1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-22 06:02:11 +02:00

added support for nested functions GNU extension to LR parser, added tests suites

This commit is contained in:
Mike Kucera 2009-04-01 15:03:01 +00:00
parent b813ee9976
commit ba9a7cbcfd
26 changed files with 5728 additions and 5518 deletions

View file

@ -0,0 +1,53 @@
/*******************************************************************************
* Copyright (c) 2009 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
*******************************************************************************/
package org.eclipse.cdt.core.lrparser.tests;
import junit.framework.TestSuite;
import org.eclipse.cdt.core.dom.ast.IASTTranslationUnit;
import org.eclipse.cdt.core.dom.lrparser.gnu.GCCLanguage;
import org.eclipse.cdt.core.dom.lrparser.gnu.GPPLanguage;
import org.eclipse.cdt.core.model.ILanguage;
import org.eclipse.cdt.core.parser.ParserLanguage;
import org.eclipse.cdt.core.parser.tests.ast2.AST2CPPImplicitNameTests;
public class LRCPPImplicitNameTests extends AST2CPPImplicitNameTests {
public static TestSuite suite() {
return suite(LRCPPImplicitNameTests.class);
}
public LRCPPImplicitNameTests() {
}
public LRCPPImplicitNameTests(String name) {
super(name);
}
@Override
protected IASTTranslationUnit parse( String code, ParserLanguage lang, @SuppressWarnings("unused") boolean useGNUExtensions, boolean expectNoProblems, boolean skipTrivialInitializers) {
ILanguage language = lang.isCPP() ? getCPPLanguage() : getCLanguage();
ParseHelper.Options options = new ParseHelper.Options();
options.setCheckSyntaxProblems(expectNoProblems);
options.setCheckPreprocessorProblems(expectNoProblems);
options.setSkipTrivialInitializers(skipTrivialInitializers);
return ParseHelper.parse(code, language, options);
}
protected ILanguage getCLanguage() {
return GCCLanguage.getDefault();
}
protected ILanguage getCPPLanguage() {
return GPPLanguage.getDefault();
}
}

View file

@ -43,7 +43,7 @@ import org.eclipse.cdt.core.model.ILanguage;
public class LRDigraphTrigraphTests extends TestCase { public class LRDigraphTrigraphTests extends TestCase {
public static TestSuite suite() { public static TestSuite suite() {
return new TestSuite(LRCSpecTests.class); return new TestSuite(LRDigraphTrigraphTests.class);
} }

View file

@ -0,0 +1,51 @@
/*******************************************************************************
* 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
*******************************************************************************/
package org.eclipse.cdt.core.lrparser.tests;
import junit.framework.TestSuite;
import org.eclipse.cdt.core.dom.ast.IASTTranslationUnit;
import org.eclipse.cdt.core.dom.lrparser.gnu.GCCLanguage;
import org.eclipse.cdt.core.dom.lrparser.gnu.GPPLanguage;
import org.eclipse.cdt.core.model.ILanguage;
import org.eclipse.cdt.core.parser.ParserLanguage;
import org.eclipse.cdt.core.parser.tests.ast2.GCCCompleteParseExtensionsTest;
import org.eclipse.cdt.internal.core.parser.ParserException;
@SuppressWarnings("restriction")
public class LRGCCCompleteParseExtensionsTest extends GCCCompleteParseExtensionsTest {
public static TestSuite suite() {
return suite(LRGCCCompleteParseExtensionsTest.class);
}
public LRGCCCompleteParseExtensionsTest() {}
public LRGCCCompleteParseExtensionsTest(String name) { super(name); }
@Override
@SuppressWarnings("unused")
protected IASTTranslationUnit parse( String code, ParserLanguage lang, boolean useGNUExtensions, boolean expectNoProblems ) throws ParserException {
ILanguage language = lang.isCPP() ? getCPPLanguage() : getCLanguage();
ParseHelper.Options options = new ParseHelper.Options().setCheckSyntaxProblems(expectNoProblems).setCheckPreprocessorProblems(expectNoProblems);
return ParseHelper.parse(code, language, options);
}
protected ILanguage getCLanguage() {
return GCCLanguage.getDefault();
}
protected ILanguage getCPPLanguage() {
return GPPLanguage.getDefault();
}
}

View file

@ -0,0 +1,53 @@
/*******************************************************************************
* Copyright (c) 2009 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
*******************************************************************************/
package org.eclipse.cdt.core.lrparser.tests;
import junit.framework.TestSuite;
import org.eclipse.cdt.core.dom.ast.IASTTranslationUnit;
import org.eclipse.cdt.core.dom.lrparser.gnu.GCCLanguage;
import org.eclipse.cdt.core.dom.lrparser.gnu.GPPLanguage;
import org.eclipse.cdt.core.model.ILanguage;
import org.eclipse.cdt.core.parser.ParserLanguage;
import org.eclipse.cdt.core.parser.tests.ast2.ASTInactiveCodeTests;
public class LRInactiveCodeTests extends ASTInactiveCodeTests {
public static TestSuite suite() {
return suite(LRInactiveCodeTests.class);
}
public LRInactiveCodeTests() {
}
public LRInactiveCodeTests(String name) {
super(name);
}
@Override
protected IASTTranslationUnit parse( String code, ParserLanguage lang, @SuppressWarnings("unused") boolean useGNUExtensions, boolean expectNoProblems, boolean skipTrivialInitializers) {
ILanguage language = lang.isCPP() ? getCPPLanguage() : getCLanguage();
ParseHelper.Options options = new ParseHelper.Options();
options.setCheckSyntaxProblems(expectNoProblems);
options.setCheckPreprocessorProblems(expectNoProblems);
options.setSkipTrivialInitializers(skipTrivialInitializers);
return ParseHelper.parse(code, language, options);
}
protected ILanguage getCLanguage() {
return GCCLanguage.getDefault();
}
protected ILanguage getCPPLanguage() {
return GPPLanguage.getDefault();
}
}

View file

@ -43,6 +43,7 @@ public class LRParserTestSuite extends TestSuite {
addTest(LRDOMLocationTests.suite()); addTest(LRDOMLocationTests.suite());
addTest(LRDOMPreprocessorInformationTest.suite()); addTest(LRDOMPreprocessorInformationTest.suite());
addTest(LRGCCTests.suite()); addTest(LRGCCTests.suite());
addTest(LRGCCCompleteParseExtensionsTest.suite());
addTest(LRImageLocationTests.suite()); addTest(LRImageLocationTests.suite());
addTest(LRKnRTests.suite()); // mostly fail due to ambiguities addTest(LRKnRTests.suite()); // mostly fail due to ambiguities
addTest(LRNodeSelectorTest.suite()); addTest(LRNodeSelectorTest.suite());
@ -54,6 +55,8 @@ public class LRParserTestSuite extends TestSuite {
addTest(LRTests.suite()); // has some tests that do fail addTest(LRTests.suite()); // has some tests that do fail
addTest(LRUtilOldTests.suite()); addTest(LRUtilOldTests.suite());
addTest(LRUtilTests.suite()); addTest(LRUtilTests.suite());
addTest(LRCPPImplicitNameTests.suite());
//addTest(LRInactiveCodeTests.suite());
}}; }};
} }

View file

@ -155,4 +155,14 @@ public class LRTests extends AST2Tests {
super.testCastVsFunctionCallAmbiguities_Bug237057(); super.testCastVsFunctionCallAmbiguities_Bug237057();
} }
/* The LR parser generates the AST for switch statements
* differently than the DOM parser.
*/
@Override
public void testCaseRange_Bug211882() { }
public void _testCaseRange_Bug211882() throws Exception {
super.testCaseRange_Bug211882();
}
} }

View file

@ -979,14 +979,16 @@ declaration_list
-- to avoid a shift/reduce error with the rule for declaration. -- to avoid a shift/reduce error with the rule for declaration.
-- The symbol table scoped is opened in the rule for function_direct_declarator -- The symbol table scoped is opened in the rule for function_direct_declarator
function_definition function_definition
::= declaration_specifiers <openscope-ast> function_declarator function_body ::= normal_function_definition
/. $Build consumeFunctionDefinition(true); $EndBuild ./
-- this rule is here as a special case (its not C99 spec) just to support implicit int in function definitions -- this rule is here as a special case (its not C99 spec) just to support implicit int in function definitions
| <openscope-ast> function_declarator function_body | <openscope-ast> function_declarator function_body
/. $Build consumeFunctionDefinition(false); $EndBuild ./ /. $Build consumeFunctionDefinition(false); $EndBuild ./
| declaration_specifiers <openscope-ast> knr_function_declarator <openscope-ast> declaration_list compound_statement | declaration_specifiers <openscope-ast> knr_function_declarator <openscope-ast> declaration_list compound_statement
/. $Build consumeFunctionDefinitionKnR(); $EndBuild ./ /. $Build consumeFunctionDefinitionKnR(); $EndBuild ./
normal_function_definition
::= declaration_specifiers <openscope-ast> function_declarator function_body
/. $Build consumeFunctionDefinition(true); $EndBuild ./
-- same syntax as compound_statement but a symbol table scope isn't opened -- same syntax as compound_statement but a symbol table scope isn't opened
function_body function_body

View file

@ -103,4 +103,10 @@ designated_initializer
-- Nested functions
block_item
::= normal_function_definition
/. $Build consumeStatementDeclaration(); $EndBuild ./
$End $End

View file

@ -24,23 +24,6 @@
id="gpp" id="gpp"
name="LR GPP"> name="LR GPP">
</language> </language>
<pdomLinkageFactory
class="org.eclipse.cdt.internal.core.pdom.dom.c.PDOMCLinkageFactory"
id="c99"/>
<pdomLinkageFactory
class="org.eclipse.cdt.internal.core.pdom.dom.c.PDOMCLinkageFactory"
id="gcc"/>
<pdomLinkageFactory
class="org.eclipse.cdt.internal.core.pdom.dom.cpp.PDOMCPPLinkageFactory"
id="isocpp"/>
<pdomLinkageFactory
class="org.eclipse.cdt.internal.core.pdom.dom.cpp.PDOMCPPLinkageFactory"
id="gpp"/>
</extension> </extension>
</plugin> </plugin>

View file

@ -17,17 +17,17 @@ import lpg.lpgjavaruntime.*;
import java.util.*; import java.util.*;
import org.eclipse.cdt.core.dom.ast.*; import org.eclipse.cdt.core.dom.ast.*;
import org.eclipse.cdt.core.dom.lrparser.CPreprocessorAdapter;
import org.eclipse.cdt.core.dom.lrparser.IDOMTokenMap; import org.eclipse.cdt.core.dom.lrparser.IDOMTokenMap;
import org.eclipse.cdt.core.dom.lrparser.IParser; import org.eclipse.cdt.core.dom.lrparser.IParser;
import org.eclipse.cdt.core.dom.lrparser.ITokenCollector; import org.eclipse.cdt.core.dom.lrparser.ITokenCollector;
import org.eclipse.cdt.core.dom.lrparser.CPreprocessorAdapter;
import org.eclipse.cdt.core.dom.lrparser.action.ITokenStream;
import org.eclipse.cdt.core.dom.lrparser.lpgextensions.FixedBacktrackingParser; import org.eclipse.cdt.core.dom.lrparser.lpgextensions.FixedBacktrackingParser;
import org.eclipse.cdt.core.dom.lrparser.action.ScopedStack; import org.eclipse.cdt.core.dom.lrparser.action.ScopedStack;
import org.eclipse.cdt.core.parser.IScanner; import org.eclipse.cdt.core.parser.IScanner;
import org.eclipse.cdt.core.dom.parser.IBuiltinBindingsProvider; import org.eclipse.cdt.core.dom.parser.IBuiltinBindingsProvider;
import org.eclipse.cdt.core.index.IIndex; import org.eclipse.cdt.core.index.IIndex;
import org.eclipse.cdt.core.dom.lrparser.action.ITokenStream;
import org.eclipse.cdt.core.dom.lrparser.action.ITokenMap; 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.TokenMap;
import org.eclipse.cdt.core.dom.lrparser.ISecondaryParser; import org.eclipse.cdt.core.dom.lrparser.ISecondaryParser;
@ -244,9 +244,9 @@ public void setTokens(List<IToken> tokens) {
addToken(new Token(null, 0, 0, C99ExpressionParsersym.TK_EOF_TOKEN)); addToken(new Token(null, 0, 0, C99ExpressionParsersym.TK_EOF_TOKEN));
} }
public C99ExpressionParser(ITokenStream parser, Set<IParser.Options> options) { // constructor for creating secondary parser public C99ExpressionParser(ITokenStream stream, Set<IParser.Options> options) { // constructor for creating secondary parser
initActions(options); initActions(options);
tokenMap = new TokenMap(C99ExpressionParsersym.orderedTerminalSymbols, parser.getOrderedTerminalSymbols()); tokenMap = new TokenMap(C99ExpressionParsersym.orderedTerminalSymbols, stream.getOrderedTerminalSymbols());
} }
@ -340,7 +340,7 @@ public C99ExpressionParser(ITokenStream parser, Set<IParser.Options> options) {
} }
// //
// Rule 28: postfix_expression ::= ( type_id ) { <openscope-ast> initializer_list comma_opt } // Rule 28: postfix_expression ::= ( type_id ) initializer_list
// //
case 28: { action. consumeExpressionTypeIdInitializer(); break; case 28: { action. consumeExpressionTypeIdInitializer(); break;
} }
@ -1162,117 +1162,117 @@ public C99ExpressionParser(ITokenStream parser, Set<IParser.Options> options) {
} }
// //
// Rule 282: initializer ::= start_initializer_list { <openscope-ast> initializer_list comma_opt } end_initializer_list // Rule 283: initializer_list ::= start_initializer_list { <openscope-ast> initializer_seq comma_opt } end_initializer_list
//
case 282: { action. consumeInitializerList(); break;
}
//
// Rule 283: initializer ::= { <openscope-ast> }
// //
case 283: { action. consumeInitializerList(); break; case 283: { action. consumeInitializerList(); break;
} }
// //
// Rule 284: start_initializer_list ::= $Empty // Rule 284: initializer_list ::= { <openscope-ast> }
// //
case 284: { action. initializerListStart(); break; case 284: { action. consumeInitializerList(); break;
} }
// //
// Rule 285: end_initializer_list ::= $Empty // Rule 285: start_initializer_list ::= $Empty
// //
case 285: { action. initializerListEnd(); break; case 285: { action. initializerListStart(); break;
} }
// //
// Rule 290: designated_initializer ::= <openscope-ast> designation = initializer // Rule 286: end_initializer_list ::= $Empty
// //
case 290: { action. consumeInitializerDesignated(); break; case 286: { action. initializerListEnd(); break;
} }
// //
// Rule 294: designator_base ::= [ constant_expression ] // Rule 291: designated_initializer ::= <openscope-ast> designation = initializer
// //
case 294: { action. consumeDesignatorArray(); break; case 291: { action. consumeInitializerDesignated(); break;
} }
// //
// Rule 295: designator_base ::= . identifier_token // Rule 295: designator_base ::= [ constant_expression ]
// //
case 295: { action. consumeDesignatorField(); break; case 295: { action. consumeDesignatorArray(); break;
} }
// //
// Rule 296: designator ::= [ constant_expression ] // Rule 296: designator_base ::= . identifier_token
// //
case 296: { action. consumeDesignatorArray(); break; case 296: { action. consumeDesignatorField(); break;
} }
// //
// Rule 297: designator ::= . identifier_token // Rule 297: designator ::= [ constant_expression ]
// //
case 297: { action. consumeDesignatorField(); break; case 297: { action. consumeDesignatorArray(); break;
} }
// //
// Rule 298: translation_unit ::= external_declaration_list // Rule 298: designator ::= . identifier_token
// //
case 298: { action. consumeTranslationUnit(); break; case 298: { action. consumeDesignatorField(); break;
} }
// //
// Rule 299: translation_unit ::= $Empty // Rule 299: translation_unit ::= external_declaration_list
// //
case 299: { action. consumeTranslationUnit(); break; case 299: { action. consumeTranslationUnit(); break;
} }
// //
// Rule 304: external_declaration ::= ; // Rule 300: translation_unit ::= $Empty
// //
case 304: { action. consumeDeclarationEmpty(); break; case 300: { action. consumeTranslationUnit(); break;
} }
// //
// Rule 305: external_declaration ::= ERROR_TOKEN // Rule 305: external_declaration ::= ;
// //
case 305: { action. consumeDeclarationProblem(); break; case 305: { action. consumeDeclarationEmpty(); break;
} }
// //
// Rule 308: function_definition ::= declaration_specifiers <openscope-ast> function_declarator function_body // Rule 306: external_declaration ::= ERROR_TOKEN
// //
case 308: { action. consumeFunctionDefinition(true); break; case 306: { action. consumeDeclarationProblem(); break;
} }
// //
// Rule 309: function_definition ::= <openscope-ast> function_declarator function_body // Rule 310: function_definition ::= <openscope-ast> function_declarator function_body
// //
case 309: { action. consumeFunctionDefinition(false); break; case 310: { action. consumeFunctionDefinition(false); break;
} }
// //
// Rule 310: function_definition ::= declaration_specifiers <openscope-ast> knr_function_declarator <openscope-ast> declaration_list compound_statement // Rule 311: function_definition ::= declaration_specifiers <openscope-ast> knr_function_declarator <openscope-ast> declaration_list compound_statement
// //
case 310: { action. consumeFunctionDefinitionKnR(); break; case 311: { action. consumeFunctionDefinitionKnR(); break;
} }
// //
// Rule 311: function_body ::= { } // Rule 312: normal_function_definition ::= declaration_specifiers <openscope-ast> function_declarator function_body
// //
case 311: { action. consumeStatementCompoundStatement(false); break; case 312: { action. consumeFunctionDefinition(true); break;
} }
// //
// Rule 312: function_body ::= { <openscope-ast> block_item_list } // Rule 313: function_body ::= { }
// //
case 312: { action. consumeStatementCompoundStatement(true); break; case 313: { action. consumeStatementCompoundStatement(false); break;
} }
// //
// Rule 314: expression_parser_start ::= ERROR_TOKEN // Rule 314: function_body ::= { <openscope-ast> block_item_list }
// //
case 314: { action. consumeEmpty(); break; case 314: { action. consumeStatementCompoundStatement(true); break;
}
//
// Rule 316: expression_parser_start ::= ERROR_TOKEN
//
case 316: { action. consumeEmpty(); break;
} }

View file

@ -39,8 +39,8 @@ public interface C99ExpressionParsersym {
TK_return = 90, TK_return = 90,
TK_short = 36, TK_short = 36,
TK_signed = 37, TK_signed = 37,
TK_sizeof = 15, TK_sizeof = 16,
TK_static = 23, TK_static = 17,
TK_struct = 45, TK_struct = 45,
TK_switch = 91, TK_switch = 91,
TK_typedef = 28, TK_typedef = 28,
@ -52,27 +52,27 @@ public interface C99ExpressionParsersym {
TK__Bool = 40, TK__Bool = 40,
TK__Complex = 41, TK__Complex = 41,
TK__Imaginary = 42, TK__Imaginary = 42,
TK_integer = 16, TK_integer = 18,
TK_floating = 17, TK_floating = 19,
TK_charconst = 18, TK_charconst = 20,
TK_stringlit = 19, TK_stringlit = 21,
TK_identifier = 1, TK_identifier = 1,
TK_Completion = 3, TK_Completion = 3,
TK_EndOfCompletion = 5, TK_EndOfCompletion = 5,
TK_Invalid = 93, TK_Invalid = 93,
TK_LeftBracket = 20, TK_LeftBracket = 12,
TK_LeftParen = 2, TK_LeftParen = 2,
TK_LeftBrace = 12, TK_LeftBrace = 13,
TK_Dot = 52, TK_Dot = 52,
TK_Arrow = 67, TK_Arrow = 67,
TK_PlusPlus = 13, TK_PlusPlus = 14,
TK_MinusMinus = 14, TK_MinusMinus = 15,
TK_And = 11, TK_And = 11,
TK_Star = 4, TK_Star = 4,
TK_Plus = 9, TK_Plus = 9,
TK_Minus = 10, TK_Minus = 10,
TK_Tilde = 21, TK_Tilde = 22,
TK_Bang = 22, TK_Bang = 23,
TK_Slash = 53, TK_Slash = 53,
TK_Percent = 54, TK_Percent = 54,
TK_RightShift = 47, TK_RightShift = 47,
@ -122,18 +122,18 @@ public interface C99ExpressionParsersym {
"Plus", "Plus",
"Minus", "Minus",
"And", "And",
"LeftBracket",
"LeftBrace", "LeftBrace",
"PlusPlus", "PlusPlus",
"MinusMinus", "MinusMinus",
"sizeof", "sizeof",
"static",
"integer", "integer",
"floating", "floating",
"charconst", "charconst",
"stringlit", "stringlit",
"LeftBracket",
"Tilde", "Tilde",
"Bang", "Bang",
"static",
"auto", "auto",
"extern", "extern",
"inline", "inline",

View file

@ -17,17 +17,17 @@ import lpg.lpgjavaruntime.*;
import java.util.*; import java.util.*;
import org.eclipse.cdt.core.dom.ast.*; import org.eclipse.cdt.core.dom.ast.*;
import org.eclipse.cdt.core.dom.lrparser.CPreprocessorAdapter;
import org.eclipse.cdt.core.dom.lrparser.IDOMTokenMap; import org.eclipse.cdt.core.dom.lrparser.IDOMTokenMap;
import org.eclipse.cdt.core.dom.lrparser.IParser; import org.eclipse.cdt.core.dom.lrparser.IParser;
import org.eclipse.cdt.core.dom.lrparser.ITokenCollector; import org.eclipse.cdt.core.dom.lrparser.ITokenCollector;
import org.eclipse.cdt.core.dom.lrparser.CPreprocessorAdapter;
import org.eclipse.cdt.core.dom.lrparser.action.ITokenStream;
import org.eclipse.cdt.core.dom.lrparser.lpgextensions.FixedBacktrackingParser; import org.eclipse.cdt.core.dom.lrparser.lpgextensions.FixedBacktrackingParser;
import org.eclipse.cdt.core.dom.lrparser.action.ScopedStack; import org.eclipse.cdt.core.dom.lrparser.action.ScopedStack;
import org.eclipse.cdt.core.parser.IScanner; import org.eclipse.cdt.core.parser.IScanner;
import org.eclipse.cdt.core.dom.parser.IBuiltinBindingsProvider; import org.eclipse.cdt.core.dom.parser.IBuiltinBindingsProvider;
import org.eclipse.cdt.core.index.IIndex; import org.eclipse.cdt.core.index.IIndex;
import org.eclipse.cdt.core.dom.lrparser.action.ITokenStream;
import org.eclipse.cdt.core.dom.lrparser.action.ITokenMap; 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.TokenMap;
import org.eclipse.cdt.core.dom.lrparser.ISecondaryParser; import org.eclipse.cdt.core.dom.lrparser.ISecondaryParser;
@ -244,9 +244,9 @@ public void setTokens(List<IToken> tokens) {
addToken(new Token(null, 0, 0, C99NoCastExpressionParsersym.TK_EOF_TOKEN)); addToken(new Token(null, 0, 0, C99NoCastExpressionParsersym.TK_EOF_TOKEN));
} }
public C99NoCastExpressionParser(ITokenStream parser, Set<IParser.Options> options) { // constructor for creating secondary parser public C99NoCastExpressionParser(ITokenStream stream, Set<IParser.Options> options) { // constructor for creating secondary parser
initActions(options); initActions(options);
tokenMap = new TokenMap(C99NoCastExpressionParsersym.orderedTerminalSymbols, parser.getOrderedTerminalSymbols()); tokenMap = new TokenMap(C99NoCastExpressionParsersym.orderedTerminalSymbols, stream.getOrderedTerminalSymbols());
} }
@ -340,7 +340,7 @@ public C99NoCastExpressionParser(ITokenStream parser, Set<IParser.Options> optio
} }
// //
// Rule 28: postfix_expression ::= ( type_id ) { <openscope-ast> initializer_list comma_opt } // Rule 28: postfix_expression ::= ( type_id ) initializer_list
// //
case 28: { action. consumeExpressionTypeIdInitializer(); break; case 28: { action. consumeExpressionTypeIdInitializer(); break;
} }
@ -1156,117 +1156,117 @@ public C99NoCastExpressionParser(ITokenStream parser, Set<IParser.Options> optio
} }
// //
// Rule 281: initializer ::= start_initializer_list { <openscope-ast> initializer_list comma_opt } end_initializer_list // Rule 282: initializer_list ::= start_initializer_list { <openscope-ast> initializer_seq comma_opt } end_initializer_list
//
case 281: { action. consumeInitializerList(); break;
}
//
// Rule 282: initializer ::= { <openscope-ast> }
// //
case 282: { action. consumeInitializerList(); break; case 282: { action. consumeInitializerList(); break;
} }
// //
// Rule 283: start_initializer_list ::= $Empty // Rule 283: initializer_list ::= { <openscope-ast> }
// //
case 283: { action. initializerListStart(); break; case 283: { action. consumeInitializerList(); break;
} }
// //
// Rule 284: end_initializer_list ::= $Empty // Rule 284: start_initializer_list ::= $Empty
// //
case 284: { action. initializerListEnd(); break; case 284: { action. initializerListStart(); break;
} }
// //
// Rule 289: designated_initializer ::= <openscope-ast> designation = initializer // Rule 285: end_initializer_list ::= $Empty
// //
case 289: { action. consumeInitializerDesignated(); break; case 285: { action. initializerListEnd(); break;
} }
// //
// Rule 293: designator_base ::= [ constant_expression ] // Rule 290: designated_initializer ::= <openscope-ast> designation = initializer
// //
case 293: { action. consumeDesignatorArray(); break; case 290: { action. consumeInitializerDesignated(); break;
} }
// //
// Rule 294: designator_base ::= . identifier_token // Rule 294: designator_base ::= [ constant_expression ]
// //
case 294: { action. consumeDesignatorField(); break; case 294: { action. consumeDesignatorArray(); break;
} }
// //
// Rule 295: designator ::= [ constant_expression ] // Rule 295: designator_base ::= . identifier_token
// //
case 295: { action. consumeDesignatorArray(); break; case 295: { action. consumeDesignatorField(); break;
} }
// //
// Rule 296: designator ::= . identifier_token // Rule 296: designator ::= [ constant_expression ]
// //
case 296: { action. consumeDesignatorField(); break; case 296: { action. consumeDesignatorArray(); break;
} }
// //
// Rule 297: translation_unit ::= external_declaration_list // Rule 297: designator ::= . identifier_token
// //
case 297: { action. consumeTranslationUnit(); break; case 297: { action. consumeDesignatorField(); break;
} }
// //
// Rule 298: translation_unit ::= $Empty // Rule 298: translation_unit ::= external_declaration_list
// //
case 298: { action. consumeTranslationUnit(); break; case 298: { action. consumeTranslationUnit(); break;
} }
// //
// Rule 303: external_declaration ::= ; // Rule 299: translation_unit ::= $Empty
// //
case 303: { action. consumeDeclarationEmpty(); break; case 299: { action. consumeTranslationUnit(); break;
} }
// //
// Rule 304: external_declaration ::= ERROR_TOKEN // Rule 304: external_declaration ::= ;
// //
case 304: { action. consumeDeclarationProblem(); break; case 304: { action. consumeDeclarationEmpty(); break;
} }
// //
// Rule 307: function_definition ::= declaration_specifiers <openscope-ast> function_declarator function_body // Rule 305: external_declaration ::= ERROR_TOKEN
// //
case 307: { action. consumeFunctionDefinition(true); break; case 305: { action. consumeDeclarationProblem(); break;
} }
// //
// Rule 308: function_definition ::= <openscope-ast> function_declarator function_body // Rule 309: function_definition ::= <openscope-ast> function_declarator function_body
// //
case 308: { action. consumeFunctionDefinition(false); break; case 309: { action. consumeFunctionDefinition(false); break;
} }
// //
// Rule 309: function_definition ::= declaration_specifiers <openscope-ast> knr_function_declarator <openscope-ast> declaration_list compound_statement // Rule 310: function_definition ::= declaration_specifiers <openscope-ast> knr_function_declarator <openscope-ast> declaration_list compound_statement
// //
case 309: { action. consumeFunctionDefinitionKnR(); break; case 310: { action. consumeFunctionDefinitionKnR(); break;
} }
// //
// Rule 310: function_body ::= { } // Rule 311: normal_function_definition ::= declaration_specifiers <openscope-ast> function_declarator function_body
// //
case 310: { action. consumeStatementCompoundStatement(false); break; case 311: { action. consumeFunctionDefinition(true); break;
} }
// //
// Rule 311: function_body ::= { <openscope-ast> block_item_list } // Rule 312: function_body ::= { }
// //
case 311: { action. consumeStatementCompoundStatement(true); break; case 312: { action. consumeStatementCompoundStatement(false); break;
} }
// //
// Rule 313: no_cast_start ::= ERROR_TOKEN // Rule 313: function_body ::= { <openscope-ast> block_item_list }
// //
case 313: { action. consumeEmpty(); break; case 313: { action. consumeStatementCompoundStatement(true); break;
}
//
// Rule 315: no_cast_start ::= ERROR_TOKEN
//
case 315: { action. consumeEmpty(); break;
} }

View file

@ -15,7 +15,7 @@ package org.eclipse.cdt.internal.core.dom.lrparser.c99;
public interface C99NoCastExpressionParsersym { public interface C99NoCastExpressionParsersym {
public final static int public final static int
TK_auto = 24, TK_auto = 17,
TK_break = 81, TK_break = 81,
TK_case = 82, TK_case = 82,
TK_char = 31, TK_char = 31,
@ -26,24 +26,24 @@ public interface C99NoCastExpressionParsersym {
TK_double = 32, TK_double = 32,
TK_else = 86, TK_else = 86,
TK_enum = 44, TK_enum = 44,
TK_extern = 25, TK_extern = 18,
TK_float = 33, TK_float = 33,
TK_for = 87, TK_for = 87,
TK_goto = 88, TK_goto = 88,
TK_if = 89, TK_if = 89,
TK_inline = 26, TK_inline = 19,
TK_int = 34, TK_int = 34,
TK_long = 35, TK_long = 35,
TK_register = 27, TK_register = 20,
TK_restrict = 7, TK_restrict = 7,
TK_return = 90, TK_return = 90,
TK_short = 36, TK_short = 36,
TK_signed = 37, TK_signed = 37,
TK_sizeof = 17, TK_sizeof = 21,
TK_static = 14, TK_static = 12,
TK_struct = 45, TK_struct = 45,
TK_switch = 91, TK_switch = 91,
TK_typedef = 28, TK_typedef = 22,
TK_union = 46, TK_union = 46,
TK_unsigned = 38, TK_unsigned = 38,
TK_void = 39, TK_void = 39,
@ -52,27 +52,27 @@ public interface C99NoCastExpressionParsersym {
TK__Bool = 40, TK__Bool = 40,
TK__Complex = 41, TK__Complex = 41,
TK__Imaginary = 42, TK__Imaginary = 42,
TK_integer = 18, TK_integer = 23,
TK_floating = 19, TK_floating = 24,
TK_charconst = 20, TK_charconst = 25,
TK_stringlit = 21, TK_stringlit = 26,
TK_identifier = 1, TK_identifier = 1,
TK_Completion = 3, TK_Completion = 3,
TK_EndOfCompletion = 5, TK_EndOfCompletion = 5,
TK_Invalid = 93, TK_Invalid = 93,
TK_LeftBracket = 11, TK_LeftBracket = 9,
TK_LeftParen = 2, TK_LeftParen = 2,
TK_LeftBrace = 12, TK_LeftBrace = 13,
TK_Dot = 52, TK_Dot = 52,
TK_Arrow = 67, TK_Arrow = 67,
TK_PlusPlus = 15, TK_PlusPlus = 15,
TK_MinusMinus = 16, TK_MinusMinus = 16,
TK_And = 13, TK_And = 14,
TK_Star = 4, TK_Star = 4,
TK_Plus = 9, TK_Plus = 10,
TK_Minus = 10, TK_Minus = 11,
TK_Tilde = 22, TK_Tilde = 27,
TK_Bang = 23, TK_Bang = 28,
TK_Slash = 53, TK_Slash = 53,
TK_Percent = 54, TK_Percent = 54,
TK_RightShift = 47, TK_RightShift = 47,
@ -119,26 +119,26 @@ public interface C99NoCastExpressionParsersym {
"const", "const",
"restrict", "restrict",
"volatile", "volatile",
"LeftBracket",
"Plus", "Plus",
"Minus", "Minus",
"LeftBracket", "static",
"LeftBrace", "LeftBrace",
"And", "And",
"static",
"PlusPlus", "PlusPlus",
"MinusMinus", "MinusMinus",
"auto",
"extern",
"inline",
"register",
"sizeof", "sizeof",
"typedef",
"integer", "integer",
"floating", "floating",
"charconst", "charconst",
"stringlit", "stringlit",
"Tilde", "Tilde",
"Bang", "Bang",
"auto",
"extern",
"inline",
"register",
"typedef",
"Comma", "Comma",
"RightParen", "RightParen",
"char", "char",

View file

@ -17,12 +17,12 @@ import lpg.lpgjavaruntime.*;
import java.util.*; import java.util.*;
import org.eclipse.cdt.core.dom.ast.*; import org.eclipse.cdt.core.dom.ast.*;
import org.eclipse.cdt.core.dom.lrparser.CPreprocessorAdapter;
import org.eclipse.cdt.core.dom.lrparser.IDOMTokenMap; import org.eclipse.cdt.core.dom.lrparser.IDOMTokenMap;
import org.eclipse.cdt.core.dom.lrparser.IParser; import org.eclipse.cdt.core.dom.lrparser.IParser;
import org.eclipse.cdt.core.dom.lrparser.ITokenCollector; import org.eclipse.cdt.core.dom.lrparser.ITokenCollector;
import org.eclipse.cdt.core.dom.lrparser.lpgextensions.FixedBacktrackingParser; import org.eclipse.cdt.core.dom.lrparser.CPreprocessorAdapter;
import org.eclipse.cdt.core.dom.lrparser.action.ITokenStream; import org.eclipse.cdt.core.dom.lrparser.action.ITokenStream;
import org.eclipse.cdt.core.dom.lrparser.lpgextensions.FixedBacktrackingParser;
import org.eclipse.cdt.core.dom.lrparser.action.ScopedStack; import org.eclipse.cdt.core.dom.lrparser.action.ScopedStack;
import org.eclipse.cdt.core.parser.IScanner; import org.eclipse.cdt.core.parser.IScanner;
import org.eclipse.cdt.core.dom.parser.IBuiltinBindingsProvider; import org.eclipse.cdt.core.dom.parser.IBuiltinBindingsProvider;
@ -317,7 +317,7 @@ public String getName() {
} }
// //
// Rule 28: postfix_expression ::= ( type_id ) { <openscope-ast> initializer_list comma_opt } // Rule 28: postfix_expression ::= ( type_id ) initializer_list
// //
case 28: { action. consumeExpressionTypeIdInitializer(); break; case 28: { action. consumeExpressionTypeIdInitializer(); break;
} }
@ -1139,111 +1139,111 @@ public String getName() {
} }
// //
// Rule 282: initializer ::= start_initializer_list { <openscope-ast> initializer_list comma_opt } end_initializer_list // Rule 283: initializer_list ::= start_initializer_list { <openscope-ast> initializer_seq comma_opt } end_initializer_list
//
case 282: { action. consumeInitializerList(); break;
}
//
// Rule 283: initializer ::= { <openscope-ast> }
// //
case 283: { action. consumeInitializerList(); break; case 283: { action. consumeInitializerList(); break;
} }
// //
// Rule 284: start_initializer_list ::= $Empty // Rule 284: initializer_list ::= { <openscope-ast> }
// //
case 284: { action. initializerListStart(); break; case 284: { action. consumeInitializerList(); break;
} }
// //
// Rule 285: end_initializer_list ::= $Empty // Rule 285: start_initializer_list ::= $Empty
// //
case 285: { action. initializerListEnd(); break; case 285: { action. initializerListStart(); break;
} }
// //
// Rule 290: designated_initializer ::= <openscope-ast> designation = initializer // Rule 286: end_initializer_list ::= $Empty
// //
case 290: { action. consumeInitializerDesignated(); break; case 286: { action. initializerListEnd(); break;
} }
// //
// Rule 294: designator_base ::= [ constant_expression ] // Rule 291: designated_initializer ::= <openscope-ast> designation = initializer
// //
case 294: { action. consumeDesignatorArray(); break; case 291: { action. consumeInitializerDesignated(); break;
} }
// //
// Rule 295: designator_base ::= . identifier_token // Rule 295: designator_base ::= [ constant_expression ]
// //
case 295: { action. consumeDesignatorField(); break; case 295: { action. consumeDesignatorArray(); break;
} }
// //
// Rule 296: designator ::= [ constant_expression ] // Rule 296: designator_base ::= . identifier_token
// //
case 296: { action. consumeDesignatorArray(); break; case 296: { action. consumeDesignatorField(); break;
} }
// //
// Rule 297: designator ::= . identifier_token // Rule 297: designator ::= [ constant_expression ]
// //
case 297: { action. consumeDesignatorField(); break; case 297: { action. consumeDesignatorArray(); break;
} }
// //
// Rule 298: translation_unit ::= external_declaration_list // Rule 298: designator ::= . identifier_token
// //
case 298: { action. consumeTranslationUnit(); break; case 298: { action. consumeDesignatorField(); break;
} }
// //
// Rule 299: translation_unit ::= $Empty // Rule 299: translation_unit ::= external_declaration_list
// //
case 299: { action. consumeTranslationUnit(); break; case 299: { action. consumeTranslationUnit(); break;
} }
// //
// Rule 304: external_declaration ::= ; // Rule 300: translation_unit ::= $Empty
// //
case 304: { action. consumeDeclarationEmpty(); break; case 300: { action. consumeTranslationUnit(); break;
} }
// //
// Rule 305: external_declaration ::= ERROR_TOKEN // Rule 305: external_declaration ::= ;
// //
case 305: { action. consumeDeclarationProblem(); break; case 305: { action. consumeDeclarationEmpty(); break;
} }
// //
// Rule 308: function_definition ::= declaration_specifiers <openscope-ast> function_declarator function_body // Rule 306: external_declaration ::= ERROR_TOKEN
// //
case 308: { action. consumeFunctionDefinition(true); break; case 306: { action. consumeDeclarationProblem(); break;
} }
// //
// Rule 309: function_definition ::= <openscope-ast> function_declarator function_body // Rule 310: function_definition ::= <openscope-ast> function_declarator function_body
// //
case 309: { action. consumeFunctionDefinition(false); break; case 310: { action. consumeFunctionDefinition(false); break;
} }
// //
// Rule 310: function_definition ::= declaration_specifiers <openscope-ast> knr_function_declarator <openscope-ast> declaration_list compound_statement // Rule 311: function_definition ::= declaration_specifiers <openscope-ast> knr_function_declarator <openscope-ast> declaration_list compound_statement
// //
case 310: { action. consumeFunctionDefinitionKnR(); break; case 311: { action. consumeFunctionDefinitionKnR(); break;
} }
// //
// Rule 311: function_body ::= { } // Rule 312: normal_function_definition ::= declaration_specifiers <openscope-ast> function_declarator function_body
// //
case 311: { action. consumeStatementCompoundStatement(false); break; case 312: { action. consumeFunctionDefinition(true); break;
} }
// //
// Rule 312: function_body ::= { <openscope-ast> block_item_list } // Rule 313: function_body ::= { }
// //
case 312: { action. consumeStatementCompoundStatement(true); break; case 313: { action. consumeStatementCompoundStatement(false); break;
}
//
// Rule 314: function_body ::= { <openscope-ast> block_item_list }
//
case 314: { action. consumeStatementCompoundStatement(true); break;
} }

View file

@ -17,17 +17,17 @@ import lpg.lpgjavaruntime.*;
import java.util.*; import java.util.*;
import org.eclipse.cdt.core.dom.ast.*; import org.eclipse.cdt.core.dom.ast.*;
import org.eclipse.cdt.core.dom.lrparser.CPreprocessorAdapter;
import org.eclipse.cdt.core.dom.lrparser.IDOMTokenMap; import org.eclipse.cdt.core.dom.lrparser.IDOMTokenMap;
import org.eclipse.cdt.core.dom.lrparser.IParser; import org.eclipse.cdt.core.dom.lrparser.IParser;
import org.eclipse.cdt.core.dom.lrparser.ITokenCollector; import org.eclipse.cdt.core.dom.lrparser.ITokenCollector;
import org.eclipse.cdt.core.dom.lrparser.CPreprocessorAdapter;
import org.eclipse.cdt.core.dom.lrparser.action.ITokenStream;
import org.eclipse.cdt.core.dom.lrparser.lpgextensions.FixedBacktrackingParser; import org.eclipse.cdt.core.dom.lrparser.lpgextensions.FixedBacktrackingParser;
import org.eclipse.cdt.core.dom.lrparser.action.ScopedStack; import org.eclipse.cdt.core.dom.lrparser.action.ScopedStack;
import org.eclipse.cdt.core.parser.IScanner; import org.eclipse.cdt.core.parser.IScanner;
import org.eclipse.cdt.core.dom.parser.IBuiltinBindingsProvider; import org.eclipse.cdt.core.dom.parser.IBuiltinBindingsProvider;
import org.eclipse.cdt.core.index.IIndex; import org.eclipse.cdt.core.index.IIndex;
import org.eclipse.cdt.core.dom.lrparser.action.ITokenStream;
import org.eclipse.cdt.core.dom.lrparser.action.ITokenMap; 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.TokenMap;
import org.eclipse.cdt.core.dom.lrparser.ISecondaryParser; import org.eclipse.cdt.core.dom.lrparser.ISecondaryParser;
@ -244,9 +244,9 @@ public void setTokens(List<IToken> tokens) {
addToken(new Token(null, 0, 0, C99SizeofExpressionParsersym.TK_EOF_TOKEN)); addToken(new Token(null, 0, 0, C99SizeofExpressionParsersym.TK_EOF_TOKEN));
} }
public C99SizeofExpressionParser(ITokenStream parser, Set<IParser.Options> options) { // constructor for creating secondary parser public C99SizeofExpressionParser(ITokenStream stream, Set<IParser.Options> options) { // constructor for creating secondary parser
initActions(options); initActions(options);
tokenMap = new TokenMap(C99SizeofExpressionParsersym.orderedTerminalSymbols, parser.getOrderedTerminalSymbols()); tokenMap = new TokenMap(C99SizeofExpressionParsersym.orderedTerminalSymbols, stream.getOrderedTerminalSymbols());
} }
@ -340,7 +340,7 @@ public C99SizeofExpressionParser(ITokenStream parser, Set<IParser.Options> optio
} }
// //
// Rule 28: postfix_expression ::= ( type_id ) { <openscope-ast> initializer_list comma_opt } // Rule 28: postfix_expression ::= ( type_id ) initializer_list
// //
case 28: { action. consumeExpressionTypeIdInitializer(); break; case 28: { action. consumeExpressionTypeIdInitializer(); break;
} }
@ -1156,117 +1156,117 @@ public C99SizeofExpressionParser(ITokenStream parser, Set<IParser.Options> optio
} }
// //
// Rule 281: initializer ::= start_initializer_list { <openscope-ast> initializer_list comma_opt } end_initializer_list // Rule 282: initializer_list ::= start_initializer_list { <openscope-ast> initializer_seq comma_opt } end_initializer_list
//
case 281: { action. consumeInitializerList(); break;
}
//
// Rule 282: initializer ::= { <openscope-ast> }
// //
case 282: { action. consumeInitializerList(); break; case 282: { action. consumeInitializerList(); break;
} }
// //
// Rule 283: start_initializer_list ::= $Empty // Rule 283: initializer_list ::= { <openscope-ast> }
// //
case 283: { action. initializerListStart(); break; case 283: { action. consumeInitializerList(); break;
} }
// //
// Rule 284: end_initializer_list ::= $Empty // Rule 284: start_initializer_list ::= $Empty
// //
case 284: { action. initializerListEnd(); break; case 284: { action. initializerListStart(); break;
} }
// //
// Rule 289: designated_initializer ::= <openscope-ast> designation = initializer // Rule 285: end_initializer_list ::= $Empty
// //
case 289: { action. consumeInitializerDesignated(); break; case 285: { action. initializerListEnd(); break;
} }
// //
// Rule 293: designator_base ::= [ constant_expression ] // Rule 290: designated_initializer ::= <openscope-ast> designation = initializer
// //
case 293: { action. consumeDesignatorArray(); break; case 290: { action. consumeInitializerDesignated(); break;
} }
// //
// Rule 294: designator_base ::= . identifier_token // Rule 294: designator_base ::= [ constant_expression ]
// //
case 294: { action. consumeDesignatorField(); break; case 294: { action. consumeDesignatorArray(); break;
} }
// //
// Rule 295: designator ::= [ constant_expression ] // Rule 295: designator_base ::= . identifier_token
// //
case 295: { action. consumeDesignatorArray(); break; case 295: { action. consumeDesignatorField(); break;
} }
// //
// Rule 296: designator ::= . identifier_token // Rule 296: designator ::= [ constant_expression ]
// //
case 296: { action. consumeDesignatorField(); break; case 296: { action. consumeDesignatorArray(); break;
} }
// //
// Rule 297: translation_unit ::= external_declaration_list // Rule 297: designator ::= . identifier_token
// //
case 297: { action. consumeTranslationUnit(); break; case 297: { action. consumeDesignatorField(); break;
} }
// //
// Rule 298: translation_unit ::= $Empty // Rule 298: translation_unit ::= external_declaration_list
// //
case 298: { action. consumeTranslationUnit(); break; case 298: { action. consumeTranslationUnit(); break;
} }
// //
// Rule 303: external_declaration ::= ; // Rule 299: translation_unit ::= $Empty
// //
case 303: { action. consumeDeclarationEmpty(); break; case 299: { action. consumeTranslationUnit(); break;
} }
// //
// Rule 304: external_declaration ::= ERROR_TOKEN // Rule 304: external_declaration ::= ;
// //
case 304: { action. consumeDeclarationProblem(); break; case 304: { action. consumeDeclarationEmpty(); break;
} }
// //
// Rule 307: function_definition ::= declaration_specifiers <openscope-ast> function_declarator function_body // Rule 305: external_declaration ::= ERROR_TOKEN
// //
case 307: { action. consumeFunctionDefinition(true); break; case 305: { action. consumeDeclarationProblem(); break;
} }
// //
// Rule 308: function_definition ::= <openscope-ast> function_declarator function_body // Rule 309: function_definition ::= <openscope-ast> function_declarator function_body
// //
case 308: { action. consumeFunctionDefinition(false); break; case 309: { action. consumeFunctionDefinition(false); break;
} }
// //
// Rule 309: function_definition ::= declaration_specifiers <openscope-ast> knr_function_declarator <openscope-ast> declaration_list compound_statement // Rule 310: function_definition ::= declaration_specifiers <openscope-ast> knr_function_declarator <openscope-ast> declaration_list compound_statement
// //
case 309: { action. consumeFunctionDefinitionKnR(); break; case 310: { action. consumeFunctionDefinitionKnR(); break;
} }
// //
// Rule 310: function_body ::= { } // Rule 311: normal_function_definition ::= declaration_specifiers <openscope-ast> function_declarator function_body
// //
case 310: { action. consumeStatementCompoundStatement(false); break; case 311: { action. consumeFunctionDefinition(true); break;
} }
// //
// Rule 311: function_body ::= { <openscope-ast> block_item_list } // Rule 312: function_body ::= { }
// //
case 311: { action. consumeStatementCompoundStatement(true); break; case 312: { action. consumeStatementCompoundStatement(false); break;
} }
// //
// Rule 313: no_sizeof_type_id_start ::= ERROR_TOKEN // Rule 313: function_body ::= { <openscope-ast> block_item_list }
// //
case 313: { action. consumeEmpty(); break; case 313: { action. consumeStatementCompoundStatement(true); break;
}
//
// Rule 315: no_sizeof_type_id_start ::= ERROR_TOKEN
//
case 315: { action. consumeEmpty(); break;
} }

View file

@ -39,8 +39,8 @@ public interface C99SizeofExpressionParsersym {
TK_return = 90, TK_return = 90,
TK_short = 36, TK_short = 36,
TK_signed = 37, TK_signed = 37,
TK_sizeof = 16, TK_sizeof = 17,
TK_static = 17, TK_static = 13,
TK_struct = 45, TK_struct = 45,
TK_switch = 91, TK_switch = 91,
TK_typedef = 28, TK_typedef = 28,
@ -60,14 +60,14 @@ public interface C99SizeofExpressionParsersym {
TK_Completion = 3, TK_Completion = 3,
TK_EndOfCompletion = 5, TK_EndOfCompletion = 5,
TK_Invalid = 93, TK_Invalid = 93,
TK_LeftBracket = 12, TK_LeftBracket = 11,
TK_LeftParen = 2, TK_LeftParen = 2,
TK_LeftBrace = 13, TK_LeftBrace = 14,
TK_Dot = 52, TK_Dot = 52,
TK_Arrow = 67, TK_Arrow = 67,
TK_PlusPlus = 14, TK_PlusPlus = 15,
TK_MinusMinus = 15, TK_MinusMinus = 16,
TK_And = 11, TK_And = 12,
TK_Star = 4, TK_Star = 4,
TK_Plus = 9, TK_Plus = 9,
TK_Minus = 10, TK_Minus = 10,
@ -121,13 +121,13 @@ public interface C99SizeofExpressionParsersym {
"volatile", "volatile",
"Plus", "Plus",
"Minus", "Minus",
"And",
"LeftBracket", "LeftBracket",
"And",
"static",
"LeftBrace", "LeftBrace",
"PlusPlus", "PlusPlus",
"MinusMinus", "MinusMinus",
"sizeof", "sizeof",
"static",
"integer", "integer",
"floating", "floating",
"charconst", "charconst",

View file

@ -1228,12 +1228,6 @@ private GNUBuildASTParserAction gnuAction;
case 306: { action. consumeDeclarationProblem(); break; case 306: { action. consumeDeclarationProblem(); break;
} }
//
// Rule 309: function_definition ::= declaration_specifiers <openscope-ast> function_declarator function_body
//
case 309: { action. consumeFunctionDefinition(true); break;
}
// //
// Rule 310: function_definition ::= <openscope-ast> function_declarator function_body // Rule 310: function_definition ::= <openscope-ast> function_declarator function_body
// //
@ -1247,123 +1241,135 @@ private GNUBuildASTParserAction gnuAction;
} }
// //
// Rule 312: function_body ::= { } // Rule 312: normal_function_definition ::= declaration_specifiers <openscope-ast> function_declarator function_body
// //
case 312: { action. consumeStatementCompoundStatement(false); break; case 312: { action. consumeFunctionDefinition(true); break;
} }
// //
// Rule 313: function_body ::= { <openscope-ast> block_item_list } // Rule 313: function_body ::= { }
// //
case 313: { action. consumeStatementCompoundStatement(true); break; case 313: { action. consumeStatementCompoundStatement(false); break;
} }
// //
// Rule 330: attribute_parameter ::= assignment_expression // Rule 314: function_body ::= { <openscope-ast> block_item_list }
// //
case 330: { action. consumeIgnore(); break; case 314: { action. consumeStatementCompoundStatement(true); break;
} }
// //
// Rule 341: extended_asm_declaration ::= asm volatile_opt ( extended_asm_param_seq ) ; // Rule 331: attribute_parameter ::= assignment_expression
// //
case 341: { gnuAction.consumeDeclarationASM(); break; case 331: { action. consumeIgnore(); break;
} }
// //
// Rule 352: unary_expression ::= __alignof__ unary_expression // Rule 342: extended_asm_declaration ::= asm volatile_opt ( extended_asm_param_seq ) ;
// //
case 352: { action. consumeExpressionUnaryOperator(IASTUnaryExpression.op_alignOf); break; case 342: { gnuAction.consumeDeclarationASM(); break;
} }
// //
// Rule 353: unary_expression ::= __alignof__ ( type_id ) // Rule 353: unary_expression ::= __alignof__ unary_expression
// //
case 353: { action. consumeExpressionTypeId(IASTTypeIdExpression.op_alignof); break; case 353: { action. consumeExpressionUnaryOperator(IASTUnaryExpression.op_alignOf); break;
} }
// //
// Rule 354: unary_expression ::= typeof unary_expression // Rule 354: unary_expression ::= __alignof__ ( type_id )
// //
case 354: { action. consumeExpressionUnaryOperator(IASTUnaryExpression.op_typeof); break; case 354: { action. consumeExpressionTypeId(IASTTypeIdExpression.op_alignof); break;
} }
// //
// Rule 355: unary_expression ::= typeof ( type_id ) // Rule 355: unary_expression ::= typeof unary_expression
// //
case 355: { action. consumeExpressionTypeId(IASTTypeIdExpression.op_typeof); break; case 355: { action. consumeExpressionUnaryOperator(IASTUnaryExpression.op_typeof); break;
} }
// //
// Rule 356: relational_expression ::= relational_expression >? shift_expression // Rule 356: unary_expression ::= typeof ( type_id )
// //
case 356: { action. consumeExpressionBinaryOperator(IASTBinaryExpression.op_max); break; case 356: { action. consumeExpressionTypeId(IASTTypeIdExpression.op_typeof); break;
} }
// //
// Rule 357: relational_expression ::= relational_expression <? shift_expression // Rule 357: relational_expression ::= relational_expression >? shift_expression
// //
case 357: { action. consumeExpressionBinaryOperator(IASTBinaryExpression.op_min); break; case 357: { action. consumeExpressionBinaryOperator(IASTBinaryExpression.op_max); break;
} }
// //
// Rule 358: conditional_expression ::= logical_or_expression ? <empty> : assignment_expression // Rule 358: relational_expression ::= relational_expression <? shift_expression
// //
case 358: { action. consumeExpressionConditional(); break; case 358: { action. consumeExpressionBinaryOperator(IASTBinaryExpression.op_min); break;
} }
// //
// Rule 359: primary_expression ::= ( compound_statement ) // Rule 359: conditional_expression ::= logical_or_expression ? <empty> : assignment_expression
// //
case 359: { gnuAction.consumeCompoundStatementExpression(); break; case 359: { action. consumeExpressionConditional(); break;
} }
// //
// Rule 360: labeled_statement ::= case case_range_expression : statement // Rule 360: primary_expression ::= ( compound_statement )
// //
case 360: { action. consumeStatementCase(); break; case 360: { gnuAction.consumeCompoundStatementExpression(); break;
} }
// //
// Rule 361: case_range_expression ::= constant_expression ... constant_expression // Rule 361: labeled_statement ::= case case_range_expression : statement
// //
case 361: { action. consumeExpressionBinaryOperator(IASTBinaryExpression.op_assign); break; case 361: { action. consumeStatementCase(); break;
} }
// //
// Rule 365: typeof_type_specifier ::= typeof unary_expression // Rule 362: case_range_expression ::= constant_expression ... constant_expression
// //
case 365: { action. consumeExpressionUnaryOperator(IASTUnaryExpression.op_typeof); break; case 362: { action. consumeExpressionBinaryOperator(IASTBinaryExpression.op_assign); break;
} }
// //
// Rule 366: typeof_type_specifier ::= typeof ( type_id ) // Rule 366: typeof_type_specifier ::= typeof unary_expression
// //
case 366: { action. consumeExpressionTypeId(IASTTypeIdExpression.op_typeof); break; case 366: { action. consumeExpressionUnaryOperator(IASTUnaryExpression.op_typeof); break;
} }
// //
// Rule 367: declaration_specifiers ::= <openscope-ast> typeof_declaration_specifiers // Rule 367: typeof_type_specifier ::= typeof ( type_id )
// //
case 367: { action. consumeDeclarationSpecifiersTypeof(); break; case 367: { action. consumeExpressionTypeId(IASTTypeIdExpression.op_typeof); break;
} }
// //
// Rule 383: field_name_designator ::= identifier_token : // Rule 368: declaration_specifiers ::= <openscope-ast> typeof_declaration_specifiers
// //
case 383: { action. consumeDesignatorFieldGCC(); break; case 368: { action. consumeDeclarationSpecifiersTypeof(); break;
} }
// //
// Rule 384: array_range_designator ::= [ constant_expression ... constant_expression ] // Rule 384: field_name_designator ::= identifier_token :
// //
case 384: { action. consumeDesignatorArrayRange(); break; case 384: { action. consumeDesignatorFieldGCC(); break;
} }
// //
// Rule 385: designated_initializer ::= <openscope-ast> field_name_designator initializer // Rule 385: array_range_designator ::= [ constant_expression ... constant_expression ]
// //
case 385: { action. consumeInitializerDesignated(); break; case 385: { action. consumeDesignatorArrayRange(); break;
}
//
// Rule 386: designated_initializer ::= <openscope-ast> field_name_designator initializer
//
case 386: { action. consumeInitializerDesignated(); break;
}
//
// Rule 387: block_item ::= normal_function_definition
//
case 387: { action. consumeStatementDeclaration(); break;
} }

View file

@ -1245,12 +1245,6 @@ private GNUBuildASTParserAction gnuAction;
case 305: { action. consumeDeclarationProblem(); break; case 305: { action. consumeDeclarationProblem(); break;
} }
//
// Rule 308: function_definition ::= declaration_specifiers <openscope-ast> function_declarator function_body
//
case 308: { action. consumeFunctionDefinition(true); break;
}
// //
// Rule 309: function_definition ::= <openscope-ast> function_declarator function_body // Rule 309: function_definition ::= <openscope-ast> function_declarator function_body
// //
@ -1264,117 +1258,129 @@ private GNUBuildASTParserAction gnuAction;
} }
// //
// Rule 311: function_body ::= { } // Rule 311: normal_function_definition ::= declaration_specifiers <openscope-ast> function_declarator function_body
// //
case 311: { action. consumeStatementCompoundStatement(false); break; case 311: { action. consumeFunctionDefinition(true); break;
} }
// //
// Rule 312: function_body ::= { <openscope-ast> block_item_list } // Rule 312: function_body ::= { }
// //
case 312: { action. consumeStatementCompoundStatement(true); break; case 312: { action. consumeStatementCompoundStatement(false); break;
} }
// //
// Rule 329: attribute_parameter ::= assignment_expression // Rule 313: function_body ::= { <openscope-ast> block_item_list }
// //
case 329: { action. consumeIgnore(); break; case 313: { action. consumeStatementCompoundStatement(true); break;
} }
// //
// Rule 340: extended_asm_declaration ::= asm volatile_opt ( extended_asm_param_seq ) ; // Rule 330: attribute_parameter ::= assignment_expression
// //
case 340: { gnuAction.consumeDeclarationASM(); break; case 330: { action. consumeIgnore(); break;
} }
// //
// Rule 351: unary_expression ::= __alignof__ unary_expression // Rule 341: extended_asm_declaration ::= asm volatile_opt ( extended_asm_param_seq ) ;
// //
case 351: { action. consumeExpressionUnaryOperator(IASTUnaryExpression.op_alignOf); break; case 341: { gnuAction.consumeDeclarationASM(); break;
} }
// //
// Rule 352: unary_expression ::= typeof unary_expression // Rule 352: unary_expression ::= __alignof__ unary_expression
// //
case 352: { action. consumeExpressionUnaryOperator(IASTUnaryExpression.op_typeof); break; case 352: { action. consumeExpressionUnaryOperator(IASTUnaryExpression.op_alignOf); break;
} }
// //
// Rule 353: relational_expression ::= relational_expression >? shift_expression // Rule 353: unary_expression ::= typeof unary_expression
// //
case 353: { action. consumeExpressionBinaryOperator(IASTBinaryExpression.op_max); break; case 353: { action. consumeExpressionUnaryOperator(IASTUnaryExpression.op_typeof); break;
} }
// //
// Rule 354: relational_expression ::= relational_expression <? shift_expression // Rule 354: relational_expression ::= relational_expression >? shift_expression
// //
case 354: { action. consumeExpressionBinaryOperator(IASTBinaryExpression.op_min); break; case 354: { action. consumeExpressionBinaryOperator(IASTBinaryExpression.op_max); break;
} }
// //
// Rule 355: conditional_expression ::= logical_or_expression ? <empty> : assignment_expression // Rule 355: relational_expression ::= relational_expression <? shift_expression
// //
case 355: { action. consumeExpressionConditional(); break; case 355: { action. consumeExpressionBinaryOperator(IASTBinaryExpression.op_min); break;
} }
// //
// Rule 356: primary_expression ::= ( compound_statement ) // Rule 356: conditional_expression ::= logical_or_expression ? <empty> : assignment_expression
// //
case 356: { gnuAction.consumeCompoundStatementExpression(); break; case 356: { action. consumeExpressionConditional(); break;
} }
// //
// Rule 357: labeled_statement ::= case case_range_expression : statement // Rule 357: primary_expression ::= ( compound_statement )
// //
case 357: { action. consumeStatementCase(); break; case 357: { gnuAction.consumeCompoundStatementExpression(); break;
} }
// //
// Rule 358: case_range_expression ::= constant_expression ... constant_expression // Rule 358: labeled_statement ::= case case_range_expression : statement
// //
case 358: { action. consumeExpressionBinaryOperator(IASTBinaryExpression.op_assign); break; case 358: { action. consumeStatementCase(); break;
} }
// //
// Rule 362: typeof_type_specifier ::= typeof unary_expression // Rule 359: case_range_expression ::= constant_expression ... constant_expression
// //
case 362: { action. consumeExpressionUnaryOperator(IASTUnaryExpression.op_typeof); break; case 359: { action. consumeExpressionBinaryOperator(IASTBinaryExpression.op_assign); break;
} }
// //
// Rule 363: typeof_type_specifier ::= typeof ( type_id ) // Rule 363: typeof_type_specifier ::= typeof unary_expression
// //
case 363: { action. consumeExpressionTypeId(IASTTypeIdExpression.op_typeof); break; case 363: { action. consumeExpressionUnaryOperator(IASTUnaryExpression.op_typeof); break;
} }
// //
// Rule 364: declaration_specifiers ::= <openscope-ast> typeof_declaration_specifiers // Rule 364: typeof_type_specifier ::= typeof ( type_id )
// //
case 364: { action. consumeDeclarationSpecifiersTypeof(); break; case 364: { action. consumeExpressionTypeId(IASTTypeIdExpression.op_typeof); break;
} }
// //
// Rule 380: field_name_designator ::= identifier_token : // Rule 365: declaration_specifiers ::= <openscope-ast> typeof_declaration_specifiers
// //
case 380: { action. consumeDesignatorFieldGCC(); break; case 365: { action. consumeDeclarationSpecifiersTypeof(); break;
} }
// //
// Rule 381: array_range_designator ::= [ constant_expression ... constant_expression ] // Rule 381: field_name_designator ::= identifier_token :
// //
case 381: { action. consumeDesignatorArrayRange(); break; case 381: { action. consumeDesignatorFieldGCC(); break;
} }
// //
// Rule 382: designated_initializer ::= <openscope-ast> field_name_designator initializer // Rule 382: array_range_designator ::= [ constant_expression ... constant_expression ]
// //
case 382: { action. consumeInitializerDesignated(); break; case 382: { action. consumeDesignatorArrayRange(); break;
} }
// //
// Rule 384: no_sizeof_type_name_start ::= ERROR_TOKEN // Rule 383: designated_initializer ::= <openscope-ast> field_name_designator initializer
// //
case 384: { action. consumeEmpty(); break; case 383: { action. consumeInitializerDesignated(); break;
}
//
// Rule 384: block_item ::= normal_function_definition
//
case 384: { action. consumeStatementDeclaration(); break;
}
//
// Rule 386: no_sizeof_type_name_start ::= ERROR_TOKEN
//
case 386: { action. consumeEmpty(); break;
} }

View file

@ -15,7 +15,7 @@ package org.eclipse.cdt.internal.core.dom.lrparser.gcc;
public interface GCCSizeofExpressionParsersym { public interface GCCSizeofExpressionParsersym {
public final static int public final static int
TK_auto = 32, TK_auto = 30,
TK_break = 38, TK_break = 38,
TK_case = 39, TK_case = 39,
TK_char = 51, TK_char = 51,
@ -25,48 +25,48 @@ public interface GCCSizeofExpressionParsersym {
TK_do = 42, TK_do = 42,
TK_double = 52, TK_double = 52,
TK_else = 98, TK_else = 98,
TK_enum = 65, TK_enum = 63,
TK_extern = 33, TK_extern = 31,
TK_float = 53, TK_float = 53,
TK_for = 43, TK_for = 43,
TK_goto = 44, TK_goto = 44,
TK_if = 45, TK_if = 45,
TK_inline = 34, TK_inline = 32,
TK_int = 54, TK_int = 54,
TK_long = 55, TK_long = 55,
TK_register = 35, TK_register = 33,
TK_restrict = 26, TK_restrict = 26,
TK_return = 46, TK_return = 46,
TK_short = 56, TK_short = 56,
TK_signed = 57, TK_signed = 57,
TK_sizeof = 16, TK_sizeof = 17,
TK_static = 28, TK_static = 28,
TK_struct = 66, TK_struct = 64,
TK_switch = 47, TK_switch = 47,
TK_typedef = 36, TK_typedef = 34,
TK_union = 67, TK_union = 65,
TK_unsigned = 58, TK_unsigned = 58,
TK_void = 59, TK_void = 59,
TK_volatile = 25, TK_volatile = 25,
TK_while = 37, TK_while = 35,
TK__Bool = 60, TK__Bool = 60,
TK__Complex = 61, TK__Complex = 61,
TK__Imaginary = 62, TK__Imaginary = 62,
TK_integer = 17, TK_integer = 18,
TK_floating = 18, TK_floating = 19,
TK_charconst = 19, TK_charconst = 20,
TK_stringlit = 11, TK_stringlit = 11,
TK_identifier = 1, TK_identifier = 1,
TK_Completion = 5, TK_Completion = 5,
TK_EndOfCompletion = 3, TK_EndOfCompletion = 3,
TK_Invalid = 100, TK_Invalid = 100,
TK_LeftBracket = 30, TK_LeftBracket = 36,
TK_LeftParen = 2, TK_LeftParen = 2,
TK_LeftBrace = 20, TK_LeftBrace = 14,
TK_Dot = 70, TK_Dot = 70,
TK_Arrow = 85, TK_Arrow = 85,
TK_PlusPlus = 14, TK_PlusPlus = 15,
TK_MinusMinus = 15, TK_MinusMinus = 16,
TK_And = 12, TK_And = 12,
TK_Star = 6, TK_Star = 6,
TK_Plus = 9, TK_Plus = 9,
@ -75,8 +75,8 @@ public interface GCCSizeofExpressionParsersym {
TK_Bang = 22, TK_Bang = 22,
TK_Slash = 71, TK_Slash = 71,
TK_Percent = 72, TK_Percent = 72,
TK_RightShift = 63, TK_RightShift = 66,
TK_LeftShift = 64, TK_LeftShift = 67,
TK_LT = 73, TK_LT = 73,
TK_GT = 74, TK_GT = 74,
TK_LE = 75, TK_LE = 75,
@ -103,7 +103,7 @@ public interface GCCSizeofExpressionParsersym {
TK_OrAssign = 97, TK_OrAssign = 97,
TK_Comma = 49, TK_Comma = 49,
TK_RightBracket = 77, TK_RightBracket = 77,
TK_RightParen = 31, TK_RightParen = 37,
TK_RightBrace = 50, TK_RightBrace = 50,
TK_SemiColon = 27, TK_SemiColon = 27,
TK_typeof = 13, TK_typeof = 13,
@ -131,13 +131,13 @@ public interface GCCSizeofExpressionParsersym {
"stringlit", "stringlit",
"And", "And",
"typeof", "typeof",
"LeftBrace",
"PlusPlus", "PlusPlus",
"MinusMinus", "MinusMinus",
"sizeof", "sizeof",
"integer", "integer",
"floating", "floating",
"charconst", "charconst",
"LeftBrace",
"Tilde", "Tilde",
"Bang", "Bang",
"__alignof__", "__alignof__",
@ -147,14 +147,14 @@ public interface GCCSizeofExpressionParsersym {
"SemiColon", "SemiColon",
"static", "static",
"ERROR_TOKEN", "ERROR_TOKEN",
"LeftBracket",
"RightParen",
"auto", "auto",
"extern", "extern",
"inline", "inline",
"register", "register",
"typedef", "typedef",
"while", "while",
"LeftBracket",
"RightParen",
"break", "break",
"case", "case",
"continue", "continue",
@ -180,11 +180,11 @@ public interface GCCSizeofExpressionParsersym {
"_Bool", "_Bool",
"_Complex", "_Complex",
"_Imaginary", "_Imaginary",
"RightShift",
"LeftShift",
"enum", "enum",
"struct", "struct",
"union", "union",
"RightShift",
"LeftShift",
"DotDotDot", "DotDotDot",
"Assign", "Assign",
"Dot", "Dot",

View file

@ -17,9 +17,6 @@
name="UPC"> name="UPC">
<contentType id="org.eclipse.cdt.core.parser.upc.upcSource"/> <contentType id="org.eclipse.cdt.core.parser.upc.upcSource"/>
</language> </language>
<pdomLinkageFactory
class="org.eclipse.cdt.internal.core.pdom.dom.c.PDOMCLinkageFactory"
id="upc"/>
</extension> </extension>
<extension point="org.eclipse.ui.editors.templates"> <extension point="org.eclipse.ui.editors.templates">