1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-06-07 09:46:02 +02:00

fix for bug #194459, the UPC parser now has its own lexer, also fixes bug #195610

This commit is contained in:
Mike Kucera 2007-07-09 18:07:45 +00:00
parent 0c58b76bcf
commit e21c7036af
12 changed files with 1528 additions and 105 deletions

View file

@ -26,6 +26,7 @@ import org.eclipse.cdt.core.dom.c99.IASTNodeFactory;
import org.eclipse.cdt.core.dom.c99.IParserActionTokenProvider; import org.eclipse.cdt.core.dom.c99.IParserActionTokenProvider;
import org.eclipse.cdt.core.dom.parser.c99.ASTStack; import org.eclipse.cdt.core.dom.parser.c99.ASTStack;
import org.eclipse.cdt.core.dom.parser.c99.C99ParserAction; import org.eclipse.cdt.core.dom.parser.c99.C99ParserAction;
import org.eclipse.cdt.core.dom.parser.c99.ITokenMap;
import org.eclipse.cdt.core.dom.upc.ast.IUPCASTDeclSpecifier; import org.eclipse.cdt.core.dom.upc.ast.IUPCASTDeclSpecifier;
import org.eclipse.cdt.core.dom.upc.ast.IUPCASTForallStatement; import org.eclipse.cdt.core.dom.upc.ast.IUPCASTForallStatement;
import org.eclipse.cdt.core.dom.upc.ast.IUPCASTKeywordExpression; import org.eclipse.cdt.core.dom.upc.ast.IUPCASTKeywordExpression;
@ -44,8 +45,8 @@ public class UPCParserAction extends C99ParserAction {
private final ASTStack astStack; private final ASTStack astStack;
public UPCParserAction(IParserActionTokenProvider parser, String[] orderedTerminalSymbols) { public UPCParserAction(IParserActionTokenProvider parser, ITokenMap tokenMap) {
super(parser, orderedTerminalSymbols); super(parser, tokenMap);
this.astStack = super.getASTStack(); this.astStack = super.getASTStack();
this.nodeFactory = (UPCASTNodeFactory) super.getNodeFactory(); this.nodeFactory = (UPCASTNodeFactory) super.getNodeFactory();
} }

View file

@ -11,14 +11,16 @@
package org.eclipse.cdt.core.dom.upc; package org.eclipse.cdt.core.dom.upc;
import org.eclipse.cdt.core.dom.c99.BaseExtensibleLanguage; import org.eclipse.cdt.core.dom.c99.BaseExtensibleLanguage;
import org.eclipse.cdt.core.dom.c99.C99Language;
import org.eclipse.cdt.core.dom.c99.IKeywordMap; import org.eclipse.cdt.core.dom.c99.IKeywordMap;
import org.eclipse.cdt.core.dom.c99.ILexerFactory;
import org.eclipse.cdt.core.dom.c99.IParser; import org.eclipse.cdt.core.dom.c99.IParser;
import org.eclipse.cdt.core.dom.c99.IPreprocessorExtensionConfiguration; import org.eclipse.cdt.core.dom.c99.IPreprocessorExtensionConfiguration;
import org.eclipse.cdt.core.dom.parser.c99.C99KeywordMap;
import org.eclipse.cdt.core.dom.parser.c99.GCCPreprocessorExtensionConfiguration; import org.eclipse.cdt.core.dom.parser.c99.GCCPreprocessorExtensionConfiguration;
import org.eclipse.cdt.core.dom.parser.c99.ITokenMap;
import org.eclipse.cdt.core.dom.parser.upc.UPCKeywordMap; import org.eclipse.cdt.core.dom.parser.upc.UPCKeywordMap;
import org.eclipse.cdt.internal.core.dom.parser.upc.UPCLexerFactory;
import org.eclipse.cdt.internal.core.dom.parser.upc.UPCParser; import org.eclipse.cdt.internal.core.dom.parser.upc.UPCParser;
import org.eclipse.cdt.internal.core.dom.parser.upc.UPCTokenMap;
/** /**
@ -37,8 +39,8 @@ public class UPCLanguage extends BaseExtensibleLanguage {
public static final String PLUGIN_ID = "org.eclipse.cdt.core.parser.upc"; //$NON-NLS-1$ public static final String PLUGIN_ID = "org.eclipse.cdt.core.parser.upc"; //$NON-NLS-1$
public static final String ID = PLUGIN_ID + ".upc"; //$NON-NLS-1$ public static final String ID = PLUGIN_ID + ".upc"; //$NON-NLS-1$
private static UPCKeywordMap keywordMap = new UPCKeywordMap(); private static final UPCKeywordMap keywordMap = new UPCKeywordMap();
private static final UPCLanguage myDefault = new UPCLanguage(); private static final UPCLanguage myDefault = new UPCLanguage();
public static UPCLanguage getDefault() { public static UPCLanguage getDefault() {
@ -67,4 +69,11 @@ public class UPCLanguage extends BaseExtensibleLanguage {
return GCC_PREPROCESSOR_EXTENSION; return GCC_PREPROCESSOR_EXTENSION;
} }
protected ILexerFactory getLexerFactory() {
return new UPCLexerFactory();
}
protected ITokenMap getTokenMap() {
return new UPCTokenMap();
}
} }

View file

@ -0,0 +1,30 @@
-----------------------------------------------------------------------------------
-- Copyright (c) 2006, 2007 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
-----------------------------------------------------------------------------------
%Options la=1
%options package=org.eclipse.cdt.internal.core.dom.parser.upc
%options template=LexerTemplateD.g
%options export_terminals=("UPCLexerBaseexp.java", "TK_")
%options verbose
%Options list
%options single_productions
$Import
C99Lexer.g
$End
$Globals
/.
import org.eclipse.cdt.internal.core.dom.parser.c99.preprocessor.Token;
./
$End

View file

@ -0,0 +1,518 @@
/*******************************************************************************
* Copyright (c) 2006, 2007 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.parser.upc;
import lpg.lpgjavaruntime.*;
import org.eclipse.cdt.core.parser.CodeReader;
import org.eclipse.cdt.internal.core.dom.parser.c99.C99LexerKind;
import org.eclipse.cdt.internal.core.dom.parser.c99.preprocessor.TokenList;
import org.eclipse.cdt.internal.core.dom.parser.c99.preprocessor.Token;
import org.eclipse.cdt.core.dom.c99.ILexer;
import org.eclipse.cdt.internal.core.dom.parser.c99.preprocessor.Token;
public class UPCLexer extends LpgLexStream implements UPCParsersym, UPCLexersym, RuleAction , ILexer
{
private static ParseTable prs = new UPCLexerprs();
private PrsStream prsStream;
private LexParser lexParser = new LexParser(this, prs, this);
public PrsStream getPrsStream() { return prsStream; }
public int getToken(int i) { return lexParser.getToken(i); }
public int getRhsFirstTokenIndex(int i) { return lexParser.getFirstToken(i); }
public int getRhsLastTokenIndex(int i) { return lexParser.getLastToken(i); }
public int getLeftSpan() { return lexParser.getFirstToken(); }
public int getRightSpan() { return lexParser.getLastToken(); }
public UPCLexer(String filename, int tab) throws java.io.IOException
{
super(filename, tab);
}
public UPCLexer(char[] input_chars, String filename, int tab)
{
super(input_chars, filename, tab);
}
public UPCLexer(char[] input_chars, String filename)
{
this(input_chars, filename, 1);
}
public UPCLexer() {}
public String[] orderedExportedSymbols() { return UPCParsersym.orderedTerminalSymbols; }
public LexStream getLexStream() { return (LexStream) this; }
public void lexer(PrsStream prsStream)
{
lexer(null, prsStream);
}
public void lexer(Monitor monitor, PrsStream prsStream)
{
if (getInputChars() == null)
throw new NullPointerException("LexStream was not initialized");//$NON-NLS-1$
this.prsStream = prsStream;
prsStream.makeToken(0, 0, 0); // Token list must start with a bad token
lexParser.parseCharacters(monitor); // Lex the input characters
int i = getStreamIndex();
prsStream.makeToken(i, i, TK_EOF_TOKEN); // and end with the end of file token
prsStream.setStreamLength(prsStream.getSize());
return;
}
private TokenList tokenList = null;
private boolean returnCommentTokens = false;
private char[] input = null; // the input character buffer
public UPCLexer(CodeReader reader) {
super(reader.buffer, new String(reader.filename));
}
// defined in interface ILexer
public synchronized TokenList lex(int options) {
if((OPTION_GENERATE_COMMENT_TOKENS & options) != 0)
returnCommentTokens = true;
tokenList = new TokenList();
input = super.getInputChars();
lexParser.parseCharacters(null); // Lex the input characters
TokenList result = tokenList;
tokenList = null;
input = null;
return result;
}
protected void makeToken(int kind) {
// ignore comments if desired
if(!returnCommentTokens && (kind == TK_MultiLineComment || kind == TK_SingleLineComment))
return;
int startOffset = lexParser.getFirstToken();
int endOffset = lexParser.getLastToken();
// an adjustment for trigraphs, commented out for optimization purposes
//if(kind != C99Parsersym.TK_Question && startOffset == endOffset && input[startOffset] == '?') {
// // The token starts with a '?' but its not a question token, then it must be a trigraph.
// endOffset += 2; // make sure the toString() method of the token returns the entire trigraph sequence
//}
tokenList.add(new Token(startOffset, endOffset, kind, input));
}
public void reportError(int leftOffset, int rightOffset) {
Token token = new Token(leftOffset, rightOffset, TK_Invalid, getInputChars());
tokenList.add(token);
}
public int getKind(int i) {
return C99LexerKind.getKind(this, i);
}
public void ruleAction( int ruleNumber)
{
switch(ruleNumber)
{
//
// Rule 1: Token ::= identifier
//
case 1: { makeToken(TK_identifier); break;
}
//
// Rule 2: Token ::= integer-constant
//
case 2: { makeToken(TK_integer); break;
}
//
// Rule 3: Token ::= floating-constant
//
case 3: { makeToken(TK_floating); break;
}
//
// Rule 4: Token ::= character-constant
//
case 4: { makeToken(TK_charconst); break;
}
//
// Rule 5: Token ::= string-literal
//
case 5: { makeToken(TK_stringlit); break;
}
//
// Rule 6: Token ::= [
//
case 6: { makeToken(TK_LeftBracket); break;
}
//
// Rule 7: Token ::= ]
//
case 7: { makeToken(TK_RightBracket); break;
}
//
// Rule 8: Token ::= (
//
case 8: { makeToken(TK_LeftParen); break;
}
//
// Rule 9: Token ::= )
//
case 9: { makeToken(TK_RightParen); break;
}
//
// Rule 10: Token ::= {
//
case 10: { makeToken(TK_LeftBrace); break;
}
//
// Rule 11: Token ::= }
//
case 11: { makeToken(TK_RightBrace); break;
}
//
// Rule 12: Token ::= .
//
case 12: { makeToken(TK_Dot); break;
}
//
// Rule 13: Token ::= - >
//
case 13: { makeToken(TK_Arrow); break;
}
//
// Rule 14: Token ::= + +
//
case 14: { makeToken(TK_PlusPlus); break;
}
//
// Rule 15: Token ::= - -
//
case 15: { makeToken(TK_MinusMinus); break;
}
//
// Rule 16: Token ::= &
//
case 16: { makeToken(TK_And); break;
}
//
// Rule 17: Token ::= *
//
case 17: { makeToken(TK_Star); break;
}
//
// Rule 18: Token ::= +
//
case 18: { makeToken(TK_Plus); break;
}
//
// Rule 19: Token ::= -
//
case 19: { makeToken(TK_Minus); break;
}
//
// Rule 20: Token ::= ~
//
case 20: { makeToken(TK_Tilde); break;
}
//
// Rule 21: Token ::= !
//
case 21: { makeToken(TK_Bang); break;
}
//
// Rule 22: Token ::= /
//
case 22: { makeToken(TK_Slash); break;
}
//
// Rule 23: Token ::= %
//
case 23: { makeToken(TK_Percent); break;
}
//
// Rule 24: Token ::= < <
//
case 24: { makeToken(TK_LeftShift); break;
}
//
// Rule 25: Token ::= > >
//
case 25: { makeToken(TK_RightShift); break;
}
//
// Rule 26: Token ::= <
//
case 26: { makeToken(TK_LT); break;
}
//
// Rule 27: Token ::= >
//
case 27: { makeToken(TK_GT); break;
}
//
// Rule 28: Token ::= < =
//
case 28: { makeToken(TK_LE); break;
}
//
// Rule 29: Token ::= > =
//
case 29: { makeToken(TK_GE); break;
}
//
// Rule 30: Token ::= = =
//
case 30: { makeToken(TK_EQ); break;
}
//
// Rule 31: Token ::= ! =
//
case 31: { makeToken(TK_NE); break;
}
//
// Rule 32: Token ::= ^
//
case 32: { makeToken(TK_Caret); break;
}
//
// Rule 33: Token ::= |
//
case 33: { makeToken(TK_Or); break;
}
//
// Rule 34: Token ::= & &
//
case 34: { makeToken(TK_AndAnd); break;
}
//
// Rule 35: Token ::= | |
//
case 35: { makeToken(TK_OrOr); break;
}
//
// Rule 36: Token ::= ?
//
case 36: { makeToken(TK_Question); break;
}
//
// Rule 37: Token ::= :
//
case 37: { makeToken(TK_Colon); break;
}
//
// Rule 38: Token ::= ;
//
case 38: { makeToken(TK_SemiColon); break;
}
//
// Rule 39: Token ::= . . .
//
case 39: { makeToken(TK_DotDotDot); break;
}
//
// Rule 40: Token ::= =
//
case 40: { makeToken(TK_Assign); break;
}
//
// Rule 41: Token ::= * =
//
case 41: { makeToken(TK_StarAssign); break;
}
//
// Rule 42: Token ::= / =
//
case 42: { makeToken(TK_SlashAssign); break;
}
//
// Rule 43: Token ::= % =
//
case 43: { makeToken(TK_PercentAssign); break;
}
//
// Rule 44: Token ::= + =
//
case 44: { makeToken(TK_PlusAssign); break;
}
//
// Rule 45: Token ::= - =
//
case 45: { makeToken(TK_MinusAssign); break;
}
//
// Rule 46: Token ::= < < =
//
case 46: { makeToken(TK_LeftShiftAssign); break;
}
//
// Rule 47: Token ::= > > =
//
case 47: { makeToken(TK_RightShiftAssign); break;
}
//
// Rule 48: Token ::= & =
//
case 48: { makeToken(TK_AndAssign); break;
}
//
// Rule 49: Token ::= ^ =
//
case 49: { makeToken(TK_CaretAssign); break;
}
//
// Rule 50: Token ::= | =
//
case 50: { makeToken(TK_OrAssign); break;
}
//
// Rule 51: Token ::= ,
//
case 51: { makeToken(TK_Comma); break;
}
//
// Rule 52: Token ::= #
//
case 52: { makeToken(TK_Hash); break;
}
//
// Rule 53: Token ::= # #
//
case 53: { makeToken(TK_HashHash); break;
}
//
// Rule 54: Token ::= < :
//
case 54: { makeToken(TK_LeftBracket); break;
}
//
// Rule 55: Token ::= : >
//
case 55: { makeToken(TK_RightBracket); break;
}
//
// Rule 56: Token ::= < %
//
case 56: { makeToken(TK_LeftBrace); break;
}
//
// Rule 57: Token ::= % >
//
case 57: { makeToken(TK_RightBrace); break;
}
//
// Rule 58: Token ::= % :
//
case 58: { makeToken(TK_Hash); break;
}
//
// Rule 59: Token ::= % : % :
//
case 59: { makeToken(TK_HashHash); break;
}
//
// Rule 217: Token ::= NewLine
//
case 217: { makeToken(TK_NewLine); break;
}
//
// Rule 219: Token ::= SLC
//
case 219: { makeToken(TK_SingleLineComment); break;
}
//
// Rule 220: Token ::= MLC
//
case 220: { makeToken(TK_MultiLineComment); break;
}
default:
break;
}
return;
}
}

View file

@ -0,0 +1,26 @@
/*******************************************************************************
* Copyright (c) 2006, 2007 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.internal.core.dom.parser.upc;
import org.eclipse.cdt.core.dom.c99.ILexer;
import org.eclipse.cdt.core.dom.c99.ILexerFactory;
import org.eclipse.cdt.core.parser.CodeReader;
/**
* Creates new lexers for tokenizing included files.
*/
public class UPCLexerFactory implements ILexerFactory {
public ILexer createLexer(CodeReader reader) {
return new UPCLexer(reader);
}
}

View file

@ -0,0 +1,580 @@
/*******************************************************************************
* Copyright (c) 2006, 2007 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.parser.upc;
public class UPCLexerprs implements lpg.lpgjavaruntime.ParseTable, UPCLexersym {
public interface IsKeyword {
public final static byte isKeyword[] = {0,
0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0
};
};
public final static byte isKeyword[] = IsKeyword.isKeyword;
public final boolean isKeyword(int index) { return isKeyword[index] != 0; }
public interface BaseCheck {
public final static byte baseCheck[] = {0,
1,1,1,1,1,1,1,1,1,1,
1,1,2,2,2,1,1,1,1,1,
1,1,1,2,2,1,1,2,2,2,
2,1,1,2,2,1,1,1,3,1,
2,2,2,2,2,3,3,2,2,2,
1,1,2,2,2,2,2,2,4,1,
1,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,1,1,
1,2,2,2,5,1,2,3,2,2,
0,1,2,2,1,1,3,4,4,1,
2,1,2,1,2,2,2,1,2,2,
1,2,1,2,1,1,1,1,2,2,
1,1,1,2,3,2,2,3,3,4,
3,4,1,2,2,2,3,3,2,3,
2,1,1,2,2,3,3,2,3,2,
1,2,1,1,1,1,3,4,1,2,
1,1,1,1,1,1,2,2,2,2,
2,2,2,2,2,2,2,2,3,2,
3,3,4,1,2,1,1
};
};
public final static byte baseCheck[] = BaseCheck.baseCheck;
public final int baseCheck(int index) { return baseCheck[index]; }
public final static byte rhs[] = baseCheck;
public final int rhs(int index) { return rhs[index]; };
public interface BaseAction {
public final static char baseAction[] = {
31,31,31,31,31,31,31,31,31,31,
31,31,31,31,31,31,31,31,31,31,
31,31,31,31,31,31,31,31,31,31,
31,31,31,31,31,31,31,31,31,31,
31,31,31,31,31,31,31,31,31,31,
31,31,31,31,31,31,31,31,31,31,
2,2,2,2,2,2,2,2,2,2,
2,2,2,2,2,2,2,2,2,2,
2,2,2,2,2,2,2,2,2,2,
2,2,2,2,2,2,2,2,2,2,
2,2,2,2,2,2,2,2,2,2,
2,2,23,23,23,1,1,1,1,1,
1,1,1,1,1,37,37,37,37,37,
37,37,37,3,3,3,3,3,3,3,
3,3,3,3,3,3,4,4,4,4,
4,4,4,4,4,4,4,4,4,4,
4,4,4,4,4,4,4,4,4,4,
4,38,38,38,38,38,38,12,12,12,
12,12,12,12,12,12,12,13,13,13,
13,13,13,13,13,13,13,14,14,14,
14,39,39,39,39,39,39,39,24,24,
24,24,24,24,24,24,24,31,31,31,
31,40,40,41,41,42,44,44,43,43,
43,43,32,32,32,25,25,6,6,19,
33,33,33,33,45,46,47,47,26,26,
26,26,26,26,26,15,15,21,21,22,
22,34,34,48,48,48,48,48,48,49,
49,49,49,5,5,50,50,50,27,27,
27,27,16,16,51,51,51,28,28,28,
28,20,20,11,11,11,11,35,35,29,
29,17,17,7,7,7,7,8,8,8,
8,8,8,8,8,8,8,8,9,10,
36,36,36,36,30,30,18,18,201,578,
112,1422,365,357,236,1212,365,398,177,178,
1577,179,583,306,326,303,304,305,99,327,
199,235,1116,232,222,324,1088,1380,274,350,
501,2,3,4,5,1433,274,426,340,493,
220,1222,318,521,519,513,261,262,371,980,
187,188,266,189,437,306,301,303,304,305,
1170,486,302,689,177,178,299,179,404,306,
326,303,304,305,1391,327,1256,133,445,319,
1240,324,980,187,188,265,189,1276,306,301,
303,304,305,459,1613,302,495,177,178,299,
179,1573,306,326,303,304,305,1585,327,1324,
133,472,292,1601,325,592,187,188,268,189,
1616,306,301,303,304,305,1197,1617,302,786,
177,178,300,179,1590,306,326,303,304,305,
1614,327,883,187,188,270,189,325,306,301,
303,304,305,1372,464,302,1,208,209,300,
210,1451,626,301,201,202,626,171,254,1277,
211,1077,234,112,101,208,209,236,210,1607,
230,1473,274,1183,133,1580,291,1307,211,1270,
1400,1574,1409,511,235,1221,233,511,228,1228,
504,204,224,552,574,252,574,1596,593,1620,
520,483,520,483,1621,243,1203,241,272,1409,
624,1226,1150,133,624,292,1256,133,1164,291,
1256,133,1619,602,456,599,1256,133,1171,602,
1409,632,1409,634,1105,632,439,634,1572,589,
537,1296,133,1194,291,237,606,642,609,1256,
133,642,602,1462,628,249,250,642,628,1462,
630,612,1256,133,630,616,1462,636,238,1462,
638,636,1352,133,638,292,1256,133,642,620,
1256,133,642,239,1484,274,1495,274,1506,274,
1517,274,1528,274,1539,274,1550,274,1561,274,
642,642
};
};
public final static char baseAction[] = BaseAction.baseAction;
public final int baseAction(int index) { return baseAction[index]; }
public final static char lhs[] = baseAction;
public final int lhs(int index) { return lhs[index]; };
public interface TermCheck {
public final static byte termCheck[] = {0,
0,1,2,3,4,5,6,7,8,9,
10,11,12,13,14,15,16,17,18,19,
20,21,22,23,24,25,26,27,28,29,
30,31,32,33,34,35,36,37,38,39,
40,41,42,43,44,45,46,47,48,49,
50,51,52,53,54,55,56,57,58,59,
60,61,62,63,64,65,66,67,68,69,
70,71,72,73,74,75,76,77,78,79,
80,81,82,83,84,85,86,87,88,89,
90,91,92,93,94,95,96,97,0,99,
0,1,2,3,4,5,6,7,8,9,
10,11,12,13,14,15,16,17,18,19,
20,21,22,23,24,25,26,27,28,29,
30,31,32,33,34,35,36,37,38,39,
40,41,42,43,44,45,46,47,48,49,
50,51,52,53,54,55,56,57,58,59,
60,61,62,63,64,65,66,67,68,69,
70,71,72,73,74,75,76,77,78,79,
80,81,82,83,84,85,86,87,88,89,
90,91,92,93,94,95,96,97,0,99,
0,1,2,3,4,5,6,7,8,9,
10,11,12,13,14,15,16,17,18,19,
20,21,22,23,24,25,26,27,28,29,
30,31,32,33,34,35,36,37,38,39,
40,41,42,43,44,45,46,47,48,49,
50,51,52,53,54,55,56,57,58,59,
60,61,62,63,64,65,66,67,68,69,
70,71,72,73,74,75,76,77,78,79,
80,81,82,83,84,85,86,87,88,89,
90,91,92,93,94,95,98,97,0,99,
0,1,2,3,4,5,6,7,8,9,
10,11,12,13,14,15,16,17,18,19,
20,21,22,23,24,25,26,27,28,29,
30,31,32,33,34,35,36,37,38,39,
40,41,42,43,44,45,46,47,48,49,
50,51,52,53,54,55,56,57,58,59,
60,61,62,63,64,65,66,67,68,69,
70,71,72,73,74,75,76,77,78,79,
80,81,82,83,84,85,86,87,88,89,
90,91,92,93,94,95,96,0,1,2,
3,4,5,6,7,8,9,10,11,12,
13,14,15,16,17,18,19,20,21,22,
23,24,25,26,27,28,29,30,31,32,
33,34,35,36,37,38,39,40,41,42,
43,44,45,46,47,48,49,50,51,52,
53,54,55,56,57,58,59,60,61,62,
63,64,65,66,67,68,69,70,71,72,
73,74,75,76,77,78,79,80,81,82,
83,84,85,86,87,88,89,90,91,92,
93,94,95,96,0,1,2,3,4,5,
6,7,8,9,10,11,12,13,14,15,
16,17,18,19,20,21,22,23,24,25,
26,27,28,29,30,31,32,33,34,35,
36,37,38,39,40,41,42,43,44,45,
46,47,48,49,50,51,52,53,54,55,
56,57,58,59,60,61,62,63,64,65,
66,67,68,69,70,71,72,73,74,75,
76,77,78,79,80,81,82,83,84,85,
86,87,88,89,90,91,92,93,94,95,
96,0,1,2,3,4,5,6,7,8,
9,10,11,12,13,14,15,16,17,18,
19,20,21,22,23,24,25,26,27,28,
29,30,31,32,33,34,35,36,37,38,
39,40,41,42,43,44,45,46,47,48,
49,50,51,52,53,54,55,56,57,58,
59,60,61,62,63,64,65,66,67,68,
69,70,71,72,73,74,75,76,77,78,
79,80,81,82,83,84,85,86,87,88,
89,90,91,92,93,94,95,96,0,1,
2,3,4,5,6,7,8,9,10,11,
12,13,14,15,16,17,18,19,20,21,
22,23,24,25,26,27,28,29,30,31,
32,33,34,35,36,37,38,39,40,41,
42,43,44,45,46,47,48,49,50,51,
52,53,54,55,56,57,58,59,60,61,
62,63,64,65,66,67,68,69,70,71,
72,73,74,75,76,77,78,79,80,81,
82,83,84,85,86,87,88,89,90,91,
92,93,94,95,96,0,1,2,3,4,
5,6,7,8,9,10,11,12,13,14,
15,16,17,18,19,20,21,22,23,24,
25,26,27,28,29,30,31,32,33,34,
35,36,37,38,39,40,41,42,43,44,
45,46,47,48,49,50,51,52,53,54,
55,56,57,58,59,60,61,62,63,64,
65,66,67,68,69,70,71,72,73,74,
75,76,77,78,79,80,81,82,83,84,
85,86,87,88,89,90,91,92,93,94,
95,96,0,1,2,3,4,5,6,7,
8,9,10,11,12,13,14,15,16,17,
18,19,20,21,22,23,24,25,26,27,
28,29,30,31,32,33,34,35,36,37,
38,39,40,41,42,43,44,45,46,47,
48,49,50,51,52,53,54,55,56,57,
58,59,60,61,62,63,64,65,66,67,
68,69,70,71,72,73,74,75,76,77,
78,79,80,81,82,83,84,85,86,87,
88,89,90,91,92,93,94,95,96,0,
1,2,3,4,5,6,7,8,9,10,
11,12,13,14,15,16,17,18,19,20,
21,22,23,24,25,26,27,28,29,30,
31,32,33,34,35,36,37,38,39,40,
41,42,43,44,45,46,47,48,49,50,
51,52,53,54,55,56,57,58,59,60,
61,62,63,64,65,66,67,68,69,70,
71,72,73,74,75,76,77,78,79,80,
81,82,0,84,85,86,87,88,89,90,
91,92,93,94,95,96,0,1,2,3,
4,5,6,7,8,9,10,0,12,13,
14,15,16,17,18,19,20,21,22,23,
24,25,26,27,0,0,30,31,32,0,
34,35,36,37,38,0,29,41,14,15,
44,45,46,47,48,49,50,51,52,53,
54,55,56,57,58,59,60,61,62,63,
64,65,66,67,68,69,70,71,72,0,
1,2,3,4,5,6,7,8,9,10,
84,12,13,0,0,16,17,18,19,0,
0,22,23,24,25,26,27,28,15,30,
11,32,0,1,2,3,4,5,6,7,
8,9,10,0,12,13,0,82,16,17,
18,19,0,33,22,23,24,25,26,27,
28,0,1,2,3,4,5,6,7,8,
0,0,0,12,0,0,30,0,32,18,
19,20,21,12,13,14,15,16,17,0,
20,21,31,0,42,34,35,36,37,80,
11,0,41,28,43,0,1,2,3,4,
5,6,7,8,9,10,0,12,13,0,
43,16,17,18,19,0,0,22,23,24,
25,26,27,14,15,0,11,11,0,20,
21,98,81,0,83,0,1,2,3,4,
5,6,7,8,9,10,0,12,13,0,
83,16,17,18,19,39,0,22,23,24,
25,26,27,0,1,2,3,4,5,6,
7,8,9,10,0,12,13,31,0,16,
17,18,19,0,38,22,23,24,25,26,
27,0,1,2,3,4,5,6,7,8,
9,10,0,12,13,0,0,16,17,18,
19,0,0,22,23,24,25,26,27,0,
1,2,3,4,5,6,7,8,9,10,
0,20,21,0,0,16,17,0,0,0,
0,0,12,13,14,15,0,28,0,1,
2,3,4,5,6,7,8,9,10,20,
21,0,1,2,3,4,5,6,7,8,
9,10,0,1,2,3,4,5,6,7,
8,9,10,0,0,0,0,39,40,28,
0,1,2,3,4,5,6,7,8,9,
10,0,1,2,3,4,5,6,7,8,
9,10,0,1,2,3,4,5,6,7,
8,9,10,0,1,2,3,4,5,6,
7,8,9,10,0,1,2,3,4,5,
6,7,8,9,10,0,1,2,3,4,
5,6,7,8,9,10,0,1,2,3,
4,5,6,7,8,9,10,0,1,2,
3,4,5,6,7,8,9,10,0,1,
2,3,4,5,6,7,8,9,10,0,
1,2,3,4,5,6,7,8,9,10,
0,1,2,3,4,5,6,7,8,9,
10,0,0,0,0,0,0,0,0,0,
0,0,0,11,0,14,15,14,15,0,
11,20,21,20,21,0,12,13,14,15,
0,12,13,14,15,33,0,12,13,14,
15,11,0,0,42,0,0,11,0,0,
0,0,0,11,11,0,11,11,0,29,
11,11,14,33,0,29,0,0,0,0,
0,29,0,0,0,0,40,0,76,73,
74,75,0,0,0,0,77,78,0,0,
0,0,0,0,0,0,0,0,0,98,
0,0,0,97,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,
0,0,79,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0
};
};
public final static byte termCheck[] = TermCheck.termCheck;
public final int termCheck(int index) { return termCheck[index]; }
public interface TermAction {
public final static char termAction[] = {0,
642,757,758,759,760,761,762,763,764,765,
766,801,707,733,713,739,706,732,702,703,
722,748,704,705,728,729,730,731,797,802,
717,725,743,798,715,719,721,723,751,794,
796,857,790,856,708,709,710,711,712,714,
716,718,720,724,726,727,734,735,736,737,
738,740,741,742,744,745,746,747,749,750,
752,753,807,839,841,842,800,871,504,791,
809,803,789,855,812,792,793,804,805,808,
810,811,788,806,799,795,854,840,231,858,
642,757,758,759,760,761,762,763,764,765,
766,801,707,733,713,739,706,732,702,703,
722,748,704,705,728,729,730,731,797,802,
717,725,743,798,715,719,721,723,751,794,
796,857,790,856,708,709,710,711,712,714,
716,718,720,724,726,727,734,735,736,737,
738,740,741,742,744,745,746,747,749,750,
752,753,807,839,841,842,800,867,869,791,
809,803,789,855,812,792,793,804,805,808,
810,811,788,806,799,795,854,840,642,858,
642,517,758,759,760,761,762,763,764,765,
766,417,707,733,713,529,706,732,702,703,
722,748,704,705,728,729,730,731,331,424,
717,725,743,356,715,719,721,723,751,499,
509,525,443,337,708,709,710,711,712,714,
716,718,720,724,726,727,734,735,736,737,
738,740,741,742,744,745,746,747,749,750,
752,753,755,839,841,842,431,515,457,470,
390,678,352,379,756,650,651,648,649,652,
653,662,450,410,680,693,641,840,642,859,
219,757,758,759,760,761,762,763,764,765,
766,801,707,733,713,739,706,732,702,703,
722,748,704,705,728,729,730,731,797,802,
717,725,743,798,715,719,721,723,751,794,
796,816,790,815,708,709,710,711,712,714,
716,718,720,724,726,727,734,735,736,737,
738,740,741,742,744,745,746,747,749,750,
752,753,807,849,847,848,800,817,818,791,
809,803,789,814,812,792,793,804,805,808,
810,811,788,806,799,795,845,642,757,758,
759,760,761,762,763,764,765,766,801,707,
733,713,739,706,732,702,703,722,748,704,
705,728,729,730,731,797,802,717,725,743,
798,715,719,721,723,751,794,796,335,790,
962,708,709,710,711,712,714,716,718,720,
724,726,727,734,735,736,737,738,740,741,
742,744,745,746,747,749,750,752,753,807,
828,826,827,800,824,825,791,809,803,789,
823,812,792,793,804,805,808,810,811,788,
806,799,795,822,642,757,758,759,760,761,
762,763,764,765,766,801,707,733,713,739,
706,732,702,703,722,748,704,705,728,729,
730,731,797,802,717,725,743,798,715,719,
721,723,751,794,796,335,790,963,708,709,
710,711,712,714,716,718,720,724,726,727,
734,735,736,737,738,740,741,742,744,745,
746,747,749,750,752,753,807,828,826,827,
800,824,825,791,809,803,789,823,812,792,
793,804,805,808,810,811,788,806,799,795,
822,642,757,758,759,760,761,762,763,764,
765,766,801,707,733,713,739,706,732,702,
703,722,748,704,705,728,729,730,731,797,
802,717,725,743,798,715,719,721,723,751,
794,796,335,790,833,708,709,710,711,712,
714,716,718,720,724,726,727,734,735,736,
737,738,740,741,742,744,745,746,747,749,
750,752,753,807,838,836,837,800,834,835,
791,809,803,789,939,812,792,793,804,805,
808,810,811,788,806,799,795,832,642,757,
758,759,760,761,762,763,764,765,766,801,
707,733,713,739,706,732,702,703,722,748,
704,705,728,729,730,731,797,802,717,725,
743,798,715,719,721,723,751,794,796,335,
790,964,708,709,710,711,712,714,716,718,
720,724,726,727,734,735,736,737,738,740,
741,742,744,745,746,747,749,750,752,753,
807,828,826,827,800,824,825,791,809,803,
789,823,812,792,793,804,805,808,810,811,
788,806,799,795,822,642,757,758,759,760,
761,762,763,764,765,766,801,707,733,713,
739,706,732,702,703,722,748,704,705,728,
729,730,731,797,802,717,725,743,798,715,
719,721,723,751,794,796,335,790,965,708,
709,710,711,712,714,716,718,720,724,726,
727,734,735,736,737,738,740,741,742,744,
745,746,747,749,750,752,753,807,828,826,
827,800,824,825,791,809,803,789,823,812,
792,793,804,805,808,810,811,788,806,799,
795,822,642,757,758,759,760,761,762,763,
764,765,766,801,707,733,713,739,706,732,
702,703,722,748,704,705,728,729,730,731,
797,802,717,725,743,798,715,719,721,723,
751,794,796,335,790,833,708,709,710,711,
712,714,716,718,720,724,726,727,734,735,
736,737,738,740,741,742,744,745,746,747,
749,750,752,753,807,838,836,837,800,834,
835,791,809,803,789,940,812,792,793,804,
805,808,810,811,788,806,799,795,832,642,
757,758,759,760,761,762,763,764,765,766,
801,707,733,713,739,706,732,702,703,722,
748,704,705,728,729,730,731,797,802,717,
725,743,798,715,719,721,723,751,794,796,
335,790,833,708,709,710,711,712,714,716,
718,720,724,726,727,734,735,736,737,738,
740,741,742,744,745,746,747,749,750,752,
753,807,838,836,837,800,834,835,791,809,
803,789,642,812,792,793,804,805,808,810,
811,788,806,799,795,832,1,757,758,759,
760,761,762,763,764,765,766,37,707,733,
713,739,706,732,702,703,722,748,704,705,
728,729,730,731,248,642,717,725,743,642,
715,719,721,723,751,52,697,525,562,558,
708,709,710,711,712,714,716,718,720,724,
726,727,734,735,736,737,738,740,741,742,
744,745,746,747,749,750,752,753,755,245,
757,758,759,760,761,762,763,764,765,766,
756,781,787,258,642,780,786,776,777,33,
642,778,779,782,783,784,785,581,902,572,
692,570,642,757,758,759,760,761,762,763,
764,765,766,221,781,787,642,695,780,786,
776,777,58,701,778,779,782,783,784,785,
556,642,767,768,769,770,771,772,773,774,
642,263,642,955,642,642,572,97,570,953,
954,566,560,935,937,936,938,549,522,32,
566,560,406,642,568,956,957,958,959,677,
691,642,952,681,950,642,757,758,759,760,
761,762,763,764,765,766,642,781,787,242,
393,780,786,776,777,40,18,778,779,782,
783,784,785,562,558,642,672,686,642,897,
898,218,951,642,949,285,757,758,759,760,
761,762,763,764,765,766,115,781,787,642,
412,780,786,776,777,656,642,778,779,782,
783,784,785,284,757,758,759,760,761,762,
763,764,765,766,642,781,787,888,642,780,
786,776,777,642,889,778,779,782,783,784,
785,286,757,758,759,760,761,762,763,764,
765,766,642,781,787,642,642,780,786,776,
777,253,642,778,779,782,783,784,785,244,
757,758,759,760,761,762,763,764,765,766,
264,897,898,642,642,549,522,642,642,251,
642,642,935,937,936,938,642,491,642,757,
758,759,760,761,762,763,764,765,766,897,
898,12,757,758,759,760,761,762,763,764,
765,766,275,757,758,759,760,761,762,763,
764,765,766,642,642,642,642,924,925,551,
276,757,758,759,760,761,762,763,764,765,
766,642,757,758,759,760,761,762,763,764,
765,766,281,757,758,759,760,761,762,763,
764,765,766,279,757,758,759,760,761,762,
763,764,765,766,277,757,758,759,760,761,
762,763,764,765,766,280,757,758,759,760,
761,762,763,764,765,766,278,757,758,759,
760,761,762,763,764,765,766,290,757,758,
759,760,761,762,763,764,765,766,288,757,
758,759,760,761,762,763,764,765,766,289,
757,758,759,760,761,762,763,764,765,766,
287,757,758,759,760,761,762,763,764,765,
766,273,26,240,642,642,218,642,642,22,
642,642,642,670,267,244,244,562,558,269,
684,244,244,897,898,271,935,937,936,938,
23,935,937,936,938,696,19,935,937,936,
938,685,27,16,698,21,17,687,257,25,
24,642,642,671,690,642,673,683,642,699,
689,688,901,546,642,655,642,642,642,642,
642,539,642,642,642,642,657,642,544,839,
841,842,642,642,642,642,865,348,642,642,
642,642,642,642,642,642,642,642,642,244,
642,642,642,840,642,642,642,642,642,642,
642,642,642,642,642,642,642,642,642,642,
642,642,676
};
};
public final static char termAction[] = TermAction.termAction;
public final int termAction(int index) { return termAction[index]; }
public final int asb(int index) { return 0; }
public final int asr(int index) { return 0; }
public final int nasb(int index) { return 0; }
public final int nasr(int index) { return 0; }
public final int terminalIndex(int index) { return 0; }
public final int nonterminalIndex(int index) { return 0; }
public final int scopePrefix(int index) { return 0;}
public final int scopeSuffix(int index) { return 0;}
public final int scopeLhs(int index) { return 0;}
public final int scopeLa(int index) { return 0;}
public final int scopeStateSet(int index) { return 0;}
public final int scopeRhs(int index) { return 0;}
public final int scopeState(int index) { return 0;}
public final int inSymb(int index) { return 0;}
public final String name(int index) { return null; }
public final int getErrorSymbol() { return 0; }
public final int getScopeUbound() { return 0; }
public final int getScopeSize() { return 0; }
public final int getMaxNameLength() { return 0; }
public final static int
NUM_STATES = 88,
NT_OFFSET = 99,
LA_STATE_OFFSET = 969,
MAX_LA = 1,
NUM_RULES = 327,
NUM_NONTERMINALS = 52,
NUM_SYMBOLS = 151,
SEGMENT_SIZE = 8192,
START_STATE = 328,
IDENTIFIER_SYMBOL = 0,
EOFT_SYMBOL = 98,
EOLT_SYMBOL = 65,
ACCEPT_ACTION = 641,
ERROR_ACTION = 642;
public final static boolean BACKTRACK = false;
public final int getNumStates() { return NUM_STATES; }
public final int getNtOffset() { return NT_OFFSET; }
public final int getLaStateOffset() { return LA_STATE_OFFSET; }
public final int getMaxLa() { return MAX_LA; }
public final int getNumRules() { return NUM_RULES; }
public final int getNumNonterminals() { return NUM_NONTERMINALS; }
public final int getNumSymbols() { return NUM_SYMBOLS; }
public final int getSegmentSize() { return SEGMENT_SIZE; }
public final int getStartState() { return START_STATE; }
public final int getStartSymbol() { return lhs[0]; }
public final int getIdentifierSymbol() { return IDENTIFIER_SYMBOL; }
public final int getEoftSymbol() { return EOFT_SYMBOL; }
public final int getEoltSymbol() { return EOLT_SYMBOL; }
public final int getAcceptAction() { return ACCEPT_ACTION; }
public final int getErrorAction() { return ERROR_ACTION; }
public final boolean isValidForParser() { return isValidForParser; }
public final boolean getBacktrack() { return BACKTRACK; }
public final int originalState(int state) { return 0; }
public final int asi(int state) { return 0; }
public final int nasi(int state) { return 0; }
public final int inSymbol(int state) { return 0; }
public final int ntAction(int state, int sym) {
return baseAction[state + sym];
}
public final int tAction(int state, int sym) {
int i = baseAction[state],
k = i + sym;
return termAction[termCheck[k] == sym ? k : i];
}
public final int lookAhead(int la_state, int sym) {
int k = la_state + sym;
return termAction[termCheck[k] == sym ? k : la_state];
}
}

View file

@ -0,0 +1,222 @@
/*******************************************************************************
* Copyright (c) 2006, 2007 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.parser.upc;
public interface UPCLexersym {
public final static int
Char_a = 18,
Char_b = 19,
Char_c = 22,
Char_d = 23,
Char_e = 16,
Char_f = 12,
Char_g = 44,
Char_h = 45,
Char_i = 46,
Char_j = 47,
Char_k = 48,
Char_l = 14,
Char_m = 49,
Char_n = 34,
Char_o = 50,
Char_p = 30,
Char_q = 51,
Char_r = 35,
Char_s = 52,
Char_t = 36,
Char_u = 20,
Char_v = 37,
Char_w = 53,
Char_x = 31,
Char_y = 54,
Char_z = 55,
Char_A = 24,
Char_B = 25,
Char_C = 26,
Char_D = 27,
Char_E = 17,
Char_F = 13,
Char_G = 56,
Char_H = 57,
Char_I = 58,
Char_J = 59,
Char_K = 60,
Char_L = 15,
Char_M = 61,
Char_N = 62,
Char_O = 63,
Char_P = 32,
Char_Q = 64,
Char_R = 65,
Char_S = 66,
Char_T = 67,
Char_U = 21,
Char_V = 68,
Char_W = 69,
Char_X = 38,
Char_Y = 70,
Char_Z = 71,
Char__ = 72,
Char_0 = 1,
Char_1 = 2,
Char_2 = 3,
Char_3 = 4,
Char_4 = 5,
Char_5 = 6,
Char_6 = 7,
Char_7 = 8,
Char_8 = 9,
Char_9 = 10,
Char_EOF = 98,
Char_Space = 73,
Char_Unused = 96,
Char_LF = 99,
Char_CR = 97,
Char_HT = 74,
Char_FF = 75,
Char_Dot = 28,
Char_LessThan = 76,
Char_GreaterThan = 29,
Char_Plus = 39,
Char_Minus = 40,
Char_Slash = 77,
Char_BackSlash = 41,
Char_Star = 78,
Char_LeftParen = 85,
Char_RightParen = 86,
Char_Equal = 11,
Char_LeftBracket = 87,
Char_RightBracket = 88,
Char_LeftBrace = 89,
Char_RightBrace = 90,
Char_Ampersand = 79,
Char_Tilde = 91,
Char_Bang = 92,
Char_Percent = 42,
Char_Caret = 93,
Char_Bar = 80,
Char_Question = 81,
Char_Colon = 33,
Char_SemiColon = 94,
Char_Comma = 95,
Char_Hash = 82,
Char_SingleQuote = 83,
Char_DoubleQuote = 43,
Char_DollarSign = 84;
public final static String orderedTerminalSymbols[] = {
"",//$NON-NLS-1$
"0",//$NON-NLS-1$
"1",//$NON-NLS-1$
"2",//$NON-NLS-1$
"3",//$NON-NLS-1$
"4",//$NON-NLS-1$
"5",//$NON-NLS-1$
"6",//$NON-NLS-1$
"7",//$NON-NLS-1$
"8",//$NON-NLS-1$
"9",//$NON-NLS-1$
"Equal",//$NON-NLS-1$
"f",//$NON-NLS-1$
"F",//$NON-NLS-1$
"l",//$NON-NLS-1$
"L",//$NON-NLS-1$
"e",//$NON-NLS-1$
"E",//$NON-NLS-1$
"a",//$NON-NLS-1$
"b",//$NON-NLS-1$
"u",//$NON-NLS-1$
"U",//$NON-NLS-1$
"c",//$NON-NLS-1$
"d",//$NON-NLS-1$
"A",//$NON-NLS-1$
"B",//$NON-NLS-1$
"C",//$NON-NLS-1$
"D",//$NON-NLS-1$
"Dot",//$NON-NLS-1$
"GreaterThan",//$NON-NLS-1$
"p",//$NON-NLS-1$
"x",//$NON-NLS-1$
"P",//$NON-NLS-1$
"Colon",//$NON-NLS-1$
"n",//$NON-NLS-1$
"r",//$NON-NLS-1$
"t",//$NON-NLS-1$
"v",//$NON-NLS-1$
"X",//$NON-NLS-1$
"Plus",//$NON-NLS-1$
"Minus",//$NON-NLS-1$
"BackSlash",//$NON-NLS-1$
"Percent",//$NON-NLS-1$
"DoubleQuote",//$NON-NLS-1$
"g",//$NON-NLS-1$
"h",//$NON-NLS-1$
"i",//$NON-NLS-1$
"j",//$NON-NLS-1$
"k",//$NON-NLS-1$
"m",//$NON-NLS-1$
"o",//$NON-NLS-1$
"q",//$NON-NLS-1$
"s",//$NON-NLS-1$
"w",//$NON-NLS-1$
"y",//$NON-NLS-1$
"z",//$NON-NLS-1$
"G",//$NON-NLS-1$
"H",//$NON-NLS-1$
"I",//$NON-NLS-1$
"J",//$NON-NLS-1$
"K",//$NON-NLS-1$
"M",//$NON-NLS-1$
"N",//$NON-NLS-1$
"O",//$NON-NLS-1$
"Q",//$NON-NLS-1$
"R",//$NON-NLS-1$
"S",//$NON-NLS-1$
"T",//$NON-NLS-1$
"V",//$NON-NLS-1$
"W",//$NON-NLS-1$
"Y",//$NON-NLS-1$
"Z",//$NON-NLS-1$
"_",//$NON-NLS-1$
"Space",//$NON-NLS-1$
"HT",//$NON-NLS-1$
"FF",//$NON-NLS-1$
"LessThan",//$NON-NLS-1$
"Slash",//$NON-NLS-1$
"Star",//$NON-NLS-1$
"Ampersand",//$NON-NLS-1$
"Bar",//$NON-NLS-1$
"Question",//$NON-NLS-1$
"Hash",//$NON-NLS-1$
"SingleQuote",//$NON-NLS-1$
"DollarSign",//$NON-NLS-1$
"LeftParen",//$NON-NLS-1$
"RightParen",//$NON-NLS-1$
"LeftBracket",//$NON-NLS-1$
"RightBracket",//$NON-NLS-1$
"LeftBrace",//$NON-NLS-1$
"RightBrace",//$NON-NLS-1$
"Tilde",//$NON-NLS-1$
"Bang",//$NON-NLS-1$
"Caret",//$NON-NLS-1$
"SemiColon",//$NON-NLS-1$
"Comma",//$NON-NLS-1$
"Unused",//$NON-NLS-1$
"CR",//$NON-NLS-1$
"EOF",//$NON-NLS-1$
"LF"//$NON-NLS-1$
};
public final static boolean isValidForParser = true;
}

View file

@ -12,7 +12,7 @@
%options la=2 %options la=2
%options package=org.eclipse.cdt.internal.core.dom.parser.upc %options package=org.eclipse.cdt.internal.core.dom.parser.upc
%options template=btParserTemplateD.g %options template=btParserTemplateD.g
%options import_terminals=D:\workspaces\cdt-head2\org.eclipse.cdt.core.parser.c99\src\org\eclipse\cdt\internal\core\dom\parser\c99\C99Lexer.g %options import_terminals=UPCLexer.g
-- Unified Parallel C (UPC) is an extension of C99. -- Unified Parallel C (UPC) is an extension of C99.
@ -36,6 +36,8 @@ $End
$Define $Define
$action_class /. UPCParserAction ./ $action_class /. UPCParserAction ./
$keyword_map_class /. UPCKeywordMap ./ $keyword_map_class /. UPCKeywordMap ./
$token_map_class /. UPCTokenMap ./
$lexer_class /. UPCLexer ./
$End $End

View file

@ -172,17 +172,12 @@ public class UPCParser extends PrsStream implements RuleAction , IParserActionTo
} }
private UPCParserAction action = new UPCParserAction (this, UPCParserprs.orderedTerminalSymbols); private UPCParserAction action = new UPCParserAction (this, new UPCTokenMap ());
private List commentTokens = new ArrayList(); private List commentTokens = new ArrayList();
private IKeywordMap keywordMap = new UPCKeywordMap (); private IKeywordMap keywordMap = new UPCKeywordMap ();
public UPCParser() { // constructor public UPCParser() { // constructor
this(new C99Lexer() { this(new UPCLexer ());
// used by mapKind() to map C99 token kinds to the token kinds of a parser that extends this one
public String[] orderedExportedSymbols() {
return C99Parsersym.orderedTerminalSymbols;
}
});
} }
public void addToken(IToken token) { public void addToken(IToken token) {
@ -207,7 +202,7 @@ public List getCommentTokens() {
public void resetTokenStream() { public void resetTokenStream() {
super.resetTokenStream(); super.resetTokenStream();
action = new UPCParserAction (this, UPCParserprs.orderedTerminalSymbols); action = new UPCParserAction (this, new UPCTokenMap ());
commentTokens = new ArrayList(); commentTokens = new ArrayList();
} }

View file

@ -28,7 +28,7 @@ public class UPCParserprs implements lpg.lpgjavaruntime.ParseTable, UPCParsersym
0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0 0,0
}; };
}; };
public final static byte isKeyword[] = IsKeyword.isKeyword; public final static byte isKeyword[] = IsKeyword.isKeyword;
@ -1177,7 +1177,7 @@ public class UPCParserprs implements lpg.lpgjavaruntime.ParseTable, UPCParsersym
94,0,0,0,0,0,0,0,0,0, 94,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0 0,0,0,0,0,0,0
}; };
}; };
public final static byte termCheck[] = TermCheck.termCheck; public final static byte termCheck[] = TermCheck.termCheck;
@ -1553,18 +1553,18 @@ public class UPCParserprs implements lpg.lpgjavaruntime.ParseTable, UPCParsersym
public interface TerminalIndex { public interface TerminalIndex {
public final static char terminalIndex[] = {0, public final static char terminalIndex[] = {0,
2,99,9,113,112,51,67,79,87,88, 2,99,9,110,109,51,67,79,87,88,
89,10,11,8,6,7,71,72,12,13, 89,10,11,8,6,7,71,72,12,13,
84,85,86,91,92,93,100,101,102,103, 84,85,86,91,92,93,100,101,102,103,
47,58,63,66,75,3,1,42,107,50, 47,58,63,66,75,3,1,42,107,50,
55,59,64,65,69,70,77,78,81,82, 55,59,64,65,69,70,77,78,81,82,
83,106,57,73,76,105,29,116,52,80, 83,106,57,73,76,105,29,113,52,80,
16,17,104,48,49,53,54,60,61,62, 16,17,104,48,49,53,54,60,61,62,
68,74,30,31,90,94,95,96,97,4, 68,74,30,31,90,94,95,96,97,4,
14,15,18,19,20,21,98,22,23,24, 14,15,18,19,20,21,98,22,23,24,
25,26,56,5,27,28,32,33,34,35, 25,26,56,5,27,28,32,33,34,35,
36,37,38,39,40,41,43,44,45,108, 36,37,38,39,40,41,43,44,45,108,
109,110,111,114,115 111,112
}; };
}; };
public final static char terminalIndex[] = TerminalIndex.terminalIndex; public final static char terminalIndex[] = TerminalIndex.terminalIndex;
@ -1572,16 +1572,16 @@ public class UPCParserprs implements lpg.lpgjavaruntime.ParseTable, UPCParsersym
public interface NonterminalIndex { public interface NonterminalIndex {
public final static char nonterminalIndex[] = {0, public final static char nonterminalIndex[] = {0,
117,0,0,123,128,129,130,131,132,133, 114,0,0,120,125,126,127,128,129,130,
134,135,136,137,138,139,140,127,121,142, 131,132,133,134,135,136,137,124,118,139,
119,0,122,145,141,144,0,0,0,0, 116,0,119,142,138,141,0,0,0,0,
0,146,0,159,0,0,151,158,160,118, 0,143,0,156,0,0,148,155,157,115,
120,177,0,179,180,199,171,157,149,166, 117,174,0,176,177,196,168,154,146,163,
178,125,143,161,167,188,190,170,181,187, 175,122,140,158,164,185,187,167,178,184,
153,165,0,169,174,186,189,191,162,163, 150,162,0,166,171,183,186,188,159,160,
164,176,182,126,148,152,154,155,156,168, 161,173,179,123,145,149,151,152,153,165,
173,0,175,183,194,196,0,0,124,147, 170,0,172,180,191,193,0,0,121,144,
150,172,184,185,192,193,195,197,198,0 147,169,181,182,189,190,192,194,195,0
}; };
}; };
public final static char nonterminalIndex[] = NonterminalIndex.nonterminalIndex; public final static char nonterminalIndex[] = NonterminalIndex.nonterminalIndex;
@ -1654,31 +1654,31 @@ public class UPCParserprs implements lpg.lpgjavaruntime.ParseTable, UPCParsersym
public interface ScopeRhs { public interface ScopeRhs {
public final static char scopeRhs[] = {0, public final static char scopeRhs[] = {0,
168,37,0,118,0,167,1,26,0,119, 165,37,0,115,0,164,1,26,0,116,
0,167,1,25,0,167,1,24,0,211, 0,164,1,25,0,164,1,24,0,208,
0,31,0,210,137,0,167,0,189,137, 0,31,0,207,134,0,164,0,186,134,
36,0,42,120,0,120,0,174,137,1, 36,0,42,117,0,117,0,171,134,1,
172,0,174,137,1,0,182,1,0,166, 169,0,171,134,1,0,179,1,0,163,
137,0,190,0,181,137,37,0,9,118, 134,0,187,0,178,134,37,0,9,115,
0,133,18,181,137,37,0,72,127,118, 0,130,18,178,134,37,0,72,124,115,
0,133,181,137,18,37,0,181,137,18, 0,130,178,134,18,37,0,178,134,18,
37,0,127,118,0,133,18,37,0,133, 37,0,124,115,0,130,18,37,0,130,
181,137,37,0,133,37,0,174,137,1, 178,134,37,0,130,37,0,171,134,1,
157,0,165,1,0,177,0,197,137,36, 154,0,162,1,0,174,0,194,134,36,
180,53,0,197,137,36,53,0,162,0, 177,53,0,194,134,36,53,0,159,0,
121,0,207,137,162,0,137,162,0,172, 118,0,204,134,159,0,134,159,0,169,
121,0,178,137,36,195,55,0,178,137, 118,0,175,134,36,192,55,0,175,134,
36,195,54,0,178,137,36,55,0,178, 36,192,54,0,175,134,36,55,0,175,
137,36,54,0,163,0,164,0,164,157, 134,36,54,0,160,0,161,0,161,154,
0,163,0,185,163,0,157,0,163,157, 0,160,0,182,160,0,154,0,160,154,
0,162,0,184,163,0,162,157,0,141, 0,159,0,181,160,0,159,154,0,138,
67,0,80,2,122,119,121,0,141,136, 67,0,80,2,119,116,118,0,138,133,
138,1,70,0,56,144,0,205,137,36, 135,1,70,0,56,141,0,202,134,36,
0,138,96,131,0,29,140,0,167,1, 0,135,96,128,0,29,137,0,164,1,
0,119,129,0,167,1,17,0,189,137, 0,116,126,0,164,1,17,0,186,134,
36,136,167,1,0,119,3,0,126,42, 36,133,164,1,0,116,3,0,123,42,
120,0,119,3,0,126,120,0,204,1, 117,0,116,3,0,123,117,0,201,1,
119,0,138,37,119,0,138,1,0 116,0,135,37,116,0,135,1,0
}; };
}; };
public final static char scopeRhs[] = ScopeRhs.scopeRhs; public final static char scopeRhs[] = ScopeRhs.scopeRhs;
@ -1719,46 +1719,46 @@ public class UPCParserprs implements lpg.lpgjavaruntime.ParseTable, UPCParsersym
public interface InSymb { public interface InSymb {
public final static char inSymb[] = {0, public final static char inSymb[] = {0,
0,203,137,159,1,157,188,152,212,169, 0,200,134,156,1,154,185,149,209,166,
10,184,55,54,185,53,186,163,166,3, 10,181,55,54,182,53,183,160,163,3,
165,137,157,1,37,36,137,163,37,163, 162,134,154,1,37,36,134,160,37,160,
195,36,195,36,163,180,36,163,186,185, 192,36,192,36,160,177,36,160,183,182,
184,169,3,159,137,166,137,18,133,137, 181,166,3,156,134,163,134,18,130,134,
120,1,26,25,24,17,20,19,13,12, 117,1,26,25,24,17,20,19,13,12,
3,14,16,15,119,122,124,123,126,125, 3,14,16,15,116,119,121,120,123,122,
128,127,130,129,131,137,209,188,191,165, 125,124,127,126,128,134,206,185,188,162,
137,157,168,3,36,137,36,137,36,137, 134,154,165,3,36,134,36,134,36,134,
163,163,163,137,181,157,174,152,137,175, 160,160,160,134,178,154,171,149,134,172,
137,133,3,181,106,105,104,102,103,101, 134,130,3,178,106,105,104,102,103,101,
100,99,98,97,74,167,138,135,162,1, 100,99,98,97,74,164,135,132,159,1,
1,1,1,1,94,80,1,37,82,81, 1,1,1,1,94,80,1,37,82,81,
3,61,62,13,12,89,88,86,85,84, 3,61,62,13,12,89,88,86,85,84,
83,90,14,92,91,96,95,205,77,75, 83,90,14,92,91,96,95,202,77,75,
78,76,71,64,59,69,79,68,60,67, 78,76,71,64,59,69,79,68,60,67,
72,70,135,140,2,66,65,147,152,137, 72,70,132,137,2,66,65,144,149,134,
38,74,166,1,137,178,162,179,137,178, 38,74,163,1,134,175,159,176,134,175,
137,197,180,198,181,137,172,1,38,181, 134,194,177,195,178,134,169,1,38,178,
18,133,3,136,38,137,1,167,167,167, 18,130,3,133,38,134,1,164,164,164,
167,167,204,138,123,123,122,122,125,125, 164,164,201,135,120,120,119,119,122,122,
124,124,124,124,127,126,129,128,138,130, 121,121,121,121,124,123,126,125,135,127,
4,138,138,138,138,206,1,1,1,141, 4,135,135,135,135,203,1,1,1,138,
1,1,168,57,137,213,36,157,137,178, 1,1,165,57,134,210,36,154,134,175,
137,178,197,38,74,38,166,1,182,137, 134,175,194,38,74,38,163,1,179,134,
133,133,36,166,137,136,136,136,136,136, 130,130,36,163,134,133,133,133,133,133,
38,57,164,134,138,164,134,138,138,60, 38,57,161,131,135,161,131,135,135,60,
138,138,137,208,207,57,165,38,172,137, 135,135,134,205,204,57,162,38,169,134,
174,137,134,138,134,138,134,134,138,134, 171,134,131,135,131,135,131,131,135,131,
138,134,136,1,136,136,189,137,38,38, 135,131,133,1,133,133,186,134,38,38,
57,174,189,134,138,134,134,138,134,134, 57,171,186,131,135,131,131,135,131,131,
138,136,138,134,136,138,134,134,138,138, 135,133,135,131,133,135,131,131,135,135,
141,38,210,80,37,211,38,136,161,134, 138,38,207,80,37,208,38,133,158,131,
134,138,136,161,134,134,138,134,138,134, 131,135,133,158,131,131,135,131,135,131,
136,136,138,136,136,138,136,138,134,136, 133,133,135,133,133,135,133,135,131,133,
93,168,136,136,161,136,161,134,136,136, 93,165,133,133,158,133,158,131,133,133,
161,136,161,134,136,161,134,134,138,136, 158,133,158,131,133,158,131,131,135,133,
136,136,136,138,136,136,136,161,136,136, 133,133,133,135,133,133,133,158,133,133,
136,161,136,136,161,136,161,134,136,136, 133,158,133,133,158,133,158,131,133,133,
136,136,136,136,161,136 133,133,133,133,158,133
}; };
}; };
public final static char inSymb[] = InSymb.inSymb; public final static char inSymb[] = InSymb.inSymb;
@ -1875,9 +1875,6 @@ public class UPCParserprs implements lpg.lpgjavaruntime.ParseTable, UPCParsersym
"RightBrace",//$NON-NLS-1$ "RightBrace",//$NON-NLS-1$
"SemiColon",//$NON-NLS-1$ "SemiColon",//$NON-NLS-1$
"Invalid",//$NON-NLS-1$ "Invalid",//$NON-NLS-1$
"PlaceMarker",//$NON-NLS-1$
"Parameter",//$NON-NLS-1$
"DisabledMacroName",//$NON-NLS-1$
"Completion",//$NON-NLS-1$ "Completion",//$NON-NLS-1$
"EndOfCompletion",//$NON-NLS-1$ "EndOfCompletion",//$NON-NLS-1$
"SingleLineComment",//$NON-NLS-1$ "SingleLineComment",//$NON-NLS-1$
@ -1986,12 +1983,12 @@ public class UPCParserprs implements lpg.lpgjavaruntime.ParseTable, UPCParsersym
public final static int public final static int
NUM_STATES = 396, NUM_STATES = 396,
NT_OFFSET = 115, NT_OFFSET = 112,
LA_STATE_OFFSET = 5068, LA_STATE_OFFSET = 5068,
MAX_LA = 2147483647, MAX_LA = 2147483647,
NUM_RULES = 347, NUM_RULES = 347,
NUM_NONTERMINALS = 100, NUM_NONTERMINALS = 100,
NUM_SYMBOLS = 215, NUM_SYMBOLS = 212,
SEGMENT_SIZE = 8192, SEGMENT_SIZE = 8192,
START_STATE = 4222, START_STATE = 4222,
IDENTIFIER_SYMBOL = 0, IDENTIFIER_SYMBOL = 0,

View file

@ -122,13 +122,10 @@ public interface UPCParsersym {
TK_RightBrace = 52, TK_RightBrace = 52,
TK_SemiColon = 39, TK_SemiColon = 39,
TK_Invalid = 110, TK_Invalid = 110,
TK_PlaceMarker = 111,
TK_Parameter = 112,
TK_DisabledMacroName = 113,
TK_Completion = 5, TK_Completion = 5,
TK_EndOfCompletion = 4, TK_EndOfCompletion = 4,
TK_SingleLineComment = 114, TK_SingleLineComment = 111,
TK_MultiLineComment = 115, TK_MultiLineComment = 112,
TK_ERROR_TOKEN = 58; TK_ERROR_TOKEN = 58;
public final static String orderedTerminalSymbols[] = { public final static String orderedTerminalSymbols[] = {
@ -243,9 +240,6 @@ public interface UPCParsersym {
"HashHash",//$NON-NLS-1$ "HashHash",//$NON-NLS-1$
"NewLine",//$NON-NLS-1$ "NewLine",//$NON-NLS-1$
"Invalid",//$NON-NLS-1$ "Invalid",//$NON-NLS-1$
"PlaceMarker",//$NON-NLS-1$
"Parameter",//$NON-NLS-1$
"DisabledMacroName",//$NON-NLS-1$
"SingleLineComment",//$NON-NLS-1$ "SingleLineComment",//$NON-NLS-1$
"MultiLineComment"//$NON-NLS-1$ "MultiLineComment"//$NON-NLS-1$
}; };

View file

@ -0,0 +1,49 @@
/*******************************************************************************
* Copyright (c) 2006, 2007 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.internal.core.dom.parser.upc;
import org.eclipse.cdt.core.dom.parser.c99.TokenMap;
public class UPCTokenMap extends TokenMap {
public UPCTokenMap() {
super(UPCParsersym.orderedTerminalSymbols);
}
public int getCompletionTokenKind() {
return UPCParsersym.TK_Completion;
}
public int getEOFTokenKind() {
return UPCParsersym.TK_EOF_TOKEN;
}
public int getEndOfCompletionTokenKind() {
return UPCParsersym.TK_EndOfCompletion;
}
public int getIntegerTokenKind() {
return UPCParsersym.TK_integer;
}
public int getInvalidTokenKind() {
return UPCParsersym.TK_Invalid;
}
public int getStringLitTokenKind() {
return UPCParsersym.TK_stringlit;
}
public int getIdentifierTokenKind() {
return UPCParsersym.TK_identifier;
}
}