/*******************************************************************************
* Copyright (c) 2006, 2008 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
*     IBM Corporation - initial API and implementation
*********************************************************************************/

// This file was generated by LPG

package org.eclipse.cdt.internal.core.dom.lrparser.c99;

import lpg.lpgjavaruntime.*;

import java.util.*;
import org.eclipse.cdt.core.dom.ast.*;
import org.eclipse.cdt.core.dom.lrparser.IParser;
import org.eclipse.cdt.core.dom.lrparser.IParserActionTokenProvider;
import org.eclipse.cdt.core.dom.lrparser.util.DebugUtil;	

import org.eclipse.cdt.core.dom.lrparser.action.ITokenMap;
import org.eclipse.cdt.core.dom.lrparser.action.TokenMap;

import org.eclipse.cdt.core.dom.lrparser.action.c99.C99ASTNodeFactory;
import org.eclipse.cdt.core.dom.lrparser.action.c99.C99BuildASTParserAction;
import org.eclipse.cdt.core.dom.lrparser.action.c99.C99TypedefTrackerParserAction;

public class C99Parser extends PrsStream implements RuleAction , IParserActionTokenProvider, IParser   
{
    private static ParseTable prs = new C99Parserprs();
    private BacktrackingParser btParser;

    public BacktrackingParser getParser() { return btParser; }
    private void setResult(Object object) { btParser.setSym1(object); }
    public Object getRhsSym(int i) { return btParser.getSym(i); }

    public int getRhsTokenIndex(int i) { return btParser.getToken(i); }
    public IToken getRhsIToken(int i) { return super.getIToken(getRhsTokenIndex(i)); }
    
    public int getRhsFirstTokenIndex(int i) { return btParser.getFirstToken(i); }
    public IToken getRhsFirstIToken(int i) { return super.getIToken(getRhsFirstTokenIndex(i)); }

    public int getRhsLastTokenIndex(int i) { return btParser.getLastToken(i); }
    public IToken getRhsLastIToken(int i) { return super.getIToken(getRhsLastTokenIndex(i)); }

    public int getLeftSpan() { return btParser.getFirstToken(); }
    public IToken getLeftIToken()  { return super.getIToken(getLeftSpan()); }

    public int getRightSpan() { return btParser.getLastToken(); }
    public IToken getRightIToken() { return super.getIToken(getRightSpan()); }

    public int getRhsErrorTokenIndex(int i)
    {
        int index = btParser.getToken(i);
        IToken err = super.getIToken(index);
        return (err instanceof ErrorToken ? index : 0);
    }
    public ErrorToken getRhsErrorIToken(int i)
    {
        int index = btParser.getToken(i);
        IToken err = super.getIToken(index);
        return (ErrorToken) (err instanceof ErrorToken ? err : null);
    }

    public C99Parser(LexStream lexStream)
    {
        super(lexStream);

        try
        {
            super.remapTerminalSymbols(orderedTerminalSymbols(), C99Parserprs.EOFT_SYMBOL);
        }
        catch(NullExportedSymbolsException e) {
        }
        catch(NullTerminalSymbolsException e) {
        }
        catch(UnimplementedTerminalsException e)
        {
            java.util.ArrayList unimplemented_symbols = e.getSymbols();
            System.out.println("The Lexer will not scan the following token(s):");
            for (int i = 0; i < unimplemented_symbols.size(); i++)
            {
                Integer id = (Integer) unimplemented_symbols.get(i);
                System.out.println("    " + C99Parsersym.orderedTerminalSymbols[id.intValue()]);               
            }
            System.out.println();                        
        }
        catch(UndefinedEofSymbolException e)
        {
            throw new Error(new UndefinedEofSymbolException
                                ("The Lexer does not implement the Eof symbol " +
                                 C99Parsersym.orderedTerminalSymbols[C99Parserprs.EOFT_SYMBOL]));
        } 
    }

    public String[] orderedTerminalSymbols() { return C99Parsersym.orderedTerminalSymbols; }
    public String getTokenKindName(int kind) { return C99Parsersym.orderedTerminalSymbols[kind]; }
    public int getEOFTokenKind() { return C99Parserprs.EOFT_SYMBOL; }
    public PrsStream getParseStream() { return (PrsStream) this; }
    
    //
    // Report error message for given error_token.
    //
    public final void reportErrorTokenMessage(int error_token, String msg)
    {
        int firsttok = super.getFirstErrorToken(error_token),
            lasttok = super.getLastErrorToken(error_token);
        String location = super.getFileName() + ':' +
                          (firsttok > lasttok
                                    ? (super.getEndLine(lasttok) + ":" + super.getEndColumn(lasttok))
                                    : (super.getLine(error_token) + ":" +
                                       super.getColumn(error_token) + ":" +
                                       super.getEndLine(error_token) + ":" +
                                       super.getEndColumn(error_token)))
                          + ": ";
        super.reportError((firsttok > lasttok ? ParseErrorCodes.INSERTION_CODE : ParseErrorCodes.SUBSTITUTION_CODE), location, msg);
    }

    public Object parser()
    {
        return parser(null, 0);
    }
    
    public Object parser(Monitor monitor)
    {
        return parser(monitor, 0);
    }
    
    public Object parser(int error_repair_count)
    {
        return parser(null, error_repair_count);
    }

    public Object parser(Monitor monitor, int error_repair_count)
    {
        try
        {
            btParser = new BacktrackingParser(monitor, (TokenStream) this, prs, (RuleAction) this);
        }
        catch (NotBacktrackParseTableException e)
        {
            throw new Error(new NotBacktrackParseTableException
                                ("Regenerate C99Parserprs.java with -BACKTRACK option"));
        }
        catch (BadParseSymFileException e)
        {
            throw new Error(new BadParseSymFileException("Bad Parser Symbol File -- C99Parsersym.java"));
        }

        try
        {
            return (Object) btParser.parse(error_repair_count);
        }
        catch (BadParseException e)
        {
            reset(e.error_token); // point to error token
            DiagnoseParser diagnoseParser = new DiagnoseParser(this, prs);
            diagnoseParser.diagnose(e.error_token);
        }

        return null;
    }


private  C99BuildASTParserAction  action;

public C99Parser() {  // constructor
}

private void initActions(IASTTranslationUnit tu) {
	action = new  C99BuildASTParserAction ( C99ASTNodeFactory.DEFAULT_INSTANCE , this, tu);
	action.setTokenMap(C99Parsersym.orderedTerminalSymbols);
}


public void addToken(IToken token) {
	token.setKind(mapKind(token.getKind())); // TODO does mapKind need to be called?
	super.addToken(token);
}


public IASTCompletionNode parse(IASTTranslationUnit tu) {
	// this has to be done, or... kaboom!
	setStreamLength(getSize());
	initActions(tu);
	
	final int errorRepairCount = -1;  // -1 means full error handling
	parser(null, errorRepairCount); // do the actual parse
	super.resetTokenStream(); // allow tokens to be garbage collected

	// the completion node may be null
	IASTCompletionNode compNode = action.getASTCompletionNode();

	//action = null;
	//parserAction = null;
	return compNode;
}

// uncomment this method to use with backtracking parser
public List getRuleTokens() {
    return Collections.unmodifiableList(getTokens().subList(getLeftSpan(), getRightSpan() + 1));
}


public IASTNode getSecondaryParseResult() {
	return  action.getSecondaryParseResult();
}



private ITokenMap tokenMap = null;

public void setTokens(List<IToken> tokens) {
	resetTokenStream();
	addToken(new Token(null, 0, 0, 0)); // dummy token
	for(IToken token : tokens) {
		token.setKind(tokenMap.mapKind(token.getKind()));
		addToken(token);
	}
	addToken(new Token(null, 0, 0, C99Parsersym.TK_EOF_TOKEN));
}

public C99Parser(String[] mapFrom) {  // constructor
	tokenMap = new TokenMap(C99Parsersym.orderedTerminalSymbols, mapFrom);
}	



    public void ruleAction(int ruleNumber)
    {
        switch (ruleNumber)
        {
  
            //
            // Rule 1:  <openscope-ast> ::= $Empty
            //
            case 1: { action.   openASTScope();             break;
            }  
  
            //
            // Rule 10:  literal ::= integer
            //
            case 10: { action.   consumeExpressionLiteral(IASTLiteralExpression.lk_integer_constant);            break;
            }  
  
            //
            // Rule 11:  literal ::= floating
            //
            case 11: { action.   consumeExpressionLiteral(IASTLiteralExpression.lk_float_constant);             break;
            }  
  
            //
            // Rule 12:  literal ::= charconst
            //
            case 12: { action.   consumeExpressionLiteral(IASTLiteralExpression.lk_char_constant);              break;
            }  
  
            //
            // Rule 13:  literal ::= stringlit
            //
            case 13: { action.   consumeExpressionLiteral(IASTLiteralExpression.lk_string_literal);             break;
            }  
  
            //
            // Rule 15:  primary_expression ::= primary_expression_id
            //
            case 15: { action.   consumeExpressionID();             break;
            }  
  
            //
            // Rule 16:  primary_expression ::= ( expression )
            //
            case 16: { action.   consumeExpressionBracketed();             break;
            }  
  
            //
            // Rule 20:  postfix_expression ::= postfix_expression [ expression ]
            //
            case 20: { action.   consumeExpressionArraySubscript();             break;
            }  
  
            //
            // Rule 21:  postfix_expression ::= postfix_expression ( expression_list_opt )
            //
            case 21: { action.   consumeExpressionFunctionCall();             break;
            }  
  
            //
            // Rule 22:  postfix_expression ::= postfix_expression . member_name
            //
            case 22: { action.   consumeExpressionFieldReference(false);             break;
            }  
  
            //
            // Rule 23:  postfix_expression ::= postfix_expression -> member_name
            //
            case 23: { action.   consumeExpressionFieldReference(true);             break;
            }  
  
            //
            // Rule 24:  postfix_expression ::= postfix_expression ++
            //
            case 24: { action.    consumeExpressionUnaryOperator(IASTUnaryExpression.op_postFixIncr);             break;
            }  
  
            //
            // Rule 25:  postfix_expression ::= postfix_expression --
            //
            case 25: { action.   consumeExpressionUnaryOperator(IASTUnaryExpression.op_postFixDecr);             break;
            }  
  
            //
            // Rule 26:  postfix_expression ::= ( type_name ) { <openscope-ast> initializer_list comma_opt }
            //
            case 26: { action.   consumeExpressionTypeIdInitializer();             break;
            }  
  
            //
            // Rule 32:  unary_expression ::= ++ unary_expression
            //
            case 32: { action.   consumeExpressionUnaryOperator(IASTUnaryExpression.op_prefixIncr);             break;
            }  
  
            //
            // Rule 33:  unary_expression ::= -- unary_expression
            //
            case 33: { action.   consumeExpressionUnaryOperator(IASTUnaryExpression.op_prefixDecr);             break;
            }  
  
            //
            // Rule 34:  unary_expression ::= & cast_expression
            //
            case 34: { action.   consumeExpressionUnaryOperator(IASTUnaryExpression.op_amper);             break;
            }  
  
            //
            // Rule 35:  unary_expression ::= * cast_expression
            //
            case 35: { action.   consumeExpressionUnaryOperator(IASTUnaryExpression.op_star);             break;
            }  
  
            //
            // Rule 36:  unary_expression ::= + cast_expression
            //
            case 36: { action.   consumeExpressionUnaryOperator(IASTUnaryExpression.op_plus);             break;
            }  
  
            //
            // Rule 37:  unary_expression ::= - cast_expression
            //
            case 37: { action.   consumeExpressionUnaryOperator(IASTUnaryExpression.op_minus);             break;
            }  
  
            //
            // Rule 38:  unary_expression ::= ~ cast_expression
            //
            case 38: { action.   consumeExpressionUnaryOperator(IASTUnaryExpression.op_tilde);             break;
            }  
  
            //
            // Rule 39:  unary_expression ::= ! cast_expression
            //
            case 39: { action.   consumeExpressionUnaryOperator(IASTUnaryExpression.op_not);             break;
            }  
  
            //
            // Rule 40:  unary_expression ::= sizeof unary_expression
            //
            case 40: { action.   consumeExpressionUnaryOperator(IASTUnaryExpression.op_sizeof);             break;
            }  
  
            //
            // Rule 41:  unary_expression ::= sizeof ( type_name )
            //
            case 41: { action.   consumeExpressionSizeofTypeId();             break;
            }  
  
            //
            // Rule 43:  cast_expression ::= ( type_name ) cast_expression
            //
            case 43: { action.   consumeExpressionCast(IASTCastExpression.op_cast);             break;
            }  
  
            //
            // Rule 45:  multiplicative_expression ::= multiplicative_expression * cast_expression
            //
            case 45: { action.   consumeExpressionBinaryOperator(IASTBinaryExpression.op_multiply);             break;
            }  
  
            //
            // Rule 46:  multiplicative_expression ::= multiplicative_expression / cast_expression
            //
            case 46: { action.   consumeExpressionBinaryOperator(IASTBinaryExpression.op_divide);             break;
            }  
  
            //
            // Rule 47:  multiplicative_expression ::= multiplicative_expression % cast_expression
            //
            case 47: { action.   consumeExpressionBinaryOperator(IASTBinaryExpression.op_modulo);             break;
            }  
  
            //
            // Rule 49:  additive_expression ::= additive_expression + multiplicative_expression
            //
            case 49: { action.   consumeExpressionBinaryOperator(IASTBinaryExpression.op_plus);             break;
            }  
  
            //
            // Rule 50:  additive_expression ::= additive_expression - multiplicative_expression
            //
            case 50: { action.   consumeExpressionBinaryOperator(IASTBinaryExpression.op_minus);             break;
            }  
  
            //
            // Rule 52:  shift_expression ::= shift_expression << additive_expression
            //
            case 52: { action.   consumeExpressionBinaryOperator(IASTBinaryExpression.op_shiftLeft);             break;
            }  
  
            //
            // Rule 53:  shift_expression ::= shift_expression >> additive_expression
            //
            case 53: { action.   consumeExpressionBinaryOperator(IASTBinaryExpression.op_shiftRight);             break;
            }  
  
            //
            // Rule 55:  relational_expression ::= relational_expression < shift_expression
            //
            case 55: { action.   consumeExpressionBinaryOperator(IASTBinaryExpression.op_lessThan);             break;
            }  
  
            //
            // Rule 56:  relational_expression ::= relational_expression > shift_expression
            //
            case 56: { action.   consumeExpressionBinaryOperator(IASTBinaryExpression.op_greaterThan);             break;
            }  
  
            //
            // Rule 57:  relational_expression ::= relational_expression <= shift_expression
            //
            case 57: { action.   consumeExpressionBinaryOperator(IASTBinaryExpression.op_lessEqual);             break;
            }  
  
            //
            // Rule 58:  relational_expression ::= relational_expression >= shift_expression
            //
            case 58: { action.   consumeExpressionBinaryOperator(IASTBinaryExpression.op_greaterEqual);             break;
            }  
  
            //
            // Rule 60:  equality_expression ::= equality_expression == relational_expression
            //
            case 60: { action.   consumeExpressionBinaryOperator(IASTBinaryExpression.op_equals);             break;
            }  
  
            //
            // Rule 61:  equality_expression ::= equality_expression != relational_expression
            //
            case 61: { action.   consumeExpressionBinaryOperator(IASTBinaryExpression.op_notequals);             break;
            }  
  
            //
            // Rule 63:  AND_expression ::= AND_expression & equality_expression
            //
            case 63: { action.   consumeExpressionBinaryOperator(IASTBinaryExpression.op_binaryAnd);             break;
            }  
  
            //
            // Rule 65:  exclusive_OR_expression ::= exclusive_OR_expression ^ AND_expression
            //
            case 65: { action.   consumeExpressionBinaryOperator(IASTBinaryExpression.op_binaryXor);             break;
            }  
  
            //
            // Rule 67:  inclusive_OR_expression ::= inclusive_OR_expression | exclusive_OR_expression
            //
            case 67: { action.   consumeExpressionBinaryOperator(IASTBinaryExpression.op_binaryOr);             break;
            }  
  
            //
            // Rule 69:  logical_AND_expression ::= logical_AND_expression && inclusive_OR_expression
            //
            case 69: { action.   consumeExpressionBinaryOperator(IASTBinaryExpression.op_logicalAnd);             break;
            }  
  
            //
            // Rule 71:  logical_OR_expression ::= logical_OR_expression || logical_AND_expression
            //
            case 71: { action.   consumeExpressionBinaryOperator(IASTBinaryExpression.op_logicalOr);             break;
            }  
  
            //
            // Rule 73:  conditional_expression ::= logical_OR_expression ? expression : conditional_expression
            //
            case 73: { action.   consumeExpressionConditional();             break;
            }  
  
            //
            // Rule 75:  assignment_expression ::= unary_expression = assignment_expression
            //
            case 75: { action.   consumeExpressionBinaryOperator(IASTBinaryExpression.op_assign);             break;
            }  
  
            //
            // Rule 76:  assignment_expression ::= unary_expression *= assignment_expression
            //
            case 76: { action.   consumeExpressionBinaryOperator(IASTBinaryExpression.op_multiplyAssign);             break;
            }  
  
            //
            // Rule 77:  assignment_expression ::= unary_expression /= assignment_expression
            //
            case 77: { action.   consumeExpressionBinaryOperator(IASTBinaryExpression.op_divideAssign);             break;
            }  
  
            //
            // Rule 78:  assignment_expression ::= unary_expression %= assignment_expression
            //
            case 78: { action.   consumeExpressionBinaryOperator(IASTBinaryExpression.op_moduloAssign);             break;
            }  
  
            //
            // Rule 79:  assignment_expression ::= unary_expression += assignment_expression
            //
            case 79: { action.   consumeExpressionBinaryOperator(IASTBinaryExpression.op_plusAssign);             break;
            }  
  
            //
            // Rule 80:  assignment_expression ::= unary_expression -= assignment_expression
            //
            case 80: { action.   consumeExpressionBinaryOperator(IASTBinaryExpression.op_minusAssign);             break;
            }  
  
            //
            // Rule 81:  assignment_expression ::= unary_expression <<= assignment_expression
            //
            case 81: { action.   consumeExpressionBinaryOperator(IASTBinaryExpression.op_shiftLeftAssign);             break;
            }  
  
            //
            // Rule 82:  assignment_expression ::= unary_expression >>= assignment_expression
            //
            case 82: { action.   consumeExpressionBinaryOperator(IASTBinaryExpression.op_shiftRightAssign);             break;
            }  
  
            //
            // Rule 83:  assignment_expression ::= unary_expression &= assignment_expression
            //
            case 83: { action.   consumeExpressionBinaryOperator(IASTBinaryExpression.op_binaryAndAssign);             break;
            }  
  
            //
            // Rule 84:  assignment_expression ::= unary_expression ^= assignment_expression
            //
            case 84: { action.   consumeExpressionBinaryOperator(IASTBinaryExpression.op_binaryXorAssign);             break;
            }  
  
            //
            // Rule 85:  assignment_expression ::= unary_expression |= assignment_expression
            //
            case 85: { action.   consumeExpressionBinaryOperator(IASTBinaryExpression.op_binaryOrAssign);             break;
            }  
  
            //
            // Rule 88:  expression_list ::= <openscope-ast> expression_list_actual
            //
            case 88: { action.   consumeExpressionList();             break;
            }  
  
            //
            // Rule 90:  expression_list_opt ::= $Empty
            //
            case 90: { action.   consumeEmpty();             break;
            }  
  
            //
            // Rule 100:  statement ::= ERROR_TOKEN
            //
            case 100: { action.   consumeStatementProblem();             break;
            }  
  
            //
            // Rule 101:  labeled_statement ::= identifier_or_typedefname : statement
            //
            case 101: { action.   consumeStatementLabeled();             break;
            }  
  
            //
            // Rule 102:  labeled_statement ::= case constant_expression :
            //
            case 102: { action.   consumeStatementCase();             break;
            }  
  
            //
            // Rule 103:  labeled_statement ::= default :
            //
            case 103: { action.   consumeStatementDefault();             break;
            }  
  
            //
            // Rule 104:  compound_statement ::= { }
            //
            case 104: { action.   consumeStatementCompoundStatement(false);             break;
            }  
  
            //
            // Rule 105:  compound_statement ::= { <openscope-ast> block_item_list }
            //
            case 105: { action.   consumeStatementCompoundStatement(true);             break;
            }  
  
            //
            // Rule 109:  block_item ::= declaration
            //
            case 109: { action.   consumeStatementDeclaration();             break;
            }  
  
            //
            // Rule 110:  expression_statement ::= ;
            //
            case 110: { action.   consumeStatementNull();             break;
            }  
  
            //
            // Rule 111:  expression_statement ::= expression_in_statement ;
            //
            case 111: { action.   consumeStatementExpression();             break;
            }  
  
            //
            // Rule 112:  selection_statement ::= if ( expression ) statement
            //
            case 112: { action.   consumeStatementIf(false);             break;
            }  
  
            //
            // Rule 113:  selection_statement ::= if ( expression ) statement else statement
            //
            case 113: { action.   consumeStatementIf(true);             break;
            }  
  
            //
            // Rule 114:  selection_statement ::= switch ( expression ) statement
            //
            case 114: { action.   consumeStatementSwitch();             break;
            }  
  
            //
            // Rule 116:  expression_opt ::= $Empty
            //
            case 116: { action.   consumeEmpty();             break;
            }  
  
            //
            // Rule 117:  iteration_statement ::= do statement while ( expression ) ;
            //
            case 117: { action.   consumeStatementDoLoop();             break;
            }  
  
            //
            // Rule 118:  iteration_statement ::= while ( expression ) statement
            //
            case 118: { action.   consumeStatementWhileLoop();             break;
            }  
  
            //
            // Rule 119:  iteration_statement ::= for ( expression_opt ; expression_opt ; expression_opt ) statement
            //
            case 119: { action.   consumeStatementForLoop();             break;
            }  
  
            //
            // Rule 120:  iteration_statement ::= for ( declaration expression_opt ; expression_opt ) statement
            //
            case 120: { action.   consumeStatementForLoop();             break;
            }  
  
            //
            // Rule 121:  jump_statement ::= goto identifier_or_typedefname ;
            //
            case 121: { action.   consumeStatementGoto();             break;
            }  
  
            //
            // Rule 122:  jump_statement ::= continue ;
            //
            case 122: { action.   consumeStatementContinue();             break;
            }  
  
            //
            // Rule 123:  jump_statement ::= break ;
            //
            case 123: { action.   consumeStatementBreak();             break;
            }  
  
            //
            // Rule 124:  jump_statement ::= return ;
            //
            case 124: { action.   consumeStatementReturn(false);             break;
            }  
  
            //
            // Rule 125:  jump_statement ::= return expression ;
            //
            case 125: { action.   consumeStatementReturn(true);             break;
            }  
  
            //
            // Rule 126:  declaration ::= declaration_specifiers ;
            //
            case 126: { action.   consumeDeclarationSimple(false);             break;
            }  
  
            //
            // Rule 127:  declaration ::= declaration_specifiers <openscope-ast> init_declarator_list ;
            //
            case 127: { action.   consumeDeclarationSimple(true);             break;
            }  
  
            //
            // Rule 128:  declaration_specifiers ::= <openscope-ast> simple_declaration_specifiers
            //
            case 128: { action.   consumeDeclarationSpecifiersSimple();             break;
            }  
  
            //
            // Rule 129:  declaration_specifiers ::= <openscope-ast> struct_or_union_declaration_specifiers
            //
            case 129: { action.   consumeDeclarationSpecifiersStructUnionEnum();             break;
            }  
  
            //
            // Rule 130:  declaration_specifiers ::= <openscope-ast> elaborated_declaration_specifiers
            //
            case 130: { action.   consumeDeclarationSpecifiersStructUnionEnum();             break;
            }  
  
            //
            // Rule 131:  declaration_specifiers ::= <openscope-ast> enum_declaration_specifiers
            //
            case 131: { action.   consumeDeclarationSpecifiersStructUnionEnum();             break;
            }  
  
            //
            // Rule 132:  declaration_specifiers ::= <openscope-ast> typdef_name_declaration_specifiers
            //
            case 132: { action.   consumeDeclarationSpecifiersTypedefName();             break;
            }  
  
            //
            // Rule 157:  init_declarator ::= complete_declarator = initializer
            //
            case 157: { action.   consumeDeclaratorWithInitializer(true);             break;
            }  
  
            //
            // Rule 159:  storage_class_specifier ::= storage_class_specifier_token
            //
            case 159: { action.   consumeDeclSpecToken();             break;
            }  
  
            //
            // Rule 165:  simple_type_specifier ::= simple_type_specifier_token
            //
            case 165: { action.   consumeDeclSpecToken();             break;
            }  
  
            //
            // Rule 178:  typedef_name_in_declspec ::= Completion
            //
            case 178: { action.   consumeDeclSpecToken();             break;
            }  
  
            //
            // Rule 179:  typedef_name_in_declspec ::= identifier
            //
            case 179: { action.   consumeDeclSpecToken();             break;
            }  
  
            //
            // Rule 182:  struct_or_union_specifier ::= struct { <openscope-ast> struct_declaration_list_opt }
            //
            case 182: { action.   consumeTypeSpecifierComposite(false, IASTCompositeTypeSpecifier.k_struct);            break;
            }  
  
            //
            // Rule 183:  struct_or_union_specifier ::= union { <openscope-ast> struct_declaration_list_opt }
            //
            case 183: { action.   consumeTypeSpecifierComposite(false, IASTCompositeTypeSpecifier.k_union);            break;
            }  
  
            //
            // Rule 184:  struct_or_union_specifier ::= struct identifier_or_typedefname { <openscope-ast> struct_declaration_list_opt }
            //
            case 184: { action.   consumeTypeSpecifierComposite(true, IASTCompositeTypeSpecifier.k_struct);            break;
            }  
  
            //
            // Rule 185:  struct_or_union_specifier ::= union identifier_or_typedefname { <openscope-ast> struct_declaration_list_opt }
            //
            case 185: { action.   consumeTypeSpecifierComposite(true, IASTCompositeTypeSpecifier.k_union);            break;
            }  
  
            //
            // Rule 186:  elaborated_specifier ::= struct identifier_or_typedefname
            //
            case 186: { action.   consumeTypeSpecifierElaborated(IASTCompositeTypeSpecifier.k_struct);            break;
            }  
  
            //
            // Rule 187:  elaborated_specifier ::= union identifier_or_typedefname
            //
            case 187: { action.   consumeTypeSpecifierElaborated(IASTCompositeTypeSpecifier.k_union);            break;
            }  
  
            //
            // Rule 188:  elaborated_specifier ::= enum identifier_or_typedefname
            //
            case 188: { action.   consumeTypeSpecifierElaborated(IASTElaboratedTypeSpecifier.k_enum);            break;
            }  
  
            //
            // Rule 193:  struct_declaration ::= specifier_qualifier_list <openscope-ast> struct_declarator_list ;
            //
            case 193: { action.   consumeStructDeclaration(true);             break;
            }  
  
            //
            // Rule 194:  struct_declaration ::= specifier_qualifier_list ;
            //
            case 194: { action.   consumeStructDeclaration(false);             break;
            }  
  
            //
            // Rule 195:  struct_declaration ::= ERROR_TOKEN
            //
            case 195: { action.   consumeDeclarationProblem();             break;
            }  
  
            //
            // Rule 201:  struct_declarator ::= : constant_expression
            //
            case 201: { action.   consumeBitField(false);             break;
            }  
  
            //
            // Rule 202:  struct_declarator ::= declarator : constant_expression
            //
            case 202: { action.   consumeBitField(true);             break;
            }  
  
            //
            // Rule 203:  enum_specifier ::= enum { <openscope-ast> enumerator_list_opt comma_opt }
            //
            case 203: { action.   consumeTypeSpecifierEnumeration(false);            break;
            }  
  
            //
            // Rule 204:  enum_specifier ::= enum identifier_or_typedefname { <openscope-ast> enumerator_list_opt comma_opt }
            //
            case 204: { action.   consumeTypeSpecifierEnumeration(true);            break;
            }  
  
            //
            // Rule 209:  enumerator ::= identifier_or_typedefname
            //
            case 209: { action.   consumeEnumerator(false);            break;
            }  
  
            //
            // Rule 210:  enumerator ::= identifier_or_typedefname = constant_expression
            //
            case 210: { action.   consumeEnumerator(true);            break;
            }  
  
            //
            // Rule 211:  type_qualifier ::= type_qualifier_token
            //
            case 211: { action.   consumeDeclSpecToken();             break;
            }  
  
            //
            // Rule 215:  function_specifier ::= inline
            //
            case 215: { action.   consumeDeclSpecToken();             break;
            }  
  
            //
            // Rule 217:  declarator ::= <openscope-ast> pointer_seq direct_declarator
            //
            case 217: { action.   consumeDeclaratorWithPointer(true);             break;
            }  
  
            //
            // Rule 222:  basic_direct_declarator ::= declarator_id_name
            //
            case 222: { action.   consumeDirectDeclaratorIdentifier();             break;
            }  
  
            //
            // Rule 223:  basic_direct_declarator ::= ( declarator )
            //
            case 223: { action.   consumeDirectDeclaratorBracketed();             break;
            }  
  
            //
            // Rule 224:  declarator_id_name ::= identifier
            //
            case 224: { action.   consumeIdentifierName();             break;
            }  
  
            //
            // Rule 225:  array_direct_declarator ::= basic_direct_declarator array_modifier
            //
            case 225: { action.   consumeDirectDeclaratorArrayDeclarator(true);             break;
            }  
  
            //
            // Rule 226:  array_direct_declarator ::= array_direct_declarator array_modifier
            //
            case 226: { action.   consumeDirectDeclaratorArrayDeclarator(true);             break;
            }  
  
            //
            // Rule 228:  function_direct_declarator ::= basic_direct_declarator ( <openscope-ast> parameter_type_list )
            //
            case 228: { action.   consumeDirectDeclaratorFunctionDeclarator(true, true);             break;
            }  
  
            //
            // Rule 229:  function_direct_declarator ::= basic_direct_declarator ( )
            //
            case 229: { action.   consumeDirectDeclaratorFunctionDeclarator(true, false);             break;
            }  
  
            //
            // Rule 231:  function_declarator ::= <openscope-ast> pointer_seq function_direct_declarator
            //
            case 231: { action.   consumeDeclaratorWithPointer(true);             break;
            }  
  
            //
            // Rule 232:  knr_direct_declarator ::= basic_direct_declarator ( <openscope-ast> identifier_list )
            //
            case 232: { action.   consumeDirectDeclaratorFunctionDeclaratorKnR();             break;
            }  
  
            //
            // Rule 234:  knr_function_declarator ::= <openscope-ast> pointer_seq knr_direct_declarator
            //
            case 234: { action.   consumeDeclaratorWithPointer(true);             break;
            }  
  
            //
            // Rule 235:  identifier_list ::= identifier
            //
            case 235: { action.   consumeIdentifierKnR();             break;
            }  
  
            //
            // Rule 236:  identifier_list ::= identifier_list , identifier
            //
            case 236: { action.   consumeIdentifierKnR();             break;
            }  
  
            //
            // Rule 237:  array_modifier ::= [ ]
            //
            case 237: { action.   consumeDirectDeclaratorArrayModifier(false);             break;
            }  
  
            //
            // Rule 238:  array_modifier ::= [ <openscope-ast> array_modifier_type_qualifiers ]
            //
            case 238: { action.   consumeDirectDeclaratorModifiedArrayModifier(false, false, true, false);             break;
            }  
  
            //
            // Rule 239:  array_modifier ::= [ assignment_expression ]
            //
            case 239: { action.   consumeDirectDeclaratorArrayModifier(true);             break;
            }  
  
            //
            // Rule 240:  array_modifier ::= [ <openscope-ast> array_modifier_type_qualifiers assignment_expression ]
            //
            case 240: { action.   consumeDirectDeclaratorModifiedArrayModifier(false, false, true, true);             break;
            }  
  
            //
            // Rule 241:  array_modifier ::= [ static assignment_expression ]
            //
            case 241: { action.   consumeDirectDeclaratorModifiedArrayModifier(true, false, false, true);             break;
            }  
  
            //
            // Rule 242:  array_modifier ::= [ static <openscope-ast> array_modifier_type_qualifiers assignment_expression ]
            //
            case 242: { action.   consumeDirectDeclaratorModifiedArrayModifier(true, false, true, true);             break;
            }  
  
            //
            // Rule 243:  array_modifier ::= [ <openscope-ast> array_modifier_type_qualifiers static assignment_expression ]
            //
            case 243: { action.   consumeDirectDeclaratorModifiedArrayModifier(true, false, true, true);             break;
            }  
  
            //
            // Rule 244:  array_modifier ::= [ * ]
            //
            case 244: { action.   consumeDirectDeclaratorModifiedArrayModifier(false, true, false, false);             break;
            }  
  
            //
            // Rule 245:  array_modifier ::= [ <openscope-ast> array_modifier_type_qualifiers * ]
            //
            case 245: { action.   consumeDirectDeclaratorModifiedArrayModifier(false, true, true, false);             break;
            }  
  
            //
            // Rule 247:  pointer_seq ::= *
            //
            case 247: { action.   consumePointer();             break;
            }  
  
            //
            // Rule 248:  pointer_seq ::= pointer_seq *
            //
            case 248: { action.   consumePointer();             break;
            }  
  
            //
            // Rule 249:  pointer_seq ::= * <openscope-ast> type_qualifier_list
            //
            case 249: { action.   consumePointerTypeQualifierList();             break;
            }  
  
            //
            // Rule 250:  pointer_seq ::= pointer_seq * <openscope-ast> type_qualifier_list
            //
            case 250: { action.   consumePointerTypeQualifierList();             break;
            }  
  
            //
            // Rule 253:  parameter_type_list ::= parameter_list
            //
            case 253: { action.   consumeEmpty();             break;
            }  
  
            //
            // Rule 254:  parameter_type_list ::= parameter_list , ...
            //
            case 254: { action.   consumePlaceHolder();             break;
            }  
  
            //
            // Rule 255:  parameter_type_list ::= ...
            //
            case 255: { action.   consumePlaceHolder();             break;
            }  
  
            //
            // Rule 258:  parameter_declaration ::= declaration_specifiers complete_parameter_declarator
            //
            case 258: { action.   consumeParameterDeclaration();             break;
            }  
  
            //
            // Rule 259:  parameter_declaration ::= declaration_specifiers
            //
            case 259: { action.   consumeParameterDeclarationWithoutDeclarator();             break;
            }  
  
            //
            // Rule 262:  type_name ::= specifier_qualifier_list
            //
            case 262: { action.   consumeTypeId(false);             break;
            }  
  
            //
            // Rule 263:  type_name ::= specifier_qualifier_list abstract_declarator
            //
            case 263: { action.   consumeTypeId(true);             break;
            }  
  
            //
            // Rule 265:  abstract_declarator ::= <openscope-ast> pointer_seq
            //
            case 265: { action.   consumeDeclaratorWithPointer(false);             break;
            }  
  
            //
            // Rule 266:  abstract_declarator ::= <openscope-ast> pointer_seq direct_abstract_declarator
            //
            case 266: { action.   consumeDeclaratorWithPointer(false);             break;
            }  
  
            //
            // Rule 270:  basic_direct_abstract_declarator ::= ( abstract_declarator )
            //
            case 270: { action.   consumeDirectDeclaratorBracketed();             break;
            }  
  
            //
            // Rule 271:  array_direct_abstract_declarator ::= array_modifier
            //
            case 271: { action.   consumeDirectDeclaratorArrayDeclarator(false);             break;
            }  
  
            //
            // Rule 272:  array_direct_abstract_declarator ::= array_direct_abstract_declarator array_modifier
            //
            case 272: { action.   consumeDirectDeclaratorArrayDeclarator(true);             break;
            }  
  
            //
            // Rule 273:  array_direct_abstract_declarator ::= basic_direct_abstract_declarator array_modifier
            //
            case 273: { action.   consumeDirectDeclaratorArrayDeclarator(true);             break;
            }  
  
            //
            // Rule 274:  function_direct_abstract_declarator ::= ( )
            //
            case 274: { action.   consumeDirectDeclaratorFunctionDeclarator(false, false);             break;
            }   
  
            //
            // Rule 275:  function_direct_abstract_declarator ::= basic_direct_abstract_declarator ( )
            //
            case 275: { action.   consumeDirectDeclaratorFunctionDeclarator(true, false);             break;
            }  
  
            //
            // Rule 276:  function_direct_abstract_declarator ::= ( <openscope-ast> parameter_type_list )
            //
            case 276: { action.   consumeDirectDeclaratorFunctionDeclarator(false, true);             break;
            }  
  
            //
            // Rule 277:  function_direct_abstract_declarator ::= basic_direct_abstract_declarator ( <openscope-ast> parameter_type_list )
            //
            case 277: { action.   consumeDirectDeclaratorFunctionDeclarator(true, true);             break;
            }  
  
            //
            // Rule 278:  initializer ::= assignment_expression
            //
            case 278: { action.   consumeInitializer();             break;
            }  
  
            //
            // Rule 279:  initializer ::= { <openscope-ast> initializer_list comma_opt }
            //
            case 279: { action.   consumeInitializerList();             break;
            }  
  
            //
            // Rule 284:  designated_initializer ::= <openscope-ast> designation = initializer
            //
            case 284: { action.   consumeInitializerDesignated();             break;
            }  
  
            //
            // Rule 288:  designator_base ::= [ constant_expression ]
            //
            case 288: { action.   consumeDesignatorArray();             break;
            }  
  
            //
            // Rule 289:  designator_base ::= . identifier_or_typedefname
            //
            case 289: { action.   consumeDesignatorField();             break;
            }  
  
            //
            // Rule 290:  designator ::= [ constant_expression ]
            //
            case 290: { action.   consumeDesignatorArray();             break;
            }  
  
            //
            // Rule 291:  designator ::= . identifier_or_typedefname
            //
            case 291: { action.   consumeDesignatorField();             break;
            }  
  
            //
            // Rule 292:  translation_unit ::= external_declaration_list
            //
            case 292: { action.   consumeTranslationUnit();             break;
            }   
  
            //
            // Rule 293:  translation_unit ::= $Empty
            //
            case 293: { action.   consumeTranslationUnit();             break;
            }  
  
            //
            // Rule 298:  external_declaration ::= ;
            //
            case 298: { action.   consumeDeclarationEmpty();             break;
            }  
  
            //
            // Rule 299:  external_declaration ::= ERROR_TOKEN
            //
            case 299: { action.   consumeDeclarationProblem();             break;
            }  
  
            //
            // Rule 302:  function_definition ::= declaration_specifiers <openscope-ast> function_declarator function_body
            //
            case 302: { action.   consumeFunctionDefinition(true);             break;
            }  
  
            //
            // Rule 303:  function_definition ::= <openscope-ast> function_declarator function_body
            //
            case 303: { action.   consumeFunctionDefinition(false);             break;
            }  
  
            //
            // Rule 304:  function_definition ::= declaration_specifiers <openscope-ast> knr_function_declarator <openscope-ast> declaration_list compound_statement
            //
            case 304: { action.   consumeFunctionDefinitionKnR();             break;
            }  
  
            //
            // Rule 305:  function_body ::= { }
            //
            case 305: { action.   consumeStatementCompoundStatement(false);             break;
            }  
  
            //
            // Rule 306:  function_body ::= { <openscope-ast> block_item_list }
            //
            case 306: { action.   consumeStatementCompoundStatement(true);             break;
            }  

    
            default:
                break;
        }
        return;
    }
}

