1 /* Generated By:JavaCC: Do not edit this line. PHPParser.java */
4 import org.eclipse.core.resources.IFile;
5 import org.eclipse.core.resources.IMarker;
6 import org.eclipse.core.runtime.CoreException;
7 import org.eclipse.ui.texteditor.MarkerUtilities;
8 import org.eclipse.jface.preference.IPreferenceStore;
10 import java.util.Hashtable;
11 import java.util.ArrayList;
12 import java.io.StringReader;
14 import java.text.MessageFormat;
16 import net.sourceforge.phpeclipse.actions.PHPStartApacheAction;
17 import net.sourceforge.phpeclipse.PHPeclipsePlugin;
18 import net.sourceforge.phpdt.internal.compiler.ast.*;
19 import net.sourceforge.phpdt.internal.compiler.parser.OutlineableWithChildren;
20 import net.sourceforge.phpdt.internal.compiler.parser.Outlineable;
21 import net.sourceforge.phpdt.internal.compiler.parser.PHPOutlineInfo;
22 import net.sourceforge.phpdt.internal.corext.Assert;
26 * This php parser is inspired by the Java 1.2 grammar example
27 * given with JavaCC. You can get JavaCC at http://www.webgain.com
28 * You can test the parser with the PHPParserTestCase2.java
29 * @author Matthieu Casanova
31 public final class PHPParser extends PHPParserSuperclass implements PHPParserConstants {
33 /** The current segment. */
34 private static OutlineableWithChildren currentSegment;
36 private static final String PARSE_ERROR_STRING = "Parse error"; //$NON-NLS-1$
37 private static final String PARSE_WARNING_STRING = "Warning"; //$NON-NLS-1$
38 static PHPOutlineInfo outlineInfo;
40 /** The error level of the current ParseException. */
41 private static int errorLevel = ERROR;
42 /** The message of the current ParseException. If it's null it's because the parse exception wasn't handled */
43 private static String errorMessage;
45 private static int errorStart = -1;
46 private static int errorEnd = -1;
47 private static PHPDocument phpDocument;
49 private static final char[] SYNTAX_ERROR_CHAR = {'s','y','n','t','a','x',' ','e','r','r','o','r'};
51 * The point where html starts.
52 * It will be used by the token manager to create HTMLCode objects
54 public static int htmlStart;
57 private final static int AstStackIncrement = 100;
58 /** The stack of node. */
59 private static AstNode[] nodes;
60 /** The cursor in expression stack. */
61 private static int nodePtr;
63 private static final boolean PARSER_DEBUG = true;
65 public final void setFileToParse(final IFile fileToParse) {
66 PHPParser.fileToParse = fileToParse;
72 public PHPParser(final IFile fileToParse) {
73 this(new StringReader(""));
74 PHPParser.fileToParse = fileToParse;
77 public static final void phpParserTester(final String strEval) throws ParseException {
78 final StringReader stream = new StringReader(strEval);
79 if (jj_input_stream == null) {
80 jj_input_stream = new SimpleCharStream(stream, 1, 1);
82 ReInit(new StringReader(strEval));
84 phpDocument = new PHPDocument(null,"_root".toCharArray());
85 currentSegment = phpDocument;
86 outlineInfo = new PHPOutlineInfo(null, currentSegment);
87 PHPParserTokenManager.SwitchTo(PHPParserTokenManager.PHPPARSING);
91 public static final void htmlParserTester(final File fileName) throws FileNotFoundException, ParseException {
92 final Reader stream = new FileReader(fileName);
93 if (jj_input_stream == null) {
94 jj_input_stream = new SimpleCharStream(stream, 1, 1);
98 phpDocument = new PHPDocument(null,"_root".toCharArray());
99 currentSegment = phpDocument;
100 outlineInfo = new PHPOutlineInfo(null, currentSegment);
104 public static final void htmlParserTester(final String strEval) throws ParseException {
105 final StringReader stream = new StringReader(strEval);
106 if (jj_input_stream == null) {
107 jj_input_stream = new SimpleCharStream(stream, 1, 1);
111 phpDocument = new PHPDocument(null,"_root".toCharArray());
112 currentSegment = phpDocument;
113 outlineInfo = new PHPOutlineInfo(null, currentSegment);
118 * Reinitialize the parser.
120 private static final void init() {
121 nodes = new AstNode[AstStackIncrement];
127 * Add an php node on the stack.
128 * @param node the node that will be added to the stack
130 private static final void pushOnAstNodes(final AstNode node) {
132 nodes[++nodePtr] = node;
133 } catch (IndexOutOfBoundsException e) {
134 final int oldStackLength = nodes.length;
135 final AstNode[] oldStack = nodes;
136 nodes = new AstNode[oldStackLength + AstStackIncrement];
137 System.arraycopy(oldStack, 0, nodes, 0, oldStackLength);
138 nodePtr = oldStackLength;
139 nodes[nodePtr] = node;
143 public final PHPOutlineInfo parseInfo(final Object parent, final String s) {
144 phpDocument = new PHPDocument(parent,"_root".toCharArray());
145 currentSegment = phpDocument;
146 outlineInfo = new PHPOutlineInfo(parent, currentSegment);
147 final StringReader stream = new StringReader(s);
148 if (jj_input_stream == null) {
149 jj_input_stream = new SimpleCharStream(stream, 1, 1);
155 phpDocument.nodes = new AstNode[nodes.length];
156 System.arraycopy(nodes,0,phpDocument.nodes,0,nodes.length);
157 if (PHPeclipsePlugin.DEBUG) {
158 PHPeclipsePlugin.log(1,phpDocument.toString());
160 } catch (ParseException e) {
161 processParseException(e);
166 private static void processParseExceptionDebug(final ParseException e) throws ParseException {
170 processParseException(e);
173 * This method will process the parse exception.
174 * If the error message is null, the parse exception wasn't catched and a trace is written in the log
175 * @param e the ParseException
177 private static void processParseException(final ParseException e) {
178 if (errorMessage == null) {
179 PHPeclipsePlugin.log(e);
180 errorMessage = "this exception wasn't handled by the parser please tell us how to reproduce it";
181 errorStart = SimpleCharStream.getPosition();
182 errorEnd = errorStart + 1;
186 // if (PHPeclipsePlugin.DEBUG) PHPeclipsePlugin.log(e);
190 * Create marker for the parse error.
191 * @param e the ParseException
193 private static void setMarker(final ParseException e) {
195 if (errorStart == -1) {
196 setMarker(fileToParse,
198 SimpleCharStream.tokenBegin,
199 SimpleCharStream.tokenBegin + e.currentToken.image.length(),
201 "Line " + e.currentToken.beginLine);
203 setMarker(fileToParse,
208 "Line " + e.currentToken.beginLine);
212 } catch (CoreException e2) {
213 PHPeclipsePlugin.log(e2);
217 private static void scanLine(final String output,
220 final int brIndx) throws CoreException {
222 final StringBuffer lineNumberBuffer = new StringBuffer(10);
224 current = output.substring(indx, brIndx);
226 if (current.indexOf(PARSE_WARNING_STRING) != -1 || current.indexOf(PARSE_ERROR_STRING) != -1) {
227 final int onLine = current.indexOf("on line <b>");
229 lineNumberBuffer.delete(0, lineNumberBuffer.length());
230 for (int i = onLine; i < current.length(); i++) {
231 ch = current.charAt(i);
232 if ('0' <= ch && '9' >= ch) {
233 lineNumberBuffer.append(ch);
237 final int lineNumber = Integer.parseInt(lineNumberBuffer.toString());
239 final Hashtable attributes = new Hashtable();
241 current = current.replaceAll("\n", "");
242 current = current.replaceAll("<b>", "");
243 current = current.replaceAll("</b>", "");
244 MarkerUtilities.setMessage(attributes, current);
246 if (current.indexOf(PARSE_ERROR_STRING) != -1)
247 attributes.put(IMarker.SEVERITY, new Integer(IMarker.SEVERITY_ERROR));
248 else if (current.indexOf(PARSE_WARNING_STRING) != -1)
249 attributes.put(IMarker.SEVERITY, new Integer(IMarker.SEVERITY_WARNING));
251 attributes.put(IMarker.SEVERITY, new Integer(IMarker.SEVERITY_INFO));
252 MarkerUtilities.setLineNumber(attributes, lineNumber);
253 MarkerUtilities.createMarker(file, attributes, IMarker.PROBLEM);
258 public final void parse(final String s) {
259 final StringReader stream = new StringReader(s);
260 if (jj_input_stream == null) {
261 jj_input_stream = new SimpleCharStream(stream, 1, 1);
267 } catch (ParseException e) {
268 processParseException(e);
273 * Call the php parse command ( php -l -f <filename> )
274 * and create markers according to the external parser output
276 public static void phpExternalParse(final IFile file) {
277 final IPreferenceStore store = PHPeclipsePlugin.getDefault().getPreferenceStore();
278 final String filename = file.getLocation().toString();
280 final String[] arguments = { filename };
281 final MessageFormat form = new MessageFormat(store.getString(PHPeclipsePlugin.EXTERNAL_PARSER_PREF));
282 final String command = form.format(arguments);
284 final String parserResult = PHPStartApacheAction.getParserOutput(command, "External parser: ");
287 // parse the buffer to find the errors and warnings
288 createMarkers(parserResult, file);
289 } catch (CoreException e) {
290 PHPeclipsePlugin.log(e);
295 * Put a new html block in the stack.
297 public static final void createNewHTMLCode() {
298 final int currentPosition = SimpleCharStream.getPosition();
299 if (currentPosition == htmlStart || currentPosition > SimpleCharStream.currentBuffer.length()) {
302 final char[] chars = SimpleCharStream.currentBuffer.substring(htmlStart,currentPosition+1).toCharArray();
303 pushOnAstNodes(new HTMLCode(chars, htmlStart,currentPosition));
306 /** Create a new task. */
307 public static final void createNewTask() {
308 final int currentPosition = SimpleCharStream.getPosition();
309 final String todo = SimpleCharStream.currentBuffer.substring(currentPosition-3,
310 SimpleCharStream.currentBuffer.indexOf("\n",
312 PHPeclipsePlugin.log(1,SimpleCharStream.currentBuffer.toString());
314 setMarker(fileToParse,
316 SimpleCharStream.getBeginLine(),
318 "Line "+SimpleCharStream.getBeginLine());
319 } catch (CoreException e) {
320 PHPeclipsePlugin.log(e);
324 private static final void parse() throws ParseException {
328 static final public void phpTest() throws ParseException {
329 trace_call("phpTest");
334 trace_return("phpTest");
338 static final public void phpFile() throws ParseException {
339 trace_call("phpFile");
344 switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
382 case INTEGER_LITERAL:
383 case FLOATING_POINT_LITERAL:
398 PHPParser.createNewHTMLCode();
399 } catch (TokenMgrError e) {
400 PHPeclipsePlugin.log(e);
401 errorStart = SimpleCharStream.getPosition();
402 errorEnd = errorStart + 1;
403 errorMessage = e.getMessage();
405 {if (true) throw generateParseException();}
408 trace_return("phpFile");
413 * A php block is a <?= expression [;]?>
414 * or <?php somephpcode ?>
415 * or <? somephpcode ?>
417 static final public void PhpBlock() throws ParseException {
418 trace_call("PhpBlock");
420 final int start = SimpleCharStream.getPosition();
421 final PHPEchoBlock phpEchoBlock;
422 switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
424 phpEchoBlock = phpEchoBlock();
425 pushOnAstNodes(phpEchoBlock);
463 case INTEGER_LITERAL:
464 case FLOATING_POINT_LITERAL:
471 switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
474 switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
476 jj_consume_token(PHPSTARTLONG);
479 jj_consume_token(PHPSTARTSHORT);
481 setMarker(fileToParse,
482 "You should use '<?php' instead of '<?' it will avoid some problems with XML",
484 SimpleCharStream.getPosition(),
486 "Line " + token.beginLine);
487 } catch (CoreException e) {
488 PHPeclipsePlugin.log(e);
493 jj_consume_token(-1);
494 throw new ParseException();
503 jj_consume_token(PHPEND);
504 } catch (ParseException e) {
505 errorMessage = "'?>' expected";
507 errorStart = SimpleCharStream.getPosition() - e.currentToken.next.image.length() + 1;
508 errorEnd = SimpleCharStream.getPosition() + 1;
509 processParseExceptionDebug(e);
514 jj_consume_token(-1);
515 throw new ParseException();
518 trace_return("PhpBlock");
522 static final public PHPEchoBlock phpEchoBlock() throws ParseException {
523 trace_call("phpEchoBlock");
525 final Expression expr;
526 final int pos = SimpleCharStream.getPosition();
527 final PHPEchoBlock echoBlock;
528 jj_consume_token(PHPECHOSTART);
530 switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
532 jj_consume_token(SEMICOLON);
538 jj_consume_token(PHPEND);
539 echoBlock = new PHPEchoBlock(expr,pos,SimpleCharStream.getPosition());
540 pushOnAstNodes(echoBlock);
541 {if (true) return echoBlock;}
542 throw new Error("Missing return statement in function");
544 trace_return("phpEchoBlock");
548 static final public void Php() throws ParseException {
553 switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
587 case INTEGER_LITERAL:
588 case FLOATING_POINT_LITERAL:
608 static final public ClassDeclaration ClassDeclaration() throws ParseException {
609 trace_call("ClassDeclaration");
611 final ClassDeclaration classDeclaration;
612 final Token className,superclassName;
614 char[] classNameImage = SYNTAX_ERROR_CHAR;
615 char[] superclassNameImage = null;
616 jj_consume_token(CLASS);
617 pos = SimpleCharStream.getPosition();
619 className = jj_consume_token(IDENTIFIER);
620 classNameImage = className.image.toCharArray();
621 } catch (ParseException e) {
622 errorMessage = "unexpected token : '"+ e.currentToken.next.image +"', identifier expected";
624 errorStart = SimpleCharStream.getPosition() - e.currentToken.next.image.length() + 1;
625 errorEnd = SimpleCharStream.getPosition() + 1;
626 processParseExceptionDebug(e);
628 switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
630 jj_consume_token(EXTENDS);
632 superclassName = jj_consume_token(IDENTIFIER);
633 superclassNameImage = superclassName.image.toCharArray();
634 } catch (ParseException e) {
635 errorMessage = "unexpected token : '"+ e.currentToken.next.image +"', identifier expected";
637 errorStart = SimpleCharStream.getPosition() - e.currentToken.next.image.length() + 1;
638 errorEnd = SimpleCharStream.getPosition() + 1;
639 processParseExceptionDebug(e);
640 superclassNameImage = SYNTAX_ERROR_CHAR;
647 if (superclassNameImage == null) {
648 classDeclaration = new ClassDeclaration(currentSegment,
653 classDeclaration = new ClassDeclaration(currentSegment,
659 currentSegment.add(classDeclaration);
660 currentSegment = classDeclaration;
661 ClassBody(classDeclaration);
662 currentSegment = (OutlineableWithChildren) currentSegment.getParent();
663 classDeclaration.setSourceEnd(SimpleCharStream.getPosition());
664 pushOnAstNodes(classDeclaration);
665 {if (true) return classDeclaration;}
666 throw new Error("Missing return statement in function");
668 trace_return("ClassDeclaration");
672 static final public void ClassBody(final ClassDeclaration classDeclaration) throws ParseException {
673 trace_call("ClassBody");
676 jj_consume_token(LBRACE);
677 } catch (ParseException e) {
678 errorMessage = "unexpected token : '"+ e.currentToken.next.image + "'. '{' expected";
680 errorStart = SimpleCharStream.getPosition() - e.currentToken.next.image.length() + 1;
681 errorEnd = SimpleCharStream.getPosition() + 1;
682 processParseExceptionDebug(e);
686 switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
695 ClassBodyDeclaration(classDeclaration);
698 jj_consume_token(RBRACE);
699 } catch (ParseException e) {
700 errorMessage = "unexpected token : '"+ e.currentToken.next.image +"'. 'var', 'function' or '}' expected";
702 errorStart = SimpleCharStream.getPosition() - e.currentToken.next.image.length() + 1;
703 errorEnd = SimpleCharStream.getPosition() + 1;
704 processParseExceptionDebug(e);
707 trace_return("ClassBody");
712 * A class can contain only methods and fields.
714 static final public void ClassBodyDeclaration(final ClassDeclaration classDeclaration) throws ParseException {
715 trace_call("ClassBodyDeclaration");
717 final MethodDeclaration method;
718 final FieldDeclaration field;
719 switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
721 method = MethodDeclaration();
722 method.analyzeCode();
723 classDeclaration.addMethod(method);
726 field = FieldDeclaration();
727 classDeclaration.addField(field);
731 jj_consume_token(-1);
732 throw new ParseException();
735 trace_return("ClassBodyDeclaration");
740 * A class field declaration : it's var VariableDeclarator() (, VariableDeclarator())*;.
741 * it is only used by ClassBodyDeclaration()
743 static final public FieldDeclaration FieldDeclaration() throws ParseException {
744 trace_call("FieldDeclaration");
746 VariableDeclaration variableDeclaration;
747 final VariableDeclaration[] list;
748 final ArrayList arrayList = new ArrayList();
749 final int pos = SimpleCharStream.getPosition();
750 jj_consume_token(VAR);
751 variableDeclaration = VariableDeclaratorNoSuffix();
752 arrayList.add(variableDeclaration);
753 outlineInfo.addVariable(new String(variableDeclaration.name()));
756 switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
764 jj_consume_token(COMMA);
765 variableDeclaration = VariableDeclaratorNoSuffix();
766 arrayList.add(variableDeclaration);
767 outlineInfo.addVariable(new String(variableDeclaration.name()));
770 jj_consume_token(SEMICOLON);
771 } catch (ParseException e) {
772 errorMessage = "unexpected token : '"+ e.currentToken.next.image +"'. A ';' was expected after variable declaration";
774 errorStart = SimpleCharStream.getPosition() - e.currentToken.next.image.length() + 1;
775 errorEnd = SimpleCharStream.getPosition() + 1;
776 processParseExceptionDebug(e);
778 list = new VariableDeclaration[arrayList.size()];
779 arrayList.toArray(list);
780 {if (true) return new FieldDeclaration(list,
782 SimpleCharStream.getPosition(),
784 throw new Error("Missing return statement in function");
786 trace_return("FieldDeclaration");
791 * a strict variable declarator : there cannot be a suffix here.
792 * It will be used by fields and formal parameters
794 static final public VariableDeclaration VariableDeclaratorNoSuffix() throws ParseException {
795 trace_call("VariableDeclaratorNoSuffix");
798 Expression initializer = null;
799 varName = jj_consume_token(DOLLAR_ID);
800 final int pos = SimpleCharStream.getPosition()-varName.image.length();
801 switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
803 jj_consume_token(ASSIGN);
805 initializer = VariableInitializer();
806 } catch (ParseException e) {
807 errorMessage = "Literal expression expected in variable initializer";
809 errorStart = SimpleCharStream.getPosition() - e.currentToken.next.image.length() + 1;
810 errorEnd = SimpleCharStream.getPosition() + 1;
811 processParseExceptionDebug(e);
818 if (initializer == null) {
819 {if (true) return new VariableDeclaration(currentSegment,
820 new Variable(varName.image.substring(1),SimpleCharStream.getPosition()-varName.image.length()-1,SimpleCharStream.getPosition()),
822 SimpleCharStream.getPosition());}
824 {if (true) return new VariableDeclaration(currentSegment,
825 new Variable(varName.image.substring(1),SimpleCharStream.getPosition()-varName.image.length()-1,SimpleCharStream.getPosition()),
827 VariableDeclaration.EQUAL,
829 throw new Error("Missing return statement in function");
831 trace_return("VariableDeclaratorNoSuffix");
836 * this will be used by static statement
838 static final public VariableDeclaration VariableDeclarator() throws ParseException {
839 trace_call("VariableDeclarator");
841 final AbstractVariable variable;
842 Expression initializer = null;
843 final int pos = SimpleCharStream.getPosition();
844 variable = VariableDeclaratorId();
845 switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
847 jj_consume_token(ASSIGN);
849 initializer = VariableInitializer();
850 } catch (ParseException e) {
851 errorMessage = "Literal expression expected in variable initializer";
853 errorStart = SimpleCharStream.getPosition() - e.currentToken.next.image.length() + 1;
854 errorEnd = SimpleCharStream.getPosition() + 1;
855 processParseExceptionDebug(e);
862 if (initializer == null) {
863 {if (true) return new VariableDeclaration(currentSegment,
866 SimpleCharStream.getPosition());}
868 {if (true) return new VariableDeclaration(currentSegment,
871 VariableDeclaration.EQUAL,
873 throw new Error("Missing return statement in function");
875 trace_return("VariableDeclarator");
881 * @return the variable name (with suffix)
883 static final public AbstractVariable VariableDeclaratorId() throws ParseException {
884 trace_call("VariableDeclaratorId");
887 AbstractVariable expression = null;
888 final int pos = SimpleCharStream.getPosition();
898 expression = VariableSuffix(var);
900 if (expression == null) {
901 {if (true) return var;}
903 {if (true) return expression;}
904 } catch (ParseException e) {
905 errorMessage = "'$' expected for variable identifier";
907 errorStart = SimpleCharStream.getPosition() - e.currentToken.next.image.length() + 1;
908 errorEnd = SimpleCharStream.getPosition() + 1;
911 throw new Error("Missing return statement in function");
913 trace_return("VariableDeclaratorId");
918 * Return a variablename without the $.
919 * @return a variable name
921 static final public Variable Variable() throws ParseException {
922 trace_call("Variable");
924 final StringBuffer buff;
925 Expression expression = null;
929 switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
931 token = jj_consume_token(DOLLAR_ID);
932 pos = SimpleCharStream.getPosition()-token.image.length();
933 switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
935 jj_consume_token(LBRACE);
936 expression = Expression();
937 jj_consume_token(RBRACE);
943 if (expression == null) {
944 {if (true) return new Variable(token.image.substring(1),pos,SimpleCharStream.getPosition());}
946 String s = expression.toStringExpression();
947 buff = new StringBuffer(token.image.length()+s.length()+2);
948 buff.append(token.image);
953 {if (true) return new Variable(s,pos,SimpleCharStream.getPosition());}
956 jj_consume_token(DOLLAR);
957 pos = SimpleCharStream.getPosition()-1;
958 expr = VariableName();
959 {if (true) return new Variable(expr,pos,SimpleCharStream.getPosition());}
963 jj_consume_token(-1);
964 throw new ParseException();
966 throw new Error("Missing return statement in function");
968 trace_return("Variable");
973 * A Variable name (without the $)
974 * @return a variable name String
976 static final public Variable VariableName() throws ParseException {
977 trace_call("VariableName");
979 final StringBuffer buff;
982 Expression expression = null;
985 switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
987 jj_consume_token(LBRACE);
988 pos = SimpleCharStream.getPosition()-1;
989 expression = Expression();
990 jj_consume_token(RBRACE);
991 expr = expression.toStringExpression();
992 buff = new StringBuffer(expr.length()+2);
996 pos = SimpleCharStream.getPosition();
997 expr = buff.toString();
998 {if (true) return new Variable(expr,
1000 SimpleCharStream.getPosition());}
1003 token = jj_consume_token(IDENTIFIER);
1004 pos = SimpleCharStream.getPosition() - token.image.length();
1005 switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
1007 jj_consume_token(LBRACE);
1008 expression = Expression();
1009 jj_consume_token(RBRACE);
1012 jj_la1[14] = jj_gen;
1015 if (expression == null) {
1016 {if (true) return new Variable(token.image,
1018 SimpleCharStream.getPosition());}
1020 expr = expression.toStringExpression();
1021 buff = new StringBuffer(token.image.length()+expr.length()+2);
1022 buff.append(token.image);
1026 expr = buff.toString();
1027 {if (true) return new Variable(expr,
1029 SimpleCharStream.getPosition());}
1032 jj_consume_token(DOLLAR);
1033 pos = SimpleCharStream.getPosition() - 1;
1034 var = VariableName();
1035 {if (true) return new Variable(var,
1037 SimpleCharStream.getPosition());}
1040 token = jj_consume_token(DOLLAR_ID);
1041 pos = SimpleCharStream.getPosition();
1042 {if (true) return new Variable(token.image,
1043 pos-token.image.length(),
1047 jj_la1[15] = jj_gen;
1048 jj_consume_token(-1);
1049 throw new ParseException();
1051 throw new Error("Missing return statement in function");
1053 trace_return("VariableName");
1057 static final public Expression VariableInitializer() throws ParseException {
1058 trace_call("VariableInitializer");
1060 final Expression expr;
1062 final int pos = SimpleCharStream.getPosition();
1063 switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
1067 case INTEGER_LITERAL:
1068 case FLOATING_POINT_LITERAL:
1069 case STRING_LITERAL:
1071 {if (true) return expr;}
1074 jj_consume_token(MINUS);
1075 switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
1076 case INTEGER_LITERAL:
1077 token = jj_consume_token(INTEGER_LITERAL);
1079 case FLOATING_POINT_LITERAL:
1080 token = jj_consume_token(FLOATING_POINT_LITERAL);
1083 jj_la1[16] = jj_gen;
1084 jj_consume_token(-1);
1085 throw new ParseException();
1087 {if (true) return new PrefixedUnaryExpression(new NumberLiteral(token.image.toCharArray(),
1089 SimpleCharStream.getPosition()),
1094 jj_consume_token(PLUS);
1095 switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
1096 case INTEGER_LITERAL:
1097 token = jj_consume_token(INTEGER_LITERAL);
1099 case FLOATING_POINT_LITERAL:
1100 token = jj_consume_token(FLOATING_POINT_LITERAL);
1103 jj_la1[17] = jj_gen;
1104 jj_consume_token(-1);
1105 throw new ParseException();
1107 {if (true) return new PrefixedUnaryExpression(new NumberLiteral(token.image.toCharArray(),
1109 SimpleCharStream.getPosition()),
1114 expr = ArrayDeclarator();
1115 {if (true) return expr;}
1118 token = jj_consume_token(IDENTIFIER);
1119 {if (true) return new ConstantIdentifier(token.image.toCharArray(),pos,SimpleCharStream.getPosition());}
1122 jj_la1[18] = jj_gen;
1123 jj_consume_token(-1);
1124 throw new ParseException();
1126 throw new Error("Missing return statement in function");
1128 trace_return("VariableInitializer");
1132 static final public ArrayVariableDeclaration ArrayVariable() throws ParseException {
1133 trace_call("ArrayVariable");
1135 final Expression expr,expr2;
1136 expr = Expression();
1137 switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
1139 jj_consume_token(ARRAYASSIGN);
1140 expr2 = Expression();
1141 {if (true) return new ArrayVariableDeclaration(expr,expr2);}
1144 jj_la1[19] = jj_gen;
1147 {if (true) return new ArrayVariableDeclaration(expr,SimpleCharStream.getPosition());}
1148 throw new Error("Missing return statement in function");
1150 trace_return("ArrayVariable");
1154 static final public ArrayVariableDeclaration[] ArrayInitializer() throws ParseException {
1155 trace_call("ArrayInitializer");
1157 ArrayVariableDeclaration expr;
1158 final ArrayList list = new ArrayList();
1159 jj_consume_token(LPAREN);
1160 switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
1175 case INTEGER_LITERAL:
1176 case FLOATING_POINT_LITERAL:
1177 case STRING_LITERAL:
1181 expr = ArrayVariable();
1190 jj_consume_token(COMMA);
1191 expr = ArrayVariable();
1196 jj_la1[20] = jj_gen;
1199 switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
1201 jj_consume_token(COMMA);
1205 jj_la1[21] = jj_gen;
1208 jj_consume_token(RPAREN);
1209 final ArrayVariableDeclaration[] vars = new ArrayVariableDeclaration[list.size()];
1211 {if (true) return vars;}
1212 throw new Error("Missing return statement in function");
1214 trace_return("ArrayInitializer");
1219 * A Method Declaration.
1220 * <b>function</b> MetodDeclarator() Block()
1222 static final public MethodDeclaration MethodDeclaration() throws ParseException {
1223 trace_call("MethodDeclaration");
1225 final MethodDeclaration functionDeclaration;
1227 final OutlineableWithChildren seg = currentSegment;
1228 jj_consume_token(FUNCTION);
1230 functionDeclaration = MethodDeclarator();
1231 outlineInfo.addVariable(new String(functionDeclaration.name));
1232 } catch (ParseException e) {
1233 if (errorMessage != null) {if (true) throw e;}
1234 errorMessage = "unexpected token : '"+ e.currentToken.next.image +"', function identifier expected";
1236 errorStart = SimpleCharStream.getPosition() - e.currentToken.next.image.length() + 1;
1237 errorEnd = SimpleCharStream.getPosition() + 1;
1238 {if (true) throw e;}
1240 currentSegment = functionDeclaration;
1242 functionDeclaration.statements = block.statements;
1243 currentSegment = seg;
1244 {if (true) return functionDeclaration;}
1245 throw new Error("Missing return statement in function");
1247 trace_return("MethodDeclaration");
1252 * A MethodDeclarator.
1253 * [&] IDENTIFIER(parameters ...).
1254 * @return a function description for the outline
1256 static final public MethodDeclaration MethodDeclarator() throws ParseException {
1257 trace_call("MethodDeclarator");
1259 final Token identifier;
1260 Token reference = null;
1261 final Hashtable formalParameters;
1262 final int pos = SimpleCharStream.getPosition();
1263 char[] identifierChar = SYNTAX_ERROR_CHAR;
1264 switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
1266 reference = jj_consume_token(BIT_AND);
1269 jj_la1[22] = jj_gen;
1273 identifier = jj_consume_token(IDENTIFIER);
1274 identifierChar = identifier.image.toCharArray();
1275 } catch (ParseException e) {
1276 errorMessage = "unexpected token : '"+ e.currentToken.next.image +"', function identifier expected";
1278 errorStart = SimpleCharStream.getPosition() - e.currentToken.next.image.length() + 1;
1279 errorEnd = SimpleCharStream.getPosition() + 1;
1280 processParseExceptionDebug(e);
1282 formalParameters = FormalParameters();
1283 MethodDeclaration method = new MethodDeclaration(currentSegment,
1288 SimpleCharStream.getPosition());
1289 {if (true) return method;}
1290 throw new Error("Missing return statement in function");
1292 trace_return("MethodDeclarator");
1297 * FormalParameters follows method identifier.
1298 * (FormalParameter())
1300 static final public Hashtable FormalParameters() throws ParseException {
1301 trace_call("FormalParameters");
1303 VariableDeclaration var;
1304 final Hashtable parameters = new Hashtable();
1306 jj_consume_token(LPAREN);
1307 } catch (ParseException e) {
1308 errorMessage = "unexpected token : '"+ e.currentToken.next.image +"', '(' expected after function identifier";
1310 errorStart = SimpleCharStream.getPosition() - e.currentToken.next.image.length() + 1;
1311 errorEnd = SimpleCharStream.getPosition() + 1;
1312 processParseExceptionDebug(e);
1314 switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
1317 var = FormalParameter();
1318 parameters.put(new String(var.name()),var);
1321 switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
1326 jj_la1[23] = jj_gen;
1329 jj_consume_token(COMMA);
1330 var = FormalParameter();
1331 parameters.put(new String(var.name()),var);
1335 jj_la1[24] = jj_gen;
1339 jj_consume_token(RPAREN);
1340 } catch (ParseException e) {
1341 errorMessage = "')' expected";
1343 errorStart = SimpleCharStream.getPosition() - e.currentToken.next.image.length() + 1;
1344 errorEnd = SimpleCharStream.getPosition() + 1;
1345 processParseExceptionDebug(e);
1347 {if (true) return parameters;}
1348 throw new Error("Missing return statement in function");
1350 trace_return("FormalParameters");
1355 * A formal parameter.
1356 * $varname[=value] (,$varname[=value])
1358 static final public VariableDeclaration FormalParameter() throws ParseException {
1359 trace_call("FormalParameter");
1361 final VariableDeclaration variableDeclaration;
1363 switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
1365 token = jj_consume_token(BIT_AND);
1368 jj_la1[25] = jj_gen;
1371 variableDeclaration = VariableDeclaratorNoSuffix();
1372 if (token != null) {
1373 variableDeclaration.setReference(true);
1375 {if (true) return variableDeclaration;}
1376 throw new Error("Missing return statement in function");
1378 trace_return("FormalParameter");
1382 static final public ConstantIdentifier Type() throws ParseException {
1386 switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
1388 jj_consume_token(STRING);
1389 pos = SimpleCharStream.getPosition();
1390 {if (true) return new ConstantIdentifier(Types.STRING,pos,pos-6);}
1393 jj_consume_token(BOOL);
1394 pos = SimpleCharStream.getPosition();
1395 {if (true) return new ConstantIdentifier(Types.BOOL,pos,pos-4);}
1398 jj_consume_token(BOOLEAN);
1399 pos = SimpleCharStream.getPosition();
1400 {if (true) return new ConstantIdentifier(Types.BOOLEAN,pos,pos-7);}
1403 jj_consume_token(REAL);
1404 pos = SimpleCharStream.getPosition();
1405 {if (true) return new ConstantIdentifier(Types.REAL,pos,pos-4);}
1408 jj_consume_token(DOUBLE);
1409 pos = SimpleCharStream.getPosition();
1410 {if (true) return new ConstantIdentifier(Types.DOUBLE,pos,pos-5);}
1413 jj_consume_token(FLOAT);
1414 pos = SimpleCharStream.getPosition();
1415 {if (true) return new ConstantIdentifier(Types.FLOAT,pos,pos-5);}
1418 jj_consume_token(INT);
1419 pos = SimpleCharStream.getPosition();
1420 {if (true) return new ConstantIdentifier(Types.INT,pos,pos-3);}
1423 jj_consume_token(INTEGER);
1424 pos = SimpleCharStream.getPosition();
1425 {if (true) return new ConstantIdentifier(Types.INTEGER,pos,pos-7);}
1428 jj_consume_token(OBJECT);
1429 pos = SimpleCharStream.getPosition();
1430 {if (true) return new ConstantIdentifier(Types.OBJECT,pos,pos-6);}
1433 jj_la1[26] = jj_gen;
1434 jj_consume_token(-1);
1435 throw new ParseException();
1437 throw new Error("Missing return statement in function");
1439 trace_return("Type");
1443 static final public Expression Expression() throws ParseException {
1444 trace_call("Expression");
1446 final Expression expr;
1447 Expression initializer = null;
1448 final int pos = SimpleCharStream.getPosition();
1449 int assignOperator = -1;
1450 switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
1463 case INTEGER_LITERAL:
1464 case FLOATING_POINT_LITERAL:
1465 case STRING_LITERAL:
1469 expr = ConditionalExpression();
1470 switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
1483 case RSIGNEDSHIFTASSIGN:
1484 assignOperator = AssignmentOperator();
1486 initializer = Expression();
1487 } catch (ParseException e) {
1488 if (errorMessage != null) {
1489 {if (true) throw e;}
1491 errorMessage = "unexpected token : '"+ e.currentToken.next.image +"', expression expected";
1493 errorEnd = SimpleCharStream.getPosition();
1494 {if (true) throw e;}
1498 jj_la1[27] = jj_gen;
1501 if (assignOperator != -1) {// todo : change this, very very bad :(
1502 if (expr instanceof AbstractVariable) {
1503 {if (true) return new VariableDeclaration(currentSegment,
1504 (AbstractVariable) expr,
1506 SimpleCharStream.getPosition());}
1508 String varName = expr.toStringExpression().substring(1);
1509 {if (true) return new VariableDeclaration(currentSegment,
1510 new Variable(varName,SimpleCharStream.getPosition()-varName.length()-1,SimpleCharStream.getPosition()),
1512 SimpleCharStream.getPosition());}
1514 {if (true) return expr;}
1518 expr = ExpressionWBang();
1519 {if (true) return expr;}
1522 jj_la1[28] = jj_gen;
1523 jj_consume_token(-1);
1524 throw new ParseException();
1526 throw new Error("Missing return statement in function");
1528 trace_return("Expression");
1532 static final public Expression ExpressionWBang() throws ParseException {
1533 trace_call("ExpressionWBang");
1535 final Expression expr;
1536 final int pos = SimpleCharStream.getPosition();
1537 switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
1539 jj_consume_token(BANG);
1540 expr = ExpressionWBang();
1541 {if (true) return new PrefixedUnaryExpression(expr,OperatorIds.NOT,pos);}
1545 expr = ExpressionNoBang();
1546 {if (true) return expr;}
1549 jj_la1[29] = jj_gen;
1550 jj_consume_token(-1);
1551 throw new ParseException();
1553 throw new Error("Missing return statement in function");
1555 trace_return("ExpressionWBang");
1559 static final public Expression ExpressionNoBang() throws ParseException {
1560 trace_call("ExpressionNoBang");
1563 switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
1565 expr = ListExpression();
1566 {if (true) return expr;}
1569 expr = PrintExpression();
1570 {if (true) return expr;}
1573 jj_la1[30] = jj_gen;
1574 jj_consume_token(-1);
1575 throw new ParseException();
1577 throw new Error("Missing return statement in function");
1579 trace_return("ExpressionNoBang");
1584 * Any assignement operator.
1585 * @return the assignement operator id
1587 static final public int AssignmentOperator() throws ParseException {
1588 trace_call("AssignmentOperator");
1590 switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
1592 jj_consume_token(ASSIGN);
1593 {if (true) return VariableDeclaration.EQUAL;}
1596 jj_consume_token(STARASSIGN);
1597 {if (true) return VariableDeclaration.STAR_EQUAL;}
1600 jj_consume_token(SLASHASSIGN);
1601 {if (true) return VariableDeclaration.SLASH_EQUAL;}
1604 jj_consume_token(REMASSIGN);
1605 {if (true) return VariableDeclaration.REM_EQUAL;}
1608 jj_consume_token(PLUSASSIGN);
1609 {if (true) return VariableDeclaration.PLUS_EQUAL;}
1612 jj_consume_token(MINUSASSIGN);
1613 {if (true) return VariableDeclaration.MINUS_EQUAL;}
1616 jj_consume_token(LSHIFTASSIGN);
1617 {if (true) return VariableDeclaration.LSHIFT_EQUAL;}
1619 case RSIGNEDSHIFTASSIGN:
1620 jj_consume_token(RSIGNEDSHIFTASSIGN);
1621 {if (true) return VariableDeclaration.RSIGNEDSHIFT_EQUAL;}
1624 jj_consume_token(ANDASSIGN);
1625 {if (true) return VariableDeclaration.AND_EQUAL;}
1628 jj_consume_token(XORASSIGN);
1629 {if (true) return VariableDeclaration.XOR_EQUAL;}
1632 jj_consume_token(ORASSIGN);
1633 {if (true) return VariableDeclaration.OR_EQUAL;}
1636 jj_consume_token(DOTASSIGN);
1637 {if (true) return VariableDeclaration.DOT_EQUAL;}
1640 jj_consume_token(TILDEEQUAL);
1641 {if (true) return VariableDeclaration.TILDE_EQUAL;}
1644 jj_la1[31] = jj_gen;
1645 jj_consume_token(-1);
1646 throw new ParseException();
1648 throw new Error("Missing return statement in function");
1650 trace_return("AssignmentOperator");
1654 static final public Expression ConditionalExpression() throws ParseException {
1655 trace_call("ConditionalExpression");
1657 final Expression expr;
1658 Expression expr2 = null;
1659 Expression expr3 = null;
1660 expr = ConditionalOrExpression();
1661 switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
1663 jj_consume_token(HOOK);
1664 expr2 = Expression();
1665 jj_consume_token(COLON);
1666 expr3 = ConditionalExpression();
1669 jj_la1[32] = jj_gen;
1672 if (expr3 == null) {
1673 {if (true) return expr;}
1675 {if (true) return new ConditionalExpression(expr,expr2,expr3);}
1676 throw new Error("Missing return statement in function");
1678 trace_return("ConditionalExpression");
1682 static final public Expression ConditionalOrExpression() throws ParseException {
1683 trace_call("ConditionalOrExpression");
1685 Expression expr,expr2;
1687 expr = ConditionalAndExpression();
1690 switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
1696 jj_la1[33] = jj_gen;
1699 switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
1701 jj_consume_token(OR_OR);
1702 operator = OperatorIds.OR_OR;
1705 jj_consume_token(_ORL);
1706 operator = OperatorIds.ORL;
1709 jj_la1[34] = jj_gen;
1710 jj_consume_token(-1);
1711 throw new ParseException();
1713 expr2 = ConditionalAndExpression();
1714 expr = new BinaryExpression(expr,expr2,operator);
1716 {if (true) return expr;}
1717 throw new Error("Missing return statement in function");
1719 trace_return("ConditionalOrExpression");
1723 static final public Expression ConditionalAndExpression() throws ParseException {
1724 trace_call("ConditionalAndExpression");
1726 Expression expr,expr2;
1728 expr = ConcatExpression();
1731 switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
1737 jj_la1[35] = jj_gen;
1740 switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
1742 jj_consume_token(AND_AND);
1743 operator = OperatorIds.AND_AND;
1746 jj_consume_token(_ANDL);
1747 operator = OperatorIds.ANDL;
1750 jj_la1[36] = jj_gen;
1751 jj_consume_token(-1);
1752 throw new ParseException();
1754 expr2 = ConcatExpression();
1755 expr = new BinaryExpression(expr,expr2,operator);
1757 {if (true) return expr;}
1758 throw new Error("Missing return statement in function");
1760 trace_return("ConditionalAndExpression");
1764 static final public Expression ConcatExpression() throws ParseException {
1765 trace_call("ConcatExpression");
1767 Expression expr,expr2;
1768 expr = InclusiveOrExpression();
1771 switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
1776 jj_la1[37] = jj_gen;
1779 jj_consume_token(DOT);
1780 expr2 = InclusiveOrExpression();
1781 expr = new BinaryExpression(expr,expr2,OperatorIds.DOT);
1783 {if (true) return expr;}
1784 throw new Error("Missing return statement in function");
1786 trace_return("ConcatExpression");
1790 static final public Expression InclusiveOrExpression() throws ParseException {
1791 trace_call("InclusiveOrExpression");
1793 Expression expr,expr2;
1794 expr = ExclusiveOrExpression();
1797 switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
1802 jj_la1[38] = jj_gen;
1805 jj_consume_token(BIT_OR);
1806 expr2 = ExclusiveOrExpression();
1807 expr = new BinaryExpression(expr,expr2,OperatorIds.OR);
1809 {if (true) return expr;}
1810 throw new Error("Missing return statement in function");
1812 trace_return("InclusiveOrExpression");
1816 static final public Expression ExclusiveOrExpression() throws ParseException {
1817 trace_call("ExclusiveOrExpression");
1819 Expression expr,expr2;
1820 expr = AndExpression();
1823 switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
1828 jj_la1[39] = jj_gen;
1831 jj_consume_token(XOR);
1832 expr2 = AndExpression();
1833 expr = new BinaryExpression(expr,expr2,OperatorIds.XOR);
1835 {if (true) return expr;}
1836 throw new Error("Missing return statement in function");
1838 trace_return("ExclusiveOrExpression");
1842 static final public Expression AndExpression() throws ParseException {
1843 trace_call("AndExpression");
1845 Expression expr,expr2;
1846 expr = EqualityExpression();
1849 switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
1854 jj_la1[40] = jj_gen;
1857 jj_consume_token(BIT_AND);
1858 expr2 = EqualityExpression();
1859 expr = new BinaryExpression(expr,expr2,OperatorIds.AND);
1861 {if (true) return expr;}
1862 throw new Error("Missing return statement in function");
1864 trace_return("AndExpression");
1868 static final public Expression EqualityExpression() throws ParseException {
1869 trace_call("EqualityExpression");
1871 Expression expr,expr2;
1873 expr = RelationalExpression();
1876 switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
1880 case BANGDOUBLEEQUAL:
1885 jj_la1[41] = jj_gen;
1888 switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
1890 jj_consume_token(EQUAL_EQUAL);
1891 operator = OperatorIds.EQUAL_EQUAL;
1894 jj_consume_token(DIF);
1895 operator = OperatorIds.DIF;
1898 jj_consume_token(NOT_EQUAL);
1899 operator = OperatorIds.DIF;
1901 case BANGDOUBLEEQUAL:
1902 jj_consume_token(BANGDOUBLEEQUAL);
1903 operator = OperatorIds.BANG_EQUAL_EQUAL;
1906 jj_consume_token(TRIPLEEQUAL);
1907 operator = OperatorIds.EQUAL_EQUAL_EQUAL;
1910 jj_la1[42] = jj_gen;
1911 jj_consume_token(-1);
1912 throw new ParseException();
1915 expr2 = RelationalExpression();
1916 } catch (ParseException e) {
1917 if (errorMessage != null) {
1918 {if (true) throw e;}
1920 errorMessage = "unexpected token : '"+ e.currentToken.next.image +"', expression expected";
1922 errorStart = SimpleCharStream.getPosition() - e.currentToken.next.image.length() + 1;
1923 errorEnd = SimpleCharStream.getPosition() + 1;
1924 {if (true) throw e;}
1926 expr = new BinaryExpression(expr,expr2,operator);
1928 {if (true) return expr;}
1929 throw new Error("Missing return statement in function");
1931 trace_return("EqualityExpression");
1935 static final public Expression RelationalExpression() throws ParseException {
1936 trace_call("RelationalExpression");
1938 Expression expr,expr2;
1940 expr = ShiftExpression();
1943 switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
1951 jj_la1[43] = jj_gen;
1954 switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
1956 jj_consume_token(LT);
1957 operator = OperatorIds.LESS;
1960 jj_consume_token(GT);
1961 operator = OperatorIds.GREATER;
1964 jj_consume_token(LE);
1965 operator = OperatorIds.LESS_EQUAL;
1968 jj_consume_token(GE);
1969 operator = OperatorIds.GREATER_EQUAL;
1972 jj_la1[44] = jj_gen;
1973 jj_consume_token(-1);
1974 throw new ParseException();
1976 expr2 = ShiftExpression();
1977 expr = new BinaryExpression(expr,expr2,operator);
1979 {if (true) return expr;}
1980 throw new Error("Missing return statement in function");
1982 trace_return("RelationalExpression");
1986 static final public Expression ShiftExpression() throws ParseException {
1987 trace_call("ShiftExpression");
1989 Expression expr,expr2;
1991 expr = AdditiveExpression();
1994 switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
1997 case RUNSIGNEDSHIFT:
2001 jj_la1[45] = jj_gen;
2004 switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
2006 jj_consume_token(LSHIFT);
2007 operator = OperatorIds.LEFT_SHIFT;
2010 jj_consume_token(RSIGNEDSHIFT);
2011 operator = OperatorIds.RIGHT_SHIFT;
2013 case RUNSIGNEDSHIFT:
2014 jj_consume_token(RUNSIGNEDSHIFT);
2015 operator = OperatorIds.UNSIGNED_RIGHT_SHIFT;
2018 jj_la1[46] = jj_gen;
2019 jj_consume_token(-1);
2020 throw new ParseException();
2022 expr2 = AdditiveExpression();
2023 expr = new BinaryExpression(expr,expr2,operator);
2025 {if (true) return expr;}
2026 throw new Error("Missing return statement in function");
2028 trace_return("ShiftExpression");
2032 static final public Expression AdditiveExpression() throws ParseException {
2033 trace_call("AdditiveExpression");
2035 Expression expr,expr2;
2037 expr = MultiplicativeExpression();
2040 switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
2046 jj_la1[47] = jj_gen;
2049 switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
2051 jj_consume_token(PLUS);
2052 operator = OperatorIds.PLUS;
2055 jj_consume_token(MINUS);
2056 operator = OperatorIds.MINUS;
2059 jj_la1[48] = jj_gen;
2060 jj_consume_token(-1);
2061 throw new ParseException();
2063 expr2 = MultiplicativeExpression();
2064 expr = new BinaryExpression(expr,expr2,operator);
2066 {if (true) return expr;}
2067 throw new Error("Missing return statement in function");
2069 trace_return("AdditiveExpression");
2073 static final public Expression MultiplicativeExpression() throws ParseException {
2074 trace_call("MultiplicativeExpression");
2076 Expression expr,expr2;
2079 expr = UnaryExpression();
2080 } catch (ParseException e) {
2081 if (errorMessage != null) {if (true) throw e;}
2082 errorMessage = "unexpected token '"+e.currentToken.next.image+"'";
2084 errorStart = SimpleCharStream.getPosition() - e.currentToken.next.image.length() + 1;
2085 errorEnd = SimpleCharStream.getPosition() + 1;
2086 {if (true) throw e;}
2090 switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
2097 jj_la1[49] = jj_gen;
2100 switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
2102 jj_consume_token(STAR);
2103 operator = OperatorIds.MULTIPLY;
2106 jj_consume_token(SLASH);
2107 operator = OperatorIds.DIVIDE;
2110 jj_consume_token(REMAINDER);
2111 operator = OperatorIds.REMAINDER;
2114 jj_la1[50] = jj_gen;
2115 jj_consume_token(-1);
2116 throw new ParseException();
2118 expr2 = UnaryExpression();
2119 expr = new BinaryExpression(expr,expr2,operator);
2121 {if (true) return expr;}
2122 throw new Error("Missing return statement in function");
2124 trace_return("MultiplicativeExpression");
2129 * An unary expression starting with @, & or nothing
2131 static final public Expression UnaryExpression() throws ParseException {
2132 trace_call("UnaryExpression");
2134 final Expression expr;
2135 final int pos = SimpleCharStream.getPosition();
2136 /* <BIT_AND> expr = UnaryExpressionNoPrefix() //why did I had that ?
2137 {return new PrefixedUnaryExpression(expr,OperatorIds.AND,pos);}
2139 expr = AtNotUnaryExpression();
2140 {if (true) return expr;}
2141 throw new Error("Missing return statement in function");
2143 trace_return("UnaryExpression");
2148 * An expression prefixed (or not) by one or more @ and !.
2149 * @return the expression
2151 static final public Expression AtNotUnaryExpression() throws ParseException {
2152 trace_call("AtNotUnaryExpression");
2154 final Expression expr;
2155 final int pos = SimpleCharStream.getPosition();
2156 switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
2158 jj_consume_token(AT);
2159 expr = AtNotUnaryExpression();
2160 {if (true) return new PrefixedUnaryExpression(expr,OperatorIds.AT,pos);}
2163 jj_consume_token(BANG);
2164 expr = AtNotUnaryExpression();
2165 {if (true) return new PrefixedUnaryExpression(expr,OperatorIds.NOT,pos);}
2177 case INTEGER_LITERAL:
2178 case FLOATING_POINT_LITERAL:
2179 case STRING_LITERAL:
2183 expr = UnaryExpressionNoPrefix();
2184 {if (true) return expr;}
2187 jj_la1[51] = jj_gen;
2188 jj_consume_token(-1);
2189 throw new ParseException();
2191 throw new Error("Missing return statement in function");
2193 trace_return("AtNotUnaryExpression");
2197 static final public Expression UnaryExpressionNoPrefix() throws ParseException {
2198 trace_call("UnaryExpressionNoPrefix");
2200 final Expression expr;
2201 final int pos = SimpleCharStream.getPosition();
2202 switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
2204 jj_consume_token(PLUS);
2205 expr = AtNotUnaryExpression();
2206 {if (true) return new PrefixedUnaryExpression(expr,OperatorIds.PLUS,pos);}
2209 jj_consume_token(MINUS);
2210 expr = AtNotUnaryExpression();
2211 {if (true) return new PrefixedUnaryExpression(expr,OperatorIds.MINUS,pos);}
2215 expr = PreIncDecExpression();
2216 {if (true) return expr;}
2224 case INTEGER_LITERAL:
2225 case FLOATING_POINT_LITERAL:
2226 case STRING_LITERAL:
2230 expr = UnaryExpressionNotPlusMinus();
2231 {if (true) return expr;}
2234 jj_la1[52] = jj_gen;
2235 jj_consume_token(-1);
2236 throw new ParseException();
2238 throw new Error("Missing return statement in function");
2240 trace_return("UnaryExpressionNoPrefix");
2244 static final public Expression PreIncDecExpression() throws ParseException {
2245 trace_call("PreIncDecExpression");
2247 final Expression expr;
2249 final int pos = SimpleCharStream.getPosition();
2250 switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
2252 jj_consume_token(PLUS_PLUS);
2253 operator = OperatorIds.PLUS_PLUS;
2256 jj_consume_token(MINUS_MINUS);
2257 operator = OperatorIds.MINUS_MINUS;
2260 jj_la1[53] = jj_gen;
2261 jj_consume_token(-1);
2262 throw new ParseException();
2264 expr = PrimaryExpression();
2265 {if (true) return new PrefixedUnaryExpression(expr,operator,pos);}
2266 throw new Error("Missing return statement in function");
2268 trace_return("PreIncDecExpression");
2272 static final public Expression UnaryExpressionNotPlusMinus() throws ParseException {
2273 trace_call("UnaryExpressionNotPlusMinus");
2275 final Expression expr;
2276 final int pos = SimpleCharStream.getPosition();
2277 if (jj_2_3(2147483647)) {
2278 expr = CastExpression();
2279 {if (true) return expr;}
2281 switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
2287 expr = PostfixExpression();
2288 {if (true) return expr;}
2293 case INTEGER_LITERAL:
2294 case FLOATING_POINT_LITERAL:
2295 case STRING_LITERAL:
2297 {if (true) return expr;}
2300 jj_consume_token(LPAREN);
2301 expr = Expression();
2303 jj_consume_token(RPAREN);
2304 } catch (ParseException e) {
2305 errorMessage = "')' expected";
2307 errorStart = SimpleCharStream.getPosition() - e.currentToken.next.image.length() + 1;
2308 errorEnd = SimpleCharStream.getPosition() + 1;
2309 {if (true) throw e;}
2311 {if (true) return expr;}
2314 jj_la1[54] = jj_gen;
2315 jj_consume_token(-1);
2316 throw new ParseException();
2319 throw new Error("Missing return statement in function");
2321 trace_return("UnaryExpressionNotPlusMinus");
2325 static final public CastExpression CastExpression() throws ParseException {
2326 trace_call("CastExpression");
2328 final ConstantIdentifier type;
2329 final Expression expr;
2330 final int pos = SimpleCharStream.getPosition();
2331 jj_consume_token(LPAREN);
2332 switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
2345 jj_consume_token(ARRAY);
2346 type = new ConstantIdentifier(Types.ARRAY,pos,SimpleCharStream.getPosition());
2349 jj_la1[55] = jj_gen;
2350 jj_consume_token(-1);
2351 throw new ParseException();
2353 jj_consume_token(RPAREN);
2354 expr = UnaryExpression();
2355 {if (true) return new CastExpression(type,expr,pos,SimpleCharStream.getPosition());}
2356 throw new Error("Missing return statement in function");
2358 trace_return("CastExpression");
2362 static final public Expression PostfixExpression() throws ParseException {
2363 trace_call("PostfixExpression");
2365 final Expression expr;
2367 final int pos = SimpleCharStream.getPosition();
2368 expr = PrimaryExpression();
2369 switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
2372 switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
2374 jj_consume_token(PLUS_PLUS);
2375 operator = OperatorIds.PLUS_PLUS;
2378 jj_consume_token(MINUS_MINUS);
2379 operator = OperatorIds.MINUS_MINUS;
2382 jj_la1[56] = jj_gen;
2383 jj_consume_token(-1);
2384 throw new ParseException();
2388 jj_la1[57] = jj_gen;
2391 if (operator == -1) {
2392 {if (true) return expr;}
2394 {if (true) return new PostfixedUnaryExpression(expr,operator,pos);}
2395 throw new Error("Missing return statement in function");
2397 trace_return("PostfixExpression");
2401 static final public Expression PrimaryExpression() throws ParseException {
2402 trace_call("PrimaryExpression");
2404 Expression expr = null;
2406 int assignOperator = -1;
2407 final Token identifier;
2410 switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
2412 token = jj_consume_token(IDENTIFIER);
2413 pos = SimpleCharStream.getPosition();
2414 expr = new ConstantIdentifier(token.image.toCharArray(),
2415 pos-token.image.length(),
2419 switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
2420 case STATICCLASSACCESS:
2424 jj_la1[58] = jj_gen;
2427 jj_consume_token(STATICCLASSACCESS);
2428 expr2 = ClassIdentifier();
2429 expr = new ClassAccess(expr,
2431 ClassAccess.STATIC);
2433 switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
2435 expr = Arguments(expr);
2438 jj_la1[59] = jj_gen;
2441 {if (true) return expr;}
2445 expr = VariableDeclaratorId();
2446 switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
2448 expr = Arguments(expr);
2451 jj_la1[60] = jj_gen;
2454 {if (true) return expr;}
2457 jj_consume_token(NEW);
2458 pos = SimpleCharStream.getPosition();
2459 expr = ClassIdentifier();
2460 expr = new PrefixedUnaryExpression(expr,
2463 switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
2465 expr = Arguments(expr);
2468 jj_la1[61] = jj_gen;
2471 {if (true) return expr;}
2474 expr = ArrayDeclarator();
2475 {if (true) return expr;}
2478 jj_la1[62] = jj_gen;
2479 jj_consume_token(-1);
2480 throw new ParseException();
2482 throw new Error("Missing return statement in function");
2484 trace_return("PrimaryExpression");
2489 * An array declarator.
2493 static final public ArrayInitializer ArrayDeclarator() throws ParseException {
2494 trace_call("ArrayDeclarator");
2496 final ArrayVariableDeclaration[] vars;
2497 final int pos = SimpleCharStream.getPosition();
2498 jj_consume_token(ARRAY);
2499 vars = ArrayInitializer();
2500 {if (true) return new ArrayInitializer(vars,pos,SimpleCharStream.getPosition());}
2501 throw new Error("Missing return statement in function");
2503 trace_return("ArrayDeclarator");
2507 static final public PrefixedUnaryExpression classInstantiation() throws ParseException {
2508 trace_call("classInstantiation");
2511 final StringBuffer buff;
2512 final int pos = SimpleCharStream.getPosition();
2513 jj_consume_token(NEW);
2514 expr = ClassIdentifier();
2515 switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
2521 buff = new StringBuffer(expr.toStringExpression());
2522 expr = PrimaryExpression();
2523 buff.append(expr.toStringExpression());
2524 expr = new ConstantIdentifier(buff.toString().toCharArray(),
2526 SimpleCharStream.getPosition());
2529 jj_la1[63] = jj_gen;
2532 {if (true) return new PrefixedUnaryExpression(expr,
2535 throw new Error("Missing return statement in function");
2537 trace_return("classInstantiation");
2541 static final public Expression ClassIdentifier() throws ParseException {
2542 trace_call("ClassIdentifier");
2544 final Expression expr;
2546 final ConstantIdentifier type;
2547 switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
2549 token = jj_consume_token(IDENTIFIER);
2550 final int pos = SimpleCharStream.getPosition();
2551 {if (true) return new ConstantIdentifier(token.image.toCharArray(),
2552 pos-token.image.length(),
2565 {if (true) return expr;}
2569 expr = VariableDeclaratorId();
2570 {if (true) return expr;}
2573 jj_la1[64] = jj_gen;
2574 jj_consume_token(-1);
2575 throw new ParseException();
2577 throw new Error("Missing return statement in function");
2579 trace_return("ClassIdentifier");
2584 * Used by Variabledeclaratorid and primarysuffix
2586 static final public AbstractVariable VariableSuffix(final AbstractVariable prefix) throws ParseException {
2587 trace_call("VariableSuffix");
2589 Variable expr = null;
2590 final int pos = SimpleCharStream.getPosition();
2591 Expression expression = null;
2592 switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
2594 jj_consume_token(CLASSACCESS);
2596 expr = VariableName();
2597 } catch (ParseException e) {
2598 errorMessage = "unexpected token : '"+ e.currentToken.next.image +"', function call or field access expected";
2600 errorStart = SimpleCharStream.getPosition() - e.currentToken.next.image.length() + 1;
2601 errorEnd = SimpleCharStream.getPosition() + 1;
2602 {if (true) throw e;}
2604 {if (true) return new ClassAccess(prefix,
2606 ClassAccess.NORMAL);}
2609 jj_consume_token(LBRACKET);
2610 switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
2634 case INTEGER_LITERAL:
2635 case FLOATING_POINT_LITERAL:
2636 case STRING_LITERAL:
2640 switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
2655 case INTEGER_LITERAL:
2656 case FLOATING_POINT_LITERAL:
2657 case STRING_LITERAL:
2661 expression = Expression();
2672 expression = Type();
2675 jj_la1[65] = jj_gen;
2676 jj_consume_token(-1);
2677 throw new ParseException();
2681 jj_la1[66] = jj_gen;
2685 jj_consume_token(RBRACKET);
2686 } catch (ParseException e) {
2687 errorMessage = "']' expected";
2689 errorStart = SimpleCharStream.getPosition() - e.currentToken.next.image.length() + 1;
2690 errorEnd = SimpleCharStream.getPosition() + 1;
2691 {if (true) throw e;}
2693 {if (true) return new ArrayDeclarator(prefix,expression,SimpleCharStream.getPosition());}
2696 jj_la1[67] = jj_gen;
2697 jj_consume_token(-1);
2698 throw new ParseException();
2700 throw new Error("Missing return statement in function");
2702 trace_return("VariableSuffix");
2706 static final public Literal Literal() throws ParseException {
2707 trace_call("Literal");
2711 switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
2712 case INTEGER_LITERAL:
2713 token = jj_consume_token(INTEGER_LITERAL);
2714 pos = SimpleCharStream.getPosition();
2715 {if (true) return new NumberLiteral(token.image.toCharArray(),pos-token.image.length(),pos);}
2717 case FLOATING_POINT_LITERAL:
2718 token = jj_consume_token(FLOATING_POINT_LITERAL);
2719 pos = SimpleCharStream.getPosition();
2720 {if (true) return new NumberLiteral(token.image.toCharArray(),pos-token.image.length(),pos);}
2722 case STRING_LITERAL:
2723 token = jj_consume_token(STRING_LITERAL);
2724 pos = SimpleCharStream.getPosition();
2725 {if (true) return new StringLiteral(token.image.toCharArray(),pos-token.image.length());}
2728 jj_consume_token(TRUE);
2729 pos = SimpleCharStream.getPosition();
2730 {if (true) return new TrueLiteral(pos-4,pos);}
2733 jj_consume_token(FALSE);
2734 pos = SimpleCharStream.getPosition();
2735 {if (true) return new FalseLiteral(pos-4,pos);}
2738 jj_consume_token(NULL);
2739 pos = SimpleCharStream.getPosition();
2740 {if (true) return new NullLiteral(pos-4,pos);}
2743 jj_la1[68] = jj_gen;
2744 jj_consume_token(-1);
2745 throw new ParseException();
2747 throw new Error("Missing return statement in function");
2749 trace_return("Literal");
2753 static final public FunctionCall Arguments(final Expression func) throws ParseException {
2754 trace_call("Arguments");
2756 Expression[] args = null;
2757 jj_consume_token(LPAREN);
2758 switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
2773 case INTEGER_LITERAL:
2774 case FLOATING_POINT_LITERAL:
2775 case STRING_LITERAL:
2779 args = ArgumentList();
2782 jj_la1[69] = jj_gen;
2786 jj_consume_token(RPAREN);
2787 } catch (ParseException e) {
2788 errorMessage = "unexpected token : '"+ e.currentToken.next.image +"', ')' expected to close the argument list";
2790 errorStart = SimpleCharStream.getPosition() - e.currentToken.next.image.length() + 1;
2791 errorEnd = SimpleCharStream.getPosition() + 1;
2792 {if (true) throw e;}
2794 {if (true) return new FunctionCall(func,args,SimpleCharStream.getPosition());}
2795 throw new Error("Missing return statement in function");
2797 trace_return("Arguments");
2802 * An argument list is a list of arguments separated by comma :
2803 * argumentDeclaration() (, argumentDeclaration)*
2804 * @return an array of arguments
2806 static final public Expression[] ArgumentList() throws ParseException {
2807 trace_call("ArgumentList");
2810 final ArrayList list = new ArrayList();
2815 switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
2820 jj_la1[70] = jj_gen;
2823 jj_consume_token(COMMA);
2827 } catch (ParseException e) {
2828 errorMessage = "unexpected token : '"+ e.currentToken.next.image +"'. An expression expected after a comma in argument list";
2830 errorStart = SimpleCharStream.getPosition() - e.currentToken.next.image.length() + 1;
2831 errorEnd = SimpleCharStream.getPosition() + 1;
2832 {if (true) throw e;}
2835 final Expression[] arguments = new Expression[list.size()];
2836 list.toArray(arguments);
2837 {if (true) return arguments;}
2838 throw new Error("Missing return statement in function");
2840 trace_return("ArgumentList");
2845 * A Statement without break.
2846 * @return a statement
2848 static final public Statement StatementNoBreak() throws ParseException {
2849 trace_call("StatementNoBreak");
2851 final Statement statement;
2854 statement = expressionStatement();
2855 {if (true) return statement;}
2857 switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
2859 statement = LabeledStatement();
2860 {if (true) return statement;}
2863 statement = Block();
2864 {if (true) return statement;}
2867 statement = EmptyStatement();
2868 {if (true) return statement;}
2871 statement = SwitchStatement();
2872 {if (true) return statement;}
2875 statement = IfStatement();
2876 {if (true) return statement;}
2879 statement = WhileStatement();
2880 {if (true) return statement;}
2883 statement = DoStatement();
2884 {if (true) return statement;}
2887 statement = ForStatement();
2888 {if (true) return statement;}
2891 statement = ForeachStatement();
2892 {if (true) return statement;}
2895 statement = ContinueStatement();
2896 {if (true) return statement;}
2899 statement = ReturnStatement();
2900 {if (true) return statement;}
2903 statement = EchoStatement();
2904 {if (true) return statement;}
2911 switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
2913 token = jj_consume_token(AT);
2916 jj_la1[71] = jj_gen;
2919 statement = IncludeStatement();
2920 if (token != null) {
2921 ((InclusionStatement)statement).silent = true;
2923 {if (true) return statement;}
2926 statement = StaticStatement();
2927 {if (true) return statement;}
2930 statement = GlobalStatement();
2931 {if (true) return statement;}
2934 statement = defineStatement();
2935 currentSegment.add((Outlineable)statement);{if (true) return statement;}
2938 jj_la1[72] = jj_gen;
2939 jj_consume_token(-1);
2940 throw new ParseException();
2943 throw new Error("Missing return statement in function");
2945 trace_return("StatementNoBreak");
2950 * A statement expression.
2952 * @return an expression
2954 static final public Statement expressionStatement() throws ParseException {
2955 trace_call("expressionStatement");
2957 final Statement statement;
2958 statement = Expression();
2960 jj_consume_token(SEMICOLON);
2961 } catch (ParseException e) {
2962 if (e.currentToken.next.kind != PHPParserConstants.PHPEND) {
2963 errorMessage = "unexpected token : '"+ e.currentToken.next.image +"'. A ';' was expected";
2965 errorStart = SimpleCharStream.getPosition() - e.currentToken.next.image.length() + 1;
2966 errorEnd = SimpleCharStream.getPosition() + 1;
2967 {if (true) throw e;}
2970 {if (true) return statement;}
2971 throw new Error("Missing return statement in function");
2973 trace_return("expressionStatement");
2977 static final public Define defineStatement() throws ParseException {
2978 trace_call("defineStatement");
2980 final int start = SimpleCharStream.getPosition();
2981 Expression defineName,defineValue;
2982 jj_consume_token(DEFINE);
2984 jj_consume_token(LPAREN);
2985 } catch (ParseException e) {
2986 errorMessage = "unexpected token : '"+ e.currentToken.next.image +"', '(' expected";
2988 errorStart = SimpleCharStream.getPosition() - e.currentToken.next.image.length() + 1;
2989 errorEnd = SimpleCharStream.getPosition() + 1;
2990 processParseExceptionDebug(e);
2993 defineName = Expression();
2994 } catch (ParseException e) {
2995 errorMessage = "unexpected token : '"+ e.currentToken.next.image +"', expression expected";
2997 errorStart = SimpleCharStream.getPosition() - e.currentToken.next.image.length() + 1;
2998 errorEnd = SimpleCharStream.getPosition() + 1;
2999 {if (true) throw e;}
3002 jj_consume_token(COMMA);
3003 } catch (ParseException e) {
3004 errorMessage = "unexpected token : '"+ e.currentToken.next.image +"', ',' expected";
3006 errorStart = SimpleCharStream.getPosition() - e.currentToken.next.image.length() + 1;
3007 errorEnd = SimpleCharStream.getPosition() + 1;
3008 processParseExceptionDebug(e);
3011 defineValue = Expression();
3012 } catch (ParseException e) {
3013 errorMessage = "unexpected token : '"+ e.currentToken.next.image +"', expression expected";
3015 errorStart = SimpleCharStream.getPosition() - e.currentToken.next.image.length() + 1;
3016 errorEnd = SimpleCharStream.getPosition() + 1;
3017 {if (true) throw e;}
3020 jj_consume_token(RPAREN);
3021 } catch (ParseException e) {
3022 errorMessage = "unexpected token : '"+ e.currentToken.next.image +"', ')' expected";
3024 errorStart = SimpleCharStream.getPosition() - e.currentToken.next.image.length() + 1;
3025 errorEnd = SimpleCharStream.getPosition() + 1;
3026 processParseExceptionDebug(e);
3028 {if (true) return new Define(currentSegment,
3032 SimpleCharStream.getPosition());}
3033 throw new Error("Missing return statement in function");
3035 trace_return("defineStatement");
3040 * A Normal statement.
3042 static final public Statement Statement() throws ParseException {
3043 trace_call("Statement");
3045 final Statement statement;
3046 switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
3077 case INTEGER_LITERAL:
3078 case FLOATING_POINT_LITERAL:
3079 case STRING_LITERAL:
3085 statement = StatementNoBreak();
3086 {if (true) return statement;}
3089 statement = BreakStatement();
3090 {if (true) return statement;}
3093 jj_la1[73] = jj_gen;
3094 jj_consume_token(-1);
3095 throw new ParseException();
3097 throw new Error("Missing return statement in function");
3099 trace_return("Statement");
3104 * An html block inside a php syntax.
3106 static final public HTMLBlock htmlBlock() throws ParseException {
3107 trace_call("htmlBlock");
3109 final int startIndex = nodePtr;
3110 final AstNode[] blockNodes;
3112 jj_consume_token(PHPEND);
3115 switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
3120 jj_la1[74] = jj_gen;
3126 switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
3128 jj_consume_token(PHPSTARTLONG);
3131 jj_consume_token(PHPSTARTSHORT);
3134 jj_la1[75] = jj_gen;
3135 jj_consume_token(-1);
3136 throw new ParseException();
3138 } catch (ParseException e) {
3139 errorMessage = "unexpected end of file , '<?php' expected";
3141 errorStart = SimpleCharStream.getPosition();
3142 errorEnd = SimpleCharStream.getPosition();
3143 {if (true) throw e;}
3145 nbNodes = nodePtr - startIndex;
3146 blockNodes = new AstNode[nbNodes];
3147 System.arraycopy(nodes,startIndex,blockNodes,0,nbNodes);
3148 nodePtr = startIndex;
3149 {if (true) return new HTMLBlock(blockNodes);}
3150 throw new Error("Missing return statement in function");
3152 trace_return("htmlBlock");
3157 * An include statement. It's "include" an expression;
3159 static final public InclusionStatement IncludeStatement() throws ParseException {
3160 trace_call("IncludeStatement");
3162 final Expression expr;
3164 final int pos = SimpleCharStream.getPosition();
3165 final InclusionStatement inclusionStatement;
3166 switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
3168 jj_consume_token(REQUIRE);
3169 keyword = InclusionStatement.REQUIRE;
3172 jj_consume_token(REQUIRE_ONCE);
3173 keyword = InclusionStatement.REQUIRE_ONCE;
3176 jj_consume_token(INCLUDE);
3177 keyword = InclusionStatement.INCLUDE;
3180 jj_consume_token(INCLUDE_ONCE);
3181 keyword = InclusionStatement.INCLUDE_ONCE;
3184 jj_la1[76] = jj_gen;
3185 jj_consume_token(-1);
3186 throw new ParseException();
3189 expr = Expression();
3190 } catch (ParseException e) {
3191 if (errorMessage != null) {
3192 {if (true) throw e;}
3194 errorMessage = "unexpected token '"+ e.currentToken.next.image+"', expression expected";
3196 errorStart = SimpleCharStream.getPosition() - e.currentToken.next.image.length() + 1;
3197 errorEnd = SimpleCharStream.getPosition() + 1;
3198 {if (true) throw e;}
3200 inclusionStatement = new InclusionStatement(currentSegment,
3204 currentSegment.add(inclusionStatement);
3206 jj_consume_token(SEMICOLON);
3207 } catch (ParseException e) {
3208 errorMessage = "unexpected token : '"+ e.currentToken.next.image +"'. A ';' was expected";
3210 errorStart = SimpleCharStream.getPosition() - e.currentToken.next.image.length() + 1;
3211 errorEnd = SimpleCharStream.getPosition() + 1;
3212 {if (true) throw e;}
3214 {if (true) return inclusionStatement;}
3215 throw new Error("Missing return statement in function");
3217 trace_return("IncludeStatement");
3221 static final public PrintExpression PrintExpression() throws ParseException {
3222 trace_call("PrintExpression");
3224 final Expression expr;
3225 final int pos = SimpleCharStream.getPosition();
3226 jj_consume_token(PRINT);
3227 expr = Expression();
3228 {if (true) return new PrintExpression(expr,pos,SimpleCharStream.getPosition());}
3229 throw new Error("Missing return statement in function");
3231 trace_return("PrintExpression");
3235 static final public ListExpression ListExpression() throws ParseException {
3236 trace_call("ListExpression");
3238 Expression expr = null;
3239 final Expression expression;
3240 final ArrayList list = new ArrayList();
3241 final int pos = SimpleCharStream.getPosition();
3242 jj_consume_token(LIST);
3244 jj_consume_token(LPAREN);
3245 } catch (ParseException e) {
3246 errorMessage = "unexpected token : '"+ e.currentToken.next.image +"', '(' expected";
3248 errorStart = SimpleCharStream.getPosition() - e.currentToken.next.image.length() + 1;
3249 errorEnd = SimpleCharStream.getPosition() + 1;
3250 {if (true) throw e;}
3252 switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
3255 expr = VariableDeclaratorId();
3259 jj_la1[77] = jj_gen;
3262 if (expr == null) list.add(null);
3265 switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
3270 jj_la1[78] = jj_gen;
3274 jj_consume_token(COMMA);
3275 } catch (ParseException e) {
3276 errorMessage = "unexpected token : '"+ e.currentToken.next.image +"', ',' expected";
3278 errorStart = SimpleCharStream.getPosition() - e.currentToken.next.image.length() + 1;
3279 errorEnd = SimpleCharStream.getPosition() + 1;
3280 {if (true) throw e;}
3282 switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
3285 expr = VariableDeclaratorId();
3289 jj_la1[79] = jj_gen;
3294 jj_consume_token(RPAREN);
3295 } catch (ParseException e) {
3296 errorMessage = "unexpected token : '"+ e.currentToken.next.image +"', ')' expected";
3298 errorStart = SimpleCharStream.getPosition() - e.currentToken.next.image.length() + 1;
3299 errorEnd = SimpleCharStream.getPosition() + 1;
3300 {if (true) throw e;}
3302 switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
3304 jj_consume_token(ASSIGN);
3305 expression = Expression();
3306 final Variable[] vars = new Variable[list.size()];
3308 {if (true) return new ListExpression(vars,
3311 SimpleCharStream.getPosition());}
3314 jj_la1[80] = jj_gen;
3317 final Variable[] vars = new Variable[list.size()];
3319 {if (true) return new ListExpression(vars,pos,SimpleCharStream.getPosition());}
3320 throw new Error("Missing return statement in function");
3322 trace_return("ListExpression");
3327 * An echo statement.
3328 * echo anyexpression (, otherexpression)*
3330 static final public EchoStatement EchoStatement() throws ParseException {
3331 trace_call("EchoStatement");
3333 final ArrayList expressions = new ArrayList();
3335 final int pos = SimpleCharStream.getPosition();
3336 jj_consume_token(ECHO);
3337 expr = Expression();
3338 expressions.add(expr);
3341 switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
3346 jj_la1[81] = jj_gen;
3349 jj_consume_token(COMMA);
3350 expr = Expression();
3351 expressions.add(expr);
3354 jj_consume_token(SEMICOLON);
3355 } catch (ParseException e) {
3356 if (e.currentToken.next.kind != 4) {
3357 errorMessage = "';' expected after 'echo' statement";
3359 errorStart = SimpleCharStream.getPosition() - e.currentToken.next.image.length() + 1;
3360 errorEnd = SimpleCharStream.getPosition() + 1;
3361 {if (true) throw e;}
3364 final Expression[] exprs = new Expression[expressions.size()];
3365 expressions.toArray(exprs);
3366 {if (true) return new EchoStatement(exprs,pos);}
3367 throw new Error("Missing return statement in function");
3369 trace_return("EchoStatement");
3373 static final public GlobalStatement GlobalStatement() throws ParseException {
3374 trace_call("GlobalStatement");
3376 final int pos = SimpleCharStream.getPosition();
3378 final ArrayList vars = new ArrayList();
3379 final GlobalStatement global;
3380 jj_consume_token(GLOBAL);
3385 switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
3390 jj_la1[82] = jj_gen;
3393 jj_consume_token(COMMA);
3398 jj_consume_token(SEMICOLON);
3399 final Variable[] variables = new Variable[vars.size()];
3400 vars.toArray(variables);
3401 global = new GlobalStatement(currentSegment,
3404 SimpleCharStream.getPosition());
3405 currentSegment.add(global);
3406 {if (true) return global;}
3407 } catch (ParseException e) {
3408 errorMessage = "unexpected token : '"+ e.currentToken.next.image +"'. a ';' was expected";
3410 errorStart = SimpleCharStream.getPosition() - e.currentToken.next.image.length() + 1;
3411 errorEnd = SimpleCharStream.getPosition() + 1;
3412 {if (true) throw e;}
3414 throw new Error("Missing return statement in function");
3416 trace_return("GlobalStatement");
3420 static final public StaticStatement StaticStatement() throws ParseException {
3421 trace_call("StaticStatement");
3423 final int pos = SimpleCharStream.getPosition();
3424 final ArrayList vars = new ArrayList();
3425 VariableDeclaration expr;
3426 jj_consume_token(STATIC);
3427 expr = VariableDeclarator();
3431 switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
3436 jj_la1[83] = jj_gen;
3439 jj_consume_token(COMMA);
3440 expr = VariableDeclarator();
3444 jj_consume_token(SEMICOLON);
3445 final VariableDeclaration[] variables = new VariableDeclaration[vars.size()];
3446 vars.toArray(variables);
3447 {if (true) return new StaticStatement(variables,
3449 SimpleCharStream.getPosition());}
3450 } catch (ParseException e) {
3451 errorMessage = "unexpected token : '"+ e.currentToken.next.image +"'. a ';' was expected";
3453 errorStart = SimpleCharStream.getPosition() - e.currentToken.next.image.length() + 1;
3454 errorEnd = SimpleCharStream.getPosition() + 1;
3455 {if (true) throw e;}
3457 throw new Error("Missing return statement in function");
3459 trace_return("StaticStatement");
3463 static final public LabeledStatement LabeledStatement() throws ParseException {
3464 trace_call("LabeledStatement");
3466 final int pos = SimpleCharStream.getPosition();
3468 final Statement statement;
3469 label = jj_consume_token(IDENTIFIER);
3470 jj_consume_token(COLON);
3471 statement = Statement();
3472 {if (true) return new LabeledStatement(label.image.toCharArray(),statement,pos,SimpleCharStream.getPosition());}
3473 throw new Error("Missing return statement in function");
3475 trace_return("LabeledStatement");
3486 static final public Block Block() throws ParseException {
3487 trace_call("Block");
3489 final int pos = SimpleCharStream.getPosition();
3490 final ArrayList list = new ArrayList();
3491 Statement statement;
3493 jj_consume_token(LBRACE);
3494 } catch (ParseException e) {
3495 errorMessage = "'{' expected";
3497 errorStart = SimpleCharStream.getPosition() - e.currentToken.next.image.length() + 1;
3498 errorEnd = SimpleCharStream.getPosition() + 1;
3499 {if (true) throw e;}
3503 switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
3538 case INTEGER_LITERAL:
3539 case FLOATING_POINT_LITERAL:
3540 case STRING_LITERAL:
3549 jj_la1[84] = jj_gen;
3552 switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
3586 case INTEGER_LITERAL:
3587 case FLOATING_POINT_LITERAL:
3588 case STRING_LITERAL:
3594 statement = BlockStatement();
3595 list.add(statement);
3598 statement = htmlBlock();
3599 list.add(statement);
3602 jj_la1[85] = jj_gen;
3603 jj_consume_token(-1);
3604 throw new ParseException();
3608 jj_consume_token(RBRACE);
3609 } catch (ParseException e) {
3610 errorMessage = "unexpected token : '"+ e.currentToken.image +"', '}' expected";
3612 errorStart = SimpleCharStream.getPosition() - e.currentToken.next.image.length() + 1;
3613 errorEnd = SimpleCharStream.getPosition() + 1;
3614 {if (true) throw e;}
3616 final Statement[] statements = new Statement[list.size()];
3617 list.toArray(statements);
3618 {if (true) return new Block(statements,pos,SimpleCharStream.getPosition());}
3619 throw new Error("Missing return statement in function");
3621 trace_return("Block");
3625 static final public Statement BlockStatement() throws ParseException {
3626 trace_call("BlockStatement");
3628 final Statement statement;
3629 switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
3661 case INTEGER_LITERAL:
3662 case FLOATING_POINT_LITERAL:
3663 case STRING_LITERAL:
3669 statement = Statement();
3670 if (phpDocument == currentSegment) pushOnAstNodes(statement);
3671 {if (true) return statement;}
3674 statement = ClassDeclaration();
3675 {if (true) return statement;}
3678 statement = MethodDeclaration();
3679 if (phpDocument == currentSegment) pushOnAstNodes(statement);
3680 currentSegment.add((MethodDeclaration) statement);
3681 ((MethodDeclaration) statement).analyzeCode();
3682 {if (true) return statement;}
3685 jj_la1[86] = jj_gen;
3686 jj_consume_token(-1);
3687 throw new ParseException();
3689 throw new Error("Missing return statement in function");
3691 trace_return("BlockStatement");
3696 * A Block statement that will not contain any 'break'
3698 static final public Statement BlockStatementNoBreak() throws ParseException {
3699 trace_call("BlockStatementNoBreak");
3701 final Statement statement;
3702 switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
3733 case INTEGER_LITERAL:
3734 case FLOATING_POINT_LITERAL:
3735 case STRING_LITERAL:
3741 statement = StatementNoBreak();
3742 {if (true) return statement;}
3745 statement = ClassDeclaration();
3746 {if (true) return statement;}
3749 statement = MethodDeclaration();
3750 currentSegment.add((MethodDeclaration) statement);
3751 ((MethodDeclaration) statement).analyzeCode();
3752 {if (true) return statement;}
3755 jj_la1[87] = jj_gen;
3756 jj_consume_token(-1);
3757 throw new ParseException();
3759 throw new Error("Missing return statement in function");
3761 trace_return("BlockStatementNoBreak");
3766 * used only by ForInit()
3768 static final public VariableDeclaration[] LocalVariableDeclaration() throws ParseException {
3769 trace_call("LocalVariableDeclaration");
3771 final ArrayList list = new ArrayList();
3772 VariableDeclaration var;
3773 var = LocalVariableDeclarator();
3777 switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
3782 jj_la1[88] = jj_gen;
3785 jj_consume_token(COMMA);
3786 var = LocalVariableDeclarator();
3789 final VariableDeclaration[] vars = new VariableDeclaration[list.size()];
3791 {if (true) return vars;}
3792 throw new Error("Missing return statement in function");
3794 trace_return("LocalVariableDeclaration");
3799 * used only by LocalVariableDeclaration().
3801 static final public VariableDeclaration LocalVariableDeclarator() throws ParseException {
3802 trace_call("LocalVariableDeclarator");
3804 final Variable varName;
3805 Expression initializer = null;
3806 final int pos = SimpleCharStream.getPosition();
3807 varName = Variable();
3808 switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
3810 jj_consume_token(ASSIGN);
3811 initializer = Expression();
3814 jj_la1[89] = jj_gen;
3817 if (initializer == null) {
3818 {if (true) return new VariableDeclaration(currentSegment,
3821 SimpleCharStream.getPosition());}
3823 {if (true) return new VariableDeclaration(currentSegment,
3826 VariableDeclaration.EQUAL,
3828 throw new Error("Missing return statement in function");
3830 trace_return("LocalVariableDeclarator");
3834 static final public EmptyStatement EmptyStatement() throws ParseException {
3835 trace_call("EmptyStatement");
3838 jj_consume_token(SEMICOLON);
3839 pos = SimpleCharStream.getPosition();
3840 {if (true) return new EmptyStatement(pos-1,pos);}
3841 throw new Error("Missing return statement in function");
3843 trace_return("EmptyStatement");
3848 * used only by StatementExpressionList() which is used only by ForInit() and ForStatement()
3850 static final public Expression StatementExpression() throws ParseException {
3851 trace_call("StatementExpression");
3853 final Expression expr,expr2;
3855 switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
3858 expr = PreIncDecExpression();
3859 {if (true) return expr;}
3866 expr = PrimaryExpression();
3867 switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
3870 switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
3872 jj_consume_token(PLUS_PLUS);
3873 {if (true) return new PostfixedUnaryExpression(expr,
3874 OperatorIds.PLUS_PLUS,
3875 SimpleCharStream.getPosition());}
3878 jj_consume_token(MINUS_MINUS);
3879 {if (true) return new PostfixedUnaryExpression(expr,
3880 OperatorIds.MINUS_MINUS,
3881 SimpleCharStream.getPosition());}
3884 jj_la1[90] = jj_gen;
3885 jj_consume_token(-1);
3886 throw new ParseException();
3890 jj_la1[91] = jj_gen;
3893 {if (true) return expr;}
3896 jj_la1[92] = jj_gen;
3897 jj_consume_token(-1);
3898 throw new ParseException();
3900 throw new Error("Missing return statement in function");
3902 trace_return("StatementExpression");
3906 static final public SwitchStatement SwitchStatement() throws ParseException {
3907 trace_call("SwitchStatement");
3909 final Expression variable;
3910 final AbstractCase[] cases;
3911 final int pos = SimpleCharStream.getPosition();
3912 jj_consume_token(SWITCH);
3914 jj_consume_token(LPAREN);
3915 } catch (ParseException e) {
3916 errorMessage = "'(' expected after 'switch'";
3918 errorStart = SimpleCharStream.getPosition() - e.currentToken.next.image.length() + 1;
3919 errorEnd = SimpleCharStream.getPosition() + 1;
3920 {if (true) throw e;}
3923 variable = Expression();
3924 } catch (ParseException e) {
3925 if (errorMessage != null) {
3926 {if (true) throw e;}
3928 errorMessage = "expression expected";
3930 errorStart = SimpleCharStream.getPosition() - e.currentToken.next.image.length() + 1;
3931 errorEnd = SimpleCharStream.getPosition() + 1;
3932 {if (true) throw e;}
3935 jj_consume_token(RPAREN);
3936 } catch (ParseException e) {
3937 errorMessage = "')' expected";
3939 errorStart = SimpleCharStream.getPosition() - e.currentToken.next.image.length() + 1;
3940 errorEnd = SimpleCharStream.getPosition() + 1;
3941 {if (true) throw e;}
3943 switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
3945 cases = switchStatementBrace();
3948 cases = switchStatementColon(pos, pos + 6);
3951 jj_la1[93] = jj_gen;
3952 jj_consume_token(-1);
3953 throw new ParseException();
3955 {if (true) return new SwitchStatement(variable,cases,pos,SimpleCharStream.getPosition());}
3956 throw new Error("Missing return statement in function");
3958 trace_return("SwitchStatement");
3962 static final public AbstractCase[] switchStatementBrace() throws ParseException {
3963 trace_call("switchStatementBrace");
3966 final ArrayList cases = new ArrayList();
3967 jj_consume_token(LBRACE);
3970 switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
3976 jj_la1[94] = jj_gen;
3979 cas = switchLabel0();
3983 jj_consume_token(RBRACE);
3984 final AbstractCase[] abcase = new AbstractCase[cases.size()];
3985 cases.toArray(abcase);
3986 {if (true) return abcase;}
3987 } catch (ParseException e) {
3988 errorMessage = "'}' expected";
3990 errorStart = SimpleCharStream.getPosition() - e.currentToken.next.image.length() + 1;
3991 errorEnd = SimpleCharStream.getPosition() + 1;
3992 {if (true) throw e;}
3994 throw new Error("Missing return statement in function");
3996 trace_return("switchStatementBrace");
4001 * A Switch statement with : ... endswitch;
4002 * @param start the begin offset of the switch
4003 * @param end the end offset of the switch
4005 static final public AbstractCase[] switchStatementColon(final int start, final int end) throws ParseException {
4006 trace_call("switchStatementColon");
4009 final ArrayList cases = new ArrayList();
4010 jj_consume_token(COLON);
4012 setMarker(fileToParse,
4013 "Ugly syntax detected, you should switch () {...} instead of switch (): ... enswitch;",
4017 "Line " + token.beginLine);
4018 } catch (CoreException e) {
4019 PHPeclipsePlugin.log(e);
4023 switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
4029 jj_la1[95] = jj_gen;
4032 cas = switchLabel0();
4036 jj_consume_token(ENDSWITCH);
4037 } catch (ParseException e) {
4038 errorMessage = "'endswitch' expected";
4040 errorStart = SimpleCharStream.getPosition() - e.currentToken.next.image.length() + 1;
4041 errorEnd = SimpleCharStream.getPosition() + 1;
4042 {if (true) throw e;}
4045 jj_consume_token(SEMICOLON);
4046 final AbstractCase[] abcase = new AbstractCase[cases.size()];
4047 cases.toArray(abcase);
4048 {if (true) return abcase;}
4049 } catch (ParseException e) {
4050 errorMessage = "';' expected after 'endswitch' keyword";
4052 errorStart = SimpleCharStream.getPosition() - e.currentToken.next.image.length() + 1;
4053 errorEnd = SimpleCharStream.getPosition() + 1;
4054 {if (true) throw e;}
4056 throw new Error("Missing return statement in function");
4058 trace_return("switchStatementColon");
4062 static final public AbstractCase switchLabel0() throws ParseException {
4063 trace_call("switchLabel0");
4065 final Expression expr;
4066 Statement statement;
4067 final ArrayList stmts = new ArrayList();
4068 final int pos = SimpleCharStream.getPosition();
4069 expr = SwitchLabel();
4072 switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
4106 case INTEGER_LITERAL:
4107 case FLOATING_POINT_LITERAL:
4108 case STRING_LITERAL:
4117 jj_la1[96] = jj_gen;
4120 switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
4153 case INTEGER_LITERAL:
4154 case FLOATING_POINT_LITERAL:
4155 case STRING_LITERAL:
4161 statement = BlockStatementNoBreak();
4162 stmts.add(statement);
4165 statement = htmlBlock();
4166 stmts.add(statement);
4169 jj_la1[97] = jj_gen;
4170 jj_consume_token(-1);
4171 throw new ParseException();
4174 switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
4176 statement = BreakStatement();
4177 stmts.add(statement);
4180 jj_la1[98] = jj_gen;
4183 final Statement[] stmtsArray = new Statement[stmts.size()];
4184 stmts.toArray(stmtsArray);
4185 if (expr == null) {//it's a default
4186 {if (true) return new DefaultCase(stmtsArray,pos,SimpleCharStream.getPosition());}
4188 {if (true) return new Case(expr,stmtsArray,pos,SimpleCharStream.getPosition());}
4189 throw new Error("Missing return statement in function");
4191 trace_return("switchLabel0");
4197 * case Expression() :
4199 * @return the if it was a case and null if not
4201 static final public Expression SwitchLabel() throws ParseException {
4202 trace_call("SwitchLabel");
4204 final Expression expr;
4205 switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
4207 token = jj_consume_token(CASE);
4209 expr = Expression();
4210 } catch (ParseException e) {
4211 if (errorMessage != null) {if (true) throw e;}
4212 errorMessage = "expression expected after 'case' keyword";
4214 errorStart = SimpleCharStream.getPosition() - e.currentToken.next.image.length() + 1;
4215 errorEnd = SimpleCharStream.getPosition() + 1;
4216 {if (true) throw e;}
4219 jj_consume_token(COLON);
4220 {if (true) return expr;}
4221 } catch (ParseException e) {
4222 errorMessage = "':' expected after case expression";
4224 errorStart = SimpleCharStream.getPosition() - e.currentToken.next.image.length() + 1;
4225 errorEnd = SimpleCharStream.getPosition() + 1;
4226 {if (true) throw e;}
4230 token = jj_consume_token(_DEFAULT);
4232 jj_consume_token(COLON);
4233 {if (true) return null;}
4234 } catch (ParseException e) {
4235 errorMessage = "':' expected after 'default' keyword";
4237 errorStart = SimpleCharStream.getPosition() - e.currentToken.next.image.length() + 1;
4238 errorEnd = SimpleCharStream.getPosition() + 1;
4239 {if (true) throw e;}
4243 jj_la1[99] = jj_gen;
4244 jj_consume_token(-1);
4245 throw new ParseException();
4247 throw new Error("Missing return statement in function");
4249 trace_return("SwitchLabel");
4253 static final public Break BreakStatement() throws ParseException {
4254 trace_call("BreakStatement");
4256 Expression expression = null;
4257 final int start = SimpleCharStream.getPosition();
4258 jj_consume_token(BREAK);
4259 switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
4274 case INTEGER_LITERAL:
4275 case FLOATING_POINT_LITERAL:
4276 case STRING_LITERAL:
4280 expression = Expression();
4283 jj_la1[100] = jj_gen;
4287 jj_consume_token(SEMICOLON);
4288 } catch (ParseException e) {
4289 errorMessage = "';' expected after 'break' keyword";
4291 errorStart = SimpleCharStream.getPosition() - e.currentToken.next.image.length() + 1;
4292 errorEnd = SimpleCharStream.getPosition() + 1;
4293 {if (true) throw e;}
4295 {if (true) return new Break(expression, start, SimpleCharStream.getPosition());}
4296 throw new Error("Missing return statement in function");
4298 trace_return("BreakStatement");
4302 static final public IfStatement IfStatement() throws ParseException {
4303 trace_call("IfStatement");
4305 final int pos = SimpleCharStream.getPosition();
4306 final Expression condition;
4307 final IfStatement ifStatement;
4308 jj_consume_token(IF);
4309 condition = Condition("if");
4310 ifStatement = IfStatement0(condition, pos,pos+2);
4311 {if (true) return ifStatement;}
4312 throw new Error("Missing return statement in function");
4314 trace_return("IfStatement");
4318 static final public Expression Condition(final String keyword) throws ParseException {
4319 trace_call("Condition");
4321 final Expression condition;
4323 jj_consume_token(LPAREN);
4324 } catch (ParseException e) {
4325 errorMessage = "'(' expected after " + keyword + " keyword";
4327 errorStart = SimpleCharStream.getPosition() - e.currentToken.next.image.length();
4328 errorEnd = errorStart +1;
4329 processParseExceptionDebug(e);
4331 condition = Expression();
4333 jj_consume_token(RPAREN);
4334 } catch (ParseException e) {
4335 errorMessage = "')' expected after " + keyword + " keyword";
4337 errorStart = SimpleCharStream.getPosition() - e.currentToken.next.image.length() + 1;
4338 errorEnd = SimpleCharStream.getPosition() + 1;
4339 processParseExceptionDebug(e);
4341 {if (true) return condition;}
4342 throw new Error("Missing return statement in function");
4344 trace_return("Condition");
4348 static final public IfStatement IfStatement0(final Expression condition, final int start,final int end) throws ParseException {
4349 trace_call("IfStatement0");
4351 Statement statement;
4352 final Statement stmt;
4353 final Statement[] statementsArray;
4354 ElseIf elseifStatement;
4355 Else elseStatement = null;
4356 final ArrayList stmts;
4357 final ArrayList elseIfList = new ArrayList();
4358 final ElseIf[] elseIfs;
4359 int pos = SimpleCharStream.getPosition();
4360 final int endStatements;
4361 switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
4363 jj_consume_token(COLON);
4364 stmts = new ArrayList();
4367 switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
4400 case INTEGER_LITERAL:
4401 case FLOATING_POINT_LITERAL:
4402 case STRING_LITERAL:
4411 jj_la1[101] = jj_gen;
4414 switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
4446 case INTEGER_LITERAL:
4447 case FLOATING_POINT_LITERAL:
4448 case STRING_LITERAL:
4454 statement = Statement();
4455 stmts.add(statement);
4458 statement = htmlBlock();
4459 stmts.add(statement);
4462 jj_la1[102] = jj_gen;
4463 jj_consume_token(-1);
4464 throw new ParseException();
4467 endStatements = SimpleCharStream.getPosition();
4470 switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
4475 jj_la1[103] = jj_gen;
4478 elseifStatement = ElseIfStatementColon();
4479 elseIfList.add(elseifStatement);
4481 switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
4483 elseStatement = ElseStatementColon();
4486 jj_la1[104] = jj_gen;
4490 setMarker(fileToParse,
4491 "Ugly syntax detected, you should if () {...} instead of if (): ... endif;",
4495 "Line " + token.beginLine);
4496 } catch (CoreException e) {
4497 PHPeclipsePlugin.log(e);
4500 jj_consume_token(ENDIF);
4501 } catch (ParseException e) {
4502 errorMessage = "'endif' expected";
4504 errorStart = SimpleCharStream.getPosition() - e.currentToken.next.image.length() + 1;
4505 errorEnd = SimpleCharStream.getPosition() + 1;
4506 {if (true) throw e;}
4509 jj_consume_token(SEMICOLON);
4510 } catch (ParseException e) {
4511 errorMessage = "';' expected after 'endif' keyword";
4513 errorStart = SimpleCharStream.getPosition() - e.currentToken.next.image.length() + 1;
4514 errorEnd = SimpleCharStream.getPosition() + 1;
4515 {if (true) throw e;}
4517 elseIfs = new ElseIf[elseIfList.size()];
4518 elseIfList.toArray(elseIfs);
4519 if (stmts.size() == 1) {
4520 {if (true) return new IfStatement(condition,
4521 (Statement) stmts.get(0),
4525 SimpleCharStream.getPosition());}
4527 statementsArray = new Statement[stmts.size()];
4528 stmts.toArray(statementsArray);
4529 {if (true) return new IfStatement(condition,
4530 new Block(statementsArray,pos,endStatements),
4534 SimpleCharStream.getPosition());}
4569 case INTEGER_LITERAL:
4570 case FLOATING_POINT_LITERAL:
4571 case STRING_LITERAL:
4577 switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
4609 case INTEGER_LITERAL:
4610 case FLOATING_POINT_LITERAL:
4611 case STRING_LITERAL:
4623 jj_la1[105] = jj_gen;
4624 jj_consume_token(-1);
4625 throw new ParseException();
4629 switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
4634 jj_la1[106] = jj_gen;
4637 elseifStatement = ElseIfStatement();
4638 elseIfList.add(elseifStatement);
4640 switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
4642 jj_consume_token(ELSE);
4644 pos = SimpleCharStream.getPosition();
4645 statement = Statement();
4646 elseStatement = new Else(statement,pos,SimpleCharStream.getPosition());
4647 } catch (ParseException e) {
4648 if (errorMessage != null) {
4649 {if (true) throw e;}
4651 errorMessage = "unexpected token '"+e.currentToken.next.image+"', a statement was expected";
4653 errorStart = SimpleCharStream.getPosition() - e.currentToken.next.image.length() + 1;
4654 errorEnd = SimpleCharStream.getPosition() + 1;
4655 {if (true) throw e;}
4659 jj_la1[107] = jj_gen;
4662 elseIfs = new ElseIf[elseIfList.size()];
4663 elseIfList.toArray(elseIfs);
4664 {if (true) return new IfStatement(condition,
4669 SimpleCharStream.getPosition());}
4672 jj_la1[108] = jj_gen;
4673 jj_consume_token(-1);
4674 throw new ParseException();
4676 throw new Error("Missing return statement in function");
4678 trace_return("IfStatement0");
4682 static final public ElseIf ElseIfStatementColon() throws ParseException {
4683 trace_call("ElseIfStatementColon");
4685 final Expression condition;
4686 Statement statement;
4687 final ArrayList list = new ArrayList();
4688 final int pos = SimpleCharStream.getPosition();
4689 jj_consume_token(ELSEIF);
4690 condition = Condition("elseif");
4691 jj_consume_token(COLON);
4694 switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
4727 case INTEGER_LITERAL:
4728 case FLOATING_POINT_LITERAL:
4729 case STRING_LITERAL:
4738 jj_la1[109] = jj_gen;
4741 switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
4773 case INTEGER_LITERAL:
4774 case FLOATING_POINT_LITERAL:
4775 case STRING_LITERAL:
4781 statement = Statement();
4782 list.add(statement);
4785 statement = htmlBlock();
4786 list.add(statement);
4789 jj_la1[110] = jj_gen;
4790 jj_consume_token(-1);
4791 throw new ParseException();
4794 final Statement[] stmtsArray = new Statement[list.size()];
4795 list.toArray(stmtsArray);
4796 {if (true) return new ElseIf(condition,stmtsArray ,pos,SimpleCharStream.getPosition());}
4797 throw new Error("Missing return statement in function");
4799 trace_return("ElseIfStatementColon");
4803 static final public Else ElseStatementColon() throws ParseException {
4804 trace_call("ElseStatementColon");
4806 Statement statement;
4807 final ArrayList list = new ArrayList();
4808 final int pos = SimpleCharStream.getPosition();
4809 jj_consume_token(ELSE);
4810 jj_consume_token(COLON);
4813 switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
4846 case INTEGER_LITERAL:
4847 case FLOATING_POINT_LITERAL:
4848 case STRING_LITERAL:
4857 jj_la1[111] = jj_gen;
4860 switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
4892 case INTEGER_LITERAL:
4893 case FLOATING_POINT_LITERAL:
4894 case STRING_LITERAL:
4900 statement = Statement();
4901 list.add(statement);
4904 statement = htmlBlock();
4905 list.add(statement);
4908 jj_la1[112] = jj_gen;
4909 jj_consume_token(-1);
4910 throw new ParseException();
4913 final Statement[] stmtsArray = new Statement[list.size()];
4914 list.toArray(stmtsArray);
4915 {if (true) return new Else(stmtsArray,pos,SimpleCharStream.getPosition());}
4916 throw new Error("Missing return statement in function");
4918 trace_return("ElseStatementColon");
4922 static final public ElseIf ElseIfStatement() throws ParseException {
4923 trace_call("ElseIfStatement");
4925 final Expression condition;
4926 final Statement statement;
4927 final ArrayList list = new ArrayList();
4928 final int pos = SimpleCharStream.getPosition();
4929 jj_consume_token(ELSEIF);
4930 condition = Condition("elseif");
4931 statement = Statement();
4932 list.add(statement);/*todo:do better*/
4933 final Statement[] stmtsArray = new Statement[list.size()];
4934 list.toArray(stmtsArray);
4935 {if (true) return new ElseIf(condition,stmtsArray,pos,SimpleCharStream.getPosition());}
4936 throw new Error("Missing return statement in function");
4938 trace_return("ElseIfStatement");
4942 static final public WhileStatement WhileStatement() throws ParseException {
4943 trace_call("WhileStatement");
4945 final Expression condition;
4946 final Statement action;
4947 final int pos = SimpleCharStream.getPosition();
4948 jj_consume_token(WHILE);
4949 condition = Condition("while");
4950 action = WhileStatement0(pos,pos + 5);
4951 {if (true) return new WhileStatement(condition,action,pos,SimpleCharStream.getPosition());}
4952 throw new Error("Missing return statement in function");
4954 trace_return("WhileStatement");
4958 static final public Statement WhileStatement0(final int start, final int end) throws ParseException {
4959 trace_call("WhileStatement0");
4961 Statement statement;
4962 final ArrayList stmts = new ArrayList();
4963 final int pos = SimpleCharStream.getPosition();
4964 switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
4966 jj_consume_token(COLON);
4969 switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
5001 case INTEGER_LITERAL:
5002 case FLOATING_POINT_LITERAL:
5003 case STRING_LITERAL:
5012 jj_la1[113] = jj_gen;
5015 statement = Statement();
5016 stmts.add(statement);
5019 setMarker(fileToParse,
5020 "Ugly syntax detected, you should while () {...} instead of while (): ... endwhile;",
5024 "Line " + token.beginLine);
5025 } catch (CoreException e) {
5026 PHPeclipsePlugin.log(e);
5029 jj_consume_token(ENDWHILE);
5030 } catch (ParseException e) {
5031 errorMessage = "'endwhile' expected";
5033 errorStart = SimpleCharStream.getPosition() - e.currentToken.next.image.length() + 1;
5034 errorEnd = SimpleCharStream.getPosition() + 1;
5035 {if (true) throw e;}
5038 jj_consume_token(SEMICOLON);
5039 final Statement[] stmtsArray = new Statement[stmts.size()];
5040 stmts.toArray(stmtsArray);
5041 {if (true) return new Block(stmtsArray,pos,SimpleCharStream.getPosition());}
5042 } catch (ParseException e) {
5043 errorMessage = "';' expected after 'endwhile' keyword";
5045 errorStart = SimpleCharStream.getPosition() - e.currentToken.next.image.length() + 1;
5046 errorEnd = SimpleCharStream.getPosition() + 1;
5047 {if (true) throw e;}
5081 case INTEGER_LITERAL:
5082 case FLOATING_POINT_LITERAL:
5083 case STRING_LITERAL:
5089 statement = Statement();
5090 {if (true) return statement;}
5093 jj_la1[114] = jj_gen;
5094 jj_consume_token(-1);
5095 throw new ParseException();
5097 throw new Error("Missing return statement in function");
5099 trace_return("WhileStatement0");
5103 static final public DoStatement DoStatement() throws ParseException {
5104 trace_call("DoStatement");
5106 final Statement action;
5107 final Expression condition;
5108 final int pos = SimpleCharStream.getPosition();
5109 jj_consume_token(DO);
5110 action = Statement();
5111 jj_consume_token(WHILE);
5112 condition = Condition("while");
5114 jj_consume_token(SEMICOLON);
5115 {if (true) return new DoStatement(condition,action,pos,SimpleCharStream.getPosition());}
5116 } catch (ParseException e) {
5117 errorMessage = "unexpected token : '"+ e.currentToken.next.image +"'. A ';' was expected";
5119 errorStart = SimpleCharStream.getPosition() - e.currentToken.next.image.length() + 1;
5120 errorEnd = SimpleCharStream.getPosition() + 1;
5121 {if (true) throw e;}
5123 throw new Error("Missing return statement in function");
5125 trace_return("DoStatement");
5129 static final public ForeachStatement ForeachStatement() throws ParseException {
5130 trace_call("ForeachStatement");
5132 Statement statement;
5133 Expression expression;
5134 final int pos = SimpleCharStream.getPosition();
5135 ArrayVariableDeclaration variable;
5136 jj_consume_token(FOREACH);
5138 jj_consume_token(LPAREN);
5139 } catch (ParseException e) {
5140 errorMessage = "'(' expected after 'foreach' keyword";
5142 errorStart = SimpleCharStream.getPosition() - e.currentToken.next.image.length() + 1;
5143 errorEnd = SimpleCharStream.getPosition() + 1;
5144 {if (true) throw e;}
5147 expression = Expression();
5148 } catch (ParseException e) {
5149 errorMessage = "variable expected";
5151 errorStart = SimpleCharStream.getPosition() - e.currentToken.next.image.length() + 1;
5152 errorEnd = SimpleCharStream.getPosition() + 1;
5153 {if (true) throw e;}
5156 jj_consume_token(AS);
5157 } catch (ParseException e) {
5158 errorMessage = "'as' expected";
5160 errorStart = SimpleCharStream.getPosition() - e.currentToken.next.image.length() + 1;
5161 errorEnd = SimpleCharStream.getPosition() + 1;
5162 {if (true) throw e;}
5165 variable = ArrayVariable();
5166 } catch (ParseException e) {
5167 errorMessage = "variable expected";
5169 errorStart = SimpleCharStream.getPosition() - e.currentToken.next.image.length() + 1;
5170 errorEnd = SimpleCharStream.getPosition() + 1;
5171 {if (true) throw e;}
5174 jj_consume_token(RPAREN);
5175 } catch (ParseException e) {
5176 errorMessage = "')' expected after 'foreach' keyword";
5178 errorStart = SimpleCharStream.getPosition() - e.currentToken.next.image.length() + 1;
5179 errorEnd = SimpleCharStream.getPosition() + 1;
5180 {if (true) throw e;}
5183 statement = Statement();
5184 } catch (ParseException e) {
5185 if (errorMessage != null) {if (true) throw e;}
5186 errorMessage = "statement expected";
5188 errorStart = SimpleCharStream.getPosition() - e.currentToken.next.image.length() + 1;
5189 errorEnd = SimpleCharStream.getPosition() + 1;
5190 {if (true) throw e;}
5192 {if (true) return new ForeachStatement(expression,
5196 SimpleCharStream.getPosition());}
5197 throw new Error("Missing return statement in function");
5199 trace_return("ForeachStatement");
5203 static final public ForStatement ForStatement() throws ParseException {
5204 trace_call("ForStatement");
5207 final int pos = SimpleCharStream.getPosition();
5208 Expression[] initializations = null;
5209 Expression condition = null;
5210 Expression[] increments = null;
5212 final ArrayList list = new ArrayList();
5213 final int startBlock, endBlock;
5214 token = jj_consume_token(FOR);
5216 jj_consume_token(LPAREN);
5217 } catch (ParseException e) {
5218 errorMessage = "'(' expected after 'for' keyword";
5220 errorStart = SimpleCharStream.getPosition() - e.currentToken.next.image.length() + 1;
5221 errorEnd = SimpleCharStream.getPosition() + 1;
5222 {if (true) throw e;}
5224 switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
5232 initializations = ForInit();
5235 jj_la1[115] = jj_gen;
5238 jj_consume_token(SEMICOLON);
5239 switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
5254 case INTEGER_LITERAL:
5255 case FLOATING_POINT_LITERAL:
5256 case STRING_LITERAL:
5260 condition = Expression();
5263 jj_la1[116] = jj_gen;
5266 jj_consume_token(SEMICOLON);
5267 switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
5275 increments = StatementExpressionList();
5278 jj_la1[117] = jj_gen;
5281 jj_consume_token(RPAREN);
5282 switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
5314 case INTEGER_LITERAL:
5315 case FLOATING_POINT_LITERAL:
5316 case STRING_LITERAL:
5322 action = Statement();
5323 {if (true) return new ForStatement(initializations,condition,increments,action,pos,SimpleCharStream.getPosition());}
5326 jj_consume_token(COLON);
5327 startBlock = SimpleCharStream.getPosition();
5330 switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
5362 case INTEGER_LITERAL:
5363 case FLOATING_POINT_LITERAL:
5364 case STRING_LITERAL:
5373 jj_la1[118] = jj_gen;
5376 action = Statement();
5380 setMarker(fileToParse,
5381 "Ugly syntax detected, you should for () {...} instead of for (): ... endfor;",
5383 pos+token.image.length(),
5385 "Line " + token.beginLine);
5386 } catch (CoreException e) {
5387 PHPeclipsePlugin.log(e);
5389 endBlock = SimpleCharStream.getPosition();
5391 jj_consume_token(ENDFOR);
5392 } catch (ParseException e) {
5393 errorMessage = "'endfor' expected";
5395 errorStart = SimpleCharStream.getPosition() - e.currentToken.next.image.length() + 1;
5396 errorEnd = SimpleCharStream.getPosition() + 1;
5397 {if (true) throw e;}
5400 jj_consume_token(SEMICOLON);
5401 final Statement[] stmtsArray = new Statement[list.size()];
5402 list.toArray(stmtsArray);
5403 {if (true) return new ForStatement(initializations,condition,increments,new Block(stmtsArray,startBlock,endBlock),pos,SimpleCharStream.getPosition());}
5404 } catch (ParseException e) {
5405 errorMessage = "';' expected after 'endfor' keyword";
5407 errorStart = SimpleCharStream.getPosition() - e.currentToken.next.image.length() + 1;
5408 errorEnd = SimpleCharStream.getPosition() + 1;
5409 {if (true) throw e;}
5413 jj_la1[119] = jj_gen;
5414 jj_consume_token(-1);
5415 throw new ParseException();
5417 throw new Error("Missing return statement in function");
5419 trace_return("ForStatement");
5423 static final public Expression[] ForInit() throws ParseException {
5424 trace_call("ForInit");
5426 final Expression[] exprs;
5427 if (jj_2_5(2147483647)) {
5428 exprs = LocalVariableDeclaration();
5429 {if (true) return exprs;}
5431 switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
5439 exprs = StatementExpressionList();
5440 {if (true) return exprs;}
5443 jj_la1[120] = jj_gen;
5444 jj_consume_token(-1);
5445 throw new ParseException();
5448 throw new Error("Missing return statement in function");
5450 trace_return("ForInit");
5454 static final public Expression[] StatementExpressionList() throws ParseException {
5455 trace_call("StatementExpressionList");
5457 final ArrayList list = new ArrayList();
5458 final Expression expr;
5459 expr = StatementExpression();
5463 switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
5468 jj_la1[121] = jj_gen;
5471 jj_consume_token(COMMA);
5472 StatementExpression();
5475 final Expression[] exprsArray = new Expression[list.size()];
5476 list.toArray(exprsArray);
5477 {if (true) return exprsArray;}
5478 throw new Error("Missing return statement in function");
5480 trace_return("StatementExpressionList");
5484 static final public Continue ContinueStatement() throws ParseException {
5485 trace_call("ContinueStatement");
5487 Expression expr = null;
5488 final int pos = SimpleCharStream.getPosition();
5489 jj_consume_token(CONTINUE);
5490 switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
5505 case INTEGER_LITERAL:
5506 case FLOATING_POINT_LITERAL:
5507 case STRING_LITERAL:
5511 expr = Expression();
5514 jj_la1[122] = jj_gen;
5518 jj_consume_token(SEMICOLON);
5519 {if (true) return new Continue(expr,pos,SimpleCharStream.getPosition());}
5520 } catch (ParseException e) {
5521 errorMessage = "';' expected after 'continue' statement";
5523 errorStart = SimpleCharStream.getPosition() - e.currentToken.next.image.length() + 1;
5524 errorEnd = SimpleCharStream.getPosition() + 1;
5525 {if (true) throw e;}
5527 throw new Error("Missing return statement in function");
5529 trace_return("ContinueStatement");
5533 static final public ReturnStatement ReturnStatement() throws ParseException {
5534 trace_call("ReturnStatement");
5536 Expression expr = null;
5537 final int pos = SimpleCharStream.getPosition();
5538 jj_consume_token(RETURN);
5539 switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
5554 case INTEGER_LITERAL:
5555 case FLOATING_POINT_LITERAL:
5556 case STRING_LITERAL:
5560 expr = Expression();
5563 jj_la1[123] = jj_gen;
5567 jj_consume_token(SEMICOLON);
5568 {if (true) return new ReturnStatement(expr,pos,SimpleCharStream.getPosition());}
5569 } catch (ParseException e) {
5570 errorMessage = "';' expected after 'return' statement";
5572 errorStart = SimpleCharStream.getPosition() - e.currentToken.next.image.length() + 1;
5573 errorEnd = SimpleCharStream.getPosition() + 1;
5574 {if (true) throw e;}
5576 throw new Error("Missing return statement in function");
5578 trace_return("ReturnStatement");
5582 static final private boolean jj_2_1(int xla) {
5583 jj_la = xla; jj_lastpos = jj_scanpos = token;
5584 boolean retval = !jj_3_1();
5589 static final private boolean jj_2_2(int xla) {
5590 jj_la = xla; jj_lastpos = jj_scanpos = token;
5591 boolean retval = !jj_3_2();
5596 static final private boolean jj_2_3(int xla) {
5597 jj_la = xla; jj_lastpos = jj_scanpos = token;
5598 boolean retval = !jj_3_3();
5603 static final private boolean jj_2_4(int xla) {
5604 jj_la = xla; jj_lastpos = jj_scanpos = token;
5605 boolean retval = !jj_3_4();
5610 static final private boolean jj_2_5(int xla) {
5611 jj_la = xla; jj_lastpos = jj_scanpos = token;
5612 boolean retval = !jj_3_5();
5617 static final private boolean jj_3R_132() {
5618 if (jj_3R_138()) return true;
5619 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
5623 if (jj_3R_139()) { jj_scanpos = xsp; break; }
5624 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
5629 static final private boolean jj_3_4() {
5630 if (jj_3R_43()) return true;
5631 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
5635 static final private boolean jj_3R_142() {
5636 if (jj_scan_token(RUNSIGNEDSHIFT)) return true;
5637 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
5641 static final private boolean jj_3R_141() {
5642 if (jj_scan_token(RSIGNEDSHIFT)) return true;
5643 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
5647 static final private boolean jj_3R_140() {
5648 if (jj_scan_token(LSHIFT)) return true;
5649 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
5653 static final private boolean jj_3_5() {
5654 if (jj_3R_44()) return true;
5655 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
5659 static final private boolean jj_3R_133() {
5666 if (jj_3R_142()) return true;
5667 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
5668 } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
5669 } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
5670 if (jj_3R_132()) return true;
5671 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
5675 static final private boolean jj_3R_125() {
5676 if (jj_3R_132()) return true;
5677 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
5681 if (jj_3R_133()) { jj_scanpos = xsp; break; }
5682 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
5687 static final private boolean jj_3R_201() {
5688 if (jj_scan_token(COMMA)) return true;
5689 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
5690 if (jj_3R_47()) return true;
5691 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
5695 static final private boolean jj_3R_137() {
5696 if (jj_scan_token(GE)) return true;
5697 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
5701 static final private boolean jj_3R_199() {
5702 if (jj_scan_token(COMMA)) return true;
5703 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
5707 static final private boolean jj_3R_136() {
5708 if (jj_scan_token(LE)) return true;
5709 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
5713 static final private boolean jj_3R_200() {
5714 if (jj_3R_47()) return true;
5715 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
5719 if (jj_3R_201()) { jj_scanpos = xsp; break; }
5720 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
5725 static final private boolean jj_3R_135() {
5726 if (jj_scan_token(GT)) return true;
5727 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
5731 static final private boolean jj_3R_134() {
5732 if (jj_scan_token(LT)) return true;
5733 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
5737 static final private boolean jj_3_2() {
5738 if (jj_scan_token(COMMA)) return true;
5739 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
5740 if (jj_3R_40()) return true;
5741 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
5745 static final private boolean jj_3R_126() {
5754 if (jj_3R_137()) return true;
5755 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
5756 } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
5757 } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
5758 } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
5759 if (jj_3R_125()) return true;
5760 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
5764 static final private boolean jj_3R_121() {
5765 if (jj_3R_125()) return true;
5766 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
5770 if (jj_3R_126()) { jj_scanpos = xsp; break; }
5771 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
5776 static final private boolean jj_3R_198() {
5777 if (jj_3R_40()) return true;
5778 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
5782 if (jj_3_2()) { jj_scanpos = xsp; break; }
5783 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
5788 static final private boolean jj_3R_196() {
5789 if (jj_scan_token(LPAREN)) return true;
5790 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
5793 if (jj_3R_198()) jj_scanpos = xsp;
5794 else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
5796 if (jj_3R_199()) jj_scanpos = xsp;
5797 else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
5798 if (jj_scan_token(RPAREN)) return true;
5799 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
5803 static final private boolean jj_3R_197() {
5804 if (jj_3R_200()) return true;
5805 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
5809 static final private boolean jj_3R_71() {
5810 if (jj_3R_48()) return true;
5811 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
5815 static final private boolean jj_3R_202() {
5816 if (jj_scan_token(ARRAYASSIGN)) return true;
5817 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
5818 if (jj_3R_47()) return true;
5819 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
5823 static final private boolean jj_3R_192() {
5824 if (jj_scan_token(LPAREN)) return true;
5825 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
5828 if (jj_3R_197()) jj_scanpos = xsp;
5829 else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
5830 if (jj_scan_token(RPAREN)) return true;
5831 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
5835 static final private boolean jj_3R_40() {
5836 if (jj_3R_47()) return true;
5837 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
5840 if (jj_3R_202()) jj_scanpos = xsp;
5841 else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
5845 static final private boolean jj_3R_131() {
5846 if (jj_scan_token(TRIPLEEQUAL)) return true;
5847 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
5851 static final private boolean jj_3R_130() {
5852 if (jj_scan_token(BANGDOUBLEEQUAL)) return true;
5853 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
5857 static final private boolean jj_3R_129() {
5858 if (jj_scan_token(NOT_EQUAL)) return true;
5859 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
5863 static final private boolean jj_3R_128() {
5864 if (jj_scan_token(DIF)) return true;
5865 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
5869 static final private boolean jj_3R_127() {
5870 if (jj_scan_token(EQUAL_EQUAL)) return true;
5871 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
5875 static final private boolean jj_3R_180() {
5876 if (jj_scan_token(NULL)) return true;
5877 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
5881 static final private boolean jj_3R_179() {
5882 if (jj_scan_token(FALSE)) return true;
5883 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
5887 static final private boolean jj_3R_122() {
5898 if (jj_3R_131()) return true;
5899 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
5900 } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
5901 } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
5902 } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
5903 } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
5904 if (jj_3R_121()) return true;
5905 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
5909 static final private boolean jj_3R_178() {
5910 if (jj_scan_token(TRUE)) return true;
5911 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
5915 static final private boolean jj_3R_116() {
5916 if (jj_3R_121()) return true;
5917 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
5921 if (jj_3R_122()) { jj_scanpos = xsp; break; }
5922 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
5927 static final private boolean jj_3R_177() {
5928 if (jj_scan_token(STRING_LITERAL)) return true;
5929 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
5933 static final private boolean jj_3R_176() {
5934 if (jj_scan_token(FLOATING_POINT_LITERAL)) return true;
5935 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
5939 static final private boolean jj_3R_170() {
5952 if (jj_3R_180()) return true;
5953 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
5954 } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
5955 } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
5956 } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
5957 } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
5958 } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
5962 static final private boolean jj_3R_175() {
5963 if (jj_scan_token(INTEGER_LITERAL)) return true;
5964 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
5968 static final private boolean jj_3R_117() {
5969 if (jj_scan_token(BIT_AND)) return true;
5970 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
5971 if (jj_3R_116()) return true;
5972 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
5976 static final private boolean jj_3R_70() {
5977 if (jj_3R_47()) return true;
5978 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
5982 static final private boolean jj_3R_52() {
5987 if (jj_3R_71()) return true;
5988 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
5989 } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
5993 static final private boolean jj_3R_114() {
5994 if (jj_3R_116()) return true;
5995 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
5999 if (jj_3R_117()) { jj_scanpos = xsp; break; }
6000 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
6005 static final private boolean jj_3R_115() {
6006 if (jj_scan_token(XOR)) return true;
6007 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
6008 if (jj_3R_114()) return true;
6009 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
6013 static final private boolean jj_3R_46() {
6014 if (jj_scan_token(LBRACKET)) return true;
6015 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
6018 if (jj_3R_52()) jj_scanpos = xsp;
6019 else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
6020 if (jj_scan_token(RBRACKET)) return true;
6021 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
6025 static final private boolean jj_3R_112() {
6026 if (jj_3R_114()) return true;
6027 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
6031 if (jj_3R_115()) { jj_scanpos = xsp; break; }
6032 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
6037 static final private boolean jj_3R_69() {
6038 if (jj_scan_token(DOLLAR_ID)) return true;
6039 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
6043 static final private boolean jj_3R_113() {
6044 if (jj_scan_token(BIT_OR)) return true;
6045 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
6046 if (jj_3R_112()) return true;
6047 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
6051 static final private boolean jj_3R_45() {
6052 if (jj_scan_token(CLASSACCESS)) return true;
6053 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
6054 if (jj_3R_51()) return true;
6055 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
6059 static final private boolean jj_3R_39() {
6064 if (jj_3R_46()) return true;
6065 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
6066 } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
6070 static final private boolean jj_3R_106() {
6071 if (jj_3R_112()) return true;
6072 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
6076 if (jj_3R_113()) { jj_scanpos = xsp; break; }
6077 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
6082 static final private boolean jj_3R_68() {
6083 if (jj_scan_token(DOLLAR)) return true;
6084 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
6085 if (jj_3R_51()) return true;
6086 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
6090 static final private boolean jj_3R_109() {
6091 if (jj_scan_token(DOT)) return true;
6092 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
6093 if (jj_3R_106()) return true;
6094 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
6098 static final private boolean jj_3R_195() {
6099 if (jj_3R_123()) return true;
6100 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
6104 static final private boolean jj_3R_194() {
6105 if (jj_3R_48()) return true;
6106 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
6110 static final private boolean jj_3R_99() {
6111 if (jj_3R_106()) return true;
6112 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
6116 if (jj_3R_109()) { jj_scanpos = xsp; break; }
6117 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
6122 static final private boolean jj_3R_193() {
6123 if (jj_scan_token(IDENTIFIER)) return true;
6124 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
6128 static final private boolean jj_3R_190() {
6135 if (jj_3R_195()) return true;
6136 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
6137 } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
6138 } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
6142 static final private boolean jj_3R_105() {
6143 if (jj_scan_token(LBRACE)) return true;
6144 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
6145 if (jj_3R_47()) return true;
6146 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
6147 if (jj_scan_token(RBRACE)) return true;
6148 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
6152 static final private boolean jj_3R_111() {
6153 if (jj_scan_token(_ANDL)) return true;
6154 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
6158 static final private boolean jj_3R_67() {
6159 if (jj_scan_token(IDENTIFIER)) return true;
6160 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
6163 if (jj_3R_105()) jj_scanpos = xsp;
6164 else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
6168 static final private boolean jj_3R_110() {
6169 if (jj_scan_token(AND_AND)) return true;
6170 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
6174 static final private boolean jj_3R_102() {
6179 if (jj_3R_111()) return true;
6180 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
6181 } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
6182 if (jj_3R_99()) return true;
6183 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
6187 static final private boolean jj_3R_120() {
6188 if (jj_scan_token(ASSIGN)) return true;
6189 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
6190 if (jj_3R_47()) return true;
6191 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
6195 static final private boolean jj_3R_83() {
6196 if (jj_3R_99()) return true;
6197 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
6201 if (jj_3R_102()) { jj_scanpos = xsp; break; }
6202 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
6207 static final private boolean jj_3R_80() {
6208 if (jj_scan_token(HOOK)) return true;
6209 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
6210 if (jj_3R_47()) return true;
6211 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
6212 if (jj_scan_token(COLON)) return true;
6213 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
6214 if (jj_3R_72()) return true;
6215 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
6219 static final private boolean jj_3R_124() {
6220 if (jj_3R_123()) return true;
6221 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
6225 static final private boolean jj_3R_104() {
6226 if (jj_scan_token(_ORL)) return true;
6227 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
6231 static final private boolean jj_3R_51() {
6240 if (jj_3R_69()) return true;
6241 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
6242 } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
6243 } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
6244 } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
6248 static final private boolean jj_3R_66() {
6249 if (jj_scan_token(LBRACE)) return true;
6250 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
6251 if (jj_3R_47()) return true;
6252 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
6253 if (jj_scan_token(RBRACE)) return true;
6254 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
6258 static final private boolean jj_3R_103() {
6259 if (jj_scan_token(OR_OR)) return true;
6260 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
6264 static final private boolean jj_3R_85() {
6269 if (jj_3R_104()) return true;
6270 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
6271 } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
6272 if (jj_3R_83()) return true;
6273 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
6277 static final private boolean jj_3R_119() {
6278 if (jj_scan_token(COMMA)) return true;
6279 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
6282 if (jj_3R_124()) jj_scanpos = xsp;
6283 else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
6287 static final private boolean jj_3R_77() {
6288 if (jj_3R_83()) return true;
6289 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
6293 if (jj_3R_85()) { jj_scanpos = xsp; break; }
6294 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
6299 static final private boolean jj_3R_181() {
6300 if (jj_scan_token(ARRAY)) return true;
6301 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
6302 if (jj_3R_196()) return true;
6303 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
6307 static final private boolean jj_3R_118() {
6308 if (jj_3R_123()) return true;
6309 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
6313 static final private boolean jj_3R_76() {
6314 if (jj_scan_token(DOLLAR)) return true;
6315 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
6316 if (jj_3R_51()) return true;
6317 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
6321 static final private boolean jj_3R_72() {
6322 if (jj_3R_77()) return true;
6323 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
6326 if (jj_3R_80()) jj_scanpos = xsp;
6327 else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
6331 static final private boolean jj_3R_174() {
6332 if (jj_3R_181()) return true;
6333 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
6337 static final private boolean jj_3R_107() {
6338 if (jj_scan_token(LIST)) return true;
6339 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
6340 if (jj_scan_token(LPAREN)) return true;
6341 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
6344 if (jj_3R_118()) jj_scanpos = xsp;
6345 else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
6348 if (jj_3R_119()) { jj_scanpos = xsp; break; }
6349 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
6351 if (jj_scan_token(RPAREN)) return true;
6352 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
6354 if (jj_3R_120()) jj_scanpos = xsp;
6355 else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
6359 static final private boolean jj_3R_191() {
6360 if (jj_3R_192()) return true;
6361 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
6365 static final private boolean jj_3R_82() {
6366 if (jj_scan_token(LBRACE)) return true;
6367 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
6368 if (jj_3R_47()) return true;
6369 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
6370 if (jj_scan_token(RBRACE)) return true;
6371 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
6375 static final private boolean jj_3R_98() {
6376 if (jj_scan_token(TILDEEQUAL)) return true;
6377 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
6381 static final private boolean jj_3R_75() {
6382 if (jj_scan_token(DOLLAR_ID)) return true;
6383 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
6386 if (jj_3R_82()) jj_scanpos = xsp;
6387 else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
6391 static final private boolean jj_3R_64() {
6396 if (jj_3R_76()) return true;
6397 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
6398 } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
6402 static final private boolean jj_3R_97() {
6403 if (jj_scan_token(DOTASSIGN)) return true;
6404 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
6408 static final private boolean jj_3R_96() {
6409 if (jj_scan_token(ORASSIGN)) return true;
6410 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
6414 static final private boolean jj_3R_173() {
6415 if (jj_scan_token(NEW)) return true;
6416 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
6417 if (jj_3R_190()) return true;
6418 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
6421 if (jj_3R_191()) jj_scanpos = xsp;
6422 else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
6426 static final private boolean jj_3R_189() {
6427 if (jj_3R_192()) return true;
6428 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
6432 static final private boolean jj_3R_95() {
6433 if (jj_scan_token(XORASSIGN)) return true;
6434 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
6438 static final private boolean jj_3R_108() {
6439 if (jj_scan_token(PRINT)) return true;
6440 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
6441 if (jj_3R_47()) return true;
6442 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
6446 static final private boolean jj_3R_94() {
6447 if (jj_scan_token(ANDASSIGN)) return true;
6448 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
6452 static final private boolean jj_3R_93() {
6453 if (jj_scan_token(RSIGNEDSHIFTASSIGN)) return true;
6454 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
6458 static final private boolean jj_3R_92() {
6459 if (jj_scan_token(LSHIFTASSIGN)) return true;
6460 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
6464 static final private boolean jj_3R_172() {
6465 if (jj_3R_123()) return true;
6466 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
6469 if (jj_3R_189()) jj_scanpos = xsp;
6470 else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
6474 static final private boolean jj_3R_188() {
6475 if (jj_3R_192()) return true;
6476 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
6480 static final private boolean jj_3R_91() {
6481 if (jj_scan_token(MINUSASSIGN)) return true;
6482 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
6486 static final private boolean jj_3R_90() {
6487 if (jj_scan_token(PLUSASSIGN)) return true;
6488 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
6492 static final private boolean jj_3R_89() {
6493 if (jj_scan_token(REMASSIGN)) return true;
6494 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
6498 static final private boolean jj_3R_88() {
6499 if (jj_scan_token(SLASHASSIGN)) return true;
6500 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
6504 static final private boolean jj_3R_87() {
6505 if (jj_scan_token(STARASSIGN)) return true;
6506 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
6510 static final private boolean jj_3R_187() {
6511 if (jj_scan_token(STATICCLASSACCESS)) return true;
6512 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
6513 if (jj_3R_190()) return true;
6514 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
6518 static final private boolean jj_3R_86() {
6519 if (jj_scan_token(ASSIGN)) return true;
6520 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
6524 static final private boolean jj_3R_81() {
6551 if (jj_3R_98()) return true;
6552 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
6553 } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
6554 } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
6555 } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
6556 } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
6557 } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
6558 } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
6559 } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
6560 } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
6561 } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
6562 } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
6563 } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
6564 } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
6568 static final private boolean jj_3R_101() {
6569 if (jj_3R_108()) return true;
6570 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
6574 static final private boolean jj_3R_167() {
6583 if (jj_3R_174()) return true;
6584 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
6585 } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
6586 } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
6587 } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
6591 static final private boolean jj_3R_171() {
6592 if (jj_scan_token(IDENTIFIER)) return true;
6593 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
6597 if (jj_3R_187()) { jj_scanpos = xsp; break; }
6598 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
6601 if (jj_3R_188()) jj_scanpos = xsp;
6602 else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
6606 static final private boolean jj_3R_100() {
6607 if (jj_3R_107()) return true;
6608 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
6612 static final private boolean jj_3R_84() {
6617 if (jj_3R_101()) return true;
6618 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
6619 } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
6623 static final private boolean jj_3_1() {
6624 if (jj_3R_39()) return true;
6625 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
6629 static final private boolean jj_3R_79() {
6630 if (jj_3R_84()) return true;
6631 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
6635 static final private boolean jj_3R_78() {
6636 if (jj_scan_token(BANG)) return true;
6637 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
6638 if (jj_3R_73()) return true;
6639 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
6643 static final private boolean jj_3R_73() {
6648 if (jj_3R_79()) return true;
6649 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
6650 } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
6654 static final private boolean jj_3R_123() {
6655 if (jj_3R_64()) return true;
6656 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
6660 if (jj_3_1()) { jj_scanpos = xsp; break; }
6661 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
6666 static final private boolean jj_3R_186() {
6667 if (jj_scan_token(MINUS_MINUS)) return true;
6668 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
6672 static final private boolean jj_3R_185() {
6673 if (jj_scan_token(PLUS_PLUS)) return true;
6674 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
6678 static final private boolean jj_3R_184() {
6683 if (jj_3R_186()) return true;
6684 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
6685 } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
6689 static final private boolean jj_3R_54() {
6690 if (jj_3R_73()) return true;
6691 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
6695 static final private boolean jj_3R_169() {
6696 if (jj_3R_167()) return true;
6697 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
6700 if (jj_3R_184()) jj_scanpos = xsp;
6701 else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
6705 static final private boolean jj_3R_183() {
6706 if (jj_scan_token(ARRAY)) return true;
6707 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
6711 static final private boolean jj_3R_182() {
6712 if (jj_3R_48()) return true;
6713 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
6717 static final private boolean jj_3R_42() {
6718 if (jj_scan_token(ARRAY)) return true;
6719 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
6723 static final private boolean jj_3R_168() {
6724 if (jj_scan_token(LPAREN)) return true;
6725 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
6730 if (jj_3R_183()) return true;
6731 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
6732 } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
6733 if (jj_scan_token(RPAREN)) return true;
6734 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
6735 if (jj_3R_143()) return true;
6736 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
6740 static final private boolean jj_3R_41() {
6741 if (jj_3R_48()) return true;
6742 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
6746 static final private boolean jj_3R_74() {
6747 if (jj_3R_81()) return true;
6748 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
6749 if (jj_3R_47()) return true;
6750 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
6754 static final private boolean jj_3R_47() {
6759 if (jj_3R_54()) return true;
6760 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
6761 } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
6765 static final private boolean jj_3R_53() {
6766 if (jj_3R_72()) return true;
6767 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
6770 if (jj_3R_74()) jj_scanpos = xsp;
6771 else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
6775 static final private boolean jj_3_3() {
6776 if (jj_scan_token(LPAREN)) return true;
6777 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
6782 if (jj_3R_42()) return true;
6783 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
6784 } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
6785 if (jj_scan_token(RPAREN)) return true;
6786 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
6790 static final private boolean jj_3R_166() {
6791 if (jj_scan_token(LPAREN)) return true;
6792 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
6793 if (jj_3R_47()) return true;
6794 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
6795 if (jj_scan_token(RPAREN)) return true;
6796 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
6800 static final private boolean jj_3R_165() {
6801 if (jj_3R_170()) return true;
6802 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
6806 static final private boolean jj_3R_164() {
6807 if (jj_3R_169()) return true;
6808 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
6812 static final private boolean jj_3R_63() {
6813 if (jj_scan_token(OBJECT)) return true;
6814 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
6818 static final private boolean jj_3R_160() {
6827 if (jj_3R_166()) return true;
6828 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
6829 } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
6830 } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
6831 } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
6835 static final private boolean jj_3R_163() {
6836 if (jj_3R_168()) return true;
6837 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
6841 static final private boolean jj_3R_62() {
6842 if (jj_scan_token(INTEGER)) return true;
6843 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
6847 static final private boolean jj_3R_61() {
6848 if (jj_scan_token(INT)) return true;
6849 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
6853 static final private boolean jj_3R_60() {
6854 if (jj_scan_token(FLOAT)) return true;
6855 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
6859 static final private boolean jj_3R_59() {
6860 if (jj_scan_token(DOUBLE)) return true;
6861 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
6865 static final private boolean jj_3R_162() {
6866 if (jj_scan_token(MINUS_MINUS)) return true;
6867 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
6871 static final private boolean jj_3R_58() {
6872 if (jj_scan_token(REAL)) return true;
6873 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
6877 static final private boolean jj_3R_161() {
6878 if (jj_scan_token(PLUS_PLUS)) return true;
6879 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
6883 static final private boolean jj_3R_65() {
6884 if (jj_scan_token(ASSIGN)) return true;
6885 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
6886 if (jj_3R_47()) return true;
6887 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
6891 static final private boolean jj_3R_57() {
6892 if (jj_scan_token(BOOLEAN)) return true;
6893 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
6897 static final private boolean jj_3R_56() {
6898 if (jj_scan_token(BOOL)) return true;
6899 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
6903 static final private boolean jj_3R_48() {
6922 if (jj_3R_63()) return true;
6923 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
6924 } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
6925 } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
6926 } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
6927 } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
6928 } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
6929 } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
6930 } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
6931 } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
6935 static final private boolean jj_3R_55() {
6936 if (jj_scan_token(STRING)) return true;
6937 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
6941 static final private boolean jj_3R_159() {
6946 if (jj_3R_162()) return true;
6947 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
6948 } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
6949 if (jj_3R_167()) return true;
6950 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
6954 static final private boolean jj_3R_158() {
6955 if (jj_3R_160()) return true;
6956 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
6960 static final private boolean jj_3R_157() {
6961 if (jj_3R_159()) return true;
6962 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
6966 static final private boolean jj_3R_156() {
6967 if (jj_scan_token(MINUS)) return true;
6968 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
6969 if (jj_3R_147()) return true;
6970 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
6974 static final private boolean jj_3R_49() {
6975 if (jj_3R_64()) return true;
6976 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
6979 if (jj_3R_65()) jj_scanpos = xsp;
6980 else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
6984 static final private boolean jj_3R_154() {
6993 if (jj_3R_158()) return true;
6994 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
6995 } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
6996 } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
6997 } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
7001 static final private boolean jj_3R_155() {
7002 if (jj_scan_token(PLUS)) return true;
7003 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
7004 if (jj_3R_147()) return true;
7005 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
7009 static final private boolean jj_3R_153() {
7010 if (jj_3R_154()) return true;
7011 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
7015 static final private boolean jj_3R_50() {
7016 if (jj_scan_token(COMMA)) return true;
7017 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
7018 if (jj_3R_49()) return true;
7019 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
7023 static final private boolean jj_3R_152() {
7024 if (jj_scan_token(BANG)) return true;
7025 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
7026 if (jj_3R_147()) return true;
7027 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
7031 static final private boolean jj_3R_44() {
7032 if (jj_3R_49()) return true;
7033 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
7037 if (jj_3R_50()) { jj_scanpos = xsp; break; }
7038 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
7043 static final private boolean jj_3R_147() {
7050 if (jj_3R_153()) return true;
7051 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
7052 } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
7053 } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
7057 static final private boolean jj_3R_151() {
7058 if (jj_scan_token(AT)) return true;
7059 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
7060 if (jj_3R_147()) return true;
7061 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
7065 static final private boolean jj_3R_143() {
7066 if (jj_3R_147()) return true;
7067 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
7071 static final private boolean jj_3R_150() {
7072 if (jj_scan_token(REMAINDER)) return true;
7073 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
7077 static final private boolean jj_3R_43() {
7078 if (jj_3R_47()) return true;
7079 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
7080 if (jj_scan_token(SEMICOLON)) return true;
7081 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
7085 static final private boolean jj_3R_149() {
7086 if (jj_scan_token(SLASH)) return true;
7087 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
7091 static final private boolean jj_3R_148() {
7092 if (jj_scan_token(STAR)) return true;
7093 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
7097 static final private boolean jj_3R_144() {
7104 if (jj_3R_150()) return true;
7105 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
7106 } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
7107 } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
7108 if (jj_3R_143()) return true;
7109 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
7113 static final private boolean jj_3R_138() {
7114 if (jj_3R_143()) return true;
7115 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
7119 if (jj_3R_144()) { jj_scanpos = xsp; break; }
7120 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
7125 static final private boolean jj_3R_146() {
7126 if (jj_scan_token(MINUS)) return true;
7127 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
7131 static final private boolean jj_3R_145() {
7132 if (jj_scan_token(PLUS)) return true;
7133 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
7137 static final private boolean jj_3R_139() {
7142 if (jj_3R_146()) return true;
7143 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
7144 } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
7145 if (jj_3R_138()) return true;
7146 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
7150 static private boolean jj_initialized_once = false;
7151 static public PHPParserTokenManager token_source;
7152 static SimpleCharStream jj_input_stream;
7153 static public Token token, jj_nt;
7154 static private int jj_ntk;
7155 static private Token jj_scanpos, jj_lastpos;
7156 static private int jj_la;
7157 static public boolean lookingAhead = false;
7158 static private boolean jj_semLA;
7159 static private int jj_gen;
7160 static final private int[] jj_la1 = new int[124];
7161 static private int[] jj_la1_0;
7162 static private int[] jj_la1_1;
7163 static private int[] jj_la1_2;
7164 static private int[] jj_la1_3;
7165 static private int[] jj_la1_4;
7173 private static void jj_la1_0() {
7174 jj_la1_0 = new int[] {0xf960001e,0x6,0x6,0xf960001e,0x0,0xf9600000,0x0,0xc00000,0xc00000,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x8000000,0x0,0x68000000,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x68000000,0x60000000,0x60000000,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x8000000,0x8000000,0x0,0x8000000,0x8000000,0x0,0x0,0x0,0x0,0x0,0x0,0x8000000,0x8000000,0x0,0x68000000,0x68000000,0x0,0x0,0x68000000,0x0,0x0,0x81000000,0xf9000000,0x8,0x6,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0xf9600010,0xf9600010,0xf9600000,0xe9600000,0x0,0x0,0x0,0x0,0x8000000,0x0,0x0,0x0,0xe9600010,0xe9600010,0x10000000,0x0,0x68000000,0xf9000010,0xf9000010,0x2000000,0x4000000,0xf9000010,0x2000000,0x4000000,0xf9000010,0xf9000010,0xf9000010,0xf9000010,0xf9000010,0xf9000000,0xf9000000,0x8000000,0x68000000,0x8000000,0xf9000000,0xf9000000,0x8000000,0x0,0x68000000,0x68000000,};
7176 private static void jj_la1_1() {
7177 jj_la1_1 = new int[] {0x875d507f,0x0,0x0,0x875d507f,0x0,0x875d507f,0x8000,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x3080000,0x200,0x30c0000,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x30c0000,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x30c0000,0x30c0000,0x0,0x30c0000,0x0,0x0,0x0,0x100,0x0,0x0,0x0,0x40000,0x40000,0x0,0x30c0000,0x30c0000,0x80,0x3080000,0x30c0000,0x0,0x0,0x8451507f,0x875d507f,0x0,0x0,0xf,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x875d507f,0x875d507f,0x875d507f,0x875d507f,0x0,0x0,0x0,0x0,0x40000,0x0,0x2400,0x2400,0x875d507f,0x875d507f,0x0,0x2400,0x30c0000,0x875d507f,0x875d507f,0x0,0x0,0x875d507f,0x0,0x0,0x875d507f,0x875d507f,0x875d507f,0x875d507f,0x875d507f,0x875d507f,0x875d507f,0x40000,0x30c0000,0x40000,0x875d507f,0x875d507f,0x40000,0x0,0x30c0000,0x30c0000,};
7179 private static void jj_la1_2() {
7180 jj_la1_2 = new int[] {0x3c1c00,0x0,0x0,0x3c1c00,0x0,0x3c1c00,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x800,0x0,0x800,0x0,0x0,0x300000,0x0,0x3c1c00,0x0,0x1000000,0x0,0x1000000,0x1000000,0x3fe,0x0,0x3c1c00,0x1000,0x0,0x0,0x4000,0x80010000,0x80010000,0x20000,0x20000,0x0,0x2000000,0x4000000,0x1000000,0x0,0x0,0x0,0x0,0x70000000,0x70000000,0x300000,0x300000,0x8c00000,0x8c00000,0x3c1c00,0x3c0800,0xc0000,0x800,0x3fe,0xc0000,0xc0000,0x0,0x0,0x0,0x0,0x800,0x800,0xbfe,0x3c1ffe,0x3c1ffe,0x0,0x0,0x3c1c00,0x0,0x400,0x400,0x3c1c00,0x0,0x0,0x0,0x800,0x0,0x800,0x0,0x0,0x0,0x0,0x3c1c00,0x3c1c00,0x3c1c00,0x3c1c00,0x0,0x0,0xc0000,0xc0000,0xc0800,0x8000,0x0,0x0,0x3c1c00,0x3c1c00,0x0,0x0,0x3c1c00,0x3c1c00,0x3c1c00,0x0,0x0,0x3c1c00,0x0,0x0,0x3c9c00,0x3c1c00,0x3c1c00,0x3c1c00,0x3c1c00,0x3c1c00,0x3c9c00,0xc0800,0x3c1c00,0xc0800,0x3c1c00,0x3c9c00,0xc0800,0x0,0x3c1c00,0x3c1c00,};
7182 private static void jj_la1_3() {
7183 jj_la1_3 = new int[] {0x2288a2,0x0,0x0,0x2288a2,0x200000,0x2288a2,0x0,0x0,0x0,0x400000,0x0,0x0,0x20000,0x0,0x20000,0x20800,0x22,0x22,0x8a2,0x0,0x88a2,0x400000,0x0,0x400000,0x0,0x0,0x0,0x0,0x88a2,0x0,0x0,0x0,0x0,0x0,0x0,0x1,0x1,0x800000,0x0,0x0,0x0,0xe4000000,0xe4000000,0x1b000000,0x1b000000,0x0,0x0,0x0,0x0,0x0,0x0,0x88a2,0x88a2,0x0,0x88a2,0x0,0x0,0x0,0x0,0x8000,0x8000,0x8000,0x800,0x800,0x800,0x88a2,0x88a2,0x80000,0xa2,0x88a2,0x400000,0x0,0x220800,0x2288a2,0x0,0x0,0x0,0x0,0x400000,0x0,0x0,0x400000,0x400000,0x400000,0x2288a2,0x2288a2,0x2288a2,0x2288a2,0x400000,0x0,0x0,0x0,0x800,0x20000,0x0,0x0,0x2288a2,0x2288a2,0x0,0x0,0x88a2,0x2288a2,0x2288a2,0x0,0x0,0x2288a2,0x0,0x0,0x2288a2,0x2288a2,0x2288a2,0x2288a2,0x2288a2,0x2288a2,0x2288a2,0x800,0x88a2,0x800,0x2288a2,0x2288a2,0x800,0x400000,0x88a2,0x88a2,};
7185 private static void jj_la1_4() {
7186 jj_la1_4 = new int[] {0x4000,0x0,0x0,0x4000,0x0,0x4000,0x0,0x0,0x0,0x0,0x2,0x2,0x0,0x4000,0x0,0x4000,0x0,0x0,0x0,0x0,0x4000,0x0,0x0,0x0,0x4000,0x0,0x0,0x3ffe,0x4000,0x0,0x0,0x3ffe,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x1,0x1,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x4000,0x4000,0x0,0x4000,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x4000,0x4000,0x4000,0x4000,0x4000,0x0,0x0,0x4000,0x0,0x0,0x0,0x4000,0x0,0x0,0x0,0x4000,0x0,0x4000,0x2,0x0,0x0,0x0,0x4000,0x4000,0x4000,0x4000,0x0,0x2,0x0,0x0,0x4000,0x0,0x0,0x0,0x4000,0x4000,0x0,0x0,0x4000,0x4000,0x4000,0x0,0x0,0x4000,0x0,0x0,0x4000,0x4000,0x4000,0x4000,0x4000,0x4000,0x4000,0x4000,0x4000,0x4000,0x4000,0x4000,0x4000,0x0,0x4000,0x4000,};
7188 static final private JJCalls[] jj_2_rtns = new JJCalls[5];
7189 static private boolean jj_rescan = false;
7190 static private int jj_gc = 0;
7192 public PHPParser(java.io.InputStream stream) {
7193 if (jj_initialized_once) {
7194 System.out.println("ERROR: Second call to constructor of static parser. You must");
7195 System.out.println(" either use ReInit() or set the JavaCC option STATIC to false");
7196 System.out.println(" during parser generation.");
7199 jj_initialized_once = true;
7200 jj_input_stream = new SimpleCharStream(stream, 1, 1);
7201 token_source = new PHPParserTokenManager(jj_input_stream);
7202 token = new Token();
7205 for (int i = 0; i < 124; i++) jj_la1[i] = -1;
7206 for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();
7209 static public void ReInit(java.io.InputStream stream) {
7210 jj_input_stream.ReInit(stream, 1, 1);
7211 token_source.ReInit(jj_input_stream);
7212 token = new Token();
7215 for (int i = 0; i < 124; i++) jj_la1[i] = -1;
7216 for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();
7219 public PHPParser(java.io.Reader stream) {
7220 if (jj_initialized_once) {
7221 System.out.println("ERROR: Second call to constructor of static parser. You must");
7222 System.out.println(" either use ReInit() or set the JavaCC option STATIC to false");
7223 System.out.println(" during parser generation.");
7226 jj_initialized_once = true;
7227 jj_input_stream = new SimpleCharStream(stream, 1, 1);
7228 token_source = new PHPParserTokenManager(jj_input_stream);
7229 token = new Token();
7232 for (int i = 0; i < 124; i++) jj_la1[i] = -1;
7233 for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();
7236 static public void ReInit(java.io.Reader stream) {
7237 jj_input_stream.ReInit(stream, 1, 1);
7238 token_source.ReInit(jj_input_stream);
7239 token = new Token();
7242 for (int i = 0; i < 124; i++) jj_la1[i] = -1;
7243 for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();
7246 public PHPParser(PHPParserTokenManager tm) {
7247 if (jj_initialized_once) {
7248 System.out.println("ERROR: Second call to constructor of static parser. You must");
7249 System.out.println(" either use ReInit() or set the JavaCC option STATIC to false");
7250 System.out.println(" during parser generation.");
7253 jj_initialized_once = true;
7255 token = new Token();
7258 for (int i = 0; i < 124; i++) jj_la1[i] = -1;
7259 for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();
7262 public void ReInit(PHPParserTokenManager tm) {
7264 token = new Token();
7267 for (int i = 0; i < 124; i++) jj_la1[i] = -1;
7268 for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();
7271 static final private Token jj_consume_token(int kind) throws ParseException {
7273 if ((oldToken = token).next != null) token = token.next;
7274 else token = token.next = token_source.getNextToken();
7276 if (token.kind == kind) {
7278 if (++jj_gc > 100) {
7280 for (int i = 0; i < jj_2_rtns.length; i++) {
7281 JJCalls c = jj_2_rtns[i];
7283 if (c.gen < jj_gen) c.first = null;
7288 trace_token(token, "");
7293 throw generateParseException();
7296 static final private boolean jj_scan_token(int kind) {
7297 if (jj_scanpos == jj_lastpos) {
7299 if (jj_scanpos.next == null) {
7300 jj_lastpos = jj_scanpos = jj_scanpos.next = token_source.getNextToken();
7302 jj_lastpos = jj_scanpos = jj_scanpos.next;
7305 jj_scanpos = jj_scanpos.next;
7308 int i = 0; Token tok = token;
7309 while (tok != null && tok != jj_scanpos) { i++; tok = tok.next; }
7310 if (tok != null) jj_add_error_token(kind, i);
7312 return (jj_scanpos.kind != kind);
7315 static final public Token getNextToken() {
7316 if (token.next != null) token = token.next;
7317 else token = token.next = token_source.getNextToken();
7320 trace_token(token, " (in getNextToken)");
7324 static final public Token getToken(int index) {
7325 Token t = lookingAhead ? jj_scanpos : token;
7326 for (int i = 0; i < index; i++) {
7327 if (t.next != null) t = t.next;
7328 else t = t.next = token_source.getNextToken();
7333 static final private int jj_ntk() {
7334 if ((jj_nt=token.next) == null)
7335 return (jj_ntk = (token.next=token_source.getNextToken()).kind);
7337 return (jj_ntk = jj_nt.kind);
7340 static private java.util.Vector jj_expentries = new java.util.Vector();
7341 static private int[] jj_expentry;
7342 static private int jj_kind = -1;
7343 static private int[] jj_lasttokens = new int[100];
7344 static private int jj_endpos;
7346 static private void jj_add_error_token(int kind, int pos) {
7347 if (pos >= 100) return;
7348 if (pos == jj_endpos + 1) {
7349 jj_lasttokens[jj_endpos++] = kind;
7350 } else if (jj_endpos != 0) {
7351 jj_expentry = new int[jj_endpos];
7352 for (int i = 0; i < jj_endpos; i++) {
7353 jj_expentry[i] = jj_lasttokens[i];
7355 boolean exists = false;
7356 for (java.util.Enumeration enum = jj_expentries.elements(); enum.hasMoreElements();) {
7357 int[] oldentry = (int[])(enum.nextElement());
7358 if (oldentry.length == jj_expentry.length) {
7360 for (int i = 0; i < jj_expentry.length; i++) {
7361 if (oldentry[i] != jj_expentry[i]) {
7369 if (!exists) jj_expentries.addElement(jj_expentry);
7370 if (pos != 0) jj_lasttokens[(jj_endpos = pos) - 1] = kind;
7374 static public ParseException generateParseException() {
7375 jj_expentries.removeAllElements();
7376 boolean[] la1tokens = new boolean[143];
7377 for (int i = 0; i < 143; i++) {
7378 la1tokens[i] = false;
7381 la1tokens[jj_kind] = true;
7384 for (int i = 0; i < 124; i++) {
7385 if (jj_la1[i] == jj_gen) {
7386 for (int j = 0; j < 32; j++) {
7387 if ((jj_la1_0[i] & (1<<j)) != 0) {
7388 la1tokens[j] = true;
7390 if ((jj_la1_1[i] & (1<<j)) != 0) {
7391 la1tokens[32+j] = true;
7393 if ((jj_la1_2[i] & (1<<j)) != 0) {
7394 la1tokens[64+j] = true;
7396 if ((jj_la1_3[i] & (1<<j)) != 0) {
7397 la1tokens[96+j] = true;
7399 if ((jj_la1_4[i] & (1<<j)) != 0) {
7400 la1tokens[128+j] = true;
7405 for (int i = 0; i < 143; i++) {
7407 jj_expentry = new int[1];
7409 jj_expentries.addElement(jj_expentry);
7414 jj_add_error_token(0, 0);
7415 int[][] exptokseq = new int[jj_expentries.size()][];
7416 for (int i = 0; i < jj_expentries.size(); i++) {
7417 exptokseq[i] = (int[])jj_expentries.elementAt(i);
7419 return new ParseException(token, exptokseq, tokenImage);
7422 static private int trace_indent = 0;
7423 static private boolean trace_enabled = true;
7425 static final public void enable_tracing() {
7426 trace_enabled = true;
7429 static final public void disable_tracing() {
7430 trace_enabled = false;
7433 static final private void trace_call(String s) {
7434 if (trace_enabled) {
7435 for (int i = 0; i < trace_indent; i++) { System.out.print(" "); }
7436 System.out.println("Call: " + s);
7438 trace_indent = trace_indent + 2;
7441 static final private void trace_return(String s) {
7442 trace_indent = trace_indent - 2;
7443 if (trace_enabled) {
7444 for (int i = 0; i < trace_indent; i++) { System.out.print(" "); }
7445 System.out.println("Return: " + s);
7449 static final private void trace_token(Token t, String where) {
7450 if (trace_enabled) {
7451 for (int i = 0; i < trace_indent; i++) { System.out.print(" "); }
7452 System.out.print("Consumed token: <" + tokenImage[t.kind]);
7453 if (t.kind != 0 && !tokenImage[t.kind].equals("\"" + t.image + "\"")) {
7454 System.out.print(": \"" + t.image + "\"");
7456 System.out.println(">" + where);
7460 static final private void trace_scan(Token t1, int t2) {
7461 if (trace_enabled) {
7462 for (int i = 0; i < trace_indent; i++) { System.out.print(" "); }
7463 System.out.print("Visited token: <" + tokenImage[t1.kind]);
7464 if (t1.kind != 0 && !tokenImage[t1.kind].equals("\"" + t1.image + "\"")) {
7465 System.out.print(": \"" + t1.image + "\"");
7467 System.out.println(">; Expected token: <" + tokenImage[t2] + ">");
7471 static final private void jj_rescan_token() {
7473 for (int i = 0; i < 5; i++) {
7474 JJCalls p = jj_2_rtns[i];
7476 if (p.gen > jj_gen) {
7477 jj_la = p.arg; jj_lastpos = jj_scanpos = p.first;
7479 case 0: jj_3_1(); break;
7480 case 1: jj_3_2(); break;
7481 case 2: jj_3_3(); break;
7482 case 3: jj_3_4(); break;
7483 case 4: jj_3_5(); break;
7487 } while (p != null);
7492 static final private void jj_save(int index, int xla) {
7493 JJCalls p = jj_2_rtns[index];
7494 while (p.gen > jj_gen) {
7495 if (p.next == null) { p = p.next = new JJCalls(); break; }
7498 p.gen = jj_gen + xla - jj_la; p.first = token; p.arg = xla;
7501 static final class JJCalls {