[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
gsantlr patch and associated gsweb patch
From: |
Kim Shrier |
Subject: |
gsantlr patch and associated gsweb patch |
Date: |
Sun, 19 Aug 2001 00:10:38 -0500 |
The gsantlr library currently works with version 2.5.0 of antlr. The
current version is 2.7.1. The gsantlr patch will update it to work with
antlr 2.7.1. The down side of commiting this patch is that it will
break
gsweb which is coded to work with the output of antlr 2.5.0. The
differences between 2.5.0 and 2.7.1 include some variable name changes
and some changes to some functions. I have also included a patch
to gsweb that will fix it to work with the output from antlr 2.7.1.
Since the patch to gsantlr creates new files that are in a new
subdirectory, I recommend the following procedure for applying this
patch:
mkdir dev-libs/gsantlr/ObjcCodeGenerator/objc
patch <dev-libs-gsantlr.patch
rm dev-libs/gsantlr/ObjcCodeGenerator/objc/*.orig
The rm command removes the empty .orig files that are created as a
side effect of applying the patch.
If you do decide to commit this patch, you will probably also want to
apply the gsweb patch since it will be broken if you don't.
I sent these patches to Manuel Guesdon about 3 months ago and it looks
like he has been too busy to apply them. I would really like to see
GNUstep keep up with the current versions of external tools so I have
decided to submit this patch through the official bug reporting
channel.
Thanks,
Kim
--
Kim Shrier - principal, Shrier and Deihl - mailto:kim@tinker.com
Remote Unix Network Admin, Security, Internet Software Development
Tinker Internet Services - Superior FreeBSD-based Web Hosting
http://www.tinker.com/
--- dev-libs/gsantlr/ObjcCodeGenerator.orig/ObjcCodeGenerator.java Thu Jan
27 10:15:52 2000
+++ dev-libs/gsantlr/ObjcCodeGenerator/ObjcCodeGenerator.java Thu May 17
09:40:44 2001
@@ -369,13 +369,13 @@
if (rs == null || !rs.isDefined())
{
// Is this redundant???
- tool.error("Rule '" + rr.targetRule + "' is not
defined", rr.getLine());
+ tool.error("Rule '" + rr.targetRule + "' is not
defined", grammar.getFilename(), rr.getLine());
return;
}
if (!(rs instanceof RuleSymbol))
{
// Is this redundant???
- tool.error("'" + rr.targetRule + "' does not name a
grammar rule", rr.getLine());
+ tool.error("'" + rr.targetRule + "' does not name a
grammar rule", grammar.getFilename(), rr.getLine());
return;
}
@@ -403,7 +403,7 @@
// Warn if the rule has no return type
if (rs.block.returnAction == null)
{
- tool.warning("Rule '" +
rr.targetRule + "' has no return type", rr.getLine());
+ tool.warning("Rule '" +
rr.targetRule + "' has no return type", grammar.getFilename(), rr.getLine());
}
_print(rr.idAssign + "=");
}
@@ -412,7 +412,7 @@
// Warn about return value if any, but not
inside syntactic predicate
if ( !(grammar instanceof LexerGrammar) &&
syntacticPredLevel == 0 && rs.block.returnAction != null)
{
- tool.warning("Rule '" +
rr.targetRule + "' returns a value", rr.getLine());
+ tool.warning("Rule '" +
rr.targetRule + "' returns a value", grammar.getFilename(), rr.getLine());
}
}
@@ -958,13 +958,13 @@
// Generate header common to all Objective-C output files
genHeader();
// Do not use printAction because we assume tabs==0
- println(behavior.headerAction);
+ println(behavior.getHeaderAction(""));
// Construct a charbuffer appropriate to the type of processing
being done.
String charBufferName = "CharBuffer";
// Generate user-defined lexer file preamble
- println(grammar.preambleAction);
+ println(grammar.preambleAction.getText());
// Generate header specific to lexer Objective-C file
println("#include \""+ IncludesPrefix +
ClassesPrefix+"Common.h\"");
@@ -1105,10 +1105,10 @@
// Generate the header common to all output files.
genHeader();
// Do not use printAction because we assume tabs==0
- println(behavior.headerAction);
+ println(behavior.getHeaderAction(""));
// Output the user-defined parser preamble
- println(grammar.preambleAction);
+ println(grammar.preambleAction.getText());
// Generate header for the parser
println("#include \""+ IncludesPrefix +
ClassesPrefix+"Common.h\"");
@@ -1252,10 +1252,10 @@
// Generate the header common to all output files.
genHeader();
// Do not use printAction because we assume tabs==0
- println(behavior.headerAction);
+ println(behavior.getHeaderAction(""));
// Output the user-defined parser premamble
- println(grammar.preambleAction);
+ println(grammar.preambleAction.getText());
// Generate header for the parser
println("#include \""+ IncludesPrefix +
ClassesPrefix+"Common.h\"");
@@ -1442,7 +1442,8 @@
if (alt.synPred != null)
{
tool.warning(
-
"Syntactic predicate superfluous for single alternative",
+
"Syntactic predicate superfluous for single alternative",
+
grammar.getFilename(),
blk.getAlternativeAt(0).synPred.getLine()
);
};
@@ -1503,6 +1504,7 @@
if (p.fset.degree() == 0 &&
!p.containsEpsilon())
{
tool.warning("Alternate omitted due to empty prediction set",
+
grammar.getFilename(),
alt.head.getLine());
}
else
@@ -1828,7 +1830,7 @@
};
// When not guessing, execute user handler
action
-
printAction(processActionForTreeSpecifiers(handler.action, 0, currentRule,
null));
+
printAction(processActionForTreeSpecifiers(handler.action.getText(), 0,
currentRule, null));
if (grammar.hasSyntacticPredicate)
{
@@ -1883,7 +1885,7 @@
println(" * Terence Parr, MageLang Institute");
println(" * with John Lilley, Empathy Software");
println(" * and Manuel Guesdon, Software Builders");
- println(" * ANTLR Version " + ANTLRParser.version + ";
1996,1997,1998,1999");
+ println(" * ANTLR Version " + Tool.version + ";
1996,1997,1998,1999,2000");
println(" */");
println("");
}
@@ -1908,7 +1910,7 @@
// Generate header common to all Objective-C output files
genHeader();
// Do not use printAction because we assume tabs==0
- println(behavior.headerAction);
+ println(behavior.getHeaderAction(""));
println("");
// Construct a charbuffer appropriate to the type of processing
being done.
@@ -1935,7 +1937,7 @@
};
// Generate user-defined lexer file preamble
- println(grammar.preambleAction);
+ println(grammar.preambleAction.getText());
// Generate lexer class definition
println("@interface " + grammar.getClassName() + " : " + sup);
@@ -1965,7 +1967,7 @@
// Generate user-defined lexer class members
print(
-
processActionForTreeSpecifiers(grammar.classMemberAction, 0, currentRule, null)
+
processActionForTreeSpecifiers(grammar.classMemberAction.getText(), 0,
currentRule, null)
);
// Generate initLiterals() method
@@ -2061,7 +2063,7 @@
// Generate the header common to all output files.
genHeader();
// Do not use printAction because we assume tabs==0
- println(behavior.headerAction);
+ println(behavior.getHeaderAction(""));
// Generate header for the parser
println("#include \""+ IncludesPrefix +
ClassesPrefix+"Common.h\"");
@@ -2073,7 +2075,7 @@
println("");
// Output the user-defined parser preamble
-// println(grammar.preambleAction);
+// println(grammar.preambleAction.getText());
// Generate parser class definition
String sup=null;
@@ -2099,7 +2101,7 @@
// Generate user-defined parser class members
print(
-
processActionForTreeSpecifiers(grammar.classMemberAction, 0, currentRule, null)
+
processActionForTreeSpecifiers(grammar.classMemberAction.getText(), 0,
currentRule, null)
);
println(" };");
@@ -2201,7 +2203,7 @@
// Generate the header common to all output files.
genHeader();
// Do not use printAction because we assume tabs==0
- println(behavior.headerAction);
+ println(behavior.getHeaderAction(""));
// Find the name of the super class
String sup=null;
@@ -2219,7 +2221,7 @@
// Generate header for the parser
// Output the user-defined parser premamble
- println(grammar.preambleAction);
+ println(grammar.preambleAction.getText());
// Generate parser class definition
println(System.getProperty("line.separator")+
@@ -2238,7 +2240,7 @@
// Generate user-defined parser class members
print(
-
processActionForTreeSpecifiers(grammar.classMemberAction, 0, currentRule, null)
+
processActionForTreeSpecifiers(grammar.classMemberAction.getText(), 0,
currentRule, null)
);
println(" };");
@@ -2444,14 +2446,14 @@
println(System.getProperty("line.separator")+"-("+TokenObjectDef+") nextToken");
println("{");
tabs++;
- println(TokenObjectDef+" _rettoken=nil;");
+ println(TokenObjectDef+" theRetToken=nil;");
println("BOOL end=NO;");
println(LOGObjectFnStart);
println("for (;!end;)");
println("{");
tabs++;
// println("int _ttype = Token::EOF_TYPE;");
- println(TokenObjectDef+" _rettoken;");
+ println(TokenObjectDef+" theRetToken;");
println(ClassesPrefix+"TokenType _ttype =
"+ANTLRTokenPrefix+"INVALID_TYPE;");
println("[self resetText];");
@@ -2711,7 +2713,8 @@
if (alt.synPred != null)
{
tool.warning(
-
"Syntactic predicate ignored for single alternative",
+
"Syntactic predicate ignored for single alternative",
+
grammar.getFilename(),
alt.synPred.getLine()
);
};
@@ -2985,7 +2988,7 @@
// Warn if the rule accepts no arguments
if (rs.block.argAction == null)
{
- tool.warning("Rule '" +
rr.targetRule + "' accepts no arguments", rr.getLine());
+ tool.warning("Rule '" +
rr.targetRule + "' accepts no arguments", grammar.getFilename(), rr.getLine());
}
}
else
@@ -3133,7 +3136,7 @@
// Generate the header common to all Objective-C files
genHeader();
// Do not use printAction because we assume tabs==0
- println(behavior.headerAction);
+ println(behavior.getHeaderAction(""));
// Encapsulate the definitions in an interface. This can be
done
// because they are all constants.
@@ -3222,6 +3225,21 @@
buf.append(")");
return buf.toString();
}
+ /** Get a string for an expression to generate creating of an AST node
+ * @param str The arguments to the AST constructor
+ */
+ public String getASTCreateString(GrammarAtom atom, String str)
+ {
+ if ( atom!=null && atom.getASTNodeType() != null )
+ {
+ return "[" + atom.getASTNodeType() + " create:"
+ str + "]";
+ }
+ else
+ {
+ return "[astFactory create:" + str + "]";
+ }
+ }
+
/** Get a string for an expression to generate creating of an AST node
* @param str The arguments to the AST constructor
*/
--- dev-libs/gsantlr/ObjcCodeGenerator/mkalljar.patch.orig Wed Dec 31
18:00:00 1969
+++ dev-libs/gsantlr/ObjcCodeGenerator/mkalljar.patch Thu May 17 09:40:45 2001
@@ -0,0 +1,10 @@
+--- mkalljar.orig Sat May 12 16:45:11 2001
++++ mkalljar Fri May 11 19:03:36 2001
+@@ -7,6 +7,7 @@
+ jar cvf antlrall.jar \
+ antlr/actions/cpp/*.class \
+ antlr/actions/java/*.class \
++ antlr/actions/objc/*.class \
+ antlr/actions/sather/*.class \
+ antlr/*.class \
+ antlr/collections/*.class \
--- dev-libs/gsantlr/ObjcCodeGenerator/objc/ActionLexer.java.orig Wed Dec
31 18:00:00 1969
+++ dev-libs/gsantlr/ObjcCodeGenerator/objc/ActionLexer.java Fri May 11
18:37:30 2001
@@ -0,0 +1,2250 @@
+// $ANTLR 2.7.1: "action.g" -> "ActionLexer.java"$
+
+package antlr.actions.objc;
+
+import java.io.InputStream;
+import antlr.TokenStreamException;
+import antlr.TokenStreamIOException;
+import antlr.TokenStreamRecognitionException;
+import antlr.CharStreamException;
+import antlr.CharStreamIOException;
+import antlr.ANTLRException;
+import java.io.Reader;
+import java.util.Hashtable;
+import antlr.CharScanner;
+import antlr.InputBuffer;
+import antlr.ByteBuffer;
+import antlr.CharBuffer;
+import antlr.Token;
+import antlr.CommonToken;
+import antlr.RecognitionException;
+import antlr.NoViableAltForCharException;
+import antlr.MismatchedCharException;
+import antlr.TokenStream;
+import antlr.ANTLRHashString;
+import antlr.LexerSharedInputState;
+import antlr.collections.impl.BitSet;
+import antlr.SemanticException;
+
+import java.io.StringReader;
+import antlr.collections.impl.Vector;
+import antlr.*;
+
+/** Perform the following translations:
+
+ AST related translations
+
+ ## -> currentRule_AST
+ #(x,y,z) ->
codeGenerator.getASTCreateString(vector-of(x,y,z))
+ #[x] -> codeGenerator.getASTCreateString(x)
+ #x -> codeGenerator.mapTreeId(x)
+
+ Inside context of #(...), you can ref (x,y,z), [x], and x as shortcuts.
+
+ Text related translations
+
+ $append(x) -> [text appendString: x]
+ $setText(x) -> text = [[NSMutableString alloc]
initWithString: [[text substringToIndex: _begin] stringByAppendingString: x]]
+ $getText -> [[NSMutableString alloc] initWithString:
[text substringFromIndex: _begin]]
+ $setToken(x) -> _token = x
+ $setType(x) -> _ttype = x
+ */
+public class ActionLexer extends antlr.CharScanner implements
ActionLexerTokenTypes, TokenStream
+ {
+
+ protected RuleBlock currentRule;
+ protected CodeGenerator generator;
+ protected int lineOffset = 0;
+ private Tool tool; // The ANTLR tool
+ ActionTransInfo transInfo;
+
+ public ActionLexer( String s,
+ RuleBlock currentRule,
+ CodeGenerator generator,
+ ActionTransInfo transInfo) {
+ this(new StringReader(s));
+ this.currentRule = currentRule;
+ this.generator = generator;
+ this.transInfo = transInfo;
+ }
+
+ public void setLineOffset(int lineOffset) {
+ // this.lineOffset = lineOffset;
+ setLine(lineOffset);
+ }
+
+ public void setTool(Tool tool) {
+ this.tool = tool;
+ }
+
+ // Override of error-reporting for syntax
+ public void reportError(RecognitionException e) {
+ System.err.print("Syntax error in action: ");
+ super.reportError(e);
+ }
+
+public ActionLexer(InputStream in) {
+ this(new ByteBuffer(in));
+}
+public ActionLexer(Reader in) {
+ this(new CharBuffer(in));
+}
+public ActionLexer(InputBuffer ib) {
+ this(new LexerSharedInputState(ib));
+}
+public ActionLexer(LexerSharedInputState state) {
+ super(state);
+ literals = new Hashtable();
+caseSensitiveLiterals = true;
+setCaseSensitive(true);
+}
+
+public Token nextToken() throws TokenStreamException {
+ Token theRetToken=null;
+tryAgain:
+ for (;;) {
+ Token _token = null;
+ int _ttype = Token.INVALID_TYPE;
+ resetText();
+ try { // for char stream error handling
+ try { // for lexical error handling
+ if (((LA(1) >= '\u0003' && LA(1) <= '~'))) {
+ mACTION(true);
+ theRetToken=_returnToken;
+ }
+ else {
+ if (LA(1)==EOF_CHAR) {uponEOF();
_returnToken = makeToken(Token.EOF_TYPE);}
+ else {throw new
NoViableAltForCharException((char)LA(1), getFilename(), getLine());}
+ }
+
+ if ( _returnToken==null ) continue tryAgain; //
found SKIP token
+ _ttype = _returnToken.getType();
+ _returnToken.setType(_ttype);
+ return _returnToken;
+ }
+ catch (RecognitionException e) {
+ throw new TokenStreamRecognitionException(e);
+ }
+ }
+ catch (CharStreamException cse) {
+ if ( cse instanceof CharStreamIOException ) {
+ throw new
TokenStreamIOException(((CharStreamIOException)cse).io);
+ }
+ else {
+ throw new
TokenStreamException(cse.getMessage());
+ }
+ }
+ }
+}
+
+ public final void mACTION(boolean _createToken) throws
RecognitionException, CharStreamException, TokenStreamException {
+ int _ttype; Token _token=null; int _begin=text.length();
+ _ttype = ACTION;
+ int _saveIndex;
+
+ {
+ int _cnt3=0;
+ _loop3:
+ do {
+ switch ( LA(1)) {
+ case '\u0003': case '\u0004': case '\u0005': case
'\u0006':
+ case '\u0007': case '\u0008': case '\t': case '\n':
+ case '\u000b': case '\u000c': case '\r': case
'\u000e':
+ case '\u000f': case '\u0010': case '\u0011': case
'\u0012':
+ case '\u0013': case '\u0014': case '\u0015': case
'\u0016':
+ case '\u0017': case '\u0018': case '\u0019': case
'\u001a':
+ case '\u001b': case '\u001c': case '\u001d': case
'\u001e':
+ case '\u001f': case ' ': case '!': case '"':
+ case '%': case '&': case '\'': case '(':
+ case ')': case '*': case '+': case ',':
+ case '-': case '.': case '/': case '0':
+ case '1': case '2': case '3': case '4':
+ case '5': case '6': case '7': case '8':
+ case '9': case ':': case ';': case '<':
+ case '=': case '>': case '?': case '@':
+ case 'A': case 'B': case 'C': case 'D':
+ case 'E': case 'F': case 'G': case 'H':
+ case 'I': case 'J': case 'K': case 'L':
+ case 'M': case 'N': case 'O': case 'P':
+ case 'Q': case 'R': case 'S': case 'T':
+ case 'U': case 'V': case 'W': case 'X':
+ case 'Y': case 'Z': case '[': case '\\':
+ case ']': case '^': case '_': case '`':
+ case 'a': case 'b': case 'c': case 'd':
+ case 'e': case 'f': case 'g': case 'h':
+ case 'i': case 'j': case 'k': case 'l':
+ case 'm': case 'n': case 'o': case 'p':
+ case 'q': case 'r': case 's': case 't':
+ case 'u': case 'v': case 'w': case 'x':
+ case 'y': case 'z': case '{': case '|':
+ case '}': case '~':
+ {
+ mSTUFF(false);
+ break;
+ }
+ case '#':
+ {
+ mAST_ITEM(false);
+ break;
+ }
+ case '$':
+ {
+ mTEXT_ITEM(false);
+ break;
+ }
+ default:
+ {
+ if ( _cnt3>=1 ) { break _loop3; } else {throw
new NoViableAltForCharException((char)LA(1), getFilename(), getLine());}
+ }
+ }
+ _cnt3++;
+ } while (true);
+ }
+ if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
+ _token = makeToken(_ttype);
+ _token.setText(new String(text.getBuffer(), _begin,
text.length()-_begin));
+ }
+ _returnToken = _token;
+ }
+
+ protected final void mSTUFF(boolean _createToken) throws
RecognitionException, CharStreamException, TokenStreamException {
+ int _ttype; Token _token=null; int _begin=text.length();
+ _ttype = STUFF;
+ int _saveIndex;
+
+ switch ( LA(1)) {
+ case '"':
+ {
+ mSTRING(false);
+ break;
+ }
+ case '\'':
+ {
+ mCHAR(false);
+ break;
+ }
+ case '\n':
+ {
+ match('\n');
+ newline();
+ break;
+ }
+ case '\u0003': case '\u0004': case '\u0005': case '\u0006':
+ case '\u0007': case '\u0008': case '\t': case '\u000b':
+ case '\u000c': case '\u000e': case '\u000f': case '\u0010':
+ case '\u0011': case '\u0012': case '\u0013': case '\u0014':
+ case '\u0015': case '\u0016': case '\u0017': case '\u0018':
+ case '\u0019': case '\u001a': case '\u001b': case '\u001c':
+ case '\u001d': case '\u001e': case '\u001f': case ' ':
+ case '!': case '%': case '&': case '(':
+ case ')': case '*': case '+': case ',':
+ case '-': case '.': case '0': case '1':
+ case '2': case '3': case '4': case '5':
+ case '6': case '7': case '8': case '9':
+ case ':': case ';': case '<': case '=':
+ case '>': case '?': case '@': case 'A':
+ case 'B': case 'C': case 'D': case 'E':
+ case 'F': case 'G': case 'H': case 'I':
+ case 'J': case 'K': case 'L': case 'M':
+ case 'N': case 'O': case 'P': case 'Q':
+ case 'R': case 'S': case 'T': case 'U':
+ case 'V': case 'W': case 'X': case 'Y':
+ case 'Z': case '[': case '\\': case ']':
+ case '^': case '_': case '`': case 'a':
+ case 'b': case 'c': case 'd': case 'e':
+ case 'f': case 'g': case 'h': case 'i':
+ case 'j': case 'k': case 'l': case 'm':
+ case 'n': case 'o': case 'p': case 'q':
+ case 'r': case 's': case 't': case 'u':
+ case 'v': case 'w': case 'x': case 'y':
+ case 'z': case '{': case '|': case '}':
+ case '~':
+ {
+ {
+ match(_tokenSet_0);
+ }
+ break;
+ }
+ default:
+ if ((LA(1)=='/') && (LA(2)=='*'||LA(2)=='/')) {
+ mCOMMENT(false);
+ }
+ else if ((LA(1)=='\r') && (LA(2)=='\n')) {
+ match("\r\n");
+ newline();
+ }
+ else if ((LA(1)=='/') && (_tokenSet_1.member(LA(2)))) {
+ match('/');
+ {
+ match(_tokenSet_1);
+ }
+ }
+ else if ((LA(1)=='\r') && (true)) {
+ match('\r');
+ newline();
+ }
+ else {
+ throw new NoViableAltForCharException((char)LA(1),
getFilename(), getLine());
+ }
+ }
+ if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
+ _token = makeToken(_ttype);
+ _token.setText(new String(text.getBuffer(), _begin,
text.length()-_begin));
+ }
+ _returnToken = _token;
+ }
+
+ protected final void mAST_ITEM(boolean _createToken) throws
RecognitionException, CharStreamException, TokenStreamException {
+ int _ttype; Token _token=null; int _begin=text.length();
+ _ttype = AST_ITEM;
+ int _saveIndex;
+ Token t=null;
+ Token id=null;
+ Token ctor=null;
+
+ if ((LA(1)=='#') && (LA(2)=='(')) {
+ _saveIndex=text.length();
+ match('#');
+ text.setLength(_saveIndex);
+ mTREE(true);
+ t=_returnToken;
+ }
+ else if ((LA(1)=='#') && (_tokenSet_2.member(LA(2)))) {
+ _saveIndex=text.length();
+ match('#');
+ text.setLength(_saveIndex);
+ mID(true);
+ id=_returnToken;
+
+ String idt = id.getText();
+ text.setLength(_begin);
text.append(generator.mapTreeId(idt,transInfo));
+
+ {
+ if ((_tokenSet_3.member(LA(1))) && (true)) {
+ mWS(false);
+ }
+ else {
+ }
+
+ }
+ {
+ if ((LA(1)=='=') && (true)) {
+ mVAR_ASSIGN(false);
+ }
+ else {
+ }
+
+ }
+ }
+ else if ((LA(1)=='#') && (LA(2)=='[')) {
+ _saveIndex=text.length();
+ match('#');
+ text.setLength(_saveIndex);
+ mAST_CONSTRUCTOR(true);
+ ctor=_returnToken;
+ }
+ else if ((LA(1)=='#') && (LA(2)=='#')) {
+ match("##");
+
+ String
r=currentRule.getRuleName()+"_AST"; text.setLength(_begin); text.append(r);
+ if ( transInfo!=null ) {
+ transInfo.refRuleRoot=r;
// we ref root of tree
+ }
+
+ {
+ if ((_tokenSet_3.member(LA(1))) && (true)) {
+ mWS(false);
+ }
+ else {
+ }
+
+ }
+ {
+ if ((LA(1)=='=') && (true)) {
+ mVAR_ASSIGN(false);
+ }
+ else {
+ }
+
+ }
+ }
+ else {
+ throw new NoViableAltForCharException((char)LA(1),
getFilename(), getLine());
+ }
+
+ if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
+ _token = makeToken(_ttype);
+ _token.setText(new String(text.getBuffer(), _begin,
text.length()-_begin));
+ }
+ _returnToken = _token;
+ }
+
+ protected final void mTEXT_ITEM(boolean _createToken) throws
RecognitionException, CharStreamException, TokenStreamException {
+ int _ttype; Token _token=null; int _begin=text.length();
+ _ttype = TEXT_ITEM;
+ int _saveIndex;
+ Token a1=null;
+ Token a2=null;
+ Token a3=null;
+ Token a4=null;
+
+ if ((LA(1)=='$') && (LA(2)=='a')) {
+ match("$append(");
+ mTEXT_ARG(true);
+ a1=_returnToken;
+ match(')');
+
+ String t = "[text appendString:
"+a1.getText()+"]";
+ text.setLength(_begin);
text.append(t);
+
+ }
+ else if ((LA(1)=='$') && (LA(2)=='s')) {
+ match("$set");
+ {
+ if ((LA(1)=='T') && (LA(2)=='e')) {
+ match("Text(");
+ mTEXT_ARG(true);
+ a2=_returnToken;
+ match(')');
+
+ String t;
+ t = "text =
[[NSMutableString alloc] initWithString: [[text substringToIndex: _begin]
stringByAppendingString:"+a2.getText()+"]]";
+ text.setLength(_begin);
text.append(t);
+
+ }
+ else if ((LA(1)=='T') && (LA(2)=='o')) {
+ match("Token(");
+ mTEXT_ARG(true);
+ a3=_returnToken;
+ match(')');
+
+ String t="_token =
"+a3.getText();
+ text.setLength(_begin);
text.append(t);
+
+ }
+ else if ((LA(1)=='T') && (LA(2)=='y')) {
+ match("Type(");
+ mTEXT_ARG(true);
+ a4=_returnToken;
+ match(')');
+
+ String t="_ttype =
"+a4.getText();
+ text.setLength(_begin);
text.append(t);
+
+ }
+ else {
+ throw new
NoViableAltForCharException((char)LA(1), getFilename(), getLine());
+ }
+
+ }
+ }
+ else if ((LA(1)=='$') && (LA(2)=='g')) {
+ match("$getText");
+
+ text.setLength(_begin);
text.append("[[NSMutableString alloc] initWithString: [text substringFromIndex:
_begin]]");
+
+ }
+ else {
+ throw new NoViableAltForCharException((char)LA(1),
getFilename(), getLine());
+ }
+
+ if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
+ _token = makeToken(_ttype);
+ _token.setText(new String(text.getBuffer(), _begin,
text.length()-_begin));
+ }
+ _returnToken = _token;
+ }
+
+ protected final void mCOMMENT(boolean _createToken) throws
RecognitionException, CharStreamException, TokenStreamException {
+ int _ttype; Token _token=null; int _begin=text.length();
+ _ttype = COMMENT;
+ int _saveIndex;
+
+ if ((LA(1)=='/') && (LA(2)=='/')) {
+ mSL_COMMENT(false);
+ }
+ else if ((LA(1)=='/') && (LA(2)=='*')) {
+ mML_COMMENT(false);
+ }
+ else {
+ throw new NoViableAltForCharException((char)LA(1),
getFilename(), getLine());
+ }
+
+ if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
+ _token = makeToken(_ttype);
+ _token.setText(new String(text.getBuffer(), _begin,
text.length()-_begin));
+ }
+ _returnToken = _token;
+ }
+
+ protected final void mSTRING(boolean _createToken) throws
RecognitionException, CharStreamException, TokenStreamException {
+ int _ttype; Token _token=null; int _begin=text.length();
+ _ttype = STRING;
+ int _saveIndex;
+
+ match('"');
+ {
+ _loop88:
+ do {
+ switch ( LA(1)) {
+ case '\\':
+ {
+ mESC(false);
+ break;
+ }
+ case '\u0003': case '\u0004': case '\u0005': case
'\u0006':
+ case '\u0007': case '\u0008': case '\t': case '\n':
+ case '\u000b': case '\u000c': case '\r': case
'\u000e':
+ case '\u000f': case '\u0010': case '\u0011': case
'\u0012':
+ case '\u0013': case '\u0014': case '\u0015': case
'\u0016':
+ case '\u0017': case '\u0018': case '\u0019': case
'\u001a':
+ case '\u001b': case '\u001c': case '\u001d': case
'\u001e':
+ case '\u001f': case ' ': case '!': case '#':
+ case '$': case '%': case '&': case '\'':
+ case '(': case ')': case '*': case '+':
+ case ',': case '-': case '.': case '/':
+ case '0': case '1': case '2': case '3':
+ case '4': case '5': case '6': case '7':
+ case '8': case '9': case ':': case ';':
+ case '<': case '=': case '>': case '?':
+ case '@': case 'A': case 'B': case 'C':
+ case 'D': case 'E': case 'F': case 'G':
+ case 'H': case 'I': case 'J': case 'K':
+ case 'L': case 'M': case 'N': case 'O':
+ case 'P': case 'Q': case 'R': case 'S':
+ case 'T': case 'U': case 'V': case 'W':
+ case 'X': case 'Y': case 'Z': case '[':
+ case ']': case '^': case '_': case '`':
+ case 'a': case 'b': case 'c': case 'd':
+ case 'e': case 'f': case 'g': case 'h':
+ case 'i': case 'j': case 'k': case 'l':
+ case 'm': case 'n': case 'o': case 'p':
+ case 'q': case 'r': case 's': case 't':
+ case 'u': case 'v': case 'w': case 'x':
+ case 'y': case 'z': case '{': case '|':
+ case '}': case '~':
+ {
+ matchNot('"');
+ break;
+ }
+ default:
+ {
+ break _loop88;
+ }
+ }
+ } while (true);
+ }
+ match('"');
+ if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
+ _token = makeToken(_ttype);
+ _token.setText(new String(text.getBuffer(), _begin,
text.length()-_begin));
+ }
+ _returnToken = _token;
+ }
+
+ protected final void mCHAR(boolean _createToken) throws
RecognitionException, CharStreamException, TokenStreamException {
+ int _ttype; Token _token=null; int _begin=text.length();
+ _ttype = CHAR;
+ int _saveIndex;
+
+ match('\'');
+ {
+ switch ( LA(1)) {
+ case '\\':
+ {
+ mESC(false);
+ break;
+ }
+ case '\u0003': case '\u0004': case '\u0005': case '\u0006':
+ case '\u0007': case '\u0008': case '\t': case '\n':
+ case '\u000b': case '\u000c': case '\r': case '\u000e':
+ case '\u000f': case '\u0010': case '\u0011': case '\u0012':
+ case '\u0013': case '\u0014': case '\u0015': case '\u0016':
+ case '\u0017': case '\u0018': case '\u0019': case '\u001a':
+ case '\u001b': case '\u001c': case '\u001d': case '\u001e':
+ case '\u001f': case ' ': case '!': case '"':
+ case '#': case '$': case '%': case '&':
+ case '(': case ')': case '*': case '+':
+ case ',': case '-': case '.': case '/':
+ case '0': case '1': case '2': case '3':
+ case '4': case '5': case '6': case '7':
+ case '8': case '9': case ':': case ';':
+ case '<': case '=': case '>': case '?':
+ case '@': case 'A': case 'B': case 'C':
+ case 'D': case 'E': case 'F': case 'G':
+ case 'H': case 'I': case 'J': case 'K':
+ case 'L': case 'M': case 'N': case 'O':
+ case 'P': case 'Q': case 'R': case 'S':
+ case 'T': case 'U': case 'V': case 'W':
+ case 'X': case 'Y': case 'Z': case '[':
+ case ']': case '^': case '_': case '`':
+ case 'a': case 'b': case 'c': case 'd':
+ case 'e': case 'f': case 'g': case 'h':
+ case 'i': case 'j': case 'k': case 'l':
+ case 'm': case 'n': case 'o': case 'p':
+ case 'q': case 'r': case 's': case 't':
+ case 'u': case 'v': case 'w': case 'x':
+ case 'y': case 'z': case '{': case '|':
+ case '}': case '~':
+ {
+ matchNot('\'');
+ break;
+ }
+ default:
+ {
+ throw new NoViableAltForCharException((char)LA(1),
getFilename(), getLine());
+ }
+ }
+ }
+ match('\'');
+ if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
+ _token = makeToken(_ttype);
+ _token.setText(new String(text.getBuffer(), _begin,
text.length()-_begin));
+ }
+ _returnToken = _token;
+ }
+
+ protected final void mTREE(boolean _createToken) throws
RecognitionException, CharStreamException, TokenStreamException {
+ int _ttype; Token _token=null; int _begin=text.length();
+ _ttype = TREE;
+ int _saveIndex;
+ Token t=null;
+ Token t2=null;
+
+ StringBuffer buf = new StringBuffer();
+ int n=0;
+ Vector terms = new Vector(10);
+
+
+ _saveIndex=text.length();
+ match('(');
+ text.setLength(_saveIndex);
+ {
+ switch ( LA(1)) {
+ case '\t': case '\n': case '\r': case ' ':
+ {
+ _saveIndex=text.length();
+ mWS(false);
+ text.setLength(_saveIndex);
+ break;
+ }
+ case '"': case '#': case '(': case 'A':
+ case 'B': case 'C': case 'D': case 'E':
+ case 'F': case 'G': case 'H': case 'I':
+ case 'J': case 'K': case 'L': case 'M':
+ case 'N': case 'O': case 'P': case 'Q':
+ case 'R': case 'S': case 'T': case 'U':
+ case 'V': case 'W': case 'X': case 'Y':
+ case 'Z': case '[': case '_': case 'a':
+ case 'b': case 'c': case 'd': case 'e':
+ case 'f': case 'g': case 'h': case 'i':
+ case 'j': case 'k': case 'l': case 'm':
+ case 'n': case 'o': case 'p': case 'q':
+ case 'r': case 's': case 't': case 'u':
+ case 'v': case 'w': case 'x': case 'y':
+ case 'z':
+ {
+ break;
+ }
+ default:
+ {
+ throw new NoViableAltForCharException((char)LA(1),
getFilename(), getLine());
+ }
+ }
+ }
+ _saveIndex=text.length();
+ mTREE_ELEMENT(true);
+ text.setLength(_saveIndex);
+ t=_returnToken;
+ terms.appendElement(t.getText());
+ {
+ switch ( LA(1)) {
+ case '\t': case '\n': case '\r': case ' ':
+ {
+ _saveIndex=text.length();
+ mWS(false);
+ text.setLength(_saveIndex);
+ break;
+ }
+ case ')': case ',':
+ {
+ break;
+ }
+ default:
+ {
+ throw new NoViableAltForCharException((char)LA(1),
getFilename(), getLine());
+ }
+ }
+ }
+ {
+ _loop20:
+ do {
+ if ((LA(1)==',')) {
+ _saveIndex=text.length();
+ match(',');
+ text.setLength(_saveIndex);
+ {
+ switch ( LA(1)) {
+ case '\t': case '\n': case '\r': case ' ':
+ {
+ _saveIndex=text.length();
+ mWS(false);
+ text.setLength(_saveIndex);
+ break;
+ }
+ case '"': case '#': case '(': case 'A':
+ case 'B': case 'C': case 'D': case 'E':
+ case 'F': case 'G': case 'H': case 'I':
+ case 'J': case 'K': case 'L': case 'M':
+ case 'N': case 'O': case 'P': case 'Q':
+ case 'R': case 'S': case 'T': case 'U':
+ case 'V': case 'W': case 'X': case 'Y':
+ case 'Z': case '[': case '_': case 'a':
+ case 'b': case 'c': case 'd': case 'e':
+ case 'f': case 'g': case 'h': case 'i':
+ case 'j': case 'k': case 'l': case 'm':
+ case 'n': case 'o': case 'p': case 'q':
+ case 'r': case 's': case 't': case 'u':
+ case 'v': case 'w': case 'x': case 'y':
+ case 'z':
+ {
+ break;
+ }
+ default:
+ {
+ throw new
NoViableAltForCharException((char)LA(1), getFilename(), getLine());
+ }
+ }
+ }
+ _saveIndex=text.length();
+ mTREE_ELEMENT(true);
+ text.setLength(_saveIndex);
+ t2=_returnToken;
+ terms.appendElement(t2.getText());
+ {
+ switch ( LA(1)) {
+ case '\t': case '\n': case '\r': case ' ':
+ {
+ _saveIndex=text.length();
+ mWS(false);
+ text.setLength(_saveIndex);
+ break;
+ }
+ case ')': case ',':
+ {
+ break;
+ }
+ default:
+ {
+ throw new
NoViableAltForCharException((char)LA(1), getFilename(), getLine());
+ }
+ }
+ }
+ }
+ else {
+ break _loop20;
+ }
+
+ } while (true);
+ }
+ text.setLength(_begin);
text.append(generator.getASTCreateString(terms));
+ _saveIndex=text.length();
+ match(')');
+ text.setLength(_saveIndex);
+ if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
+ _token = makeToken(_ttype);
+ _token.setText(new String(text.getBuffer(), _begin,
text.length()-_begin));
+ }
+ _returnToken = _token;
+ }
+
+ protected final void mID(boolean _createToken) throws
RecognitionException, CharStreamException, TokenStreamException {
+ int _ttype; Token _token=null; int _begin=text.length();
+ _ttype = ID;
+ int _saveIndex;
+
+ {
+ switch ( LA(1)) {
+ case 'a': case 'b': case 'c': case 'd':
+ case 'e': case 'f': case 'g': case 'h':
+ case 'i': case 'j': case 'k': case 'l':
+ case 'm': case 'n': case 'o': case 'p':
+ case 'q': case 'r': case 's': case 't':
+ case 'u': case 'v': case 'w': case 'x':
+ case 'y': case 'z':
+ {
+ matchRange('a','z');
+ break;
+ }
+ case 'A': case 'B': case 'C': case 'D':
+ case 'E': case 'F': case 'G': case 'H':
+ case 'I': case 'J': case 'K': case 'L':
+ case 'M': case 'N': case 'O': case 'P':
+ case 'Q': case 'R': case 'S': case 'T':
+ case 'U': case 'V': case 'W': case 'X':
+ case 'Y': case 'Z':
+ {
+ matchRange('A','Z');
+ break;
+ }
+ case '_':
+ {
+ match('_');
+ break;
+ }
+ default:
+ {
+ throw new NoViableAltForCharException((char)LA(1),
getFilename(), getLine());
+ }
+ }
+ }
+ {
+ _loop74:
+ do {
+ if ((_tokenSet_4.member(LA(1))) && (true)) {
+ {
+ switch ( LA(1)) {
+ case 'a': case 'b': case 'c': case 'd':
+ case 'e': case 'f': case 'g': case 'h':
+ case 'i': case 'j': case 'k': case 'l':
+ case 'm': case 'n': case 'o': case 'p':
+ case 'q': case 'r': case 's': case 't':
+ case 'u': case 'v': case 'w': case 'x':
+ case 'y': case 'z':
+ {
+ matchRange('a','z');
+ break;
+ }
+ case 'A': case 'B': case 'C': case 'D':
+ case 'E': case 'F': case 'G': case 'H':
+ case 'I': case 'J': case 'K': case 'L':
+ case 'M': case 'N': case 'O': case 'P':
+ case 'Q': case 'R': case 'S': case 'T':
+ case 'U': case 'V': case 'W': case 'X':
+ case 'Y': case 'Z':
+ {
+ matchRange('A','Z');
+ break;
+ }
+ case '0': case '1': case '2': case '3':
+ case '4': case '5': case '6': case '7':
+ case '8': case '9':
+ {
+ matchRange('0','9');
+ break;
+ }
+ case '_':
+ {
+ match('_');
+ break;
+ }
+ default:
+ {
+ throw new
NoViableAltForCharException((char)LA(1), getFilename(), getLine());
+ }
+ }
+ }
+ }
+ else {
+ break _loop74;
+ }
+
+ } while (true);
+ }
+ if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
+ _token = makeToken(_ttype);
+ _token.setText(new String(text.getBuffer(), _begin,
text.length()-_begin));
+ }
+ _returnToken = _token;
+ }
+
+ protected final void mWS(boolean _createToken) throws
RecognitionException, CharStreamException, TokenStreamException {
+ int _ttype; Token _token=null; int _begin=text.length();
+ _ttype = WS;
+ int _saveIndex;
+
+ {
+ int _cnt108=0;
+ _loop108:
+ do {
+ if ((LA(1)=='\r') && (LA(2)=='\n')) {
+ match('\r');
+ match('\n');
+ newline();
+ }
+ else if ((LA(1)==' ') && (true)) {
+ match(' ');
+ }
+ else if ((LA(1)=='\t') && (true)) {
+ match('\t');
+ }
+ else if ((LA(1)=='\r') && (true)) {
+ match('\r');
+ newline();
+ }
+ else if ((LA(1)=='\n') && (true)) {
+ match('\n');
+ newline();
+ }
+ else {
+ if ( _cnt108>=1 ) { break _loop108; } else
{throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine());}
+ }
+
+ _cnt108++;
+ } while (true);
+ }
+ if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
+ _token = makeToken(_ttype);
+ _token.setText(new String(text.getBuffer(), _begin,
text.length()-_begin));
+ }
+ _returnToken = _token;
+ }
+
+ protected final void mVAR_ASSIGN(boolean _createToken) throws
RecognitionException, CharStreamException, TokenStreamException {
+ int _ttype; Token _token=null; int _begin=text.length();
+ _ttype = VAR_ASSIGN;
+ int _saveIndex;
+
+ match('=');
+
+ // inform the code generator that an assignment
was done to
+ // AST root for the rule if invoker set
refRuleRoot.
+ if ( LA(1)!='=' && transInfo!=null &&
transInfo.refRuleRoot!=null ) {
+ transInfo.assignToRoot=true;
+ }
+
+ if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
+ _token = makeToken(_ttype);
+ _token.setText(new String(text.getBuffer(), _begin,
text.length()-_begin));
+ }
+ _returnToken = _token;
+ }
+
+ protected final void mAST_CONSTRUCTOR(boolean _createToken) throws
RecognitionException, CharStreamException, TokenStreamException {
+ int _ttype; Token _token=null; int _begin=text.length();
+ _ttype = AST_CONSTRUCTOR;
+ int _saveIndex;
+ Token x=null;
+ Token y=null;
+
+ _saveIndex=text.length();
+ match('[');
+ text.setLength(_saveIndex);
+ {
+ switch ( LA(1)) {
+ case '\t': case '\n': case '\r': case ' ':
+ {
+ _saveIndex=text.length();
+ mWS(false);
+ text.setLength(_saveIndex);
+ break;
+ }
+ case '"': case '#': case '(': case '0':
+ case '1': case '2': case '3': case '4':
+ case '5': case '6': case '7': case '8':
+ case '9': case 'A': case 'B': case 'C':
+ case 'D': case 'E': case 'F': case 'G':
+ case 'H': case 'I': case 'J': case 'K':
+ case 'L': case 'M': case 'N': case 'O':
+ case 'P': case 'Q': case 'R': case 'S':
+ case 'T': case 'U': case 'V': case 'W':
+ case 'X': case 'Y': case 'Z': case '[':
+ case '_': case 'a': case 'b': case 'c':
+ case 'd': case 'e': case 'f': case 'g':
+ case 'h': case 'i': case 'j': case 'k':
+ case 'l': case 'm': case 'n': case 'o':
+ case 'p': case 'q': case 'r': case 's':
+ case 't': case 'u': case 'v': case 'w':
+ case 'x': case 'y': case 'z':
+ {
+ break;
+ }
+ default:
+ {
+ throw new NoViableAltForCharException((char)LA(1),
getFilename(), getLine());
+ }
+ }
+ }
+ _saveIndex=text.length();
+ mAST_CTOR_ELEMENT(true);
+ text.setLength(_saveIndex);
+ x=_returnToken;
+ {
+ switch ( LA(1)) {
+ case '\t': case '\n': case '\r': case ' ':
+ {
+ _saveIndex=text.length();
+ mWS(false);
+ text.setLength(_saveIndex);
+ break;
+ }
+ case ',': case ']':
+ {
+ break;
+ }
+ default:
+ {
+ throw new NoViableAltForCharException((char)LA(1),
getFilename(), getLine());
+ }
+ }
+ }
+ {
+ switch ( LA(1)) {
+ case ',':
+ {
+ _saveIndex=text.length();
+ match(',');
+ text.setLength(_saveIndex);
+ {
+ switch ( LA(1)) {
+ case '\t': case '\n': case '\r': case ' ':
+ {
+ _saveIndex=text.length();
+ mWS(false);
+ text.setLength(_saveIndex);
+ break;
+ }
+ case '"': case '#': case '(': case '0':
+ case '1': case '2': case '3': case '4':
+ case '5': case '6': case '7': case '8':
+ case '9': case 'A': case 'B': case 'C':
+ case 'D': case 'E': case 'F': case 'G':
+ case 'H': case 'I': case 'J': case 'K':
+ case 'L': case 'M': case 'N': case 'O':
+ case 'P': case 'Q': case 'R': case 'S':
+ case 'T': case 'U': case 'V': case 'W':
+ case 'X': case 'Y': case 'Z': case '[':
+ case '_': case 'a': case 'b': case 'c':
+ case 'd': case 'e': case 'f': case 'g':
+ case 'h': case 'i': case 'j': case 'k':
+ case 'l': case 'm': case 'n': case 'o':
+ case 'p': case 'q': case 'r': case 's':
+ case 't': case 'u': case 'v': case 'w':
+ case 'x': case 'y': case 'z':
+ {
+ break;
+ }
+ default:
+ {
+ throw new
NoViableAltForCharException((char)LA(1), getFilename(), getLine());
+ }
+ }
+ }
+ _saveIndex=text.length();
+ mAST_CTOR_ELEMENT(true);
+ text.setLength(_saveIndex);
+ y=_returnToken;
+ {
+ switch ( LA(1)) {
+ case '\t': case '\n': case '\r': case ' ':
+ {
+ _saveIndex=text.length();
+ mWS(false);
+ text.setLength(_saveIndex);
+ break;
+ }
+ case ']':
+ {
+ break;
+ }
+ default:
+ {
+ throw new
NoViableAltForCharException((char)LA(1), getFilename(), getLine());
+ }
+ }
+ }
+ break;
+ }
+ case ']':
+ {
+ break;
+ }
+ default:
+ {
+ throw new NoViableAltForCharException((char)LA(1),
getFilename(), getLine());
+ }
+ }
+ }
+ _saveIndex=text.length();
+ match(']');
+ text.setLength(_saveIndex);
+
+ String ys = "";
+ if ( y!=null ) {
+ ys = ","+y.getText();
+ }
+ text.setLength(_begin);
text.append(generator.getASTCreateString(null,x.getText()+ys));
+
+ if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
+ _token = makeToken(_ttype);
+ _token.setText(new String(text.getBuffer(), _begin,
text.length()-_begin));
+ }
+ _returnToken = _token;
+ }
+
+ protected final void mTEXT_ARG(boolean _createToken) throws
RecognitionException, CharStreamException, TokenStreamException {
+ int _ttype; Token _token=null; int _begin=text.length();
+ _ttype = TEXT_ARG;
+ int _saveIndex;
+
+ {
+ switch ( LA(1)) {
+ case '\t': case '\n': case '\r': case ' ':
+ {
+ mWS(false);
+ break;
+ }
+ case '"': case '$': case '\'': case '+':
+ case '0': case '1': case '2': case '3':
+ case '4': case '5': case '6': case '7':
+ case '8': case '9': case 'A': case 'B':
+ case 'C': case 'D': case 'E': case 'F':
+ case 'G': case 'H': case 'I': case 'J':
+ case 'K': case 'L': case 'M': case 'N':
+ case 'O': case 'P': case 'Q': case 'R':
+ case 'S': case 'T': case 'U': case 'V':
+ case 'W': case 'X': case 'Y': case 'Z':
+ case '_': case 'a': case 'b': case 'c':
+ case 'd': case 'e': case 'f': case 'g':
+ case 'h': case 'i': case 'j': case 'k':
+ case 'l': case 'm': case 'n': case 'o':
+ case 'p': case 'q': case 'r': case 's':
+ case 't': case 'u': case 'v': case 'w':
+ case 'x': case 'y': case 'z':
+ {
+ break;
+ }
+ default:
+ {
+ throw new NoViableAltForCharException((char)LA(1),
getFilename(), getLine());
+ }
+ }
+ }
+ {
+ int _cnt48=0;
+ _loop48:
+ do {
+ if ((_tokenSet_5.member(LA(1))) && ((LA(2) >= '\u0003'
&& LA(2) <= '~'))) {
+ mTEXT_ARG_ELEMENT(false);
+ {
+ if ((_tokenSet_3.member(LA(1))) &&
(_tokenSet_6.member(LA(2)))) {
+ mWS(false);
+ }
+ else if ((_tokenSet_6.member(LA(1))) && (true))
{
+ }
+ else {
+ throw new
NoViableAltForCharException((char)LA(1), getFilename(), getLine());
+ }
+
+ }
+ }
+ else {
+ if ( _cnt48>=1 ) { break _loop48; } else {throw
new NoViableAltForCharException((char)LA(1), getFilename(), getLine());}
+ }
+
+ _cnt48++;
+ } while (true);
+ }
+ if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
+ _token = makeToken(_ttype);
+ _token.setText(new String(text.getBuffer(), _begin,
text.length()-_begin));
+ }
+ _returnToken = _token;
+ }
+
+ protected final void mTREE_ELEMENT(boolean _createToken) throws
RecognitionException, CharStreamException, TokenStreamException {
+ int _ttype; Token _token=null; int _begin=text.length();
+ _ttype = TREE_ELEMENT;
+ int _saveIndex;
+ Token id=null;
+ boolean was_mapped;
+
+ switch ( LA(1)) {
+ case '(':
+ {
+ mTREE(false);
+ break;
+ }
+ case '[':
+ {
+ mAST_CONSTRUCTOR(false);
+ break;
+ }
+ case 'A': case 'B': case 'C': case 'D':
+ case 'E': case 'F': case 'G': case 'H':
+ case 'I': case 'J': case 'K': case 'L':
+ case 'M': case 'N': case 'O': case 'P':
+ case 'Q': case 'R': case 'S': case 'T':
+ case 'U': case 'V': case 'W': case 'X':
+ case 'Y': case 'Z': case '_': case 'a':
+ case 'b': case 'c': case 'd': case 'e':
+ case 'f': case 'g': case 'h': case 'i':
+ case 'j': case 'k': case 'l': case 'm':
+ case 'n': case 'o': case 'p': case 'q':
+ case 'r': case 's': case 't': case 'u':
+ case 'v': case 'w': case 'x': case 'y':
+ case 'z':
+ {
+ mID_ELEMENT(false);
+ break;
+ }
+ case '"':
+ {
+ mSTRING(false);
+ break;
+ }
+ default:
+ if ((LA(1)=='#') && (LA(2)=='(')) {
+ _saveIndex=text.length();
+ match('#');
+ text.setLength(_saveIndex);
+ mTREE(false);
+ }
+ else if ((LA(1)=='#') && (LA(2)=='[')) {
+ _saveIndex=text.length();
+ match('#');
+ text.setLength(_saveIndex);
+ mAST_CONSTRUCTOR(false);
+ }
+ else if ((LA(1)=='#') && (_tokenSet_2.member(LA(2)))) {
+ _saveIndex=text.length();
+ match('#');
+ text.setLength(_saveIndex);
+ was_mapped=mID_ELEMENT(true);
+ id=_returnToken;
+ // RK: I have a queer feeling that this
maptreeid is redundant
+ if( ! was_mapped )
+ {
+ String t =
generator.mapTreeId(id.getText(), null);
+
text.setLength(_begin); text.append(t);
+ }
+
+ }
+ else if ((LA(1)=='#') && (LA(2)=='#')) {
+ match("##");
+ String t = currentRule.getRuleName()+"_AST";
text.setLength(_begin); text.append(t);
+ }
+ else {
+ throw new NoViableAltForCharException((char)LA(1),
getFilename(), getLine());
+ }
+ }
+ if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
+ _token = makeToken(_ttype);
+ _token.setText(new String(text.getBuffer(), _begin,
text.length()-_begin));
+ }
+ _returnToken = _token;
+ }
+
+/** An ID_ELEMENT can be a func call, array ref, simple var,
+ * or AST label ref.
+ */
+ protected final boolean mID_ELEMENT(boolean _createToken) throws
RecognitionException, CharStreamException, TokenStreamException {
+ boolean mapped=false;
+ int _ttype; Token _token=null; int _begin=text.length();
+ _ttype = ID_ELEMENT;
+ int _saveIndex;
+ Token id=null;
+
+ mID(true);
+ id=_returnToken;
+ {
+ if ((_tokenSet_3.member(LA(1))) && (_tokenSet_7.member(LA(2))))
{
+ _saveIndex=text.length();
+ mWS(false);
+ text.setLength(_saveIndex);
+ }
+ else if ((_tokenSet_7.member(LA(1))) && (true)) {
+ }
+ else {
+ throw new NoViableAltForCharException((char)LA(1),
getFilename(), getLine());
+ }
+
+ }
+ {
+ switch ( LA(1)) {
+ case '(':
+ {
+ match('(');
+ {
+ if ((_tokenSet_3.member(LA(1))) &&
(_tokenSet_8.member(LA(2)))) {
+ _saveIndex=text.length();
+ mWS(false);
+ text.setLength(_saveIndex);
+ }
+ else if ((_tokenSet_8.member(LA(1))) && ((LA(2) >=
'\u0003' && LA(2) <= '~'))) {
+ }
+ else {
+ throw new
NoViableAltForCharException((char)LA(1), getFilename(), getLine());
+ }
+
+ }
+ {
+ switch ( LA(1)) {
+ case '"': case '#': case '\'': case '(':
+ case '0': case '1': case '2': case '3':
+ case '4': case '5': case '6': case '7':
+ case '8': case '9': case 'A': case 'B':
+ case 'C': case 'D': case 'E': case 'F':
+ case 'G': case 'H': case 'I': case 'J':
+ case 'K': case 'L': case 'M': case 'N':
+ case 'O': case 'P': case 'Q': case 'R':
+ case 'S': case 'T': case 'U': case 'V':
+ case 'W': case 'X': case 'Y': case 'Z':
+ case '[': case '_': case 'a': case 'b':
+ case 'c': case 'd': case 'e': case 'f':
+ case 'g': case 'h': case 'i': case 'j':
+ case 'k': case 'l': case 'm': case 'n':
+ case 'o': case 'p': case 'q': case 'r':
+ case 's': case 't': case 'u': case 'v':
+ case 'w': case 'x': case 'y': case 'z':
+ {
+ mARG(false);
+ {
+ _loop36:
+ do {
+ if ((LA(1)==',')) {
+ match(',');
+ {
+ switch ( LA(1)) {
+ case '\t': case '\n': case
'\r': case ' ':
+ {
+
_saveIndex=text.length();
+ mWS(false);
+
text.setLength(_saveIndex);
+ break;
+ }
+ case '"': case '#': case
'\'': case '(':
+ case '0': case '1': case '2':
case '3':
+ case '4': case '5': case '6':
case '7':
+ case '8': case '9': case 'A':
case 'B':
+ case 'C': case 'D': case 'E':
case 'F':
+ case 'G': case 'H': case 'I':
case 'J':
+ case 'K': case 'L': case 'M':
case 'N':
+ case 'O': case 'P': case 'Q':
case 'R':
+ case 'S': case 'T': case 'U':
case 'V':
+ case 'W': case 'X': case 'Y':
case 'Z':
+ case '[': case '_': case 'a':
case 'b':
+ case 'c': case 'd': case 'e':
case 'f':
+ case 'g': case 'h': case 'i':
case 'j':
+ case 'k': case 'l': case 'm':
case 'n':
+ case 'o': case 'p': case 'q':
case 'r':
+ case 's': case 't': case 'u':
case 'v':
+ case 'w': case 'x': case 'y':
case 'z':
+ {
+ break;
+ }
+ default:
+ {
+ throw new
NoViableAltForCharException((char)LA(1), getFilename(), getLine());
+ }
+ }
+ }
+ mARG(false);
+ }
+ else {
+ break _loop36;
+ }
+
+ } while (true);
+ }
+ break;
+ }
+ case '\t': case '\n': case '\r': case ' ':
+ case ')':
+ {
+ break;
+ }
+ default:
+ {
+ throw new
NoViableAltForCharException((char)LA(1), getFilename(), getLine());
+ }
+ }
+ }
+ {
+ switch ( LA(1)) {
+ case '\t': case '\n': case '\r': case ' ':
+ {
+ _saveIndex=text.length();
+ mWS(false);
+ text.setLength(_saveIndex);
+ break;
+ }
+ case ')':
+ {
+ break;
+ }
+ default:
+ {
+ throw new
NoViableAltForCharException((char)LA(1), getFilename(), getLine());
+ }
+ }
+ }
+ match(')');
+ break;
+ }
+ case '[':
+ {
+ {
+ int _cnt41=0;
+ _loop41:
+ do {
+ if ((LA(1)=='[')) {
+ match('[');
+ {
+ switch ( LA(1)) {
+ case '\t': case '\n': case '\r':
case ' ':
+ {
+ _saveIndex=text.length();
+ mWS(false);
+ text.setLength(_saveIndex);
+ break;
+ }
+ case '"': case '#': case '\'': case
'(':
+ case '0': case '1': case '2': case
'3':
+ case '4': case '5': case '6': case
'7':
+ case '8': case '9': case 'A': case
'B':
+ case 'C': case 'D': case 'E': case
'F':
+ case 'G': case 'H': case 'I': case
'J':
+ case 'K': case 'L': case 'M': case
'N':
+ case 'O': case 'P': case 'Q': case
'R':
+ case 'S': case 'T': case 'U': case
'V':
+ case 'W': case 'X': case 'Y': case
'Z':
+ case '[': case '_': case 'a': case
'b':
+ case 'c': case 'd': case 'e': case
'f':
+ case 'g': case 'h': case 'i': case
'j':
+ case 'k': case 'l': case 'm': case
'n':
+ case 'o': case 'p': case 'q': case
'r':
+ case 's': case 't': case 'u': case
'v':
+ case 'w': case 'x': case 'y': case
'z':
+ {
+ break;
+ }
+ default:
+ {
+ throw new
NoViableAltForCharException((char)LA(1), getFilename(), getLine());
+ }
+ }
+ }
+ mARG(false);
+ {
+ switch ( LA(1)) {
+ case '\t': case '\n': case '\r':
case ' ':
+ {
+ _saveIndex=text.length();
+ mWS(false);
+ text.setLength(_saveIndex);
+ break;
+ }
+ case ']':
+ {
+ break;
+ }
+ default:
+ {
+ throw new
NoViableAltForCharException((char)LA(1), getFilename(), getLine());
+ }
+ }
+ }
+ match(']');
+ }
+ else {
+ if ( _cnt41>=1 ) { break _loop41; }
else {throw new NoViableAltForCharException((char)LA(1), getFilename(),
getLine());}
+ }
+
+ _cnt41++;
+ } while (true);
+ }
+ break;
+ }
+ case '.':
+ {
+ match('.');
+ mID_ELEMENT(false);
+ break;
+ }
+ default:
+ if ((LA(1)=='-') && (LA(2)=='>')) {
+ match("->");
+ mID_ELEMENT(false);
+ }
+ else if ((_tokenSet_9.member(LA(1))) && (true)) {
+
+ mapped = true;
+ String t =
generator.mapTreeId(id.getText(), transInfo);
+
text.setLength(_begin); text.append(t);
+
+ {
+ if (((_tokenSet_10.member(LA(1))) &&
(_tokenSet_9.member(LA(2))))&&(transInfo!=null && transInfo.refRuleRoot!=null))
{
+ {
+ switch ( LA(1)) {
+ case '\t': case '\n': case '\r':
case ' ':
+ {
+ mWS(false);
+ break;
+ }
+ case '=':
+ {
+ break;
+ }
+ default:
+ {
+ throw new
NoViableAltForCharException((char)LA(1), getFilename(), getLine());
+ }
+ }
+ }
+ mVAR_ASSIGN(false);
+ }
+ else if ((_tokenSet_11.member(LA(1))) &&
(true)) {
+ }
+ else {
+ throw new
NoViableAltForCharException((char)LA(1), getFilename(), getLine());
+ }
+
+ }
+ }
+ else {
+ throw new NoViableAltForCharException((char)LA(1),
getFilename(), getLine());
+ }
+ }
+ }
+ if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
+ _token = makeToken(_ttype);
+ _token.setText(new String(text.getBuffer(), _begin,
text.length()-_begin));
+ }
+ _returnToken = _token;
+ return mapped;
+ }
+
+/** The arguments of a #[...] constructor are text, token type,
+ * or a tree.
+ */
+ protected final void mAST_CTOR_ELEMENT(boolean _createToken) throws
RecognitionException, CharStreamException, TokenStreamException {
+ int _ttype; Token _token=null; int _begin=text.length();
+ _ttype = AST_CTOR_ELEMENT;
+ int _saveIndex;
+
+ if ((LA(1)=='"') && ((LA(2) >= '\u0003' && LA(2) <= '~'))) {
+ mSTRING(false);
+ }
+ else if ((_tokenSet_12.member(LA(1))) && ((LA(2) >= '\u0003' &&
LA(2) <= '~'))) {
+ mTREE_ELEMENT(false);
+ }
+ else if (((LA(1) >= '0' && LA(1) <= '9'))) {
+ mINT(false);
+ }
+ else {
+ throw new NoViableAltForCharException((char)LA(1),
getFilename(), getLine());
+ }
+
+ if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
+ _token = makeToken(_ttype);
+ _token.setText(new String(text.getBuffer(), _begin,
text.length()-_begin));
+ }
+ _returnToken = _token;
+ }
+
+ protected final void mINT(boolean _createToken) throws
RecognitionException, CharStreamException, TokenStreamException {
+ int _ttype; Token _token=null; int _begin=text.length();
+ _ttype = INT;
+ int _saveIndex;
+
+ {
+ int _cnt99=0;
+ _loop99:
+ do {
+ if (((LA(1) >= '0' && LA(1) <= '9'))) {
+ mDIGIT(false);
+ }
+ else {
+ if ( _cnt99>=1 ) { break _loop99; } else {throw
new NoViableAltForCharException((char)LA(1), getFilename(), getLine());}
+ }
+
+ _cnt99++;
+ } while (true);
+ }
+ if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
+ _token = makeToken(_ttype);
+ _token.setText(new String(text.getBuffer(), _begin,
text.length()-_begin));
+ }
+ _returnToken = _token;
+ }
+
+ protected final void mARG(boolean _createToken) throws
RecognitionException, CharStreamException, TokenStreamException {
+ int _ttype; Token _token=null; int _begin=text.length();
+ _ttype = ARG;
+ int _saveIndex;
+
+ {
+ switch ( LA(1)) {
+ case '\'':
+ {
+ mCHAR(false);
+ break;
+ }
+ case '0': case '1': case '2': case '3':
+ case '4': case '5': case '6': case '7':
+ case '8': case '9':
+ {
+ mINT_OR_FLOAT(false);
+ break;
+ }
+ default:
+ if ((_tokenSet_12.member(LA(1))) && ((LA(2) >= '\u0003'
&& LA(2) <= '~'))) {
+ mTREE_ELEMENT(false);
+ }
+ else if ((LA(1)=='"') && ((LA(2) >= '\u0003' && LA(2)
<= '~'))) {
+ mSTRING(false);
+ }
+ else {
+ throw new NoViableAltForCharException((char)LA(1),
getFilename(), getLine());
+ }
+ }
+ }
+ {
+ _loop69:
+ do {
+ if ((_tokenSet_13.member(LA(1))) &&
(_tokenSet_14.member(LA(2)))) {
+ {
+ switch ( LA(1)) {
+ case '\t': case '\n': case '\r': case ' ':
+ {
+ mWS(false);
+ break;
+ }
+ case '*': case '+': case '-': case '/':
+ {
+ break;
+ }
+ default:
+ {
+ throw new
NoViableAltForCharException((char)LA(1), getFilename(), getLine());
+ }
+ }
+ }
+ {
+ switch ( LA(1)) {
+ case '+':
+ {
+ match('+');
+ break;
+ }
+ case '-':
+ {
+ match('-');
+ break;
+ }
+ case '*':
+ {
+ match('*');
+ break;
+ }
+ case '/':
+ {
+ match('/');
+ break;
+ }
+ default:
+ {
+ throw new
NoViableAltForCharException((char)LA(1), getFilename(), getLine());
+ }
+ }
+ }
+ {
+ switch ( LA(1)) {
+ case '\t': case '\n': case '\r': case ' ':
+ {
+ mWS(false);
+ break;
+ }
+ case '"': case '#': case '\'': case '(':
+ case '0': case '1': case '2': case '3':
+ case '4': case '5': case '6': case '7':
+ case '8': case '9': case 'A': case 'B':
+ case 'C': case 'D': case 'E': case 'F':
+ case 'G': case 'H': case 'I': case 'J':
+ case 'K': case 'L': case 'M': case 'N':
+ case 'O': case 'P': case 'Q': case 'R':
+ case 'S': case 'T': case 'U': case 'V':
+ case 'W': case 'X': case 'Y': case 'Z':
+ case '[': case '_': case 'a': case 'b':
+ case 'c': case 'd': case 'e': case 'f':
+ case 'g': case 'h': case 'i': case 'j':
+ case 'k': case 'l': case 'm': case 'n':
+ case 'o': case 'p': case 'q': case 'r':
+ case 's': case 't': case 'u': case 'v':
+ case 'w': case 'x': case 'y': case 'z':
+ {
+ break;
+ }
+ default:
+ {
+ throw new
NoViableAltForCharException((char)LA(1), getFilename(), getLine());
+ }
+ }
+ }
+ mARG(false);
+ }
+ else {
+ break _loop69;
+ }
+
+ } while (true);
+ }
+ if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
+ _token = makeToken(_ttype);
+ _token.setText(new String(text.getBuffer(), _begin,
text.length()-_begin));
+ }
+ _returnToken = _token;
+ }
+
+ protected final void mTEXT_ARG_ELEMENT(boolean _createToken) throws
RecognitionException, CharStreamException, TokenStreamException {
+ int _ttype; Token _token=null; int _begin=text.length();
+ _ttype = TEXT_ARG_ELEMENT;
+ int _saveIndex;
+
+ switch ( LA(1)) {
+ case 'A': case 'B': case 'C': case 'D':
+ case 'E': case 'F': case 'G': case 'H':
+ case 'I': case 'J': case 'K': case 'L':
+ case 'M': case 'N': case 'O': case 'P':
+ case 'Q': case 'R': case 'S': case 'T':
+ case 'U': case 'V': case 'W': case 'X':
+ case 'Y': case 'Z': case '_': case 'a':
+ case 'b': case 'c': case 'd': case 'e':
+ case 'f': case 'g': case 'h': case 'i':
+ case 'j': case 'k': case 'l': case 'm':
+ case 'n': case 'o': case 'p': case 'q':
+ case 'r': case 's': case 't': case 'u':
+ case 'v': case 'w': case 'x': case 'y':
+ case 'z':
+ {
+ mTEXT_ARG_ID_ELEMENT(false);
+ break;
+ }
+ case '"':
+ {
+ mSTRING(false);
+ break;
+ }
+ case '\'':
+ {
+ mCHAR(false);
+ break;
+ }
+ case '0': case '1': case '2': case '3':
+ case '4': case '5': case '6': case '7':
+ case '8': case '9':
+ {
+ mINT_OR_FLOAT(false);
+ break;
+ }
+ case '$':
+ {
+ mTEXT_ITEM(false);
+ break;
+ }
+ case '+':
+ {
+ match('+');
+ break;
+ }
+ default:
+ {
+ throw new NoViableAltForCharException((char)LA(1),
getFilename(), getLine());
+ }
+ }
+ if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
+ _token = makeToken(_ttype);
+ _token.setText(new String(text.getBuffer(), _begin,
text.length()-_begin));
+ }
+ _returnToken = _token;
+ }
+
+ protected final void mTEXT_ARG_ID_ELEMENT(boolean _createToken) throws
RecognitionException, CharStreamException, TokenStreamException {
+ int _ttype; Token _token=null; int _begin=text.length();
+ _ttype = TEXT_ARG_ID_ELEMENT;
+ int _saveIndex;
+ Token id=null;
+
+ mID(true);
+ id=_returnToken;
+ {
+ if ((_tokenSet_3.member(LA(1))) &&
(_tokenSet_15.member(LA(2)))) {
+ _saveIndex=text.length();
+ mWS(false);
+ text.setLength(_saveIndex);
+ }
+ else if ((_tokenSet_15.member(LA(1))) && (true)) {
+ }
+ else {
+ throw new NoViableAltForCharException((char)LA(1),
getFilename(), getLine());
+ }
+
+ }
+ {
+ switch ( LA(1)) {
+ case '(':
+ {
+ match('(');
+ {
+ if ((_tokenSet_3.member(LA(1))) &&
(_tokenSet_16.member(LA(2)))) {
+ _saveIndex=text.length();
+ mWS(false);
+ text.setLength(_saveIndex);
+ }
+ else if ((_tokenSet_16.member(LA(1))) && ((LA(2) >=
'\u0003' && LA(2) <= '~'))) {
+ }
+ else {
+ throw new
NoViableAltForCharException((char)LA(1), getFilename(), getLine());
+ }
+
+ }
+ {
+ _loop57:
+ do {
+ if ((_tokenSet_17.member(LA(1))) && ((LA(2) >=
'\u0003' && LA(2) <= '~'))) {
+ mTEXT_ARG(false);
+ {
+ _loop56:
+ do {
+ if ((LA(1)==',')) {
+ match(',');
+ mTEXT_ARG(false);
+ }
+ else {
+ break _loop56;
+ }
+
+ } while (true);
+ }
+ }
+ else {
+ break _loop57;
+ }
+
+ } while (true);
+ }
+ {
+ switch ( LA(1)) {
+ case '\t': case '\n': case '\r': case ' ':
+ {
+ _saveIndex=text.length();
+ mWS(false);
+ text.setLength(_saveIndex);
+ break;
+ }
+ case ')':
+ {
+ break;
+ }
+ default:
+ {
+ throw new
NoViableAltForCharException((char)LA(1), getFilename(), getLine());
+ }
+ }
+ }
+ match(')');
+ break;
+ }
+ case '[':
+ {
+ {
+ int _cnt62=0;
+ _loop62:
+ do {
+ if ((LA(1)=='[')) {
+ match('[');
+ {
+ if ((_tokenSet_3.member(LA(1))) &&
(_tokenSet_17.member(LA(2)))) {
+ _saveIndex=text.length();
+ mWS(false);
+ text.setLength(_saveIndex);
+ }
+ else if ((_tokenSet_17.member(LA(1)))
&& ((LA(2) >= '\u0003' && LA(2) <= '~'))) {
+ }
+ else {
+ throw new
NoViableAltForCharException((char)LA(1), getFilename(), getLine());
+ }
+
+ }
+ mTEXT_ARG(false);
+ {
+ switch ( LA(1)) {
+ case '\t': case '\n': case '\r':
case ' ':
+ {
+ _saveIndex=text.length();
+ mWS(false);
+ text.setLength(_saveIndex);
+ break;
+ }
+ case ']':
+ {
+ break;
+ }
+ default:
+ {
+ throw new
NoViableAltForCharException((char)LA(1), getFilename(), getLine());
+ }
+ }
+ }
+ match(']');
+ }
+ else {
+ if ( _cnt62>=1 ) { break _loop62; }
else {throw new NoViableAltForCharException((char)LA(1), getFilename(),
getLine());}
+ }
+
+ _cnt62++;
+ } while (true);
+ }
+ break;
+ }
+ case '.':
+ {
+ match('.');
+ mTEXT_ARG_ID_ELEMENT(false);
+ break;
+ }
+ case '-':
+ {
+ match("->");
+ mTEXT_ARG_ID_ELEMENT(false);
+ break;
+ }
+ case '\t': case '\n': case '\r': case ' ':
+ case '"': case '$': case '\'': case ')':
+ case '+': case ',': case '0': case '1':
+ case '2': case '3': case '4': case '5':
+ case '6': case '7': case '8': case '9':
+ case 'A': case 'B': case 'C': case 'D':
+ case 'E': case 'F': case 'G': case 'H':
+ case 'I': case 'J': case 'K': case 'L':
+ case 'M': case 'N': case 'O': case 'P':
+ case 'Q': case 'R': case 'S': case 'T':
+ case 'U': case 'V': case 'W': case 'X':
+ case 'Y': case 'Z': case ']': case '_':
+ case 'a': case 'b': case 'c': case 'd':
+ case 'e': case 'f': case 'g': case 'h':
+ case 'i': case 'j': case 'k': case 'l':
+ case 'm': case 'n': case 'o': case 'p':
+ case 'q': case 'r': case 's': case 't':
+ case 'u': case 'v': case 'w': case 'x':
+ case 'y': case 'z':
+ {
+ break;
+ }
+ default:
+ {
+ throw new NoViableAltForCharException((char)LA(1),
getFilename(), getLine());
+ }
+ }
+ }
+ if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
+ _token = makeToken(_ttype);
+ _token.setText(new String(text.getBuffer(), _begin,
text.length()-_begin));
+ }
+ _returnToken = _token;
+ }
+
+ protected final void mINT_OR_FLOAT(boolean _createToken) throws
RecognitionException, CharStreamException, TokenStreamException {
+ int _ttype; Token _token=null; int _begin=text.length();
+ _ttype = INT_OR_FLOAT;
+ int _saveIndex;
+
+ {
+ int _cnt102=0;
+ _loop102:
+ do {
+ if (((LA(1) >= '0' && LA(1) <= '9')) &&
(_tokenSet_18.member(LA(2)))) {
+ mDIGIT(false);
+ }
+ else {
+ if ( _cnt102>=1 ) { break _loop102; } else
{throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine());}
+ }
+
+ _cnt102++;
+ } while (true);
+ }
+ {
+ if ((LA(1)=='L') && (_tokenSet_19.member(LA(2)))) {
+ match('L');
+ }
+ else if ((LA(1)=='l') && (_tokenSet_19.member(LA(2)))) {
+ match('l');
+ }
+ else if ((LA(1)=='.')) {
+ match('.');
+ {
+ _loop105:
+ do {
+ if (((LA(1) >= '0' && LA(1) <= '9')) &&
(_tokenSet_19.member(LA(2)))) {
+ mDIGIT(false);
+ }
+ else {
+ break _loop105;
+ }
+
+ } while (true);
+ }
+ }
+ else if ((_tokenSet_19.member(LA(1))) && (true)) {
+ }
+ else {
+ throw new NoViableAltForCharException((char)LA(1),
getFilename(), getLine());
+ }
+
+ }
+ if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
+ _token = makeToken(_ttype);
+ _token.setText(new String(text.getBuffer(), _begin,
text.length()-_begin));
+ }
+ _returnToken = _token;
+ }
+
+ protected final void mSL_COMMENT(boolean _createToken) throws
RecognitionException, CharStreamException, TokenStreamException {
+ int _ttype; Token _token=null; int _begin=text.length();
+ _ttype = SL_COMMENT;
+ int _saveIndex;
+
+ match("//");
+ {
+ _loop79:
+ do {
+ // nongreedy exit test
+ if ((LA(1)=='\n'||LA(1)=='\r') && (true)) break _loop79;
+ if (((LA(1) >= '\u0003' && LA(1) <= '~')) && ((LA(2) >=
'\u0003' && LA(2) <= '~'))) {
+ matchNot(EOF_CHAR);
+ }
+ else {
+ break _loop79;
+ }
+
+ } while (true);
+ }
+ {
+ if ((LA(1)=='\r') && (LA(2)=='\n')) {
+ match("\r\n");
+ }
+ else if ((LA(1)=='\n')) {
+ match('\n');
+ }
+ else if ((LA(1)=='\r') && (true)) {
+ match('\r');
+ }
+ else {
+ throw new NoViableAltForCharException((char)LA(1),
getFilename(), getLine());
+ }
+
+ }
+ newline();
+ if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
+ _token = makeToken(_ttype);
+ _token.setText(new String(text.getBuffer(), _begin,
text.length()-_begin));
+ }
+ _returnToken = _token;
+ }
+
+ protected final void mML_COMMENT(boolean _createToken) throws
RecognitionException, CharStreamException, TokenStreamException {
+ int _ttype; Token _token=null; int _begin=text.length();
+ _ttype = ML_COMMENT;
+ int _saveIndex;
+
+ match("/*");
+ {
+ _loop83:
+ do {
+ // nongreedy exit test
+ if ((LA(1)=='*') && (LA(2)=='/')) break _loop83;
+ if ((LA(1)=='\r') && (LA(2)=='\n')) {
+ match('\r');
+ match('\n');
+ newline();
+ }
+ else if ((LA(1)=='\r') && ((LA(2) >= '\u0003' && LA(2)
<= '~'))) {
+ match('\r');
+ newline();
+ }
+ else if ((LA(1)=='\n') && ((LA(2) >= '\u0003' && LA(2)
<= '~'))) {
+ match('\n');
+ newline();
+ }
+ else if (((LA(1) >= '\u0003' && LA(1) <= '~')) &&
((LA(2) >= '\u0003' && LA(2) <= '~'))) {
+ matchNot(EOF_CHAR);
+ }
+ else {
+ break _loop83;
+ }
+
+ } while (true);
+ }
+ match("*/");
+ if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
+ _token = makeToken(_ttype);
+ _token.setText(new String(text.getBuffer(), _begin,
text.length()-_begin));
+ }
+ _returnToken = _token;
+ }
+
+ protected final void mESC(boolean _createToken) throws
RecognitionException, CharStreamException, TokenStreamException {
+ int _ttype; Token _token=null; int _begin=text.length();
+ _ttype = ESC;
+ int _saveIndex;
+
+ match('\\');
+ {
+ switch ( LA(1)) {
+ case 'n':
+ {
+ match('n');
+ break;
+ }
+ case 'r':
+ {
+ match('r');
+ break;
+ }
+ case 't':
+ {
+ match('t');
+ break;
+ }
+ case 'b':
+ {
+ match('b');
+ break;
+ }
+ case 'f':
+ {
+ match('f');
+ break;
+ }
+ case '"':
+ {
+ match('"');
+ break;
+ }
+ case '\'':
+ {
+ match('\'');
+ break;
+ }
+ case '\\':
+ {
+ match('\\');
+ break;
+ }
+ case '0': case '1': case '2': case '3':
+ {
+ {
+ matchRange('0','3');
+ }
+ {
+ if (((LA(1) >= '0' && LA(1) <= '9')) && ((LA(2) >=
'\u0003' && LA(2) <= '~'))) {
+ mDIGIT(false);
+ {
+ if (((LA(1) >= '0' && LA(1) <= '9')) && ((LA(2)
>= '\u0003' && LA(2) <= '~'))) {
+ mDIGIT(false);
+ }
+ else if (((LA(1) >= '\u0003' && LA(1) <= '~'))
&& (true)) {
+ }
+ else {
+ throw new
NoViableAltForCharException((char)LA(1), getFilename(), getLine());
+ }
+
+ }
+ }
+ else if (((LA(1) >= '\u0003' && LA(1) <= '~')) &&
(true)) {
+ }
+ else {
+ throw new
NoViableAltForCharException((char)LA(1), getFilename(), getLine());
+ }
+
+ }
+ break;
+ }
+ case '4': case '5': case '6': case '7':
+ {
+ {
+ matchRange('4','7');
+ }
+ {
+ if (((LA(1) >= '0' && LA(1) <= '9')) && ((LA(2) >=
'\u0003' && LA(2) <= '~'))) {
+ mDIGIT(false);
+ }
+ else if (((LA(1) >= '\u0003' && LA(1) <= '~')) &&
(true)) {
+ }
+ else {
+ throw new
NoViableAltForCharException((char)LA(1), getFilename(), getLine());
+ }
+
+ }
+ break;
+ }
+ default:
+ {
+ throw new NoViableAltForCharException((char)LA(1),
getFilename(), getLine());
+ }
+ }
+ }
+ if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
+ _token = makeToken(_ttype);
+ _token.setText(new String(text.getBuffer(), _begin,
text.length()-_begin));
+ }
+ _returnToken = _token;
+ }
+
+ protected final void mDIGIT(boolean _createToken) throws
RecognitionException, CharStreamException, TokenStreamException {
+ int _ttype; Token _token=null; int _begin=text.length();
+ _ttype = DIGIT;
+ int _saveIndex;
+
+ matchRange('0','9');
+ if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
+ _token = makeToken(_ttype);
+ _token.setText(new String(text.getBuffer(), _begin,
text.length()-_begin));
+ }
+ _returnToken = _token;
+ }
+
+
+ private static final long _tokenSet_0_data_[] = { -141407503262728L,
9223372036854775807L, 0L, 0L };
+ public static final BitSet _tokenSet_0 = new BitSet(_tokenSet_0_data_);
+ private static final long _tokenSet_1_data_[] = { -145135534866440L,
9223372036854775807L, 0L, 0L };
+ public static final BitSet _tokenSet_1 = new BitSet(_tokenSet_1_data_);
+ private static final long _tokenSet_2_data_[] = { 0L,
576460745995190270L, 0L, 0L };
+ public static final BitSet _tokenSet_2 = new BitSet(_tokenSet_2_data_);
+ private static final long _tokenSet_3_data_[] = { 4294977024L, 0L, 0L };
+ public static final BitSet _tokenSet_3 = new BitSet(_tokenSet_3_data_);
+ private static final long _tokenSet_4_data_[] = { 287948901175001088L,
576460745995190270L, 0L, 0L };
+ public static final BitSet _tokenSet_4 = new BitSet(_tokenSet_4_data_);
+ private static final long _tokenSet_5_data_[] = { 287958332923183104L,
576460745995190270L, 0L, 0L };
+ public static final BitSet _tokenSet_5 = new BitSet(_tokenSet_5_data_);
+ private static final long _tokenSet_6_data_[] = { 287978128427460096L,
576460746532061182L, 0L, 0L };
+ public static final BitSet _tokenSet_6 = new BitSet(_tokenSet_6_data_);
+ private static final long _tokenSet_7_data_[] = { 2306123388973753856L,
671088640L, 0L, 0L };
+ public static final BitSet _tokenSet_7 = new BitSet(_tokenSet_7_data_);
+ private static final long _tokenSet_8_data_[] = { 287952805300282880L,
576460746129407998L, 0L, 0L };
+ public static final BitSet _tokenSet_8 = new BitSet(_tokenSet_8_data_);
+ private static final long _tokenSet_9_data_[] = { 2306051920717948416L,
536870912L, 0L, 0L };
+ public static final BitSet _tokenSet_9 = new BitSet(_tokenSet_9_data_);
+ private static final long _tokenSet_10_data_[] = {
2305843013508670976L, 0L, 0L };
+ public static final BitSet _tokenSet_10 = new
BitSet(_tokenSet_10_data_);
+ private static final long _tokenSet_11_data_[] = { 208911504254464L,
536870912L, 0L, 0L };
+ public static final BitSet _tokenSet_11 = new
BitSet(_tokenSet_11_data_);
+ private static final long _tokenSet_12_data_[] = { 1151051235328L,
576460746129407998L, 0L, 0L };
+ public static final BitSet _tokenSet_12 = new
BitSet(_tokenSet_12_data_);
+ private static final long _tokenSet_13_data_[] = { 189120294954496L,
0L, 0L };
+ public static final BitSet _tokenSet_13 = new
BitSet(_tokenSet_13_data_);
+ private static final long _tokenSet_14_data_[] = { 288139722277004800L,
576460746129407998L, 0L, 0L };
+ public static final BitSet _tokenSet_14 = new
BitSet(_tokenSet_14_data_);
+ private static final long _tokenSet_15_data_[] = { 288084781055354368L,
576460746666278910L, 0L, 0L };
+ public static final BitSet _tokenSet_15 = new
BitSet(_tokenSet_15_data_);
+ private static final long _tokenSet_16_data_[] = { 287960536241415680L,
576460745995190270L, 0L, 0L };
+ public static final BitSet _tokenSet_16 = new
BitSet(_tokenSet_16_data_);
+ private static final long _tokenSet_17_data_[] = { 287958337218160128L,
576460745995190270L, 0L, 0L };
+ public static final BitSet _tokenSet_17 = new
BitSet(_tokenSet_17_data_);
+ private static final long _tokenSet_18_data_[] = { 288228817078593024L,
576460746532061182L, 0L, 0L };
+ public static final BitSet _tokenSet_18 = new
BitSet(_tokenSet_18_data_);
+ private static final long _tokenSet_19_data_[] = { 288158448334415360L,
576460746532061182L, 0L, 0L };
+ public static final BitSet _tokenSet_19 = new
BitSet(_tokenSet_19_data_);
+
+ }
--- dev-libs/gsantlr/ObjcCodeGenerator/objc/ActionLexerTokenTypes.java.orig
Wed Dec 31 18:00:00 1969
+++ dev-libs/gsantlr/ObjcCodeGenerator/objc/ActionLexerTokenTypes.java Fri May
11 18:37:30 2001
@@ -0,0 +1,33 @@
+// $ANTLR 2.7.1: "action.g" -> "ActionLexer.java"$
+
+package antlr.actions.objc;
+
+public interface ActionLexerTokenTypes {
+ int EOF = 1;
+ int NULL_TREE_LOOKAHEAD = 3;
+ int ACTION = 4;
+ int STUFF = 5;
+ int AST_ITEM = 6;
+ int TEXT_ITEM = 7;
+ int TREE = 8;
+ int TREE_ELEMENT = 9;
+ int AST_CONSTRUCTOR = 10;
+ int AST_CTOR_ELEMENT = 11;
+ int ID_ELEMENT = 12;
+ int TEXT_ARG = 13;
+ int TEXT_ARG_ELEMENT = 14;
+ int TEXT_ARG_ID_ELEMENT = 15;
+ int ARG = 16;
+ int ID = 17;
+ int VAR_ASSIGN = 18;
+ int COMMENT = 19;
+ int SL_COMMENT = 20;
+ int ML_COMMENT = 21;
+ int CHAR = 22;
+ int STRING = 23;
+ int ESC = 24;
+ int DIGIT = 25;
+ int INT = 26;
+ int INT_OR_FLOAT = 27;
+ int WS = 28;
+}
--- dev-libs/gsantlr/ObjcCodeGenerator/objc/ActionLexerTokenTypes.txt.orig
Wed Dec 31 18:00:00 1969
+++ dev-libs/gsantlr/ObjcCodeGenerator/objc/ActionLexerTokenTypes.txt Fri May
11 18:37:30 2001
@@ -0,0 +1,27 @@
+// $ANTLR 2.7.1: action.g -> ActionLexerTokenTypes.txt$
+ActionLexer // output token vocab name
+ACTION=4
+STUFF=5
+AST_ITEM=6
+TEXT_ITEM=7
+TREE=8
+TREE_ELEMENT=9
+AST_CONSTRUCTOR=10
+AST_CTOR_ELEMENT=11
+ID_ELEMENT=12
+TEXT_ARG=13
+TEXT_ARG_ELEMENT=14
+TEXT_ARG_ID_ELEMENT=15
+ARG=16
+ID=17
+VAR_ASSIGN=18
+COMMENT=19
+SL_COMMENT=20
+ML_COMMENT=21
+CHAR=22
+STRING=23
+ESC=24
+DIGIT=25
+INT=26
+INT_OR_FLOAT=27
+WS=28
--- dev-libs/gsantlr/ObjcCodeGenerator/objc/action.g.orig Wed Dec 31
18:00:00 1969
+++ dev-libs/gsantlr/ObjcCodeGenerator/objc/action.g Fri May 11 18:36:50 2001
@@ -0,0 +1,380 @@
+header {
+package antlr.actions.objc;
+}
+
+{
+import java.io.StringReader;
+import antlr.collections.impl.Vector;
+import antlr.*;
+}
+
+/* ANTLR Translator Generator
+ * Project led by Terence Parr at http://www.jGuru.com
+ * Software rights: http://www.antlr.org/RIGHTS.html
+ *
+ * $Id$
+ */
+
+/** Perform the following translations:
+
+ AST related translations
+
+ ## -> currentRule_AST
+ #(x,y,z) ->
codeGenerator.getASTCreateString(vector-of(x,y,z))
+ #[x] -> codeGenerator.getASTCreateString(x)
+ #x -> codeGenerator.mapTreeId(x)
+
+ Inside context of #(...), you can ref (x,y,z), [x], and x as shortcuts.
+
+ Text related translations
+
+ $append(x) -> [text appendString: x]
+ $setText(x) -> text = [[NSMutableString alloc]
initWithString: [[text substringToIndex: _begin] stringByAppendingString: x]]
+ $getText -> [[NSMutableString alloc] initWithString:
[text substringFromIndex: _begin]]
+ $setToken(x) -> _token = x
+ $setType(x) -> _ttype = x
+ */
+class ActionLexer extends Lexer;
+options {
+ k=2;
+ charVocabulary='\3'..'\176';
+ testLiterals=false;
+ interactive=true;
+}
+
+{
+ protected RuleBlock currentRule;
+ protected CodeGenerator generator;
+ protected int lineOffset = 0;
+ private Tool tool; // The ANTLR tool
+ ActionTransInfo transInfo;
+
+ public ActionLexer( String s,
+ RuleBlock currentRule,
+ CodeGenerator generator,
+ ActionTransInfo transInfo) {
+ this(new StringReader(s));
+ this.currentRule = currentRule;
+ this.generator = generator;
+ this.transInfo = transInfo;
+ }
+
+ public void setLineOffset(int lineOffset) {
+ // this.lineOffset = lineOffset;
+ setLine(lineOffset);
+ }
+
+ public void setTool(Tool tool) {
+ this.tool = tool;
+ }
+
+ // Override of error-reporting for syntax
+ public void reportError(RecognitionException e) {
+ System.err.print("Syntax error in action: ");
+ super.reportError(e);
+ }
+
+}
+
+// rules are protected because we don't care about nextToken().
+
+public
+ACTION
+ : ( STUFF
+ | AST_ITEM
+ | TEXT_ITEM
+ )+
+ ;
+
+// stuff in between #(...) and #id items
+protected
+STUFF
+ : COMMENT
+ | STRING
+ | CHAR
+ | "\r\n" {newline();}
+ | '\r' {newline();}
+ | '\n' {newline();}
+ | '/' ~('/'|'*') // non-comment start '/'
+// | ( ~('/'|'\n'|'\r'|'$'|'#'|'"'|'\'') )+
+ | ~('/'|'\n'|'\r'|'$'|'#'|'"'|'\'')
+ ;
+
+protected
+AST_ITEM
+ : '#'! t:TREE
+ | '#'! id:ID
+ {
+ String idt = id.getText();
+ $setText(generator.mapTreeId(idt,transInfo));
+ }
+ (WS)?
+ ( options {greedy=true;} : VAR_ASSIGN )?
+ | '#'! ctor:AST_CONSTRUCTOR
+ | "##"
+ {
+ String r=currentRule.getRuleName()+"_AST"; $setText(r);
+ if ( transInfo!=null ) {
+ transInfo.refRuleRoot=r; // we ref root of tree
+ }
+ }
+ (WS)?
+ ( options {greedy=true;} : VAR_ASSIGN )?
+ ;
+
+protected
+TEXT_ITEM
+ : "$append(" a1:TEXT_ARG ')'
+ {
+ String t = "[text appendString: "+a1.getText()+"]";
+ $setText(t);
+ }
+ | "$set"
+ ( "Text(" a2:TEXT_ARG ')'
+ {
+ String t;
+ t = "text = [[NSMutableString alloc] initWithString:
[[text substringToIndex: _begin] stringByAppendingString:"+a2.getText()+"]]";
+ $setText(t);
+ }
+ | "Token(" a3:TEXT_ARG ')'
+ {
+ String t="_token = "+a3.getText();
+ $setText(t);
+ }
+ | "Type(" a4:TEXT_ARG ')'
+ {
+ String t="_ttype = "+a4.getText();
+ $setText(t);
+ }
+ )
+ | "$getText"
+ {
+ $setText("[[NSMutableString alloc] initWithString:
[text substringFromIndex: _begin]]");
+ }
+ ;
+
+protected
+TREE!
+{
+ StringBuffer buf = new StringBuffer();
+ int n=0;
+ Vector terms = new Vector(10);
+}
+ : '('
+ (WS)?
+ t:TREE_ELEMENT {terms.appendElement(t.getText());}
+ (WS)?
+ ( ',' (WS)?
+ t2:TREE_ELEMENT {terms.appendElement(t2.getText());}
+ (WS)?
+ )*
+ {$setText(generator.getASTCreateString(terms));}
+ ')'
+ ;
+
+protected
+TREE_ELEMENT { boolean was_mapped; }
+ : '#'! TREE
+ | '#'! AST_CONSTRUCTOR
+ | '#'! was_mapped=id:ID_ELEMENT
+ { // RK: I have a queer feeling that this maptreeid is
redundant
+ if( ! was_mapped )
+ {
+ String t = generator.mapTreeId(id.getText(),
null);
+ $setText(t);
+ }
+ }
+ | "##"
+ {String t = currentRule.getRuleName()+"_AST"; $setText(t);}
+ | TREE
+ | AST_CONSTRUCTOR
+ | ID_ELEMENT
+ | STRING
+ ;
+
+protected
+AST_CONSTRUCTOR!
+ : '[' (WS)? x:AST_CTOR_ELEMENT (WS)?
+ (',' (WS)? y:AST_CTOR_ELEMENT (WS)? )? ']'
+ {
+ String ys = "";
+ if ( y!=null ) {
+ ys = ","+y.getText();
+ }
+ $setText(generator.getASTCreateString(null,x.getText()+ys));
+ }
+ ;
+
+/** The arguments of a #[...] constructor are text, token type,
+ * or a tree.
+ */
+protected
+AST_CTOR_ELEMENT
+ : STRING
+ | INT
+ | TREE_ELEMENT
+ ;
+
+/** An ID_ELEMENT can be a func call, array ref, simple var,
+ * or AST label ref.
+ */
+protected
+ID_ELEMENT returns [boolean mapped=false]
+ : id:ID (options {greedy=true;}:WS!)?
+ ( '(' (options {greedy=true;}:WS!)? ( ARG (',' (WS!)?
ARG)* )? (WS!)? ')' // method call
+ | ( '[' (WS!)? ARG (WS!)? ']' )+
// array reference
+ | '.' ID_ELEMENT
+ | "->" ID_ELEMENT
+ | /* could be a token reference or just a user var */
+ {
+ mapped = true;
+ String t = generator.mapTreeId(id.getText(),
transInfo);
+ $setText(t);
+ }
+ // if #rule referenced, check for assignment
+ ( options {greedy=true;}
+ : {transInfo!=null &&
transInfo.refRuleRoot!=null}?
+ (WS)? VAR_ASSIGN
+ )?
+ )
+ ;
+
+protected
+TEXT_ARG
+ : (WS)? ( TEXT_ARG_ELEMENT (options {greedy=true;}:WS)? )+
+ ;
+
+protected
+TEXT_ARG_ELEMENT
+ : TEXT_ARG_ID_ELEMENT
+ | STRING
+ | CHAR
+ | INT_OR_FLOAT
+ | TEXT_ITEM
+ | '+'
+ ;
+
+protected
+TEXT_ARG_ID_ELEMENT
+ : id:ID (options {greedy=true;}:WS!)?
+ ( '(' (options {greedy=true;}:WS!)? ( TEXT_ARG (','
TEXT_ARG)* )* (WS!)? ')' // method call
+ | ( '[' (WS!)? TEXT_ARG (WS!)? ']' )+
// array reference
+ | '.' TEXT_ARG_ID_ELEMENT
+ | "->" TEXT_ARG_ID_ELEMENT
+ |
+ )
+ ;
+
+protected
+ARG : ( TREE_ELEMENT
+ | STRING
+ | CHAR
+ | INT_OR_FLOAT
+ )
+ (options {greedy=true;} : (WS)? ( '+'| '-' | '*' | '/' ) (WS)?
ARG )*
+ ;
+
+protected
+ID : ('a'..'z'|'A'..'Z'|'_')
+ (options {greedy=true;} : ('a'..'z'|'A'..'Z'|'0'..'9'|'_'))*
+ ;
+
+protected
+VAR_ASSIGN
+ : '='
+ {
+ // inform the code generator that an assignment was done to
+ // AST root for the rule if invoker set refRuleRoot.
+ if ( LA(1)!='=' && transInfo!=null &&
transInfo.refRuleRoot!=null ) {
+ transInfo.assignToRoot=true;
+ }
+ }
+ ;
+
+protected
+COMMENT
+ : SL_COMMENT
+ | ML_COMMENT
+ ;
+
+protected
+SL_COMMENT
+ : "//" (options {greedy=false;}:.)* ('\n'|"\r\n"|'\r')
+ {newline();}
+ ;
+
+protected
+ML_COMMENT :
+ "/*"
+ ( options {greedy=false;}
+ : '\r' '\n' {newline();}
+ | '\r' {newline();}
+ | '\n' {newline();}
+ | .
+ )*
+ "*/"
+ ;
+
+protected
+CHAR :
+ '\''
+ ( ESC | ~'\'' )
+ '\''
+ ;
+
+protected
+STRING :
+ '"'
+ (ESC|~'"')*
+ '"'
+ ;
+
+protected
+ESC : '\\'
+ ( 'n'
+ | 'r'
+ | 't'
+ | 'b'
+ | 'f'
+ | '"'
+ | '\''
+ | '\\'
+ | ('0'..'3')
+ ( options {greedy=true;}
+ : DIGIT
+ ( options {greedy=true;}
+ : DIGIT
+ )?
+ )?
+ | ('4'..'7') (options {greedy=true;}:DIGIT)?
+ )
+ ;
+
+protected
+DIGIT
+ : '0'..'9'
+ ;
+
+protected
+INT : (DIGIT)+
+ ;
+
+protected
+INT_OR_FLOAT
+ : (options {greedy=true;}:DIGIT)+
+ ( options {greedy=true;}
+ : '.' (options {greedy=true;}:DIGIT)*
+ | 'L'
+ | 'l'
+ )?
+ ;
+
+protected
+WS : ( options {greedy=true;}
+ : ' '
+ | '\t'
+ | '\r' '\n' {newline();}
+ | '\r' {newline();}
+ | '\n' {newline();}
+ )+
+ ;
--- dev-libs/gsweb/GSWeb.framework/GSWHTMLAttrLexer.h.orig Mon Oct 30
09:36:47 2000
+++ dev-libs/gsweb/GSWeb.framework/GSWHTMLAttrLexer.h Sat May 12 12:45:20 2001
@@ -7,7 +7,7 @@
* Terence Parr, MageLang Institute
* with John Lilley, Empathy Software
* and Manuel Guesdon, Software Builders
- * ANTLR Version 2.5.0; 1996,1997,1998,1999
+ * ANTLR Version 2.7.1; 1996,1997,1998,1999,2000
*/
@@ -19,6 +19,7 @@
#include "gsantlr/ANTLRCharBuffer.h"
#include "gsantlr/ANTLRBitSet.h"
#include "gsantlr/ANTLRCharScanner.h"
+
@interface GSWHTMLAttrLexer : ANTLRCharScanner
{
};
--- dev-libs/gsweb/GSWeb.framework/GSWHTMLAttrLexer.m.orig Mon Oct 30
09:36:47 2000
+++ dev-libs/gsweb/GSWeb.framework/GSWHTMLAttrLexer.m Sat May 12 12:45:20 2001
@@ -4,12 +4,13 @@
* Terence Parr, MageLang Institute
* with John Lilley, Empathy Software
* and Manuel Guesdon, Software Builders
- * ANTLR Version 2.5.0; 1996,1997,1998,1999
+ * ANTLR Version 2.7.1; 1996,1997,1998,1999,2000
*/
#include <GSWeb/GSWeb.h>
+
#include "gsantlr/ANTLRCommon.h"
#include "gsantlr/ANTLRException.h"
#include "GSWHTMLAttrLexer.h"
@@ -49,12 +50,12 @@
-(ANTLRDefToken) nextToken
{
- ANTLRDefToken _rettoken=nil;
+ ANTLRDefToken theRetToken=nil;
BOOL end=NO;
//LOGObjectFnStart();
for (;!end;)
{
- ANTLRDefToken _rettoken;
+ ANTLRDefToken theRetToken;
ANTLRTokenType _ttype = ANTLRToken_INVALID_TYPE;
[self resetText];
NS_DURING // for error handling
@@ -77,49 +78,49 @@
case ((unichar)('z')):
{
[self mIDENTWithCreateToken:YES];
- _rettoken=_returnToken;
+ theRetToken=_returnToken;
break;
}
case ((unichar)('=')):
{
[self mASSIGNWithCreateToken:YES];
- _rettoken=_returnToken;
+ theRetToken=_returnToken;
break;
}
case ((unichar)('\t')): case ((unichar)('\n')): case
((unichar)('\r')): case ((unichar)(' ')):
{
[self mWSWithCreateToken:YES];
- _rettoken=_returnToken;
+ theRetToken=_returnToken;
break;
}
case ((unichar)('"')): case ((unichar)('\'')):
{
[self mSTRINGWithCreateToken:YES];
- _rettoken=_returnToken;
+ theRetToken=_returnToken;
break;
}
case ((unichar)('.')):
{
[self mPOINTWithCreateToken:YES];
- _rettoken=_returnToken;
+ theRetToken=_returnToken;
break;
}
case ((unichar)('#')):
{
[self mHEXNUMWithCreateToken:YES];
- _rettoken=_returnToken;
+ theRetToken=_returnToken;
break;
}
default:
if ((([self LA:1] >= ((unichar)('0')) && [self
LA:1] <= ((unichar)('9')))) && ([GSWHTMLAttrLexer___tokenSet_0 isMember:[self
LA:2]]))
{
[self mPCINTWithCreateToken:YES];
- _rettoken=_returnToken;
+ theRetToken=_returnToken;
}
else if ((([self LA:1] >= ((unichar)('0')) &&
[self LA:1] <= ((unichar)('9')))))
{
[self mINTWithCreateToken:YES];
- _rettoken=_returnToken;
+ theRetToken=_returnToken;
}
else
{
--- dev-libs/gsweb/GSWeb.framework/GSWHTMLAttrParser.h.orig Mon Oct 30
09:36:47 2000
+++ dev-libs/gsweb/GSWeb.framework/GSWHTMLAttrParser.h Sat May 12 12:45:20 2001
@@ -7,7 +7,7 @@
* Terence Parr, MageLang Institute
* with John Lilley, Empathy Software
* and Manuel Guesdon, Software Builders
- * ANTLR Version 2.5.0; 1996,1997,1998,1999
+ * ANTLR Version 2.7.1; 1996,1997,1998,1999,2000
*/
--- dev-libs/gsweb/GSWeb.framework/GSWHTMLAttrParser.m.orig Mon Oct 30
09:36:47 2000
+++ dev-libs/gsweb/GSWeb.framework/GSWHTMLAttrParser.m Sat May 12 12:45:20 2001
@@ -4,11 +4,12 @@
* Terence Parr, MageLang Institute
* with John Lilley, Empathy Software
* and Manuel Guesdon, Software Builders
- * ANTLR Version 2.5.0; 1996,1997,1998,1999
+ * ANTLR Version 2.7.1; 1996,1997,1998,1999,2000
*/
#include <GSWeb/GSWeb.h>
+
#include "gsantlr/ANTLRCommon.h"
#include "GSWHTMLAttrParser.h"
--- dev-libs/gsweb/GSWeb.framework/GSWHTMLAttrTokenTypes.h.orig Mon Oct 30
09:36:47 2000
+++ dev-libs/gsweb/GSWeb.framework/GSWHTMLAttrTokenTypes.h Sat May 12
12:45:20 2001
@@ -7,7 +7,7 @@
* Terence Parr, MageLang Institute
* with John Lilley, Empathy Software
* and Manuel Guesdon, Software Builders
- * ANTLR Version 2.5.0; 1996,1997,1998,1999
+ * ANTLR Version 2.7.1; 1996,1997,1998,1999,2000
*/
--- dev-libs/gsweb/GSWeb.framework/GSWHTMLAttrTokenTypes.txt.orig Sat Jan
22 06:51:23 2000
+++ dev-libs/gsweb/GSWeb.framework/GSWHTMLAttrTokenTypes.txt Sat May 12
12:45:20 2001
@@ -1,4 +1,5 @@
-GSWHTMLAttr // tokenVocabulary name
+// $ANTLR 2.7.1: htmltag.g -> GSWHTMLAttrTokenTypes.txt$
+GSWHTMLAttr // output token vocab name
IDENT=4
WS=5
ASSIGN=6
--- dev-libs/gsweb/GSWeb.framework/GSWHTMLLexer.h.orig Mon Oct 30 09:36:47 2000
+++ dev-libs/gsweb/GSWeb.framework/GSWHTMLLexer.h Sat May 12 12:45:09 2001
@@ -7,7 +7,7 @@
* Terence Parr, MageLang Institute
* with John Lilley, Empathy Software
* and Manuel Guesdon, Software Builders
- * ANTLR Version 2.5.0; 1996,1997,1998,1999
+ * ANTLR Version 2.7.1; 1996,1997,1998,1999,2000
*/
@@ -19,6 +19,7 @@
#include "gsantlr/ANTLRCharBuffer.h"
#include "gsantlr/ANTLRBitSet.h"
#include "gsantlr/ANTLRCharScanner.h"
+
@interface GSWHTMLLexer : ANTLRCharScanner
{
};
--- dev-libs/gsweb/GSWeb.framework/GSWHTMLLexer.m.orig Mon Oct 30 09:36:47 2000
+++ dev-libs/gsweb/GSWeb.framework/GSWHTMLLexer.m Sat May 12 12:45:09 2001
@@ -4,12 +4,13 @@
* Terence Parr, MageLang Institute
* with John Lilley, Empathy Software
* and Manuel Guesdon, Software Builders
- * ANTLR Version 2.5.0; 1996,1997,1998,1999
+ * ANTLR Version 2.7.1; 1996,1997,1998,1999,2000
*/
#include <GSWeb/GSWeb.h>
+
#include "gsantlr/ANTLRCommon.h"
#include "gsantlr/ANTLRException.h"
#include "GSWHTMLLexer.h"
@@ -49,12 +50,12 @@
-(ANTLRDefToken) nextToken
{
- ANTLRDefToken _rettoken=nil;
+ ANTLRDefToken theRetToken=nil;
BOOL end=NO;
//LOGObjectFnStart();
for (;!end;)
{
- ANTLRDefToken _rettoken;
+ ANTLRDefToken theRetToken;
ANTLRTokenType _ttype = ANTLRToken_INVALID_TYPE;
[self resetText];
NS_DURING // for error handling
@@ -62,22 +63,22 @@
if (([self LA:1]==((unichar)('<'))) &&
([GSWHTMLLexer___tokenSet_0 isMember:[self LA:2]]))
{
[self mOPENTAGWithCreateToken:YES];
- _rettoken=_returnToken;
+ theRetToken=_returnToken;
}
else if (([self LA:1]==((unichar)('<'))) && ([self
LA:2]==((unichar)('/'))))
{
[self mCLOSETAGWithCreateToken:YES];
- _rettoken=_returnToken;
+ theRetToken=_returnToken;
}
else if (([self LA:1]==((unichar)('<'))) && ([self
LA:2]==((unichar)('!'))))
{
[self mCOMMENTWithCreateToken:YES];
- _rettoken=_returnToken;
+ theRetToken=_returnToken;
}
else if (([GSWHTMLLexer___tokenSet_1 isMember:[self
LA:1]]))
{
[self mTEXTWithCreateToken:YES];
- _rettoken=_returnToken;
+ theRetToken=_returnToken;
}
else
{
@@ -1116,9 +1117,7 @@
int _saveIndex;
//LOGObjectFnStart();
- switch ( [self LA:1])
- {
- case ((unichar)('<')):
+ if (([self LA:1]==((unichar)('<'))) && (([self LA:2] >=
((unichar)(0x3)) && [self LA:2] <= ((unichar)(0xff)))))
{
[self matchCharacter:'<'];
{
@@ -1172,9 +1171,8 @@
_loop67:;
}
NSLog(@"invalid tag: %@",[self text]);
- break;
}
- case ((unichar)('\n')): case ((unichar)('\r')):
+ else if (([self LA:1]==((unichar)('\n'))||[self
LA:1]==((unichar)('\r'))))
{
{
if (([self LA:1]==((unichar)('\r'))) && ([self
LA:2]==((unichar)('\n'))))
@@ -1196,80 +1194,16 @@
}
[self newline];
- break;
}
- case ((unichar)(0x3)): case ((unichar)(0x4)): case ((unichar)(0x5)):
case ((unichar)(0x6)):
- case ((unichar)(0x7)): case ((unichar)(0x8)): case ((unichar)('\t')):
case ((unichar)(0xb)):
- case ((unichar)(0xc)): case ((unichar)(0xe)): case ((unichar)(0xf)):
case ((unichar)(0x10)):
- case ((unichar)(0x11)): case ((unichar)(0x12)): case
((unichar)(0x13)): case ((unichar)(0x14)):
- case ((unichar)(0x15)): case ((unichar)(0x16)): case
((unichar)(0x17)): case ((unichar)(0x18)):
- case ((unichar)(0x19)): case ((unichar)(0x1a)): case
((unichar)(0x1b)): case ((unichar)(0x1c)):
- case ((unichar)(0x1d)): case ((unichar)(0x1e)): case
((unichar)(0x1f)): case ((unichar)(' ')):
- case ((unichar)('!')): case ((unichar)('"')): case ((unichar)('#')):
case ((unichar)('$')):
- case ((unichar)('%')): case ((unichar)('&')): case ((unichar)('\'')):
case ((unichar)('(')):
- case ((unichar)(')')): case ((unichar)('*')): case ((unichar)('+')):
case ((unichar)(',')):
- case ((unichar)('-')): case ((unichar)('.')): case ((unichar)('/')):
case ((unichar)('0')):
- case ((unichar)('1')): case ((unichar)('2')): case ((unichar)('3')):
case ((unichar)('4')):
- case ((unichar)('5')): case ((unichar)('6')): case ((unichar)('7')):
case ((unichar)('8')):
- case ((unichar)('9')): case ((unichar)(':')): case ((unichar)(';')):
case ((unichar)('=')):
- case ((unichar)('>')): case ((unichar)('?')): case ((unichar)('@')):
case ((unichar)('A')):
- case ((unichar)('B')): case ((unichar)('C')): case ((unichar)('D')):
case ((unichar)('E')):
- case ((unichar)('F')): case ((unichar)('G')): case ((unichar)('H')):
case ((unichar)('I')):
- case ((unichar)('J')): case ((unichar)('K')): case ((unichar)('L')):
case ((unichar)('M')):
- case ((unichar)('N')): case ((unichar)('O')): case ((unichar)('P')):
case ((unichar)('Q')):
- case ((unichar)('R')): case ((unichar)('S')): case ((unichar)('T')):
case ((unichar)('U')):
- case ((unichar)('V')): case ((unichar)('W')): case ((unichar)('X')):
case ((unichar)('Y')):
- case ((unichar)('Z')): case ((unichar)('[')): case ((unichar)('\\')):
case ((unichar)(']')):
- case ((unichar)('^')): case ((unichar)('_')): case ((unichar)('`')):
case ((unichar)('a')):
- case ((unichar)('b')): case ((unichar)('c')): case ((unichar)('d')):
case ((unichar)('e')):
- case ((unichar)('f')): case ((unichar)('g')): case ((unichar)('h')):
case ((unichar)('i')):
- case ((unichar)('j')): case ((unichar)('k')): case ((unichar)('l')):
case ((unichar)('m')):
- case ((unichar)('n')): case ((unichar)('o')): case ((unichar)('p')):
case ((unichar)('q')):
- case ((unichar)('r')): case ((unichar)('s')): case ((unichar)('t')):
case ((unichar)('u')):
- case ((unichar)('v')): case ((unichar)('w')): case ((unichar)('x')):
case ((unichar)('y')):
- case ((unichar)('z')): case ((unichar)('{')): case ((unichar)('|')):
case ((unichar)('}')):
- case ((unichar)('~')): case ((unichar)(0x7f)): case
((unichar)(0x80)): case ((unichar)(0x81)):
- case ((unichar)(0x82)): case ((unichar)(0x83)): case
((unichar)(0x84)): case ((unichar)(0x85)):
- case ((unichar)(0x86)): case ((unichar)(0x87)): case
((unichar)(0x88)): case ((unichar)(0x89)):
- case ((unichar)(0x8a)): case ((unichar)(0x8b)): case
((unichar)(0x8c)): case ((unichar)(0x8d)):
- case ((unichar)(0x8e)): case ((unichar)(0x8f)): case
((unichar)(0x90)): case ((unichar)(0x91)):
- case ((unichar)(0x92)): case ((unichar)(0x93)): case
((unichar)(0x94)): case ((unichar)(0x95)):
- case ((unichar)(0x96)): case ((unichar)(0x97)): case
((unichar)(0x98)): case ((unichar)(0x99)):
- case ((unichar)(0x9a)): case ((unichar)(0x9b)): case
((unichar)(0x9c)): case ((unichar)(0x9d)):
- case ((unichar)(0x9e)): case ((unichar)(0x9f)): case
((unichar)(0xa0)): case ((unichar)(0xa1)):
- case ((unichar)(0xa2)): case ((unichar)(0xa3)): case
((unichar)(0xa4)): case ((unichar)(0xa5)):
- case ((unichar)(0xa6)): case ((unichar)(0xa7)): case
((unichar)(0xa8)): case ((unichar)(0xa9)):
- case ((unichar)(0xaa)): case ((unichar)(0xab)): case
((unichar)(0xac)): case ((unichar)(0xad)):
- case ((unichar)(0xae)): case ((unichar)(0xaf)): case
((unichar)(0xb0)): case ((unichar)(0xb1)):
- case ((unichar)(0xb2)): case ((unichar)(0xb3)): case
((unichar)(0xb4)): case ((unichar)(0xb5)):
- case ((unichar)(0xb6)): case ((unichar)(0xb7)): case
((unichar)(0xb8)): case ((unichar)(0xb9)):
- case ((unichar)(0xba)): case ((unichar)(0xbb)): case
((unichar)(0xbc)): case ((unichar)(0xbd)):
- case ((unichar)(0xbe)): case ((unichar)(0xbf)): case
((unichar)(0xc0)): case ((unichar)(0xc1)):
- case ((unichar)(0xc2)): case ((unichar)(0xc3)): case
((unichar)(0xc4)): case ((unichar)(0xc5)):
- case ((unichar)(0xc6)): case ((unichar)(0xc7)): case
((unichar)(0xc8)): case ((unichar)(0xc9)):
- case ((unichar)(0xca)): case ((unichar)(0xcb)): case
((unichar)(0xcc)): case ((unichar)(0xcd)):
- case ((unichar)(0xce)): case ((unichar)(0xcf)): case
((unichar)(0xd0)): case ((unichar)(0xd1)):
- case ((unichar)(0xd2)): case ((unichar)(0xd3)): case
((unichar)(0xd4)): case ((unichar)(0xd5)):
- case ((unichar)(0xd6)): case ((unichar)(0xd7)): case
((unichar)(0xd8)): case ((unichar)(0xd9)):
- case ((unichar)(0xda)): case ((unichar)(0xdb)): case
((unichar)(0xdc)): case ((unichar)(0xdd)):
- case ((unichar)(0xde)): case ((unichar)(0xdf)): case
((unichar)(0xe0)): case ((unichar)(0xe1)):
- case ((unichar)(0xe2)): case ((unichar)(0xe3)): case
((unichar)(0xe4)): case ((unichar)(0xe5)):
- case ((unichar)(0xe6)): case ((unichar)(0xe7)): case
((unichar)(0xe8)): case ((unichar)(0xe9)):
- case ((unichar)(0xea)): case ((unichar)(0xeb)): case
((unichar)(0xec)): case ((unichar)(0xed)):
- case ((unichar)(0xee)): case ((unichar)(0xef)): case
((unichar)(0xf0)): case ((unichar)(0xf1)):
- case ((unichar)(0xf2)): case ((unichar)(0xf3)): case
((unichar)(0xf4)): case ((unichar)(0xf5)):
- case ((unichar)(0xf6)): case ((unichar)(0xf7)): case
((unichar)(0xf8)): case ((unichar)(0xf9)):
- case ((unichar)(0xfa)): case ((unichar)(0xfb)): case
((unichar)(0xfc)): case ((unichar)(0xfd)):
- case ((unichar)(0xfe)): case ((unichar)(0xff)):
+ else if ((([self LA:1] >= ((unichar)(0x3)) && [self LA:1] <=
((unichar)(0xff)))))
{
[self matchNotCharacter:ANTLR_EOF_CHAR];
- break;
}
- default:
+ else
{
[ANTLRScannerException raiseWithReason:[NSString
stringWithFormat:@"no viable alt for char: %@",[ANTLRCharScanner charName:[self
LA:1]]] line:[self line]];
}
- }
+
if ( _createToken && _token==0 )
{
_token = [self makeToken:_ttype];
--- dev-libs/gsweb/GSWeb.framework/GSWHTMLParser.h.orig Mon Oct 30 09:36:47 2000
+++ dev-libs/gsweb/GSWeb.framework/GSWHTMLParser.h Sat May 12 12:45:08 2001
@@ -7,7 +7,7 @@
* Terence Parr, MageLang Institute
* with John Lilley, Empathy Software
* and Manuel Guesdon, Software Builders
- * ANTLR Version 2.5.0; 1996,1997,1998,1999
+ * ANTLR Version 2.7.1; 1996,1997,1998,1999,2000
*/
--- dev-libs/gsweb/GSWeb.framework/GSWHTMLParser.m.orig Mon Oct 30 09:36:47 2000
+++ dev-libs/gsweb/GSWeb.framework/GSWHTMLParser.m Sat May 12 12:45:08 2001
@@ -4,11 +4,12 @@
* Terence Parr, MageLang Institute
* with John Lilley, Empathy Software
* and Manuel Guesdon, Software Builders
- * ANTLR Version 2.5.0; 1996,1997,1998,1999
+ * ANTLR Version 2.7.1; 1996,1997,1998,1999,2000
*/
#include <GSWeb/GSWeb.h>
+
#include "gsantlr/ANTLRCommon.h"
#include "GSWHTMLParser.h"
--- dev-libs/gsweb/GSWeb.framework/GSWHTMLTokenTypes.h.orig Mon Oct 30
09:36:48 2000
+++ dev-libs/gsweb/GSWeb.framework/GSWHTMLTokenTypes.h Sat May 12 12:45:09 2001
@@ -7,7 +7,7 @@
* Terence Parr, MageLang Institute
* with John Lilley, Empathy Software
* and Manuel Guesdon, Software Builders
- * ANTLR Version 2.5.0; 1996,1997,1998,1999
+ * ANTLR Version 2.7.1; 1996,1997,1998,1999,2000
*/
--- dev-libs/gsweb/GSWeb.framework/GSWHTMLTokenTypes.txt.orig Sat Jan 22
06:51:23 2000
+++ dev-libs/gsweb/GSWeb.framework/GSWHTMLTokenTypes.txt Sat May 12
12:45:09 2001
@@ -1,4 +1,5 @@
-GSWHTML // tokenVocabulary name
+// $ANTLR 2.7.1: html.g -> GSWHTMLTokenTypes.txt$
+GSWHTML // output token vocab name
WS=4
TEXT=5
OPENTAG=6
--- dev-libs/gsweb/GSWeb.framework/GSWPageDefLexer.h.orig Mon Oct 30
09:36:48 2000
+++ dev-libs/gsweb/GSWeb.framework/GSWPageDefLexer.h Sat May 12 12:44:55 2001
@@ -7,7 +7,7 @@
* Terence Parr, MageLang Institute
* with John Lilley, Empathy Software
* and Manuel Guesdon, Software Builders
- * ANTLR Version 2.5.0; 1996,1997,1998,1999
+ * ANTLR Version 2.7.1; 1996,1997,1998,1999,2000
*/
@@ -19,6 +19,7 @@
#include "gsantlr/ANTLRCharBuffer.h"
#include "gsantlr/ANTLRBitSet.h"
#include "gsantlr/ANTLRCharScanner.h"
+
@interface GSWPageDefLexer : ANTLRCharScanner
{
};
--- dev-libs/gsweb/GSWeb.framework/GSWPageDefLexer.m.orig Mon Oct 30
09:36:48 2000
+++ dev-libs/gsweb/GSWeb.framework/GSWPageDefLexer.m Sat May 12 12:44:55 2001
@@ -4,12 +4,13 @@
* Terence Parr, MageLang Institute
* with John Lilley, Empathy Software
* and Manuel Guesdon, Software Builders
- * ANTLR Version 2.5.0; 1996,1997,1998,1999
+ * ANTLR Version 2.7.1; 1996,1997,1998,1999,2000
*/
#include <GSWeb/GSWeb.h>
+
#include "gsantlr/ANTLRCommon.h"
#include "gsantlr/ANTLRException.h"
#include "GSWPageDefLexer.h"
@@ -49,12 +50,12 @@
-(ANTLRDefToken) nextToken
{
- ANTLRDefToken _rettoken=nil;
+ ANTLRDefToken theRetToken=nil;
BOOL end=NO;
//LOGObjectFnStart();
for (;!end;)
{
- ANTLRDefToken _rettoken;
+ ANTLRDefToken theRetToken;
ANTLRTokenType _ttype = ANTLRToken_INVALID_TYPE;
[self resetText];
NS_DURING // for error handling
@@ -64,55 +65,55 @@
case ((unichar)('"')): case ((unichar)('\'')):
{
[self mSTRINGWithCreateToken:YES];
- _rettoken=_returnToken;
+ theRetToken=_returnToken;
break;
}
case ((unichar)('{')):
{
[self mLCURLYWithCreateToken:YES];
- _rettoken=_returnToken;
+ theRetToken=_returnToken;
break;
}
case ((unichar)('}')):
{
[self mRCURLYWithCreateToken:YES];
- _rettoken=_returnToken;
+ theRetToken=_returnToken;
break;
}
case ((unichar)(';')):
{
[self mSEMIWithCreateToken:YES];
- _rettoken=_returnToken;
+ theRetToken=_returnToken;
break;
}
case ((unichar)('^')):
{
[self mCIRCWithCreateToken:YES];
- _rettoken=_returnToken;
+ theRetToken=_returnToken;
break;
}
case ((unichar)('~')):
{
[self mTILDEWithCreateToken:YES];
- _rettoken=_returnToken;
+ theRetToken=_returnToken;
break;
}
case ((unichar)(':')):
{
[self mCOLUMNWithCreateToken:YES];
- _rettoken=_returnToken;
+ theRetToken=_returnToken;
break;
}
case ((unichar)('=')):
{
[self mASSIGNWithCreateToken:YES];
- _rettoken=_returnToken;
+ theRetToken=_returnToken;
break;
}
case ((unichar)('\t')): case ((unichar)('\n')): case
((unichar)('\r')): case ((unichar)(' ')):
{
[self mWSWithCreateToken:YES];
- _rettoken=_returnToken;
+ theRetToken=_returnToken;
break;
}
case ((unichar)('0')): case ((unichar)('1')): case
((unichar)('2')): case ((unichar)('3')):
@@ -120,54 +121,54 @@
case ((unichar)('8')): case ((unichar)('9')):
{
[self mINTWithCreateToken:YES];
- _rettoken=_returnToken;
+ theRetToken=_returnToken;
break;
}
default:
if (([self LA:1]==((unichar)('Y'))) && ([self
LA:2]==((unichar)('E'))) && ([self LA:3]==((unichar)('S'))))
{
[self mYESWithCreateToken:YES];
- _rettoken=_returnToken;
+ theRetToken=_returnToken;
}
else if (([self LA:1]==((unichar)('/'))) &&
([self LA:2]==((unichar)('/'))))
{
[self mSL_COMMENTWithCreateToken:YES];
- _rettoken=_returnToken;
+ theRetToken=_returnToken;
}
else if (([self LA:1]==((unichar)('/'))) &&
([self LA:2]==((unichar)('*'))))
{
[self mML_COMMENTWithCreateToken:YES];
- _rettoken=_returnToken;
+ theRetToken=_returnToken;
}
else if (([self LA:1]==((unichar)('#'))) &&
([self LA:2]==((unichar)('i'))))
{
[self mINCLUDEWithCreateToken:YES];
- _rettoken=_returnToken;
+ theRetToken=_returnToken;
}
else if (([self LA:1]==((unichar)('.'))) &&
([GSWPageDefLexer___tokenSet_0 isMember:[self LA:2]]))
{
[self mPIDENTWithCreateToken:YES];
- _rettoken=_returnToken;
+ theRetToken=_returnToken;
}
else if (([self LA:1]==((unichar)('N'))) &&
([self LA:2]==((unichar)('O'))))
{
[self mNOWithCreateToken:YES];
- _rettoken=_returnToken;
+ theRetToken=_returnToken;
}
else if (([self LA:1]==((unichar)('#'))) &&
([GSWPageDefLexer___tokenSet_1 isMember:[self LA:2]]))
{
[self mHEXNUMWithCreateToken:YES];
- _rettoken=_returnToken;
+ theRetToken=_returnToken;
}
else if (([GSWPageDefLexer___tokenSet_2
isMember:[self LA:1]]))
{
[self mIDENTWithCreateToken:YES];
- _rettoken=_returnToken;
+ theRetToken=_returnToken;
}
else if (([self LA:1]==((unichar)('.'))))
{
[self mPOINTWithCreateToken:YES];
- _rettoken=_returnToken;
+ theRetToken=_returnToken;
}
else
{
--- dev-libs/gsweb/GSWeb.framework/GSWPageDefParser.h.orig Mon Oct 30
09:36:48 2000
+++ dev-libs/gsweb/GSWeb.framework/GSWPageDefParser.h Sat May 12 12:44:55 2001
@@ -7,7 +7,7 @@
* Terence Parr, MageLang Institute
* with John Lilley, Empathy Software
* and Manuel Guesdon, Software Builders
- * ANTLR Version 2.5.0; 1996,1997,1998,1999
+ * ANTLR Version 2.7.1; 1996,1997,1998,1999,2000
*/
--- dev-libs/gsweb/GSWeb.framework/GSWPageDefParser.m.orig Mon Oct 30
09:36:48 2000
+++ dev-libs/gsweb/GSWeb.framework/GSWPageDefParser.m Sat May 12 12:44:55 2001
@@ -4,11 +4,12 @@
* Terence Parr, MageLang Institute
* with John Lilley, Empathy Software
* and Manuel Guesdon, Software Builders
- * ANTLR Version 2.5.0; 1996,1997,1998,1999
+ * ANTLR Version 2.7.1; 1996,1997,1998,1999,2000
*/
#include <GSWeb/GSWeb.h>
+
#include "gsantlr/ANTLRCommon.h"
#include "GSWPageDefParser.h"
--- dev-libs/gsweb/GSWeb.framework/GSWPageDefTokenTypes.h.orig Mon Oct 30
09:36:48 2000
+++ dev-libs/gsweb/GSWeb.framework/GSWPageDefTokenTypes.h Sat May 12
12:44:55 2001
@@ -7,7 +7,7 @@
* Terence Parr, MageLang Institute
* with John Lilley, Empathy Software
* and Manuel Guesdon, Software Builders
- * ANTLR Version 2.5.0; 1996,1997,1998,1999
+ * ANTLR Version 2.7.1; 1996,1997,1998,1999,2000
*/
--- dev-libs/gsweb/GSWeb.framework/GSWPageDefTokenTypes.txt.orig Thu Mar
16 10:16:49 2000
+++ dev-libs/gsweb/GSWeb.framework/GSWPageDefTokenTypes.txt Sat May 12
12:44:55 2001
@@ -1,4 +1,5 @@
-GSWPageDef // tokenVocabulary name
+// $ANTLR 2.7.1: PageDef.g -> GSWPageDefTokenTypes.txt$
+GSWPageDef // output token vocab name
INCLUDE=4
WS=5
STRING=6
--- dev-libs/gsweb/GSWeb.framework/PageDef.g.orig Mon Oct 30 16:56:08 2000
+++ dev-libs/gsweb/GSWeb.framework/PageDef.g Fri May 11 19:26:09 2001
@@ -10,7 +10,7 @@
class GSWPageDefParser extends Parser;
options {
- tokenVocabulary=GSWPageDef;
+ exportVocab=GSWPageDef;
buildAST=true;
k = 4;
}
@@ -101,7 +101,7 @@
class GSWPageDefLexer extends Lexer;
options {
k = 4;
- tokenVocabulary=GSWPageDef;
+ exportVocab=GSWPageDef;
charVocabulary = '\3'..'\377';
caseSensitive=true;
filter=UNDEFINED_TOKEN;
--- dev-libs/gsweb/GSWeb.framework/html.g.orig Mon Oct 30 16:56:08 2000
+++ dev-libs/gsweb/GSWeb.framework/html.g Fri May 11 19:27:59 2001
@@ -56,7 +56,7 @@
class GSWHTMLParser extends Parser;
options {
- tokenVocabulary=GSWHTML;
+ exportVocab=GSWHTML;
buildAST=true;
k = 1;
}
@@ -84,7 +84,7 @@
class GSWHTMLLexer extends Lexer;
options {
k = 3;
- tokenVocabulary=GSWHTML;
+ exportVocab=GSWHTML;
charVocabulary = '\3'..'\377';
caseSensitive=true;
filter=UNDEFINED_TOKEN;
--- dev-libs/gsweb/GSWeb.framework/htmltag.g.orig Mon Oct 30 16:56:08 2000
+++ dev-libs/gsweb/GSWeb.framework/htmltag.g Fri May 11 19:29:06 2001
@@ -10,7 +10,7 @@
class GSWHTMLAttrParser extends Parser;
options {
- tokenVocabulary=GSWHTMLAttr;
+ exportVocab=GSWHTMLAttr;
buildAST=true;
k = 2;
}
@@ -65,7 +65,7 @@
class GSWHTMLAttrLexer extends Lexer;
options {
k = 8;
- tokenVocabulary=GSWHTMLAttr;
+ exportVocab=GSWHTMLAttr;
charVocabulary = '\3'..'\377';
caseSensitive=true;
filter=UNDEFINED_TOKEN;
- gsantlr patch and associated gsweb patch,
Kim Shrier <=