From ed99bca55f4479c95dce901473dc4bb940ceb3a1 Mon Sep 17 00:00:00 2001 From: "L. Sousa" Date: Thu, 3 Oct 2024 00:02:47 +0100 Subject: [PATCH 001/209] Remove code related to the compilation and use of .lara files --- LARAC/.classpath | 18 +- LARAC/.project | 35 - LARAC/.settings/sf.eclipse.javacc.prefs~ | 16 - LARAC/ant/WeaverGenerator_cetus.xml | 20 - LARAC/ant/lara_Weaver.xml | 20 - LARAC/build.gradle | 18 +- LARAC/commands.build | 9 - LARAC/deploy/LaraC-deploy.launch | 17 - LARAC/deploy/LaraC.deploy | 110 - LARAC/diagrams/CD.cld | 1564 -- LARAC/diagrams/Class.atxa | 282 - LARAC/diagrams/Layered.atxa | 138 - LARAC/ivy.xml | 38 - LARAC/launchers/[LARAC]Test.launch | 13 - LARAC/src/applet/GUI.java | 813 - LARAC/src/larac/LARACLauncher.java | 89 - LARAC/src/larac/LaraC.java | 978 -- LARAC/src/larac/code/AspectIrToLara.java | 143 - LARAC/src/larac/code/CodeElems.java | 201 - .../larac/exceptions/AspectIRException.java | 39 - .../exceptions/LARACompilerException.java | 47 - LARAC/src/larac/exceptions/LaraException.java | 46 - .../src/larac/exceptions/OptionException.java | 18 - .../larac/exceptions/ParseExceptionData.java | 58 - .../larac/exceptions/StopParseException.java | 29 - .../src/larac/exceptions/SyntaxException.java | 62 - LARAC/src/larac/imports/FileLaraImport.java | 38 - LARAC/src/larac/imports/LaraImport.java | 74 - LARAC/src/larac/imports/LaraImports.java | 133 - .../src/larac/imports/ResourceLaraImport.java | 35 - LARAC/src/larac/objects/Enums.java | 351 - LARAC/src/larac/objects/SymbolTable.java | 38 - LARAC/src/larac/objects/Variable.java | 161 - LARAC/src/larac/options/LaraCOptions.java | 542 - .../src/larac/options/LaraOptionProvider.java | 67 - .../options/optionprovider/ArgOption.java | 18 - .../options/optionprovider/Descriptor.java | 148 - .../optionprovider/OptionProvider.java | 18 - .../options/optionprovider/OptionUtils.java | 271 - .../resources/InputStreamProvider.java | 21 - LARAC/src/larac/structure/AspectIR.java | 419 - LARAC/src/larac/structure/AspectView.java | 28 - LARAC/src/larac/utils/FileUtils.java | 233 - LARAC/src/larac/utils/OrganizeUtils.java | 218 - LARAC/src/larac/utils/Organizer.java | 137 - .../larac/utils/output/MessageConstants.java | 4 - LARAC/src/larac/utils/output/Output.java | 5 +- .../src/larac/utils/xml/AspectIRFactory.java | 110 - LARAC/src/larac/utils/xml/Pair.java | 65 - .../utils/xml/entity/ActionArgument.java | 126 - .../src/larac/utils/xml/entity/Artifact.java | 115 - .../src/larac/utils/xml/entity/Attribute.java | 120 - .../org/dojo/jsl/parser/LARAEcmaScript.jjt | 3309 ---- LARAC/src/org/dojo/jsl/parser/ast/.gitignore | 33 - .../jsl/parser/ast/ASTANDFiltersExpr.java | 68 - .../org/dojo/jsl/parser/ast/ASTAction.java | 156 - .../parser/ast/ASTActionParameterList.java | 21 - .../parser/ast/ASTAllocationExpression.java | 149 - .../parser/ast/ASTAndExpressionSequence.java | 69 - .../org/dojo/jsl/parser/ast/ASTApplies.java | 47 - .../src/org/dojo/jsl/parser/ast/ASTApply.java | 351 - .../dojo/jsl/parser/ast/ASTAroundApply.java | 192 - .../dojo/jsl/parser/ast/ASTArrayLiteral.java | 72 - .../ast/ASTArrowFunctionExpression.java | 121 - .../org/dojo/jsl/parser/ast/ASTAspectDef.java | 593 - .../parser/ast/ASTAssignmentExpression.java | 102 - .../ast/ASTBinaryExpressionSequence.java | 115 - .../src/org/dojo/jsl/parser/ast/ASTBlock.java | 108 - .../jsl/parser/ast/ASTBreakStatement.java | 54 - .../src/org/dojo/jsl/parser/ast/ASTCall.java | 243 - .../org/dojo/jsl/parser/ast/ASTCaseGroup.java | 53 - .../dojo/jsl/parser/ast/ASTCaseGroups.java | 39 - .../org/dojo/jsl/parser/ast/ASTCaseGuard.java | 39 - .../dojo/jsl/parser/ast/ASTCatchClause.java | 66 - .../src/org/dojo/jsl/parser/ast/ASTCheck.java | 63 - LARAC/src/org/dojo/jsl/parser/ast/ASTCmd.java | 208 - .../src/org/dojo/jsl/parser/ast/ASTCode.java | 32 - .../org/dojo/jsl/parser/ast/ASTCodeDef.java | 292 - .../jsl/parser/ast/ASTCompositeReference.java | 344 - .../org/dojo/jsl/parser/ast/ASTCondition.java | 68 - .../parser/ast/ASTConditionalExpression.java | 41 - .../jsl/parser/ast/ASTContinueStatement.java | 54 - .../org/dojo/jsl/parser/ast/ASTDefine.java | 146 - .../dojo/jsl/parser/ast/ASTDoStatement.java | 56 - .../jsl/parser/ast/ASTEmptyExpression.java | 32 - .../jsl/parser/ast/ASTEmptyPositions.java | 51 - .../jsl/parser/ast/ASTEmptyStatement.java | 32 - .../jsl/parser/ast/ASTExpressionList.java | 51 - .../parser/ast/ASTExpressionStatement.java | 54 - .../org/dojo/jsl/parser/ast/ASTFilePath.java | 21 - .../org/dojo/jsl/parser/ast/ASTFilter.java | 109 - .../org/dojo/jsl/parser/ast/ASTFinalize.java | 40 - .../dojo/jsl/parser/ast/ASTFinallyClause.java | 37 - LARAC/src/org/dojo/jsl/parser/ast/ASTFor.java | 21 - .../jsl/parser/ast/ASTForConditionList.java | 56 - .../jsl/parser/ast/ASTForInStatement.java | 76 - .../dojo/jsl/parser/ast/ASTForStatement.java | 70 - .../jsl/parser/ast/ASTForVarInStatement.java | 123 - .../jsl/parser/ast/ASTForVarStatement.java | 86 - .../parser/ast/ASTFormalParameterList.java | 32 - .../parser/ast/ASTFunctionCallParameters.java | 59 - .../parser/ast/ASTFunctionDeclaration.java | 169 - .../jsl/parser/ast/ASTFunctionExpression.java | 192 - .../ast/ASTGeneratorFunctionDeclaration.java | 165 - .../ast/ASTGeneratorFunctionExpression.java | 186 - .../dojo/jsl/parser/ast/ASTIdentifier.java | 189 - .../dojo/jsl/parser/ast/ASTIfStatement.java | 70 - .../org/dojo/jsl/parser/ast/ASTImport.java | 428 - .../org/dojo/jsl/parser/ast/ASTInclude.java | 21 - .../dojo/jsl/parser/ast/ASTInitialize.java | 40 - .../src/org/dojo/jsl/parser/ast/ASTInput.java | 66 - .../org/dojo/jsl/parser/ast/ASTInputList.java | 21 - .../org/dojo/jsl/parser/ast/ASTInsert.java | 315 - .../dojo/jsl/parser/ast/ASTJavaScript.java | 89 - .../src/org/dojo/jsl/parser/ast/ASTJoin.java | 100 - .../jsl/parser/ast/ASTLabelledStatement.java | 39 - .../org/dojo/jsl/parser/ast/ASTLiteral.java | 212 - .../dojo/jsl/parser/ast/ASTLiteralField.java | 21 - .../dojo/jsl/parser/ast/ASTNamedArgument.java | 34 - .../dojo/jsl/parser/ast/ASTNaturalJoin.java | 21 - .../org/dojo/jsl/parser/ast/ASTORJPExpr.java | 58 - .../dojo/jsl/parser/ast/ASTObjectLiteral.java | 67 - .../org/dojo/jsl/parser/ast/ASTOperator.java | 94 - .../parser/ast/ASTOrExpressionSequence.java | 69 - .../dojo/jsl/parser/ast/ASTOrFiltersExpr.java | 60 - .../org/dojo/jsl/parser/ast/ASTOutput.java | 66 - .../org/dojo/jsl/parser/ast/ASTOutputAct.java | 262 - .../jsl/parser/ast/ASTParenExpression.java | 60 - .../org/dojo/jsl/parser/ast/ASTPerform.java | 533 - .../org/dojo/jsl/parser/ast/ASTPointcut.java | 418 - .../jsl/parser/ast/ASTPointcutFilters.java | 102 - .../jsl/parser/ast/ASTPostAssignmentList.java | 38 - .../jsl/parser/ast/ASTPostfixExpression.java | 45 - .../jsl/parser/ast/ASTPreAssignmentList.java | 38 - .../ast/ASTPropertyIdentifierReference.java | 78 - .../parser/ast/ASTPropertyValueReference.java | 39 - .../jsl/parser/ast/ASTReturnStatement.java | 51 - LARAC/src/org/dojo/jsl/parser/ast/ASTRun.java | 212 - .../dojo/jsl/parser/ast/ASTSecondSetOp.java | 21 - .../org/dojo/jsl/parser/ast/ASTSelect.java | 184 - .../src/org/dojo/jsl/parser/ast/ASTStart.java | 133 - .../dojo/jsl/parser/ast/ASTStatementList.java | 38 - .../org/dojo/jsl/parser/ast/ASTStatic.java | 109 - .../jsl/parser/ast/ASTSwitchStatement.java | 49 - .../dojo/jsl/parser/ast/ASTThirdSetOp.java | 21 - .../dojo/jsl/parser/ast/ASTThisReference.java | 43 - .../jsl/parser/ast/ASTThrowStatement.java | 39 - LARAC/src/org/dojo/jsl/parser/ast/ASTTo.java | 97 - .../dojo/jsl/parser/ast/ASTTryStatement.java | 49 - .../jsl/parser/ast/ASTUnaryExpression.java | 59 - .../parser/ast/ASTVariableDeclaration.java | 164 - .../ast/ASTVariableDeclarationList.java | 68 - .../jsl/parser/ast/ASTVariableStatement.java | 65 - .../jsl/parser/ast/ASTWhileStatement.java | 56 - .../dojo/jsl/parser/ast/ASTWithStatement.java | 66 - .../org/dojo/jsl/parser/ast/ASTYieldStar.java | 16 - .../jsl/parser/ast/ASTYieldStatement.java | 65 - .../parser/ast/JJTLARAEcmaScriptState.java | 123 - .../dojo/jsl/parser/ast/JavaCharStream.java | 692 - .../dojo/jsl/parser/ast/LARAEcmaScript.html | 2007 --- .../dojo/jsl/parser/ast/LARAEcmaScript.java | 14549 ---------------- .../org/dojo/jsl/parser/ast/LARAEcmaScript.jj | 8109 --------- .../parser/ast/LARAEcmaScriptConstants.java | 534 - .../ast/LARAEcmaScriptTokenManager.java | 5072 ------ .../ast/LARAEcmaScriptTreeConstants.java | 203 - .../dojo/jsl/parser/ast/LARAParserBase.java | 67 - LARAC/src/org/dojo/jsl/parser/ast/Node.java | 38 - .../dojo/jsl/parser/ast/ParseException.java | 213 - .../org/dojo/jsl/parser/ast/SimpleNode.java | 726 - LARAC/src/org/dojo/jsl/parser/ast/Token.java | 132 - .../dojo/jsl/parser/ast/TokenMgrError.java | 174 - .../jsl/parser/ast/utils/ASTJSImport.java | 92 - .../jsl/parser/ast/utils/ASTLaraImport.java | 90 - .../jsl/parser/ast/utils/ASTScriptImport.java | 93 - .../parser/ast/utils/LARACConstantPool.java | 22 - .../parser/ast/utils/LaraCNodeFactory.java | 40 - LARAC/test/specs/actionModel.xml | 29 - LARAC/test/specs/artifacts.xml | 159 - LARAC/test/specs/joinPointModel.xml | 29 - LARAI/.classpath | 29 +- LARAI/.project | 8 +- LARAI/ant/[LAPTOP]lara_cetus.xml | 1 - LARAI/ant/lara_lalp.xml | 1 - LARAI/ant/larai.xml | 1 - LARAI/ant/larai_cetus.xml | 1 - LARAI/build.gradle | 1 - LARAI/run/[Generate]DefaultWeaver.launch | 1 - LARAI/settings.gradle | 1 - LARAI/src/larai/LaraI.java | 232 +- .../src/org/lara/interpreter/Interpreter.java | 1028 -- .../lara/interpreter/cli/CLIConfigOption.java | 3 +- .../org/lara/interpreter/cli/CLIOption.java | 11 +- .../interpreter/cli/JOptionsInterface.java | 6 - .../lara/interpreter/cli/OptionsParser.java | 52 +- .../generator/js/ExpressionProcessor.java | 48 - .../generator/stmt/AspectClassProcessor.java | 597 - .../generator/stmt/StatementProcessor.java | 376 - .../stmt/WeaverStatementProcessor.java | 493 - .../config/interpreter/LaraIDataStore.java | 7 - .../joptions/gui/LaraLauncher.java | 222 - .../joptions/gui/LaraiLauncherKernel.java | 50 - .../joptions/panels/editor/EditorPanel.java | 602 - .../panels/editor/TextEditorDemo.java | 67 - .../editor/components/ButtonTabComponent.java | 139 - .../panels/editor/components/CloseButton.java | 111 - .../panels/editor/components/DevUtils.java | 46 - .../components/DontAskMeAgainPanel.java | 134 - .../editor/components/EditorToolBar.java | 487 - .../panels/editor/components/Explorer.java | 711 - .../editor/components/ExplorerPopup.java | 54 - .../panels/editor/components/FileNode.java | 71 - .../editor/components/FileNotExistPane.java | 128 - .../LanguageSpecificationSideBar.java | 624 - .../editor/components/OutlinePanel.java | 256 - .../panels/editor/components/ReloadPane.java | 119 - .../panels/editor/components/SearchPanel.java | 144 - .../editor/components/TabbedContextMenu.java | 90 - .../panels/editor/components/WorkDirNode.java | 28 - .../langspecsidebar/LangSpecSorting.java | 21 - .../editor/highlight/EditorConfigurer.java | 275 - .../panels/editor/highlight/EditorParser.java | 172 - .../editor/highlight/LaraTokenMaker.java | 1010 -- .../listeners/DocumentChangedListener.java | 42 - .../editor/listeners/EditorListener.java | 159 - .../editor/listeners/FileTransferHandler.java | 80 - .../listeners/FileTreeCellRenderer.java | 97 - .../panels/editor/listeners/FileWorkers.java | 22 - .../editor/listeners/FocusGainedListener.java | 39 - .../editor/listeners/FocusLostListener.java | 39 - .../editor/listeners/GenericKeyListener.java | 65 - .../editor/listeners/ListenerUtils.java | 78 - .../editor/listeners/StrokesAndActions.java | 78 - .../editor/listeners/TabbedListener.java | 94 - .../listeners/WindowsFocusGainedListener.java | 37 - .../panels/editor/tabbed/MainLaraTab.java | 97 - .../panels/editor/tabbed/SourceTextArea.java | 600 - .../editor/tabbed/TabsContainerPanel.java | 529 - .../editor/utils/ApplicationWorker.java | 165 - .../joptions/panels/editor/utils/Colors.java | 23 - .../panels/editor/utils/EditorKeys.java | 24 - .../joptions/panels/editor/utils/Factory.java | 133 - .../panels/editor/utils/LaraWorker.java | 81 - .../panels/editor/utils/SearchUtils.java | 36 - .../panels/editor/utils/SettingsManager.java | 179 - .../lara/interpreter/utils/LaraIUtils.java | 11 - .../lara/interpreter/utils/SelectUtils.java | 109 - .../interpreter/weaver/LaraWeaverEngine.java | 6 - .../lara/interpreter/weaver/MasterWeaver.java | 62 - .../weaver/events/EventTriggerGenerator.java | 146 - .../src/pt/up/fe/specs/lara/LaraCompiler.java | 117 - .../fe/specs/lara/importer/LaraImporter.java | 31 +- LARAI/src/utils/LARASystem.java | 14 - LanguageSpecification/.classpath | 7 +- LanguageSpecification/.project | 2 +- .../language/specification/dsl/Action.java | 3 - LaraApi/.classpath | 18 +- LaraApi/.project | 8 +- LaraAst/.project | 2 +- LaraCommonLanguage/.project | 2 +- LaraCommonLanguageApi/.project | 2 +- LaraDoc/.classpath | 36 - LaraDoc/.project | 35 - LaraDoc/JsDoc.js | 2 - LaraDoc/build.gradle | 70 - LaraDoc/ivy.xml | 36 - LaraDoc/resources/lara/doc/JsDoc.js | 42 - LaraDoc/resources/lara/doc/index.html | 35 - .../resources/lara/doc/jquery-3.6.4.min.js | 2 - LaraDoc/resources/lara/doc/styles.css | 176 - .../resources/lara/doc/test/comments_examples | 63 - .../pt/up/fe/specs/lara/doc/docExample.js | 121 - .../pt/up/fe/specs/lara/doc/docExample2.js | 6 - LaraDoc/run/LaraDocLauncher.launch | 18 - LaraDoc/settings.gradle | 14 - .../specs/lara/doc/AspectIrDocLauncher.java | 94 - .../fe/specs/lara/doc/CreateJsLauncher.java | 58 - .../pt/up/fe/specs/lara/doc/JsDocHelper.java | 51 - .../src/pt/up/fe/specs/lara/doc/LaraDoc.java | 355 - .../specs/lara/doc/LaraDocHtmlGenerator.java | 391 - .../up/fe/specs/lara/doc/LaraDocLauncher.java | 162 - .../up/fe/specs/lara/doc/LaraDocResource.java | 49 - .../src/pt/up/fe/specs/lara/doc/LaraDocs.java | 55 - .../src/pt/up/fe/specs/lara/doc/LaraToJs.java | 312 - .../pt/up/fe/specs/lara/doc/PackagesMap.java | 98 - .../specs/lara/doc/aspectir/AspectIrDoc.java | 202 - .../lara/doc/aspectir/AspectIrDocBuilder.java | 196 - .../lara/doc/aspectir/AspectIrElement.java | 32 - .../doc/aspectir/AspectIrElementType.java | 21 - .../lara/doc/aspectir/AspectIrParser.java | 513 - .../fe/specs/lara/doc/aspectir/BaseNodes.java | 38 - .../specs/lara/doc/aspectir/BaseVisitor.java | 90 - .../fe/specs/lara/doc/aspectir/ExtraOp.java | 36 - .../aspectir/elements/AAspectIrElement.java | 39 - .../doc/aspectir/elements/AspectElement.java | 35 - .../aspectir/elements/AssignmentElement.java | 82 - .../doc/aspectir/elements/ClassElement.java | 82 - .../elements/FunctionDeclElement.java | 30 - .../lara/doc/aspectir/elements/NamedType.java | 10 - .../aspectir/elements/StatementElement.java | 16 - .../doc/aspectir/elements/VarDeclElement.java | 51 - .../lara/doc/comments/LaraCommentsParser.java | 251 - .../lara/doc/comments/LaraDocComment.java | 206 - .../fe/specs/lara/doc/data/LaraDocBundle.java | 85 - .../fe/specs/lara/doc/data/LaraDocFiles.java | 228 - .../up/fe/specs/lara/doc/data/LaraDocJs.java | 67 - .../fe/specs/lara/doc/data/LaraDocModule.java | 175 - .../fe/specs/lara/doc/data/LaraDocNode.java | 202 - .../specs/lara/doc/data/LaraDocPackage.java | 116 - .../up/fe/specs/lara/doc/data/LaraDocTop.java | 29 - .../specs/lara/doc/esprima/EsprimaParser.java | 342 - .../html/StaticPageLaraDocHtmlGenerator.java | 630 - .../up/fe/specs/lara/doc/jsdoc/JsDocTag.java | 125 - .../lara/doc/jsdoc/JsDocTagLineParser.java | 22 - .../fe/specs/lara/doc/jsdoc/JsDocTagName.java | 52 - .../specs/lara/doc/jsdoc/JsDocTagParser.java | 166 - .../lara/doc/jsdoc/JsDocTagProperty.java | 41 - .../lara/doc/jsdoc/JsDocTagStringParsers.java | 31 - .../specs/lara/doc/jsdoc/data/ParamData.java | 67 - .../lara/doc/jsdocgen/BasicHtmlGenerator.java | 71 - .../doc/jsdocgen/DocumentationGenerator.java | 126 - .../lara/doc/jsdocgen/DummyGenerator.java | 60 - .../lara/doc/jsdocgen/JsDocGenerator.java | 66 - .../lara/doc/jsdocgen/JsDocNodeGenerator.java | 125 - .../jsdocgen/basichtml/HtmlGenerators.java | 347 - .../jsdocgen/basichtml/LaraModuleBuilder.java | 230 - .../doc/jsdocgen/basichtml/TocBuilder.java | 90 - .../lara/doc/launcher/LaraDocKernel.java | 33 - .../specs/lara/doc/launcher/LaraDocKeys.java | 38 - .../lara/doc/launcher/LaraDocLauncher.java | 46 - .../specs/lara/doc/parser/LaraDocParser.java | 356 - .../pt/up/fe/specs/lara/doc/JsDocTester.java | 41 - LaraFramework/.classpath | 14 +- LaraFramework/.project | 2 +- LaraFramework/build.gradle | 3 - LaraFramework/settings.gradle | 3 - .../pt/up/fe/specs/lara/WeaverLauncher.java | 64 - LaraLoc/.classpath | 18 - LaraLoc/.project | 34 - LaraLoc/build.gradle | 44 - LaraLoc/settings.gradle | 9 - .../src/pt/up/fe/specs/lara/loc/LaraLoc.java | 172 - .../pt/up/fe/specs/lara/loc/LaraStats.java | 83 - .../lara/loc/visitors/CommentVisitor.java | 150 - .../lara/loc/visitors/FunctionsVisitor.java | 48 - .../lara/loc/visitors/StatementsVisitor.java | 59 - LaraParser/.classpath | 19 - LaraParser/.project | 35 - LaraParser/EsprimaNodes.xlsx | Bin 10738 -> 0 bytes LaraParser/commands.build | 9 - LaraParser/ivy.xml | 33 - .../fe/specs/lara/parser/escodegen.browser.js | 5081 ------ .../pt/up/fe/specs/lara/parser/esprima.js | 6709 ------- .../up/fe/specs/lara/parser/esprima_lara.js | 3 - .../fe/specs/lara/parser/parseJavascript.js | 2 - .../lara/parser/test/jetstream2/poker.js | 316 - .../up/fe/specs/lara/parser/test/js/module.js | 0 .../up/fe/specs/lara/parser/test/js/script.js | 12 - .../parser/test/lara/CheatSheetAspect.lara | 52 - .../fe/specs/lara/parser/EsprimaJsParser.java | 90 - .../specs/lara/parser/JavaCCLaraParser.java | 44 - .../up/fe/specs/lara/parser/LaraParser.java | 34 - .../specs/lara/parser/LaraParserResource.java | 53 - .../lara/parser/esprima/ConverterUtils.java | 69 - .../lara/parser/esprima/EsprimaConverter.java | 106 - .../parser/esprima/EsprimaConverterData.java | 31 - .../lara/parser/esprima/EsprimaUtils.java | 282 - .../esprima/LaraNodeClassesService.java | 46 - .../esprima/parsers/ExpressionParsers.java | 42 - .../esprima/parsers/GeneralParsers.java | 76 - .../esprima/parsers/StatementParsers.java | 41 - .../parser/esprima/parsers/ValuesParsers.java | 43 - .../lara/parser/javacc/LARAEcmaScript.jjt | 3417 ---- .../specs/lara/parser/javacc/ast/.gitignore | 106 - .../parser/javacc/ast/LARAParserBase.java | 157 - .../lara/parser/Jetstream2ParserTest.java | 47 - .../up/fe/specs/lara/parser/JsParserTest.java | 52 - .../specs/lara/parser/LaraParserTester.java | 48 - .../specs/lara/parser/test/ParserTester.java | 59 - LaraUnit/.classpath | 18 - LaraUnit/.project | 35 - LaraUnit/build.gradle | 55 - LaraUnit/ivy.xml | 33 - .../lara/unit/resources/test_aspect.lara | 11 - LaraUnit/settings.gradle | 10 - .../pt/up/fe/specs/lara/unit/LaraArgs.java | 236 - .../lara/unit/LaraUnitHarnessBuilder.java | 262 - .../fe/specs/lara/unit/LaraUnitLauncher.java | 220 - .../fe/specs/lara/unit/LaraUnitOptions.java | 60 - .../up/fe/specs/lara/unit/LaraUnitReport.java | 133 - .../fe/specs/lara/unit/LaraUnitResource.java | 46 - .../up/fe/specs/lara/unit/LaraUnitTester.java | 115 - .../pt/up/fe/specs/lara/unit/TestResult.java | 103 - LaraUtils/.project | 2 +- Support/javacc/javacc-5.jar | Bin 298569 -> 0 bytes WeaverGenerator/.classpath | 29 +- WeaverGenerator/.project | 2 +- WeaverInterface/.project | 2 +- .../config/interpreter/LaraiKeys.java | 12 +- .../weaver/events/EventTrigger.java | 1 - 399 files changed, 105 insertions(+), 94783 deletions(-) delete mode 100644 LARAC/.project delete mode 100644 LARAC/.settings/sf.eclipse.javacc.prefs~ delete mode 100644 LARAC/ant/WeaverGenerator_cetus.xml delete mode 100644 LARAC/ant/lara_Weaver.xml delete mode 100644 LARAC/commands.build delete mode 100644 LARAC/deploy/LaraC-deploy.launch delete mode 100644 LARAC/deploy/LaraC.deploy delete mode 100644 LARAC/diagrams/CD.cld delete mode 100644 LARAC/diagrams/Class.atxa delete mode 100644 LARAC/diagrams/Layered.atxa delete mode 100644 LARAC/ivy.xml delete mode 100644 LARAC/launchers/[LARAC]Test.launch delete mode 100644 LARAC/src/applet/GUI.java delete mode 100644 LARAC/src/larac/LARACLauncher.java delete mode 100644 LARAC/src/larac/LaraC.java delete mode 100644 LARAC/src/larac/code/AspectIrToLara.java delete mode 100644 LARAC/src/larac/code/CodeElems.java delete mode 100644 LARAC/src/larac/exceptions/AspectIRException.java delete mode 100644 LARAC/src/larac/exceptions/LARACompilerException.java delete mode 100644 LARAC/src/larac/exceptions/LaraException.java delete mode 100644 LARAC/src/larac/exceptions/OptionException.java delete mode 100644 LARAC/src/larac/exceptions/ParseExceptionData.java delete mode 100644 LARAC/src/larac/exceptions/StopParseException.java delete mode 100644 LARAC/src/larac/exceptions/SyntaxException.java delete mode 100644 LARAC/src/larac/imports/FileLaraImport.java delete mode 100644 LARAC/src/larac/imports/LaraImport.java delete mode 100644 LARAC/src/larac/imports/LaraImports.java delete mode 100644 LARAC/src/larac/imports/ResourceLaraImport.java delete mode 100644 LARAC/src/larac/objects/Enums.java delete mode 100644 LARAC/src/larac/objects/SymbolTable.java delete mode 100644 LARAC/src/larac/objects/Variable.java delete mode 100644 LARAC/src/larac/options/LaraCOptions.java delete mode 100644 LARAC/src/larac/options/LaraOptionProvider.java delete mode 100644 LARAC/src/larac/options/optionprovider/ArgOption.java delete mode 100644 LARAC/src/larac/options/optionprovider/Descriptor.java delete mode 100644 LARAC/src/larac/options/optionprovider/OptionProvider.java delete mode 100644 LARAC/src/larac/options/optionprovider/OptionUtils.java delete mode 100644 LARAC/src/larac/options/resources/InputStreamProvider.java delete mode 100644 LARAC/src/larac/structure/AspectIR.java delete mode 100644 LARAC/src/larac/structure/AspectView.java delete mode 100644 LARAC/src/larac/utils/FileUtils.java delete mode 100644 LARAC/src/larac/utils/OrganizeUtils.java delete mode 100644 LARAC/src/larac/utils/Organizer.java delete mode 100644 LARAC/src/larac/utils/xml/AspectIRFactory.java delete mode 100644 LARAC/src/larac/utils/xml/Pair.java delete mode 100644 LARAC/src/larac/utils/xml/entity/ActionArgument.java delete mode 100644 LARAC/src/larac/utils/xml/entity/Artifact.java delete mode 100644 LARAC/src/larac/utils/xml/entity/Attribute.java delete mode 100644 LARAC/src/org/dojo/jsl/parser/LARAEcmaScript.jjt delete mode 100644 LARAC/src/org/dojo/jsl/parser/ast/.gitignore delete mode 100644 LARAC/src/org/dojo/jsl/parser/ast/ASTANDFiltersExpr.java delete mode 100644 LARAC/src/org/dojo/jsl/parser/ast/ASTAction.java delete mode 100644 LARAC/src/org/dojo/jsl/parser/ast/ASTActionParameterList.java delete mode 100644 LARAC/src/org/dojo/jsl/parser/ast/ASTAllocationExpression.java delete mode 100644 LARAC/src/org/dojo/jsl/parser/ast/ASTAndExpressionSequence.java delete mode 100644 LARAC/src/org/dojo/jsl/parser/ast/ASTApplies.java delete mode 100644 LARAC/src/org/dojo/jsl/parser/ast/ASTApply.java delete mode 100644 LARAC/src/org/dojo/jsl/parser/ast/ASTAroundApply.java delete mode 100644 LARAC/src/org/dojo/jsl/parser/ast/ASTArrayLiteral.java delete mode 100644 LARAC/src/org/dojo/jsl/parser/ast/ASTArrowFunctionExpression.java delete mode 100644 LARAC/src/org/dojo/jsl/parser/ast/ASTAspectDef.java delete mode 100644 LARAC/src/org/dojo/jsl/parser/ast/ASTAssignmentExpression.java delete mode 100644 LARAC/src/org/dojo/jsl/parser/ast/ASTBinaryExpressionSequence.java delete mode 100644 LARAC/src/org/dojo/jsl/parser/ast/ASTBlock.java delete mode 100644 LARAC/src/org/dojo/jsl/parser/ast/ASTBreakStatement.java delete mode 100644 LARAC/src/org/dojo/jsl/parser/ast/ASTCall.java delete mode 100644 LARAC/src/org/dojo/jsl/parser/ast/ASTCaseGroup.java delete mode 100644 LARAC/src/org/dojo/jsl/parser/ast/ASTCaseGroups.java delete mode 100644 LARAC/src/org/dojo/jsl/parser/ast/ASTCaseGuard.java delete mode 100644 LARAC/src/org/dojo/jsl/parser/ast/ASTCatchClause.java delete mode 100644 LARAC/src/org/dojo/jsl/parser/ast/ASTCheck.java delete mode 100644 LARAC/src/org/dojo/jsl/parser/ast/ASTCmd.java delete mode 100644 LARAC/src/org/dojo/jsl/parser/ast/ASTCode.java delete mode 100644 LARAC/src/org/dojo/jsl/parser/ast/ASTCodeDef.java delete mode 100644 LARAC/src/org/dojo/jsl/parser/ast/ASTCompositeReference.java delete mode 100644 LARAC/src/org/dojo/jsl/parser/ast/ASTCondition.java delete mode 100644 LARAC/src/org/dojo/jsl/parser/ast/ASTConditionalExpression.java delete mode 100644 LARAC/src/org/dojo/jsl/parser/ast/ASTContinueStatement.java delete mode 100644 LARAC/src/org/dojo/jsl/parser/ast/ASTDefine.java delete mode 100644 LARAC/src/org/dojo/jsl/parser/ast/ASTDoStatement.java delete mode 100644 LARAC/src/org/dojo/jsl/parser/ast/ASTEmptyExpression.java delete mode 100644 LARAC/src/org/dojo/jsl/parser/ast/ASTEmptyPositions.java delete mode 100644 LARAC/src/org/dojo/jsl/parser/ast/ASTEmptyStatement.java delete mode 100644 LARAC/src/org/dojo/jsl/parser/ast/ASTExpressionList.java delete mode 100644 LARAC/src/org/dojo/jsl/parser/ast/ASTExpressionStatement.java delete mode 100644 LARAC/src/org/dojo/jsl/parser/ast/ASTFilePath.java delete mode 100644 LARAC/src/org/dojo/jsl/parser/ast/ASTFilter.java delete mode 100644 LARAC/src/org/dojo/jsl/parser/ast/ASTFinalize.java delete mode 100644 LARAC/src/org/dojo/jsl/parser/ast/ASTFinallyClause.java delete mode 100644 LARAC/src/org/dojo/jsl/parser/ast/ASTFor.java delete mode 100644 LARAC/src/org/dojo/jsl/parser/ast/ASTForConditionList.java delete mode 100644 LARAC/src/org/dojo/jsl/parser/ast/ASTForInStatement.java delete mode 100644 LARAC/src/org/dojo/jsl/parser/ast/ASTForStatement.java delete mode 100644 LARAC/src/org/dojo/jsl/parser/ast/ASTForVarInStatement.java delete mode 100644 LARAC/src/org/dojo/jsl/parser/ast/ASTForVarStatement.java delete mode 100644 LARAC/src/org/dojo/jsl/parser/ast/ASTFormalParameterList.java delete mode 100644 LARAC/src/org/dojo/jsl/parser/ast/ASTFunctionCallParameters.java delete mode 100644 LARAC/src/org/dojo/jsl/parser/ast/ASTFunctionDeclaration.java delete mode 100644 LARAC/src/org/dojo/jsl/parser/ast/ASTFunctionExpression.java delete mode 100644 LARAC/src/org/dojo/jsl/parser/ast/ASTGeneratorFunctionDeclaration.java delete mode 100644 LARAC/src/org/dojo/jsl/parser/ast/ASTGeneratorFunctionExpression.java delete mode 100644 LARAC/src/org/dojo/jsl/parser/ast/ASTIdentifier.java delete mode 100644 LARAC/src/org/dojo/jsl/parser/ast/ASTIfStatement.java delete mode 100644 LARAC/src/org/dojo/jsl/parser/ast/ASTImport.java delete mode 100644 LARAC/src/org/dojo/jsl/parser/ast/ASTInclude.java delete mode 100644 LARAC/src/org/dojo/jsl/parser/ast/ASTInitialize.java delete mode 100644 LARAC/src/org/dojo/jsl/parser/ast/ASTInput.java delete mode 100644 LARAC/src/org/dojo/jsl/parser/ast/ASTInputList.java delete mode 100644 LARAC/src/org/dojo/jsl/parser/ast/ASTInsert.java delete mode 100644 LARAC/src/org/dojo/jsl/parser/ast/ASTJavaScript.java delete mode 100644 LARAC/src/org/dojo/jsl/parser/ast/ASTJoin.java delete mode 100644 LARAC/src/org/dojo/jsl/parser/ast/ASTLabelledStatement.java delete mode 100644 LARAC/src/org/dojo/jsl/parser/ast/ASTLiteral.java delete mode 100644 LARAC/src/org/dojo/jsl/parser/ast/ASTLiteralField.java delete mode 100644 LARAC/src/org/dojo/jsl/parser/ast/ASTNamedArgument.java delete mode 100644 LARAC/src/org/dojo/jsl/parser/ast/ASTNaturalJoin.java delete mode 100644 LARAC/src/org/dojo/jsl/parser/ast/ASTORJPExpr.java delete mode 100644 LARAC/src/org/dojo/jsl/parser/ast/ASTObjectLiteral.java delete mode 100644 LARAC/src/org/dojo/jsl/parser/ast/ASTOperator.java delete mode 100644 LARAC/src/org/dojo/jsl/parser/ast/ASTOrExpressionSequence.java delete mode 100644 LARAC/src/org/dojo/jsl/parser/ast/ASTOrFiltersExpr.java delete mode 100644 LARAC/src/org/dojo/jsl/parser/ast/ASTOutput.java delete mode 100644 LARAC/src/org/dojo/jsl/parser/ast/ASTOutputAct.java delete mode 100644 LARAC/src/org/dojo/jsl/parser/ast/ASTParenExpression.java delete mode 100644 LARAC/src/org/dojo/jsl/parser/ast/ASTPerform.java delete mode 100644 LARAC/src/org/dojo/jsl/parser/ast/ASTPointcut.java delete mode 100644 LARAC/src/org/dojo/jsl/parser/ast/ASTPointcutFilters.java delete mode 100644 LARAC/src/org/dojo/jsl/parser/ast/ASTPostAssignmentList.java delete mode 100644 LARAC/src/org/dojo/jsl/parser/ast/ASTPostfixExpression.java delete mode 100644 LARAC/src/org/dojo/jsl/parser/ast/ASTPreAssignmentList.java delete mode 100644 LARAC/src/org/dojo/jsl/parser/ast/ASTPropertyIdentifierReference.java delete mode 100644 LARAC/src/org/dojo/jsl/parser/ast/ASTPropertyValueReference.java delete mode 100644 LARAC/src/org/dojo/jsl/parser/ast/ASTReturnStatement.java delete mode 100644 LARAC/src/org/dojo/jsl/parser/ast/ASTRun.java delete mode 100644 LARAC/src/org/dojo/jsl/parser/ast/ASTSecondSetOp.java delete mode 100644 LARAC/src/org/dojo/jsl/parser/ast/ASTSelect.java delete mode 100644 LARAC/src/org/dojo/jsl/parser/ast/ASTStart.java delete mode 100644 LARAC/src/org/dojo/jsl/parser/ast/ASTStatementList.java delete mode 100644 LARAC/src/org/dojo/jsl/parser/ast/ASTStatic.java delete mode 100644 LARAC/src/org/dojo/jsl/parser/ast/ASTSwitchStatement.java delete mode 100644 LARAC/src/org/dojo/jsl/parser/ast/ASTThirdSetOp.java delete mode 100644 LARAC/src/org/dojo/jsl/parser/ast/ASTThisReference.java delete mode 100644 LARAC/src/org/dojo/jsl/parser/ast/ASTThrowStatement.java delete mode 100644 LARAC/src/org/dojo/jsl/parser/ast/ASTTo.java delete mode 100644 LARAC/src/org/dojo/jsl/parser/ast/ASTTryStatement.java delete mode 100644 LARAC/src/org/dojo/jsl/parser/ast/ASTUnaryExpression.java delete mode 100644 LARAC/src/org/dojo/jsl/parser/ast/ASTVariableDeclaration.java delete mode 100644 LARAC/src/org/dojo/jsl/parser/ast/ASTVariableDeclarationList.java delete mode 100644 LARAC/src/org/dojo/jsl/parser/ast/ASTVariableStatement.java delete mode 100644 LARAC/src/org/dojo/jsl/parser/ast/ASTWhileStatement.java delete mode 100644 LARAC/src/org/dojo/jsl/parser/ast/ASTWithStatement.java delete mode 100644 LARAC/src/org/dojo/jsl/parser/ast/ASTYieldStar.java delete mode 100644 LARAC/src/org/dojo/jsl/parser/ast/ASTYieldStatement.java delete mode 100644 LARAC/src/org/dojo/jsl/parser/ast/JJTLARAEcmaScriptState.java delete mode 100644 LARAC/src/org/dojo/jsl/parser/ast/JavaCharStream.java delete mode 100644 LARAC/src/org/dojo/jsl/parser/ast/LARAEcmaScript.html delete mode 100644 LARAC/src/org/dojo/jsl/parser/ast/LARAEcmaScript.java delete mode 100644 LARAC/src/org/dojo/jsl/parser/ast/LARAEcmaScript.jj delete mode 100644 LARAC/src/org/dojo/jsl/parser/ast/LARAEcmaScriptConstants.java delete mode 100644 LARAC/src/org/dojo/jsl/parser/ast/LARAEcmaScriptTokenManager.java delete mode 100644 LARAC/src/org/dojo/jsl/parser/ast/LARAEcmaScriptTreeConstants.java delete mode 100644 LARAC/src/org/dojo/jsl/parser/ast/LARAParserBase.java delete mode 100644 LARAC/src/org/dojo/jsl/parser/ast/Node.java delete mode 100644 LARAC/src/org/dojo/jsl/parser/ast/ParseException.java delete mode 100644 LARAC/src/org/dojo/jsl/parser/ast/SimpleNode.java delete mode 100644 LARAC/src/org/dojo/jsl/parser/ast/Token.java delete mode 100644 LARAC/src/org/dojo/jsl/parser/ast/TokenMgrError.java delete mode 100644 LARAC/src/org/dojo/jsl/parser/ast/utils/ASTJSImport.java delete mode 100644 LARAC/src/org/dojo/jsl/parser/ast/utils/ASTLaraImport.java delete mode 100644 LARAC/src/org/dojo/jsl/parser/ast/utils/ASTScriptImport.java delete mode 100644 LARAC/src/org/dojo/jsl/parser/ast/utils/LARACConstantPool.java delete mode 100644 LARAC/src/org/dojo/jsl/parser/ast/utils/LaraCNodeFactory.java delete mode 100644 LARAC/test/specs/actionModel.xml delete mode 100644 LARAC/test/specs/artifacts.xml delete mode 100644 LARAC/test/specs/joinPointModel.xml delete mode 100644 LARAI/src/org/lara/interpreter/generator/js/ExpressionProcessor.java delete mode 100644 LARAI/src/org/lara/interpreter/generator/stmt/AspectClassProcessor.java delete mode 100644 LARAI/src/org/lara/interpreter/generator/stmt/StatementProcessor.java delete mode 100644 LARAI/src/org/lara/interpreter/generator/stmt/WeaverStatementProcessor.java delete mode 100644 LARAI/src/org/lara/interpreter/joptions/gui/LaraLauncher.java delete mode 100644 LARAI/src/org/lara/interpreter/joptions/gui/LaraiLauncherKernel.java delete mode 100644 LARAI/src/org/lara/interpreter/joptions/panels/editor/EditorPanel.java delete mode 100644 LARAI/src/org/lara/interpreter/joptions/panels/editor/TextEditorDemo.java delete mode 100644 LARAI/src/org/lara/interpreter/joptions/panels/editor/components/ButtonTabComponent.java delete mode 100644 LARAI/src/org/lara/interpreter/joptions/panels/editor/components/CloseButton.java delete mode 100644 LARAI/src/org/lara/interpreter/joptions/panels/editor/components/DevUtils.java delete mode 100644 LARAI/src/org/lara/interpreter/joptions/panels/editor/components/DontAskMeAgainPanel.java delete mode 100644 LARAI/src/org/lara/interpreter/joptions/panels/editor/components/EditorToolBar.java delete mode 100644 LARAI/src/org/lara/interpreter/joptions/panels/editor/components/Explorer.java delete mode 100644 LARAI/src/org/lara/interpreter/joptions/panels/editor/components/ExplorerPopup.java delete mode 100644 LARAI/src/org/lara/interpreter/joptions/panels/editor/components/FileNode.java delete mode 100644 LARAI/src/org/lara/interpreter/joptions/panels/editor/components/FileNotExistPane.java delete mode 100644 LARAI/src/org/lara/interpreter/joptions/panels/editor/components/LanguageSpecificationSideBar.java delete mode 100644 LARAI/src/org/lara/interpreter/joptions/panels/editor/components/OutlinePanel.java delete mode 100644 LARAI/src/org/lara/interpreter/joptions/panels/editor/components/ReloadPane.java delete mode 100644 LARAI/src/org/lara/interpreter/joptions/panels/editor/components/SearchPanel.java delete mode 100644 LARAI/src/org/lara/interpreter/joptions/panels/editor/components/TabbedContextMenu.java delete mode 100644 LARAI/src/org/lara/interpreter/joptions/panels/editor/components/WorkDirNode.java delete mode 100644 LARAI/src/org/lara/interpreter/joptions/panels/editor/components/langspecsidebar/LangSpecSorting.java delete mode 100644 LARAI/src/org/lara/interpreter/joptions/panels/editor/highlight/EditorConfigurer.java delete mode 100644 LARAI/src/org/lara/interpreter/joptions/panels/editor/highlight/EditorParser.java delete mode 100644 LARAI/src/org/lara/interpreter/joptions/panels/editor/highlight/LaraTokenMaker.java delete mode 100644 LARAI/src/org/lara/interpreter/joptions/panels/editor/listeners/DocumentChangedListener.java delete mode 100644 LARAI/src/org/lara/interpreter/joptions/panels/editor/listeners/EditorListener.java delete mode 100644 LARAI/src/org/lara/interpreter/joptions/panels/editor/listeners/FileTransferHandler.java delete mode 100644 LARAI/src/org/lara/interpreter/joptions/panels/editor/listeners/FileTreeCellRenderer.java delete mode 100644 LARAI/src/org/lara/interpreter/joptions/panels/editor/listeners/FileWorkers.java delete mode 100644 LARAI/src/org/lara/interpreter/joptions/panels/editor/listeners/FocusGainedListener.java delete mode 100644 LARAI/src/org/lara/interpreter/joptions/panels/editor/listeners/FocusLostListener.java delete mode 100644 LARAI/src/org/lara/interpreter/joptions/panels/editor/listeners/GenericKeyListener.java delete mode 100644 LARAI/src/org/lara/interpreter/joptions/panels/editor/listeners/ListenerUtils.java delete mode 100644 LARAI/src/org/lara/interpreter/joptions/panels/editor/listeners/StrokesAndActions.java delete mode 100644 LARAI/src/org/lara/interpreter/joptions/panels/editor/listeners/TabbedListener.java delete mode 100644 LARAI/src/org/lara/interpreter/joptions/panels/editor/listeners/WindowsFocusGainedListener.java delete mode 100644 LARAI/src/org/lara/interpreter/joptions/panels/editor/tabbed/MainLaraTab.java delete mode 100644 LARAI/src/org/lara/interpreter/joptions/panels/editor/tabbed/SourceTextArea.java delete mode 100644 LARAI/src/org/lara/interpreter/joptions/panels/editor/tabbed/TabsContainerPanel.java delete mode 100644 LARAI/src/org/lara/interpreter/joptions/panels/editor/utils/ApplicationWorker.java delete mode 100644 LARAI/src/org/lara/interpreter/joptions/panels/editor/utils/Colors.java delete mode 100644 LARAI/src/org/lara/interpreter/joptions/panels/editor/utils/EditorKeys.java delete mode 100644 LARAI/src/org/lara/interpreter/joptions/panels/editor/utils/Factory.java delete mode 100644 LARAI/src/org/lara/interpreter/joptions/panels/editor/utils/LaraWorker.java delete mode 100644 LARAI/src/org/lara/interpreter/joptions/panels/editor/utils/SearchUtils.java delete mode 100644 LARAI/src/org/lara/interpreter/joptions/panels/editor/utils/SettingsManager.java delete mode 100644 LARAI/src/org/lara/interpreter/utils/SelectUtils.java delete mode 100644 LARAI/src/org/lara/interpreter/weaver/events/EventTriggerGenerator.java delete mode 100644 LARAI/src/pt/up/fe/specs/lara/LaraCompiler.java delete mode 100644 LaraDoc/.classpath delete mode 100644 LaraDoc/.project delete mode 100644 LaraDoc/JsDoc.js delete mode 100644 LaraDoc/build.gradle delete mode 100644 LaraDoc/ivy.xml delete mode 100644 LaraDoc/resources/lara/doc/JsDoc.js delete mode 100644 LaraDoc/resources/lara/doc/index.html delete mode 100644 LaraDoc/resources/lara/doc/jquery-3.6.4.min.js delete mode 100644 LaraDoc/resources/lara/doc/styles.css delete mode 100644 LaraDoc/resources/lara/doc/test/comments_examples delete mode 100644 LaraDoc/resources/pt/up/fe/specs/lara/doc/docExample.js delete mode 100644 LaraDoc/resources/pt/up/fe/specs/lara/doc/docExample2.js delete mode 100644 LaraDoc/run/LaraDocLauncher.launch delete mode 100644 LaraDoc/settings.gradle delete mode 100644 LaraDoc/src/pt/up/fe/specs/lara/doc/AspectIrDocLauncher.java delete mode 100644 LaraDoc/src/pt/up/fe/specs/lara/doc/CreateJsLauncher.java delete mode 100644 LaraDoc/src/pt/up/fe/specs/lara/doc/JsDocHelper.java delete mode 100644 LaraDoc/src/pt/up/fe/specs/lara/doc/LaraDoc.java delete mode 100644 LaraDoc/src/pt/up/fe/specs/lara/doc/LaraDocHtmlGenerator.java delete mode 100644 LaraDoc/src/pt/up/fe/specs/lara/doc/LaraDocLauncher.java delete mode 100644 LaraDoc/src/pt/up/fe/specs/lara/doc/LaraDocResource.java delete mode 100644 LaraDoc/src/pt/up/fe/specs/lara/doc/LaraDocs.java delete mode 100644 LaraDoc/src/pt/up/fe/specs/lara/doc/LaraToJs.java delete mode 100644 LaraDoc/src/pt/up/fe/specs/lara/doc/PackagesMap.java delete mode 100644 LaraDoc/src/pt/up/fe/specs/lara/doc/aspectir/AspectIrDoc.java delete mode 100644 LaraDoc/src/pt/up/fe/specs/lara/doc/aspectir/AspectIrDocBuilder.java delete mode 100644 LaraDoc/src/pt/up/fe/specs/lara/doc/aspectir/AspectIrElement.java delete mode 100644 LaraDoc/src/pt/up/fe/specs/lara/doc/aspectir/AspectIrElementType.java delete mode 100644 LaraDoc/src/pt/up/fe/specs/lara/doc/aspectir/AspectIrParser.java delete mode 100644 LaraDoc/src/pt/up/fe/specs/lara/doc/aspectir/BaseNodes.java delete mode 100644 LaraDoc/src/pt/up/fe/specs/lara/doc/aspectir/BaseVisitor.java delete mode 100644 LaraDoc/src/pt/up/fe/specs/lara/doc/aspectir/ExtraOp.java delete mode 100644 LaraDoc/src/pt/up/fe/specs/lara/doc/aspectir/elements/AAspectIrElement.java delete mode 100644 LaraDoc/src/pt/up/fe/specs/lara/doc/aspectir/elements/AspectElement.java delete mode 100644 LaraDoc/src/pt/up/fe/specs/lara/doc/aspectir/elements/AssignmentElement.java delete mode 100644 LaraDoc/src/pt/up/fe/specs/lara/doc/aspectir/elements/ClassElement.java delete mode 100644 LaraDoc/src/pt/up/fe/specs/lara/doc/aspectir/elements/FunctionDeclElement.java delete mode 100644 LaraDoc/src/pt/up/fe/specs/lara/doc/aspectir/elements/NamedType.java delete mode 100644 LaraDoc/src/pt/up/fe/specs/lara/doc/aspectir/elements/StatementElement.java delete mode 100644 LaraDoc/src/pt/up/fe/specs/lara/doc/aspectir/elements/VarDeclElement.java delete mode 100644 LaraDoc/src/pt/up/fe/specs/lara/doc/comments/LaraCommentsParser.java delete mode 100644 LaraDoc/src/pt/up/fe/specs/lara/doc/comments/LaraDocComment.java delete mode 100644 LaraDoc/src/pt/up/fe/specs/lara/doc/data/LaraDocBundle.java delete mode 100644 LaraDoc/src/pt/up/fe/specs/lara/doc/data/LaraDocFiles.java delete mode 100644 LaraDoc/src/pt/up/fe/specs/lara/doc/data/LaraDocJs.java delete mode 100644 LaraDoc/src/pt/up/fe/specs/lara/doc/data/LaraDocModule.java delete mode 100644 LaraDoc/src/pt/up/fe/specs/lara/doc/data/LaraDocNode.java delete mode 100644 LaraDoc/src/pt/up/fe/specs/lara/doc/data/LaraDocPackage.java delete mode 100644 LaraDoc/src/pt/up/fe/specs/lara/doc/data/LaraDocTop.java delete mode 100644 LaraDoc/src/pt/up/fe/specs/lara/doc/esprima/EsprimaParser.java delete mode 100644 LaraDoc/src/pt/up/fe/specs/lara/doc/html/StaticPageLaraDocHtmlGenerator.java delete mode 100644 LaraDoc/src/pt/up/fe/specs/lara/doc/jsdoc/JsDocTag.java delete mode 100644 LaraDoc/src/pt/up/fe/specs/lara/doc/jsdoc/JsDocTagLineParser.java delete mode 100644 LaraDoc/src/pt/up/fe/specs/lara/doc/jsdoc/JsDocTagName.java delete mode 100644 LaraDoc/src/pt/up/fe/specs/lara/doc/jsdoc/JsDocTagParser.java delete mode 100644 LaraDoc/src/pt/up/fe/specs/lara/doc/jsdoc/JsDocTagProperty.java delete mode 100644 LaraDoc/src/pt/up/fe/specs/lara/doc/jsdoc/JsDocTagStringParsers.java delete mode 100644 LaraDoc/src/pt/up/fe/specs/lara/doc/jsdoc/data/ParamData.java delete mode 100644 LaraDoc/src/pt/up/fe/specs/lara/doc/jsdocgen/BasicHtmlGenerator.java delete mode 100644 LaraDoc/src/pt/up/fe/specs/lara/doc/jsdocgen/DocumentationGenerator.java delete mode 100644 LaraDoc/src/pt/up/fe/specs/lara/doc/jsdocgen/DummyGenerator.java delete mode 100644 LaraDoc/src/pt/up/fe/specs/lara/doc/jsdocgen/JsDocGenerator.java delete mode 100644 LaraDoc/src/pt/up/fe/specs/lara/doc/jsdocgen/JsDocNodeGenerator.java delete mode 100644 LaraDoc/src/pt/up/fe/specs/lara/doc/jsdocgen/basichtml/HtmlGenerators.java delete mode 100644 LaraDoc/src/pt/up/fe/specs/lara/doc/jsdocgen/basichtml/LaraModuleBuilder.java delete mode 100644 LaraDoc/src/pt/up/fe/specs/lara/doc/jsdocgen/basichtml/TocBuilder.java delete mode 100644 LaraDoc/src/pt/up/fe/specs/lara/doc/launcher/LaraDocKernel.java delete mode 100644 LaraDoc/src/pt/up/fe/specs/lara/doc/launcher/LaraDocKeys.java delete mode 100644 LaraDoc/src/pt/up/fe/specs/lara/doc/launcher/LaraDocLauncher.java delete mode 100644 LaraDoc/src/pt/up/fe/specs/lara/doc/parser/LaraDocParser.java delete mode 100644 LaraDoc/test/pt/up/fe/specs/lara/doc/JsDocTester.java delete mode 100644 LaraLoc/.classpath delete mode 100644 LaraLoc/.project delete mode 100644 LaraLoc/build.gradle delete mode 100644 LaraLoc/settings.gradle delete mode 100644 LaraLoc/src/pt/up/fe/specs/lara/loc/LaraLoc.java delete mode 100644 LaraLoc/src/pt/up/fe/specs/lara/loc/LaraStats.java delete mode 100644 LaraLoc/src/pt/up/fe/specs/lara/loc/visitors/CommentVisitor.java delete mode 100644 LaraLoc/src/pt/up/fe/specs/lara/loc/visitors/FunctionsVisitor.java delete mode 100644 LaraLoc/src/pt/up/fe/specs/lara/loc/visitors/StatementsVisitor.java delete mode 100644 LaraParser/.classpath delete mode 100644 LaraParser/.project delete mode 100644 LaraParser/EsprimaNodes.xlsx delete mode 100644 LaraParser/commands.build delete mode 100644 LaraParser/ivy.xml delete mode 100644 LaraParser/resources/pt/up/fe/specs/lara/parser/escodegen.browser.js delete mode 100644 LaraParser/resources/pt/up/fe/specs/lara/parser/esprima.js delete mode 100644 LaraParser/resources/pt/up/fe/specs/lara/parser/esprima_lara.js delete mode 100644 LaraParser/resources/pt/up/fe/specs/lara/parser/parseJavascript.js delete mode 100644 LaraParser/resources/pt/up/fe/specs/lara/parser/test/jetstream2/poker.js delete mode 100644 LaraParser/resources/pt/up/fe/specs/lara/parser/test/js/module.js delete mode 100644 LaraParser/resources/pt/up/fe/specs/lara/parser/test/js/script.js delete mode 100644 LaraParser/resources/pt/up/fe/specs/lara/parser/test/lara/CheatSheetAspect.lara delete mode 100644 LaraParser/src/pt/up/fe/specs/lara/parser/EsprimaJsParser.java delete mode 100644 LaraParser/src/pt/up/fe/specs/lara/parser/JavaCCLaraParser.java delete mode 100644 LaraParser/src/pt/up/fe/specs/lara/parser/LaraParser.java delete mode 100644 LaraParser/src/pt/up/fe/specs/lara/parser/LaraParserResource.java delete mode 100644 LaraParser/src/pt/up/fe/specs/lara/parser/esprima/ConverterUtils.java delete mode 100644 LaraParser/src/pt/up/fe/specs/lara/parser/esprima/EsprimaConverter.java delete mode 100644 LaraParser/src/pt/up/fe/specs/lara/parser/esprima/EsprimaConverterData.java delete mode 100644 LaraParser/src/pt/up/fe/specs/lara/parser/esprima/EsprimaUtils.java delete mode 100644 LaraParser/src/pt/up/fe/specs/lara/parser/esprima/LaraNodeClassesService.java delete mode 100644 LaraParser/src/pt/up/fe/specs/lara/parser/esprima/parsers/ExpressionParsers.java delete mode 100644 LaraParser/src/pt/up/fe/specs/lara/parser/esprima/parsers/GeneralParsers.java delete mode 100644 LaraParser/src/pt/up/fe/specs/lara/parser/esprima/parsers/StatementParsers.java delete mode 100644 LaraParser/src/pt/up/fe/specs/lara/parser/esprima/parsers/ValuesParsers.java delete mode 100644 LaraParser/src/pt/up/fe/specs/lara/parser/javacc/LARAEcmaScript.jjt delete mode 100644 LaraParser/src/pt/up/fe/specs/lara/parser/javacc/ast/.gitignore delete mode 100644 LaraParser/src/pt/up/fe/specs/lara/parser/javacc/ast/LARAParserBase.java delete mode 100644 LaraParser/test/pt/up/fe/specs/lara/parser/Jetstream2ParserTest.java delete mode 100644 LaraParser/test/pt/up/fe/specs/lara/parser/JsParserTest.java delete mode 100644 LaraParser/test/pt/up/fe/specs/lara/parser/LaraParserTester.java delete mode 100644 LaraParser/test/pt/up/fe/specs/lara/parser/test/ParserTester.java delete mode 100644 LaraUnit/.classpath delete mode 100644 LaraUnit/.project delete mode 100644 LaraUnit/build.gradle delete mode 100644 LaraUnit/ivy.xml delete mode 100644 LaraUnit/resources/pt/up/fe/specs/lara/unit/resources/test_aspect.lara delete mode 100644 LaraUnit/settings.gradle delete mode 100644 LaraUnit/src/pt/up/fe/specs/lara/unit/LaraArgs.java delete mode 100644 LaraUnit/src/pt/up/fe/specs/lara/unit/LaraUnitHarnessBuilder.java delete mode 100644 LaraUnit/src/pt/up/fe/specs/lara/unit/LaraUnitLauncher.java delete mode 100644 LaraUnit/src/pt/up/fe/specs/lara/unit/LaraUnitOptions.java delete mode 100644 LaraUnit/src/pt/up/fe/specs/lara/unit/LaraUnitReport.java delete mode 100644 LaraUnit/src/pt/up/fe/specs/lara/unit/LaraUnitResource.java delete mode 100644 LaraUnit/src/pt/up/fe/specs/lara/unit/LaraUnitTester.java delete mode 100644 LaraUnit/src/pt/up/fe/specs/lara/unit/TestResult.java delete mode 100644 Support/javacc/javacc-5.jar diff --git a/LARAC/.classpath b/LARAC/.classpath index 21ea32667..c3580fc79 100644 --- a/LARAC/.classpath +++ b/LARAC/.classpath @@ -1,19 +1,19 @@ - - + + + + + + + + - - - - - - - + diff --git a/LARAC/.project b/LARAC/.project deleted file mode 100644 index 028c214a0..000000000 --- a/LARAC/.project +++ /dev/null @@ -1,35 +0,0 @@ - - - LARAC - JavaCC Nature - - - - - sf.eclipse.javacc.core.javaccbuilder - - - - - org.eclipse.jdt.core.javabuilder - - - - - - org.eclipse.jdt.core.javanature - sf.eclipse.javacc.core.javaccnature - org.apache.ivyde.eclipse.ivynature - - - - 1665246567161 - - 30 - - org.eclipse.core.resources.regexFilterMatcher - node_modules|\.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__ - - - - diff --git a/LARAC/.settings/sf.eclipse.javacc.prefs~ b/LARAC/.settings/sf.eclipse.javacc.prefs~ deleted file mode 100644 index 103017c84..000000000 --- a/LARAC/.settings/sf.eclipse.javacc.prefs~ +++ /dev/null @@ -1,16 +0,0 @@ -CLEAR_CONSOLE=true -JAVACC_OPTIONS= -JJDOC_OPTIONS= -JJTREE_OPTIONS= -JJ_NATURE=true -JTB_OPTIONS=-ia -jd -tk -MARK_GEN_FILES_AS_DERIVED=true -<<<<<<< HEAD -RUNTIME_JJJAR=/usr/share/java/javacc.jar -RUNTIME_JTBJAR=${eclipse_home}/plugins/sf.eclipse.javacc_1.5.27/jtb-1.4.7.jar -======= -RUNTIME_JJJAR=${project_loc\:/Support}/libs/javacc/sf.eclipse.javacc_1.5.27/javacc.jar -RUNTIME_JTBJAR=${project_loc\:/Support}/libs/javacc/sf.eclipse.javacc_1.5.27/jtb-1.4.7.jar ->>>>>>> 1e903401174c0cbbed49174a0df044b8954d4179 -SUPPRESS_WARNINGS=true -eclipse.preferences.version=1 diff --git a/LARAC/ant/WeaverGenerator_cetus.xml b/LARAC/ant/WeaverGenerator_cetus.xml deleted file mode 100644 index a64b40c37..000000000 --- a/LARAC/ant/WeaverGenerator_cetus.xml +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - - - - - - - - - - - - - - diff --git a/LARAC/ant/lara_Weaver.xml b/LARAC/ant/lara_Weaver.xml deleted file mode 100644 index e602f7c0c..000000000 --- a/LARAC/ant/lara_Weaver.xml +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - - - - - - - - - - - - - - diff --git a/LARAC/build.gradle b/LARAC/build.gradle index 3a514412c..883e6b3df 100644 --- a/LARAC/build.gradle +++ b/LARAC/build.gradle @@ -45,21 +45,5 @@ sourceSets { java { srcDir 'src' } - - resources { - srcDir 'resources' - } - } - - - test { - java { - srcDir 'test' - } - - resources { - srcDir 'resources' - } - } - + } } diff --git a/LARAC/commands.build b/LARAC/commands.build deleted file mode 100644 index 87192cf1b..000000000 --- a/LARAC/commands.build +++ /dev/null @@ -1,9 +0,0 @@ -# System commands to be executed before compiling this project - -# Create .jj from .jjt -# Could not set output directory of jjtree, setting working directory instead -[dir=src/org/dojo/jsl/parser/] java -cp ../../../../../../Support/javacc/javacc-5.jar jjtree LARAEcmaScript.jjt - -# Create grammar from .jj -[dir=src/org/dojo/jsl/parser/ast] java -cp ../../../../../../../Support/javacc/javacc-5.jar javacc LARAEcmaScript.jj - diff --git a/LARAC/deploy/LaraC-deploy.launch b/LARAC/deploy/LaraC-deploy.launch deleted file mode 100644 index 4ce8a21a8..000000000 --- a/LARAC/deploy/LaraC-deploy.launch +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - - - - - - - - - - - diff --git a/LARAC/deploy/LaraC.deploy b/LARAC/deploy/LaraC.deploy deleted file mode 100644 index 6150c8ad6..000000000 --- a/LARAC/deploy/LaraC.deploy +++ /dev/null @@ -1,110 +0,0 @@ - - - - NameOfOutputJar - - larac.jar - string - - - - ClassWithMain - - larac.LARACLauncher - string - - - - Tasks - - - - - - - OutputJarFilename - - larac.jar - string - - - - Port - - 22 - string - - - - UserPass - - SpecS#12345 - string - - - - Host - - specs.fe.up.pt - string - - - - DestinationFolder - - /var/www/html/tools - string - - - - UserLogin - - root - string - - - - CommandsFile - - - string - - - - SFTP Task - - - - - SFTP Task - - - - - setupList - - - - ProjectName - - LARAC - string - - - - OutputJarType - - RepackJar - multipleChoice - - - - WorkspaceFolder - - - string - - - - EclipseDeployment - \ No newline at end of file diff --git a/LARAC/diagrams/CD.cld b/LARAC/diagrams/CD.cld deleted file mode 100644 index 855800fef..000000000 --- a/LARAC/diagrams/CD.cld +++ /dev/null @@ -1,1564 +0,0 @@ - - - - 255 - 255 - 206 - - - 0 - 0 - 0 - - true - - - - - 2 - - - - - - - - - - 255 - 255 - 206 - - - 0 - 0 - 0 - - true - - - - true - - - - - 2 - - - - - - - - - - - - true - - - - - - 2 - - - - - - -1 - -1 - 178 - 308 - - - - true - - - - - 2 - - - - - - - - - true - - - - - - 2 - - - - - - -1 - -1 - 173 - 130 - - - - true - - - - - 2 - - - - - - - - - - - - - true - - - - - 2 - - - - - - - - - - - - - - - - - - - - true - - - - - - 2 - - - - - - compile - Document - - false - false - - - - - true - - - - - - 2 - - - - - - parse - void - - false - false - - - - - true - - - - - - 2 - - - - - - toAspectIR - void - - false - false - - - - - true - - - - - - 2 - - - - - - createXML - void - - false - false - - - - - - _stereo_type - Stereo Type - false - - - _simpleEntityName - Simple Name - false - - - _entityName - Name - false - - - _background - Background Color - false - - - _attrs - Attributes... - false - - - _operations - Operations... - false - - - _abstract - abstract - false - - - - LaraC - false - - - - - - - - - - true - - - - - 2 - - - - - - - - true - - - - - - 2 - - - - - - -1 - -1 - 211 - 452 - - - - - true - - - - - 2 - - - - - - - - - true - - - - - - 2 - - - - - - -1 - -1 - 453 - 269 - - - - - true - - - - - 2 - - - - - - - - true - - - - - - 2 - - - - - - -1 - -1 - 571 - 450 - - - - - true - - - - - 2 - - - - - - - - - - - - true - - - - - 2 - - - - - - - 255 - 255 - 206 - - - 0 - 0 - 0 - - true - - - - true - - - - - 2 - - - - - - - - - - - - - - true - - - - - - 2 - - - - - - -1 - -1 - 907 - 452 - - - - true - - - - - 2 - - - - - - - - - - - - true - - - - - 2 - - - - - - - - true - - - - - - 2 - - - - - - -1 - -1 - 734 - 452 - - - - - true - - - - - 2 - - - - - - - - - - - - - true - - - - - 2 - - - - - - - - - - - - - true - - - - - 2 - - - - - - - - - - - - - true - - - - - 2 - - - - - - - - - - - - - true - - - - - 2 - - - - - - - - - - - - - true - - - - - 2 - - - - - - - - - - - - - - - _stereo_type - Stereo Type - false - - - _simpleEntityName - Simple Name - false - - - _entityName - Name - false - - - _background - Background Color - false - - - _attrs - Attributes... - false - - - _operations - Operations... - false - - - _abstract - abstract - false - - - - ASTSelect - false - - - - - - - - - - - - - - - - - - _stereo_type - Stereo Type - false - - - _simpleEntityName - Simple Name - false - - - _entityName - Name - false - - - _background - Background Color - false - - - _attrs - Attributes... - false - - - _operations - Operations... - false - - - _abstract - abstract - false - - - - ASTApply - false - - - - - - true - - - - - - 2 - - - - - - -1 - -1 - 381 - 452 - - - - true - - - - - 2 - - - - - - - - - - - - true - - - - - 2 - - - - - - - - - - - - - - - - - _stereo_type - Stereo Type - false - - - _simpleEntityName - Simple Name - false - - - _entityName - Name - false - - - _background - Background Color - false - - - _attrs - Attributes... - false - - - _operations - Operations... - false - - - _abstract - abstract - false - - - - ASTPointcut - false - - - - - - - - - - - - - 2 - - - - - - -1 - -1 - 528 - 587 - - - - - - - - true - - - - - 2 - - - - - - - - true - - - - - - 2 - - - - - - -1 - -1 - 402 - 719 - - - - - - - - - - _stereo_type - Stereo Type - false - - - _simpleEntityName - Simple Name - false - - - _entityName - Name - false - - - _background - Background Color - false - - - _attrs - Attributes... - false - - - _operations - Operations... - false - - - _abstract - abstract - false - - - - JoinPointModel - false - - - - - - - - - true - - - - - 2 - - - - - - - - true - - - - - - 2 - - - - - - -1 - -1 - 552 - 719 - - - - - - - - - - _stereo_type - Stereo Type - false - - - _simpleEntityName - Simple Name - false - - - _entityName - Name - false - - - _background - Background Color - false - - - _attrs - Attributes... - false - - - _operations - Operations... - false - - - _abstract - abstract - false - - - - ArtifactsModel - false - - - - - - - - - true - - - - - 2 - - - - - - - - true - - - - - - 2 - - - - - - -1 - -1 - 700 - 719 - - - - - - - - - - _stereo_type - Stereo Type - false - - - _simpleEntityName - Simple Name - false - - - _entityName - Name - false - - - _background - Background Color - false - - - _attrs - Attributes... - false - - - _operations - Operations... - false - - - _abstract - abstract - false - - - - ActionModel - false - - - - - - - - - - - - - _stereo_type - Stereo Type - false - - - _simpleEntityName - Simple Name - false - - - _entityName - Name - false - - - _background - Background Color - false - - - _attrs - Attributes... - false - - - _operations - Operations... - false - - - _abstract - abstract - false - - - - LanguageSpecification - false - - - - - - - - - - - - - _stereo_type - Stereo Type - false - - - _simpleEntityName - Simple Name - false - - - _entityName - Name - false - - - _background - Background Color - false - - - _attrs - Attributes... - false - - - _operations - Operations... - false - - - _abstract - abstract - false - - - - ASTInsert - false - - - - - - - - - - - - - - - true - - - - - - 2 - - - - - - organize - Object - - - obj - Object - - - false - false - - - - - true - - - - - - 2 - - - - - - toXML - void - - - doc - Document - - - parent - Element - - - false - false - - - - - - _stereo_type - Stereo Type - false - - - _simpleEntityName - Simple Name - false - - - _entityName - Name - false - - - _background - Background Color - false - - - _attrs - Attributes... - false - - - _operations - Operations... - false - - - _abstract - abstract - false - - - - SimpleNode - false - - - - - - - - - - _stereo_type - Stereo Type - false - - - _simpleEntityName - Simple Name - false - - - _entityName - Name - false - - - _background - Background Color - false - - - _attrs - Attributes... - false - - - _operations - Operations... - false - - - _abstract - abstract - false - - - - ASTStart - false - - - - - - - - - - - - - - true - - - - - - 2 - - - - - - organize - void - - false - false - - - - - true - - - - - - 2 - - - - - - toXML - Document - - false - false - - - - - - _stereo_type - Stereo Type - false - - - _simpleEntityName - Simple Name - false - - - _entityName - Name - false - - - _background - Background Color - false - - - _attrs - Attributes... - false - - - _operations - Operations... - false - - - _abstract - abstract - false - - - - AspectIR - false - - - - - - - - - - - - - - - - 2 - - - - - - -1 - -1 - 1 - 28 - - - - - - - - - - true - - - - - - 2 - - - - - - exec - int - - - args - String[] - - - langSpec - LanguageSpecification - - - output - Output - - - false - true - - - - - - _stereo_type - Stereo Type - false - - - _simpleEntityName - Simple Name - false - - - _entityName - Name - false - - - _background - Background Color - false - - - _attrs - Attributes... - false - - - _operations - Operations... - false - - - _abstract - abstract - false - - - - LARACLauncher - false - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/LARAC/diagrams/Class.atxa b/LARAC/diagrams/Class.atxa deleted file mode 100644 index 0577f00bd..000000000 --- a/LARAC/diagrams/Class.atxa +++ /dev/null @@ -1,282 +0,0 @@ -@prefix rdf: . -@prefix atxa-jdt: . -@prefix atxa-rse-eclipse: . -@prefix atxa-core: . -@prefix atxa: . -@prefix atxa-jdt-wkspc: . - - a atxa-core:reloFile . - -atxa:DetailNode atxa-core:detailLevel "1" . - -atxa-core:docRoot atxa-core:browseModel "com.architexa.diagrams.relo.jdt/com.architexa.diagrams.relo.jdt.browse.ClassStrucBrowseModel" ; - atxa-core:contains _:node1abjppsp1x1 . - -_:node1abjppsp1x1 a atxa-core:node ; - atxa-core:model atxa-jdt-wkspc:larac ; - atxa-core:posX "-33" ; - atxa-core:posY "-111" . - -atxa-jdt-wkspc:larac atxa-core:contains , . - -_:node1abjppsp1x1 atxa-core:contains _:node1abjppsp1x2 . - -_:node1abjppsp1x2 a atxa-core:node ; - atxa-core:model ; - atxa-core:posX "-27" ; - atxa-core:posY "-56" . - - atxa-core:contains . - -_:node1abjppsp1x3 a atxa-core:link ; - atxa-core:model atxa-jdt:refType ; - rdf:subject _:node1abjppsp1x2 ; - rdf:object _:node1abjppsp1x4 . - -_:node1abjppsp1x2 atxa-core:contains _:node1abjppsp1x5 . - -_:node1abjppsp1x5 a atxa-core:node ; - atxa-core:model ; - atxa-core:posX "-26" ; - atxa-core:posY "-37" . - -_:node1abjppsp1x1 atxa-core:contains _:node1abjppsp1x4 . - -_:node1abjppsp1x4 a atxa-core:node ; - atxa-core:model ; - atxa-core:posX "425" ; - atxa-core:posY "-85" . - - atxa-core:contains , , , . - -_:node1abjppsp1x6 a atxa-core:link ; - atxa-core:model atxa-jdt:refType ; - rdf:subject _:node1abjppsp1x4 ; - rdf:object _:node1abjppsp1x7 . - -_:node1abjppsp1x4 atxa-core:contains _:node1abjppsp1x8 . - -_:node1abjppsp1x8 a atxa-core:node ; - atxa-core:model ; - atxa-core:posX "426" ; - atxa-core:posY "-66" . - -_:node1abjppsp1x4 atxa-core:contains _:node1abjppsp1x9 . - -_:node1abjppsp1x9 a atxa-core:node ; - atxa-core:model ; - atxa-core:posX "426" ; - atxa-core:posY "-49" . - -_:node1abjppsp1x4 atxa-core:contains _:node1abjppsp1x10 . - -_:node1abjppsp1x10 a atxa-core:node ; - atxa-core:model ; - atxa-core:posX "426" ; - atxa-core:posY "-32" . - -_:node1abjppsp1x4 atxa-core:contains _:node1abjppsp1x11 . - -_:node1abjppsp1x11 a atxa-core:node ; - atxa-core:model ; - atxa-core:posX "426" ; - atxa-core:posY "-15" . - -atxa-core:docRoot atxa-core:contains _:node1abjppsp1x12 . - -_:node1abjppsp1x12 a atxa-core:node ; - atxa-core:model ; - atxa-core:posX "-41" ; - atxa-core:posY "149" . - - atxa-core:contains , , , , , . - -_:node1abjppsp1x12 atxa-core:contains _:node1abjppsp1x13 . - -_:node1abjppsp1x13 a atxa-core:node ; - atxa-core:model ; - atxa-core:posX "-35" ; - atxa-core:posY "273" . - -_:node1abjppsp1x14 a atxa-core:link ; - atxa-core:model atxa-jdt:inherits ; - rdf:subject _:node1abjppsp1x13 ; - rdf:object _:node1abjppsp1x15 ; - atxa-core:bendpoint _:node1abjpmri8x2954 . - -_:node1abjpmri8x2954 atxa-core:bpLocation "22,232" ; - atxa-core:bpIndex "0" . - -_:node1abjppsp1x14 atxa-core:bendpoint _:node1abjpmri8x2955 . - -_:node1abjpmri8x2955 atxa-core:bpLocation "278,232" ; - atxa-core:bpIndex "1" . - -_:node1abjppsp1x12 atxa-core:contains _:node1abjppsp1x18 . - -_:node1abjppsp1x18 a atxa-core:node ; - atxa-core:model ; - atxa-core:posX "335" ; - atxa-core:posY "271" . - -_:node1abjppsp1x19 a atxa-core:link ; - atxa-core:model atxa-jdt:inherits ; - rdf:subject _:node1abjppsp1x18 ; - rdf:object _:node1abjppsp1x15 ; - atxa-core:bendpoint _:node1abjpmri8x2956 . - -_:node1abjpmri8x2956 atxa-core:bpLocation "390,232" ; - atxa-core:bpIndex "0" . - -_:node1abjppsp1x19 atxa-core:bendpoint _:node1abjpmri8x2957 . - -_:node1abjpmri8x2957 atxa-core:bpLocation "278,232" ; - atxa-core:bpIndex "1" . - -_:node1abjppsp1x12 atxa-core:contains _:node1abjppsp1x22 . - -_:node1abjppsp1x22 a atxa-core:node ; - atxa-core:model ; - atxa-core:posX "222" ; - atxa-core:posY "270" . - -_:node1abjppsp1x23 a atxa-core:link ; - atxa-core:model atxa-jdt:refType ; - rdf:subject _:node1abjppsp1x22 ; - rdf:object _:node1abjppsp1x24 . - -_:node1abjppsp1x25 a atxa-core:link ; - atxa-core:model atxa-jdt:inherits ; - rdf:subject _:node1abjppsp1x22 ; - rdf:object _:node1abjppsp1x15 ; - atxa-core:bendpoint _:node1abjpmri8x2958 . - -_:node1abjpmri8x2958 atxa-core:bpLocation "278,232" ; - atxa-core:bpIndex "0" . - -_:node1abjppsp1x12 atxa-core:contains _:node1abjppsp1x27 . - -_:node1abjppsp1x27 a atxa-core:node ; - atxa-core:model ; - atxa-core:posX "450" ; - atxa-core:posY "272" . - -_:node1abjppsp1x28 a atxa-core:link ; - atxa-core:model atxa-jdt:inherits ; - rdf:subject _:node1abjppsp1x27 ; - rdf:object _:node1abjppsp1x15 ; - atxa-core:bendpoint _:node1abjpmri8x2959 . - -_:node1abjpmri8x2959 atxa-core:bpLocation "503,232" ; - atxa-core:bpIndex "0" . - -_:node1abjppsp1x28 atxa-core:bendpoint _:node1abjpmri8x2960 . - -_:node1abjpmri8x2960 atxa-core:bpLocation "278,232" ; - atxa-core:bpIndex "1" . - -_:node1abjppsp1x12 atxa-core:contains _:node1abjppsp1x15 . - -_:node1abjppsp1x15 a atxa-core:node ; - atxa-core:model ; - atxa-core:posX "172" ; - atxa-core:posY "175" . - - atxa-core:contains . - -_:node1abjppsp1x15 atxa-core:contains _:node1abjppsp1x31 . - -_:node1abjppsp1x31 a atxa-core:node ; - atxa-core:model ; - atxa-core:posX "173" ; - atxa-core:posY "194" . - -_:node1abjppsp1x12 atxa-core:contains _:node1abjppsp1x32 . - -_:node1abjppsp1x32 a atxa-core:node ; - atxa-core:model ; - atxa-core:posX "83" ; - atxa-core:posY "271" . - -_:node1abjppsp1x33 a atxa-core:link ; - atxa-core:model atxa-jdt:refType ; - rdf:subject _:node1abjppsp1x32 ; - rdf:object _:node1abjppsp1x24 . - -_:node1abjppsp1x34 a atxa-core:link ; - atxa-core:model atxa-jdt:inherits ; - rdf:subject _:node1abjppsp1x32 ; - rdf:object _:node1abjppsp1x15 ; - atxa-core:bendpoint _:node1abjpmri8x2961 . - -_:node1abjpmri8x2961 atxa-core:bpLocation "148,232" ; - atxa-core:bpIndex "0" . - -_:node1abjppsp1x34 atxa-core:bendpoint _:node1abjpmri8x2962 . - -_:node1abjpmri8x2962 atxa-core:bpLocation "278,232" ; - atxa-core:bpIndex "1" . - -atxa-core:docRoot atxa-core:contains _:node1abjppsp1x37 . - -_:node1abjppsp1x37 a atxa-core:node ; - atxa-core:model ; - atxa-core:posX "424" ; - atxa-core:posY "40" . - - atxa-core:contains . - -_:node1abjppsp1x37 atxa-core:contains _:node1abjppsp1x7 . - -_:node1abjppsp1x7 a atxa-core:node ; - atxa-core:model ; - atxa-core:posX "430" ; - atxa-core:posY "66" . - - atxa-core:contains , . - -_:node1abjppsp1x38 a atxa-core:link ; - atxa-core:model atxa-jdt:refType ; - rdf:subject _:node1abjppsp1x7 ; - rdf:object _:node1abjppsp1x27 . - -_:node1abjppsp1x7 atxa-core:contains _:node1abjppsp1x39 . - -_:node1abjppsp1x39 a atxa-core:node ; - atxa-core:model ; - atxa-core:posX "431" ; - atxa-core:posY "85" . - -_:node1abjppsp1x7 atxa-core:contains _:node1abjppsp1x40 . - -_:node1abjppsp1x40 a atxa-core:node ; - atxa-core:model ; - atxa-core:posX "431" ; - atxa-core:posY "102" . - -atxa-core:docRoot atxa-core:contains _:node1abjppsp1x41 . - -_:node1abjppsp1x41 a atxa-core:node ; - atxa-core:model ; - atxa-core:posX "123" ; - atxa-core:posY "357" . - - atxa-core:contains . - -_:node1abjppsp1x41 atxa-core:contains _:node1abjppsp1x24 . - -_:node1abjppsp1x24 a atxa-core:node ; - atxa-core:model ; - atxa-core:posX "129" ; - atxa-core:posY "383" . - -@prefix rdf: . -@prefix atxa-jdt: . -@prefix atxa-rse-eclipse: . -@prefix atxa-core: . -@prefix atxa: . -@prefix atxa-jdt-wkspc: . - - a atxa-core:reloFile ; - atxa-core:contains _:node1abjppsp1x5 , _:node1abjppsp1x2 , _:node1abjppsp1x8 , _:node1abjppsp1x9 , _:node1abjppsp1x10 , _:node1abjppsp1x11 , _:node1abjppsp1x4 , _:node1abjppsp1x1 , _:node1abjppsp1x13 , _:node1abjppsp1x18 , _:node1abjppsp1x22 , _:node1abjppsp1x27 , _:node1abjppsp1x31 , _:node1abjppsp1x15 , _:node1abjppsp1x32 , _:node1abjppsp1x12 , _:node1abjppsp1x39 , _:node1abjppsp1x40 , _:node1abjppsp1x7 , _:node1abjppsp1x37 , _:node1abjppsp1x24 , _:node1abjppsp1x41 , atxa-core:docRoot , _:node1abjppsp1x5 , _:node1abjppsp1x2 , _:node1abjppsp1x8 , _:node1abjppsp1x9 , _:node1abjppsp1x10 , _:node1abjppsp1x11 , _:node1abjppsp1x4 , _:node1abjppsp1x1 , _:node1abjppsp1x13 , _:node1abjppsp1x18 , _:node1abjppsp1x22 , _:node1abjppsp1x27 , _:node1abjppsp1x31 , _:node1abjppsp1x15 , _:node1abjppsp1x32 , _:node1abjppsp1x12 , _:node1abjppsp1x39 , _:node1abjppsp1x40 , _:node1abjppsp1x7 , _:node1abjppsp1x37 , _:node1abjppsp1x24 , _:node1abjppsp1x41 , atxa-core:docRoot , _:node1abjppsp1x3 , _:node1abjppsp1x6 , _:node1abjppsp1x14 , _:node1abjppsp1x19 , _:node1abjppsp1x23 , _:node1abjppsp1x25 , _:node1abjppsp1x28 , _:node1abjppsp1x33 , _:node1abjppsp1x34 , _:node1abjppsp1x38 , _:node1abjppsp1x3 , _:node1abjppsp1x6 , _:node1abjppsp1x14 , _:node1abjppsp1x19 , _:node1abjppsp1x23 , _:node1abjppsp1x25 , _:node1abjppsp1x28 , _:node1abjppsp1x33 , _:node1abjppsp1x34 , _:node1abjppsp1x38 . - diff --git a/LARAC/diagrams/Layered.atxa b/LARAC/diagrams/Layered.atxa deleted file mode 100644 index 06497c678..000000000 --- a/LARAC/diagrams/Layered.atxa +++ /dev/null @@ -1,138 +0,0 @@ -@prefix rdf: . -@prefix atxa-rse-eclipse: . -@prefix atxa-strata: . -@prefix atxa-core: . -@prefix atxa: . -@prefix atxa-jdt-wkspc: . - - a atxa-core:strataFile . - -atxa:DetailNode atxa-core:detailLevel "0" . - -atxa-core:docRoot atxa-core:browseModel "com.architexa.diagrams.relo.jdt/com.architexa.diagrams.relo.jdt.browse.ClassStrucBrowseModel" ; - atxa-core:contains _:node1abirdjcqx41414 . - -_:node1abirdjcqx41414 a atxa-core:node ; - atxa-core:model ; - atxa-strata:nestedLayerIndexes ":0,false,false,true:0,false,false,true" ; - atxa-strata:layerIndex "0" ; - atxa-strata:indexWithinLayer "0" ; - atxa-core:containerState "true" , "true" , "false" . - - atxa-core:contains atxa-jdt-wkspc:larac , . - -_:node1abirdjcqx41414 atxa-core:contains _:node1abirdjcqx41415 . - -_:node1abirdjcqx41415 a atxa-core:node ; - atxa-core:model atxa-jdt-wkspc:larac ; - atxa-strata:nestedLayerIndexes ":0,false,false,true:0,false,false,true" ; - atxa-strata:layerIndex "0" ; - atxa-strata:indexWithinLayer "0" ; - atxa-core:containerState "true" , "false" , "false" . - -atxa-jdt-wkspc:larac atxa-core:contains , . - -_:node1abirdjcqx41415 atxa-core:contains _:node1abirdjcqx41416 . - -_:node1abirdjcqx41416 a atxa-core:node ; - atxa-core:model ; - atxa-strata:nestedLayerIndexes ":0,false,false,false:1,false,false,false:0,false,true,true" ; - atxa-strata:layerIndex "0" ; - atxa-strata:indexWithinLayer "-1" ; - atxa-core:containerState "false" , "true" , "false" . - -_:node1abirdjcqx41415 atxa-core:contains _:node1abirdjcqx41417 . - -_:node1abirdjcqx41417 a atxa-core:node ; - atxa-core:model ; - atxa-strata:nestedLayerIndexes ":0,false,false,true:0,false,false,true:0,false,true,true" ; - atxa-strata:layerIndex "0" ; - atxa-strata:indexWithinLayer "-1" ; - atxa-core:containerState "false" , "false" , "false" . - -_:node1abirdjcqx41414 atxa-core:contains _:node1abirdjcqx41418 . - -_:node1abirdjcqx41418 a atxa-core:node ; - atxa-core:model ; - atxa-strata:nestedLayerIndexes ":0,false,false,true:1,false,false,true" ; - atxa-strata:layerIndex "1" ; - atxa-strata:indexWithinLayer "0" ; - atxa-core:containerState "true" , "false" , "false" . - - atxa-core:contains . - -_:node1abirdjcqx41418 atxa-core:contains _:node1abirdjcqx41419 . - -_:node1abirdjcqx41419 a atxa-core:node ; - atxa-core:model ; - atxa-strata:nestedLayerIndexes ":0,false,false,true:0,false,false,true" ; - atxa-strata:layerIndex "0" ; - atxa-strata:indexWithinLayer "0" ; - atxa-core:containerState "false" , "false" , "false" . - -atxa-core:docRoot atxa-core:contains _:node1abirdjcqx41428 . - -_:node1abirdjcqx41428 a atxa-core:node ; - atxa-core:model ; - atxa-strata:nestedLayerIndexes ":1,false,false,true:0,false,false,true" ; - atxa-strata:layerIndex "0" ; - atxa-strata:indexWithinLayer "1" ; - atxa-core:containerState "true" , "false" , "false" . - - atxa-core:contains , , , , . - -_:node1abirdjcqx41428 atxa-core:contains _:node1abirdjcqx41429 . - -_:node1abirdjcqx41429 a atxa-core:node ; - atxa-core:model ; - atxa-strata:nestedLayerIndexes ":0,false,false,true:1,false,false,true" ; - atxa-strata:layerIndex "1" ; - atxa-strata:indexWithinLayer "0" ; - atxa-core:containerState "false" , "false" , "false" . - -_:node1abirdjcqx41428 atxa-core:contains _:node1abirdjcqx41550 . - -_:node1abirdjcqx41550 a atxa-core:node ; - atxa-core:model ; - atxa-strata:nestedLayerIndexes ":0,false,false,true:0,false,false,true" ; - atxa-strata:layerIndex "0" ; - atxa-strata:indexWithinLayer "0" ; - atxa-core:containerState "false" , "true" , "false" . - -_:node1abirdjcqx41428 atxa-core:contains _:node1abirdjcqx41551 . - -_:node1abirdjcqx41551 a atxa-core:node ; - atxa-core:model ; - atxa-strata:nestedLayerIndexes ":1,false,false,true:1,false,false,true" ; - atxa-strata:layerIndex "1" ; - atxa-strata:indexWithinLayer "1" ; - atxa-core:containerState "false" , "true" , "false" . - -_:node1abirdjcqx41428 atxa-core:contains _:node1abirdjcqx41552 . - -_:node1abirdjcqx41552 a atxa-core:node ; - atxa-core:model ; - atxa-strata:nestedLayerIndexes ":0,false,false,true:2,false,false,true" ; - atxa-strata:layerIndex "2" ; - atxa-strata:indexWithinLayer "0" ; - atxa-core:containerState "false" , "true" , "false" . - -_:node1abirdjcqx41428 atxa-core:contains _:node1abirdjcqx41553 . - -_:node1abirdjcqx41553 a atxa-core:node ; - atxa-core:model ; - atxa-strata:nestedLayerIndexes ":1,false,false,true:2,false,false,true" ; - atxa-strata:layerIndex "2" ; - atxa-strata:indexWithinLayer "1" ; - atxa-core:containerState "false" , "true" , "false" . - -@prefix rdf: . -@prefix atxa-rse-eclipse: . -@prefix atxa-strata: . -@prefix atxa-core: . -@prefix atxa: . -@prefix atxa-jdt-wkspc: . - - a atxa-core:strataFile ; - atxa-core:contains _:node1abirdjcqx41416 , _:node1abirdjcqx41417 , _:node1abirdjcqx41415 , _:node1abirdjcqx41419 , _:node1abirdjcqx41418 , _:node1abirdjcqx41414 , _:node1abirdjcqx41429 , _:node1abirdjcqx41550 , _:node1abirdjcqx41551 , _:node1abirdjcqx41552 , _:node1abirdjcqx41553 , _:node1abirdjcqx41428 , atxa-core:docRoot , _:node1abirdjcqx41416 , _:node1abirdjcqx41417 , _:node1abirdjcqx41415 , _:node1abirdjcqx41419 , _:node1abirdjcqx41418 , _:node1abirdjcqx41414 , _:node1abirdjcqx41429 , _:node1abirdjcqx41550 , _:node1abirdjcqx41551 , _:node1abirdjcqx41552 , _:node1abirdjcqx41553 , _:node1abirdjcqx41428 , atxa-core:docRoot . - diff --git a/LARAC/ivy.xml b/LARAC/ivy.xml deleted file mode 100644 index 9b9263643..000000000 --- a/LARAC/ivy.xml +++ /dev/null @@ -1,38 +0,0 @@ - - - - - - - - - - - - - - - - - diff --git a/LARAC/launchers/[LARAC]Test.launch b/LARAC/launchers/[LARAC]Test.launch deleted file mode 100644 index 09bdcc535..000000000 --- a/LARAC/launchers/[LARAC]Test.launch +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - diff --git a/LARAC/src/applet/GUI.java b/LARAC/src/applet/GUI.java deleted file mode 100644 index 7c64cd49d..000000000 --- a/LARAC/src/applet/GUI.java +++ /dev/null @@ -1,813 +0,0 @@ -package applet; - -import java.applet.Applet; -import java.awt.Button; -import java.awt.Checkbox; -import java.awt.Choice; -import java.awt.Color; -import java.awt.Dimension; -import java.awt.Event; -import java.awt.Frame; -import java.awt.GridBagConstraints; -import java.awt.GridBagLayout; -import java.awt.Insets; -import java.awt.Label; -import java.awt.Panel; -import java.awt.TextArea; -import java.awt.TextField; -import java.awt.Toolkit; -import java.awt.event.ComponentEvent; -import java.awt.event.ComponentListener; -import java.awt.event.WindowEvent; -import java.awt.event.WindowListener; -import java.io.ByteArrayInputStream; -import java.io.File; -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; -import java.io.PrintStream; -import java.security.Permission; -import java.util.HashMap; - -import javax.swing.JFileChooser; -import javax.swing.JOptionPane; - -import org.dojo.jsl.parser.ast.LARAEcmaScript; -import org.dojo.jsl.parser.ast.SimpleNode; - -import larac.exceptions.LARACompilerException; -import larac.utils.FileUtils; -import larac.utils.FileUtils.Commands; - -/** - * - * @deprecated Bispo: It seems is not been used, nor there are plans to use it - * - */ -@Deprecated -class errorReport extends Frame { - - /** - * - */ - private static final long serialVersionUID = 1L; - int factor = 50; - - public errorReport(String error) { - final GridBagLayout gbl = new GridBagLayout(); - final GridBagConstraints gbcon = new GridBagConstraints(); - final int width = GUI.window_Width * 2 / 3; - int height = error.split("\n").length * this.factor; - int lines = height / this.factor; - if (height > GUI.window_Height) { - lines = lines * GUI.window_Height / (height * 1 / 2); - height = GUI.window_Height; - } - setSize(width, height); - final Toolkit tk = Toolkit.getDefaultToolkit(); - final Dimension screenSize = tk.getScreenSize(); - final int screenHeight = screenSize.height; - final int screenWidth = screenSize.width; - // setSize(screenWidth / 2, screenHeight / 2); - setLocation(screenWidth / 2 - width / 2, screenHeight / 2 - height / 2); - final Label l = new Label("AspectIR"); - final TextArea ta = new TextArea(error, lines, (int) Math.round(GUI.areaWidth * 2.5 / 4), - TextArea.SCROLLBARS_VERTICAL_ONLY); - - // ta.setSize(width,height); - gbcon.anchor = GridBagConstraints.NORTH; - gbcon.gridx = 0; - gbcon.gridy = 0; - gbl.setConstraints(l, gbcon); - add(l); - gbcon.gridy = 1; - gbl.setConstraints(ta, gbcon); - add(ta); - setLayout(gbl); - addWindowListener(new WindowListener() { - - @Override - public void windowOpened(WindowEvent e) { - } - - @Override - public void windowIconified(WindowEvent e) { - } - - @Override - public void windowDeiconified(WindowEvent e) { - } - - @Override - public void windowDeactivated(WindowEvent e) { - setVisible(false); - } - - @Override - public void windowClosing(WindowEvent e) { - setVisible(false); - } - - @Override - public void windowClosed(WindowEvent e) { - } - - @Override - public void windowActivated(WindowEvent e) { - } - }); - } -} - -class AspectIRPopup extends Frame { - /** - * - */ - private static final long serialVersionUID = 1L; - int factor = 50; - - public AspectIRPopup(String aspectIR) { - final GridBagLayout gbl = new GridBagLayout(); - final GridBagConstraints gbcon = new GridBagConstraints(); - final int width = GUI.window_Width * 2 / 3; - int height = aspectIR.split("\n").length * this.factor; - int lines = height / this.factor; - if (height > GUI.window_Height) { - lines = lines * GUI.window_Height / (height * 1 / 2); - height = GUI.window_Height; - } - setSize(width, height); - final Toolkit tk = Toolkit.getDefaultToolkit(); - final Dimension screenSize = tk.getScreenSize(); - final int screenHeight = screenSize.height; - final int screenWidth = screenSize.width; - // setSize(screenWidth / 2, screenHeight / 2); - setLocation(screenWidth / 2 - width / 2, screenHeight / 2 - height / 2); - final Label l = new Label("AspectIR"); - final TextArea ta = new TextArea(aspectIR, lines, (int) Math.round(GUI.areaWidth * 2.5 / 4), - TextArea.SCROLLBARS_VERTICAL_ONLY); - // ta.setSize(width,height); - gbcon.anchor = GridBagConstraints.NORTH; - gbcon.gridx = 0; - gbcon.gridy = 0; - gbl.setConstraints(l, gbcon); - add(l); - gbcon.gridy = 1; - gbl.setConstraints(ta, gbcon); - add(ta); - setLayout(gbl); - addWindowListener(new WindowListener() { - - @Override - public void windowOpened(WindowEvent e) { - } - - @Override - public void windowIconified(WindowEvent e) { - } - - @Override - public void windowDeiconified(WindowEvent e) { - } - - @Override - public void windowDeactivated(WindowEvent e) { - } - - @Override - public void windowClosing(WindowEvent e) { - setVisible(false); - } - - @Override - public void windowClosed(WindowEvent e) { - } - - @Override - public void windowActivated(WindowEvent e) { - } - }); - } -} - -class RunLara { - - private final String code; - private final boolean showAspectIR; - private final boolean interpret; - private final boolean showTree; - - private static class ExitTrappedException extends SecurityException { - - /** - * - */ - private static final long serialVersionUID = 1L; - } - - public RunLara(String code, boolean showAspectIR, boolean showIntepreter, boolean showTree, GUI app) { - this.code = code; - this.showAspectIR = showAspectIR; - this.interpret = showIntepreter; - this.showTree = showTree; - } - - public void run() { - - try { - - System.out.println("EcmaScript Parser: Reading from console"); - final InputStream is = new ByteArrayInputStream(this.code.getBytes("UTF-8")); - final LARAEcmaScript parser = new LARAEcmaScript(is); - final SimpleNode n = parser.Start(); - - System.out.println("LARAEcmaScript parser: EcmaScript program parsed successfully."); - if (this.interpret) { - - } - if (this.showAspectIR) { - final AspectIRPopup popup = new AspectIRPopup(n.dumpToString("")); - popup.setVisible(true); - } - if (this.showTree) { - - } - - // } catch (final ExitTrappedException e) { - } catch (final Exception e) { - throw new LARACompilerException("during GUI execution", e); - } - } -} - -class LowPanel extends Panel { - /** - * - */ - private static final long serialVersionUID = 1L; - Button save, saveAs, open, clear; - GUI app; - JFileChooser fc = new JFileChooser() { - /** - * - */ - private static final long serialVersionUID = 1L; - - @Override - public void approveSelection() { - final File f = getSelectedFile(); - if (f.exists() && getDialogType() == JFileChooser.SAVE_DIALOG) { - final int result = JOptionPane.showConfirmDialog(this, "The file exists, overwrite?", "Existing file", - JOptionPane.YES_NO_CANCEL_OPTION); - switch (result) { - case JOptionPane.YES_OPTION: - super.approveSelection(); - return; - case JOptionPane.NO_OPTION: - return; - case JOptionPane.CANCEL_OPTION: - cancelSelection(); - return; - default: - break; - } - } - super.approveSelection(); - } - }; - String filePathSave = ""; - - public LowPanel(GUI parent) { - this.app = parent; - final GridBagLayout gbl = new GridBagLayout(); - final GridBagConstraints gbcon = new GridBagConstraints(); - - initBottomBoxs(gbl, gbcon); - setLayout(gbl); - } - - private void initBottomBoxs(GridBagLayout gbl, GridBagConstraints gbcon) { - this.open = new Button("Open"); - this.open.setActionCommand(Commands.OPEN.toString()); - this.save = new Button("Save"); - this.save.setActionCommand(Commands.SAVE.toString()); - this.saveAs = new Button("SaveAs"); - this.saveAs.setActionCommand(Commands.SAVEAS.toString()); - this.clear = new Button("Clear"); - this.clear.setActionCommand(Commands.CLEAR.toString()); - gbcon.anchor = GridBagConstraints.WEST; - gbcon.gridx = 0; - gbcon.gridy = 0; - gbl.setConstraints(this.open, gbcon); - add(this.open); - gbcon.gridx = 1; - gbl.setConstraints(this.save, gbcon); - add(this.save); - gbcon.gridx = 2; - gbl.setConstraints(this.saveAs, gbcon); - add(this.saveAs); - gbcon.gridx = 3; - gbl.setConstraints(this.clear, gbcon); - add(this.clear); - } - - @Override - public boolean action(Event evt, Object arg) { - // new StringBuffer(50); - if (evt.target instanceof Button) { - final Button bt = (Button) evt.target; - final String command = bt.getActionCommand(); - this.fc.setCurrentDirectory(new File(".")); - switch (Commands.valueOf(command)) { - case SAVE: - if (!this.filePathSave.isEmpty()) { - FileUtils.toFile(this.filePathSave, "", this.app.console.code.getText(), new File(".")); - break; - } - //$FALL-THROUGH$ - case SAVEAS: - this.filePathSave = FileUtils.processSaveFileChooser(this.app, this.fc, FileUtils.aspectFilter, "Save", - JFileChooser.FILES_ONLY); - if (!this.filePathSave.isEmpty()) { - this.filePathSave += this.filePathSave.endsWith(".lara") ? "" : ".lara"; - FileUtils.toFile(this.filePathSave, "", this.app.console.code.getText(), new File(".")); - } - break; - case CLEAR: - this.filePathSave = ""; - this.app.console.code.setText(""); - break; - case OPEN: - final File f = FileUtils.processOpenFileChooser(this.app, this.fc, FileUtils.aspectFilter, "Open", - JFileChooser.FILES_ONLY); - this.filePathSave = f.getPath(); - this.app.console.code.setText(FileUtils.fromFile(f)); - break; - case ASPECT: - break; - case GENERATE: - break; - case LANGUAGE: - break; - case LOAD: - break; - case OUTPUT: - break; - case RESOURCE: - break; - case WORKSPACE: - break; - case XML: - break; - default: - break; - } - return true; - } - return false; - } -} - -class Console extends Panel { - - /** - * - */ - private static final long serialVersionUID = 1L; - - TextArea code; - - Button generate; - TextArea output; - GUI app; - PrintStream SystemOut = System.out; - - public Console(GUI parent) { - - this.app = parent; - final GridBagLayout gbl = new GridBagLayout(); - final GridBagConstraints gbcon = new GridBagConstraints(); - - initTxtBoxs(gbl, gbcon); - final OutputStream outStream = new OutputStream() { - - @Override - public void write(int b) throws IOException { - Console.this.output.append("" + (char) b); - } - }; - try (PrintStream printStream = new PrintStream(outStream);) { - System.setOut(printStream); - } - setLayout(gbl); - - } - - private void initTxtBoxs(GridBagLayout gbl, GridBagConstraints gbcon) { - this.code = new TextArea("aspectdef example\n\nend", GUI.areaHeight, (int) Math.round(GUI.areaWidth * 2.5 / 4), - TextArea.SCROLLBARS_VERTICAL_ONLY); - - this.generate = new Button("Generate"); - this.output = new TextArea("", GUI.areaHeight, (int) Math.round(GUI.areaWidth * 1.5 / 4), - TextArea.SCROLLBARS_VERTICAL_ONLY); - this.output.setEditable(false); - gbcon.gridx = 0; - gbcon.gridy = 0; - gbl.setConstraints(this.code, gbcon); - add(this.code); - gbcon.gridx = 1; - gbl.setConstraints(this.generate, gbcon); - add(this.generate); - gbcon.gridx = 2; - gbl.setConstraints(this.output, gbcon); - add(this.output); - } - - @Override - public boolean action(Event evt, Object arg) { - - if (evt.target instanceof Button) { - this.output.setText(""); - runProgram(); - return true; - } - return false; - } - - public void runProgram() { - - final TopPanel tp = this.app.topPanel; - runLara(this.app, this.code.getText(), tp.languageTxt.getText(), tp.resourcesTxt.getText(), tp.xmlTxt.getText(), - tp.outputTxt.getText(), tp.workingTxt.getText(), tp.showAspectIR.getState(), tp.interpreter.getState(), - tp.showTreeDefinition.getState()); - final String out = this.output.getText(); - if (out.contains("at line ")) { - - final int pos = out.indexOf("at line ") + "at line ".length(); - final int line = Integer.parseInt(out.substring(pos, out.indexOf(",", pos))); - final int colPos = out.indexOf(" column ", pos) + " column ".length(); - final int column = Integer.parseInt(out.substring(colPos, out.indexOf(".", colPos))); - System.out.println("select: " + line); - this.code.select(line, line + 10); - System.getProperty("line.separator"); - - final String[] lines = this.code.getText().split("\n"); - System.out.println("totalLines: " + lines.length); - if (line - 1 < lines.length) { - int posInit = 0; - for (int i = 0; i < line - 1; i++) { - posInit += (lines[i] + "\n").length(); - } - - final int finalSel = posInit + (lines[line - 1] + "\n").length(); - this.code.select(posInit + column, finalSel); - this.code.requestFocus(); - } - } - - } - - private static void runLara(GUI app, String code, String language, String resource, String xmlDir, String outputDir, - String workDir, boolean showAspectIR, boolean interpret, boolean showTree) { - final RunLara runner = new RunLara(code, showAspectIR, interpret, showTree, app); - runner.run(); - } -} - -class TopPanel extends Panel { - - /** - * - */ - private static final long serialVersionUID = 1L; - HashMap examples; - Checkbox showAspectIR; - Checkbox interpreter; - Checkbox showTreeDefinition; - Label aspectLabel, languageLabel, resourcesLabel, xmlLabel, outputLabel, workingLabel; - Button aspectDial, languageDial, resourcesDial, xmlDial, outputDial, workingDial; - Choice loader; - Button load; - TextField aspectTxt, languageTxt, resourcesTxt, xmlTxt, outputTxt, workingTxt; - GUI app; - - public TopPanel(GUI parent) { - this.app = parent; - final GridBagLayout gbl = new GridBagLayout(); - final GridBagConstraints gbcon = new GridBagConstraints(); - - initLabels(gbl, gbcon); - initDialogs(gbl, gbcon); - initTxtBoxs(gbl, gbcon); - initExamplesChoice(gbl, gbcon); - setLayout(gbl); - } - - private void initExamplesChoice(GridBagLayout gbl, GridBagConstraints gbcon) { - this.load = new Button("Load"); - this.showAspectIR = new Checkbox("Show Aspect-IR", true); - this.interpreter = new Checkbox("Interpret (not working)", false); - this.showTreeDefinition = new Checkbox("Tree of Definitions", false); - this.load.setActionCommand(Commands.LOAD.toString()); - this.loader = new Choice(); - this.examples = new HashMap<>(); - if (FileUtils.getExamplesFromDir("examples", this.examples)) { - for (final String example : this.examples.keySet()) { - this.loader.addItem(example); - } - } - gbcon.gridx = 1; - gbcon.gridy = 3; - gbcon.anchor = GridBagConstraints.WEST; - gbl.setConstraints(this.loader, gbcon); - add(this.loader); - - gbcon.gridx = 0; - gbcon.gridy = 3; - gbcon.anchor = GridBagConstraints.EAST; - gbl.setConstraints(this.load, gbcon); - add(this.load); - gbcon.anchor = GridBagConstraints.WEST; - gbcon.gridx = 4; - gbcon.gridy = 2; - gbl.setConstraints(this.showAspectIR, gbcon); - add(this.showAspectIR); - gbcon.anchor = GridBagConstraints.WEST; - gbcon.gridy = 3; - gbcon.gridx = 4; - gbl.setConstraints(this.interpreter, gbcon); - add(this.interpreter); - gbcon.gridy = 4; - gbl.setConstraints(this.showTreeDefinition, gbcon); - add(this.showTreeDefinition); - } - - private void initTxtBoxs(GridBagLayout gbl, GridBagConstraints gbcon) { - - this.aspectTxt = new TextField(20); - this.languageTxt = new TextField(20); - this.languageTxt.setText("C"); - this.resourcesTxt = new TextField(20); - this.xmlTxt = new TextField(20); - this.xmlTxt.setText("." + File.separator); - this.outputTxt = new TextField(20); - this.outputTxt.setText("." + File.separator); - this.workingTxt = new TextField(20); - this.workingTxt.setText("." + File.separator); - - gbcon.gridx = 1; - gbcon.gridy = 0; - - // gbcon.gridx = 4; - gbl.setConstraints(this.languageTxt, gbcon); - add(this.languageTxt); - - gbcon.gridx = 1; - gbcon.gridy = 1; - gbl.setConstraints(this.resourcesTxt, gbcon); - add(this.resourcesTxt); - - gbcon.gridx = 4; - gbcon.gridy = 0; - gbl.setConstraints(this.xmlTxt, gbcon); - add(this.xmlTxt); - - gbcon.gridx = 1; - gbcon.gridy = 2; - gbl.setConstraints(this.outputTxt, gbcon); - add(this.outputTxt); - - gbcon.gridx = 4; - gbcon.gridy = 1; - gbl.setConstraints(this.workingTxt, gbcon); - add(this.workingTxt); - } - - private void initDialogs(GridBagLayout gbl, GridBagConstraints gbcon) { - - this.aspectDial = new Button(".."); - this.aspectDial.setActionCommand(Commands.ASPECT.toString()); - this.languageDial = new Button(".."); - this.languageDial.setActionCommand(Commands.LANGUAGE.toString()); - this.resourcesDial = new Button(".."); - this.resourcesDial.setActionCommand(Commands.RESOURCE.toString()); - this.xmlDial = new Button(".."); - this.xmlDial.setActionCommand(Commands.XML.toString()); - this.outputDial = new Button(".."); - this.outputDial.setActionCommand(Commands.OUTPUT.toString()); - this.workingDial = new Button(".."); - this.workingDial.setActionCommand(Commands.WORKSPACE.toString()); - - // gbcon.gridx = 2; gbcon.gridy = 0; - // gbl.setConstraints(aspectDial, gbcon); - // add(aspectDial); - gbcon.gridx = 2; - gbcon.gridy = 1; - gbl.setConstraints(this.resourcesDial, gbcon); - add(this.resourcesDial); - gbcon.gridx = 5; - gbcon.gridy = 0; - gbl.setConstraints(this.xmlDial, gbcon); - add(this.xmlDial); - gbcon.gridx = 2; - gbcon.gridy = 2; - gbl.setConstraints(this.outputDial, gbcon); - add(this.outputDial); - gbcon.gridx = 5; - gbcon.gridy = 1; - gbl.setConstraints(this.workingDial, gbcon); - add(this.workingDial); - } - - private void initLabels(GridBagLayout gbl, GridBagConstraints gbcon) { - this.aspectLabel = new Label("Aspect File:"); - this.languageLabel = new Label("Language:"); - this.resourcesLabel = new Label("Resources:"); - this.xmlLabel = new Label("XML dir:"); - this.outputLabel = new Label("Output dir:"); - this.workingLabel = new Label("Working dir:"); - gbcon.gridx = 0; - gbcon.gridy = 0; - // gbcon.gridwidth = 2; - gbcon.anchor = GridBagConstraints.EAST; - // gbcon.weighty = 0.1; - // gbl.setConstraints(aspectLabel, gbcon); - // add(aspectLabel); - - // gbcon.gridx = 3; - gbl.setConstraints(this.languageLabel, gbcon); - add(this.languageLabel); - - gbcon.gridx = 0; - gbcon.gridy = 0; - gbl.setConstraints(this.resourcesLabel, gbcon); - add(this.resourcesLabel); - - gbcon.gridx = 3; - gbl.setConstraints(this.xmlLabel, gbcon); - add(this.xmlLabel); - - gbcon.gridx = 0; - gbcon.gridy = 1; - gbl.setConstraints(this.outputLabel, gbcon); - add(this.outputLabel); - - gbcon.gridx = 3; - gbl.setConstraints(this.workingLabel, gbcon); - add(this.workingLabel); - } - - JFileChooser fc = new JFileChooser("File selection"); - - @Override - public boolean action(Event evt, Object arg) { - // new StringBuffer(50); - - if (evt.target instanceof Button) { - final Button bt = (Button) evt.target; - final String command = bt.getActionCommand(); - this.fc.setCurrentDirectory(new File(".")); - switch (Commands.valueOf(command)) { - case ASPECT: - FileUtils.processJFileChooser(this.app, this.fc, FileUtils.aspectFilter, this.aspectTxt, - JFileChooser.FILES_ONLY); - break; - case RESOURCE: - FileUtils.processJFileChooser(this.app, this.fc, FileUtils.txtFilter, this.resourcesTxt, - JFileChooser.FILES_ONLY); - break; - case XML: - FileUtils.processJFileChooser(this.app, this.fc, FileUtils.dirXMLFilter, this.xmlTxt, - JFileChooser.DIRECTORIES_ONLY); - break; - case OUTPUT: - FileUtils.processJFileChooser(this.app, this.fc, FileUtils.dirFilter, this.outputTxt, - JFileChooser.DIRECTORIES_ONLY); - break; - case WORKSPACE: - FileUtils.processJFileChooser(this.app, this.fc, FileUtils.dirFilter, this.workingTxt, - JFileChooser.DIRECTORIES_ONLY); - break; - case LOAD: - final String key = this.loader.getSelectedItem(); - final String example = this.examples.get(key); - this.app.console.code.setText(example); - break; - case CLEAR: - break; - case GENERATE: - break; - case LANGUAGE: - break; - case OPEN: - break; - case SAVE: - break; - case SAVEAS: - break; - default: - break; - } - return true; - } - return false; - } -} - -public class GUI extends Applet { - /** - * - */ - private static final long serialVersionUID = 1L; - static final Color BGCOLOR = new Color(192, 192, 192); - static final int window_Width = 1000; - static final int window_Height = 650; - static final int areaHeight = (int) (GUI.window_Height / 10 * 0.40); - static final int areaWidth = (int) (GUI.window_Width / 10 * 1.2); - - Label title = new Label("Meta-Aspect Language"); - TopPanel topPanel; - Console console; - LowPanel lowPanel; - - @Override - public void init() { - - setBackground(GUI.BGCOLOR); - - this.topPanel = new TopPanel(this); - this.console = new Console(this); - this.lowPanel = new LowPanel(this); - final GridBagLayout gbl = new GridBagLayout(); - - final GridBagConstraints gbcon = new GridBagConstraints(); - setLayout(gbl); - gbcon.gridx = 0; - gbcon.gridy = 0; - // gbcon.gridwidth = 2; - gbcon.fill = GridBagConstraints.BOTH; - - gbcon.weighty = 0.2; - gbcon.anchor = GridBagConstraints.WEST; - gbl.setConstraints(this.topPanel, gbcon); - add(this.topPanel); - this.topPanel.validate(); - gbcon.gridy = 1; - gbcon.weighty = 0.1; - gbcon.anchor = GridBagConstraints.WEST; - gbl.setConstraints(this.console, gbcon); - add(this.console); - this.console.validate(); - gbcon.gridy = 2; - gbcon.weighty = 0.1; - gbcon.gridx = 0; - gbcon.anchor = GridBagConstraints.WEST; - gbcon.insets = new Insets(0, 0, 0, GUI.window_Width / 2); - gbl.setConstraints(this.lowPanel, gbcon); - add(this.lowPanel); - this.lowPanel.validate(); - - setSize(GUI.window_Width, GUI.window_Height); - setMinimumSize(new Dimension(GUI.window_Width, GUI.window_Height)); - addComponentListener(new ComponentListener() { - - @Override - public void componentShown(ComponentEvent e) { - // TODO Auto-generated method stub - - } - - @Override - public void componentResized(ComponentEvent e) { - // determine the size of the new JFrame - final GUI gui = (GUI) e.getComponent(); - final Dimension oldDim = gui.getSize(); - - /* - * resize the JScrollPane to be 20 pixels less in width and 70 - * pixels less in height that new size - */ - final int width = (int) oldDim.getWidth(); - final int height = (int) oldDim.getHeight(); - - // new Dimension(width, height); - - gui.setSize(new Dimension(width, height)); - - } - - @Override - public void componentMoved(ComponentEvent e) { - // TODO Auto-generated method stub - - } - - @Override - public void componentHidden(ComponentEvent e) { - // TODO Auto-generated method stub - - } - }); - - } -} diff --git a/LARAC/src/larac/LARACLauncher.java b/LARAC/src/larac/LARACLauncher.java deleted file mode 100644 index faa7b2fbd..000000000 --- a/LARAC/src/larac/LARACLauncher.java +++ /dev/null @@ -1,89 +0,0 @@ -/** - * Copyright 2015 SPeCS. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. under the License. - */ - -package larac; - -import org.lara.language.specification.dsl.LanguageSpecificationV2; - -import larac.utils.output.Output; -import pt.up.fe.specs.tools.lara.exception.BaseException; - -public class LARACLauncher { - - /** - * The main function where the aspect file is parsed and the output files are created - * - * @param args - * The input arguments of the program - */ - public static void main(String args[]) { - - LARACLauncher.exec(args); - } - - /** - * Execute LaraC with the input arguments - * - * @param args - * array containing the input arguments - */ - public static int exec(String args[]) { - - return LARACLauncher.exec(args, new Output()); - } - - /** - * Execute LaraC with the input arguments and a user-defined output (typically used when calling LaraC recursively) - * - * @param args - * array containing the input arguments - * @param output - * user-defined output, containing a user-defined verbose level - */ - public static int exec(String args[], Output output) { - // Create a new instance of lara with the standard output and generate - // the AST - try { - final LaraC lara = new LaraC(args, output); - if (lara.isReadyToParse()) { - return lara.compileAndSave(); - } - return 1; - } catch (BaseException e) { - throw e.generateRuntimeException(); - } - } - - /** - * Execute LaraC with the input arguments and a user-defined output (typically used when calling LaraC recursively) - * - * @param args - * array containing the input arguments - * @param output - * user-defined output, containing a user-defined verbose level - */ - public static int exec(String args[], LanguageSpecificationV2 langSpec, Output output) { - // Create a new instance of lara with the standard output and generate - // the AST - try { - final LaraC lara = new LaraC(args, langSpec, output); - if (lara.isReadyToParse()) { - return lara.compileAndSave(); - } - return 1; - } catch (BaseException e) { - throw e.generateRuntimeException(); - } - } - -} diff --git a/LARAC/src/larac/LaraC.java b/LARAC/src/larac/LaraC.java deleted file mode 100644 index 7af50a267..000000000 --- a/LARAC/src/larac/LaraC.java +++ /dev/null @@ -1,978 +0,0 @@ -/* - * Copyright 2013 SPeCS. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. under the License. - */ -package larac; - -import java.io.BufferedReader; -import java.io.File; -import java.io.IOException; -import java.io.InputStream; -import java.io.InputStreamReader; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collection; -import java.util.LinkedHashSet; -import java.util.List; -import java.util.Map; -import java.util.Optional; -import java.util.stream.Collectors; - -import javax.management.modelmbean.XMLParseException; -import javax.xml.bind.JAXBException; -import javax.xml.parsers.ParserConfigurationException; -import javax.xml.transform.TransformerException; -import javax.xml.transform.TransformerFactoryConfigurationError; - -import org.apache.commons.io.input.BOMInputStream; -import org.dojo.jsl.parser.ast.ASTStart; -import org.dojo.jsl.parser.ast.LARAEcmaScript; -import org.dojo.jsl.parser.ast.LARAEcmaScriptTreeConstants; -import org.dojo.jsl.parser.ast.ParseException; -import org.dojo.jsl.parser.ast.Token; -import org.dojo.jsl.parser.ast.TokenMgrError; -import org.dojo.jsl.parser.ast.utils.ASTScriptImport; -import org.lara.language.specification.dsl.LanguageSpecificationV2; -import org.w3c.dom.Document; -import org.xml.sax.SAXException; - -import larac.exceptions.LARACompilerException; -import larac.exceptions.StopParseException; -import larac.exceptions.SyntaxException; -import larac.options.LaraCOptions; -import larac.options.resources.InputStreamProvider; -import larac.structure.AspectIR; -import larac.utils.FileUtils; -import larac.utils.Organizer; -import larac.utils.output.MessageConstants; -import larac.utils.output.Output; -import pt.up.fe.specs.lara.aspectir.Aspects; -import pt.up.fe.specs.tools.lara.exception.BaseException; -import pt.up.fe.specs.util.SpecsCollections; -import pt.up.fe.specs.util.SpecsIo; -import pt.up.fe.specs.util.SpecsLogs; -import pt.up.fe.specs.util.providers.ResourceProvider; -import tdrc.utils.StringUtils; - -/** - * Main class of the LARA compiler. The process involves parsing the input file given by the user, organize the AST, - * according to the target language specification, and the create the Aspect Intermediate Representation (Aspect-IR) - * - * @author Tiago - * - */ -public class LaraC { - /** - * The current version of the Lara compiler - */ - public static final String FRONT_END_VERSION = "Lara compiler version: 2.51"; - - public static final String PROPERTY_JAR_PATH = "lara.jarpath"; - - private static final Collection SUPPORTED_LARA_EXT = new LinkedHashSet<>(Arrays.asList("lara")); - // private static final Collection SUPPORTED_SCRIPT_EXT = new LinkedHashSet<>(Arrays.asList("js", "mjs")); - // Disabled .mjs since it is not properly working for imports - private static final Collection SUPPORTED_SCRIPT_EXT = new LinkedHashSet<>(Arrays.asList("js", "mjs")); - private static final Collection SUPPORTED_EXT = new LinkedHashSet<>(); - static { - SUPPORTED_EXT.addAll(SUPPORTED_LARA_EXT); - SUPPORTED_EXT.addAll(SUPPORTED_SCRIPT_EXT); - } - - private Output print; - private String jarPath; - private String laraName; // simple name of the lara file/resource - private String laraPath; // complete path to the lara file/resource - private File laraFile; - private InputStreamProvider laraStreamProvider; - private String prefix = ""; - - private LanguageSpecificationV2 languageSpec; - - private AspectIR aspectIR; - - private boolean parsed; - private LaraCOptions options; - - private Document aspectIRXmlRepresentation; - private Map importedLARA; - private List previouslyImportedLARA = new ArrayList<>(); - - private boolean readyToParse = false; - private boolean toJsMode = false; - - /** - * Create a LaraC instance with the input arguments and the default output stream - * - * @param args - * input arguments - * @throws IOException - * @throws SAXException - * @throws ParserConfigurationException - * @throws XMLParseException - * @throws JAXBException - */ - public LaraC(String args[]) - // throws IOException, ParserConfigurationException, SAXException, JAXBException, XMLParseException { - throws IOException, ParserConfigurationException, SAXException, JAXBException { - this(args, new Output()); - } - - /** - * Create a LaraC instance with the input arguments and a user-defined output stream - * - * @param args - * input arguments - * @param out - * user-defined output, containing a user-defined verbose level - */ - public LaraC(String args[], Output out) { - - setReadyToParse(laraConstructor(args, out)); - } - - /** - * Create a LaraC instance with the input arguments and a user-defined output stream - * - * @param args - * input arguments - * @param out - * user-defined output, containing a user-defined verbose level - */ - public LaraC(String args[], LanguageSpecificationV2 langSpec, Output out) { - setReadyToParse(laraConstructor(args, langSpec, out)); - } - - /** - * Generate a LaraC instance with a previous information of a (parent) LaraC instance and the target language - * specification.
- * NOTE: This constructor should only be called when an import is made in a LARA file - * - * @param laraFile - * input lara file - * @param options - * input arguments previously parsed by other LaraC instance - * @param langSpec - * language specification previously parsed by other LaraC instance - * @param output - * the output stream used on the parent LaraC instance - */ - public static LaraC newImporter(File laraFile, LaraCOptions options, LanguageSpecificationV2 langSpec, - Output output, Map importedFiles) { - - LaraC laraC = new LaraC(options, langSpec, output); - laraC.getOptions().setLaraFile(laraC, laraFile); - laraC.parseForImport(importedFiles); - return laraC; - } - - /** - * Generate a LaraC instance with a previous information of a (parent) LaraC instance and the target language - * specification.
- * NOTE: This constructor should only be called when an import is made in a LARA file - * - * * @param laraResource input lara resource - * - * @param options - * input arguments previously parsed by other LaraC instance - * @param langSpec - * language specification previously parsed by other LaraC instance - * @param output - * the output stream used on the parent LaraC instance - */ - public static LaraC newImporter(ResourceProvider laraResource, LaraCOptions options, - LanguageSpecificationV2 langSpec, - Output output, Map importedFiles) { - LaraC laraC = new LaraC(options, langSpec, output); - laraC.getOptions().setLaraResource(laraC, laraResource); - laraC.parseForImport(importedFiles); - - return laraC; - } - - // public static LaraC newImporter(String filename, String laraCode, LaraCOptions options, - // LanguageSpecificationV2 langSpec, - // Output output, Map importedFiles) { - // - // LaraC laraC = new LaraC(options, langSpec, output); - // laraC.setLaraPath(filename); - // laraC.setLaraStreamProvider(() -> SpecsIo.toInputStream(laraCode)); - // laraC.parseForImport(importedFiles); - // return laraC; - // } - - private LaraC(LaraCOptions options, LanguageSpecificationV2 langSpec, Output output) { - setParsed(false); - this.options = options; - print = output; - languageSpec = langSpec; - // languageSpecV2 = JoinPointFactory.fromOld(langSpec); - } - - public void setToJsMode(boolean toJsMode, String laraFilename, String laraCode) { - this.toJsMode = toJsMode; - setLaraPath(laraFilename); - setLaraStreamProvider(() -> SpecsIo.toInputStream(laraCode)); - } - - public boolean isToJsMode() { - return toJsMode; - } - - public static Collection getSupportedScriptExtensions() { - return SUPPORTED_SCRIPT_EXT; - } - - public static Collection getSupportedExtensions() { - return SUPPORTED_EXT; - } - - private void parseForImport(Map importedFiles) { - importedLARA = importedFiles; - aspectIR = new AspectIR(this); - - final boolean isParsed = execParse(); - if (!isParsed) { - return; - } - setParsed(true); - // parse(); - println("Importing: Parse Successful!"); - } - - /** - * Constructs the LaraC instance with the given arguments and an output stream - * - * @param args - */ - private boolean laraConstructor(String[] args, Output out) { - - // initialize lara - boolean ready = initialize(args, out); - - // Parse the language specification - if (ready) { - final File xmlSourceDir = options.getXmlSpecDir(); - setLanguageSpec(LanguageSpecificationV2.newInstance(xmlSourceDir, true)); - } - return ready; - // parse(); - } - - /** - * Constructs the LaraC instance with the given arguments, the output stream and a {@link LanguageSpecificationV2} - * instance - * - * @param args - * @param langSpec - * @param out - */ - private boolean laraConstructor(String[] args, LanguageSpecificationV2 langSpec, Output out) { - - // initialize lara - boolean ready = initialize(args, out); - - // Parsing the language specification - setLanguageSpec(langSpec); - return ready; - // parse(); - } - - /** - * This is the last part of the constructor, after the language specification, in which we parse the lara file with - * the given input and the language specification - */ - private void parse() { - final boolean isFileParsed = execParse(); - if (!isFileParsed) { - return; - } - setParsed(true); - } - - /** - * Initialize LaraC with the input arguments and the output stream - * - * @param args - * @return true if all options were successfully managed, false otherwise - */ - private boolean initialize(String[] args, Output out) { - - setPrint(out); - printTopic("Setting up LARA"); - setImportedLARA(SpecsCollections.newHashMap()); - setAspectIR(new AspectIR(this)); - setParsed(false); - setOptions(new LaraCOptions()); - - final boolean optionsSetted = options.setOptions(this, args); - if (optionsSetted) { - options.printInformation(print); - } - return optionsSetted; - } - - /** - * Parse the input LARA file - * - * @return true if parsed successful, false otherwise - */ - private boolean execParse() { - - // Create a new Parser - // final LARAEcmaScript parser = new LARAEcmaScript(); - // laraFile = new File(laraPath + laraSimpleName); - - // And then parse the input LARA file, if exists - println(MessageConstants.FILE_READ + laraPath); - // if (laraFile == null) { - // LoggingUtils.msgInfo("!Terminating program"); - // return false; - // } - - var extension = SpecsIo.getExtension(laraPath).toLowerCase(); - - // System.out.println("EXTENSION: " + extension); - - if (extension.equals("lara")) { - parseLara(); - } else if (SUPPORTED_SCRIPT_EXT.contains(extension)) { - parseScript(); - } else { - throw new RuntimeException("Tried to import unsupported file type: " + extension - + ". Supported types: lara, " + SUPPORTED_SCRIPT_EXT.stream().collect(Collectors.joining(", "))); - } - - println("Parse Successful!"); - aspectIR.getAst().setLara(this); - return true; - } - - private void parseLara() { - // try (BOMInputStream bis = new BOMInputStream(new FileInputStream(laraFile)); - try (BOMInputStream bis = new BOMInputStream(getLaraStream()); - BufferedReader br = new BufferedReader(new InputStreamReader(bis));) { - ASTStart ast = javaCCParser(br); - aspectIR.setAst(ast); - } catch (Exception e) { - throw new LARACompilerException("when parsing: " + laraPath, e); - } - } - - private void parseScript() { - var ast = new ASTStart(LARAEcmaScriptTreeConstants.JJTSTART); - ast.jjtAddChild(new ASTScriptImport(getLaraStream(), getLaraPath()), 0); - aspectIR.setAst(ast); - } - - public static ASTStart javaCCParser(BufferedReader br) { - LARAEcmaScript parser = new LARAEcmaScript(br); - Throwable possibleException = null; - ASTStart abstractTree = null; - try { - abstractTree = parser.parse(); - if (!parser.exceptions.isEmpty()) { - throw new StopParseException(); - // System.out.println("Exceptions:"); - // parser.exceptions.forEach(System.out::println); - } - return abstractTree; - } catch (StopParseException e) { - // Just go to the finally statement and throw syntax exception with exceptions - } catch (ParseException e) { - parser.exceptions.add(e); - } catch (TokenMgrError e) { - parser.exceptions.add(e); - } catch (Throwable e) { - possibleException = e; - } finally { - - if (!parser.exceptions.isEmpty()) { - if (parser.exceptions.size() == 1) { - throw new RuntimeException("Problems while parsing LARA", parser.exceptions.get(0)); - } else { - throw new SyntaxException(parser.exceptions, possibleException); - } - - } else if (possibleException != null) { - parser.exceptions.add(possibleException); - possibleException.printStackTrace(); - throw new SyntaxException(parser.exceptions); - } - } - return abstractTree; - - } - - public static int getNumTokens(ASTStart abstractTree) { - Token token = abstractTree.jjtGetFirstToken(); - int count = 0; - while (token != null) { - count++; - token = token.next; - } - return count; - } - - public int getNumTokens() { - return getNumTokens(this.aspectIR.getAst()); - } - - /** - * Organize the AST containing the aspects, according to the target language specification, to agree with the - * Aspect-IR structure specification - */ - public void toAspectIR() { - aspectIR.organize(); - } - - /** - * Generate the Aspect-IR and save it into an xml file with the same name as the input lara file - */ - public void createXML() { - - aspectIRXmlRepresentation = aspectIR.toXML(); - - } - - private void saveXML() { - try { - String fileName = laraName; - - fileName = fileName.replace(".lara", ""); - fileName = fileName.replace(".js", ""); - - if (fileName.lastIndexOf(File.separator) > -1) { - fileName = fileName.substring(fileName.lastIndexOf(File.separator) + 1); - } - - saveXML(aspectIRXmlRepresentation, fileName); - } catch (final TransformerException e) { - throw new LARACompilerException("When saving Aspect-IR's XML", e); - } - } - - /** - * Write an XML (org.w3c.dom.Document instance) into a file - * - * @param doc - * the Document to be written - * @param fileName - * output file name - * @throws TransformerException - * if doc is not correctly transformed to XML - */ - private void saveXML(Document doc, String fileName) throws TransformerException { - final StringBuffer xmlStringBuffer = StringUtils.xmlToStringBuffer(doc, MessageConstants.INDENT); - aspectIR.setXml(xmlStringBuffer); - FileUtils.toFile(print, fileName, ".xml", xmlStringBuffer.toString(), options.getOutputDir()); - } - - /** - * Kill the execution. The method is deprecated, please use {@link LaraC} .kill(error). - * - * @param error - */ - @Deprecated - public void die(String error) { - // errorln(error); - throw new RuntimeException(error);// System.exit(-1); - } - - /** - * Kill the execution, throwing a RuntimeException - * - * @param error - * an error message - */ - /* - * public static void kill(String error) { // ErrorMsg.say(error); throw new - * RuntimeException(error);// System.exit(-1); } - */ - - // ////////////////////////////////////////// - // Methods to ease the use of the printer // - // ////////////////////////////////////////// - - /** - * Method used to print the section where the front-end currently is - * - * @param topic - * the current topic - * @param larac - * the current instance of LaraC - */ - public void printTopic(String topic) { - final StringBuffer buf = new StringBuffer(MessageConstants.UNDERLINE); - buf.append("\n "); - buf.append(MessageConstants.order++); - buf.append(". "); - buf.append(topic); - buf.append("\n"); - buf.append(MessageConstants.OVERLINE); - println(buf.toString()); - } - - /** - * Method used to print the section where the front-end currently is - * - * @param topic - * the current topic - * @param larac - * the current instance of LaraC - */ - public void printSubTopic(String topic) { - final StringBuffer buf = new StringBuffer(MessageConstants.UNDERLINE); - buf.append("\n"); - buf.append(topic); - buf.append("\n"); - buf.append(MessageConstants.OVERLINE); - println(buf.toString()); - } - - public void error(Object message) { - print.error(message); - } - - public void errorln(Object message) { - print.errorln(message); - } - - public void warn(Object message) { - print.warn(message); - } - - public void warnln(Object message) { - print.warnln(message); - } - - public void print(Object message) { - print.print(message); - } - - public void println(Object message) { - print.println(message); - } - - // ////////////////////////////////////////// - // ///////// Getters & Setters ////////////// - // ////////////////////////////////////////// - - /** - * @param printer - * the printer to set - */ - public void setPrint(Output printer) { - print = printer; - } - - /** - * @param the - * printer - */ - public Output getPrint() { - return print; - } - - /** - * @return the options - */ - public LaraCOptions getOptions() { - return options; - } - - /** - * @param options - * the options to set - */ - public void setOptions(LaraCOptions options) { - this.options = options; - } - - /** - * @return the laraName - */ - public String getLaraName() { - return laraName; - } - - /** - * @param laraName - * the laraName to set - */ - public void setLaraName(String laraName) { - this.laraName = laraName; - } - - /** - * @return the laraFile - */ - public File getLaraFile() { - return laraFile; - } - - // public String getLaraLocation() { - // if (laraFile != null) { - // return IoUtils.getCanonicalPath(laraFile); - // } - // - // return getLaraPath() - // } - - /** - * @param laraFile - * the laraFile to set - */ - public void setLaraFile(File laraFile) { - this.laraFile = laraFile; - } - - /** - * @return the jarPath - */ - public String getJarPath() { - return jarPath; - } - - /** - * @param jarPath - * the jarPath to set - */ - public void setJarPath(String jarPath) { - this.jarPath = jarPath; - } - - /** - * @return the prefix - */ - public String getPrefix() { - return prefix; - } - - /** - * @param prefix - * the prefix to set - */ - public void setPrefix(String prefix) { - this.prefix = prefix; - } - - /** - * @return the languageSpec - */ - public LanguageSpecificationV2 languageSpec() { - return languageSpec; - } - - /** - * @param languageSpec - * the languageSpec to set - */ - public void setLanguageSpec(LanguageSpecificationV2 languageSpec) { - this.languageSpec = languageSpec; - } - - /** - * @return the aspectIR - */ - public AspectIR aspectIR() { - return aspectIR; - } - - /** - * @param aspectIR - * the aspectIR to set - */ - public void setAspectIR(AspectIR aspectIR) { - this.aspectIR = aspectIR; - } - - /** - * @return the initialized - */ - public boolean isParsed() { - return parsed; - } - - /** - * @param initialized - * the initialized to set - */ - public void setParsed(boolean initialized) { - parsed = initialized; - } - - public LanguageSpecificationV2 getLanguageSpec() { - return languageSpec; - } - - // public LanguageSpecificationV2 getLanguageSpecV2() { - // // return languageSpecV2; - // return JoinPointFactory.fromOld(getLanguageSpec()); - // } - - public Organizer getOrganizer() { - return new Organizer(getLanguageSpec()); - } - - public AspectIR getAspectIR() { - return aspectIR; - } - - /** - * Compiling a LARA file consist on four phases:
- *
    - *
  1. Parse - parse the input file based on the LARA grammar to obtain the AST
  2. - *
  3. AST to Aspect-IR - validation and organization of the AST based on the Aspect-IR Specification
  4. - *
  5. Generate XML - generate the XML representation of the Aspect-IR
  6. - *
  7. Save the XML in a file, within the output folder: /.xml - *
- * - * @return - */ - public int compileAndSave() { - - compile(); - - printTopic("Saving Aspect-IR"); - saveXML(); - println("Saved!"); - - return 0; - } - - /** - * Compiling a LARA file consist on four phases:
- *
    - *
  1. Parse - parse the input file based on the LARA grammar to obtain the AST
  2. - *
  3. AST to Aspect-IR - validation and organization of the AST based on the Aspect-IR Specification
  4. - *
  5. Generate XML - generate the XML representation of the Aspect-IR
  6. - *
- *
- * NOTE:Use this method if you intend to access immediately the Aspect-IR xml representation and do not want - * to create the xml file - * - * @return an xml representation of the Aspect-IR - */ - public Document compile() { - parse(); - /*if (!isParsed()) { - return n; - }*/ - // On debug mode, dump the AST - if (getOptions().isDebug()) { - printTopic("Dumping AST"); - getAspectIR().getAst().dump(" "); - } - - if (laraFile != null) { - importedLARA.put(SpecsIo.getCanonicalPath(laraFile), this); - } - - // Organize Aspects in AST according to the language specification - printTopic("Organizing Aspects"); - toAspectIR(); - println("Organized!"); - // lara.println("\nFinal Structure"); - // lara.printIR(); - - // Generate the Aspect-Intermediate Representation as an XML - printTopic("Creating Aspect-IR"); - createXML(); - println("Created!"); - // On debug or When the user wants to see the Aspect-IR - if (getOptions().isShowAspectIR() || getOptions().isDebug()) { - printTopic("Dumping Aspect-IR"); - printAspectIR(); - } - return getAspectIRXmlRepresentation(); - } - - public void printAspectIR() { - try { - println(StringUtils.xmlToStringBuffer(aspectIRXmlRepresentation, MessageConstants.INDENT).toString()); - } catch (TransformerFactoryConfigurationError | TransformerException e) { - throw new LARACompilerException("When dumping Aspect-IR", e); - } - } - - public Document getAspectIRXmlRepresentation() { - return aspectIRXmlRepresentation; - } - - public String getLaraPath() { - - return laraPath; - } - - public void setLaraPath(String laraPath) { - this.laraPath = laraPath; - } - - public InputStream getLaraStream() { - return laraStreamProvider.getInputStream(); - } - - public void setLaraStreamProvider(InputStreamProvider laraStream) { - laraStreamProvider = laraStream; - } - - public Map getImportedLARA() { - return importedLARA; - } - - public void setImportedLARA(Map importedLARA) { - this.importedLARA = importedLARA; - } - - public void addImportedLARA(String name, LaraC laraC) { - - importedLARA.put(name, laraC); - } - - public void addImportedLARA(Map laras) { - importedLARA.putAll(laras); - } - - public boolean wasImported(String name) { - return importedLARA.containsKey(name); - } - - public LaraC getImportedLARA(String name) { - return importedLARA.get(name); - } - - public boolean isReadyToParse() { - return readyToParse; - } - - public void setReadyToParse(boolean readyToParse) { - this.readyToParse = readyToParse; - } - - public List getPreviouslyImportedLARA() { - return previouslyImportedLARA; - } - - public void setPreviouslyImportedLARA(List previouslyImportedLARA) { - this.previouslyImportedLARA = previouslyImportedLARA; - } - - public void addPreviouslyImportedLARA(LaraC previouslyImportedLARA) { - // LaraLog.debug("PREVIOUSLY IMPORTED: " + previouslyImportedLARA.getLaraPath() + " @ " + getLaraPath()); - this.previouslyImportedLARA.add(previouslyImportedLARA); - } - - public static Optional parseLara(File laraFile, LanguageSpecificationV2 languageSpecification) { - // Pass through LaraC - List args = new ArrayList<>(); - - args.add(laraFile.getAbsolutePath()); - args.add("--doc"); - args.add("--verbose"); - args.add("0"); - - LaraC larac = new LaraC(args.toArray(new String[0]), languageSpecification, - new Output(0)); - Document aspectIr = null; - - try { - aspectIr = larac.compile(); - } catch (BaseException e) { - // If LARA exception, generate exception - SpecsLogs.msgInfo("Could not compile file '" + laraFile + "': " - + e.generateExceptionBuilder().getRuntimeException()); - return Optional.empty(); - } catch (Exception e) { - SpecsLogs.warn("Could not compile file '" + laraFile + "'", e); - return Optional.empty(); - } - - try { - return Optional.of(new Aspects(aspectIr, "")); - } catch (Exception e) { - SpecsLogs.msgInfo("Could not create aspects: " + e.getMessage()); - return Optional.empty(); - } - - } - - public static boolean isSupportedExtension(String filenameExtension) { - return SUPPORTED_EXT.contains(filenameExtension.toLowerCase()); - } - - /** - * - * Generates a XML document with the AspectIR corresponding to the JS code that needs to be executed in order to - * import the given name, using the same format as the imports in LARA files (e.g. weaver.Query). - * - * @param importName - */ - public Document importLara(String importName) { - // Create LaraC based on current LaraC, to keep imports - - LaraC laraC = new LaraC(options, languageSpec, print); - // laraC.getOptions().setLaraResource(laraC, laraResource); - laraC.setLaraPath("dummy.lara"); - laraC.setLaraStreamProvider(() -> SpecsIo.toInputStream("import " + importName + ";")); - laraC.parseForImport(getImportedLARA()); - - // laraC.compile(); - // laraC.parse(); - - // var previouslyImported = new HashSet<>(getImportedLARA().keySet()); - - // System.out.println("IMPORTED LARA BEFORE: " + previouslyImported); - - if (importName.endsWith(".")) { - throw new RuntimeException("Invalid import, cannot end with '.': " + importName); - } - - // Split into fileName and filePath - int dotIndex = importName.lastIndexOf('.'); - - var fileName = dotIndex == -1 ? importName : importName.substring(dotIndex + 1); - var filePath = dotIndex == -1 ? "" : importName.substring(0, dotIndex + 1); - filePath = filePath.replace('.', '/'); - - // Get LARA imports - var laraImports = getOptions().getLaraImports(fileName, filePath); - - laraImports.stream().forEach(laraImport -> laraImport.resolveImport(laraC)); - - // var currentlyImported = getImportedLARA(); - // System.out.println("IMPORTED LARA AFTER: " + currentlyImported); - - // var newKeys = new HashSet<>(currentlyImported.keySet()); - // System.out.println("NEW KEYS BEFORE: " + newKeys); - // newKeys.removeAll(previouslyImported); - - // System.out.println("NEW KEYS AFTER: " + newKeys); - - var aspectIr = laraC.getAspectIR(); - var doc = aspectIr.toXML(); - - return doc; - - // for (var key : newKeys) { - // System.out.println("KEY: " + key); - // var larac = currentlyImported.get(key); - // var aspectIr = larac.getAspectIR(); - // - // System.out.println("IS PARSED? " + larac.isParsed()); - // // Alternatively, we could call larac.createXML();, but this is more explicit - // var doc = aspectIr.toXML(); - // - // System.out.println("DOC: " + doc); - // } - - } -} diff --git a/LARAC/src/larac/code/AspectIrToLara.java b/LARAC/src/larac/code/AspectIrToLara.java deleted file mode 100644 index fe69d7463..000000000 --- a/LARAC/src/larac/code/AspectIrToLara.java +++ /dev/null @@ -1,143 +0,0 @@ -package larac.code; - -import java.util.stream.Collectors; - -import larac.objects.Enums; -import larac.objects.Enums.BinaryOperator; -import larac.objects.Enums.UnaryOperator; -import pt.up.fe.specs.lara.aspectir.Argument; -import pt.up.fe.specs.lara.aspectir.CodeElem; -import pt.up.fe.specs.lara.aspectir.ExprCall; -import pt.up.fe.specs.lara.aspectir.ExprId; -import pt.up.fe.specs.lara.aspectir.ExprLiteral; -import pt.up.fe.specs.lara.aspectir.ExprOp; -import pt.up.fe.specs.lara.aspectir.Expression; -import pt.up.fe.specs.lara.aspectir.Parameter; -import pt.up.fe.specs.util.SpecsCheck; -import pt.up.fe.specs.util.classmap.FunctionClassMap; - -public class AspectIrToLara { - - private final FunctionClassMap codeGenerators; - - public AspectIrToLara() { - this.codeGenerators = new FunctionClassMap<>(); - buildCodeGenerators(); - } - - private void buildCodeGenerators() { - codeGenerators.put(Argument.class, this::getArgumentCode); - codeGenerators.put(ExprId.class, this::getExprIdCode); - codeGenerators.put(ExprLiteral.class, this::getExprLiteralCode); - codeGenerators.put(ExprOp.class, this::getExprOpCode); - codeGenerators.put(ExprCall.class, this::getExprCallCode); - codeGenerators.put(Expression.class, this::getExpressionCode); - } - - public String getCode(CodeElem codeElem) { - return codeGenerators.apply(codeElem); - } - - public String getExpressionCode(Expression expression) { - // If Expression, xmltag should be defined? Implement as normal call - if (expression.xmltag == null) { - throw new RuntimeException("Generator not implemented for class " + expression.getClass() + ".\nXML IR: " - + CodeElems.toXml(expression)); - } - - switch (expression.xmltag) { - case "property": - return getPropertyCode(expression); - default: - throw new RuntimeException("Expression code not implement for xml tag '" + expression.xmltag + "'"); - } - - } - - private String getPropertyCode(Expression expression) { - // SpecsCheck.checkArgument(expression.exprs.size() == 2, - // () -> "Expected expression property to have two expressions, has " + expression.exprs.size()); - SpecsCheck.checkSize(expression.exprs, 2); - - return codeGenerators.apply(expression.exprs.get(0)) + "." + codeGenerators.apply(expression.exprs.get(1)); - } - - public String getExprIdCode(ExprId exprId) { - return exprId.name; - } - - public String getExprLiteralCode(ExprLiteral exprLiteral) { - // if ("Integer.parseInt(System.getProperty(".equals(exprLiteral.value) || "stringify".equals(exprLiteral.value) - // || "weaver.kadabra.concurrent".equals(exprLiteral.value)) { - // System.out.println("EXPR LITERAL: " + CodeElems.toXml(exprLiteral)); - // System.out.println("PARENT:" + exprLiteral.parent); - // } - - String value = exprLiteral.value; - - // HACK: Is there a better way? - if ((exprLiteral.parent instanceof ExprOp || exprLiteral.parent instanceof Parameter) - && "string".equals(exprLiteral.type)) { - return "\"" + value + "\""; - } - - return value; - } - - public String getExprOpCode(ExprOp exprOp) { - String op = exprOp.name; - - // Get operator - if (exprOp.exprs.size() == 1) { - // Special case: suffix ops - if (op.equals("INCS")) { - return getCode(exprOp.exprs.get(0)) + "++"; - } - - if (op.equals("DECS")) { - return getCode(exprOp.exprs.get(0)) + "++"; - } - - UnaryOperator unaryOp = Enums.UnaryOperator.getHelper().fromValue(op); - - return unaryOp.getOp() + getCode(exprOp.exprs.get(0)); - // return getUnaryOpCode(exprOp, unaryOp); - } - - if (exprOp.exprs.size() == 2) { - BinaryOperator binaryOp = Enums.BinaryOperator.getHelper().fromValue(op); - return getCode(exprOp.exprs.get(0)) + " " + binaryOp.getOp() + " " + getCode(exprOp.exprs.get(1)); - } - - throw new RuntimeException( - "Expected operator two have one or two parameters, it has '" + exprOp.exprs.size() + "'"); - - } - - public String getExprCallCode(ExprCall exprCall) { - String args = exprCall.arguments.stream().map(this::getCode).collect(Collectors.joining(", ")); - - SpecsCheck.checkSize(exprCall.method.exprs, 1); - Expression methodExpr = exprCall.method.exprs.get(0); - - SpecsCheck.checkSize(methodExpr.exprs, 2); - - Expression instance = methodExpr.exprs.get(0); - Expression memberName = methodExpr.exprs.get(1); - - String exprCode = getCode(instance) + "." + getCode(memberName) + "(" + args + ")"; - // System.out.println("EXPR CALL CODE: " + exprCode); - - return exprCode; - - // throw new RuntimeException("Generator not implemented for class " + exprCall.getClass() + ".\nXML IR: " - // + CodeElems.toXml(exprCall)); - } - - public String getArgumentCode(Argument argument) { - SpecsCheck.checkSize(argument.exprs, 1); - - return getCode(argument.exprs.get(0)); - } - -} diff --git a/LARAC/src/larac/code/CodeElems.java b/LARAC/src/larac/code/CodeElems.java deleted file mode 100644 index 8d1734690..000000000 --- a/LARAC/src/larac/code/CodeElems.java +++ /dev/null @@ -1,201 +0,0 @@ -package larac.code; - -import java.util.List; -import java.util.Optional; -import java.util.stream.Stream; - -import javax.xml.transform.TransformerException; -import javax.xml.transform.TransformerFactoryConfigurationError; - -import pt.up.fe.specs.lara.aspectir.Code; -import pt.up.fe.specs.lara.aspectir.CodeElem; -import pt.up.fe.specs.lara.aspectir.ExprBody; -import pt.up.fe.specs.lara.aspectir.ExprCall; -import pt.up.fe.specs.lara.aspectir.ExprLiteral; -import pt.up.fe.specs.lara.aspectir.ExprOp; -import pt.up.fe.specs.lara.aspectir.Expression; -import pt.up.fe.specs.lara.aspectir.Statement; -import pt.up.fe.specs.util.SpecsCheck; -import pt.up.fe.specs.util.classmap.FunctionClassMap; -import pt.up.fe.specs.util.lazy.Lazy; -import tdrc.utils.StringUtils; - -public class CodeElems { - - private final static Lazy CODE_GENERATOR = Lazy.newInstance(() -> new AspectIrToLara()); - - private final static FunctionClassMap> CODE_ELEM_TO_STREAM; - static { - CODE_ELEM_TO_STREAM = new FunctionClassMap<>(); - - CODE_ELEM_TO_STREAM.put(ExprCall.class, CodeElems::toElemStream); - CODE_ELEM_TO_STREAM.put(ExprBody.class, exprBody -> CodeElems.toElemStream(exprBody, exprBody.code)); - CODE_ELEM_TO_STREAM.put(Expression.class, CodeElems::getDescendantsAndSelf); - CODE_ELEM_TO_STREAM.put(Code.class, CodeElems::toElemStream); - } - - /** - * @deprecated Replaced by BaseNodes.toStream() - * @param codeElem - * @return - */ - @Deprecated - public static Stream toElemStream(CodeElem codeElem) { - return CODE_ELEM_TO_STREAM.apply(codeElem); - } - - private static Stream toElemStream(Code code) { - if (code.statements == null) { - return Stream.empty(); - } - - return code.statements.stream().flatMap(CodeElems::toElemStream); - } - - /** - * @deprecated Replaced by BaseNodes.toStream() - * @param statement - * @return - */ - @Deprecated - public static Stream toElemStream(Statement statement) { - if (statement.components == null) { - return Stream.empty(); - } - - return statement.components.stream().flatMap(CODE_ELEM_TO_STREAM::apply); - } - - private static Stream getDescendantsAndSelf(Expression expression) { - Stream descendants = getDescendants(expression); - - return Stream.concat(Stream.of(expression), descendants); - } - - private static Stream getDescendants(Expression expression) { - return expression.exprs != null ? expression.exprs.stream().flatMap(CODE_ELEM_TO_STREAM::apply) - : Stream.empty(); - } - - // private static Stream toElemStream(ExprBody exprBody) { - private static Stream toElemStream(Expression expression, Code code) { - Stream descendants = getDescendants(expression); - - return Stream.concat(descendants, toElemStream(code)); - } - - private static Stream toElemStream(ExprCall exprCall) { - Stream arguments = exprCall.arguments.stream().flatMap(CodeElems::getDescendants); - Stream method = CodeElems.getDescendants(exprCall.method); - - return Stream.concat(arguments, method); - } - - public static String parseStringLiteralExpr(Expression stringLiteral) { - // System.out.println("CLASS:" + stringLiteralExpr.getClass()); - // Preconditions.checkArgument(stringLiteralExpr instanceof - // Expression.class, "Expected a code element of type Expression, got - // "+stringLiteralExpr.); - // Preconditions.checkArgument(stringLiteral.exprs.size() == 1, - // "Expected to have one expression, has " + stringLiteral.exprs.size()); - SpecsCheck.checkSize(stringLiteral.exprs, 1); - Expression expression = stringLiteral.exprs.get(0); - - SpecsCheck.checkArgument(expression instanceof ExprLiteral, - () -> "Expected first expression to be a literal, is a " + expression.getClass().getSimpleName()); - - ExprLiteral exprLiteral = (ExprLiteral) expression; - - SpecsCheck.checkArgument(exprLiteral.type.equals("string"), - () -> "Expected type to be string, is " + exprLiteral.type); - - return exprLiteral.value; - - } - - public static String getLaraCode(CodeElem codeElem) { - return CODE_GENERATOR.get().getCode(codeElem); - } - - public static String toXml(CodeElem codeElem) { - try { - return StringUtils.xmlToStringBuffer(codeElem.getXmlDocument(), 3).toString(); - } catch (TransformerFactoryConfigurationError | TransformerException e) { - throw new RuntimeException("Could not convert aspect IR node to XML: ", e); - } - } - - public static T get(int index, List elements, Class elemClass) { - CodeElem element = elements.get(index); - - SpecsCheck.checkArgument(elemClass.isInstance(element), - () -> "Expected code element at index " + index + " to be a " + elemClass.getSimpleName()); - - return elemClass.cast(element); - } - - public static Optional getOp(Expression expression, String opName) { - // Expect one child - if (expression.exprs.size() != 1) { - return Optional.empty(); - } - - Expression maybeOp = expression.exprs.get(0); - if (!(maybeOp instanceof ExprOp)) { - return Optional.empty(); - } - - ExprOp op = (ExprOp) maybeOp; - - return op.name.equals(opName) ? Optional.of(op) : Optional.empty(); - } - - public static ExprBody getBody(ExprOp function) { - return function.exprs.stream() - .filter(ExprBody.class::isInstance) - .map(ExprBody.class::cast) - .findFirst() - .orElseThrow(() -> new RuntimeException("Expected function to have a body: " + function)); - } - - // public static Stream getElemsStream(CodeElem elem) { - // - // } - - /* - public static Stream getExpressionStream(Expression expression) { - // Get expressions - Stream expressions = expression.exprs != null ? expression.exprs.stream() : Stream.empty(); - - // Get code / statements - Optional code = getCode(expression); - // if (expression instanceof ExprBody) { - // Code code = ((ExprBody) expression).code; - // if (code == null) { - // return Stream.empty(); - // } - // - // // Return the expressions inside the statements - // } - - return expression.exprs.stream(); - } - - public static Optional getCode(Expression expression) { - if (expression instanceof ExprBody) { - return Optional.of(((ExprBody) expression).code); - } - - return Optional.empty(); - } - - public static Stream getDescendantsAndSelfStream(Expression expression) { - return Stream.concat(Stream.of(expression), CodeElems.getDescendantsStream(expression)); - } - - public static Stream getDescendantsStream(Expression expression) { - return CodeElems.getExpressionStream(expression).flatMap(expr -> CodeElems.getDescendantsAndSelfStream(expr)); - } - */ - -} diff --git a/LARAC/src/larac/exceptions/AspectIRException.java b/LARAC/src/larac/exceptions/AspectIRException.java deleted file mode 100644 index e9895a209..000000000 --- a/LARAC/src/larac/exceptions/AspectIRException.java +++ /dev/null @@ -1,39 +0,0 @@ -/** - * Copyright 2015 SPeCS. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. under the License. - */ - -package larac.exceptions; - -import pt.up.fe.specs.tools.lara.exception.BaseException; - -public class AspectIRException extends BaseException { - - /** - * - */ - private static final long serialVersionUID = 1L; - - public AspectIRException(Throwable e) { - super(e); - } - - @Override - protected String generateMessage() { - return "Problem " + generateSimpleMessage(); - } - - @Override - protected String generateSimpleMessage() { - return "when converting the AST to an Aspect-IR"; - } - -} diff --git a/LARAC/src/larac/exceptions/LARACompilerException.java b/LARAC/src/larac/exceptions/LARACompilerException.java deleted file mode 100644 index a8a419a8e..000000000 --- a/LARAC/src/larac/exceptions/LARACompilerException.java +++ /dev/null @@ -1,47 +0,0 @@ -/** - * Copyright 2015 SPeCS. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. under the License. - */ - -package larac.exceptions; - -import pt.up.fe.specs.tools.lara.exception.BaseException; - -public class LARACompilerException extends BaseException { - - private static final long serialVersionUID = 1L; - private static final String DEFAULT_TEXT = "when running LARAC"; - private String message; - - public LARACompilerException(String message, Throwable e) { - super(e); - this.message = message; - } - - public LARACompilerException(Throwable e) { - this(null, e); - } - - public LARACompilerException(String message) { - this(message, null); - } - - @Override - protected String generateMessage() { - - return "Exception on "; - } - - @Override - protected String generateSimpleMessage() { - return this.message != null ? this.message : LARACompilerException.DEFAULT_TEXT; - } -} diff --git a/LARAC/src/larac/exceptions/LaraException.java b/LARAC/src/larac/exceptions/LaraException.java deleted file mode 100644 index 15e5fae3d..000000000 --- a/LARAC/src/larac/exceptions/LaraException.java +++ /dev/null @@ -1,46 +0,0 @@ -/** - * Copyright 2015 SPeCS. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. under the License. - */ - -package larac.exceptions; - -import larac.utils.output.ErrorMsg; - -public class LaraException extends RuntimeException { - - /** - * - */ - private static final long serialVersionUID = 1L; - - public LaraException(String message) { - super(message); - } - - public LaraException(String message, Throwable cause) { - super(message, cause); - } - - /** - * Calls "ErrorMsg.say()" before returning the LaraException. - * - *

- * This method was built to replace LaraI.die(). - * - * @param message - * @return - */ - public static LaraException newError(String message) { - ErrorMsg.say(message); - return new LaraException(message); - } -} diff --git a/LARAC/src/larac/exceptions/OptionException.java b/LARAC/src/larac/exceptions/OptionException.java deleted file mode 100644 index cd6932b65..000000000 --- a/LARAC/src/larac/exceptions/OptionException.java +++ /dev/null @@ -1,18 +0,0 @@ -/** - * Copyright 2015 SPeCS. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. under the License. - */ - -package larac.exceptions; - -public class OptionException { - -} diff --git a/LARAC/src/larac/exceptions/ParseExceptionData.java b/LARAC/src/larac/exceptions/ParseExceptionData.java deleted file mode 100644 index 85a0bdcd2..000000000 --- a/LARAC/src/larac/exceptions/ParseExceptionData.java +++ /dev/null @@ -1,58 +0,0 @@ -package larac.exceptions; - -import java.util.ArrayList; - -import org.dojo.jsl.parser.ast.Node; -import org.dojo.jsl.parser.ast.ParseException; -import org.dojo.jsl.parser.ast.Token; - -/** - * This class is used to store the exception data, which will be stored in a {@link Node}.
- * Note: This data may be used in the future for a syntax highlighter. - * - * @author tiago - * - */ -public class ParseExceptionData { - - private final ArrayList skippedTokens; - private ParseException exception; - private int skippedToTokenKind; - - public ParseExceptionData() { - skippedTokens = new ArrayList<>(); - exception = null; - skippedToTokenKind = -1; - } - - public ParseExceptionData(ParseException e) { - skippedTokens = new ArrayList<>(); - exception = e; - skippedToTokenKind = -1; - } - - public void addSkippedToken(Token token) { - skippedTokens.add(token); - } - - public ArrayList getSkippedTokens() { - return skippedTokens; - } - - public void setSkippedToToken(int kind) { - skippedToTokenKind = kind; - } - - public int getSkippedToToken() { - return skippedToTokenKind; - } - - public void setException(ParseException e) { - exception = e; - } - - public Throwable getException() { - return exception; - } - -} \ No newline at end of file diff --git a/LARAC/src/larac/exceptions/StopParseException.java b/LARAC/src/larac/exceptions/StopParseException.java deleted file mode 100644 index 3cef23a1a..000000000 --- a/LARAC/src/larac/exceptions/StopParseException.java +++ /dev/null @@ -1,29 +0,0 @@ -/** - * Copyright 2015 SPeCS. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. under the License. - */ - -package larac.exceptions; - -/** - * Just an exception to stop the parse - * - * @author tiago - * - */ -public class StopParseException extends RuntimeException { - - /** - * - */ - private static final long serialVersionUID = 1L; - -} diff --git a/LARAC/src/larac/exceptions/SyntaxException.java b/LARAC/src/larac/exceptions/SyntaxException.java deleted file mode 100644 index 2dfbd2a9f..000000000 --- a/LARAC/src/larac/exceptions/SyntaxException.java +++ /dev/null @@ -1,62 +0,0 @@ -/** - * Copyright 2015 SPeCS. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. under the License. - */ - -package larac.exceptions; - -import java.util.List; - -import pt.up.fe.specs.tools.lara.exception.BaseException; - -public class SyntaxException extends BaseException { - - /** - * - */ - private static final long serialVersionUID = 1L; - private final List exceptions; - - public SyntaxException(List exceptions) { - this(exceptions, null); - } - - public SyntaxException(List exceptions, Throwable cause) { - super(cause); - this.exceptions = exceptions; - } - - @Override - protected String generateMessage() { - return "Parsing problems"; - } - - @Override - protected String generateSimpleMessage() { - if (exceptions.isEmpty()) { - return "this message shouldn't even appear! the exceptions list is empty!"; - } - if (exceptions.size() > 1) { - String string = "Multiple syntax problems:"; - for (int i = 0; i < exceptions.size(); i++) { - string += "\n " + (i + 1) + ". " + exceptions.get(i).getMessage(); - } - // string += tdrc.utils.StringUtils.join(this.exceptions, Exception::getMessage, "\n"); - return string; - } - return exceptions.get(0).getMessage(); - } - - public List getExceptions() { - return exceptions; - } - -} diff --git a/LARAC/src/larac/imports/FileLaraImport.java b/LARAC/src/larac/imports/FileLaraImport.java deleted file mode 100644 index 5938bcbfa..000000000 --- a/LARAC/src/larac/imports/FileLaraImport.java +++ /dev/null @@ -1,38 +0,0 @@ -/** - * Copyright 2021 SPeCS. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. under the License. - */ - -package larac.imports; - -import java.io.File; - -import larac.LaraC; -import pt.up.fe.specs.util.SpecsCheck; - -public class FileLaraImport extends LaraImport { - - private final File importFile; - - public FileLaraImport(String importPath, File importFile) { - super(importPath); - - SpecsCheck.checkArgument(importFile.exists(), () -> "Expected import file to exist: " + importFile); - this.importFile = importFile; - } - - @Override - public void resolveImport(LaraC lara) { - lara.printSubTopic("Importing " + importFile); - LaraImports.importLaraFile(lara, getImportPath(), importFile); - } - -} diff --git a/LARAC/src/larac/imports/LaraImport.java b/LARAC/src/larac/imports/LaraImport.java deleted file mode 100644 index 1d9617f9b..000000000 --- a/LARAC/src/larac/imports/LaraImport.java +++ /dev/null @@ -1,74 +0,0 @@ -/** - * Copyright 2021 SPeCS. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. under the License. - */ - -package larac.imports; - -import larac.LaraC; - -public abstract class LaraImport { - - private final String importPath; - - public LaraImport(String importPath) { - this.importPath = importPath; - } - - public String getImportPath() { - return importPath; - } - - public abstract void resolveImport(LaraC lara); - - /* - // 1. - // Check include folders - for (final File path : lara.getOptions().getIncludeFolders()) { - for (var ext : LaraC.getSupportedExtensions()) { - var importPath = relativePath + "." + ext; - - final File importingFile = new File(path, importPath); - if (importingFile.exists()) { - lara.printSubTopic("Importing " + importingFile); - importLaraFile(lara, importPath, importingFile); - foundImport = true; - } - } - } - - // 2. - // Check resource by filename, instead of resource name - for (var ext : LaraC.getSupportedExtensions()) { - var importPath = relativePath + "." + ext; - - var resource = lara.getOptions().getIncludeResourcesMap().get(importPath); - if (!resource.isEmpty()) { - importLaraResource(lara, importPath, resource.get(0)); - - // importScriptFile(lara, filepath, findFirst.get()); - foundImport = true; - } - - // Optional findFirst = lara.getOptions().getIncludeResources().stream() - // .filter(r -> r.getFileLocation().replace("/", File.separator).equals(importPath)) - // .findFirst(); - // - // if (findFirst.isPresent()) { - // importLaraResource(lara, importPath, findFirst.get()); - // - // // importScriptFile(lara, filepath, findFirst.get()); - // foundImport = true; - // } - - } - */ -} diff --git a/LARAC/src/larac/imports/LaraImports.java b/LARAC/src/larac/imports/LaraImports.java deleted file mode 100644 index bbdcfbd69..000000000 --- a/LARAC/src/larac/imports/LaraImports.java +++ /dev/null @@ -1,133 +0,0 @@ -/** - * Copyright 2021 SPeCS. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. under the License. - */ - -package larac.imports; - -import java.io.File; -import java.util.List; -import java.util.Map; - -import org.dojo.jsl.parser.ast.ASTAspectDef; -import org.dojo.jsl.parser.ast.SimpleNode; -import org.lara.interpreter.weaver.utils.LaraResourceProvider; - -import larac.LaraC; -import larac.exceptions.LARACompilerException; -import larac.utils.output.MessageConstants; -import pt.up.fe.specs.util.SpecsIo; -import tdrc.utils.StringUtils; - -public class LaraImports { - - public static void importLaraFile(final LaraC lara, final String importPath, final File importingFile) { - - String canonicalPath = SpecsIo.getCanonicalPath(importingFile); - if (lara.wasImported(canonicalPath)) { - LaraC importedLARA = lara.getImportedLARA(canonicalPath); - if (importedLARA == null) { - throw new LARACompilerException("Problem with recursive import with file: " + canonicalPath - + " one occurrence is: " + lara.getLaraPath()); - } - // LaraLog.debug("ALREADY IMPORTED:" + importedLARA); - lara.addPreviouslyImportedLARA(importedLARA); - lara.println(" Aspects from file " + importPath + " were already imported. Will ignore this import."); - return; - } - lara.printSubTopic(" Importing aspects from file " + importPath); - lara.addImportedLARA(canonicalPath, null); - final LaraC importingLara = LaraC.newImporter(importingFile, lara.getOptions(), lara.languageSpec(), - lara.getPrint(), lara.getImportedLARA()); - LaraImports.rearrangeImportedLaraAndImportAspects(lara, importPath, importingLara); - lara.setImportedLARA(importingLara.getImportedLARA()); - lara.addImportedLARA(canonicalPath, importingLara); - } - - public static void importLaraResource(final LaraC lara, String filePath, - final LaraResourceProvider importingResource) { - - String importName = importingResource.getFileLocation(); - String resource = importingResource.getResource(); - // if (lara.wasImported(resource)) { - - if (lara.wasImported(importName)) { - LaraC importedLARA = lara.getImportedLARA(importName); - if (importedLARA == null) { - throw new LARACompilerException("Problem with recursive import with resource: " + resource - + " one occurrence is: " + lara.getLaraPath()); - } - lara.addPreviouslyImportedLARA(importedLARA); - lara.println(" Aspects from import " + importName + " were already imported. Will ignore this import."); - return; - } - - if (importName.equals(resource)) { - lara.printSubTopic(" Importing aspects from resource " + resource); - } else { - lara.printSubTopic(" Importing aspects from resource " + resource + " (import '" + importName + "')"); - } - - // lara.addImportedLARA(resource); - lara.addImportedLARA(importName, null); - final LaraC importingLara = LaraC.newImporter(importingResource, lara.getOptions(), lara.languageSpec(), - lara.getPrint(), lara.getImportedLARA()); - LaraImports.rearrangeImportedLaraAndImportAspects(lara, resource.replace("/", File.separator), importingLara); - lara.setImportedLARA(importingLara.getImportedLARA()); - lara.addImportedLARA(importName, importingLara); - - } - - private static void rearrangeImportedLaraAndImportAspects(final LaraC lara, String filePath, - final LaraC importingLara) { - String prefix = filePath.replace(".lara", MessageConstants.NAME_SEPARATOR); - prefix = prefix.replace(File.separator, MessageConstants.NAME_SEPARATOR); - - importingLara.setPrefix(prefix); - lara.println("Organizing imported aspects from " + filePath); - importingLara.toAspectIR(); - - lara.println("Finished organizing imported aspects!"); - LaraImports.importAspects(lara, filePath, importingLara); - } - - private static void importAspects(final LaraC lara, String filePath, final LaraC importingLara) { - List importingAspects = importingLara.aspectIR().getAspectdefs(); - - if (!importingAspects.isEmpty()) { - for (final ASTAspectDef importingAsp : importingAspects) { - final String key = importingLara.getPrefix() + importingAsp.getName(); - - lara.aspectIR().getImportedAspectDefs().put(key, importingAsp); - } - String importingAspectsStr = StringUtils.join(importingAspects, ASTAspectDef::getName, ", "); - lara.println(" Imported the following aspects: " + importingAspectsStr); - } - - Map globalElements = importingLara.aspectIR().getGlobalElements(); - - if (!globalElements.isEmpty()) { - globalElements.entrySet() - .forEach(e -> lara.aspectIR().addGlobalElement(e.getKey(), e.getValue(), filePath)); - String importingAspectsStr = StringUtils.join(globalElements.keySet(), ", "); - lara.println(" Imported the following aspects: " + importingAspectsStr); - } - // Recursive import - Map recursiveImport = importingLara.aspectIR().getImportedAspectDefs(); - if (!recursiveImport.isEmpty()) { - lara.aspectIR().getImportedAspectDefs().putAll(recursiveImport); - String importedFromImporting = StringUtils.join(recursiveImport.keySet(), - s -> s.replace(MessageConstants.NAME_SEPARATOR, "."), ","); - lara.println(" Recursive import: " + importedFromImporting); - } - } - -} diff --git a/LARAC/src/larac/imports/ResourceLaraImport.java b/LARAC/src/larac/imports/ResourceLaraImport.java deleted file mode 100644 index e049a5ee0..000000000 --- a/LARAC/src/larac/imports/ResourceLaraImport.java +++ /dev/null @@ -1,35 +0,0 @@ -/** - * Copyright 2021 SPeCS. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. under the License. - */ - -package larac.imports; - -import org.lara.interpreter.weaver.utils.LaraResourceProvider; - -import larac.LaraC; - -public class ResourceLaraImport extends LaraImport { - - private final LaraResourceProvider importResource; - - public ResourceLaraImport(String importPath, LaraResourceProvider importResource) { - super(importPath); - - this.importResource = importResource; - } - - @Override - public void resolveImport(LaraC lara) { - LaraImports.importLaraResource(lara, getImportPath(), importResource); - } - -} diff --git a/LARAC/src/larac/objects/Enums.java b/LARAC/src/larac/objects/Enums.java deleted file mode 100644 index b10f80b11..000000000 --- a/LARAC/src/larac/objects/Enums.java +++ /dev/null @@ -1,351 +0,0 @@ -/* - * Copyright 2013 SPeCS. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. under the License. - */ -package larac.objects; - -import pt.up.fe.specs.util.enums.EnumHelperWithValue; -import pt.up.fe.specs.util.lazy.Lazy; -import pt.up.fe.specs.util.providers.StringProvider; -import tdrc.utils.StringUtils; - -public class Enums { - // private static final String CODE_PARAM_REGEX = "(?!\\[)(\\s*\\S+?\\s*)"; // no spaces in between - private static final String CODE_PARAM_REGEX = "(?!\\[)(.+?)"; - public static String SYMBOL_REGEX_BEGIN = "\\[\\["; - public static String SYMBOL_REGEX_END = "\\]\\]"; - public static String SYMBOL_BEGIN = "[["; - public static String SYMBOL_END = "]]"; - // public static String INSERT_SYMBOL_REGEX = Enums.SYMBOL_REGEX_BEGIN + "(?!\\[)(\\S+?)" + Enums.SYMBOL_REGEX_END; - public static String INSERT_SYMBOL_REGEX = Enums.SYMBOL_REGEX_BEGIN + Enums.CODE_PARAM_REGEX - + Enums.SYMBOL_REGEX_END; - - public static enum JoinOperator { - UNION_JOIN("+"), - NATURAL_JOIN("::"), - BITAND_JOIN("&"),; - - private String op; - - JoinOperator(String op) { - setOp(op); - } - - public void setOp(String op) { - this.op = op; - } - - public String getOp() { - return op; - } - - public static JoinOperator getOpTag(String text) { - if (text != null) { - for (final JoinOperator b : JoinOperator.values()) { - if (text.equalsIgnoreCase(b.op)) { - return b; - } - } - } - return null; - } - - public static boolean contains(String text) { - if (text != null) { - for (final JoinOperator b : JoinOperator.values()) { - if (text.equalsIgnoreCase(b.op)) { - return true; - } - } - } - return false; - } - } - - /** - * Binary operators ordered by precedence: less ordinal means less precedence - * - * @author Tiago - * - */ - public static enum BinaryOperator implements StringProvider { - - COMMA(",", 0), // 0 - OR("||", 1), // 1 - AND("&&", 2), // 2 - BitOR("|", 3), // 3 - BitXOR("^", 4), // 4 - BitAND("&", 5), // 5 - - SEQ("===", 6), // 6 - NSEQ("!==", 6), // 6 - EQ("==", 6), // 6 - NEQ("!=", 6), // 6 - MATCH("~=", 6), // 6 - - LT("<", 7), // 7 - LTE("<=", 7), // 7 - GT(">", 7), // 7 - GTE(">=", 7), // 7 - INSTANCEOF("instanceof", 7), // 7 - IN("in", 7), // 7 - - SHL("<<", 8), // 8 - SHR(">>", 8), // 8 - USHR(">>>", 8), // 8 - - ADD("+", 9), // 9 - SUB("-", 9), // 9 - - MULT("*", 10), // 10 - DIV("/", 10), // 10 - MOD("%", 10), // 10 - - ; - - private static final Lazy> ENUM_HELPER = EnumHelperWithValue - .newLazyHelperWithValue(BinaryOperator.class); - - private String op; - private final int precedence; - - BinaryOperator(String op, int precedence) { - setOp(op); - this.precedence = precedence; - } - - public void setOp(String op) { - this.op = op; - } - - public String getOp() { - return op; - } - - public static BinaryOperator getOpTag(String text) { - if (text != null) { - for (final BinaryOperator b : BinaryOperator.values()) { - if (text.equalsIgnoreCase(b.op)) { - return b; - } - } - } - return null; - } - - public static boolean contains(String text) { - if (text != null) { - for (final BinaryOperator b : BinaryOperator.values()) { - if (text.equalsIgnoreCase(b.op)) { - return true; - } - } - } - return false; - } - - public boolean hasPrecedence(BinaryOperator operator) { - return precedence > operator.precedence; - } - - @Override - public String getString() { - return name(); - } - - public static EnumHelperWithValue getHelper() { - return ENUM_HELPER.get(); - } - } - - public static enum UnaryOperator implements StringProvider { - POS("+"), - NEG("-"), - NOT("!"), - INV("~"), - INCP("++"), - DECP("--"), - TYPEOF("typeof"), - DELETE("delete"), - VOID("void"); - // NEW("new"); - - private static final Lazy> ENUM_HELPER = EnumHelperWithValue - .newLazyHelperWithValue(UnaryOperator.class); - - private String op; - - UnaryOperator(String op) { - setOp(op); - } - - public void setOp(String op) { - this.op = op; - } - - public String getOp() { - return op; - } - - public static UnaryOperator getOpTag(String text) { - if (text != null) { - for (final UnaryOperator b : UnaryOperator.values()) { - if (text.equalsIgnoreCase(b.op)) { - return b; - } - } - } - return null; - } - - public static boolean contains(String text) { - if (text != null) { - for (final UnaryOperator b : UnaryOperator.values()) { - if (text.equalsIgnoreCase(b.op)) { - return true; - } - } - } - return false; - } - - @Override - public String getString() { - return name(); - } - - public static EnumHelperWithValue getHelper() { - return ENUM_HELPER.get(); - } - } - - public static enum AssignOperator { - ASSIGN("="), - ASSIGN_ADD("+="), - ASSIGN_SUB("-="), - ASSIGN_MULT("*="), - ASSIGN_DIV("/="), - ASSIGN_MOD( - "%="), - ASSIGN_SHL("<<="), - ASSIGN_SHR(">>="), - ASSIGN_USHR(">>>="), - ASSIGN_BitAND("&="), - ASSIGN_BitXOR( - "^="), - ASSIGN_BitOR("|=") - - ; - /* - * "<<=" ">>=" - * ">>>=" "&=" "^=" "^=" "|=" - * - * - * - */ - - private String op; - - AssignOperator(String op) { - setOp(op); - } - - public void setOp(String op) { - this.op = op; - } - - public String getOp() { - return op; - } - - public static AssignOperator getOpTag(String text) { - if (text != null) { - for (final AssignOperator b : AssignOperator.values()) { - if (text.equalsIgnoreCase(b.op)) { - return b; - } - } - } - return null; - } - - public static boolean contains(String text) { - if (text != null) { - for (final AssignOperator b : AssignOperator.values()) { - if (text.equalsIgnoreCase(b.op)) { - return true; - } - } - } - return false; - } - } - - public static enum Types { - Null, - Boolean, - Int, - Float, - Double, - String, - RegEx, - Code, - Joinpoint, - Aspect, - Array, - Map, - Object, - FN, - GFN, - ArrowFN, - FNDecl, - GenFNDecl, - Exception, - Undefined, - AspectSTATIC, - Base64; - - public static Types getDefault() { - return Undefined; - } - - public static Types maxType(Types leftType, Types rightType) { - return leftType.compareTo(rightType) >= 0 ? leftType : rightType; - } - - public static Types value(String t) { - if (t.equals("Integer")) { - return Int; - } - t = StringUtils.firstCharToUpper(t); - try { - return valueOf(t); - } catch (final Exception e) { - return null; - } - } - - @Override - public String toString() { - return name().toLowerCase(); - } - - } - - public static enum LoopTypes { - WHILE, - DO, - FOR, - FORIN, - FOREACH; - } -} diff --git a/LARAC/src/larac/objects/SymbolTable.java b/LARAC/src/larac/objects/SymbolTable.java deleted file mode 100644 index 071d88316..000000000 --- a/LARAC/src/larac/objects/SymbolTable.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright 2013 SPeCS. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. under the License. - */ -/** - * - */ -package larac.objects; - -import java.util.LinkedHashMap; - -/** - * @param - * Key - * @param - * Value - * - */ -public class SymbolTable extends LinkedHashMap { - private static final String MIDDLE = "_U_"; - private static final long serialVersionUID = 1L; - private static int unique_count = 0; - - public String getUniqueName(String key) { - if (containsKey(key)) { - key += SymbolTable.MIDDLE + SymbolTable.unique_count++; - } - return key; - } -} diff --git a/LARAC/src/larac/objects/Variable.java b/LARAC/src/larac/objects/Variable.java deleted file mode 100644 index 6e4a2e965..000000000 --- a/LARAC/src/larac/objects/Variable.java +++ /dev/null @@ -1,161 +0,0 @@ -/* - * Copyright 2013 SPeCS. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. under the License. - */ -/** - * - */ -package larac.objects; - -import org.dojo.jsl.parser.ast.SimpleNode; -import org.w3c.dom.Document; -import org.w3c.dom.Element; - -import larac.objects.Enums.Types; -import larac.utils.output.NormalMsg; - -public class Variable { - public int staticCounter = 0; - public String staticName = "_larac_call_var_"; - private String name; - private Types type; - // private SimpleNode initialize; // REMOVED INIT as it is provoking a big issue when declaring variables with - // the same name - private SimpleNode expression; - private boolean notFound; - - /* - public Variable(String name, SimpleNode init) { - this.name = name; - if (!(init instanceof ASTFunctionDeclaration)) { - init.organize(init.jjtGetParent()); - } - - initialize = init; - expression = init; - type = init.getExpressionType(); - if (type == Types.FNDecl) { - type = Types.FN; - } - if (name.startsWith("$")) { - type = Types.Joinpoint; - } - notFound = false; - } - */ - public Variable(String name) { - this.name = name; - // initialize = expression = null; - type = Types.getDefault(); - notFound = false; - } - - public Variable(String name, Types type) { - this.name = name; - this.type = type; - notFound = false; - } - - /** - * @return the name - */ - public String getName() { - return name; - } - - /** - * @param name - * the name to set - */ - public void setName(String name) { - this.name = name; - } - - /** - * @return the type - */ - public Types getType() { - return type; - } - - /** - * @param type - * the type to set - */ - public void setType(Types type) { - this.type = type; - } - - /** - * @return the initialize - * - * public SimpleNode getInitialize() { return initialize; } - */ - - /** - * @param initialize - * the initialize to set - * - * public void setInitialize(SimpleNode initialize) { this.initialize = initialize; } - */ - - /** - * @return the expression - */ - public SimpleNode getExpression() { - return expression; - } - - /** - * @param expression - * the expression to set - */ - public void setExpression(SimpleNode expression) { - this.expression = expression; - } - - public void printIR() { - new NormalMsg() - .println("name \"" + getName() + "\"" + "\n type: " + type + "\n"); // + "\n initialize: " + initialize - } - - public void toXML(Document doc, Element parent) { - final Element el = doc.createElement("id"); - parent.appendChild(el); - // String xmlName = name.startsWith("$")?name.substring(1):name; - final String xmlName = name; - el.setAttribute("name", xmlName); - // if(type != Types.Undefined) - // el.setAttribute("type", type.name()); - - } - - @Override - public Object clone() throws CloneNotSupportedException { - final Variable newVar = new Variable(getName()); - return newVar; - } - - /** - * @return the notFound - */ - public boolean isNotFound() { - return notFound; - } - - /** - * @param notFound - * the notFound to set - */ - public void setNotFound(boolean notFound) { - this.notFound = notFound; - } -} diff --git a/LARAC/src/larac/options/LaraCOptions.java b/LARAC/src/larac/options/LaraCOptions.java deleted file mode 100644 index af9335300..000000000 --- a/LARAC/src/larac/options/LaraCOptions.java +++ /dev/null @@ -1,542 +0,0 @@ -/* - * Copyright 2013 SPeCS. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. under the License. - */ -package larac.options; - -import java.io.File; -import java.io.FileInputStream; -import java.io.FileNotFoundException; -import java.io.InputStream; -import java.io.PrintStream; -import java.util.ArrayList; -import java.util.Collection; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.stream.Collectors; - -import org.apache.commons.cli.CommandLine; -import org.apache.commons.cli.Option; -import org.apache.commons.cli.Options; -import org.lara.interpreter.weaver.utils.GenericLaraResourceProvider; -import org.lara.interpreter.weaver.utils.LaraResourceProvider; - -import larac.LaraC; -import larac.exceptions.LARACompilerException; -import larac.imports.FileLaraImport; -import larac.imports.LaraImport; -import larac.imports.ResourceLaraImport; -import larac.options.optionprovider.OptionUtils; -import larac.utils.output.MessageConstants; -import larac.utils.output.Output; -import pt.up.fe.specs.util.SpecsFactory; -import pt.up.fe.specs.util.SpecsIo; -import pt.up.fe.specs.util.collections.MultiMap; -import pt.up.fe.specs.util.lazy.Lazy; -import pt.up.fe.specs.util.providers.ResourceProvider; -import pt.up.fe.specs.util.utilities.JarPath; - -public class LaraCOptions { - public static final String CONFIG_FILE_NAME = "larac.properties"; - - private static final String SKIP_ARGS = "#lara_c_options_skip"; - - // Display the Aspect-IR - private boolean showAspectIR; - // Display all available information in the console - private boolean debug; - // Target Language - private String language; - // Specification Directory - private File xmlSpecDir; - // Output directory for the created files - private File outputDir; - // include aspects in the given directories (separated by the file separator) - private List includeFolders; - private List includeResources; - private Lazy> includeResourcesMap; - private boolean documentationMode; - - private Map> importsCache; - - private Options options; - private CommandLine command; - - public LaraCOptions() { - setDefaultOptions(); - } - - public static String getSkipArgs() { - return SKIP_ARGS; - } - - /** - * Define the default values for LaraC options - */ - private void setDefaultOptions() { - showAspectIR = debug = false; - language = MessageConstants.LANGUAGE_DEFAULT; - xmlSpecDir = outputDir = new File(MessageConstants.HOME_DIR); - includeFolders = new ArrayList<>(); - includeResources = new ArrayList<>(); - includeResourcesMap = Lazy.newInstance(() -> buildIncludeResourcesMap()); - importsCache = new HashMap<>(); - - // Add working dir to the included paths - final File workingDir = SpecsIo.getWorkingDir(); - includeFolders.add(workingDir); - documentationMode = false; - } - - /** - * Set {@link LaraCOptions} instance with the given input arguments - * - * @param args - * @return - */ - public boolean setOptions(LaraC larac, String args[]) { - // SpecsLogs.debug(() -> "LARAC args: " + Arrays.asList(args)); - options = OptionUtils.optionsBuilder(LaraOptionProvider.class); - // LaraC requires at least one input: the aspect file - if ((args.length < 1)) { - - OptionUtils.help(MessageConstants.LARAC_HELP_EXEC, options); - return false; - } - - String laraFileName = args[0]; - - if (laraFileName.equals(SKIP_ARGS)) { - return true; - } - - setLaraFile(larac, laraFileName); - - command = OptionUtils.parseOptions(options, args, MessageConstants.LARAC_HELP_EXEC); - if (command == null) { - return false; - } - - final Option[] processedOptions = command.getOptions(); - for (final Option option : processedOptions) { - - setOption(option, larac); - } - - larac.setJarPath(new JarPath(LaraC.class, LaraC.PROPERTY_JAR_PATH).buildJarPath()); - getIncludeFolders().add(larac.getLaraFile().getParentFile()); - return true; - } - - /** - * @param args - */ - public void setLaraFile(LaraC larac, String laraFileName) { - final File laraFile = new File(laraFileName); - - setLaraFile(larac, laraFile); - } - - /** - * @param args - */ - public void setLaraFile(LaraC larac, File laraFile) { - - if (!laraFile.exists()) { - throw new LARACompilerException("when loading file", - new FileNotFoundException("The file does not exist: " + laraFile.getPath())); - } - - final File absoluteLaraFile = SpecsIo.getCanonicalFile(laraFile); - - // try { - // laraFile = laraFile.getCanonicalFile(); - // } catch (final IOException e) { - // throw new LARACompilerException("when processing file", e); - // } - larac.setLaraName(absoluteLaraFile.getName()); - // larac.setLaraPath(absoluteLaraFile.getName()); - larac.setLaraPath(SpecsIo.getCanonicalPath(absoluteLaraFile)); - - larac.setLaraStreamProvider(() -> { - try { - return new FileInputStream(absoluteLaraFile); - } catch (Exception e) { - throw new LARACompilerException( - "Could not create InputStream from file: " + absoluteLaraFile.getAbsolutePath(), - e); - } - }); - - larac.setLaraFile(absoluteLaraFile); - - } - - public void setLaraResource(LaraC larac, ResourceProvider laraResource) { - - String resourcePath = laraResource.getResource(); - - // laraFile = IoUtils.getCanonicalFile(laraFile); - // try { - // laraFile = laraFile.getCanonicalFile(); - // } catch (final IOException e) { - // throw new LARACompilerException("when processing file", e); - // } - larac.setLaraName(laraResource.getResourceName()); - larac.setLaraPath(resourcePath); - - larac.setLaraStreamProvider(() -> { - InputStream stream = LaraCOptions.class.getClassLoader().getResourceAsStream(resourcePath); - if (stream == null) { - throw new LARACompilerException("when loading resource", - new FileNotFoundException("Could not read resource file: " + resourcePath)); - } - return stream; - }); - // larac.setLaraFile(laraFile); - } - - /** - * Set an option on larac according to the value given, if the option exists on the enum {@link LaraOptionProvider} - * - * @param optionName - * @return - */ - public boolean setOption(Option option, LaraC larac) { - - final String optionName = option.getLongOpt(); - final String value = option.getValue(); - - LaraOptionProvider arg = OptionUtils.getOptionByName(LaraOptionProvider.class, optionName); - if (arg == null) { - arg = OptionUtils.getOptionByShortName(LaraOptionProvider.class, optionName); - if (arg == null) { - larac.warnln("Option " + optionName + " does not exist. Ignoring option."); - return true; - } - } - switch (arg) { - case help: - OptionUtils.help(MessageConstants.LARAC_HELP_EXEC, options); - return false; - case version: - larac.println(MessageConstants.LARA_VERSION + "\n" + LaraC.FRONT_END_VERSION); - return false; - case debug: - setDebug(true); - break; - case documentation: - setDocumentationMode(true); - break; - case aspectir: - showAspectIR = true; - break; - case language: - setLanguage(value); - break; - case xmlspec: - setXmlSpecDir(new File(value)); - break; - case output: - setOutputDir(new File(value)); - break; - case verbose: - try { - - final int verboseLevel = Integer.parseInt(value); - if (verboseLevel < 0 || verboseLevel > 3) { - throw new NumberFormatException("Number out of bounds"); - } - larac.getPrint().setLevel(verboseLevel); - } catch (final NumberFormatException e) { - - larac.errorln("Wrong value for verbose level: " + value + ". Will use default level"); - } - break; - case stream: - try (final PrintStream streamFile = new PrintStream(new File(value));) { - - larac.getPrint().setStream(streamFile); - } catch (final FileNotFoundException e) { - - larac.errorln("Could not create stream file: " + value + ". Will use default output stream."); - } - break; - case include: - includeFolders.addAll(getIncludeFolders(value, larac)); - break; - case resource: - includeResources.addAll(getResourceProviders(value, larac)); - break; - default: - break; - } - return true; - } - // - // @Override - // public String toString() { - // final StringBuilder toString = new StringBuilder("LARAC options:"); - // toString.append("\n\tTODO"); - // toString.append("\n"); - // return toString.toString(); - // } - - public Collection getResourceProviders(String includeDir, LaraC larac) { - final String[] paths = SpecsIo.splitPaths(includeDir); - - final Collection importPaths = SpecsFactory.newArrayList(); - for (final String path : paths) { - - // importPaths.add(() -> path); - importPaths.add(new GenericLaraResourceProvider(path)); - } - return importPaths; - } - - public List getIncludeFolders(String includeDir, LaraC larac) { - final String[] paths = SpecsIo.splitPaths(includeDir); - - final List importPaths = SpecsFactory.newArrayList(); - for (final String path : paths) { - - final File includeFile = new File(path); - if (!includeFile.isDirectory()) { - larac.warnln("Tried to add folder '" + includeFile + "' to the includes, but the path was not found."); - } - - importPaths.add(includeFile); - } - return importPaths; - } - - /** - * @return the showAspectIR - */ - public boolean isShowAspectIR() { - return showAspectIR; - } - - /** - * @param showAspectIR - * the showAspectIR to set - */ - public void setShowAspectIR(boolean showAspectIR) { - this.showAspectIR = showAspectIR; - } - - /** - * @return the debug - */ - public boolean isDebug() { - return debug; - } - - /** - * @param debug - * the debug to set - */ - public void setDebug(boolean debug) { - this.debug = debug; - if (debug) { - showAspectIR = true; - } - } - - /** - * @return the language - */ - public String getLanguage() { - return language; - } - - /** - * @param language - * the language to set - */ - public void setLanguage(String language) { - this.language = language; - } - - /** - * @return the xmlSpecDir - */ - public File getXmlSpecDir() { - return xmlSpecDir; - } - - /** - * @param xmlSpecDir - * the xmlSpecDir to set - */ - public void setXmlSpecDir(File xmlSpecDir) { - this.xmlSpecDir = xmlSpecDir; - } - - /** - * @return the outputDir - */ - public File getOutputDir() { - return outputDir; - } - - /** - * @param outputDir - * the outputDir to set - */ - public void setOutputDir(File outputDir) { - this.outputDir = SpecsIo.mkdir(outputDir); - } - - /** - * @return the includeFolders - */ - public List getIncludeFolders() { - return includeFolders; - } - - /** - * @param includeFolders - * the includeFolders to set - */ - public void setIncludeFolders(List includeFolders) { - this.includeFolders = includeFolders; - - // Reset - importsCache = new HashMap<>(); - } - - /** - * @return the options - */ - public Options getOptions() { - return options; - } - - /** - * @param options - * the options to set - */ - public void setOptions(Options options) { - this.options = options; - } - - public List getIncludeResources() { - return includeResources; - } - - public MultiMap getIncludeResourcesMap() { - return includeResourcesMap.get(); - // Optional findFirst = lara.getOptions().getIncludeResources().stream() - // .filter(r -> r.getFileLocation().replace("/", File.separator).equals(importPath)) - // .findFirst(); - } - - private MultiMap buildIncludeResourcesMap() { - var resourcesMap = new MultiMap(); - - for (var resource : getIncludeResources()) { - resourcesMap.put(resource.getFileLocation().replace("/", File.separator), resource); - } - - return resourcesMap; - } - - public void setIncludeResources(List includeResources) { - this.includeResources = includeResources; - - // Reset in case it is initialized - if (includeResourcesMap.isInitialized()) { - includeResourcesMap = Lazy.newInstance(() -> buildIncludeResourcesMap()); - } - - // Reset - importsCache = new HashMap<>(); - } - - /** - * Print information regarding the LaraC Execution - * - * @param print - * Print streamer - */ - public void printInformation(Output print) { - // print.println("Concerning language: " + language); <-- Activate this when we start to use it - print.println("Language Specification folder: " + xmlSpecDir); - print.println("Output directory: " + outputDir); - if (!includeFolders.isEmpty()) { - print.println("Path included for import: " + includeFolders); - } - if (!includeResources.isEmpty()) { - print.println("Resources included for import: " - + includeResources.stream().map(ResourceProvider::getResource).collect(Collectors.toList())); - } - print.println("Running on: " + System.getProperty("os.name")); - } - - public boolean isDocumentationMode() { - return documentationMode; - } - - public void setDocumentationMode(boolean documentationMode) { - this.documentationMode = documentationMode; - } - - public List getLaraImports(String filename, String filePath) { - // Using forward slash as separator, since it is an illegal charater for a filename, both in Windows and Linux - var key = filename + "////" + filePath; - - var laraImports = importsCache.get(key); - - if (laraImports == null) { - laraImports = buildLaraImports(filename, filePath); - importsCache.put(key, laraImports); - } - - return laraImports; - } - - private List buildLaraImports(String filename, String filePath) { - var laraImports = new ArrayList(); - - String relativePath = filePath + filename; - - // 1. - // Check include folders - for (final File path : getIncludeFolders()) { - for (var ext : LaraC.getSupportedExtensions()) { - var importPath = relativePath + "." + ext; - - final File importingFile = new File(path, importPath); - if (importingFile.exists()) { - laraImports.add(new FileLaraImport(importPath, importingFile)); - // System.out.println("FILE: " + importingFile); - } - } - } - - // 2. - // Check resource by filename, instead of resource name - for (var ext : LaraC.getSupportedExtensions()) { - var importPath = relativePath + "." + ext; - - var resource = getIncludeResourcesMap().get(importPath); - if (!resource.isEmpty()) { - laraImports.add(new ResourceLaraImport(importPath, resource.get(0))); - // System.out.println("RESOURCE: " + resource.get(0)); - } - } - - return laraImports; - } - -} diff --git a/LARAC/src/larac/options/LaraOptionProvider.java b/LARAC/src/larac/options/LaraOptionProvider.java deleted file mode 100644 index b9537b7ef..000000000 --- a/LARAC/src/larac/options/LaraOptionProvider.java +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Copyright 2013 SPeCS. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. under the License. - */ -package larac.options; - -import larac.options.optionprovider.ArgOption; -import larac.options.optionprovider.Descriptor; -import larac.options.optionprovider.OptionProvider; -import larac.options.optionprovider.OptionUtils; -import larac.utils.output.MessageConstants; -import pt.up.fe.specs.util.providers.KeyProvider; - -public enum LaraOptionProvider implements OptionProvider, KeyProvider { - - /* Options with no arguments */ - // Show help message - help(OptionUtils.newDescriptor("help", "h", ArgOption.NO_ARGS, MessageConstants.HELP_DESC)), - // Show version - version(OptionUtils.newDescriptor("version", "v", ArgOption.NO_ARGS, MessageConstants.VERSION_DESC)), - // Display the Aspect-IR - aspectir(OptionUtils.newDescriptor("aspectir", "a", ArgOption.NO_ARGS, MessageConstants.SHOWXML_DESC)), - // Display all available information in the console - debug(OptionUtils.newDescriptor("debug", "d", ArgOption.NO_ARGS, MessageConstants.DEBUG_DESC)), - // Special mode to generate aspect IR for documentation purposes - documentation(OptionUtils.newDescriptor("doc", "c", ArgOption.NO_ARGS, MessageConstants.DOC_DESC)), - - /* Options with one argument */ - // Target Language - language(OptionUtils.newDescriptor("language", "l", ArgOption.ONE_ARG, "language", MessageConstants.LANGUAGE_DESC)), - // Specification Directory - xmlspec(OptionUtils.newDescriptor("xmlspec", "x", ArgOption.ONE_ARG, "dir", MessageConstants.XMLSPEC_DESC)), - // Output directory for the created files - output(OptionUtils.newDescriptor("output", "o", ArgOption.ONE_ARG, "dir", MessageConstants.OUTPUT_DESC)), - // Outputs to a file with the given name - stream(OptionUtils.newDescriptor("stream", "s", ArgOption.ONE_ARG, "file", MessageConstants.STREAM_DESC)), - // Verbose level - verbose(OptionUtils.newDescriptor("verbose", "b", ArgOption.ONE_ARG, "level", MessageConstants.VERBOSE_DESC)), - // include aspects in the given directories (separated by ';') - include(OptionUtils.newDescriptor("include", "i", ArgOption.ONE_ARG, "dir(;dir)*", MessageConstants.INCLUDE_DESC)), - resource(OptionUtils.newDescriptor("resource", "r", ArgOption.ONE_ARG, "resource(;resource)*", - MessageConstants.RESOURCE_DESC)),; - - private Descriptor descriptor; - - LaraOptionProvider(Descriptor descriptor) { - this.descriptor = descriptor; - } - - @Override - public Descriptor getKey() { - return getDescriptor(); - } - - @Override - public Descriptor getDescriptor() { - return descriptor; - } -} diff --git a/LARAC/src/larac/options/optionprovider/ArgOption.java b/LARAC/src/larac/options/optionprovider/ArgOption.java deleted file mode 100644 index f85881ba7..000000000 --- a/LARAC/src/larac/options/optionprovider/ArgOption.java +++ /dev/null @@ -1,18 +0,0 @@ -/** - * Copyright 2013 SPeCS Research Group. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. under the License. - */ - -package larac.options.optionprovider; - -public enum ArgOption { - NO_ARGS, ONE_ARG, SEVERAL_ARGS, OPTIONAL_ARG, OPTIONAL_ARGS; -} \ No newline at end of file diff --git a/LARAC/src/larac/options/optionprovider/Descriptor.java b/LARAC/src/larac/options/optionprovider/Descriptor.java deleted file mode 100644 index ffadfde97..000000000 --- a/LARAC/src/larac/options/optionprovider/Descriptor.java +++ /dev/null @@ -1,148 +0,0 @@ -/** - * Copyright 2013 SPeCS Research Group. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. under the License. - */ - -package larac.options.optionprovider; - -/** - * Description of a program option - * - * @author Tiago - * - */ -public class Descriptor { - - private String name; - private String shortName; - private ArgOption numOfArguments; - private String argumentName; - private String description; - - /** - * Creates a new Descriptor - * - * @param name - * the name of the option - * @param shortName - * short version for the option - * @param numOfArguments - * number of arguments the option requires (see {@link ArgOption} - * ) - * @param description - * a description for the option - */ - public Descriptor(String name, String shortName, ArgOption numOfArguments, String description) { - setName(name); - setShortName(shortName); - setNumOfArguments(numOfArguments); - setArgumentName(null); - setDescription(description); - } - - /** - * Creates a new Descriptor (with a name for the option argument) - * - * @param name - * the name of the option - * @param shortName - * short version for the option - * @param numOfArguments - * number of arguments the option requires (see {@link ArgOption} - * ) - * @param description - * a description for the option - */ - public Descriptor(String name, String shortName, ArgOption numOfArguments, String argumentName, - String description) { - setName(name); - setShortName(shortName); - setNumOfArguments(numOfArguments); - setArgumentName(argumentName); - setDescription(description); - } - - /** - * @return the name - */ - public String getName() { - return name; - } - - /** - * @return the shortName - */ - public String getShortName() { - return shortName; - } - - /** - * @return the numOfArguments - */ - public ArgOption getNumOfArguments() { - return numOfArguments; - } - - /** - * @return the description - */ - public String getDescription() { - return description; - } - - /** - * @param name - * the name to set - */ - protected void setName(String name) { - this.name = name; - } - - /** - * @param shortName - * the shortName to set - */ - protected void setShortName(String shortName) { - this.shortName = shortName; - } - - /** - * @param numOfArguments - * the numOfArguments to set - */ - protected void setNumOfArguments(ArgOption numOfArguments) { - this.numOfArguments = numOfArguments; - } - - /** - * @param description - * the description to set - */ - protected void setDescription(String description) { - this.description = description; - } - - /** - * @return the argumentName - */ - public String getArgumentName() { - return argumentName; - } - - /** - * @param argumentName - * the argumentName to set - */ - protected void setArgumentName(String argumentName) { - this.argumentName = argumentName; - } - -} diff --git a/LARAC/src/larac/options/optionprovider/OptionProvider.java b/LARAC/src/larac/options/optionprovider/OptionProvider.java deleted file mode 100644 index a46cd6bc1..000000000 --- a/LARAC/src/larac/options/optionprovider/OptionProvider.java +++ /dev/null @@ -1,18 +0,0 @@ -/** - * Copyright 2013 SPeCS Research Group. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. under the License. - */ - -package larac.options.optionprovider; - -public interface OptionProvider { - public Descriptor getDescriptor(); -} \ No newline at end of file diff --git a/LARAC/src/larac/options/optionprovider/OptionUtils.java b/LARAC/src/larac/options/optionprovider/OptionUtils.java deleted file mode 100644 index 6a168f87d..000000000 --- a/LARAC/src/larac/options/optionprovider/OptionUtils.java +++ /dev/null @@ -1,271 +0,0 @@ -/** - * Copyright 2013 SPeCS Research Group. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. under the License. - */ - -package larac.options.optionprovider; - -import java.io.ByteArrayOutputStream; -import java.io.PrintWriter; -import java.nio.charset.StandardCharsets; -import java.util.List; - -import org.apache.commons.cli.CommandLine; -import org.apache.commons.cli.CommandLineParser; -import org.apache.commons.cli.DefaultParser; -import org.apache.commons.cli.HelpFormatter; -import org.apache.commons.cli.Option; -import org.apache.commons.cli.Option.Builder; -import org.apache.commons.cli.Options; -import org.apache.commons.cli.ParseException; - -import larac.exceptions.LARACompilerException; -import pt.up.fe.specs.util.SpecsEnums; -import pt.up.fe.specs.util.providers.KeyProvider; - -/** - * Utility class for Options creation and parsing. - * - * @author Tiago - * - */ -public class OptionUtils { - - /** - * Parse and create a {@link CommandLine} for the given input arguments for the {@link Options} available - * - * @param options - * @param args - * @param cmdLineSyntax - * @return - */ - public static CommandLine parseOptions(Options options, String[] args, String cmdLineSyntax) { - - try { - - final CommandLineParser parser = new DefaultParser(); - return parser.parse(options, args); - - } catch (final ParseException e) { - String message = e.getMessage() + "\n"; - final HelpFormatter formatter = new HelpFormatter(); - ByteArrayOutputStream baos = new ByteArrayOutputStream(); - PrintWriter pw = new PrintWriter(baos); - formatter.printHelp(pw, formatter.getWidth(), cmdLineSyntax, "Options:", options, - formatter.getLeftPadding(), - formatter.getDescPadding(), null, false); - pw.flush(); - String usage = new String(baos.toByteArray(), StandardCharsets.UTF_8); - // System.out.println("->" + usage); - message += usage; - throw new LARACompilerException("when processing options", new LARACompilerException(message)); - // System.out.println(message); - // help(cmdLineSyntax, options); - } - // return null; - } - - /** - * Print a help message of how to use the application and its options - * - * @param cmdLineSyntax - * the syntax one should use to execute the application - * @param options - * the options of the application - */ - public static void help(String cmdLineSyntax, Options options) { - - final HelpFormatter formatter = new HelpFormatter(); - formatter.printHelp(cmdLineSyntax, options); - } - - /** - * Create a new {@link Options} instance containing the enumerated options in optionsEnum (implementing - * {@link OptionProvider}). - * - * @param optionsEnum - * an enum implementing {@link OptionProvider} and {@link KeyProvider}<{@link Descriptor}> - * @return - */ - public static & OptionProvider & KeyProvider> Options optionsBuilder( - Class optionsEnum) { - - final Options options = new Options(); - final List descriptors = SpecsEnums.getKeys(optionsEnum); - - for (final Descriptor desc : descriptors) { - final Option newOpt = newOption(desc); - options.addOption(newOpt); - } - return options; - } - - /** - * Build an option according to a {@link Descriptor} - * - * @param descriptor - * @return - */ - public static Option newOption(Descriptor descriptor) { - final String shortName = descriptor.getShortName(); - - Builder builder; - - if (shortName == null) { - builder = Option.builder(); - } else { - builder = Option.builder(shortName); - } - - builder.longOpt(descriptor.getName()); - switch (descriptor.getNumOfArguments()) { - case ONE_ARG: - builder.hasArg(); - break; - case SEVERAL_ARGS: - builder.hasArgs(); - break; - case OPTIONAL_ARG: - builder.hasArg(); - builder.optionalArg(true); - break; - case OPTIONAL_ARGS: - builder.optionalArg(true); - builder.hasArgs(); - break; - default: - break; - } - - final String argumentName = descriptor.getArgumentName(); - if (argumentName != null) { - builder.argName(argumentName); - } - - builder.desc(descriptor.getDescription()); - - return builder.build(); - } - - /** - * Create a new Option Descriptor (see {@link Descriptor}) - * - * @param name - * @param shortName - * @param numOfArguments - * @param description - * @return - */ - public static Descriptor newDescriptor(String name, String shortName, ArgOption numOfArguments, - String description) { - return new Descriptor(name, shortName, numOfArguments, description); - } - - /** - * Create a new Option Descriptor, with an argument description (see {@link Descriptor}) - * - * @param name - * @param shortName - * @param numOfArguments - * @param argumentName - * @param description - * @return - */ - public static Descriptor newDescriptor(String name, String shortName, ArgOption numOfArguments, String argumentName, - String description) { - return new Descriptor(name, shortName, numOfArguments, description); - } - - /** - * Get the descriptor of an option with a specific shortName - * - * @param options - * Enum, implementing {@link OptionProvider}, containing the options - * @param shortName - * the short version of an option to search - * @return a {@link Descriptor} containing the option description - */ - public static & OptionProvider & KeyProvider> Descriptor getDescriptionByShortName( - Class options, String shortName) { - - final List descriptors = SpecsEnums.getKeys(options); - - for (final Descriptor desc : descriptors) { - if (desc.getShortName().equals(shortName)) { - return desc; - } - } - return null; - } - - /** - * Get the enum referent to an option with a specific shortName - * - * @param optionsEnum - * Enum, implementing {@link OptionProvider}, containing the options - * @param shortName - * the short version of an option to search - * @return the enum containing the option description - */ - public static & OptionProvider & KeyProvider> K getOptionByShortName( - Class optionsEnum, String shortName) { - final K[] optionsList = optionsEnum.getEnumConstants(); - for (final K opt : optionsList) { - if (opt.getDescriptor().getShortName().equals(shortName)) { - return opt; - } - } - return null; - } - - /** - * Verifies if an option exists in a given Enum implementing {@link OptionProvider} - * - * @param options - * Enum containing the options - * @param shortName - * the short version of an option to search - * @return a {@link Descriptor} containing the option description - */ - public static & OptionProvider & KeyProvider> boolean contains(Class options, - String optionName) { - - final List descriptors = SpecsEnums.getKeys(options); - - for (final Descriptor desc : descriptors) { - if (desc.getName().equals(optionName)) { - return true; - } - } - return false; - } - - /** - * Verifies if an option exists in a given Enum implementing {@link OptionProvider} - * - * @param optionsEnum - * Enum containing the options - * @param shortName - * the short version of an option to search - * @return a {@link Descriptor} containing the option description - */ - public static & OptionProvider & KeyProvider> K getOptionByName(Class optionsEnum, - String optionName) { - - final K[] optionsList = optionsEnum.getEnumConstants(); - for (final K opt : optionsList) { - if (opt.getDescriptor().getName().equals(optionName)) { - return opt; - } - } - return null; - } -} diff --git a/LARAC/src/larac/options/resources/InputStreamProvider.java b/LARAC/src/larac/options/resources/InputStreamProvider.java deleted file mode 100644 index f8486c21f..000000000 --- a/LARAC/src/larac/options/resources/InputStreamProvider.java +++ /dev/null @@ -1,21 +0,0 @@ -/** - * Copyright 2016 SPeCS. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. under the License. - */ - -package larac.options.resources; - -import java.io.InputStream; - -public interface InputStreamProvider { - - public InputStream getInputStream(); -} diff --git a/LARAC/src/larac/structure/AspectIR.java b/LARAC/src/larac/structure/AspectIR.java deleted file mode 100644 index 309830f80..000000000 --- a/LARAC/src/larac/structure/AspectIR.java +++ /dev/null @@ -1,419 +0,0 @@ -/** - * Copyright 2013 SPeCS Research Group. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. under the License. - */ - -package larac.structure; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.LinkedHashMap; -import java.util.List; -import java.util.Map; - -import javax.xml.parsers.DocumentBuilder; -import javax.xml.parsers.DocumentBuilderFactory; -import javax.xml.parsers.ParserConfigurationException; - -import org.dojo.jsl.parser.ast.ASTAspectDef; -import org.dojo.jsl.parser.ast.ASTStart; -import org.dojo.jsl.parser.ast.SimpleNode; -import org.w3c.dom.Document; -import org.w3c.dom.Element; - -import larac.LaraC; -import larac.exceptions.AspectIRException; -import larac.exceptions.LARACompilerException; -import larac.exceptions.LaraException; -import larac.utils.output.MessageConstants; - -/** - * Class for creating an Aspect-Intermediate Representation (Aspect-IR) - * - * @author Tiago - * - */ -public class AspectIR { - private int codeCount; - // private ASTCompositeReference compositeReference; - private ASTStart ast; - // private Map codedefs; - private List aspectdefs; - private Map importedAspectDefs; - private Map globalElements; - private StringBuffer xml; - private final LaraC lara; - private static int globalUID = 0; - - public AspectIR(LaraC lara) { - this.lara = lara; - codeCount = 0; - // codedefs = new HashMap<>(); - aspectdefs = new ArrayList<>(); - importedAspectDefs = new HashMap<>(); - setGlobalElements(new LinkedHashMap<>()); - xml = null; - } - - /** - * * Organize the AST containing the aspects, according to the target language specification, to agree with the - * Aspect-IR structure specification - * - */ - public void organize() { - try { - ast.organize(lara); - } catch (Exception e) { - throw new AspectIRException(e); - } - - } - - /** - * Generate Aspect-IR as an org.w3c.dom.Document instance - * - * @return the Aspect-IR Document instance - */ - public Document toXML() { - final DocumentBuilderFactory dbfac = DocumentBuilderFactory.newInstance(); - DocumentBuilder docBuilder; - try { - docBuilder = dbfac.newDocumentBuilder(); - final Document doc = docBuilder.newDocument(); - final Element root = doc.createElement("aspects"); - if (!aspectdefs.isEmpty()) { - // return doc; - root.setAttribute("main", aspectdefs.get(0).getName()); - } else { - root.setAttribute("main", ""); - } - doc.appendChild(root); - - for (final ASTAspectDef aspect : aspectdefs) { - aspect.toXML(doc, root); - } - for (final ASTAspectDef aspect : importedAspectDefs.values()) { - aspect.toXML(doc, root); - } - for (final SimpleNode node : globalElements.values()) { - node.globalToXML(doc, root); - } - return doc; - } catch (final ParserConfigurationException e) { - throw new LARACompilerException("When generating Aspect-IR", e); - } - - } - - /** - * Add a new Codedef to the Codedefs' hashmap - * - * @param name - * Codedef identifier - * @param codedef - * the Codedef instance - */ - // public void addCodeDef(String name, ASTCodeDef codedef) { - // if (codedefs.containsKey(name)) { - // throw new LARACompilerException("Duplicated name for codedef \"" + name + "\""); - // } - // codedefs.put(name, codedef); - // } - - /** - * Add a new AspectDef to the AspectDefs' List - * - * @param name - * @param aspectdef - */ - public void addAspectDef(String name, ASTAspectDef aspectdef) { - if (aspectdefs.contains(aspectdef)) { - throw new LARACompilerException("Duplicated name for aspectdef \"" + name + "\""); - } - if (globalElements.containsKey(name)) { - - throw new LaraException( - "Found an aspect with the same name as a declaration: " + name + "."); - } - aspectdefs.add(aspectdef); - } - - /** - * Return the AspectDef according to its name, or null if the AspectDef does not exist in the List - * - * @param name - * the name of the Aspect to be returned - * @return the corresponding AspectDef, or null if the AspectDef does not exist - */ - public ASTAspectDef getAspectDef(String name) { - for (final ASTAspectDef asp : aspectdefs) { - if (asp.getName().equals(name)) { - return asp; - } - } - return null; - } - - /** - * Get an imported AspectDef - * - * @param name - * @return - */ - public ASTAspectDef getImportedAspectDef(String name) { - ASTAspectDef asp = importedAspectDefs.get(name); - if (asp != null) { - return asp; - } - String lastName = ""; - final String endingName = MessageConstants.NAME_SEPARATOR + name; - for (final String key : importedAspectDefs.keySet()) { - if (key.endsWith(endingName)) { - if (asp != null) { - // String error = "Found more than one aspect with the same - // name in different files for '" + name - final String error = "Found more than one aspect with name '" + name + "' in different files.\n" - + "\tTwo of them are \"" + lastName.replace(MessageConstants.NAME_SEPARATOR, ".") - + "\" and \"" + key.replace(MessageConstants.NAME_SEPARATOR, ".") - + "\".\n\tPlease refine which is the intended aspect."; - throw new LARACompilerException(error); - } - - asp = importedAspectDefs.get(key); - lastName = key; - } - - } - if (asp != null) { - return asp; - } - for (LaraC laraC : lara.getPreviouslyImportedLARA()) { - List aspectdefs2 = laraC.getAspectIR().getAspectdefs(); - for (ASTAspectDef astAspectDef : aspectdefs2) { - String nameWPrefix = laraC.getPrefix() + astAspectDef.getName(); - if (nameWPrefix.endsWith(endingName)) { - - return astAspectDef; - } - } - asp = laraC.getAspectIR().getImportedAspectDef(name); - if (asp != null) { - return asp; - } - } - return asp; - } - - /** - * Get a codedef based on its name - * - * @param codeName - * @return - */ - // public ASTCodeDef getCodedef(String codeName) { - // - // return codedefs.get(codeName); - // } - - /** - * Prints the aspects intermediate representation - */ - public void printIR() { - // lara.println("CodeDefs"); - // for (final ASTCodeDef code : codedefs.values()) { - // code.printIR(); - // } - lara.println("AspectDefs"); - for (final ASTAspectDef aspect : aspectdefs) { - aspect.printIR(); - } - lara.println("Declarations (TODO)"); - // for (final SimpleNode node : globalElements.values()) { - // node.printIR(); - // } - } - - /** - * @return the codeCount - */ - public int getCodeCount() { - return codeCount; - } - - /** - * @param codeCount - * the codeCount to set - */ - public void setCodeCount(int codeCount) { - this.codeCount = codeCount; - } - - // /** - // * @return the compositeReference - // */ - // public ASTCompositeReference getCompositeReference() { - // return compositeReference; - // } - // - // /** - // * @param compositeReference - // * the compositeReference to set - // */ - // public void setCompositeReference(ASTCompositeReference compositeReference) { - // this.compositeReference = compositeReference; - // } - - /** - * @return the ast - */ - public ASTStart getAst() { - return ast; - } - - /** - * @param ast - * the ast to set - */ - public void setAst(ASTStart ast) { - this.ast = ast; - } - - /** - * @return the codedefs - */ - // public Map getCodedefs() { - // return codedefs; - // } - - /** - * @param codedefs - * the codedefs to set - */ - // public void setCodedefs(Map codedefs) { - // this.codedefs = codedefs; - // } - - /** - * @return the aspectdefs - */ - public List getAspectdefs() { - return aspectdefs; - } - - /** - * @param aspectdefs - * the aspectdefs to set - */ - public void setAspectdefs(List aspectdefs) { - this.aspectdefs = aspectdefs; - } - - /** - * @return the importedAspectDefs - */ - public Map getImportedAspectDefs() { - return importedAspectDefs; - } - - /** - * @param importedAspectDefs - * the importedAspectDefs to set - */ - public void setImportedAspectDefs(Map importedAspectDefs) { - this.importedAspectDefs = importedAspectDefs; - } - - /** - * @return the xml - */ - public StringBuffer getXml() { - return xml; - } - - /** - * @param xml - * the xml to set - */ - public void setXml(StringBuffer xml) { - this.xml = xml; - } - - /** - * Generate a new name for a code - * - * @return - */ - public String generateNewCodeName() { - final String codeName = lara.getLaraName() + "_code_" + codeCount++; - return codeName; - } - - public Map getGlobalElements() { - return globalElements; - } - - public void addGlobalElement(String name, SimpleNode element) { - addGlobalElement(name, element, lara.getLaraPath()); - } - - public void addGlobalStatement(SimpleNode element) { - addGlobalStatement(element, lara.getLaraPath()); - } - - public void addGlobalStatement(SimpleNode element, String origin) { - addGlobalElement("statement" + newGlobalUID(), element, origin); - } - - private static int newGlobalUID() { - - return globalUID++; - } - - public void addGlobalElement(String name, SimpleNode element, String origin) { - if (globalElements.containsKey(name)) { - String location; - String laraPath = lara.getLaraPath(); - if (laraPath.equals(origin)) { - location = "both in file " + origin; - } else { - location = "one in file " + lara.getLaraFile() + " other in file " + origin; - } - throw new LaraException("Two Declarations with the same name: " + name + ". " + location + "."); - } - boolean foundAspect = aspectdefs.stream().anyMatch(aspect -> aspect.getName().equals(name)); - if (foundAspect) { - String location; - String laraPath = lara.getLaraPath(); - if (laraPath.equals(origin)) { - location = "both in file " + origin; - } else { - location = "aspect in file " + laraPath + ", declaration in file " + origin; - } - throw new LaraException( - "Found an aspect with the same name as a declaration: " - + name + ". " + location + "."); - } - globalElements.put(name, element); - } - - public void setGlobalElements(Map globalElements) { - this.globalElements = globalElements; - } - - public boolean containsGlobal(String var) { - return globalElements.containsKey(var); - } - - public SimpleNode getGlobal(String var) { - return globalElements.get(var); - } - -} \ No newline at end of file diff --git a/LARAC/src/larac/structure/AspectView.java b/LARAC/src/larac/structure/AspectView.java deleted file mode 100644 index 087b92341..000000000 --- a/LARAC/src/larac/structure/AspectView.java +++ /dev/null @@ -1,28 +0,0 @@ -/** - * Copyright 2016 SPeCS. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. under the License. - */ - -package larac.structure; - -/** - * Simple view of an aspect, containing a name, a list of inputs and list of outputs - * - * @author Tiago - * - */ -public class AspectView { - - // private String name; - // private List inputs; - // private String name; - -} diff --git a/LARAC/src/larac/utils/FileUtils.java b/LARAC/src/larac/utils/FileUtils.java deleted file mode 100644 index ade82714e..000000000 --- a/LARAC/src/larac/utils/FileUtils.java +++ /dev/null @@ -1,233 +0,0 @@ -/* - * Copyright 2013 SPeCS. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. under the License. - */ -package larac.utils; - -import java.awt.Panel; -import java.awt.TextField; -import java.io.BufferedReader; -import java.io.File; -import java.io.FileReader; -import java.io.IOException; -import java.util.HashMap; - -import javax.swing.JFileChooser; -import javax.swing.filechooser.FileFilter; - -import larac.utils.output.NormalMsg; -import larac.utils.output.Output; -import pt.up.fe.specs.util.SpecsIo; - -public class FileUtils { - public enum Commands { - ASPECT, - LANGUAGE, - RESOURCE, - XML, - OUTPUT, - WORKSPACE, - LOAD, - SAVE, - SAVEAS, - CLEAR, - GENERATE, - OPEN - } - - public static FileFilter aspectFilter = new FileFilter() { - String extension = ".lara"; - - @Override - public String getDescription() { - return "Aspect File (" + extension + ")"; - } - - @Override - public boolean accept(File arg0) { - if (arg0.isDirectory()) { - return true; - } - if (arg0.getName().contains(extension)) { - return true; - } - - return false; - } - }; - public static FileFilter txtFilter = new FileFilter() { - String extension = ".txt"; - - @Override - public String getDescription() { - return "Resource File (" + extension + ")"; - } - - @Override - public boolean accept(File arg0) { - if (arg0.isDirectory()) { - return true; - } - if (arg0.getName().contains(extension)) { - return true; - } - - return false; - } - }; - public static FileFilter dirFilter = new FileFilter() { - @Override - public String getDescription() { - return "Directory"; - } - - @Override - public boolean accept(File arg0) { - if (arg0.isDirectory()) { - return true; - } - return false; - } - }; - public static FileFilter dirXMLFilter = new FileFilter() { - @Override - public String getDescription() { - return "XMLs Directory"; - } - - @Override - public boolean accept(File arg0) { - if (arg0.isDirectory()) { - return true; - } - return false; - } - }; - - /** - * - * @param app - * @param fc - * @param ff - * @param txtField - * @param type - */ - public static void processJFileChooser(Panel app, JFileChooser fc, FileFilter ff, TextField txtField, int type) { - fc.setFileSelectionMode(type); - fc.setFileFilter(ff); - final int returnValue = fc.showDialog(app, "Open"); - switch (returnValue) { - case JFileChooser.APPROVE_OPTION: - txtField.setText(fc.getSelectedFile().getPath()); - break; - default: - break; - } - } - - public static String processSaveFileChooser(Panel app, JFileChooser fc, FileFilter ff, String title, int type) { - fc.setFileSelectionMode(type); - fc.setFileFilter(ff); - - final int returnValue = fc.showSaveDialog(app); - switch (returnValue) { - case JFileChooser.APPROVE_OPTION: - return fc.getSelectedFile().getPath(); - default: - break; - } - return ""; - } - - public static File processOpenFileChooser(Panel app, JFileChooser fc, FileFilter ff, String title, int type) { - fc.setFileSelectionMode(type); - fc.setFileFilter(ff); - - final int returnValue = fc.showOpenDialog(app); - switch (returnValue) { - case JFileChooser.APPROVE_OPTION: - return fc.getSelectedFile(); - default: - break; - } - return null; - } - - public static void toFile(String filePath, String extension, String text, File outputDir) { - final File outputFile = new File(outputDir, filePath + extension); - System.out.println("Writing to file: " + outputFile.getAbsolutePath()); - SpecsIo.write(outputFile, text); - } - - public static void toFile(Output printStream, String filePath, String extension, String text, File outputDir) { - final File outputFile = new File(outputDir, filePath + extension); - printStream.println("Writing to file: " + outputFile.getAbsolutePath()); - SpecsIo.write(outputFile, text); - } - - public static String fromFile(File f) { - new NormalMsg().println("Opening file: " + f.getPath()); - return SpecsIo.read(f); - - } - - public static boolean getExamplesFromDir(String dirName, HashMap files) { - final File dir = new File(dirName); - if (!dir.exists() || !dir.isDirectory()) { - new NormalMsg().println("Directory not found: " + dirName); - return false; - } - final String path = dir.getPath() + "\\"; - for (final String fileName : dir.list()) { - final File f = new File(path + fileName); - if (f.isDirectory()) { - getExamplesFromDir(path + fileName, files); - } else if (f.getPath().endsWith(".lara") || f.getPath().endsWith(".js")) { - String key = f.getPath(); - if (key.contains(File.separator)) { - key = key.substring(key.lastIndexOf(File.separator) + 1); - } - try (FileReader fr = new FileReader(f.getPath()); BufferedReader br = new BufferedReader(fr);) { - - String line; - String aspectCode = ""; - while ((line = br.readLine()) != null) { - aspectCode += line + "\n"; - } - files.put(key, aspectCode); - } catch (final IOException e) { - System.err.println(e.getLocalizedMessage() + "\n"); - return false; - } - - } - } - return true; - } - - public static boolean removeDirectory(File directory) { - if (directory == null || !directory.exists() || !directory.isDirectory()) { - return false; - } - final String[] list = directory.list(); - if (list != null) { - for (int i = 0; i < list.length; i++) { - final File entry = new File(directory, list[i]); - if (entry.isDirectory() && !removeDirectory(entry)) { - return false; - } else if (!entry.delete()) { - return false; - } - } - } - return directory.delete(); - } -} diff --git a/LARAC/src/larac/utils/OrganizeUtils.java b/LARAC/src/larac/utils/OrganizeUtils.java deleted file mode 100644 index 4bb6b7cc4..000000000 --- a/LARAC/src/larac/utils/OrganizeUtils.java +++ /dev/null @@ -1,218 +0,0 @@ -/* - * Copyright 2013 SPeCS. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. under the License. - */ -package larac.utils; - -import java.io.ByteArrayInputStream; -import java.io.InputStream; -import java.util.ArrayList; -import java.util.List; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -import org.dojo.jsl.parser.ast.ASTExpressionStatement; -import org.dojo.jsl.parser.ast.LARAEcmaScript; -import org.dojo.jsl.parser.ast.ParseException; -import org.dojo.jsl.parser.ast.SimpleNode; -import org.w3c.dom.Document; -import org.w3c.dom.Element; -import org.w3c.dom.Node; -import org.w3c.dom.NodeList; - -import larac.exceptions.LARACompilerException; -import larac.objects.Enums; -import larac.objects.Enums.Types; - -public class OrganizeUtils { - private static final String VALUE_ARGUMENT_NAME = "value"; - - private static final String ATTRIBUTE_ARGUMENT_NAME = "attribute"; - private static final String CODE_ARGUMENT_NAME = "code"; - private static final String POSITION_ARGUMENT_NAME = "position"; - public String space = ""; - public static final String IDENT_STR = " "; - public String fileName = ""; - public int condNum = 0; - public int applyNum = 0; - public int codeNum = 0; - - public static ArrayList getDirectChilds(Element joinPoint, String tag) { - final ArrayList childs = new ArrayList<>(); - final NodeList nodeList = joinPoint.getChildNodes(); - for (int i = 0; i < nodeList.getLength(); i++) { - if (nodeList.item(i).getNodeName().equals(tag)) { - childs.add(nodeList.item(i)); - } - } - return childs; - } - - public static ArrayList getDescendantNodes(Element el, ArrayList tags, int pos) { - final String tag = tags.get(pos++); - final ArrayList nodes = getDirectChilds(el, tag); - if (tags.size() == pos) { - return nodes; - } - final ArrayList finalNodes = new ArrayList<>(); - for (final Node n : nodes) { - final Element elChild = (Element) n; - finalNodes.addAll(getDescendantNodes(elChild, tags, pos)); - } - return finalNodes; - } - - // @Deprecated - // public static Map createOutputActionParameters(LanguageSpecification spec) { - // final Map args = new LinkedHashMap<>(); - // final ActionArgument code = new ActionArgument(OrganizeUtils.CODE_ARGUMENT_NAME, "template", spec); - // args.put(OrganizeUtils.CODE_ARGUMENT_NAME, code); - // return args; - // } - - /** - * - */ - - private static final Pattern CODE_REGEX = Pattern.compile(Enums.INSERT_SYMBOL_REGEX); - - public static List getTagValues(final String str) { - final List tagValues = new ArrayList<>(); - final Matcher matcher = OrganizeUtils.CODE_REGEX.matcher(str); - while (matcher.find()) { - tagValues.add(matcher.group(1)); - } - return tagValues; - } - - public static String firstCharToUpper(String string) { - return charToUpper(string, 0); - } - - public static String charToUpper(String string, int pos) { - if (pos < 0 || pos >= string.length()) { - throw new StringIndexOutOfBoundsException(pos); - } - String ret = string.substring(0, pos); - ret += string.substring(pos, pos + 1).toUpperCase(); - ret += string.substring(pos + 1); - return ret; - } - - /** - * Create an element, inside the document, as an undefined literal type, as child of the given element - * - * @param doc - * @param parent - */ - public static void createLiteralUndefined(Document doc, Element parent) { - final Element litEl = doc.createElement("literal"); - litEl.setAttribute("type", Types.Undefined.toString()); - litEl.setAttribute("value", Types.Undefined.toString()); - parent.appendChild(litEl); - } - - /** - * Parse an arbitrary string as an expression statement and returns the expression itself - * - * @param code - * the code to parse - * @return the expression node - */ - public static SimpleNode parseExpression(String code) { - InputStream is = new ByteArrayInputStream(code.getBytes()); - LARAEcmaScript parser = new LARAEcmaScript(is); - try { - - ASTExpressionStatement parseExpression = parser.parseExpression(code); - if (parseExpression.jjtGetNumChildren() == 0) { - throw new RuntimeException("Expression is empty"); - } - if (parseExpression.jjtGetNumChildren() != 1) { - throw new RuntimeException("More than one expression was given"); - } - return parseExpression.getChild(0); - // return parseExpression; - } catch (ParseException e) { - RuntimeException simpleE = new RuntimeException(e.getMessage()); - throw new LARACompilerException("Problems when parsing code parameter: " + code, simpleE); - - } catch (Exception e) { - - throw new LARACompilerException("Problems when parsing code parameter: " + code, e); - } - - } - - public String getSpace() { - return space; - } - - public void setSpace(String space) { - this.space = space; - } - - public String getFileName() { - return fileName; - } - - public void setFileName(String fileName) { - this.fileName = fileName; - } - - public int getCondNum() { - return condNum; - } - - public void setCondNum(int condNum) { - this.condNum = condNum; - } - - public int getApplyNum() { - return applyNum; - } - - public void setApplyNum(int applyNum) { - this.applyNum = applyNum; - } - - public int getCodeNum() { - return codeNum; - } - - public void setCodeNum(int codeNum) { - this.codeNum = codeNum; - } - - public static String getValueArgumentName() { - return OrganizeUtils.VALUE_ARGUMENT_NAME; - } - - public static String getAttributeArgumentName() { - return OrganizeUtils.ATTRIBUTE_ARGUMENT_NAME; - } - - public static String getCodeArgumentName() { - return OrganizeUtils.CODE_ARGUMENT_NAME; - } - - public static String getPositionArgumentName() { - return OrganizeUtils.POSITION_ARGUMENT_NAME; - } - - public static String getIdentStr() { - return OrganizeUtils.IDENT_STR; - } - - public static Pattern getCodeRegex() { - return OrganizeUtils.CODE_REGEX; - } -} diff --git a/LARAC/src/larac/utils/Organizer.java b/LARAC/src/larac/utils/Organizer.java deleted file mode 100644 index 324c7d9ee..000000000 --- a/LARAC/src/larac/utils/Organizer.java +++ /dev/null @@ -1,137 +0,0 @@ -/** - * Copyright 2020 SPeCS. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. under the License. - */ - -package larac.utils; - -import java.util.Arrays; -import java.util.Collection; -import java.util.LinkedHashMap; -import java.util.Map; - -import org.lara.language.specification.dsl.Action; -import org.lara.language.specification.dsl.JoinPointClass; -import org.lara.language.specification.dsl.LanguageSpecificationV2; -import org.lara.language.specification.dsl.types.TypeDef; - -import larac.objects.Enums.Types; -import larac.utils.xml.entity.ActionArgument; -import tdrc.utils.StringUtils; - -/** - * Methods for organization of the LARA AST. - * - * @author jbispo - * - */ -public class Organizer { - - private static final String CODE_ARGUMENT_NAME = "code"; - private static final String POSITION_ARGUMENT_NAME = "position"; - private static final String VALUE_ARGUMENT_NAME = "value"; - private static final String ATTRIBUTE_ARGUMENT_NAME = "attribute"; - - private final LanguageSpecificationV2 langSpec; - - public Organizer(LanguageSpecificationV2 langSpec) { - this.langSpec = langSpec; - } - - public Map createActionParameters(final Action act) { - Map args = new LinkedHashMap<>(); - for (var param : act.getParameters()) { - - final ActionArgument actionArgument = new ActionArgument(param.getDeclaration().getName(), - param.getDeclaration().getType().getType(), this); - - var defaultValue = param.getDefaultValue(); - if (!defaultValue.isEmpty()) { - actionArgument.setValue(defaultValue); - } - args.put(param.getDeclaration().getName(), actionArgument); - } - return args; - } - - public Types getConvertedType(String typeStr) { - - final Types type = Types.value(typeStr); - if (type != null) { - return type; - } - if (typeStr.contains("[]")) { - return Types.Array; - } - - // if the object declaration exist in the artifacts - if (langSpec.hasTypeDef(typeStr)) { - return Types.Object; - } - // if it is a join point class - if (langSpec.hasJoinPointName(typeStr)) { - return Types.Joinpoint; - } - - // If it does not exist, throw an exception with the error message and - // the possible - // types that can be used - final StringBuilder message = new StringBuilder("Could not convert type '" + type + "'. Available types: "); - - final StringBuilder availableTypes = reportAvailableTypes(); - message.append(availableTypes); - - throw new RuntimeException(message.toString()); - } - - private StringBuilder reportAvailableTypes() { - final StringBuilder message = new StringBuilder("\n\t Primitives: "); - message.append(StringUtils.join(Arrays.asList(Types.values()), ", ")); - // message.append(", Object, Array, Map, Template, Joinpoint"); - - final Collection objects = langSpec.getTypeDefs().values(); - if (!objects.isEmpty()) { - - message.append("\n\t Defined types: "); - final String objectsString = StringUtils.join(objects, TypeDef::getName, ", "); - message.append(objectsString); - } - - var joinpoints = langSpec.getJoinPoints().values(); - if (!joinpoints.isEmpty()) { - - message.append("\n\t Join point types: "); - final String jpsString = StringUtils.join(joinpoints, JoinPointClass::getName, ", "); - message.append(jpsString); - } - return message; - } - - public Map createInsertParameters() { - final Map args = new LinkedHashMap<>(); - - final ActionArgument when = new ActionArgument(POSITION_ARGUMENT_NAME, "string", this); - args.put(POSITION_ARGUMENT_NAME, when); - final ActionArgument code = new ActionArgument(CODE_ARGUMENT_NAME, "template", this); - args.put(CODE_ARGUMENT_NAME, code); - return args; - } - - public Map createDefParameters() { - final Map args = new LinkedHashMap<>(); - - final ActionArgument attribute = new ActionArgument(ATTRIBUTE_ARGUMENT_NAME, "string", this); - args.put(ATTRIBUTE_ARGUMENT_NAME, attribute); - final ActionArgument value = new ActionArgument(VALUE_ARGUMENT_NAME, "Object", this); - args.put(VALUE_ARGUMENT_NAME, value); - return args; - } -} diff --git a/LARAC/src/larac/utils/output/MessageConstants.java b/LARAC/src/larac/utils/output/MessageConstants.java index 3661833f0..11479f786 100644 --- a/LARAC/src/larac/utils/output/MessageConstants.java +++ b/LARAC/src/larac/utils/output/MessageConstants.java @@ -14,7 +14,6 @@ import java.io.File; -import larac.objects.Variable; /** * Class containing all the predefined messages used on Lara @@ -74,9 +73,6 @@ public class MessageConstants { public static String getDuplicateMessage(Object obj) { String type = obj.getClass().getName(); - if (obj instanceof Variable) { - return "Duplicate Variable: "; - } if (obj.getClass().getName().contains("AST")) { type = type.substring(type.lastIndexOf("AST") + 3); } diff --git a/LARAC/src/larac/utils/output/Output.java b/LARAC/src/larac/utils/output/Output.java index b84b04bfa..b3608b9e7 100644 --- a/LARAC/src/larac/utils/output/Output.java +++ b/LARAC/src/larac/utils/output/Output.java @@ -21,7 +21,6 @@ import java.util.Arrays; import java.util.Optional; -import larac.exceptions.LARACompilerException; import pt.up.fe.specs.compress.ZipFormat; import pt.up.fe.specs.util.SpecsIo; import pt.up.fe.specs.util.logging.MultiOutputStream; @@ -157,7 +156,7 @@ private PrintStream buildFileStream(File outFile) { try { fileOutputStream = new FileOutputStream(outFile); } catch (FileNotFoundException e) { - throw new LARACompilerException("Could not use file '" + outFile + "' for zipped output: ", e); + throw new RuntimeException("Could not use file '" + outFile + "' for zipped output: ", e); } BufferedOutputStream bufferedOutputStream = new BufferedOutputStream(fileOutputStream); @@ -173,7 +172,7 @@ private PrintStream buildFileStream(File outFile) { return new PrintStream(outFile); } catch (FileNotFoundException e) { - throw new LARACompilerException("Could not create output file: ", e); + throw new RuntimeException("Could not create output file: ", e); } } diff --git a/LARAC/src/larac/utils/xml/AspectIRFactory.java b/LARAC/src/larac/utils/xml/AspectIRFactory.java deleted file mode 100644 index a7a851708..000000000 --- a/LARAC/src/larac/utils/xml/AspectIRFactory.java +++ /dev/null @@ -1,110 +0,0 @@ -/** - * Copyright 2016 SPeCS. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. under the License. - */ - -package larac.utils.xml; - -import java.util.Optional; - -import org.dojo.jsl.parser.ast.ASTAction; -import org.dojo.jsl.parser.ast.SimpleNode; -import org.w3c.dom.Document; -import org.w3c.dom.Element; - -import larac.objects.Enums.Types; - -public class AspectIRFactory { - - /** - * See {@link AspectIRFactory#varDeclStmtToXML(Document, Element, String, SimpleNode, String)} - * - * @param doc - * @param parent - * @param name - * @param coords - */ - public static void varDeclStmtToXML(Document doc, Element parent, String name, String coords) { - varDeclStmtToXML(doc, parent, name, null, coords, null); - } - - /** - * Adds a variable declaration to the document, using a name, the initial value (can be null) and the coordinates - * - * @param doc - * @param parent - * @param name - * @param init - * @param coords - */ - public static void varDeclStmtToXML(Document doc, Element parent, String name, SimpleNode init, String coords, - Optional type) { - final Element statementDeclEl = doc.createElement("statement"); - statementDeclEl.setAttribute("name", "vardecl"); - statementDeclEl.setAttribute("coord", coords); - varDeclExprToXML(doc, statementDeclEl, name, init, type); - parent.appendChild(statementDeclEl); - - } - - /** - * See {@link AspectIRFactory#varDeclExprToXML(Document, Element, String, SimpleNode)} - * - * @param doc - * @param parent - * @param name - */ - public static void varDeclExprToXML(Document doc, Element parent, String name) { - varDeclExprToXML(doc, parent, name, null, null); - } - - /** - * Adds the inner elements of the variable declaration, i.e., an expression containing a literal, of type string, - * with the name of the variable, and an expression containing the initial value. If init is null, then the initial - * expression is empty - * - * @param doc - * @param parent - * @param name - * @param init - */ - public static void varDeclExprToXML(Document doc, Element parent, String name, SimpleNode init, - Optional type) { - // TODO- add type ifPresent - final Element nameExprEl = doc.createElement("expression"); - parent.appendChild(nameExprEl); - // if(var.getName().startsWith("$")) - // nameExprEl.setAttribute("type", Types.Joinpoint.toString()); - final Element literalNameEl = doc.createElement("literal"); - literalNameEl.setAttribute("value", name); - literalNameEl.setAttribute("type", Types.String.toString()); - nameExprEl.appendChild(literalNameEl); - - if (init instanceof ASTAction) { - ((ASTAction) init).actionExprToXML(doc, parent, true); - } else { - - final Element initEl = doc.createElement("expression"); - initEl.setAttribute("desc", "init"); - parent.appendChild(initEl); - if (init != null) { - init.toXML(doc, initEl); - } - } - - } - - public static void idRef(Document doc, Element parent, String name) { - final Element el = doc.createElement("id"); - el.setAttribute("name", name); - parent.appendChild(el); - } -} diff --git a/LARAC/src/larac/utils/xml/Pair.java b/LARAC/src/larac/utils/xml/Pair.java deleted file mode 100644 index b375d01c9..000000000 --- a/LARAC/src/larac/utils/xml/Pair.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright 2013 SPeCS. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. under the License. - */ -/** - * - */ -package larac.utils.xml; - -/** - * @author Tiago - * - */ -public class Pair { - private T1 left; - private T2 right; - - public Pair(T1 left, T2 right) { - this.left = left; - this.right = right; - } - - /** - * @param left - * the left to set - */ - public void setLeft(T1 left) { - this.left = left; - } - - /** - * @return the left - */ - public T1 getLeft() { - return this.left; - } - - /** - * @param right - * the right to set - */ - public void setRight(T2 right) { - this.right = right; - } - - /** - * @return the right - */ - public T2 getRight() { - return this.right; - } - - @Override - public String toString() { - return "(" + this.left + ", " + this.right + ")"; - } -} diff --git a/LARAC/src/larac/utils/xml/entity/ActionArgument.java b/LARAC/src/larac/utils/xml/entity/ActionArgument.java deleted file mode 100644 index 52c2b95f5..000000000 --- a/LARAC/src/larac/utils/xml/entity/ActionArgument.java +++ /dev/null @@ -1,126 +0,0 @@ -/* - * Copyright 2013 SPeCS. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. under the License. - */ -package larac.utils.xml.entity; - -import org.dojo.jsl.parser.ast.ASTLiteral; -import org.dojo.jsl.parser.ast.LARAEcmaScriptTreeConstants; -import org.dojo.jsl.parser.ast.SimpleNode; -import org.w3c.dom.Document; -import org.w3c.dom.Element; - -import larac.objects.Enums.Types; -import larac.utils.Organizer; - -public class ActionArgument { - private String name; - private String type; - private SimpleNode value; - // private LanguageSpecification langSpec; - private Organizer organizer; - - public ActionArgument(String name, String type, Organizer organizer) { - this.organizer = organizer; - setName(name); - setType(type); - } - - /* - public ActionArgument(String name, String type, String value) { - setName(name); - setType(type); - setValue(value); - } - */ - - public boolean hasValue() { - return value != null; - } - - /** - * @return the name - */ - public String getName() { - return name; - } - - /** - * @param name - * the name to set - */ - public void setName(String name) { - this.name = name; - } - - /** - * @return the type - */ - public String getType() { - return type; - } - - /** - * @param type - * the type to set - */ - public void setType(String type) { - this.type = type; - } - - /** - * @return the value - */ - public SimpleNode getValue() { - return value; - } - - /** - * @param value - * the value to set - */ - public void setValue(SimpleNode value) { - this.value = value; - } - - /** - * @param value - * the value to set - */ - public void setValue(String value) { - - final ASTLiteral lit = new ASTLiteral(LARAEcmaScriptTreeConstants.JJTLITERAL); - lit.jjtSetValue(value); - // try { - if (type.contains("[]")) { - - lit.setType(Types.Array); - } else if (value.equals("null")) { - lit.setType(Types.Null); - } else { - lit.setType(organizer.getConvertedType(type)); - } - // } catch (Exception e) { - // else - // value.equals(Types.Object); - // } - this.value = lit; - } - - public void toXML(Document doc, Element actEl) { - if (value != null) { - final Element argEL = doc.createElement("argument"); - actEl.appendChild(argEL); - argEL.setAttribute("name", name); - value.toXML(doc, argEL); - } - } -} diff --git a/LARAC/src/larac/utils/xml/entity/Artifact.java b/LARAC/src/larac/utils/xml/entity/Artifact.java deleted file mode 100644 index 1c29fc1e0..000000000 --- a/LARAC/src/larac/utils/xml/entity/Artifact.java +++ /dev/null @@ -1,115 +0,0 @@ -/** - * Copyright 2013 SPeCS Research Group. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. under the License. - */ - -package larac.utils.xml.entity; - -import java.util.HashMap; -import java.util.Map; - -/** - * Represents an artifact (of a join point) containing its attributes - * - * @author Tiago - * - */ -public class Artifact { - private String name; - private Attribute defaultAttribute; - private Map attributes; - - /** - * Create an artifact with a name - * - * @param name - * the name of the artifact - */ - public Artifact(String name) { - - this.name = name; - attributes = new HashMap<>(); - } - - /** - * Add a new attribute - * - * @param attr - * the attribute to add - */ - public void add(Attribute attr) { - attributes.put(attr.getName(), attr); - } - - /** - * @return the name - */ - public String getName() { - return name; - } - - /** - * @param name - * the name to set - */ - public void setName(String name) { - this.name = name; - } - - /** - * @return the attributes - */ - public Map getAttributes() { - return attributes; - } - - /** - * @param attributes - * the attributes to set - */ - public void setAttributes(Map attributes) { - this.attributes = attributes; - } - - /** - * @return the defaultAttribute - */ - public Attribute getDefaultAttribute() { - return defaultAttribute; - } - - /** - * @param defaultAttribute - * the defaultAttribute to set - */ - public void setDefaultAttribute(Attribute defaultAttribute) { - this.defaultAttribute = defaultAttribute; - } - - /** - * @param defaultAttribute - * the default attribute name to set - */ - public void setDefaultAttribute(String defaultAttribute) { - this.defaultAttribute = get(defaultAttribute); - } - - /** - * Get an attribute from the artifact - * - * @param attribute - * the attribute to get - * @return - */ - public Attribute get(String attribute) { - return getAttributes().get(attribute); - } -} diff --git a/LARAC/src/larac/utils/xml/entity/Attribute.java b/LARAC/src/larac/utils/xml/entity/Attribute.java deleted file mode 100644 index af2a5b7b1..000000000 --- a/LARAC/src/larac/utils/xml/entity/Attribute.java +++ /dev/null @@ -1,120 +0,0 @@ -/** - * Copyright 2013 SPeCS Research Group. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. under the License. - */ - -package larac.utils.xml.entity; - -import java.util.ArrayList; -import java.util.List; - -import larac.utils.xml.Pair; - -/** - * Represents an attribute pertaining to an artifact - * - * @author Tiago - * - */ -public class Attribute { - private String name; - private String type; - private boolean canDefine; - /****** List> parameters **/ - private List> parameters; - - /** - * Create a new attribute with name and type - * - * @param name - * the name of the attribute - * @param type - * the type of the attribute - */ - public Attribute(String name, String type) { - this.name = name; - this.type = type; - canDefine = false; - parameters = new ArrayList<>(); - } - - /** - * Add a new parameter to the attribute - * - * @param type - * the type of the attribute - * @param name - * the name of the attribute - */ - public void addParameter(String type, String name) { - parameters.add(new Pair<>(type, name)); - } - - /** - * @return the parameters - */ - public List> getParameters() { - return parameters; - } - - /** - * @param parameters - * the parameters to set - */ - public void setParameters(List> parameters) { - this.parameters = parameters; - } - - /** - * @return the canDefine - */ - public boolean isCanDefine() { - return canDefine; - } - - /** - * @param canDefine - * the canDefine to set - */ - public void setCanDefine(boolean canDefine) { - this.canDefine = canDefine; - } - - /** - * @return the name - */ - public String getName() { - return name; - } - - /** - * @param name - * the name to set - */ - public void setName(String name) { - this.name = name; - } - - /** - * @return the type - */ - public String getType() { - return type; - } - - /** - * @param type - * the type to set - */ - public void setType(String type) { - this.type = type; - } -} diff --git a/LARAC/src/org/dojo/jsl/parser/LARAEcmaScript.jjt b/LARAC/src/org/dojo/jsl/parser/LARAEcmaScript.jjt deleted file mode 100644 index dde452288..000000000 --- a/LARAC/src/org/dojo/jsl/parser/LARAEcmaScript.jjt +++ /dev/null @@ -1,3309 +0,0 @@ -/* - * Copyright 2013 SPeCS. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. under the License. - */ - - -options { - - /* - * Default value is true. If true, all methods and class variables - * are specified as static in the generated parser and token manager. This allows only - * one parser object to be present, but it improves the performance of the parser. - */ - STATIC = false; - - /* - * Options for obtaining debugging information - */ - DEBUG_PARSER = false; - - DEBUG_TOKEN_MANAGER = false; - - /* - * Default value is false. When set to true, the generated parser - * uses an input stream object that processes Java Unicode escapes before - * sending characters to the token manager. - */ - JAVA_UNICODE_ESCAPE = true; - - /* - * Default value is false. When set to true, the generated parser - * uses uses an input stream object that reads Unicode files. By default, ASCII files - * are assumed. - */ - UNICODE_INPUT = true; - - /* - * Default value is false. Generate a multi mode parse tree. - * The default for this is false, generating a simple mode parse tree. - */ - MULTI=true; - - /* - * Default value is false. Instead of making each non-decorated - * production an indefinite node, make it void instead. - */ - NODE_DEFAULT_VOID=true; - - /* - * The package to generate the node classes into. - */ - NODE_PACKAGE = "org.dojo.jsl.parser.ast"; - - /* - * The output directory for the generated classes - */ - JJTREE_OUTPUT_DIRECTORY = "ast"; - - /* - * Default value is false. Insert a jjtAccept() method in the - * node classes, and generate a visitor implementation with an entry for every - * node type used in the grammar. - */ - VISITOR=false; - - /* - * Default value is false. Insert calls to user-defined parser - * methods on entry and exit of every node scope. See Node Scope Hooks above. - */ - NODE_SCOPE_HOOK=false; - TRACK_TOKENS = true; //sets first and last token of the node - /* - * JDK Version - */ - JDK_VERSION = "1.5"; - - /* - * Ignore case for keywords - */ - //IGNORE_CASE = true; -} - -PARSER_BEGIN(LARAEcmaScript) - -package org.dojo.jsl.parser.ast; - -import java.io.*; -import java.util.*; -import java.io.File; -import java.io.FileReader; -import java.io.BufferedReader; -import java.io.ByteArrayInputStream; -import larac.utils.output.ErrorMsg; -import larac.objects.Enums.Types; -import larac.exceptions.ParseExceptionData; -import larac.exceptions.StopParseException; - -public class LARAEcmaScript extends LARAParserBase{ - private static final int MAX_EXCEPTION_TOKEN_SIZE = 6; - private static final int MAXIMUM_SYNTAX_EXCEPTIONS = 5; - - public File inputAspectFile = null; - public FileReader inputAspectFr = null; - public BufferedReader inputAspectBr = null; - public List exceptions = new ArrayList() ; - private int exprBraceCount = 0; - - public ASTExpressionStatement parseExpression(String expression) throws ParseException{ - return ParseExpression(); - } - - public ASTStart parse() throws ParseException{ - this.exceptions = new ArrayList(); - - return this.Start(); - } - - /* Old Code */ - @Deprecated - public static ASTStart parseFile(String fileName){ - return parseFile(new File(fileName)); - } - @Deprecated - public static ASTStart parseFile(File laraFile){ - ASTStart start = null; - File inputAspectFile = laraFile; - FileReader inputAspectFr = null; - BufferedReader inputAspectBr = null; - try{ - inputAspectFr = new FileReader(inputAspectFile); - inputAspectBr = new BufferedReader(inputAspectFr); - LARAEcmaScript aspectParser = new LARAEcmaScript(inputAspectBr); - start = aspectParser.Start(); - } - catch (Exception e) - { - try { - if(inputAspectFr != null) - inputAspectFr.close(); - if(inputAspectBr != null) - inputAspectBr.close(); - } catch (IOException e1) { - throw new RuntimeException(e1); - } - } - - try { - if(inputAspectFr != null) - inputAspectFr.close(); - if(inputAspectBr != null) - inputAspectBr.close(); - - } catch (IOException e1) { - throw new RuntimeException(e1); - } - return start; - } - -} -PARSER_END(LARAEcmaScript) - -TOKEN_MGR_DECLS : { - public int htmlTokenNestingLevel = 0; - public boolean expectActionScript = false; -} - - -/***************************************** - * LEXICAL & REGEXP GRAMMARS STARTS HERE * - *****************************************/ - - -/* Section 7 : Lexical Conventions */ - -/* Section 7.2 : White Space */ - - -SKIP: //SPECIAL_TOKEN : -{ - | | | | > -| - < #TAB: "\u0009" | "\t" > /* TAB */ -| - < #VT: "\u000B" > /* Vertical Tab */ -| - < #FF: "\u000C" | "\f"> /* Form Feed */ -| - < #SP: "\u0020" | " " > /* Space */ -| - < #NBSP: "\u00A0" > /* No-break space */ -| - < #USP: /* Other Unicode space seperator */ - ["\u2000"] - | ["\u2001"] - | ["\u2002"] - | ["\u2003"] - | ["\u2004"] - | ["\u2005"] - | ["\u2006"] - | ["\u2007"] - | ["\u2008"] - | ["\u2009"] - | ["\u200A"] - | ["\u200B"] - | ["\u3000"] - > -} - -/* Section 7.3 : Line Terminators */ - - -SKIP: //SPECIAL_TOKEN : -{ - | | | > -| - < #LF: "\n" > /* Line Feed */ -| - < #CR: "\r" > /* Carriage Return */ -| - < #LS: "\u2028" > /* Line separator */ -| - < #PS: "\u2029" > /* Paragraph separator */ -} - - -/* Comments */ - - -MORE : -{ - "//" : IN_SINGLE_LINE_COMMENT -| - "/*" : IN_MULTI_LINE_COMMENT -//| -// "/**" : IN_MULTI_LINE_DOC -} - - -SPECIAL_TOKEN : -{ - : DEFAULT -} - - -SPECIAL_TOKEN : -{ - : DEFAULT -} - -// -//SPECIAL_TOKEN : -//{ -// : DEFAULT -//} - - -MORE : -{ - < ~[] > -} - - - -/* Section 7.5.1: Reserved Words */ - - -TOKEN : -{ - /************************** LARA TOKENS *************************************/ - : DEFAULT -| - : DEFAULT -| - : DEFAULT -| - : DEFAULT -| - : DEFAULT -| - < STATICDECL: "static" > : DEFAULT -| - : DEFAULT -| - : DEFAULT -| - : DEFAULT -| - : DEFAULT -| - : DEFAULT -| - : DEFAULT -| - : DEFAULT -| - : DEFAULT -| - : DEFAULT -| - : DEFAULT -| - : DEFAULT -| - : DEFAULT -| - : DEFAULT -| - : DEFAULT -| - : DEFAULT -| - : DEFAULT -| - : DEFAULT -| - : DEFAULT -| - : DEFAULT -| - : DEFAULT -| - /*******Tokens required for the dynamic apply ******/ - : DEFAULT -| - : DEFAULT -| - : DEFAULT -| - /************************** LARA TOKENS *************************************/ - < BREAK: "break" > : DEFAULT -| - < CONTINUE: "continue" > : DEFAULT -| - < DELETE: "delete" > : DEFAULT -| - < ELSE: "else" > : DEFAULT -| - < FOR: "for" > : DEFAULT -| - < FUNCTION: "function" > : DEFAULT -| - < FUNCTION_GEN: "function*" > : DEFAULT -| - < IF: "if" > : DEFAULT -| - < IN: "in" > : DEFAULT -| - < OF: "of" > : DEFAULT -| - < EACH: "each" > : DEFAULT -| - < NEW: "new" > : DEFAULT -| - < RETURN: "return" > : DEFAULT -| - < YIELD: "yield" > : DEFAULT -| - < THIS: "this" > : IN_REGEX -| - < TYPEOF: "typeof" > : DEFAULT -| - < VAR: "var" > : DEFAULT -| - < VOID: "void" > : DEFAULT -| - < WHILE: "while" > : DEFAULT -| - < WITH: "with" > : DEFAULT -| - < CASE: "case" > : DEFAULT -| - < CATCH: "catch" > : DEFAULT -| - < CLASS: "class" > : DEFAULT -| - < CONST: "const" > : DEFAULT -| - < DEBUGGER: "debugger" > : DEFAULT -| - < _DEFAULT: "default" > : DEFAULT -| - < DO: "do" > : DEFAULT -| - < ENUM: "enum" > : DEFAULT -| - < EXTENDS: "extends" > : DEFAULT -| - < FINALLY: "finally" > : DEFAULT -| - < IMPORT: "import" > : DEFAULT -| - < SUPER: "super" > : DEFAULT -| - < SWITCH: "switch" > : DEFAULT -| - < THROW: "throw" > : DEFAULT -| - < TRY: "try" > : DEFAULT -| - < ARROW: "=>" > : DEFAULT -//| -// < UTF8_BOM: "\u00EF\u00BB\u00BF" > : DEFAULT -} - - - -/* JScript .NET Tokens - -TOKEN : -{ - < BYTE: "byte" > - | < SBYTE: "sbyte" > - | < SHORT: "short" > - | < USHORT: "ushort" > - | < UINT: "uint" > - | < LONG: "long" > - | < ULONG: "ulong" > - | < FLOAT: "float" > - | < NUMBER: "Number" > - | < DOUBLE: "double" > - | < DECIMAL: "decimal" > - | < BOOLEAN: "boolean" > - | < STRING: "String" > - | < CHAR: "char" > -} - -*/ - - -/* Section 7.7: Punctuators */ - - -TOKEN : -{ - < LBRACE: "{" > : DEFAULT -| - < RBRACE: "}" > : IN_REGEX -| - < LPAREN: "(" > : DEFAULT -| - < RPAREN: ")" > : IN_REGEX -| - < LBRACKET: "[" > : DEFAULT -| - < RBRACKET: "]" > : IN_REGEX -| - < DOT: "." > : DEFAULT -| - < SEMICOLON: ";" > : DEFAULT -| - < COMMA: "," > : DEFAULT -| - < LT: "<" > : DEFAULT -| - < GT: ">" > : DEFAULT -| - < LE: "<=" > : DEFAULT -| - < GE: ">=" > : DEFAULT -| - < EQ: "==" > : DEFAULT -| - < NE: "!=" > : DEFAULT -| - : DEFAULT /* LARA operator */ -| - < SEQ: "===" > : DEFAULT /* Strict Equals Operator */ -| - < SNEQ: "!==" > : DEFAULT /* Strict Does-not-equal Operator */ -| - < PLUS: "+" > : DEFAULT -| - < MINUS: "-" > : DEFAULT -| - < STAR: "*" > : DEFAULT -| - < REM: "%" > : DEFAULT -| - < INCR: "++" > : IN_REGEX -| - < DECR: "--" > : IN_REGEX -| - < LSHIFT: "<<" > : DEFAULT -| - < RSHIFT: ">>" > : DEFAULT -| - < RUNSHIFT: ">>>" > : DEFAULT /* Unsigned Right Shift Operator */ -| - < BIT_AND: "&" > : DEFAULT -| - < BIT_OR: "|" > : DEFAULT -| - < XOR: "^" > : DEFAULT -| - < BANG: "!" > : DEFAULT -| - < TILDE: "~" > : IN_REGEX -| - < SC_AND: "&&" > : DEFAULT -| - < SC_OR: "||" > : DEFAULT -| - < HOOK: "?" > : DEFAULT -| - < NATURAL_JOIN: "::" > : DEFAULT /* LARA Operator*/ -| - < COLON: ":" > : DEFAULT -| - < ASSIGN: "=" > : DEFAULT -| - < PLUSASSIGN: "+=" > : DEFAULT -| - < MINUSASSIGN: "-=" > : DEFAULT -| - < STARASSIGN: "*=" > : DEFAULT -| - < REMASSIGN: "%=" > : DEFAULT -| - < LSHIFTASSIGN: "<<=" > : DEFAULT -| - < RSIGNEDSHIFTASSIGN: ">>=" > : DEFAULT -| - < RUNSIGNEDSHIFTASSIGN: ">>>=" > : DEFAULT -| - < ANDASSIGN: "&=" > : DEFAULT -| - < ORASSIGN: "|=" > : DEFAULT -| - < XORASSIGN: "^=" > : DEFAULT -| - < INTANCE_OF: "instanceof" > : DEFAULT -} - - -/* Section 7.8.3: Numeric Literals */ - - -TOKEN: -{ - < DECIMAL_LITERAL : - "." ()? ()? - | - "." ()? - | - ()? - > : IN_REGEX -| - < #NON_ZERO_DIGIT: ["1"-"9"] > -| - < #EXPONENT_PART: ("e" | "E") (["+","-"])? > -} - - -TOKEN: -{ - < DECIMAL_INTEGER_LITERAL: - "0" | ()? - > : IN_REGEX -} - - -TOKEN: -{ - < HEX_INTEGER_LITERAL: "0" ["x","X"] ()+ > : IN_REGEX -} - - -TOKEN: -{ < DECIMAL_DIGITS: ()+ > : IN_REGEX } - -TOKEN: -{ - < DECIMAL_DIGIT: ["0"-"9"] > -} - -/* Section 7.8.1: NULL Literals */ - - -TOKEN: -{ - < NULL_LITERAL: "null" > : IN_REGEX -} - -/* Section 7.8.2: Boolean Literals */ - - -TOKEN: -{ - < BOOLEAN_LITERAL: "true" | "false" > : IN_REGEX -} - - - -/* Section 7.8.4: String Literals */ - - -TOKEN: -{ - < STRING_LITERAL: - "\"" ()? "\"" | "'" ()? "'" - > : IN_REGEX -| - < #DOUBLE_STRING_CHARACTERS: ()* > -| - < #SINGLE_STRING_CHARACTERS: ()* > -| - < #DOUBLE_STRING_CHARACTER: - (~["\"","\\","\n","\r","\u2028","\u2029"])* - | "\\" - > -| - < #SINGLE_STRING_CHARACTER: - (~["'","\\","\n","\r","\u2028","\u2029"]) - | "\\" - > -| - < #ESCAPE_SEQUENCE: - - | - "0" - | - - | - - > -| - < #CHARACTER_ESCAPE_SEQUENCE: - | - > -| - < #SINGLE_ESCAPE_CHARACTER: ["'" , "\"" , "\\" , "b" , "f" , "n" , "r" , "t" , "v"] > -| - < #NON_ESCAPE_CHARACTER: - ~["\n","\r","\u2028","\u2029"] - | - ~["'" , "\"" , "\\" , "b" , "f" , "n" , "r" , "t" , "v", "x", "u"] - | - ~["0"-"9"] - > -} - -TOKEN: -{ - < HEX_ESCAPE_SEQUENCE: "x" > -} - -< DEFAULT, IN_REGEX > -TOKEN: -{ - : DEFAULT - -} - -/* -TOKEN: -{ - < ESCAPE_CHARACTER: - ["'" , "\"" , "\\" , "b" , "f" , "n" , "r" , "t" , "v"] - | ["0"-"9"] - | "x" - | "u" - > -} -*/ - -/* Section 7.6: Identifiers */ - - -TOKEN: -{ - < LABEL_IDENTIFIER: - "#" ()* - > : IN_REGEX -| - < IDENTIFIER_NAME: - ( ( | "*" | "#" | "^") ) - | - (( | < AT_SIGN >)? ()*) - > : IN_REGEX -| - < #IDENTIFIER_START: - - | - - | - - > -| - < #IDENTIFIER_PART: - - | - - | - - | - - | - - | - - > -| - < #DOLLAR_SIGN: "$" > -| - < #AT_SIGN: "@" > -| - < #UNDER_SCORE: "_" > -| - < #UNICODE_LETTER: - ["A"-"Z"] - | ["a"-"z"] - | ["\u0041"-"\u005A"] - | ["\u0061"-"\u007A"] - | ["\u00AA"] - | ["\u00B5"] - | ["\u00BA"] - | ["\u00C0"-"\u00D6"] - | ["\u00D8"-"\u00F6"] - | ["\u00F8"-"\u021F"] - | ["\u0222"-"\u0233"] - | ["\u0250"-"\u02AD"] - | ["\u02B0"-"\u02B8"] - | ["\u02BB"-"\u02C1"] - | ["\u02D0"-"\u02D1"] - | ["\u02E0"-"\u02E4"] - | ["\u02EE"] - | ["\u037A"] - | ["\u0386"] - | ["\u0388"-"\u038A"] - | ["\u038C"] - | ["\u038E"-"\u03A1"] - | ["\u03A3"-"\u03CE"] - | ["\u03D0"-"\u03D7"] - | ["\u03DA"-"\u03F3"] - | ["\u0400"-"\u0481"] - | ["\u048C"-"\u04C4"] - | ["\u04C7"-"\u04C8"] - | ["\u04CB"-"\u04CC"] - | ["\u04D0"-"\u04F5"] - | ["\u04F8"-"\u04F9"] - | ["\u0531"-"\u0556"] - | ["\u0559"] - | ["\u0561"-"\u0587"] - | ["\u05D0"-"\u05EA"] - | ["\u05F0"-"\u05F2"] - | ["\u0621"-"\u063A"] - | ["\u0640"-"\u064A"] - | ["\u0671"-"\u06D3"] - | ["\u06D5"] - | ["\u06E5"-"\u06E6"] - | ["\u06FA"-"\u06FC"] - | ["\u0710"] - | ["\u0712"-"\u072C"] - | ["\u0780"-"\u07A5"] - | ["\u0905"-"\u0939"] - | ["\u093D"] - | ["\u0950"] - | ["\u0958"-"\u0961"] - | ["\u0985"-"\u098C"] - | ["\u098F"-"\u0990"] - | ["\u0993"-"\u09A8"] - | ["\u09AA"-"\u09B0"] - | ["\u09B2"] - | ["\u09B6"-"\u09B9"] - | ["\u09DC"-"\u09DD"] - | ["\u09DF"-"\u09E1"] - | ["\u09F0"-"\u09F1"] - | ["\u0A05"-"\u0A0A"] - | ["\u0A0F"-"\u0A10"] - | ["\u0A13"-"\u0A28"] - | ["\u0A2A"-"\u0A30"] - | ["\u0A32"-"\u0A33"] - | ["\u0A35"-"\u0A36"] - | ["\u0A38"-"\u0A39"] - | ["\u0A59"-"\u0A5C"] - | ["\u0A5E"] - | ["\u0A72"-"\u0A74"] - | ["\u0A85"-"\u0A8B"] - | ["\u0A8D"] - | ["\u0A8F"-"\u0A91"] - | ["\u0A93"-"\u0AA8"] - | ["\u0AAA"-"\u0AB0"] - | ["\u0AB2"-"\u0AB3"] - | ["\u0AB5"-"\u0AB9"] - | ["\u0ABD"] - | ["\u0AD0"] - | ["\u0AE0"] - | ["\u0B05"-"\u0B0C"] - | ["\u0B0F"-"\u0B10"] - | ["\u0B13"-"\u0B28"] - | ["\u0B2A"-"\u0B30"] - | ["\u0B32"-"\u0B33"] - | ["\u0B36"-"\u0B39"] - | ["\u0B3D"] - | ["\u0B5C"-"\u0B5D"] - | ["\u0B5F"-"\u0B61"] - | ["\u0B85"-"\u0B8A"] - | ["\u0B8E"-"\u0B90"] - | ["\u0B92"-"\u0B95"] - | ["\u0B99"-"\u0B9A"] - | ["\u0B9C"] - | ["\u0B9E"-"\u0B9F"] - | ["\u0BA3"-"\u0BA4"] - | ["\u0BA8"-"\u0BAA"] - | ["\u0BAE"-"\u0BB5"] - | ["\u0BB7"-"\u0BB9"] - | ["\u0C05"-"\u0C0C"] - | ["\u0C0E"-"\u0C10"] - | ["\u0C12"-"\u0C28"] - | ["\u0C2A"-"\u0C33"] - | ["\u0C35"-"\u0C39"] - | ["\u0C60"-"\u0C61"] - | ["\u0C85"-"\u0C8C"] - | ["\u0C8E"-"\u0C90"] - | ["\u0C92"-"\u0CA8"] - | ["\u0CAA"-"\u0CB3"] - | ["\u0CB5"-"\u0CB9"] - | ["\u0CDE"] - | ["\u0CE0"-"\u0CE1"] - | ["\u0D05"-"\u0D0C"] - | ["\u0D0E"-"\u0D10"] - | ["\u0D12"-"\u0D28"] - | ["\u0D2A"-"\u0D39"] - | ["\u0D60"-"\u0D61"] - | ["\u0D85"-"\u0D96"] - | ["\u0D9A"-"\u0DB1"] - | ["\u0DB3"-"\u0DBB"] - | ["\u0DBD"] - | ["\u0DC0"-"\u0DC6"] - | ["\u0E01"-"\u0E30"] - | ["\u0E32"-"\u0E33"] - | ["\u0E40"-"\u0E46"] - | ["\u0E81"-"\u0E82"] - | ["\u0E84"] - | ["\u0E87"-"\u0E88"] - | ["\u0E8A"] - | ["\u0E8D"] - | ["\u0E94"-"\u0E97"] - | ["\u0E99"-"\u0E9F"] - | ["\u0EA1"-"\u0EA3"] - | ["\u0EA5"] - | ["\u0EA7"] - | ["\u0EAA"-"\u0EAB"] - | ["\u0EAD"-"\u0EB0"] - | ["\u0EB2"-"\u0EB3"] - | ["\u0EBD"-"\u0EC4"] - | ["\u0EC6"] - | ["\u0EDC"-"\u0EDD"] - | ["\u0F00"] - | ["\u0F40"-"\u0F6A"] - | ["\u0F88"-"\u0F8B"] - | ["\u1000"-"\u1021"] - | ["\u1023"-"\u1027"] - | ["\u1029"-"\u102A"] - | ["\u1050"-"\u1055"] - | ["\u10A0"-"\u10C5"] - | ["\u10D0"-"\u10F6"] - | ["\u1100"-"\u1159"] - | ["\u115F"-"\u11A2"] - | ["\u11A8"-"\u11F9"] - | ["\u1200"-"\u1206"] - | ["\u1208"-"\u1246"] - | ["\u1248"] - | ["\u124A"-"\u124D"] - | ["\u1250"-"\u1256"] - | ["\u1258"] - | ["\u125A"-"\u125D"] - | ["\u1260"-"\u1286"] - | ["\u1288"] - | ["\u128A"-"\u128D"] - | ["\u1290"-"\u12AE"] - | ["\u12B0"] - | ["\u12B2"-"\u12B5"] - | ["\u12B8"-"\u12BE"] - | ["\u12C0"] - | ["\u12C2"-"\u12C5"] - | ["\u12C8"-"\u12CE"] - | ["\u12D0"-"\u12D6"] - | ["\u12D8"-"\u12EE"] - | ["\u12F0"-"\u130E"] - | ["\u1310"] - | ["\u1312"-"\u1315"] - | ["\u1318"-"\u131E"] - | ["\u1320"-"\u1346"] - | ["\u1348"-"\u135A"] - | ["\u13A0"-"\u13B0"] - | ["\u13B1"-"\u13F4"] - | ["\u1401"-"\u1676"] - | ["\u1681"-"\u169A"] - | ["\u16A0"-"\u16EA"] - | ["\u1780"-"\u17B3"] - | ["\u1820"-"\u1877"] - | ["\u1880"-"\u18A8"] - | ["\u1E00"-"\u1E9B"] - | ["\u1EA0"-"\u1EE0"] - | ["\u1EE1"-"\u1EF9"] - | ["\u1F00"-"\u1F15"] - | ["\u1F18"-"\u1F1D"] - | ["\u1F20"-"\u1F39"] - | ["\u1F3A"-"\u1F45"] - | ["\u1F48"-"\u1F4D"] - | ["\u1F50"-"\u1F57"] - | ["\u1F59"] - | ["\u1F5B"] - | ["\u1F5D"] - | ["\u1F5F"-"\u1F7D"] - | ["\u1F80"-"\u1FB4"] - | ["\u1FB6"-"\u1FBC"] - | ["\u1FBE"] - | ["\u1FC2"-"\u1FC4"] - | ["\u1FC6"-"\u1FCC"] - | ["\u1FD0"-"\u1FD3"] - | ["\u1FD6"-"\u1FDB"] - | ["\u1FE0"-"\u1FEC"] - | ["\u1FF2"-"\u1FF4"] - | ["\u1FF6"-"\u1FFC"] - | ["\u207F"] - | ["\u2102"] - | ["\u2107"] - | ["\u210A"-"\u2113"] - | ["\u2115"] - | ["\u2119"-"\u211D"] - | ["\u2124"] - | ["\u2126"] - | ["\u2128"] - | ["\u212A"-"\u212D"] - | ["\u212F"-"\u2131"] - | ["\u2133"-"\u2139"] - | ["\u2160"-"\u2183"] - | ["\u3005"-"\u3007"] - | ["\u3021"-"\u3029"] - | ["\u3031"-"\u3035"] - | ["\u3038"-"\u303A"] - | ["\u3041"-"\u3094"] - | ["\u309D"-"\u309E"] - | ["\u30A1"-"\u30FA"] - | ["\u30FC"-"\u30FE"] - | ["\u3105"-"\u312C"] - | ["\u3131"-"\u318E"] - | ["\u31A0"-"\u31B7"] - | ["\u3400"] - | ["\u4DB5"] - | ["\u4E00"] - | ["\u9FA5"] - | ["\uA000"-"\uA48C"] - | ["\uAC00"] - | ["\uD7A3"] - | ["\uF900"-"\uFA2D"] - | ["\uFB00"-"\uFB06"] - | ["\uFB13"-"\uFB17"] - | ["\uFB1D"] - | ["\uFB1F"-"\uFB28"] - | ["\uFB2A"-"\uFB36"] - | ["\uFB38"-"\uFB3C"] - | ["\uFB3E"] - | ["\uFB40"-"\uFB41"] - | ["\uFB43"-"\uFB44"] - | ["\uFB46"-"\uFBB1"] - | ["\uFBD3"-"\uFD3D"] - | ["\uFD50"-"\uFD8F"] - | ["\uFD92"-"\uFDC7"] - | ["\uFDF0"-"\uFDFB"] - | ["\uFE70"-"\uFE72"] - | ["\uFE74"] - | ["\uFE76"-"\uFEFC"] - | ["\uFF21"-"\uFF3A"] - | ["\uFF41"-"\uFF5A"] - | ["\uFF66"-"\uFFBE"] - | ["\uFFC2"-"\uFFC7"] - | ["\uFFCA"-"\uFFCF"] - | ["\uFFD2"-"\uFFD7"] - | ["\uFFDA"-"\uFFDC"] - > -} - -/* - * Unicode categories Non-spacing mark (MN) OR Combining spacing mark (MC) - */ -MORE: -{ - < UNICODE_COMBINING_MARK: | > -} - - -TOKEN: -{ - < MC: - ["\u0903"] - | ["\u093E"] - | ["\u093F"] - | ["\u0940"] - | ["\u0949"] - | ["\u094A"] - | ["\u094B"] - | ["\u094C"] - | ["\u0982"] - | ["\u0983"] - | ["\u09BE"] - | ["\u09BF"] - | ["\u09C0"] - | ["\u09C7"] - | ["\u09C8"] - | ["\u09CB"] - | ["\u09CC"] - | ["\u09D7"] - | ["\u0A03"] - | ["\u0A3E"] - | ["\u0A3F"] - | ["\u0A40"] - | ["\u0A83"] - | ["\u0ABE"] - | ["\u0ABF"] - | ["\u0AC0"] - | ["\u0AC9"] - | ["\u0ACB"] - | ["\u0ACC"] - | ["\u0B02"] - | ["\u0B03"] - | ["\u0B3E"] - | ["\u0B40"] - | ["\u0B47"] - | ["\u0B48"] - | ["\u0B4B"] - | ["\u0B4C"] - | ["\u0B57"] - | ["\u0BBE"] - | ["\u0BBF"] - | ["\u0BC1"] - | ["\u0BC2"] - | ["\u0BC6"] - | ["\u0BC7"] - | ["\u0BC8"] - | ["\u0BCA"] - | ["\u0BCB"] - | ["\u0BCC"] - | ["\u0BD7"] - | ["\u0C01"] - | ["\u0C02"] - | ["\u0C03"] - | ["\u0C41"] - | ["\u0C42"] - | ["\u0C43"] - | ["\u0C44"] - | ["\u0C82"] - | ["\u0C83"] - | ["\u0CBE"] - | ["\u0CC0"] - | ["\u0CC1"] - | ["\u0CC2"] - | ["\u0CC3"] - | ["\u0CC4"] - | ["\u0CC7"] - | ["\u0CC8"] - | ["\u0CCA"] - | ["\u0CCB"] - | ["\u0CD5"] - | ["\u0CD6"] - | ["\u0D02"] - | ["\u0D03"] - | ["\u0D3E"] - | ["\u0D3F"] - | ["\u0D40"] - | ["\u0D46"] - | ["\u0D47"] - | ["\u0D48"] - | ["\u0D4A"] - | ["\u0D4B"] - | ["\u0D4C"] - | ["\u0D57"] - | ["\u0D82"] - | ["\u0D83"] - | ["\u0DCF"] - | ["\u0DD0"] - | ["\u0DD1"] - | ["\u0DD8"] - | ["\u0DD9"] - | ["\u0DDA"] - | ["\u0DDB"] - | ["\u0DDC"] - | ["\u0DDD"] - | ["\u0DDE"] - | ["\u0DDF"] - | ["\u0DF2"] - | ["\u0DF3"] - | ["\u0F3E"] - | ["\u0F3F"] - | ["\u0F7F"] - | ["\u102C"] - | ["\u1031"] - | ["\u1038"] - | ["\u1056"] - | ["\u1057"] - | ["\u17B6"] - | ["\u17BE"] - | ["\u17BF"] - | ["\u17C0"] - | ["\u17C1"] - | ["\u17C2"] - | ["\u17C3"] - | ["\u17C4"] - | ["\u17C5"] - | ["\u17C7"] - | ["\u17C8"] - | ["\u1923"] - | ["\u1924"] - | ["\u1925"] - | ["\u1926"] - | ["\u1929"] - | ["\u192A"] - | ["\u192B"] - | ["\u1930"] - | ["\u1931"] - | ["\u1933"] - | ["\u1934"] - | ["\u1935"] - | ["\u1936"] - | ["\u1937"] - | ["\u1938"] - | ["\u19B0"] - | ["\u19B1"] - | ["\u19B2"] - | ["\u19B3"] - | ["\u19B4"] - | ["\u19B5"] - | ["\u19B6"] - | ["\u19B7"] - | ["\u19B8"] - | ["\u19B9"] - | ["\u19BA"] - | ["\u19BB"] - | ["\u19BC"] - | ["\u19BD"] - | ["\u19BE"] - | ["\u19BF"] - | ["\u19C0"] - | ["\u19C8"] - | ["\u19C9"] - | ["\u1A19"] - | ["\u1A1A"] - | ["\u1A1B"] - | ["\uA802"] - | ["\uA823"] - | ["\uA824"] - | ["\uA827"] - | ["\u1D16"] - | ["\u1D16"] - | ["\u1D16"] - | ["\u1D16"] - | ["\u1D16"] - | ["\u1D17"] - | ["\u1D17"] - | ["\u1D17"] - > -| - < MN: - ["\u0300"-"\u034E"] - | ["\u0360"-"\u0362"] - | ["\u0483"-"\u0486"] - | ["\u0591"-"\u05A1"] - | ["\u05A3"-"\u05B9"] - | ["\u05BB"-"\u05BD"] - | ["\u05BF"] - | ["\u05C1"-"\u05C2"] - | ["\u05C4"] - | ["\u064B"-"\u0655"] - | ["\u0670"] - | ["\u06D6"-"\u06DC"] - | ["\u06DF"-"\u06E4"] - | ["\u06E7"-"\u06E8"] - | ["\u06EA"-"\u06ED"] - | ["\u0711"] - | ["\u0730"-"\u074A"] - | ["\u07A6"-"\u07B0"] - | ["\u0901"-"\u0903"] - | ["\u093C"] - | ["\u093E"-"\u094D"] - | ["\u0951"-"\u0954"] - | ["\u0962"-"\u0963"] - | ["\u0981"-"\u0983"] - | ["\u09BC"-"\u09C4"] - | ["\u09C7"-"\u09C8"] - | ["\u09CB"-"\u09CD"] - | ["\u09D7"] - | ["\u09E2"-"\u09E3"] - | ["\u0A02"] - | ["\u0A3C"] - | ["\u0A3E"-"\u0A42"] - | ["\u0A47"-"\u0A48"] - | ["\u0A4B"-"\u0A4D"] - | ["\u0A70"-"\u0A71"] - | ["\u0A81"-"\u0A83"] - | ["\u0ABC"] - | ["\u0ABE"-"\u0AC5"] - | ["\u0AC7"-"\u0AC9"] - | ["\u0ACB"-"\u0ACD"] - | ["\u0B01"-"\u0B03"] - | ["\u0B3C"] - | ["\u0B3E"-"\u0B43"] - | ["\u0B47"-"\u0B48"] - | ["\u0B4B"-"\u0B4D"] - | ["\u0B56"-"\u0B57"] - | ["\u0B82"-"\u0B83"] - | ["\u0BBE"-"\u0BC2"] - | ["\u0BC6"-"\u0BC8"] - | ["\u0BCA"-"\u0BCD"] - | ["\u0BD7"] - | ["\u0C01"-"\u0C03"] - | ["\u0C3E"-"\u0C44"] - | ["\u0C46"-"\u0C48"] - | ["\u0C4A"-"\u0C4D"] - | ["\u0C55"-"\u0C56"] - | ["\u0C82"-"\u0C83"] - | ["\u0CBE"-"\u0CC4"] - | ["\u0CC6"-"\u0CC8"] - | ["\u0CCA"-"\u0CCD"] - | ["\u0CD5"-"\u0CD6"] - | ["\u0D02"-"\u0D03"] - | ["\u0D3E"-"\u0D43"] - | ["\u0D46"-"\u0D48"] - | ["\u0D4A"-"\u0D4D"] - | ["\u0D57"] - | ["\u0D82"-"\u0D83"] - | ["\u0DCA"] - | ["\u0DCF"-"\u0DD4"] - | ["\u0DD6"] - | ["\u0DD8"-"\u0DDF"] - | ["\u0DF2"-"\u0DF3"] - | ["\u0E31"] - | ["\u0E34"-"\u0E3A"] - | ["\u0E47"-"\u0E4E"] - | ["\u0EB1"] - | ["\u0EB4"-"\u0EB9"] - | ["\u0EBB"-"\u0EBC"] - | ["\u0EC8"-"\u0ECD"] - | ["\u0F18"-"\u0F19"] - | ["\u0F35"] - | ["\u0F37"] - | ["\u0F39"] - | ["\u0F3E"-"\u0F3F"] - | ["\u0F71"-"\u0F84"] - | ["\u0F86"-"\u0F87"] - | ["\u0F90"-"\u0F97"] - | ["\u0F99"-"\u0FBC"] - | ["\u0FC6"] - | ["\u102C"-"\u1032"] - | ["\u1036"-"\u1039"] - | ["\u1056"-"\u1059"] - | ["\u17B4"-"\u17D3"] - | ["\u18A9"] - | ["\u20D0"-"\u20DC"] - | ["\u20E1"] - | ["\u302A"-"\u302F"] - | ["\u3099"-"\u309A"] - | ["\uFB1E"] - | ["\uFE20"-"\uFE23"] - > -} - -TOKEN: -{ - < UNICODE_DIGIT: - ["\u0030"-"\u0039"] - | ["\u0660"-"\u0669"] - | ["\u06F0"-"\u06F9"] - | ["\u0966"-"\u096F"] - | ["\u09E6"-"\u09EF"] - | ["\u0A66"-"\u0A6F"] - | ["\u0AE6"-"\u0AEF"] - | ["\u0B66"-"\u0B6F"] - | ["\u0BE7"-"\u0BEF"] - | ["\u0C66"-"\u0C6F"] - | ["\u0CE6"-"\u0CEF"] - | ["\u0D66"-"\u0D6F"] - | ["\u0E50"-"\u0E59"] - | ["\u0ED0"-"\u0ED9"] - | ["\u0F20"-"\u0F29"] - | ["\u1040"-"\u1049"] - | ["\u1369"-"\u1371"] - | ["\u17E0"-"\u17E9"] - | ["\u1810"-"\u1819"] - | ["\uFF10"-"\uFF19"] - > -} - -TOKEN: -{ - < UNICODE_CONNECTOR_PUNCTUATION: - ["\u005F"] - | - ["\u203F"-"\u2040"] - | - ["\u30FB"] - | - ["\uFE33"-"\uFE34"] - | - ["\uFE4D"-"\uFE4F"] - | - ["\uFF3F"] - | - ["\uFF65"] - > -} - -TOKEN: -{ - < UNICODE_ESCAPE_SEQUENCE: "u" > -} - -TOKEN: -{ - < HEX_DIGIT: ["0"-"9"] | ["a"-"f"] | ["A"-"F"] > -} - - - - -TOKEN : -{ - < SLASHASSIGN: "/=" > : DEFAULT -| - < SLASH: "/" > : DEFAULT -} - - /* ************************* LARA TOKENS ************************************* - -TOKEN : /* JP IDENTIFIERS * -{ - < JPVAR: "$" ( | )> :DEFAULT | - < #IN_JPVAR: | | < END > | | | | | > -} - /* ************************* LARA TOKENS ************************************* / - -/* Section 7.8.5: Regular Expression Literals */ - - -TOKEN : -{ - < REGULAR_EXPRESSION_LITERAL: - "/" ( (~["\n","\r","\\","/","*"]) | ) - ( (~["\n","\r","\\","/"]) | )* "/" ()* - > : IN_REGEX -| - < #BACKSLASH_SEQUENCE: - "\\" (~["\n","\r"]) - > -} - - -/** Function that returns the join point identifier, which can be any identifier - or one of the following reserved words - **/ - Token getNoReservedIdentifier() : - {Token t;} - { - ( - t= | - t= | t= | t=< END > | - t= | t= | t= | t= | t= | - t= | t= | t= | t= | t=< SWITCH > | t=< CASE > | - t= | t= | t= | t=<_DEFAULT> | t= | t=< INTANCE_OF > | - t= | t= | t= | - t= | t= |t= | t= |t=< REPLACE > |t=< CHECK > |t=< APPLY > - ) - {return t;} - } - - - - void noReservedIdentifier() #Identifier: - {Token t;} - { - ( - t= | - t= | t= | t=< END > | - t= | t= | t= | t= | t= | - t= | t= | t= | t= | t=< SWITCH > | t=< CASE > | - t= | t= | t= | t=<_DEFAULT> | t=< CLASS > | t=< INTANCE_OF > | - t= | t= | t= | - t= | t= |t= | t= | - t= |t=< REPLACE > | t=< CHECK > | t=< APPLY > - ) - { jjtThis.setName(t.image);jjtThis.jjtSetValue(t.image); - //jjtThis.setCoord(t,t); - } - } - -/***************************************** - * ECMA SYNTACTIC GRAMMARS STARTS HERE * - *****************************************/ - -/******************************************************************************* - ************************ LARA SYNTACTIC GRAMMAR ************************* - *******************************************************************************/ - - /** - * A LARA file can contain zero or more includes and imports, followed by definitions of aspectdefs, - * codedefs, functions and global variables - **/ - ASTStart Start() #Start: - {} - { -// [] - (Import())* - (AspectDef() - | CodeDef() - | Declaration() - )* - - { return jjtThis; } - } - - void Declaration() #void: { } - { - - LOOKAHEAD(( ) Identifier()) GeneratorFunctionDeclaration() - | LOOKAHEAD(( ) Identifier()) FunctionDeclaration() - | VariableStatement() - // TODO: Enable this, disable the one below, implement declareGlobal - //| Expression() ( )? - - | - ( - - LeftHandSideExpression() AssignmentOperator() AssignmentExpression() [] - )#AssignmentExpression - - } - - /** - * The path to a file that is not in the same path of the invoked LARA file. With one import it is - * possible to import one or every file within a package - **/ - void Import() #Import: - {Token t; Token begin; Token end;} - { - begin= t=FilePath() end=EndStatement() - {jjtThis.jjtSetValue(t.image);} - // { jjtThis.setCoord(begin,end);} - } - /** FilePath - * gets the path to a file or all the files in the package - **/ - Token FilePath(): - {Token t;} - { - (LOOKAHEAD(2)Identifier())* (t= |t=) - {return t;} - } - - /** FilePathNoSTar - * gets the path to a file in a package - **/ - void FilePathNoSTar() #FilePath: - {} - { - (LOOKAHEAD(2)Identifier())+ - } - - /** - * Code Definition A parcel of native code or LARA-Code to be used by the insert/output action. To define the target - * language, one has to define the type of the codedef, such as: codedef, this means that the code to be inserted - * is written in C language. A code definition needs an identifier and its body is code that can contain a tag such - * as "" to insert information on the code such as: join point property or a variable value. To use those tags, - * the codedef must have input arguments to refer those to specific values. - **/ - void CodeDef() #CodeDef: - {Token name, code, language, begin, end;} - { - {jjtThis.setLanguage("native");} - begin=[ language= {jjtThis.setLanguage(language.image);}] - name= {jjtThis.setName(name.image);} - ( [ [FormalParameterList()] ] )#FormalParameterList(>0) - code = - { - String simpleCode = code.image.substring(2,code.image.length()-2); - jjtThis.setCode(simpleCode); - } - end= - - // { jjtThis.setCoord(begin,end);} - } - - /** - * Input arguments The arguments to be defined when a "aspect-call" action is stated. They can be normal variables - * or variables referent to a specific join point. The normal variables can have a default value - **/ - void Input() #Input: { Token begin, end;} - { - begin= - VariableDeclarationList() ()? - end= - //{ jjtThis.setCoord(begin,end);} - } - - /** - * Output arguments List of normal variables or variables referent to a specific join point. The normal variables - * can have a default value - **/ - void Output() #Output: { Token begin, end;} - { - begin= - VariableDeclarationList() ()? - end= - } - - /** - * Static List of static variables and functions, which can be accessed statically in the aspect. The variables - * values are shared between all aspect instances - **/ - void Static() #Static: {} - { - - (VariableStatement()| GeneratorFunctionDeclaration() | FunctionDeclaration())* - - } - - /** Initialize - * Similar to a constructor. A block of JavaScript code to initialize variables, inter alia - **/ - void Initialize() #Initialize: {} - { - - JavaScript() - - } - /** Finalize - * Similar to a destructor. A block of JavaScript code to finalize output variables, inter alia - **/ - void Finalize() #Finalize: {} - { - - JavaScript() - - } - - /** Check - * Set of conditions to verify input arguments and other important stats that specify if the aspect can be executed - **/ - void Check() #Check: {} - { - - LogicalORExpression() [EndStatement() (LogicalORExpression() EndStatement())*] - - } - - /** Aspect Definition - * The aspect definition can contain outputs and inputs variables, a check to verify those variables, an initializer and a finalizer to deal with information to be handler before and after the aspect, respectively. - * The body of the aspect consists of selects, applies and conditions to apply the aspect in the target program, and afters, befores, function and variable declaration to assist the apply and condition section. - */ - void AspectDef() #AspectDef: - {Token aspName, begin, end;} - { - begin= - aspName= - ( - Input() - | - Output() - | - Static() - )* - - [ Initialize() ] - [ Check() ] - ( - ( - LOOKAHEAD([Identifier() ] ( - LOOKAHEAD((getNoReservedIdentifier()(||)) - | ([]getNoReservedIdentifier() )) Pointcut() | - - LOOKAHEAD(2) FourthSetOp()) end=< END > - //{ jjtThis.setCoord(begin,end);} - } - - void FourthSetOp() #Join(>1): - {Token joinType;} - { - ThirdSetOp() [LOOKAHEAD(2)joinType=FourthSetOp() - {jjtThis.jjtSetValue(joinType.image);}] - } - - void ThirdSetOp() #Join(>1): - {Token joinType;} - { - FirstSetOp() [(joinType=|joinType=) ThirdSetOp() - {jjtThis.jjtSetValue(joinType.image);}] - } - - void FirstSetOp():{} - { - Identifier() | ( FourthSetOp()) - } - - /** Pointcut - * It can contain an identifier for the join point, a join point identifier and a possible property expression. - * Each join point can have a child, the join point down to its hierarchy - */ - void Pointcut()#Pointcut: - {Token joinPoint,reference;String referenceStr;} - { - ( - //e.g.: ($l1=loop){...} - - reference = < IDENTIFIER_NAME> - joinPoint = getNoReservedIdentifier() - {referenceStr = reference.image;} - - | - LOOKAHEAD(< IDENTIFIER_NAME > ) //e.g.: $l1=loop{...} - reference = < IDENTIFIER_NAME> - joinPoint = getNoReservedIdentifier() - {referenceStr = reference.image;} - | - joinPoint = getNoReservedIdentifier() ////e.g.: loop{...} - {referenceStr = "$"+joinPoint.image;} - - ) - { - jjtThis.jjtSetValue(joinPoint.image); - jjtThis.setReference(referenceStr); - } - - [PointcutFilters()] - [ Pointcut()] - } - - /** Pointcut properties - * The properties of a pointcut can be declared in three different ways: - - it can be any property (*) - - a set of properties that will be mapped to the default attribute - - a property expression - */ - void PointcutFilters(): - {} - { - - (| - (LOOKAHEAD( (EqualityOperator()|RelationalOperator()) | ) - ( - OrFiltersExpr() - {jjtThis.setFullSpecified(true);} - ) - | - ( - - ( ConditionalExpression() - ( ConditionalExpression())* - ) #OrFiltersExpr(>1) - {jjtThis.setFullSpecified(false);} - ) - ) - #PointcutFilters - ) - - } - - /** "OR" Property Expr - * In the pointcut properties declaration, the comma is used as an OR operator (similar to ||) - **/ - void OrFiltersExpr() :{} - { - (ANDFiltersExpr() ( ANDFiltersExpr() )*) #OrFiltersExpr(>1) - } - - /** "AND" Property Expression - * To combine properties such as an AND operation, the properties are declared inside brackets, converting the comma (which is the OR operator) into an AND. - */ - void ANDFiltersExpr():{} - { - Filter() | (Filter() ( Filter() )*) #ANDFiltersExpr(>1) - } - - /** Property - * The property is defined by comparing a join point attribute to a value - **/ - void Filter() #Filter: - {Token prop,op;} - { - prop= (EqualityOperator()|RelationalOperator()) ConditionalExpression() - {jjtThis.setProp(prop.image); - } - } - - - /** Around - * A Statement to occur around an apply - * It contains a list of applies that this statement refers to. The body of this statement is JavaScript, and can be used to prepare information for the applies. - **/ - void AroundApply() #AroundApply: - {Token name,when, end; - String label = "";} - { - [name= {label = name.image;}] ( when= | when= ) - [(Identifier() ((LOOKAHEAD(2) Identifier())*))#Applies ] - JavaScript() - - {jjtThis.setName(label); - jjtThis.setWhen(when.image);} - end= - //{ jjtThis.setCoord(when,end);} - - } - - /** Apply - * Old Version of apply, only static weaving - * Advice each join point of the related select(s). - * It can contain an unique label and a list of selects to be advised by the apply. If no select is inserted, the last select with no label will be used. - * The body contains JavaScript, in which the actions can be declared - ** - void Apply() #Apply: - {Token name, apply, end;} - { - [name={jjtThis.setName(name.image);} ] apply= [To()] - JavaScript() - end= - { jjtThis.setCoord(apply,end);} - } - /**/ - - /** Apply (Static/Dynamic) - * The new version of the Apply statement: static or dynamic weaving - * Advice each join point of the related select(s). - * It can contain an unique label and a list of selects to be advised by the apply. If no select is inserted, the last select with no label will be used. - * The body contains JavaScript, in which the actions can be declared - **/ - void Apply() #Apply: - {Token name, apply, end;} - { - [name={jjtThis.setName(name.image);} ] - apply= - - [ - < DYNAMIC > {jjtThis.setDynamic(true);} - [ - < PARALLEL > {jjtThis.setConcurrent(true);} - | - < SEQUENCIAL > {jjtThis.setConcurrent(false);} - ] - [ - < BEFORE > {jjtThis.setTrigger("before");} - | - < AFTER > {jjtThis.setTrigger("after");} -// | -// //This needs to be fixed as it conflicts with the action "replace" -// < REPLACE > {jjtThis.setTrigger("around");} - ] - ] - - - [To()] - JavaScript() - end= - //{ jjtThis.setCoord(apply,end);} - - - } - - /** To - * list of selects that will be influenced by the apply - **/ - void To() #To: - {} - { - FourthSetOp() - (LOOKAHEAD( FourthSetOp()) FourthSetOp())* - } - - - void SimpleAction() #Action: - {Token t;} - { - ( - Insert() - | - Define() - | - Perform() - | - OutputAct() /**/ - ) - EndStatement() - - } - - /** Action - * Actions that can be used to influence the join points. - * A join point variable can be used to specify the targeted join point where the action takes place - **/ - void Action() #void: - { - Token t; - } - { -// -// LOOKAHEAD(LeftHandSideExpression() AssignmentOperator() ) ( -// LeftHandSideExpression() AssignmentOperator() -// ActionOnAssign() -// -// )#AssignmentExpression -// | - ( - ( - ( - ( - t= - { - jjtThis.setName(t.image);jjtThis.jjtSetValue(t.image); - //jjtThis.setCoord(t,t); - } - )#Identifier - ) - - (LOOKAHEAD(MemberExpressionPart())MemberExpressionPart())* - < DOT > - - )#CompositeReference(>1) - ( - Insert() | - Define() | - Perform() | - OutputAct() - ) - )#Action - EndStatement() - } - - -void ActionOnAssign() #Action: - { - Token t; - } - { - - ( ( - ( - ( - t= - { - jjtThis.setName(t.image);jjtThis.jjtSetValue(t.image); - //jjtThis.setCoord(t,t); - } - )#Identifier - ) - - (LOOKAHEAD(MemberExpressionPart())MemberExpressionPart())* - < DOT > - - )#CompositeReference(>1))? - - - ExecOnAssign() - } - - /** Call - * Action to invoke an aspect. - * The aspect is called with the input arguments that requires and the call instance can have a reference variable to be used to recover information from the invoked aspect. - **/ - void Call() #Call: - {Token aspVarName,aspName,ref, end;} - { - ( - [LOOKAHEAD(LeftHandSideExpression() ) - LeftHandSideExpression() ] - - | - < VAR > Identifier() < ASSIGN > - | - LeftHandSideExpression() < ASSIGN > - ) - - [LOOKAHEAD(2)FilePathNoSTar()] - aspName= - - [Arguments()] end=EndStatement() - - { - jjtThis.setAspName(aspName.image); - // jjtThis.setCoord(aspName,end); - } - } - - - - /** Run - * Execution of an external tool. - **/ - void Run() #Run: - {Token run, toolName, end;} - { - run= [LOOKAHEAD(LeftHandSideExpression() )LeftHandSideExpression() ] - [toolName=getNoReservedIdentifier() {jjtThis.setToolName(toolName.image);}] - Arguments() - [ AssignmentExpression()] - end=EndStatement() - - // {jjtThis.setCoord(run,end);} - } - - /** Command - * Execution of a command. - **/ - void Cmd() #Cmd: - {Token cmd, toolName, end;} - { - ( - cmd= | cmd= {jjtThis.setNewVersion(true);} ) - [LOOKAHEAD(LeftHandSideExpression() )LeftHandSideExpression() ] - Arguments() - [ AssignmentExpression()] - end=EndStatement() - //{jjtThis.setCoord(cmd,end);} - } - - /** OLD CALL ** - void Call() #Call: - {Token aspVarName,aspName,ref, end;} - { - [LOOKAHEAD( ) - aspVarName= - {jjtThis.setAspVarName(aspVarName.image);}] - [LOOKAHEAD(2)FilePathNoSTar()]aspName= - {jjtThis.setAspName(aspName.image);} - [LOOKAHEAD(Arguments())Arguments()] end= - // { jjtThis.setCoord(aspName,end);} - } - /***/ - - /** Insert - * The insertion of code is made by indicating a codedefinition's identifier with the required arguments or writing the desired code, with the possibility of using LARA-code to be defined into the target language, such as insert before %{�}%. - * It is also needed to say if the code is inserted before, after or around the pointcut. - **/ - void Insert() #Insert: - {Token when,language, begin, end;} - { - { - jjtThis.setLanguage("native"); - } - ( - ( - begin= - ( - ( - [ language= {jjtThis.setLanguage(language.image);}] - (when= | when= | when= | when=) - ConditionalExpression() -// ( -// TemplateLiteral() -// | -// ((Identifier() [LOOKAHEAD(Arguments())Arguments()]) #CompositeReference(>1)) -// ) - {jjtThis.setWhen(when.image);} - //{jjtThis.setCoord(begin,when);} - ) - | - ( - Arguments() - //{jjtThis.setCoord(begin,begin);} - ) - /*| - ( - TemplateLiteral() - | - ((Identifier() [LOOKAHEAD(Arguments())Arguments()]) #CompositeReference(>1)) - {jjtThis.setWhen("inside");} - //{jjtThis.setCoord(begin,begin);} - ) */ - ) - ) - | - ( - begin = ConditionalExpression() -// ( -// TemplateLiteral() -// | -// ((Identifier() [LOOKAHEAD(Arguments())Arguments()]) #CompositeReference(>1)) -// ) - {jjtThis.setWhen(begin.image);} - //{jjtThis.setCoord(begin,begin);} - ) - ) - } - - /** Perform - * Perform an action over the join point - **/ - void Perform() #Perform: - {Token action, begin, end, t;} - { - begin= - [LOOKAHEAD(< IDENTIFIER_NAME > < COLON > ) t=< IDENTIFIER_NAME > < COLON >{jjtThis.setVariable(t.image);} ] - action=getNoReservedIdentifier() - {jjtThis.setAction(action.image);} - //{jjtThis.setCoord(begin,action);} - [ - (TemplateLiteral()) #FunctionCallParameters - | - Arguments() - ] - } - - /** Perform - * Perform an action over the join point - **/ - void ExecOnAssign() #Perform: - {Token action, begin, end, t;} - { - - //[LOOKAHEAD(< IDENTIFIER_NAME > < COLON > ) t=< IDENTIFIER_NAME > < COLON >{jjtThis.setVariable(t.image);} ] - action=getNoReservedIdentifier() - {jjtThis.setAction(action.image);} - //{jjtThis.setCoord(begin,action);} - ( - (TemplateLiteral()) #FunctionCallParameters - | - Arguments() - ) - } - - -// void CodeLiteralOnlyArgument() #FunctionCallParameters: {} -// { -// TemplateLiteral() -// } - - /** Output - * Similar to Insert, however it is used to output in runtime - **/ - void OutputAct() #OutputAct: - {Token begin;} - { - begin= - ( - ( - TemplateLiteral() - | - ((Identifier() [LOOKAHEAD(Arguments())Arguments()]) #CompositeReference(>1)) - ) - | - Arguments() - ) - //{jjtThis.setCoord(begin,begin);} - } - - /** Define - * Assign a value to a join point attribute - **/ - void Define() #Define: - {Token begin;} - { - begin= - - ( - noReservedIdentifier() AssignmentExpression() - | - Arguments() - ) - //{jjtThis.setCoord(begin,begin);} - } - - /** Condition - * Boolean expression that verifies if the apply can take place in a join point - **/ - void Condition() #Condition: - {Token t,begin, end;} - { - [ t= { jjtThis.jjtSetValue(t.image); } ] - begin= [ (Identifier() ( Identifier())* ) #For] - LogicalORExpression() - end= - //{jjtThis.setCoord(begin,end);} - } - -/******************************************************************************* - ********************** END OF LARA SYNTACTIC GRAMMAR ********************* - *******************************************************************************/ - - /* The following part of the grammar is the EcmaScript grammar created by The Dojo Foundation (2004-2005), and it was partially updated to conform to the requirements of LARA grammar, such as the use of actions and join point variables. - **/ - - /* Section 11.1: Primary Expressions */ - - void PrimaryExpression() #void : - {} - { - This() - | ObjectLiteral() - | ArrayLiteral() - | ParenExpression() - | Identifier() - | Literal() -// { return jjtThis; } - } - - void This() #ThisReference: - {} - { - "this" #ThisReference - - } - - void ParenExpression() #ParenExpression: - {} - { - "(" Expression() ")" - } - - /* Section 7.8: Literals */ - - void Literal() #Literal : - { - Token t; - Map objLiteral; - List arrayLiteral; - } - { - t = - { - jjtThis.setDecimalValue(t.image); - if(t.image.contains(".")) - jjtThis.setType(Types.Float); - else jjtThis.setType(Types.Int); - } - | - t = - { - jjtThis.setHexValue(t.image); - jjtThis.setType(Types.Int); - } - | - t = - { - jjtThis.setStringValue(t.image); - jjtThis.setType(Types.String); - } - | - t = - { - jjtThis.setBooleanValue(t.image); - jjtThis.setType(Types.Boolean); - } - | - t = - { - jjtThis.setNullValue(); - jjtThis.setType(Types.Null); - } - | - t = - { - jjtThis.setRegexValue(t.image); - jjtThis.setType(Types.RegEx); - } - | - t = - { - jjtThis.setCodeValue(t.image); - jjtThis.setType(Types.Code); - } - } - - void TemplateLiteral() #Literal: - { - Token t; - } - { - t = - { - jjtThis.setStringValue(t.image); - jjtThis.setType(Types.String); - } - | - t = - { - jjtThis.setCodeValue(t.image); - jjtThis.setType(Types.Code); - } - } - - - void Identifier() #Identifier : - { - Token t; - } - { - t= - { - jjtThis.setName(t.image);jjtThis.jjtSetValue(t.image); - /*{jjtThis.setCoord(t,t); }*/ - } - } - - - void LabelIdentifier() #Identifier : - { - Token t; - } - { - ( - t= | t=< IDENTIFIER_NAME>) - { - jjtThis.setName(t.image);jjtThis.jjtSetValue(t.image); - /*{jjtThis.setCoord(t,t); }*/ - } - } - - /* Section 11.1.4: Array Initialiser */ - - void ArrayLiteral() #ArrayLiteral : - {} - { - "[" ( - (ElisionFirst())? - ( - ElementList() - //LOOKAHEAD(ElementList() Elision()) ElementList() Elision() - //| ( ElementList() )? - )? - ) "]" - } - - - - void ElementList() #void : - {} - { - AssignmentExpression() - - ( LOOKAHEAD(2) - Elision() AssignmentExpression() )* [Elision()] - //(Elision() AssignmentExpression() )* - //(Elision())? - } - - void Elision() #void: - {} - { - (",") - [("," {jjtThis.inc();})+ #EmptyPositions] - } - - - void ElisionFirst() #EmptyPositions: - {} - { - (","){jjtThis.inc();} - [("," {jjtThis.inc();})+ ] - } - - /* Section 11.1.5: Object Initialiser */ - - void ObjectLiteral() #ObjectLiteral : - {} - { - < LBRACE > {exprBraceCount++;} - ( PropertyNameAndValueList() )? - < RBRACE > {exprBraceCount--;} - } - - void PropertyNameAndValueList() #void : - {} - { - - PropertyNameAndValue() ( LOOKAHEAD( "," PropertyNameAndValue()) "," PropertyNameAndValue() | "," )* - } - - void PropertyNameAndValue() #LiteralField : - {} - { - PropertyName() ":" AssignmentExpression() - } - - void PropertyName() #void : - {} - { - noReservedIdentifier() - | - Literal() - /* OLD - Identifier() - | - #Literal - | - #Literal - */ - } - - - /* Section 11.2: Left-Hand-Side Expressions */ - - void MemberExpression() #void : - {} - { - ( ( - LOOKAHEAD("function*") GeneratorFunctionExpression() | - LOOKAHEAD("function") FunctionExpression() | - LOOKAHEAD(ArrowFunctionExpression()) ArrowFunctionExpression() | - PrimaryExpression() - ) (LOOKAHEAD(2) MemberExpressionPart())* ) #CompositeReference(>1) - | AllocationExpression() - } - - void MemberExpressionForIn() #void : - {} - { - ( ( - LOOKAHEAD("function*") GeneratorFunctionExpression() | - LOOKAHEAD("function") FunctionExpression() | - LOOKAHEAD(ArrowFunctionExpression()) ArrowFunctionExpression() | - PrimaryExpression() - ) (LOOKAHEAD(2) MemberExpressionPart())* ) #CompositeReference(>1) - } - - void AllocationExpression() #AllocationExpression : - {} - { - ( "new" MemberExpression() ( (LOOKAHEAD(Arguments()) Arguments() (LOOKAHEAD(2) MemberExpressionPart())* ) * ) ) #CompositeReference(>1) - } - - void MemberExpressionPart() #void : - {} - { - ( ("[" Expression() "]") | (< LBRACE > {exprBraceCount++;} Expression() < RBRACE > {exprBraceCount--;})) #PropertyValueReference | ( "." (noReservedIdentifier())) #PropertyIdentifierReference - - } - - void CallExpression() #CompositeReference(>1) : - {} - { - MemberExpression() Arguments() ( LOOKAHEAD(2) CallExpressionPart() )* - } - - void CallExpressionForIn() #CompositeReference(>1) : - {} - { - MemberExpressionForIn() Arguments() ( LOOKAHEAD(2) CallExpressionPart() )* - } - - void CallExpressionPart() #void : - {} - { - Arguments() | ( "[" Expression() "]" ) #PropertyValueReference | ( "." noReservedIdentifier() ) #PropertyIdentifierReference - } - - void Arguments() #FunctionCallParameters : - {} - { - "(" (LOOKAHEAD(getNoReservedIdentifier() ) (NamedArgumentList(){ jjtThis.areNamed = true;}) - | ArgumentList())? ")" - } - - void NamedArgumentList() #void: - {} - { - NamedArgument() ( NamedArgument())* - } - - void NamedArgument() #NamedArgument: - {Token argument;} - { - argument=getNoReservedIdentifier() {jjtThis.jjtSetValue(argument.image);} - AssignmentExpression() - } - void ArgumentList() #void : - {} - { - AssignmentExpression() ("," AssignmentExpression())* - } - - - void LeftHandSideExpression() #void : - {} - { - LOOKAHEAD(MemberExpression() "(") CallExpression() | MemberExpression() - } - - - void LeftHandSideExpressionForIn() #void : - {} - { - LOOKAHEAD(CallExpression()) CallExpressionForIn() | MemberExpressionForIn() - } - - /* Section 11.3 Postfix Expressions */ - - void PostfixExpression() #PostfixExpression(>1) : - {} - { - LeftHandSideExpression() [ LOOKAHEAD(1) PostfixOperator() ] - } - - void PostfixOperator() #Operator : - {Token op;} - { - ( op="++" | op="--") - { jjtThis.jjtSetValue(op.image); } - } - - - /* Section 11.4 Unary Operators */ - - void UnaryExpression() #UnaryExpression(>1) : - {} - { - PostfixExpression() | ( UnaryOperator() UnaryExpression() ) - } - - void UnaryOperator() #Operator : - {Token op;} - { - (op="delete" | op="void" | op="typeof" | op="++" | op="--" | op="+" | op="-" | op="~" | op="!") - { jjtThis.jjtSetValue(op.image);} - } - - - /* Section 11.5: Multiplicative Operators */ - - - void MultiplicativeExpression() #BinaryExpressionSequence(>1) : - {} - { - UnaryExpression() ( MultiplicativeOperator() UnaryExpression() )* - } - - - void MultiplicativeOperator() #Operator : - {Token op;} - { - (op="*" | op= | op="%") { jjtThis.jjtSetValue(op.image);} - } - - /* Section 11.6: Additive Operators */ - - void AdditiveExpression() #BinaryExpressionSequence(>1) : - {} - { - MultiplicativeExpression() ( LOOKAHEAD(1) AdditiveOperator() MultiplicativeExpression())* - } - - void AdditiveOperator() #Operator : - {Token op;} - { - (op="+" | op="-") { jjtThis.jjtSetValue(op.image);} - } - - - /* Section 11.7: Bitwise Shift Operators */ - - void ShiftExpression() #BinaryExpressionSequence(>1) : - {} - { - AdditiveExpression() ( ShiftOperator() AdditiveExpression() )* - } - - void ShiftOperator() #Operator : - {Token op;} - { - (op="<<" | op=">>" | op=">>>") - { jjtThis.jjtSetValue(op.image); } - } - - /* Section 11.4: Relational Operators */ - - void RelationalExpression() #BinaryExpressionSequence(>1) : - {} - { - ShiftExpression() ( RelationalOperator() ShiftExpression() )* - } - - void RelationalOperator() #Operator : - {Token op;} - { - (op="<" | op=">" | op="<=" | op=">=" | op="instanceof" | op="in") - { jjtThis.jjtSetValue(op.image); } - } - - void RelationalExpressionNoIn() #BinaryExpressionSequence(>1) : - {} - { - ShiftExpression() ( RelationalNoInOperator() ShiftExpression() )* - } - - - void RelationalNoInOperator() #Operator : - {Token op;} - { - (op="<" | op=">" | op="<=" | op=">=" | op="instanceof") - { jjtThis.jjtSetValue(op.image); } - } - - /* Section 11.9: Equality Operators */ - - void EqualityExpression() #BinaryExpressionSequence(>1) : - {} - { - RelationalExpression() ( EqualityOperator() RelationalExpression() )* - } - - void EqualityExpressionNoIn() #BinaryExpressionSequence(>1) : - {} - { - RelationalExpressionNoIn() ( EqualityOperator() RelationalExpressionNoIn())* - } - - void EqualityOperator() #Operator : - {Token op;} - { - (op="==" | op="!=" | op="===" | op="!==" | op=) { jjtThis.jjtSetValue(op.image);} - } - - /* Section 11.10: Binary Bitwise Operators */ - - void BitwiseANDExpression() #BinaryExpressionSequence(>1) : - {} - { - EqualityExpression() ( BitwiseANDOperator() EqualityExpression())* - } - - void BitwiseANDExpressionNoIn() #BinaryExpressionSequence(>1) : - {} - { - EqualityExpressionNoIn() (BitwiseANDOperator() EqualityExpressionNoIn())* - } - - void BitwiseANDOperator() #Operator : - {Token op;} - { - op="&" { jjtThis.jjtSetValue(op.image); } - } - - void BitwiseXORExpression() #BinaryExpressionSequence(>1) : - {} - { - BitwiseANDExpression() (BitwiseXOROperator() BitwiseANDExpression())* - } - - void BitwiseXORExpressionNoIn() #BinaryExpressionSequence(>1) : - {} - { - BitwiseANDExpressionNoIn() (BitwiseXOROperator() BitwiseANDExpressionNoIn())* - } - - void BitwiseXOROperator() #Operator : - {Token op;} - { - op="^" { jjtThis.jjtSetValue(op.image); } - } - - void BitwiseORExpression() #BinaryExpressionSequence(>1) : - {} - { - BitwiseXORExpression() (BitwiseOROperator() BitwiseXORExpression())* - } - - void BitwiseORExpressionNoIn() #BinaryExpressionSequence(>1) : - {} - { - BitwiseXORExpressionNoIn() (BitwiseOROperator() BitwiseXORExpressionNoIn())* - } - - void BitwiseOROperator() #Operator : - {Token op;} - { - op="|" { jjtThis.jjtSetValue(op.image); } - } - /* Section 11.11: Binary Logical Operators */ - - void LogicalANDExpression() #AndExpressionSequence(>1) : - {} - { - BitwiseORExpression() (LogicalANDOperator() BitwiseORExpression())* - } - - void LogicalANDExpressionNoIn() #AndExpressionSequence(>1) : - {} - { - BitwiseORExpressionNoIn() (LogicalANDOperator() BitwiseORExpressionNoIn())* - } - - void LogicalANDOperator() #Operator : - {Token op;} - { - op="&&" { jjtThis.jjtSetValue(op.image); } - } - - void LogicalORExpression() #OrExpressionSequence(>1) : - {} - { - LogicalANDExpression() (LogicalOROperator() LogicalANDExpression())* - } - - void LogicalORExpressionNoIn() #OrExpressionSequence(>1) : - {} - { - LogicalANDExpressionNoIn() (LogicalOROperator() LogicalANDExpressionNoIn())* - } - - void LogicalOROperator() #Operator : - {Token op;} - { - op="||" { jjtThis.jjtSetValue(op.image); } - } - - /* Section 11.12: Conditional Operator */ - - void ConditionalExpression() #ConditionalExpression(>1) : - {} - { - LogicalORExpression() [ "?" AssignmentExpression() ":" AssignmentExpression() ] - } - - void ConditionalExpressionNoIn() #ConditionalExpression(>1) : - {} - { - LogicalORExpressionNoIn() [ "?" AssignmentExpression() ":" AssignmentExpressionNoIn() ] - } - - - /* Section 11.13: Assignment Operators */ - - void AssignmentExpression() #AssignmentExpression(>1) : - {} - { - LOOKAHEAD(LeftHandSideExpression() AssignmentOperator()) LeftHandSideExpression() AssignmentOperator() - (LOOKAHEAD(ActionOnAssign())ActionOnAssign() |AssignmentExpression()) - | ConditionalExpression() - } - - void AssignmentExpressionNoIn() #AssignmentExpression(>1) : - {} - { - LOOKAHEAD(LeftHandSideExpression() AssignmentOperator()) - - LeftHandSideExpression() AssignmentOperator() - (LOOKAHEAD(ActionOnAssign())ActionOnAssign() | AssignmentExpressionNoIn()) - | ConditionalExpressionNoIn() - } - - void AssignmentOperator() #Operator : - {Token op;} - { - (op="=" | op="*=" | op= | op="%=" | op="+=" | op="-=" | op="<<=" | op=">>=" | op=">>>=" | op="&=" | op="^=" | op="|=") - { jjtThis.jjtSetValue(op.image); } - } - - - /* Section 11.14: Comma Operator */ - - void Expression() #ExpressionList(>1) : - {} - { - AssignmentExpression() ( "," AssignmentExpression() )* - } - - void ExpressionNoIn() : - {} - { - AssignmentExpressionNoIn() ( "," AssignmentExpressionNoIn() )* - } - - - - /* Section 12: STATEMENTS */ - - void Statement() #void : - {{exprBraceCount =0;}} - { - - - LOOKAHEAD(2) BodiedStatement() - | - SingleStatement() -// }catch(ParseException e){ -// e.printStackTrace(); -// throw null; -// } - } - - void SingleStatement() #void: - {} - { - try - { - - SimpleAction() - | LOOKAHEAD(Action()) - Action() - | LOOKAHEAD(< CALL > | (< VAR > < IDENTIFIER_NAME > | LeftHandSideExpression() ) ) Call() - | LOOKAHEAD([] ) - Cmd() - | Run() - //| LOOKAHEAD(Block()) Block() - // | LOOKAHEAD("var" Identifier() ":") JScriptVarStatement() // JScript .NET declaration - | LOOKAHEAD("var" Identifier()) - VariableStatement() - | EmptyStatement() - | LOOKAHEAD(ExpressionStatement()) - ExpressionStatement() - | LOOKAHEAD(Identifier() ":") - LabelledStatement() - | ContinueStatement() - | YieldStatement() - | BreakStatement() - | ImportStatement() - | ReturnStatement() - }catch(ParseException e){ - error_skipto(e,SEMICOLON); - }catch(TokenMgrError error){ - exceptions.add(error); - if (exceptions.size() >= MAXIMUM_SYNTAX_EXCEPTIONS) { - Exception e = new larac.exceptions.LARACompilerException("Lexer problems", error); - error_skipto(new ParseException(error.getMessage()), SEMICOLON); - } - -// error_skipto(new ParseException(e.getMessage()),SEMICOLON); -// Exception e = new larac.exceptions.LARACompilerException("Lexer problems",error); -// exceptions.add(error); -// throw ; - } - - } - - void BodiedStatement() #void: - {} - { - try{ - - Block() - | IfStatement() - | IterationStatement() - | SwitchStatement() - | WithStatement() - | ThrowStatement() - | TryStatement() - }catch(ParseException e){ - error_skipto(e,LBRACE); - } - } - - /* 12.1 Block Statement */ - - void Block() #Block : - {Token begin, end;} - { - begin=< LBRACE > - ( StatementList() )? - end=< RBRACE > - //{jjtThis.setCoord(begin,end);} - } - - void StatementList() #StatementList(>1) : - {} - { - ( Statement() )+ - } - - - /* Section 12.2: Variable statement */ - - void VariableStatement() #VariableStatement : - {Token begin, end;} - { - - begin=< VAR > VariableDeclarationList() end=EndStatement() - //{ jjtThis.setCoord(begin,end);} - - } - - void VariableDeclarationList() #VariableDeclarationList(>1) : - {} - { - VariableDeclaration() ( "," VariableDeclaration() )* - } - - void VariableDeclarationListNoIn() #VariableDeclarationList(>1) : - {} - { - VariableDeclarationNoIn() ( "," VariableDeclarationNoIn() )* - } - - void VariableDeclaration() #VariableDeclaration : - {Token type;} - { -// Identifier() ( Initialiser() )? - Identifier()[":" type=getNoReservedIdentifier() {jjtThis.setType(type.image);}] ( Initialiser() )? - } - - void VariableDeclarationNoIn() : - {} - { - Identifier() ( InitialiserNoIn() )? #EmptyExpression(jjtree.nodeArity()==0) - } - - void Initialiser() #void : - {} - { - "=" (LOOKAHEAD(ActionOnAssign() ) ActionOnAssign() | AssignmentExpression()) - } - - void InitialiserNoIn() #void : - {} - { - "=" AssignmentExpressionNoIn() - } - - - /* Section 12.3: Empty Statement */ - - void EmptyStatement() #EmptyStatement : - {} - { - ";" - } - - - /* Section 12.4: Expression Statement */ - - void ExpressionStatement() #ExpressionStatement : - {} - { - Expression() EndStatement() - } - - ASTExpressionStatement ParseExpression() #ExpressionStatement : - {} - { - //Expression() //To many things! just need a parser like the LeftHandSideExpression rule - //This is a simpler version, which is just what we need - ( - LOOKAHEAD(MemberExpression() "(") CallExpression() - | MemberExpression() - ) - - {return jjtThis;} - } - - - /* Section 12.5: The if Statement */ - - void IfStatement() #IfStatement : - {Token begin;} - { - begin="if" "(" Expression() ")" Statement() [ LOOKAHEAD(1) "else" Statement() ] - //{jjtThis.setCoord(begin,begin); } - } - - - /* Section 12.6: Iteration Statements */ - void IterationStatement() #void : - {Token begin;Token end;} - { - DoStatement() - | WhileStatement() - | ForStatement() - } - - void DoStatement() #DoStatement: - {Token begin, end;} - { - begin= Statement() end= Expression() EndStatement() - // {jjtThis.setCoord(begin,end);} - } - - void WhileStatement() #WhileStatement: - {Token begin;} - { - begin= Expression() Statement() - // {jjtThis.setCoord(begin,begin);} - } - - void ForStatement() #void: - {Token begin;boolean isEach = false;} - { - begin=< FOR >( - ( //for each var - ("var" VariableDeclarationNoIn() Expression() Statement() - {jjtThis.setEach(true);} /*{jjtThis.setCoord(begin,begin);*/) #ForVarInStatement - |//for each - ( LeftHandSideExpressionForIn() Expression() Statement() - {jjtThis.setEach(true);} /*{jjtThis.setCoord(begin,begin);*/) #ForInStatement - ) - | - ( //for ...;...;... - LOOKAHEAD( (ExpressionNoIn())? ";") (( ExpressionNoIn() #PreAssignmentList)? #EmptyExpression(jjtree.nodeArity()==0) ";" - ( Expression() #ForConditionList)? #EmptyExpression(jjtree.nodeArity()==0) ";" - ( Expression() #PostAssignmentList)? #EmptyExpression(jjtree.nodeArity()==0) ")" - Statement() /*{jjtThis.setCoord(begin,begin); }*/) #ForStatement - |//for var ...;...;... - LOOKAHEAD("var" VariableDeclarationList() ";") ("var" VariableDeclarationList() #PreAssignmentList";" - ( Expression() #ForConditionList)? #EmptyExpression(jjtree.nodeArity()==0) ";" - ( Expression() #PostAssignmentList)? #EmptyExpression(jjtree.nodeArity()==0) - Statement() /*{jjtThis.setCoord(begin,begin);}*/) #ForVarStatement - | //for var in/of - ( "var" VariableDeclarationNoIn() (|( {isEach = true;})) Expression() Statement() - {jjtThis.setEach(isEach);} /*{jjtThis.setCoord(begin,begin); }*/) #ForVarInStatement - | //for in/of - ( LeftHandSideExpressionForIn() (|( {isEach = true;})) Expression() Statement() - {jjtThis.setEach(isEach);}/*{jjtThis.setCoord(begin,begin); }*/) #ForInStatement - ) - ) - } - /* Section 12.7: The continue Statement */ - - void ContinueStatement() #ContinueStatement : - {Token begin;} - { - begin="continue" ( LOOKAHEAD(LabelIdentifier()) LabelIdentifier() )? EndStatement() - /*{jjtThis.setCoord(begin,begin); }*/ - } - - - - /* Section 12.8: The break Statement */ - - void BreakStatement() #BreakStatement : - {Token begin;} - { - begin="break"( LOOKAHEAD(LabelIdentifier()) LabelIdentifier() )? EndStatement() - /*{jjtThis.setCoord(begin,begin); }*/ - } - - - /* Section 12.9 The return Statement */ - - void ReturnStatement() #ReturnStatement : - {} - { - "return" ( LOOKAHEAD(Expression()) Expression() )? #EmptyExpression(jjtree.nodeArity()==0) EndStatement() - } - - - /* Custom */ - void YieldStatement() #YieldStatement : - {Token begin;} - { - begin="yield" ( YieldStar() )? ( LOOKAHEAD(Expression()) Expression() )? #EmptyExpression(jjtree.nodeArity()==0) EndStatement() - } - - - void YieldStar() #YieldStar : - {} - { - "*" - } - - /* Section 12.10: The with Statement */ - - void WithStatement() #WithStatement : - {} - { - "with" "(" Expression() ")" Statement() - } - - - /* 12.11 The switch Statement */ - - void SwitchStatement() #SwitchStatement : - {Token begin;} - { - begin="switch" "(" Expression() ")" CaseBlock() - /*{jjtThis.setCoord(begin,begin); }*/ - } - - void CaseBlock() #CaseGroups : - {Token begin,end;} - { - begin=< LBRACE > ( CaseClauses() )? - ( - end=< RBRACE > | DefaultClause() ( CaseClauses() )? end=< RBRACE > - ) - /*{jjtThis.setCoord(begin,end); }*/ - } - - void CaseClauses() #void : - {} - { - ( CaseClause() )+ - } - - void CaseClause() #CaseGroup : - {Token begin;} - { - ( ( begin="case" Expression() ":" ) #CaseGuard ) ( StatementList() )? - /*{jjtThis.setCoord(begin,begin); }*/ - } - - void DefaultClause() #CaseGroup : - {Token begin;} - { - ( ( begin="default" ":" ) #CaseGuard ) ( StatementList() )? - /*{jjtThis.setCoord(begin,begin); }*/ - } - - - /* Section 12.12: Labelled Statements */ - - void LabelledStatement() #LabelledStatement: - {} - { - Identifier() ":" Statement() - } - - void ThrowStatement() #ThrowStatement : - {Token begin;} - { - begin="throw" Expression() EndStatement() - /*{jjtThis.setCoord(begin,begin); }*/ - } - - void TryStatement() #TryStatement : - {Token begin;} - { - begin="try" Block() - ( - ( Finally() | Catch() [Finally()]) - ) - /*{jjtThis.setCoord(begin,begin); }*/ - } - - void Catch() #CatchClause : - {Token begin;} - { - begin="catch" "(" Identifier() ")" Block() - /*{jjtThis.setCoord(begin,begin); }*/ - } - - void Finally() #FinallyClause : - {Token begin;} - { - begin="finally" Block() - /*{jjtThis.setCoord(begin,begin); }*/ - } - - /* Section 13: Function Definition */ - - void FunctionDeclaration() #FunctionDeclaration : - {Token begin;} - { - begin="function" Identifier() ( "(" ( FormalParameterList() )? ")" ) #FormalParameterList FunctionBody() - /*{jjtThis.setCoord(begin,begin); }*/ - } - - void GeneratorFunctionDeclaration() #GeneratorFunctionDeclaration : - {Token begin;} - { - begin="function*" Identifier() ( "(" ( FormalParameterList() )? ")" ) #FormalParameterList FunctionBody() - /*{jjtThis.setCoord(begin,begin); }*/ - } - - - void ArrowFunctionBody() #Block : - {} - { - < LBRACE > (Statement())* < RBRACE > - } - - void ArrowFunctionExpression() #ArrowFunctionExpression : - {} - { - ( "(" (FormalParameterList())? ")" | Identifier() ) #FormalParameterList - ( LOOKAHEAD(ArrowFunctionBody()) ArrowFunctionBody() | LOOKAHEAD(ExpressionNoIn()) ExpressionNoIn() ) - - -//ActionOnAssign() -// | Expression() - -//LOOKAHEAD(ArrowFunctionBody() -//LOOKAHEAD(ExpressionNoIn()) - //| LOOKAHEAD(PrimaryExpression()) PrimaryExpression() - // LOOKAHEAD(ActionOnAssign()) ActionOnAssign() - //| ConditionalExpression() - - //( LOOKAHEAD(ArrowFunctionBody()) ArrowFunctionBody() | LOOKAHEAD(Expression())Expression()) - //ConditionalExpression() - //( (LOOKAHEAD(FunctionBody()) FunctionBody()) | (LOOKAHEAD(Expression()) Expression()) ) - //(ArrowFunctionBody() | PrimaryExpression()) - //(ArrowFunctionBody() | ( LOOKAHEAD(MemberExpression() "(") CallExpression() | MemberExpression() )) - //(ArrowFunctionBody() | ( LOOKAHEAD(MemberExpression() "(") CallExpression() | MemberExpression() )) - //( "(" FormalParameterList() ")" | Identifier() ) #FormalParameterList (FunctionBody() | ActionOnAssign() | LogicalORExpression()) - //"(" ( FormalParameterList() )? ")" #ArrowParameterList "=>" (FunctionBody()) - //( ("(" ( FormalParameterList() )? ")") | Identifier()) #ArrowParameterList "=>" FunctionBody() - /*{jjtThis.setCoord(begin,begin); }*/ - } - - void FunctionExpression() #FunctionExpression : - {Token begin;} - { - begin="function" ( Identifier() )? ( "(" ( FormalParameterList() )? ")" ) #FormalParameterList FunctionBody() - /*{jjtThis.setCoord(begin,begin); }*/ - } - - void GeneratorFunctionExpression() #GeneratorFunctionExpression : - {Token begin;} - { - begin="function*" ( Identifier() )? ( "(" ( FormalParameterList() )? ")" ) #FormalParameterList FunctionBody() - /*{jjtThis.setCoord(begin,begin); }*/ - } - - void FormalParameterList() #void : - {} - { - (Identifier()) ( "," (Identifier()) )* - } - - void FunctionBody() #Block : - {} - { - < LBRACE > (SourceElements())? < RBRACE > - } - - - /* Section 14: Program * - - ASTProgram Program() #Program : - {} - { - JavaScript() - - { return jjtThis; } - } - /**/ - - void JavaScript() #JavaScript: - {} - { - (SourceElements())? - } - - - void SourceElements() #void : - {} - { - (SourceElement())+ - } - - void SourceElement() #void : - {} - { - LOOKAHEAD("function*" Identifier()) GeneratorFunctionDeclaration() | LOOKAHEAD("function" Identifier()) FunctionDeclaration() | Statement() - } - - - - - - /* - * Grammar for parsing JScript .NET contructs: ( import System; var contents : - * String = reader.ReadToEnd(); ) Refer: src/hostenv_jsc.js - */ - - void ImportStatement(): - {} - { - "import" Name() [ "." "*" ] EndStatement() - } - - - void Name(): - {} - { - ( LOOKAHEAD(2) < DOT > )* - } - - - void JScriptVarStatement() #VariableStatement : - {} - { - < VAR > JScriptVarDeclarationList() EndStatement() - } - - void JScriptVarDeclarationList() #VariableDeclarationList(>1) : - {} - { - JScriptVarDeclaration() ( < COMMA > JScriptVarDeclaration() )* - } - - void JScriptVarDeclaration() #VariableDeclaration : - {} - { - Identifier() ":" ( Initialiser() )? - } - - Token EndStatement() #void: - {Token end;} - { - try - { - end=< SEMICOLON > - {return end;} - - }catch(ParseException e) - { - if(e.expectedTokenSet.size() > MAX_EXCEPTION_TOKEN_SIZE - || (e.expectedTokenSet.size() == 1 && e.expectedTokenSet.get(0).equals(";"))){ - - Token foundToken = getToken(1); - String line = "at line " + e.currentToken.beginLine + ", column " + e.currentToken.beginColumn; - String message = line+": did you forget a ';'?"; - if (foundToken != null){ - message+=" (possible errant token: "+ foundToken + ")"; - } - e = new ParseException(message); - SimpleNode currNode = getCurrentNode(); - exceptions.add(e); - ParseExceptionData excData = new ParseExceptionData(e); - if (currNode != null){ - currNode.setExceptionData(excData); - } - }else{ - error_skipto(e, SEMICOLON); - } - - // - } - - {return new Token(SEMICOLON);} - - } - -JAVACODE -void error_skipto(ParseException e, int kind) { -// ParseException e = generateParseException(); // generate the exception object. -// System.out.println(e.toString()); // print the error message - exceptions.add(e); - SimpleNode currNode = getCurrentNode(); - ParseExceptionData excData = new ParseExceptionData(e); - excData.setSkippedToToken(kind); - Token t = null; -// int braceCount = 0; - skipper: do { - Token test = getToken(1); -// System.out.println(exprBraceCount); - if(test == null || test.kind == END) - { -// System.out.println("I'm breaking here with:"+test); - break; - } - switch(test.kind) - { - case RBRACE: - exprBraceCount--; - if(exprBraceCount < 0) - break skipper; - break; - } - - - t = getNextToken(); - - if(t != null) - excData.addSkippedToken(t); -// System.out.println("Skipped: "+t+" token("+test+")"); - } while (t != null && (t.kind != kind && t.kind != EOF)); - // The above loop consumes tokens all the way up to a token of -// "kind". We use a do-while loop rather than a while because the -// current token is the one immediately before the erroneous token -// (in our case the token immediately before what should have been -// "if"/"while". - - if (currNode != null){ - currNode.setExceptionData(excData); - } - if(t == null || t.kind == EOF){ - throw new StopParseException(); - } -} - -JAVACODE -void error_noSkip(ParseException e) { - System.out.println("--------------NO SKIP-----------------"); -// ParseException e = generateParseException(); // generate the exception object. -// System.out.println(e.toString()); // print the error message - SimpleNode currNode = getCurrentNode(); - ParseExceptionData excData = new ParseExceptionData(e); - if (currNode != null){ - currNode.setExceptionData(excData); - } -} \ No newline at end of file diff --git a/LARAC/src/org/dojo/jsl/parser/ast/.gitignore b/LARAC/src/org/dojo/jsl/parser/ast/.gitignore deleted file mode 100644 index dba750589..000000000 --- a/LARAC/src/org/dojo/jsl/parser/ast/.gitignore +++ /dev/null @@ -1,33 +0,0 @@ -#/JJTLARAEcmaScriptState.java -#/LARAEcmaScript.java -#/LARAEcmaScript.jj -#/LARAEcmaScriptConstants.java -#/LARAEcmaScriptTokenManager.java -#/LARAEcmaScriptTreeConstants.java -#/Token.java -#/Node.java -#/JavaCharStream.java -#/ASTEventAdaptation.java -#/ASTPeriodicAdaptation.java -#/ASTStartCondition.java -#/ASTStopCondition.java - -# These files have custom changes -#/TokenMgrError.java -#/ParseException.java - -#/ASTNormalFunctionExpression.java -#/ASTArrowParameterList.java -#/ParseException.java -#/TokenMgrError.java -#/ASTYieldStar.java -/ASTYieldStar.java -/JJTLARAEcmaScriptState.java -/JavaCharStream.java -/LARAEcmaScript.java -/LARAEcmaScriptConstants.java -/LARAEcmaScript.jj -/LARAEcmaScriptTokenManager.java -/LARAEcmaScriptTreeConstants.java -/Node.java -/Token.java diff --git a/LARAC/src/org/dojo/jsl/parser/ast/ASTANDFiltersExpr.java b/LARAC/src/org/dojo/jsl/parser/ast/ASTANDFiltersExpr.java deleted file mode 100644 index 7dd6b8efc..000000000 --- a/LARAC/src/org/dojo/jsl/parser/ast/ASTANDFiltersExpr.java +++ /dev/null @@ -1,68 +0,0 @@ -/* Generated By:JJTree: Do not edit this line. ASTANDFiltersExpr.java Version 4.3 */ -/* - * JavaCCOptions:MULTI=true,NODE_USES_PARSER=false,VISITOR=false,TRACK_TOKENS=false,NODE_PREFIX=AST,NODE_EXTENDS=, - * NODE_FACTORY=,SUPPORT_CLASS_VISIBILITY_PUBLIC=true - */ -package org.dojo.jsl.parser.ast; - -import org.lara.language.specification.dsl.LanguageSpecificationV2; -import org.w3c.dom.Document; -import org.w3c.dom.Element; - -public class ASTANDFiltersExpr extends SimpleNode { - public ASTANDFiltersExpr(int id) { - super(id); - } - - public ASTANDFiltersExpr(LARAEcmaScript p, int id) { - super(p, id); - } - - @Override - public String organize(String type, LanguageSpecificationV2 langSpec) { - // ArrayList props = new ArrayList(); - for (final Node child : getChildren()) { - // String s = - ((SimpleNode) child).organize(type, langSpec); - /* - * WHY? if (props.contains(s)) { SimpleNode pcParent = - * getParentById(LARAEcmaScriptTreeConstants.JJTPOINTCUT); throw - * newException("In joinpoint \"" + pcParent.jjtGetValue() + - * "\": duplicate attribute used in an AND expression: \"\"" + s + - * "\""); } props.add(s); - */ - } - return null; - } - - @Override - public Element getFilterElement(Document doc) { - Element aux = null; - boolean first = true; - Element jpANDEl = null; - for (final Node child : getChildren()) { - final Element childEl = ((SimpleNode) child).getFilterElement(doc); - if (childEl != null) { - if (first) { - aux = childEl; - first = false; - } else { - if (jpANDEl == null) { - jpANDEl = doc.createElement("op"); - jpANDEl.setAttribute("name", "AND"); - jpANDEl.appendChild(aux); - } - jpANDEl.appendChild(childEl); - } - } - } - if (jpANDEl != null) { - return jpANDEl; - } - return aux; - } -} -/* - * JavaCC - OriginalChecksum=61255ba5f4f54f385b3c8ad768398374 (do not edit this - * line) - */ diff --git a/LARAC/src/org/dojo/jsl/parser/ast/ASTAction.java b/LARAC/src/org/dojo/jsl/parser/ast/ASTAction.java deleted file mode 100644 index acccb0677..000000000 --- a/LARAC/src/org/dojo/jsl/parser/ast/ASTAction.java +++ /dev/null @@ -1,156 +0,0 @@ -/* Generated By:JJTree: Do not edit this line. ASTAction.java Version 4.3 */ -/* - * JavaCCOptions:MULTI=true,NODE_USES_PARSER=false,VISITOR=false,TRACK_TOKENS=false,NODE_PREFIX=AST,NODE_EXTENDS=, - * NODE_FACTORY=,SUPPORT_CLASS_VISIBILITY_PUBLIC=true - */ -package org.dojo.jsl.parser.ast; - -import java.util.Map; - -import org.w3c.dom.Document; -import org.w3c.dom.Element; - -import larac.objects.Enums.Types; -import larac.utils.xml.entity.ActionArgument; - -public class ASTAction extends SimpleNode { - private String method = ""; - private Map arguments = null; - private String varName = null; - - public ASTAction(int id) { - super(id); - } - - public ASTAction(LARAEcmaScript p, int id) { - super(p, id); - } - - public String getMethod() { - return method; - } - - public void setMethod(String method) { - this.method = method; - } - - public Map getArguments() { - return arguments; - } - - public void setArguments(Map arguments) { - this.arguments = arguments; - } - - @Override - public Object organize(Object obj) { - /* - * if(select == null) throw newException( - * "Cannot invoke this action(s) outside of an apply statement. \n" + - * "First select the pointcut, such as: select " - * +(value!=null?value.toString():"")+" end"); - */ - ((SimpleNode) getChildren()[0]).organize(obj); - if (children.length > 1) { - ((SimpleNode) getChildren()[1]).organize(obj); - } - return null; - } - - @Override - public void toXML(Document doc, Element parent) { - final Element statEl = doc.createElement("statement"); - statEl.setAttribute("coord", getCoords()); - parent.appendChild(statEl); - - if (varName != null) { - statEl.setAttribute("name", "vardecl"); - - final Element nameExprEl = doc.createElement("expression"); - statEl.appendChild(nameExprEl); - // if(var.getName().startsWith("$")) - // nameExprEl.setAttribute("type", Types.Joinpoint.toString()); - final Element literalNameEl = doc.createElement("literal"); - literalNameEl.setAttribute("value", varName); - literalNameEl.setAttribute("type", Types.String.toString()); - nameExprEl.appendChild(literalNameEl); - // final Element initEl = doc.createElement("expression"); - // initEl.setAttribute("desc", "init"); - // statEl.appendChild(initEl); - // initEl.appendChild(exprEl); - } else { - statEl.setAttribute("name", "expr"); - } - actionExprToXML(doc, statEl, true); - } - - public void actionExprToXML(Document doc, final Element statEl, boolean encapsulateWithExpression) { - - final Element callEl = doc.createElement("call"); - - if (encapsulateWithExpression) { - final Element exprEl = doc.createElement("expression"); - exprEl.setAttribute("desc", "action"); - exprEl.appendChild(callEl); - statEl.appendChild(exprEl); - } else { - statEl.appendChild(callEl); - } - - final Element methodEl = doc.createElement("method"); - callEl.appendChild(methodEl); - - /* - * if(children.length == 1){ ASTApply apl = (ASTApply) - * getParentById(LARAEcmaScriptTreeConstants.JJTAPPLY); Variable v = - * apl.getActiveSelect().lookupLastJPVariable(); String pc = - * v.getName(); Element idEl = doc.createElement("id"); - * idEl.setAttribute("name", pc); propEl.appendChild(idEl); }else - * ((SimpleNode)getChildren()[0]).toXML(doc, propEl); / - **/ - if (children.length != 1) { - final Element propEl = doc.createElement("property"); - methodEl.appendChild(propEl); - ((SimpleNode) getChildren()[0]).toXML(doc, propEl); - final Element litEl = doc.createElement("literal"); - litEl.setAttribute("value", method); - litEl.setAttribute("type", Types.String.toString()); - propEl.appendChild(litEl); - } else { - final Element idEl = doc.createElement("id"); - idEl.setAttribute("name", method); - methodEl.appendChild(idEl); - } - for (final ActionArgument arg : arguments.values()) { - SimpleNode argValueNode = arg.getValue(); - if (argValueNode == null) { - throw newException("Argument '" + arg.getName() + "' for action '" + method + "' must be defined."); - } - final Element argEl = doc.createElement("argument"); - callEl.appendChild(argEl); - // if (arg.getType().equals("template")) { - // argValueNode.toXMLTemplate(doc, argEl); - // } else { - argValueNode.toXML(doc, argEl); - - // } - } - - } - - @Override - public void secondOrganize(ASTSelect sel) { - ((SimpleNode) getChildren()[0]).secondOrganize(sel); - if (children.length > 1) { - ((SimpleNode) getChildren()[1]).secondOrganize(sel); - } - } - - public void setVarName(String varName) { - this.varName = varName; - } -} -/* - * JavaCC - OriginalChecksum=f7d66d4d016739e22aba1a5140aba067 (do not edit this - * line) - */ diff --git a/LARAC/src/org/dojo/jsl/parser/ast/ASTActionParameterList.java b/LARAC/src/org/dojo/jsl/parser/ast/ASTActionParameterList.java deleted file mode 100644 index d12671c09..000000000 --- a/LARAC/src/org/dojo/jsl/parser/ast/ASTActionParameterList.java +++ /dev/null @@ -1,21 +0,0 @@ -/* Generated By:JJTree: Do not edit this line. ASTActionParameterList.java Version 4.3 */ -/* - * JavaCCOptions:MULTI=true,NODE_USES_PARSER=false,VISITOR=false,TRACK_TOKENS=false,NODE_PREFIX=AST,NODE_EXTENDS=, - * NODE_FACTORY=,SUPPORT_CLASS_VISIBILITY_PUBLIC=true - */ -package org.dojo.jsl.parser.ast; - -public class ASTActionParameterList extends SimpleNode { - public ASTActionParameterList(int id) { - super(id); - } - - public ASTActionParameterList(LARAEcmaScript p, int id) { - super(p, id); - } - -} -/* - * JavaCC - OriginalChecksum=c5c5a1ae2c156a9e15e1b40132cf0a34 (do not edit this - * line) - */ diff --git a/LARAC/src/org/dojo/jsl/parser/ast/ASTAllocationExpression.java b/LARAC/src/org/dojo/jsl/parser/ast/ASTAllocationExpression.java deleted file mode 100644 index 13e9bd36c..000000000 --- a/LARAC/src/org/dojo/jsl/parser/ast/ASTAllocationExpression.java +++ /dev/null @@ -1,149 +0,0 @@ -/* Generated By:JJTree: Do not edit this line. ASTAllocationExpression.java Version 4.3 */ -/* - * JavaCCOptions:MULTI=true,NODE_USES_PARSER=false,VISITOR=false,TRACK_TOKENS=false,NODE_PREFIX=AST,NODE_EXTENDS=, - * NODE_FACTORY=,SUPPORT_CLASS_VISIBILITY_PUBLIC=true - */ -package org.dojo.jsl.parser.ast; - -import org.w3c.dom.Document; -import org.w3c.dom.Element; - -import larac.LaraC; -import larac.objects.Enums.Types; - -public class ASTAllocationExpression extends SimpleNode { - - /** - * @return the args - */ - public ASTFunctionCallParameters getArgs() { - return args; - } - - /** - * @param args - * the args to set - */ - public void setArgs(ASTFunctionCallParameters args) { - this.args = args; - } - - /** - * @return the allocType - */ - public Types getAllocType() { - return allocType; - } - - /** - * @param allocType - * the allocType to set - */ - public void setAllocType(Types allocType) { - this.allocType = allocType; - } - - /** - * @return the methodID - */ - public String getMethodID() { - return methodID; - } - - /** - * @param methodID - * the methodID to set - */ - public void setMethodID(String methodID) { - this.methodID = methodID; - } - - private Types allocType = Types.getDefault(); - private String methodID; - private ASTFunctionCallParameters args; - - public ASTAllocationExpression(int id) { - super(id); - } - - public ASTAllocationExpression(LARAEcmaScript p, int id) { - super(p, id); - } - - @Override - public Object organize(Object obj) { - if (children[0] instanceof ASTIdentifier) { - final String instance = ((ASTIdentifier) children[0]).value.toString(); - methodID = instance; - } else if (children[0] instanceof ASTFunctionExpression) { - final ASTFunctionExpression funcExpr = ((ASTFunctionExpression) children[0]); - funcExpr.organize(obj); - } else { - final ASTCompositeReference comp = ((ASTCompositeReference) children[0]); - comp.setAlloc(this); - } - if (args != null) { - args.organize(this); - } - final ASTAspectDef asp = getAspectDef(methodID); - if (asp != null) { - allocType = Types.Aspect; - methodID = asp.getLara().getPrefix() + asp.getName(); - } else { - allocType = Types.Object; - } - /* - * OLD -> bug! //LaraC lara = getLara(); - * if(lara.system.hasItem("Constructors", methodID)) allocType = - * Types.Object; else{ ASTAspectDef asp = getAspectDef(methodID); if(asp - * == null) throw newException( - * "Bad Object/Aspect used in the allocation expression: "+methodID); - * allocType = Types.Aspect; - * - * methodID = asp.getLara().prefix+asp.getName(); } / - **/ - return null; - } - - private ASTAspectDef getAspectDef(String instance) { - final LaraC lara = getLara(); - ASTAspectDef asp = lara.aspectIR().getAspectDef(instance); - if (asp == null) { - asp = lara.aspectIR().getImportedAspectDef(instance); - } - return asp; - } - - @Override - public Types getExpressionType() { - return allocType; - } - - @Override - public void toXML(Document doc, Element parent) { - final Element newEl = doc.createElement("op"); - newEl.setAttribute("name", "NEW"); - parent.appendChild(newEl); - - if (allocType == Types.Object && !(children[0] instanceof ASTIdentifier)) { - ((SimpleNode) children[0]).toXML(doc, newEl); - return; - } - final Element callEl = doc.createElement("call"); - newEl.appendChild(callEl); - final Element methodEl = doc.createElement("method"); - callEl.appendChild(methodEl); - - final Element idEl = doc.createElement("id"); - idEl.setAttribute("name", methodID); - // idEl.setAttribute("type", allocType.toString()); - methodEl.appendChild(idEl); - if (args != null) { - args.toXML(doc, callEl); - } - } -} -/* - * JavaCC - OriginalChecksum=b64db1759614cdc2b435b70f761571e3 (do not edit this - * line) - */ diff --git a/LARAC/src/org/dojo/jsl/parser/ast/ASTAndExpressionSequence.java b/LARAC/src/org/dojo/jsl/parser/ast/ASTAndExpressionSequence.java deleted file mode 100644 index 7ed6b133e..000000000 --- a/LARAC/src/org/dojo/jsl/parser/ast/ASTAndExpressionSequence.java +++ /dev/null @@ -1,69 +0,0 @@ -/* Generated By:JJTree: Do not edit this line. ASTAndExpressionSequence.java Version 4.3 */ -/* - * JavaCCOptions:MULTI=true,NODE_USES_PARSER=false,VISITOR=false,TRACK_TOKENS=false,NODE_PREFIX=AST,NODE_EXTENDS=, - * NODE_FACTORY=,SUPPORT_CLASS_VISIBILITY_PUBLIC=true - */ -package org.dojo.jsl.parser.ast; - -import org.w3c.dom.Document; -import org.w3c.dom.Element; - -import larac.objects.Enums.Types; - -public class ASTAndExpressionSequence extends SimpleNode { - public ASTAndExpressionSequence(int id) { - super(id); - } - - public ASTAndExpressionSequence(LARAEcmaScript p, int id) { - super(p, id); - } - - @Override - public Object organize(Object obj) { - final SimpleNode left = (SimpleNode) children[0]; - left.organize(this); - for (int i = 1; i < children.length; i += 2) { - final ASTOperator operator = (ASTOperator) children[i]; - operator.organize(this); - final SimpleNode right = (SimpleNode) children[i + 1]; - right.organize(this); - operator.setReturnType(Types.Boolean); - } - return obj; - } - - @Override - public void toXML(Document doc, Element parent) { - SimpleNode left = (SimpleNode) children[0]; - ASTOperator operator = (ASTOperator) children[1]; - Element opEl = doc.createElement("op"); - opEl.setAttribute("name", operator.getTag()); - parent.appendChild(opEl); - left.toXML(doc, opEl); - // opEl.setAttribute("type", operator.getReturnType().name()); - int i = 2; - while (i + 1 < children.length) { - left = (SimpleNode) children[i++]; - operator = (ASTOperator) children[i++]; - final Element newOpEl = doc.createElement("op"); - newOpEl.setAttribute("name", operator.getTag()); - opEl.appendChild(newOpEl); - opEl = newOpEl; - // opEl.setAttribute("type", operator.getReturnType().name()); - left.toXML(doc, opEl); - } - final SimpleNode right = (SimpleNode) children[i]; - right.toXML(doc, opEl); - } - - @Override - public Types getExpressionType() { - return Types.Boolean; - } - -} -/* - * JavaCC - OriginalChecksum=2c6739a84b97b5235ff2487a9e6e3a6e (do not edit this - * line) - */ diff --git a/LARAC/src/org/dojo/jsl/parser/ast/ASTApplies.java b/LARAC/src/org/dojo/jsl/parser/ast/ASTApplies.java deleted file mode 100644 index b6a7a75ad..000000000 --- a/LARAC/src/org/dojo/jsl/parser/ast/ASTApplies.java +++ /dev/null @@ -1,47 +0,0 @@ -/* Generated By:JJTree: Do not edit this line. ASTApplies.java Version 4.3 */ -/* - * JavaCCOptions:MULTI=true,NODE_USES_PARSER=false,VISITOR=false,TRACK_TOKENS=false,NODE_PREFIX=AST,NODE_EXTENDS=, - * NODE_FACTORY=,SUPPORT_CLASS_VISIBILITY_PUBLIC=true - */ -package org.dojo.jsl.parser.ast; - -public class ASTApplies extends SimpleNode { - public ASTApplies(int id) { - super(id); - } - - public ASTApplies(LARAEcmaScript p, int id) { - super(p, id); - } - - @Override - public Object organize(Object obj) { - final ASTAroundApply around = ((ASTAroundApply) parent); - // final ASTAspectDef aspectDef = ((ASTAspectDef) around.parent); - final ASTAspectDef aspectDef = getAspectDefForDeclStmt("Around apply"); - if (around.getWhen().equals("before")) { - for (final Node child : getChildren()) { - final String applyTarget = ((ASTIdentifier) child).value.toString(); - final ASTApply apply = aspectDef.findApplyByName(applyTarget); - if (apply == null) { - throw newException("Unknown apply \"" + applyTarget + "\" used on before statement"); - } - apply.setBefore(around); - } - } else if (around.getWhen().equals("after")) { - for (final Node child : getChildren()) { - final String applyTarget = ((ASTIdentifier) child).value.toString(); - final ASTApply apply = aspectDef.findApplyByName(applyTarget); - if (apply == null) { - throw newException("Unknown apply \"" + applyTarget + "\" used on after statement"); - } - apply.setAfter(around); - } - } - return null; - } -} -/* - * JavaCC - OriginalChecksum=89e8ac0f17c045fb469de2bc42f87667 (do not edit this - * line) - */ diff --git a/LARAC/src/org/dojo/jsl/parser/ast/ASTApply.java b/LARAC/src/org/dojo/jsl/parser/ast/ASTApply.java deleted file mode 100644 index b7c795c7e..000000000 --- a/LARAC/src/org/dojo/jsl/parser/ast/ASTApply.java +++ /dev/null @@ -1,351 +0,0 @@ -/* Generated By:JJTree: Do not edit this line. ASTApply.java Version 4.3 */ -/* - * JavaCCOptions:MULTI=true,NODE_USES_PARSER=false,VISITOR=false,TRACK_TOKENS=false,NODE_PREFIX=AST,NODE_EXTENDS=, - * NODE_FACTORY=,SUPPORT_CLASS_VISIBILITY_PUBLIC=true - */ -package org.dojo.jsl.parser.ast; - -import java.util.HashMap; -import java.util.Map; - -import org.w3c.dom.Document; -import org.w3c.dom.Element; - -import larac.LaraC; -import larac.objects.Variable; - -public class ASTApply extends SimpleNode { - private String name; - private ASTAroundApply before, after; - private ASTCondition condition; - public int codeCount = 0; - private int toPosition; - private ASTSelect activeSelect; - private boolean dynamic = false; - private Boolean concurrent = false; - private String trigger = "before"; - - // private int bodyPosition = -1; - - public ASTApply(int id) { - super(id); - } - - public ASTApply(LARAEcmaScript p, int id) { - super(p, id); - } - - public void setName(String image) { - value = name = label = image; - } - - public String getName() { - return name; - } - - @Override - public Object organize(Object obj) { - // final ASTAspectDef aspectDef = ((ASTAspectDef) obj); - final ASTAspectDef aspectDef = getAspectDefForDeclStmt("Apply"); - - if (name == null) { - value = name = aspectDef.getName() + "_apply_" + aspectDef.getApplyCount(); - aspectDef.setLastApplyWithNoLabel(this); - } - - setBefore(aspectDef.getLastbeforeWithNoLabel()); - - if (!(children[0] instanceof ASTTo)) { - setToWithUnlabelledSelect(aspectDef); - } - - if (isDynamic()) { - processDynamicConditions(aspectDef); - } - - ((ASTTo) getChildren()[0]).organize(this); // js.organize inside - - aspectDef.putApply(this); - return null; - } - - /** - * //Process conditions, which are location between the To (0) and the JavaScript Nodes (children.lenght-1), hence: - * ]0,lenght-1[ - * - * @param aspectDef - */ - private static void processDynamicConditions(ASTAspectDef aspectDef) { - // What has to be done here? do we need to validate something inside the apply? - // - // throw new NotImplementedException("The dynamic conditions are not yet implemented"); - } - - /** - * Create an ASTTo with the last select that has no label - * - * @param aspectDef - * @return - */ - private void setToWithUnlabelledSelect(ASTAspectDef aspectDef) { - final ASTSelect sel = aspectDef.getLastSelectWithNoLabel(); - // aspectDef.setLastSelectWithNoLabel(null); - if (sel == null) { - throw newException("Unknown select for apply :\"" + name + "\""); - } - final ASTTo to = new ASTTo(LARAEcmaScriptTreeConstants.JJTTO); - final ASTIdentifier id = new ASTIdentifier(LARAEcmaScriptTreeConstants.JJTIDENTIFIER); - id.jjtSetValue(sel.getName()); - to.associateChild(id, 0); - appendChildAsFirst(to); - to.parent = this; - } - - public ASTSelect getSelect(String value) { - // final ASTAspectDef aspect = (ASTAspectDef) parent; - final ASTAspectDef aspect = getAspectDefForDeclStmt("Apply"); - return aspect.getSelect(value); - } - - @Override - public void toXML(Document doc, Element parent) { - - // final ASTAspectDef aspect = (ASTAspectDef) this.parent; - final ASTAspectDef aspect = getAspectDefForDeclStmt("Apply"); - final ASTTo to = (ASTTo) children[0]; // First node should always be an ASTTo - - if (dynamic) { - System.out.println(outsideVariables); - } - - toPosition = 0; - int count = 0; - ASTCondition condition = null; - if (aspect.containsCondition(getName())) { - condition = aspect.getCondition(getName()); - } - int length = to.children.length; - while (toPosition < length) { - setActiveSelect(to.selects.get(toPosition)); - final String applyName = getName() + "_" + count++; - final Element applyEl = doc.createElement("statement"); - applyEl.setAttribute("coord", getCoords()); - parent.appendChild(applyEl); - applyEl.setAttribute("name", "apply"); - applyEl.setAttribute("label", applyName); - applyEl.setAttribute("dynamic", Boolean.toString(dynamic)); - applyEl.setAttribute("concurrent", Boolean.toString(concurrent)); - applyEl.setAttribute("execute", trigger); - - to.toXML(doc, applyEl, toPosition); - setCondition(doc, condition, applyEl, applyName); - - if (before != null && before.children[0].jjtGetNumChildren() != 0) { - before.toXML(doc, applyEl); - } else { - final Element applyBeforeEl = doc.createElement("code"); - applyBeforeEl.setAttribute("desc", "before"); - applyEl.appendChild(applyBeforeEl); - } - - final Element applyCodeEl = doc.createElement("code"); - applyCodeEl.setAttribute("desc", "do"); - applyEl.appendChild(applyCodeEl); - ((SimpleNode) getChildren()[1]).toXML(doc, applyCodeEl); - if (after != null && after.children[0].jjtGetNumChildren() != 0) { - after.toXML(doc, applyEl); - } else { - final Element applyAfterEl = doc.createElement("code"); - applyAfterEl.setAttribute("desc", "after"); - applyEl.appendChild(applyAfterEl); - } - - toPosition++; - setActiveSelect(null); - } - } - - private static void setCondition(Document doc, ASTCondition condition, Element applyEl, String applyName) { - if (condition != null) { - condition.toXML(doc, applyEl); - } else { - applyEl.appendChild(doc.createElement("expression")); - } - } - - /** - * @param before - * the before to set - */ - public void setBefore(ASTAroundApply before) { - if (this.before != null) { - final LaraC lara = getLara(); - lara.warnln("Apply \"" + name + "\" contains more than one before statement. First will be used"); - return; - } - this.before = before; - } - - /** - * @return the before - */ - public ASTAroundApply getBefore() { - return before; - } - - /** - * @param after - * the after to set - */ - public void setAfter(ASTAroundApply after) { - if (this.after != null) { - getLara().warnln("Apply \"" + name + "\" contains more than one after statement. First will be used"); - return; - } - this.after = after; - } - - /** - * @return the after - */ - public ASTAroundApply getAfter() { - return after; - } - - /** - * @param condition - * the condition to set - */ - public void setCondition(ASTCondition condition) { - if (this.condition != null) { - getLara().warnln("Apply \"" + name + "\" contains more than one condition. First will be used"); - return; - } - this.condition = condition; - } - - /** - * @return the condition - */ - public ASTCondition getCondition() { - return condition; - } - - public void organizeCondition() { - ((ASTTo) getChildren()[0]).organizeCondition(this); - - } - - public String getSelectLastJPVar() { - final ASTSelect sel = ((ASTTo) children[0]).selects.get(toPosition); - return sel.getLastJPVariable().getName(); - } - - @Override - public Variable lookup(String var) { - if (before != null) { - if (before.getJs().getHMVars().containsKey(var)) { - return before.getJs().getHMVars().get(var); - } - } - Variable getVar = super.lookupNoError(var); - if (getVar != null && !outsideVariables.containsKey(getVar.getName())) { - outsideVariables.put(getVar.getName(), getVar); - } - - return getVar; - } - - private Map outsideVariables = new HashMap<>(); - - @Override - public Variable lookupNoError(String var) { - if (before != null) { - if (before.getJs().getHMVars().containsKey(var)) { - return before.getJs().getHMVars().get(var); - } - } - Variable getVar = super.lookupNoError(var); - if (getVar != null && !outsideVariables.containsKey(getVar.getName())) { - outsideVariables.put(getVar.getName(), getVar); - } - return getVar; - } - - public void organizeAfter() { - if (after != null) { - after.organizeForApply(this); - } - } - - public void setActiveSelect(ASTSelect astSelect) { - activeSelect = astSelect; - } - - public ASTSelect getActiveSelect() { - return activeSelect; - } - - public boolean isDynamic() { - return dynamic; - } - - public void setDynamic(boolean isDynamic) { - dynamic = isDynamic; - } - - @Override - public String toString() { - - String toString = LARAEcmaScriptTreeConstants.jjtNodeName[id]; - if (dynamic) { - return toString + " [static]"; - } - - toString += " [dynamic "; - toString += concurrent ? "par" : "seq"; - toString += " " + trigger; - return toString + "]"; - } - - public ASTJavaScript getBody() { - // if (bodyPosition == -1) { - // searchBody(); - // } - // return (ASTJavaScript) children[bodyPosition]; - return (ASTJavaScript) children[children.length - 1]; - } - - /** - * @return the parallel - */ - public boolean isParallel() { - return concurrent; - } - - /** - * @param parallel - * the parallel to set - */ - public void setConcurrent(boolean parallel) { - concurrent = parallel; - } - - public void setTrigger(String string) { - trigger = string; - - } - - // private void searchBody() { - // for (int i = 0; i < children.length; i++) { - // if (children[i] instanceof ASTJavaScript) { - // bodyPosition = i; - // return; - // } - // } - // } -} -/* - * JavaCC - OriginalChecksum=eab81715be50293fb9681ab9499db9c9 (do not edit this - * line) - */ diff --git a/LARAC/src/org/dojo/jsl/parser/ast/ASTAroundApply.java b/LARAC/src/org/dojo/jsl/parser/ast/ASTAroundApply.java deleted file mode 100644 index 038a4049b..000000000 --- a/LARAC/src/org/dojo/jsl/parser/ast/ASTAroundApply.java +++ /dev/null @@ -1,192 +0,0 @@ -/* Generated By:JJTree: Do not edit this line. ASTAroundApply.java Version 4.3 */ -/* - * JavaCCOptions:MULTI=true,NODE_USES_PARSER=false,VISITOR=false,TRACK_TOKENS=false,NODE_PREFIX=AST,NODE_EXTENDS=, - * NODE_FACTORY=,SUPPORT_CLASS_VISIBILITY_PUBLIC=true - */ -package org.dojo.jsl.parser.ast; - -import org.w3c.dom.Document; -import org.w3c.dom.Element; - -import larac.objects.Variable; - -public class ASTAroundApply extends SimpleNode { - private String name; - private String when; - private ASTJavaScript js; - private ASTApply apply; - - public ASTAroundApply(int id) { - super(id); - } - - public ASTAroundApply(LARAEcmaScript p, int id) { - super(p, id); - } - - public void setName(String name) { - this.name = name; - } - - public String getName() { - return name; - } - - /** - * @param when - * the when to set - */ - public void setWhen(String when) { - this.when = when; - } - - /** - * @return the when - */ - public String getWhen() { - return when; - } - - @Override - public String toString() { - return LARAEcmaScriptTreeConstants.jjtNodeName[id] + " [" + name + "," + when + "]"; - } - - @Override - public Object organize(Object obj) { - // final ASTAspectDef aspectDef = ((ASTAspectDef) obj); - final ASTAspectDef aspectDef = getAspectDefForDeclStmt("Around apply"); - setJs(null); - - if (getChildren().length == 1) { - if (getWhen().equals("before")) { - aspectDef.setLastbeforeWithNoLabel(this); - } else { - final ASTApply astApply = aspectDef.getLastApplyDecl(); - if (astApply == null) { - getLara().warnln("No apply for the after statement. This statement will not take place."); - return null; - } - astApply.setAfter(this); - } - setJs((ASTJavaScript) getChildren()[0]); - } else { - ((ASTApplies) getChildren()[0]).organize(this); - setJs((ASTJavaScript) getChildren()[1]); - } - if (getWhen().equals("before")) { - js.organize(this); - } - return null; - } - - @Override - public void toXML(Document doc, Element parent) { - if (((SimpleNode) getChildren()[getChildren().length - 1]).children == null) { - return; - } - final Element codeEl = doc.createElement("code"); - - if (getWhen().equals("before")) { - codeEl.setAttribute("desc", "before"); - } else { - codeEl.setAttribute("desc", "after"); - } - parent.appendChild(codeEl); - ((SimpleNode) getChildren()[getChildren().length - 1]).toXML(doc, codeEl); - } - - /** - * @param js - * the js to set - */ - public void setJs(ASTJavaScript js) { - this.js = js; - } - - /** - * @return the js - */ - public ASTJavaScript getJs() { - return js; - } - - /** - * @param apply - * the apply to set - */ - public void setApply(ASTApply apply) { - this.apply = apply; - } - - /** - * @return the apply - */ - public ASTApply getApply() { - return apply; - } - - @Override - public Variable lookup(String var) { - - if (getWhen().equals("after")) { - ASTJavaScript localJS = (ASTJavaScript) apply.getChildren()[1]; - if (localJS.getHMVars().containsKey(var)) { - final Variable v = localJS.getHMVars().get(var); - return v; - } - final SimpleNode before = apply.getBefore(); - if (before != null) { - localJS = (ASTJavaScript) before.getChildren()[0]; - if (localJS.getHMVars().containsKey(var)) { - final Variable v = localJS.getHMVars().get(var); - return v; - } - } - final Variable v = super.lookup(var); - if (v == null) { - throw newException("'" + var + "' is undefined for 'after' apply '" + apply.getName() + "'"); - } - return v; - } - return super.lookup(var); - } - - @Override - public Variable lookupNoError(String var) { - if (getWhen().equals("after")) { - ASTJavaScript localJS = (ASTJavaScript) apply.getChildren()[1]; - if (localJS.getHMVars().containsKey(var)) { - final Variable v = localJS.getHMVars().get(var); - return v; - } - final SimpleNode before = apply.getBefore(); - if (before != null) { - localJS = (ASTJavaScript) before.getChildren()[0]; - if (localJS.getHMVars().containsKey(var)) { - final Variable v = localJS.getHMVars().get(var); - return v; - } - } - } - return super.lookupNoError(var); - } - - private boolean first = true; - - public void organizeForApply(ASTApply astApply) { - setApply(astApply); - if (first) { - first = false; - js.organize(this); - } else { - js.secondOrganize(null); - } - setApply(null); - } - -} -/* - * JavaCC - OriginalChecksum=b3dd2ec6505ff47e381b776339c261d0 (do not edit this - * line) - */ diff --git a/LARAC/src/org/dojo/jsl/parser/ast/ASTArrayLiteral.java b/LARAC/src/org/dojo/jsl/parser/ast/ASTArrayLiteral.java deleted file mode 100644 index 51d7ebbc0..000000000 --- a/LARAC/src/org/dojo/jsl/parser/ast/ASTArrayLiteral.java +++ /dev/null @@ -1,72 +0,0 @@ -/* Generated By:JJTree: Do not edit this line. ASTArrayLiteral.java Version 4.3 */ -/* - * JavaCCOptions:MULTI=true,NODE_USES_PARSER=false,VISITOR=false,TRACK_TOKENS=false,NODE_PREFIX=AST,NODE_EXTENDS=, - * NODE_FACTORY=,SUPPORT_CLASS_VISIBILITY_PUBLIC=true - */ -package org.dojo.jsl.parser.ast; - -import org.w3c.dom.Document; -import org.w3c.dom.Element; - -import larac.objects.Enums.Types; - -public class ASTArrayLiteral extends SimpleNode { - public ASTArrayLiteral(int id) { - super(id); - } - - public ASTArrayLiteral(LARAEcmaScript p, int id) { - super(p, id); - } - - @Override - public Object organize(Object obj) { - if (children != null) { - for (final Node child : children) { - ((SimpleNode) child).organize(obj); - } - } - return null; - } - - @Override - public Types getExpressionType() { - // TODO Auto-generated method stub - return Types.Array; - } - - @Override - public void toXML(Document doc, Element parent) { - int count = 0; - final Element litArray = doc.createElement("literal"); - litArray.setAttribute("type", Types.Array.toString()); - parent.appendChild(litArray); - if (children != null) { - for (final Node child : children) { - if (child instanceof ASTEmptyPositions) { - final int emptyPoss = ((ASTEmptyPositions) child).getCount(); - for (int i = count; i < count + emptyPoss; i++) { - final Element propertyEl = doc.createElement("key"); - propertyEl.setAttribute("name", "" + i); - litArray.appendChild(propertyEl); - /* - * Element emptyExpr = doc.createElement("expression"); - * propertyEl.appendChild(emptyExpr); - */ - } - count += emptyPoss; - continue; - } - final Element propertyEl = doc.createElement("key"); - propertyEl.setAttribute("name", "" + count); - litArray.appendChild(propertyEl); - ((SimpleNode) child).toXML(doc, propertyEl); - count++; - } - } - } -} -/* - * JavaCC - OriginalChecksum=9c60781d05feb5378330379cb23c2f61 (do not edit this - * line) - */ diff --git a/LARAC/src/org/dojo/jsl/parser/ast/ASTArrowFunctionExpression.java b/LARAC/src/org/dojo/jsl/parser/ast/ASTArrowFunctionExpression.java deleted file mode 100644 index 51b86ed07..000000000 --- a/LARAC/src/org/dojo/jsl/parser/ast/ASTArrowFunctionExpression.java +++ /dev/null @@ -1,121 +0,0 @@ -/* Generated By:JJTree: Do not edit this line. ASTArrowFunctionExpression.java Version 4.3 */ -/* - * JavaCCOptions:MULTI=true,NODE_USES_PARSER=false,VISITOR=false,TRACK_TOKENS=true,NODE_PREFIX=AST,NODE_EXTENDS=, - * NODE_FACTORY=,SUPPORT_CLASS_VISIBILITY_PUBLIC=true - */ -package org.dojo.jsl.parser.ast; - -import java.util.ArrayList; -import java.util.List; - -import org.w3c.dom.Document; -import org.w3c.dom.Element; - -import larac.objects.Enums.Types; - -public class ASTArrowFunctionExpression extends SimpleNode { - // private LinkedHashMap args = new LinkedHashMap<>(); - private final List params = new ArrayList<>(); - private Types myType = Types.ArrowFN; - private int pos = 0; - private boolean toXML = true; - - private static final int PARAM_LIST_IDX = 0; - private static final int BODY_IDX = 1; - - public ASTArrowFunctionExpression(int id) { - super(id); - } - - public ASTArrowFunctionExpression(LARAEcmaScript p, int id) { - super(p, id); - } - - @Override - public Object organize(Object obj) { - // System.out.println("ARROW F:\n" + dumpToString("")); - - if (!(children[0] instanceof ASTFormalParameterList)) { - throw newException("Cannot declare an arrow function without a parameter list."); - } - - final ASTFormalParameterList paramList = ((ASTFormalParameterList) children[PARAM_LIST_IDX]); - if (paramList.children != null) { - for (final Node argChild : paramList.children) { - final String argName = ((ASTIdentifier) argChild).value.toString(); - // if (args.containsKey(argName)) { - // throw newException( - // "Function \"" + funcName + "\" contains variables with the same name: " + argName); - // } - // final Variable argVar = new Variable(argName); - // args.put(argName, argVar); - params.add(argName); - } - } - - var body = children[BODY_IDX]; - // System.out.println("BODY CLASS: " + body.getClass()); - // System.out.println("DUMP: " + ((SimpleNode) body).dumpToString("")); - - // Code to execute - ((SimpleNode) children[BODY_IDX]).organize(obj); - ((SimpleNode) children[BODY_IDX]).insertTag = false; - - /* - } else { - if (children[0] instanceof ASTIdentifier) { - funcName = ((ASTIdentifier) children[0]).value.toString(); - pos++; - } - final ASTFormalParameterList paramList = ((ASTFormalParameterList) children[pos]); - if (paramList.children != null) { - for (final Node argChild : paramList.children) { - final String argName = ((ASTIdentifier) argChild).value.toString(); - if (args.containsKey(argName)) { - throw newException("Function expression contains variables with the same name: " + argName); - } - final Variable argVar = new Variable(argName); - args.put(argName, argVar); - params.add(argName); - } - } - ((SimpleNode) children[++pos]).organize(obj); - ((SimpleNode) children[pos]).insertTag = false; - } - */ - return obj; - } - - @Override - public void toXML(Document doc, Element parent) { - - if (!toXML) { - return; - } - - final Element opEl = doc.createElement("op"); - opEl.setAttribute("name", "ArrowFN"); - parent.appendChild(opEl); - // Element litEl = doc.createElement("literal"); - // litEl.setAttribute("value", funcName); - // litEl.setAttribute("type", Types.String.toString()); - // opEl.appendChild(litEl); - // for (final String id : args.keySet()) { - for (final String id : params) { - Element litEl = doc.createElement("literal"); - litEl.setAttribute("value", id); - litEl.setAttribute("type", Types.String.toString()); - opEl.appendChild(litEl); - } - ((SimpleNode) children[BODY_IDX]).toXML(doc, opEl); - toXML = false; - - } - - @Override - public Types getExpressionType() { - return Types.ArrowFN; - } - -} -/* JavaCC - OriginalChecksum=acb0bcefa142160f1b60353031289f5b (do not edit this line) */ diff --git a/LARAC/src/org/dojo/jsl/parser/ast/ASTAspectDef.java b/LARAC/src/org/dojo/jsl/parser/ast/ASTAspectDef.java deleted file mode 100644 index b8c2da479..000000000 --- a/LARAC/src/org/dojo/jsl/parser/ast/ASTAspectDef.java +++ /dev/null @@ -1,593 +0,0 @@ -/* Generated By:JJTree: Do not edit this line. ASTAspectDef.java Version 4.3 */ -/* - * JavaCCOptions:MULTI=true,NODE_USES_PARSER=false,VISITOR=false,TRACK_TOKENS=false,NODE_PREFIX=AST,NODE_EXTENDS=, - * NODE_FACTORY=,SUPPORT_CLASS_VISIBILITY_PUBLIC=true - */ -package org.dojo.jsl.parser.ast; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.LinkedHashMap; -import java.util.Map; - -import org.w3c.dom.Document; -import org.w3c.dom.Element; - -import larac.LaraC; -import larac.objects.Enums.Types; -import larac.objects.SymbolTable; -import larac.objects.Variable; - -public class ASTAspectDef extends SimpleNode { - private String name; - private String referenceName; - private LaraC lara; - private int selectCount = 0; - private int applyCount = 0; - private int conditionCount = 0; - private ASTSelect lastSelectWithNoLabel = null; - private ASTApply lastApplyWithNoLabel = null; - private ASTAroundApply lastBeforeWithNoLabel = null; - private final SymbolTable selects = new SymbolTable<>(); - private ASTCheck check; - private ASTInitialize initialize; - private ASTFinalize finalize; - private final ArrayList applies = new ArrayList<>(); - private final SymbolTable conditions = new SymbolTable<>(); - private Variable staticVar; - private final ArrayList nodeList = new ArrayList<>(); - private LinkedHashMap inputs = new LinkedHashMap<>(); - - private SymbolTable outputs = new SymbolTable<>(); - private SymbolTable localVars = new SymbolTable<>(); - private ASTStatic Static; - private ASTInput inputsNode; - private ASTOutput outputsNode; - - private static enum StatementJump { - ASTAroundApply, - ASTCondition, - ASTInput, - ASTStatic, - ASTInitialize, - ASTFinalize, - ASTCheck, - ASTOutput; - - public static boolean contains(String member) { - - if (member != null) { - for (final StatementJump b : StatementJump.values()) { - if (member.equalsIgnoreCase(b.name())) { - return true; - } - } - } - return false; - } - } - - public ASTApply findApplyByName(String name) { - for (final SimpleNode apply : applies) { - if (apply instanceof ASTApply) { - if (apply.value.toString().equals(name)) { - return (ASTApply) apply; - } - } - } - return null; - } - - public ArrayList getApplies() { - return applies; - } - - public ASTAspectDef(int id) { - super(id); - } - - public ASTAspectDef(LARAEcmaScript p, int id) { - super(p, id); - } - - public void setName(String image) { - name = image; - value = name; - } - - public String getName() { - return name; - } - - @Override - public Object organize(Object obj) { - if (getChildren() == null) { - return null; - } - - for (int i = 0; i < getChildren().length; i++) { - final SimpleNode node = getChild(i); - if (!StatementJump.contains(node.getClass().getSimpleName())) { - nodeList.add(i); - } - node.organize(this); - - } - for (final String var : localVars.keySet()) { - if (inputs.containsKey(var) || outputs.containsKey(var) - || (Static != null && Static.getLocalVars().containsKey(var))) { - throw newException("Duplicate local var: \"" + var + "\"on aspectdef \"" + getName() + "\""); - } - } - - // for(int i: pos){ - // ((SimpleNode)getChildren()[i]).organize(this,nullSelect); - // } - - if (lastBeforeWithNoLabel != null) { - getLara().warnln("No apply for the before statement. This statement will not take place."); - } - return null; - } - - public int getSelectCount() { - return selectCount++; - } - - public void setSelectCount(int selectCount) { - this.selectCount = selectCount; - } - - /** - * @return the lara - */ - @Override - public LaraC getLara() { - if (lara == null) { - return super.getLara(); - } - return lara; - } - - /** - * @param lara - * the lara to set - */ - public void setLara(LaraC lara) { - this.lara = lara; - } - - public int getApplyCount() { - return applyCount++; - } - - public void setApplyCount(int applyCount) { - this.applyCount = applyCount; - } - - public ASTSelect getLastSelectWithNoLabel() { - return lastSelectWithNoLabel; - } - - public void setLastSelectWithNoLabel(ASTSelect lastSelectWithNoLabel) { - this.lastSelectWithNoLabel = lastSelectWithNoLabel; - } - - public ASTApply getLastApplyWithNoLabel() { - return lastApplyWithNoLabel; - } - - public void setLastApplyWithNoLabel(ASTApply lastApplyWithNoLabel) { - this.lastApplyWithNoLabel = lastApplyWithNoLabel; - } - - public ASTSelect putSelect(String string, ASTSelect astSelect) { - return selects.put(string, astSelect); - } - - public ASTSelect getSelect(String string) { - return selects.get(string); - } - - public String printIR() { - - lara.println("aspectdef \"" + getName() + "\""); - lara.println("Inputs:"); - lara.println("---------------------------------------------------"); - for (final Variable var : inputs.values()) { - var.printIR(); - } - lara.println("Outputs:"); - lara.println("---------------------------------------------------"); - for (final Variable var : outputs.values()) { - var.printIR(); - } - lara.println("---------------------------------------------------"); - lara.println("Local Variables:"); - lara.println("---------------------------------------------------"); - for (final Variable var : localVars.values()) { - var.printIR(); - } - lara.println("---------------------------------------------------"); - return null; - } - - public int compare(ASTAspectDef o) { - if (name.equals(o.getName())) { - return 0; - } - return -1; - } - - /* - * @Override public boolean equals(Object obj) { if (obj instanceof - * ASTAspectDef) return equals((ASTAspectDef) obj); return - * super.equals(obj); } - */ - /* - * public boolean equals(ASTAspectDef o) { if (name.equals(o.getName())) - * return true; return false; } - */ - @Override - public int hashCode() { - final int prime = 31; - int result = 1; - result = prime * result + ((name == null) ? 0 : name.hashCode()); - return result; - } - - @Override - public boolean equals(Object obj) { - if (this == obj) { - return true; - } - if (obj == null) { - return false; - } - if (getClass() != obj.getClass()) { - return false; - } - final ASTAspectDef other = (ASTAspectDef) obj; - if (name == null) { - if (other.name != null) { - return false; - } - } else if (!name.equals(other.name)) { - return false; - } - return true; - } - - public void putApply(ASTApply astApply) { - applies.add(astApply); - } - - public ASTCondition putCondition(String string, ASTCondition astCondition) { - return conditions.put(string, astCondition); - } - - public HashMap getInputs() { - return inputs; - } - - public void setInputs(LinkedHashMap inputs) { - this.inputs = inputs; - } - - public HashMap getOutputs() { - return outputs; - } - - public void setOutputs(SymbolTable outputs) { - this.outputs = outputs; - } - - public int getConditionCount() { - return conditionCount++; - } - - public ASTCondition getCondition(String name) { - return conditions.get(name); - } - - @Override - public void toXML(Document doc, Element root) { - final Element aspectEl = doc.createElement("aspect"); - aspectEl.setAttribute("name", lara.getPrefix() + getName()); - aspectEl.setAttribute("coord", getCoords()); - addXMLComent(aspectEl); - root.appendChild(aspectEl); - - final Element parameterEl = doc.createElement("parameters"); - - if (inputsNode != null) { - final Element inputEl = doc.createElement("input"); - parameterEl.appendChild(inputEl); - createInputXMLDecl(inputsNode.getChild(0), inputs, doc, inputEl); - } - if (outputsNode != null) { - final Element outputEl = doc.createElement("output"); - parameterEl.appendChild(outputEl); - createInputXMLDecl(outputsNode.getChild(0), outputs, doc, outputEl); - } - if (parameterEl.getChildNodes().getLength() > 0) { - aspectEl.appendChild(parameterEl); - } - if (Static != null) { - Static.toXML(doc, aspectEl); - } - if (initialize != null) { - initialize.toXML(doc, aspectEl); - } - if (check != null) { - check.toXML(doc, aspectEl); - } - - for (final int i : nodeList) { - ((SimpleNode) children[i]).toXML(doc, aspectEl); - } - /* - * for(ASTSelect select: selects.values()) select.toXML(doc,aspectEl); - * for(SimpleNode apply: applies) apply.toXML(doc,aspectEl); - */ - if (finalize != null) { - finalize.toXML(doc, aspectEl); - } - } - - protected void createInputXMLDecl(SimpleNode simpleNode, Map vars, Document doc, Element parent) { - if (simpleNode instanceof ASTVariableDeclarationList) { - for (SimpleNode node : simpleNode.getSimpleNodeChildren()) { - ASTVariableDeclaration varDecl = (ASTVariableDeclaration) node; - createInputXMLDecl(varDecl, vars.get(varDecl.getIdName()), doc, parent); - } - } else { - ASTVariableDeclaration varDecl = (ASTVariableDeclaration) simpleNode; - createInputXMLDecl(varDecl, vars.get(varDecl.getIdName()), doc, parent); - } - } - - protected void createInputXMLDecl(ASTVariableDeclaration simpleNode, Variable var, Document doc, - Element parent) { - final Element paramEl = doc.createElement("parameter"); - paramEl.setAttribute("name", var.getName()); - parent.appendChild(paramEl); - paramEl.setAttribute("type", var.getType().toString()); - if (simpleNode.jjtGetNumChildren() > 1) { - simpleNode.getChild(1).toXML(doc, paramEl); - } - } - - /** - * @param localVars - * the localVars to set - */ - public void setLocalVars(SymbolTable localVars) { - this.localVars = localVars; - } - - /** - * @return the localVars - */ - public HashMap getLocalVars() { - return localVars; - } - - @Override - public Variable lookup(String var) { - if (inputs.containsKey(var)) { - return inputs.get(var); - } - if (outputs.containsKey(var)) { - return outputs.get(var); - } - - if (initialize != null) { - final HashMap initVars = ((SimpleNode) initialize.getChildren()[0]).getHMVars(); - if (initVars.containsKey(var)) { - return initVars.get(var); - } - } - - if (localVars.containsKey(var)) { - return localVars.get(var); - } - - if (Static != null) { - final Variable retVar = Static.lookupStatic(var); - - if (retVar != null) { - return retVar; - } - } - - return ((SimpleNode) parent).lookup(var); - } - - @Override - public Variable lookupNoError(String var) { - if (inputs.containsKey(var)) { - return inputs.get(var); - } - if (outputs.containsKey(var)) { - return outputs.get(var); - } - if (initialize != null) { - - final HashMap initVars = ((SimpleNode) initialize.getChildren()[0]).getHMVars(); - - if (initVars.containsKey(var)) { - return initVars.get(var); - } - - } - - if (localVars.containsKey(var)) { - return localVars.get(var); - } - if (Static != null) { - final Variable retVar = Static.lookupNoErrorStatic(var); - if (retVar != null) { - return retVar; - } - } - - return ((SimpleNode) parent).lookupNoError(var); - } - - public boolean containsCondition(String name2) { - return conditions.containsKey(name2); - } - - @Override - public HashMap getHMVars() { - return localVars; - } - - /** - * @param initialize - * the initialize to set - */ - public void setInitialize(ASTInitialize initialize) { - this.initialize = initialize; - } - - /** - * @return the initialize - */ - public ASTInitialize getInitialize() { - return initialize; - } - - /** - * @param finalize - * the finalize to set - */ - public void setFinalize(ASTFinalize finalize) { - this.finalize = finalize; - } - - /** - * @return the finalize - */ - public ASTFinalize getFinalize() { - return finalize; - } - - /** - * @param lastbeforeWithNoLabel - * the lastbeforeWithNoLabel to set - */ - public void setLastbeforeWithNoLabel(ASTAroundApply lastbeforeWithNoLabel) { - lastBeforeWithNoLabel = lastbeforeWithNoLabel; - } - - /** - * @return the lastbeforeWithNoLabel - */ - public ASTAroundApply getLastbeforeWithNoLabel() { - final ASTAroundApply ret = lastBeforeWithNoLabel; - lastBeforeWithNoLabel = null; - return ret; - } - - public ASTApply getLastApplyDecl() { - for (int i = applies.size() - 1; i > -1; i--) { - if (applies.get(i) instanceof ASTApply) { - return (ASTApply) applies.get(i); - } - } - return null; - } - - /** - * @param check - * the check to set - */ - public void setCheck(ASTCheck check) { - this.check = check; - } - - /** - * @return the check - */ - public ASTCheck getCheck() { - return check; - } - - public void setStatic(ASTStatic astStatic) { - Static = astStatic; - } - - public ASTStatic getStatic() { - return Static; - } - - public void createAspect(LaraC lara) { - this.lara = lara; - lara.aspectIR().addAspectDef(name, this); - if (getChildren() == null) { - return; - } - /* - for (Node child : getChildren()) { - if (child instanceof ASTInput || - child instanceof ASTOutput) { - ((SimpleNode) child).organize(this); - } - } - */ - } - - public Variable getStaticVar() { - return staticVar; - } - - public void createVar() { - String nameWithPrefix = lara.getPrefix() + name; - // final ASTAllocationExpression alloc = newAllocExpr(nameWithPrefix); - - staticVar = new Variable(nameWithPrefix, Types.AspectSTATIC); - // System.out.println("STATIC VAR CREATED: " + nameWithPrefix); - // staticVar.setInitialize(alloc); - } - - public String getCompleteName() { - return lara.getPrefix() + name; - } - - /** - * @param referenceName - * the referenceName to set - */ - public void setReferenceName(String referenceName) { - this.referenceName = referenceName; - } - - /** - * @return the referenceName - */ - public String getReferenceName() { - return referenceName; - } - - public ASTInput getInputsNode() { - return inputsNode; - } - - public void setInputsNode(ASTInput inputsNode) { - this.inputsNode = inputsNode; - } - - public ASTOutput getOutputsNode() { - return outputsNode; - } - - public void setOutputsNode(ASTOutput outputsNode) { - this.outputsNode = outputsNode; - } -} -/* - * JavaCC - OriginalChecksum=598b7423db12e3e7552f7955c92efea9 (do not edit this - * line) - */ diff --git a/LARAC/src/org/dojo/jsl/parser/ast/ASTAssignmentExpression.java b/LARAC/src/org/dojo/jsl/parser/ast/ASTAssignmentExpression.java deleted file mode 100644 index 6c7b3db5a..000000000 --- a/LARAC/src/org/dojo/jsl/parser/ast/ASTAssignmentExpression.java +++ /dev/null @@ -1,102 +0,0 @@ -/* Generated By:JJTree: Do not edit this line. ASTAssignmentExpression.java Version 4.3 */ -/* - * JavaCCOptions:MULTI=true,NODE_USES_PARSER=false,VISITOR=false,TRACK_TOKENS=false,NODE_PREFIX=AST,NODE_EXTENDS=, - * NODE_FACTORY=,SUPPORT_CLASS_VISIBILITY_PUBLIC=true - */ -package org.dojo.jsl.parser.ast; - -import java.util.HashMap; - -import org.w3c.dom.Document; -import org.w3c.dom.Element; - -import larac.LaraC; -import larac.objects.Variable; - -public class ASTAssignmentExpression extends SimpleNode { - public ASTAssignmentExpression(int id) { - super(id); - } - - public ASTAssignmentExpression(LARAEcmaScript p, int id) { - super(p, id); - } - - public SimpleNode solveInitializeAssignment(HashMap vars) { - final String operator = ((ASTOperator) getChild(1)).value.toString(); - final String varName = getChild(0).value.toString(); - - if (!operator.equals("=")) { - throw newException("Variable initizalization only supports the assignment operator \"=\"\n" + "\tUsed: \"" - + operator + "\" for variable \"" + varName + "\""); - } - SimpleNode rhs = getChild(2); - if (!(rhs instanceof ASTAssignmentExpression)) { - if (vars.containsKey(varName)) { - throw newException("Variable '" + varName + "' already defined on this scope"); - } - - vars.put(varName, new Variable(varName));// , expr)); - return rhs; - } - final ASTAssignmentExpression assignExpr = getChildAs(2, ASTAssignmentExpression.class); - final SimpleNode expr = assignExpr.solveInitializeAssignment(vars); - if (vars.containsKey(varName)) { - throw newException("Variable '" + varName + "' already defined on this scope"); - } - vars.put(varName, new Variable(varName)); - expr.organize(this); - return expr; - } - - @Override - public void declareGlobal(LaraC lara) { - organize(null); - getLara().aspectIR().addGlobalStatement(this, lara.getLaraPath()); - } - - @Override - public Object organize(Object obj) { - final SimpleNode assignee = getChild(0); - final ASTOperator operator = getChildAs(1, ASTOperator.class); - final SimpleNode assignment = getChild(2); - operator.organize(this); - assignment.organize(this); - assignee.organizeLHS(assignment.getExpressionType()); - return null; - } - - @Override - public void globalToXML(Document doc, Element parent) { - final Element statEl = doc.createElement("declaration"); - statEl.setAttribute("name", "expr"); - statEl.setAttribute("coord", getCoords()); - addXMLComent(statEl); - parent.appendChild(statEl); - final Element exprEl = doc.createElement("expression"); - statEl.appendChild(exprEl); - toXML(doc, exprEl); - } - - @Override - public void toXML(Document doc, Element parent) { - - final SimpleNode assignee = getChild(0); - final ASTOperator operator = getChildAs(1, ASTOperator.class); - final SimpleNode assignment = getChild(2); - final Element assignEl = doc.createElement("op"); - // addCoords(assignEl); - parent.appendChild(assignEl); - assignEl.setAttribute("name", operator.getTag()); - assignee.toXML(doc, assignEl); - if (assignment instanceof ASTAction) { - ((ASTAction) assignment).actionExprToXML(doc, assignEl, false); - } else { - assignment.toXML(doc, assignEl); - } - } -} -/* - * JavaCC - OriginalChecksum=53aa17881f524d3978dc513d5dc2e458 (do not edit this - * line) - */ diff --git a/LARAC/src/org/dojo/jsl/parser/ast/ASTBinaryExpressionSequence.java b/LARAC/src/org/dojo/jsl/parser/ast/ASTBinaryExpressionSequence.java deleted file mode 100644 index 6ed159343..000000000 --- a/LARAC/src/org/dojo/jsl/parser/ast/ASTBinaryExpressionSequence.java +++ /dev/null @@ -1,115 +0,0 @@ -/* Generated By:JJTree: Do not edit this line. ASTBinaryExpressionSequence.java Version 4.3 */ -/* - * JavaCCOptions:MULTI=true,NODE_USES_PARSER=false,VISITOR=false,TRACK_TOKENS=false,NODE_PREFIX=AST,NODE_EXTENDS=, - * NODE_FACTORY=,SUPPORT_CLASS_VISIBILITY_PUBLIC=true - */ -package org.dojo.jsl.parser.ast; - -import org.w3c.dom.Document; -import org.w3c.dom.Element; - -import larac.objects.Enums.Types; - -public class ASTBinaryExpressionSequence extends SimpleNode { - private Types maxType; - - public ASTBinaryExpressionSequence(int id) { - super(id); - } - - public ASTBinaryExpressionSequence(LARAEcmaScript p, int id) { - super(p, id); - } - - @Override - public Object organize(Object obj) { - final SimpleNode left = getChild(0); - left.organize(this); - // Types lastType = maxType = left.getExpressionType(); - for (int i = 1; i < getChildren().length; i += 2) { - final ASTOperator operator = (ASTOperator) getChild(i); - operator.organize(this); - final SimpleNode right = getChild(i + 1); - right.organize(this); - /* - * if(BinaryOperator.valueOf(operator.getTag()).ordinal() > - * BinaryOperator.DIV.ordinal()) - * operator.setReturnType(Types.Boolean); else - * operator.setReturnType(lastType, right.getExpressionType()); - * lastType = right.getExpressionType(); maxType = - * Types.maxType(maxType, lastType); - */ - } - return obj; - } - - @Override - public Types getExpressionType() { - SimpleNode simpleNode = getChild(0); - Types aType = simpleNode.getExpressionType(); - maxType = aType; - - // Types lastType = maxType = left.getExpressionType(); - for (int i = 2; i < getChildren().length; i += 2) { - - final SimpleNode right = getChild(i); - maxType = Types.maxType(maxType, right.getExpressionType()); - - /* - * if(BinaryOperator.valueOf(operator.getTag()).ordinal() > - * BinaryOperator.DIV.ordinal()) - * operator.setReturnType(Types.Boolean); else - * operator.setReturnType(lastType, right.getExpressionType()); - * lastType = right.getExpressionType(); maxType = - * Types.maxType(maxType, lastType); - */ - } - - return maxType; - } - - @Override - public void toXML(Document doc, Element parent) { - final SimpleNode left = getChild(0); - - ASTOperator operator = (ASTOperator) getChild(1); - SimpleNode right = getChild(2); - Element opEl = doc.createElement("op"); - - opEl.setAttribute("name", operator.getTag()); - - left.toXML(doc, opEl); - right.toXML(doc, opEl); - int i = 3; - while (i < getChildren().length) { - operator = (ASTOperator) jjtGetChild(i++); - final Element newOpEl = doc.createElement("op"); - newOpEl.setAttribute("name", operator.getTag()); - newOpEl.appendChild(opEl); - opEl = newOpEl; - right = getChild(i++); - right.toXML(doc, opEl); - } - parent.appendChild(opEl); - return; - } - - @Override - public String toSource(int indentation) { - String source = indent(indentation); - final SimpleNode left = getChild(0); - source += left.toSource(); - - for (int i = 1; i < getChildren().length; i += 2) { - final ASTOperator operator = (ASTOperator) getChild(i); - source += " " + operator.toSource(); - final SimpleNode right = getChild(i + 1); - source += " " + right.toSource(); - } - return source; - } -} -/* - * JavaCC - OriginalChecksum=736ce1af49de3893fa2eaa79beb25df2 (do not edit this - * line) - */ diff --git a/LARAC/src/org/dojo/jsl/parser/ast/ASTBlock.java b/LARAC/src/org/dojo/jsl/parser/ast/ASTBlock.java deleted file mode 100644 index b0a0501a7..000000000 --- a/LARAC/src/org/dojo/jsl/parser/ast/ASTBlock.java +++ /dev/null @@ -1,108 +0,0 @@ -/* Generated By:JJTree: Do not edit this line. ASTBlock.java Version 4.3 */ -/* - * JavaCCOptions:MULTI=true,NODE_USES_PARSER=false,VISITOR=false,TRACK_TOKENS=false,NODE_PREFIX=AST,NODE_EXTENDS=, - * NODE_FACTORY=,SUPPORT_CLASS_VISIBILITY_PUBLIC=true - */ -package org.dojo.jsl.parser.ast; - -import org.w3c.dom.Document; -import org.w3c.dom.Element; - -public class ASTBlock extends SimpleNode { - // private SymbolTable localVars = new SymbolTable(); - public ASTBlock(int id) { - super(id); - } - - public ASTBlock(LARAEcmaScript p, int id) { - super(p, id); - } - - @Override - public Object organize(Object obj) { - if (getChildren() != null) { - for (final Node child : getChildren()) { - ((SimpleNode) child).organize(obj); - } - } - return null; - } - - /* - * public Variable lookup(String var) { if(localVars.containsKey(var)) - * return localVars.get(var); return ((SimpleNode)parent).lookup(var); } - * - * public Variable lookupNoError(String var) { - * if(localVars.containsKey(var)) return localVars.get(var); return - * ((SimpleNode)parent).lookupNoError(var); } - * - * @Override public HashMap getHMVars() { return - * localVars; } - */ - private static enum NodeJump { - ASTForVarStatement, - ASTForStatement, - ASTForVarInStatement, - ASTDoStatement, - ASTWhileStatement, - ASTIfStatement, - ASTWithStatement, - ASTTryStatement, - ASTCatchClause, - ASTFinallyClause; - - public static boolean contains(String member) { - if (member != null) { - for (final NodeJump b : NodeJump.values()) { - if (member.equalsIgnoreCase(b.name())) { - return true; - } - } - } - return false; - } - } - - @Override - public void toXML(Document doc, Element parent) { - Element blockEl; - if (!insertTag) { - blockEl = doc.createElement("body"); - parent.appendChild(blockEl); - } else { - if (NodeJump.contains(this.parent.getClass().getSimpleName())) { - if (getChildren() == null) { - return; - } - // createXMLDecl(localVars.values(), doc, parent); - for (final Node child : getChildren()) { - ((SimpleNode) child).toXML(doc, parent); - } - return; - } - blockEl = doc.createElement("code"); - final Element statEl = doc.createElement("statement"); - if (!label.isEmpty()) { - statEl.setAttribute("label", label); - } - statEl.setAttribute("name", "block"); - statEl.setAttribute("coord", getCoords()); - parent.appendChild(statEl); - statEl.appendChild(blockEl); - } - - if (getChildren() == null) { - return; - } - // createXMLDecl(localVars.values(), doc, blockEl); - for (final Node child : getChildren()) { - ((SimpleNode) child).toXML(doc, blockEl); - } - } - -} -/* - * JavaCC - OriginalChecksum=9ca6e0cd015ff970c7956a2598421534 (do not edit this - * line) - */ diff --git a/LARAC/src/org/dojo/jsl/parser/ast/ASTBreakStatement.java b/LARAC/src/org/dojo/jsl/parser/ast/ASTBreakStatement.java deleted file mode 100644 index bad222d9a..000000000 --- a/LARAC/src/org/dojo/jsl/parser/ast/ASTBreakStatement.java +++ /dev/null @@ -1,54 +0,0 @@ -/* Generated By:JJTree: Do not edit this line. ASTBreakStatement.java Version 4.3 */ -/* - * JavaCCOptions:MULTI=true,NODE_USES_PARSER=false,VISITOR=false,TRACK_TOKENS=false,NODE_PREFIX=AST,NODE_EXTENDS=, - * NODE_FACTORY=,SUPPORT_CLASS_VISIBILITY_PUBLIC=true - */ -package org.dojo.jsl.parser.ast; - -import org.w3c.dom.Document; -import org.w3c.dom.Element; - -public class ASTBreakStatement extends SimpleNode { - private String targetLabel = ""; - - public ASTBreakStatement(int id) { - super(id); - } - - public ASTBreakStatement(LARAEcmaScript p, int id) { - super(p, id); - } - - @Override - public Object organize(Object obj) { - if (children != null) { - targetLabel = ((ASTIdentifier) children[0]).value.toString(); - if (targetLabel.startsWith("#")) { - return null; - } - if (lookupLabel(targetLabel) == null) { - throw newException("Label \"" + targetLabel + "\" does not exist."); - } - } - return null; - } - - @Override - public void toXML(Document doc, Element parent) { - final Element breakEl = doc.createElement("statement"); - breakEl.setAttribute("name", "break"); - breakEl.setAttribute("coord", getCoords()); - final Element exprEl = doc.createElement("expression"); - breakEl.appendChild(exprEl); - if (!targetLabel.isEmpty()) { - final Element idEl = doc.createElement("id"); - idEl.setAttribute("name", targetLabel); - exprEl.appendChild(idEl); - } - parent.appendChild(breakEl); - } -} -/* - * JavaCC - OriginalChecksum=7d2ce2261e1f80d7976629a6225e61c1 (do not edit this - * line) - */ diff --git a/LARAC/src/org/dojo/jsl/parser/ast/ASTCall.java b/LARAC/src/org/dojo/jsl/parser/ast/ASTCall.java deleted file mode 100644 index a8575bf83..000000000 --- a/LARAC/src/org/dojo/jsl/parser/ast/ASTCall.java +++ /dev/null @@ -1,243 +0,0 @@ -/* Generated By:JJTree: Do not edit this line. ASTCall.java Version 4.3 */ -/* - * JavaCCOptions:MULTI=true,NODE_USES_PARSER=false,VISITOR=false,TRACK_TOKENS=false,NODE_PREFIX=AST,NODE_EXTENDS=, - * NODE_FACTORY=,SUPPORT_CLASS_VISIBILITY_PUBLIC=true - */ -package org.dojo.jsl.parser.ast; - -import java.util.HashMap; - -import org.dojo.jsl.parser.ast.utils.LaraCNodeFactory; -import org.w3c.dom.Document; -import org.w3c.dom.Element; - -import larac.objects.Enums.AssignOperator; -import larac.objects.Enums.Types; -import larac.objects.Variable; -import larac.utils.output.MessageConstants; -import larac.utils.xml.AspectIRFactory; - -public class ASTCall extends SimpleNode { - private String aspName; - private String aspVarName; - private SimpleNode leftHandSideExpression; - - private Variable aspectDeclaration; - private ASTFunctionCallParameters args; - - public ASTCall(int id) { - super(id); - } - - public ASTCall(LARAEcmaScript p, int id) { - super(p, id); - } - - /** - * @param aspName - * the aspName to set - */ - public void setAspName(String aspName) { - this.aspName = aspName; - } - - /** - * @return the aspName - */ - public String getAspName() { - return aspName; - } - - public String getAspVarName() { - return aspVarName; - } - - public void setAspVarName(String aspVarName) { - this.aspVarName = aspVarName; - } - - @Override - public Object organize(Object obj) { - String path = aspName; - if (children != null) { - - int pos = 0; - // If first child is not a list of parameters OR a path to the aspect - if (!(getChild(pos) instanceof ASTFunctionCallParameters || getChild(pos) instanceof ASTFilePath)) { - // Then is a lefthandside expression - getChild(pos).organize(obj); - // If it is a simple identifier then we are declaring a new variable - if (jjtGetChild(pos) instanceof ASTIdentifier) { - aspVarName = ((ASTIdentifier) jjtGetChild(pos)).getName(); - } else { // otherwise it is some kind of composite reference - leftHandSideExpression = getChild(pos); - } - pos++; - } - // If it has more children - if (pos < children.length) { - // if we have a filepath means that we are statically accessing an aspect - if (jjtGetChild(pos) instanceof ASTFilePath) { - final ASTFilePath filePath = (ASTFilePath) jjtGetChild(pos); - path = ""; - // Concatenate the path to the aspect - for (final Node child : filePath.getChildren()) { - path += ((ASTIdentifier) child).value.toString() + MessageConstants.NAME_SEPARATOR; - } - path += aspName; - pos++; - } - // If more children then these are the arguments - if (pos < children.length) { - args = (ASTFunctionCallParameters) jjtGetChild(pos); - args.organize(obj); - } - } - } - // Verify if the called aspect exists - aspectDeclaration = lookup(path); - - // System.out.println(path + "->" + aspectDeclaration); - if (aspectDeclaration == null && !getLara().getOptions().isDocumentationMode()) { - throw newException("Called aspect/variable does not exist: \"" + aspName + "\""); - } - Types aspectType = aspectDeclaration.getType(); - - /* - // and if it is indeed an aspect - if (!(aspectType.equals(Types.Aspect) || aspectType.equals(Types.AspectSTATIC))) { - throw newException("Called variable is not an aspect: \"" + aspName + "\" is of type: " + aspectType); - } - */ - // If we have a variable declaration then we should add it to the symbol table - if (aspVarName != null) { - - final HashMap vars = getHMVars(); - // if (vars.containsKey(aspVarName)) - // throw newException("Variable '" + aspVarName + "' already defined - // on this scope"); - if (!vars.containsKey(aspVarName)) { - getHMVars().put(aspVarName, new Variable(aspVarName, aspectType)); - } - } - /* - * - * else{ LaraC lara = getLara(); ASTAspectDef asp = - * lara.getAspectDef(aspName); if(asp == null){ asp = - * lara.getImportedAspectDef(aspName); if(asp == null) throw - * newException("The aspect does not exist: "+aspName); } } - * SymbolTable vars = (SymbolTable) - * getHMVars(); this.var = new - * Variable(vars.getUniqueName("FRONTEND_CALL_ASPECT_"+aspName),Types. - * ASPECT); if(getChildren() == null || getChildren()[0] instanceof - * ASTFunctionCallParameters){ Variable var = lookupNoError(aspName); - * - * } return null; } - * - * LaraC lara = getLara(); ASTAspectDef asp = - * lara.getImportedAspectDef(path); if(asp == null) throw newException( - * "The aspect does not exist: "+path); SymbolTable - * vars = (SymbolTable) getHMVars(); this.var = new - * Variable(vars.getUniqueName("FRONTEND_CALL_ASPECT_"+aspName),Types. - * ASPECT); - */ - return null; - } - - @Override - public void toXML(Document doc, Element parent) { - // System.out.println("AspectDeclName: " + aspectDeclaration.getName()); - // System.out.println("AspectDeclType: " + aspectDeclaration.getType()); - - String varName = aspectDeclaration.getName(); - // if (aspectDeclaration.getType() == Types.AspectSTATIC) { - // If using a complex LHS, then wrap the call with an assignment - if (leftHandSideExpression != null) { - final Element statementEl = doc.createElement("statement"); - statementEl.setAttribute("coord", getCoords()); - statementEl.setAttribute("name", "expr"); - parent.appendChild(statementEl); - final Element exprEl = doc.createElement("expression"); - statementEl.appendChild(exprEl); - final Element assignEl = doc.createElement("op"); - assignEl.setAttribute("name", AssignOperator.ASSIGN.name()); - exprEl.appendChild(assignEl); - leftHandSideExpression.toXML(doc, assignEl); - if (aspectDeclaration.getType().equals(Types.AspectSTATIC)) { - ASTAllocationExpression allocExpr = LaraCNodeFactory.newAllocExpr(aspectDeclaration.getName()); - allocExpr.toXML(doc, assignEl); - } else { - aspectDeclaration.toXML(doc, assignEl); - } - - } - // This 'if' assumes all code is present, and that we can obtain the declaration of any aspect - // However, for separate compilation this is not the case. - // Assume that all calls are made over aspects - else if (aspectDeclaration.getType().equals(Types.AspectSTATIC) || true) { - - if (aspVarName != null) { - varName = aspVarName; - } else { - varName = aspectDeclaration.getName() + aspectDeclaration.staticName - + aspectDeclaration.staticCounter++; - } - - SimpleNode initExpr = LaraCNodeFactory.newAllocExpr(aspectDeclaration.getName()); - // if (aspectDeclaration.getType().equals(Types.AspectSTATIC)) { - // } else { - // initExpr = LaraCNodeFactory.newIdentifier(aspectDeclaration.getName()); - // } - AspectIRFactory.varDeclStmtToXML(doc, parent, varName, initExpr, getCoords(), null); - - /* - final Element statementEl = doc.createElement("statement"); - statementEl.setAttribute("coord", getCoords()); - statementEl.setAttribute("name", "vardecl"); - parent.appendChild(statementEl); - - if (aspectDeclaration.getType().equals(Types.AspectSTATIC)) { - ASTAllocationExpression allocExpr = newAllocExpr(aspectDeclaration.getName()); - allocExpr.toXML(doc, statementEl); - } else { - aspectDeclaration.toXML(doc, statementEl); - }*/ - } - - // } - final Element statementEl = doc.createElement("statement"); - statementEl.setAttribute("name", "expr"); - statementEl.setAttribute("coord", getCoords()); - parent.appendChild(statementEl); - final Element expressionEl = doc.createElement("expression"); - statementEl.appendChild(expressionEl); - final Element callEl = doc.createElement("call"); - expressionEl.appendChild(callEl); - final Element methodEl = doc.createElement("method"); - callEl.appendChild(methodEl); - final Element propEl = doc.createElement("property"); - methodEl.appendChild(propEl); - if (leftHandSideExpression != null) { - leftHandSideExpression.toXML(doc, propEl); - } else { - AspectIRFactory.idRef(doc, propEl, varName); - } - final Element litCallEl = doc.createElement("literal"); - litCallEl.setAttribute("type", Types.String.toString()); - litCallEl.setAttribute("value", "call"); - propEl.appendChild(litCallEl); - if (args != null) { - args.toXML(doc, callEl); - } - // aspectDeclaration.setName(varName); - } - - @Override - public String toString() { - return LARAEcmaScriptTreeConstants.jjtNodeName[id] + " [" + aspName + "]"; - } -} -/* - * JavaCC - OriginalChecksum=435ab740a3ff136aeff8f583fff894e4 (do not edit this - * line) - */ diff --git a/LARAC/src/org/dojo/jsl/parser/ast/ASTCaseGroup.java b/LARAC/src/org/dojo/jsl/parser/ast/ASTCaseGroup.java deleted file mode 100644 index ab19a0308..000000000 --- a/LARAC/src/org/dojo/jsl/parser/ast/ASTCaseGroup.java +++ /dev/null @@ -1,53 +0,0 @@ -/* Generated By:JJTree: Do not edit this line. ASTCaseGroup.java Version 4.3 */ -/* - * JavaCCOptions:MULTI=true,NODE_USES_PARSER=false,VISITOR=false,TRACK_TOKENS=false,NODE_PREFIX=AST,NODE_EXTENDS=, - * NODE_FACTORY=,SUPPORT_CLASS_VISIBILITY_PUBLIC=true - */ -package org.dojo.jsl.parser.ast; - -import org.w3c.dom.Document; -import org.w3c.dom.Element; - -public class ASTCaseGroup extends SimpleNode { - public ASTCaseGroup(int id) { - super(id); - } - - public ASTCaseGroup(LARAEcmaScript p, int id) { - super(p, id); - } - - @Override - public Object organize(Object obj) { - for (int i = 0; i < children.length; i++) { - ((SimpleNode) children[i]).organize(obj); - } - return null; - } - - @Override - public void toXML(Document doc, Element parent) { - if (((SimpleNode) children[0]).children != null) { - final Element caseGuard = doc.createElement("expression"); - parent.appendChild(caseGuard); - caseGuard.setAttribute("desc", "case"); - ((SimpleNode) children[0]).toXML(doc, caseGuard); - } - - final Element caseBody = doc.createElement("code"); - parent.appendChild(caseBody); - if (((SimpleNode) children[0]).children == null) { - caseBody.setAttribute("desc", "default"); - } else { - caseBody.setAttribute("desc", "case_body"); - } - if (children.length > 1) { - ((SimpleNode) children[1]).toXML(doc, caseBody); - } - - } -} -/* - * JavaCC - OriginalChecksum=38619f15d78f6fa5a9e5d10df4d3adb6 (do not edit this - * line) - */ diff --git a/LARAC/src/org/dojo/jsl/parser/ast/ASTCaseGroups.java b/LARAC/src/org/dojo/jsl/parser/ast/ASTCaseGroups.java deleted file mode 100644 index 4d7704c73..000000000 --- a/LARAC/src/org/dojo/jsl/parser/ast/ASTCaseGroups.java +++ /dev/null @@ -1,39 +0,0 @@ -/* Generated By:JJTree: Do not edit this line. ASTCaseGroups.java Version 4.3 */ -/* - * JavaCCOptions:MULTI=true,NODE_USES_PARSER=false,VISITOR=false,TRACK_TOKENS=false,NODE_PREFIX=AST,NODE_EXTENDS=, - * NODE_FACTORY=,SUPPORT_CLASS_VISIBILITY_PUBLIC=true - */ -package org.dojo.jsl.parser.ast; - -import org.w3c.dom.Document; -import org.w3c.dom.Element; - -public class ASTCaseGroups extends SimpleNode { - public ASTCaseGroups(int id) { - super(id); - } - - public ASTCaseGroups(LARAEcmaScript p, int id) { - super(p, id); - } - - @Override - public Object organize(Object obj) { - for (int i = 0; i < children.length; i++) { - ((SimpleNode) children[i]).organize(obj); - } - return null; - } - - @Override - public void toXML(Document doc, Element parent) { - for (final Node child : children) { - ((SimpleNode) child).toXML(doc, parent); - } - } - -} -/* - * JavaCC - OriginalChecksum=226233d49a1eac506d313d7e34ec97d9 (do not edit this - * line) - */ diff --git a/LARAC/src/org/dojo/jsl/parser/ast/ASTCaseGuard.java b/LARAC/src/org/dojo/jsl/parser/ast/ASTCaseGuard.java deleted file mode 100644 index 6e9c3f3fe..000000000 --- a/LARAC/src/org/dojo/jsl/parser/ast/ASTCaseGuard.java +++ /dev/null @@ -1,39 +0,0 @@ -/* Generated By:JJTree: Do not edit this line. ASTCaseGuard.java Version 4.3 */ -/* - * JavaCCOptions:MULTI=true,NODE_USES_PARSER=false,VISITOR=false,TRACK_TOKENS=false,NODE_PREFIX=AST,NODE_EXTENDS=, - * NODE_FACTORY=,SUPPORT_CLASS_VISIBILITY_PUBLIC=true - */ -package org.dojo.jsl.parser.ast; - -import org.w3c.dom.Document; -import org.w3c.dom.Element; - -public class ASTCaseGuard extends SimpleNode { - public ASTCaseGuard(int id) { - super(id); - } - - public ASTCaseGuard(LARAEcmaScript p, int id) { - super(p, id); - } - - @Override - public Object organize(Object obj) { - if (children != null) { - for (int i = 0; i < children.length; i++) { - ((SimpleNode) children[i]).organize(obj); - } - } - return null; - } - - @Override - public void toXML(Document doc, Element parent) { - ((SimpleNode) children[0]).toXML(doc, parent); - } - -} -/* - * JavaCC - OriginalChecksum=799bec44f37b0399bfed673d6b6ac113 (do not edit this - * line) - */ diff --git a/LARAC/src/org/dojo/jsl/parser/ast/ASTCatchClause.java b/LARAC/src/org/dojo/jsl/parser/ast/ASTCatchClause.java deleted file mode 100644 index 0cc75e973..000000000 --- a/LARAC/src/org/dojo/jsl/parser/ast/ASTCatchClause.java +++ /dev/null @@ -1,66 +0,0 @@ -/* Generated By:JJTree: Do not edit this line. ASTCatchClause.java Version 4.3 */ -/* - * JavaCCOptions:MULTI=true,NODE_USES_PARSER=false,VISITOR=false,TRACK_TOKENS=false,NODE_PREFIX=AST,NODE_EXTENDS=, - * NODE_FACTORY=,SUPPORT_CLASS_VISIBILITY_PUBLIC=true - */ -package org.dojo.jsl.parser.ast; - -import org.w3c.dom.Document; -import org.w3c.dom.Element; - -import larac.objects.Enums.Types; -import larac.objects.Variable; - -public class ASTCatchClause extends SimpleNode { - private Variable exception; - - public ASTCatchClause(int id) { - super(id); - } - - public ASTCatchClause(LARAEcmaScript p, int id) { - super(p, id); - } - - @Override - public Object organize(Object obj) { - final String exceptionName = ((SimpleNode) children[0]).value.toString(); - exception = new Variable(exceptionName, Types.Exception); - ((SimpleNode) children[1]).organize(obj); - return null; - } - - @Override - public Variable lookup(String var) { - if (exception.getName().equals(var)) { - return exception; - } - return ((SimpleNode) parent).lookup(var); - } - - @Override - public Variable lookupNoError(String var) { - if (exception.getName().equals(var)) { - return exception; - } - return ((SimpleNode) parent).lookupNoError(var); - } - - @Override - public void toXML(Document doc, Element parent) { - final Element exprEl = doc.createElement("expression"); - exprEl.setAttribute("desc", "catch_id"); - parent.appendChild(exprEl); - final Element idEl = doc.createElement("id"); - idEl.setAttribute("name", exception.getName()); - exprEl.appendChild(idEl); - final Element codeEl = doc.createElement("code"); - codeEl.setAttribute("desc", "catch"); - parent.appendChild(codeEl); - ((SimpleNode) children[1]).toXML(doc, codeEl); - } -} -/* - * JavaCC - OriginalChecksum=b9082663e2a539546622639966ef2f1a (do not edit this - * line) - */ diff --git a/LARAC/src/org/dojo/jsl/parser/ast/ASTCheck.java b/LARAC/src/org/dojo/jsl/parser/ast/ASTCheck.java deleted file mode 100644 index 494f92374..000000000 --- a/LARAC/src/org/dojo/jsl/parser/ast/ASTCheck.java +++ /dev/null @@ -1,63 +0,0 @@ -/* Generated By:JJTree: Do not edit this line. ASTCheck.java Version 4.3 */ -/* - * JavaCCOptions:MULTI=true,NODE_USES_PARSER=false,VISITOR=false,TRACK_TOKENS=false,NODE_PREFIX=AST,NODE_EXTENDS=, - * NODE_FACTORY=,SUPPORT_CLASS_VISIBILITY_PUBLIC=true - */ -package org.dojo.jsl.parser.ast; - -import org.w3c.dom.Document; -import org.w3c.dom.Element; - -public class ASTCheck extends SimpleNode { - public ASTCheck(int id) { - super(id); - } - - public ASTCheck(LARAEcmaScript p, int id) { - super(p, id); - } - - @Override - public Object organize(Object obj) { - if (children == null) { - return null; - } - ((ASTAspectDef) parent).setCheck(this); - for (final Node child : getChildren()) { - ((SimpleNode) child).organize(obj); - } - return null; - } - - @Override - public void toXML(Document doc, Element parent) { - final Element checkEl = doc.createElement("check"); - parent.appendChild(checkEl); - - if (jjtGetNumChildren() == 1) { - ((SimpleNode) children[0]).toXML(doc, checkEl); - return; - } - - Element andEl = doc.createElement("op"); - andEl.setAttribute("name", "AND"); - SimpleNode left = getChild(0); - SimpleNode right = getChild(1); - left.toXML(doc, andEl); - right.toXML(doc, andEl); - for (int i = 2; i < jjtGetNumChildren(); i++) { - Element newAndEl = doc.createElement("op"); - newAndEl.setAttribute("name", "AND"); - newAndEl.appendChild(andEl); - andEl = newAndEl; - SimpleNode child = getChild(i); - child.toXML(doc, andEl); - } - - checkEl.appendChild(andEl); - } -} -/* - * JavaCC - OriginalChecksum=c72555870faf84ea1630fc8784600d0c (do not edit this - * line) - */ diff --git a/LARAC/src/org/dojo/jsl/parser/ast/ASTCmd.java b/LARAC/src/org/dojo/jsl/parser/ast/ASTCmd.java deleted file mode 100644 index e531a53aa..000000000 --- a/LARAC/src/org/dojo/jsl/parser/ast/ASTCmd.java +++ /dev/null @@ -1,208 +0,0 @@ -/* Generated By:JJTree: Do not edit this line. ASTCmd.java Version 4.3 */ -/* - * JavaCCOptions:MULTI=true,NODE_USES_PARSER=false,VISITOR=false,TRACK_TOKENS=false,NODE_PREFIX=AST,NODE_EXTENDS=, - * NODE_FACTORY=,SUPPORT_CLASS_VISIBILITY_PUBLIC=true - */ -package org.dojo.jsl.parser.ast; - -import org.w3c.dom.Document; -import org.w3c.dom.Element; - -import larac.objects.Enums.AssignOperator; -import larac.objects.Enums.Types; -import larac.utils.OrganizeUtils; - -public @SuppressWarnings("all") class ASTCmd extends SimpleNode { - private static final int numOfJSCMDMethod = 4; - private boolean newVersion = false; - - public ASTCmd(int id) { - super(id); - } - - public ASTCmd(LARAEcmaScript p, int id) { - super(p, id); - } - - @Override - public Object organize(Object obj) { - int pos = 0; - if (!(children[pos] instanceof ASTFunctionCallParameters)) { - pos++; - } - - final ASTFunctionCallParameters args = (ASTFunctionCallParameters) children[pos]; - args.organize(obj); - if (args.jjtGetNumChildren() == 0) { - throw newException("No argument was given in 'cmd'. At least a command is required to execute."); - } - - if (newVersion) { - - return null; - } - - final int remainingArgs = ASTCmd.numOfJSCMDMethod - args.jjtGetNumChildren(); - - if (remainingArgs < 0) { - getLara().warnln("A total of " + args.jjtGetNumChildren() - + " arguments was used in the command execution, the required number of arguments are: " - + (ASTCmd.numOfJSCMDMethod - 1) + ". This may lead to issues in the command execution."); - } else if (remainingArgs == 0 && (pos < children.length)) { - getLara().warnln(ASTCmd.numOfJSCMDMethod - + " arguments and a pipe in the 'cmd' method. However, the last argument overrides the used pipe."); - } - - return null; - } - - @Override - public void toXML(Document doc, Element parent) { - final Element statementEl = doc.createElement("statement"); - statementEl.setAttribute("coord", getCoords()); - statementEl.setAttribute("name", "expr"); - parent.appendChild(statementEl); - - final Element exprEl = doc.createElement("expression"); - statementEl.appendChild(exprEl); - int pos = 0; - Element current = exprEl; - if (!(children[pos] instanceof ASTFunctionCallParameters)) { - // Then it is a left hand side expression - final Element opEl = doc.createElement("op"); - opEl.setAttribute("name", AssignOperator.ASSIGN.name()); - exprEl.appendChild(opEl); - ((SimpleNode) children[pos]).toXML(doc, opEl); - pos++; - current = opEl; - } - - final Element callEl = doc.createElement("call"); - current.appendChild(callEl); - final Element methodEl = doc.createElement("method"); - callEl.appendChild(methodEl); - final Element runIDEl = doc.createElement("id"); - runIDEl.setAttribute("name", "cmd"); - methodEl.appendChild(runIDEl); - final ASTFunctionCallParameters args = (ASTFunctionCallParameters) children[pos++]; - - if (isNewVersion()) { - toXMLOfNewVersion(doc, pos, callEl, args); - } else { // old version was used - - toXMLOldVersion(doc, pos, callEl, args); - } - } - - /** - * Generate the arguments of the use of old cmd method - * - * @param doc - * @param pos - * @param callEl - * @param args - */ - private void toXMLOldVersion(Document doc, int pos, Element callEl, ASTFunctionCallParameters args) { - args.toXML(doc, callEl); - final int remainingArgs = ASTCmd.numOfJSCMDMethod - args.jjtGetNumChildren(); - if (remainingArgs <= 0) { - return; - } - - final Element pipeEl = doc.createElement("argument"); - - if (args.areNamed) { - pipeEl.setAttribute("name", "pipe"); - } else { - // Fill the missing arguments with 'undefined' - for (int i = 0; i < remainingArgs - 1; i++) { - final Element argEl = doc.createElement("argument"); - callEl.appendChild(argEl); - OrganizeUtils.createLiteralUndefined(doc, argEl); - } - - } - - // Only appended here so it can be the last argument, including the - // undefined arguments before - callEl.appendChild(pipeEl); - - if (pos < children.length) { - final SimpleNode pipeExpr = (SimpleNode) children[pos]; - pipeExpr.toXML(doc, pipeEl); - } else { - OrganizeUtils.createLiteralUndefined(doc, pipeEl); - } - } - - /** - * Generate the arguments of the use of new cmd method - */ - private void toXMLOfNewVersion(Document doc, int pos, Element callEl, ASTFunctionCallParameters args) { - // Then is the new run version - - setArgumentsAsList(args, doc, callEl); - - Element argEl = doc.createElement("argument"); - argEl.setAttribute("name", "verbose"); - callEl.appendChild(argEl); - final Element litEl = doc.createElement("literal"); - litEl.setAttribute("type", Types.Int.toString()); - litEl.setAttribute("value", String.valueOf(2)); - argEl.appendChild(litEl); - argEl = doc.createElement("argument"); - argEl.setAttribute("name", "pipe"); - callEl.appendChild(argEl); - if (pos < children.length) { - final SimpleNode pipeExpr = (SimpleNode) children[pos]; - pipeExpr.toXML(doc, argEl); - } else { - OrganizeUtils.createLiteralUndefined(doc, argEl); - } - } - - private void setArgumentsAsList(ASTFunctionCallParameters args, Document doc, Element parentEl) { - - Element argEl = doc.createElement("argument"); - argEl.setAttribute("name", "command"); - parentEl.appendChild(argEl); - SimpleNode arg = (SimpleNode) args.jjtGetChild(0); - arg.toXML(doc, argEl); - - argEl = doc.createElement("argument"); - parentEl.appendChild(argEl); - argEl.setAttribute("name", "args"); - final Element litEl = doc.createElement("literal"); - argEl.appendChild(litEl); - - litEl.setAttribute("type", "array"); - for (int i = 1; i < args.getChildren().length; i++) { - arg = (SimpleNode) args.jjtGetChild(i); - final Element keyEl = doc.createElement("key"); - keyEl.setAttribute("name", String.valueOf(i - 1)); - litEl.appendChild(keyEl); - arg.toXML(doc, keyEl); - } - - } - - /** - * @return the newVersion - */ - public boolean isNewVersion() { - return newVersion; - } - - /** - * @param newVersion - * the newVersion to set - */ - public void setNewVersion(boolean newVersion) { - this.newVersion = newVersion; - } - -} -/* - * JavaCC - OriginalChecksum=52fd5a98cc9622d4b30cd075148aab99 (do not edit this - * line) - */ diff --git a/LARAC/src/org/dojo/jsl/parser/ast/ASTCode.java b/LARAC/src/org/dojo/jsl/parser/ast/ASTCode.java deleted file mode 100644 index b3f8a1e2c..000000000 --- a/LARAC/src/org/dojo/jsl/parser/ast/ASTCode.java +++ /dev/null @@ -1,32 +0,0 @@ -/* Generated By:JJTree: Do not edit this line. ASTCode.java Version 4.3 */ -/* - * JavaCCOptions:MULTI=true,NODE_USES_PARSER=false,VISITOR=false,TRACK_TOKENS=false,NODE_PREFIX=AST,NODE_EXTENDS=, - * NODE_FACTORY=,SUPPORT_CLASS_VISIBILITY_PUBLIC=true - */ -package org.dojo.jsl.parser.ast; - -public class ASTCode extends SimpleNode { - private String code; - - public ASTCode(int id) { - super(id); - } - - public ASTCode(LARAEcmaScript p, int id) { - super(p, id); - } - - public void setCode(String code) { - this.code = code; - value = code; - } - - public String getCode() { - return code; - } - -} -/* - * JavaCC - OriginalChecksum=314e7eec637ef7f013baed1066c8ec33 (do not edit this - * line) - */ diff --git a/LARAC/src/org/dojo/jsl/parser/ast/ASTCodeDef.java b/LARAC/src/org/dojo/jsl/parser/ast/ASTCodeDef.java deleted file mode 100644 index ac8e03c90..000000000 --- a/LARAC/src/org/dojo/jsl/parser/ast/ASTCodeDef.java +++ /dev/null @@ -1,292 +0,0 @@ -/* Generated By:JJTree: Do not edit this line. ASTCodeDef.java Version 4.3 */ -/* - * JavaCCOptions:MULTI=true,NODE_USES_PARSER=false,VISITOR=false,TRACK_TOKENS=false,NODE_PREFIX=AST,NODE_EXTENDS=, - * NODE_FACTORY=,SUPPORT_CLASS_VISIBILITY_PUBLIC=true - */ -package org.dojo.jsl.parser.ast; - -import java.io.UnsupportedEncodingException; -import java.util.ArrayList; -import java.util.HashMap; - -import javax.xml.bind.DatatypeConverter; - -import org.w3c.dom.Document; -import org.w3c.dom.Element; - -import larac.LaraC; -import larac.objects.Enums; -import larac.objects.Enums.Types; -import larac.objects.Variable; -import larac.utils.OrganizeUtils; - -public class ASTCodeDef extends SimpleNode { - private String name; - // private String filePath; - private String language; - private String code; - private ArrayList parametersInCode = new ArrayList<>(); - private ArrayList parameters = new ArrayList<>(); - - public ASTCodeDef(int id) { - super(id); - } - - public ASTCodeDef(LARAEcmaScript p, int id) { - super(p, id); - } - - public void setName(String image) { - name = image; - } - - public String getName() { - return name; - } - - /** - * @param language - * the language to set - */ - public void setLanguage(String language) { - this.language = language; - } - - /** - * @return the language - */ - public String getLanguage() { - return language; - } - - /** - * @param code - * the code to set - */ - public void setCode(String code) { - // Remove trailing new lines - if (code.startsWith("\r")) { - code = code.substring(1); - } - if (code.startsWith("\n")) { - code = code.substring(1); - } - - if (code.endsWith("\n")) { - code = code.substring(0, code.length() - 1); - } - if (code.endsWith("\r")) { - code = code.substring(0, code.length() - 1); - } - - this.code = code; - } - - /** - * @return the code - */ - public String getCode() { - return code; - } - - @Override - public String toString() { - return LARAEcmaScriptTreeConstants.jjtNodeName[id] + " [" + name - + /* ","+code+ */"," + language + "]"; - } - - @Override - public void declareGlobal(LaraC lara) { - validateParameters(lara); - lara.aspectIR().addGlobalElement(name, this); - } - - @Override - public Object organize(Object obj) { - final Variable var = new Variable(name, Types.FNDecl); - final HashMap parentVars = ((SimpleNode) parent).getHMVars(); - if (parentVars.containsKey(name)) { - throw newException("Identifier '" + name + "' already in use"); - } - parentVars.put(name, var); - validateParameters(getLara()); - return null; - } - - private void validateParameters(final LaraC lara) { - // lara.aspectIR().addCodeDef(name, this); - - // if(language.equals("native") || language.equals("LARA")) - // ;//TODO transform lara code into target code (lara.language?) - - findParametersInCode(); - if (getChildren() == null) { - if (!parametersInCode.isEmpty()) { - lara.warnln( - " Code parameters in \"" + getName() + "\" will be undefined if no arguments are declared."); - } - return; - } - - final ASTFormalParameterList args = (ASTFormalParameterList) getChildren()[0]; - parameters = args.getArguments(); - verifyCodeParameters(); - } - - private void verifyCodeParameters() { - for (final String paramInCode : parametersInCode) { - if (!parameters.contains(paramInCode)) { - throw newException("Codedef \"" + name + "\" does not contain parameter \"" + paramInCode + "\""); - } - } - - } - - /** - * Searches the string containing the code for parameters\n Those parameters are shown in the AspectIR - */ - private void findParametersInCode() { - parametersInCode = new ArrayList<>(OrganizeUtils.getTagValues(code)); - } - - public String printIR() { - getLara().println("codedef<" + language + "> code \"" + code + "\", parameters: " + parametersInCode - + ", arguments: " + parameters); - return null; - } - - /** - * @return the codeParameters - */ - public ArrayList getCodeParameters() { - return parametersInCode; - } - - /** - * @param codeParameters - * the codeParameters to set - */ - public void setCodeParameters(ArrayList codeParameters) { - parametersInCode = codeParameters; - } - - /** - * @return the arguments - */ - public ArrayList getArguments() { - return parameters; - } - - /** - * @param arguments - * the arguments to set - */ - public void setArguments(ArrayList arguments) { - parameters = arguments; - } - - public int argsLength() { - return parameters.size(); - } - - @Override - public void globalToXML(Document doc, Element parent) { - toXML(doc, parent, "declaration"); - } - - @Override - public void toXML(Document doc, Element parent) { - toXML(doc, parent, "statement"); - - } - - private void toXML(Document doc, Element parent, String elementType) { - final Element statEl = doc.createElement(elementType); - statEl.setAttribute("name", "fndecl"); - statEl.setAttribute("coord", getCoords()); - addXMLComent(statEl); - parent.appendChild(statEl); - final Element exprEl = doc.createElement("expression"); - statEl.appendChild(exprEl); - final Element opEl = doc.createElement("op"); - opEl.setAttribute("name", "FN"); - exprEl.appendChild(opEl); - Element litEl = doc.createElement("literal"); - litEl.setAttribute("value", name); - litEl.setAttribute("type", Types.String.toString()); - opEl.appendChild(litEl); - for (final String argChild : parameters) { - litEl = doc.createElement("literal"); - litEl.setAttribute("value", argChild); - litEl.setAttribute("type", Types.String.toString()); - opEl.appendChild(litEl); - } - final Element bodyEl = doc.createElement("body"); - opEl.appendChild(bodyEl); - final Element returnEl = doc.createElement("statement"); - returnEl.setAttribute("name", "return"); - returnEl.setAttribute("coord", getCoords()); - bodyEl.appendChild(returnEl); - final Element returnExprEl = doc.createElement("expression"); - returnEl.appendChild(returnExprEl); - codeBlock2XML(doc, returnExprEl); - - } - /* - * - - - - - - - - - - - - - - - - - */ - - private void codeBlock2XML(Document doc, Element parent) { - - final Element literalEl = doc.createElement("literal"); - literalEl.setAttribute("type", Types.Object.toString()); - literalEl.setAttribute("desc", Types.Code.toString()); - parent.appendChild(literalEl); - final Element propEl = doc.createElement("key"); - propEl.setAttribute("name", "code"); - literalEl.appendChild(propEl); - addCodeDef(doc, propEl); - - for (final String prop : parametersInCode) { - final Element propertyKeyEl = doc.createElement("key"); - literalEl.appendChild(propertyKeyEl); - propertyKeyEl.setAttribute("name", Enums.SYMBOL_BEGIN + prop + Enums.SYMBOL_END); - final Element idEl = doc.createElement("id"); - propertyKeyEl.appendChild(idEl); - idEl.setAttribute("name", prop); - } - } - - private void addCodeDef(Document doc, final Element propEl) { - final Element stringEl = doc.createElement("literal"); - stringEl.setAttribute("type", Types.Code.toString()); - propEl.appendChild(stringEl); - try { - final String codeBase64 = DatatypeConverter.printBase64Binary(code.getBytes("UTF-8")); - stringEl.setAttribute("value", codeBase64); - } catch (final UnsupportedEncodingException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - } -} -/* - * JavaCC - OriginalChecksum=43cf3768fe8173b715404b4f3d29764c (do not edit this - * line) - */ diff --git a/LARAC/src/org/dojo/jsl/parser/ast/ASTCompositeReference.java b/LARAC/src/org/dojo/jsl/parser/ast/ASTCompositeReference.java deleted file mode 100644 index 777d94676..000000000 --- a/LARAC/src/org/dojo/jsl/parser/ast/ASTCompositeReference.java +++ /dev/null @@ -1,344 +0,0 @@ -/* Generated By:JJTree: Do not edit this line. ASTCompositeReference.java Version 4.3 */ -/* - * JavaCCOptions:MULTI=true,NODE_USES_PARSER=false,VISITOR=false,TRACK_TOKENS=false,NODE_PREFIX=AST,NODE_EXTENDS=, - * NODE_FACTORY=,SUPPORT_CLASS_VISIBILITY_PUBLIC=true - */ -package org.dojo.jsl.parser.ast; - -import java.util.ArrayList; -import java.util.LinkedHashMap; - -import org.w3c.dom.Document; -import org.w3c.dom.Element; - -import larac.LaraC; -import larac.objects.Enums.Types; -import larac.objects.Variable; -import larac.utils.output.MessageConstants; - -public class ASTCompositeReference extends SimpleNode { - private int endOfFirst = 0; - - private final ArrayList codeParams = new ArrayList<>(); - private final LinkedHashMap codeMapping = new LinkedHashMap<>(); - - public ASTCompositeReference(int id) { - super(id); - } - - public ASTCompositeReference(LARAEcmaScript p, int id) { - super(p, id); - } - - @Override - public Object organize(Object obj) { - // if (isTemplate) { - // if (!(children[0] instanceof ASTIdentifier) || !(children[1] instanceof ASTFunctionCallParameters)) { - // throw newException( - // "When using actions, parameters of type 'template' can only be of type: \n\t-> literal string\n\t-> literal - // code\n\t-> codedef"); - // } - // final String codeName = ((ASTIdentifier) jjtGetChild(0)).value.toString(); - // codeDef = getLara().aspectIR().getCodedef(codeName); - // if (codeDef == null) { - // throw newException("Codedef '" + codeName + "' does not exist."); - // } - // - // for (final String arg : codeDef.getArguments()) { - // codeMapping.put(arg, null); - // } - // final ASTFunctionCallParameters params = (ASTFunctionCallParameters) jjtGetChild(1); - // organizeArguments(params); - // return obj; - // } - final LaraC lara = getLara(); - // if (parent instanceof ASTExpressionStatement) - // if (actionReview()) - // return obj; - // if (!(children[0] instanceof ASTCompositeReference)) { - // lara.aspectIR().setCompositeReference(this); - // } - int pos = 0; - if ((children[0] instanceof ASTThisReference)) { - pos = 1; - } - final Object childObj = ((SimpleNode) children[pos]).organize(obj); - // lara.aspectIR().setCompositeReference(null); - if (childObj instanceof ASTPointcut && children.length == 2) { - final ASTPointcut pc = (ASTPointcut) childObj; - if (parent instanceof ASTCompositeReference) { - if (((ASTCompositeReference) parent).children[1] instanceof ASTFunctionCallParameters) { - ((SimpleNode) children[1]).organizeActionReference(pc); - } - } else { - ((SimpleNode) children[1]).organizePointcutReference(pc); - } - } else { - for (int i = pos + 1; i < children.length; i++) { - ((SimpleNode) children[i]).organize(obj); - } - } - - return obj; - } - - // private boolean actionReview() { - // if (children[children.length - 1] instanceof ASTFunctionCallParameters) { - // SimpleNode methodId = (SimpleNode) children[children.length - 2]; - // ASTFunctionCallParameters params = (ASTFunctionCallParameters) - // children[children.length - 1]; - // LaraC lara = getLara(); - // if (methodId instanceof ASTCompositeReference) { - // methodId = (SimpleNode) methodId.children[methodId.children.length - 1]; - // } - // if (methodId instanceof ASTPropertyIdentifierReference) { - // methodId = (SimpleNode) methodId.children[0]; - // } - // if (methodId instanceof ASTIdentifier) { - // String method = ((ASTIdentifier) methodId).getName(); - // LanguageSpecification languageSpec = lara.languageSpec(); - // ActionModel actionModel = languageSpec.getActionModel(); - // if (actionModel.contains(method)) { - // Map actionParam = Utils.createPerformParameters( - // actionModel, method); - // ASTFunctionCallParameters newParams = new ASTFunctionCallParameters( - // LARAEcmaScriptTreeConstants.JJTFUNCTIONCALLPARAMETERS); - // if (params.areNamed) { - // for (Node param : params.getChildren()) { - // ASTNamedArgument na = (ASTNamedArgument) param; - // if (!actionParam.containsKey(na.value)) - // throw newException("The argument '" + na.value + "' does not exist for - // action '" - // + method + "'"); - // ActionArgument actArg = actionParam.get(na.value); - // actArg.setValue((SimpleNode) na.jjtGetChild(0)); - // } - // } else { - // if (params.children == null) { - // if (actionParam.size() > 0) { - // int given = 0; - // String verb = given == 1 ? "was" : "were"; - // throw newException("Illegal number of arguments in action '" + method + - // ". '" - // + given + "' " + verb + " given, Expected '" - // + actionParam.size() + "'"); - // } - // } else if ((params.children.length != actionParam.size())) { - // int given = params.children.length; - // String verb = given == 1 ? "was" : "were"; - // throw newException("Illegal number of arguments in action '" + method + - // ". '" + given - // + "' " + verb + " given, Expected '" + actionParam.size() + "'"); - // } - // int i = 0; - // for (ActionArgument arg : actionParam.values()) { - // arg.setValue((SimpleNode) params.jjtGetChild(i++)); - // } - // } - // int i = 0; - // for (ActionArgument arg : actionParam.values()) { - // if (arg.getValue() == null) - // throw newException("Argument '" + arg.getName() + "' for action '" + - // method - // + "' must be defined."); - // if (arg.getType().equals("template")) - // arg.getValue().isTemplate = true; - // arg.getValue().organize(this); - // newParams.associateChild(arg.getValue(), i++); - // } - // associateChild(newParams, children.length - 1); - // if (children.length - 2 == 0) - // return true; - // } - // } - // } - // return false; - // } - - @Override - public void secondOrganize(ASTSelect sel) { - ((SimpleNode) children[0]).secondOrganize(sel); - /* - * for(int i = 1; i < children.length; i++) - * ((SimpleNode)children[i]).secondOrganize(sel); - */ - } - - @Override - public void toXML(Document doc, Element parent) { - final SimpleNode firstChild = (SimpleNode) children[0]; - Element firstEl = doc.createElement("temp"); - firstChild.toXML(doc, firstEl); - firstEl = (Element) firstEl.getChildNodes().item(0); - - for (int i = endOfFirst + 1; i < children.length; i++) { - Element thisEl = null; - if (children[i] instanceof ASTFunctionCallParameters) { - thisEl = doc.createElement("call"); - final Element methodEl = doc.createElement("method"); - methodEl.appendChild(firstEl); - thisEl.appendChild(methodEl); - } else { - thisEl = doc.createElement("property"); - thisEl.appendChild(firstEl); - } - ((SimpleNode) children[i]).toXML(doc, thisEl); - firstEl = thisEl; - } - parent.appendChild(firstEl); - } - - @Override - public Types getExpressionType() { - return Types.Undefined; - } - - public void setEndOfFirst(int child) { - endOfFirst = child; - } - - public void setAlloc(ASTAllocationExpression astAlloc) { - int length = children.length; - if (children[length - 1] instanceof ASTFunctionCallParameters) { - length--; - astAlloc.setArgs((ASTFunctionCallParameters) children[length]); - } - String methodID = ""; - for (int i = 0; i < length; i++) { - methodID += MessageConstants.NAME_SEPARATOR + ((SimpleNode) children[i]).getMethodId(); - } - astAlloc.setMethodID(methodID.substring(1)); - } - - @Override - public String getMethodId() { - String methodId = ""; - for (final Node child : children) { - methodId += MessageConstants.NAME_SEPARATOR + ((SimpleNode) child).getMethodId(); - } - return methodId.substring(1); - } - - @Override - public void organizeLHS(Types type) { - if (children[0] instanceof ASTThisReference) { - return; - } - final String varName = getVarName(); - Variable var = null; - if (varName.startsWith("$")) { - var = new Variable(varName, Types.Joinpoint); - } else if (varName.startsWith("@")) { - var = new Variable(varName); - } else { - final SimpleNode father = (SimpleNode) parent; - var = father.lookup(varName); - } - if (var == null) { - throw newException("'" + value + "' is undefined"); - } - setIdVar(var); - } - - @Override - public String toSource(int indentation) { - String code = indent(indentation) + getChild(0).toSource(0); - // if ((children[0] instanceof ASTThisReference)) { - // code += "this"; - // } - for (int i = 1; i < children.length; i++) { - code += "." + getChild(i).toSource(0); - } - return code; - } - - @Override - public String getVarName() { - int pos = 0; - if (children[0] instanceof ASTThisReference) { - pos = 1; - } - return ((SimpleNode) children[pos]).getVarName(); - } - - @Override - public void setIdVar(Variable var) { - int pos = 0; - if (children[0] instanceof ASTThisReference) { - pos = 1; - } - ((SimpleNode) children[pos]).setIdVar(var); - } - - /* - private void organizeArguments(ASTFunctionCallParameters astFunctionCallParameters) { - if (astFunctionCallParameters.areNamed) { - for (final Node node : astFunctionCallParameters.getChildren()) { - final ASTNamedArgument named = (ASTNamedArgument) node; - - ((SimpleNode) named.getChildren()[0]).organize(this); - codeMapping.put(named.value.toString(), (SimpleNode) named.getChildren()[0]); - } - } else { - for (final Node node : astFunctionCallParameters.getChildren()) { - final String arg = getParamWithNoValue(); - ((SimpleNode) node).organize(this); - codeMapping.put(arg, (SimpleNode) node); - } - } - - for (final SimpleNode sn : codeMapping.values()) { - if (sn == null) { - String unsigned = ""; - for (final String nulls : codeMapping.keySet()) { - if (codeMapping.get(nulls) == null) { - unsigned += nulls + ","; - } - } - unsigned = unsigned.substring(0, unsigned.length() - 1); - throw newException("In Action using codedef '" + codeDef.getName() - + "': not all codedef arguments are set: " + unsigned); - } - } - } - - private String getParamWithNoValue() { - for (final String param : codeMapping.keySet()) { - if (codeMapping.get(param) == null) { - return param; - } - } - return null; - } - - @Override - public void toXMLTemplate(Document doc, Element parent) { - throw new RuntimeException("This method is deprecated and should not be invoked!"); - - final Element literalEl = doc.createElement("literal"); - literalEl.setAttribute("type", Types.Object.toString()); - parent.appendChild(literalEl); - final Element propEl = doc.createElement("key"); - propEl.setAttribute("name", "'code'"); - literalEl.appendChild(propEl); - final Element stringEl = doc.createElement("literal"); - stringEl.setAttribute("type", Types.String.toString()); - propEl.appendChild(stringEl); - stringEl.setAttribute("value", codeDef.getName() + ".code"); - - for (final String prop : codeMapping.keySet()) { - final SimpleNode replace = codeMapping.get(prop); - final Element propertyKeyEl = doc.createElement("key"); - literalEl.appendChild(propertyKeyEl); - propertyKeyEl.setAttribute("name", Enums.SYMBOL_BEGIN + prop + Enums.SYMBOL_END); - replace.toXML(doc, propertyKeyEl); - } - codeTemplateArgumentsToXML(doc, literalEl, codeParams); - - } */ - -} -/* - * JavaCC - OriginalChecksum=4bff27c8421e69659ace3e1a4342cb99 (do not edit this - * line) - */ diff --git a/LARAC/src/org/dojo/jsl/parser/ast/ASTCondition.java b/LARAC/src/org/dojo/jsl/parser/ast/ASTCondition.java deleted file mode 100644 index 935d77db9..000000000 --- a/LARAC/src/org/dojo/jsl/parser/ast/ASTCondition.java +++ /dev/null @@ -1,68 +0,0 @@ -/* Generated By:JJTree: Do not edit this line. ASTCondition.java Version 4.3 */ -/* - * JavaCCOptions:MULTI=true,NODE_USES_PARSER=false,VISITOR=false,TRACK_TOKENS=false,NODE_PREFIX=AST,NODE_EXTENDS=, - * NODE_FACTORY=,SUPPORT_CLASS_VISIBILITY_PUBLIC=true - */ -package org.dojo.jsl.parser.ast; - -import org.w3c.dom.Document; -import org.w3c.dom.Element; - -public class ASTCondition extends SimpleNode { - - public ASTCondition(int id) { - super(id); - } - - public ASTCondition(LARAEcmaScript p, int id) { - super(p, id); - } - - @Override - public Object organize(Object obj) { - // final ASTAspectDef aspectDef = ((ASTAspectDef) obj); - final ASTAspectDef aspectDef = this.getAspectDefForDeclStmt("Condition"); - - if (getChildren().length == 1) { // The For Node does not exist, - // lastApplyWithNoLabel - final ASTApply apply = aspectDef.getLastApplyWithNoLabel(); - if (apply == null) { - throw newException("No apply exists before the condition!"); - } - final ASTFor astFor = new ASTFor(33); - final ASTIdentifier id = new ASTIdentifier(35); - final SimpleNode condChild = (SimpleNode) getChildren()[0]; - id.jjtSetValue(apply.getName()); - astFor.associateChild(id, 0); - associateChild(astFor, 0); - associateChild(condChild, 1); - } - final ASTFor astFor = (ASTFor) getChildren()[0]; - for (final Node child : astFor.getChildren()) { - final ASTIdentifier id = (ASTIdentifier) child; - final ASTApply apply = aspectDef.findApplyByName(id.value.toString()); - if (apply == null) { - throw newException("The apply \"" + id.value + "\" cannot be found"); - } - apply.setCondition(this); - apply.organizeCondition(); - if (aspectDef.putCondition(apply.getName(), this) != null) { - throw newException("Condition for '" + apply.getName() + "' already defined."); - } - - } - return null; - } - - @Override - public void toXML(Document doc, Element parent) { - final Element condEl = doc.createElement("expression"); - parent.appendChild(condEl); - condEl.setAttribute("desc", condEl.getAttribute("name") + "_condition"); - ((SimpleNode) getChildren()[1]).toXML(doc, condEl); - } -} -/* - * JavaCC - OriginalChecksum=3a902eaa20b3a304d9421568aaf582d9 (do not edit this - * line) - */ diff --git a/LARAC/src/org/dojo/jsl/parser/ast/ASTConditionalExpression.java b/LARAC/src/org/dojo/jsl/parser/ast/ASTConditionalExpression.java deleted file mode 100644 index 1ad7103d0..000000000 --- a/LARAC/src/org/dojo/jsl/parser/ast/ASTConditionalExpression.java +++ /dev/null @@ -1,41 +0,0 @@ -/* Generated By:JJTree: Do not edit this line. ASTConditionalExpression.java Version 4.3 */ -/* - * JavaCCOptions:MULTI=true,NODE_USES_PARSER=false,VISITOR=false,TRACK_TOKENS=false,NODE_PREFIX=AST,NODE_EXTENDS=, - * NODE_FACTORY=,SUPPORT_CLASS_VISIBILITY_PUBLIC=true - */ -package org.dojo.jsl.parser.ast; - -import org.w3c.dom.Document; -import org.w3c.dom.Element; - -public class ASTConditionalExpression extends SimpleNode { - public ASTConditionalExpression(int id) { - super(id); - } - - public ASTConditionalExpression(LARAEcmaScript p, int id) { - super(p, id); - } - - @Override - public Object organize(Object obj) { - for (final Node child : children) { - ((SimpleNode) child).organize(obj); - } - return null; - } - - @Override - public void toXML(Document doc, Element parent) { - final Element opEl = doc.createElement("op"); - opEl.setAttribute("name", "COND"); - parent.appendChild(opEl); - for (final Node child : children) { - ((SimpleNode) child).toXML(doc, opEl); - } - } -} -/* - * JavaCC - OriginalChecksum=f10fcc7a136035db53470e9701d1a475 (do not edit this - * line) - */ diff --git a/LARAC/src/org/dojo/jsl/parser/ast/ASTContinueStatement.java b/LARAC/src/org/dojo/jsl/parser/ast/ASTContinueStatement.java deleted file mode 100644 index c4ada17ac..000000000 --- a/LARAC/src/org/dojo/jsl/parser/ast/ASTContinueStatement.java +++ /dev/null @@ -1,54 +0,0 @@ -/* Generated By:JJTree: Do not edit this line. ASTContinueStatement.java Version 4.3 */ -/* - * JavaCCOptions:MULTI=true,NODE_USES_PARSER=false,VISITOR=false,TRACK_TOKENS=false,NODE_PREFIX=AST,NODE_EXTENDS=, - * NODE_FACTORY=,SUPPORT_CLASS_VISIBILITY_PUBLIC=true - */ -package org.dojo.jsl.parser.ast; - -import org.w3c.dom.Document; -import org.w3c.dom.Element; - -public class ASTContinueStatement extends SimpleNode { - private String targetLabel = ""; - - public ASTContinueStatement(int id) { - super(id); - } - - public ASTContinueStatement(LARAEcmaScript p, int id) { - super(p, id); - } - - @Override - public Object organize(Object obj) { - if (children != null) { - targetLabel = ((ASTIdentifier) children[0]).value.toString(); - if (targetLabel.startsWith("#")) { - return null; - } - if (lookupLabel(targetLabel) == null) { - throw newException("Label \"" + targetLabel + "\" does not exist."); - } - } - return null; - } - - @Override - public void toXML(Document doc, Element parent) { - final Element continueEl = doc.createElement("statement"); - continueEl.setAttribute("name", "continue"); - continueEl.setAttribute("coord", getCoords()); - final Element exprEl = doc.createElement("expression"); - continueEl.appendChild(exprEl); - if (!targetLabel.isEmpty()) { - final Element idEl = doc.createElement("id"); - idEl.setAttribute("name", targetLabel); - exprEl.appendChild(idEl); - } - parent.appendChild(continueEl); - } -} -/* - * JavaCC - OriginalChecksum=c7cac251633ec6fdde2c2b8e1d56e60c (do not edit this - * line) - */ diff --git a/LARAC/src/org/dojo/jsl/parser/ast/ASTDefine.java b/LARAC/src/org/dojo/jsl/parser/ast/ASTDefine.java deleted file mode 100644 index c4bc52d10..000000000 --- a/LARAC/src/org/dojo/jsl/parser/ast/ASTDefine.java +++ /dev/null @@ -1,146 +0,0 @@ -/* Generated By:JJTree: Do not edit this line. ASTDefine.java Version 4.3 */ -/* - * JavaCCOptions:MULTI=true,NODE_USES_PARSER=false,VISITOR=false,TRACK_TOKENS=false,NODE_PREFIX=AST,NODE_EXTENDS=, - * NODE_FACTORY=,SUPPORT_CLASS_VISIBILITY_PUBLIC=true - */ -package org.dojo.jsl.parser.ast; - -import java.util.Iterator; -import java.util.Map; - -import org.w3c.dom.Document; -import org.w3c.dom.Element; - -import larac.objects.Enums.Types; -import larac.utils.xml.entity.ActionArgument; - -public class ASTDefine extends SimpleNode { - private String target; - private String attr; - private SimpleNode assignment; - - public ASTDefine(int id) { - super(id); - } - - public ASTDefine(LARAEcmaScript p, int id) { - super(p, id); - } - - /** - * @param target - * the target to set - */ - public void setTarget(String target) { - this.target = target; - } - - /** - * @return the target - */ - public String getTarget() { - return target; - } - - @Override - public String toString() { - return LARAEcmaScriptTreeConstants.jjtNodeName[id] + " [" + target + "]"; - } - - @Override - /* FIXME */ - public Object organize(Object obj) { - - // LaraC larac = getLara(); - // if (!larac.languageSpec().getActionModel().contains("def")) - // throw newException("Action 'def' is not available."); - final ASTAction act = (ASTAction) parent; - act.setMethod("def"); - act.setArguments(getLara().getOrganizer().createDefParameters()); - final Map arguments = act.getArguments(); - if (jjtGetChild(0) instanceof ASTFunctionCallParameters) { - final ASTFunctionCallParameters params = (ASTFunctionCallParameters) jjtGetChild(0); - if (params.areNamed) { - for (final Node param : params.getChildren()) { - final ASTNamedArgument na = (ASTNamedArgument) param; - if (!arguments.containsKey(na.value)) { - throw newException("The argument '" + na.value + "' does not exist for action 'def'"); - } - final ActionArgument actArg = arguments.get(na.value); - na.organize(obj); - actArg.setValue((SimpleNode) na.jjtGetChild(0)); - } - } else { - if (params.getChildren() == null || params.getChildren().length != arguments.size()) { - throw newException("Illegal number of arguments for action 'def'"); - } - int pos = 0; - for (final ActionArgument actArg : arguments.values()) { - actArg.setValue((SimpleNode) params.jjtGetChild(pos++)); - } - } - } else { - if (!(children[0] instanceof ASTIdentifier)) { - throw newException("The joinpoint 'def' action can only have an identifier in the left hand side!"); - } - - final Iterator it = arguments.values().iterator(); - it.next().setValue(((ASTIdentifier) children[0]).value.toString()); - assignment = ((SimpleNode) children[1]); - assignment.organize(obj); - it.next().setValue(assignment); - // arguments.get("value").setValue(assignment); - } - return null; - } - - @Override - public void toXML(Document doc, Element parent) { - - final Element statEl = doc.createElement("statement"); - statEl.setAttribute("name", "expr"); - statEl.setAttribute("coord", getCoords()); - parent.appendChild(statEl); - final Element exprEl = doc.createElement("expression"); - statEl.appendChild(exprEl); - final Element callEl = doc.createElement("call"); - exprEl.appendChild(callEl); - - final Element methodEl = doc.createElement("method"); - callEl.appendChild(methodEl); - final Element propertyEl = doc.createElement("property"); - methodEl.appendChild(propertyEl); - - String jpTarget = ""; - final ASTApply apply = (ASTApply) getParentById(LARAEcmaScriptTreeConstants.JJTAPPLY); - if (((SimpleNode) this.parent).value != null) { - jpTarget = ((SimpleNode) this.parent).value.toString(); - } else { - jpTarget = apply.getSelectLastJPVar(); - } - - final Element idEl = doc.createElement("id"); - idEl.setAttribute("name", jpTarget); - idEl.setAttribute("type", Types.Joinpoint.toString()); - propertyEl.appendChild(idEl); - final Element literalDefEl = doc.createElement("literal"); - literalDefEl.setAttribute("value", "def"); - literalDefEl.setAttribute("type", Types.String.toString()); - propertyEl.appendChild(literalDefEl); - - final Element arg1El = doc.createElement("argument"); - callEl.appendChild(arg1El); - final Element literalTypeEl = doc.createElement("literal"); - literalTypeEl.setAttribute("value", attr); - literalTypeEl.setAttribute("type", Types.String.toString()); - arg1El.appendChild(literalTypeEl); - - final Element arg2El = doc.createElement("argument"); - callEl.appendChild(arg2El); - assignment.toXML(doc, arg2El); - } -} -/* - * JavaCC - OriginalChecksum=13cc41d6a267e0c9ef2669bd1422a111 (do not edit this - * line) - */ diff --git a/LARAC/src/org/dojo/jsl/parser/ast/ASTDoStatement.java b/LARAC/src/org/dojo/jsl/parser/ast/ASTDoStatement.java deleted file mode 100644 index 1a6b03e35..000000000 --- a/LARAC/src/org/dojo/jsl/parser/ast/ASTDoStatement.java +++ /dev/null @@ -1,56 +0,0 @@ -/* Generated By:JJTree: Do not edit this line. ASTDoStatement.java Version 4.3 */ -/* - * JavaCCOptions:MULTI=true,NODE_USES_PARSER=false,VISITOR=false,TRACK_TOKENS=false,NODE_PREFIX=AST,NODE_EXTENDS=, - * NODE_FACTORY=,SUPPORT_CLASS_VISIBILITY_PUBLIC=true - */ -package org.dojo.jsl.parser.ast; - -import org.w3c.dom.Document; -import org.w3c.dom.Element; - -import larac.objects.Enums; - -public class ASTDoStatement extends SimpleNode { - public ASTDoStatement(int id) { - super(id); - } - - public ASTDoStatement(LARAEcmaScript p, int id) { - super(p, id); - } - - @Override - public Object organize(Object obj) { - for (int i = 0; i < children.length; i++) { - ((SimpleNode) children[i]).organize(obj); - } - return null; - } - - @Override - public void toXML(Document doc, Element parent) { - final Element stmtEl = doc.createElement("statement"); - stmtEl.setAttribute("name", "loop"); - stmtEl.setAttribute("desc", Enums.LoopTypes.DO.toString()); - stmtEl.setAttribute("coord", getCoords()); - if (!label.isEmpty()) { - stmtEl.setAttribute("label", label); - } - parent.appendChild(stmtEl); - - final Element codeEl = doc.createElement("code"); - codeEl.setAttribute("desc", "body"); - stmtEl.appendChild(codeEl); - ((SimpleNode) children[0]).toXML(doc, codeEl); - - final Element conditionEl = doc.createElement("expression"); - conditionEl.setAttribute("desc", "condition"); - stmtEl.appendChild(conditionEl); - ((SimpleNode) children[1]).toXML(doc, conditionEl); - } - -} -/* - * JavaCC - OriginalChecksum=897d48445d115989cc12cd03d158c619 (do not edit this - * line) - */ diff --git a/LARAC/src/org/dojo/jsl/parser/ast/ASTEmptyExpression.java b/LARAC/src/org/dojo/jsl/parser/ast/ASTEmptyExpression.java deleted file mode 100644 index affe4a8b3..000000000 --- a/LARAC/src/org/dojo/jsl/parser/ast/ASTEmptyExpression.java +++ /dev/null @@ -1,32 +0,0 @@ -/* Generated By:JJTree: Do not edit this line. ASTEmptyExpression.java Version 4.3 */ -/* - * JavaCCOptions:MULTI=true,NODE_USES_PARSER=false,VISITOR=false,TRACK_TOKENS=false,NODE_PREFIX=AST,NODE_EXTENDS=, - * NODE_FACTORY=,SUPPORT_CLASS_VISIBILITY_PUBLIC=true - */ -package org.dojo.jsl.parser.ast; - -import org.w3c.dom.Document; -import org.w3c.dom.Element; - -public class ASTEmptyExpression extends SimpleNode { - public ASTEmptyExpression(int id) { - super(id); - } - - public ASTEmptyExpression(LARAEcmaScript p, int id) { - super(p, id); - } - - @Override - public Object organize(Object obj) { - return null; - } - - @Override - public void toXML(Document doc, Element parent) { - } -} -/* - * JavaCC - OriginalChecksum=c2bec030feafd4d42271955a4767fe69 (do not edit this - * line) - */ diff --git a/LARAC/src/org/dojo/jsl/parser/ast/ASTEmptyPositions.java b/LARAC/src/org/dojo/jsl/parser/ast/ASTEmptyPositions.java deleted file mode 100644 index 751cd9104..000000000 --- a/LARAC/src/org/dojo/jsl/parser/ast/ASTEmptyPositions.java +++ /dev/null @@ -1,51 +0,0 @@ -/* Generated By:JJTree: Do not edit this line. ASTElision.java Version 4.3 */ -/* - * JavaCCOptions:MULTI=true,NODE_USES_PARSER=false,VISITOR=false,TRACK_TOKENS=false,NODE_PREFIX=AST,NODE_EXTENDS=, - * NODE_FACTORY=,SUPPORT_CLASS_VISIBILITY_PUBLIC=true - */ -package org.dojo.jsl.parser.ast; - -public class ASTEmptyPositions extends SimpleNode { - private int count = 0; - - public ASTEmptyPositions(int id) { - super(id); - } - - public ASTEmptyPositions(LARAEcmaScript p, int id) { - super(p, id); - } - - public void inc() { - count++; - } - - public void setCount(int count) { - this.count = count; - } - - public int getCount() { - return count; - } - - @Override - public String toString() { - return LARAEcmaScriptTreeConstants.jjtNodeName[id] + " [" + count + "]"; - } - - @Override - public Object organize(Object obj) { - return null; - } - - /* - * @Override public void toXML(Document doc, Element parent) { for(int i=0; - * i< count; i++){ Element undefinedEl = doc.createElement("literal"); - * parent.appendChild(undefinedEl); undefinedEl.setAttribute("type", - * "undefined"); } } - */ -} -/* - * JavaCC - OriginalChecksum=85fc01c554e46918aacba6da481a56c8 (do not edit this - * line) - */ diff --git a/LARAC/src/org/dojo/jsl/parser/ast/ASTEmptyStatement.java b/LARAC/src/org/dojo/jsl/parser/ast/ASTEmptyStatement.java deleted file mode 100644 index 0f8a0f3b8..000000000 --- a/LARAC/src/org/dojo/jsl/parser/ast/ASTEmptyStatement.java +++ /dev/null @@ -1,32 +0,0 @@ -/* Generated By:JJTree: Do not edit this line. ASTEmptyStatement.java Version 4.3 */ -/* - * JavaCCOptions:MULTI=true,NODE_USES_PARSER=false,VISITOR=false,TRACK_TOKENS=false,NODE_PREFIX=AST,NODE_EXTENDS=, - * NODE_FACTORY=,SUPPORT_CLASS_VISIBILITY_PUBLIC=true - */ -package org.dojo.jsl.parser.ast; - -import org.w3c.dom.Document; -import org.w3c.dom.Element; - -public class ASTEmptyStatement extends SimpleNode { - public ASTEmptyStatement(int id) { - super(id); - } - - public ASTEmptyStatement(LARAEcmaScript p, int id) { - super(p, id); - } - - @Override - public Object organize(Object obj) { - return null; - } - - @Override - public void toXML(Document doc, Element parent) { - } -} -/* - * JavaCC - OriginalChecksum=7e1f751f351af514d125ee662e6798cf (do not edit this - * line) - */ diff --git a/LARAC/src/org/dojo/jsl/parser/ast/ASTExpressionList.java b/LARAC/src/org/dojo/jsl/parser/ast/ASTExpressionList.java deleted file mode 100644 index 925bb9070..000000000 --- a/LARAC/src/org/dojo/jsl/parser/ast/ASTExpressionList.java +++ /dev/null @@ -1,51 +0,0 @@ -/* Generated By:JJTree: Do not edit this line. ASTExpressionList.java Version 4.3 */ -/* - * JavaCCOptions:MULTI=true,NODE_USES_PARSER=false,VISITOR=false,TRACK_TOKENS=false,NODE_PREFIX=AST,NODE_EXTENDS=, - * NODE_FACTORY=,SUPPORT_CLASS_VISIBILITY_PUBLIC=true - */ -package org.dojo.jsl.parser.ast; - -import org.w3c.dom.Document; -import org.w3c.dom.Element; - -public class ASTExpressionList extends SimpleNode { - public ASTExpressionList(int id) { - super(id); - } - - public ASTExpressionList(LARAEcmaScript p, int id) { - super(p, id); - } - - @Override - public Object organize(Object obj) { - for (final Node child : getChildren()) { - ((SimpleNode) child).organize(obj); - } - return null; - } - - @Override - public void toXML(Document doc, Element parent) { - final SimpleNode left = (SimpleNode) getChildren()[0]; - SimpleNode right = (SimpleNode) getChildren()[1]; - Element opEl = doc.createElement("op"); - opEl.setAttribute("name", "COMMA"); - left.toXML(doc, opEl); - right.toXML(doc, opEl); - int i = 2; - while (i < getChildren().length) { - final Element newOpEl = doc.createElement("op"); - newOpEl.setAttribute("name", "COMMA"); - newOpEl.appendChild(opEl); - opEl = newOpEl; - right = (SimpleNode) getChildren()[i++]; - right.toXML(doc, opEl); - } - parent.appendChild(opEl); - } -} -/* - * JavaCC - OriginalChecksum=b0c2c08a1c8fb2da59ad8e381622575c (do not edit this - * line) - */ diff --git a/LARAC/src/org/dojo/jsl/parser/ast/ASTExpressionStatement.java b/LARAC/src/org/dojo/jsl/parser/ast/ASTExpressionStatement.java deleted file mode 100644 index 4e7123dd6..000000000 --- a/LARAC/src/org/dojo/jsl/parser/ast/ASTExpressionStatement.java +++ /dev/null @@ -1,54 +0,0 @@ -/* Generated By:JJTree: Do not edit this line. ASTExpressionStatement.java Version 4.3 */ -/* - * JavaCCOptions:MULTI=true,NODE_USES_PARSER=false,VISITOR=false,TRACK_TOKENS=false,NODE_PREFIX=AST,NODE_EXTENDS=, - * NODE_FACTORY=,SUPPORT_CLASS_VISIBILITY_PUBLIC=true - */ -package org.dojo.jsl.parser.ast; - -import org.w3c.dom.Document; -import org.w3c.dom.Element; - -public class ASTExpressionStatement extends SimpleNode { - public ASTExpressionStatement(int id) { - super(id); - } - - public ASTExpressionStatement(LARAEcmaScript p, int id) { - super(p, id); - } - - @Override - public Object organize(Object obj) { - for (final Node child : getChildren()) { - ((SimpleNode) child).organize(obj); - } - return null; - } - - @Override - public void toXML(Document doc, Element parent) { - for (final Node child : getChildren()) { - - if (!insertTag) { - ((SimpleNode) child).toXML(doc, parent); - continue; - } - final Element statEl = doc.createElement("statement"); - addXMLComent(statEl); - statEl.setAttribute("coord", getCoords()); - if (!label.isEmpty()) { - statEl.setAttribute("label", label); - } - parent.appendChild(statEl); - statEl.setAttribute("name", "expr"); - - final Element exprEl = doc.createElement("expression"); - statEl.appendChild(exprEl); - ((SimpleNode) child).toXML(doc, exprEl); - } - } -} -/* - * JavaCC - OriginalChecksum=b35cf230ca3a5f40e973934bf7137de1 (do not edit this - * line) - */ diff --git a/LARAC/src/org/dojo/jsl/parser/ast/ASTFilePath.java b/LARAC/src/org/dojo/jsl/parser/ast/ASTFilePath.java deleted file mode 100644 index fea7c0710..000000000 --- a/LARAC/src/org/dojo/jsl/parser/ast/ASTFilePath.java +++ /dev/null @@ -1,21 +0,0 @@ -/* Generated By:JJTree: Do not edit this line. ASTFilePath.java Version 4.3 */ -/* - * JavaCCOptions:MULTI=true,NODE_USES_PARSER=false,VISITOR=false,TRACK_TOKENS=false,NODE_PREFIX=AST,NODE_EXTENDS=, - * NODE_FACTORY=,SUPPORT_CLASS_VISIBILITY_PUBLIC=true - */ -package org.dojo.jsl.parser.ast; - -public @SuppressWarnings("all") class ASTFilePath extends SimpleNode { - public ASTFilePath(int id) { - super(id); - } - - public ASTFilePath(LARAEcmaScript p, int id) { - super(p, id); - } - -} -/* - * JavaCC - OriginalChecksum=df6115dbbe0fb927a6088321e1af3714 (do not edit this - * line) - */ diff --git a/LARAC/src/org/dojo/jsl/parser/ast/ASTFilter.java b/LARAC/src/org/dojo/jsl/parser/ast/ASTFilter.java deleted file mode 100644 index 59cb7d55a..000000000 --- a/LARAC/src/org/dojo/jsl/parser/ast/ASTFilter.java +++ /dev/null @@ -1,109 +0,0 @@ -/* Generated By:JJTree: Do not edit this line. ASTFilter.java Version 4.3 */ -/* - * JavaCCOptions:MULTI=true,NODE_USES_PARSER=false,VISITOR=false,TRACK_TOKENS=false,NODE_PREFIX=AST,NODE_EXTENDS=, - * NODE_FACTORY=,SUPPORT_CLASS_VISIBILITY_PUBLIC=true - */ -package org.dojo.jsl.parser.ast; - -import org.lara.language.specification.dsl.LanguageSpecificationV2; -import org.w3c.dom.Document; -import org.w3c.dom.Element; - -public class ASTFilter extends SimpleNode { - private String prop; - private String op; - private String attrType; - - public ASTFilter(int id) { - super(id); - } - - public ASTFilter(LARAEcmaScript p, int id) { - super(p, id); - } - - public void setProp(String image) { - prop = image; - } - - public void setOp(String image) { - op = image; - } - - public String getProp() { - return prop; - } - - public String getOp() { - return op; - } - - @Override - public String toString() { - return LARAEcmaScriptTreeConstants.jjtNodeName[id] + "[" + prop + ", " + op + "," + attrType + "]"; - } - - @Override - public String organize(String type, LanguageSpecificationV2 langSpec) { - if (type == null) { - SimpleNode pcParent = (SimpleNode) parent; - while (!(pcParent instanceof ASTPointcut)) { - pcParent = (SimpleNode) pcParent.parent; - } - getLara().warnln("Cannot validate attribute '" + prop + "' as the joinpoint type '" + pcParent.jjtGetValue() - + "' could not be verified. Will use as is"); - } else { - // final Attribute attribute = artifacts.getAttribute(type, prop); - var attribute = langSpec.getJoinPoint(type).getAttribute(prop); - - if (attribute.isEmpty()) { - SimpleNode pcParent = (SimpleNode) parent; - while (!(pcParent instanceof ASTPointcut)) { - pcParent = (SimpleNode) pcParent.parent; - } - throw newException( - "The attribute '" + prop + "' does not exist on joinpoint '" + pcParent.jjtGetValue() + "'"); - } - // Use the first occurrence - setAttrType(attribute.get(0).getReturnType()); - } - final ASTOperator opNode = (ASTOperator) children[0]; - opNode.organize(new ASTBinaryExpressionSequence(-1)); - op = opNode.getTag(); - ((SimpleNode) children[1]).organize(this); - return prop; - } - - /** - * @return the attrType - */ - public String getAttrType() { - return attrType; - } - - /** - * @param attrType - * the attrType to set - */ - public void setAttrType(String attrType) { - this.attrType = attrType; - } - - @Override - public Element getFilterElement(Document doc) { - - final Element matchEl = doc.createElement("op"); - matchEl.setAttribute("name", op); - - final Element idEl = doc.createElement("id"); - idEl.setAttribute("name", prop); - matchEl.appendChild(idEl); - ((SimpleNode) getChildren()[1]).toXML(doc, matchEl); - - return matchEl; - } -} -/* - * JavaCC - OriginalChecksum=12edf7f7eff79f8e3b5adafce0c6c166 (do not edit this - * line) - */ diff --git a/LARAC/src/org/dojo/jsl/parser/ast/ASTFinalize.java b/LARAC/src/org/dojo/jsl/parser/ast/ASTFinalize.java deleted file mode 100644 index b392e00d9..000000000 --- a/LARAC/src/org/dojo/jsl/parser/ast/ASTFinalize.java +++ /dev/null @@ -1,40 +0,0 @@ -/* Generated By:JJTree: Do not edit this line. ASTFinalize.java Version 4.3 */ -/* - * JavaCCOptions:MULTI=true,NODE_USES_PARSER=false,VISITOR=false,TRACK_TOKENS=false,NODE_PREFIX=AST,NODE_EXTENDS=, - * NODE_FACTORY=,SUPPORT_CLASS_VISIBILITY_PUBLIC=true - */ -package org.dojo.jsl.parser.ast; - -import org.w3c.dom.Document; -import org.w3c.dom.Element; - -public class ASTFinalize extends SimpleNode { - public ASTFinalize(int id) { - super(id); - } - - public ASTFinalize(LARAEcmaScript p, int id) { - super(p, id); - } - - @Override - public Object organize(Object obj) { - if (((SimpleNode) getChildren()[0]).getChildren() == null) { - return null; - } - ((SimpleNode) getChildren()[0]).organize(obj); - ((ASTAspectDef) parent).setFinalize(this); - return null; - } - - @Override - public void toXML(Document doc, Element parent) { - final Element finEl = doc.createElement("finalize"); - parent.appendChild(finEl); - ((SimpleNode) getChildren()[0]).toXML(doc, finEl); - } -} -/* - * JavaCC - OriginalChecksum=5f4f89815e48640eb1f1c355e69eb115 (do not edit this - * line) - */ diff --git a/LARAC/src/org/dojo/jsl/parser/ast/ASTFinallyClause.java b/LARAC/src/org/dojo/jsl/parser/ast/ASTFinallyClause.java deleted file mode 100644 index e5ebd166b..000000000 --- a/LARAC/src/org/dojo/jsl/parser/ast/ASTFinallyClause.java +++ /dev/null @@ -1,37 +0,0 @@ -/* Generated By:JJTree: Do not edit this line. ASTFinallyClause.java Version 4.3 */ -/* - * JavaCCOptions:MULTI=true,NODE_USES_PARSER=false,VISITOR=false,TRACK_TOKENS=false,NODE_PREFIX=AST,NODE_EXTENDS=, - * NODE_FACTORY=,SUPPORT_CLASS_VISIBILITY_PUBLIC=true - */ -package org.dojo.jsl.parser.ast; - -import org.w3c.dom.Document; -import org.w3c.dom.Element; - -public class ASTFinallyClause extends SimpleNode { - public ASTFinallyClause(int id) { - super(id); - } - - public ASTFinallyClause(LARAEcmaScript p, int id) { - super(p, id); - } - - @Override - public Object organize(Object obj) { - return ((SimpleNode) children[0]).organize(obj); - } - - @Override - public void toXML(Document doc, Element parent) { - - final Element codeEl = doc.createElement("code"); - codeEl.setAttribute("desc", "finally"); - parent.appendChild(codeEl); - ((SimpleNode) children[0]).toXML(doc, codeEl); - } -} -/* - * JavaCC - OriginalChecksum=620e9f98df42e9490bd5bc3d4870d763 (do not edit this - * line) - */ diff --git a/LARAC/src/org/dojo/jsl/parser/ast/ASTFor.java b/LARAC/src/org/dojo/jsl/parser/ast/ASTFor.java deleted file mode 100644 index 58bc293c8..000000000 --- a/LARAC/src/org/dojo/jsl/parser/ast/ASTFor.java +++ /dev/null @@ -1,21 +0,0 @@ -/* Generated By:JJTree: Do not edit this line. ASTFor.java Version 4.3 */ -/* - * JavaCCOptions:MULTI=true,NODE_USES_PARSER=false,VISITOR=false,TRACK_TOKENS=false,NODE_PREFIX=AST,NODE_EXTENDS=, - * NODE_FACTORY=,SUPPORT_CLASS_VISIBILITY_PUBLIC=true - */ -package org.dojo.jsl.parser.ast; - -public @SuppressWarnings("all") class ASTFor extends SimpleNode { - public ASTFor(int id) { - super(id); - } - - public ASTFor(LARAEcmaScript p, int id) { - super(p, id); - } - -} -/* - * JavaCC - OriginalChecksum=a06ae7ff785aa62466edb38d2a708a6f (do not edit this - * line) - */ diff --git a/LARAC/src/org/dojo/jsl/parser/ast/ASTForConditionList.java b/LARAC/src/org/dojo/jsl/parser/ast/ASTForConditionList.java deleted file mode 100644 index 60c8b6645..000000000 --- a/LARAC/src/org/dojo/jsl/parser/ast/ASTForConditionList.java +++ /dev/null @@ -1,56 +0,0 @@ -/* Generated By:JJTree: Do not edit this line. ASTForConditionList.java Version 4.3 */ -/* - * JavaCCOptions:MULTI=true,NODE_USES_PARSER=false,VISITOR=false,TRACK_TOKENS=false,NODE_PREFIX=AST,NODE_EXTENDS=, - * NODE_FACTORY=,SUPPORT_CLASS_VISIBILITY_PUBLIC=true - */ -package org.dojo.jsl.parser.ast; - -import org.w3c.dom.Document; -import org.w3c.dom.Element; -import org.w3c.dom.NodeList; - -public class ASTForConditionList extends SimpleNode { - public ASTForConditionList(int id) { - super(id); - } - - public ASTForConditionList(LARAEcmaScript p, int id) { - super(p, id); - } - - @Override - public Object organize(Object obj) { - for (int i = 0; i < children.length; i++) { - ((SimpleNode) children[i]).organize(obj); - } - return null; - } - - @Override - public void toXML(Document doc, Element parent) { - if (((SimpleNode) children[0]).children.length == 1) { - ((SimpleNode) children[0]).toXML(doc, parent); - return; - } - final Element exprListEl = doc.createElement("temp"); // think about - // using - // doc.removeChild(Node); - ((SimpleNode) children[0]).toXML(doc, exprListEl); - final NodeList els = exprListEl.getChildNodes(); - Element lastEl = (Element) els.item(0); - for (int i = 1; i < els.getLength(); i++) { - final Element OREl = doc.createElement("op"); - OREl.setAttribute("name", "AND"); - OREl.appendChild(lastEl); - lastEl = OREl; - lastEl.appendChild(els.item(0)); // zero because when appending to - // another father, it is removed - // from that list - } - parent.appendChild(lastEl); - } -} -/* - * JavaCC - OriginalChecksum=f32c23c785caa9bc827e13c43a6901a8 (do not edit this - * line) - */ diff --git a/LARAC/src/org/dojo/jsl/parser/ast/ASTForInStatement.java b/LARAC/src/org/dojo/jsl/parser/ast/ASTForInStatement.java deleted file mode 100644 index da3779c52..000000000 --- a/LARAC/src/org/dojo/jsl/parser/ast/ASTForInStatement.java +++ /dev/null @@ -1,76 +0,0 @@ -/* Generated By:JJTree: Do not edit this line. ASTForInStatement.java Version 4.3 */ -/* - * JavaCCOptions:MULTI=true,NODE_USES_PARSER=false,VISITOR=false,TRACK_TOKENS=false,NODE_PREFIX=AST,NODE_EXTENDS=, - * NODE_FACTORY=,SUPPORT_CLASS_VISIBILITY_PUBLIC=true - */ -package org.dojo.jsl.parser.ast; - -import org.w3c.dom.Document; -import org.w3c.dom.Element; - -import larac.objects.Enums.LoopTypes; - -public class ASTForInStatement extends SimpleNode { - private boolean each = false; - - public ASTForInStatement(int id) { - super(id); - } - - public ASTForInStatement(LARAEcmaScript p, int id) { - super(p, id); - } - - @Override - public Object organize(Object obj) { - for (int i = 0; i < children.length; i++) { - ((SimpleNode) children[i]).organize(obj); - } - return null; - } - - @Override - public void toXML(Document doc, Element parent) { - final Element stmtEl = doc.createElement("statement"); - stmtEl.setAttribute("name", "loop"); - final LoopTypes loopType = isEach() ? LoopTypes.FOREACH : LoopTypes.FORIN; - stmtEl.setAttribute("desc", loopType.toString()); - stmtEl.setAttribute("coord", getCoords()); - parent.appendChild(stmtEl); - if (!label.isEmpty()) { - stmtEl.setAttribute("label", label); - } - final Element initEl = doc.createElement("code"); - initEl.setAttribute("desc", "init"); - stmtEl.appendChild(initEl); - final Element statExprEl = doc.createElement("statement"); - statExprEl.setAttribute("name", "expr"); - statExprEl.setAttribute("coord", getCoords()); - initEl.appendChild(statExprEl); - final Element exprEl = doc.createElement("expression"); - statExprEl.appendChild(exprEl); - ((SimpleNode) children[0]).toXML(doc, exprEl); - - final Element containerEl = doc.createElement("expression"); - containerEl.setAttribute("desc", "container"); - stmtEl.appendChild(containerEl); - ((SimpleNode) children[1]).toXML(doc, containerEl); - - final Element codeEl = doc.createElement("code"); - codeEl.setAttribute("desc", "body"); - stmtEl.appendChild(codeEl); - ((SimpleNode) children[2]).toXML(doc, codeEl); - } - - public boolean isEach() { - return each; - } - - public void setEach(boolean each) { - this.each = each; - } -} -/* - * JavaCC - OriginalChecksum=dc8c61704cfc22f28f18f34b4cbc3b3a (do not edit this - * line) - */ diff --git a/LARAC/src/org/dojo/jsl/parser/ast/ASTForStatement.java b/LARAC/src/org/dojo/jsl/parser/ast/ASTForStatement.java deleted file mode 100644 index 9aecd53ed..000000000 --- a/LARAC/src/org/dojo/jsl/parser/ast/ASTForStatement.java +++ /dev/null @@ -1,70 +0,0 @@ -/* Generated By:JJTree: Do not edit this line. ASTForStatement.java Version 4.3 */ -/* - * JavaCCOptions:MULTI=true,NODE_USES_PARSER=false,VISITOR=false,TRACK_TOKENS=false,NODE_PREFIX=AST,NODE_EXTENDS=, - * NODE_FACTORY=,SUPPORT_CLASS_VISIBILITY_PUBLIC=true - */ -package org.dojo.jsl.parser.ast; - -import org.w3c.dom.Document; -import org.w3c.dom.Element; - -import larac.objects.Enums; - -public class ASTForStatement extends SimpleNode { - public ASTForStatement(int id) { - super(id); - } - - public ASTForStatement(LARAEcmaScript p, int id) { - super(p, id); - } - - @Override - public Object organize(Object obj) { - for (int i = 0; i < children.length; i++) { - ((SimpleNode) children[i]).organize(obj); - } - return null; - } - - @Override - public void toXML(Document doc, Element parent) { - - final Element statEl = doc.createElement("statement"); - parent.appendChild(statEl); - - statEl.setAttribute("coord", getCoords()); - statEl.setAttribute("name", "loop"); - statEl.setAttribute("desc", Enums.LoopTypes.FOR.toString()); - if (!label.isEmpty()) { - statEl.setAttribute("label", label); - } - final Element initEl = doc.createElement("code"); - statEl.appendChild(initEl); - initEl.setAttribute("desc", "init"); - final Element statExprEl = doc.createElement("statement"); - statExprEl.setAttribute("name", "expr"); - statExprEl.setAttribute("coord", getCoords()); - initEl.appendChild(statExprEl); - final Element exprEl = doc.createElement("expression"); - statExprEl.appendChild(exprEl); - ((SimpleNode) children[0]).toXML(doc, exprEl); - - final Element conditionEl = doc.createElement("expression"); - statEl.appendChild(conditionEl); - conditionEl.setAttribute("desc", "condition"); - ((SimpleNode) children[1]).toXML(doc, conditionEl); - final Element codeEl = doc.createElement("code"); - statEl.appendChild(codeEl); - codeEl.setAttribute("desc", "body"); - ((SimpleNode) children[3]).toXML(doc, codeEl); - - final Element exprItEl = doc.createElement("expression"); - statEl.appendChild(exprItEl); - ((SimpleNode) children[2]).toXML(doc, exprItEl); - } -} -/* - * JavaCC - OriginalChecksum=512f5c288d5c705f5c8200c17c94ad98 (do not edit this - * line) - */ diff --git a/LARAC/src/org/dojo/jsl/parser/ast/ASTForVarInStatement.java b/LARAC/src/org/dojo/jsl/parser/ast/ASTForVarInStatement.java deleted file mode 100644 index 164da47be..000000000 --- a/LARAC/src/org/dojo/jsl/parser/ast/ASTForVarInStatement.java +++ /dev/null @@ -1,123 +0,0 @@ -/* Generated By:JJTree: Do not edit this line. ASTForVarInStatement.java Version 4.3 */ -/* - * JavaCCOptions:MULTI=true,NODE_USES_PARSER=false,VISITOR=false,TRACK_TOKENS=false,NODE_PREFIX=AST,NODE_EXTENDS=, - * NODE_FACTORY=,SUPPORT_CLASS_VISIBILITY_PUBLIC=true - */ -package org.dojo.jsl.parser.ast; - -import org.w3c.dom.Document; -import org.w3c.dom.Element; - -import larac.objects.Enums.LoopTypes; -import larac.objects.Variable; -import larac.utils.xml.AspectIRFactory; - -public class ASTForVarInStatement extends SimpleNode { - private boolean each = false; - private Variable varForVarIn; - - /** - * @return the varForVarIn - */ - public Variable getVarForVarIn() { - return varForVarIn; - } - - /** - * @param varForVarIn - * the varForVarIn to set - */ - public void setVarForVarIn(Variable varForVarIn) { - this.varForVarIn = varForVarIn; - } - - /**/ - public ASTForVarInStatement(int id) { - super(id); - } - - public ASTForVarInStatement(LARAEcmaScript p, int id) { - super(p, id); - } - - @Override - public Object organize(Object obj) { - // final Map vars = getHMVars(); - // if (getChild(1) instanceof ASTEmptyExpression) { - varForVarIn = new Variable(((ASTIdentifier) jjtGetChild(0)).getName()); - // } else { - // varForVarIn = new Variable(((ASTIdentifier) children[0]).getName(), (SimpleNode) children[1]); - // } - // vars.put(varForVarIn.getName(), varForVarIn); - for (int i = 1; i < children.length; i++) { - ((SimpleNode) children[i]).organize(obj); - } - return null; - } - - @Override - public Variable lookup(String var) { - if (getVarForVarIn().getName().equals(var)) { - return getVarForVarIn(); - } - return ((SimpleNode) parent).lookup(var); - } - - @Override - public Variable lookupNoError(String var) { - if (getVarForVarIn().getName().equals(var)) { - return getVarForVarIn(); - } - return ((SimpleNode) parent).lookupNoError(var); - } - - @Override - public void toXML(Document doc, Element parent) { - final Element stmtEl = doc.createElement("statement"); - stmtEl.setAttribute("name", "loop"); - final LoopTypes loopType = isEach() ? LoopTypes.FOREACH : LoopTypes.FORIN; - stmtEl.setAttribute("desc", loopType.toString()); - final String coords = getCoords(); - stmtEl.setAttribute("coord", coords); - if (!label.isEmpty()) { - stmtEl.setAttribute("label", label); - } - parent.appendChild(stmtEl); - - final Element initEl = doc.createElement("code"); - initEl.setAttribute("desc", "init"); - stmtEl.appendChild(initEl); - stmtEl.setAttribute("coord", getCoords()); - - SimpleNode initNode = getChild(1); - if (!(initNode instanceof ASTEmptyExpression)) { - AspectIRFactory.varDeclStmtToXML(doc, initEl, varForVarIn.getName(), coords); - } else { - AspectIRFactory.varDeclStmtToXML(doc, initEl, varForVarIn.getName(), initNode, coords, null); - } - // varDeclToXML(doc, statementDeclEl, getVarForVarIn()); - - final Element containerEl = doc.createElement("expression"); - containerEl.setAttribute("desc", "container"); - stmtEl.appendChild(containerEl); - ((SimpleNode) children[2]).toXML(doc, containerEl); - - final Element codeEl = doc.createElement("code"); - codeEl.setAttribute("desc", "body"); - stmtEl.appendChild(codeEl); - ((SimpleNode) children[3]).toXML(doc, codeEl); - } - - public boolean isEach() { - return each; - } - - public void setEach(boolean each) { - this.each = each; - } - -} -/* - * JavaCC - OriginalChecksum=f7161e8ad63b4575966d675f4c8aa0d7 (do not edit this - * line) - */ diff --git a/LARAC/src/org/dojo/jsl/parser/ast/ASTForVarStatement.java b/LARAC/src/org/dojo/jsl/parser/ast/ASTForVarStatement.java deleted file mode 100644 index 6d86c6ddf..000000000 --- a/LARAC/src/org/dojo/jsl/parser/ast/ASTForVarStatement.java +++ /dev/null @@ -1,86 +0,0 @@ -/* Generated By:JJTree: Do not edit this line. ASTForVarStatement.java Version 4.3 */ -/* - * JavaCCOptions:MULTI=true,NODE_USES_PARSER=false,VISITOR=false,TRACK_TOKENS=false,NODE_PREFIX=AST,NODE_EXTENDS=, - * NODE_FACTORY=,SUPPORT_CLASS_VISIBILITY_PUBLIC=true - */ -package org.dojo.jsl.parser.ast; - -import org.w3c.dom.Document; -import org.w3c.dom.Element; - -import larac.objects.Enums; - -public class ASTForVarStatement extends SimpleNode { - // private SymbolTable localVars = new SymbolTable(); - public ASTForVarStatement(int id) { - super(id); - } - - public ASTForVarStatement(LARAEcmaScript p, int id) { - super(p, id); - } - - @Override - public Object organize(Object obj) { - - for (int i = 0; i < children.length; i++) { - ((SimpleNode) children[i]).organize(this); - } - return null; - } - - @Override - public void toXML(Document doc, Element parent) { - - final Element statEl = doc.createElement("statement"); - parent.appendChild(statEl); - final String coords = getCoords(); - statEl.setAttribute("name", "loop"); - statEl.setAttribute("desc", Enums.LoopTypes.FOR.toString()); - statEl.setAttribute("coord", coords); - if (!label.isEmpty()) { - statEl.setAttribute("label", label); - } - - final Element initEl = doc.createElement("code"); - statEl.appendChild(initEl); - initEl.setAttribute("desc", "init"); - final Element varDeclEl = doc.createElement("statement"); - varDeclEl.setAttribute("name", "vardecl"); - varDeclEl.setAttribute("coord", coords); - initEl.appendChild(varDeclEl); - ((SimpleNode) children[0]).toXML(doc, varDeclEl); - // createXMLDecl(localVars.values(), doc, initEl); - - final Element conditionEl = doc.createElement("expression"); - statEl.appendChild(conditionEl); - conditionEl.setAttribute("desc", "condition"); - ((SimpleNode) children[1]).toXML(doc, conditionEl); - - final Element codeEl = doc.createElement("code"); - statEl.appendChild(codeEl); - codeEl.setAttribute("desc", "body"); - ((SimpleNode) children[3]).toXML(doc, codeEl); - - final Element exprItEl = doc.createElement("expression"); - exprItEl.setAttribute("desc", "next-iterator"); - statEl.appendChild(exprItEl); - ((SimpleNode) children[2]).toXML(doc, exprItEl); - } - /* - * public Variable lookup(String var) { if(localVars.containsKey(var)) - * return localVars.get(var); return ((SimpleNode)parent).lookup(var); } - * - * public Variable lookupNoError(String var) { - * if(localVars.containsKey(var)) return localVars.get(var); return - * ((SimpleNode)parent).lookupNoError(var); } - * - * @Override public HashMap getHMVars() { return - * localVars; } - */ -} -/* - * JavaCC - OriginalChecksum=275faf88f67bd8be5cce441ad4c2c51a (do not edit this - * line) - */ diff --git a/LARAC/src/org/dojo/jsl/parser/ast/ASTFormalParameterList.java b/LARAC/src/org/dojo/jsl/parser/ast/ASTFormalParameterList.java deleted file mode 100644 index 63c438cc9..000000000 --- a/LARAC/src/org/dojo/jsl/parser/ast/ASTFormalParameterList.java +++ /dev/null @@ -1,32 +0,0 @@ -/* Generated By:JJTree: Do not edit this line. ASTFormalParameterList.java Version 4.3 */ -/* - * JavaCCOptions:MULTI=true,NODE_USES_PARSER=false,VISITOR=false,TRACK_TOKENS=false,NODE_PREFIX=AST,NODE_EXTENDS=, - * NODE_FACTORY=,SUPPORT_CLASS_VISIBILITY_PUBLIC=true - */ -package org.dojo.jsl.parser.ast; - -import java.util.ArrayList; - -public class ASTFormalParameterList extends SimpleNode { - public ASTFormalParameterList(int id) { - super(id); - } - - public ASTFormalParameterList(LARAEcmaScript p, int id) { - super(p, id); - } - - public ArrayList getArguments() { - final ArrayList args = new ArrayList<>(); - for (final Node child : getChildren()) { - final ASTIdentifier identifier = (ASTIdentifier) child; - args.add(identifier.jjtGetValue().toString()); - } - return args; - } - -} -/* - * JavaCC - OriginalChecksum=34bfcb019231452ff007fa4cf8f2abdf (do not edit this - * line) - */ diff --git a/LARAC/src/org/dojo/jsl/parser/ast/ASTFunctionCallParameters.java b/LARAC/src/org/dojo/jsl/parser/ast/ASTFunctionCallParameters.java deleted file mode 100644 index 53e76b732..000000000 --- a/LARAC/src/org/dojo/jsl/parser/ast/ASTFunctionCallParameters.java +++ /dev/null @@ -1,59 +0,0 @@ -/* Generated By:JJTree: Do not edit this line. ASTFunctionCallParameters.java Version 4.3 */ -/* - * JavaCCOptions:MULTI=true,NODE_USES_PARSER=false,VISITOR=false,TRACK_TOKENS=false,NODE_PREFIX=AST,NODE_EXTENDS=, - * NODE_FACTORY=,SUPPORT_CLASS_VISIBILITY_PUBLIC=true - */ -package org.dojo.jsl.parser.ast; - -import org.w3c.dom.Document; -import org.w3c.dom.Element; - -public class ASTFunctionCallParameters extends SimpleNode { - protected boolean areNamed = false; - - public ASTFunctionCallParameters(int id) { - super(id); - } - - public ASTFunctionCallParameters(LARAEcmaScript p, int id) { - super(p, id); - } - - @Override - public String toString() { - return LARAEcmaScriptTreeConstants.jjtNodeName[id] + " [named=" + areNamed + "]"; - } - - @Override - public Object organize(Object obj) { - - if (children != null) { - for (int i = 0; i < children.length; i++) { - ((SimpleNode) children[i]).organize(obj); - } - } - - return null; - } - - @Override - public void toXML(Document doc, Element parent) { - if (children != null) { - for (int j = 0; j < children.length; j++) { - final Element argEl = doc.createElement("argument"); - final SimpleNode child = ((SimpleNode) children[j]); - if (child.isTemplate) { - child.toXMLTemplate(doc, argEl); - } else { - child.toXML(doc, argEl); - } - parent.appendChild(argEl); - } - } - } - -} -/* - * JavaCC - OriginalChecksum=0235fb7373907dbeba1c6755ad622a23 (do not edit this - * line) - */ diff --git a/LARAC/src/org/dojo/jsl/parser/ast/ASTFunctionDeclaration.java b/LARAC/src/org/dojo/jsl/parser/ast/ASTFunctionDeclaration.java deleted file mode 100644 index 0dbe65b11..000000000 --- a/LARAC/src/org/dojo/jsl/parser/ast/ASTFunctionDeclaration.java +++ /dev/null @@ -1,169 +0,0 @@ -/* Generated By:JJTree: Do not edit this line. ASTFunctionDeclaration.java Version 4.3 */ -/* - * JavaCCOptions:MULTI=true,NODE_USES_PARSER=false,VISITOR=false,TRACK_TOKENS=false,NODE_PREFIX=AST,NODE_EXTENDS=, - * NODE_FACTORY=,SUPPORT_CLASS_VISIBILITY_PUBLIC=true - */ -package org.dojo.jsl.parser.ast; - -import java.util.HashMap; -import java.util.LinkedHashMap; - -import org.w3c.dom.Document; -import org.w3c.dom.Element; - -import larac.LaraC; -import larac.objects.Enums.Types; -import larac.objects.Variable; - -public class ASTFunctionDeclaration extends SimpleNode { - private LinkedHashMap args = new LinkedHashMap<>(); - private String funcName = ""; - - public ASTFunctionDeclaration(int id) { - super(id); - } - - public ASTFunctionDeclaration(LARAEcmaScript p, int id) { - super(p, id); - } - - @Override - public void declareGlobal(LaraC lara) { - - funcName = ((ASTIdentifier) children[0]).value.toString(); - - getLara().aspectIR().addGlobalElement(funcName, this); - organizeParams(this); - } - - @Override - public Object organize(Object obj) { - funcName = ((ASTIdentifier) children[0]).value.toString(); - - final Variable var = new Variable(funcName);// , this); - final HashMap parentVars = ((SimpleNode) parent).getHMVars(); - if (parentVars.containsKey(funcName)) { - throw newException("Identifier '" + funcName + "' already in use"); - } - parentVars.put(funcName, var); - - organizeParams(obj); - return obj; - } - - private void organizeParams(Object obj) { - final ASTFormalParameterList paramList = ((ASTFormalParameterList) children[1]); - if (paramList.children != null) { - for (final Node argChild : paramList.children) { - final String argName = ((ASTIdentifier) argChild).value.toString(); - if (args.containsKey(argName)) { - throw newException( - "Function \"" + funcName + "\" contains variables with the same name: " + argName); - } - final Variable argVar = new Variable(argName); - args.put(argName, argVar); - } - } - ((SimpleNode) children[2]).organize(obj); - ((SimpleNode) children[2]).insertTag = false; - } - - @Override - public void globalToXML(Document doc, Element parent) { - toXML(doc, parent, "declaration"); - } - - @Override - public void toXML(Document doc, Element parent) { - toXML(doc, parent, "statement"); - - } - - private void toXML(Document doc, Element parent, String elementType) { - final Element statEl = doc.createElement(elementType); - statEl.setAttribute("name", "fndecl"); - statEl.setAttribute("coord", getCoords()); - addXMLComent(statEl); - parent.appendChild(statEl); - final Element exprEl = doc.createElement("expression"); - statEl.appendChild(exprEl); - final Element opEl = doc.createElement("op"); - opEl.setAttribute("name", "FN"); - exprEl.appendChild(opEl); - Element litEl = doc.createElement("literal"); - litEl.setAttribute("value", funcName); - litEl.setAttribute("type", Types.String.toString()); - opEl.appendChild(litEl); - - final ASTFormalParameterList paramList = ((ASTFormalParameterList) children[1]); - if (paramList.children != null) { - for (final Node argChild : paramList.children) { - final String argName = ((ASTIdentifier) argChild).value.toString(); - litEl = doc.createElement("literal"); - litEl.setAttribute("value", argName); - litEl.setAttribute("type", Types.String.toString()); - - opEl.appendChild(litEl); - } - } - - // for (final String id : args.keySet()) { - // litEl = doc.createElement("literal"); - // litEl.setAttribute("value", id); - // litEl.setAttribute("type", Types.String.toString()); - // - // opEl.appendChild(litEl); - // } - ((SimpleNode) children[2]).toXML(doc, opEl); - } - - @Override - public Types getExpressionType() { - return Types.FNDecl; - } - - /** - * @param args - * the args to set - */ - public void setArgs(LinkedHashMap args) { - this.args = args; - } - - /** - * @return the args - */ - public LinkedHashMap getArgs() { - return args; - } - - @Override - public Variable lookup(String var) { - if (args.containsKey(var)) { - return args.get(var); - } - return ((SimpleNode) parent).lookup(var); - } - - @Override - public Variable lookupNoError(String var) { - if (args.containsKey(var)) { - return args.get(var); - } - return ((SimpleNode) parent).lookupNoError(var); - } - - @Override - public HashMap getHMVars() { - return args; - } - - public String getFuncName() { - return ((ASTIdentifier) children[0]).value.toString(); - } -} - -/* - * JavaCC - OriginalChecksum=6ad6228c0375726db657af81111aa7b8 (do not edit this - * line) - */ diff --git a/LARAC/src/org/dojo/jsl/parser/ast/ASTFunctionExpression.java b/LARAC/src/org/dojo/jsl/parser/ast/ASTFunctionExpression.java deleted file mode 100644 index 72d16cbae..000000000 --- a/LARAC/src/org/dojo/jsl/parser/ast/ASTFunctionExpression.java +++ /dev/null @@ -1,192 +0,0 @@ -/* Generated By:JJTree: Do not edit this line. ASTFunctionExpression.java Version 4.3 */ -/* - * - * JavaCCOptions:MULTI=true,NODE_USES_PARSER=false,VISITOR=false,TRACK_TOKENS=false,NODE_PREFIX=AST,NODE_EXTENDS=, - * NODE_FACTORY=,S - * - * UPPORT_CLASS_VISIBILITY_PUBLIC=true - */ -package org.dojo.jsl.parser.ast; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.LinkedHashMap; -import java.util.List; - -import org.w3c.dom.Document; -import org.w3c.dom.Element; - -import larac.objects.Enums.Types; -import larac.objects.Variable; - -public class ASTFunctionExpression extends SimpleNode { - private LinkedHashMap args = new LinkedHashMap<>(); - private final List params = new ArrayList<>(); - private Types myType = Types.FN; - private int pos = 0; - private boolean toXML = true; - private String funcName = ""; - - public ASTFunctionExpression(int id) { - super(id); - } - - public ASTFunctionExpression(LARAEcmaScript p, int id) { - super(p, id); - } - - @Override - public Object organize(Object obj) { - - if (parent instanceof ASTExpressionStatement) { - ((ASTExpressionStatement) parent).insertTag = false; - if (!(children[0] instanceof ASTIdentifier)) { - throw newException("Cannot declare a function without an identifier."); - } - funcName = ((ASTIdentifier) children[0]).value.toString(); - final Variable var = new Variable(funcName); - // var.setInitialize(this); - myType = Types.FNDecl; - var.setType(Types.FNDecl); - final HashMap parentVars = ((SimpleNode) parent).getHMVars(); - if (parentVars.containsKey(funcName)) { - throw newException("Identifier '" + funcName + "' already in use"); - } - parentVars.put(funcName, var); - final ASTFormalParameterList paramList = ((ASTFormalParameterList) children[1]); - if (paramList.children != null) { - for (final Node argChild : paramList.children) { - final String argName = ((ASTIdentifier) argChild).value.toString(); - if (args.containsKey(argName)) { - throw newException( - "Function \"" + funcName + "\" contains variables with the same name: " + argName); - } - final Variable argVar = new Variable(argName); - args.put(argName, argVar); - params.add(argName); - } - } - ((SimpleNode) children[2]).organize(obj); - ((SimpleNode) children[2]).insertTag = false; - - toXML = true; - } else { - if (children[0] instanceof ASTIdentifier) { - funcName = ((ASTIdentifier) children[0]).value.toString(); - pos++; - } - final ASTFormalParameterList paramList = ((ASTFormalParameterList) children[pos]); - if (paramList.children != null) { - for (final Node argChild : paramList.children) { - final String argName = ((ASTIdentifier) argChild).value.toString(); - if (args.containsKey(argName)) { - throw newException("Function expression contains variables with the same name: " + argName); - } - final Variable argVar = new Variable(argName); - args.put(argName, argVar); - params.add(argName); - } - } - ((SimpleNode) children[++pos]).organize(obj); - ((SimpleNode) children[pos]).insertTag = false; - } - return obj; - } - - @Override - public void toXML(Document doc, Element parent) { - if (!toXML) { - return; - } - if (myType.equals(Types.FNDecl)) { - final Element statEl = doc.createElement("statement"); - statEl.setAttribute("name", "fndecl"); - statEl.setAttribute("coord", getCoords()); - parent.appendChild(statEl); - final Element exprEl = doc.createElement("expression"); - statEl.appendChild(exprEl); - final Element opEl = doc.createElement("op"); - opEl.setAttribute("name", "FN"); - exprEl.appendChild(opEl); - Element litEl = doc.createElement("literal"); - litEl.setAttribute("value", funcName); - litEl.setAttribute("type", Types.String.toString()); - opEl.appendChild(litEl); - // for (final String id : args.keySet()) { - for (final String id : params) { - litEl = doc.createElement("literal"); - litEl.setAttribute("value", id); - litEl.setAttribute("type", Types.String.toString()); - opEl.appendChild(litEl); - } - ((SimpleNode) children[2]).toXML(doc, opEl); - toXML = false; - return; - } - final Element opEl = doc.createElement("op"); - opEl.setAttribute("name", "FN"); - parent.appendChild(opEl); - Element litEl = doc.createElement("literal"); - litEl.setAttribute("value", funcName); - litEl.setAttribute("type", Types.String.toString()); - opEl.appendChild(litEl); - // for (final String id : args.keySet()) { - for (final String id : params) { - litEl = doc.createElement("literal"); - litEl.setAttribute("value", id); - litEl.setAttribute("type", Types.String.toString()); - opEl.appendChild(litEl); - } - ((SimpleNode) children[pos]).toXML(doc, opEl); - toXML = false; - } - - @Override - public Types getExpressionType() { - return Types.FN; - } - - /** - * @param args - * the args to set - */ - public void setArgs(LinkedHashMap args) { - this.args = args; - } - - /** - * @return the args - */ - public LinkedHashMap getArgs() { - return args; - } - - @Override - public Variable lookup(String var) { - if (args.containsKey(var)) { - return args.get(var); - } - return ((SimpleNode) parent).lookup(var); - } - - @Override - public Variable lookupNoError(String var) { - if (args.containsKey(var)) { - return args.get(var); - } - return ((SimpleNode) parent).lookupNoError(var); - } - - @Override - public HashMap getHMVars() { - return args; - } - - public String getFuncName() { - return funcName; - } -} -/* - * JavaCC - OriginalChecksum=d74ba2bc6a47f6c46c2a3346b91f2412 (do not edit this - * line) - */ diff --git a/LARAC/src/org/dojo/jsl/parser/ast/ASTGeneratorFunctionDeclaration.java b/LARAC/src/org/dojo/jsl/parser/ast/ASTGeneratorFunctionDeclaration.java deleted file mode 100644 index 90c45ae8a..000000000 --- a/LARAC/src/org/dojo/jsl/parser/ast/ASTGeneratorFunctionDeclaration.java +++ /dev/null @@ -1,165 +0,0 @@ -/* Generated By:JJTree: Do not edit this line. ASTGeneratorFunctionDeclaration.java Version 4.3 */ -/* - * JavaCCOptions:MULTI=true,NODE_USES_PARSER=false,VISITOR=false,TRACK_TOKENS=true,NODE_PREFIX=AST,NODE_EXTENDS=, - * NODE_FACTORY=,SUPPORT_CLASS_VISIBILITY_PUBLIC=true - */ -package org.dojo.jsl.parser.ast; - -import java.util.HashMap; -import java.util.LinkedHashMap; - -import org.w3c.dom.Document; -import org.w3c.dom.Element; - -import larac.LaraC; -import larac.objects.Enums.Types; -import larac.objects.Variable; - -public class ASTGeneratorFunctionDeclaration extends SimpleNode { - private LinkedHashMap args = new LinkedHashMap<>(); - private String funcName = ""; - - public ASTGeneratorFunctionDeclaration(int id) { - super(id); - } - - public ASTGeneratorFunctionDeclaration(LARAEcmaScript p, int id) { - super(p, id); - } - - @Override - public void declareGlobal(LaraC lara) { - - funcName = ((ASTIdentifier) children[0]).value.toString(); - - getLara().aspectIR().addGlobalElement(funcName, this); - organizeParams(this); - } - - @Override - public Object organize(Object obj) { - funcName = ((ASTIdentifier) children[0]).value.toString(); - - final Variable var = new Variable(funcName);// , this); - final HashMap parentVars = ((SimpleNode) parent).getHMVars(); - if (parentVars.containsKey(funcName)) { - throw newException("Identifier '" + funcName + "' already in use"); - } - parentVars.put(funcName, var); - - organizeParams(obj); - return obj; - } - - private void organizeParams(Object obj) { - final ASTFormalParameterList paramList = ((ASTFormalParameterList) children[1]); - if (paramList.children != null) { - for (final Node argChild : paramList.children) { - final String argName = ((ASTIdentifier) argChild).value.toString(); - if (args.containsKey(argName)) { - throw newException( - "Function \"" + funcName + "\" contains variables with the same name: " + argName); - } - final Variable argVar = new Variable(argName); - args.put(argName, argVar); - } - } - ((SimpleNode) children[2]).organize(obj); - ((SimpleNode) children[2]).insertTag = false; - } - - @Override - public void globalToXML(Document doc, Element parent) { - toXML(doc, parent, "declaration"); - } - - @Override - public void toXML(Document doc, Element parent) { - toXML(doc, parent, "statement"); - - } - - private void toXML(Document doc, Element parent, String elementType) { - final Element statEl = doc.createElement(elementType); - statEl.setAttribute("name", "gfndecl"); - statEl.setAttribute("coord", getCoords()); - addXMLComent(statEl); - parent.appendChild(statEl); - final Element exprEl = doc.createElement("expression"); - statEl.appendChild(exprEl); - final Element opEl = doc.createElement("op"); - opEl.setAttribute("name", "GFN"); - exprEl.appendChild(opEl); - Element litEl = doc.createElement("literal"); - litEl.setAttribute("value", funcName); - litEl.setAttribute("type", Types.String.toString()); - opEl.appendChild(litEl); - - final ASTFormalParameterList paramList = ((ASTFormalParameterList) children[1]); - if (paramList.children != null) { - for (final Node argChild : paramList.children) { - final String argName = ((ASTIdentifier) argChild).value.toString(); - litEl = doc.createElement("literal"); - litEl.setAttribute("value", argName); - litEl.setAttribute("type", Types.String.toString()); - - opEl.appendChild(litEl); - } - } - - // for (final String id : args.keySet()) { - // litEl = doc.createElement("literal"); - // litEl.setAttribute("value", id); - // litEl.setAttribute("type", Types.String.toString()); - // - // opEl.appendChild(litEl); - // } - ((SimpleNode) children[2]).toXML(doc, opEl); - } - - @Override - public Types getExpressionType() { - return Types.GenFNDecl; - } - - /** - * @param args - * the args to set - */ - public void setArgs(LinkedHashMap args) { - this.args = args; - } - - /** - * @return the args - */ - public LinkedHashMap getArgs() { - return args; - } - - @Override - public Variable lookup(String var) { - if (args.containsKey(var)) { - return args.get(var); - } - return ((SimpleNode) parent).lookup(var); - } - - @Override - public Variable lookupNoError(String var) { - if (args.containsKey(var)) { - return args.get(var); - } - return ((SimpleNode) parent).lookupNoError(var); - } - - @Override - public HashMap getHMVars() { - return args; - } - - public String getFuncName() { - return ((ASTIdentifier) children[0]).value.toString(); - } -} -/* JavaCC - OriginalChecksum=ab8b9ef746ad34352444113bfe51f9e6 (do not edit this line) */ diff --git a/LARAC/src/org/dojo/jsl/parser/ast/ASTGeneratorFunctionExpression.java b/LARAC/src/org/dojo/jsl/parser/ast/ASTGeneratorFunctionExpression.java deleted file mode 100644 index b0f46a8de..000000000 --- a/LARAC/src/org/dojo/jsl/parser/ast/ASTGeneratorFunctionExpression.java +++ /dev/null @@ -1,186 +0,0 @@ -/* Generated By:JJTree: Do not edit this line. ASTGeneratorFunctionExpression.java Version 4.3 */ -/* - * JavaCCOptions:MULTI=true,NODE_USES_PARSER=false,VISITOR=false,TRACK_TOKENS=true,NODE_PREFIX=AST,NODE_EXTENDS=, - * NODE_FACTORY=,SUPPORT_CLASS_VISIBILITY_PUBLIC=true - */ -package org.dojo.jsl.parser.ast; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.LinkedHashMap; -import java.util.List; - -import org.w3c.dom.Document; -import org.w3c.dom.Element; - -import larac.objects.Enums.Types; -import larac.objects.Variable; - -public class ASTGeneratorFunctionExpression extends SimpleNode { - private LinkedHashMap args = new LinkedHashMap<>(); - private final List params = new ArrayList<>(); - private Types myType = Types.GFN; - private int pos = 0; - private boolean toXML = true; - private String funcName = ""; - - public ASTGeneratorFunctionExpression(int id) { - super(id); - } - - public ASTGeneratorFunctionExpression(LARAEcmaScript p, int id) { - super(p, id); - } - - @Override - public Object organize(Object obj) { - - if (parent instanceof ASTExpressionStatement) { - ((ASTExpressionStatement) parent).insertTag = false; - if (!(children[0] instanceof ASTIdentifier)) { - throw newException("Cannot declare a function without an identifier."); - } - funcName = ((ASTIdentifier) children[0]).value.toString(); - final Variable var = new Variable(funcName); - // var.setInitialize(this); - myType = Types.GenFNDecl; - var.setType(Types.GenFNDecl); - final HashMap parentVars = ((SimpleNode) parent).getHMVars(); - if (parentVars.containsKey(funcName)) { - throw newException("Identifier '" + funcName + "' already in use"); - } - parentVars.put(funcName, var); - final ASTFormalParameterList paramList = ((ASTFormalParameterList) children[1]); - if (paramList.children != null) { - for (final Node argChild : paramList.children) { - final String argName = ((ASTIdentifier) argChild).value.toString(); - if (args.containsKey(argName)) { - throw newException( - "Function \"" + funcName + "\" contains variables with the same name: " + argName); - } - final Variable argVar = new Variable(argName); - args.put(argName, argVar); - params.add(argName); - } - } - ((SimpleNode) children[2]).organize(obj); - ((SimpleNode) children[2]).insertTag = false; - - toXML = true; - } else { - if (children[0] instanceof ASTIdentifier) { - funcName = ((ASTIdentifier) children[0]).value.toString(); - pos++; - } - final ASTFormalParameterList paramList = ((ASTFormalParameterList) children[pos]); - if (paramList.children != null) { - for (final Node argChild : paramList.children) { - final String argName = ((ASTIdentifier) argChild).value.toString(); - if (args.containsKey(argName)) { - throw newException("Function expression contains variables with the same name: " + argName); - } - final Variable argVar = new Variable(argName); - args.put(argName, argVar); - params.add(argName); - } - } - ((SimpleNode) children[++pos]).organize(obj); - ((SimpleNode) children[pos]).insertTag = false; - } - return obj; - } - - @Override - public void toXML(Document doc, Element parent) { - if (!toXML) { - return; - } - if (myType.equals(Types.GenFNDecl)) { - final Element statEl = doc.createElement("statement"); - statEl.setAttribute("name", "genfndecl"); - statEl.setAttribute("coord", getCoords()); - parent.appendChild(statEl); - final Element exprEl = doc.createElement("expression"); - statEl.appendChild(exprEl); - final Element opEl = doc.createElement("op"); - opEl.setAttribute("name", "GFN"); - exprEl.appendChild(opEl); - Element litEl = doc.createElement("literal"); - litEl.setAttribute("value", funcName); - litEl.setAttribute("type", Types.String.toString()); - opEl.appendChild(litEl); - // for (final String id : args.keySet()) { - for (final String id : params) { - litEl = doc.createElement("literal"); - litEl.setAttribute("value", id); - litEl.setAttribute("type", Types.String.toString()); - opEl.appendChild(litEl); - } - ((SimpleNode) children[2]).toXML(doc, opEl); - toXML = false; - return; - } - final Element opEl = doc.createElement("op"); - opEl.setAttribute("name", "GFN"); - parent.appendChild(opEl); - Element litEl = doc.createElement("literal"); - litEl.setAttribute("value", funcName); - litEl.setAttribute("type", Types.String.toString()); - opEl.appendChild(litEl); - // for (final String id : args.keySet()) { - for (final String id : params) { - litEl = doc.createElement("literal"); - litEl.setAttribute("value", id); - litEl.setAttribute("type", Types.String.toString()); - opEl.appendChild(litEl); - } - ((SimpleNode) children[pos]).toXML(doc, opEl); - toXML = false; - } - - @Override - public Types getExpressionType() { - return Types.GFN; - } - - /** - * @param args - * the args to set - */ - public void setArgs(LinkedHashMap args) { - this.args = args; - } - - /** - * @return the args - */ - public LinkedHashMap getArgs() { - return args; - } - - @Override - public Variable lookup(String var) { - if (args.containsKey(var)) { - return args.get(var); - } - return ((SimpleNode) parent).lookup(var); - } - - @Override - public Variable lookupNoError(String var) { - if (args.containsKey(var)) { - return args.get(var); - } - return ((SimpleNode) parent).lookupNoError(var); - } - - @Override - public HashMap getHMVars() { - return args; - } - - public String getFuncName() { - return funcName; - } -} -/* JavaCC - OriginalChecksum=8ab604c185541f2c5b862d427e704d3a (do not edit this line) */ diff --git a/LARAC/src/org/dojo/jsl/parser/ast/ASTIdentifier.java b/LARAC/src/org/dojo/jsl/parser/ast/ASTIdentifier.java deleted file mode 100644 index b4abdf32f..000000000 --- a/LARAC/src/org/dojo/jsl/parser/ast/ASTIdentifier.java +++ /dev/null @@ -1,189 +0,0 @@ -/* Generated By:JJTree: Do not edit this line. ASTIdentifier.java Version 4.3 */ -/* - * JavaCCOptions:MULTI=true,NODE_USES_PARSER=false,VISITOR=false,TRACK_TOKENS=false,NODE_PREFIX=AST,NODE_EXTENDS=, - * NODE_FACTORY=,SUPPORT_CLASS_VISIBILITY_PUBLIC=true - */ -package org.dojo.jsl.parser.ast; - -import java.util.ArrayList; -import java.util.LinkedHashMap; - -import org.w3c.dom.Document; -import org.w3c.dom.Element; - -import larac.objects.Enums; -import larac.objects.Enums.Types; -import larac.objects.Variable; - -public class ASTIdentifier extends SimpleNode { - - private ASTCodeDef codeDef; - private final ArrayList codeParams = new ArrayList<>(); - private final LinkedHashMap codeMapping = new LinkedHashMap<>(); - - /** - * @return the var - */ - public Variable getVar() { - return var; - } - - /** - * @param var - * the var to set - */ - public void setVar(Variable var) { - this.var = var; - } - - private Variable var; - private String name; - - public ASTIdentifier(int id) { - super(id); - } - - public ASTIdentifier(LARAEcmaScript p, int id) { - super(p, id); - } - - public void setName(String image) { - name = image; - value = image; - } - - public String getName() { - return name; - } - - @Override - public String toSource(int indentation) { - return indent(indentation) + getName(); - } - - @Override - public Object organize(Object obj) { - /* if (isTemplate) { - codeDef = getLara().aspectIR().getCodedef(name); - if (codeDef == null) { - throw newException("Codedef '" + name + "' does not exist."); - } - if (codeDef.argsLength() != 0) { - throw newException("Codedef '" + name + "' requires " + codeDef.argsLength() + " arguments"); - } - - return Types.Code; - } - */ - if (value.toString().startsWith("$")) { - var = new Variable(value.toString(), Types.Joinpoint); - } else { - var = new Variable(value.toString()); - } - - if (var == null) { - throw newException("'" + value + "' is undefined"); - } - - return var.getType(); - } - - @Override - public void secondOrganize(ASTSelect sel) { - if (organize(null) == null) { - throw newException("The following variable does not exist: " + value); - } - } - - @Override - public void toXML(Document doc, Element parent) { - - if (name.equals(Types.Undefined.toString())) { - final Element literalEl = doc.createElement("literal"); - literalEl.setAttribute("value", name); - literalEl.setAttribute("type", Types.Undefined.toString()); - parent.appendChild(literalEl); - return; - } - - if (var == null) { - - final Element literalEl = doc.createElement("id"); - literalEl.setAttribute("name", name); - // literalEl.setAttribute("type", Types.String.toString()); - parent.appendChild(literalEl); - } else { - var.toXML(doc, parent); - } - } - - @Override - public Types getExpressionType() { - return var.getType(); - } - - public void getFields(ArrayList fields) { - if (getChildren() == null) { - return; - } - final ASTIdentifier id = (ASTIdentifier) getChildren()[0]; - fields.add(id.value.toString()); - id.getFields(fields); - } - - @Override - public void organizeLHS(Types type) { - - var = lookupNoError(value.toString()); - - if (var != null) { - return; - } - - var = new Variable(value.toString(), type); - getHMVars().put(value.toString(), var); - } - - @Override - public String getMethodId() { - return value.toString(); - } - - @Override - public String getVarName() { - return value.toString(); - } - - @Override - public void setIdVar(Variable var) { - this.var = var; - } - - @Override - public void toXMLTemplate(Document doc, Element parent) { - final Element literalEl = doc.createElement("literal"); - literalEl.setAttribute("type", Types.Object.toString()); - parent.appendChild(literalEl); - final Element propEl = doc.createElement("key"); - propEl.setAttribute("name", "'code'"); - literalEl.appendChild(propEl); - final Element stringEl = doc.createElement("literal"); - stringEl.setAttribute("type", Types.String.toString()); - propEl.appendChild(stringEl); - stringEl.setAttribute("value", codeDef.getName() + ".code"); - - for (final String prop : codeMapping.keySet()) { - final SimpleNode replace = codeMapping.get(prop); - final Element propertyKeyEl = doc.createElement("key"); - literalEl.appendChild(propertyKeyEl); - propertyKeyEl.setAttribute("name", Enums.SYMBOL_BEGIN + prop + Enums.SYMBOL_END); - replace.toXML(doc, propertyKeyEl); - } - codeTemplateArgumentsToXML(doc, literalEl, codeParams); - } - -} -/* - * JavaCC - OriginalChecksum=8697559df6eb5c3e8d25c919cffa1e63 (do not edit this - * line) - */ diff --git a/LARAC/src/org/dojo/jsl/parser/ast/ASTIfStatement.java b/LARAC/src/org/dojo/jsl/parser/ast/ASTIfStatement.java deleted file mode 100644 index f1d819a25..000000000 --- a/LARAC/src/org/dojo/jsl/parser/ast/ASTIfStatement.java +++ /dev/null @@ -1,70 +0,0 @@ -/* Generated By:JJTree: Do not edit this line. ASTIfStatement.java Version 4.3 */ -/* - * JavaCCOptions:MULTI=true,NODE_USES_PARSER=false,VISITOR=false,TRACK_TOKENS=false,NODE_PREFIX=AST,NODE_EXTENDS=, - * NODE_FACTORY=,SUPPORT_CLASS_VISIBILITY_PUBLIC=true - */ -package org.dojo.jsl.parser.ast; - -import org.w3c.dom.Document; -import org.w3c.dom.Element; - -public class ASTIfStatement extends SimpleNode { - public ASTIfStatement(int id) { - super(id); - } - - public ASTIfStatement(LARAEcmaScript p, int id) { - super(p, id); - } - - @Override - public Object organize(Object obj) { - final SimpleNode condition = (SimpleNode) getChildren()[0]; - condition.organize(obj); - final SimpleNode thenExp = (SimpleNode) getChildren()[1]; - thenExp.organize(obj); - if (getChildren().length == 3) { - final SimpleNode elseExp = (SimpleNode) getChildren()[2]; // Could - // be - // another - // IF - elseExp.organize(obj); - } - return obj; - } - - @Override - public void toXML(Document doc, Element parent) { - final Element stmtEl = doc.createElement("statement"); - stmtEl.setAttribute("name", "if"); - stmtEl.setAttribute("coord", getCoords()); - if (!label.isEmpty()) { - stmtEl.setAttribute("label", label); - } - parent.appendChild(stmtEl); - - final Element condEl = doc.createElement("expression"); - condEl.setAttribute("desc", "condition"); - final SimpleNode condition = (SimpleNode) getChildren()[0]; - condition.toXML(doc, condEl); - stmtEl.appendChild(condEl); - - final Element thenEl = doc.createElement("code"); - thenEl.setAttribute("desc", "then"); - final SimpleNode thenExp = (SimpleNode) getChildren()[1]; - thenExp.toXML(doc, thenEl); - stmtEl.appendChild(thenEl); - - final Element elseEl = doc.createElement("code"); - elseEl.setAttribute("desc", "else"); - if (getChildren().length == 3) { - final SimpleNode elseExp = (SimpleNode) getChildren()[2]; - elseExp.toXML(doc, elseEl); - } - stmtEl.appendChild(elseEl); - } -} -/* - * JavaCC - OriginalChecksum=29274ce9440edfe2601e9b72912ce2c8 (do not edit this - * line) - */ diff --git a/LARAC/src/org/dojo/jsl/parser/ast/ASTImport.java b/LARAC/src/org/dojo/jsl/parser/ast/ASTImport.java deleted file mode 100644 index 526edb6b3..000000000 --- a/LARAC/src/org/dojo/jsl/parser/ast/ASTImport.java +++ /dev/null @@ -1,428 +0,0 @@ -/* Generated By:JJTree: Do not edit this line. ASTImport.java Version 4.3 */ -/* - * JavaCCOptions:MULTI=true,NODE_USES_PARSER=false,VISITOR=false,TRACK_TOKENS=false,NODE_PREFIX=AST,NODE_EXTENDS=, - * NODE_FACTORY=,SUPPORT_CLASS_VISIBILITY_PUBLIC=true - */ -package org.dojo.jsl.parser.ast; - -import java.io.File; -import java.util.ArrayList; -import java.util.List; - -import org.dojo.jsl.parser.ast.utils.ASTJSImport; -import org.dojo.jsl.parser.ast.utils.ASTLaraImport; -import org.w3c.dom.Document; -import org.w3c.dom.Element; - -import larac.LaraC; -import larac.imports.LaraImports; -import larac.utils.output.MessageConstants; -import pt.up.fe.specs.util.SpecsIo; - -public class ASTImport extends SimpleNode { - - public ASTImport(int id) { - super(id); - } - - public ASTImport(LARAEcmaScript p, int id) { - super(p, id); - } - - @Override - public Object organize(Object obj) { - declareGlobal(getLara()); - return null; - } - - @Override - public void declareGlobal(LaraC lara) { - - // Add call to laraImport - getLara().getAspectIR() - .addGlobalStatement(new ASTLaraImport(getQualifiedImport())); - - /* - // Ignore imports if in documentation mode - if (lara.getOptions().isDocumentationMode()) { - return; - } - - // Transform into script import if in toJs mode - if (lara.isToJsMode()) { - toJsImport(lara); - return; - } - - String filePath = ""; - if (getChildren() != null) { - for (final Node n : getChildren()) { - filePath += ((ASTIdentifier) n).value + File.separator; - } - } - - MessageConstants.addSpace(); - if (value.equals("*")) { - - importAllLara(lara, filePath); - - } else { - // String fileName = value + ".lara"; - // var validLaraImport = importSingleLara(lara, value + ".lara", filePath); - // var validScriptImport = importSingleScript(lara, value.toString(), filePath); - - var validImport = importSingleName(lara, value.toString(), filePath); - - // var validImport = validLaraImport || validScriptImport; - if (!validImport) { - var importValue = filePath + value; - var exts = LaraC.getSupportedExtensions().stream().collect(Collectors.joining(", .", ".", "")); - throw newException( - "No valid file (" + exts + ") was found in the included folders/resources for the import: " - + importValue); - } - - } - MessageConstants.removeSpace(); - lara.println(""); - */ - } - - private void toJsImport(LaraC lara) { - // System.out.println("LABEL: " + label); - lara.getAspectIR() - .addGlobalStatement(new ASTJSImport(getQualifiedImport())); - - } - - private List getQualifiedImport() { - var qualifiedImport = new ArrayList(); - - if (getChildren() != null) { - for (final Node n : getChildren()) { - qualifiedImport.add(((ASTIdentifier) n).value.toString()); - } - } - - qualifiedImport.add(value.toString()); - - return qualifiedImport; - } - - /** - * Imports all lara files/resources containing the input file path prefix - * - * @param lara - * @param filePath - */ - private void importAllLara(final LaraC lara, String filePath) { - - boolean anyImported = false; - - // 1. - // Search all included folders that contains the path as child - for (final File path : lara.getOptions().getIncludeFolders()) { - if ((new File(path, filePath).exists())) { - - final File importingDir = new File(path, filePath); - - importLaraFiles(importingDir, filePath, lara); - anyImported = true; - } - } - - // 2. - // Search the resources defined in the given package; - - var resources = lara.getOptions().getIncludeResourcesMap().get(filePath); - // List resources = lara.getOptions().getIncludeResources().stream() - // // .filter(r -> r.getResourceLocation().replace("/", File.separator).equals(filePath)) - // .filter(r -> r.getFileLocation().replace("/", File.separator).equals(filePath)) - // .collect(Collectors.toList()); - if (!resources.isEmpty()) { - resources.forEach(r -> LaraImports.importLaraResource(lara, filePath, r)); - anyImported = true; - } - - if (!anyImported) { - throw newException("No aspect was found in the included folder for the aspect file: " - + filePath.replace("*.lara", "")); - } - } - - private void importLaraFiles(final File importingDir, String filePath, final LaraC lara) { - lara.printSubTopic("Importing all lara files from " + importingDir.getAbsolutePath()); - if (!importingDir.isDirectory()) { - throw newException("Import: The following path is not a directory: " + importingDir); - } - - MessageConstants.addSpace(); - final File[] files = importingDir.listFiles(); - if (files.length != 0) { - for (final File importingLaraFile : files) { - var extension = SpecsIo.getExtension(importingLaraFile); - if (importingLaraFile.isFile() && LaraC.getSupportedExtensions().contains(extension)) { - LaraImports.importLaraFile(lara, filePath, importingLaraFile); - } - } - } else { - lara.warnln("No LARA files to import."); - } - MessageConstants.removeSpace(); - } - - /** - * Import a single lara file with a given name, in the file path - * - * @param lara - * @param fileName - * @param filePath - * @return true if the file was a valid .lara file for import, false otherwise - */ - // private boolean importSingleLara(final LaraC lara, String fileName, String filePath) { - // String relativePath = filePath + fileName; - // - // // 1. - // // Check include folders - // for (final File path : lara.getOptions().getIncludeFolders()) { - // final File importingFile = new File(path, relativePath); - // if (importingFile.exists()) { - // lara.printSubTopic("Importing " + importingFile); - // importLaraFile(lara, relativePath, importingFile); - // return true; - // } - // } - // - // // 2. - // // Check resource by filename, instead of resource name - // Optional findFirst = lara.getOptions().getIncludeResources().stream() - // // .filter(r -> r.getResource().replace("/", File.separator).equals(relativePath)) - // .filter(r -> r.getFileLocation().replace("/", File.separator).equals(relativePath)) - // .findFirst(); - // - // if (findFirst.isPresent()) { - // importLaraResource(lara, relativePath, findFirst.get()); - // return true; - // } - // - // return false; - // - // // throw newException( - // // "No aspect was found in the included folders/resources for the aspect file: " + relativePath); - // - // } - - /** - * Imports a single file (either .js or .lara) with a given name, in the file path - * - * @param lara - * @param fileName - * @param filePath - */ - // private boolean importSingleScript(final LaraC lara, String fileName, String filePath) { - // String relativePath = filePath + fileName; - // - // var filesToCheck = getFilesToCheck(lara, relativePath); - // - // var foundImport = false; - // - // // 1. - // // Check include folders - // for (final File path : lara.getOptions().getIncludeFolders()) { - // for (var ext : LaraC.getSupportedScriptExtensions()) { - // var filepath = relativePath + "." + ext; - // - // final File importingFile = new File(path, filepath); - // if (importingFile.exists()) { - // lara.printSubTopic("Importing " + importingFile); - // importLaraFile(lara, filepath, importingFile); - // foundImport = true; - // break; - // } - // } - // } - // - // // 2. - // // Check resource by filename, instead of resource name - // for (var ext : LaraC.getSupportedScriptExtensions()) { - // var filepath = relativePath + "." + ext; - // - // Optional findFirst = lara.getOptions().getIncludeResources().stream() - // .filter(r -> r.getFileLocation().replace("/", File.separator).equals(filepath)) - // .findFirst(); - // - // if (findFirst.isPresent()) { - // importLaraResource(lara, filepath, findFirst.get()); - // - // // importScriptFile(lara, filepath, findFirst.get()); - // foundImport = true; - // break; - // } - // - // } - // - // return foundImport; - // - // } - - /** - * Imports all files associated with a single import name (e.g. .lara, .js). - * - *

- * For instance, if filePath and fileName resolve to lara.EgImport, will import lara/EgImport.lara and - * lara/EgImport.js, if they exist. - * - * @param lara - * @param fileName - * @param filePath - */ - private boolean importSingleName(final LaraC lara, String fileName, String filePath) { - - // Get LARA imports - var laraImports = lara.getOptions().getLaraImports(fileName, filePath); - - laraImports.stream().forEach(laraImport -> laraImport.resolveImport(lara)); - - // true if there where imports found - return !laraImports.isEmpty(); - - /* - String relativePath = filePath + fileName; - - var foundImport = false; - - // var filesToCheck = getFilesToCheck(lara, relativePath); - - // 1. - // Check include folders - for (final File path : lara.getOptions().getIncludeFolders()) { - for (var ext : LaraC.getSupportedExtensions()) { - var importPath = relativePath + "." + ext; - - final File importingFile = new File(path, importPath); - if (importingFile.exists()) { - lara.printSubTopic("Importing " + importingFile); - LaraImports.importLaraFile(lara, importPath, importingFile); - foundImport = true; - } - } - } - - // 2. - // Check resource by filename, instead of resource name - for (var ext : LaraC.getSupportedExtensions()) { - var importPath = relativePath + "." + ext; - - var resource = lara.getOptions().getIncludeResourcesMap().get(importPath); - if (!resource.isEmpty()) { - LaraImports.importLaraResource(lara, importPath, resource.get(0)); - - // importScriptFile(lara, filepath, findFirst.get()); - foundImport = true; - } - - // Optional findFirst = lara.getOptions().getIncludeResources().stream() - // .filter(r -> r.getFileLocation().replace("/", File.separator).equals(importPath)) - // .findFirst(); - // - // if (findFirst.isPresent()) { - // importLaraResource(lara, importPath, findFirst.get()); - // - // // importScriptFile(lara, filepath, findFirst.get()); - // foundImport = true; - // } - - } - - return foundImport; - */ - } - - /* - private boolean importFromResource(final LaraC lara, String relativePath) { - - // Check resource by filename, instead of resource name - Optional findFirst = lara.getOptions().getIncludeResources().stream() - // .filter(r -> r.getResource().replace("/", File.separator).equals(relativePath)) - .filter(r -> r.getFileLocation().replace("/", File.separator).equals(relativePath)) - .findFirst(); - - if (findFirst.isPresent()) { - importLaraResource(lara, relativePath, findFirst.get()); - return true; - } - - return false; - } - */ - /* - private boolean importFromInclude(final LaraC lara, String fileName, String filePath) { - String relativePath = filePath + fileName; - - for (final File path : lara.getOptions().getIncludeFolders()) { - final File importingFile = new File(path, relativePath); - if (importingFile.exists()) { - lara.printSubTopic("Importing " + importingFile); - if (!importingFile.exists()) { - throw newException( - "Import: Could not find file '" + fileName + "' on file path: " + path + relativePath); - } - - importLaraFile(lara, relativePath, importingFile); - return true; - } - } - - return false; - } - */ - - // private List getFilesToCheck(LaraC lara, String relativePath) { - // - // var filesToCheck = new ArrayList(); - // - // for (final File path : lara.getOptions().getIncludeFolders()) { - // for (var ext : LaraC.getSupportedScriptExtensions()) { - // filesToCheck.add(relativePath + "." + ext); - // } - // } - // - // return filesToCheck; - // } - - // @Override - // public void globalToXML(Document doc, Element parent) { - // SpecsCheck.checkArgument(parent.getNodeName().equals("aspects"), - // () -> "Expected node to be 'aspects', is '" + parent.getNodeName() + "'"); - // - // // HACK: To avoid regeneration the Java classes from XML, using attributes Statement already has - // final Element statementDeclEl = doc.createElement("declaration"); - // statementDeclEl.setAttribute("name", "ScriptImport"); - // statementDeclEl.setAttribute("coord", path); - // statementDeclEl.setAttribute("desc", scriptContents.get()); - // // statementDeclEl.setAttribute("script", scriptContents.get()); - // // final Element statementDeclEl = doc.createElement("scriptImport"); - // // statementDeclEl.setNodeValue(scriptContents.get()); - // - // // System.out.println("PARENT: " + parent.getNodeName()); - // // final Element statementDeclEl = doc.createElement("scriptImport"); - // // statementDeclEl.setNodeValue(scriptContents.get()); - // // statementDeclEl.setAttribute("name", "scriptImport"); - // // statementDeclEl.setAttribute("path", path); - // // statementDeclEl.setAttribute("script", scriptContents.get()); - // // statementDeclEl.setAttribute("coord", getCoords()); - // // addXMLComent(statementDeclEl); - // parent.appendChild(statementDeclEl); - // toXML(doc, statementDeclEl); - // } - - @Override - public void toXML(Document doc, Element parent) { - // System.out.println("PARENT: " + parent.getNodeName()); - - } -} -/* - * JavaCC - OriginalChecksum=70d3639852523f4c77e45a34861ed251 (do not edit this - * line) - */ diff --git a/LARAC/src/org/dojo/jsl/parser/ast/ASTInclude.java b/LARAC/src/org/dojo/jsl/parser/ast/ASTInclude.java deleted file mode 100644 index 0fe75c9f9..000000000 --- a/LARAC/src/org/dojo/jsl/parser/ast/ASTInclude.java +++ /dev/null @@ -1,21 +0,0 @@ -/* Generated By:JJTree: Do not edit this line. ASTInclude.java Version 4.3 */ -/* - * JavaCCOptions:MULTI=true,NODE_USES_PARSER=false,VISITOR=false,TRACK_TOKENS=false,NODE_PREFIX=AST,NODE_EXTENDS=, - * NODE_FACTORY=,SUPPORT_CLASS_VISIBILITY_PUBLIC=true - */ -package org.dojo.jsl.parser.ast; - -public class ASTInclude extends SimpleNode { - public ASTInclude(int id) { - super(id); - } - - public ASTInclude(LARAEcmaScript p, int id) { - super(p, id); - } - -} -/* - * JavaCC - OriginalChecksum=13a79f3491a3f2efc06dbcd9003d4157 (do not edit this - * line) - */ diff --git a/LARAC/src/org/dojo/jsl/parser/ast/ASTInitialize.java b/LARAC/src/org/dojo/jsl/parser/ast/ASTInitialize.java deleted file mode 100644 index 1f5ed4377..000000000 --- a/LARAC/src/org/dojo/jsl/parser/ast/ASTInitialize.java +++ /dev/null @@ -1,40 +0,0 @@ -/* Generated By:JJTree: Do not edit this line. ASTInitialize.java Version 4.3 */ -/* - * JavaCCOptions:MULTI=true,NODE_USES_PARSER=false,VISITOR=false,TRACK_TOKENS=false,NODE_PREFIX=AST,NODE_EXTENDS=, - * NODE_FACTORY=,SUPPORT_CLASS_VISIBILITY_PUBLIC=true - */ -package org.dojo.jsl.parser.ast; - -import org.w3c.dom.Document; -import org.w3c.dom.Element; - -public class ASTInitialize extends SimpleNode { - public ASTInitialize(int id) { - super(id); - } - - public ASTInitialize(LARAEcmaScript p, int id) { - super(p, id); - } - - @Override - public Object organize(Object obj) { - if (((SimpleNode) getChildren()[0]).getChildren() == null) { - return null; - } - ((SimpleNode) getChildren()[0]).organize(obj); - ((ASTAspectDef) parent).setInitialize(this); - return null; - } - - @Override - public void toXML(Document doc, Element parent) { - final Element initEl = doc.createElement("initialize"); - parent.appendChild(initEl); - ((SimpleNode) getChildren()[0]).toXML(doc, initEl); - } -} -/* - * JavaCC - OriginalChecksum=e670fa2115c280692f65386d9b0bdfb4 (do not edit this - * line) - */ diff --git a/LARAC/src/org/dojo/jsl/parser/ast/ASTInput.java b/LARAC/src/org/dojo/jsl/parser/ast/ASTInput.java deleted file mode 100644 index fe9fc3262..000000000 --- a/LARAC/src/org/dojo/jsl/parser/ast/ASTInput.java +++ /dev/null @@ -1,66 +0,0 @@ -/* Generated By:JJTree: Do not edit this line. ASTInput.java Version 4.3 */ -/* - * JavaCCOptions:MULTI=true,NODE_USES_PARSER=false,VISITOR=false,TRACK_TOKENS=false,NODE_PREFIX=AST,NODE_EXTENDS=, - * NODE_FACTORY=,SUPPORT_CLASS_VISIBILITY_PUBLIC=true - */ -package org.dojo.jsl.parser.ast; - -import java.util.HashMap; - -import larac.objects.Variable; - -public class ASTInput extends SimpleNode { - public ASTInput(int id) { - super(id); - } - - public ASTInput(LARAEcmaScript p, int id) { - super(p, id); - } - - @Override - public Object organize(Object obj) { - final ASTAspectDef asp = (ASTAspectDef) parent; - - // if (!asp.getInputs().isEmpty()) { - if (asp.getInputsNode() != null) { - throw newException("Can only have one input section!"); - } - asp.setInputsNode(this); - // - if (getChildren() == null) { - return null; - } - ((SimpleNode) getChildren()[0]).organize(this); - return null; - } - - @Override - public HashMap getHMVars() { - return ((ASTAspectDef) parent).getInputs(); - } - - @Override - public String toSource(int indentation) { - - String source = indent(indentation) + "input"; - if (getChildren() == null) { - return source + " end"; - } - SimpleNode child = getChild(0); - if (child instanceof ASTVariableDeclarationList) { - if (child.getChildren() != null) { - for (final Node n : child.getChildren()) { - source += "\n" + ((SimpleNode) n).toSource(indentation + 1); - } - } - } else { - source += "\n" + child.toSource(indentation + 1); - } - return source + "\n" + indent(indentation) + "end"; - } -} -/* - * JavaCC - OriginalChecksum=4e4b76905016ac2c5b045b1fa76fe04f (do not edit this - * line) - */ diff --git a/LARAC/src/org/dojo/jsl/parser/ast/ASTInputList.java b/LARAC/src/org/dojo/jsl/parser/ast/ASTInputList.java deleted file mode 100644 index 0f4eb862a..000000000 --- a/LARAC/src/org/dojo/jsl/parser/ast/ASTInputList.java +++ /dev/null @@ -1,21 +0,0 @@ -/* Generated By:JJTree: Do not edit this line. ASTInputList.java Version 4.3 */ -/* - * JavaCCOptions:MULTI=true,NODE_USES_PARSER=false,VISITOR=false,TRACK_TOKENS=false,NODE_PREFIX=AST,NODE_EXTENDS=, - * NODE_FACTORY=,SUPPORT_CLASS_VISIBILITY_PUBLIC=true - */ -package org.dojo.jsl.parser.ast; - -public class ASTInputList extends SimpleNode { - public ASTInputList(int id) { - super(id); - } - - public ASTInputList(LARAEcmaScript p, int id) { - super(p, id); - } - -} -/* - * JavaCC - OriginalChecksum=76f7005148588ad22f69afab042d69c9 (do not edit this - * line) - */ diff --git a/LARAC/src/org/dojo/jsl/parser/ast/ASTInsert.java b/LARAC/src/org/dojo/jsl/parser/ast/ASTInsert.java deleted file mode 100644 index e475d58d3..000000000 --- a/LARAC/src/org/dojo/jsl/parser/ast/ASTInsert.java +++ /dev/null @@ -1,315 +0,0 @@ -/* Generated By:JJTree: Do not edit this line. ASTInsert.java Version 4.3 */ -/* - * JavaCCOptions:MULTI=true,NODE_USES_PARSER=false,VISITOR=false,TRACK_TOKENS=false,NODE_PREFIX=AST,NODE_EXTENDS=, - * NODE_FACTORY=,SUPPORT_CLASS_VISIBILITY_PUBLIC=true - */ -package org.dojo.jsl.parser.ast; - -import java.io.UnsupportedEncodingException; -import java.util.ArrayList; -import java.util.LinkedHashMap; -import java.util.Map; - -import javax.xml.bind.DatatypeConverter; - -import org.w3c.dom.Document; -import org.w3c.dom.Element; - -import larac.objects.Enums; -import larac.objects.Enums.Types; -import larac.utils.xml.entity.ActionArgument; - -public class ASTInsert extends SimpleNode { - private String when; - private String language; - private ASTCodeDef codeDef; - private String codeFileName; - private boolean pureCode; - private final ArrayList codeParams = new ArrayList<>(); - private Map codeMapping = new LinkedHashMap<>(); - - public ASTInsert(int id) { - super(id); - } - - public ASTInsert(LARAEcmaScript p, int id) { - super(p, id); - } - - public void setWhen(String when) { - this.when = when; - value = when; - } - - public String getWhen() { - return when; - } - - @Override - public String toString() { - return LARAEcmaScriptTreeConstants.jjtNodeName[id] + " [" + when + "," + language + "]"; - } - - /** - * @param language - * the language to set - */ - public void setLanguage(String language) { - this.language = language; - } - - /** - * @return the language - */ - public String getLanguage() { - return language; - } - - /** - * @param codeMapping - * the paramMapping to set - */ - public void setCodeMapping(LinkedHashMap codeMapping) { - this.codeMapping = codeMapping; - } - - /** - * @return the paramMapping - */ - public Map getCodeMapping() { - return codeMapping; - } - - @Override - public Object organize(Object obj) { - - final ASTAction act = (ASTAction) parent; - act.setMethod("insert"); - // act.setArguments(OrganizeUtils.createInsertParameters(getLara().languageSpec())); - act.setArguments(getLara().getOrganizer().createInsertParameters()); - final Map arguments = act.getArguments(); - if (jjtGetChild(0) instanceof ASTFunctionCallParameters) { - final ASTFunctionCallParameters params = (ASTFunctionCallParameters) jjtGetChild(0); - if (params.areNamed) { - for (final Node param : params.getChildren()) { - final ASTNamedArgument na = (ASTNamedArgument) param; - if (!arguments.containsKey(na.value)) { - throw newException("The argument '" + na.value + "' does not exist for action 'insert'"); - } - final ActionArgument actArg = arguments.get(na.value); - // if (na.value.equals("code")) { - // verifyCodeDef(na.jjtGetChild(0), arguments); - // } else { - na.organize(obj); - actArg.setValue((SimpleNode) na.jjtGetChild(0)); - // } - } - } else { - if (params.getChildren().length != arguments.size()) { - throw newException("Illegal number of arguments for action 'insert'"); - } - params.getChild(0).organize(this); - arguments.get("position").setValue(params.getChild(0)); - params.getChild(1).organize(this); - arguments.get("code").setValue(params.getChild(1)); - // verifyCodeDef(params.jjtGetChild(1), arguments); - } - } else { - arguments.get("position").setValue(when); - // if (children[0] instanceof ASTLiteral) { - // ((SimpleNode) children[0]).organize(this); - // arguments.get("code").setValue((SimpleNode) children[0]); - // } else { - SimpleNode codeExpr = getChild(0); - codeExpr.organize(this); - arguments.get("code").setValue(codeExpr); - // verifyCodeDef(children[0], arguments); - // } - } - return null; - } - - /* - private void verifyCodeDef(Node node, Map arguments) { - String codeName = ""; - if (node instanceof ASTLiteral) { // This will never happen! - ((SimpleNode) node).organize(this); - - arguments.get("code").setValue((SimpleNode) node); - return; - } - if (node instanceof ASTIdentifier) { - codeName = ((ASTIdentifier) node).value.toString(); - // codeDef = getLara().aspectIR().getCodedef(codeName); - // if (codeDef == null) { - Variable lookupNoError = lookupNoError(codeName); - if (lookupNoError == null) { - // getLara().warnln("Did not find a codedef but found : " + lookupNoError.getName()); - // } else { - throw newException("No codedef nor variable was found for name '" + codeName + "'."); - } - // }else - // throw newException("No Codedef nor variable exists with name '" + codeName + "'."); - // } - } else if (node instanceof ASTCompositeReference) { - - codeName = ((ASTIdentifier) node.jjtGetChild(0)).value.toString(); - // codeDef = getLara().aspectIR().getCodedef(codeName); - final ASTFunctionCallParameters params = (ASTFunctionCallParameters) node.jjtGetChild(1); - // if (codeDef == null) { - // Variable lookupNoError = lookupNoError(codeName); - // if (lookupNoError != null) { - // getLara().warnln("Did not find a codedef but found : " + lookupNoError.getName()); - // } else { - // throw newException("No codedef nor variable was found for name '" + codeName + "'."); - // } - // params.organize(this); - // } else { - - for (final String arg : codeDef.getArguments()) { - codeMapping.put(arg, null); - } - - organizeArguments(params); - // } - - } else { - throw newException("Argument 'code' for insert is invalid."); - } - - arguments.get("code").setValue(this); - } - - private void organizeArguments(ASTFunctionCallParameters astFunctionCallParameters) { - if (astFunctionCallParameters.areNamed) { - for (final Node node : astFunctionCallParameters.getSimpleNodeChildren()) { - final ASTNamedArgument named = (ASTNamedArgument) node; - if (!codeDef.getArguments().contains(named.value)) { - throw newException("In Action 'insert': '" + named.value + "' does not exist."); - } - ((SimpleNode) named.getChildren()[0]).organize(this); - getCodeMapping().put(named.value.toString(), (SimpleNode) named.getChildren()[0]); - } - } else { - for (final SimpleNode node : astFunctionCallParameters.getSimpleNodeChildren()) { - final String arg = getParamWithNoValue(); - if (arg == null) { - throw newException("In Action 'insert': Illegal number of arguments"); - } - node.organize(this); - codeMapping.put(arg, node); - } - } - - for (final SimpleNode sn : codeMapping.values()) { - if (sn == null) { - String unsigned = ""; - for (final String nulls : codeMapping.keySet()) { - if (codeMapping.get(nulls) == null) { - unsigned += nulls + ","; - } - } - unsigned = unsigned.substring(0, unsigned.length() - 1); - throw newException("In Action 'insert': not all codedef arguments are set: " + unsigned); - } - } - } - - private String getParamWithNoValue() { - for (final String param : codeMapping.keySet()) { - if (codeMapping.get(param) == null) { - return param; - } - } - return null; - } - */ - /** - * @param codeDef - * the codeDef to set - */ - public void setCodeDef(ASTCodeDef codeDef) { - this.codeDef = codeDef; - } - - /** - * @return the codeDef - */ - public ASTCodeDef getCodeDef() { - return codeDef; - } - - /** - * @param codeFileName - * the codeFileName to set - */ - public void setCodeFileName(String codeFileName) { - this.codeFileName = codeFileName; - } - - /** - * @return the codeFileName - */ - public String getCodeFileName() { - return codeFileName; - } - - /** - * @param pureCode - * the pureCode to set - */ - public void setPureCode(boolean pureCode) { - this.pureCode = pureCode; - } - - /** - * @return the pureCode - */ - public boolean isPureCode() { - return pureCode; - } - - @Override - public void toXMLTemplate(Document doc, Element parent) { - - final Element literalEl = doc.createElement("literal"); - literalEl.setAttribute("type", Types.Object.toString()); - literalEl.setAttribute("desc", Types.Code.toString()); - parent.appendChild(literalEl); - final Element propEl = doc.createElement("key"); - propEl.setAttribute("name", "code"); - literalEl.appendChild(propEl); - if (codeDef != null) { - addCodeDef(doc, propEl); - } else { - getChild(0).toXML(doc, propEl); - } - - for (final String prop : codeMapping.keySet()) { - final SimpleNode replace = codeMapping.get(prop); - final Element propertyKeyEl = doc.createElement("key"); - literalEl.appendChild(propertyKeyEl); - propertyKeyEl.setAttribute("name", Enums.SYMBOL_BEGIN + prop + Enums.SYMBOL_END); - replace.toXML(doc, propertyKeyEl); - } - codeTemplateArgumentsToXML(doc, literalEl, codeParams); - } - - public void addCodeDef(Document doc, final Element propEl) { - final Element stringEl = doc.createElement("literal"); - stringEl.setAttribute("type", Types.Base64.toString()); - propEl.appendChild(stringEl); - try { - final String codeBase64 = DatatypeConverter.printBase64Binary(codeDef.getCode().getBytes("UTF-8")); - stringEl.setAttribute("value", codeBase64); - } catch (final UnsupportedEncodingException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - } - -} -/* - * JavaCC - OriginalChecksum=dc1f61881b611a8788d045963882552a (do not edit this - * line) - */ diff --git a/LARAC/src/org/dojo/jsl/parser/ast/ASTJavaScript.java b/LARAC/src/org/dojo/jsl/parser/ast/ASTJavaScript.java deleted file mode 100644 index bd85aa291..000000000 --- a/LARAC/src/org/dojo/jsl/parser/ast/ASTJavaScript.java +++ /dev/null @@ -1,89 +0,0 @@ -/* Generated By:JJTree: Do not edit this line. ASTJavaScript.java Version 4.3 */ -/* - * JavaCCOptions:MULTI=true,NODE_USES_PARSER=false,VISITOR=false,TRACK_TOKENS=false,NODE_PREFIX=AST,NODE_EXTENDS=, - * NODE_FACTORY=,SUPPORT_CLASS_VISIBILITY_PUBLIC=true - */ -package org.dojo.jsl.parser.ast; - -import java.util.HashMap; - -import org.w3c.dom.Document; -import org.w3c.dom.Element; - -import larac.objects.SymbolTable; -import larac.objects.Variable; - -public class ASTJavaScript extends SimpleNode { - private SymbolTable localVars = new SymbolTable<>(); - - public ASTJavaScript(int id) { - super(id); - } - - public ASTJavaScript(LARAEcmaScript p, int id) { - super(p, id); - } - - @Override - public Object organize(Object obj) { - if (getChildren() != null) { - for (final Node child : getChildren()) { - ((SimpleNode) child).organize(obj); - } - } - return null; - } - - @Override - public void toXML(Document doc, Element parent) { - // createXMLDecl(localVars.values(), doc, parent); - - if (getChildren() != null) { - for (final Node node : getChildren()) { - ((SimpleNode) node).toXML(doc, parent); - } - } - } - - /** - * @param localVars - * the localVars to set - */ - public void setLocalVars(SymbolTable localVars) { - this.localVars = localVars; - } - - /** - * @return the localVars - */ - public SymbolTable getLocalVars() { - return localVars; - } - - @Override - public Variable lookup(String var) { - if (localVars.containsKey(var)) { - return localVars.get(var); - } - return ((SimpleNode) parent).lookup(var); - } - - @Override - public Variable lookupNoError(String var) { - - if (localVars.containsKey(var)) { - return localVars.get(var); - } - - return ((SimpleNode) parent).lookupNoError(var); - } - - @Override - public HashMap getHMVars() { - return localVars; - } -} -/* - * JavaCC - OriginalChecksum=f7b7ff61dae1ae6df2aaefd3fd88c256 (do not edit this - * line) - */ diff --git a/LARAC/src/org/dojo/jsl/parser/ast/ASTJoin.java b/LARAC/src/org/dojo/jsl/parser/ast/ASTJoin.java deleted file mode 100644 index 6508421d0..000000000 --- a/LARAC/src/org/dojo/jsl/parser/ast/ASTJoin.java +++ /dev/null @@ -1,100 +0,0 @@ -/* Generated By:JJTree: Do not edit this line. ASTJoin.java Version 4.3 */ -/* - * JavaCCOptions:MULTI=true,NODE_USES_PARSER=false,VISITOR=false,TRACK_TOKENS=false,NODE_PREFIX=AST,NODE_EXTENDS=, - * NODE_FACTORY=,SUPPORT_CLASS_VISIBILITY_PUBLIC=true - */ -package org.dojo.jsl.parser.ast; - -import org.w3c.dom.Document; -import org.w3c.dom.Element; - -import larac.objects.Enums.JoinOperator; -import larac.objects.Variable; - -public class ASTJoin extends SimpleNode { - public SimpleNode leftObj; - public SimpleNode rightObj; - - public ASTJoin(int id) { - super(id); - } - - public ASTJoin(LARAEcmaScript p, int id) { - super(p, id); - } - - @Override - public Object organize(Object obj) { - final ASTAspectDef aspectDef = (ASTAspectDef) obj; - // final ASTAspectDef aspectDef = getAspectDefForDeclStmt("Join "); - final SimpleNode leftChild = (SimpleNode) getChildren()[0]; - final SimpleNode rightChild = (SimpleNode) getChildren()[1]; - final ASTSelect parentSelect = (ASTSelect) getParentById(LARAEcmaScriptTreeConstants.JJTSELECT); - leftObj = setAJoinSide(aspectDef, leftChild, parentSelect); - rightObj = setAJoinSide(aspectDef, rightChild, parentSelect); - return null; - } - - private SimpleNode setAJoinSide(ASTAspectDef aspectDef, SimpleNode pcChild, ASTSelect parentSelect) { - SimpleNode pcExpr; - if (pcChild instanceof ASTJoin) { - pcChild.organize(aspectDef); - pcExpr = pcChild; - } else { - final ASTIdentifier ident = (ASTIdentifier) pcChild; - pcExpr = aspectDef.getSelect(ident.value.toString()); - if (pcExpr == null) { - throw newException("Select '" + ident.value + "' is undefined"); - } - - // Undesired code, since it was doing nothing useful and was only - // creating bugs! - // ASTSelect leftSelect = (ASTSelect) pcExpr; - // for (String key : leftSelect.getPointcuts().keySet()) - // parentSelect.putPointcut(key, leftSelect.getPointcut(key)); - } - return pcExpr; - } - - @Override - public Object organizeFirst(Object obj, int i) { - return organize(obj); - } - - @Override - public void toXML(Document doc, Element parent) { - final JoinOperator tag = JoinOperator.getOpTag(value.toString()); - - final Element joinEl = doc.createElement("op"); - joinEl.setAttribute("name", tag.toString()); - parent.appendChild(joinEl); - if (getChildren()[0] instanceof ASTIdentifier) { - createPointcutElement(doc, joinEl, 0); - } else { - ((SimpleNode) getChildren()[0]).toXML(doc, joinEl); - } - if (getChildren()[1] instanceof ASTIdentifier) { - createPointcutElement(doc, joinEl, 1); - } else { - ((SimpleNode) getChildren()[1]).toXML(doc, joinEl); - } - } - - private void createPointcutElement(Document doc, Element joinEl, int i) { - final Element pcEl = doc.createElement("id"); - pcEl.setAttribute("name", ((SimpleNode) getChildren()[i]).value.toString()); - // pcEl.setAttribute("type", "JoinSet"); - joinEl.appendChild(pcEl); - } - - @Override - public Variable lookupLastJPVariable() { - - return rightObj.lookupLastJPVariable(); - } - -} -/* - * JavaCC - OriginalChecksum=a7f54d8229a9a8b322a56732cea28a8e (do not edit this - * line) - */ diff --git a/LARAC/src/org/dojo/jsl/parser/ast/ASTLabelledStatement.java b/LARAC/src/org/dojo/jsl/parser/ast/ASTLabelledStatement.java deleted file mode 100644 index 48ed660da..000000000 --- a/LARAC/src/org/dojo/jsl/parser/ast/ASTLabelledStatement.java +++ /dev/null @@ -1,39 +0,0 @@ -/* Generated By:JJTree: Do not edit this line. ASTLabelledStatement.java Version 4.3 */ -/* - * JavaCCOptions:MULTI=true,NODE_USES_PARSER=false,VISITOR=false,TRACK_TOKENS=false,NODE_PREFIX=AST,NODE_EXTENDS=, - * NODE_FACTORY=,SUPPORT_CLASS_VISIBILITY_PUBLIC=true - */ -package org.dojo.jsl.parser.ast; - -import org.w3c.dom.Document; -import org.w3c.dom.Element; - -public class ASTLabelledStatement extends SimpleNode { - public ASTLabelledStatement(int id) { - super(id); - } - - public ASTLabelledStatement(LARAEcmaScript p, int id) { - super(p, id); - } - - @Override - public Object organize(Object obj) { - final String label = ((ASTIdentifier) getChildren()[0]).value.toString(); - if (lookupLabel(label) != null) { - throw newException("Duplicated label: " + label); - } - ((SimpleNode) getChildren()[1]).label = label; - ((SimpleNode) getChildren()[1]).organize(obj); - return null; - } - - @Override - public void toXML(Document doc, Element parent) { - ((SimpleNode) getChildren()[1]).toXML(doc, parent); - } -} -/* - * JavaCC - OriginalChecksum=85d80aae31823079b4111bf08ef25c33 (do not edit this - * line) - */ diff --git a/LARAC/src/org/dojo/jsl/parser/ast/ASTLiteral.java b/LARAC/src/org/dojo/jsl/parser/ast/ASTLiteral.java deleted file mode 100644 index 7ecad9d60..000000000 --- a/LARAC/src/org/dojo/jsl/parser/ast/ASTLiteral.java +++ /dev/null @@ -1,212 +0,0 @@ -/* Generated By:JJTree: Do not edit this line. ASTLiteral.java Version 4.3 */ -/* - * JavaCCOptions:MULTI=true,NODE_USES_PARSER=false,VISITOR=false,TRACK_TOKENS=false,NODE_PREFIX=AST,NODE_EXTENDS=, - * NODE_FACTORY=,SUPPORT_CLASS_VISIBILITY_PUBLIC=true - */ -package org.dojo.jsl.parser.ast; - -import java.io.UnsupportedEncodingException; -import java.util.List; - -import javax.xml.bind.DatatypeConverter; - -import org.w3c.dom.Document; -import org.w3c.dom.Element; - -import larac.objects.Enums.Types; - -public class ASTLiteral extends SimpleNode { - private Types type; - private List codeParams = null; - - // private String codeFileName; - - public ASTLiteral(int id) { - super(id); - } - - public ASTLiteral(LARAEcmaScript p, int id) { - super(p, id); - } - - public void setStringValue(String image) { - value = image.substring(1, image.length() - 1); - } - - public void setDecimalValue(String image) { - - try { - value = Long.valueOf(image); - } catch (final NumberFormatException e) { - // it's a floating point - value = Double.valueOf(image); - } - } - - public void setHexValue(String image) { - - value = Long.valueOf(image.substring(2), 16); - } - - public void setFloatingPointValue(String image) { - value = Double.valueOf(image); - } - - public void setBooleanValue(String image) { - value = Boolean.valueOf(image); - } - - public void setNullValue() { - } - - public void setRegexValue(String image) { - value = image; - - } - - public void setCodeValue(String image) { - value = image; - } - - public void setType(Types type) { - this.type = type; - } - - public Types getType() { - return type; - } - - @Override - public String toString() { - String ret = LARAEcmaScriptTreeConstants.jjtNodeName[id]; - - if (type.equals(Types.Null)) { - ret += " [null]"; - } else { - ret += value != null ? (" [" + type + "," + value + "]") : ""; - } - return ret; - } - - public Element getFilterElement(Document doc, String prefix) { - final Element literalEl = doc.createElement("literal"); - // literalEl.setAttribute("type", type.name()); - literalEl.setAttribute("value", prefix + value.toString().replace("\"", "")); - return literalEl; - } - - @Override - public Types getExpressionType() { - return getType(); - } - - @Override - public Object organize(Object obj) { - if (type.equals(Types.Code)) { - codeParams = getCodeArguments(value.toString()); - try { - value = value.toString().substring(2, value.toString().length() - 2); - value = DatatypeConverter.printBase64Binary(value.toString().getBytes("UTF-8")); - - } catch (final UnsupportedEncodingException e) { - - e.printStackTrace(); - } - // LaraC lara = getLara(); - // - // codeFileName = lara.aspectIR().generateNewCodeName(); - // String fileSep = System.getProperty("file.separator"); - // File outputDir = lara.getOptions().getOutputDir(); - // FileUtils.toFile(lara.getPrint(), codeFileName, ".code", - // value.toString().substring(2, value.toString().length() - 2), - // outputDir); - // File codeFile = new File(outputDir, codeFileName + ".code"); - // value = codeFile.getAbsolutePath().replace(fileSep, fileSep + - // fileSep); - } - if (obj instanceof ASTInsert && type.equals(Types.String)) { - codeParams = getCodeArguments(value.toString()); - } - return type; - } - - @Override - public void toXML(Document doc, Element parent) { - final Element literalEl = doc.createElement("literal"); - - if (type.equals(Types.Null)) { - literalEl.setAttribute("value", "null"); - literalEl.setAttribute("type", Types.Object.toString()); - } else { - - if (type.equals(Types.Code) || (type.equals(Types.String) && codeParams != null && !codeParams.isEmpty())) { - // final SimpleNode obj = ((SimpleNode) - // this.parent).getParentById(LARAEcmaScriptTreeConstants.JJTACTION); - // if (obj == null) { - codeToXML(doc, parent); - return; - // } - // literalEl.setAttribute("type", Types.Base64.toString()); - } else { - literalEl.setAttribute("type", type.toString()); - } - - literalEl.setAttribute("value", value.toString()); - - } - parent.appendChild(literalEl); - } - - @Override - public void toXMLTemplate(Document doc, Element parent) { - final Element literalEl = doc.createElement("literal"); - literalEl.setAttribute("type", Types.Object.toString()); - literalEl.setAttribute("desc", Types.Code.toString()); - parent.appendChild(literalEl); - final Element propEl = doc.createElement("key"); - literalEl.appendChild(propEl); - propEl.setAttribute("name", "code"); - if (type == Types.String) { - codeParams = getCodeArguments(value.toString()); - } - toXML(doc, propEl); - if (codeParams != null) { - verifyCodeArguments(codeParams); - codeTemplateArgumentsToXML(doc, literalEl, codeParams); - } - } - - public void codeToXML(Document doc, Element parent) { - final Element literalEl = doc.createElement("literal"); - literalEl.setAttribute("type", Types.Object.toString()); - literalEl.setAttribute("desc", Types.Code.toString()); - parent.appendChild(literalEl); - - final Element propEl = doc.createElement("key"); - literalEl.appendChild(propEl); - propEl.setAttribute("name", "code"); - - final Element literalCodeEl = doc.createElement("literal"); - literalCodeEl.setAttribute("value", value.toString()); - literalCodeEl.setAttribute("type", type.toString()); - propEl.appendChild(literalCodeEl); - if (codeParams != null) { - verifyCodeArguments(codeParams); - codeTemplateArgumentsToXML(doc, literalEl, codeParams); - } - } - - @Override - public String toSource(int indentation) { - - String string = value.toString(); - if (type == Types.String) { - string = '"' + string + '"'; - } - return indent(indentation) + string; - } -} -/* - * JavaCC - OriginalChecksum=de0fd5e10db38b45e5e755afa080eb7f (do not edit this - * line) - */ diff --git a/LARAC/src/org/dojo/jsl/parser/ast/ASTLiteralField.java b/LARAC/src/org/dojo/jsl/parser/ast/ASTLiteralField.java deleted file mode 100644 index 5f066b1cf..000000000 --- a/LARAC/src/org/dojo/jsl/parser/ast/ASTLiteralField.java +++ /dev/null @@ -1,21 +0,0 @@ -/* Generated By:JJTree: Do not edit this line. ASTLiteralField.java Version 4.3 */ -/* - * JavaCCOptions:MULTI=true,NODE_USES_PARSER=false,VISITOR=false,TRACK_TOKENS=false,NODE_PREFIX=AST,NODE_EXTENDS=, - * NODE_FACTORY=,SUPPORT_CLASS_VISIBILITY_PUBLIC=true - */ -package org.dojo.jsl.parser.ast; - -public @SuppressWarnings("all") class ASTLiteralField extends SimpleNode { - public ASTLiteralField(int id) { - super(id); - } - - public ASTLiteralField(LARAEcmaScript p, int id) { - super(p, id); - } - -} -/* - * JavaCC - OriginalChecksum=0f6af9d9a7db9dfb202ef74b938fbc2e (do not edit this - * line) - */ diff --git a/LARAC/src/org/dojo/jsl/parser/ast/ASTNamedArgument.java b/LARAC/src/org/dojo/jsl/parser/ast/ASTNamedArgument.java deleted file mode 100644 index 61c094cd5..000000000 --- a/LARAC/src/org/dojo/jsl/parser/ast/ASTNamedArgument.java +++ /dev/null @@ -1,34 +0,0 @@ -/* Generated By:JJTree: Do not edit this line. ASTNamedArgument.java Version 4.3 */ -/* - * JavaCCOptions:MULTI=true,NODE_USES_PARSER=false,VISITOR=false,TRACK_TOKENS=false,NODE_PREFIX=AST,NODE_EXTENDS=, - * NODE_FACTORY=,SUPPORT_CLASS_VISIBILITY_PUBLIC=true - */ -package org.dojo.jsl.parser.ast; - -import org.w3c.dom.Document; -import org.w3c.dom.Element; - -public class ASTNamedArgument extends SimpleNode { - public ASTNamedArgument(int id) { - super(id); - } - - public ASTNamedArgument(LARAEcmaScript p, int id) { - super(p, id); - } - - @Override - public Object organize(Object obj) { - return ((SimpleNode) children[0]).organize(obj); - } - - @Override - public void toXML(Document doc, Element parent) { - parent.setAttribute("name", value.toString()); - ((SimpleNode) children[0]).toXML(doc, parent); - } -} -/* - * JavaCC - OriginalChecksum=b92964a2b6aa12c3bcb99e149c9adacf (do not edit this - * line) - */ diff --git a/LARAC/src/org/dojo/jsl/parser/ast/ASTNaturalJoin.java b/LARAC/src/org/dojo/jsl/parser/ast/ASTNaturalJoin.java deleted file mode 100644 index 489d7229a..000000000 --- a/LARAC/src/org/dojo/jsl/parser/ast/ASTNaturalJoin.java +++ /dev/null @@ -1,21 +0,0 @@ -/* Generated By:JJTree: Do not edit this line. ASTNaturalJoin.java Version 4.3 */ -/* - * JavaCCOptions:MULTI=true,NODE_USES_PARSER=false,VISITOR=false,TRACK_TOKENS=false,NODE_PREFIX=AST,NODE_EXTENDS=, - * NODE_FACTORY=,SUPPORT_CLASS_VISIBILITY_PUBLIC=true - */ -package org.dojo.jsl.parser.ast; - -public class ASTNaturalJoin extends SimpleNode { - public ASTNaturalJoin(int id) { - super(id); - } - - public ASTNaturalJoin(LARAEcmaScript p, int id) { - super(p, id); - } - -} -/* - * JavaCC - OriginalChecksum=db982db7548861f6fff221e20c8ee9ac (do not edit this - * line) - */ diff --git a/LARAC/src/org/dojo/jsl/parser/ast/ASTORJPExpr.java b/LARAC/src/org/dojo/jsl/parser/ast/ASTORJPExpr.java deleted file mode 100644 index dba10c408..000000000 --- a/LARAC/src/org/dojo/jsl/parser/ast/ASTORJPExpr.java +++ /dev/null @@ -1,58 +0,0 @@ -/* Generated By:JJTree: Do not edit this line. ASTORJPExpr.java Version 4.3 */ -/* - * JavaCCOptions:MULTI=true,NODE_USES_PARSER=false,VISITOR=false,TRACK_TOKENS=false,NODE_PREFIX=AST,NODE_EXTENDS=, - * NODE_FACTORY=,SUPPORT_CLASS_VISIBILITY_PUBLIC=true - */ -package org.dojo.jsl.parser.ast; - -import org.w3c.dom.Document; -import org.w3c.dom.Element; - -public class ASTORJPExpr extends SimpleNode { - public ASTORJPExpr(int id) { - super(id); - } - - public ASTORJPExpr(LARAEcmaScript p, int id) { - super(p, id); - } - - @Override - public Object organize(Object obj) { - - for (final Node child : getChildren()) { - ((SimpleNode) child).organize(obj); - } - return null; - } - - @Override - public Object organizeFirst(Object obj, int dummy) { - - for (int i = 0; i < getChildren().length; i++) { - ((SimpleNode) getChildren()[i]).organizeFirst(obj, i); - } - return null; - } - - @Override - public void toXML(Document doc, Element parent) { - for (final Node child : getChildren()) { - ((SimpleNode) child).toXML(doc, parent); - } - } - - @Override - public boolean hasFilter() { - for (final Node child : getChildren()) { - if (((SimpleNode) child).hasFilter()) { - return true; - } - } - return false; - } -} -/* - * JavaCC - OriginalChecksum=809ee13c569e1e4397220af63595e13e (do not edit this - * line) - */ diff --git a/LARAC/src/org/dojo/jsl/parser/ast/ASTObjectLiteral.java b/LARAC/src/org/dojo/jsl/parser/ast/ASTObjectLiteral.java deleted file mode 100644 index e2225f562..000000000 --- a/LARAC/src/org/dojo/jsl/parser/ast/ASTObjectLiteral.java +++ /dev/null @@ -1,67 +0,0 @@ -/* Generated By:JJTree: Do not edit this line. ASTObjectLiteral.java Version 4.3 */ -/* - * JavaCCOptions:MULTI=true,NODE_USES_PARSER=false,VISITOR=false,TRACK_TOKENS=false,NODE_PREFIX=AST,NODE_EXTENDS=, - * NODE_FACTORY=,SUPPORT_CLASS_VISIBILITY_PUBLIC=true - */ -package org.dojo.jsl.parser.ast; - -import java.util.LinkedHashMap; - -import org.w3c.dom.Document; -import org.w3c.dom.Element; - -import larac.objects.Enums.Types; - -public class ASTObjectLiteral extends SimpleNode { - private final LinkedHashMap props = new LinkedHashMap<>(); - - public ASTObjectLiteral(int id) { - super(id); - } - - public ASTObjectLiteral(LARAEcmaScript p, int id) { - super(p, id); - } - - @Override - public Object organize(Object obj) { - // System.out.println(children); - if (children == null) { - return null; - } - - for (final Node child : children) { - final ASTLiteralField litField = (ASTLiteralField) child; - final String prop = ((SimpleNode) litField.children[0]).value.toString(); - // if (props.containsKey(prop)) - // throw newException("The object already contains the property \"" - // + prop + "\"."); - final SimpleNode init = ((SimpleNode) litField.children[1]); - init.organize(obj); - props.put(prop, init); - } - return null; - } - - @Override - public Types getExpressionType() { - return Types.Object; - } - - @Override - public void toXML(Document doc, Element parent) { - final Element literalEl = doc.createElement("literal"); - literalEl.setAttribute("type", Types.Object.toString()); - parent.appendChild(literalEl); - for (final String prop : props.keySet()) { - final Element propEl = doc.createElement("key"); - propEl.setAttribute("name", prop); - literalEl.appendChild(propEl); - props.get(prop).toXML(doc, propEl); - } - } -} -/* - * JavaCC - OriginalChecksum=8a6932db8f6cab10e111b9097896eeee (do not edit this - * line) - */ diff --git a/LARAC/src/org/dojo/jsl/parser/ast/ASTOperator.java b/LARAC/src/org/dojo/jsl/parser/ast/ASTOperator.java deleted file mode 100644 index c650e8b05..000000000 --- a/LARAC/src/org/dojo/jsl/parser/ast/ASTOperator.java +++ /dev/null @@ -1,94 +0,0 @@ -/* Generated By:JJTree: Do not edit this line. ASTOperator.java Version 4.3 */ -/* - * JavaCCOptions:MULTI=true,NODE_USES_PARSER=false,VISITOR=false,TRACK_TOKENS=false,NODE_PREFIX=AST,NODE_EXTENDS=, - * NODE_FACTORY=,SUPPORT_CLASS_VISIBILITY_PUBLIC=true - */ -package org.dojo.jsl.parser.ast; - -import larac.objects.Enums.AssignOperator; -import larac.objects.Enums.BinaryOperator; -import larac.objects.Enums.Types; -import larac.objects.Enums.UnaryOperator; - -public class ASTOperator extends SimpleNode { - private String tag; - private Types returnType; - - public ASTOperator(int id) { - super(id); - } - - public ASTOperator(LARAEcmaScript p, int id) { - super(p, id); - } - - @Override - public Object organize(Object obj) { - if (obj instanceof ASTBinaryExpressionSequence && BinaryOperator.contains(value.toString())) { - tag = BinaryOperator.getOpTag(value.toString()).toString(); - - } else if (obj instanceof ASTAssignmentExpression && AssignOperator.contains(value.toString())) { - tag = AssignOperator.getOpTag(value.toString()).toString(); - } else if (obj instanceof ASTUnaryExpression && UnaryOperator.contains(value.toString())) { - tag = UnaryOperator.getOpTag(value.toString()).toString(); - } else if (obj instanceof ASTAndExpressionSequence && BinaryOperator.contains(value.toString())) { - tag = BinaryOperator.getOpTag(value.toString()).toString(); - } else if (obj instanceof ASTOrExpressionSequence && BinaryOperator.contains(value.toString())) { - tag = BinaryOperator.getOpTag(value.toString()).toString(); - } - if (tag == null) { - throw newException("Operator \"" + value + "\" not suported on " + obj); - } - return null; - } - - /** - * @return the tag - */ - public String getTag() { - if (tag == null) { - this.organize(parent); - } - return tag; - } - - /** - * @param tag - * the tag to set - */ - public void setTag(String tag) { - this.tag = tag; - } - - /** - * @return the returnType - */ - public Types getReturnType() { - return returnType; - } - - /** - * @param returnType - * the returnType to set - */ - public void setReturnType(Types returnType) { - this.returnType = returnType; - } - - /** - * @param returnType - * the returnType to set - */ - public void setReturnType(Types returnType, Types returnType2) { - this.returnType = Types.maxType(returnType, returnType2); - } - - @Override - public String toSource(int indentation) { - return indent(indentation) + value.toString(); - } -} -/* - * JavaCC - OriginalChecksum=59c67cb5edd2fdd095ebcb001516032d (do not edit this - * line) - */ diff --git a/LARAC/src/org/dojo/jsl/parser/ast/ASTOrExpressionSequence.java b/LARAC/src/org/dojo/jsl/parser/ast/ASTOrExpressionSequence.java deleted file mode 100644 index 761967d6b..000000000 --- a/LARAC/src/org/dojo/jsl/parser/ast/ASTOrExpressionSequence.java +++ /dev/null @@ -1,69 +0,0 @@ -/* Generated By:JJTree: Do not edit this line. ASTOrExpressionSequence.java Version 4.3 */ -/* - * JavaCCOptions:MULTI=true,NODE_USES_PARSER=false,VISITOR=false,TRACK_TOKENS=false,NODE_PREFIX=AST,NODE_EXTENDS=, - * NODE_FACTORY=,SUPPORT_CLASS_VISIBILITY_PUBLIC=true - */ -package org.dojo.jsl.parser.ast; - -import org.w3c.dom.Document; -import org.w3c.dom.Element; - -import larac.objects.Enums.Types; - -public class ASTOrExpressionSequence extends SimpleNode { - public ASTOrExpressionSequence(int id) { - super(id); - } - - public ASTOrExpressionSequence(LARAEcmaScript p, int id) { - super(p, id); - } - - @Override - public Object organize(Object obj) { - final SimpleNode left = (SimpleNode) children[0]; - left.organize(this); - for (int i = 1; i < children.length; i += 2) { - final ASTOperator operator = (ASTOperator) children[i]; - operator.organize(this); - final SimpleNode right = (SimpleNode) children[i + 1]; - right.organize(this); - operator.setReturnType(Types.Boolean); - } - return obj; - } - - @Override - public void toXML(Document doc, Element parent) { - SimpleNode left = (SimpleNode) children[0]; - ASTOperator operator = (ASTOperator) children[1]; - Element opEl = doc.createElement("op"); - opEl.setAttribute("name", operator.getTag()); - parent.appendChild(opEl); - left.toXML(doc, opEl); - // opEl.setAttribute("type", operator.getReturnType().name()); - int i = 2; - while (i + 1 < children.length) { - left = (SimpleNode) children[i++]; - operator = (ASTOperator) children[i++]; - final Element newOpEl = doc.createElement("op"); - newOpEl.setAttribute("name", operator.getTag()); - opEl.appendChild(newOpEl); - opEl = newOpEl; - // opEl.setAttribute("type", operator.getReturnType().name()); - left.toXML(doc, opEl); - } - final SimpleNode right = (SimpleNode) children[i]; - right.toXML(doc, opEl); - } - - @Override - public Types getExpressionType() { - return Types.Boolean; - } - -} -/* - * JavaCC - OriginalChecksum=672bba3e5cbcb55cd86b548c2fbe249e (do not edit this - * line) - */ diff --git a/LARAC/src/org/dojo/jsl/parser/ast/ASTOrFiltersExpr.java b/LARAC/src/org/dojo/jsl/parser/ast/ASTOrFiltersExpr.java deleted file mode 100644 index ab9a8ebae..000000000 --- a/LARAC/src/org/dojo/jsl/parser/ast/ASTOrFiltersExpr.java +++ /dev/null @@ -1,60 +0,0 @@ -/* Generated By:JJTree: Do not edit this line. ASTOrFiltersExpr.java Version 4.3 */ -/* - * JavaCCOptions:MULTI=true,NODE_USES_PARSER=false,VISITOR=false,TRACK_TOKENS=false,NODE_PREFIX=AST,NODE_EXTENDS=, - * NODE_FACTORY=,SUPPORT_CLASS_VISIBILITY_PUBLIC=true - */ -package org.dojo.jsl.parser.ast; - -import org.lara.language.specification.dsl.LanguageSpecificationV2; -import org.w3c.dom.Document; -import org.w3c.dom.Element; - -public class ASTOrFiltersExpr extends SimpleNode { - public ASTOrFiltersExpr(int id) { - super(id); - } - - public ASTOrFiltersExpr(LARAEcmaScript p, int id) { - super(p, id); - } - - @Override - public String organize(String type, LanguageSpecificationV2 langSpec) { - for (final Node child : getChildren()) { - ((SimpleNode) child).organize(type, langSpec); - } - return null; - } - - @Override - public Element getFilterElement(Document doc) { - Element aux = null; - boolean first = true; - Element jpOREl = null; - - for (final Node child : getChildren()) { - final Element childEl = ((SimpleNode) child).getFilterElement(doc); - if (childEl != null) { - if (first) { - aux = childEl; - first = false; - } else { - if (jpOREl == null) { - jpOREl = doc.createElement("op"); - jpOREl.setAttribute("name", "OR"); - jpOREl.appendChild(aux); - } - jpOREl.appendChild(childEl); - } - } - } - if (jpOREl != null) { - return jpOREl; - } - return aux; - } -} -/* - * JavaCC - OriginalChecksum=3506f10ce2f5a7c50c491a5b58d86e9b (do not edit this - * line) - */ diff --git a/LARAC/src/org/dojo/jsl/parser/ast/ASTOutput.java b/LARAC/src/org/dojo/jsl/parser/ast/ASTOutput.java deleted file mode 100644 index ae372fe16..000000000 --- a/LARAC/src/org/dojo/jsl/parser/ast/ASTOutput.java +++ /dev/null @@ -1,66 +0,0 @@ -/* Generated By:JJTree: Do not edit this line. ASTOutput.java Version 4.3 */ -/* - * JavaCCOptions:MULTI=true,NODE_USES_PARSER=false,VISITOR=false,TRACK_TOKENS=false,NODE_PREFIX=AST,NODE_EXTENDS=, - * NODE_FACTORY=,SUPPORT_CLASS_VISIBILITY_PUBLIC=true - */ -package org.dojo.jsl.parser.ast; - -import java.util.HashMap; - -import larac.objects.Variable; - -public class ASTOutput extends SimpleNode { - - public ASTOutput(int id) { - super(id); - } - - public ASTOutput(LARAEcmaScript p, int id) { - super(p, id); - } - - @Override - public Object organize(Object obj) { - final ASTAspectDef asp = (ASTAspectDef) parent; - if (asp.getOutputsNode() != null) { - // if (!asp.getOutputs().isEmpty()) { - throw newException("Can only have one output section!"); - } - asp.setOutputsNode(this); - if (getChildren() == null) { - return null; - } - final ASTAspectDef aspect = (ASTAspectDef) obj; - ((SimpleNode) getChildren()[0]).organize(aspect.getOutputs(), aspect.getInputs()); - return null; - } - - @Override - public HashMap getHMVars() { - return ((ASTAspectDef) parent).getOutputs(); - } - - @Override - public String toSource(int indentation) { - - String source = indent(indentation) + "output"; - if (getChildren() == null) { - return source + " end"; - } - SimpleNode child = getChild(0); - if (child instanceof ASTVariableDeclarationList) { - if (child.getChildren() != null) { - for (final Node n : child.getChildren()) { - source += "\n" + ((SimpleNode) n).toSource(indentation + 1); - } - } - } else { - source += "\n" + child.toSource(indentation + 1); - } - return source + "\n" + indent(indentation) + "end"; - } -} -/* - * JavaCC - OriginalChecksum=86064c04cf6bb75b2b5038c23b32713a (do not edit this - * line) - */ diff --git a/LARAC/src/org/dojo/jsl/parser/ast/ASTOutputAct.java b/LARAC/src/org/dojo/jsl/parser/ast/ASTOutputAct.java deleted file mode 100644 index c479495f1..000000000 --- a/LARAC/src/org/dojo/jsl/parser/ast/ASTOutputAct.java +++ /dev/null @@ -1,262 +0,0 @@ -/* Generated By:JJTree: Do not edit this line. ASTOutputAct.java Version 4.3 */ -/* - * JavaCCOptions:MULTI=true,NODE_USES_PARSER=false,VISITOR=false,TRACK_TOKENS=false,NODE_PREFIX=AST,NODE_EXTENDS=, - * NODE_FACTORY=,SUPPORT_CLASS_VISIBILITY_PUBLIC=true - */ -package org.dojo.jsl.parser.ast; - -import java.io.UnsupportedEncodingException; -import java.util.ArrayList; -import java.util.LinkedHashMap; - -import javax.xml.bind.DatatypeConverter; - -import org.w3c.dom.Document; -import org.w3c.dom.Element; - -import larac.objects.Enums; -import larac.objects.Enums.Types; - -@Deprecated -public class ASTOutputAct extends SimpleNode { - private String language; - private boolean pureCode; - private ASTCodeDef codeDef; - private final ArrayList codeParams = new ArrayList<>(); - private LinkedHashMap codeMapping = new LinkedHashMap<>(); - - public ASTOutputAct(int id) { - super(id); - } - - public ASTOutputAct(LARAEcmaScript p, int id) { - super(p, id); - } - - @Override - public String toString() { - return LARAEcmaScriptTreeConstants.jjtNodeName[id]; - } - - /** - * @param language - * the language to set - */ - public void setLanguage(String language) { - this.language = language; - } - - /** - * @return the language - */ - public String getLanguage() { - return language; - } - - /** - * @param paramMapping - * the paramMapping to set - */ - public void setParamMapping(LinkedHashMap paramMapping) { - codeMapping = paramMapping; - } - - /** - * @return the paramMapping - */ - public LinkedHashMap getParamMapping() { - return codeMapping; - } - - @Override - public Object organize(Object obj) { - /* - final ASTAction act = (ASTAction) parent; - act.setMethod("out"); - act.setArguments(OrganizeUtils.createOutputActionParameters(getLara().languageSpec())); - final Map arguments = act.getArguments(); - if (jjtGetChild(0) instanceof ASTFunctionCallParameters) { - final ASTFunctionCallParameters params = (ASTFunctionCallParameters) jjtGetChild(0); - if (params.areNamed) { - for (final Node param : params.getChildren()) { - final ASTNamedArgument na = (ASTNamedArgument) param; - if (!arguments.containsKey(na.value)) { - throw newException("The argument '" + na.value + "' does not exist for action 'out'"); - } - final ActionArgument actArg = arguments.get(na.value); - if (na.value.equals("code")) { - verifyCodeDef(na.jjtGetChild(0), arguments); - } else { - na.organize(obj); - actArg.setValue((SimpleNode) na.jjtGetChild(0)); - } - } - } else { - if (params.getChildren().length != arguments.size()) { - throw newException("Illegal number of arguments for action 'out'"); - } - verifyCodeDef(params.jjtGetChild(0), arguments); - } - } else { - if (children[0] instanceof ASTLiteral) { - ((SimpleNode) children[0]).organize(this); - arguments.get("code").setValue((SimpleNode) children[0]); - } else { - verifyCodeDef(children[0], arguments); - } - }*/ - return null; - } - - /* - private void verifyCodeDef(Node node, Map arguments) { - String codeName = ""; - if (node instanceof ASTLiteral) { - ((SimpleNode) node).organize(this); - - arguments.get("code").setValue((SimpleNode) node); - return; - } - if (node instanceof ASTIdentifier) { - codeName = ((ASTIdentifier) node).value.toString(); - codeDef = getLara().aspectIR().getCodedef(codeName); - if (codeDef == null) { - throw newException("Codedef '" + codeName + "' does not exist."); - } - } else if (node instanceof ASTCompositeReference) { - - codeName = ((ASTIdentifier) node.jjtGetChild(0)).value.toString(); - codeDef = getLara().aspectIR().getCodedef(codeName); - if (codeDef == null) { - throw newException("Codedef '" + codeName + "' does not exist."); - } - - for (final String arg : codeDef.getArguments()) { - codeMapping.put(arg, null); - } - final ASTFunctionCallParameters params = (ASTFunctionCallParameters) node.jjtGetChild(1); - organizeArguments(params); - } else { - throw newException("Argument 'code' for out is invalid."); - } - - arguments.get("code").setValue(this); - } - - private void organizeArguments(ASTFunctionCallParameters astFunctionCallParameters) { - if (astFunctionCallParameters.areNamed) { - for (final Node node : astFunctionCallParameters.getChildren()) { - final ASTNamedArgument named = (ASTNamedArgument) node; - if (!codeDef.getArguments().contains(named.value)) { - throw newException("In Action 'out': '" + named.value + "' does not exist."); - } - ((SimpleNode) named.getChildren()[0]).organize(this); - getParamMapping().put(named.value.toString(), (SimpleNode) named.getChildren()[0]); - } - } else { - for (final Node node : astFunctionCallParameters.getChildren()) { - final String arg = getParamWithNoValue(); - if (arg == null) { - throw newException("In Action 'out': Illegal number of arguments"); - } - ((SimpleNode) node).organize(this); - codeMapping.put(arg, (SimpleNode) node); - } - } - - for (final SimpleNode sn : codeMapping.values()) { - if (sn == null) { - String unsigned = ""; - for (final String nulls : codeMapping.keySet()) { - if (codeMapping.get(nulls) == null) { - unsigned += nulls + ","; - } - } - unsigned = unsigned.substring(0, unsigned.length() - 1); - throw newException("In Action 'out': not all codedef arguments are set: " + unsigned); - } - } - } - - private String getParamWithNoValue() { - for (final String param : codeMapping.keySet()) { - if (codeMapping.get(param) == null) { - return param; - } - } - return null; - } - */ - /** - * @param codeDef - * the codeDef to set - */ - public void setCodeDef(ASTCodeDef codeDef) { - this.codeDef = codeDef; - } - - /** - * @return the codeDef - */ - public ASTCodeDef getCodeDef() { - return codeDef; - } - - /** - * @param pureCode - * the pureCode to set - */ - public void setPureCode(boolean pureCode) { - this.pureCode = pureCode; - } - - /** - * @return the pureCode - */ - public boolean isPureCode() { - return pureCode; - } - - /** - * @param doc - * Document where the Aspect-IR is going to be saved - * @param parent - * the parent node owner for the nodes generated in this node - */ - @Override - public void toXMLTemplate(Document doc, Element parent) { - final Element literalEl = doc.createElement("literal"); - literalEl.setAttribute("type", Types.Object.toString()); - parent.appendChild(literalEl); - final Element propEl = doc.createElement("key"); - propEl.setAttribute("name", "'code'"); - literalEl.appendChild(propEl); - final Element stringEl = doc.createElement("literal"); - // stringEl.setAttribute("type", Types.String.toString()); - // propEl.appendChild(stringEl); - // stringEl.setAttribute("value", codeDef.getName() + ".code"); - stringEl.setAttribute("type", Types.Base64.toString()); - propEl.appendChild(stringEl); - try { - final String codeBase64 = DatatypeConverter.printBase64Binary(codeDef.getCode().getBytes("UTF-8")); - stringEl.setAttribute("value", codeBase64); - } catch (final UnsupportedEncodingException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - - for (final String prop : codeMapping.keySet()) { - final SimpleNode replace = codeMapping.get(prop); - final Element propertyKeyEl = doc.createElement("key"); - literalEl.appendChild(propertyKeyEl); - propertyKeyEl.setAttribute("name", Enums.SYMBOL_BEGIN + prop + Enums.SYMBOL_END); - replace.toXML(doc, propertyKeyEl); - } - codeTemplateArgumentsToXML(doc, literalEl, codeParams); - } - -} -/* - * JavaCC - OriginalChecksum=686f16c31cea47f2f993b8d2a4070c21 (do not edit this - * line) - */ diff --git a/LARAC/src/org/dojo/jsl/parser/ast/ASTParenExpression.java b/LARAC/src/org/dojo/jsl/parser/ast/ASTParenExpression.java deleted file mode 100644 index ad8e2648a..000000000 --- a/LARAC/src/org/dojo/jsl/parser/ast/ASTParenExpression.java +++ /dev/null @@ -1,60 +0,0 @@ -/* Generated By:JJTree: Do not edit this line. ASTParenExpression.java Version 4.3 */ -/* - * JavaCCOptions:MULTI=true,NODE_USES_PARSER=false,VISITOR=false,TRACK_TOKENS=false,NODE_PREFIX=AST,NODE_EXTENDS=, - * NODE_FACTORY=,SUPPORT_CLASS_VISIBILITY_PUBLIC=true - */ -package org.dojo.jsl.parser.ast; - -import org.w3c.dom.Document; -import org.w3c.dom.Element; - -import larac.objects.Enums.BinaryOperator; - -public class ASTParenExpression extends SimpleNode { - public ASTParenExpression(int id) { - super(id); - } - - public ASTParenExpression(LARAEcmaScript p, int id) { - super(p, id); - } - - @Override - public Object organize(Object obj) { - if (getChildren() != null) { - for (final Node child : getChildren()) { - ((SimpleNode) child).organize(obj); - } - } - return null; - } - - @Override - public void toXML(Document doc, Element parent) { - if (getChildren() == null) { - return; - } - if (children[0] instanceof ASTExpressionList) { - final ASTExpressionList exprList = (ASTExpressionList) children[0]; - Element auxEl = doc.createElement("aux"); - ((SimpleNode) exprList.children[0]).toXML(doc, auxEl); - auxEl = (Element) auxEl.getFirstChild(); - for (int i = 1; i < exprList.children.length; i++) { - final Element commaEl = doc.createElement("op"); - commaEl.setAttribute("name", BinaryOperator.COMMA.toString()); - commaEl.appendChild(auxEl); - ((SimpleNode) exprList.children[i]).toXML(doc, commaEl); - auxEl = commaEl; - } - parent.appendChild(auxEl); - } else { - for (final Node child : getChildren()) { - ((SimpleNode) child).toXML(doc, parent); - } - } - } -} -/* - * JavaCC - OriginalChecksum=7ed48279809a76b7276997fbebe6ca6a (do not edit this - * line) - */ diff --git a/LARAC/src/org/dojo/jsl/parser/ast/ASTPerform.java b/LARAC/src/org/dojo/jsl/parser/ast/ASTPerform.java deleted file mode 100644 index 2800babaa..000000000 --- a/LARAC/src/org/dojo/jsl/parser/ast/ASTPerform.java +++ /dev/null @@ -1,533 +0,0 @@ -/* Generated By:JJTree: Do not edit this line. ASTPerform.java Version 4.3 */ -/* - * JavaCCOptions:MULTI=true,NODE_USES_PARSER=false,VISITOR=false,TRACK_TOKENS=false,NODE_PREFIX=AST,NODE_EXTENDS=, - * NODE_FACTORY=,SUPPORT_CLASS_VISIBILITY_PUBLIC=true - */ -package org.dojo.jsl.parser.ast; - -import java.util.Collections; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Optional; - -import org.lara.language.specification.dsl.Action; - -// import org.lara.language.specification.actionsmodel.schema.Action; - -import larac.LaraC; -import larac.exceptions.LARACompilerException; -import larac.objects.Variable; -import larac.utils.xml.entity.ActionArgument; -import pt.up.fe.specs.util.SpecsFactory; -import tdrc.utils.StringUtils; - -public class ASTPerform extends SimpleNode { - - private String action; - private Optional returnName = Optional.empty(); - - public ASTPerform(int id) { - super(id); - } - - public ASTPerform(LARAEcmaScript p, int id) { - super(p, id); - } - - @Override - public Object organize(Object obj) { - final LaraC lara = getLara(); - - var organizer = lara.getOrganizer(); - var languageSpec = lara.getLanguageSpec(); - // final ActionModel actionModel = languageSpec.getActionModel(); - final ASTAction act = (ASTAction) parent; - act.setMethod(action); - - // if (!actionModel.contains(action)) { - if (!languageSpec.hasAction(action)) { - - lara.warnln("Action '" + action - + "' does not exist in the action model. The arguments cannot be verified. Will use action as is."); - final Map emptyMap = Collections.emptyMap(); - act.setArguments(emptyMap); - return null; - } - - // Since we accept method overloading then we should verify all possible actions - List actions = languageSpec.getAction(action); - if (children == null) { - // Base case: no arguments were given to the action and there is an action without parameters - for (Action action : actions) { - if (action.getParameters().isEmpty()) { - final Map actionParam = organizer.createActionParameters(action); - act.setArguments(actionParam); - validateReturn(lara, action); - return null; - } - } - throwIllegalParameters(actions, children); - // + actionParam.size() + " arguments: '" + actionParam.keySet() + "'"); - } - - // Get the action arguments - final ASTFunctionCallParameters params = (ASTFunctionCallParameters) children[0]; - int callparametersId = LARAEcmaScriptTreeConstants.JJTFUNCTIONCALLPARAMETERS; - // Instantiate the new arguments that will comprise the necessary changes - final ASTFunctionCallParameters newParams = new ASTFunctionCallParameters(callparametersId); - List> actionsParams = SpecsFactory.newLinkedList(); - List possibleActions = SpecsFactory.newLinkedList(); - if (params.areNamed) { - actions: for (Action action : actions) { - final Map actionParam = organizer.createActionParameters(action); - for (final Node param : params.getChildren()) { - final ASTNamedArgument na = (ASTNamedArgument) param; - if (!actionParam.containsKey(na.value)) { - continue actions; - } - - final ActionArgument actArg = actionParam.get(na.value); - actArg.setValue(na.getChild(0)); - } - if (argsAreValid(actionParam)) { - actionsParams.add(actionParam); - possibleActions.add(action); - } - } - if (possibleActions.isEmpty()) { - throwIllegalParameters(actions, params.children); - } - if (possibleActions.size() > 1) { - String message = "Conflicting action choice when using named arguments. Given: (show named arguments given by user)"; - message += "Conflicting Options:\n"; - int i = 0; - for (Action action : possibleActions) { - message += "\t" + i + ") " + action2String(action) + "\n"; - } - throw new RuntimeException(message); - } - Map map = actionsParams.get(0); - Action action = possibleActions.get(0); - organizeWithGivenParams(lara, act, params, newParams, action, map); - } else { - for (Action action : actions) { - int length = params.children == null ? 0 : params.children.length; - int actionParametersLength = action.getParameters().size(); - - int requiredParametersLength = action.getParameters().size(); - for (var child : action.getParameters()) { - if (child.getDefaultValue() != null) { - requiredParametersLength--; - } - } - - if (length == 0 && actionParametersLength == 0) { - final Map actionParam = organizer.createActionParameters(action); - act.setArguments(actionParam); - validateReturn(lara, action); - return null; - } else { - if (length >= requiredParametersLength && length <= actionParametersLength) { - final Map actionParam = organizer.createActionParameters(action); - int i = 0; - for (final ActionArgument arg : actionParam.values()) { - if (i >= length) { - break; - } - arg.setValue((SimpleNode) params.jjtGetChild(i++)); - } - - - organizeWithGivenParams(lara, act, params, newParams, action, actionParam); - return null; - } - } - } - throwIllegalParameters(actions, params.children); - } - - return null; - } - - // @Override - // public Object organize(Object obj) { - // final LaraC lara = getLara(); - // final LanguageSpecification languageSpec = lara.languageSpec(); - // final ActionModel actionModel = languageSpec.getActionModel(); - // final ASTAction act = (ASTAction) parent; - // act.setMethod(action); - // - // if (!actionModel.contains(action)) { - // - // lara.warnln("Action '" + action - // + "' does not exist in the action model. The arguments cannot be verified. Will use action as is."); - // final Map emptyMap = Collections.emptyMap(); - // act.setArguments(emptyMap); - // return null; - // } - // // Since we accept method overloading then we should verify all possible actions - // List actions = actionModel.getActions(action); - // if (children == null) { - // // Base case: no arguments were given to the action and there is an action without parameters - // for (Action action : actions) { - // if (action.getParameter().isEmpty()) { - // final Map actionParam = OrganizeUtils.createActionParameters(action, - // languageSpec); - // act.setArguments(actionParam); - // validateReturn(lara, action); - // return null; - // } - // } - // throwIllegalParameters(actions, children); - // // + actionParam.size() + " arguments: '" + actionParam.keySet() + "'"); - // } - // - // // Get the action arguments - // final ASTFunctionCallParameters params = (ASTFunctionCallParameters) children[0]; - // int callparametersId = LARAEcmaScriptTreeConstants.JJTFUNCTIONCALLPARAMETERS; - // // Instantiate the new arguments that will comprise the necessary changes - // final ASTFunctionCallParameters newParams = new ASTFunctionCallParameters(callparametersId); - // List> actionsParams = SpecsFactory.newLinkedList(); - // List possibleActions = SpecsFactory.newLinkedList(); - // if (params.areNamed) { - // actions: for (Action action : actions) { - // final Map actionParam = OrganizeUtils.createActionParameters(action, - // languageSpec); - // for (final Node param : params.getChildren()) { - // final ASTNamedArgument na = (ASTNamedArgument) param; - // if (!actionParam.containsKey(na.value)) { - // continue actions; - // } - // - // final ActionArgument actArg = actionParam.get(na.value); - // actArg.setValue(na.getChild(0)); - // } - // if (argsAreValid(actionParam)) { - // actionsParams.add(actionParam); - // possibleActions.add(action); - // } - // } - // if (possibleActions.isEmpty()) { - // throwIllegalParameters(actions, params.children); - // } - // if (possibleActions.size() > 1) { - // String message = "Conflicting action choice when using named arguments. Given: (show named arguments given by - // user)"; - // message += "Conflicting Options:\n"; - // int i = 0; - // for (Action action : possibleActions) { - // message += "\t" + i + ") " + action2String(action) + "\n"; - // } - // throw new RuntimeException(message); - // } - // Map map = actionsParams.get(0); - // Action action = possibleActions.get(0); - // organizeWithGivenParams(lara, act, params, newParams, action, map); - // } else { - // if (params.children == null) { - // for (Action action : actions) { - // if (action.getParameter().isEmpty()) { - // final Map actionParam = OrganizeUtils.createActionParameters(action, - // languageSpec); - // act.setArguments(actionParam); - // validateReturn(lara, action); - // return null; - // } - // } - // } else { - // for (Action action : actions) { - // int length = params.children.length; - // if (length == action.getParameter().size()) { // Just accept same size of parameters - // final Map actionParam = OrganizeUtils.createActionParameters(action, - // languageSpec); - // int i = 0; - // for (final ActionArgument arg : actionParam.values()) { - // arg.setValue((SimpleNode) params.jjtGetChild(i++)); - // } - // - // organizeWithGivenParams(lara, act, params, newParams, action, actionParam); - // return null; - // } - // } - // } - // throwIllegalParameters(actions, params.children); - // } - // /* - // - // act.setArguments(actionParam); - // - // if (children == null) { //DONE - // if (!actionParam.isEmpty()) { //DONE - // throw newException("Illegal number of arguments in action '" + action + "'. None was given, Expected " - // + actionParam.size() + " arguments: '" + actionParam.keySet() + "'"); - // } - // - // return null; //DONE - // } - // final ASTFunctionCallParameters params = (ASTFunctionCallParameters) children[0]; - // int callparametersId = LARAEcmaScriptTreeConstants.JJTFUNCTIONCALLPARAMETERS; - // final ASTFunctionCallParameters newParams = new ASTFunctionCallParameters(callparametersId); - // if (params.areNamed) { - // for (final Node param : params.getChildren()) { - // final ASTNamedArgument na = (ASTNamedArgument) param; - // if (!actionParam.containsKey(na.value)) { - // throw newException("The argument '" + na.value + "' does not exist for action '" + action - // + "'. Expected arguments: " + actionParam.keySet()); - // } - // final ActionArgument actArg = actionParam.get(na.value); - // actArg.setValue(na.getChild(0)); - // } - // } else { - // if (params.children == null) { - // if (actionParam.size() > 0) { - // // final int given = 0; - // // final String verb = given == 1 ? "was" : "were"; - // throw newException( - // "Illegal number of arguments in action '" + action + ". No arguments given, Expected " - // + actionParam.size() + " arguments: '" + actionParam.keySet() + "'"); - // } - // } else if ((params.children.length != actionParam.size())) { - // final int given = params.children.length; - // final String verb = given == 1 ? "was" : "were"; - // throw newException("Illegal number of arguments in action '" + action + ". '" + given + "' " + verb - // + " given, Expected " + actionParam.size() + " arguments: '" + actionParam.keySet() + "'"); - // } - // int i = 0; - // for (final ActionArgument arg : actionParam.values()) { - // arg.setValue((SimpleNode) params.jjtGetChild(i++)); - // } - // } - // int i = 0; - // final List missingArguments = new ArrayList<>(); - // for (final ActionArgument arg : actionParam.values()) { - // if (arg.getValue() == null) { - // missingArguments.add(arg.getName()); - // } else { - // if (arg.getType().equals("template")) { - // arg.getValue().isTemplate = true; - // } - // arg.getValue().organize(this); - // newParams.associateChild(arg.getValue(), i++); - // } - // } - // if (!missingArguments.isEmpty()) { - // throw newException("Arguments " + missingArguments + " for action '" + action + "' must be defined."); - // } - // associateChild(newParams, children.length - 1); - // - // if (returnName.isPresent()) { - // Action action2 = actionModel.getAction((action)); - // if (action2.getReturn().equals("void")) { - // lara.warnln("Using a variable assignment from an action that returns void."); - // } - // String varName = returnName.get(); - // final HashMap vars = getHMVars(); - // if (!vars.containsKey(varName)) { - // - // // Verify outputs - // - // Optional ancestorOfType = getAncestorOfType(ASTAspectDef.class); - // if (!ancestorOfType.isPresent() || - // !ancestorOfType.get().getOutputs().containsKey(varName)) { - // - // getHMVars().put(varName, new Variable(varName)); - // } - // } - // ASTAction parent = (ASTAction) jjtGetParent(); - // parent.setVarName(varName); - // - // } - // // if (children.length - 2 == 0) - // // return true; - // // - // - // */ - // // validateReturn(lara, actionModel); - // return null; - // } - - private void organizeWithGivenParams(final LaraC lara, final ASTAction act, final ASTFunctionCallParameters params, - final ASTFunctionCallParameters newParams, Action action, final Map actionParam) { - act.setArguments(actionParam); - int i = 0; - for (final ActionArgument arg : actionParam.values()) { - // arg.setValue((SimpleNode) params.jjtGetChild(i)); - if (arg.getType().equals("template")) { - arg.getValue().isTemplate = true; - } - arg.getValue().organize(this); - newParams.associateChild(arg.getValue(), i); - associateChild(newParams, children.length - 1); - validateReturn(lara, action); - i++; - } - - // for (final ActionArgument arg : actionParam.values()) { - // - // if (arg.getType().equals("template")) { - // arg.getValue().isTemplate = true; - // } - // arg.getValue().organize(this); - // newParams.associateChild(arg.getValue(), i++); - // } - } - - // private void validateReturn(final LaraC lara, final ActionModel actionModel) { - // if (returnName.isPresent()) - // - // { - // Action action2 = actionModel.getAction((action)); - // if (action2.getReturn().equals("void")) { - // lara.warnln("Using a variable assignment from an action that returns void."); - // } - // String varName = returnName.get(); - // final HashMap vars = getHMVars(); - // if (!vars.containsKey(varName)) { - // - // // Verify outputs - // - // Optional ancestorOfType = getAncestorOfType(ASTAspectDef.class); - // if (!ancestorOfType.isPresent() || - // !ancestorOfType.get().getOutputs().containsKey(varName)) { - // - // getHMVars().put(varName, new Variable(varName)); - // } - // } - // ASTAction parent = (ASTAction) jjtGetParent(); - // parent.setVarName(varName); - // - // } - // } - private void validateReturn(final LaraC lara, final Action action) { - if (returnName.isPresent()) { - - if (action.getReturnType().equals("void")) { - lara.warnln("Using a variable assignment from an action that returns void."); - } - String varName = returnName.get(); - final HashMap vars = getHMVars(); - if (!vars.containsKey(varName)) { - - // Verify outputs - - Optional ancestorOfType = getAncestorOfType(ASTAspectDef.class); - if (!ancestorOfType.isPresent() || - !ancestorOfType.get().getOutputs().containsKey(varName)) { - - getHMVars().put(varName, new Variable(varName)); - } - } - ASTAction parent = (ASTAction) jjtGetParent(); - parent.setVarName(varName); - - } - } - - private static boolean argsAreValid(Map actionParam) { - // int i = 0; - // final List missingArguments = SpecsFactory.newArrayList(); - for (final ActionArgument arg : actionParam.values()) { - if (arg.getValue() == null) { - return false; - // missingArguments.add(arg.getName()); - } else { - // if (arg.getType().equals("template")) { - // arg.getValue().isTemplate = true; - // } - // arg.getValue().organize(this); - // newParams.associateChild(arg.getValue(), i++); - } - } - // if (!missingArguments.isEmpty()) { - // throw newException( - // "Arguments " + missingArguments + " for action '" + action + "' must be defined."); - // } - return true; - } - - // private void organizeArgs(Map actionParam, ASTActionParameterList params) { - // int i = 0; - // for (final ActionArgument arg : actionParam.values()) { - // if (arg.getValue() == null) { - // throw new LARACompilerException("Unnexpected error. Please report to LARA developer"); - // // missingArguments.add(arg.getName()); - // } else { - // if (arg.getType().equals("template")) { - // arg.getValue().isTemplate = true; - // } - // arg.getValue().organize(this); - // params.associateChild(arg.getValue(), i++); - // } - // } - // // // if (!missingArguments.isEmpty()) { - // // // throw newException( - // // // "Arguments " + missingArguments + " for action '" + action + "' must be defined."); - // // // } - // // return true; - // } - - private void throwIllegalParameters(List actions, Node[] children) { - String message = "Illegal number of arguments in action '" + action + "'. "; - if (children == null) { - message += "None were given"; - } else { - if (children.length == 1) { - message += "One was given"; - } else { - message += children.length + " were given"; - } - } - - String numArgs = StringUtils.join(actions, a -> "(" + a.getParameters().size() + ")", ", "); - message += ", expected one of: " + numArgs + ". "; - String options = getOptionsString(actions); - message += options; - throw new LARACompilerException(message); - } - - private static String getOptionsString(List actions) { - String options = "Options:\n"; - int pos = 1; - for (Action action : actions) { - - String args = action2String(action); - options += "\t" + (pos++) + ") " + args + "\n"; - } - return options; - } - - private static String action2String(Action action) { - String args = action.getName() + "(" - + StringUtils.join(action.getParameters(), p -> p.getType() + " " + p.getName(), ", ") + ")"; - return args; - } - - /** - * @return the action - */ - public String getAction() { - return action; - } - - /** - * @param action - * the action to set - */ - public void setAction(String action) { - this.action = action; - } - - @Override - public String toString() { - return LARAEcmaScriptTreeConstants.jjtNodeName[id] + " [" + action + "]"; - } - - public void setVariable(String name) { - returnName = Optional.of(name); - } -} -/* - * JavaCC - OriginalChecksum=4864020f6ff39a51d8cfa5dfc0b2b815 (do not edit this - * line) - */ diff --git a/LARAC/src/org/dojo/jsl/parser/ast/ASTPointcut.java b/LARAC/src/org/dojo/jsl/parser/ast/ASTPointcut.java deleted file mode 100644 index 86a380d4d..000000000 --- a/LARAC/src/org/dojo/jsl/parser/ast/ASTPointcut.java +++ /dev/null @@ -1,418 +0,0 @@ -/* Generated By:JJTree: Do not edit this line. ASTPointcut.java Version 4.3 */ -/* - * JavaCCOptions:MULTI=true,NODE_USES_PARSER=false,VISITOR=false,TRACK_TOKENS=false,NODE_PREFIX=AST,NODE_EXTENDS=, - * NODE_FACTORY=,SUPPORT_CLASS_VISIBILITY_PUBLIC=true - */ -package org.dojo.jsl.parser.ast; - -import java.util.List; - -import org.dojo.jsl.parser.ast.utils.LARACConstantPool; -import org.lara.language.specification.dsl.Select; -import org.w3c.dom.Document; -import org.w3c.dom.Element; - -import larac.LaraC; -import larac.exceptions.LARACompilerException; -import larac.exceptions.LaraException; -import larac.objects.Enums.Types; -import larac.objects.Variable; -import utils.SelectionPathV2; -import utils.Selector; - -public class ASTPointcut extends SimpleNode { - public String reference; - private String type; - private Variable var; - private boolean validateChain = true; - - public ASTPointcut(int id) { - super(id); - } - - public ASTPointcut(LARAEcmaScript p, int id) { - super(p, id); - } - - public void setReference(String string) { - - if (!string.startsWith("$")) { - throw new LaraException( - "Id \"" + string + "\" for join point \"" + value + "\" must start with '$'"); - } - - reference = string; - - } - - public String getReference() { - return reference; - } - - /** - * @return the var - */ - public Variable getVar() { - return var; - } - - /** - * @param var - * the var to set - */ - public void setVar(Variable var) { - this.var = var; - } - - @Override - public Object organize(Object obj) { - final ASTSelect select = ((ASTSelect) obj); - final ASTAspectDef aspdef = this.getAspectDefForDeclStmt("Select"); - // final ASTAspectDef aspdef = (ASTAspectDef) (select.parent); - final LaraC lara = aspdef.getLara(); - // final JoinPointModel joinPointModel = lara.languageSpec().getJpModel(); - // This type was set previously, I hope! - // setType(joinPointModel.getLastPointcutType()); - var = new Variable(reference, Types.Joinpoint); - select.putPointcut(reference, this); - if (getChildren() == null) { - return null; - } - final SimpleNode firstChild = (SimpleNode) getChildren()[0]; - SimpleNode pointcutNode = null; - - if (firstChild instanceof ASTPointcutFilters) { - final ASTPointcutFilters pcp = (ASTPointcutFilters) firstChild; - pcp.organize(this, type, lara); - - if (getChildren().length > 1) { - pointcutNode = (SimpleNode) getChildren()[1]; - } else { - return null; - } - } else { - pointcutNode = firstChild; - } - - final String jpType = getType(); - final String selectName = pointcutNode.value.toString(); - // final PairList path2 = joinPointModel.getPath(jpType, selectName, validateChain); - final SelectionPathV2 selPath = new Selector(lara.languageSpec()).selectionPath(jpType, selectName, - validateChain); - // final SelectionPathV2 selPath = joinPointModel.selectionPath(jpType, selectName, validateChain); - - // System.out.println("##########################################"); - // System.out.println("[DEBUG]" + path2); - // System.out.println("[DEBUG]" + selPath); - // System.out.println("##########################################"); - - if ((!selPath.hasPath() || selPath.getPath().isEmpty()) && validateChain) { - throw newException( - "The following pointcut chain is not correct: \"" + value + "\"->\"" + pointcutNode.value + "\""); - } - - if (selPath.hasSecondaryPath()) { - getLara().warnln("More than one path was found for select: " + selPath.toString()); - - } - List path = selPath.getReversedPath(); - - for (int j = 0; j < path.size() - 1; j++) { - final ASTPointcut pc = new ASTPointcut(id); - final String pcName = path.get(j).getSelectName(); - // final String pcName = path.get(j).getAlias(); - // final String pcType = path.get(j).getClazz().getClazz(); - final String pcType = path.get(j).getClazz().getName(); - pc.jjtSetValue(pcName); - pc.setReference("$" + pcName + LARACConstantPool.HIDDEN_TAG + select.getHiddenCount()); - pc.setType(pcType); - ((SimpleNode) parent).associateChild(pc, i); - pc.associateChild(this, 0); - i = 0; - } - // setType(path.get(path.size() - 1).getClazz().getClazz()); - setType(path.get(path.size() - 1).getClazz().getName()); - - // if (path == null || path.isEmpty()) { - // throw new LARACompilerException("No path exists for was found for join pont '" + value + "'"); - // } - // - // for (int j = 0; j < path.size() - 1; j++) { - // final ASTPointcut pc = new ASTPointcut(id); - // final String pcName = path.get(j).getLeft(); - // final String pcType = path.get(j).getRight(); - // pc.jjtSetValue(pcName); - // pc.setReference("$" + pcName + LARACConstantPool.HIDDEN_TAG + select.getHiddenCount()); - // pc.setType(pcType); - // ((SimpleNode) parent).associateChild(pc, i); - // pc.associateChild(this, 0); - // i = 0; - // } - // setType(path.last().getRight()); - this.organize(obj); - return null; - } - - private void setValidateChain(boolean b) { - validateChain = b; - } - - @Override - public Variable lookupLastJPVariable() { - if (children == null) { - return var; - } - if (children.length == 1) { - if ((children[0] instanceof ASTPointcutFilters)) { - return var; - } - return ((SimpleNode) children[0]).lookupLastJPVariable(); - } - return ((SimpleNode) children[1]).lookupLastJPVariable(); - } - - @Override - public String toString() { - return LARAEcmaScriptTreeConstants.jjtNodeName[id] - + (value != null ? " [" + reference + "," + value + "]" : ""); - } - - @Override - public void toXML(Document doc, Element parent) { - final Element nameExprEl = doc.createElement("expression"); - parent.appendChild(nameExprEl); - Element nameLitEl; - if (type != null && type.equals(LARACConstantPool.USER_DEFINED)) { - // nameExprEl.setAttribute("desc", USER_DEFINED); - nameLitEl = doc.createElement("id"); - nameLitEl.setAttribute("name", value.toString()); - } else { - - nameLitEl = doc.createElement("literal"); - nameLitEl.setAttribute("value", value.toString()); - nameLitEl.setAttribute("type", Types.String.toString()); - - } - - nameExprEl.appendChild(nameLitEl); - - final Element idExprEl = doc.createElement("expression"); - parent.appendChild(idExprEl); - final Element idLitEl = doc.createElement("literal"); - - idLitEl.setAttribute("value", getReference().substring(1)); - idLitEl.setAttribute("type", Types.String.toString()); - idExprEl.appendChild(idLitEl); - /* - * Element classExprEl = doc.createElement("expression"); - * parent.appendChild(classExprEl); Element classLitEl = - * doc.createElement("literal"); classLitEl.setAttribute("value", type); - * classLitEl.setAttribute("type", Types.String.toString()); - * classExprEl.appendChild(classLitEl); - */ - final Element filterExprEl = doc.createElement("expression"); - parent.appendChild(filterExprEl); - if (getChildren() == null) { - return; - } - if (((SimpleNode) getChildren()[0]) instanceof ASTPointcutFilters) { - ((SimpleNode) getChildren()[0]).toXML(doc, filterExprEl); - if (getChildren().length > 1) { - ((SimpleNode) getChildren()[1]).toXML(doc, parent); - } - } else { - ((SimpleNode) getChildren()[0]).toXML(doc, parent); - } - - } - - /** - * @return the type - */ - public String getType() { - return type; - } - - /** - * @param type - * the type to set - */ - public void setType(String type) { - this.type = type; - } - - @Override - public boolean hasFilter() { - if (getChildren() == null) { - return false; - } - if (getChildren().length == 2) { - return true; - } - if (getChildren()[0] instanceof ASTPointcutFilters) { - return true; - } - return ((SimpleNode) getChildren()[0]).hasFilter(); - } - - @Override - public Element getFilterElement(Document doc) { - - // Element filterEl = doc.createElement("TODO-FILTER"); - if (getChildren() == null) { - return null; - } - if (getChildren().length == 2) { - final ASTPointcutFilters props = (ASTPointcutFilters) getChildren()[0]; - final Element propsEl = props.getFilterElement(doc); - final Element childPropsEl = ((SimpleNode) getChildren()[1]).getFilterElement(doc); - if (childPropsEl != null) { - final Element andEl = doc.createElement("AND"); - andEl.appendChild(propsEl); - andEl.appendChild(childPropsEl); - return andEl; - } - return propsEl; - } - if (getChildren()[0] instanceof ASTPointcutFilters) { - final ASTPointcutFilters props = (ASTPointcutFilters) getChildren()[0]; - return props.getFilterElement(doc); - } - return ((SimpleNode) getChildren()[0]).getFilterElement(doc); - - } -} - -/* - * JavaCC - OriginalChecksum=fe9e94dd85a2ee269ee705d34a1bed04 (do not edit this - * line) - */ diff --git a/LARAC/src/org/dojo/jsl/parser/ast/ASTPointcutFilters.java b/LARAC/src/org/dojo/jsl/parser/ast/ASTPointcutFilters.java deleted file mode 100644 index 10d9e362c..000000000 --- a/LARAC/src/org/dojo/jsl/parser/ast/ASTPointcutFilters.java +++ /dev/null @@ -1,102 +0,0 @@ -/* Generated By:JJTree: Do not edit this line. ASTPointcutFilters.java Version 4.3 */ -/* - * JavaCCOptions:MULTI=true,NODE_USES_PARSER=false,VISITOR=false,TRACK_TOKENS=false,NODE_PREFIX=AST,NODE_EXTENDS=, - * NODE_FACTORY=,SUPPORT_CLASS_VISIBILITY_PUBLIC=true - */ -package org.dojo.jsl.parser.ast; - -import org.w3c.dom.Document; -import org.w3c.dom.Element; - -import larac.LaraC; -import larac.exceptions.LARACompilerException; - -public class ASTPointcutFilters extends SimpleNode { - private boolean fullSpecified; - - public ASTPointcutFilters(int id) { - super(id); - } - - public ASTPointcutFilters(LARAEcmaScript p, int id) { - super(p, id); - } - - /** - * - * @param obj - * @param type - * @param lara - * @return - */ - public Object organize(Object obj, String type, LaraC lara) { - // if not full specified then we need to search for the default attribute and convert the children - // to full specified, i.e., == || == - if (!this.fullSpecified) { - final SimpleNode propChild = (SimpleNode) getChildren()[0]; - if (propChild instanceof ASTOrFiltersExpr) { - - for (int i = 0; i < propChild.getChildren().length; i++) { - setDefaultProperty(lara, propChild, (SimpleNode) propChild.getChildren()[i], i, type); - } - } else { - setDefaultProperty(lara, this, propChild, 0, type); - } - } - - for (final Node node : getChildren()) { - ((SimpleNode) node).organize(type, lara.languageSpec()); - } - return null; - } - - private static void setDefaultProperty(LaraC lara, SimpleNode child, SimpleNode value, int pos, String type) { - // final ArtifactsModel artifacts = lara.languageSpec().getArtifacts(); - // final Artifact art = artifacts.getArtifactRecursively(type); - // if (art == null) { - // - // throw new LARACompilerException("The joinpoint '" + type - // + "' does not contain any attribute defined, please reformulate the filter of the select."); - // } - // - // final String propStr = art.getDefault(); - - var defaultAttr = lara.languageSpec().getJoinPoint(type).getDefaultAttribute(); - - // if (propStr != null) { - if (defaultAttr.isPresent()) { - final ASTFilter prop = new ASTFilter(LARAEcmaScriptTreeConstants.JJTFILTER); - final ASTOperator op = new ASTOperator(LARAEcmaScriptTreeConstants.JJTOPERATOR); - op.jjtSetValue("=="); - // prop.setProp(propStr); - prop.setProp(defaultAttr.get()); - // prop.setOp("=="); - prop.associateChild(op, 0); - prop.associateChild(value, 1); - child.associateChild(prop, pos); - } else { - throw new LARACompilerException("The joinpoint '" + type - + "' does not contain a default attribute, please reformulate the filter of the select."); - } - } - - @Override - public Element getFilterElement(Document doc) { - return ((SimpleNode) getChildren()[0]).getFilterElement(doc); - } - - @Override - public void toXML(Document doc, Element parent) { - final Element propsCondEl = getFilterElement(doc); - - parent.appendChild(propsCondEl); - } - - public void setFullSpecified(boolean b) { - this.fullSpecified = b; - } -} -/* - * JavaCC - OriginalChecksum=b23d1ef4e84bc3e2939268dff4344012 (do not edit this - * line) - */ diff --git a/LARAC/src/org/dojo/jsl/parser/ast/ASTPostAssignmentList.java b/LARAC/src/org/dojo/jsl/parser/ast/ASTPostAssignmentList.java deleted file mode 100644 index 758b2f1b1..000000000 --- a/LARAC/src/org/dojo/jsl/parser/ast/ASTPostAssignmentList.java +++ /dev/null @@ -1,38 +0,0 @@ -/* Generated By:JJTree: Do not edit this line. ASTPostAssignmentList.java Version 4.3 */ -/* - * JavaCCOptions:MULTI=true,NODE_USES_PARSER=false,VISITOR=false,TRACK_TOKENS=false,NODE_PREFIX=AST,NODE_EXTENDS=, - * NODE_FACTORY=,SUPPORT_CLASS_VISIBILITY_PUBLIC=true - */ -package org.dojo.jsl.parser.ast; - -import org.w3c.dom.Document; -import org.w3c.dom.Element; - -public class ASTPostAssignmentList extends SimpleNode { - public ASTPostAssignmentList(int id) { - super(id); - } - - public ASTPostAssignmentList(LARAEcmaScript p, int id) { - super(p, id); - } - - @Override - public Object organize(Object obj) { - for (int i = 0; i < children.length; i++) { - ((SimpleNode) children[i]).organize(obj); - } - return null; - } - - @Override - public void toXML(Document doc, Element parent) { - for (int i = 0; i < children.length; i++) { - ((SimpleNode) children[i]).toXML(doc, parent); - } - } -} -/* - * JavaCC - OriginalChecksum=3436d21d14d367e791f53c8a9e7d0b32 (do not edit this - * line) - */ diff --git a/LARAC/src/org/dojo/jsl/parser/ast/ASTPostfixExpression.java b/LARAC/src/org/dojo/jsl/parser/ast/ASTPostfixExpression.java deleted file mode 100644 index b9a667e23..000000000 --- a/LARAC/src/org/dojo/jsl/parser/ast/ASTPostfixExpression.java +++ /dev/null @@ -1,45 +0,0 @@ -/* Generated By:JJTree: Do not edit this line. ASTPostfixExpression.java Version 4.3 */ -/* - * JavaCCOptions:MULTI=true,NODE_USES_PARSER=false,VISITOR=false,TRACK_TOKENS=false,NODE_PREFIX=AST,NODE_EXTENDS=, - * NODE_FACTORY=,SUPPORT_CLASS_VISIBILITY_PUBLIC=true - */ -package org.dojo.jsl.parser.ast; - -import org.w3c.dom.Document; -import org.w3c.dom.Element; - -public class ASTPostfixExpression extends SimpleNode { - private String op; - - public ASTPostfixExpression(int id) { - super(id); - } - - public ASTPostfixExpression(LARAEcmaScript p, int id) { - super(p, id); - } - - @Override - public Object organize(Object obj) { - ((SimpleNode) children[0]).organize(obj); - final ASTOperator oper = ((ASTOperator) children[1]); - if (oper.value.toString().equals("++")) { - op = "INCS"; - } else { - op = "DECS"; - } - return null; - } - - @Override - public void toXML(Document doc, Element parent) { - final Element opEl = doc.createElement("op"); - opEl.setAttribute("name", op); - parent.appendChild(opEl); - ((SimpleNode) children[0]).toXML(doc, opEl); - } -} -/* - * JavaCC - OriginalChecksum=0868f138559f384bd58ad9f9f495f1bb (do not edit this - * line) - */ diff --git a/LARAC/src/org/dojo/jsl/parser/ast/ASTPreAssignmentList.java b/LARAC/src/org/dojo/jsl/parser/ast/ASTPreAssignmentList.java deleted file mode 100644 index 033d89005..000000000 --- a/LARAC/src/org/dojo/jsl/parser/ast/ASTPreAssignmentList.java +++ /dev/null @@ -1,38 +0,0 @@ -/* Generated By:JJTree: Do not edit this line. ASTPreAssignmentList.java Version 4.3 */ -/* - * JavaCCOptions:MULTI=true,NODE_USES_PARSER=false,VISITOR=false,TRACK_TOKENS=false,NODE_PREFIX=AST,NODE_EXTENDS=, - * NODE_FACTORY=,SUPPORT_CLASS_VISIBILITY_PUBLIC=true - */ -package org.dojo.jsl.parser.ast; - -import org.w3c.dom.Document; -import org.w3c.dom.Element; - -public class ASTPreAssignmentList extends SimpleNode { - public ASTPreAssignmentList(int id) { - super(id); - } - - public ASTPreAssignmentList(LARAEcmaScript p, int id) { - super(p, id); - } - - @Override - public Object organize(Object obj) { - for (int i = 0; i < children.length; i++) { - ((SimpleNode) children[i]).organize(obj); - } - return null; - } - - @Override - public void toXML(Document doc, Element parent) { - for (int i = 0; i < children.length; i++) { - ((SimpleNode) children[i]).toXML(doc, parent); - } - } -} -/* - * JavaCC - OriginalChecksum=cf67b85cf68fc8793080c566bccd03d0 (do not edit this - * line) - */ diff --git a/LARAC/src/org/dojo/jsl/parser/ast/ASTPropertyIdentifierReference.java b/LARAC/src/org/dojo/jsl/parser/ast/ASTPropertyIdentifierReference.java deleted file mode 100644 index 847dd9d43..000000000 --- a/LARAC/src/org/dojo/jsl/parser/ast/ASTPropertyIdentifierReference.java +++ /dev/null @@ -1,78 +0,0 @@ -/* Generated By:JJTree: Do not edit this line. ASTPropertyIdentifierReference.java Version 4.3 */ -/* - * JavaCCOptions:MULTI=true,NODE_USES_PARSER=false,VISITOR=false,TRACK_TOKENS=false,NODE_PREFIX=AST,NODE_EXTENDS=, - * NODE_FACTORY=,SUPPORT_CLASS_VISIBILITY_PUBLIC=true - */ -package org.dojo.jsl.parser.ast; - -import org.w3c.dom.Document; -import org.w3c.dom.Element; - -import larac.LaraC; -import larac.objects.Enums.Types; - -public class ASTPropertyIdentifierReference extends SimpleNode { - public ASTPropertyIdentifierReference(int id) { - super(id); - } - - public ASTPropertyIdentifierReference(LARAEcmaScript p, int id) { - super(p, id); - } - - @Override - public void toXML(Document doc, Element parent) { - final String name = ((ASTIdentifier) children[0]).getName(); - final Element literalEl = doc.createElement("literal"); - literalEl.setAttribute("value", name); - literalEl.setAttribute("type", Types.String.toString()); - parent.appendChild(literalEl); - // ((SimpleNode)children[0]).toXML(doc, parent); - } - - @Override - public Object organize(Object obj) { - return null; - } - - @Override - public String toSource(int indentation) { - - return indent(indentation) + ((ASTIdentifier) children[0]).toSource(); - } - - @Override - public void organizePointcutReference(ASTPointcut pc) { - final LaraC lara = getLara(); - if (lara.languageSpec().getJoinPoint(pc.getType()).getAttribute(((SimpleNode) children[0]).value.toString()) - .isEmpty()) { - // if (lara.languageSpec().getArtifacts().getAttribute(pc.getType(), - // ((SimpleNode) children[0]).value.toString()) == null) { - throw newException("The joinpoint \"" + pc.getReference() + "\" does not contain the attribute \"" - + ((SimpleNode) children[0]).value.toString() + "\""); - } - } - - @Override - public void organizeActionReference(ASTPointcut pc) { - final LaraC lara = getLara(); - // if (!lara.languageSpec().getActionModel().contains(((SimpleNode) children[0]).value.toString())) { - if (!lara.languageSpec().hasAction(((SimpleNode) children[0]).value.toString())) { - throw newException("The action \"" + ((SimpleNode) children[0]).value.toString() + "\" does not exist"); - } - } - - @Override - public String getMethodId() { - return ((SimpleNode) children[0]).getMethodId(); - } - - @Override - public String getVarName() { - return ((SimpleNode) children[0]).getVarName(); - } -} -/* - * JavaCC - OriginalChecksum=ce74fbfcc89103c0721fd0ebd16fcba1 (do not edit this - * line) - */ diff --git a/LARAC/src/org/dojo/jsl/parser/ast/ASTPropertyValueReference.java b/LARAC/src/org/dojo/jsl/parser/ast/ASTPropertyValueReference.java deleted file mode 100644 index 4f483d2bc..000000000 --- a/LARAC/src/org/dojo/jsl/parser/ast/ASTPropertyValueReference.java +++ /dev/null @@ -1,39 +0,0 @@ -/* Generated By:JJTree: Do not edit this line. ASTPropertyValueReference.java Version 4.3 */ -/* - * JavaCCOptions:MULTI=true,NODE_USES_PARSER=false,VISITOR=false,TRACK_TOKENS=false,NODE_PREFIX=AST,NODE_EXTENDS=, - * NODE_FACTORY=,SUPPORT_CLASS_VISIBILITY_PUBLIC=true - */ -package org.dojo.jsl.parser.ast; - -import org.w3c.dom.Document; -import org.w3c.dom.Element; - -public class ASTPropertyValueReference extends SimpleNode { - public ASTPropertyValueReference(int id) { - super(id); - } - - public ASTPropertyValueReference(LARAEcmaScript p, int id) { - super(p, id); - } - - @Override - public Object organize(Object obj) { - return ((SimpleNode) children[0]).organize(obj); - } - - @Override - public void toXML(Document doc, Element parent) { - ((SimpleNode) children[0]).toXML(doc, parent); - } - - @Override - public String toSource(int indentation) { - - return indent(indentation) + "[" + ((SimpleNode) children[0]).toSource(0) + "]"; - } -} -/* - * JavaCC - OriginalChecksum=a9e3d25c9236ea41f6a673f87a9ca4a5 (do not edit this - * line) - */ diff --git a/LARAC/src/org/dojo/jsl/parser/ast/ASTReturnStatement.java b/LARAC/src/org/dojo/jsl/parser/ast/ASTReturnStatement.java deleted file mode 100644 index 10155e6be..000000000 --- a/LARAC/src/org/dojo/jsl/parser/ast/ASTReturnStatement.java +++ /dev/null @@ -1,51 +0,0 @@ -/* Generated By:JJTree: Do not edit this line. ASTReturnStatement.java Version 4.3 */ -/* - * JavaCCOptions:MULTI=true,NODE_USES_PARSER=false,VISITOR=false,TRACK_TOKENS=false,NODE_PREFIX=AST,NODE_EXTENDS=, - * NODE_FACTORY=,SUPPORT_CLASS_VISIBILITY_PUBLIC=true - */ -package org.dojo.jsl.parser.ast; - -import org.w3c.dom.Document; -import org.w3c.dom.Element; - -public class ASTReturnStatement extends SimpleNode { - public ASTReturnStatement(int id) { - super(id); - } - - public ASTReturnStatement(LARAEcmaScript p, int id) { - super(p, id); - } - - @Override - public Object organize(Object obj) { - ((SimpleNode) children[0]).organize(obj); - return obj; - } - - @Override - public void toXML(Document doc, Element parent) { - // Element returnEl = doc.createElement("return"); - final SimpleNode funDecl = getParentById(LARAEcmaScriptTreeConstants.JJTFUNCTIONDECLARATION); - final SimpleNode funExpr = getParentById(LARAEcmaScriptTreeConstants.JJTFUNCTIONEXPRESSION); - final Element returnEl = doc.createElement("statement"); - if (funDecl == null && funExpr == null) { // IF both are null, mean that - // the return is somewhere - // inside the - // aspect - returnEl.setAttribute("name", "exit"); - } else { - returnEl.setAttribute("name", "return"); - } - returnEl.setAttribute("coord", getCoords()); - parent.appendChild(returnEl); - final Element exprEl = doc.createElement("expression"); - returnEl.appendChild(exprEl); - ((SimpleNode) children[0]).toXML(doc, exprEl); - } - -} -/* - * JavaCC - OriginalChecksum=1bec65412e57773f32b5cb7e65646749 (do not edit this - * line) - */ diff --git a/LARAC/src/org/dojo/jsl/parser/ast/ASTRun.java b/LARAC/src/org/dojo/jsl/parser/ast/ASTRun.java deleted file mode 100644 index 31592a475..000000000 --- a/LARAC/src/org/dojo/jsl/parser/ast/ASTRun.java +++ /dev/null @@ -1,212 +0,0 @@ -/* Generated By:JJTree: Do not edit this line. ASTRun.java Version 4.3 */ -/* - * JavaCCOptions:MULTI=true,NODE_USES_PARSER=false,VISITOR=false,TRACK_TOKENS=false,NODE_PREFIX=AST,NODE_EXTENDS=, - * NODE_FACTORY=,SUPPORT_CLASS_VISIBILITY_PUBLIC=true - */ -package org.dojo.jsl.parser.ast; - -import org.w3c.dom.Document; -import org.w3c.dom.Element; - -import larac.objects.Enums.AssignOperator; -import larac.objects.Enums.Types; -import larac.utils.OrganizeUtils; - -public @SuppressWarnings("all") class ASTRun extends SimpleNode { - private String toolName; - private static final int numOfJSRunMethod = 6; - - public ASTRun(int id) { - super(id); - } - - public ASTRun(LARAEcmaScript p, int id) { - super(p, id); - } - - @Override - public Object organize(Object obj) { - int pos = 0; - if (!(children[pos] instanceof ASTFunctionCallParameters)) { - pos++; - } - - final ASTFunctionCallParameters args = (ASTFunctionCallParameters) children[pos]; - args.organize(obj); - if (args.jjtGetNumChildren() == 0 && toolName == null) { - throw newException("No argument was given in 'run'. At least 'tool' is required to execute."); - } - if (toolName != null) { - - return null; - } - final int remainingArgs = ASTRun.numOfJSRunMethod - args.jjtGetNumChildren(); - - if (remainingArgs < 0) { - getLara().warnln("A total of " + args.jjtGetNumChildren() - + " arguments was used in the tool execution, the required number of arguments are: " - + (ASTRun.numOfJSRunMethod - 1) + ". This may lead to issues in the tool execution."); - } else if (remainingArgs == 0 && (pos < children.length)) { - getLara().warnln(ASTRun.numOfJSRunMethod - + " arguments and a pipe in the 'run' method. However, the last argument overrides the used pipe."); - } - - return null; - } - - @Override - public void toXML(Document doc, Element parent) { - final Element statementEl = doc.createElement("statement"); - statementEl.setAttribute("coord", getCoords()); - statementEl.setAttribute("name", "expr"); - parent.appendChild(statementEl); - - final Element exprEl = doc.createElement("expression"); - statementEl.appendChild(exprEl); - int pos = 0; - Element current = exprEl; - if (!(children[pos] instanceof ASTFunctionCallParameters)) { - // Then it is a left hand side expression - final Element opEl = doc.createElement("op"); - opEl.setAttribute("name", AssignOperator.ASSIGN.name()); - exprEl.appendChild(opEl); - ((SimpleNode) children[pos]).toXML(doc, opEl); - pos++; - current = opEl; - } - - final Element callEl = doc.createElement("call"); - current.appendChild(callEl); - final Element methodEl = doc.createElement("method"); - callEl.appendChild(methodEl); - final Element runIDEl = doc.createElement("id"); - runIDEl.setAttribute("name", "run"); - methodEl.appendChild(runIDEl); - final ASTFunctionCallParameters args = (ASTFunctionCallParameters) children[pos++]; - - if (toolName != null) { - toXMLOfNewVersion(doc, pos, callEl, args); - } else { // old version was used - - toXMLOldVersion(doc, pos, callEl, args); - } - } - - /** - * Generate the arguments of the use of old run method - * - * @param doc - * @param pos - * @param callEl - * @param args - */ - private void toXMLOldVersion(Document doc, int pos, Element callEl, ASTFunctionCallParameters args) { - args.toXML(doc, callEl); - final int remainingArgs = ASTRun.numOfJSRunMethod - args.jjtGetNumChildren(); - if (remainingArgs <= 0) { - return; - } - - final Element pipeEl = doc.createElement("argument"); - if (args.areNamed) { - pipeEl.setAttribute("name", "pipe"); - } else { - // Fill the missing arguments with 'undefined' - for (int i = 0; i < remainingArgs - 1; i++) { - final Element argEl = doc.createElement("argument"); - callEl.appendChild(argEl); - OrganizeUtils.createLiteralUndefined(doc, argEl); - } - - } - - callEl.appendChild(pipeEl); - - if (pos < children.length) { - final SimpleNode pipeExpr = (SimpleNode) children[pos]; - pipeExpr.toXML(doc, pipeEl); - } else { - OrganizeUtils.createLiteralUndefined(doc, pipeEl); - - } - } - - /** - * Generate the arguments of the use of new run method - */ - private void toXMLOfNewVersion(Document doc, int pos, Element callEl, ASTFunctionCallParameters args) { - // Then is the new run version - Element argEl = doc.createElement("argument"); - argEl.setAttribute("name", "tool"); - callEl.appendChild(argEl); - Element litEl = doc.createElement("literal"); - litEl.setAttribute("type", Types.String.toString()); - litEl.setAttribute("value", toolName); - argEl.appendChild(litEl); - setArgumentsAsList(args, doc, callEl); - - argEl = doc.createElement("argument"); - argEl.setAttribute("name", "verbose"); - callEl.appendChild(argEl); - litEl = doc.createElement("literal"); - litEl.setAttribute("type", Types.Int.toString()); - litEl.setAttribute("value", String.valueOf(2)); - argEl.appendChild(litEl); - argEl = doc.createElement("argument"); - argEl.setAttribute("name", "pipe"); - callEl.appendChild(argEl); - if (pos < children.length) { - final SimpleNode pipeExpr = (SimpleNode) children[pos]; - pipeExpr.toXML(doc, argEl); - } else { - OrganizeUtils.createLiteralUndefined(doc, argEl); - } - } - - private void setArgumentsAsList(ASTFunctionCallParameters args, Document doc, Element parentEl) { - final Element argEl = doc.createElement("argument"); - parentEl.appendChild(argEl); - argEl.setAttribute("name", "args"); - final Element litEl = doc.createElement("literal"); - argEl.appendChild(litEl); - if (args.areNamed) { - litEl.setAttribute("type", "object"); - for (final Node arg : args.getChildren()) { - final ASTNamedArgument na = (ASTNamedArgument) arg; - final Element keyEl = doc.createElement("key"); - na.toXML(doc, keyEl); - litEl.appendChild(keyEl); - } - } else { - litEl.setAttribute("type", "array"); - int i = 0; - for (final Node arg : args.getChildren()) { - final Element keyEl = doc.createElement("key"); - keyEl.setAttribute("name", String.valueOf(i++)); - litEl.appendChild(keyEl); - ((SimpleNode) arg).toXML(doc, keyEl); - } - } - - } - - /** - * @return the toolName - */ - public String getToolName() { - return toolName; - } - - /** - * @param toolName - * the toolName to set - */ - public void setToolName(String toolName) { - this.toolName = toolName; - } - -} -/* - * JavaCC - OriginalChecksum=a983f8b6f04dcc338add9564fb6fdd01 (do not edit this - * line) - */ diff --git a/LARAC/src/org/dojo/jsl/parser/ast/ASTSecondSetOp.java b/LARAC/src/org/dojo/jsl/parser/ast/ASTSecondSetOp.java deleted file mode 100644 index 3b8c7c553..000000000 --- a/LARAC/src/org/dojo/jsl/parser/ast/ASTSecondSetOp.java +++ /dev/null @@ -1,21 +0,0 @@ -/* Generated By:JJTree: Do not edit this line. ASTSecondSetOp.java Version 4.3 */ -/* - * JavaCCOptions:MULTI=true,NODE_USES_PARSER=false,VISITOR=false,TRACK_TOKENS=false,NODE_PREFIX=AST,NODE_EXTENDS=, - * NODE_FACTORY=,SUPPORT_CLASS_VISIBILITY_PUBLIC=true - */ -package org.dojo.jsl.parser.ast; - -public class ASTSecondSetOp extends SimpleNode { - public ASTSecondSetOp(int id) { - super(id); - } - - public ASTSecondSetOp(LARAEcmaScript p, int id) { - super(p, id); - } - -} -/* - * JavaCC - OriginalChecksum=d91e265260790110aaade59f0249a7dd (do not edit this - * line) - */ diff --git a/LARAC/src/org/dojo/jsl/parser/ast/ASTSelect.java b/LARAC/src/org/dojo/jsl/parser/ast/ASTSelect.java deleted file mode 100644 index 7bda02837..000000000 --- a/LARAC/src/org/dojo/jsl/parser/ast/ASTSelect.java +++ /dev/null @@ -1,184 +0,0 @@ -/* Generated By:JJTree: Do not edit this line. ASTSelect.java Version 4.3 */ -/* - * JavaCCOptions:MULTI=true,NODE_USES_PARSER=false,VISITOR=false,TRACK_TOKENS=false,NODE_PREFIX=AST,NODE_EXTENDS=, - * NODE_FACTORY=,SUPPORT_CLASS_VISIBILITY_PUBLIC=true - */ -package org.dojo.jsl.parser.ast; - -import java.util.HashMap; - -import org.dojo.jsl.parser.ast.utils.LARACConstantPool; -import org.w3c.dom.Document; -import org.w3c.dom.Element; - -import larac.objects.Enums.Types; -import larac.objects.Variable; -import tdrc.utils.HashBag; - -public class ASTSelect extends SimpleNode { - private String name; - private Variable lastJPVariable; - private int hiddenCount = 0; - private HashMap pointcuts = new HashMap<>(); - private final HashBag repeatedPointcutsBag = new HashBag<>(); - - public ASTSelect(int id) { - super(id); - } - - public ASTSelect(LARAEcmaScript p, int id) { - super(p, id); - } - - @Override - public Object organize(Object obj) { - // final ASTAspectDef aspectDef = ((ASTAspectDef) obj); - final ASTAspectDef aspectDef = this.getAspectDefForDeclStmt("Select"); - if (name == null) { - name = aspectDef.getName() + "_select_" + aspectDef.getSelectCount(); - aspectDef.setLastSelectWithNoLabel(this); - } - - /* - * Variable var = lookup(name); if(var != null){ - * System.out.println("WHAT??"); throw newException("variable '"+name+ - * "' used in 'select' is already defined."); } - */ - final SimpleNode child = (SimpleNode) getChildren()[0]; - if (child instanceof ASTJoin) { - child.organize(aspectDef); - } else { - child.organizeFirst(this, 0); - // aspectDef.getLara().languageSpec().getJpModel().setLastPointcutType(null); - } - - if (aspectDef.putSelect(name, this) != null) { - throw newException("select '" + name + "' already defined."); - } - setLastJPVariable(lookupLastJPVariable()); - getHMVars().put(name, new Variable(name, Types.Joinpoint)); - return null; - } - - public Object organizeJoinInApply(Object obj) { - final ASTAspectDef aspectDef = ((ASTAspectDef) obj); - // final ASTAspectDef aspectDef = this.getAspectDefForDeclStmt("Select"); - final SimpleNode child = (SimpleNode) getChildren()[0]; - child.organize(aspectDef); - setLastJPVariable(lookupLastJPVariable()); - return null; - } - - @Override - public Variable lookupLastJPVariable() { - final SimpleNode child = (SimpleNode) getChildren()[0]; - return child.lookupLastJPVariable(); - } - - /** - * @return the name - */ - public String getName() { - return name; - } - - /** - * @param name - * the name to set - */ - public void setName(String name) { - this.name = name; - } - - @Override - public String toString() { - return LARAEcmaScriptTreeConstants.jjtNodeName[id] + (name != null ? " [" + name + "]" : ""); - } - - /** - * @return the pointcuts - */ - public HashMap getPointcuts() { - return pointcuts; - } - - public ASTPointcut getPointcut(String pc) { - return pointcuts.get(pc); - } - - /** - * @param pointcuts - * the pointcuts to set - */ - public void setPointcuts(HashMap pointcuts) { - this.pointcuts = pointcuts; - } - - public void putPointcut(String key, ASTPointcut pointcut) { - if (pointcuts.containsKey(key)) { - final ASTPointcut oldPC = pointcuts.get(key); - // System.out.println("KEY: " + key); - // System.out.println("REPEATED REF: " + oldPC.getReference()); - final int newVal = repeatedPointcutsBag.get(key); - repeatedPointcutsBag.put(key); - oldPC.setReference(key + LARACConstantPool.DISABLED_TAG + newVal); - pointcuts.put(oldPC.getReference(), oldPC); - } - pointcuts.put(key, pointcut); - } - - public int getHiddenCount() { - - return hiddenCount++; - } - - @Override - public void toXML(Document doc, Element parent) { - final Element selectEl = doc.createElement("statement"); - selectEl.setAttribute("name", "select"); - selectEl.setAttribute("label", getName()); - selectEl.setAttribute("coord", getCoords()); - parent.appendChild(selectEl); - /* - * UNCOMMENT IF NAME REQUIRED! * Element nameExprEl = - * doc.createElement("expression"); selectEl.appendChild(nameExprEl); - * Element nameLitEl = doc.createElement("literal"); - * nameLitEl.setAttribute("value", getName()); - * nameLitEl.setAttribute("type", Types.String.toString()); - * nameExprEl.appendChild(nameLitEl); / - **/ - if ((SimpleNode) getChildren()[0] instanceof ASTPointcut) { - ((SimpleNode) getChildren()[0]).toXML(doc, selectEl); - } else { - final Element exprEl = doc.createElement("expression"); - selectEl.appendChild(exprEl); - ((SimpleNode) getChildren()[0]).toXML(doc, exprEl); - } - } - - @Override - public boolean hasFilter() { - final SimpleNode child = (SimpleNode) getChildren()[0]; - return child.hasFilter(); - } - - @Override - public Element getFilterElement(Document doc) { - - final SimpleNode child = (SimpleNode) getChildren()[0]; - return child.getFilterElement(doc); - } - - public void setLastJPVariable(Variable lastJPVariable) { - this.lastJPVariable = lastJPVariable; - } - - public Variable getLastJPVariable() { - return lastJPVariable; - } - -} -/* - * JavaCC - OriginalChecksum=35d276dbfb06bfd94dbf01f8f69a2519 (do not edit this - * line) - */ diff --git a/LARAC/src/org/dojo/jsl/parser/ast/ASTStart.java b/LARAC/src/org/dojo/jsl/parser/ast/ASTStart.java deleted file mode 100644 index be233674a..000000000 --- a/LARAC/src/org/dojo/jsl/parser/ast/ASTStart.java +++ /dev/null @@ -1,133 +0,0 @@ -/* Generated By:JJTree: Do not edit this line. ASTStart.java Version 4.3 */ -/* - * JavaCCOptions:MULTI=true,NODE_USES_PARSER=false,VISITOR=false,TRACK_TOKENS=false,NODE_PREFIX=AST,NODE_EXTENDS=, - * NODE_FACTORY=,SUPPORT_CLASS_VISIBILITY_PUBLIC=true - */ -package org.dojo.jsl.parser.ast; - -import java.util.ArrayList; -import java.util.Iterator; - -import larac.LaraC; -import larac.objects.Variable; - -public class ASTStart extends SimpleNode { - private LaraC lara; - - public ASTStart(int id) { - super(id); - } - - public ASTStart(LARAEcmaScript p, int id) { - super(p, id); - } - - @Override - public Object organize(Object obj) { - lara = (LaraC) obj; - var declList = new ArrayList(); - final ArrayList aspectsList = new ArrayList<>(); - if (getChildren() == null) { - return null; - } - for (final SimpleNode n : getSimpleNodeChildren()) { - if (!(n instanceof ASTAspectDef)) { - // n.declareGlobal(lara); - declList.add(n); // delay declaring global symbols - // ((SimpleNode) n).organize(obj); - } else { - aspectsList.add((ASTAspectDef) n); - } - } - for (final ASTAspectDef asp : aspectsList) { - asp.createAspect(lara); - asp.createVar(); - } - - // declare global symbols after aspects have been created - for (var n : declList) { - n.declareGlobal(lara); - } - - for (final ASTAspectDef asp : aspectsList) { - asp.organize(obj); - for (final SimpleNode sn : asp.getApplies()) { - ((ASTApply) sn).organizeAfter(); - } - } - return null; - } - - @Override - public Variable lookup(String var) { - ASTAspectDef asp = lara.aspectIR().getAspectDef(var); - if (asp != null) { - return asp.getStaticVar(); - } - asp = lara.aspectIR().getImportedAspectDef(var); - if (asp != null) { - return asp.getStaticVar(); - } - - if (lara.aspectIR().containsGlobal(var)) { - SimpleNode global = lara.aspectIR().getGlobal(var); - return new Variable(var, global.getExpressionType()); - } - - final Variable variableNotFound = new Variable(var); - variableNotFound.setNotFound(true); - return variableNotFound; - } - - public void getMatchingAspectDef(ArrayList aspects, String name) { - final Iterator it = aspects.iterator(); - while (it.hasNext()) { - final ASTAspectDef asp = it.next(); - if (!asp.getCompleteName().contains(name)) { - it.remove(); - } - } - } - - @Override - public Variable lookupNoError(String var) { - ASTAspectDef asp = lara.aspectIR().getAspectDef(var); - - if (asp != null) { - return asp.getStaticVar(); - } - asp = lara.aspectIR().getImportedAspectDef(var); - if (asp != null) { - return asp.getStaticVar(); - } - - return new Variable(var); - } - - @Override - public LaraC getLara() { - return lara; - } - - public void setLara(LaraC lara) { - this.lara = lara; - } - - @Override - public String toSource(int indentation) { - if (getChildren() == null) { - return ""; - } - String source = ""; - - for (final Node n : getChildren()) { - source += ((SimpleNode) n).toSource(indentation) + "\n"; - } - return source; - } - -} -/* - * JavaCC - OriginalChecksum=8071fc6e50a502f262cc0461c29fb06b (do not edit this - * line) - */ diff --git a/LARAC/src/org/dojo/jsl/parser/ast/ASTStatementList.java b/LARAC/src/org/dojo/jsl/parser/ast/ASTStatementList.java deleted file mode 100644 index b5eb63947..000000000 --- a/LARAC/src/org/dojo/jsl/parser/ast/ASTStatementList.java +++ /dev/null @@ -1,38 +0,0 @@ -/* Generated By:JJTree: Do not edit this line. ASTStatementList.java Version 4.3 */ -/* - * JavaCCOptions:MULTI=true,NODE_USES_PARSER=false,VISITOR=false,TRACK_TOKENS=false,NODE_PREFIX=AST,NODE_EXTENDS=, - * NODE_FACTORY=,SUPPORT_CLASS_VISIBILITY_PUBLIC=true - */ -package org.dojo.jsl.parser.ast; - -import org.w3c.dom.Document; -import org.w3c.dom.Element; - -public class ASTStatementList extends SimpleNode { - public ASTStatementList(int id) { - super(id); - } - - public ASTStatementList(LARAEcmaScript p, int id) { - super(p, id); - } - - @Override - public Object organize(Object obj) { - for (final Node child : getChildren()) { - ((SimpleNode) child).organize(obj); - } - return null; - } - - @Override - public void toXML(Document doc, Element parent) { - for (final Node child : getChildren()) { - ((SimpleNode) child).toXML(doc, parent); - } - } -} -/* - * JavaCC - OriginalChecksum=abb3ed87f64e250c8d785390504b91ff (do not edit this - * line) - */ diff --git a/LARAC/src/org/dojo/jsl/parser/ast/ASTStatic.java b/LARAC/src/org/dojo/jsl/parser/ast/ASTStatic.java deleted file mode 100644 index 505e71fef..000000000 --- a/LARAC/src/org/dojo/jsl/parser/ast/ASTStatic.java +++ /dev/null @@ -1,109 +0,0 @@ -/* Generated By:JJTree: Do not edit this line. ASTStatic.java Version 4.3 */ -/* - * JavaCCOptions:MULTI=true,NODE_USES_PARSER=false,VISITOR=false,TRACK_TOKENS=false,NODE_PREFIX=AST,NODE_EXTENDS=, - * NODE_FACTORY=,SUPPORT_CLASS_VISIBILITY_PUBLIC=true - */ -package org.dojo.jsl.parser.ast; - -import java.util.HashMap; - -import org.w3c.dom.Document; -import org.w3c.dom.Element; - -import larac.objects.SymbolTable; -import larac.objects.Variable; - -public class ASTStatic extends SimpleNode { - private SymbolTable localVars = new SymbolTable<>(); - - public ASTStatic(int id) { - super(id); - } - - public ASTStatic(LARAEcmaScript p, int id) { - super(p, id); - } - - @Override - public Object organize(Object obj) { - if (getChildren() == null) { - return null; - } - if (((ASTAspectDef) parent).getStatic() != null) { - throw newException("Can only have one static section"); - } - ((ASTAspectDef) parent).setStatic(this); - for (final Node child : getChildren()) { - ((SimpleNode) child).organize(this); - } - return null; - } - - @Override - public void toXML(Document doc, Element parent) { - if (localVars.isEmpty()) { - return; - } - final Element staticEl = doc.createElement("static"); - parent.appendChild(staticEl); - // createXMLDecl(localVars.values(),doc,staticEl); - for (final Node child : children) { - final SimpleNode sn = (SimpleNode) child; - sn.toXML(doc, staticEl); - } - } - - /** - * @return the localVars - */ - public SymbolTable getLocalVars() { - return localVars; - } - - @Override - public HashMap getHMVars() { - return localVars; - } - - /** - * @param localVars - * the localVars to set - */ - public void setLocalVars(SymbolTable localVars) { - this.localVars = localVars; - } - - @Override - public Variable lookup(String var) { - if (localVars.containsKey(var)) { - return localVars.get(var); - } - return ((SimpleNode) ((SimpleNode) parent).parent).lookupNoError(var); // grandfather - } - - public Variable lookupStatic(String var) { - if (localVars.containsKey(var)) { - return localVars.get(var); - } - return null; - } - - @Override - public Variable lookupNoError(String var) { - if (localVars.containsKey(var)) { - return localVars.get(var); - } - return ((SimpleNode) ((SimpleNode) parent).parent).lookupNoError(var); // grandfather - } - - public Variable lookupNoErrorStatic(String var) { - if (localVars.containsKey(var)) { - return localVars.get(var); - } - return null; - } -} -/* - * JavaCC - OriginalChecksum=5e81d4475827eff1b045f39e6f06f00f (do not edit this - * line) - */ diff --git a/LARAC/src/org/dojo/jsl/parser/ast/ASTSwitchStatement.java b/LARAC/src/org/dojo/jsl/parser/ast/ASTSwitchStatement.java deleted file mode 100644 index e65a386da..000000000 --- a/LARAC/src/org/dojo/jsl/parser/ast/ASTSwitchStatement.java +++ /dev/null @@ -1,49 +0,0 @@ -/* Generated By:JJTree: Do not edit this line. ASTSwitchStatement.java Version 4.3 */ -/* - * JavaCCOptions:MULTI=true,NODE_USES_PARSER=false,VISITOR=false,TRACK_TOKENS=false,NODE_PREFIX=AST,NODE_EXTENDS=, - * NODE_FACTORY=,SUPPORT_CLASS_VISIBILITY_PUBLIC=true - */ -package org.dojo.jsl.parser.ast; - -import org.w3c.dom.Document; -import org.w3c.dom.Element; - -public class ASTSwitchStatement extends SimpleNode { - public ASTSwitchStatement(int id) { - super(id); - } - - public ASTSwitchStatement(LARAEcmaScript p, int id) { - super(p, id); - } - - @Override - public Object organize(Object obj) { - for (int i = 0; i < children.length; i++) { - ((SimpleNode) children[i]).organize(obj); - } - return null; - } - - @Override - public void toXML(Document doc, Element parent) { - final Element statEl = doc.createElement("statement"); - parent.appendChild(statEl); - statEl.setAttribute("name", "switch"); - statEl.setAttribute("coord", getCoords()); - if (!label.isEmpty()) { - statEl.setAttribute("label", label); - } - final Element swEl = doc.createElement("expression"); - statEl.appendChild(swEl); - swEl.setAttribute("desc", "switcher"); - ((SimpleNode) children[0]).toXML(doc, swEl); - - ((SimpleNode) children[1]).toXML(doc, statEl); - } - -} -/* - * JavaCC - OriginalChecksum=c4be2b1ffd729f6b6c4034f162aad0e4 (do not edit this - * line) - */ diff --git a/LARAC/src/org/dojo/jsl/parser/ast/ASTThirdSetOp.java b/LARAC/src/org/dojo/jsl/parser/ast/ASTThirdSetOp.java deleted file mode 100644 index 8717863b3..000000000 --- a/LARAC/src/org/dojo/jsl/parser/ast/ASTThirdSetOp.java +++ /dev/null @@ -1,21 +0,0 @@ -/* Generated By:JJTree: Do not edit this line. ASTThirdSetOp.java Version 4.3 */ -/* - * JavaCCOptions:MULTI=true,NODE_USES_PARSER=false,VISITOR=false,TRACK_TOKENS=false,NODE_PREFIX=AST,NODE_EXTENDS=, - * NODE_FACTORY=,SUPPORT_CLASS_VISIBILITY_PUBLIC=true - */ -package org.dojo.jsl.parser.ast; - -public class ASTThirdSetOp extends SimpleNode { - public ASTThirdSetOp(int id) { - super(id); - } - - public ASTThirdSetOp(LARAEcmaScript p, int id) { - super(p, id); - } - -} -/* - * JavaCC - OriginalChecksum=69404b05376c45d8012af93aee712405 (do not edit this - * line) - */ diff --git a/LARAC/src/org/dojo/jsl/parser/ast/ASTThisReference.java b/LARAC/src/org/dojo/jsl/parser/ast/ASTThisReference.java deleted file mode 100644 index 3bc36108e..000000000 --- a/LARAC/src/org/dojo/jsl/parser/ast/ASTThisReference.java +++ /dev/null @@ -1,43 +0,0 @@ -/* Generated By:JJTree: Do not edit this line. ASTThisReference.java Version 4.3 */ -/* - * JavaCCOptions:MULTI=true,NODE_USES_PARSER=false,VISITOR=false,TRACK_TOKENS=false,NODE_PREFIX=AST,NODE_EXTENDS=, - * NODE_FACTORY=,SUPPORT_CLASS_VISIBILITY_PUBLIC=true - */ -package org.dojo.jsl.parser.ast; - -import org.w3c.dom.Document; -import org.w3c.dom.Element; - -import larac.objects.Variable; - -public class ASTThisReference extends SimpleNode { - public ASTThisReference(int id) { - super(id); - } - - public ASTThisReference(LARAEcmaScript p, int id) { - super(p, id); - } - - @Override - public Object organize(Object obj) { - return new Variable("this");// getParentById(LARAEcmaScriptTreeConstants.JJTASPECTDEF); - } - - @Override - public void toXML(Document doc, Element parent) { - final Element thisEl = doc.createElement("id"); - thisEl.setAttribute("name", "this"); - parent.appendChild(thisEl); - } - - @Override - public String toSource(int indentation) { - return indent(indentation) + "this"; - } - -} -/* - * JavaCC - OriginalChecksum=e8f88206dc48b417690bf934d8e6788e (do not edit this - * line) - */ diff --git a/LARAC/src/org/dojo/jsl/parser/ast/ASTThrowStatement.java b/LARAC/src/org/dojo/jsl/parser/ast/ASTThrowStatement.java deleted file mode 100644 index 4e1ab5508..000000000 --- a/LARAC/src/org/dojo/jsl/parser/ast/ASTThrowStatement.java +++ /dev/null @@ -1,39 +0,0 @@ -/* Generated By:JJTree: Do not edit this line. ASTThrowStatement.java Version 4.3 */ -/* - * JavaCCOptions:MULTI=true,NODE_USES_PARSER=false,VISITOR=false,TRACK_TOKENS=false,NODE_PREFIX=AST,NODE_EXTENDS=, - * NODE_FACTORY=,SUPPORT_CLASS_VISIBILITY_PUBLIC=true - */ -package org.dojo.jsl.parser.ast; - -import org.w3c.dom.Document; -import org.w3c.dom.Element; - -public class ASTThrowStatement extends SimpleNode { - public ASTThrowStatement(int id) { - super(id); - } - - public ASTThrowStatement(LARAEcmaScript p, int id) { - super(p, id); - } - - @Override - public Object organize(Object obj) { - return ((SimpleNode) children[0]).organize(obj); - } - - @Override - public void toXML(Document doc, Element parent) { - final Element statEl = doc.createElement("statement"); - statEl.setAttribute("name", "throw"); - statEl.setAttribute("coord", getCoords()); - parent.appendChild(statEl); - final Element exprEl = doc.createElement("expression"); - statEl.appendChild(exprEl); - ((SimpleNode) children[0]).toXML(doc, exprEl); - } -} -/* - * JavaCC - OriginalChecksum=d4955a4ea899d87a9870aeeab52a0554 (do not edit this - * line) - */ diff --git a/LARAC/src/org/dojo/jsl/parser/ast/ASTTo.java b/LARAC/src/org/dojo/jsl/parser/ast/ASTTo.java deleted file mode 100644 index 1eb53fb40..000000000 --- a/LARAC/src/org/dojo/jsl/parser/ast/ASTTo.java +++ /dev/null @@ -1,97 +0,0 @@ -/* Generated By:JJTree: Do not edit this line. ASTTo.java Version 4.3 */ -/* - * JavaCCOptions:MULTI=true,NODE_USES_PARSER=false,VISITOR=false,TRACK_TOKENS=false,NODE_PREFIX=AST,NODE_EXTENDS=, - * NODE_FACTORY=,SUPPORT_CLASS_VISIBILITY_PUBLIC=true - */ -package org.dojo.jsl.parser.ast; - -import java.util.ArrayList; - -import org.w3c.dom.Document; -import org.w3c.dom.Element; - -public class ASTTo extends SimpleNode { - ArrayList selects = new ArrayList<>(); - - public ASTTo(int id) { - super(id); - } - - public ASTTo(LARAEcmaScript p, int id) { - super(p, id); - } - - @Override - public Object organize(Object obj) { - final ASTApply apply = ((ASTApply) parent); - final ASTJavaScript js = apply.getBody(); - if (children[0] instanceof ASTJoin) { - final ASTSelect sel = new ASTSelect(LARAEcmaScriptTreeConstants.JJTSELECT); - sel.associateChild(((ASTJoin) children[0]), 0); - sel.organizeJoinInApply(getParentById(LARAEcmaScriptTreeConstants.JJTASPECTDEF)); - ((ASTJoin) children[0]).organize(apply.parent); - selects.add(sel); - - js.organize(apply); - associateChild(((ASTJoin) children[0]), 0); - } else { - final String id = ((ASTIdentifier) getChildren()[0]).value.toString(); - final ASTSelect select = apply.getSelect(id); - if (select == null) { - throw newException("Select '" + id + "' is undefined"); - } - selects.add(select); - js.organize(apply); - } - for (int i = 1; i < getChildren().length; i++) { - - if (children[i] instanceof ASTJoin) { - final ASTSelect sel = new ASTSelect(LARAEcmaScriptTreeConstants.JJTSELECT); - sel.associateChild(((ASTJoin) children[i]), 0); - sel.organizeJoinInApply(getParentById(LARAEcmaScriptTreeConstants.JJTASPECTDEF)); - ((ASTJoin) children[i]).organize(apply.parent); - selects.add(sel); - js.secondOrganize(sel); - associateChild(((ASTJoin) children[i]), i); - } else { - final String id = ((ASTIdentifier) getChildren()[i]).value.toString(); - final ASTSelect select = apply.getSelect(id); - if (select == null) { - throw newException("Select '" + id + "' is undefined"); - } - selects.add(select); - js.secondOrganize(select); - } - } - return null; - } - - public void organizeCondition(ASTApply astApply) { - final ASTApply apply = ((ASTApply) parent); - ((SimpleNode) apply.getCondition().getChildren()[1]).organize(apply); - - } - - public void toXML(Document doc, Element applyEl, int i) { - final SimpleNode child = (SimpleNode) children[i]; - final Element toEl = doc.createElement("expression"); - applyEl.appendChild(toEl); - if (child instanceof ASTIdentifier) { - final Element pcEl = doc.createElement("id"); - pcEl.setAttribute("name", child.value.toString()); - // pcEl.setAttribute("type", "JoinSet"); - toEl.appendChild(pcEl); - } else { - child.toXML(doc, toEl); - } - - } - - public String getLastJoinPointVar(int toPosition) { - return selects.get(toPosition).getLastJPVariable().getName(); - } -} -/* - * JavaCC - OriginalChecksum=7f29d2de88bf3b3dcd7b3887fc9e9770 (do not edit this - * line) - */ diff --git a/LARAC/src/org/dojo/jsl/parser/ast/ASTTryStatement.java b/LARAC/src/org/dojo/jsl/parser/ast/ASTTryStatement.java deleted file mode 100644 index 734c94605..000000000 --- a/LARAC/src/org/dojo/jsl/parser/ast/ASTTryStatement.java +++ /dev/null @@ -1,49 +0,0 @@ -/* Generated By:JJTree: Do not edit this line. ASTTryStatement.java Version 4.3 */ -/* - * JavaCCOptions:MULTI=true,NODE_USES_PARSER=false,VISITOR=false,TRACK_TOKENS=false,NODE_PREFIX=AST,NODE_EXTENDS=, - * NODE_FACTORY=,SUPPORT_CLASS_VISIBILITY_PUBLIC=true - */ -package org.dojo.jsl.parser.ast; - -import org.w3c.dom.Document; -import org.w3c.dom.Element; - -public class ASTTryStatement extends SimpleNode { - public ASTTryStatement(int id) { - super(id); - } - - public ASTTryStatement(LARAEcmaScript p, int id) { - super(p, id); - } - - @Override - public Object organize(Object obj) { - for (final Node child : getChildren()) { - ((SimpleNode) child).organize(obj); - } - return null; - } - - @Override - public void toXML(Document doc, Element parent) { - final Element statEl = doc.createElement("statement"); - if (!label.isEmpty()) { - statEl.setAttribute("label", label); - } - statEl.setAttribute("name", "try"); - statEl.setAttribute("coord", getCoords()); - parent.appendChild(statEl); - final Element tryScope = doc.createElement("code"); - tryScope.setAttribute("desc", "body"); - statEl.appendChild(tryScope); - ((SimpleNode) children[0]).toXML(doc, tryScope); - for (int i = 1; i < children.length; i++) { - ((SimpleNode) children[i]).toXML(doc, statEl); - } - } -} -/* - * JavaCC - OriginalChecksum=45edd72666c6ffd45d42c72f6bc3c2c8 (do not edit this - * line) - */ diff --git a/LARAC/src/org/dojo/jsl/parser/ast/ASTUnaryExpression.java b/LARAC/src/org/dojo/jsl/parser/ast/ASTUnaryExpression.java deleted file mode 100644 index 1a6397abd..000000000 --- a/LARAC/src/org/dojo/jsl/parser/ast/ASTUnaryExpression.java +++ /dev/null @@ -1,59 +0,0 @@ -/* Generated By:JJTree: Do not edit this line. ASTUnaryExpression.java Version 4.3 */ -/* - * JavaCCOptions:MULTI=true,NODE_USES_PARSER=false,VISITOR=false,TRACK_TOKENS=false,NODE_PREFIX=AST,NODE_EXTENDS=, - * NODE_FACTORY=,SUPPORT_CLASS_VISIBILITY_PUBLIC=true - */ -package org.dojo.jsl.parser.ast; - -import org.w3c.dom.Document; -import org.w3c.dom.Element; - -import larac.objects.Enums.Types; - -public class ASTUnaryExpression extends SimpleNode { - public ASTUnaryExpression(int id) { - super(id); - } - - public ASTUnaryExpression(LARAEcmaScript p, int id) { - super(p, id); - } - - @Override - public Object organize(Object obj) { - final SimpleNode unary = (SimpleNode) getChildren()[1]; - unary.organize(this); - final ASTOperator operator = (ASTOperator) getChildren()[0]; - operator.organize(this); - operator.setReturnType(unary.getExpressionType()); - return obj; - } - - @Override - public void toXML(Document doc, Element parent) { - final Element opEl = toXMLCommon(doc, parent); - final SimpleNode unary = getChild(1); - unary.toXML(doc, opEl); - } - - private Element toXMLCommon(Document doc, Element parent) { - final ASTOperator operator = (ASTOperator) getChildren()[0]; - final Element opEl = doc.createElement("op"); - opEl.setAttribute("name", operator.getTag()); - parent.appendChild(opEl); - if (!operator.getReturnType().equals(Types.Undefined)) { - opEl.setAttribute("type", operator.getReturnType().toString()); - } - return opEl; - } - - @Override - public Types getExpressionType() { - - return ((SimpleNode) getChildren()[1]).getExpressionType(); - } -} -/* - * JavaCC - OriginalChecksum=970e1ce05c9ee12da7f7ce34b02241b5 (do not edit this - * line) - */ diff --git a/LARAC/src/org/dojo/jsl/parser/ast/ASTVariableDeclaration.java b/LARAC/src/org/dojo/jsl/parser/ast/ASTVariableDeclaration.java deleted file mode 100644 index 3b75884e3..000000000 --- a/LARAC/src/org/dojo/jsl/parser/ast/ASTVariableDeclaration.java +++ /dev/null @@ -1,164 +0,0 @@ -/* Generated By:JJTree: Do not edit this line. ASTVariableDeclaration.java Version 4.3 */ -/* - * JavaCCOptions:MULTI=true,NODE_USES_PARSER=false,VISITOR=false,TRACK_TOKENS=false,NODE_PREFIX=AST,NODE_EXTENDS=, - * NODE_FACTORY=,SUPPORT_CLASS_VISIBILITY_PUBLIC=true - */ -package org.dojo.jsl.parser.ast; - -import java.util.HashMap; -import java.util.Optional; - -import org.w3c.dom.Document; -import org.w3c.dom.Element; - -import larac.LaraC; -import larac.objects.Variable; -import larac.utils.xml.AspectIRFactory; - -public class ASTVariableDeclaration extends SimpleNode { - - private Optional type; - - public ASTVariableDeclaration(int id) { - super(id); - } - - public ASTVariableDeclaration(LARAEcmaScript p, int id) { - super(p, id); - } - - @Override - public void declareGlobal(LaraC lara) { - - final ASTIdentifier id = (ASTIdentifier) getChildren()[0]; - final String varName = id.value.toString(); - if (getChildren().length > 1) { - SimpleNode init = getChild(1); - if (init instanceof ASTAssignmentExpression) { - throw newException("Chainned variable declaration assignments are not supported."); - } - init.organize(this); - // vars.put(varName, new Variable(varName, (SimpleNode) getChildren()[1])); - } - - lara.aspectIR().addGlobalElement(varName, this); - Optional ancestorOfType = getAncestorOfType(ASTVariableStatement.class); - if (ancestorOfType.isPresent()) { - jjtGetFirstToken().specialToken = ancestorOfType.get().jjtGetFirstToken().specialToken; - } - } - - @Override - public Object organize(Object obj) { - final HashMap vars = ((SimpleNode) obj).getHMVars(); - // final HashMap vars = getHMVars(); - if (!(getChildren()[0] instanceof ASTIdentifier)) { - throw newException("Variable not supported: \"" + ((SimpleNode) getChildren()[0]).toString() + "\"\n"); - } - final ASTIdentifier id = (ASTIdentifier) getChildren()[0]; - final String varName = id.value.toString(); - /* - * if(vars.containsKey(varName)) throw newException("Variable '" - * +varName+"' is already declared"); / - **/if (getChildren().length > 1) { - - SimpleNode init = getChild(1); - if (init instanceof ASTAssignmentExpression) { - throw newException("Chainned variable declaration assignments are not supported."); - } - init.organize(this); - // vars.put(varName, new Variable(varName, (SimpleNode) getChildren()[1])); - } - vars.put(varName, new Variable(varName)); - - return null; - - } - - @Override - public Object organize(Object obj, Object obj2) { - if (!(obj instanceof HashMap)) { - throw newException("Should have been an HashMap on ASTVariableDeclaration!\n"); - } - @SuppressWarnings("unchecked") - final HashMap vars = (HashMap) obj; - @SuppressWarnings("unchecked") - final HashMap otherVars = (HashMap) obj2; - if (getChildren()[0] instanceof ASTIdentifier) { - final String varName = getIdName(); - /* - * if(vars.containsKey(varName)) throw newException("Variable '" - * +varName+"' is already declared"); / - **/ - if (getChildren().length > 1) { - if (otherVars.containsKey(varName)) { - throw newException("Variable \"" + varName - + "\", used in both in Input and Output, can only be initialized on the Input.\n"); - } - - if (getChildren()[1] instanceof ASTAssignmentExpression) { - final ASTAssignmentExpression assignExpr = (ASTAssignmentExpression) getChild(1); - // final SimpleNode expr = - assignExpr.solveInitializeAssignment(vars); - // vars.put(varName, new Variable(varName));// , expr)); - } else { - getChild(1).organize(this); - // else { - } - // vars.put(varName, new Variable(varName));// , (SimpleNode) getChildren()[1])); - // } - } // else { - /* - * if(otherVars.containsKey(varName)) throw newException( - * "Variable '"+varName+"' already declared" - * );//vars.put(varName, otherVars.get(varName)); else/ - **/ - vars.put(varName, new Variable(varName)); - // } - } else - - { - throw newException("Variable not supported: \"" + ((SimpleNode) getChildren()[0]).toString() + "\"\n"); - } - // ASTAspectDef aspectDef = ((ASTAspectDef)obj); - // aspectDef.putInput(this); - return null; - - } - - @Override - public void toXML(Document doc, Element parent) { - final SimpleNode init = jjtGetNumChildren() > 1 ? getChild(1) : null; - AspectIRFactory.varDeclExprToXML(doc, parent, getIdName(), init, type); - //// final Variable var = lookupNoError(id.getName()); - // varDeclToXML(doc, parent, var); // <--replace this invocation! - } - - @Override - public void globalToXML(Document doc, Element parent) { - final Element statementDeclEl = doc.createElement("declaration"); - statementDeclEl.setAttribute("name", "vardecl"); - statementDeclEl.setAttribute("coord", getCoords()); - addXMLComent(statementDeclEl); - parent.appendChild(statementDeclEl); - toXML(doc, statementDeclEl); - - } - - public String getIdName() { - ASTIdentifier id = (ASTIdentifier) jjtGetChild(0); - return id.getName(); - } - - public Optional getType() { - return type; - } - - public void setType(String type) { - this.type = Optional.of(type); - } -} -/* - * JavaCC - OriginalChecksum=f4dddfe6c7daf45cbac10963428e4a90 (do not edit this - * line) - */ diff --git a/LARAC/src/org/dojo/jsl/parser/ast/ASTVariableDeclarationList.java b/LARAC/src/org/dojo/jsl/parser/ast/ASTVariableDeclarationList.java deleted file mode 100644 index 5551d641d..000000000 --- a/LARAC/src/org/dojo/jsl/parser/ast/ASTVariableDeclarationList.java +++ /dev/null @@ -1,68 +0,0 @@ -/* Generated By:JJTree: Do not edit this line. ASTVariableDeclarationList.java Version 4.3 */ -/* - * JavaCCOptions:MULTI=true,NODE_USES_PARSER=false,VISITOR=false,TRACK_TOKENS=false,NODE_PREFIX=AST,NODE_EXTENDS=, - * NODE_FACTORY=,SUPPORT_CLASS_VISIBILITY_PUBLIC=true - */ -package org.dojo.jsl.parser.ast; - -import java.util.ArrayList; - -import org.w3c.dom.Document; -import org.w3c.dom.Element; - -import larac.LaraC; - -public class ASTVariableDeclarationList extends SimpleNode { - public ASTVariableDeclarationList(int id) { - super(id); - } - - public ASTVariableDeclarationList(LARAEcmaScript p, int id) { - super(p, id); - } - - @Override - public void declareGlobal(LaraC lara) { - getSimpleNodeChildren().forEach(n -> n.declareGlobal(lara)); - } - - @Override - public Object organize(Object obj) { - - final ArrayList variablesDeclaration = new ArrayList<>(); - if (getChildren() != null) { - for (final Node n : getChildren()) { - variablesDeclaration.add((ASTVariableDeclaration) n); - ((SimpleNode) n).organize(obj); - } - } - return variablesDeclaration; - } - - @Override - public Object organize(Object obj, Object obj2) { - if (getChildren() == null) { - return null; - } - - final ArrayList variablesDeclaration = new ArrayList<>(); - for (final Node n : getChildren()) { - variablesDeclaration.add((ASTVariableDeclaration) n); - ((SimpleNode) n).organize(obj, obj2); - } - return variablesDeclaration; - } - - @Override - public void toXML(Document doc, Element parent) { - - for (final Node n : getChildren()) { - ((SimpleNode) n).toXML(doc, parent); - } - - } -} -/* - * JavaCC - OriginalChecksum=6a776e0bca1e74c8919a4767da17888c (do not edit this - * line) - */ diff --git a/LARAC/src/org/dojo/jsl/parser/ast/ASTVariableStatement.java b/LARAC/src/org/dojo/jsl/parser/ast/ASTVariableStatement.java deleted file mode 100644 index 3ae3c586a..000000000 --- a/LARAC/src/org/dojo/jsl/parser/ast/ASTVariableStatement.java +++ /dev/null @@ -1,65 +0,0 @@ -/* Generated By:JJTree: Do not edit this line. ASTVariableStatement.java Version 4.3 */ -/* - * JavaCCOptions:MULTI=true,NODE_USES_PARSER=false,VISITOR=false,TRACK_TOKENS=false,NODE_PREFIX=AST,NODE_EXTENDS=, - * NODE_FACTORY=,SUPPORT_CLASS_VISIBILITY_PUBLIC=true - */ -package org.dojo.jsl.parser.ast; - -import org.w3c.dom.Document; -import org.w3c.dom.Element; - -import larac.LaraC; - -public class ASTVariableStatement extends SimpleNode { - public ASTVariableStatement(int id) { - super(id); - } - - public ASTVariableStatement(LARAEcmaScript p, int id) { - super(p, id); - } - - @Override - public Object organize(Object obj, Object obj2) { - for (final Node child : getChildren()) { - ((SimpleNode) child).organize(obj, obj2); - } - return null; - } - - @Override - public void declareGlobal(LaraC lara) { - getSimpleNodeChildren().forEach(n -> n.declareGlobal(lara)); - } - - @Override - public Object organize(Object obj) { - for (final Node child : getChildren()) { - ((SimpleNode) child).organize(this); - } - return null; - } - - @Override - public void toXML(Document doc, Element parent) { - - final Element statementDeclEl = doc.createElement("statement"); - statementDeclEl.setAttribute("name", "vardecl"); - statementDeclEl.setAttribute("coord", getCoords()); - addXMLComent(statementDeclEl); - if (!label.isEmpty()) { - statementDeclEl.setAttribute("label", label); - } - - for (final Node child : getChildren()) { - ((SimpleNode) child).toXML(doc, statementDeclEl); - } - if (statementDeclEl.hasChildNodes()) { - parent.appendChild(statementDeclEl); - } - } -} -/* - * JavaCC - OriginalChecksum=c2a03cbc033a9517e3ea8ffd52530488 (do not edit this - * line) - */ diff --git a/LARAC/src/org/dojo/jsl/parser/ast/ASTWhileStatement.java b/LARAC/src/org/dojo/jsl/parser/ast/ASTWhileStatement.java deleted file mode 100644 index aa8f07ba8..000000000 --- a/LARAC/src/org/dojo/jsl/parser/ast/ASTWhileStatement.java +++ /dev/null @@ -1,56 +0,0 @@ -/* Generated By:JJTree: Do not edit this line. ASTWhileStatement.java Version 4.3 */ -/* - * JavaCCOptions:MULTI=true,NODE_USES_PARSER=false,VISITOR=false,TRACK_TOKENS=false,NODE_PREFIX=AST,NODE_EXTENDS=, - * NODE_FACTORY=,SUPPORT_CLASS_VISIBILITY_PUBLIC=true - */ -package org.dojo.jsl.parser.ast; - -import org.w3c.dom.Document; -import org.w3c.dom.Element; - -import larac.objects.Enums; - -public class ASTWhileStatement extends SimpleNode { - public ASTWhileStatement(int id) { - super(id); - } - - public ASTWhileStatement(LARAEcmaScript p, int id) { - super(p, id); - } - - @Override - public Object organize(Object obj) { - for (int i = 0; i < children.length; i++) { - ((SimpleNode) children[i]).organize(obj); - } - return null; - } - - @Override - public void toXML(Document doc, Element parent) { - final Element stmtEl = doc.createElement("statement"); - stmtEl.setAttribute("name", "loop"); - stmtEl.setAttribute("desc", Enums.LoopTypes.WHILE.toString()); - stmtEl.setAttribute("coord", getCoords()); - if (!label.isEmpty()) { - stmtEl.setAttribute("label", label); - } - parent.appendChild(stmtEl); - - final Element conditionEl = doc.createElement("expression"); - conditionEl.setAttribute("desc", "condition"); - stmtEl.appendChild(conditionEl); - ((SimpleNode) children[0]).toXML(doc, conditionEl); - - final Element codeEl = doc.createElement("code"); - codeEl.setAttribute("desc", "body"); - stmtEl.appendChild(codeEl); - ((SimpleNode) children[1]).toXML(doc, codeEl); - } - -} -/* - * JavaCC - OriginalChecksum=0d01611f7eb519190d61f4c36d5dc3da (do not edit this - * line) - */ diff --git a/LARAC/src/org/dojo/jsl/parser/ast/ASTWithStatement.java b/LARAC/src/org/dojo/jsl/parser/ast/ASTWithStatement.java deleted file mode 100644 index 36fbc5203..000000000 --- a/LARAC/src/org/dojo/jsl/parser/ast/ASTWithStatement.java +++ /dev/null @@ -1,66 +0,0 @@ -/* Generated By:JJTree: Do not edit this line. ASTWithStatement.java Version 4.3 */ -/* - * JavaCCOptions:MULTI=true,NODE_USES_PARSER=false,VISITOR=false,TRACK_TOKENS=false,NODE_PREFIX=AST,NODE_EXTENDS=, - * NODE_FACTORY=,SUPPORT_CLASS_VISIBILITY_PUBLIC=true - */ -package org.dojo.jsl.parser.ast; - -import org.w3c.dom.Document; -import org.w3c.dom.Element; - -import larac.objects.Variable; - -public class ASTWithStatement extends SimpleNode { - public ASTWithStatement(int id) { - super(id); - } - - public ASTWithStatement(LARAEcmaScript p, int id) { - super(p, id); - } - - @Override - public Object organize(Object obj) { - for (final Node child : getChildren()) { - ((SimpleNode) child).organize(obj); - } - return null; - } - - @Override - public void toXML(Document doc, Element parent) { - final Element statEl = doc.createElement("statement"); - statEl.setAttribute("name", "with"); - statEl.setAttribute("coord", getCoords()); - if (!label.isEmpty()) { - statEl.setAttribute("label", label); - } - parent.appendChild(statEl); - - final Element exprEl = doc.createElement("expression"); - statEl.appendChild(exprEl); - ((SimpleNode) children[0]).toXML(doc, exprEl); - final Element codeEl = doc.createElement("code"); - statEl.appendChild(codeEl); - ((SimpleNode) children[1]).toXML(doc, codeEl); - } - - @Override - public Variable lookup(String var) { - return new Variable(var); - } - - @Override - public Variable lookupNoError(String var) { - - Variable retVar = super.lookupNoError(var); - if (retVar == null) { - retVar = new Variable(var); - } - return retVar; - } -} -/* - * JavaCC - OriginalChecksum=78f16403bd7e266f0ec510844f91e919 (do not edit this - * line) - */ diff --git a/LARAC/src/org/dojo/jsl/parser/ast/ASTYieldStar.java b/LARAC/src/org/dojo/jsl/parser/ast/ASTYieldStar.java deleted file mode 100644 index 3b7dd86a3..000000000 --- a/LARAC/src/org/dojo/jsl/parser/ast/ASTYieldStar.java +++ /dev/null @@ -1,16 +0,0 @@ -/* Generated By:JJTree: Do not edit this line. ASTYieldStar.java Version 7.0 */ -/* JavaCCOptions:MULTI=true,NODE_USES_PARSER=false,VISITOR=false,TRACK_TOKENS=true,NODE_PREFIX=AST,NODE_EXTENDS=,NODE_FACTORY=,SUPPORT_CLASS_VISIBILITY_PUBLIC=true */ -package org.dojo.jsl.parser.ast; - -public -class ASTYieldStar extends SimpleNode { - public ASTYieldStar(int id) { - super(id); - } - - public ASTYieldStar(LARAEcmaScript p, int id) { - super(p, id); - } - -} -/* JavaCC - OriginalChecksum=323cf70695742d00aedb5b915073d67e (do not edit this line) */ diff --git a/LARAC/src/org/dojo/jsl/parser/ast/ASTYieldStatement.java b/LARAC/src/org/dojo/jsl/parser/ast/ASTYieldStatement.java deleted file mode 100644 index c943e0559..000000000 --- a/LARAC/src/org/dojo/jsl/parser/ast/ASTYieldStatement.java +++ /dev/null @@ -1,65 +0,0 @@ -/* Generated By:JJTree: Do not edit this line. ASTYieldStatement.java Version 4.3 */ -/* - * JavaCCOptions:MULTI=true,NODE_USES_PARSER=false,VISITOR=false,TRACK_TOKENS=true,NODE_PREFIX=AST,NODE_EXTENDS=, - * NODE_FACTORY=,SUPPORT_CLASS_VISIBILITY_PUBLIC=true - */ -package org.dojo.jsl.parser.ast; - -import org.w3c.dom.Document; -import org.w3c.dom.Element; - -public class ASTYieldStatement extends SimpleNode { - - private boolean hasStar = false; - - public ASTYieldStatement(int id) { - super(id); - } - - public ASTYieldStatement(LARAEcmaScript p, int id) { - super(p, id); - } - - @Override - public Object organize(Object obj) { - var expression = ((SimpleNode) children[0]); - if (expression instanceof ASTYieldStar) { - this.hasStar = true; - expression = ((SimpleNode) children[1]); - } - - // ((SimpleNode) children[0]).organize(obj); - expression.organize(obj); - return obj; - } - - @Override - public void toXML(Document doc, Element parent) { - // Element returnEl = doc.createElement("return"); - // final SimpleNode funDecl = getParentById(LARAEcmaScriptTreeConstants.JJTFUNCTIONDECLARATION); - // final SimpleNode funExpr = getParentById(LARAEcmaScriptTreeConstants.JJTFUNCTIONEXPRESSION); - final Element returnEl = doc.createElement("statement"); - var name = hasStar ? "yield_star" : "yield"; - returnEl.setAttribute("name", name); - /* - if (funDecl == null && funExpr == null) { // IF both are null, mean that - // the yield is somewhere - // inside the - // aspect - returnEl.setAttribute("name", "exit"); - } else { - returnEl.setAttribute("name", "yield"); - } - */ - returnEl.setAttribute("coord", getCoords()); - parent.appendChild(returnEl); - final Element exprEl = doc.createElement("expression"); - returnEl.appendChild(exprEl); - - int childIndex = ((SimpleNode) children[0]) instanceof ASTYieldStar ? 1 : 0; - - ((SimpleNode) children[childIndex]).toXML(doc, exprEl); - // ((SimpleNode) children[0]).toXML(doc, exprEl); - } -} -/* JavaCC - OriginalChecksum=b744cd05342470d303d814d1b3486714 (do not edit this line) */ diff --git a/LARAC/src/org/dojo/jsl/parser/ast/JJTLARAEcmaScriptState.java b/LARAC/src/org/dojo/jsl/parser/ast/JJTLARAEcmaScriptState.java deleted file mode 100644 index 94950a62b..000000000 --- a/LARAC/src/org/dojo/jsl/parser/ast/JJTLARAEcmaScriptState.java +++ /dev/null @@ -1,123 +0,0 @@ -/* Generated By:JavaCC: Do not edit this line. JJTLARAEcmaScriptState.java Version 7.0.12 */ -package org.dojo.jsl.parser.ast; - -public class JJTLARAEcmaScriptState { - private java.util.List nodes; - private java.util.List marks; - - private int sp; // number of nodes on stack - private int mk; // current mark - private boolean node_created; - - public JJTLARAEcmaScriptState() { - nodes = new java.util.ArrayList(); - marks = new java.util.ArrayList(); - sp = 0; - mk = 0; - } - - /* Determines whether the current node was actually closed and - pushed. This should only be called in the final user action of a - node scope. */ - public boolean nodeCreated() { - return node_created; - } - - /* Call this to reinitialize the node stack. It is called - automatically by the parser's ReInit() method. */ - public void reset() { - nodes.clear(); - marks.clear(); - sp = 0; - mk = 0; - } - - /* Returns the root node of the AST. It only makes sense to call - this after a successful parse. */ - public Node rootNode() { - return nodes.get(0); - } - - /* Pushes a node on to the stack. */ - public void pushNode(Node n) { - nodes.add(n); - ++sp; - } - - /* Returns the node on the top of the stack, and remove it from the - stack. */ - public Node popNode() { - if (--sp < mk) { - mk = marks.remove(marks.size()-1); - } - return nodes.remove(nodes.size()-1); - } - - /* Returns the node currently on the top of the stack. */ - public Node peekNode() { - return nodes.get(nodes.size()-1); - } - - /* Returns the number of children on the stack in the current node - scope. */ - public int nodeArity() { - return sp - mk; - } - - - public void clearNodeScope(Node n) { - while (sp > mk) { - popNode(); - } - mk = marks.remove(marks.size()-1); - } - - - public void openNodeScope(Node n) { - marks.add(mk); - mk = sp; - n.jjtOpen(); - } - - - /* A definite node is constructed from a specified number of - children. That number of nodes are popped from the stack and - made the children of the definite node. Then the definite node - is pushed on to the stack. */ - public void closeNodeScope(Node n, int num) { - mk = marks.remove(marks.size()-1); - while (num-- > 0) { - Node c = popNode(); - c.jjtSetParent(n); - n.jjtAddChild(c, num); - } - n.jjtClose(); - pushNode(n); - node_created = true; - } - - - /* A conditional node is constructed if its condition is true. All - the nodes that have been pushed since the node was opened are - made children of the conditional node, which is then pushed - on to the stack. If the condition is false the node is not - constructed and they are left on the stack. */ - public void closeNodeScope(Node n, boolean condition) { - if (condition) { - int a = nodeArity(); - mk = marks.remove(marks.size()-1); - while (a-- > 0) { - Node c = popNode(); - c.jjtSetParent(n); - n.jjtAddChild(c, a); - } - n.jjtClose(); - pushNode(n); - node_created = true; - } else { - mk = marks.remove(marks.size()-1); - node_created = false; - } - } -} -/* JavaCC - OriginalChecksum=a1a1e094ffa39c58ec77fb52f6bd1a01 (do not edit this line) */ diff --git a/LARAC/src/org/dojo/jsl/parser/ast/JavaCharStream.java b/LARAC/src/org/dojo/jsl/parser/ast/JavaCharStream.java deleted file mode 100644 index 679161c07..000000000 --- a/LARAC/src/org/dojo/jsl/parser/ast/JavaCharStream.java +++ /dev/null @@ -1,692 +0,0 @@ -/* Generated By:JavaCC: Do not edit this line. JavaCharStream.java Version 7.0 */ -/* JavaCCOptions:STATIC=false,SUPPORT_CLASS_VISIBILITY_PUBLIC=true */ -package org.dojo.jsl.parser.ast; - -/** - * An implementation of interface CharStream, where the stream is assumed to - * contain only ASCII characters (with java-like unicode escape processing). - */ - -public -class JavaCharStream -{ - /** Whether parser is static. */ - public static final boolean staticFlag = false; - - static final int hexval(char c) throws java.io.IOException { - switch(c) - { - case '0' : - return 0; - case '1' : - return 1; - case '2' : - return 2; - case '3' : - return 3; - case '4' : - return 4; - case '5' : - return 5; - case '6' : - return 6; - case '7' : - return 7; - case '8' : - return 8; - case '9' : - return 9; - - case 'a' : - case 'A' : - return 10; - case 'b' : - case 'B' : - return 11; - case 'c' : - case 'C' : - return 12; - case 'd' : - case 'D' : - return 13; - case 'e' : - case 'E' : - return 14; - case 'f' : - case 'F' : - return 15; - } - - throw new java.io.IOException(); // Should never come here - } - -/* Position in buffer. */ - public int bufpos = -1; - int bufsize; - int available; - int tokenBegin; - protected int bufline[]; - protected int bufcolumn[]; - - protected int column = 0; - protected int line = 1; - - protected boolean prevCharIsCR = false; - protected boolean prevCharIsLF = false; - - protected java.io.Reader inputStream; - - protected char[] nextCharBuf; - protected char[] buffer; - protected int maxNextCharInd = 0; - protected int nextCharInd = -1; - protected int inBuf = 0; - protected int tabSize = 1; - protected boolean trackLineColumn = true; - - public void setTabSize(int i) { tabSize = i; } - public int getTabSize() { return tabSize; } - - protected void ExpandBuff(boolean wrapAround) - { - char[] newbuffer = new char[bufsize + 2048]; - int newbufline[] = new int[bufsize + 2048]; - int newbufcolumn[] = new int[bufsize + 2048]; - - try - { - if (wrapAround) - { - System.arraycopy(buffer, tokenBegin, newbuffer, 0, bufsize - tokenBegin); - System.arraycopy(buffer, 0, newbuffer, bufsize - tokenBegin, bufpos); - buffer = newbuffer; - - System.arraycopy(bufline, tokenBegin, newbufline, 0, bufsize - tokenBegin); - System.arraycopy(bufline, 0, newbufline, bufsize - tokenBegin, bufpos); - bufline = newbufline; - - System.arraycopy(bufcolumn, tokenBegin, newbufcolumn, 0, bufsize - tokenBegin); - System.arraycopy(bufcolumn, 0, newbufcolumn, bufsize - tokenBegin, bufpos); - bufcolumn = newbufcolumn; - - bufpos += (bufsize - tokenBegin); - } - else - { - System.arraycopy(buffer, tokenBegin, newbuffer, 0, bufsize - tokenBegin); - buffer = newbuffer; - - System.arraycopy(bufline, tokenBegin, newbufline, 0, bufsize - tokenBegin); - bufline = newbufline; - - System.arraycopy(bufcolumn, tokenBegin, newbufcolumn, 0, bufsize - tokenBegin); - bufcolumn = newbufcolumn; - - bufpos -= tokenBegin; - } - } - catch (Throwable t) - { - throw new Error(t.getMessage()); - } - - available = (bufsize += 2048); - tokenBegin = 0; - } - - protected void FillBuff() throws java.io.IOException - { - int i; - if (maxNextCharInd == 4096) - maxNextCharInd = nextCharInd = 0; - - try { - if ((i = inputStream.read(nextCharBuf, maxNextCharInd, - 4096 - maxNextCharInd)) == -1) - { - inputStream.close(); - throw new java.io.IOException(); - } - else - maxNextCharInd += i; - return; - } - catch(java.io.IOException e) { - if (bufpos != 0) - { - --bufpos; - backup(0); - } - else - { - bufline[bufpos] = line; - bufcolumn[bufpos] = column; - } - throw e; - } - } - - protected char ReadByte() throws java.io.IOException - { - if (++nextCharInd >= maxNextCharInd) - FillBuff(); - - return nextCharBuf[nextCharInd]; - } - -/* @return starting character for token. */ - public char BeginToken() throws java.io.IOException - { - if (inBuf > 0) - { - --inBuf; - - if (++bufpos == bufsize) - bufpos = 0; - - tokenBegin = bufpos; - return buffer[bufpos]; - } - - tokenBegin = 0; - bufpos = -1; - - return readChar(); - } - - protected void AdjustBuffSize() - { - if (available == bufsize) - { - if (tokenBegin > 2048) - { - bufpos = 0; - available = tokenBegin; - } - else - ExpandBuff(false); - } - else if (available > tokenBegin) - available = bufsize; - else if ((tokenBegin - available) < 2048) - ExpandBuff(true); - else - available = tokenBegin; - } - - protected void UpdateLineColumn(char c) - { - column++; - - if (prevCharIsLF) - { - prevCharIsLF = false; - line += (column = 1); - } - else if (prevCharIsCR) - { - prevCharIsCR = false; - if (c == '\n') - { - prevCharIsLF = true; - } - else - line += (column = 1); - } - - switch (c) - { - case '\r' : - prevCharIsCR = true; - break; - case '\n' : - prevCharIsLF = true; - break; - case '\t' : - column--; - column += (tabSize - (column % tabSize)); - break; - default : - break; - } - - bufline[bufpos] = line; - bufcolumn[bufpos] = column; - } - -/* Read a character. */ - public char readChar() throws java.io.IOException - { - if (inBuf > 0) - { - --inBuf; - - if (++bufpos == bufsize) - bufpos = 0; - - return buffer[bufpos]; - } - - char c; - - if (++bufpos == available) - AdjustBuffSize(); - - if ((buffer[bufpos] = c = ReadByte()) == '\\') - { - if (trackLineColumn) { UpdateLineColumn(c); } - - int backSlashCnt = 1; - - for (;;) // Read all the backslashes - { - if (++bufpos == available) - AdjustBuffSize(); - - try - { - if ((buffer[bufpos] = c = ReadByte()) != '\\') - { - if (trackLineColumn) { UpdateLineColumn(c); } - // found a non-backslash char. - if ((c == 'u') && ((backSlashCnt & 1) == 1)) - { - if (--bufpos < 0) - bufpos = bufsize - 1; - - break; - } - - backup(backSlashCnt); - return '\\'; - } - } - catch(java.io.IOException e) - { - // We are returning one backslash so we should only backup (count-1) - if (backSlashCnt > 1) - backup(backSlashCnt-1); - - return '\\'; - } - - if (trackLineColumn) { UpdateLineColumn(c); } - backSlashCnt++; - } - - // Here, we have seen an odd number of backslash's followed by a 'u' - try - { - while ((c = ReadByte()) == 'u') - ++column; - - buffer[bufpos] = c = (char)(hexval(c) << 12 | - hexval(ReadByte()) << 8 | - hexval(ReadByte()) << 4 | - hexval(ReadByte())); - - column += 4; - } - catch(java.io.IOException e) - { - throw new Error("Invalid escape character at line " + line + - " column " + column + "."); - } - - if (backSlashCnt == 1) - return c; - else - { - backup(backSlashCnt - 1); - return '\\'; - } - } - else - { - UpdateLineColumn(c); - return c; - } - } - - /* - * @deprecated - * @see #getEndColumn - */ - @Deprecated - public int getColumn() { - return bufcolumn[bufpos]; - } - - /* - * @deprecated - * @see #getEndLine - * @return the line number. - */ - @Deprecated - public int getLine() { - return bufline[bufpos]; - } - -/** Get end column. - * @return the end column or -1 - */ - public int getEndColumn() { - return bufcolumn[bufpos]; - } - -/** Get end line. - * @return the end line number or -1 - */ - public int getEndLine() { - return bufline[bufpos]; - } - -/** Get the beginning column. - * @return column of token start */ - public int getBeginColumn() { - return bufcolumn[tokenBegin]; - } - -/** @return line number of token start */ - public int getBeginLine() { - return bufline[tokenBegin]; - } - -/** Retreat. */ - public void backup(int amount) { - - inBuf += amount; - if ((bufpos -= amount) < 0) - bufpos += bufsize; - } - -/** Constructor. - * @param dstream the underlying data source. - * @param startline line number of the first character of the stream, mostly for error messages. - * @param startcolumn column number of the first character of the stream. - * @param buffersize size of the buffer - */ - public JavaCharStream(java.io.Reader dstream, - int startline, int startcolumn, int buffersize) - { - inputStream = dstream; - line = startline; - column = startcolumn - 1; - - available = bufsize = buffersize; - buffer = new char[buffersize]; - bufline = new int[buffersize]; - bufcolumn = new int[buffersize]; - nextCharBuf = new char[4096]; - } - -/** Constructor. - * @param dstream the underlying data source. - * @param startline line number of the first character of the stream, mostly for error messages. - * @param startcolumn column number of the first character of the stream. - */ - public JavaCharStream(java.io.Reader dstream, - int startline, int startcolumn) - { - this(dstream, startline, startcolumn, 4096); - } - -/** Constructor. - * @param dstream the underlying data source. - * @param startline line number of the first character of the stream, mostly for error messages. - */ - public JavaCharStream(java.io.Reader dstream) - { - this(dstream, 1, 1, 4096); - } -/* Reinitialise. */ - public void ReInit(java.io.Reader dstream, - int startline, int startcolumn, int buffersize) - { - inputStream = dstream; - line = startline; - column = startcolumn - 1; - - if (buffer == null || buffersize != buffer.length) - { - available = bufsize = buffersize; - buffer = new char[buffersize]; - bufline = new int[buffersize]; - bufcolumn = new int[buffersize]; - nextCharBuf = new char[4096]; - } - prevCharIsLF = prevCharIsCR = false; - tokenBegin = inBuf = maxNextCharInd = 0; - nextCharInd = bufpos = -1; - } - -/* Reinitialise. */ - public void ReInit(java.io.Reader dstream, - int startline, int startcolumn) - { - ReInit(dstream, startline, startcolumn, 4096); - } - -/* Reinitialise. */ - public void ReInit(java.io.Reader dstream) - { - ReInit(dstream, 1, 1, 4096); - } -/** Constructor. */ - public JavaCharStream(java.io.InputStream dstream, String encoding, int startline, - int startcolumn, int buffersize) throws java.io.UnsupportedEncodingException - { - this(encoding == null ? new java.io.InputStreamReader(dstream) : new java.io.InputStreamReader(dstream, encoding), startline, startcolumn, buffersize); - } - -/** Constructor. - * @param dstream the underlying data source. - * @param startline line number of the first character of the stream, mostly for error messages. - * @param startcolumn column number of the first character of the stream. - * @param buffersize size of the buffer - */ - public JavaCharStream(java.io.InputStream dstream, int startline, - int startcolumn, int buffersize) - { - this(new java.io.InputStreamReader(dstream), startline, startcolumn, buffersize); - } - -/** Constructor. - * @param dstream the underlying data source. - * @param encoding the character encoding of the data stream. - * @param startline line number of the first character of the stream, mostly for error messages. - * @param startcolumn column number of the first character of the stream. - * @throws UnsupportedEncodingException encoding is invalid or unsupported. - */ - public JavaCharStream(java.io.InputStream dstream, String encoding, int startline, - int startcolumn) throws java.io.UnsupportedEncodingException - { - this(dstream, encoding, startline, startcolumn, 4096); - } - -/** Constructor. - * @param dstream the underlying data source. - * @param startline line number of the first character of the stream, mostly for error messages. - * @param startcolumn column number of the first character of the stream. - */ - public JavaCharStream(java.io.InputStream dstream, int startline, - int startcolumn) - { - this(dstream, startline, startcolumn, 4096); - } - -/** Constructor. - * @param dstream the underlying data source. - * @param encoding the character encoding of the data stream. - * @throws UnsupportedEncodingException encoding is invalid or unsupported. - */ - public JavaCharStream(java.io.InputStream dstream, String encoding) throws java.io.UnsupportedEncodingException - { - this(dstream, encoding, 1, 1, 4096); - } - - /** Constructor. - * @param dstream the underlying data source. - */ - public JavaCharStream(java.io.InputStream dstream) - { - this(dstream, 1, 1, 4096); - } - -/** Reinitialise. - * @param dstream the underlying data source. - * @param encoding the character encoding of the data stream. - * @param startline line number of the first character of the stream, mostly for error messages. - * @param startcolumn column number of the first character of the stream. - * @param buffersize size of the buffer - */ - public void ReInit(java.io.InputStream dstream, String encoding, int startline, - int startcolumn, int buffersize) throws java.io.UnsupportedEncodingException - { - ReInit(encoding == null ? new java.io.InputStreamReader(dstream) : new java.io.InputStreamReader(dstream, encoding), startline, startcolumn, buffersize); - } - -/** Reinitialise. - * @param dstream the underlying data source. - * @param startline line number of the first character of the stream, mostly for error messages. - * @param startcolumn column number of the first character of the stream. - * @param buffersize size of the buffer - */ - public void ReInit(java.io.InputStream dstream, int startline, - int startcolumn, int buffersize) - { - ReInit(new java.io.InputStreamReader(dstream), startline, startcolumn, buffersize); - } -/** Reinitialise. - * @param dstream the underlying data source. - * @param encoding the character encoding of the data stream. - * @param startline line number of the first character of the stream, mostly for error messages. - * @param startcolumn column number of the first character of the stream. - * @throws UnsupportedEncodingException encoding is invalid or unsupported. - */ - public void ReInit(java.io.InputStream dstream, String encoding, int startline, - int startcolumn) throws java.io.UnsupportedEncodingException - { - ReInit(dstream, encoding, startline, startcolumn, 4096); - } -/** Reinitialise. - * @param dstream the underlying data source. - * @param startline line number of the first character of the stream, mostly for error messages. - * @param startcolumn column number of the first character of the stream. - */ - public void ReInit(java.io.InputStream dstream, int startline, - int startcolumn) - { - ReInit(dstream, startline, startcolumn, 4096); - } -/** Reinitialise. - * @param dstream the underlying data source. - * @param encoding the character encoding of the data stream. - * @throws UnsupportedEncodingException encoding is invalid or unsupported. - */ - public void ReInit(java.io.InputStream dstream, String encoding) throws java.io.UnsupportedEncodingException - { - ReInit(dstream, encoding, 1, 1, 4096); - } - -/** Reinitialise. - * @param dstream the underlying data source. - */ - public void ReInit(java.io.InputStream dstream) - { - ReInit(dstream, 1, 1, 4096); - } - - /** Get the token timage. - * @return token image as String */ - public String GetImage() - { - if (bufpos >= tokenBegin) - return new String(buffer, tokenBegin, bufpos - tokenBegin + 1); - else - return new String(buffer, tokenBegin, bufsize - tokenBegin) + - new String(buffer, 0, bufpos + 1); - } - - /** Get the suffix as an array of characters. - * @param len the length of the array to return. - * @return suffix */ - public char[] GetSuffix(int len) - { - char[] ret = new char[len]; - - if ((bufpos + 1) >= len) - System.arraycopy(buffer, bufpos - len + 1, ret, 0, len); - else - { - System.arraycopy(buffer, bufsize - (len - bufpos - 1), ret, 0, - len - bufpos - 1); - System.arraycopy(buffer, 0, ret, len - bufpos - 1, bufpos + 1); - } - - return ret; - } - - /** Set buffers back to null when finished. */ - public void Done() - { - nextCharBuf = null; - buffer = null; - bufline = null; - bufcolumn = null; - } - - /** - * Method to adjust line and column numbers for the start of a token. - * - * @param newLine the new line number. - * @param newCol the new column number. - */ - public void adjustBeginLineColumn(int newLine, int newCol) - { - int start = tokenBegin; - int len; - - if (bufpos >= tokenBegin) - { - len = bufpos - tokenBegin + inBuf + 1; - } - else - { - len = bufsize - tokenBegin + bufpos + 1 + inBuf; - } - - int i = 0, j = 0, k = 0; - int nextColDiff = 0, columnDiff = 0; - - while (i < len && bufline[j = start % bufsize] == bufline[k = ++start % bufsize]) - { - bufline[j] = newLine; - nextColDiff = columnDiff + bufcolumn[k] - bufcolumn[j]; - bufcolumn[j] = newCol + columnDiff; - columnDiff = nextColDiff; - i++; - } - - if (i < len) - { - bufline[j] = newLine++; - bufcolumn[j] = newCol + columnDiff; - - while (i++ < len) - { - if (bufline[j = start % bufsize] != bufline[++start % bufsize]) - bufline[j] = newLine++; - else - bufline[j] = newLine; - } - } - - line = bufline[j]; - column = bufcolumn[j]; - } - boolean getTrackLineColumn() { return trackLineColumn; } - void setTrackLineColumn(boolean tlc) { trackLineColumn = tlc; } - -} -/* JavaCC - OriginalChecksum=7fd6038e4bf0504b4ac40a1960385be2 (do not edit this line) */ diff --git a/LARAC/src/org/dojo/jsl/parser/ast/LARAEcmaScript.html b/LARAC/src/org/dojo/jsl/parser/ast/LARAEcmaScript.html deleted file mode 100644 index 1c2e7e392..000000000 --- a/LARAC/src/org/dojo/jsl/parser/ast/LARAEcmaScript.html +++ /dev/null @@ -1,2007 +0,0 @@ - - - -BNF for LARAEcmaScript.jj - - -

BNF for LARAEcmaScript.jj

-

TOKENS

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
-/*****************************************
- * LEXICAL & REGEXP GRAMMARS STARTS HERE *
- *****************************************/
-
-
-/* Section 7 : Lexical Conventions */
-
-/* Section 7.2 : White Space */
-
-
-<DEFAULT,IN_REGEX> SPECIAL : {
-<WHITE_SPACE: <TAB> | <VT> | <FF> | <SP> | <NBSP>>
-| <#TAB: "\t" | "\t">
-| <#VT: "\u000b">
-| <#FF: "\f" | "\f">
-| <#SP: " " | " ">
-| <#NBSP: "\u00a0">
-| <#USP: ["\u2000"] | ["\u2001"] | ["\u2002"] | ["\u2003"] | ["\u2004"] | ["\u2005"] | ["\u2006"] | ["\u2007"] | ["\u2008"] | ["\u2009"] | ["\u200a"] | ["\u200b"] | ["\u3000"]>
-}
-
-   
-
-
-/* Section 7.3 : Line Terminators */
-
-
-<DEFAULT,IN_REGEX> SPECIAL : {
-<LINE_TERMINATOR: <LF> | <CR> | <LS> | <PS>>
-| <#LF: "\n">
-| <#CR: "\r">
-| <#LS: "\u2028">
-| <#PS: "\u2029">
-}
-
-   
-
-
-/* Comments */
-
-
-<DEFAULT,IN_REGEX> MORE : {
-"//" : IN_SINGLE_LINE_COMMENT
-| "/*" : IN_MULTI_LINE_COMMENT
-}
-
-   
-
-
-<IN_SINGLE_LINE_COMMENT> SPECIAL : {
-<SINGLE_LINE_COMMENT: (~["\n","\r"])* ("\n" | "\r" | "\r\n")?> : DEFAULT
-}
-
-   
-
-
-<IN_MULTI_LINE_COMMENT> SPECIAL : {
-<MULTI_LINE_COMMENT: "*/"> : DEFAULT
-}
-
-   
-
-
-<IN_SINGLE_LINE_COMMENT,IN_MULTI_LINE_COMMENT,IN_PATTERN> MORE : {
-<~[]>
-}
-
-   
-
-
-/* Section 7.5.1: Reserved Words */
-
-
-<DEFAULT,IN_REGEX> TOKEN : {
-<INCLUDE: "include"> : DEFAULT
-| <ASPECTDEF: "aspectdef"> : DEFAULT
-| <CODEDEF: "codedef"> : DEFAULT
-| <INPUT: "input"> : DEFAULT
-| <OUTPUT: "output"> : DEFAULT
-| <STATICDECL: "static"> : DEFAULT
-| <SELECT: "select"> : DEFAULT
-| <APPLY: "apply"> : DEFAULT
-| <TO: "to"> : DEFAULT
-| <CALL: "call"> : DEFAULT
-| <RUN: "run"> : DEFAULT
-| <CMD: "cmd"> : DEFAULT
-| <CONDITION: "condition"> : DEFAULT
-| <BEGIN: "begin"> : DEFAULT
-| <INSERT: "insert"> : DEFAULT
-| <EXEC: "exec"> : DEFAULT
-| <OUTPUT_ACT: "out"> : DEFAULT
-| <BEFORE: "before"> : DEFAULT
-| <AFTER: "after"> : DEFAULT
-| <AROUND: "around"> : DEFAULT
-| <REPLACE: "replace"> : DEFAULT
-| <DEFINE: "def"> : DEFAULT
-| <CHECK: "check"> : DEFAULT
-| <INITIALIZE: "initialize"> : DEFAULT
-| <FINALIZE: "finalize"> : DEFAULT
-| <END: "end"> : DEFAULT
-| <DYNAMIC: "dynamic"> : DEFAULT
-| <SEQUENCIAL: "seq"> : DEFAULT
-| <PARALLEL: "par"> : DEFAULT
-| <BREAK: "break"> : DEFAULT
-| <CONTINUE: "continue"> : DEFAULT
-| <DELETE: "delete"> : DEFAULT
-| <ELSE: "else"> : DEFAULT
-| <FOR: "for"> : DEFAULT
-| <FUNCTION: "function"> : DEFAULT
-| <IF: "if"> : DEFAULT
-| <IN: "in"> : DEFAULT
-| <OF: "of"> : DEFAULT
-| <EACH: "each"> : DEFAULT
-| <NEW: "new"> : DEFAULT
-| <RETURN: "return"> : DEFAULT
-| <THIS: "this"> : IN_REGEX
-| <TYPEOF: "typeof"> : DEFAULT
-| <VAR: "var"> : DEFAULT
-| <VOID: "void"> : DEFAULT
-| <WHILE: "while"> : DEFAULT
-| <WITH: "with"> : DEFAULT
-| <CASE: "case"> : DEFAULT
-| <CATCH: "catch"> : DEFAULT
-| <CLASS: "class"> : DEFAULT
-| <CONST: "const"> : DEFAULT
-| <DEBUGGER: "debugger"> : DEFAULT
-| <_DEFAULT: "default"> : DEFAULT
-| <DO: "do"> : DEFAULT
-| <ENUM: "enum"> : DEFAULT
-| <EXTENDS: "extends"> : DEFAULT
-| <FINALLY: "finally"> : DEFAULT
-| <IMPORT: "import"> : DEFAULT
-| <SUPER: "super"> : DEFAULT
-| <SWITCH: "switch"> : DEFAULT
-| <THROW: "throw"> : DEFAULT
-| <TRY: "try"> : DEFAULT
-| <UTF8_BOM: "\u00ef\u00bb\u00bf"> : DEFAULT
-}
-
-   
-
-
-/* JScript .NET Tokens
-
-TOKEN :
-{
-	< BYTE: "byte" >
-	| < SBYTE: "sbyte" >
-	| < SHORT: "short" >
-	| < USHORT: "ushort" >
-	| < UINT: "uint" >
-	| < LONG: "long" >
-	| < ULONG: "ulong" >
-	| < FLOAT: "float" >
-	| < NUMBER: "Number" >
-	| < DOUBLE: "double" >
-	| < DECIMAL: "decimal" >
-	| < BOOLEAN: "boolean" >
-	| < STRING: "String" >
-	| < CHAR: "char" >
-}
-
-*/
-
-
-/* Section 7.7: Punctuators */
-
-
-<DEFAULT,IN_REGEX> TOKEN : {
-<LBRACE: "{"> : DEFAULT
-| <RBRACE: "}"> : IN_REGEX
-| <LPAREN: "("> : DEFAULT
-| <RPAREN: ")"> : IN_REGEX
-| <LBRACKET: "["> : DEFAULT
-| <RBRACKET: "]"> : IN_REGEX
-| <DOT: "."> : DEFAULT
-| <SEMICOLON: ";"> : DEFAULT
-| <COMMA: ","> : DEFAULT
-| <LT: "<"> : DEFAULT
-| <GT: ">"> : DEFAULT
-| <LE: "<="> : DEFAULT
-| <GE: ">="> : DEFAULT
-| <EQ: "=="> : DEFAULT
-| <NE: "!="> : DEFAULT
-| <MATCH: "~="> : DEFAULT
-| <SEQ: "==="> : DEFAULT
-| <SNEQ: "!=="> : DEFAULT
-| <PLUS: "+"> : DEFAULT
-| <MINUS: "-"> : DEFAULT
-| <STAR: "*"> : DEFAULT
-| <REM: "%"> : DEFAULT
-| <INCR: "++"> : IN_REGEX
-| <DECR: "--"> : IN_REGEX
-| <LSHIFT: "<<"> : DEFAULT
-| <RSHIFT: ">>"> : DEFAULT
-| <RUNSHIFT: ">>>"> : DEFAULT
-| <BIT_AND: "&"> : DEFAULT
-| <BIT_OR: "|"> : DEFAULT
-| <XOR: "^"> : DEFAULT
-| <BANG: "!"> : DEFAULT
-| <TILDE: "~"> : IN_REGEX
-| <SC_AND: "&&"> : DEFAULT
-| <SC_OR: "||"> : DEFAULT
-| <HOOK: "?"> : DEFAULT
-| <NATURAL_JOIN: "::"> : DEFAULT
-| <COLON: ":"> : DEFAULT
-| <ASSIGN: "="> : DEFAULT
-| <PLUSASSIGN: "+="> : DEFAULT
-| <MINUSASSIGN: "-="> : DEFAULT
-| <STARASSIGN: "*="> : DEFAULT
-| <REMASSIGN: "%="> : DEFAULT
-| <LSHIFTASSIGN: "<<="> : DEFAULT
-| <RSIGNEDSHIFTASSIGN: ">>="> : DEFAULT
-| <RUNSIGNEDSHIFTASSIGN: ">>>="> : DEFAULT
-| <ANDASSIGN: "&="> : DEFAULT
-| <ORASSIGN: "|="> : DEFAULT
-| <XORASSIGN: "^="> : DEFAULT
-| <INTANCE_OF: "instanceof"> : DEFAULT
-}
-
-   
-
-
-/* Section 7.8.3: Numeric Literals */
-
-
-<DEFAULT,IN_REGEX> TOKEN : {
-<DECIMAL_LITERAL: <DECIMAL_INTEGER_LITERAL> "." (<DECIMAL_DIGITS>)? (<EXPONENT_PART>)? | "." <DECIMAL_DIGITS> (<EXPONENT_PART>)? | <DECIMAL_INTEGER_LITERAL> (<EXPONENT_PART>)?> : IN_REGEX
-| <#NON_ZERO_DIGIT: ["1"-"9"]>
-| <#EXPONENT_PART: ("e" | "E") (["+","-"])? <DECIMAL_DIGITS>>
-}
-
-   
-
-
-<DEFAULT,IN_REGEX> TOKEN : {
-<DECIMAL_INTEGER_LITERAL: "0" | <NON_ZERO_DIGIT> (<DECIMAL_DIGITS>)?> : IN_REGEX
-}
-
-   
-
-
-<DEFAULT,IN_REGEX> TOKEN : {
-<HEX_INTEGER_LITERAL: "0" ["x","X"] (<HEX_DIGIT>)+> : IN_REGEX
-}
-
-   
-
-
-<DEFAULT,IN_REGEX> TOKEN : {
-<DECIMAL_DIGITS: (<DECIMAL_DIGIT>)+> : IN_REGEX
-}
-
-   
-
-
-<DEFAULT> TOKEN : {
-<DECIMAL_DIGIT: ["0"-"9"]>
-}
-
-   
-
-
-/* Section 7.8.1: NULL Literals */
-
-
-<DEFAULT,IN_REGEX> TOKEN : {
-<NULL_LITERAL: "null"> : IN_REGEX
-}
-
-   
-
-
-/* Section 7.8.2: Boolean Literals */
-
-
-<DEFAULT,IN_REGEX> TOKEN : {
-<BOOLEAN_LITERAL: "true" | "false"> : IN_REGEX
-}
-
-   
-
-
-/* Section 7.8.4: String Literals */
-
-
-<DEFAULT,IN_REGEX> TOKEN : {
-<STRING_LITERAL: "\"" (<DOUBLE_STRING_CHARACTERS>)? "\"" | "\'" (<SINGLE_STRING_CHARACTERS>)? "\'"> : IN_REGEX
-| <#DOUBLE_STRING_CHARACTERS: (<DOUBLE_STRING_CHARACTER>)*>
-| <#SINGLE_STRING_CHARACTERS: (<SINGLE_STRING_CHARACTER>)*>
-| <#DOUBLE_STRING_CHARACTER: (~["\"","\\","\n","\r","\u2028","\u2029"])* | "\\" <ESCAPE_SEQUENCE>>
-| <#SINGLE_STRING_CHARACTER: ~["\'","\\","\n","\r","\u2028","\u2029"] | "\\" <ESCAPE_SEQUENCE>>
-| <#ESCAPE_SEQUENCE: <CHARACTER_ESCAPE_SEQUENCE> | "0" | <HEX_ESCAPE_SEQUENCE> | <UNICODE_ESCAPE_SEQUENCE>>
-| <#CHARACTER_ESCAPE_SEQUENCE: <SINGLE_ESCAPE_CHARACTER> | <NON_ESCAPE_CHARACTER>>
-| <#SINGLE_ESCAPE_CHARACTER: ["\'","\"","\\","b","f","n","r","t","v"]>
-| <#NON_ESCAPE_CHARACTER: ~["\n","\r","\u2028","\u2029"] | ~["\'","\"","\\","b","f","n","r","t","v","x","u"] | ~["0"-"9"]>
-}
-
-   
-
-
-<DEFAULT> TOKEN : {
-<HEX_ESCAPE_SEQUENCE: "x" <HEX_DIGIT> <HEX_DIGIT>>
-}
-
-   
-
-
-<DEFAULT,IN_REGEX> TOKEN : {
-<CODE_LITERAL: "%{" (~["}"])* "}" ("}" | ~["}","%"] (~["}"])* "}")* "%"> : DEFAULT
-}
-
-   
-
-
-/*
-TOKEN:
-{
-  < ESCAPE_CHARACTER:
-	  ["'" , "\"" , "\\" , "b" , "f" , "n" , "r" , "t" , "v"]
-	| ["0"-"9"]
-	| "x"
-	| "u"
-  >
-}
-*/
-
-/* Section 7.6: Identifiers */
-
-
-<DEFAULT,IN_REGEX> TOKEN : {
-<LABEL_IDENTIFIER: "#" (<IDENTIFIER_PART>)*> : IN_REGEX
-| <IDENTIFIER_NAME: <DOLLAR_SIGN> (<DOLLAR_SIGN> | "*" | "#" | "^") | (<DOLLAR_SIGN> | <AT_SIGN>)? <IDENTIFIER_START> (<IDENTIFIER_PART>)*> : IN_REGEX
-| <#IDENTIFIER_START: <UNICODE_LETTER> | <UNDER_SCORE> | <UNICODE_ESCAPE_SEQUENCE>>
-| <#IDENTIFIER_PART: <IDENTIFIER_START> | <UNICODE_COMBINING_MARK> | <UNICODE_DIGIT> | <UNICODE_CONNECTOR_PUNCTUATION> | <UNICODE_ESCAPE_SEQUENCE>>
-| <#DOLLAR_SIGN: "$">
-| <#AT_SIGN: "@">
-| <#UNDER_SCORE: "_">
-| <#UNICODE_LETTER: ["A"-"Z"] | ["a"-"z"] | ["A"-"Z"] | ["a"-"z"] | ["\u00aa"] | ["\u00b5"] | ["\u00ba"] | ["\u00c0"-"\u00d6"] | ["\u00d8"-"\u00f6"] | ["\u00f8"-"\u021f"] | ["\u0222"-"\u0233"] | ["\u0250"-"\u02ad"] | ["\u02b0"-"\u02b8"] | ["\u02bb"-"\u02c1"] | ["\u02d0"-"\u02d1"] | ["\u02e0"-"\u02e4"] | ["\u02ee"] | ["\u037a"] | ["\u0386"] | ["\u0388"-"\u038a"] | ["\u038c"] | ["\u038e"-"\u03a1"] | ["\u03a3"-"\u03ce"] | ["\u03d0"-"\u03d7"] | ["\u03da"-"\u03f3"] | ["\u0400"-"\u0481"] | ["\u048c"-"\u04c4"] | ["\u04c7"-"\u04c8"] | ["\u04cb"-"\u04cc"] | ["\u04d0"-"\u04f5"] | ["\u04f8"-"\u04f9"] | ["\u0531"-"\u0556"] | ["\u0559"] | ["\u0561"-"\u0587"] | ["\u05d0"-"\u05ea"] | ["\u05f0"-"\u05f2"] | ["\u0621"-"\u063a"] | ["\u0640"-"\u064a"] | ["\u0671"-"\u06d3"] | ["\u06d5"] | ["\u06e5"-"\u06e6"] | ["\u06fa"-"\u06fc"] | ["\u0710"] | ["\u0712"-"\u072c"] | ["\u0780"-"\u07a5"] | ["\u0905"-"\u0939"] | ["\u093d"] | ["\u0950"] | ["\u0958"-"\u0961"] | ["\u0985"-"\u098c"] | ["\u098f"-"\u0990"] | ["\u0993"-"\u09a8"] | ["\u09aa"-"\u09b0"] | ["\u09b2"] | ["\u09b6"-"\u09b9"] | ["\u09dc"-"\u09dd"] | ["\u09df"-"\u09e1"] | ["\u09f0"-"\u09f1"] | ["\u0a05"-"\u0a0a"] | ["\u0a0f"-"\u0a10"] | ["\u0a13"-"\u0a28"] | ["\u0a2a"-"\u0a30"] | ["\u0a32"-"\u0a33"] | ["\u0a35"-"\u0a36"] | ["\u0a38"-"\u0a39"] | ["\u0a59"-"\u0a5c"] | ["\u0a5e"] | ["\u0a72"-"\u0a74"] | ["\u0a85"-"\u0a8b"] | ["\u0a8d"] | ["\u0a8f"-"\u0a91"] | ["\u0a93"-"\u0aa8"] | ["\u0aaa"-"\u0ab0"] | ["\u0ab2"-"\u0ab3"] | ["\u0ab5"-"\u0ab9"] | ["\u0abd"] | ["\u0ad0"] | ["\u0ae0"] | ["\u0b05"-"\u0b0c"] | ["\u0b0f"-"\u0b10"] | ["\u0b13"-"\u0b28"] | ["\u0b2a"-"\u0b30"] | ["\u0b32"-"\u0b33"] | ["\u0b36"-"\u0b39"] | ["\u0b3d"] | ["\u0b5c"-"\u0b5d"] | ["\u0b5f"-"\u0b61"] | ["\u0b85"-"\u0b8a"] | ["\u0b8e"-"\u0b90"] | ["\u0b92"-"\u0b95"] | ["\u0b99"-"\u0b9a"] | ["\u0b9c"] | ["\u0b9e"-"\u0b9f"] | ["\u0ba3"-"\u0ba4"] | ["\u0ba8"-"\u0baa"] | ["\u0bae"-"\u0bb5"] | ["\u0bb7"-"\u0bb9"] | ["\u0c05"-"\u0c0c"] | ["\u0c0e"-"\u0c10"] | ["\u0c12"-"\u0c28"] | ["\u0c2a"-"\u0c33"] | ["\u0c35"-"\u0c39"] | ["\u0c60"-"\u0c61"] | ["\u0c85"-"\u0c8c"] | ["\u0c8e"-"\u0c90"] | ["\u0c92"-"\u0ca8"] | ["\u0caa"-"\u0cb3"] | ["\u0cb5"-"\u0cb9"] | ["\u0cde"] | ["\u0ce0"-"\u0ce1"] | ["\u0d05"-"\u0d0c"] | ["\u0d0e"-"\u0d10"] | ["\u0d12"-"\u0d28"] | ["\u0d2a"-"\u0d39"] | ["\u0d60"-"\u0d61"] | ["\u0d85"-"\u0d96"] | ["\u0d9a"-"\u0db1"] | ["\u0db3"-"\u0dbb"] | ["\u0dbd"] | ["\u0dc0"-"\u0dc6"] | ["\u0e01"-"\u0e30"] | ["\u0e32"-"\u0e33"] | ["\u0e40"-"\u0e46"] | ["\u0e81"-"\u0e82"] | ["\u0e84"] | ["\u0e87"-"\u0e88"] | ["\u0e8a"] | ["\u0e8d"] | ["\u0e94"-"\u0e97"] | ["\u0e99"-"\u0e9f"] | ["\u0ea1"-"\u0ea3"] | ["\u0ea5"] | ["\u0ea7"] | ["\u0eaa"-"\u0eab"] | ["\u0ead"-"\u0eb0"] | ["\u0eb2"-"\u0eb3"] | ["\u0ebd"-"\u0ec4"] | ["\u0ec6"] | ["\u0edc"-"\u0edd"] | ["\u0f00"] | ["\u0f40"-"\u0f6a"] | ["\u0f88"-"\u0f8b"] | ["\u1000"-"\u1021"] | ["\u1023"-"\u1027"] | ["\u1029"-"\u102a"] | ["\u1050"-"\u1055"] | ["\u10a0"-"\u10c5"] | ["\u10d0"-"\u10f6"] | ["\u1100"-"\u1159"] | ["\u115f"-"\u11a2"] | ["\u11a8"-"\u11f9"] | ["\u1200"-"\u1206"] | ["\u1208"-"\u1246"] | ["\u1248"] | ["\u124a"-"\u124d"] | ["\u1250"-"\u1256"] | ["\u1258"] | ["\u125a"-"\u125d"] | ["\u1260"-"\u1286"] | ["\u1288"] | ["\u128a"-"\u128d"] | ["\u1290"-"\u12ae"] | ["\u12b0"] | ["\u12b2"-"\u12b5"] | ["\u12b8"-"\u12be"] | ["\u12c0"] | ["\u12c2"-"\u12c5"] | ["\u12c8"-"\u12ce"] | ["\u12d0"-"\u12d6"] | ["\u12d8"-"\u12ee"] | ["\u12f0"-"\u130e"] | ["\u1310"] | ["\u1312"-"\u1315"] | ["\u1318"-"\u131e"] | ["\u1320"-"\u1346"] | ["\u1348"-"\u135a"] | ["\u13a0"-"\u13b0"] | ["\u13b1"-"\u13f4"] | ["\u1401"-"\u1676"] | ["\u1681"-"\u169a"] | ["\u16a0"-"\u16ea"] | ["\u1780"-"\u17b3"] | ["\u1820"-"\u1877"] | ["\u1880"-"\u18a8"] | ["\u1e00"-"\u1e9b"] | ["\u1ea0"-"\u1ee0"] | ["\u1ee1"-"\u1ef9"] | ["\u1f00"-"\u1f15"] | ["\u1f18"-"\u1f1d"] | ["\u1f20"-"\u1f39"] | ["\u1f3a"-"\u1f45"] | ["\u1f48"-"\u1f4d"] | ["\u1f50"-"\u1f57"] | ["\u1f59"] | ["\u1f5b"] | ["\u1f5d"] | ["\u1f5f"-"\u1f7d"] | ["\u1f80"-"\u1fb4"] | ["\u1fb6"-"\u1fbc"] | ["\u1fbe"] | ["\u1fc2"-"\u1fc4"] | ["\u1fc6"-"\u1fcc"] | ["\u1fd0"-"\u1fd3"] | ["\u1fd6"-"\u1fdb"] | ["\u1fe0"-"\u1fec"] | ["\u1ff2"-"\u1ff4"] | ["\u1ff6"-"\u1ffc"] | ["\u207f"] | ["\u2102"] | ["\u2107"] | ["\u210a"-"\u2113"] | ["\u2115"] | ["\u2119"-"\u211d"] | ["\u2124"] | ["\u2126"] | ["\u2128"] | ["\u212a"-"\u212d"] | ["\u212f"-"\u2131"] | ["\u2133"-"\u2139"] | ["\u2160"-"\u2183"] | ["\u3005"-"\u3007"] | ["\u3021"-"\u3029"] | ["\u3031"-"\u3035"] | ["\u3038"-"\u303a"] | ["\u3041"-"\u3094"] | ["\u309d"-"\u309e"] | ["\u30a1"-"\u30fa"] | ["\u30fc"-"\u30fe"] | ["\u3105"-"\u312c"] | ["\u3131"-"\u318e"] | ["\u31a0"-"\u31b7"] | ["\u3400"] | ["\u4db5"] | ["\u4e00"] | ["\u9fa5"] | ["\ua000"-"\ua48c"] | ["\uac00"] | ["\ud7a3"] | ["\uf900"-"\ufa2d"] | ["\ufb00"-"\ufb06"] | ["\ufb13"-"\ufb17"] | ["\ufb1d"] | ["\ufb1f"-"\ufb28"] | ["\ufb2a"-"\ufb36"] | ["\ufb38"-"\ufb3c"] | ["\ufb3e"] | ["\ufb40"-"\ufb41"] | ["\ufb43"-"\ufb44"] | ["\ufb46"-"\ufbb1"] | ["\ufbd3"-"\ufd3d"] | ["\ufd50"-"\ufd8f"] | ["\ufd92"-"\ufdc7"] | ["\ufdf0"-"\ufdfb"] | ["\ufe70"-"\ufe72"] | ["\ufe74"] | ["\ufe76"-"\ufefc"] | ["\uff21"-"\uff3a"] | ["\uff41"-"\uff5a"] | ["\uff66"-"\uffbe"] | ["\uffc2"-"\uffc7"] | ["\uffca"-"\uffcf"] | ["\uffd2"-"\uffd7"] | ["\uffda"-"\uffdc"]>
-}
-
-   
-
-
-/*
- * Unicode categories Non-spacing mark (MN) OR Combining spacing mark (MC)
- */
-
-
-<DEFAULT> MORE : {
-<UNICODE_COMBINING_MARK: <MN> | <MC>>
-}
-
-   
-
-
-<DEFAULT> TOKEN : {
-<MC: ["\u0903"] | ["\u093e"] | ["\u093f"] | ["\u0940"] | ["\u0949"] | ["\u094a"] | ["\u094b"] | ["\u094c"] | ["\u0982"] | ["\u0983"] | ["\u09be"] | ["\u09bf"] | ["\u09c0"] | ["\u09c7"] | ["\u09c8"] | ["\u09cb"] | ["\u09cc"] | ["\u09d7"] | ["\u0a03"] | ["\u0a3e"] | ["\u0a3f"] | ["\u0a40"] | ["\u0a83"] | ["\u0abe"] | ["\u0abf"] | ["\u0ac0"] | ["\u0ac9"] | ["\u0acb"] | ["\u0acc"] | ["\u0b02"] | ["\u0b03"] | ["\u0b3e"] | ["\u0b40"] | ["\u0b47"] | ["\u0b48"] | ["\u0b4b"] | ["\u0b4c"] | ["\u0b57"] | ["\u0bbe"] | ["\u0bbf"] | ["\u0bc1"] | ["\u0bc2"] | ["\u0bc6"] | ["\u0bc7"] | ["\u0bc8"] | ["\u0bca"] | ["\u0bcb"] | ["\u0bcc"] | ["\u0bd7"] | ["\u0c01"] | ["\u0c02"] | ["\u0c03"] | ["\u0c41"] | ["\u0c42"] | ["\u0c43"] | ["\u0c44"] | ["\u0c82"] | ["\u0c83"] | ["\u0cbe"] | ["\u0cc0"] | ["\u0cc1"] | ["\u0cc2"] | ["\u0cc3"] | ["\u0cc4"] | ["\u0cc7"] | ["\u0cc8"] | ["\u0cca"] | ["\u0ccb"] | ["\u0cd5"] | ["\u0cd6"] | ["\u0d02"] | ["\u0d03"] | ["\u0d3e"] | ["\u0d3f"] | ["\u0d40"] | ["\u0d46"] | ["\u0d47"] | ["\u0d48"] | ["\u0d4a"] | ["\u0d4b"] | ["\u0d4c"] | ["\u0d57"] | ["\u0d82"] | ["\u0d83"] | ["\u0dcf"] | ["\u0dd0"] | ["\u0dd1"] | ["\u0dd8"] | ["\u0dd9"] | ["\u0dda"] | ["\u0ddb"] | ["\u0ddc"] | ["\u0ddd"] | ["\u0dde"] | ["\u0ddf"] | ["\u0df2"] | ["\u0df3"] | ["\u0f3e"] | ["\u0f3f"] | ["\u0f7f"] | ["\u102c"] | ["\u1031"] | ["\u1038"] | ["\u1056"] | ["\u1057"] | ["\u17b6"] | ["\u17be"] | ["\u17bf"] | ["\u17c0"] | ["\u17c1"] | ["\u17c2"] | ["\u17c3"] | ["\u17c4"] | ["\u17c5"] | ["\u17c7"] | ["\u17c8"] | ["\u1923"] | ["\u1924"] | ["\u1925"] | ["\u1926"] | ["\u1929"] | ["\u192a"] | ["\u192b"] | ["\u1930"] | ["\u1931"] | ["\u1933"] | ["\u1934"] | ["\u1935"] | ["\u1936"] | ["\u1937"] | ["\u1938"] | ["\u19b0"] | ["\u19b1"] | ["\u19b2"] | ["\u19b3"] | ["\u19b4"] | ["\u19b5"] | ["\u19b6"] | ["\u19b7"] | ["\u19b8"] | ["\u19b9"] | ["\u19ba"] | ["\u19bb"] | ["\u19bc"] | ["\u19bd"] | ["\u19be"] | ["\u19bf"] | ["\u19c0"] | ["\u19c8"] | ["\u19c9"] | ["\u1a19"] | ["\u1a1a"] | ["\u1a1b"] | ["\ua802"] | ["\ua823"] | ["\ua824"] | ["\ua827"] | ["\u1d16"] | ["\u1d16"] | ["\u1d16"] | ["\u1d16"] | ["\u1d16"] | ["\u1d17"] | ["\u1d17"] | ["\u1d17"]>
-| <MN: ["\u0300"-"\u034e"] | ["\u0360"-"\u0362"] | ["\u0483"-"\u0486"] | ["\u0591"-"\u05a1"] | ["\u05a3"-"\u05b9"] | ["\u05bb"-"\u05bd"] | ["\u05bf"] | ["\u05c1"-"\u05c2"] | ["\u05c4"] | ["\u064b"-"\u0655"] | ["\u0670"] | ["\u06d6"-"\u06dc"] | ["\u06df"-"\u06e4"] | ["\u06e7"-"\u06e8"] | ["\u06ea"-"\u06ed"] | ["\u0711"] | ["\u0730"-"\u074a"] | ["\u07a6"-"\u07b0"] | ["\u0901"-"\u0903"] | ["\u093c"] | ["\u093e"-"\u094d"] | ["\u0951"-"\u0954"] | ["\u0962"-"\u0963"] | ["\u0981"-"\u0983"] | ["\u09bc"-"\u09c4"] | ["\u09c7"-"\u09c8"] | ["\u09cb"-"\u09cd"] | ["\u09d7"] | ["\u09e2"-"\u09e3"] | ["\u0a02"] | ["\u0a3c"] | ["\u0a3e"-"\u0a42"] | ["\u0a47"-"\u0a48"] | ["\u0a4b"-"\u0a4d"] | ["\u0a70"-"\u0a71"] | ["\u0a81"-"\u0a83"] | ["\u0abc"] | ["\u0abe"-"\u0ac5"] | ["\u0ac7"-"\u0ac9"] | ["\u0acb"-"\u0acd"] | ["\u0b01"-"\u0b03"] | ["\u0b3c"] | ["\u0b3e"-"\u0b43"] | ["\u0b47"-"\u0b48"] | ["\u0b4b"-"\u0b4d"] | ["\u0b56"-"\u0b57"] | ["\u0b82"-"\u0b83"] | ["\u0bbe"-"\u0bc2"] | ["\u0bc6"-"\u0bc8"] | ["\u0bca"-"\u0bcd"] | ["\u0bd7"] | ["\u0c01"-"\u0c03"] | ["\u0c3e"-"\u0c44"] | ["\u0c46"-"\u0c48"] | ["\u0c4a"-"\u0c4d"] | ["\u0c55"-"\u0c56"] | ["\u0c82"-"\u0c83"] | ["\u0cbe"-"\u0cc4"] | ["\u0cc6"-"\u0cc8"] | ["\u0cca"-"\u0ccd"] | ["\u0cd5"-"\u0cd6"] | ["\u0d02"-"\u0d03"] | ["\u0d3e"-"\u0d43"] | ["\u0d46"-"\u0d48"] | ["\u0d4a"-"\u0d4d"] | ["\u0d57"] | ["\u0d82"-"\u0d83"] | ["\u0dca"] | ["\u0dcf"-"\u0dd4"] | ["\u0dd6"] | ["\u0dd8"-"\u0ddf"] | ["\u0df2"-"\u0df3"] | ["\u0e31"] | ["\u0e34"-"\u0e3a"] | ["\u0e47"-"\u0e4e"] | ["\u0eb1"] | ["\u0eb4"-"\u0eb9"] | ["\u0ebb"-"\u0ebc"] | ["\u0ec8"-"\u0ecd"] | ["\u0f18"-"\u0f19"] | ["\u0f35"] | ["\u0f37"] | ["\u0f39"] | ["\u0f3e"-"\u0f3f"] | ["\u0f71"-"\u0f84"] | ["\u0f86"-"\u0f87"] | ["\u0f90"-"\u0f97"] | ["\u0f99"-"\u0fbc"] | ["\u0fc6"] | ["\u102c"-"\u1032"] | ["\u1036"-"\u1039"] | ["\u1056"-"\u1059"] | ["\u17b4"-"\u17d3"] | ["\u18a9"] | ["\u20d0"-"\u20dc"] | ["\u20e1"] | ["\u302a"-"\u302f"] | ["\u3099"-"\u309a"] | ["\ufb1e"] | ["\ufe20"-"\ufe23"]>
-}
-
-   
-
-
-<DEFAULT> TOKEN : {
-<UNICODE_DIGIT: ["0"-"9"] | ["\u0660"-"\u0669"] | ["\u06f0"-"\u06f9"] | ["\u0966"-"\u096f"] | ["\u09e6"-"\u09ef"] | ["\u0a66"-"\u0a6f"] | ["\u0ae6"-"\u0aef"] | ["\u0b66"-"\u0b6f"] | ["\u0be7"-"\u0bef"] | ["\u0c66"-"\u0c6f"] | ["\u0ce6"-"\u0cef"] | ["\u0d66"-"\u0d6f"] | ["\u0e50"-"\u0e59"] | ["\u0ed0"-"\u0ed9"] | ["\u0f20"-"\u0f29"] | ["\u1040"-"\u1049"] | ["\u1369"-"\u1371"] | ["\u17e0"-"\u17e9"] | ["\u1810"-"\u1819"] | ["\uff10"-"\uff19"]>
-}
-
-   
-
-
-<DEFAULT> TOKEN : {
-<UNICODE_CONNECTOR_PUNCTUATION: ["_"] | ["\u203f"-"\u2040"] | ["\u30fb"] | ["\ufe33"-"\ufe34"] | ["\ufe4d"-"\ufe4f"] | ["\uff3f"] | ["\uff65"]>
-}
-
-   
-
-
-<DEFAULT> TOKEN : {
-<UNICODE_ESCAPE_SEQUENCE: "u" <HEX_DIGIT> <HEX_DIGIT> <HEX_DIGIT> <HEX_DIGIT>>
-}
-
-   
-
-
-<DEFAULT> TOKEN : {
-<HEX_DIGIT: ["0"-"9"] | ["a"-"f"] | ["A"-"F"]>
-}
-
-   
-
-
-<IN_REGEX> TOKEN : {
-<SLASHASSIGN: "/="> : DEFAULT
-| <SLASH: "/"> : DEFAULT
-}
-
-   
-
-
-/************************** LARA TOKENS *************************************
-
-TOKEN : /* JP IDENTIFIERS *
-{
-  < JPVAR: "$" ( | )>  :DEFAULT |
-  < #IN_JPVAR:  |  | < END > |  |  |  |  |  >
-}
- /************************** LARA TOKENS *************************************/
-
-/* Section 7.8.5: Regular Expression Literals */
-
-
-<DEFAULT> TOKEN : {
-<REGULAR_EXPRESSION_LITERAL: "/" (~["\n","\r","\\","/","*"] | <BACKSLASH_SEQUENCE>) (~["\n","\r","\\","/"] | <BACKSLASH_SEQUENCE>)* "/" (<IDENTIFIER_PART>)*> : IN_REGEX
-| <#BACKSLASH_SEQUENCE: "\\" ~["\n","\r"]>
-}
-
-   
-
-

NON-TERMINALS

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
-/** Get the join point Identifier
-	 * Function that returns the join point identifier, which can any identifier or one of the following reserved words
-	 **/
-
getNoReservedIdentifier::=( <IDENTIFIER_NAME> | <CALL> | <BEGIN> | <END> | <FUNCTION> | <VAR> | <RETURN> | <IF> | <ELSE> | <TO> | <IN> | <INPUT> | <OUTPUT> | <CONDITION> | <_DEFAULT> | <CLASS> )
noReservedIdentifier::=( <IDENTIFIER_NAME> | <CALL> | <BEGIN> | <END> | <FUNCTION> | <VAR> | <RETURN> | <IF> | <ELSE> | <TO> | <IN> | <INPUT> | <OUTPUT> | <CONDITION> | <_DEFAULT> | <CLASS> )
-
-/*****************************************
- * ECMA SYNTACTIC GRAMMARS  STARTS HERE  *
- *****************************************/
-
-/*******************************************************************************
- ************************    LARA SYNTACTIC GRAMMAR    ************************* 
- *******************************************************************************/
-
-        /** LARA Start
-	 * A LARA file can contain zero or more includes and imports, followed by definitions of aspectdefs, codedefs, functions and global variables
-	 **/
-
Start::=( <UTF8_BOM> )? ( Import )* ( AspectDef | CodeDef )* <EOF>
-
-/** Import
-	 * Imports the path to a file that is not in the same path of the invoked LARA file.
-	 * With one import it is possible to import one or every file within a package
-	 **/
-
Import::=<IMPORT> FilePath EndStatement
-
-/** FilePath
-	* gets the path to a file or all the files in the package 
-	**/
-
FilePath::=( Identifier <DOT> )* ( <IDENTIFIER_NAME> | <STAR> )
-
-/** FilePathNoSTar
-	* gets the path to a file in a package
-	**/
-
FilePathNoSTar::=( Identifier <DOT> )+
-
-/** Code Definition
-	 * A parcel of native code or LARA-Code to be used by the insert/output action. To define the target language, one has to define the type of the codedef, such as: codedef, this means that the code to be inserted is written in C language.
-	 * A code definition needs an identifier and its body is code that can contain a tag such as "" to insert information on the code such as: join point property or a variable value. To use those tags, the codedef must have input arguments to refer those to specific values.
-	 **/
-
CodeDef::=<CODEDEF> ( <LT> <IDENTIFIER_NAME> <GT> )? <IDENTIFIER_NAME> ( ( <LPAREN> FormalParameterList <RPAREN> )? ) <CODE_LITERAL> <END>
-
-/** Input arguments
-	 * The arguments to be defined when a "aspect-call" action is stated.
-	 * They can be normal variables or variables referent to a specific join point. The normal variables can have a default value
-	 **/
-
Input::=<INPUT> VariableDeclarationList ( <SEMICOLON> )? <END>
-
-/** Output arguments
-	 * List of normal variables or variables referent to a specific join point. The normal variables can have a default value
-	 **/
-
Output::=<OUTPUT> VariableDeclarationList ( <SEMICOLON> )? <END>
-
-/** Static
-	 * List of static variables and functions, which can be accessed statically in the aspect. The variables values are shared
-	 * between all aspect instances
-	 **/
-
Static::=<STATICDECL> ( VariableStatement | FunctionDeclaration )* <END>
-
-/** Initialize
-	 * Similar to a constructor. A block of JavaScript code to initialize variables, inter alia
-	 **/
-
Initialize::=<INITIALIZE> JavaScript <END>
-
-/** Finalize
-	 * Similar to a destructor. A block of JavaScript code to finalize output variables, inter alia
-	 **/
-
Finalize::=<FINALIZE> JavaScript <END>
-
-/** Check
-	 * Set of conditions to verify input arguments and other important stats that specify if the aspect can be executed
-	 **/
-
Check::=<CHECK> ( LogicalORExpression EndStatement )* <END>
-
-/** Aspect Definition
-	 * The aspect definition can contain outputs and inputs variables, a check to verify those variables, an initializer and a finalizer to deal with information to be handler before and after the aspect, respectively.
-	 * The body of the aspect consists of selects, applies and conditions to apply the aspect in the target program, and afters, befores, function and variable declaration to assist the apply and condition section.
-	 */
-
AspectDef::=<ASPECTDEF> <IDENTIFIER_NAME> ( Input | Output | Static )* ( Initialize )? ( Check )? ( ( Select | Apply | AroundApply | Condition | SourceElement ) )* ( Finalize )? <END>
-
-/** Select
-	 * Pointcut expression to specify which join points are intended to influence.
-	 * It can contain an unique label, so it can be advised, and a pointcut expression
-	 */
-
Select::=( <IDENTIFIER_NAME> <COLON> )? <SELECT> ( Pointcut | FourthSetOp ) <END>
FourthSetOp::=ThirdSetOp ( <PLUS> FourthSetOp )?
ThirdSetOp::=FirstSetOp ( ( <NATURAL_JOIN> | <BIT_AND> ) ThirdSetOp )?
FirstSetOp::=Identifier
|( <LPAREN> FourthSetOp <RPAREN> )
-
-/** Pointcut
-	 * It can contain an identifier for the join point, a join point identifier and a possible property expression. 
-	 * Each join point can have a child, the join point down to its hierarchy
-	 */
-
Pointcut::=( getNoReservedIdentifier | <LPAREN> <IDENTIFIER_NAME> <ASSIGN> getNoReservedIdentifier <RPAREN> ) ( PointcutFilters )? ( <DOT> Pointcut )?
-
-/** Pointcut  properties
-	 * The properties of a pointcut can be declared in three different ways:
-		- it can be any property (*)
-		- a set of properties that will be mapped to the default attribute
-		- a property expression
-	 */
-
PointcutFilters::=<LBRACE> ( <STAR> | ( ( OrFiltersExpr ) | ( ( ConditionalExpression ( <COMMA> ConditionalExpression )* ) ) ) ) <RBRACE>
-
-/** "OR" Property Expr
-	 * In the pointcut properties declaration, the comma is used as an OR operator (similar to ||)
-	 **/
-
OrFiltersExpr::=( ANDFiltersExpr ( <COMMA> ANDFiltersExpr )* )
-
-/** "AND" Property Expression
-	 * To combine properties such as an AND operation, the properties are declared inside brackets, converting the comma (which is the OR operator) into an AND.
-	 */
-
ANDFiltersExpr::=Filter
|<LPAREN> ( Filter ( <COMMA> Filter )* ) <RPAREN>
-
-/** Property
-	 * The property is defined by comparing a join point attribute to a value
-	 **/
-
Filter::=<IDENTIFIER_NAME> ( EqualityOperator | RelationalOperator ) ConditionalExpression
-
-/** Around
-	 * A Statement to occur around an apply
-	 * It contains a list of applies that this statement refers to. The body of this statement is JavaScript, and can be used to prepare information for the applies.
-	 **/
-
AroundApply::=( <IDENTIFIER_NAME> <COLON> )? ( <BEFORE> | <AFTER> ) ( ( Identifier ( ( <COMMA> Identifier )* ) ) )? <DO> JavaScript <END>
-
-/** Apply
-	 * Old Version of apply, only static weaving
-	 * Advice each join point of the related select(s).
-	 * It can contain an unique label and a list of selects to be advised by the apply. If no select is inserted, the last select with no label will be used.
-	 * The body contains JavaScript, in which the actions can be declared
-	 **
-	void Apply() #Apply:
-	{Token name, apply, end;}
-	{
-	  [name={jjtThis.setName(name.image);} ] apply= [To()]
-	  		JavaScript()
-	  end=
-	  { jjtThis.setCoord(apply,end);}
-	}
-	/**/
-
-        /** Apply (Static/Dynamic)
-	 * The new version of the Apply statement: static or dynamic weaving
-	 * Advice each join point of the related select(s).
-	 * It can contain an unique label and a list of selects to be advised by the apply. If no select is inserted, the last select with no label will be used.
-	 * The body contains JavaScript, in which the actions can be declared
-	 **/
-
Apply::=( <IDENTIFIER_NAME> <COLON> )? <APPLY> ( <DYNAMIC> ( <PARALLEL> | <SEQUENCIAL> )? ( <BEFORE> | <AFTER> | <REPLACE> )? )? ( To )? JavaScript <END>
-
-/** To
-	 * list of selects that will be influenced by the apply
-	 **/
-
To::=<TO> FourthSetOp ( <COMMA> FourthSetOp )*
SimpleAction::=( Insert | Define | Perform | OutputAct ) EndStatement
-
-/** Action
-	 * Actions that can be used to influence the join points.
-	 * A join point variable can be used to specify the targeted join point where the action takes place 
-	 **/
-
Action::=( ( ( <IDENTIFIER_NAME> ) ) ( MemberExpressionPart )* <DOT> ) ( Insert | Define | Perform | OutputAct ) EndStatement
-
-/** Call
-	 * Action to invoke an aspect.
-	 * The aspect is called with the input arguments that requires and the call instance can have a reference variable to be used to recover information from the invoked aspect.
-	 **/
-
Call::=<CALL> ( LeftHandSideExpression <COLON> )? ( FilePathNoSTar )? <IDENTIFIER_NAME> ( Arguments )? EndStatement
-
-/** Run
-	 * Execution of an external tool.
-	 **/
-
Run::=<RUN> ( LeftHandSideExpression <COLON> )? ( getNoReservedIdentifier )? Arguments ( <GT> AssignmentExpression )? EndStatement
-
-/** Command
-	 * Execution of a command.
-	 **/
-
Cmd::=( <CMD> | <RUN> <CMD> ) ( LeftHandSideExpression <COLON> )? Arguments ( <GT> AssignmentExpression )? EndStatement
-
-/** OLD CALL **
-	void Call() #Call:
-	{Token aspVarName,aspName,ref, end;}
-	{
-	    [LOOKAHEAD( )
-	   					aspVarName=
-	   							{jjtThis.setAspVarName(aspVarName.image);}]
-   			  [LOOKAHEAD(2)FilePathNoSTar()]aspName=
-		{jjtThis.setAspName(aspName.image);}
-	    	[LOOKAHEAD(Arguments())Arguments()] end=
-	   { jjtThis.setCoord(aspName,end);}
-	}
-	/***/
-
-        /** Insert
-	 * The insertion of code is made by indicating a codedefinition's identifier with the required arguments or writing the desired code, with the possibility of using LARA-code to be defined into the target language, such as insert before %{�}%.
-	 * It is also needed to say if the code is inserted before, after or around the pointcut.
-	 **/
-
Insert::=<INSERT> ( ( ( <LT> <IDENTIFIER_NAME> <GT> )? ( <BEFORE> | <AFTER> | <AROUND> | <REPLACE> ) ( TemplateLiteral | ( ( Identifier ( Arguments )? ) ) ) ) | ( Arguments ) )
-
-/** Perform
-	 * Perform an action over the join point
-	 **/
-
Perform::=<EXEC> getNoReservedIdentifier ( Arguments )?
-
-/** Output
-	 * Similar to Insert, however it is used to output in runtime
-	 **/
-
OutputAct::=<OUTPUT_ACT> ( ( TemplateLiteral | ( ( Identifier ( Arguments )? ) ) ) | Arguments )
-
-/** Define
-	 *  Assign a value to a join point attribute
-	 **/
-
Define::=<DEFINE> ( noReservedIdentifier <ASSIGN> AssignmentExpression | Arguments )
-
-/** Condition
-	 *  Boolean expression that verifies if the apply can take place in a join point
-	 **/
-
Condition::=( <IDENTIFIER_NAME> <COLON> )? <CONDITION> ( <FOR> ( Identifier ( <COMMA> Identifier )* ) )? LogicalORExpression <END>
-
-/*******************************************************************************
- **********************   END OF LARA SYNTACTIC GRAMMAR    ********************* 
- *******************************************************************************/
-
-        /* The following part of the grammar is the EcmaScript grammar created by The Dojo Foundation (2004-2005), and it was partially updated to conform to the requirements of LARA grammar, such as the use of actions and join point variables.
-	**/
-
-        /* Section 11.1: Primary Expressions */
-
PrimaryExpression::="this"
|ObjectLiteral
|ArrayLiteral
|( "(" Expression ")" )
|Identifier
|Literal
-
-/* Section 7.8: Literals */
-
Literal::=( <DECIMAL_LITERAL> | <HEX_INTEGER_LITERAL> | <STRING_LITERAL> | <BOOLEAN_LITERAL> | <NULL_LITERAL> | <REGULAR_EXPRESSION_LITERAL> | <CODE_LITERAL> )
TemplateLiteral::=( <STRING_LITERAL> | <CODE_LITERAL> )
Identifier::=<IDENTIFIER_NAME>
LabelIdentifier::=( <LABEL_IDENTIFIER> | <IDENTIFIER_NAME> )
-
-/* Section 11.1.4: Array Initialiser */
-
ArrayLiteral::="[" ( ( ElisionFirst )? ( ElementList Elision "]" | ( ElementList )? "]" ) )
ElementList::=AssignmentExpression ( Elision AssignmentExpression )*
Elision::=( "," ) ( ( "," )+ )?
ElisionFirst::=( "," ) ( ( "," )+ )?
-
-/* Section 11.1.5: Object Initialiser */
-
ObjectLiteral::=<LBRACE> ( PropertyNameAndValueList )? <RBRACE>
PropertyNameAndValueList::=PropertyNameAndValue ( "," PropertyNameAndValue | "," )*
PropertyNameAndValue::=PropertyName ":" AssignmentExpression
PropertyName::=noReservedIdentifier
|Literal
-
-/* Section 11.2: Left-Hand-Side Expressions */
-
MemberExpression::=( ( FunctionExpression | PrimaryExpression ) ( MemberExpressionPart )* )
|AllocationExpression
MemberExpressionForIn::=( ( FunctionExpression | PrimaryExpression ) ( MemberExpressionPart )* )
AllocationExpression::=( "new" MemberExpression ( ( Arguments ( MemberExpressionPart )* )* ) )
MemberExpressionPart::=( ( "[" Expression "]" ) | ( <LBRACE> Expression <RBRACE> ) )
|( "." ( noReservedIdentifier ) )
CallExpression::=MemberExpression Arguments ( CallExpressionPart )*
CallExpressionForIn::=MemberExpressionForIn Arguments ( CallExpressionPart )*
CallExpressionPart::=Arguments
|( "[" Expression "]" )
|( "." noReservedIdentifier )
Arguments::="(" ( ( NamedArgumentList ) | ArgumentList )? ")"
NamedArgumentList::=NamedArgument ( <COMMA> NamedArgument )*
NamedArgument::=getNoReservedIdentifier <COLON> AssignmentExpression
ArgumentList::=AssignmentExpression ( "," AssignmentExpression )*
LeftHandSideExpression::=CallExpression
|MemberExpression
LeftHandSideExpressionForIn::=CallExpressionForIn
|MemberExpressionForIn
-
-/* Section 11.3 Postfix Expressions */
-
PostfixExpression::=LeftHandSideExpression ( PostfixOperator )?
PostfixOperator::=( "++" | "--" )
-
-/* Section 11.4 Unary Operators */
-
UnaryExpression::=( PostfixExpression | ( UnaryOperator UnaryExpression )+ )
UnaryOperator::=( "delete" | "void" | "typeof" | "++" | "--" | "+" | "-" | "~" | "!" )
-
-/* Section 11.5: Multiplicative Operators */
-
MultiplicativeExpression::=UnaryExpression ( MultiplicativeOperator UnaryExpression )*
MultiplicativeOperator::=( "*" | <SLASH> | "%" )
-
-/* Section 11.6: Additive Operators */
-
AdditiveExpression::=MultiplicativeExpression ( AdditiveOperator MultiplicativeExpression )*
AdditiveOperator::=( "+" | "-" )
-
-/* Section 11.7: Bitwise Shift Operators */
-
ShiftExpression::=AdditiveExpression ( ShiftOperator AdditiveExpression )*
ShiftOperator::=( "<<" | ">>" | ">>>" )
-
-/* Section 11.4: Relational Operators */
-
RelationalExpression::=ShiftExpression ( RelationalOperator ShiftExpression )*
RelationalOperator::=( "<" | ">" | "<=" | ">=" | "instanceof" | "in" )
RelationalExpressionNoIn::=ShiftExpression ( RelationalNoInOperator ShiftExpression )*
RelationalNoInOperator::=( "<" | ">" | "<=" | ">=" | "instanceof" )
-
-/* Section 11.9: Equality Operators */
-
EqualityExpression::=RelationalExpression ( EqualityOperator RelationalExpression )*
EqualityExpressionNoIn::=RelationalExpressionNoIn ( EqualityOperator RelationalExpressionNoIn )*
EqualityOperator::=( "==" | "!=" | "===" | "!==" | <MATCH> )
-
-/* Section 11.10: Binary Bitwise Operators */
-
BitwiseANDExpression::=EqualityExpression ( BitwiseANDOperator EqualityExpression )*
BitwiseANDExpressionNoIn::=EqualityExpressionNoIn ( BitwiseANDOperator EqualityExpressionNoIn )*
BitwiseANDOperator::="&"
BitwiseXORExpression::=BitwiseANDExpression ( BitwiseXOROperator BitwiseANDExpression )*
BitwiseXORExpressionNoIn::=BitwiseANDExpressionNoIn ( BitwiseXOROperator BitwiseANDExpressionNoIn )*
BitwiseXOROperator::="^"
BitwiseORExpression::=BitwiseXORExpression ( BitwiseOROperator BitwiseXORExpression )*
BitwiseORExpressionNoIn::=BitwiseXORExpressionNoIn ( BitwiseOROperator BitwiseXORExpressionNoIn )*
BitwiseOROperator::="|"
-
-/* Section 11.11: Binary Logical Operators */
-
LogicalANDExpression::=BitwiseORExpression ( LogicalANDOperator BitwiseORExpression )*
LogicalANDExpressionNoIn::=BitwiseORExpressionNoIn ( LogicalANDOperator BitwiseORExpressionNoIn )*
LogicalANDOperator::="&&"
LogicalORExpression::=LogicalANDExpression ( LogicalOROperator LogicalANDExpression )*
LogicalORExpressionNoIn::=LogicalANDExpressionNoIn ( LogicalOROperator LogicalANDExpressionNoIn )*
LogicalOROperator::="||"
-
-/* Section 11.12: Conditional Operator */
-
ConditionalExpression::=LogicalORExpression ( "?" AssignmentExpression ":" AssignmentExpression )?
ConditionalExpressionNoIn::=LogicalORExpressionNoIn ( "?" AssignmentExpression ":" AssignmentExpressionNoIn )?
-
-/* Section 11.13: Assignment Operators */
-
AssignmentExpression::=( LeftHandSideExpression AssignmentOperator AssignmentExpression | ConditionalExpression )
AssignmentExpressionNoIn::=( LeftHandSideExpression AssignmentOperator AssignmentExpressionNoIn | ConditionalExpressionNoIn )
AssignmentOperator::=( "=" | "*=" | <SLASHASSIGN> | "%=" | "+=" | "-=" | "<<=" | ">>=" | ">>>=" | "&=" | "^=" | "|=" )
-
-/* Section 11.14: Comma Operator */
-
Expression::=AssignmentExpression ( "," AssignmentExpression )*
ExpressionNoIn::=AssignmentExpressionNoIn ( "," AssignmentExpressionNoIn )*
-
-/* Section 12: STATEMENTS */
-
Statement::=BodiedStatement
|SingleStatement
SingleStatement::=( SimpleAction | Action | Call | Cmd | Run | VariableStatement | EmptyStatement | ExpressionStatement | LabelledStatement | ContinueStatement | BreakStatement | ImportStatement | ReturnStatement )
BodiedStatement::=( Block | IfStatement | IterationStatement | SwitchStatement | WithStatement | ThrowStatement | TryStatement )
-
-/* 12.1 Block Statement */
-
Block::=<LBRACE> ( StatementList )? <RBRACE>
StatementList::=( Statement )+
-
-/* Section 12.2: Variable statement */
-
VariableStatement::=<VAR> VariableDeclarationList EndStatement
VariableDeclarationList::=VariableDeclaration ( "," VariableDeclaration )*
VariableDeclarationListNoIn::=VariableDeclarationNoIn ( "," VariableDeclarationNoIn )*
VariableDeclaration::=Identifier ( Initialiser )?
VariableDeclarationNoIn::=Identifier ( InitialiserNoIn )?
Initialiser::="=" AssignmentExpression
InitialiserNoIn::="=" AssignmentExpressionNoIn
-
-/* Section 12.3: Empty Statement */
-
EmptyStatement::=";"
-
-/* Section 12.4: Expression Statement */
-
ExpressionStatement::=Expression EndStatement
-
-/* Section 12.5: The if Statement */
-
IfStatement::="if" "(" Expression ")" Statement ( "else" Statement )?
-
-/* Section 12.6: Iteration Statements */
-
IterationStatement::=DoStatement
|WhileStatement
|ForStatement
DoStatement::=<DO> Statement <WHILE> <LPAREN> Expression <RPAREN> EndStatement
WhileStatement::=<WHILE> <LPAREN> Expression <RPAREN> Statement
ForStatement::=<FOR> ( <EACH> <LPAREN> ( ( "var" VariableDeclarationNoIn <IN> Expression <RPAREN> Statement ) | ( LeftHandSideExpressionForIn <IN> Expression <RPAREN> Statement ) ) | <LPAREN> ( ( ( ExpressionNoIn )? ";" ( Expression )? ";" ( Expression )? ")" Statement ) | ( "var" VariableDeclarationList ";" ( Expression )? ";" ( Expression )? <RPAREN> Statement ) | ( "var" VariableDeclarationNoIn ( <IN> | ( <OF> ) ) Expression <RPAREN> Statement ) | ( LeftHandSideExpressionForIn ( <IN> | ( <OF> ) ) Expression <RPAREN> Statement ) ) )
-
-/* Section 12.7: The continue Statement */
-
ContinueStatement::="continue" ( LabelIdentifier )? EndStatement
-
-/* Section 12.8: The break Statement */
-
BreakStatement::="break" ( LabelIdentifier )? EndStatement
-
-/* Section 12.9 The return Statement */
-
ReturnStatement::="return" ( Expression )? EndStatement
-
-/* Section 12.10: The with Statement */
-
WithStatement::="with" "(" Expression ")" Statement
-
-/* 12.11 The switch Statement */
-
SwitchStatement::="switch" "(" Expression ")" CaseBlock
CaseBlock::=<LBRACE> ( CaseClauses )? ( <RBRACE> | DefaultClause ( CaseClauses )? <RBRACE> )
CaseClauses::=( CaseClause )+
CaseClause::=( ( "case" Expression ":" ) ) ( StatementList )?
DefaultClause::=( ( "default" ":" ) ) ( StatementList )?
-
-/* Section 12.12: Labelled Statements */
-
LabelledStatement::=Identifier ":" Statement
ThrowStatement::="throw" Expression EndStatement
TryStatement::="try" Block ( ( Finally | Catch ( Finally )? ) )
Catch::="catch" "(" Identifier ")" Block
Finally::="finally" Block
-
-/* Section 13: Function Definition */
-
FunctionDeclaration::="function" Identifier ( "(" ( FormalParameterList )? ")" ) FunctionBody
FunctionExpression::="function" ( Identifier )? ( "(" ( FormalParameterList )? ")" ) FunctionBody
FormalParameterList::=( Identifier ) ( "," ( Identifier ) )*
FunctionBody::=<LBRACE> ( SourceElements )? <RBRACE>
-
-/* Section 14: Program *
-
-	ASTProgram Program() #Program :
-	{}
-	{  
-		JavaScript()
-				
-		{ return jjtThis; }
-	}
-	/**/
-
JavaScript::=( SourceElements )?
SourceElements::=( SourceElement )+
SourceElement::=FunctionDeclaration
|Statement
-
-/*
-	 * Grammar for parsing JScript .NET contructs: ( import System; var contents :
-	 * String = reader.ReadToEnd(); ) Refer: src/hostenv_jsc.js
-	 */
-
ImportStatement::="import" Name ( "." "*" )? EndStatement
Name::=<IDENTIFIER_NAME> ( <DOT> <IDENTIFIER_NAME> )*
JScriptVarStatement::=<VAR> JScriptVarDeclarationList EndStatement
JScriptVarDeclarationList::=JScriptVarDeclaration ( <COMMA> JScriptVarDeclaration )*
JScriptVarDeclaration::=Identifier ":" <IDENTIFIER_NAME> ( Initialiser )?
EndStatement::=<SEMICOLON>
error_skipto::=java code
error_noSkip::=java code
- - diff --git a/LARAC/src/org/dojo/jsl/parser/ast/LARAEcmaScript.java b/LARAC/src/org/dojo/jsl/parser/ast/LARAEcmaScript.java deleted file mode 100644 index 486b6e925..000000000 --- a/LARAC/src/org/dojo/jsl/parser/ast/LARAEcmaScript.java +++ /dev/null @@ -1,14549 +0,0 @@ -/* LARAEcmaScript.java */ -/* Generated By:JJTree&JavaCC: Do not edit this line. LARAEcmaScript.java */ -package org.dojo.jsl.parser.ast; - -import java.io.*; -import java.util.*; -import java.io.File; -import java.io.FileReader; -import java.io.BufferedReader; -import java.io.ByteArrayInputStream; -import larac.utils.output.ErrorMsg; -import larac.objects.Enums.Types; -import larac.exceptions.ParseExceptionData; -import larac.exceptions.StopParseException; - -public class LARAEcmaScript extends LARAParserBase/*@bgen(jjtree)*/implements LARAEcmaScriptTreeConstants, LARAEcmaScriptConstants {/*@bgen(jjtree)*/ - protected JJTLARAEcmaScriptState jjtree = new JJTLARAEcmaScriptState();private static final int MAX_EXCEPTION_TOKEN_SIZE = 6; - private static final int MAXIMUM_SYNTAX_EXCEPTIONS = 5; - - public File inputAspectFile = null; - public FileReader inputAspectFr = null; - public BufferedReader inputAspectBr = null; - public List exceptions = new ArrayList() ; - private int exprBraceCount = 0; - - public ASTExpressionStatement parseExpression(String expression) throws ParseException{ - return ParseExpression(); - } - - public ASTStart parse() throws ParseException{ - this.exceptions = new ArrayList(); - - return this.Start(); - } - - /* Old Code */ - @Deprecated - public static ASTStart parseFile(String fileName){ - return parseFile(new File(fileName)); - } - @Deprecated - public static ASTStart parseFile(File laraFile){ - ASTStart start = null; - File inputAspectFile = laraFile; - FileReader inputAspectFr = null; - BufferedReader inputAspectBr = null; - try{ - inputAspectFr = new FileReader(inputAspectFile); - inputAspectBr = new BufferedReader(inputAspectFr); - LARAEcmaScript aspectParser = new LARAEcmaScript(inputAspectBr); - start = aspectParser.Start(); - } - catch (Exception e) - { - try { - if(inputAspectFr != null) - inputAspectFr.close(); - if(inputAspectBr != null) - inputAspectBr.close(); - } catch (IOException e1) { - throw new RuntimeException(e1); - } - } - - try { - if(inputAspectFr != null) - inputAspectFr.close(); - if(inputAspectBr != null) - inputAspectBr.close(); - - } catch (IOException e1) { - throw new RuntimeException(e1); - } - return start; - } - -/** Function that returns the join point identifier, which can be any identifier - or one of the following reserved words - **/ - final public Token getNoReservedIdentifier() throws ParseException {Token t; - switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { - case IDENTIFIER_NAME:{ - t = jj_consume_token(IDENTIFIER_NAME); - break; - } - case CALL:{ - t = jj_consume_token(CALL); - break; - } - case BEGIN:{ - t = jj_consume_token(BEGIN); - break; - } - case END:{ - t = jj_consume_token(END); - break; - } - case FUNCTION:{ - t = jj_consume_token(FUNCTION); - break; - } - case FUNCTION_GEN:{ - t = jj_consume_token(FUNCTION_GEN); - break; - } - case VAR:{ - t = jj_consume_token(VAR); - break; - } - case RETURN:{ - t = jj_consume_token(RETURN); - break; - } - case YIELD:{ - t = jj_consume_token(YIELD); - break; - } - case IF:{ - t = jj_consume_token(IF); - break; - } - case ELSE:{ - t = jj_consume_token(ELSE); - break; - } - case TO:{ - t = jj_consume_token(TO); - break; - } - case IN:{ - t = jj_consume_token(IN); - break; - } - case SWITCH:{ - t = jj_consume_token(SWITCH); - break; - } - case CASE:{ - t = jj_consume_token(CASE); - break; - } - case INPUT:{ - t = jj_consume_token(INPUT); - break; - } - case OUTPUT:{ - t = jj_consume_token(OUTPUT); - break; - } - case CONDITION:{ - t = jj_consume_token(CONDITION); - break; - } - case _DEFAULT:{ - t = jj_consume_token(_DEFAULT); - break; - } - case CLASS:{ - t = jj_consume_token(CLASS); - break; - } - case INTANCE_OF:{ - t = jj_consume_token(INTANCE_OF); - break; - } - case BEFORE:{ - t = jj_consume_token(BEFORE); - break; - } - case AFTER:{ - t = jj_consume_token(AFTER); - break; - } - case AROUND:{ - t = jj_consume_token(AROUND); - break; - } - case FOR:{ - t = jj_consume_token(FOR); - break; - } - case WHILE:{ - t = jj_consume_token(WHILE); - break; - } - case DO:{ - t = jj_consume_token(DO); - break; - } - case INCLUDE:{ - t = jj_consume_token(INCLUDE); - break; - } - case REPLACE:{ - t = jj_consume_token(REPLACE); - break; - } - case CHECK:{ - t = jj_consume_token(CHECK); - break; - } - case APPLY:{ - t = jj_consume_token(APPLY); - break; - } - default: - jj_la1[0] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } -{if ("" != null) return t;} - throw new Error("Missing return statement in function"); -} - - final public void noReservedIdentifier() throws ParseException {/*@bgen(jjtree) Identifier */ - ASTIdentifier jjtn000 = new ASTIdentifier(JJTIDENTIFIER); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1));Token t; - try { - switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { - case IDENTIFIER_NAME:{ - t = jj_consume_token(IDENTIFIER_NAME); - break; - } - case CALL:{ - t = jj_consume_token(CALL); - break; - } - case BEGIN:{ - t = jj_consume_token(BEGIN); - break; - } - case END:{ - t = jj_consume_token(END); - break; - } - case FUNCTION:{ - t = jj_consume_token(FUNCTION); - break; - } - case FUNCTION_GEN:{ - t = jj_consume_token(FUNCTION_GEN); - break; - } - case VAR:{ - t = jj_consume_token(VAR); - break; - } - case RETURN:{ - t = jj_consume_token(RETURN); - break; - } - case YIELD:{ - t = jj_consume_token(YIELD); - break; - } - case IF:{ - t = jj_consume_token(IF); - break; - } - case ELSE:{ - t = jj_consume_token(ELSE); - break; - } - case TO:{ - t = jj_consume_token(TO); - break; - } - case IN:{ - t = jj_consume_token(IN); - break; - } - case SWITCH:{ - t = jj_consume_token(SWITCH); - break; - } - case CASE:{ - t = jj_consume_token(CASE); - break; - } - case INPUT:{ - t = jj_consume_token(INPUT); - break; - } - case OUTPUT:{ - t = jj_consume_token(OUTPUT); - break; - } - case CONDITION:{ - t = jj_consume_token(CONDITION); - break; - } - case _DEFAULT:{ - t = jj_consume_token(_DEFAULT); - break; - } - case CLASS:{ - t = jj_consume_token(CLASS); - break; - } - case INTANCE_OF:{ - t = jj_consume_token(INTANCE_OF); - break; - } - case BEFORE:{ - t = jj_consume_token(BEFORE); - break; - } - case AFTER:{ - t = jj_consume_token(AFTER); - break; - } - case AROUND:{ - t = jj_consume_token(AROUND); - break; - } - case FOR:{ - t = jj_consume_token(FOR); - break; - } - case WHILE:{ - t = jj_consume_token(WHILE); - break; - } - case DO:{ - t = jj_consume_token(DO); - break; - } - case INCLUDE:{ - t = jj_consume_token(INCLUDE); - break; - } - case DELETE:{ - t = jj_consume_token(DELETE); - break; - } - case REPLACE:{ - t = jj_consume_token(REPLACE); - break; - } - case CHECK:{ - t = jj_consume_token(CHECK); - break; - } - case APPLY:{ - t = jj_consume_token(APPLY); - break; - } - default: - jj_la1[1] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } -jjtree.closeNodeScope(jjtn000, true); - jjtc000 = false; - jjtn000.jjtSetLastToken(getToken(0)); -jjtn000.setName(t.image);jjtn000.jjtSetValue(t.image); - //jjtThis.setCoord(t,t); - - } finally { -if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -} - -/***************************************** - * ECMA SYNTACTIC GRAMMARS STARTS HERE * - *****************************************/ - -/******************************************************************************* - ************************ LARA SYNTACTIC GRAMMAR ************************* - *******************************************************************************/ - - /** - * A LARA file can contain zero or more includes and imports, followed by definitions of aspectdefs, - * codedefs, functions and global variables - **/ - final public ASTStart Start() throws ParseException {/*@bgen(jjtree) Start */ - ASTStart jjtn000 = new ASTStart(JJTSTART); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1)); - try { - label_1: - while (true) { - switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { - case IMPORT:{ - ; - break; - } - default: - jj_la1[2] = jj_gen; - break label_1; - } - Import(); - } - label_2: - while (true) { - switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { - case ASPECTDEF: - case CODEDEF: - case FUNCTION: - case FUNCTION_GEN: - case NEW: - case THIS: - case VAR: - case LBRACE: - case LPAREN: - case LBRACKET: - case DECIMAL_LITERAL: - case HEX_INTEGER_LITERAL: - case NULL_LITERAL: - case BOOLEAN_LITERAL: - case STRING_LITERAL: - case CODE_LITERAL: - case IDENTIFIER_NAME: - case REGULAR_EXPRESSION_LITERAL:{ - ; - break; - } - default: - jj_la1[3] = jj_gen; - break label_2; - } - switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { - case ASPECTDEF:{ - AspectDef(); - break; - } - case CODEDEF:{ - CodeDef(); - break; - } - case FUNCTION: - case FUNCTION_GEN: - case NEW: - case THIS: - case VAR: - case LBRACE: - case LPAREN: - case LBRACKET: - case DECIMAL_LITERAL: - case HEX_INTEGER_LITERAL: - case NULL_LITERAL: - case BOOLEAN_LITERAL: - case STRING_LITERAL: - case CODE_LITERAL: - case IDENTIFIER_NAME: - case REGULAR_EXPRESSION_LITERAL:{ - Declaration(); - break; - } - default: - jj_la1[4] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - } - jj_consume_token(0); -jjtree.closeNodeScope(jjtn000, true); - jjtc000 = false; - jjtn000.jjtSetLastToken(getToken(0)); -{if ("" != null) return jjtn000;} - } catch (Throwable jjte000) { -if (jjtc000) { - jjtree.clearNodeScope(jjtn000); - jjtc000 = false; - } else { - jjtree.popNode(); - } - if (jjte000 instanceof RuntimeException) { - {if (true) throw (RuntimeException)jjte000;} - } - if (jjte000 instanceof ParseException) { - {if (true) throw (ParseException)jjte000;} - } - {if (true) throw (Error)jjte000;} - } finally { -if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - jjtn000.jjtSetLastToken(getToken(0)); - } - } - throw new Error("Missing return statement in function"); -} - - final public void Declaration() throws ParseException { - if (jj_2_1(2147483647)) { - GeneratorFunctionDeclaration(); - } else if (jj_2_2(2147483647)) { - FunctionDeclaration(); - } else { - switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { - case VAR:{ - VariableStatement(); - break; - } - case FUNCTION: - case FUNCTION_GEN: - case NEW: - case THIS: - case LBRACE: - case LPAREN: - case LBRACKET: - case DECIMAL_LITERAL: - case HEX_INTEGER_LITERAL: - case NULL_LITERAL: - case BOOLEAN_LITERAL: - case STRING_LITERAL: - case CODE_LITERAL: - case IDENTIFIER_NAME: - case REGULAR_EXPRESSION_LITERAL:{ -ASTAssignmentExpression jjtn001 = new ASTAssignmentExpression(JJTASSIGNMENTEXPRESSION); - boolean jjtc001 = true; - jjtree.openNodeScope(jjtn001); - jjtn001.jjtSetFirstToken(getToken(1)); - try { - LeftHandSideExpression(); - AssignmentOperator(); - AssignmentExpression(); - switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { - case SEMICOLON:{ - jj_consume_token(SEMICOLON); - break; - } - default: - jj_la1[5] = jj_gen; - ; - } - } catch (Throwable jjte001) { -if (jjtc001) { - jjtree.clearNodeScope(jjtn001); - jjtc001 = false; - } else { - jjtree.popNode(); - } - if (jjte001 instanceof RuntimeException) { - {if (true) throw (RuntimeException)jjte001;} - } - if (jjte001 instanceof ParseException) { - {if (true) throw (ParseException)jjte001;} - } - {if (true) throw (Error)jjte001;} - } finally { -if (jjtc001) { - jjtree.closeNodeScope(jjtn001, true); - jjtn001.jjtSetLastToken(getToken(0)); - } - } - break; - } - default: - jj_la1[6] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - } -} - -/** - * The path to a file that is not in the same path of the invoked LARA file. With one import it is - * possible to import one or every file within a package - **/ - final public void Import() throws ParseException {/*@bgen(jjtree) Import */ - ASTImport jjtn000 = new ASTImport(JJTIMPORT); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1));Token t; Token begin; Token end; - try { - begin = jj_consume_token(IMPORT); - t = FilePath(); - end = EndStatement(); -jjtree.closeNodeScope(jjtn000, true); - jjtc000 = false; - jjtn000.jjtSetLastToken(getToken(0)); -jjtn000.jjtSetValue(t.image); - } catch (Throwable jjte000) { -if (jjtc000) { - jjtree.clearNodeScope(jjtn000); - jjtc000 = false; - } else { - jjtree.popNode(); - } - if (jjte000 instanceof RuntimeException) { - {if (true) throw (RuntimeException)jjte000;} - } - if (jjte000 instanceof ParseException) { - {if (true) throw (ParseException)jjte000;} - } - {if (true) throw (Error)jjte000;} - } finally { -if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -} - -/** FilePath - * gets the path to a file or all the files in the package - **/ - final public Token FilePath() throws ParseException {Token t; - label_3: - while (true) { - if (jj_2_3(2)) { - ; - } else { - break label_3; - } - Identifier(); - jj_consume_token(DOT); - } - switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { - case IDENTIFIER_NAME:{ - t = jj_consume_token(IDENTIFIER_NAME); - break; - } - case STAR:{ - t = jj_consume_token(STAR); - break; - } - default: - jj_la1[7] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } -{if ("" != null) return t;} - throw new Error("Missing return statement in function"); -} - -/** FilePathNoSTar - * gets the path to a file in a package - **/ - final public void FilePathNoSTar() throws ParseException {/*@bgen(jjtree) FilePath */ - ASTFilePath jjtn000 = new ASTFilePath(JJTFILEPATH); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1)); - try { - label_4: - while (true) { - Identifier(); - jj_consume_token(DOT); - if (jj_2_4(2)) { - ; - } else { - break label_4; - } - } - } catch (Throwable jjte000) { -if (jjtc000) { - jjtree.clearNodeScope(jjtn000); - jjtc000 = false; - } else { - jjtree.popNode(); - } - if (jjte000 instanceof RuntimeException) { - {if (true) throw (RuntimeException)jjte000;} - } - if (jjte000 instanceof ParseException) { - {if (true) throw (ParseException)jjte000;} - } - {if (true) throw (Error)jjte000;} - } finally { -if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -} - -/** - * Code Definition A parcel of native code or LARA-Code to be used by the insert/output action. To define the target - * language, one has to define the type of the codedef, such as: codedef, this means that the code to be inserted - * is written in C language. A code definition needs an identifier and its body is code that can contain a tag such - * as "
" to insert information on the code such as: join point property or a variable value. To use those tags, - * the codedef must have input arguments to refer those to specific values. - **/ - final public void CodeDef() throws ParseException {/*@bgen(jjtree) CodeDef */ - ASTCodeDef jjtn000 = new ASTCodeDef(JJTCODEDEF); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1));Token name, code, language, begin, end; - try { -jjtn000.setLanguage("native"); - begin = jj_consume_token(CODEDEF); - switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { - case LT:{ - jj_consume_token(LT); - language = jj_consume_token(IDENTIFIER_NAME); - jj_consume_token(GT); -jjtn000.setLanguage(language.image); - break; - } - default: - jj_la1[8] = jj_gen; - ; - } - name = jj_consume_token(IDENTIFIER_NAME); -jjtn000.setName(name.image); -ASTFormalParameterList jjtn001 = new ASTFormalParameterList(JJTFORMALPARAMETERLIST); - boolean jjtc001 = true; - jjtree.openNodeScope(jjtn001); - jjtn001.jjtSetFirstToken(getToken(1)); - try { - switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { - case LPAREN:{ - jj_consume_token(LPAREN); - switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { - case IDENTIFIER_NAME:{ - FormalParameterList(); - break; - } - default: - jj_la1[9] = jj_gen; - ; - } - jj_consume_token(RPAREN); - break; - } - default: - jj_la1[10] = jj_gen; - ; - } - } catch (Throwable jjte001) { -if (jjtc001) { - jjtree.clearNodeScope(jjtn001); - jjtc001 = false; - } else { - jjtree.popNode(); - } - if (jjte001 instanceof RuntimeException) { - {if (true) throw (RuntimeException)jjte001;} - } - if (jjte001 instanceof ParseException) { - {if (true) throw (ParseException)jjte001;} - } - {if (true) throw (Error)jjte001;} - } finally { -if (jjtc001) { - jjtree.closeNodeScope(jjtn001, jjtree.nodeArity() > 0); - jjtn001.jjtSetLastToken(getToken(0)); - } - } - code = jj_consume_token(CODE_LITERAL); -String simpleCode = code.image.substring(2,code.image.length()-2); - jjtn000.setCode(simpleCode); - end = jj_consume_token(END); - } catch (Throwable jjte000) { -if (jjtc000) { - jjtree.clearNodeScope(jjtn000); - jjtc000 = false; - } else { - jjtree.popNode(); - } - if (jjte000 instanceof RuntimeException) { - {if (true) throw (RuntimeException)jjte000;} - } - if (jjte000 instanceof ParseException) { - {if (true) throw (ParseException)jjte000;} - } - {if (true) throw (Error)jjte000;} - } finally { -if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -} - -/** - * Input arguments The arguments to be defined when a "aspect-call" action is stated. They can be normal variables - * or variables referent to a specific join point. The normal variables can have a default value - **/ - final public void Input() throws ParseException {/*@bgen(jjtree) Input */ - ASTInput jjtn000 = new ASTInput(JJTINPUT); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1));Token begin, end; - try { - begin = jj_consume_token(INPUT); - VariableDeclarationList(); - switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { - case SEMICOLON:{ - jj_consume_token(SEMICOLON); - break; - } - default: - jj_la1[11] = jj_gen; - ; - } - end = jj_consume_token(END); - } catch (Throwable jjte000) { -if (jjtc000) { - jjtree.clearNodeScope(jjtn000); - jjtc000 = false; - } else { - jjtree.popNode(); - } - if (jjte000 instanceof RuntimeException) { - {if (true) throw (RuntimeException)jjte000;} - } - if (jjte000 instanceof ParseException) { - {if (true) throw (ParseException)jjte000;} - } - {if (true) throw (Error)jjte000;} - } finally { -if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -} - -/** - * Output arguments List of normal variables or variables referent to a specific join point. The normal variables - * can have a default value - **/ - final public void Output() throws ParseException {/*@bgen(jjtree) Output */ - ASTOutput jjtn000 = new ASTOutput(JJTOUTPUT); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1));Token begin, end; - try { - begin = jj_consume_token(OUTPUT); - VariableDeclarationList(); - switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { - case SEMICOLON:{ - jj_consume_token(SEMICOLON); - break; - } - default: - jj_la1[12] = jj_gen; - ; - } - end = jj_consume_token(END); - } catch (Throwable jjte000) { -if (jjtc000) { - jjtree.clearNodeScope(jjtn000); - jjtc000 = false; - } else { - jjtree.popNode(); - } - if (jjte000 instanceof RuntimeException) { - {if (true) throw (RuntimeException)jjte000;} - } - if (jjte000 instanceof ParseException) { - {if (true) throw (ParseException)jjte000;} - } - {if (true) throw (Error)jjte000;} - } finally { -if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -} - -/** - * Static List of static variables and functions, which can be accessed statically in the aspect. The variables - * values are shared between all aspect instances - **/ - final public void Static() throws ParseException {/*@bgen(jjtree) Static */ - ASTStatic jjtn000 = new ASTStatic(JJTSTATIC); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1)); - try { - jj_consume_token(STATICDECL); - label_5: - while (true) { - switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { - case FUNCTION: - case FUNCTION_GEN: - case VAR:{ - ; - break; - } - default: - jj_la1[13] = jj_gen; - break label_5; - } - switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { - case VAR:{ - VariableStatement(); - break; - } - case FUNCTION_GEN:{ - GeneratorFunctionDeclaration(); - break; - } - case FUNCTION:{ - FunctionDeclaration(); - break; - } - default: - jj_la1[14] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - } - jj_consume_token(END); - } catch (Throwable jjte000) { -if (jjtc000) { - jjtree.clearNodeScope(jjtn000); - jjtc000 = false; - } else { - jjtree.popNode(); - } - if (jjte000 instanceof RuntimeException) { - {if (true) throw (RuntimeException)jjte000;} - } - if (jjte000 instanceof ParseException) { - {if (true) throw (ParseException)jjte000;} - } - {if (true) throw (Error)jjte000;} - } finally { -if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -} - -/** Initialize - * Similar to a constructor. A block of JavaScript code to initialize variables, inter alia - **/ - final public void Initialize() throws ParseException {/*@bgen(jjtree) Initialize */ - ASTInitialize jjtn000 = new ASTInitialize(JJTINITIALIZE); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1)); - try { - jj_consume_token(INITIALIZE); - JavaScript(); - jj_consume_token(END); - } catch (Throwable jjte000) { -if (jjtc000) { - jjtree.clearNodeScope(jjtn000); - jjtc000 = false; - } else { - jjtree.popNode(); - } - if (jjte000 instanceof RuntimeException) { - {if (true) throw (RuntimeException)jjte000;} - } - if (jjte000 instanceof ParseException) { - {if (true) throw (ParseException)jjte000;} - } - {if (true) throw (Error)jjte000;} - } finally { -if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -} - -/** Finalize - * Similar to a destructor. A block of JavaScript code to finalize output variables, inter alia - **/ - final public void Finalize() throws ParseException {/*@bgen(jjtree) Finalize */ - ASTFinalize jjtn000 = new ASTFinalize(JJTFINALIZE); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1)); - try { - jj_consume_token(FINALIZE); - JavaScript(); - jj_consume_token(END); - } catch (Throwable jjte000) { -if (jjtc000) { - jjtree.clearNodeScope(jjtn000); - jjtc000 = false; - } else { - jjtree.popNode(); - } - if (jjte000 instanceof RuntimeException) { - {if (true) throw (RuntimeException)jjte000;} - } - if (jjte000 instanceof ParseException) { - {if (true) throw (ParseException)jjte000;} - } - {if (true) throw (Error)jjte000;} - } finally { -if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -} - -/** Check - * Set of conditions to verify input arguments and other important stats that specify if the aspect can be executed - **/ - final public void Check() throws ParseException {/*@bgen(jjtree) Check */ - ASTCheck jjtn000 = new ASTCheck(JJTCHECK); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1)); - try { - jj_consume_token(CHECK); - LogicalORExpression(); - switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { - case SEMICOLON:{ - EndStatement(); - label_6: - while (true) { - switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { - case DELETE: - case FUNCTION: - case FUNCTION_GEN: - case NEW: - case THIS: - case TYPEOF: - case VOID: - case LBRACE: - case LPAREN: - case LBRACKET: - case PLUS: - case MINUS: - case INCR: - case DECR: - case BANG: - case TILDE: - case DECIMAL_LITERAL: - case HEX_INTEGER_LITERAL: - case NULL_LITERAL: - case BOOLEAN_LITERAL: - case STRING_LITERAL: - case CODE_LITERAL: - case IDENTIFIER_NAME: - case REGULAR_EXPRESSION_LITERAL:{ - ; - break; - } - default: - jj_la1[15] = jj_gen; - break label_6; - } - LogicalORExpression(); - EndStatement(); - } - break; - } - default: - jj_la1[16] = jj_gen; - ; - } - jj_consume_token(END); - } catch (Throwable jjte000) { -if (jjtc000) { - jjtree.clearNodeScope(jjtn000); - jjtc000 = false; - } else { - jjtree.popNode(); - } - if (jjte000 instanceof RuntimeException) { - {if (true) throw (RuntimeException)jjte000;} - } - if (jjte000 instanceof ParseException) { - {if (true) throw (ParseException)jjte000;} - } - {if (true) throw (Error)jjte000;} - } finally { -if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -} - -/** Aspect Definition - * The aspect definition can contain outputs and inputs variables, a check to verify those variables, an initializer and a finalizer to deal with information to be handler before and after the aspect, respectively. - * The body of the aspect consists of selects, applies and conditions to apply the aspect in the target program, and afters, befores, function and variable declaration to assist the apply and condition section. - */ - final public void AspectDef() throws ParseException {/*@bgen(jjtree) AspectDef */ - ASTAspectDef jjtn000 = new ASTAspectDef(JJTASPECTDEF); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1));Token aspName, begin, end; - try { - begin = jj_consume_token(ASPECTDEF); - aspName = jj_consume_token(IDENTIFIER_NAME); - label_7: - while (true) { - switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { - case INPUT: - case OUTPUT: - case STATICDECL:{ - ; - break; - } - default: - jj_la1[17] = jj_gen; - break label_7; - } - switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { - case INPUT:{ - Input(); - break; - } - case OUTPUT:{ - Output(); - break; - } - case STATICDECL:{ - Static(); - break; - } - default: - jj_la1[18] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - } - switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { - case INITIALIZE:{ - Initialize(); - break; - } - default: - jj_la1[19] = jj_gen; - ; - } - switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { - case CHECK:{ - Check(); - break; - } - default: - jj_la1[20] = jj_gen; - ; - } - label_8: - while (true) { - switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { - case SELECT: - case APPLY: - case CALL: - case RUN: - case CMD: - case CONDITION: - case INSERT: - case EXEC: - case OUTPUT_ACT: - case BEFORE: - case AFTER: - case REPLACE: - case DEFINE: - case BREAK: - case CONTINUE: - case DELETE: - case FOR: - case FUNCTION: - case FUNCTION_GEN: - case IF: - case NEW: - case RETURN: - case YIELD: - case THIS: - case TYPEOF: - case VAR: - case VOID: - case WHILE: - case WITH: - case DO: - case IMPORT: - case SWITCH: - case THROW: - case TRY: - case LBRACE: - case LPAREN: - case LBRACKET: - case SEMICOLON: - case PLUS: - case MINUS: - case INCR: - case DECR: - case BANG: - case TILDE: - case DECIMAL_LITERAL: - case HEX_INTEGER_LITERAL: - case NULL_LITERAL: - case BOOLEAN_LITERAL: - case STRING_LITERAL: - case CODE_LITERAL: - case IDENTIFIER_NAME: - case REGULAR_EXPRESSION_LITERAL:{ - ; - break; - } - default: - jj_la1[21] = jj_gen; - break label_8; - } - if (jj_2_5(2147483647)) { - Select(); - } else if (jj_2_6(2147483647)) { - Apply(); - } else if (jj_2_7(2147483647)) { - AroundApply(); - } else if (jj_2_8(2147483647)) { - Condition(); - } else { - switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { - case CALL: - case RUN: - case CMD: - case INSERT: - case EXEC: - case OUTPUT_ACT: - case REPLACE: - case DEFINE: - case BREAK: - case CONTINUE: - case DELETE: - case FOR: - case FUNCTION: - case FUNCTION_GEN: - case IF: - case NEW: - case RETURN: - case YIELD: - case THIS: - case TYPEOF: - case VAR: - case VOID: - case WHILE: - case WITH: - case DO: - case IMPORT: - case SWITCH: - case THROW: - case TRY: - case LBRACE: - case LPAREN: - case LBRACKET: - case SEMICOLON: - case PLUS: - case MINUS: - case INCR: - case DECR: - case BANG: - case TILDE: - case DECIMAL_LITERAL: - case HEX_INTEGER_LITERAL: - case NULL_LITERAL: - case BOOLEAN_LITERAL: - case STRING_LITERAL: - case CODE_LITERAL: - case IDENTIFIER_NAME: - case REGULAR_EXPRESSION_LITERAL:{ - SourceElement(); - break; - } - default: - jj_la1[22] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - } - } - switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { - case FINALIZE:{ - Finalize(); - break; - } - default: - jj_la1[23] = jj_gen; - ; - } - end = jj_consume_token(END); -jjtree.closeNodeScope(jjtn000, true); - jjtc000 = false; - jjtn000.jjtSetLastToken(getToken(0)); -jjtn000.setName(aspName.image); - } catch (Throwable jjte000) { -if (jjtc000) { - jjtree.clearNodeScope(jjtn000); - jjtc000 = false; - } else { - jjtree.popNode(); - } - if (jjte000 instanceof RuntimeException) { - {if (true) throw (RuntimeException)jjte000;} - } - if (jjte000 instanceof ParseException) { - {if (true) throw (ParseException)jjte000;} - } - {if (true) throw (Error)jjte000;} - } finally { -if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -} - -/** Select - * Pointcut expression to specify which join points are intended to influence. - * It can contain an unique label, so it can be advised, and a pointcut expression - */ - final public void Select() throws ParseException {/*@bgen(jjtree) Select */ - ASTSelect jjtn000 = new ASTSelect(JJTSELECT); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1));Token name, begin, end; - try { - switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { - case IDENTIFIER_NAME:{ - name = jj_consume_token(IDENTIFIER_NAME); -jjtn000.setName(name.image); - jj_consume_token(COLON); - break; - } - default: - jj_la1[24] = jj_gen; - ; - } - begin = jj_consume_token(SELECT); - if (jj_2_9(2147483647)) { - Pointcut(); - } else if (jj_2_10(2)) { - FourthSetOp(); - } else { - jj_consume_token(-1); - throw new ParseException(); - } - end = jj_consume_token(END); - } catch (Throwable jjte000) { -if (jjtc000) { - jjtree.clearNodeScope(jjtn000); - jjtc000 = false; - } else { - jjtree.popNode(); - } - if (jjte000 instanceof RuntimeException) { - {if (true) throw (RuntimeException)jjte000;} - } - if (jjte000 instanceof ParseException) { - {if (true) throw (ParseException)jjte000;} - } - {if (true) throw (Error)jjte000;} - } finally { -if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -} - - final public void FourthSetOp() throws ParseException {/*@bgen(jjtree) #Join(> 1) */ - ASTJoin jjtn000 = new ASTJoin(JJTJOIN); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1));Token joinType; - try { - ThirdSetOp(); - if (jj_2_11(2)) { - joinType = jj_consume_token(PLUS); - FourthSetOp(); -jjtn000.jjtSetValue(joinType.image); - } else { - ; - } - } catch (Throwable jjte000) { -if (jjtc000) { - jjtree.clearNodeScope(jjtn000); - jjtc000 = false; - } else { - jjtree.popNode(); - } - if (jjte000 instanceof RuntimeException) { - {if (true) throw (RuntimeException)jjte000;} - } - if (jjte000 instanceof ParseException) { - {if (true) throw (ParseException)jjte000;} - } - {if (true) throw (Error)jjte000;} - } finally { -if (jjtc000) { - jjtree.closeNodeScope(jjtn000, jjtree.nodeArity() > 1); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -} - - final public void ThirdSetOp() throws ParseException {/*@bgen(jjtree) #Join(> 1) */ - ASTJoin jjtn000 = new ASTJoin(JJTJOIN); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1));Token joinType; - try { - FirstSetOp(); - switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { - case BIT_AND: - case NATURAL_JOIN:{ - switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { - case NATURAL_JOIN:{ - joinType = jj_consume_token(NATURAL_JOIN); - break; - } - case BIT_AND:{ - joinType = jj_consume_token(BIT_AND); - break; - } - default: - jj_la1[25] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - ThirdSetOp(); -jjtn000.jjtSetValue(joinType.image); - break; - } - default: - jj_la1[26] = jj_gen; - ; - } - } catch (Throwable jjte000) { -if (jjtc000) { - jjtree.clearNodeScope(jjtn000); - jjtc000 = false; - } else { - jjtree.popNode(); - } - if (jjte000 instanceof RuntimeException) { - {if (true) throw (RuntimeException)jjte000;} - } - if (jjte000 instanceof ParseException) { - {if (true) throw (ParseException)jjte000;} - } - {if (true) throw (Error)jjte000;} - } finally { -if (jjtc000) { - jjtree.closeNodeScope(jjtn000, jjtree.nodeArity() > 1); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -} - - final public void FirstSetOp() throws ParseException { - switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { - case IDENTIFIER_NAME:{ - Identifier(); - break; - } - case LPAREN:{ - jj_consume_token(LPAREN); - FourthSetOp(); - jj_consume_token(RPAREN); - break; - } - default: - jj_la1[27] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } -} - -/** Pointcut - * It can contain an identifier for the join point, a join point identifier and a possible property expression. - * Each join point can have a child, the join point down to its hierarchy - */ - final public void Pointcut() throws ParseException {/*@bgen(jjtree) Pointcut */ - ASTPointcut jjtn000 = new ASTPointcut(JJTPOINTCUT); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1));Token joinPoint,reference;String referenceStr; - try { - switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { - case LPAREN:{ - jj_consume_token(LPAREN); - //e.g.: ($l1=loop){...} - - reference = jj_consume_token(IDENTIFIER_NAME); - jj_consume_token(ASSIGN); - joinPoint = getNoReservedIdentifier(); -referenceStr = reference.image; - jj_consume_token(RPAREN); - break; - } - default: - jj_la1[28] = jj_gen; - if (jj_2_12(2147483647)) { - //e.g.: $l1=loop{...} - reference = jj_consume_token(IDENTIFIER_NAME); - jj_consume_token(ASSIGN); - joinPoint = getNoReservedIdentifier(); -referenceStr = reference.image; - } else { - switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { - case INCLUDE: - case INPUT: - case OUTPUT: - case APPLY: - case TO: - case CALL: - case CONDITION: - case BEGIN: - case BEFORE: - case AFTER: - case AROUND: - case REPLACE: - case CHECK: - case END: - case ELSE: - case FOR: - case FUNCTION: - case FUNCTION_GEN: - case IF: - case IN: - case RETURN: - case YIELD: - case VAR: - case WHILE: - case CASE: - case CLASS: - case _DEFAULT: - case DO: - case SWITCH: - case INTANCE_OF: - case IDENTIFIER_NAME:{ - joinPoint = getNoReservedIdentifier(); -referenceStr = "$"+joinPoint.image; - break; - } - default: - jj_la1[29] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - } - } -jjtn000.jjtSetValue(joinPoint.image); - jjtn000.setReference(referenceStr); - switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { - case LBRACE:{ - PointcutFilters(); - break; - } - default: - jj_la1[30] = jj_gen; - ; - } - switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { - case DOT:{ - jj_consume_token(DOT); - Pointcut(); - break; - } - default: - jj_la1[31] = jj_gen; - ; - } - } catch (Throwable jjte000) { -if (jjtc000) { - jjtree.clearNodeScope(jjtn000); - jjtc000 = false; - } else { - jjtree.popNode(); - } - if (jjte000 instanceof RuntimeException) { - {if (true) throw (RuntimeException)jjte000;} - } - if (jjte000 instanceof ParseException) { - {if (true) throw (ParseException)jjte000;} - } - {if (true) throw (Error)jjte000;} - } finally { -if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -} - -/** Pointcut properties - * The properties of a pointcut can be declared in three different ways: - - it can be any property (*) - - a set of properties that will be mapped to the default attribute - - a property expression - */ - final public void PointcutFilters() throws ParseException { - jj_consume_token(LBRACE); - switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { - case STAR:{ - jj_consume_token(STAR); - break; - } - case DELETE: - case FUNCTION: - case FUNCTION_GEN: - case NEW: - case THIS: - case TYPEOF: - case VOID: - case LBRACE: - case LPAREN: - case LBRACKET: - case PLUS: - case MINUS: - case INCR: - case DECR: - case BANG: - case TILDE: - case DECIMAL_LITERAL: - case HEX_INTEGER_LITERAL: - case NULL_LITERAL: - case BOOLEAN_LITERAL: - case STRING_LITERAL: - case CODE_LITERAL: - case IDENTIFIER_NAME: - case REGULAR_EXPRESSION_LITERAL:{ -ASTPointcutFilters jjtn002 = new ASTPointcutFilters(JJTPOINTCUTFILTERS); - boolean jjtc002 = true; - jjtree.openNodeScope(jjtn002); - jjtn002.jjtSetFirstToken(getToken(1)); - try { - if (jj_2_13(2147483647)) { - OrFiltersExpr(); -jjtree.closeNodeScope(jjtn002, true); - jjtc002 = false; - jjtn002.jjtSetLastToken(getToken(0)); -jjtn002.setFullSpecified(true); - } else { - switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { - case DELETE: - case FUNCTION: - case FUNCTION_GEN: - case NEW: - case THIS: - case TYPEOF: - case VOID: - case LBRACE: - case LPAREN: - case LBRACKET: - case PLUS: - case MINUS: - case INCR: - case DECR: - case BANG: - case TILDE: - case DECIMAL_LITERAL: - case HEX_INTEGER_LITERAL: - case NULL_LITERAL: - case BOOLEAN_LITERAL: - case STRING_LITERAL: - case CODE_LITERAL: - case IDENTIFIER_NAME: - case REGULAR_EXPRESSION_LITERAL:{ -ASTOrFiltersExpr jjtn001 = new ASTOrFiltersExpr(JJTORFILTERSEXPR); - boolean jjtc001 = true; - jjtree.openNodeScope(jjtn001); - jjtn001.jjtSetFirstToken(getToken(1)); - try { - ConditionalExpression(); - label_9: - while (true) { - switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { - case COMMA:{ - ; - break; - } - default: - jj_la1[32] = jj_gen; - break label_9; - } - jj_consume_token(COMMA); - ConditionalExpression(); - } - } catch (Throwable jjte001) { -if (jjtc001) { - jjtree.clearNodeScope(jjtn001); - jjtc001 = false; - } else { - jjtree.popNode(); - } - if (jjte001 instanceof RuntimeException) { - {if (true) throw (RuntimeException)jjte001;} - } - if (jjte001 instanceof ParseException) { - {if (true) throw (ParseException)jjte001;} - } - {if (true) throw (Error)jjte001;} - } finally { -if (jjtc001) { - jjtree.closeNodeScope(jjtn001, jjtree.nodeArity() > 1); - jjtn001.jjtSetLastToken(getToken(0)); - } - } -jjtree.closeNodeScope(jjtn002, true); - jjtc002 = false; - jjtn002.jjtSetLastToken(getToken(0)); -jjtn002.setFullSpecified(false); - break; - } - default: - jj_la1[33] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - } - } catch (Throwable jjte002) { -if (jjtc002) { - jjtree.clearNodeScope(jjtn002); - jjtc002 = false; - } else { - jjtree.popNode(); - } - if (jjte002 instanceof RuntimeException) { - {if (true) throw (RuntimeException)jjte002;} - } - if (jjte002 instanceof ParseException) { - {if (true) throw (ParseException)jjte002;} - } - {if (true) throw (Error)jjte002;} - } finally { -if (jjtc002) { - jjtree.closeNodeScope(jjtn002, true); - jjtn002.jjtSetLastToken(getToken(0)); - } - } - break; - } - default: - jj_la1[34] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - jj_consume_token(RBRACE); -} - -/** "OR" Property Expr - * In the pointcut properties declaration, the comma is used as an OR operator (similar to ||) - **/ - final public void OrFiltersExpr() throws ParseException { -ASTOrFiltersExpr jjtn001 = new ASTOrFiltersExpr(JJTORFILTERSEXPR); - boolean jjtc001 = true; - jjtree.openNodeScope(jjtn001); - jjtn001.jjtSetFirstToken(getToken(1)); - try { - ANDFiltersExpr(); - label_10: - while (true) { - switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { - case COMMA:{ - ; - break; - } - default: - jj_la1[35] = jj_gen; - break label_10; - } - jj_consume_token(COMMA); - ANDFiltersExpr(); - } - } catch (Throwable jjte001) { -if (jjtc001) { - jjtree.clearNodeScope(jjtn001); - jjtc001 = false; - } else { - jjtree.popNode(); - } - if (jjte001 instanceof RuntimeException) { - {if (true) throw (RuntimeException)jjte001;} - } - if (jjte001 instanceof ParseException) { - {if (true) throw (ParseException)jjte001;} - } - {if (true) throw (Error)jjte001;} - } finally { -if (jjtc001) { - jjtree.closeNodeScope(jjtn001, jjtree.nodeArity() > 1); - jjtn001.jjtSetLastToken(getToken(0)); - } - } -} - -/** "AND" Property Expression - * To combine properties such as an AND operation, the properties are declared inside brackets, converting the comma (which is the OR operator) into an AND. - */ - final public void ANDFiltersExpr() throws ParseException { - switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { - case IDENTIFIER_NAME:{ - Filter(); - break; - } - case LPAREN:{ - jj_consume_token(LPAREN); -ASTANDFiltersExpr jjtn001 = new ASTANDFiltersExpr(JJTANDFILTERSEXPR); - boolean jjtc001 = true; - jjtree.openNodeScope(jjtn001); - jjtn001.jjtSetFirstToken(getToken(1)); - try { - Filter(); - label_11: - while (true) { - switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { - case COMMA:{ - ; - break; - } - default: - jj_la1[36] = jj_gen; - break label_11; - } - jj_consume_token(COMMA); - Filter(); - } - } catch (Throwable jjte001) { -if (jjtc001) { - jjtree.clearNodeScope(jjtn001); - jjtc001 = false; - } else { - jjtree.popNode(); - } - if (jjte001 instanceof RuntimeException) { - {if (true) throw (RuntimeException)jjte001;} - } - if (jjte001 instanceof ParseException) { - {if (true) throw (ParseException)jjte001;} - } - {if (true) throw (Error)jjte001;} - } finally { -if (jjtc001) { - jjtree.closeNodeScope(jjtn001, jjtree.nodeArity() > 1); - jjtn001.jjtSetLastToken(getToken(0)); - } - } - jj_consume_token(RPAREN); - break; - } - default: - jj_la1[37] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } -} - -/** Property - * The property is defined by comparing a join point attribute to a value - **/ - final public void Filter() throws ParseException {/*@bgen(jjtree) Filter */ - ASTFilter jjtn000 = new ASTFilter(JJTFILTER); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1));Token prop,op; - try { - prop = jj_consume_token(IDENTIFIER_NAME); - switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { - case EQ: - case NE: - case MATCH: - case SEQ: - case SNEQ:{ - EqualityOperator(); - break; - } - case IN: - case LT: - case GT: - case LE: - case GE: - case INTANCE_OF:{ - RelationalOperator(); - break; - } - default: - jj_la1[38] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - ConditionalExpression(); -jjtree.closeNodeScope(jjtn000, true); - jjtc000 = false; - jjtn000.jjtSetLastToken(getToken(0)); -jjtn000.setProp(prop.image); - } catch (Throwable jjte000) { -if (jjtc000) { - jjtree.clearNodeScope(jjtn000); - jjtc000 = false; - } else { - jjtree.popNode(); - } - if (jjte000 instanceof RuntimeException) { - {if (true) throw (RuntimeException)jjte000;} - } - if (jjte000 instanceof ParseException) { - {if (true) throw (ParseException)jjte000;} - } - {if (true) throw (Error)jjte000;} - } finally { -if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -} - -/** Around - * A Statement to occur around an apply - * It contains a list of applies that this statement refers to. The body of this statement is JavaScript, and can be used to prepare information for the applies. - **/ - final public void AroundApply() throws ParseException {/*@bgen(jjtree) AroundApply */ - ASTAroundApply jjtn000 = new ASTAroundApply(JJTAROUNDAPPLY); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1));Token name,when, end; - String label = ""; - try { - switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { - case IDENTIFIER_NAME:{ - name = jj_consume_token(IDENTIFIER_NAME); - jj_consume_token(COLON); -label = name.image; - break; - } - default: - jj_la1[39] = jj_gen; - ; - } - switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { - case BEFORE:{ - when = jj_consume_token(BEFORE); - break; - } - case AFTER:{ - when = jj_consume_token(AFTER); - break; - } - default: - jj_la1[40] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { - case IDENTIFIER_NAME:{ -ASTApplies jjtn001 = new ASTApplies(JJTAPPLIES); - boolean jjtc001 = true; - jjtree.openNodeScope(jjtn001); - jjtn001.jjtSetFirstToken(getToken(1)); - try { - Identifier(); - label_12: - while (true) { - if (jj_2_14(2)) { - ; - } else { - break label_12; - } - jj_consume_token(COMMA); - Identifier(); - } - } catch (Throwable jjte001) { -if (jjtc001) { - jjtree.clearNodeScope(jjtn001); - jjtc001 = false; - } else { - jjtree.popNode(); - } - if (jjte001 instanceof RuntimeException) { - {if (true) throw (RuntimeException)jjte001;} - } - if (jjte001 instanceof ParseException) { - {if (true) throw (ParseException)jjte001;} - } - {if (true) throw (Error)jjte001;} - } finally { -if (jjtc001) { - jjtree.closeNodeScope(jjtn001, true); - jjtn001.jjtSetLastToken(getToken(0)); - } - } - break; - } - default: - jj_la1[41] = jj_gen; - ; - } - jj_consume_token(DO); - JavaScript(); -jjtn000.setName(label); - jjtn000.setWhen(when.image); - end = jj_consume_token(END); - } catch (Throwable jjte000) { -if (jjtc000) { - jjtree.clearNodeScope(jjtn000); - jjtc000 = false; - } else { - jjtree.popNode(); - } - if (jjte000 instanceof RuntimeException) { - {if (true) throw (RuntimeException)jjte000;} - } - if (jjte000 instanceof ParseException) { - {if (true) throw (ParseException)jjte000;} - } - {if (true) throw (Error)jjte000;} - } finally { -if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -} - -/** Apply - * Old Version of apply, only static weaving - * Advice each join point of the related select(s). - * It can contain an unique label and a list of selects to be advised by the apply. If no select is inserted, the last select with no label will be used. - * The body contains JavaScript, in which the actions can be declared - ** - void Apply() #Apply: - {Token name, apply, end;} - { - [name={jjtThis.setName(name.image);} ] apply= [To()] - JavaScript() - end= - { jjtThis.setCoord(apply,end);} - } - /**/ - - /** Apply (Static/Dynamic) - * The new version of the Apply statement: static or dynamic weaving - * Advice each join point of the related select(s). - * It can contain an unique label and a list of selects to be advised by the apply. If no select is inserted, the last select with no label will be used. - * The body contains JavaScript, in which the actions can be declared - **/ - final public void Apply() throws ParseException {/*@bgen(jjtree) Apply */ - ASTApply jjtn000 = new ASTApply(JJTAPPLY); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1));Token name, apply, end; - try { - switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { - case IDENTIFIER_NAME:{ - name = jj_consume_token(IDENTIFIER_NAME); -jjtn000.setName(name.image); - jj_consume_token(COLON); - break; - } - default: - jj_la1[42] = jj_gen; - ; - } - apply = jj_consume_token(APPLY); - switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { - case DYNAMIC:{ - jj_consume_token(DYNAMIC); -jjtn000.setDynamic(true); - switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { - case SEQUENCIAL: - case PARALLEL:{ - switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { - case PARALLEL:{ - jj_consume_token(PARALLEL); -jjtn000.setConcurrent(true); - break; - } - case SEQUENCIAL:{ - jj_consume_token(SEQUENCIAL); -jjtn000.setConcurrent(false); - break; - } - default: - jj_la1[43] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - break; - } - default: - jj_la1[44] = jj_gen; - ; - } - switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { - case BEFORE: - case AFTER:{ - switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { - case BEFORE:{ - jj_consume_token(BEFORE); -jjtn000.setTrigger("before"); - break; - } - case AFTER:{ - jj_consume_token(AFTER); -jjtn000.setTrigger("after"); - break; - } - default: - jj_la1[45] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - break; - } - default: - jj_la1[46] = jj_gen; - ; - } - break; - } - default: - jj_la1[47] = jj_gen; - ; - } - switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { - case TO:{ - To(); - break; - } - default: - jj_la1[48] = jj_gen; - ; - } - JavaScript(); - end = jj_consume_token(END); - } catch (Throwable jjte000) { -if (jjtc000) { - jjtree.clearNodeScope(jjtn000); - jjtc000 = false; - } else { - jjtree.popNode(); - } - if (jjte000 instanceof RuntimeException) { - {if (true) throw (RuntimeException)jjte000;} - } - if (jjte000 instanceof ParseException) { - {if (true) throw (ParseException)jjte000;} - } - {if (true) throw (Error)jjte000;} - } finally { -if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -} - -/** To - * list of selects that will be influenced by the apply - **/ - final public void To() throws ParseException {/*@bgen(jjtree) To */ - ASTTo jjtn000 = new ASTTo(JJTTO); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1)); - try { - jj_consume_token(TO); - FourthSetOp(); - label_13: - while (true) { - if (jj_2_15(2147483647)) { - ; - } else { - break label_13; - } - jj_consume_token(COMMA); - FourthSetOp(); - } - } catch (Throwable jjte000) { -if (jjtc000) { - jjtree.clearNodeScope(jjtn000); - jjtc000 = false; - } else { - jjtree.popNode(); - } - if (jjte000 instanceof RuntimeException) { - {if (true) throw (RuntimeException)jjte000;} - } - if (jjte000 instanceof ParseException) { - {if (true) throw (ParseException)jjte000;} - } - {if (true) throw (Error)jjte000;} - } finally { -if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -} - - final public void SimpleAction() throws ParseException {/*@bgen(jjtree) Action */ - ASTAction jjtn000 = new ASTAction(JJTACTION); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1));Token t; - try { - switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { - case INSERT: - case REPLACE:{ - Insert(); - break; - } - case DEFINE:{ - Define(); - break; - } - case EXEC:{ - Perform(); - break; - } - case OUTPUT_ACT:{ - OutputAct(); - break; - } - default: - jj_la1[49] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - EndStatement(); - } catch (Throwable jjte000) { -if (jjtc000) { - jjtree.clearNodeScope(jjtn000); - jjtc000 = false; - } else { - jjtree.popNode(); - } - if (jjte000 instanceof RuntimeException) { - {if (true) throw (RuntimeException)jjte000;} - } - if (jjte000 instanceof ParseException) { - {if (true) throw (ParseException)jjte000;} - } - {if (true) throw (Error)jjte000;} - } finally { -if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -} - -/** Action - * Actions that can be used to influence the join points. - * A join point variable can be used to specify the targeted join point where the action takes place - **/ - final public void Action() throws ParseException {Token t; -ASTAction jjtn003 = new ASTAction(JJTACTION); - boolean jjtc003 = true; - jjtree.openNodeScope(jjtn003); - jjtn003.jjtSetFirstToken(getToken(1)); - try { -ASTCompositeReference jjtn002 = new ASTCompositeReference(JJTCOMPOSITEREFERENCE); - boolean jjtc002 = true; - jjtree.openNodeScope(jjtn002); - jjtn002.jjtSetFirstToken(getToken(1)); - try { -ASTIdentifier jjtn001 = new ASTIdentifier(JJTIDENTIFIER); - boolean jjtc001 = true; - jjtree.openNodeScope(jjtn001); - jjtn001.jjtSetFirstToken(getToken(1)); - try { - t = jj_consume_token(IDENTIFIER_NAME); -jjtree.closeNodeScope(jjtn001, true); - jjtc001 = false; - jjtn001.jjtSetLastToken(getToken(0)); -jjtn001.setName(t.image);jjtn001.jjtSetValue(t.image); - //jjtThis.setCoord(t,t); - - } finally { -if (jjtc001) { - jjtree.closeNodeScope(jjtn001, true); - jjtn001.jjtSetLastToken(getToken(0)); - } - } - label_14: - while (true) { - if (jj_2_16(2147483647)) { - ; - } else { - break label_14; - } - MemberExpressionPart(); - } - jj_consume_token(DOT); - } catch (Throwable jjte002) { -if (jjtc002) { - jjtree.clearNodeScope(jjtn002); - jjtc002 = false; - } else { - jjtree.popNode(); - } - if (jjte002 instanceof RuntimeException) { - {if (true) throw (RuntimeException)jjte002;} - } - if (jjte002 instanceof ParseException) { - {if (true) throw (ParseException)jjte002;} - } - {if (true) throw (Error)jjte002;} - } finally { -if (jjtc002) { - jjtree.closeNodeScope(jjtn002, jjtree.nodeArity() > 1); - jjtn002.jjtSetLastToken(getToken(0)); - } - } - switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { - case INSERT: - case REPLACE:{ - Insert(); - break; - } - case DEFINE:{ - Define(); - break; - } - case EXEC:{ - Perform(); - break; - } - case OUTPUT_ACT:{ - OutputAct(); - break; - } - default: - jj_la1[50] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - } catch (Throwable jjte003) { -if (jjtc003) { - jjtree.clearNodeScope(jjtn003); - jjtc003 = false; - } else { - jjtree.popNode(); - } - if (jjte003 instanceof RuntimeException) { - {if (true) throw (RuntimeException)jjte003;} - } - if (jjte003 instanceof ParseException) { - {if (true) throw (ParseException)jjte003;} - } - {if (true) throw (Error)jjte003;} - } finally { -if (jjtc003) { - jjtree.closeNodeScope(jjtn003, true); - jjtn003.jjtSetLastToken(getToken(0)); - } - } - EndStatement(); -} - - final public void ActionOnAssign() throws ParseException {/*@bgen(jjtree) Action */ - ASTAction jjtn000 = new ASTAction(JJTACTION); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1));Token t; - try { - switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { - case IDENTIFIER_NAME:{ -ASTCompositeReference jjtn002 = new ASTCompositeReference(JJTCOMPOSITEREFERENCE); - boolean jjtc002 = true; - jjtree.openNodeScope(jjtn002); - jjtn002.jjtSetFirstToken(getToken(1)); - try { -ASTIdentifier jjtn001 = new ASTIdentifier(JJTIDENTIFIER); - boolean jjtc001 = true; - jjtree.openNodeScope(jjtn001); - jjtn001.jjtSetFirstToken(getToken(1)); - try { - t = jj_consume_token(IDENTIFIER_NAME); -jjtree.closeNodeScope(jjtn001, true); - jjtc001 = false; - jjtn001.jjtSetLastToken(getToken(0)); -jjtn001.setName(t.image);jjtn001.jjtSetValue(t.image); - //jjtThis.setCoord(t,t); - - } finally { -if (jjtc001) { - jjtree.closeNodeScope(jjtn001, true); - jjtn001.jjtSetLastToken(getToken(0)); - } - } - label_15: - while (true) { - if (jj_2_17(2147483647)) { - ; - } else { - break label_15; - } - MemberExpressionPart(); - } - jj_consume_token(DOT); - } catch (Throwable jjte002) { -if (jjtc002) { - jjtree.clearNodeScope(jjtn002); - jjtc002 = false; - } else { - jjtree.popNode(); - } - if (jjte002 instanceof RuntimeException) { - {if (true) throw (RuntimeException)jjte002;} - } - if (jjte002 instanceof ParseException) { - {if (true) throw (ParseException)jjte002;} - } - {if (true) throw (Error)jjte002;} - } finally { -if (jjtc002) { - jjtree.closeNodeScope(jjtn002, jjtree.nodeArity() > 1); - jjtn002.jjtSetLastToken(getToken(0)); - } - } - break; - } - default: - jj_la1[51] = jj_gen; - ; - } - ExecOnAssign(); - } catch (Throwable jjte000) { -if (jjtc000) { - jjtree.clearNodeScope(jjtn000); - jjtc000 = false; - } else { - jjtree.popNode(); - } - if (jjte000 instanceof RuntimeException) { - {if (true) throw (RuntimeException)jjte000;} - } - if (jjte000 instanceof ParseException) { - {if (true) throw (ParseException)jjte000;} - } - {if (true) throw (Error)jjte000;} - } finally { -if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -} - -/** Call - * Action to invoke an aspect. - * The aspect is called with the input arguments that requires and the call instance can have a reference variable to be used to recover information from the invoked aspect. - **/ - final public void Call() throws ParseException {/*@bgen(jjtree) Call */ - ASTCall jjtn000 = new ASTCall(JJTCALL); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1));Token aspVarName,aspName,ref, end; - try { - switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { - case CALL:{ - jj_consume_token(CALL); - if (jj_2_18(2147483647)) { - LeftHandSideExpression(); - jj_consume_token(COLON); - } else { - ; - } - break; - } - case VAR:{ - jj_consume_token(VAR); - Identifier(); - jj_consume_token(ASSIGN); - jj_consume_token(CALL); - break; - } - case FUNCTION: - case FUNCTION_GEN: - case NEW: - case THIS: - case LBRACE: - case LPAREN: - case LBRACKET: - case DECIMAL_LITERAL: - case HEX_INTEGER_LITERAL: - case NULL_LITERAL: - case BOOLEAN_LITERAL: - case STRING_LITERAL: - case CODE_LITERAL: - case IDENTIFIER_NAME: - case REGULAR_EXPRESSION_LITERAL:{ - LeftHandSideExpression(); - jj_consume_token(ASSIGN); - jj_consume_token(CALL); - break; - } - default: - jj_la1[52] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - if (jj_2_19(2)) { - FilePathNoSTar(); - } else { - ; - } - aspName = jj_consume_token(IDENTIFIER_NAME); - switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { - case LPAREN:{ - Arguments(); - break; - } - default: - jj_la1[53] = jj_gen; - ; - } - end = EndStatement(); -jjtree.closeNodeScope(jjtn000, true); - jjtc000 = false; - jjtn000.jjtSetLastToken(getToken(0)); -jjtn000.setAspName(aspName.image); - // jjtThis.setCoord(aspName,end); - - } catch (Throwable jjte000) { -if (jjtc000) { - jjtree.clearNodeScope(jjtn000); - jjtc000 = false; - } else { - jjtree.popNode(); - } - if (jjte000 instanceof RuntimeException) { - {if (true) throw (RuntimeException)jjte000;} - } - if (jjte000 instanceof ParseException) { - {if (true) throw (ParseException)jjte000;} - } - {if (true) throw (Error)jjte000;} - } finally { -if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -} - -/** Run - * Execution of an external tool. - **/ - final public void Run() throws ParseException {/*@bgen(jjtree) Run */ - ASTRun jjtn000 = new ASTRun(JJTRUN); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1));Token run, toolName, end; - try { - run = jj_consume_token(RUN); - if (jj_2_20(2147483647)) { - LeftHandSideExpression(); - jj_consume_token(COLON); - } else { - ; - } - switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { - case INCLUDE: - case INPUT: - case OUTPUT: - case APPLY: - case TO: - case CALL: - case CONDITION: - case BEGIN: - case BEFORE: - case AFTER: - case AROUND: - case REPLACE: - case CHECK: - case END: - case ELSE: - case FOR: - case FUNCTION: - case FUNCTION_GEN: - case IF: - case IN: - case RETURN: - case YIELD: - case VAR: - case WHILE: - case CASE: - case CLASS: - case _DEFAULT: - case DO: - case SWITCH: - case INTANCE_OF: - case IDENTIFIER_NAME:{ - toolName = getNoReservedIdentifier(); -jjtn000.setToolName(toolName.image); - break; - } - default: - jj_la1[54] = jj_gen; - ; - } - Arguments(); - switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { - case GT:{ - jj_consume_token(GT); - AssignmentExpression(); - break; - } - default: - jj_la1[55] = jj_gen; - ; - } - end = EndStatement(); - } catch (Throwable jjte000) { -if (jjtc000) { - jjtree.clearNodeScope(jjtn000); - jjtc000 = false; - } else { - jjtree.popNode(); - } - if (jjte000 instanceof RuntimeException) { - {if (true) throw (RuntimeException)jjte000;} - } - if (jjte000 instanceof ParseException) { - {if (true) throw (ParseException)jjte000;} - } - {if (true) throw (Error)jjte000;} - } finally { -if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -} - -/** Command - * Execution of a command. - **/ - final public void Cmd() throws ParseException {/*@bgen(jjtree) Cmd */ - ASTCmd jjtn000 = new ASTCmd(JJTCMD); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1));Token cmd, toolName, end; - try { - switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { - case CMD:{ - cmd = jj_consume_token(CMD); - break; - } - case RUN:{ - cmd = jj_consume_token(RUN); - jj_consume_token(CMD); -jjtn000.setNewVersion(true); - break; - } - default: - jj_la1[56] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - if (jj_2_21(2147483647)) { - LeftHandSideExpression(); - jj_consume_token(COLON); - } else { - ; - } - Arguments(); - switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { - case GT:{ - jj_consume_token(GT); - AssignmentExpression(); - break; - } - default: - jj_la1[57] = jj_gen; - ; - } - end = EndStatement(); - } catch (Throwable jjte000) { -if (jjtc000) { - jjtree.clearNodeScope(jjtn000); - jjtc000 = false; - } else { - jjtree.popNode(); - } - if (jjte000 instanceof RuntimeException) { - {if (true) throw (RuntimeException)jjte000;} - } - if (jjte000 instanceof ParseException) { - {if (true) throw (ParseException)jjte000;} - } - {if (true) throw (Error)jjte000;} - } finally { -if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -} - -/** OLD CALL ** - void Call() #Call: - {Token aspVarName,aspName,ref, end;} - { - [LOOKAHEAD( ) - aspVarName= - {jjtThis.setAspVarName(aspVarName.image);}] - [LOOKAHEAD(2)FilePathNoSTar()]aspName= - {jjtThis.setAspName(aspName.image);} - [LOOKAHEAD(Arguments())Arguments()] end= - // { jjtThis.setCoord(aspName,end);} - } - /***/ - - /** Insert - * The insertion of code is made by indicating a codedefinition's identifier with the required arguments or writing the desired code, with the possibility of using LARA-code to be defined into the target language, such as insert before %{�}%. - * It is also needed to say if the code is inserted before, after or around the pointcut. - **/ - final public void Insert() throws ParseException {/*@bgen(jjtree) Insert */ - ASTInsert jjtn000 = new ASTInsert(JJTINSERT); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1));Token when,language, begin, end; - try { -jjtn000.setLanguage("native"); - switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { - case INSERT:{ - begin = jj_consume_token(INSERT); - switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { - case BEFORE: - case AFTER: - case AROUND: - case REPLACE: - case LT:{ - switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { - case LT:{ - jj_consume_token(LT); - language = jj_consume_token(IDENTIFIER_NAME); - jj_consume_token(GT); -jjtn000.setLanguage(language.image); - break; - } - default: - jj_la1[58] = jj_gen; - ; - } - switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { - case BEFORE:{ - when = jj_consume_token(BEFORE); - break; - } - case AFTER:{ - when = jj_consume_token(AFTER); - break; - } - case AROUND:{ - when = jj_consume_token(AROUND); - break; - } - case REPLACE:{ - when = jj_consume_token(REPLACE); - break; - } - default: - jj_la1[59] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - ConditionalExpression(); -jjtree.closeNodeScope(jjtn000, true); - jjtc000 = false; - jjtn000.jjtSetLastToken(getToken(0)); -jjtn000.setWhen(when.image); - break; - } - case LPAREN:{ - Arguments(); - break; - } - default: - jj_la1[60] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - break; - } - case REPLACE:{ - begin = jj_consume_token(REPLACE); - ConditionalExpression(); -jjtree.closeNodeScope(jjtn000, true); - jjtc000 = false; - jjtn000.jjtSetLastToken(getToken(0)); -jjtn000.setWhen(begin.image); - break; - } - default: - jj_la1[61] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - } catch (Throwable jjte000) { -if (jjtc000) { - jjtree.clearNodeScope(jjtn000); - jjtc000 = false; - } else { - jjtree.popNode(); - } - if (jjte000 instanceof RuntimeException) { - {if (true) throw (RuntimeException)jjte000;} - } - if (jjte000 instanceof ParseException) { - {if (true) throw (ParseException)jjte000;} - } - {if (true) throw (Error)jjte000;} - } finally { -if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -} - -/** Perform - * Perform an action over the join point - **/ - final public void Perform() throws ParseException {/*@bgen(jjtree) Perform */ - ASTPerform jjtn000 = new ASTPerform(JJTPERFORM); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1));Token action, begin, end, t; - try { - begin = jj_consume_token(EXEC); - if (jj_2_22(2147483647)) { - t = jj_consume_token(IDENTIFIER_NAME); - jj_consume_token(COLON); -jjtn000.setVariable(t.image); - } else { - ; - } - action = getNoReservedIdentifier(); -jjtn000.setAction(action.image); - switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { - case LPAREN: - case STRING_LITERAL: - case CODE_LITERAL:{ - switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { - case STRING_LITERAL: - case CODE_LITERAL:{ -ASTFunctionCallParameters jjtn001 = new ASTFunctionCallParameters(JJTFUNCTIONCALLPARAMETERS); - boolean jjtc001 = true; - jjtree.openNodeScope(jjtn001); - jjtn001.jjtSetFirstToken(getToken(1)); - try { - TemplateLiteral(); - } catch (Throwable jjte001) { -if (jjtc001) { - jjtree.clearNodeScope(jjtn001); - jjtc001 = false; - } else { - jjtree.popNode(); - } - if (jjte001 instanceof RuntimeException) { - {if (true) throw (RuntimeException)jjte001;} - } - if (jjte001 instanceof ParseException) { - {if (true) throw (ParseException)jjte001;} - } - {if (true) throw (Error)jjte001;} - } finally { -if (jjtc001) { - jjtree.closeNodeScope(jjtn001, true); - jjtn001.jjtSetLastToken(getToken(0)); - } - } - break; - } - case LPAREN:{ - Arguments(); - break; - } - default: - jj_la1[62] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - break; - } - default: - jj_la1[63] = jj_gen; - ; - } - } catch (Throwable jjte000) { -if (jjtc000) { - jjtree.clearNodeScope(jjtn000); - jjtc000 = false; - } else { - jjtree.popNode(); - } - if (jjte000 instanceof RuntimeException) { - {if (true) throw (RuntimeException)jjte000;} - } - if (jjte000 instanceof ParseException) { - {if (true) throw (ParseException)jjte000;} - } - {if (true) throw (Error)jjte000;} - } finally { -if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -} - -/** Perform - * Perform an action over the join point - **/ - final public void ExecOnAssign() throws ParseException {/*@bgen(jjtree) Perform */ - ASTPerform jjtn000 = new ASTPerform(JJTPERFORM); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1));Token action, begin, end, t; - try { - jj_consume_token(EXEC); - //[LOOKAHEAD(< IDENTIFIER_NAME > < COLON > ) t=< IDENTIFIER_NAME > < COLON >{jjtThis.setVariable(t.image);} ] - action = getNoReservedIdentifier(); -jjtn000.setAction(action.image); - switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { - case STRING_LITERAL: - case CODE_LITERAL:{ -ASTFunctionCallParameters jjtn001 = new ASTFunctionCallParameters(JJTFUNCTIONCALLPARAMETERS); - boolean jjtc001 = true; - jjtree.openNodeScope(jjtn001); - jjtn001.jjtSetFirstToken(getToken(1)); - try { - TemplateLiteral(); - } catch (Throwable jjte001) { -if (jjtc001) { - jjtree.clearNodeScope(jjtn001); - jjtc001 = false; - } else { - jjtree.popNode(); - } - if (jjte001 instanceof RuntimeException) { - {if (true) throw (RuntimeException)jjte001;} - } - if (jjte001 instanceof ParseException) { - {if (true) throw (ParseException)jjte001;} - } - {if (true) throw (Error)jjte001;} - } finally { -if (jjtc001) { - jjtree.closeNodeScope(jjtn001, true); - jjtn001.jjtSetLastToken(getToken(0)); - } - } - break; - } - case LPAREN:{ - Arguments(); - break; - } - default: - jj_la1[64] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - } catch (Throwable jjte000) { -if (jjtc000) { - jjtree.clearNodeScope(jjtn000); - jjtc000 = false; - } else { - jjtree.popNode(); - } - if (jjte000 instanceof RuntimeException) { - {if (true) throw (RuntimeException)jjte000;} - } - if (jjte000 instanceof ParseException) { - {if (true) throw (ParseException)jjte000;} - } - {if (true) throw (Error)jjte000;} - } finally { -if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -} - -// void CodeLiteralOnlyArgument() #FunctionCallParameters: {} -// { -// TemplateLiteral() -// } - - /** Output - * Similar to Insert, however it is used to output in runtime - **/ - final public void OutputAct() throws ParseException {/*@bgen(jjtree) OutputAct */ - ASTOutputAct jjtn000 = new ASTOutputAct(JJTOUTPUTACT); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1));Token begin; - try { - begin = jj_consume_token(OUTPUT_ACT); - switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { - case STRING_LITERAL: - case CODE_LITERAL: - case IDENTIFIER_NAME:{ - switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { - case STRING_LITERAL: - case CODE_LITERAL:{ - TemplateLiteral(); - break; - } - case IDENTIFIER_NAME:{ -ASTCompositeReference jjtn001 = new ASTCompositeReference(JJTCOMPOSITEREFERENCE); - boolean jjtc001 = true; - jjtree.openNodeScope(jjtn001); - jjtn001.jjtSetFirstToken(getToken(1)); - try { - Identifier(); - if (jj_2_23(2147483647)) { - Arguments(); - } else { - ; - } - } catch (Throwable jjte001) { -if (jjtc001) { - jjtree.clearNodeScope(jjtn001); - jjtc001 = false; - } else { - jjtree.popNode(); - } - if (jjte001 instanceof RuntimeException) { - {if (true) throw (RuntimeException)jjte001;} - } - if (jjte001 instanceof ParseException) { - {if (true) throw (ParseException)jjte001;} - } - {if (true) throw (Error)jjte001;} - } finally { -if (jjtc001) { - jjtree.closeNodeScope(jjtn001, jjtree.nodeArity() > 1); - jjtn001.jjtSetLastToken(getToken(0)); - } - } - break; - } - default: - jj_la1[65] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - break; - } - case LPAREN:{ - Arguments(); - break; - } - default: - jj_la1[66] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - } catch (Throwable jjte000) { -if (jjtc000) { - jjtree.clearNodeScope(jjtn000); - jjtc000 = false; - } else { - jjtree.popNode(); - } - if (jjte000 instanceof RuntimeException) { - {if (true) throw (RuntimeException)jjte000;} - } - if (jjte000 instanceof ParseException) { - {if (true) throw (ParseException)jjte000;} - } - {if (true) throw (Error)jjte000;} - } finally { -if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -} - -/** Define - * Assign a value to a join point attribute - **/ - final public void Define() throws ParseException {/*@bgen(jjtree) Define */ - ASTDefine jjtn000 = new ASTDefine(JJTDEFINE); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1));Token begin; - try { - begin = jj_consume_token(DEFINE); - switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { - case INCLUDE: - case INPUT: - case OUTPUT: - case APPLY: - case TO: - case CALL: - case CONDITION: - case BEGIN: - case BEFORE: - case AFTER: - case AROUND: - case REPLACE: - case CHECK: - case END: - case DELETE: - case ELSE: - case FOR: - case FUNCTION: - case FUNCTION_GEN: - case IF: - case IN: - case RETURN: - case YIELD: - case VAR: - case WHILE: - case CASE: - case CLASS: - case _DEFAULT: - case DO: - case SWITCH: - case INTANCE_OF: - case IDENTIFIER_NAME:{ - noReservedIdentifier(); - jj_consume_token(ASSIGN); - AssignmentExpression(); - break; - } - case LPAREN:{ - Arguments(); - break; - } - default: - jj_la1[67] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - } catch (Throwable jjte000) { -if (jjtc000) { - jjtree.clearNodeScope(jjtn000); - jjtc000 = false; - } else { - jjtree.popNode(); - } - if (jjte000 instanceof RuntimeException) { - {if (true) throw (RuntimeException)jjte000;} - } - if (jjte000 instanceof ParseException) { - {if (true) throw (ParseException)jjte000;} - } - {if (true) throw (Error)jjte000;} - } finally { -if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -} - -/** Condition - * Boolean expression that verifies if the apply can take place in a join point - **/ - final public void Condition() throws ParseException {/*@bgen(jjtree) Condition */ - ASTCondition jjtn000 = new ASTCondition(JJTCONDITION); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1));Token t,begin, end; - try { - switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { - case IDENTIFIER_NAME:{ - t = jj_consume_token(IDENTIFIER_NAME); - jj_consume_token(COLON); -jjtn000.jjtSetValue(t.image); - break; - } - default: - jj_la1[68] = jj_gen; - ; - } - begin = jj_consume_token(CONDITION); - switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { - case FOR:{ - jj_consume_token(FOR); -ASTFor jjtn001 = new ASTFor(JJTFOR); - boolean jjtc001 = true; - jjtree.openNodeScope(jjtn001); - jjtn001.jjtSetFirstToken(getToken(1)); - try { - Identifier(); - label_16: - while (true) { - switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { - case COMMA:{ - ; - break; - } - default: - jj_la1[69] = jj_gen; - break label_16; - } - jj_consume_token(COMMA); - Identifier(); - } - } catch (Throwable jjte001) { -if (jjtc001) { - jjtree.clearNodeScope(jjtn001); - jjtc001 = false; - } else { - jjtree.popNode(); - } - if (jjte001 instanceof RuntimeException) { - {if (true) throw (RuntimeException)jjte001;} - } - if (jjte001 instanceof ParseException) { - {if (true) throw (ParseException)jjte001;} - } - {if (true) throw (Error)jjte001;} - } finally { -if (jjtc001) { - jjtree.closeNodeScope(jjtn001, true); - jjtn001.jjtSetLastToken(getToken(0)); - } - } - break; - } - default: - jj_la1[70] = jj_gen; - ; - } - LogicalORExpression(); - end = jj_consume_token(END); - } catch (Throwable jjte000) { -if (jjtc000) { - jjtree.clearNodeScope(jjtn000); - jjtc000 = false; - } else { - jjtree.popNode(); - } - if (jjte000 instanceof RuntimeException) { - {if (true) throw (RuntimeException)jjte000;} - } - if (jjte000 instanceof ParseException) { - {if (true) throw (ParseException)jjte000;} - } - {if (true) throw (Error)jjte000;} - } finally { -if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -} - -/******************************************************************************* - ********************** END OF LARA SYNTACTIC GRAMMAR ********************* - *******************************************************************************/ - - /* The following part of the grammar is the EcmaScript grammar created by The Dojo Foundation (2004-2005), and it was partially updated to conform to the requirements of LARA grammar, such as the use of actions and join point variables. - **/ - - /* Section 11.1: Primary Expressions */ - final public - void PrimaryExpression() throws ParseException { - switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { - case THIS:{ - This(); - break; - } - case LBRACE:{ - ObjectLiteral(); - break; - } - case LBRACKET:{ - ArrayLiteral(); - break; - } - case LPAREN:{ - ParenExpression(); - break; - } - case IDENTIFIER_NAME:{ - Identifier(); - break; - } - case DECIMAL_LITERAL: - case HEX_INTEGER_LITERAL: - case NULL_LITERAL: - case BOOLEAN_LITERAL: - case STRING_LITERAL: - case CODE_LITERAL: - case REGULAR_EXPRESSION_LITERAL:{ - Literal(); - break; - } - default: - jj_la1[71] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } -} - - final public void This() throws ParseException {/*@bgen(jjtree) ThisReference */ - ASTThisReference jjtn000 = new ASTThisReference(JJTTHISREFERENCE); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1)); - try { -ASTThisReference jjtn001 = new ASTThisReference(JJTTHISREFERENCE); - boolean jjtc001 = true; - jjtree.openNodeScope(jjtn001); - jjtn001.jjtSetFirstToken(getToken(1)); - try { - jj_consume_token(THIS); - } finally { -if (jjtc001) { - jjtree.closeNodeScope(jjtn001, true); - jjtn001.jjtSetLastToken(getToken(0)); - } - } - } finally { -if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -} - - final public void ParenExpression() throws ParseException {/*@bgen(jjtree) ParenExpression */ - ASTParenExpression jjtn000 = new ASTParenExpression(JJTPARENEXPRESSION); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1)); - try { - jj_consume_token(LPAREN); - Expression(); - jj_consume_token(RPAREN); - } catch (Throwable jjte000) { -if (jjtc000) { - jjtree.clearNodeScope(jjtn000); - jjtc000 = false; - } else { - jjtree.popNode(); - } - if (jjte000 instanceof RuntimeException) { - {if (true) throw (RuntimeException)jjte000;} - } - if (jjte000 instanceof ParseException) { - {if (true) throw (ParseException)jjte000;} - } - {if (true) throw (Error)jjte000;} - } finally { -if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -} - -/* Section 7.8: Literals */ - final public - void Literal() throws ParseException {/*@bgen(jjtree) Literal */ - ASTLiteral jjtn000 = new ASTLiteral(JJTLITERAL); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1));Token t; - Map objLiteral; - List arrayLiteral; - try { - switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { - case DECIMAL_LITERAL:{ - t = jj_consume_token(DECIMAL_LITERAL); -jjtree.closeNodeScope(jjtn000, true); - jjtc000 = false; - jjtn000.jjtSetLastToken(getToken(0)); -jjtn000.setDecimalValue(t.image); - if(t.image.contains(".")) - jjtn000.setType(Types.Float); - else jjtn000.setType(Types.Int); - break; - } - case HEX_INTEGER_LITERAL:{ - t = jj_consume_token(HEX_INTEGER_LITERAL); -jjtree.closeNodeScope(jjtn000, true); - jjtc000 = false; - jjtn000.jjtSetLastToken(getToken(0)); -jjtn000.setHexValue(t.image); - jjtn000.setType(Types.Int); - break; - } - case STRING_LITERAL:{ - t = jj_consume_token(STRING_LITERAL); -jjtree.closeNodeScope(jjtn000, true); - jjtc000 = false; - jjtn000.jjtSetLastToken(getToken(0)); -jjtn000.setStringValue(t.image); - jjtn000.setType(Types.String); - break; - } - case BOOLEAN_LITERAL:{ - t = jj_consume_token(BOOLEAN_LITERAL); -jjtree.closeNodeScope(jjtn000, true); - jjtc000 = false; - jjtn000.jjtSetLastToken(getToken(0)); -jjtn000.setBooleanValue(t.image); - jjtn000.setType(Types.Boolean); - break; - } - case NULL_LITERAL:{ - t = jj_consume_token(NULL_LITERAL); -jjtree.closeNodeScope(jjtn000, true); - jjtc000 = false; - jjtn000.jjtSetLastToken(getToken(0)); -jjtn000.setNullValue(); - jjtn000.setType(Types.Null); - break; - } - case REGULAR_EXPRESSION_LITERAL:{ - t = jj_consume_token(REGULAR_EXPRESSION_LITERAL); -jjtree.closeNodeScope(jjtn000, true); - jjtc000 = false; - jjtn000.jjtSetLastToken(getToken(0)); -jjtn000.setRegexValue(t.image); - jjtn000.setType(Types.RegEx); - break; - } - case CODE_LITERAL:{ - t = jj_consume_token(CODE_LITERAL); -jjtree.closeNodeScope(jjtn000, true); - jjtc000 = false; - jjtn000.jjtSetLastToken(getToken(0)); -jjtn000.setCodeValue(t.image); - jjtn000.setType(Types.Code); - break; - } - default: - jj_la1[72] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - } finally { -if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -} - - final public void TemplateLiteral() throws ParseException {/*@bgen(jjtree) Literal */ - ASTLiteral jjtn000 = new ASTLiteral(JJTLITERAL); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1));Token t; - try { - switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { - case STRING_LITERAL:{ - t = jj_consume_token(STRING_LITERAL); -jjtree.closeNodeScope(jjtn000, true); - jjtc000 = false; - jjtn000.jjtSetLastToken(getToken(0)); -jjtn000.setStringValue(t.image); - jjtn000.setType(Types.String); - break; - } - case CODE_LITERAL:{ - t = jj_consume_token(CODE_LITERAL); -jjtree.closeNodeScope(jjtn000, true); - jjtc000 = false; - jjtn000.jjtSetLastToken(getToken(0)); -jjtn000.setCodeValue(t.image); - jjtn000.setType(Types.Code); - break; - } - default: - jj_la1[73] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - } finally { -if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -} - - final public void Identifier() throws ParseException {/*@bgen(jjtree) Identifier */ - ASTIdentifier jjtn000 = new ASTIdentifier(JJTIDENTIFIER); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1));Token t; - try { - t = jj_consume_token(IDENTIFIER_NAME); -jjtree.closeNodeScope(jjtn000, true); - jjtc000 = false; - jjtn000.jjtSetLastToken(getToken(0)); -jjtn000.setName(t.image);jjtn000.jjtSetValue(t.image); - /*{jjtThis.setCoord(t,t); }*/ - - } finally { -if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -} - - final public void LabelIdentifier() throws ParseException {/*@bgen(jjtree) Identifier */ - ASTIdentifier jjtn000 = new ASTIdentifier(JJTIDENTIFIER); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1));Token t; - try { - switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { - case LABEL_IDENTIFIER:{ - t = jj_consume_token(LABEL_IDENTIFIER); - break; - } - case IDENTIFIER_NAME:{ - t = jj_consume_token(IDENTIFIER_NAME); - break; - } - default: - jj_la1[74] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } -jjtree.closeNodeScope(jjtn000, true); - jjtc000 = false; - jjtn000.jjtSetLastToken(getToken(0)); -jjtn000.setName(t.image);jjtn000.jjtSetValue(t.image); - /*{jjtThis.setCoord(t,t); }*/ - - } finally { -if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -} - -/* Section 11.1.4: Array Initialiser */ - final public - void ArrayLiteral() throws ParseException {/*@bgen(jjtree) ArrayLiteral */ - ASTArrayLiteral jjtn000 = new ASTArrayLiteral(JJTARRAYLITERAL); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1)); - try { - jj_consume_token(LBRACKET); - switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { - case COMMA:{ - ElisionFirst(); - break; - } - default: - jj_la1[75] = jj_gen; - ; - } - switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { - case DELETE: - case FUNCTION: - case FUNCTION_GEN: - case NEW: - case THIS: - case TYPEOF: - case VOID: - case LBRACE: - case LPAREN: - case LBRACKET: - case PLUS: - case MINUS: - case INCR: - case DECR: - case BANG: - case TILDE: - case DECIMAL_LITERAL: - case HEX_INTEGER_LITERAL: - case NULL_LITERAL: - case BOOLEAN_LITERAL: - case STRING_LITERAL: - case CODE_LITERAL: - case IDENTIFIER_NAME: - case REGULAR_EXPRESSION_LITERAL:{ - ElementList(); - break; - } - default: - jj_la1[76] = jj_gen; - ; - } - jj_consume_token(RBRACKET); - } catch (Throwable jjte000) { -if (jjtc000) { - jjtree.clearNodeScope(jjtn000); - jjtc000 = false; - } else { - jjtree.popNode(); - } - if (jjte000 instanceof RuntimeException) { - {if (true) throw (RuntimeException)jjte000;} - } - if (jjte000 instanceof ParseException) { - {if (true) throw (ParseException)jjte000;} - } - {if (true) throw (Error)jjte000;} - } finally { -if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -} - - final public void ElementList() throws ParseException { - AssignmentExpression(); - label_17: - while (true) { - if (jj_2_24(2)) { - ; - } else { - break label_17; - } - Elision(); - AssignmentExpression(); - } - switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { - case COMMA:{ - Elision(); - break; - } - default: - jj_la1[77] = jj_gen; - ; - } -} - - final public void Elision() throws ParseException { - jj_consume_token(COMMA); - switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { - case COMMA:{ -ASTEmptyPositions jjtn001 = new ASTEmptyPositions(JJTEMPTYPOSITIONS); - boolean jjtc001 = true; - jjtree.openNodeScope(jjtn001); - jjtn001.jjtSetFirstToken(getToken(1)); - try { - label_18: - while (true) { - jj_consume_token(COMMA); -jjtn001.inc(); - switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { - case COMMA:{ - ; - break; - } - default: - jj_la1[78] = jj_gen; - break label_18; - } - } - } finally { -if (jjtc001) { - jjtree.closeNodeScope(jjtn001, true); - jjtn001.jjtSetLastToken(getToken(0)); - } - } - break; - } - default: - jj_la1[79] = jj_gen; - ; - } -} - - final public void ElisionFirst() throws ParseException {/*@bgen(jjtree) EmptyPositions */ - ASTEmptyPositions jjtn000 = new ASTEmptyPositions(JJTEMPTYPOSITIONS); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1)); - try { - jj_consume_token(COMMA); -jjtn000.inc(); - switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { - case COMMA:{ - label_19: - while (true) { - jj_consume_token(COMMA); -jjtn000.inc(); - switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { - case COMMA:{ - ; - break; - } - default: - jj_la1[80] = jj_gen; - break label_19; - } - } - break; - } - default: - jj_la1[81] = jj_gen; - ; - } - } finally { -if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -} - -/* Section 11.1.5: Object Initialiser */ - final public - void ObjectLiteral() throws ParseException {/*@bgen(jjtree) ObjectLiteral */ - ASTObjectLiteral jjtn000 = new ASTObjectLiteral(JJTOBJECTLITERAL); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1)); - try { - jj_consume_token(LBRACE); -exprBraceCount++; - switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { - case INCLUDE: - case INPUT: - case OUTPUT: - case APPLY: - case TO: - case CALL: - case CONDITION: - case BEGIN: - case BEFORE: - case AFTER: - case AROUND: - case REPLACE: - case CHECK: - case END: - case DELETE: - case ELSE: - case FOR: - case FUNCTION: - case FUNCTION_GEN: - case IF: - case IN: - case RETURN: - case YIELD: - case VAR: - case WHILE: - case CASE: - case CLASS: - case _DEFAULT: - case DO: - case SWITCH: - case INTANCE_OF: - case DECIMAL_LITERAL: - case HEX_INTEGER_LITERAL: - case NULL_LITERAL: - case BOOLEAN_LITERAL: - case STRING_LITERAL: - case CODE_LITERAL: - case IDENTIFIER_NAME: - case REGULAR_EXPRESSION_LITERAL:{ - PropertyNameAndValueList(); - break; - } - default: - jj_la1[82] = jj_gen; - ; - } - jj_consume_token(RBRACE); -jjtree.closeNodeScope(jjtn000, true); - jjtc000 = false; - jjtn000.jjtSetLastToken(getToken(0)); -exprBraceCount--; - } catch (Throwable jjte000) { -if (jjtc000) { - jjtree.clearNodeScope(jjtn000); - jjtc000 = false; - } else { - jjtree.popNode(); - } - if (jjte000 instanceof RuntimeException) { - {if (true) throw (RuntimeException)jjte000;} - } - if (jjte000 instanceof ParseException) { - {if (true) throw (ParseException)jjte000;} - } - {if (true) throw (Error)jjte000;} - } finally { -if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -} - - final public void PropertyNameAndValueList() throws ParseException { - PropertyNameAndValue(); - label_20: - while (true) { - switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { - case COMMA:{ - ; - break; - } - default: - jj_la1[83] = jj_gen; - break label_20; - } - if (jj_2_25(2147483647)) { - jj_consume_token(COMMA); - PropertyNameAndValue(); - } else { - switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { - case COMMA:{ - jj_consume_token(COMMA); - break; - } - default: - jj_la1[84] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - } - } -} - - final public void PropertyNameAndValue() throws ParseException {/*@bgen(jjtree) LiteralField */ - ASTLiteralField jjtn000 = new ASTLiteralField(JJTLITERALFIELD); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1)); - try { - PropertyName(); - jj_consume_token(COLON); - AssignmentExpression(); - } catch (Throwable jjte000) { -if (jjtc000) { - jjtree.clearNodeScope(jjtn000); - jjtc000 = false; - } else { - jjtree.popNode(); - } - if (jjte000 instanceof RuntimeException) { - {if (true) throw (RuntimeException)jjte000;} - } - if (jjte000 instanceof ParseException) { - {if (true) throw (ParseException)jjte000;} - } - {if (true) throw (Error)jjte000;} - } finally { -if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -} - - final public void PropertyName() throws ParseException { - switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { - case INCLUDE: - case INPUT: - case OUTPUT: - case APPLY: - case TO: - case CALL: - case CONDITION: - case BEGIN: - case BEFORE: - case AFTER: - case AROUND: - case REPLACE: - case CHECK: - case END: - case DELETE: - case ELSE: - case FOR: - case FUNCTION: - case FUNCTION_GEN: - case IF: - case IN: - case RETURN: - case YIELD: - case VAR: - case WHILE: - case CASE: - case CLASS: - case _DEFAULT: - case DO: - case SWITCH: - case INTANCE_OF: - case IDENTIFIER_NAME:{ - noReservedIdentifier(); - break; - } - case DECIMAL_LITERAL: - case HEX_INTEGER_LITERAL: - case NULL_LITERAL: - case BOOLEAN_LITERAL: - case STRING_LITERAL: - case CODE_LITERAL: - case REGULAR_EXPRESSION_LITERAL:{ - Literal(); - break; - } - default: - jj_la1[85] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } -} - -/* Section 11.2: Left-Hand-Side Expressions */ - final public - void MemberExpression() throws ParseException { - switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { - case FUNCTION: - case FUNCTION_GEN: - case THIS: - case LBRACE: - case LPAREN: - case LBRACKET: - case DECIMAL_LITERAL: - case HEX_INTEGER_LITERAL: - case NULL_LITERAL: - case BOOLEAN_LITERAL: - case STRING_LITERAL: - case CODE_LITERAL: - case IDENTIFIER_NAME: - case REGULAR_EXPRESSION_LITERAL:{ -ASTCompositeReference jjtn001 = new ASTCompositeReference(JJTCOMPOSITEREFERENCE); - boolean jjtc001 = true; - jjtree.openNodeScope(jjtn001); - jjtn001.jjtSetFirstToken(getToken(1)); - try { - if (jj_2_26(2147483647)) { - GeneratorFunctionExpression(); - } else if (jj_2_27(2147483647)) { - FunctionExpression(); - } else if (jj_2_28(2147483647)) { - ArrowFunctionExpression(); - } else { - switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { - case THIS: - case LBRACE: - case LPAREN: - case LBRACKET: - case DECIMAL_LITERAL: - case HEX_INTEGER_LITERAL: - case NULL_LITERAL: - case BOOLEAN_LITERAL: - case STRING_LITERAL: - case CODE_LITERAL: - case IDENTIFIER_NAME: - case REGULAR_EXPRESSION_LITERAL:{ - PrimaryExpression(); - break; - } - default: - jj_la1[86] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - } - label_21: - while (true) { - if (jj_2_29(2)) { - ; - } else { - break label_21; - } - MemberExpressionPart(); - } - } catch (Throwable jjte001) { -if (jjtc001) { - jjtree.clearNodeScope(jjtn001); - jjtc001 = false; - } else { - jjtree.popNode(); - } - if (jjte001 instanceof RuntimeException) { - {if (true) throw (RuntimeException)jjte001;} - } - if (jjte001 instanceof ParseException) { - {if (true) throw (ParseException)jjte001;} - } - {if (true) throw (Error)jjte001;} - } finally { -if (jjtc001) { - jjtree.closeNodeScope(jjtn001, jjtree.nodeArity() > 1); - jjtn001.jjtSetLastToken(getToken(0)); - } - } - break; - } - case NEW:{ - AllocationExpression(); - break; - } - default: - jj_la1[87] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } -} - - final public void MemberExpressionForIn() throws ParseException { -ASTCompositeReference jjtn001 = new ASTCompositeReference(JJTCOMPOSITEREFERENCE); - boolean jjtc001 = true; - jjtree.openNodeScope(jjtn001); - jjtn001.jjtSetFirstToken(getToken(1)); - try { - if (jj_2_30(2147483647)) { - GeneratorFunctionExpression(); - } else if (jj_2_31(2147483647)) { - FunctionExpression(); - } else if (jj_2_32(2147483647)) { - ArrowFunctionExpression(); - } else { - switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { - case THIS: - case LBRACE: - case LPAREN: - case LBRACKET: - case DECIMAL_LITERAL: - case HEX_INTEGER_LITERAL: - case NULL_LITERAL: - case BOOLEAN_LITERAL: - case STRING_LITERAL: - case CODE_LITERAL: - case IDENTIFIER_NAME: - case REGULAR_EXPRESSION_LITERAL:{ - PrimaryExpression(); - break; - } - default: - jj_la1[88] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - } - label_22: - while (true) { - if (jj_2_33(2)) { - ; - } else { - break label_22; - } - MemberExpressionPart(); - } - } catch (Throwable jjte001) { -if (jjtc001) { - jjtree.clearNodeScope(jjtn001); - jjtc001 = false; - } else { - jjtree.popNode(); - } - if (jjte001 instanceof RuntimeException) { - {if (true) throw (RuntimeException)jjte001;} - } - if (jjte001 instanceof ParseException) { - {if (true) throw (ParseException)jjte001;} - } - {if (true) throw (Error)jjte001;} - } finally { -if (jjtc001) { - jjtree.closeNodeScope(jjtn001, jjtree.nodeArity() > 1); - jjtn001.jjtSetLastToken(getToken(0)); - } - } -} - - final public void AllocationExpression() throws ParseException {/*@bgen(jjtree) AllocationExpression */ - ASTAllocationExpression jjtn000 = new ASTAllocationExpression(JJTALLOCATIONEXPRESSION); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1)); - try { -ASTCompositeReference jjtn001 = new ASTCompositeReference(JJTCOMPOSITEREFERENCE); - boolean jjtc001 = true; - jjtree.openNodeScope(jjtn001); - jjtn001.jjtSetFirstToken(getToken(1)); - try { - jj_consume_token(NEW); - MemberExpression(); - label_23: - while (true) { - if (jj_2_34(2147483647)) { - ; - } else { - break label_23; - } - Arguments(); - label_24: - while (true) { - if (jj_2_35(2)) { - ; - } else { - break label_24; - } - MemberExpressionPart(); - } - } - } catch (Throwable jjte001) { -if (jjtc001) { - jjtree.clearNodeScope(jjtn001); - jjtc001 = false; - } else { - jjtree.popNode(); - } - if (jjte001 instanceof RuntimeException) { - {if (true) throw (RuntimeException)jjte001;} - } - if (jjte001 instanceof ParseException) { - {if (true) throw (ParseException)jjte001;} - } - {if (true) throw (Error)jjte001;} - } finally { -if (jjtc001) { - jjtree.closeNodeScope(jjtn001, jjtree.nodeArity() > 1); - jjtn001.jjtSetLastToken(getToken(0)); - } - } - } catch (Throwable jjte000) { -if (jjtc000) { - jjtree.clearNodeScope(jjtn000); - jjtc000 = false; - } else { - jjtree.popNode(); - } - if (jjte000 instanceof RuntimeException) { - {if (true) throw (RuntimeException)jjte000;} - } - if (jjte000 instanceof ParseException) { - {if (true) throw (ParseException)jjte000;} - } - {if (true) throw (Error)jjte000;} - } finally { -if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -} - - final public void MemberExpressionPart() throws ParseException { - switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { - case LBRACE: - case LBRACKET:{ -ASTPropertyValueReference jjtn001 = new ASTPropertyValueReference(JJTPROPERTYVALUEREFERENCE); - boolean jjtc001 = true; - jjtree.openNodeScope(jjtn001); - jjtn001.jjtSetFirstToken(getToken(1)); - try { - switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { - case LBRACKET:{ - jj_consume_token(LBRACKET); - Expression(); - jj_consume_token(RBRACKET); - break; - } - case LBRACE:{ - jj_consume_token(LBRACE); -exprBraceCount++; - Expression(); - jj_consume_token(RBRACE); -jjtree.closeNodeScope(jjtn001, true); - jjtc001 = false; - jjtn001.jjtSetLastToken(getToken(0)); -exprBraceCount--; - break; - } - default: - jj_la1[89] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - } catch (Throwable jjte001) { -if (jjtc001) { - jjtree.clearNodeScope(jjtn001); - jjtc001 = false; - } else { - jjtree.popNode(); - } - if (jjte001 instanceof RuntimeException) { - {if (true) throw (RuntimeException)jjte001;} - } - if (jjte001 instanceof ParseException) { - {if (true) throw (ParseException)jjte001;} - } - {if (true) throw (Error)jjte001;} - } finally { -if (jjtc001) { - jjtree.closeNodeScope(jjtn001, true); - jjtn001.jjtSetLastToken(getToken(0)); - } - } - break; - } - case DOT:{ -ASTPropertyIdentifierReference jjtn002 = new ASTPropertyIdentifierReference(JJTPROPERTYIDENTIFIERREFERENCE); - boolean jjtc002 = true; - jjtree.openNodeScope(jjtn002); - jjtn002.jjtSetFirstToken(getToken(1)); - try { - jj_consume_token(DOT); - noReservedIdentifier(); - } catch (Throwable jjte002) { -if (jjtc002) { - jjtree.clearNodeScope(jjtn002); - jjtc002 = false; - } else { - jjtree.popNode(); - } - if (jjte002 instanceof RuntimeException) { - {if (true) throw (RuntimeException)jjte002;} - } - if (jjte002 instanceof ParseException) { - {if (true) throw (ParseException)jjte002;} - } - {if (true) throw (Error)jjte002;} - } finally { -if (jjtc002) { - jjtree.closeNodeScope(jjtn002, true); - jjtn002.jjtSetLastToken(getToken(0)); - } - } - break; - } - default: - jj_la1[90] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } -} - - final public void CallExpression() throws ParseException {/*@bgen(jjtree) #CompositeReference(> 1) */ - ASTCompositeReference jjtn000 = new ASTCompositeReference(JJTCOMPOSITEREFERENCE); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1)); - try { - MemberExpression(); - Arguments(); - label_25: - while (true) { - if (jj_2_36(2)) { - ; - } else { - break label_25; - } - CallExpressionPart(); - } - } catch (Throwable jjte000) { -if (jjtc000) { - jjtree.clearNodeScope(jjtn000); - jjtc000 = false; - } else { - jjtree.popNode(); - } - if (jjte000 instanceof RuntimeException) { - {if (true) throw (RuntimeException)jjte000;} - } - if (jjte000 instanceof ParseException) { - {if (true) throw (ParseException)jjte000;} - } - {if (true) throw (Error)jjte000;} - } finally { -if (jjtc000) { - jjtree.closeNodeScope(jjtn000, jjtree.nodeArity() > 1); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -} - - final public void CallExpressionForIn() throws ParseException {/*@bgen(jjtree) #CompositeReference(> 1) */ - ASTCompositeReference jjtn000 = new ASTCompositeReference(JJTCOMPOSITEREFERENCE); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1)); - try { - MemberExpressionForIn(); - Arguments(); - label_26: - while (true) { - if (jj_2_37(2)) { - ; - } else { - break label_26; - } - CallExpressionPart(); - } - } catch (Throwable jjte000) { -if (jjtc000) { - jjtree.clearNodeScope(jjtn000); - jjtc000 = false; - } else { - jjtree.popNode(); - } - if (jjte000 instanceof RuntimeException) { - {if (true) throw (RuntimeException)jjte000;} - } - if (jjte000 instanceof ParseException) { - {if (true) throw (ParseException)jjte000;} - } - {if (true) throw (Error)jjte000;} - } finally { -if (jjtc000) { - jjtree.closeNodeScope(jjtn000, jjtree.nodeArity() > 1); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -} - - final public void CallExpressionPart() throws ParseException { - switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { - case LPAREN:{ - Arguments(); - break; - } - case LBRACKET:{ -ASTPropertyValueReference jjtn001 = new ASTPropertyValueReference(JJTPROPERTYVALUEREFERENCE); - boolean jjtc001 = true; - jjtree.openNodeScope(jjtn001); - jjtn001.jjtSetFirstToken(getToken(1)); - try { - jj_consume_token(LBRACKET); - Expression(); - jj_consume_token(RBRACKET); - } catch (Throwable jjte001) { -if (jjtc001) { - jjtree.clearNodeScope(jjtn001); - jjtc001 = false; - } else { - jjtree.popNode(); - } - if (jjte001 instanceof RuntimeException) { - {if (true) throw (RuntimeException)jjte001;} - } - if (jjte001 instanceof ParseException) { - {if (true) throw (ParseException)jjte001;} - } - {if (true) throw (Error)jjte001;} - } finally { -if (jjtc001) { - jjtree.closeNodeScope(jjtn001, true); - jjtn001.jjtSetLastToken(getToken(0)); - } - } - break; - } - case DOT:{ -ASTPropertyIdentifierReference jjtn002 = new ASTPropertyIdentifierReference(JJTPROPERTYIDENTIFIERREFERENCE); - boolean jjtc002 = true; - jjtree.openNodeScope(jjtn002); - jjtn002.jjtSetFirstToken(getToken(1)); - try { - jj_consume_token(DOT); - noReservedIdentifier(); - } catch (Throwable jjte002) { -if (jjtc002) { - jjtree.clearNodeScope(jjtn002); - jjtc002 = false; - } else { - jjtree.popNode(); - } - if (jjte002 instanceof RuntimeException) { - {if (true) throw (RuntimeException)jjte002;} - } - if (jjte002 instanceof ParseException) { - {if (true) throw (ParseException)jjte002;} - } - {if (true) throw (Error)jjte002;} - } finally { -if (jjtc002) { - jjtree.closeNodeScope(jjtn002, true); - jjtn002.jjtSetLastToken(getToken(0)); - } - } - break; - } - default: - jj_la1[91] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } -} - - final public void Arguments() throws ParseException {/*@bgen(jjtree) FunctionCallParameters */ - ASTFunctionCallParameters jjtn000 = new ASTFunctionCallParameters(JJTFUNCTIONCALLPARAMETERS); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1)); - try { - jj_consume_token(LPAREN); - switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { - case INCLUDE: - case INPUT: - case OUTPUT: - case APPLY: - case TO: - case CALL: - case CONDITION: - case BEGIN: - case BEFORE: - case AFTER: - case AROUND: - case REPLACE: - case CHECK: - case END: - case DELETE: - case ELSE: - case FOR: - case FUNCTION: - case FUNCTION_GEN: - case IF: - case IN: - case NEW: - case RETURN: - case YIELD: - case THIS: - case TYPEOF: - case VAR: - case VOID: - case WHILE: - case CASE: - case CLASS: - case _DEFAULT: - case DO: - case SWITCH: - case LBRACE: - case LPAREN: - case LBRACKET: - case PLUS: - case MINUS: - case INCR: - case DECR: - case BANG: - case TILDE: - case INTANCE_OF: - case DECIMAL_LITERAL: - case HEX_INTEGER_LITERAL: - case NULL_LITERAL: - case BOOLEAN_LITERAL: - case STRING_LITERAL: - case CODE_LITERAL: - case IDENTIFIER_NAME: - case REGULAR_EXPRESSION_LITERAL:{ - if (jj_2_38(2147483647)) { - NamedArgumentList(); -jjtn000.areNamed = true; - } else { - switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { - case DELETE: - case FUNCTION: - case FUNCTION_GEN: - case NEW: - case THIS: - case TYPEOF: - case VOID: - case LBRACE: - case LPAREN: - case LBRACKET: - case PLUS: - case MINUS: - case INCR: - case DECR: - case BANG: - case TILDE: - case DECIMAL_LITERAL: - case HEX_INTEGER_LITERAL: - case NULL_LITERAL: - case BOOLEAN_LITERAL: - case STRING_LITERAL: - case CODE_LITERAL: - case IDENTIFIER_NAME: - case REGULAR_EXPRESSION_LITERAL:{ - ArgumentList(); - break; - } - default: - jj_la1[92] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - } - break; - } - default: - jj_la1[93] = jj_gen; - ; - } - jj_consume_token(RPAREN); - } catch (Throwable jjte000) { -if (jjtc000) { - jjtree.clearNodeScope(jjtn000); - jjtc000 = false; - } else { - jjtree.popNode(); - } - if (jjte000 instanceof RuntimeException) { - {if (true) throw (RuntimeException)jjte000;} - } - if (jjte000 instanceof ParseException) { - {if (true) throw (ParseException)jjte000;} - } - {if (true) throw (Error)jjte000;} - } finally { -if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -} - - final public void NamedArgumentList() throws ParseException { - NamedArgument(); - label_27: - while (true) { - switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { - case COMMA:{ - ; - break; - } - default: - jj_la1[94] = jj_gen; - break label_27; - } - jj_consume_token(COMMA); - NamedArgument(); - } -} - - final public void NamedArgument() throws ParseException {/*@bgen(jjtree) NamedArgument */ - ASTNamedArgument jjtn000 = new ASTNamedArgument(JJTNAMEDARGUMENT); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1));Token argument; - try { - argument = getNoReservedIdentifier(); -jjtn000.jjtSetValue(argument.image); - jj_consume_token(COLON); - AssignmentExpression(); - } catch (Throwable jjte000) { -if (jjtc000) { - jjtree.clearNodeScope(jjtn000); - jjtc000 = false; - } else { - jjtree.popNode(); - } - if (jjte000 instanceof RuntimeException) { - {if (true) throw (RuntimeException)jjte000;} - } - if (jjte000 instanceof ParseException) { - {if (true) throw (ParseException)jjte000;} - } - {if (true) throw (Error)jjte000;} - } finally { -if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -} - - final public void ArgumentList() throws ParseException { - AssignmentExpression(); - label_28: - while (true) { - switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { - case COMMA:{ - ; - break; - } - default: - jj_la1[95] = jj_gen; - break label_28; - } - jj_consume_token(COMMA); - AssignmentExpression(); - } -} - - final public void LeftHandSideExpression() throws ParseException { - if (jj_2_39(2147483647)) { - CallExpression(); - } else { - switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { - case FUNCTION: - case FUNCTION_GEN: - case NEW: - case THIS: - case LBRACE: - case LPAREN: - case LBRACKET: - case DECIMAL_LITERAL: - case HEX_INTEGER_LITERAL: - case NULL_LITERAL: - case BOOLEAN_LITERAL: - case STRING_LITERAL: - case CODE_LITERAL: - case IDENTIFIER_NAME: - case REGULAR_EXPRESSION_LITERAL:{ - MemberExpression(); - break; - } - default: - jj_la1[96] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - } -} - - final public void LeftHandSideExpressionForIn() throws ParseException { - if (jj_2_40(2147483647)) { - CallExpressionForIn(); - } else { - switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { - case FUNCTION: - case FUNCTION_GEN: - case THIS: - case LBRACE: - case LPAREN: - case LBRACKET: - case DECIMAL_LITERAL: - case HEX_INTEGER_LITERAL: - case NULL_LITERAL: - case BOOLEAN_LITERAL: - case STRING_LITERAL: - case CODE_LITERAL: - case IDENTIFIER_NAME: - case REGULAR_EXPRESSION_LITERAL:{ - MemberExpressionForIn(); - break; - } - default: - jj_la1[97] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - } -} - -/* Section 11.3 Postfix Expressions */ - final public - void PostfixExpression() throws ParseException {/*@bgen(jjtree) #PostfixExpression(> 1) */ - ASTPostfixExpression jjtn000 = new ASTPostfixExpression(JJTPOSTFIXEXPRESSION); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1)); - try { - LeftHandSideExpression(); - switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { - case INCR: - case DECR:{ - PostfixOperator(); - break; - } - default: - jj_la1[98] = jj_gen; - ; - } - } catch (Throwable jjte000) { -if (jjtc000) { - jjtree.clearNodeScope(jjtn000); - jjtc000 = false; - } else { - jjtree.popNode(); - } - if (jjte000 instanceof RuntimeException) { - {if (true) throw (RuntimeException)jjte000;} - } - if (jjte000 instanceof ParseException) { - {if (true) throw (ParseException)jjte000;} - } - {if (true) throw (Error)jjte000;} - } finally { -if (jjtc000) { - jjtree.closeNodeScope(jjtn000, jjtree.nodeArity() > 1); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -} - - final public void PostfixOperator() throws ParseException {/*@bgen(jjtree) Operator */ - ASTOperator jjtn000 = new ASTOperator(JJTOPERATOR); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1));Token op; - try { - switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { - case INCR:{ - op = jj_consume_token(INCR); - break; - } - case DECR:{ - op = jj_consume_token(DECR); - break; - } - default: - jj_la1[99] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } -jjtree.closeNodeScope(jjtn000, true); - jjtc000 = false; - jjtn000.jjtSetLastToken(getToken(0)); -jjtn000.jjtSetValue(op.image); - } finally { -if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -} - -/* Section 11.4 Unary Operators */ - final public - void UnaryExpression() throws ParseException {/*@bgen(jjtree) #UnaryExpression(> 1) */ - ASTUnaryExpression jjtn000 = new ASTUnaryExpression(JJTUNARYEXPRESSION); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1)); - try { - switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { - case FUNCTION: - case FUNCTION_GEN: - case NEW: - case THIS: - case LBRACE: - case LPAREN: - case LBRACKET: - case DECIMAL_LITERAL: - case HEX_INTEGER_LITERAL: - case NULL_LITERAL: - case BOOLEAN_LITERAL: - case STRING_LITERAL: - case CODE_LITERAL: - case IDENTIFIER_NAME: - case REGULAR_EXPRESSION_LITERAL:{ - PostfixExpression(); - break; - } - case DELETE: - case TYPEOF: - case VOID: - case PLUS: - case MINUS: - case INCR: - case DECR: - case BANG: - case TILDE:{ - UnaryOperator(); - UnaryExpression(); - break; - } - default: - jj_la1[100] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - } catch (Throwable jjte000) { -if (jjtc000) { - jjtree.clearNodeScope(jjtn000); - jjtc000 = false; - } else { - jjtree.popNode(); - } - if (jjte000 instanceof RuntimeException) { - {if (true) throw (RuntimeException)jjte000;} - } - if (jjte000 instanceof ParseException) { - {if (true) throw (ParseException)jjte000;} - } - {if (true) throw (Error)jjte000;} - } finally { -if (jjtc000) { - jjtree.closeNodeScope(jjtn000, jjtree.nodeArity() > 1); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -} - - final public void UnaryOperator() throws ParseException {/*@bgen(jjtree) Operator */ - ASTOperator jjtn000 = new ASTOperator(JJTOPERATOR); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1));Token op; - try { - switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { - case DELETE:{ - op = jj_consume_token(DELETE); - break; - } - case VOID:{ - op = jj_consume_token(VOID); - break; - } - case TYPEOF:{ - op = jj_consume_token(TYPEOF); - break; - } - case INCR:{ - op = jj_consume_token(INCR); - break; - } - case DECR:{ - op = jj_consume_token(DECR); - break; - } - case PLUS:{ - op = jj_consume_token(PLUS); - break; - } - case MINUS:{ - op = jj_consume_token(MINUS); - break; - } - case TILDE:{ - op = jj_consume_token(TILDE); - break; - } - case BANG:{ - op = jj_consume_token(BANG); - break; - } - default: - jj_la1[101] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } -jjtree.closeNodeScope(jjtn000, true); - jjtc000 = false; - jjtn000.jjtSetLastToken(getToken(0)); -jjtn000.jjtSetValue(op.image); - } finally { -if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -} - -/* Section 11.5: Multiplicative Operators */ - final public - - void MultiplicativeExpression() throws ParseException {/*@bgen(jjtree) #BinaryExpressionSequence(> 1) */ - ASTBinaryExpressionSequence jjtn000 = new ASTBinaryExpressionSequence(JJTBINARYEXPRESSIONSEQUENCE); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1)); - try { - UnaryExpression(); - label_29: - while (true) { - switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { - case STAR: - case REM: - case SLASH:{ - ; - break; - } - default: - jj_la1[102] = jj_gen; - break label_29; - } - MultiplicativeOperator(); - UnaryExpression(); - } - } catch (Throwable jjte000) { -if (jjtc000) { - jjtree.clearNodeScope(jjtn000); - jjtc000 = false; - } else { - jjtree.popNode(); - } - if (jjte000 instanceof RuntimeException) { - {if (true) throw (RuntimeException)jjte000;} - } - if (jjte000 instanceof ParseException) { - {if (true) throw (ParseException)jjte000;} - } - {if (true) throw (Error)jjte000;} - } finally { -if (jjtc000) { - jjtree.closeNodeScope(jjtn000, jjtree.nodeArity() > 1); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -} - - final public void MultiplicativeOperator() throws ParseException {/*@bgen(jjtree) Operator */ - ASTOperator jjtn000 = new ASTOperator(JJTOPERATOR); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1));Token op; - try { - switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { - case STAR:{ - op = jj_consume_token(STAR); - break; - } - case SLASH:{ - op = jj_consume_token(SLASH); - break; - } - case REM:{ - op = jj_consume_token(REM); - break; - } - default: - jj_la1[103] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } -jjtree.closeNodeScope(jjtn000, true); - jjtc000 = false; - jjtn000.jjtSetLastToken(getToken(0)); -jjtn000.jjtSetValue(op.image); - } finally { -if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -} - -/* Section 11.6: Additive Operators */ - final public - void AdditiveExpression() throws ParseException {/*@bgen(jjtree) #BinaryExpressionSequence(> 1) */ - ASTBinaryExpressionSequence jjtn000 = new ASTBinaryExpressionSequence(JJTBINARYEXPRESSIONSEQUENCE); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1)); - try { - MultiplicativeExpression(); - label_30: - while (true) { - switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { - case PLUS: - case MINUS:{ - ; - break; - } - default: - jj_la1[104] = jj_gen; - break label_30; - } - AdditiveOperator(); - MultiplicativeExpression(); - } - } catch (Throwable jjte000) { -if (jjtc000) { - jjtree.clearNodeScope(jjtn000); - jjtc000 = false; - } else { - jjtree.popNode(); - } - if (jjte000 instanceof RuntimeException) { - {if (true) throw (RuntimeException)jjte000;} - } - if (jjte000 instanceof ParseException) { - {if (true) throw (ParseException)jjte000;} - } - {if (true) throw (Error)jjte000;} - } finally { -if (jjtc000) { - jjtree.closeNodeScope(jjtn000, jjtree.nodeArity() > 1); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -} - - final public void AdditiveOperator() throws ParseException {/*@bgen(jjtree) Operator */ - ASTOperator jjtn000 = new ASTOperator(JJTOPERATOR); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1));Token op; - try { - switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { - case PLUS:{ - op = jj_consume_token(PLUS); - break; - } - case MINUS:{ - op = jj_consume_token(MINUS); - break; - } - default: - jj_la1[105] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } -jjtree.closeNodeScope(jjtn000, true); - jjtc000 = false; - jjtn000.jjtSetLastToken(getToken(0)); -jjtn000.jjtSetValue(op.image); - } finally { -if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -} - -/* Section 11.7: Bitwise Shift Operators */ - final public - void ShiftExpression() throws ParseException {/*@bgen(jjtree) #BinaryExpressionSequence(> 1) */ - ASTBinaryExpressionSequence jjtn000 = new ASTBinaryExpressionSequence(JJTBINARYEXPRESSIONSEQUENCE); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1)); - try { - AdditiveExpression(); - label_31: - while (true) { - switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { - case LSHIFT: - case RSHIFT: - case RUNSHIFT:{ - ; - break; - } - default: - jj_la1[106] = jj_gen; - break label_31; - } - ShiftOperator(); - AdditiveExpression(); - } - } catch (Throwable jjte000) { -if (jjtc000) { - jjtree.clearNodeScope(jjtn000); - jjtc000 = false; - } else { - jjtree.popNode(); - } - if (jjte000 instanceof RuntimeException) { - {if (true) throw (RuntimeException)jjte000;} - } - if (jjte000 instanceof ParseException) { - {if (true) throw (ParseException)jjte000;} - } - {if (true) throw (Error)jjte000;} - } finally { -if (jjtc000) { - jjtree.closeNodeScope(jjtn000, jjtree.nodeArity() > 1); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -} - - final public void ShiftOperator() throws ParseException {/*@bgen(jjtree) Operator */ - ASTOperator jjtn000 = new ASTOperator(JJTOPERATOR); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1));Token op; - try { - switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { - case LSHIFT:{ - op = jj_consume_token(LSHIFT); - break; - } - case RSHIFT:{ - op = jj_consume_token(RSHIFT); - break; - } - case RUNSHIFT:{ - op = jj_consume_token(RUNSHIFT); - break; - } - default: - jj_la1[107] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } -jjtree.closeNodeScope(jjtn000, true); - jjtc000 = false; - jjtn000.jjtSetLastToken(getToken(0)); -jjtn000.jjtSetValue(op.image); - } finally { -if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -} - -/* Section 11.4: Relational Operators */ - final public - void RelationalExpression() throws ParseException {/*@bgen(jjtree) #BinaryExpressionSequence(> 1) */ - ASTBinaryExpressionSequence jjtn000 = new ASTBinaryExpressionSequence(JJTBINARYEXPRESSIONSEQUENCE); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1)); - try { - ShiftExpression(); - label_32: - while (true) { - switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { - case IN: - case LT: - case GT: - case LE: - case GE: - case INTANCE_OF:{ - ; - break; - } - default: - jj_la1[108] = jj_gen; - break label_32; - } - RelationalOperator(); - ShiftExpression(); - } - } catch (Throwable jjte000) { -if (jjtc000) { - jjtree.clearNodeScope(jjtn000); - jjtc000 = false; - } else { - jjtree.popNode(); - } - if (jjte000 instanceof RuntimeException) { - {if (true) throw (RuntimeException)jjte000;} - } - if (jjte000 instanceof ParseException) { - {if (true) throw (ParseException)jjte000;} - } - {if (true) throw (Error)jjte000;} - } finally { -if (jjtc000) { - jjtree.closeNodeScope(jjtn000, jjtree.nodeArity() > 1); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -} - - final public void RelationalOperator() throws ParseException {/*@bgen(jjtree) Operator */ - ASTOperator jjtn000 = new ASTOperator(JJTOPERATOR); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1));Token op; - try { - switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { - case LT:{ - op = jj_consume_token(LT); - break; - } - case GT:{ - op = jj_consume_token(GT); - break; - } - case LE:{ - op = jj_consume_token(LE); - break; - } - case GE:{ - op = jj_consume_token(GE); - break; - } - case INTANCE_OF:{ - op = jj_consume_token(INTANCE_OF); - break; - } - case IN:{ - op = jj_consume_token(IN); - break; - } - default: - jj_la1[109] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } -jjtree.closeNodeScope(jjtn000, true); - jjtc000 = false; - jjtn000.jjtSetLastToken(getToken(0)); -jjtn000.jjtSetValue(op.image); - } finally { -if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -} - - final public void RelationalExpressionNoIn() throws ParseException {/*@bgen(jjtree) #BinaryExpressionSequence(> 1) */ - ASTBinaryExpressionSequence jjtn000 = new ASTBinaryExpressionSequence(JJTBINARYEXPRESSIONSEQUENCE); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1)); - try { - ShiftExpression(); - label_33: - while (true) { - switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { - case LT: - case GT: - case LE: - case GE: - case INTANCE_OF:{ - ; - break; - } - default: - jj_la1[110] = jj_gen; - break label_33; - } - RelationalNoInOperator(); - ShiftExpression(); - } - } catch (Throwable jjte000) { -if (jjtc000) { - jjtree.clearNodeScope(jjtn000); - jjtc000 = false; - } else { - jjtree.popNode(); - } - if (jjte000 instanceof RuntimeException) { - {if (true) throw (RuntimeException)jjte000;} - } - if (jjte000 instanceof ParseException) { - {if (true) throw (ParseException)jjte000;} - } - {if (true) throw (Error)jjte000;} - } finally { -if (jjtc000) { - jjtree.closeNodeScope(jjtn000, jjtree.nodeArity() > 1); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -} - - final public void RelationalNoInOperator() throws ParseException {/*@bgen(jjtree) Operator */ - ASTOperator jjtn000 = new ASTOperator(JJTOPERATOR); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1));Token op; - try { - switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { - case LT:{ - op = jj_consume_token(LT); - break; - } - case GT:{ - op = jj_consume_token(GT); - break; - } - case LE:{ - op = jj_consume_token(LE); - break; - } - case GE:{ - op = jj_consume_token(GE); - break; - } - case INTANCE_OF:{ - op = jj_consume_token(INTANCE_OF); - break; - } - default: - jj_la1[111] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } -jjtree.closeNodeScope(jjtn000, true); - jjtc000 = false; - jjtn000.jjtSetLastToken(getToken(0)); -jjtn000.jjtSetValue(op.image); - } finally { -if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -} - -/* Section 11.9: Equality Operators */ - final public - void EqualityExpression() throws ParseException {/*@bgen(jjtree) #BinaryExpressionSequence(> 1) */ - ASTBinaryExpressionSequence jjtn000 = new ASTBinaryExpressionSequence(JJTBINARYEXPRESSIONSEQUENCE); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1)); - try { - RelationalExpression(); - label_34: - while (true) { - switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { - case EQ: - case NE: - case MATCH: - case SEQ: - case SNEQ:{ - ; - break; - } - default: - jj_la1[112] = jj_gen; - break label_34; - } - EqualityOperator(); - RelationalExpression(); - } - } catch (Throwable jjte000) { -if (jjtc000) { - jjtree.clearNodeScope(jjtn000); - jjtc000 = false; - } else { - jjtree.popNode(); - } - if (jjte000 instanceof RuntimeException) { - {if (true) throw (RuntimeException)jjte000;} - } - if (jjte000 instanceof ParseException) { - {if (true) throw (ParseException)jjte000;} - } - {if (true) throw (Error)jjte000;} - } finally { -if (jjtc000) { - jjtree.closeNodeScope(jjtn000, jjtree.nodeArity() > 1); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -} - - final public void EqualityExpressionNoIn() throws ParseException {/*@bgen(jjtree) #BinaryExpressionSequence(> 1) */ - ASTBinaryExpressionSequence jjtn000 = new ASTBinaryExpressionSequence(JJTBINARYEXPRESSIONSEQUENCE); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1)); - try { - RelationalExpressionNoIn(); - label_35: - while (true) { - switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { - case EQ: - case NE: - case MATCH: - case SEQ: - case SNEQ:{ - ; - break; - } - default: - jj_la1[113] = jj_gen; - break label_35; - } - EqualityOperator(); - RelationalExpressionNoIn(); - } - } catch (Throwable jjte000) { -if (jjtc000) { - jjtree.clearNodeScope(jjtn000); - jjtc000 = false; - } else { - jjtree.popNode(); - } - if (jjte000 instanceof RuntimeException) { - {if (true) throw (RuntimeException)jjte000;} - } - if (jjte000 instanceof ParseException) { - {if (true) throw (ParseException)jjte000;} - } - {if (true) throw (Error)jjte000;} - } finally { -if (jjtc000) { - jjtree.closeNodeScope(jjtn000, jjtree.nodeArity() > 1); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -} - - final public void EqualityOperator() throws ParseException {/*@bgen(jjtree) Operator */ - ASTOperator jjtn000 = new ASTOperator(JJTOPERATOR); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1));Token op; - try { - switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { - case EQ:{ - op = jj_consume_token(EQ); - break; - } - case NE:{ - op = jj_consume_token(NE); - break; - } - case SEQ:{ - op = jj_consume_token(SEQ); - break; - } - case SNEQ:{ - op = jj_consume_token(SNEQ); - break; - } - case MATCH:{ - op = jj_consume_token(MATCH); - break; - } - default: - jj_la1[114] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } -jjtree.closeNodeScope(jjtn000, true); - jjtc000 = false; - jjtn000.jjtSetLastToken(getToken(0)); -jjtn000.jjtSetValue(op.image); - } finally { -if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -} - -/* Section 11.10: Binary Bitwise Operators */ - final public - void BitwiseANDExpression() throws ParseException {/*@bgen(jjtree) #BinaryExpressionSequence(> 1) */ - ASTBinaryExpressionSequence jjtn000 = new ASTBinaryExpressionSequence(JJTBINARYEXPRESSIONSEQUENCE); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1)); - try { - EqualityExpression(); - label_36: - while (true) { - switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { - case BIT_AND:{ - ; - break; - } - default: - jj_la1[115] = jj_gen; - break label_36; - } - BitwiseANDOperator(); - EqualityExpression(); - } - } catch (Throwable jjte000) { -if (jjtc000) { - jjtree.clearNodeScope(jjtn000); - jjtc000 = false; - } else { - jjtree.popNode(); - } - if (jjte000 instanceof RuntimeException) { - {if (true) throw (RuntimeException)jjte000;} - } - if (jjte000 instanceof ParseException) { - {if (true) throw (ParseException)jjte000;} - } - {if (true) throw (Error)jjte000;} - } finally { -if (jjtc000) { - jjtree.closeNodeScope(jjtn000, jjtree.nodeArity() > 1); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -} - - final public void BitwiseANDExpressionNoIn() throws ParseException {/*@bgen(jjtree) #BinaryExpressionSequence(> 1) */ - ASTBinaryExpressionSequence jjtn000 = new ASTBinaryExpressionSequence(JJTBINARYEXPRESSIONSEQUENCE); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1)); - try { - EqualityExpressionNoIn(); - label_37: - while (true) { - switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { - case BIT_AND:{ - ; - break; - } - default: - jj_la1[116] = jj_gen; - break label_37; - } - BitwiseANDOperator(); - EqualityExpressionNoIn(); - } - } catch (Throwable jjte000) { -if (jjtc000) { - jjtree.clearNodeScope(jjtn000); - jjtc000 = false; - } else { - jjtree.popNode(); - } - if (jjte000 instanceof RuntimeException) { - {if (true) throw (RuntimeException)jjte000;} - } - if (jjte000 instanceof ParseException) { - {if (true) throw (ParseException)jjte000;} - } - {if (true) throw (Error)jjte000;} - } finally { -if (jjtc000) { - jjtree.closeNodeScope(jjtn000, jjtree.nodeArity() > 1); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -} - - final public void BitwiseANDOperator() throws ParseException {/*@bgen(jjtree) Operator */ - ASTOperator jjtn000 = new ASTOperator(JJTOPERATOR); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1));Token op; - try { - op = jj_consume_token(BIT_AND); -jjtree.closeNodeScope(jjtn000, true); - jjtc000 = false; - jjtn000.jjtSetLastToken(getToken(0)); -jjtn000.jjtSetValue(op.image); - } finally { -if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -} - - final public void BitwiseXORExpression() throws ParseException {/*@bgen(jjtree) #BinaryExpressionSequence(> 1) */ - ASTBinaryExpressionSequence jjtn000 = new ASTBinaryExpressionSequence(JJTBINARYEXPRESSIONSEQUENCE); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1)); - try { - BitwiseANDExpression(); - label_38: - while (true) { - switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { - case XOR:{ - ; - break; - } - default: - jj_la1[117] = jj_gen; - break label_38; - } - BitwiseXOROperator(); - BitwiseANDExpression(); - } - } catch (Throwable jjte000) { -if (jjtc000) { - jjtree.clearNodeScope(jjtn000); - jjtc000 = false; - } else { - jjtree.popNode(); - } - if (jjte000 instanceof RuntimeException) { - {if (true) throw (RuntimeException)jjte000;} - } - if (jjte000 instanceof ParseException) { - {if (true) throw (ParseException)jjte000;} - } - {if (true) throw (Error)jjte000;} - } finally { -if (jjtc000) { - jjtree.closeNodeScope(jjtn000, jjtree.nodeArity() > 1); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -} - - final public void BitwiseXORExpressionNoIn() throws ParseException {/*@bgen(jjtree) #BinaryExpressionSequence(> 1) */ - ASTBinaryExpressionSequence jjtn000 = new ASTBinaryExpressionSequence(JJTBINARYEXPRESSIONSEQUENCE); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1)); - try { - BitwiseANDExpressionNoIn(); - label_39: - while (true) { - switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { - case XOR:{ - ; - break; - } - default: - jj_la1[118] = jj_gen; - break label_39; - } - BitwiseXOROperator(); - BitwiseANDExpressionNoIn(); - } - } catch (Throwable jjte000) { -if (jjtc000) { - jjtree.clearNodeScope(jjtn000); - jjtc000 = false; - } else { - jjtree.popNode(); - } - if (jjte000 instanceof RuntimeException) { - {if (true) throw (RuntimeException)jjte000;} - } - if (jjte000 instanceof ParseException) { - {if (true) throw (ParseException)jjte000;} - } - {if (true) throw (Error)jjte000;} - } finally { -if (jjtc000) { - jjtree.closeNodeScope(jjtn000, jjtree.nodeArity() > 1); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -} - - final public void BitwiseXOROperator() throws ParseException {/*@bgen(jjtree) Operator */ - ASTOperator jjtn000 = new ASTOperator(JJTOPERATOR); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1));Token op; - try { - op = jj_consume_token(XOR); -jjtree.closeNodeScope(jjtn000, true); - jjtc000 = false; - jjtn000.jjtSetLastToken(getToken(0)); -jjtn000.jjtSetValue(op.image); - } finally { -if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -} - - final public void BitwiseORExpression() throws ParseException {/*@bgen(jjtree) #BinaryExpressionSequence(> 1) */ - ASTBinaryExpressionSequence jjtn000 = new ASTBinaryExpressionSequence(JJTBINARYEXPRESSIONSEQUENCE); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1)); - try { - BitwiseXORExpression(); - label_40: - while (true) { - switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { - case BIT_OR:{ - ; - break; - } - default: - jj_la1[119] = jj_gen; - break label_40; - } - BitwiseOROperator(); - BitwiseXORExpression(); - } - } catch (Throwable jjte000) { -if (jjtc000) { - jjtree.clearNodeScope(jjtn000); - jjtc000 = false; - } else { - jjtree.popNode(); - } - if (jjte000 instanceof RuntimeException) { - {if (true) throw (RuntimeException)jjte000;} - } - if (jjte000 instanceof ParseException) { - {if (true) throw (ParseException)jjte000;} - } - {if (true) throw (Error)jjte000;} - } finally { -if (jjtc000) { - jjtree.closeNodeScope(jjtn000, jjtree.nodeArity() > 1); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -} - - final public void BitwiseORExpressionNoIn() throws ParseException {/*@bgen(jjtree) #BinaryExpressionSequence(> 1) */ - ASTBinaryExpressionSequence jjtn000 = new ASTBinaryExpressionSequence(JJTBINARYEXPRESSIONSEQUENCE); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1)); - try { - BitwiseXORExpressionNoIn(); - label_41: - while (true) { - switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { - case BIT_OR:{ - ; - break; - } - default: - jj_la1[120] = jj_gen; - break label_41; - } - BitwiseOROperator(); - BitwiseXORExpressionNoIn(); - } - } catch (Throwable jjte000) { -if (jjtc000) { - jjtree.clearNodeScope(jjtn000); - jjtc000 = false; - } else { - jjtree.popNode(); - } - if (jjte000 instanceof RuntimeException) { - {if (true) throw (RuntimeException)jjte000;} - } - if (jjte000 instanceof ParseException) { - {if (true) throw (ParseException)jjte000;} - } - {if (true) throw (Error)jjte000;} - } finally { -if (jjtc000) { - jjtree.closeNodeScope(jjtn000, jjtree.nodeArity() > 1); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -} - - final public void BitwiseOROperator() throws ParseException {/*@bgen(jjtree) Operator */ - ASTOperator jjtn000 = new ASTOperator(JJTOPERATOR); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1));Token op; - try { - op = jj_consume_token(BIT_OR); -jjtree.closeNodeScope(jjtn000, true); - jjtc000 = false; - jjtn000.jjtSetLastToken(getToken(0)); -jjtn000.jjtSetValue(op.image); - } finally { -if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -} - -/* Section 11.11: Binary Logical Operators */ - final public - void LogicalANDExpression() throws ParseException {/*@bgen(jjtree) #AndExpressionSequence(> 1) */ - ASTAndExpressionSequence jjtn000 = new ASTAndExpressionSequence(JJTANDEXPRESSIONSEQUENCE); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1)); - try { - BitwiseORExpression(); - label_42: - while (true) { - switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { - case SC_AND:{ - ; - break; - } - default: - jj_la1[121] = jj_gen; - break label_42; - } - LogicalANDOperator(); - BitwiseORExpression(); - } - } catch (Throwable jjte000) { -if (jjtc000) { - jjtree.clearNodeScope(jjtn000); - jjtc000 = false; - } else { - jjtree.popNode(); - } - if (jjte000 instanceof RuntimeException) { - {if (true) throw (RuntimeException)jjte000;} - } - if (jjte000 instanceof ParseException) { - {if (true) throw (ParseException)jjte000;} - } - {if (true) throw (Error)jjte000;} - } finally { -if (jjtc000) { - jjtree.closeNodeScope(jjtn000, jjtree.nodeArity() > 1); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -} - - final public void LogicalANDExpressionNoIn() throws ParseException {/*@bgen(jjtree) #AndExpressionSequence(> 1) */ - ASTAndExpressionSequence jjtn000 = new ASTAndExpressionSequence(JJTANDEXPRESSIONSEQUENCE); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1)); - try { - BitwiseORExpressionNoIn(); - label_43: - while (true) { - switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { - case SC_AND:{ - ; - break; - } - default: - jj_la1[122] = jj_gen; - break label_43; - } - LogicalANDOperator(); - BitwiseORExpressionNoIn(); - } - } catch (Throwable jjte000) { -if (jjtc000) { - jjtree.clearNodeScope(jjtn000); - jjtc000 = false; - } else { - jjtree.popNode(); - } - if (jjte000 instanceof RuntimeException) { - {if (true) throw (RuntimeException)jjte000;} - } - if (jjte000 instanceof ParseException) { - {if (true) throw (ParseException)jjte000;} - } - {if (true) throw (Error)jjte000;} - } finally { -if (jjtc000) { - jjtree.closeNodeScope(jjtn000, jjtree.nodeArity() > 1); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -} - - final public void LogicalANDOperator() throws ParseException {/*@bgen(jjtree) Operator */ - ASTOperator jjtn000 = new ASTOperator(JJTOPERATOR); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1));Token op; - try { - op = jj_consume_token(SC_AND); -jjtree.closeNodeScope(jjtn000, true); - jjtc000 = false; - jjtn000.jjtSetLastToken(getToken(0)); -jjtn000.jjtSetValue(op.image); - } finally { -if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -} - - final public void LogicalORExpression() throws ParseException {/*@bgen(jjtree) #OrExpressionSequence(> 1) */ - ASTOrExpressionSequence jjtn000 = new ASTOrExpressionSequence(JJTOREXPRESSIONSEQUENCE); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1)); - try { - LogicalANDExpression(); - label_44: - while (true) { - switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { - case SC_OR:{ - ; - break; - } - default: - jj_la1[123] = jj_gen; - break label_44; - } - LogicalOROperator(); - LogicalANDExpression(); - } - } catch (Throwable jjte000) { -if (jjtc000) { - jjtree.clearNodeScope(jjtn000); - jjtc000 = false; - } else { - jjtree.popNode(); - } - if (jjte000 instanceof RuntimeException) { - {if (true) throw (RuntimeException)jjte000;} - } - if (jjte000 instanceof ParseException) { - {if (true) throw (ParseException)jjte000;} - } - {if (true) throw (Error)jjte000;} - } finally { -if (jjtc000) { - jjtree.closeNodeScope(jjtn000, jjtree.nodeArity() > 1); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -} - - final public void LogicalORExpressionNoIn() throws ParseException {/*@bgen(jjtree) #OrExpressionSequence(> 1) */ - ASTOrExpressionSequence jjtn000 = new ASTOrExpressionSequence(JJTOREXPRESSIONSEQUENCE); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1)); - try { - LogicalANDExpressionNoIn(); - label_45: - while (true) { - switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { - case SC_OR:{ - ; - break; - } - default: - jj_la1[124] = jj_gen; - break label_45; - } - LogicalOROperator(); - LogicalANDExpressionNoIn(); - } - } catch (Throwable jjte000) { -if (jjtc000) { - jjtree.clearNodeScope(jjtn000); - jjtc000 = false; - } else { - jjtree.popNode(); - } - if (jjte000 instanceof RuntimeException) { - {if (true) throw (RuntimeException)jjte000;} - } - if (jjte000 instanceof ParseException) { - {if (true) throw (ParseException)jjte000;} - } - {if (true) throw (Error)jjte000;} - } finally { -if (jjtc000) { - jjtree.closeNodeScope(jjtn000, jjtree.nodeArity() > 1); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -} - - final public void LogicalOROperator() throws ParseException {/*@bgen(jjtree) Operator */ - ASTOperator jjtn000 = new ASTOperator(JJTOPERATOR); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1));Token op; - try { - op = jj_consume_token(SC_OR); -jjtree.closeNodeScope(jjtn000, true); - jjtc000 = false; - jjtn000.jjtSetLastToken(getToken(0)); -jjtn000.jjtSetValue(op.image); - } finally { -if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -} - -/* Section 11.12: Conditional Operator */ - final public - void ConditionalExpression() throws ParseException {/*@bgen(jjtree) #ConditionalExpression(> 1) */ - ASTConditionalExpression jjtn000 = new ASTConditionalExpression(JJTCONDITIONALEXPRESSION); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1)); - try { - LogicalORExpression(); - switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { - case HOOK:{ - jj_consume_token(HOOK); - AssignmentExpression(); - jj_consume_token(COLON); - AssignmentExpression(); - break; - } - default: - jj_la1[125] = jj_gen; - ; - } - } catch (Throwable jjte000) { -if (jjtc000) { - jjtree.clearNodeScope(jjtn000); - jjtc000 = false; - } else { - jjtree.popNode(); - } - if (jjte000 instanceof RuntimeException) { - {if (true) throw (RuntimeException)jjte000;} - } - if (jjte000 instanceof ParseException) { - {if (true) throw (ParseException)jjte000;} - } - {if (true) throw (Error)jjte000;} - } finally { -if (jjtc000) { - jjtree.closeNodeScope(jjtn000, jjtree.nodeArity() > 1); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -} - - final public void ConditionalExpressionNoIn() throws ParseException {/*@bgen(jjtree) #ConditionalExpression(> 1) */ - ASTConditionalExpression jjtn000 = new ASTConditionalExpression(JJTCONDITIONALEXPRESSION); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1)); - try { - LogicalORExpressionNoIn(); - switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { - case HOOK:{ - jj_consume_token(HOOK); - AssignmentExpression(); - jj_consume_token(COLON); - AssignmentExpressionNoIn(); - break; - } - default: - jj_la1[126] = jj_gen; - ; - } - } catch (Throwable jjte000) { -if (jjtc000) { - jjtree.clearNodeScope(jjtn000); - jjtc000 = false; - } else { - jjtree.popNode(); - } - if (jjte000 instanceof RuntimeException) { - {if (true) throw (RuntimeException)jjte000;} - } - if (jjte000 instanceof ParseException) { - {if (true) throw (ParseException)jjte000;} - } - {if (true) throw (Error)jjte000;} - } finally { -if (jjtc000) { - jjtree.closeNodeScope(jjtn000, jjtree.nodeArity() > 1); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -} - -/* Section 11.13: Assignment Operators */ - final public - void AssignmentExpression() throws ParseException {/*@bgen(jjtree) #AssignmentExpression(> 1) */ - ASTAssignmentExpression jjtn000 = new ASTAssignmentExpression(JJTASSIGNMENTEXPRESSION); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1)); - try { - if (jj_2_42(2147483647)) { - LeftHandSideExpression(); - AssignmentOperator(); - if (jj_2_41(2147483647)) { - ActionOnAssign(); - } else { - switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { - case DELETE: - case FUNCTION: - case FUNCTION_GEN: - case NEW: - case THIS: - case TYPEOF: - case VOID: - case LBRACE: - case LPAREN: - case LBRACKET: - case PLUS: - case MINUS: - case INCR: - case DECR: - case BANG: - case TILDE: - case DECIMAL_LITERAL: - case HEX_INTEGER_LITERAL: - case NULL_LITERAL: - case BOOLEAN_LITERAL: - case STRING_LITERAL: - case CODE_LITERAL: - case IDENTIFIER_NAME: - case REGULAR_EXPRESSION_LITERAL:{ - AssignmentExpression(); - break; - } - default: - jj_la1[127] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - } - } else { - switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { - case DELETE: - case FUNCTION: - case FUNCTION_GEN: - case NEW: - case THIS: - case TYPEOF: - case VOID: - case LBRACE: - case LPAREN: - case LBRACKET: - case PLUS: - case MINUS: - case INCR: - case DECR: - case BANG: - case TILDE: - case DECIMAL_LITERAL: - case HEX_INTEGER_LITERAL: - case NULL_LITERAL: - case BOOLEAN_LITERAL: - case STRING_LITERAL: - case CODE_LITERAL: - case IDENTIFIER_NAME: - case REGULAR_EXPRESSION_LITERAL:{ - ConditionalExpression(); - break; - } - default: - jj_la1[128] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - } - } catch (Throwable jjte000) { -if (jjtc000) { - jjtree.clearNodeScope(jjtn000); - jjtc000 = false; - } else { - jjtree.popNode(); - } - if (jjte000 instanceof RuntimeException) { - {if (true) throw (RuntimeException)jjte000;} - } - if (jjte000 instanceof ParseException) { - {if (true) throw (ParseException)jjte000;} - } - {if (true) throw (Error)jjte000;} - } finally { -if (jjtc000) { - jjtree.closeNodeScope(jjtn000, jjtree.nodeArity() > 1); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -} - - final public void AssignmentExpressionNoIn() throws ParseException {/*@bgen(jjtree) #AssignmentExpression(> 1) */ - ASTAssignmentExpression jjtn000 = new ASTAssignmentExpression(JJTASSIGNMENTEXPRESSION); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1)); - try { - if (jj_2_44(2147483647)) { - LeftHandSideExpression(); - AssignmentOperator(); - if (jj_2_43(2147483647)) { - ActionOnAssign(); - } else { - switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { - case DELETE: - case FUNCTION: - case FUNCTION_GEN: - case NEW: - case THIS: - case TYPEOF: - case VOID: - case LBRACE: - case LPAREN: - case LBRACKET: - case PLUS: - case MINUS: - case INCR: - case DECR: - case BANG: - case TILDE: - case DECIMAL_LITERAL: - case HEX_INTEGER_LITERAL: - case NULL_LITERAL: - case BOOLEAN_LITERAL: - case STRING_LITERAL: - case CODE_LITERAL: - case IDENTIFIER_NAME: - case REGULAR_EXPRESSION_LITERAL:{ - AssignmentExpressionNoIn(); - break; - } - default: - jj_la1[129] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - } - } else { - switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { - case DELETE: - case FUNCTION: - case FUNCTION_GEN: - case NEW: - case THIS: - case TYPEOF: - case VOID: - case LBRACE: - case LPAREN: - case LBRACKET: - case PLUS: - case MINUS: - case INCR: - case DECR: - case BANG: - case TILDE: - case DECIMAL_LITERAL: - case HEX_INTEGER_LITERAL: - case NULL_LITERAL: - case BOOLEAN_LITERAL: - case STRING_LITERAL: - case CODE_LITERAL: - case IDENTIFIER_NAME: - case REGULAR_EXPRESSION_LITERAL:{ - ConditionalExpressionNoIn(); - break; - } - default: - jj_la1[130] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - } - } catch (Throwable jjte000) { -if (jjtc000) { - jjtree.clearNodeScope(jjtn000); - jjtc000 = false; - } else { - jjtree.popNode(); - } - if (jjte000 instanceof RuntimeException) { - {if (true) throw (RuntimeException)jjte000;} - } - if (jjte000 instanceof ParseException) { - {if (true) throw (ParseException)jjte000;} - } - {if (true) throw (Error)jjte000;} - } finally { -if (jjtc000) { - jjtree.closeNodeScope(jjtn000, jjtree.nodeArity() > 1); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -} - - final public void AssignmentOperator() throws ParseException {/*@bgen(jjtree) Operator */ - ASTOperator jjtn000 = new ASTOperator(JJTOPERATOR); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1));Token op; - try { - switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { - case ASSIGN:{ - op = jj_consume_token(ASSIGN); - break; - } - case STARASSIGN:{ - op = jj_consume_token(STARASSIGN); - break; - } - case SLASHASSIGN:{ - op = jj_consume_token(SLASHASSIGN); - break; - } - case REMASSIGN:{ - op = jj_consume_token(REMASSIGN); - break; - } - case PLUSASSIGN:{ - op = jj_consume_token(PLUSASSIGN); - break; - } - case MINUSASSIGN:{ - op = jj_consume_token(MINUSASSIGN); - break; - } - case LSHIFTASSIGN:{ - op = jj_consume_token(LSHIFTASSIGN); - break; - } - case RSIGNEDSHIFTASSIGN:{ - op = jj_consume_token(RSIGNEDSHIFTASSIGN); - break; - } - case RUNSIGNEDSHIFTASSIGN:{ - op = jj_consume_token(RUNSIGNEDSHIFTASSIGN); - break; - } - case ANDASSIGN:{ - op = jj_consume_token(ANDASSIGN); - break; - } - case XORASSIGN:{ - op = jj_consume_token(XORASSIGN); - break; - } - case ORASSIGN:{ - op = jj_consume_token(ORASSIGN); - break; - } - default: - jj_la1[131] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } -jjtree.closeNodeScope(jjtn000, true); - jjtc000 = false; - jjtn000.jjtSetLastToken(getToken(0)); -jjtn000.jjtSetValue(op.image); - } finally { -if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -} - -/* Section 11.14: Comma Operator */ - final public - void Expression() throws ParseException {/*@bgen(jjtree) #ExpressionList(> 1) */ - ASTExpressionList jjtn000 = new ASTExpressionList(JJTEXPRESSIONLIST); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1)); - try { - AssignmentExpression(); - label_46: - while (true) { - switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { - case COMMA:{ - ; - break; - } - default: - jj_la1[132] = jj_gen; - break label_46; - } - jj_consume_token(COMMA); - AssignmentExpression(); - } - } catch (Throwable jjte000) { -if (jjtc000) { - jjtree.clearNodeScope(jjtn000); - jjtc000 = false; - } else { - jjtree.popNode(); - } - if (jjte000 instanceof RuntimeException) { - {if (true) throw (RuntimeException)jjte000;} - } - if (jjte000 instanceof ParseException) { - {if (true) throw (ParseException)jjte000;} - } - {if (true) throw (Error)jjte000;} - } finally { -if (jjtc000) { - jjtree.closeNodeScope(jjtn000, jjtree.nodeArity() > 1); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -} - - final public void ExpressionNoIn() throws ParseException { - AssignmentExpressionNoIn(); - label_47: - while (true) { - switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { - case COMMA:{ - ; - break; - } - default: - jj_la1[133] = jj_gen; - break label_47; - } - jj_consume_token(COMMA); - AssignmentExpressionNoIn(); - } -} - -/* Section 12: STATEMENTS */ - final public - void Statement() throws ParseException {{exprBraceCount =0;} - if (jj_2_45(2)) { - BodiedStatement(); - } else { - switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { - case CALL: - case RUN: - case CMD: - case INSERT: - case EXEC: - case OUTPUT_ACT: - case REPLACE: - case DEFINE: - case BREAK: - case CONTINUE: - case DELETE: - case FUNCTION: - case FUNCTION_GEN: - case NEW: - case RETURN: - case YIELD: - case THIS: - case TYPEOF: - case VAR: - case VOID: - case IMPORT: - case LBRACE: - case LPAREN: - case LBRACKET: - case SEMICOLON: - case PLUS: - case MINUS: - case INCR: - case DECR: - case BANG: - case TILDE: - case DECIMAL_LITERAL: - case HEX_INTEGER_LITERAL: - case NULL_LITERAL: - case BOOLEAN_LITERAL: - case STRING_LITERAL: - case CODE_LITERAL: - case IDENTIFIER_NAME: - case REGULAR_EXPRESSION_LITERAL:{ - SingleStatement(); - break; - } - default: - jj_la1[134] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - } -} - - final public void SingleStatement() throws ParseException { - try { - switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { - case INSERT: - case EXEC: - case OUTPUT_ACT: - case REPLACE: - case DEFINE:{ - SimpleAction(); - break; - } - default: - jj_la1[135] = jj_gen; - if (jj_2_46(2147483647)) { - Action(); - } else if (jj_2_47(2147483647)) { - Call(); - } else if (jj_2_48(2147483647)) { - Cmd(); - } else { - switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { - case RUN:{ - Run(); - break; - } - default: - jj_la1[136] = jj_gen; - if (jj_2_49(2147483647)) { - VariableStatement(); - } else { - switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { - case SEMICOLON:{ - EmptyStatement(); - break; - } - default: - jj_la1[137] = jj_gen; - if (jj_2_50(2147483647)) { - ExpressionStatement(); - } else if (jj_2_51(2147483647)) { - LabelledStatement(); - } else { - switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { - case CONTINUE:{ - ContinueStatement(); - break; - } - case YIELD:{ - YieldStatement(); - break; - } - case BREAK:{ - BreakStatement(); - break; - } - case IMPORT:{ - ImportStatement(); - break; - } - case RETURN:{ - ReturnStatement(); - break; - } - default: - jj_la1[138] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - } - } - } - } - } - } - } catch (ParseException e) { -error_skipto(e,SEMICOLON); - } catch (TokenMgrError error) { -exceptions.add(error); - if (exceptions.size() >= MAXIMUM_SYNTAX_EXCEPTIONS) { - Exception e = new larac.exceptions.LARACompilerException("Lexer problems", error); - error_skipto(new ParseException(error.getMessage()), SEMICOLON); - } - -// error_skipto(new ParseException(e.getMessage()),SEMICOLON); -// Exception e = new larac.exceptions.LARACompilerException("Lexer problems",error); -// exceptions.add(error); -// throw ; - - } -} - - final public void BodiedStatement() throws ParseException { - try { - switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { - case LBRACE:{ - Block(); - break; - } - case IF:{ - IfStatement(); - break; - } - case FOR: - case WHILE: - case DO:{ - IterationStatement(); - break; - } - case SWITCH:{ - SwitchStatement(); - break; - } - case WITH:{ - WithStatement(); - break; - } - case THROW:{ - ThrowStatement(); - break; - } - case TRY:{ - TryStatement(); - break; - } - default: - jj_la1[139] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - } catch (ParseException e) { -error_skipto(e,LBRACE); - } -} - -/* 12.1 Block Statement */ - final public - void Block() throws ParseException {/*@bgen(jjtree) Block */ - ASTBlock jjtn000 = new ASTBlock(JJTBLOCK); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1));Token begin, end; - try { - begin = jj_consume_token(LBRACE); - switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { - case CALL: - case RUN: - case CMD: - case INSERT: - case EXEC: - case OUTPUT_ACT: - case REPLACE: - case DEFINE: - case BREAK: - case CONTINUE: - case DELETE: - case FOR: - case FUNCTION: - case FUNCTION_GEN: - case IF: - case NEW: - case RETURN: - case YIELD: - case THIS: - case TYPEOF: - case VAR: - case VOID: - case WHILE: - case WITH: - case DO: - case IMPORT: - case SWITCH: - case THROW: - case TRY: - case LBRACE: - case LPAREN: - case LBRACKET: - case SEMICOLON: - case PLUS: - case MINUS: - case INCR: - case DECR: - case BANG: - case TILDE: - case DECIMAL_LITERAL: - case HEX_INTEGER_LITERAL: - case NULL_LITERAL: - case BOOLEAN_LITERAL: - case STRING_LITERAL: - case CODE_LITERAL: - case IDENTIFIER_NAME: - case REGULAR_EXPRESSION_LITERAL:{ - StatementList(); - break; - } - default: - jj_la1[140] = jj_gen; - ; - } - end = jj_consume_token(RBRACE); - } catch (Throwable jjte000) { -if (jjtc000) { - jjtree.clearNodeScope(jjtn000); - jjtc000 = false; - } else { - jjtree.popNode(); - } - if (jjte000 instanceof RuntimeException) { - {if (true) throw (RuntimeException)jjte000;} - } - if (jjte000 instanceof ParseException) { - {if (true) throw (ParseException)jjte000;} - } - {if (true) throw (Error)jjte000;} - } finally { -if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -} - - final public void StatementList() throws ParseException {/*@bgen(jjtree) #StatementList(> 1) */ - ASTStatementList jjtn000 = new ASTStatementList(JJTSTATEMENTLIST); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1)); - try { - label_48: - while (true) { - Statement(); - switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { - case CALL: - case RUN: - case CMD: - case INSERT: - case EXEC: - case OUTPUT_ACT: - case REPLACE: - case DEFINE: - case BREAK: - case CONTINUE: - case DELETE: - case FOR: - case FUNCTION: - case FUNCTION_GEN: - case IF: - case NEW: - case RETURN: - case YIELD: - case THIS: - case TYPEOF: - case VAR: - case VOID: - case WHILE: - case WITH: - case DO: - case IMPORT: - case SWITCH: - case THROW: - case TRY: - case LBRACE: - case LPAREN: - case LBRACKET: - case SEMICOLON: - case PLUS: - case MINUS: - case INCR: - case DECR: - case BANG: - case TILDE: - case DECIMAL_LITERAL: - case HEX_INTEGER_LITERAL: - case NULL_LITERAL: - case BOOLEAN_LITERAL: - case STRING_LITERAL: - case CODE_LITERAL: - case IDENTIFIER_NAME: - case REGULAR_EXPRESSION_LITERAL:{ - ; - break; - } - default: - jj_la1[141] = jj_gen; - break label_48; - } - } - } catch (Throwable jjte000) { -if (jjtc000) { - jjtree.clearNodeScope(jjtn000); - jjtc000 = false; - } else { - jjtree.popNode(); - } - if (jjte000 instanceof RuntimeException) { - {if (true) throw (RuntimeException)jjte000;} - } - if (jjte000 instanceof ParseException) { - {if (true) throw (ParseException)jjte000;} - } - {if (true) throw (Error)jjte000;} - } finally { -if (jjtc000) { - jjtree.closeNodeScope(jjtn000, jjtree.nodeArity() > 1); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -} - -/* Section 12.2: Variable statement */ - final public - void VariableStatement() throws ParseException {/*@bgen(jjtree) VariableStatement */ - ASTVariableStatement jjtn000 = new ASTVariableStatement(JJTVARIABLESTATEMENT); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1));Token begin, end; - try { - begin = jj_consume_token(VAR); - VariableDeclarationList(); - end = EndStatement(); - } catch (Throwable jjte000) { -if (jjtc000) { - jjtree.clearNodeScope(jjtn000); - jjtc000 = false; - } else { - jjtree.popNode(); - } - if (jjte000 instanceof RuntimeException) { - {if (true) throw (RuntimeException)jjte000;} - } - if (jjte000 instanceof ParseException) { - {if (true) throw (ParseException)jjte000;} - } - {if (true) throw (Error)jjte000;} - } finally { -if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -} - - final public void VariableDeclarationList() throws ParseException {/*@bgen(jjtree) #VariableDeclarationList(> 1) */ - ASTVariableDeclarationList jjtn000 = new ASTVariableDeclarationList(JJTVARIABLEDECLARATIONLIST); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1)); - try { - VariableDeclaration(); - label_49: - while (true) { - switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { - case COMMA:{ - ; - break; - } - default: - jj_la1[142] = jj_gen; - break label_49; - } - jj_consume_token(COMMA); - VariableDeclaration(); - } - } catch (Throwable jjte000) { -if (jjtc000) { - jjtree.clearNodeScope(jjtn000); - jjtc000 = false; - } else { - jjtree.popNode(); - } - if (jjte000 instanceof RuntimeException) { - {if (true) throw (RuntimeException)jjte000;} - } - if (jjte000 instanceof ParseException) { - {if (true) throw (ParseException)jjte000;} - } - {if (true) throw (Error)jjte000;} - } finally { -if (jjtc000) { - jjtree.closeNodeScope(jjtn000, jjtree.nodeArity() > 1); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -} - - final public void VariableDeclarationListNoIn() throws ParseException {/*@bgen(jjtree) #VariableDeclarationList(> 1) */ - ASTVariableDeclarationList jjtn000 = new ASTVariableDeclarationList(JJTVARIABLEDECLARATIONLIST); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1)); - try { - VariableDeclarationNoIn(); - label_50: - while (true) { - switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { - case COMMA:{ - ; - break; - } - default: - jj_la1[143] = jj_gen; - break label_50; - } - jj_consume_token(COMMA); - VariableDeclarationNoIn(); - } - } catch (Throwable jjte000) { -if (jjtc000) { - jjtree.clearNodeScope(jjtn000); - jjtc000 = false; - } else { - jjtree.popNode(); - } - if (jjte000 instanceof RuntimeException) { - {if (true) throw (RuntimeException)jjte000;} - } - if (jjte000 instanceof ParseException) { - {if (true) throw (ParseException)jjte000;} - } - {if (true) throw (Error)jjte000;} - } finally { -if (jjtc000) { - jjtree.closeNodeScope(jjtn000, jjtree.nodeArity() > 1); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -} - - final public void VariableDeclaration() throws ParseException {/*@bgen(jjtree) VariableDeclaration */ - ASTVariableDeclaration jjtn000 = new ASTVariableDeclaration(JJTVARIABLEDECLARATION); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1));Token type; - try { - Identifier(); - switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { - case COLON:{ - jj_consume_token(COLON); - type = getNoReservedIdentifier(); -jjtn000.setType(type.image); - break; - } - default: - jj_la1[144] = jj_gen; - ; - } - switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { - case ASSIGN:{ - Initialiser(); - break; - } - default: - jj_la1[145] = jj_gen; - ; - } - } catch (Throwable jjte000) { -if (jjtc000) { - jjtree.clearNodeScope(jjtn000); - jjtc000 = false; - } else { - jjtree.popNode(); - } - if (jjte000 instanceof RuntimeException) { - {if (true) throw (RuntimeException)jjte000;} - } - if (jjte000 instanceof ParseException) { - {if (true) throw (ParseException)jjte000;} - } - {if (true) throw (Error)jjte000;} - } finally { -if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -} - - final public void VariableDeclarationNoIn() throws ParseException { - Identifier(); -ASTEmptyExpression jjtn001 = new ASTEmptyExpression(JJTEMPTYEXPRESSION); - boolean jjtc001 = true; - jjtree.openNodeScope(jjtn001); - jjtn001.jjtSetFirstToken(getToken(1)); - try { - switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { - case ASSIGN:{ - InitialiserNoIn(); - break; - } - default: - jj_la1[146] = jj_gen; - ; - } - } catch (Throwable jjte001) { -if (jjtc001) { - jjtree.clearNodeScope(jjtn001); - jjtc001 = false; - } else { - jjtree.popNode(); - } - if (jjte001 instanceof RuntimeException) { - {if (true) throw (RuntimeException)jjte001;} - } - if (jjte001 instanceof ParseException) { - {if (true) throw (ParseException)jjte001;} - } - {if (true) throw (Error)jjte001;} - } finally { -if (jjtc001) { - jjtree.closeNodeScope(jjtn001, jjtree . nodeArity ( ) == 0); - jjtn001.jjtSetLastToken(getToken(0)); - } - } -} - - final public void Initialiser() throws ParseException { - jj_consume_token(ASSIGN); - if (jj_2_52(2147483647)) { - ActionOnAssign(); - } else { - switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { - case DELETE: - case FUNCTION: - case FUNCTION_GEN: - case NEW: - case THIS: - case TYPEOF: - case VOID: - case LBRACE: - case LPAREN: - case LBRACKET: - case PLUS: - case MINUS: - case INCR: - case DECR: - case BANG: - case TILDE: - case DECIMAL_LITERAL: - case HEX_INTEGER_LITERAL: - case NULL_LITERAL: - case BOOLEAN_LITERAL: - case STRING_LITERAL: - case CODE_LITERAL: - case IDENTIFIER_NAME: - case REGULAR_EXPRESSION_LITERAL:{ - AssignmentExpression(); - break; - } - default: - jj_la1[147] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - } -} - - final public void InitialiserNoIn() throws ParseException { - jj_consume_token(ASSIGN); - AssignmentExpressionNoIn(); -} - -/* Section 12.3: Empty Statement */ - final public - void EmptyStatement() throws ParseException {/*@bgen(jjtree) EmptyStatement */ - ASTEmptyStatement jjtn000 = new ASTEmptyStatement(JJTEMPTYSTATEMENT); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1)); - try { - jj_consume_token(SEMICOLON); - } finally { -if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -} - -/* Section 12.4: Expression Statement */ - final public - void ExpressionStatement() throws ParseException {/*@bgen(jjtree) ExpressionStatement */ - ASTExpressionStatement jjtn000 = new ASTExpressionStatement(JJTEXPRESSIONSTATEMENT); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1)); - try { - Expression(); - EndStatement(); - } catch (Throwable jjte000) { -if (jjtc000) { - jjtree.clearNodeScope(jjtn000); - jjtc000 = false; - } else { - jjtree.popNode(); - } - if (jjte000 instanceof RuntimeException) { - {if (true) throw (RuntimeException)jjte000;} - } - if (jjte000 instanceof ParseException) { - {if (true) throw (ParseException)jjte000;} - } - {if (true) throw (Error)jjte000;} - } finally { -if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -} - - final public ASTExpressionStatement ParseExpression() throws ParseException {/*@bgen(jjtree) ExpressionStatement */ - ASTExpressionStatement jjtn000 = new ASTExpressionStatement(JJTEXPRESSIONSTATEMENT); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1)); - try { - if (jj_2_53(2147483647)) { - CallExpression(); - } else { - switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { - case FUNCTION: - case FUNCTION_GEN: - case NEW: - case THIS: - case LBRACE: - case LPAREN: - case LBRACKET: - case DECIMAL_LITERAL: - case HEX_INTEGER_LITERAL: - case NULL_LITERAL: - case BOOLEAN_LITERAL: - case STRING_LITERAL: - case CODE_LITERAL: - case IDENTIFIER_NAME: - case REGULAR_EXPRESSION_LITERAL:{ - MemberExpression(); - break; - } - default: - jj_la1[148] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - } - jj_consume_token(0); -jjtree.closeNodeScope(jjtn000, true); - jjtc000 = false; - jjtn000.jjtSetLastToken(getToken(0)); -{if ("" != null) return jjtn000;} - } catch (Throwable jjte000) { -if (jjtc000) { - jjtree.clearNodeScope(jjtn000); - jjtc000 = false; - } else { - jjtree.popNode(); - } - if (jjte000 instanceof RuntimeException) { - {if (true) throw (RuntimeException)jjte000;} - } - if (jjte000 instanceof ParseException) { - {if (true) throw (ParseException)jjte000;} - } - {if (true) throw (Error)jjte000;} - } finally { -if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - jjtn000.jjtSetLastToken(getToken(0)); - } - } - throw new Error("Missing return statement in function"); -} - -/* Section 12.5: The if Statement */ - final public - void IfStatement() throws ParseException {/*@bgen(jjtree) IfStatement */ - ASTIfStatement jjtn000 = new ASTIfStatement(JJTIFSTATEMENT); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1));Token begin; - try { - begin = jj_consume_token(IF); - jj_consume_token(LPAREN); - Expression(); - jj_consume_token(RPAREN); - Statement(); - switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { - case ELSE:{ - jj_consume_token(ELSE); - Statement(); - break; - } - default: - jj_la1[149] = jj_gen; - ; - } - } catch (Throwable jjte000) { -if (jjtc000) { - jjtree.clearNodeScope(jjtn000); - jjtc000 = false; - } else { - jjtree.popNode(); - } - if (jjte000 instanceof RuntimeException) { - {if (true) throw (RuntimeException)jjte000;} - } - if (jjte000 instanceof ParseException) { - {if (true) throw (ParseException)jjte000;} - } - {if (true) throw (Error)jjte000;} - } finally { -if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -} - -/* Section 12.6: Iteration Statements */ - final public void IterationStatement() throws ParseException {Token begin;Token end; - switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { - case DO:{ - DoStatement(); - break; - } - case WHILE:{ - WhileStatement(); - break; - } - case FOR:{ - ForStatement(); - break; - } - default: - jj_la1[150] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } -} - - final public void DoStatement() throws ParseException {/*@bgen(jjtree) DoStatement */ - ASTDoStatement jjtn000 = new ASTDoStatement(JJTDOSTATEMENT); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1));Token begin, end; - try { - begin = jj_consume_token(DO); - Statement(); - end = jj_consume_token(WHILE); - jj_consume_token(LPAREN); - Expression(); - jj_consume_token(RPAREN); - EndStatement(); - } catch (Throwable jjte000) { -if (jjtc000) { - jjtree.clearNodeScope(jjtn000); - jjtc000 = false; - } else { - jjtree.popNode(); - } - if (jjte000 instanceof RuntimeException) { - {if (true) throw (RuntimeException)jjte000;} - } - if (jjte000 instanceof ParseException) { - {if (true) throw (ParseException)jjte000;} - } - {if (true) throw (Error)jjte000;} - } finally { -if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -} - - final public void WhileStatement() throws ParseException {/*@bgen(jjtree) WhileStatement */ - ASTWhileStatement jjtn000 = new ASTWhileStatement(JJTWHILESTATEMENT); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1));Token begin; - try { - begin = jj_consume_token(WHILE); - jj_consume_token(LPAREN); - Expression(); - jj_consume_token(RPAREN); - Statement(); - } catch (Throwable jjte000) { -if (jjtc000) { - jjtree.clearNodeScope(jjtn000); - jjtc000 = false; - } else { - jjtree.popNode(); - } - if (jjte000 instanceof RuntimeException) { - {if (true) throw (RuntimeException)jjte000;} - } - if (jjte000 instanceof ParseException) { - {if (true) throw (ParseException)jjte000;} - } - {if (true) throw (Error)jjte000;} - } finally { -if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -} - - final public void ForStatement() throws ParseException {Token begin;boolean isEach = false; - begin = jj_consume_token(FOR); - switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { - case EACH:{ - jj_consume_token(EACH); - jj_consume_token(LPAREN); - switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { - case VAR:{ -ASTForVarInStatement jjtn001 = new ASTForVarInStatement(JJTFORVARINSTATEMENT); - boolean jjtc001 = true; - jjtree.openNodeScope(jjtn001); - jjtn001.jjtSetFirstToken(getToken(1)); - try { - jj_consume_token(VAR); - VariableDeclarationNoIn(); - jj_consume_token(IN); - Expression(); - jj_consume_token(RPAREN); - Statement(); -jjtree.closeNodeScope(jjtn001, true); - jjtc001 = false; - jjtn001.jjtSetLastToken(getToken(0)); -jjtn001.setEach(true); - } catch (Throwable jjte001) { -if (jjtc001) { - jjtree.clearNodeScope(jjtn001); - jjtc001 = false; - } else { - jjtree.popNode(); - } - if (jjte001 instanceof RuntimeException) { - {if (true) throw (RuntimeException)jjte001;} - } - if (jjte001 instanceof ParseException) { - {if (true) throw (ParseException)jjte001;} - } - {if (true) throw (Error)jjte001;} - } finally { -if (jjtc001) { - jjtree.closeNodeScope(jjtn001, true); - jjtn001.jjtSetLastToken(getToken(0)); - } - } - break; - } - case FUNCTION: - case FUNCTION_GEN: - case THIS: - case LBRACE: - case LPAREN: - case LBRACKET: - case DECIMAL_LITERAL: - case HEX_INTEGER_LITERAL: - case NULL_LITERAL: - case BOOLEAN_LITERAL: - case STRING_LITERAL: - case CODE_LITERAL: - case IDENTIFIER_NAME: - case REGULAR_EXPRESSION_LITERAL:{ -ASTForInStatement jjtn002 = new ASTForInStatement(JJTFORINSTATEMENT); - boolean jjtc002 = true; - jjtree.openNodeScope(jjtn002); - jjtn002.jjtSetFirstToken(getToken(1)); - try { - LeftHandSideExpressionForIn(); - jj_consume_token(IN); - Expression(); - jj_consume_token(RPAREN); - Statement(); -jjtree.closeNodeScope(jjtn002, true); - jjtc002 = false; - jjtn002.jjtSetLastToken(getToken(0)); -jjtn002.setEach(true); - } catch (Throwable jjte002) { -if (jjtc002) { - jjtree.clearNodeScope(jjtn002); - jjtc002 = false; - } else { - jjtree.popNode(); - } - if (jjte002 instanceof RuntimeException) { - {if (true) throw (RuntimeException)jjte002;} - } - if (jjte002 instanceof ParseException) { - {if (true) throw (ParseException)jjte002;} - } - {if (true) throw (Error)jjte002;} - } finally { -if (jjtc002) { - jjtree.closeNodeScope(jjtn002, true); - jjtn002.jjtSetLastToken(getToken(0)); - } - } - break; - } - default: - jj_la1[151] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - break; - } - case LPAREN:{ - jj_consume_token(LPAREN); - if (jj_2_54(2147483647)) { -ASTForStatement jjtn009 = new ASTForStatement(JJTFORSTATEMENT); - boolean jjtc009 = true; - jjtree.openNodeScope(jjtn009); - jjtn009.jjtSetFirstToken(getToken(1)); - try { -ASTEmptyExpression jjtn004 = new ASTEmptyExpression(JJTEMPTYEXPRESSION); - boolean jjtc004 = true; - jjtree.openNodeScope(jjtn004); - jjtn004.jjtSetFirstToken(getToken(1)); - try { - switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { - case DELETE: - case FUNCTION: - case FUNCTION_GEN: - case NEW: - case THIS: - case TYPEOF: - case VOID: - case LBRACE: - case LPAREN: - case LBRACKET: - case PLUS: - case MINUS: - case INCR: - case DECR: - case BANG: - case TILDE: - case DECIMAL_LITERAL: - case HEX_INTEGER_LITERAL: - case NULL_LITERAL: - case BOOLEAN_LITERAL: - case STRING_LITERAL: - case CODE_LITERAL: - case IDENTIFIER_NAME: - case REGULAR_EXPRESSION_LITERAL:{ -ASTPreAssignmentList jjtn003 = new ASTPreAssignmentList(JJTPREASSIGNMENTLIST); - boolean jjtc003 = true; - jjtree.openNodeScope(jjtn003); - jjtn003.jjtSetFirstToken(getToken(1)); - try { - ExpressionNoIn(); - } catch (Throwable jjte003) { -if (jjtc003) { - jjtree.clearNodeScope(jjtn003); - jjtc003 = false; - } else { - jjtree.popNode(); - } - if (jjte003 instanceof RuntimeException) { - {if (true) throw (RuntimeException)jjte003;} - } - if (jjte003 instanceof ParseException) { - {if (true) throw (ParseException)jjte003;} - } - {if (true) throw (Error)jjte003;} - } finally { -if (jjtc003) { - jjtree.closeNodeScope(jjtn003, true); - jjtn003.jjtSetLastToken(getToken(0)); - } - } - break; - } - default: - jj_la1[152] = jj_gen; - ; - } - } catch (Throwable jjte004) { -if (jjtc004) { - jjtree.clearNodeScope(jjtn004); - jjtc004 = false; - } else { - jjtree.popNode(); - } - if (jjte004 instanceof RuntimeException) { - {if (true) throw (RuntimeException)jjte004;} - } - if (jjte004 instanceof ParseException) { - {if (true) throw (ParseException)jjte004;} - } - {if (true) throw (Error)jjte004;} - } finally { -if (jjtc004) { - jjtree.closeNodeScope(jjtn004, jjtree . nodeArity ( ) == 0); - jjtn004.jjtSetLastToken(getToken(0)); - } - } - jj_consume_token(SEMICOLON); -ASTEmptyExpression jjtn006 = new ASTEmptyExpression(JJTEMPTYEXPRESSION); - boolean jjtc006 = true; - jjtree.openNodeScope(jjtn006); - jjtn006.jjtSetFirstToken(getToken(1)); - try { - switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { - case DELETE: - case FUNCTION: - case FUNCTION_GEN: - case NEW: - case THIS: - case TYPEOF: - case VOID: - case LBRACE: - case LPAREN: - case LBRACKET: - case PLUS: - case MINUS: - case INCR: - case DECR: - case BANG: - case TILDE: - case DECIMAL_LITERAL: - case HEX_INTEGER_LITERAL: - case NULL_LITERAL: - case BOOLEAN_LITERAL: - case STRING_LITERAL: - case CODE_LITERAL: - case IDENTIFIER_NAME: - case REGULAR_EXPRESSION_LITERAL:{ -ASTForConditionList jjtn005 = new ASTForConditionList(JJTFORCONDITIONLIST); - boolean jjtc005 = true; - jjtree.openNodeScope(jjtn005); - jjtn005.jjtSetFirstToken(getToken(1)); - try { - Expression(); - } catch (Throwable jjte005) { -if (jjtc005) { - jjtree.clearNodeScope(jjtn005); - jjtc005 = false; - } else { - jjtree.popNode(); - } - if (jjte005 instanceof RuntimeException) { - {if (true) throw (RuntimeException)jjte005;} - } - if (jjte005 instanceof ParseException) { - {if (true) throw (ParseException)jjte005;} - } - {if (true) throw (Error)jjte005;} - } finally { -if (jjtc005) { - jjtree.closeNodeScope(jjtn005, true); - jjtn005.jjtSetLastToken(getToken(0)); - } - } - break; - } - default: - jj_la1[153] = jj_gen; - ; - } - } catch (Throwable jjte006) { -if (jjtc006) { - jjtree.clearNodeScope(jjtn006); - jjtc006 = false; - } else { - jjtree.popNode(); - } - if (jjte006 instanceof RuntimeException) { - {if (true) throw (RuntimeException)jjte006;} - } - if (jjte006 instanceof ParseException) { - {if (true) throw (ParseException)jjte006;} - } - {if (true) throw (Error)jjte006;} - } finally { -if (jjtc006) { - jjtree.closeNodeScope(jjtn006, jjtree . nodeArity ( ) == 0); - jjtn006.jjtSetLastToken(getToken(0)); - } - } - jj_consume_token(SEMICOLON); -ASTEmptyExpression jjtn008 = new ASTEmptyExpression(JJTEMPTYEXPRESSION); - boolean jjtc008 = true; - jjtree.openNodeScope(jjtn008); - jjtn008.jjtSetFirstToken(getToken(1)); - try { - switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { - case DELETE: - case FUNCTION: - case FUNCTION_GEN: - case NEW: - case THIS: - case TYPEOF: - case VOID: - case LBRACE: - case LPAREN: - case LBRACKET: - case PLUS: - case MINUS: - case INCR: - case DECR: - case BANG: - case TILDE: - case DECIMAL_LITERAL: - case HEX_INTEGER_LITERAL: - case NULL_LITERAL: - case BOOLEAN_LITERAL: - case STRING_LITERAL: - case CODE_LITERAL: - case IDENTIFIER_NAME: - case REGULAR_EXPRESSION_LITERAL:{ -ASTPostAssignmentList jjtn007 = new ASTPostAssignmentList(JJTPOSTASSIGNMENTLIST); - boolean jjtc007 = true; - jjtree.openNodeScope(jjtn007); - jjtn007.jjtSetFirstToken(getToken(1)); - try { - Expression(); - } catch (Throwable jjte007) { -if (jjtc007) { - jjtree.clearNodeScope(jjtn007); - jjtc007 = false; - } else { - jjtree.popNode(); - } - if (jjte007 instanceof RuntimeException) { - {if (true) throw (RuntimeException)jjte007;} - } - if (jjte007 instanceof ParseException) { - {if (true) throw (ParseException)jjte007;} - } - {if (true) throw (Error)jjte007;} - } finally { -if (jjtc007) { - jjtree.closeNodeScope(jjtn007, true); - jjtn007.jjtSetLastToken(getToken(0)); - } - } - break; - } - default: - jj_la1[154] = jj_gen; - ; - } - } catch (Throwable jjte008) { -if (jjtc008) { - jjtree.clearNodeScope(jjtn008); - jjtc008 = false; - } else { - jjtree.popNode(); - } - if (jjte008 instanceof RuntimeException) { - {if (true) throw (RuntimeException)jjte008;} - } - if (jjte008 instanceof ParseException) { - {if (true) throw (ParseException)jjte008;} - } - {if (true) throw (Error)jjte008;} - } finally { -if (jjtc008) { - jjtree.closeNodeScope(jjtn008, jjtree . nodeArity ( ) == 0); - jjtn008.jjtSetLastToken(getToken(0)); - } - } - jj_consume_token(RPAREN); - Statement(); - } catch (Throwable jjte009) { -if (jjtc009) { - jjtree.clearNodeScope(jjtn009); - jjtc009 = false; - } else { - jjtree.popNode(); - } - if (jjte009 instanceof RuntimeException) { - {if (true) throw (RuntimeException)jjte009;} - } - if (jjte009 instanceof ParseException) { - {if (true) throw (ParseException)jjte009;} - } - {if (true) throw (Error)jjte009;} - } finally { -if (jjtc009) { - jjtree.closeNodeScope(jjtn009, true); - jjtn009.jjtSetLastToken(getToken(0)); - } - } - } else if (jj_2_55(2147483647)) { -ASTForVarStatement jjtn015 = new ASTForVarStatement(JJTFORVARSTATEMENT); - boolean jjtc015 = true; - jjtree.openNodeScope(jjtn015); - jjtn015.jjtSetFirstToken(getToken(1)); - try { - jj_consume_token(VAR); -ASTPreAssignmentList jjtn010 = new ASTPreAssignmentList(JJTPREASSIGNMENTLIST); - boolean jjtc010 = true; - jjtree.openNodeScope(jjtn010); - jjtn010.jjtSetFirstToken(getToken(1)); - try { - VariableDeclarationList(); - } catch (Throwable jjte010) { -if (jjtc010) { - jjtree.clearNodeScope(jjtn010); - jjtc010 = false; - } else { - jjtree.popNode(); - } - if (jjte010 instanceof RuntimeException) { - {if (true) throw (RuntimeException)jjte010;} - } - if (jjte010 instanceof ParseException) { - {if (true) throw (ParseException)jjte010;} - } - {if (true) throw (Error)jjte010;} - } finally { -if (jjtc010) { - jjtree.closeNodeScope(jjtn010, true); - jjtn010.jjtSetLastToken(getToken(0)); - } - } - jj_consume_token(SEMICOLON); -ASTEmptyExpression jjtn012 = new ASTEmptyExpression(JJTEMPTYEXPRESSION); - boolean jjtc012 = true; - jjtree.openNodeScope(jjtn012); - jjtn012.jjtSetFirstToken(getToken(1)); - try { - switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { - case DELETE: - case FUNCTION: - case FUNCTION_GEN: - case NEW: - case THIS: - case TYPEOF: - case VOID: - case LBRACE: - case LPAREN: - case LBRACKET: - case PLUS: - case MINUS: - case INCR: - case DECR: - case BANG: - case TILDE: - case DECIMAL_LITERAL: - case HEX_INTEGER_LITERAL: - case NULL_LITERAL: - case BOOLEAN_LITERAL: - case STRING_LITERAL: - case CODE_LITERAL: - case IDENTIFIER_NAME: - case REGULAR_EXPRESSION_LITERAL:{ -ASTForConditionList jjtn011 = new ASTForConditionList(JJTFORCONDITIONLIST); - boolean jjtc011 = true; - jjtree.openNodeScope(jjtn011); - jjtn011.jjtSetFirstToken(getToken(1)); - try { - Expression(); - } catch (Throwable jjte011) { -if (jjtc011) { - jjtree.clearNodeScope(jjtn011); - jjtc011 = false; - } else { - jjtree.popNode(); - } - if (jjte011 instanceof RuntimeException) { - {if (true) throw (RuntimeException)jjte011;} - } - if (jjte011 instanceof ParseException) { - {if (true) throw (ParseException)jjte011;} - } - {if (true) throw (Error)jjte011;} - } finally { -if (jjtc011) { - jjtree.closeNodeScope(jjtn011, true); - jjtn011.jjtSetLastToken(getToken(0)); - } - } - break; - } - default: - jj_la1[155] = jj_gen; - ; - } - } catch (Throwable jjte012) { -if (jjtc012) { - jjtree.clearNodeScope(jjtn012); - jjtc012 = false; - } else { - jjtree.popNode(); - } - if (jjte012 instanceof RuntimeException) { - {if (true) throw (RuntimeException)jjte012;} - } - if (jjte012 instanceof ParseException) { - {if (true) throw (ParseException)jjte012;} - } - {if (true) throw (Error)jjte012;} - } finally { -if (jjtc012) { - jjtree.closeNodeScope(jjtn012, jjtree . nodeArity ( ) == 0); - jjtn012.jjtSetLastToken(getToken(0)); - } - } - jj_consume_token(SEMICOLON); -ASTEmptyExpression jjtn014 = new ASTEmptyExpression(JJTEMPTYEXPRESSION); - boolean jjtc014 = true; - jjtree.openNodeScope(jjtn014); - jjtn014.jjtSetFirstToken(getToken(1)); - try { - switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { - case DELETE: - case FUNCTION: - case FUNCTION_GEN: - case NEW: - case THIS: - case TYPEOF: - case VOID: - case LBRACE: - case LPAREN: - case LBRACKET: - case PLUS: - case MINUS: - case INCR: - case DECR: - case BANG: - case TILDE: - case DECIMAL_LITERAL: - case HEX_INTEGER_LITERAL: - case NULL_LITERAL: - case BOOLEAN_LITERAL: - case STRING_LITERAL: - case CODE_LITERAL: - case IDENTIFIER_NAME: - case REGULAR_EXPRESSION_LITERAL:{ -ASTPostAssignmentList jjtn013 = new ASTPostAssignmentList(JJTPOSTASSIGNMENTLIST); - boolean jjtc013 = true; - jjtree.openNodeScope(jjtn013); - jjtn013.jjtSetFirstToken(getToken(1)); - try { - Expression(); - } catch (Throwable jjte013) { -if (jjtc013) { - jjtree.clearNodeScope(jjtn013); - jjtc013 = false; - } else { - jjtree.popNode(); - } - if (jjte013 instanceof RuntimeException) { - {if (true) throw (RuntimeException)jjte013;} - } - if (jjte013 instanceof ParseException) { - {if (true) throw (ParseException)jjte013;} - } - {if (true) throw (Error)jjte013;} - } finally { -if (jjtc013) { - jjtree.closeNodeScope(jjtn013, true); - jjtn013.jjtSetLastToken(getToken(0)); - } - } - break; - } - default: - jj_la1[156] = jj_gen; - ; - } - } catch (Throwable jjte014) { -if (jjtc014) { - jjtree.clearNodeScope(jjtn014); - jjtc014 = false; - } else { - jjtree.popNode(); - } - if (jjte014 instanceof RuntimeException) { - {if (true) throw (RuntimeException)jjte014;} - } - if (jjte014 instanceof ParseException) { - {if (true) throw (ParseException)jjte014;} - } - {if (true) throw (Error)jjte014;} - } finally { -if (jjtc014) { - jjtree.closeNodeScope(jjtn014, jjtree . nodeArity ( ) == 0); - jjtn014.jjtSetLastToken(getToken(0)); - } - } - jj_consume_token(RPAREN); - Statement(); - } catch (Throwable jjte015) { -if (jjtc015) { - jjtree.clearNodeScope(jjtn015); - jjtc015 = false; - } else { - jjtree.popNode(); - } - if (jjte015 instanceof RuntimeException) { - {if (true) throw (RuntimeException)jjte015;} - } - if (jjte015 instanceof ParseException) { - {if (true) throw (ParseException)jjte015;} - } - {if (true) throw (Error)jjte015;} - } finally { -if (jjtc015) { - jjtree.closeNodeScope(jjtn015, true); - jjtn015.jjtSetLastToken(getToken(0)); - } - } - } else { - switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { - case VAR:{ -ASTForVarInStatement jjtn016 = new ASTForVarInStatement(JJTFORVARINSTATEMENT); - boolean jjtc016 = true; - jjtree.openNodeScope(jjtn016); - jjtn016.jjtSetFirstToken(getToken(1)); - try { - jj_consume_token(VAR); - VariableDeclarationNoIn(); - switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { - case IN:{ - jj_consume_token(IN); - break; - } - case OF:{ - jj_consume_token(OF); -isEach = true; - break; - } - default: - jj_la1[157] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - Expression(); - jj_consume_token(RPAREN); - Statement(); -jjtree.closeNodeScope(jjtn016, true); - jjtc016 = false; - jjtn016.jjtSetLastToken(getToken(0)); -jjtn016.setEach(isEach); - } catch (Throwable jjte016) { -if (jjtc016) { - jjtree.clearNodeScope(jjtn016); - jjtc016 = false; - } else { - jjtree.popNode(); - } - if (jjte016 instanceof RuntimeException) { - {if (true) throw (RuntimeException)jjte016;} - } - if (jjte016 instanceof ParseException) { - {if (true) throw (ParseException)jjte016;} - } - {if (true) throw (Error)jjte016;} - } finally { -if (jjtc016) { - jjtree.closeNodeScope(jjtn016, true); - jjtn016.jjtSetLastToken(getToken(0)); - } - } - break; - } - case FUNCTION: - case FUNCTION_GEN: - case THIS: - case LBRACE: - case LPAREN: - case LBRACKET: - case DECIMAL_LITERAL: - case HEX_INTEGER_LITERAL: - case NULL_LITERAL: - case BOOLEAN_LITERAL: - case STRING_LITERAL: - case CODE_LITERAL: - case IDENTIFIER_NAME: - case REGULAR_EXPRESSION_LITERAL:{ -ASTForInStatement jjtn017 = new ASTForInStatement(JJTFORINSTATEMENT); - boolean jjtc017 = true; - jjtree.openNodeScope(jjtn017); - jjtn017.jjtSetFirstToken(getToken(1)); - try { - LeftHandSideExpressionForIn(); - switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { - case IN:{ - jj_consume_token(IN); - break; - } - case OF:{ - jj_consume_token(OF); -isEach = true; - break; - } - default: - jj_la1[158] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - Expression(); - jj_consume_token(RPAREN); - Statement(); -jjtree.closeNodeScope(jjtn017, true); - jjtc017 = false; - jjtn017.jjtSetLastToken(getToken(0)); -jjtn017.setEach(isEach); - } catch (Throwable jjte017) { -if (jjtc017) { - jjtree.clearNodeScope(jjtn017); - jjtc017 = false; - } else { - jjtree.popNode(); - } - if (jjte017 instanceof RuntimeException) { - {if (true) throw (RuntimeException)jjte017;} - } - if (jjte017 instanceof ParseException) { - {if (true) throw (ParseException)jjte017;} - } - {if (true) throw (Error)jjte017;} - } finally { -if (jjtc017) { - jjtree.closeNodeScope(jjtn017, true); - jjtn017.jjtSetLastToken(getToken(0)); - } - } - break; - } - default: - jj_la1[159] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - } - break; - } - default: - jj_la1[160] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } -} - -/* Section 12.7: The continue Statement */ - final public - void ContinueStatement() throws ParseException {/*@bgen(jjtree) ContinueStatement */ - ASTContinueStatement jjtn000 = new ASTContinueStatement(JJTCONTINUESTATEMENT); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1));Token begin; - try { - begin = jj_consume_token(CONTINUE); - if (jj_2_56(2147483647)) { - LabelIdentifier(); - } else { - ; - } - EndStatement(); - } catch (Throwable jjte000) { -if (jjtc000) { - jjtree.clearNodeScope(jjtn000); - jjtc000 = false; - } else { - jjtree.popNode(); - } - if (jjte000 instanceof RuntimeException) { - {if (true) throw (RuntimeException)jjte000;} - } - if (jjte000 instanceof ParseException) { - {if (true) throw (ParseException)jjte000;} - } - {if (true) throw (Error)jjte000;} - } finally { -if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -} - -/* Section 12.8: The break Statement */ - final public - void BreakStatement() throws ParseException {/*@bgen(jjtree) BreakStatement */ - ASTBreakStatement jjtn000 = new ASTBreakStatement(JJTBREAKSTATEMENT); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1));Token begin; - try { - begin = jj_consume_token(BREAK); - if (jj_2_57(2147483647)) { - LabelIdentifier(); - } else { - ; - } - EndStatement(); - } catch (Throwable jjte000) { -if (jjtc000) { - jjtree.clearNodeScope(jjtn000); - jjtc000 = false; - } else { - jjtree.popNode(); - } - if (jjte000 instanceof RuntimeException) { - {if (true) throw (RuntimeException)jjte000;} - } - if (jjte000 instanceof ParseException) { - {if (true) throw (ParseException)jjte000;} - } - {if (true) throw (Error)jjte000;} - } finally { -if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -} - -/* Section 12.9 The return Statement */ - final public - void ReturnStatement() throws ParseException {/*@bgen(jjtree) ReturnStatement */ - ASTReturnStatement jjtn000 = new ASTReturnStatement(JJTRETURNSTATEMENT); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1)); - try { - jj_consume_token(RETURN); -ASTEmptyExpression jjtn001 = new ASTEmptyExpression(JJTEMPTYEXPRESSION); - boolean jjtc001 = true; - jjtree.openNodeScope(jjtn001); - jjtn001.jjtSetFirstToken(getToken(1)); - try { - if (jj_2_58(2147483647)) { - Expression(); - } else { - ; - } - } catch (Throwable jjte001) { -if (jjtc001) { - jjtree.clearNodeScope(jjtn001); - jjtc001 = false; - } else { - jjtree.popNode(); - } - if (jjte001 instanceof RuntimeException) { - {if (true) throw (RuntimeException)jjte001;} - } - if (jjte001 instanceof ParseException) { - {if (true) throw (ParseException)jjte001;} - } - {if (true) throw (Error)jjte001;} - } finally { -if (jjtc001) { - jjtree.closeNodeScope(jjtn001, jjtree . nodeArity ( ) == 0); - jjtn001.jjtSetLastToken(getToken(0)); - } - } - EndStatement(); - } catch (Throwable jjte000) { -if (jjtc000) { - jjtree.clearNodeScope(jjtn000); - jjtc000 = false; - } else { - jjtree.popNode(); - } - if (jjte000 instanceof RuntimeException) { - {if (true) throw (RuntimeException)jjte000;} - } - if (jjte000 instanceof ParseException) { - {if (true) throw (ParseException)jjte000;} - } - {if (true) throw (Error)jjte000;} - } finally { -if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -} - -/* Custom */ - final public void YieldStatement() throws ParseException {/*@bgen(jjtree) YieldStatement */ - ASTYieldStatement jjtn000 = new ASTYieldStatement(JJTYIELDSTATEMENT); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1));Token begin; - try { - begin = jj_consume_token(YIELD); - switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { - case STAR:{ - YieldStar(); - break; - } - default: - jj_la1[161] = jj_gen; - ; - } -ASTEmptyExpression jjtn001 = new ASTEmptyExpression(JJTEMPTYEXPRESSION); - boolean jjtc001 = true; - jjtree.openNodeScope(jjtn001); - jjtn001.jjtSetFirstToken(getToken(1)); - try { - if (jj_2_59(2147483647)) { - Expression(); - } else { - ; - } - } catch (Throwable jjte001) { -if (jjtc001) { - jjtree.clearNodeScope(jjtn001); - jjtc001 = false; - } else { - jjtree.popNode(); - } - if (jjte001 instanceof RuntimeException) { - {if (true) throw (RuntimeException)jjte001;} - } - if (jjte001 instanceof ParseException) { - {if (true) throw (ParseException)jjte001;} - } - {if (true) throw (Error)jjte001;} - } finally { -if (jjtc001) { - jjtree.closeNodeScope(jjtn001, jjtree . nodeArity ( ) == 0); - jjtn001.jjtSetLastToken(getToken(0)); - } - } - EndStatement(); - } catch (Throwable jjte000) { -if (jjtc000) { - jjtree.clearNodeScope(jjtn000); - jjtc000 = false; - } else { - jjtree.popNode(); - } - if (jjte000 instanceof RuntimeException) { - {if (true) throw (RuntimeException)jjte000;} - } - if (jjte000 instanceof ParseException) { - {if (true) throw (ParseException)jjte000;} - } - {if (true) throw (Error)jjte000;} - } finally { -if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -} - - final public void YieldStar() throws ParseException {/*@bgen(jjtree) YieldStar */ - ASTYieldStar jjtn000 = new ASTYieldStar(JJTYIELDSTAR); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1)); - try { - jj_consume_token(STAR); - } finally { -if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -} - -/* Section 12.10: The with Statement */ - final public - void WithStatement() throws ParseException {/*@bgen(jjtree) WithStatement */ - ASTWithStatement jjtn000 = new ASTWithStatement(JJTWITHSTATEMENT); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1)); - try { - jj_consume_token(WITH); - jj_consume_token(LPAREN); - Expression(); - jj_consume_token(RPAREN); - Statement(); - } catch (Throwable jjte000) { -if (jjtc000) { - jjtree.clearNodeScope(jjtn000); - jjtc000 = false; - } else { - jjtree.popNode(); - } - if (jjte000 instanceof RuntimeException) { - {if (true) throw (RuntimeException)jjte000;} - } - if (jjte000 instanceof ParseException) { - {if (true) throw (ParseException)jjte000;} - } - {if (true) throw (Error)jjte000;} - } finally { -if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -} - -/* 12.11 The switch Statement */ - final public - void SwitchStatement() throws ParseException {/*@bgen(jjtree) SwitchStatement */ - ASTSwitchStatement jjtn000 = new ASTSwitchStatement(JJTSWITCHSTATEMENT); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1));Token begin; - try { - begin = jj_consume_token(SWITCH); - jj_consume_token(LPAREN); - Expression(); - jj_consume_token(RPAREN); - CaseBlock(); - } catch (Throwable jjte000) { -if (jjtc000) { - jjtree.clearNodeScope(jjtn000); - jjtc000 = false; - } else { - jjtree.popNode(); - } - if (jjte000 instanceof RuntimeException) { - {if (true) throw (RuntimeException)jjte000;} - } - if (jjte000 instanceof ParseException) { - {if (true) throw (ParseException)jjte000;} - } - {if (true) throw (Error)jjte000;} - } finally { -if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -} - - final public void CaseBlock() throws ParseException {/*@bgen(jjtree) CaseGroups */ - ASTCaseGroups jjtn000 = new ASTCaseGroups(JJTCASEGROUPS); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1));Token begin,end; - try { - begin = jj_consume_token(LBRACE); - switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { - case CASE:{ - CaseClauses(); - break; - } - default: - jj_la1[162] = jj_gen; - ; - } - switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { - case RBRACE:{ - end = jj_consume_token(RBRACE); - break; - } - case _DEFAULT:{ - DefaultClause(); - switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { - case CASE:{ - CaseClauses(); - break; - } - default: - jj_la1[163] = jj_gen; - ; - } - end = jj_consume_token(RBRACE); - break; - } - default: - jj_la1[164] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - } catch (Throwable jjte000) { -if (jjtc000) { - jjtree.clearNodeScope(jjtn000); - jjtc000 = false; - } else { - jjtree.popNode(); - } - if (jjte000 instanceof RuntimeException) { - {if (true) throw (RuntimeException)jjte000;} - } - if (jjte000 instanceof ParseException) { - {if (true) throw (ParseException)jjte000;} - } - {if (true) throw (Error)jjte000;} - } finally { -if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -} - - final public void CaseClauses() throws ParseException { - label_51: - while (true) { - CaseClause(); - switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { - case CASE:{ - ; - break; - } - default: - jj_la1[165] = jj_gen; - break label_51; - } - } -} - - final public void CaseClause() throws ParseException {/*@bgen(jjtree) CaseGroup */ - ASTCaseGroup jjtn000 = new ASTCaseGroup(JJTCASEGROUP); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1));Token begin; - try { -ASTCaseGuard jjtn001 = new ASTCaseGuard(JJTCASEGUARD); - boolean jjtc001 = true; - jjtree.openNodeScope(jjtn001); - jjtn001.jjtSetFirstToken(getToken(1)); - try { - begin = jj_consume_token(CASE); - Expression(); - jj_consume_token(COLON); - } catch (Throwable jjte001) { -if (jjtc001) { - jjtree.clearNodeScope(jjtn001); - jjtc001 = false; - } else { - jjtree.popNode(); - } - if (jjte001 instanceof RuntimeException) { - {if (true) throw (RuntimeException)jjte001;} - } - if (jjte001 instanceof ParseException) { - {if (true) throw (ParseException)jjte001;} - } - {if (true) throw (Error)jjte001;} - } finally { -if (jjtc001) { - jjtree.closeNodeScope(jjtn001, true); - jjtn001.jjtSetLastToken(getToken(0)); - } - } - switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { - case CALL: - case RUN: - case CMD: - case INSERT: - case EXEC: - case OUTPUT_ACT: - case REPLACE: - case DEFINE: - case BREAK: - case CONTINUE: - case DELETE: - case FOR: - case FUNCTION: - case FUNCTION_GEN: - case IF: - case NEW: - case RETURN: - case YIELD: - case THIS: - case TYPEOF: - case VAR: - case VOID: - case WHILE: - case WITH: - case DO: - case IMPORT: - case SWITCH: - case THROW: - case TRY: - case LBRACE: - case LPAREN: - case LBRACKET: - case SEMICOLON: - case PLUS: - case MINUS: - case INCR: - case DECR: - case BANG: - case TILDE: - case DECIMAL_LITERAL: - case HEX_INTEGER_LITERAL: - case NULL_LITERAL: - case BOOLEAN_LITERAL: - case STRING_LITERAL: - case CODE_LITERAL: - case IDENTIFIER_NAME: - case REGULAR_EXPRESSION_LITERAL:{ - StatementList(); - break; - } - default: - jj_la1[166] = jj_gen; - ; - } - } catch (Throwable jjte000) { -if (jjtc000) { - jjtree.clearNodeScope(jjtn000); - jjtc000 = false; - } else { - jjtree.popNode(); - } - if (jjte000 instanceof RuntimeException) { - {if (true) throw (RuntimeException)jjte000;} - } - if (jjte000 instanceof ParseException) { - {if (true) throw (ParseException)jjte000;} - } - {if (true) throw (Error)jjte000;} - } finally { -if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -} - - final public void DefaultClause() throws ParseException {/*@bgen(jjtree) CaseGroup */ - ASTCaseGroup jjtn000 = new ASTCaseGroup(JJTCASEGROUP); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1));Token begin; - try { -ASTCaseGuard jjtn001 = new ASTCaseGuard(JJTCASEGUARD); - boolean jjtc001 = true; - jjtree.openNodeScope(jjtn001); - jjtn001.jjtSetFirstToken(getToken(1)); - try { - begin = jj_consume_token(_DEFAULT); - jj_consume_token(COLON); - } finally { -if (jjtc001) { - jjtree.closeNodeScope(jjtn001, true); - jjtn001.jjtSetLastToken(getToken(0)); - } - } - switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { - case CALL: - case RUN: - case CMD: - case INSERT: - case EXEC: - case OUTPUT_ACT: - case REPLACE: - case DEFINE: - case BREAK: - case CONTINUE: - case DELETE: - case FOR: - case FUNCTION: - case FUNCTION_GEN: - case IF: - case NEW: - case RETURN: - case YIELD: - case THIS: - case TYPEOF: - case VAR: - case VOID: - case WHILE: - case WITH: - case DO: - case IMPORT: - case SWITCH: - case THROW: - case TRY: - case LBRACE: - case LPAREN: - case LBRACKET: - case SEMICOLON: - case PLUS: - case MINUS: - case INCR: - case DECR: - case BANG: - case TILDE: - case DECIMAL_LITERAL: - case HEX_INTEGER_LITERAL: - case NULL_LITERAL: - case BOOLEAN_LITERAL: - case STRING_LITERAL: - case CODE_LITERAL: - case IDENTIFIER_NAME: - case REGULAR_EXPRESSION_LITERAL:{ - StatementList(); - break; - } - default: - jj_la1[167] = jj_gen; - ; - } - } catch (Throwable jjte000) { -if (jjtc000) { - jjtree.clearNodeScope(jjtn000); - jjtc000 = false; - } else { - jjtree.popNode(); - } - if (jjte000 instanceof RuntimeException) { - {if (true) throw (RuntimeException)jjte000;} - } - if (jjte000 instanceof ParseException) { - {if (true) throw (ParseException)jjte000;} - } - {if (true) throw (Error)jjte000;} - } finally { -if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -} - -/* Section 12.12: Labelled Statements */ - final public - void LabelledStatement() throws ParseException {/*@bgen(jjtree) LabelledStatement */ - ASTLabelledStatement jjtn000 = new ASTLabelledStatement(JJTLABELLEDSTATEMENT); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1)); - try { - Identifier(); - jj_consume_token(COLON); - Statement(); - } catch (Throwable jjte000) { -if (jjtc000) { - jjtree.clearNodeScope(jjtn000); - jjtc000 = false; - } else { - jjtree.popNode(); - } - if (jjte000 instanceof RuntimeException) { - {if (true) throw (RuntimeException)jjte000;} - } - if (jjte000 instanceof ParseException) { - {if (true) throw (ParseException)jjte000;} - } - {if (true) throw (Error)jjte000;} - } finally { -if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -} - - final public void ThrowStatement() throws ParseException {/*@bgen(jjtree) ThrowStatement */ - ASTThrowStatement jjtn000 = new ASTThrowStatement(JJTTHROWSTATEMENT); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1));Token begin; - try { - begin = jj_consume_token(THROW); - Expression(); - EndStatement(); - } catch (Throwable jjte000) { -if (jjtc000) { - jjtree.clearNodeScope(jjtn000); - jjtc000 = false; - } else { - jjtree.popNode(); - } - if (jjte000 instanceof RuntimeException) { - {if (true) throw (RuntimeException)jjte000;} - } - if (jjte000 instanceof ParseException) { - {if (true) throw (ParseException)jjte000;} - } - {if (true) throw (Error)jjte000;} - } finally { -if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -} - - final public void TryStatement() throws ParseException {/*@bgen(jjtree) TryStatement */ - ASTTryStatement jjtn000 = new ASTTryStatement(JJTTRYSTATEMENT); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1));Token begin; - try { - begin = jj_consume_token(TRY); - Block(); - switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { - case FINALLY:{ - Finally(); - break; - } - case CATCH:{ - Catch(); - switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { - case FINALLY:{ - Finally(); - break; - } - default: - jj_la1[168] = jj_gen; - ; - } - break; - } - default: - jj_la1[169] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - } catch (Throwable jjte000) { -if (jjtc000) { - jjtree.clearNodeScope(jjtn000); - jjtc000 = false; - } else { - jjtree.popNode(); - } - if (jjte000 instanceof RuntimeException) { - {if (true) throw (RuntimeException)jjte000;} - } - if (jjte000 instanceof ParseException) { - {if (true) throw (ParseException)jjte000;} - } - {if (true) throw (Error)jjte000;} - } finally { -if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -} - - final public void Catch() throws ParseException {/*@bgen(jjtree) CatchClause */ - ASTCatchClause jjtn000 = new ASTCatchClause(JJTCATCHCLAUSE); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1));Token begin; - try { - begin = jj_consume_token(CATCH); - jj_consume_token(LPAREN); - Identifier(); - jj_consume_token(RPAREN); - Block(); - } catch (Throwable jjte000) { -if (jjtc000) { - jjtree.clearNodeScope(jjtn000); - jjtc000 = false; - } else { - jjtree.popNode(); - } - if (jjte000 instanceof RuntimeException) { - {if (true) throw (RuntimeException)jjte000;} - } - if (jjte000 instanceof ParseException) { - {if (true) throw (ParseException)jjte000;} - } - {if (true) throw (Error)jjte000;} - } finally { -if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -} - - final public void Finally() throws ParseException {/*@bgen(jjtree) FinallyClause */ - ASTFinallyClause jjtn000 = new ASTFinallyClause(JJTFINALLYCLAUSE); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1));Token begin; - try { - begin = jj_consume_token(FINALLY); - Block(); - } catch (Throwable jjte000) { -if (jjtc000) { - jjtree.clearNodeScope(jjtn000); - jjtc000 = false; - } else { - jjtree.popNode(); - } - if (jjte000 instanceof RuntimeException) { - {if (true) throw (RuntimeException)jjte000;} - } - if (jjte000 instanceof ParseException) { - {if (true) throw (ParseException)jjte000;} - } - {if (true) throw (Error)jjte000;} - } finally { -if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -} - -/* Section 13: Function Definition */ - final public - void FunctionDeclaration() throws ParseException {/*@bgen(jjtree) FunctionDeclaration */ - ASTFunctionDeclaration jjtn000 = new ASTFunctionDeclaration(JJTFUNCTIONDECLARATION); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1));Token begin; - try { - begin = jj_consume_token(FUNCTION); - Identifier(); -ASTFormalParameterList jjtn001 = new ASTFormalParameterList(JJTFORMALPARAMETERLIST); - boolean jjtc001 = true; - jjtree.openNodeScope(jjtn001); - jjtn001.jjtSetFirstToken(getToken(1)); - try { - jj_consume_token(LPAREN); - switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { - case IDENTIFIER_NAME:{ - FormalParameterList(); - break; - } - default: - jj_la1[170] = jj_gen; - ; - } - jj_consume_token(RPAREN); - } catch (Throwable jjte001) { -if (jjtc001) { - jjtree.clearNodeScope(jjtn001); - jjtc001 = false; - } else { - jjtree.popNode(); - } - if (jjte001 instanceof RuntimeException) { - {if (true) throw (RuntimeException)jjte001;} - } - if (jjte001 instanceof ParseException) { - {if (true) throw (ParseException)jjte001;} - } - {if (true) throw (Error)jjte001;} - } finally { -if (jjtc001) { - jjtree.closeNodeScope(jjtn001, true); - jjtn001.jjtSetLastToken(getToken(0)); - } - } - FunctionBody(); - } catch (Throwable jjte000) { -if (jjtc000) { - jjtree.clearNodeScope(jjtn000); - jjtc000 = false; - } else { - jjtree.popNode(); - } - if (jjte000 instanceof RuntimeException) { - {if (true) throw (RuntimeException)jjte000;} - } - if (jjte000 instanceof ParseException) { - {if (true) throw (ParseException)jjte000;} - } - {if (true) throw (Error)jjte000;} - } finally { -if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -} - - final public void GeneratorFunctionDeclaration() throws ParseException {/*@bgen(jjtree) GeneratorFunctionDeclaration */ - ASTGeneratorFunctionDeclaration jjtn000 = new ASTGeneratorFunctionDeclaration(JJTGENERATORFUNCTIONDECLARATION); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1));Token begin; - try { - begin = jj_consume_token(FUNCTION_GEN); - Identifier(); -ASTFormalParameterList jjtn001 = new ASTFormalParameterList(JJTFORMALPARAMETERLIST); - boolean jjtc001 = true; - jjtree.openNodeScope(jjtn001); - jjtn001.jjtSetFirstToken(getToken(1)); - try { - jj_consume_token(LPAREN); - switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { - case IDENTIFIER_NAME:{ - FormalParameterList(); - break; - } - default: - jj_la1[171] = jj_gen; - ; - } - jj_consume_token(RPAREN); - } catch (Throwable jjte001) { -if (jjtc001) { - jjtree.clearNodeScope(jjtn001); - jjtc001 = false; - } else { - jjtree.popNode(); - } - if (jjte001 instanceof RuntimeException) { - {if (true) throw (RuntimeException)jjte001;} - } - if (jjte001 instanceof ParseException) { - {if (true) throw (ParseException)jjte001;} - } - {if (true) throw (Error)jjte001;} - } finally { -if (jjtc001) { - jjtree.closeNodeScope(jjtn001, true); - jjtn001.jjtSetLastToken(getToken(0)); - } - } - FunctionBody(); - } catch (Throwable jjte000) { -if (jjtc000) { - jjtree.clearNodeScope(jjtn000); - jjtc000 = false; - } else { - jjtree.popNode(); - } - if (jjte000 instanceof RuntimeException) { - {if (true) throw (RuntimeException)jjte000;} - } - if (jjte000 instanceof ParseException) { - {if (true) throw (ParseException)jjte000;} - } - {if (true) throw (Error)jjte000;} - } finally { -if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -} - - final public void ArrowFunctionBody() throws ParseException {/*@bgen(jjtree) Block */ - ASTBlock jjtn000 = new ASTBlock(JJTBLOCK); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1)); - try { - jj_consume_token(LBRACE); - label_52: - while (true) { - switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { - case CALL: - case RUN: - case CMD: - case INSERT: - case EXEC: - case OUTPUT_ACT: - case REPLACE: - case DEFINE: - case BREAK: - case CONTINUE: - case DELETE: - case FOR: - case FUNCTION: - case FUNCTION_GEN: - case IF: - case NEW: - case RETURN: - case YIELD: - case THIS: - case TYPEOF: - case VAR: - case VOID: - case WHILE: - case WITH: - case DO: - case IMPORT: - case SWITCH: - case THROW: - case TRY: - case LBRACE: - case LPAREN: - case LBRACKET: - case SEMICOLON: - case PLUS: - case MINUS: - case INCR: - case DECR: - case BANG: - case TILDE: - case DECIMAL_LITERAL: - case HEX_INTEGER_LITERAL: - case NULL_LITERAL: - case BOOLEAN_LITERAL: - case STRING_LITERAL: - case CODE_LITERAL: - case IDENTIFIER_NAME: - case REGULAR_EXPRESSION_LITERAL:{ - ; - break; - } - default: - jj_la1[172] = jj_gen; - break label_52; - } - Statement(); - } - jj_consume_token(RBRACE); - } catch (Throwable jjte000) { -if (jjtc000) { - jjtree.clearNodeScope(jjtn000); - jjtc000 = false; - } else { - jjtree.popNode(); - } - if (jjte000 instanceof RuntimeException) { - {if (true) throw (RuntimeException)jjte000;} - } - if (jjte000 instanceof ParseException) { - {if (true) throw (ParseException)jjte000;} - } - {if (true) throw (Error)jjte000;} - } finally { -if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -} - - final public void ArrowFunctionExpression() throws ParseException {/*@bgen(jjtree) ArrowFunctionExpression */ - ASTArrowFunctionExpression jjtn000 = new ASTArrowFunctionExpression(JJTARROWFUNCTIONEXPRESSION); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1)); - try { -ASTFormalParameterList jjtn001 = new ASTFormalParameterList(JJTFORMALPARAMETERLIST); - boolean jjtc001 = true; - jjtree.openNodeScope(jjtn001); - jjtn001.jjtSetFirstToken(getToken(1)); - try { - switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { - case LPAREN:{ - jj_consume_token(LPAREN); - switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { - case IDENTIFIER_NAME:{ - FormalParameterList(); - break; - } - default: - jj_la1[173] = jj_gen; - ; - } - jj_consume_token(RPAREN); - break; - } - case IDENTIFIER_NAME:{ - Identifier(); - break; - } - default: - jj_la1[174] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - } catch (Throwable jjte001) { -if (jjtc001) { - jjtree.clearNodeScope(jjtn001); - jjtc001 = false; - } else { - jjtree.popNode(); - } - if (jjte001 instanceof RuntimeException) { - {if (true) throw (RuntimeException)jjte001;} - } - if (jjte001 instanceof ParseException) { - {if (true) throw (ParseException)jjte001;} - } - {if (true) throw (Error)jjte001;} - } finally { -if (jjtc001) { - jjtree.closeNodeScope(jjtn001, true); - jjtn001.jjtSetLastToken(getToken(0)); - } - } - jj_consume_token(ARROW); - if (jj_2_60(2147483647)) { - ArrowFunctionBody(); - } else if (jj_2_61(2147483647)) { - ExpressionNoIn(); - } else { - jj_consume_token(-1); - throw new ParseException(); - } - } catch (Throwable jjte000) { -if (jjtc000) { - jjtree.clearNodeScope(jjtn000); - jjtc000 = false; - } else { - jjtree.popNode(); - } - if (jjte000 instanceof RuntimeException) { - {if (true) throw (RuntimeException)jjte000;} - } - if (jjte000 instanceof ParseException) { - {if (true) throw (ParseException)jjte000;} - } - {if (true) throw (Error)jjte000;} - } finally { -if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -} - - final public void FunctionExpression() throws ParseException {/*@bgen(jjtree) FunctionExpression */ - ASTFunctionExpression jjtn000 = new ASTFunctionExpression(JJTFUNCTIONEXPRESSION); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1));Token begin; - try { - begin = jj_consume_token(FUNCTION); - switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { - case IDENTIFIER_NAME:{ - Identifier(); - break; - } - default: - jj_la1[175] = jj_gen; - ; - } -ASTFormalParameterList jjtn001 = new ASTFormalParameterList(JJTFORMALPARAMETERLIST); - boolean jjtc001 = true; - jjtree.openNodeScope(jjtn001); - jjtn001.jjtSetFirstToken(getToken(1)); - try { - jj_consume_token(LPAREN); - switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { - case IDENTIFIER_NAME:{ - FormalParameterList(); - break; - } - default: - jj_la1[176] = jj_gen; - ; - } - jj_consume_token(RPAREN); - } catch (Throwable jjte001) { -if (jjtc001) { - jjtree.clearNodeScope(jjtn001); - jjtc001 = false; - } else { - jjtree.popNode(); - } - if (jjte001 instanceof RuntimeException) { - {if (true) throw (RuntimeException)jjte001;} - } - if (jjte001 instanceof ParseException) { - {if (true) throw (ParseException)jjte001;} - } - {if (true) throw (Error)jjte001;} - } finally { -if (jjtc001) { - jjtree.closeNodeScope(jjtn001, true); - jjtn001.jjtSetLastToken(getToken(0)); - } - } - FunctionBody(); - } catch (Throwable jjte000) { -if (jjtc000) { - jjtree.clearNodeScope(jjtn000); - jjtc000 = false; - } else { - jjtree.popNode(); - } - if (jjte000 instanceof RuntimeException) { - {if (true) throw (RuntimeException)jjte000;} - } - if (jjte000 instanceof ParseException) { - {if (true) throw (ParseException)jjte000;} - } - {if (true) throw (Error)jjte000;} - } finally { -if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -} - - final public void GeneratorFunctionExpression() throws ParseException {/*@bgen(jjtree) GeneratorFunctionExpression */ - ASTGeneratorFunctionExpression jjtn000 = new ASTGeneratorFunctionExpression(JJTGENERATORFUNCTIONEXPRESSION); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1));Token begin; - try { - begin = jj_consume_token(FUNCTION_GEN); - switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { - case IDENTIFIER_NAME:{ - Identifier(); - break; - } - default: - jj_la1[177] = jj_gen; - ; - } -ASTFormalParameterList jjtn001 = new ASTFormalParameterList(JJTFORMALPARAMETERLIST); - boolean jjtc001 = true; - jjtree.openNodeScope(jjtn001); - jjtn001.jjtSetFirstToken(getToken(1)); - try { - jj_consume_token(LPAREN); - switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { - case IDENTIFIER_NAME:{ - FormalParameterList(); - break; - } - default: - jj_la1[178] = jj_gen; - ; - } - jj_consume_token(RPAREN); - } catch (Throwable jjte001) { -if (jjtc001) { - jjtree.clearNodeScope(jjtn001); - jjtc001 = false; - } else { - jjtree.popNode(); - } - if (jjte001 instanceof RuntimeException) { - {if (true) throw (RuntimeException)jjte001;} - } - if (jjte001 instanceof ParseException) { - {if (true) throw (ParseException)jjte001;} - } - {if (true) throw (Error)jjte001;} - } finally { -if (jjtc001) { - jjtree.closeNodeScope(jjtn001, true); - jjtn001.jjtSetLastToken(getToken(0)); - } - } - FunctionBody(); - } catch (Throwable jjte000) { -if (jjtc000) { - jjtree.clearNodeScope(jjtn000); - jjtc000 = false; - } else { - jjtree.popNode(); - } - if (jjte000 instanceof RuntimeException) { - {if (true) throw (RuntimeException)jjte000;} - } - if (jjte000 instanceof ParseException) { - {if (true) throw (ParseException)jjte000;} - } - {if (true) throw (Error)jjte000;} - } finally { -if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -} - - final public void FormalParameterList() throws ParseException { - Identifier(); - label_53: - while (true) { - switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { - case COMMA:{ - ; - break; - } - default: - jj_la1[179] = jj_gen; - break label_53; - } - jj_consume_token(COMMA); - Identifier(); - } -} - - final public void FunctionBody() throws ParseException {/*@bgen(jjtree) Block */ - ASTBlock jjtn000 = new ASTBlock(JJTBLOCK); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1)); - try { - jj_consume_token(LBRACE); - switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { - case CALL: - case RUN: - case CMD: - case INSERT: - case EXEC: - case OUTPUT_ACT: - case REPLACE: - case DEFINE: - case BREAK: - case CONTINUE: - case DELETE: - case FOR: - case FUNCTION: - case FUNCTION_GEN: - case IF: - case NEW: - case RETURN: - case YIELD: - case THIS: - case TYPEOF: - case VAR: - case VOID: - case WHILE: - case WITH: - case DO: - case IMPORT: - case SWITCH: - case THROW: - case TRY: - case LBRACE: - case LPAREN: - case LBRACKET: - case SEMICOLON: - case PLUS: - case MINUS: - case INCR: - case DECR: - case BANG: - case TILDE: - case DECIMAL_LITERAL: - case HEX_INTEGER_LITERAL: - case NULL_LITERAL: - case BOOLEAN_LITERAL: - case STRING_LITERAL: - case CODE_LITERAL: - case IDENTIFIER_NAME: - case REGULAR_EXPRESSION_LITERAL:{ - SourceElements(); - break; - } - default: - jj_la1[180] = jj_gen; - ; - } - jj_consume_token(RBRACE); - } catch (Throwable jjte000) { -if (jjtc000) { - jjtree.clearNodeScope(jjtn000); - jjtc000 = false; - } else { - jjtree.popNode(); - } - if (jjte000 instanceof RuntimeException) { - {if (true) throw (RuntimeException)jjte000;} - } - if (jjte000 instanceof ParseException) { - {if (true) throw (ParseException)jjte000;} - } - {if (true) throw (Error)jjte000;} - } finally { -if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -} - -/* Section 14: Program * - - ASTProgram Program() #Program : - {} - { - JavaScript() - - { return jjtThis; } - } - /**/ - final public - void JavaScript() throws ParseException {/*@bgen(jjtree) JavaScript */ - ASTJavaScript jjtn000 = new ASTJavaScript(JJTJAVASCRIPT); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1)); - try { - switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { - case CALL: - case RUN: - case CMD: - case INSERT: - case EXEC: - case OUTPUT_ACT: - case REPLACE: - case DEFINE: - case BREAK: - case CONTINUE: - case DELETE: - case FOR: - case FUNCTION: - case FUNCTION_GEN: - case IF: - case NEW: - case RETURN: - case YIELD: - case THIS: - case TYPEOF: - case VAR: - case VOID: - case WHILE: - case WITH: - case DO: - case IMPORT: - case SWITCH: - case THROW: - case TRY: - case LBRACE: - case LPAREN: - case LBRACKET: - case SEMICOLON: - case PLUS: - case MINUS: - case INCR: - case DECR: - case BANG: - case TILDE: - case DECIMAL_LITERAL: - case HEX_INTEGER_LITERAL: - case NULL_LITERAL: - case BOOLEAN_LITERAL: - case STRING_LITERAL: - case CODE_LITERAL: - case IDENTIFIER_NAME: - case REGULAR_EXPRESSION_LITERAL:{ - SourceElements(); - break; - } - default: - jj_la1[181] = jj_gen; - ; - } - } catch (Throwable jjte000) { -if (jjtc000) { - jjtree.clearNodeScope(jjtn000); - jjtc000 = false; - } else { - jjtree.popNode(); - } - if (jjte000 instanceof RuntimeException) { - {if (true) throw (RuntimeException)jjte000;} - } - if (jjte000 instanceof ParseException) { - {if (true) throw (ParseException)jjte000;} - } - {if (true) throw (Error)jjte000;} - } finally { -if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -} - - final public void SourceElements() throws ParseException { - label_54: - while (true) { - SourceElement(); - switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { - case CALL: - case RUN: - case CMD: - case INSERT: - case EXEC: - case OUTPUT_ACT: - case REPLACE: - case DEFINE: - case BREAK: - case CONTINUE: - case DELETE: - case FOR: - case FUNCTION: - case FUNCTION_GEN: - case IF: - case NEW: - case RETURN: - case YIELD: - case THIS: - case TYPEOF: - case VAR: - case VOID: - case WHILE: - case WITH: - case DO: - case IMPORT: - case SWITCH: - case THROW: - case TRY: - case LBRACE: - case LPAREN: - case LBRACKET: - case SEMICOLON: - case PLUS: - case MINUS: - case INCR: - case DECR: - case BANG: - case TILDE: - case DECIMAL_LITERAL: - case HEX_INTEGER_LITERAL: - case NULL_LITERAL: - case BOOLEAN_LITERAL: - case STRING_LITERAL: - case CODE_LITERAL: - case IDENTIFIER_NAME: - case REGULAR_EXPRESSION_LITERAL:{ - ; - break; - } - default: - jj_la1[182] = jj_gen; - break label_54; - } - } -} - - final public void SourceElement() throws ParseException { - if (jj_2_62(2147483647)) { - GeneratorFunctionDeclaration(); - } else if (jj_2_63(2147483647)) { - FunctionDeclaration(); - } else { - switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { - case CALL: - case RUN: - case CMD: - case INSERT: - case EXEC: - case OUTPUT_ACT: - case REPLACE: - case DEFINE: - case BREAK: - case CONTINUE: - case DELETE: - case FOR: - case FUNCTION: - case FUNCTION_GEN: - case IF: - case NEW: - case RETURN: - case YIELD: - case THIS: - case TYPEOF: - case VAR: - case VOID: - case WHILE: - case WITH: - case DO: - case IMPORT: - case SWITCH: - case THROW: - case TRY: - case LBRACE: - case LPAREN: - case LBRACKET: - case SEMICOLON: - case PLUS: - case MINUS: - case INCR: - case DECR: - case BANG: - case TILDE: - case DECIMAL_LITERAL: - case HEX_INTEGER_LITERAL: - case NULL_LITERAL: - case BOOLEAN_LITERAL: - case STRING_LITERAL: - case CODE_LITERAL: - case IDENTIFIER_NAME: - case REGULAR_EXPRESSION_LITERAL:{ - Statement(); - break; - } - default: - jj_la1[183] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - } -} - -/* - * Grammar for parsing JScript .NET contructs: ( import System; var contents : - * String = reader.ReadToEnd(); ) Refer: src/hostenv_jsc.js - */ - final public - void ImportStatement() throws ParseException { - jj_consume_token(IMPORT); - Name(); - switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { - case DOT:{ - jj_consume_token(DOT); - jj_consume_token(STAR); - break; - } - default: - jj_la1[184] = jj_gen; - ; - } - EndStatement(); -} - - final public void Name() throws ParseException { - jj_consume_token(IDENTIFIER_NAME); - label_55: - while (true) { - if (jj_2_64(2)) { - ; - } else { - break label_55; - } - jj_consume_token(DOT); - jj_consume_token(IDENTIFIER_NAME); - } -} - - final public void JScriptVarStatement() throws ParseException {/*@bgen(jjtree) VariableStatement */ - ASTVariableStatement jjtn000 = new ASTVariableStatement(JJTVARIABLESTATEMENT); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1)); - try { - jj_consume_token(VAR); - JScriptVarDeclarationList(); - EndStatement(); - } catch (Throwable jjte000) { -if (jjtc000) { - jjtree.clearNodeScope(jjtn000); - jjtc000 = false; - } else { - jjtree.popNode(); - } - if (jjte000 instanceof RuntimeException) { - {if (true) throw (RuntimeException)jjte000;} - } - if (jjte000 instanceof ParseException) { - {if (true) throw (ParseException)jjte000;} - } - {if (true) throw (Error)jjte000;} - } finally { -if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -} - - final public void JScriptVarDeclarationList() throws ParseException {/*@bgen(jjtree) #VariableDeclarationList(> 1) */ - ASTVariableDeclarationList jjtn000 = new ASTVariableDeclarationList(JJTVARIABLEDECLARATIONLIST); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1)); - try { - JScriptVarDeclaration(); - label_56: - while (true) { - switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { - case COMMA:{ - ; - break; - } - default: - jj_la1[185] = jj_gen; - break label_56; - } - jj_consume_token(COMMA); - JScriptVarDeclaration(); - } - } catch (Throwable jjte000) { -if (jjtc000) { - jjtree.clearNodeScope(jjtn000); - jjtc000 = false; - } else { - jjtree.popNode(); - } - if (jjte000 instanceof RuntimeException) { - {if (true) throw (RuntimeException)jjte000;} - } - if (jjte000 instanceof ParseException) { - {if (true) throw (ParseException)jjte000;} - } - {if (true) throw (Error)jjte000;} - } finally { -if (jjtc000) { - jjtree.closeNodeScope(jjtn000, jjtree.nodeArity() > 1); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -} - - final public void JScriptVarDeclaration() throws ParseException {/*@bgen(jjtree) VariableDeclaration */ - ASTVariableDeclaration jjtn000 = new ASTVariableDeclaration(JJTVARIABLEDECLARATION); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1)); - try { - Identifier(); - jj_consume_token(COLON); - jj_consume_token(IDENTIFIER_NAME); - switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { - case ASSIGN:{ - Initialiser(); - break; - } - default: - jj_la1[186] = jj_gen; - ; - } - } catch (Throwable jjte000) { -if (jjtc000) { - jjtree.clearNodeScope(jjtn000); - jjtc000 = false; - } else { - jjtree.popNode(); - } - if (jjte000 instanceof RuntimeException) { - {if (true) throw (RuntimeException)jjte000;} - } - if (jjte000 instanceof ParseException) { - {if (true) throw (ParseException)jjte000;} - } - {if (true) throw (Error)jjte000;} - } finally { -if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -} - - final public Token EndStatement() throws ParseException {Token end; - try { - end = jj_consume_token(SEMICOLON); -{if ("" != null) return end;} - } catch (ParseException e) { -if(e.expectedTokenSet.size() > MAX_EXCEPTION_TOKEN_SIZE - || (e.expectedTokenSet.size() == 1 && e.expectedTokenSet.get(0).equals(";"))){ - - Token foundToken = getToken(1); - String line = "at line " + e.currentToken.beginLine + ", column " + e.currentToken.beginColumn; - String message = line+": did you forget a ';'?"; - if (foundToken != null){ - message+=" (possible errant token: "+ foundToken + ")"; - } - e = new ParseException(message); - SimpleNode currNode = getCurrentNode(); - exceptions.add(e); - ParseExceptionData excData = new ParseExceptionData(e); - if (currNode != null){ - currNode.setExceptionData(excData); - } - }else{ - error_skipto(e, SEMICOLON); - } - - // - - } -{if ("" != null) return new Token(SEMICOLON);} - throw new Error("Missing return statement in function"); -} - - void error_skipto(ParseException e, int kind) throws ParseException {// ParseException e = generateParseException(); // generate the exception object. -// System.out.println(e.toString()); // print the error message - exceptions.add(e); - SimpleNode currNode = getCurrentNode(); - ParseExceptionData excData = new ParseExceptionData(e); - excData.setSkippedToToken(kind); - Token t = null; -// int braceCount = 0; - skipper: do { - Token test = getToken(1); -// System.out.println(exprBraceCount); - if(test == null || test.kind == END) - { -// System.out.println("I'm breaking here with:"+test); - break; - } - switch(test.kind) - { - case RBRACE: - exprBraceCount--; - if(exprBraceCount < 0) - break skipper; - break; - } - - - t = getNextToken(); - - if(t != null) - excData.addSkippedToken(t); -// System.out.println("Skipped: "+t+" token("+test+")"); - } while (t != null && (t.kind != kind && t.kind != EOF)); - // The above loop consumes tokens all the way up to a token of -// "kind". We use a do-while loop rather than a while because the -// current token is the one immediately before the erroneous token -// (in our case the token immediately before what should have been -// "if"/"while". - - if (currNode != null){ - currNode.setExceptionData(excData); - } - if(t == null || t.kind == EOF){ - throw new StopParseException(); - } - } - - void error_noSkip(ParseException e) throws ParseException {System.out.println("--------------NO SKIP-----------------"); -// ParseException e = generateParseException(); // generate the exception object. -// System.out.println(e.toString()); // print the error message - SimpleNode currNode = getCurrentNode(); - ParseExceptionData excData = new ParseExceptionData(e); - if (currNode != null){ - currNode.setExceptionData(excData); - } - } - - private boolean jj_2_1(int xla) - { - jj_la = xla; jj_lastpos = jj_scanpos = token; - try { return (!jj_3_1()); } - catch(LookaheadSuccess ls) { return true; } - finally { jj_save(0, xla); } - } - - private boolean jj_2_2(int xla) - { - jj_la = xla; jj_lastpos = jj_scanpos = token; - try { return (!jj_3_2()); } - catch(LookaheadSuccess ls) { return true; } - finally { jj_save(1, xla); } - } - - private boolean jj_2_3(int xla) - { - jj_la = xla; jj_lastpos = jj_scanpos = token; - try { return (!jj_3_3()); } - catch(LookaheadSuccess ls) { return true; } - finally { jj_save(2, xla); } - } - - private boolean jj_2_4(int xla) - { - jj_la = xla; jj_lastpos = jj_scanpos = token; - try { return (!jj_3_4()); } - catch(LookaheadSuccess ls) { return true; } - finally { jj_save(3, xla); } - } - - private boolean jj_2_5(int xla) - { - jj_la = xla; jj_lastpos = jj_scanpos = token; - try { return (!jj_3_5()); } - catch(LookaheadSuccess ls) { return true; } - finally { jj_save(4, xla); } - } - - private boolean jj_2_6(int xla) - { - jj_la = xla; jj_lastpos = jj_scanpos = token; - try { return (!jj_3_6()); } - catch(LookaheadSuccess ls) { return true; } - finally { jj_save(5, xla); } - } - - private boolean jj_2_7(int xla) - { - jj_la = xla; jj_lastpos = jj_scanpos = token; - try { return (!jj_3_7()); } - catch(LookaheadSuccess ls) { return true; } - finally { jj_save(6, xla); } - } - - private boolean jj_2_8(int xla) - { - jj_la = xla; jj_lastpos = jj_scanpos = token; - try { return (!jj_3_8()); } - catch(LookaheadSuccess ls) { return true; } - finally { jj_save(7, xla); } - } - - private boolean jj_2_9(int xla) - { - jj_la = xla; jj_lastpos = jj_scanpos = token; - try { return (!jj_3_9()); } - catch(LookaheadSuccess ls) { return true; } - finally { jj_save(8, xla); } - } - - private boolean jj_2_10(int xla) - { - jj_la = xla; jj_lastpos = jj_scanpos = token; - try { return (!jj_3_10()); } - catch(LookaheadSuccess ls) { return true; } - finally { jj_save(9, xla); } - } - - private boolean jj_2_11(int xla) - { - jj_la = xla; jj_lastpos = jj_scanpos = token; - try { return (!jj_3_11()); } - catch(LookaheadSuccess ls) { return true; } - finally { jj_save(10, xla); } - } - - private boolean jj_2_12(int xla) - { - jj_la = xla; jj_lastpos = jj_scanpos = token; - try { return (!jj_3_12()); } - catch(LookaheadSuccess ls) { return true; } - finally { jj_save(11, xla); } - } - - private boolean jj_2_13(int xla) - { - jj_la = xla; jj_lastpos = jj_scanpos = token; - try { return (!jj_3_13()); } - catch(LookaheadSuccess ls) { return true; } - finally { jj_save(12, xla); } - } - - private boolean jj_2_14(int xla) - { - jj_la = xla; jj_lastpos = jj_scanpos = token; - try { return (!jj_3_14()); } - catch(LookaheadSuccess ls) { return true; } - finally { jj_save(13, xla); } - } - - private boolean jj_2_15(int xla) - { - jj_la = xla; jj_lastpos = jj_scanpos = token; - try { return (!jj_3_15()); } - catch(LookaheadSuccess ls) { return true; } - finally { jj_save(14, xla); } - } - - private boolean jj_2_16(int xla) - { - jj_la = xla; jj_lastpos = jj_scanpos = token; - try { return (!jj_3_16()); } - catch(LookaheadSuccess ls) { return true; } - finally { jj_save(15, xla); } - } - - private boolean jj_2_17(int xla) - { - jj_la = xla; jj_lastpos = jj_scanpos = token; - try { return (!jj_3_17()); } - catch(LookaheadSuccess ls) { return true; } - finally { jj_save(16, xla); } - } - - private boolean jj_2_18(int xla) - { - jj_la = xla; jj_lastpos = jj_scanpos = token; - try { return (!jj_3_18()); } - catch(LookaheadSuccess ls) { return true; } - finally { jj_save(17, xla); } - } - - private boolean jj_2_19(int xla) - { - jj_la = xla; jj_lastpos = jj_scanpos = token; - try { return (!jj_3_19()); } - catch(LookaheadSuccess ls) { return true; } - finally { jj_save(18, xla); } - } - - private boolean jj_2_20(int xla) - { - jj_la = xla; jj_lastpos = jj_scanpos = token; - try { return (!jj_3_20()); } - catch(LookaheadSuccess ls) { return true; } - finally { jj_save(19, xla); } - } - - private boolean jj_2_21(int xla) - { - jj_la = xla; jj_lastpos = jj_scanpos = token; - try { return (!jj_3_21()); } - catch(LookaheadSuccess ls) { return true; } - finally { jj_save(20, xla); } - } - - private boolean jj_2_22(int xla) - { - jj_la = xla; jj_lastpos = jj_scanpos = token; - try { return (!jj_3_22()); } - catch(LookaheadSuccess ls) { return true; } - finally { jj_save(21, xla); } - } - - private boolean jj_2_23(int xla) - { - jj_la = xla; jj_lastpos = jj_scanpos = token; - try { return (!jj_3_23()); } - catch(LookaheadSuccess ls) { return true; } - finally { jj_save(22, xla); } - } - - private boolean jj_2_24(int xla) - { - jj_la = xla; jj_lastpos = jj_scanpos = token; - try { return (!jj_3_24()); } - catch(LookaheadSuccess ls) { return true; } - finally { jj_save(23, xla); } - } - - private boolean jj_2_25(int xla) - { - jj_la = xla; jj_lastpos = jj_scanpos = token; - try { return (!jj_3_25()); } - catch(LookaheadSuccess ls) { return true; } - finally { jj_save(24, xla); } - } - - private boolean jj_2_26(int xla) - { - jj_la = xla; jj_lastpos = jj_scanpos = token; - try { return (!jj_3_26()); } - catch(LookaheadSuccess ls) { return true; } - finally { jj_save(25, xla); } - } - - private boolean jj_2_27(int xla) - { - jj_la = xla; jj_lastpos = jj_scanpos = token; - try { return (!jj_3_27()); } - catch(LookaheadSuccess ls) { return true; } - finally { jj_save(26, xla); } - } - - private boolean jj_2_28(int xla) - { - jj_la = xla; jj_lastpos = jj_scanpos = token; - try { return (!jj_3_28()); } - catch(LookaheadSuccess ls) { return true; } - finally { jj_save(27, xla); } - } - - private boolean jj_2_29(int xla) - { - jj_la = xla; jj_lastpos = jj_scanpos = token; - try { return (!jj_3_29()); } - catch(LookaheadSuccess ls) { return true; } - finally { jj_save(28, xla); } - } - - private boolean jj_2_30(int xla) - { - jj_la = xla; jj_lastpos = jj_scanpos = token; - try { return (!jj_3_30()); } - catch(LookaheadSuccess ls) { return true; } - finally { jj_save(29, xla); } - } - - private boolean jj_2_31(int xla) - { - jj_la = xla; jj_lastpos = jj_scanpos = token; - try { return (!jj_3_31()); } - catch(LookaheadSuccess ls) { return true; } - finally { jj_save(30, xla); } - } - - private boolean jj_2_32(int xla) - { - jj_la = xla; jj_lastpos = jj_scanpos = token; - try { return (!jj_3_32()); } - catch(LookaheadSuccess ls) { return true; } - finally { jj_save(31, xla); } - } - - private boolean jj_2_33(int xla) - { - jj_la = xla; jj_lastpos = jj_scanpos = token; - try { return (!jj_3_33()); } - catch(LookaheadSuccess ls) { return true; } - finally { jj_save(32, xla); } - } - - private boolean jj_2_34(int xla) - { - jj_la = xla; jj_lastpos = jj_scanpos = token; - try { return (!jj_3_34()); } - catch(LookaheadSuccess ls) { return true; } - finally { jj_save(33, xla); } - } - - private boolean jj_2_35(int xla) - { - jj_la = xla; jj_lastpos = jj_scanpos = token; - try { return (!jj_3_35()); } - catch(LookaheadSuccess ls) { return true; } - finally { jj_save(34, xla); } - } - - private boolean jj_2_36(int xla) - { - jj_la = xla; jj_lastpos = jj_scanpos = token; - try { return (!jj_3_36()); } - catch(LookaheadSuccess ls) { return true; } - finally { jj_save(35, xla); } - } - - private boolean jj_2_37(int xla) - { - jj_la = xla; jj_lastpos = jj_scanpos = token; - try { return (!jj_3_37()); } - catch(LookaheadSuccess ls) { return true; } - finally { jj_save(36, xla); } - } - - private boolean jj_2_38(int xla) - { - jj_la = xla; jj_lastpos = jj_scanpos = token; - try { return (!jj_3_38()); } - catch(LookaheadSuccess ls) { return true; } - finally { jj_save(37, xla); } - } - - private boolean jj_2_39(int xla) - { - jj_la = xla; jj_lastpos = jj_scanpos = token; - try { return (!jj_3_39()); } - catch(LookaheadSuccess ls) { return true; } - finally { jj_save(38, xla); } - } - - private boolean jj_2_40(int xla) - { - jj_la = xla; jj_lastpos = jj_scanpos = token; - try { return (!jj_3_40()); } - catch(LookaheadSuccess ls) { return true; } - finally { jj_save(39, xla); } - } - - private boolean jj_2_41(int xla) - { - jj_la = xla; jj_lastpos = jj_scanpos = token; - try { return (!jj_3_41()); } - catch(LookaheadSuccess ls) { return true; } - finally { jj_save(40, xla); } - } - - private boolean jj_2_42(int xla) - { - jj_la = xla; jj_lastpos = jj_scanpos = token; - try { return (!jj_3_42()); } - catch(LookaheadSuccess ls) { return true; } - finally { jj_save(41, xla); } - } - - private boolean jj_2_43(int xla) - { - jj_la = xla; jj_lastpos = jj_scanpos = token; - try { return (!jj_3_43()); } - catch(LookaheadSuccess ls) { return true; } - finally { jj_save(42, xla); } - } - - private boolean jj_2_44(int xla) - { - jj_la = xla; jj_lastpos = jj_scanpos = token; - try { return (!jj_3_44()); } - catch(LookaheadSuccess ls) { return true; } - finally { jj_save(43, xla); } - } - - private boolean jj_2_45(int xla) - { - jj_la = xla; jj_lastpos = jj_scanpos = token; - try { return (!jj_3_45()); } - catch(LookaheadSuccess ls) { return true; } - finally { jj_save(44, xla); } - } - - private boolean jj_2_46(int xla) - { - jj_la = xla; jj_lastpos = jj_scanpos = token; - try { return (!jj_3_46()); } - catch(LookaheadSuccess ls) { return true; } - finally { jj_save(45, xla); } - } - - private boolean jj_2_47(int xla) - { - jj_la = xla; jj_lastpos = jj_scanpos = token; - try { return (!jj_3_47()); } - catch(LookaheadSuccess ls) { return true; } - finally { jj_save(46, xla); } - } - - private boolean jj_2_48(int xla) - { - jj_la = xla; jj_lastpos = jj_scanpos = token; - try { return (!jj_3_48()); } - catch(LookaheadSuccess ls) { return true; } - finally { jj_save(47, xla); } - } - - private boolean jj_2_49(int xla) - { - jj_la = xla; jj_lastpos = jj_scanpos = token; - try { return (!jj_3_49()); } - catch(LookaheadSuccess ls) { return true; } - finally { jj_save(48, xla); } - } - - private boolean jj_2_50(int xla) - { - jj_la = xla; jj_lastpos = jj_scanpos = token; - try { return (!jj_3_50()); } - catch(LookaheadSuccess ls) { return true; } - finally { jj_save(49, xla); } - } - - private boolean jj_2_51(int xla) - { - jj_la = xla; jj_lastpos = jj_scanpos = token; - try { return (!jj_3_51()); } - catch(LookaheadSuccess ls) { return true; } - finally { jj_save(50, xla); } - } - - private boolean jj_2_52(int xla) - { - jj_la = xla; jj_lastpos = jj_scanpos = token; - try { return (!jj_3_52()); } - catch(LookaheadSuccess ls) { return true; } - finally { jj_save(51, xla); } - } - - private boolean jj_2_53(int xla) - { - jj_la = xla; jj_lastpos = jj_scanpos = token; - try { return (!jj_3_53()); } - catch(LookaheadSuccess ls) { return true; } - finally { jj_save(52, xla); } - } - - private boolean jj_2_54(int xla) - { - jj_la = xla; jj_lastpos = jj_scanpos = token; - try { return (!jj_3_54()); } - catch(LookaheadSuccess ls) { return true; } - finally { jj_save(53, xla); } - } - - private boolean jj_2_55(int xla) - { - jj_la = xla; jj_lastpos = jj_scanpos = token; - try { return (!jj_3_55()); } - catch(LookaheadSuccess ls) { return true; } - finally { jj_save(54, xla); } - } - - private boolean jj_2_56(int xla) - { - jj_la = xla; jj_lastpos = jj_scanpos = token; - try { return (!jj_3_56()); } - catch(LookaheadSuccess ls) { return true; } - finally { jj_save(55, xla); } - } - - private boolean jj_2_57(int xla) - { - jj_la = xla; jj_lastpos = jj_scanpos = token; - try { return (!jj_3_57()); } - catch(LookaheadSuccess ls) { return true; } - finally { jj_save(56, xla); } - } - - private boolean jj_2_58(int xla) - { - jj_la = xla; jj_lastpos = jj_scanpos = token; - try { return (!jj_3_58()); } - catch(LookaheadSuccess ls) { return true; } - finally { jj_save(57, xla); } - } - - private boolean jj_2_59(int xla) - { - jj_la = xla; jj_lastpos = jj_scanpos = token; - try { return (!jj_3_59()); } - catch(LookaheadSuccess ls) { return true; } - finally { jj_save(58, xla); } - } - - private boolean jj_2_60(int xla) - { - jj_la = xla; jj_lastpos = jj_scanpos = token; - try { return (!jj_3_60()); } - catch(LookaheadSuccess ls) { return true; } - finally { jj_save(59, xla); } - } - - private boolean jj_2_61(int xla) - { - jj_la = xla; jj_lastpos = jj_scanpos = token; - try { return (!jj_3_61()); } - catch(LookaheadSuccess ls) { return true; } - finally { jj_save(60, xla); } - } - - private boolean jj_2_62(int xla) - { - jj_la = xla; jj_lastpos = jj_scanpos = token; - try { return (!jj_3_62()); } - catch(LookaheadSuccess ls) { return true; } - finally { jj_save(61, xla); } - } - - private boolean jj_2_63(int xla) - { - jj_la = xla; jj_lastpos = jj_scanpos = token; - try { return (!jj_3_63()); } - catch(LookaheadSuccess ls) { return true; } - finally { jj_save(62, xla); } - } - - private boolean jj_2_64(int xla) - { - jj_la = xla; jj_lastpos = jj_scanpos = token; - try { return (!jj_3_64()); } - catch(LookaheadSuccess ls) { return true; } - finally { jj_save(63, xla); } - } - - private boolean jj_3R_ForStatement_2931_134_384() - { - if (jj_3R_Expression_2691_17_88()) return true; - return false; - } - - private boolean jj_3R_ForStatement_2930_134_383() - { - if (jj_3R_Expression_2691_17_88()) return true; - return false; - } - - private boolean jj_3R_Elision_2279_18_101() - { - Token xsp; - if (jj_3R_Elision_2278_19_146()) return true; - while (true) { - xsp = jj_scanpos; - if (jj_3R_Elision_2278_19_146()) { jj_scanpos = xsp; break; } - } - return false; - } - - private boolean jj_3R_Elision_2278_19_146() - { - if (jj_scan_token(COMMA)) return true; - return false; - } - - private boolean jj_3R_ThrowStatement_3045_17_164() - { - if (jj_scan_token(THROW)) return true; - if (jj_3R_Expression_2691_17_88()) return true; - if (jj_3R_EndStatement_3225_17_128()) return true; - return false; - } - - private boolean jj_3R_Elision_2277_17_71() - { - if (jj_scan_token(COMMA)) return true; - Token xsp; - xsp = jj_scanpos; - if (jj_3R_Elision_2279_18_101()) jj_scanpos = xsp; - return false; - } - - private boolean jj_3R_ForStatement_2926_134_382() - { - if (jj_3R_Expression_2691_17_88()) return true; - return false; - } - - private boolean jj_3R_ForStatement_2925_134_381() - { - if (jj_3R_Expression_2691_17_88()) return true; - return false; - } - - private boolean jj_3R_LabelledStatement_3039_17_288() - { - if (jj_3R_Identifier_2221_11_57()) return true; - if (jj_scan_token(COLON)) return true; - if (jj_3R_Statement_2709_25_172()) return true; - return false; - } - - private boolean jj_3R_ArrayLiteral_2250_35_281() - { - if (jj_3R_ElementList_2262_17_302()) return true; - return false; - } - - private boolean jj_3R_ElementList_2269_14_336() - { - if (jj_3R_Elision_2277_17_71()) return true; - return false; - } - - private boolean jj_3R_ArrayLiteral_2248_34_280() - { - if (jj_3R_ElisionFirst_2285_17_301()) return true; - return false; - } - - private boolean jj_3R_DefaultClause_3029_17_355() - { - if (jj_scan_token(_DEFAULT)) return true; - if (jj_scan_token(COLON)) return true; - Token xsp; - xsp = jj_scanpos; - if (jj_3R_DefaultClause_3029_58_371()) jj_scanpos = xsp; - return false; - } - - private boolean jj_3R_ElementList_2262_17_302() - { - if (jj_3R_AssignmentExpression_2663_17_72()) return true; - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3_24()) { jj_scanpos = xsp; break; } - } - xsp = jj_scanpos; - if (jj_3R_ElementList_2269_14_336()) jj_scanpos = xsp; - return false; - } - - private boolean jj_3_24() - { - if (jj_3R_Elision_2277_17_71()) return true; - if (jj_3R_AssignmentExpression_2663_17_72()) return true; - return false; - } - - private boolean jj_3R_CaseBlock_3006_36_337() - { - if (jj_3R_CaseClauses_3016_17_354()) return true; - return false; - } - - private boolean jj_3R_CaseClause_3022_17_387() - { - if (jj_scan_token(CASE)) return true; - if (jj_3R_Expression_2691_17_88()) return true; - if (jj_scan_token(COLON)) return true; - Token xsp; - xsp = jj_scanpos; - if (jj_3R_CaseClause_3022_68_394()) jj_scanpos = xsp; - return false; - } - - private boolean jj_3R_CaseClauses_3016_19_370() - { - if (jj_3R_CaseClause_3022_17_387()) return true; - return false; - } - - private boolean jj_3_59() - { - if (jj_3R_Expression_2691_17_88()) return true; - return false; - } - - private boolean jj_3R_CaseClauses_3016_17_354() - { - Token xsp; - if (jj_3R_CaseClauses_3016_19_370()) return true; - while (true) { - xsp = jj_scanpos; - if (jj_3R_CaseClauses_3016_19_370()) { jj_scanpos = xsp; break; } - } - return false; - } - - private boolean jj_3R_ArrayLiteral_2247_17_252() - { - if (jj_scan_token(LBRACKET)) return true; - Token xsp; - xsp = jj_scanpos; - if (jj_3R_ArrayLiteral_2248_34_280()) jj_scanpos = xsp; - xsp = jj_scanpos; - if (jj_3R_ArrayLiteral_2250_35_281()) jj_scanpos = xsp; - if (jj_scan_token(RBRACKET)) return true; - return false; - } - - private boolean jj_3R_YieldStatement_2975_50_323() - { - if (jj_3R_Expression_2691_17_88()) return true; - return false; - } - - private boolean jj_3R_CaseBlock_3006_17_304() - { - if (jj_scan_token(LBRACE)) return true; - Token xsp; - xsp = jj_scanpos; - if (jj_3R_CaseBlock_3006_36_337()) jj_scanpos = xsp; - xsp = jj_scanpos; - if (jj_scan_token(84)) { - jj_scanpos = xsp; - if (jj_3R_CaseBlock_3008_66_338()) return true; - } - return false; - } - - private boolean jj_3R_SwitchStatement_2999_17_162() - { - if (jj_scan_token(SWITCH)) return true; - if (jj_scan_token(LPAREN)) return true; - if (jj_3R_Expression_2691_17_88()) return true; - if (jj_scan_token(RPAREN)) return true; - if (jj_3R_CaseBlock_3006_17_304()) return true; - return false; - } - - private boolean jj_3R_LabelIdentifier_2234_11_87() - { - Token xsp; - xsp = jj_scanpos; - if (jj_scan_token(152)) { - jj_scanpos = xsp; - if (jj_scan_token(153)) return true; - } - return false; - } - - private boolean jj_3_4() - { - if (jj_3R_Identifier_2221_11_57()) return true; - if (jj_scan_token(DOT)) return true; - return false; - } - - private boolean jj_3R_FilePathNoSTar_1464_11_69() - { - Token xsp; - if (jj_3_4()) return true; - while (true) { - xsp = jj_scanpos; - if (jj_3_4()) { jj_scanpos = xsp; break; } - } - return false; - } - - private boolean jj_3R_YieldStatement_2975_33_322() - { - if (jj_3R_YieldStar_2982_17_343()) return true; - return false; - } - - private boolean jj_3R_WithStatement_2990_17_163() - { - if (jj_scan_token(WITH)) return true; - if (jj_scan_token(LPAREN)) return true; - if (jj_3R_Expression_2691_17_88()) return true; - if (jj_scan_token(RPAREN)) return true; - if (jj_3R_Statement_2709_25_172()) return true; - return false; - } - - private boolean jj_3_58() - { - if (jj_3R_Expression_2691_17_88()) return true; - return false; - } - - private boolean jj_3R_ForStatement_2936_65_386() - { - if (jj_scan_token(OF)) return true; - return false; - } - - private boolean jj_3R_ForStatement_2933_68_385() - { - if (jj_scan_token(OF)) return true; - return false; - } - - private boolean jj_3_3() - { - if (jj_3R_Identifier_2221_11_57()) return true; - if (jj_scan_token(DOT)) return true; - return false; - } - - private boolean jj_3R_YieldStar_2982_17_343() - { - if (jj_scan_token(STAR)) return true; - return false; - } - - private boolean jj_3R_Identifier_2221_11_57() - { - if (jj_scan_token(IDENTIFIER_NAME)) return true; - return false; - } - - private boolean jj_3_57() - { - if (jj_3R_LabelIdentifier_2234_11_87()) return true; - return false; - } - - private boolean jj_3R_ReturnStatement_2967_28_327() - { - if (jj_3R_Expression_2691_17_88()) return true; - return false; - } - - private boolean jj_3R_YieldStatement_2975_17_290() - { - if (jj_scan_token(YIELD)) return true; - Token xsp; - xsp = jj_scanpos; - if (jj_3R_YieldStatement_2975_33_322()) jj_scanpos = xsp; - xsp = jj_scanpos; - if (jj_3R_YieldStatement_2975_50_323()) jj_scanpos = xsp; - if (jj_3R_EndStatement_3225_17_128()) return true; - return false; - } - - private boolean jj_3R_TemplateLiteral_2208_17_231() - { - if (jj_scan_token(CODE_LITERAL)) return true; - return false; - } - - private boolean jj_3_56() - { - if (jj_3R_LabelIdentifier_2234_11_87()) return true; - return false; - } - - private boolean jj_3R_ForStatement_2924_66_380() - { - if (jj_3R_ExpressionNoIn_2697_17_90()) return true; - return false; - } - - private boolean jj_3R_BreakStatement_2957_32_324() - { - if (jj_3R_LabelIdentifier_2234_11_87()) return true; - return false; - } - - private boolean jj_3_2() - { - if (jj_scan_token(FUNCTION)) return true; - if (jj_3R_Identifier_2221_11_57()) return true; - return false; - } - - private boolean jj_3_1() - { - if (jj_scan_token(FUNCTION_GEN)) return true; - if (jj_3R_Identifier_2221_11_57()) return true; - return false; - } - - private boolean jj_3R_ReturnStatement_2967_17_293() - { - if (jj_scan_token(RETURN)) return true; - Token xsp; - xsp = jj_scanpos; - if (jj_3R_ReturnStatement_2967_28_327()) jj_scanpos = xsp; - if (jj_3R_EndStatement_3225_17_128()) return true; - return false; - } - - private boolean jj_3R_ContinueStatement_2946_36_321() - { - if (jj_3R_LabelIdentifier_2234_11_87()) return true; - return false; - } - - private boolean jj_3R_TemplateLiteral_2202_11_188() - { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_TemplateLiteral_2202_11_230()) { - jj_scanpos = xsp; - if (jj_3R_TemplateLiteral_2208_17_231()) return true; - } - return false; - } - - private boolean jj_3R_TemplateLiteral_2202_11_230() - { - if (jj_scan_token(STRING_LITERAL)) return true; - return false; - } - - private boolean jj_3R_BreakStatement_2957_17_291() - { - if (jj_scan_token(BREAK)) return true; - Token xsp; - xsp = jj_scanpos; - if (jj_3R_BreakStatement_2957_32_324()) jj_scanpos = xsp; - if (jj_3R_EndStatement_3225_17_128()) return true; - return false; - } - - private boolean jj_3R_Literal_2190_17_216() - { - if (jj_scan_token(CODE_LITERAL)) return true; - return false; - } - - private boolean jj_3R_Literal_2184_17_215() - { - if (jj_scan_token(REGULAR_EXPRESSION_LITERAL)) return true; - return false; - } - - private boolean jj_3_55() - { - if (jj_scan_token(VAR)) return true; - if (jj_3R_VariableDeclarationList_2811_17_86()) return true; - if (jj_scan_token(SEMICOLON)) return true; - return false; - } - - private boolean jj_3R_ForStatement_2936_27_369() - { - if (jj_3R_LeftHandSideExpressionForIn_2420_17_379()) return true; - Token xsp; - xsp = jj_scanpos; - if (jj_scan_token(55)) { - jj_scanpos = xsp; - if (jj_3R_ForStatement_2936_65_386()) return true; - } - if (jj_3R_Expression_2691_17_88()) return true; - if (jj_scan_token(RPAREN)) return true; - if (jj_3R_Statement_2709_25_172()) return true; - return false; - } - - private boolean jj_3R_ContinueStatement_2946_17_289() - { - if (jj_scan_token(CONTINUE)) return true; - Token xsp; - xsp = jj_scanpos; - if (jj_3R_ContinueStatement_2946_36_321()) jj_scanpos = xsp; - if (jj_3R_EndStatement_3225_17_128()) return true; - return false; - } - - private boolean jj_3R_Literal_2178_17_214() - { - if (jj_scan_token(NULL_LITERAL)) return true; - return false; - } - - private boolean jj_3R_null_2923_39_85() - { - if (jj_3R_ExpressionNoIn_2697_17_90()) return true; - return false; - } - - private boolean jj_3_54() - { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_null_2923_39_85()) jj_scanpos = xsp; - if (jj_scan_token(SEMICOLON)) return true; - return false; - } - - private boolean jj_3R_ForStatement_2933_27_368() - { - if (jj_scan_token(VAR)) return true; - if (jj_3R_VariableDeclarationNoIn_2830_17_378()) return true; - Token xsp; - xsp = jj_scanpos; - if (jj_scan_token(55)) { - jj_scanpos = xsp; - if (jj_3R_ForStatement_2933_68_385()) return true; - } - if (jj_3R_Expression_2691_17_88()) return true; - if (jj_scan_token(RPAREN)) return true; - if (jj_3R_Statement_2709_25_172()) return true; - return false; - } - - private boolean jj_3R_Literal_2172_17_213() - { - if (jj_scan_token(BOOLEAN_LITERAL)) return true; - return false; - } - - private boolean jj_3R_ForStatement_2928_27_367() - { - if (jj_scan_token(VAR)) return true; - if (jj_3R_VariableDeclarationList_2811_17_86()) return true; - if (jj_scan_token(SEMICOLON)) return true; - Token xsp; - xsp = jj_scanpos; - if (jj_3R_ForStatement_2930_134_383()) jj_scanpos = xsp; - if (jj_scan_token(SEMICOLON)) return true; - xsp = jj_scanpos; - if (jj_3R_ForStatement_2931_134_384()) jj_scanpos = xsp; - if (jj_scan_token(RPAREN)) return true; - if (jj_3R_Statement_2709_25_172()) return true; - return false; - } - - private boolean jj_3R_ForStatement_2923_27_366() - { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_ForStatement_2924_66_380()) jj_scanpos = xsp; - if (jj_scan_token(SEMICOLON)) return true; - xsp = jj_scanpos; - if (jj_3R_ForStatement_2925_134_381()) jj_scanpos = xsp; - if (jj_scan_token(SEMICOLON)) return true; - xsp = jj_scanpos; - if (jj_3R_ForStatement_2926_134_382()) jj_scanpos = xsp; - if (jj_scan_token(RPAREN)) return true; - if (jj_3R_Statement_2709_25_172()) return true; - return false; - } - - private boolean jj_3R_Literal_2166_17_212() - { - if (jj_scan_token(STRING_LITERAL)) return true; - return false; - } - - private boolean jj_3R_ForStatement_2918_28_365() - { - if (jj_3R_LeftHandSideExpressionForIn_2420_17_379()) return true; - if (jj_scan_token(IN)) return true; - if (jj_3R_Expression_2691_17_88()) return true; - if (jj_scan_token(RPAREN)) return true; - if (jj_3R_Statement_2709_25_172()) return true; - return false; - } - - private boolean jj_3R_IfStatement_2882_63_303() - { - if (jj_scan_token(ELSE)) return true; - if (jj_3R_Statement_2709_25_172()) return true; - return false; - } - - private boolean jj_3R_Literal_2160_17_211() - { - if (jj_scan_token(HEX_INTEGER_LITERAL)) return true; - return false; - } - - private boolean jj_3R_ForStatement_2915_28_364() - { - if (jj_scan_token(VAR)) return true; - if (jj_3R_VariableDeclarationNoIn_2830_17_378()) return true; - if (jj_scan_token(IN)) return true; - if (jj_3R_Expression_2691_17_88()) return true; - if (jj_scan_token(RPAREN)) return true; - if (jj_3R_Statement_2709_25_172()) return true; - return false; - } - - private boolean jj_3R_ForStatement_2922_17_256() - { - if (jj_scan_token(LPAREN)) return true; - Token xsp; - xsp = jj_scanpos; - if (jj_3R_ForStatement_2923_27_366()) { - jj_scanpos = xsp; - if (jj_3R_ForStatement_2928_27_367()) { - jj_scanpos = xsp; - if (jj_3R_ForStatement_2933_27_368()) { - jj_scanpos = xsp; - if (jj_3R_ForStatement_2936_27_369()) return true; - } - } - } - return false; - } - - private boolean jj_3R_Literal_2152_17_180() - { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_Literal_2152_17_210()) { - jj_scanpos = xsp; - if (jj_3R_Literal_2160_17_211()) { - jj_scanpos = xsp; - if (jj_3R_Literal_2166_17_212()) { - jj_scanpos = xsp; - if (jj_3R_Literal_2172_17_213()) { - jj_scanpos = xsp; - if (jj_3R_Literal_2178_17_214()) { - jj_scanpos = xsp; - if (jj_3R_Literal_2184_17_215()) { - jj_scanpos = xsp; - if (jj_3R_Literal_2190_17_216()) return true; - } - } - } - } - } - } - return false; - } - - private boolean jj_3R_Literal_2152_17_210() - { - if (jj_scan_token(DECIMAL_LITERAL)) return true; - return false; - } - - private boolean jj_3R_ForStatement_2914_17_255() - { - if (jj_scan_token(EACH)) return true; - if (jj_scan_token(LPAREN)) return true; - Token xsp; - xsp = jj_scanpos; - if (jj_3R_ForStatement_2915_28_364()) { - jj_scanpos = xsp; - if (jj_3R_ForStatement_2918_28_365()) return true; - } - return false; - } - - private boolean jj_3R_noReservedIdentifier_1380_11_143() - { - Token xsp; - xsp = jj_scanpos; - if (jj_scan_token(153)) { - jj_scanpos = xsp; - if (jj_scan_token(27)) { - jj_scanpos = xsp; - if (jj_scan_token(31)) { - jj_scanpos = xsp; - if (jj_scan_token(43)) { - jj_scanpos = xsp; - if (jj_scan_token(52)) { - jj_scanpos = xsp; - if (jj_scan_token(53)) { - jj_scanpos = xsp; - if (jj_scan_token(63)) { - jj_scanpos = xsp; - if (jj_scan_token(59)) { - jj_scanpos = xsp; - if (jj_scan_token(60)) { - jj_scanpos = xsp; - if (jj_scan_token(54)) { - jj_scanpos = xsp; - if (jj_scan_token(50)) { - jj_scanpos = xsp; - if (jj_scan_token(26)) { - jj_scanpos = xsp; - if (jj_scan_token(55)) { - jj_scanpos = xsp; - if (jj_scan_token(79)) { - jj_scanpos = xsp; - if (jj_scan_token(67)) { - jj_scanpos = xsp; - if (jj_scan_token(21)) { - jj_scanpos = xsp; - if (jj_scan_token(22)) { - jj_scanpos = xsp; - if (jj_scan_token(30)) { - jj_scanpos = xsp; - if (jj_scan_token(72)) { - jj_scanpos = xsp; - if (jj_scan_token(69)) { - jj_scanpos = xsp; - if (jj_scan_token(131)) { - jj_scanpos = xsp; - if (jj_scan_token(35)) { - jj_scanpos = xsp; - if (jj_scan_token(36)) { - jj_scanpos = xsp; - if (jj_scan_token(37)) { - jj_scanpos = xsp; - if (jj_scan_token(51)) { - jj_scanpos = xsp; - if (jj_scan_token(65)) { - jj_scanpos = xsp; - if (jj_scan_token(73)) { - jj_scanpos = xsp; - if (jj_scan_token(18)) { - jj_scanpos = xsp; - if (jj_scan_token(49)) { - jj_scanpos = xsp; - if (jj_scan_token(38)) { - jj_scanpos = xsp; - if (jj_scan_token(40)) { - jj_scanpos = xsp; - if (jj_scan_token(25)) return true; - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - return false; - } - - private boolean jj_3R_ForStatement_2913_11_235() - { - if (jj_scan_token(FOR)) return true; - Token xsp; - xsp = jj_scanpos; - if (jj_3R_ForStatement_2914_17_255()) { - jj_scanpos = xsp; - if (jj_3R_ForStatement_2922_17_256()) return true; - } - return false; - } - - private boolean jj_3R_VariableDeclaration_2824_99_171() - { - if (jj_3R_Initialiser_2836_17_201()) return true; - return false; - } - - private boolean jj_3R_ParenExpression_2140_11_253() - { - if (jj_scan_token(LPAREN)) return true; - if (jj_3R_Expression_2691_17_88()) return true; - if (jj_scan_token(RPAREN)) return true; - return false; - } - - private boolean jj_3R_WhileStatement_2906_11_234() - { - if (jj_scan_token(WHILE)) return true; - if (jj_scan_token(LPAREN)) return true; - if (jj_3R_Expression_2691_17_88()) return true; - if (jj_scan_token(RPAREN)) return true; - if (jj_3R_Statement_2709_25_172()) return true; - return false; - } - - private boolean jj_3R_PrimaryExpression_2126_19_229() - { - if (jj_3R_Literal_2152_17_180()) return true; - return false; - } - - private boolean jj_3R_IterationStatement_2893_19_192() - { - if (jj_3R_ForStatement_2913_11_235()) return true; - return false; - } - - private boolean jj_3R_PrimaryExpression_2125_19_228() - { - if (jj_3R_Identifier_2221_11_57()) return true; - return false; - } - - private boolean jj_3R_This_2133_11_250() - { - if (jj_scan_token(THIS)) return true; - return false; - } - - private boolean jj_3R_IterationStatement_2892_19_191() - { - if (jj_3R_WhileStatement_2906_11_234()) return true; - return false; - } - - private boolean jj_3R_PrimaryExpression_2124_19_227() - { - if (jj_3R_ParenExpression_2140_11_253()) return true; - return false; - } - - private boolean jj_3R_IterationStatement_2891_19_161() - { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_IterationStatement_2891_19_190()) { - jj_scanpos = xsp; - if (jj_3R_IterationStatement_2892_19_191()) { - jj_scanpos = xsp; - if (jj_3R_IterationStatement_2893_19_192()) return true; - } - } - return false; - } - - private boolean jj_3R_IterationStatement_2891_19_190() - { - if (jj_3R_DoStatement_2899_11_233()) return true; - return false; - } - - private boolean jj_3R_DoStatement_2899_11_233() - { - if (jj_scan_token(DO)) return true; - if (jj_3R_Statement_2709_25_172()) return true; - if (jj_scan_token(WHILE)) return true; - if (jj_scan_token(LPAREN)) return true; - if (jj_3R_Expression_2691_17_88()) return true; - if (jj_scan_token(RPAREN)) return true; - if (jj_3R_EndStatement_3225_17_128()) return true; - return false; - } - - private boolean jj_3R_PrimaryExpression_2123_19_226() - { - if (jj_3R_ArrayLiteral_2247_17_252()) return true; - return false; - } - - private boolean jj_3R_getNoReservedIdentifier_1363_11_76() - { - Token xsp; - xsp = jj_scanpos; - if (jj_scan_token(153)) { - jj_scanpos = xsp; - if (jj_scan_token(27)) { - jj_scanpos = xsp; - if (jj_scan_token(31)) { - jj_scanpos = xsp; - if (jj_scan_token(43)) { - jj_scanpos = xsp; - if (jj_scan_token(52)) { - jj_scanpos = xsp; - if (jj_scan_token(53)) { - jj_scanpos = xsp; - if (jj_scan_token(63)) { - jj_scanpos = xsp; - if (jj_scan_token(59)) { - jj_scanpos = xsp; - if (jj_scan_token(60)) { - jj_scanpos = xsp; - if (jj_scan_token(54)) { - jj_scanpos = xsp; - if (jj_scan_token(50)) { - jj_scanpos = xsp; - if (jj_scan_token(26)) { - jj_scanpos = xsp; - if (jj_scan_token(55)) { - jj_scanpos = xsp; - if (jj_scan_token(79)) { - jj_scanpos = xsp; - if (jj_scan_token(67)) { - jj_scanpos = xsp; - if (jj_scan_token(21)) { - jj_scanpos = xsp; - if (jj_scan_token(22)) { - jj_scanpos = xsp; - if (jj_scan_token(30)) { - jj_scanpos = xsp; - if (jj_scan_token(72)) { - jj_scanpos = xsp; - if (jj_scan_token(69)) { - jj_scanpos = xsp; - if (jj_scan_token(131)) { - jj_scanpos = xsp; - if (jj_scan_token(35)) { - jj_scanpos = xsp; - if (jj_scan_token(36)) { - jj_scanpos = xsp; - if (jj_scan_token(37)) { - jj_scanpos = xsp; - if (jj_scan_token(51)) { - jj_scanpos = xsp; - if (jj_scan_token(65)) { - jj_scanpos = xsp; - if (jj_scan_token(73)) { - jj_scanpos = xsp; - if (jj_scan_token(18)) { - jj_scanpos = xsp; - if (jj_scan_token(38)) { - jj_scanpos = xsp; - if (jj_scan_token(40)) { - jj_scanpos = xsp; - if (jj_scan_token(25)) return true; - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - return false; - } - - private boolean jj_3R_PrimaryExpression_2122_19_225() - { - if (jj_3R_ObjectLiteral_2294_17_251()) return true; - return false; - } - - private boolean jj_3R_Initialiser_2836_72_243() - { - if (jj_3R_AssignmentExpression_2663_17_72()) return true; - return false; - } - - private boolean jj_3R_PrimaryExpression_2121_13_186() - { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_PrimaryExpression_2121_13_224()) { - jj_scanpos = xsp; - if (jj_3R_PrimaryExpression_2122_19_225()) { - jj_scanpos = xsp; - if (jj_3R_PrimaryExpression_2123_19_226()) { - jj_scanpos = xsp; - if (jj_3R_PrimaryExpression_2124_19_227()) { - jj_scanpos = xsp; - if (jj_3R_PrimaryExpression_2125_19_228()) { - jj_scanpos = xsp; - if (jj_3R_PrimaryExpression_2126_19_229()) return true; - } - } - } - } - } - return false; - } - - private boolean jj_3R_PrimaryExpression_2121_13_224() - { - if (jj_3R_This_2133_11_250()) return true; - return false; - } - - private boolean jj_3R_IfStatement_2882_17_160() - { - if (jj_scan_token(IF)) return true; - if (jj_scan_token(LPAREN)) return true; - if (jj_3R_Expression_2691_17_88()) return true; - if (jj_scan_token(RPAREN)) return true; - if (jj_3R_Statement_2709_25_172()) return true; - Token xsp; - xsp = jj_scanpos; - if (jj_3R_IfStatement_2882_63_303()) jj_scanpos = xsp; - return false; - } - - private boolean jj_3_53() - { - if (jj_3R_MemberExpression_2333_17_77()) return true; - if (jj_scan_token(LPAREN)) return true; - return false; - } - - private boolean jj_3_23() - { - if (jj_3R_Arguments_2387_17_70()) return true; - return false; - } - - private boolean jj_3R_Define_2091_25_196() - { - if (jj_3R_Arguments_2387_17_70()) return true; - return false; - } - - private boolean jj_3R_Define_2089_25_195() - { - if (jj_3R_noReservedIdentifier_1380_11_143()) return true; - if (jj_scan_token(ASSIGN)) return true; - if (jj_3R_AssignmentExpression_2663_17_72()) return true; - return false; - } - - private boolean jj_3R_OutputAct_2072_41_258() - { - if (jj_3R_Arguments_2387_17_70()) return true; - return false; - } - - private boolean jj_3R_ExpressionStatement_2860_17_84() - { - if (jj_3R_Expression_2691_17_88()) return true; - if (jj_3R_EndStatement_3225_17_128()) return true; - return false; - } - - private boolean jj_3R_Define_2086_17_167() - { - if (jj_scan_token(DEFINE)) return true; - Token xsp; - xsp = jj_scanpos; - if (jj_3R_Define_2089_25_195()) { - jj_scanpos = xsp; - if (jj_3R_Define_2091_25_196()) return true; - } - return false; - } - - private boolean jj_3R_EmptyStatement_2851_17_287() - { - if (jj_scan_token(SEMICOLON)) return true; - return false; - } - - private boolean jj_3_52() - { - if (jj_3R_ActionOnAssign_1866_17_79()) return true; - return false; - } - - private boolean jj_3R_OutputAct_2075_25_200() - { - if (jj_3R_Arguments_2387_17_70()) return true; - return false; - } - - private boolean jj_3R_OutputAct_2072_25_241() - { - if (jj_3R_Identifier_2221_11_57()) return true; - Token xsp; - xsp = jj_scanpos; - if (jj_3R_OutputAct_2072_41_258()) jj_scanpos = xsp; - return false; - } - - private boolean jj_3R_VariableDeclarationNoIn_2830_32_391() - { - if (jj_3R_InitialiserNoIn_2842_17_399()) return true; - return false; - } - - private boolean jj_3R_OutputAct_2070_25_240() - { - if (jj_3R_TemplateLiteral_2202_11_188()) return true; - return false; - } - - private boolean jj_3R_InitialiserNoIn_2842_17_399() - { - if (jj_scan_token(ASSIGN)) return true; - if (jj_3R_AssignmentExpressionNoIn_2671_17_135()) return true; - return false; - } - - private boolean jj_3R_Initialiser_2836_22_242() - { - if (jj_3R_ActionOnAssign_1866_17_79()) return true; - return false; - } - - private boolean jj_3R_OutputAct_2069_19_199() - { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_OutputAct_2070_25_240()) { - jj_scanpos = xsp; - if (jj_3R_OutputAct_2072_25_241()) return true; - } - return false; - } - - private boolean jj_3R_VariableDeclaration_2824_30_170() - { - if (jj_scan_token(COLON)) return true; - if (jj_3R_getNoReservedIdentifier_1363_11_76()) return true; - return false; - } - - private boolean jj_3R_Initialiser_2836_17_201() - { - if (jj_scan_token(ASSIGN)) return true; - Token xsp; - xsp = jj_scanpos; - if (jj_3R_Initialiser_2836_22_242()) { - jj_scanpos = xsp; - if (jj_3R_Initialiser_2836_72_243()) return true; - } - return false; - } - - private boolean jj_3R_VariableDeclarationList_2811_41_132() - { - if (jj_scan_token(COMMA)) return true; - if (jj_3R_VariableDeclaration_2823_17_131()) return true; - return false; - } - - private boolean jj_3R_ExecOnAssign_2051_33_158() - { - if (jj_3R_Arguments_2387_17_70()) return true; - return false; - } - - private boolean jj_3R_ExecOnAssign_2048_33_157() - { - if (jj_3R_TemplateLiteral_2202_11_188()) return true; - return false; - } - - private boolean jj_3R_VariableDeclarationNoIn_2830_17_378() - { - if (jj_3R_Identifier_2221_11_57()) return true; - Token xsp; - xsp = jj_scanpos; - if (jj_3R_VariableDeclarationNoIn_2830_32_391()) jj_scanpos = xsp; - return false; - } - - private boolean jj_3R_OutputAct_2067_12_169() - { - if (jj_scan_token(OUTPUT_ACT)) return true; - Token xsp; - xsp = jj_scanpos; - if (jj_3R_OutputAct_2069_19_199()) { - jj_scanpos = xsp; - if (jj_3R_OutputAct_2075_25_200()) return true; - } - return false; - } - - private boolean jj_3R_VariableDeclaration_2823_17_131() - { - if (jj_3R_Identifier_2221_11_57()) return true; - Token xsp; - xsp = jj_scanpos; - if (jj_3R_VariableDeclaration_2824_30_170()) jj_scanpos = xsp; - xsp = jj_scanpos; - if (jj_3R_VariableDeclaration_2824_99_171()) jj_scanpos = xsp; - return false; - } - - private boolean jj_3R_Perform_2032_33_239() - { - if (jj_3R_Arguments_2387_17_70()) return true; - return false; - } - - private boolean jj_3R_Perform_2030_33_198() - { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_Perform_2030_33_238()) { - jj_scanpos = xsp; - if (jj_3R_Perform_2032_33_239()) return true; - } - return false; - } - - private boolean jj_3R_Perform_2030_33_238() - { - if (jj_3R_TemplateLiteral_2202_11_188()) return true; - return false; - } - - private boolean jj_3R_VariableDeclarationList_2811_17_86() - { - if (jj_3R_VariableDeclaration_2823_17_131()) return true; - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3R_VariableDeclarationList_2811_41_132()) { jj_scanpos = xsp; break; } - } - return false; - } - - private boolean jj_3R_ExecOnAssign_2042_17_115() - { - if (jj_scan_token(EXEC)) return true; - if (jj_3R_getNoReservedIdentifier_1363_11_76()) return true; - Token xsp; - xsp = jj_scanpos; - if (jj_3R_ExecOnAssign_2048_33_157()) { - jj_scanpos = xsp; - if (jj_3R_ExecOnAssign_2051_33_158()) return true; - } - return false; - } - - private boolean jj_3_22() - { - if (jj_scan_token(IDENTIFIER_NAME)) return true; - if (jj_scan_token(COLON)) return true; - return false; - } - - private boolean jj_3R_VariableStatement_2802_17_286() - { - if (jj_scan_token(VAR)) return true; - if (jj_3R_VariableDeclarationList_2811_17_86()) return true; - if (jj_3R_EndStatement_3225_17_128()) return true; - return false; - } - - private boolean jj_3R_Block_2785_27_189() - { - if (jj_3R_StatementList_2793_17_232()) return true; - return false; - } - - private boolean jj_3R_StatementList_2793_19_254() - { - if (jj_3R_Statement_2709_25_172()) return true; - return false; - } - - private boolean jj_3R_Perform_2025_18_197() - { - if (jj_scan_token(IDENTIFIER_NAME)) return true; - if (jj_scan_token(COLON)) return true; - return false; - } - - private boolean jj_3R_StatementList_2793_17_232() - { - Token xsp; - if (jj_3R_StatementList_2793_19_254()) return true; - while (true) { - xsp = jj_scanpos; - if (jj_3R_StatementList_2793_19_254()) { jj_scanpos = xsp; break; } - } - return false; - } - - private boolean jj_3R_Perform_2024_17_168() - { - if (jj_scan_token(EXEC)) return true; - Token xsp; - xsp = jj_scanpos; - if (jj_3R_Perform_2025_18_197()) jj_scanpos = xsp; - if (jj_3R_getNoReservedIdentifier_1363_11_76()) return true; - xsp = jj_scanpos; - if (jj_3R_Perform_2030_33_198()) jj_scanpos = xsp; - return false; - } - - private boolean jj_3R_Block_2784_17_159() - { - if (jj_scan_token(LBRACE)) return true; - Token xsp; - xsp = jj_scanpos; - if (jj_3R_Block_2785_27_189()) jj_scanpos = xsp; - if (jj_scan_token(RBRACE)) return true; - return false; - } - - private boolean jj_3R_null_2727_71_130() - { - if (jj_3R_LeftHandSideExpression_2413_17_68()) return true; - return false; - } - - private boolean jj_3R_BodiedStatement_2770_27_119() - { - if (jj_3R_SwitchStatement_2999_17_162()) return true; - return false; - } - - private boolean jj_3R_BodiedStatement_2769_27_118() - { - if (jj_3R_IterationStatement_2891_19_161()) return true; - return false; - } - - private boolean jj_3R_BodiedStatement_2768_27_117() - { - if (jj_3R_IfStatement_2882_17_160()) return true; - return false; - } - - private boolean jj_3R_BodiedStatement_2773_19_122() - { - if (jj_3R_TryStatement_3052_17_165()) return true; - return false; - } - - private boolean jj_3R_BodiedStatement_2767_25_116() - { - if (jj_3R_Block_2784_17_159()) return true; - return false; - } - - private boolean jj_3R_BodiedStatement_2772_19_121() - { - if (jj_3R_ThrowStatement_3045_17_164()) return true; - return false; - } - - private boolean jj_3R_BodiedStatement_2771_19_120() - { - if (jj_3R_WithStatement_2990_17_163()) return true; - return false; - } - - private boolean jj_3R_Insert_1990_30_237() - { - if (jj_3R_Arguments_2387_17_70()) return true; - return false; - } - - private boolean jj_3R_Insert_2005_14_194() - { - if (jj_scan_token(REPLACE)) return true; - if (jj_3R_ConditionalExpression_2648_17_147()) return true; - return false; - } - - private boolean jj_3R_BodiedStatement_2765_17_81() - { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_BodiedStatement_2767_25_116()) { - jj_scanpos = xsp; - if (jj_3R_BodiedStatement_2768_27_117()) { - jj_scanpos = xsp; - if (jj_3R_BodiedStatement_2769_27_118()) { - jj_scanpos = xsp; - if (jj_3R_BodiedStatement_2770_27_119()) { - jj_scanpos = xsp; - if (jj_3R_BodiedStatement_2771_19_120()) { - jj_scanpos = xsp; - if (jj_3R_BodiedStatement_2772_19_121()) { - jj_scanpos = xsp; - if (jj_3R_BodiedStatement_2773_19_122()) return true; - } - } - } - } - } - } - return false; - } - - private boolean jj_3R_Insert_1978_31_257() - { - if (jj_scan_token(LT)) return true; - if (jj_scan_token(IDENTIFIER_NAME)) return true; - if (jj_scan_token(GT)) return true; - return false; - } - - private boolean jj_3_51() - { - if (jj_3R_Identifier_2221_11_57()) return true; - if (jj_scan_token(COLON)) return true; - return false; - } - - private boolean jj_3R_Insert_1977_30_236() - { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_Insert_1978_31_257()) jj_scanpos = xsp; - xsp = jj_scanpos; - if (jj_scan_token(35)) { - jj_scanpos = xsp; - if (jj_scan_token(36)) { - jj_scanpos = xsp; - if (jj_scan_token(37)) { - jj_scanpos = xsp; - if (jj_scan_token(38)) return true; - } - } - } - if (jj_3R_ConditionalExpression_2648_17_147()) return true; - return false; - } - - private boolean jj_3_50() - { - if (jj_3R_ExpressionStatement_2860_17_84()) return true; - return false; - } - - private boolean jj_3_49() - { - if (jj_scan_token(VAR)) return true; - if (jj_3R_Identifier_2221_11_57()) return true; - return false; - } - - private boolean jj_3R_null_2727_41_129() - { - if (jj_scan_token(VAR)) return true; - if (jj_scan_token(IDENTIFIER_NAME)) return true; - return false; - } - - private boolean jj_3R_null_2727_40_83() - { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_null_2727_41_129()) { - jj_scanpos = xsp; - if (jj_3R_null_2727_71_130()) return true; - } - if (jj_scan_token(ASSIGN)) return true; - if (jj_scan_token(CALL)) return true; - return false; - } - - private boolean jj_3_48() - { - Token xsp; - xsp = jj_scanpos; - if (jj_scan_token(28)) jj_scanpos = xsp; - if (jj_scan_token(CMD)) return true; - return false; - } - - private boolean jj_3R_SingleStatement_2738_27_267() - { - if (jj_3R_LabelledStatement_3039_17_288()) return true; - return false; - } - - private boolean jj_3R_SingleStatement_2736_27_266() - { - if (jj_3R_ExpressionStatement_2860_17_84()) return true; - return false; - } - - private boolean jj_3R_SingleStatement_2744_19_272() - { - if (jj_3R_ReturnStatement_2967_17_293()) return true; - return false; - } - - private boolean jj_3R_SingleStatement_2743_19_271() - { - if (jj_3R_ImportStatement_3193_17_292()) return true; - return false; - } - - private boolean jj_3R_SingleStatement_2742_19_270() - { - if (jj_3R_BreakStatement_2957_17_291()) return true; - return false; - } - - private boolean jj_3R_SingleStatement_2733_27_264() - { - if (jj_3R_VariableStatement_2802_17_286()) return true; - return false; - } - - private boolean jj_3R_SingleStatement_2741_19_269() - { - if (jj_3R_YieldStatement_2975_17_290()) return true; - return false; - } - - private boolean jj_3R_SingleStatement_2740_19_268() - { - if (jj_3R_ContinueStatement_2946_17_289()) return true; - return false; - } - - private boolean jj_3_47() - { - Token xsp; - xsp = jj_scanpos; - if (jj_scan_token(27)) { - jj_scanpos = xsp; - if (jj_3R_null_2727_40_83()) return true; - } - return false; - } - - private boolean jj_3R_Insert_1974_14_193() - { - if (jj_scan_token(INSERT)) return true; - Token xsp; - xsp = jj_scanpos; - if (jj_3R_Insert_1977_30_236()) { - jj_scanpos = xsp; - if (jj_3R_Insert_1990_30_237()) return true; - } - return false; - } - - private boolean jj_3R_SingleStatement_2728_27_262() - { - if (jj_3R_Cmd_1940_9_284()) return true; - return false; - } - - private boolean jj_3_46() - { - if (jj_3R_Action_1826_11_82()) return true; - return false; - } - - private boolean jj_3R_SingleStatement_2735_19_265() - { - if (jj_3R_EmptyStatement_2851_17_287()) return true; - return false; - } - - private boolean jj_3R_SingleStatement_2730_19_263() - { - if (jj_3R_Run_1925_12_285()) return true; - return false; - } - - private boolean jj_3R_Insert_1970_11_166() - { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_Insert_1974_14_193()) { - jj_scanpos = xsp; - if (jj_3R_Insert_2005_14_194()) return true; - } - return false; - } - - private boolean jj_3R_AssignmentExpressionNoIn_2674_72_204() - { - if (jj_3R_AssignmentExpressionNoIn_2671_17_135()) return true; - return false; - } - - private boolean jj_3R_SingleStatement_2727_19_261() - { - if (jj_3R_Call_1895_11_283()) return true; - return false; - } - - private boolean jj_3R_Cmd_1944_34_317() - { - if (jj_scan_token(GT)) return true; - if (jj_3R_AssignmentExpression_2663_17_72()) return true; - return false; - } - - private boolean jj_3R_SingleStatement_2725_19_260() - { - if (jj_3R_Action_1826_11_82()) return true; - return false; - } - - private boolean jj_3R_ExpressionNoIn_2697_46_136() - { - if (jj_scan_token(COMMA)) return true; - if (jj_3R_AssignmentExpressionNoIn_2671_17_135()) return true; - return false; - } - - private boolean jj_3R_SingleStatement_2724_19_259() - { - if (jj_3R_SimpleAction_1804_13_282()) return true; - return false; - } - - private boolean jj_3R_SingleStatement_2721_17_244() - { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_SingleStatement_2724_19_259()) { - jj_scanpos = xsp; - if (jj_3R_SingleStatement_2725_19_260()) { - jj_scanpos = xsp; - if (jj_3R_SingleStatement_2727_19_261()) { - jj_scanpos = xsp; - if (jj_3R_SingleStatement_2728_27_262()) { - jj_scanpos = xsp; - if (jj_3R_SingleStatement_2730_19_263()) { - jj_scanpos = xsp; - if (jj_3R_SingleStatement_2733_27_264()) { - jj_scanpos = xsp; - if (jj_3R_SingleStatement_2735_19_265()) { - jj_scanpos = xsp; - if (jj_3R_SingleStatement_2736_27_266()) { - jj_scanpos = xsp; - if (jj_3R_SingleStatement_2738_27_267()) { - jj_scanpos = xsp; - if (jj_3R_SingleStatement_2740_19_268()) { - jj_scanpos = xsp; - if (jj_3R_SingleStatement_2741_19_269()) { - jj_scanpos = xsp; - if (jj_3R_SingleStatement_2742_19_270()) { - jj_scanpos = xsp; - if (jj_3R_SingleStatement_2743_19_271()) { - jj_scanpos = xsp; - if (jj_3R_SingleStatement_2744_19_272()) return true; - } - } - } - } - } - } - } - } - } - } - } - } - } - return false; - } - - private boolean jj_3R_Statement_2711_25_202() - { - if (jj_3R_SingleStatement_2721_17_244()) return true; - return false; - } - - private boolean jj_3_45() - { - if (jj_3R_BodiedStatement_2765_17_81()) return true; - return false; - } - - private boolean jj_3R_Statement_2709_25_172() - { - Token xsp; - xsp = jj_scanpos; - if (jj_3_45()) { - jj_scanpos = xsp; - if (jj_3R_Statement_2711_25_202()) return true; - } - return false; - } - - private boolean jj_3R_Expression_2691_42_133() - { - if (jj_scan_token(COMMA)) return true; - if (jj_3R_AssignmentExpression_2663_17_72()) return true; - return false; - } - - private boolean jj_3_21() - { - if (jj_3R_LeftHandSideExpression_2413_17_68()) return true; - if (jj_scan_token(COLON)) return true; - return false; - } - - private boolean jj_3R_Cmd_1941_23_315() - { - if (jj_scan_token(RUN)) return true; - if (jj_scan_token(CMD)) return true; - return false; - } - - private boolean jj_3R_Run_1928_34_320() - { - if (jj_scan_token(GT)) return true; - if (jj_3R_AssignmentExpression_2663_17_72()) return true; - return false; - } - - private boolean jj_3R_AssignmentExpression_2664_64_182() - { - if (jj_3R_AssignmentExpression_2663_17_72()) return true; - return false; - } - - private boolean jj_3_20() - { - if (jj_3R_LeftHandSideExpression_2413_17_68()) return true; - if (jj_scan_token(COLON)) return true; - return false; - } - - private boolean jj_3R_Cmd_1942_13_316() - { - if (jj_3R_LeftHandSideExpression_2413_17_68()) return true; - if (jj_scan_token(COLON)) return true; - return false; - } - - private boolean jj_3R_Cmd_1940_9_284() - { - Token xsp; - xsp = jj_scanpos; - if (jj_scan_token(29)) { - jj_scanpos = xsp; - if (jj_3R_Cmd_1941_23_315()) return true; - } - xsp = jj_scanpos; - if (jj_3R_Cmd_1942_13_316()) jj_scanpos = xsp; - if (jj_3R_Arguments_2387_17_70()) return true; - xsp = jj_scanpos; - if (jj_3R_Cmd_1944_34_317()) jj_scanpos = xsp; - if (jj_3R_EndStatement_3225_17_128()) return true; - return false; - } - - private boolean jj_3R_Run_1925_23_318() - { - if (jj_3R_LeftHandSideExpression_2413_17_68()) return true; - if (jj_scan_token(COLON)) return true; - return false; - } - - private boolean jj_3R_ExpressionNoIn_2697_17_90() - { - if (jj_3R_AssignmentExpressionNoIn_2671_17_135()) return true; - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3R_ExpressionNoIn_2697_46_136()) { jj_scanpos = xsp; break; } - } - return false; - } - - private boolean jj_3R_Run_1926_20_319() - { - if (jj_3R_getNoReservedIdentifier_1363_11_76()) return true; - return false; - } - - private boolean jj_3_43() - { - if (jj_3R_ActionOnAssign_1866_17_79()) return true; - return false; - } - - private boolean jj_3R_Expression_2691_17_88() - { - if (jj_3R_AssignmentExpression_2663_17_72()) return true; - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3R_Expression_2691_42_133()) { jj_scanpos = xsp; break; } - } - return false; - } - - private boolean jj_3R_Run_1925_12_285() - { - if (jj_scan_token(RUN)) return true; - Token xsp; - xsp = jj_scanpos; - if (jj_3R_Run_1925_23_318()) jj_scanpos = xsp; - xsp = jj_scanpos; - if (jj_3R_Run_1926_20_319()) jj_scanpos = xsp; - if (jj_3R_Arguments_2387_17_70()) return true; - xsp = jj_scanpos; - if (jj_3R_Run_1928_34_320()) jj_scanpos = xsp; - if (jj_3R_EndStatement_3225_17_128()) return true; - return false; - } - - private boolean jj_3R_AssignmentExpressionNoIn_2674_26_203() - { - if (jj_3R_ActionOnAssign_1866_17_79()) return true; - return false; - } - - private boolean jj_3R_ConditionalExpressionNoIn_2654_45_246() - { - if (jj_scan_token(HOOK)) return true; - if (jj_3R_AssignmentExpression_2663_17_72()) return true; - if (jj_scan_token(COLON)) return true; - if (jj_3R_AssignmentExpressionNoIn_2671_17_135()) return true; - return false; - } - - private boolean jj_3R_AssignmentOperator_2681_17_80() - { - Token xsp; - xsp = jj_scanpos; - if (jj_scan_token(120)) { - jj_scanpos = xsp; - if (jj_scan_token(123)) { - jj_scanpos = xsp; - if (jj_scan_token(167)) { - jj_scanpos = xsp; - if (jj_scan_token(124)) { - jj_scanpos = xsp; - if (jj_scan_token(121)) { - jj_scanpos = xsp; - if (jj_scan_token(122)) { - jj_scanpos = xsp; - if (jj_scan_token(125)) { - jj_scanpos = xsp; - if (jj_scan_token(126)) { - jj_scanpos = xsp; - if (jj_scan_token(127)) { - jj_scanpos = xsp; - if (jj_scan_token(128)) { - jj_scanpos = xsp; - if (jj_scan_token(130)) { - jj_scanpos = xsp; - if (jj_scan_token(129)) return true; - } - } - } - } - } - } - } - } - } - } - } - return false; - } - - private boolean jj_3_44() - { - if (jj_3R_LeftHandSideExpression_2413_17_68()) return true; - if (jj_3R_AssignmentOperator_2681_17_80()) return true; - return false; - } - - private boolean jj_3R_Call_1909_18_314() - { - if (jj_3R_Arguments_2387_17_70()) return true; - return false; - } - - private boolean jj_3_18() - { - if (jj_3R_LeftHandSideExpression_2413_17_68()) return true; - if (jj_scan_token(COLON)) return true; - return false; - } - - private boolean jj_3R_AssignmentExpressionNoIn_2675_19_174() - { - if (jj_3R_ConditionalExpressionNoIn_2654_17_205()) return true; - return false; - } - - private boolean jj_3_41() - { - if (jj_3R_ActionOnAssign_1866_17_79()) return true; - return false; - } - - private boolean jj_3_42() - { - if (jj_3R_LeftHandSideExpression_2413_17_68()) return true; - if (jj_3R_AssignmentOperator_2681_17_80()) return true; - return false; - } - - private boolean jj_3R_ConditionalExpression_2648_41_217() - { - if (jj_scan_token(HOOK)) return true; - if (jj_3R_AssignmentExpression_2663_17_72()) return true; - if (jj_scan_token(COLON)) return true; - if (jj_3R_AssignmentExpression_2663_17_72()) return true; - return false; - } - - private boolean jj_3R_AssignmentExpressionNoIn_2671_17_135() - { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_AssignmentExpressionNoIn_2671_17_173()) { - jj_scanpos = xsp; - if (jj_3R_AssignmentExpressionNoIn_2675_19_174()) return true; - } - return false; - } - - private boolean jj_3R_AssignmentExpressionNoIn_2671_17_173() - { - if (jj_3R_LeftHandSideExpression_2413_17_68()) return true; - if (jj_3R_AssignmentOperator_2681_17_80()) return true; - Token xsp; - xsp = jj_scanpos; - if (jj_3R_AssignmentExpressionNoIn_2674_26_203()) { - jj_scanpos = xsp; - if (jj_3R_AssignmentExpressionNoIn_2674_72_204()) return true; - } - return false; - } - - private boolean jj_3R_Call_1901_17_312() - { - if (jj_scan_token(VAR)) return true; - if (jj_3R_Identifier_2221_11_57()) return true; - if (jj_scan_token(ASSIGN)) return true; - if (jj_scan_token(CALL)) return true; - return false; - } - - private boolean jj_3_19() - { - if (jj_3R_FilePathNoSTar_1464_11_69()) return true; - return false; - } - - private boolean jj_3R_Call_1897_20_342() - { - if (jj_3R_LeftHandSideExpression_2413_17_68()) return true; - if (jj_scan_token(COLON)) return true; - return false; - } - - private boolean jj_3_17() - { - if (jj_3R_MemberExpressionPart_2362_17_67()) return true; - return false; - } - - private boolean jj_3R_AssignmentExpression_2665_19_103() - { - if (jj_3R_ConditionalExpression_2648_17_147()) return true; - return false; - } - - private boolean jj_3R_AssignmentExpression_2664_19_181() - { - if (jj_3R_ActionOnAssign_1866_17_79()) return true; - return false; - } - - private boolean jj_3R_AssignmentExpression_2663_17_102() - { - if (jj_3R_LeftHandSideExpression_2413_17_68()) return true; - if (jj_3R_AssignmentOperator_2681_17_80()) return true; - Token xsp; - xsp = jj_scanpos; - if (jj_3R_AssignmentExpression_2664_19_181()) { - jj_scanpos = xsp; - if (jj_3R_AssignmentExpression_2664_64_182()) return true; - } - return false; - } - - private boolean jj_3R_AssignmentExpression_2663_17_72() - { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_AssignmentExpression_2663_17_102()) { - jj_scanpos = xsp; - if (jj_3R_AssignmentExpression_2665_19_103()) return true; - } - return false; - } - - private boolean jj_3R_Call_1903_9_313() - { - if (jj_3R_LeftHandSideExpression_2413_17_68()) return true; - if (jj_scan_token(ASSIGN)) return true; - if (jj_scan_token(CALL)) return true; - return false; - } - - private boolean jj_3R_LogicalORExpressionNoIn_2634_45_274() - { - if (jj_3R_LogicalOROperator_2640_17_277()) return true; - if (jj_3R_LogicalANDExpressionNoIn_2616_17_273()) return true; - return false; - } - - private boolean jj_3R_Call_1897_12_311() - { - if (jj_scan_token(CALL)) return true; - Token xsp; - xsp = jj_scanpos; - if (jj_3R_Call_1897_20_342()) jj_scanpos = xsp; - return false; - } - - private boolean jj_3R_ActionOnAssign_1879_28_156() - { - if (jj_3R_MemberExpressionPart_2362_17_67()) return true; - return false; - } - - private boolean jj_3R_Call_1895_11_283() - { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_Call_1897_12_311()) { - jj_scanpos = xsp; - if (jj_3R_Call_1901_17_312()) { - jj_scanpos = xsp; - if (jj_3R_Call_1903_9_313()) return true; - } - } - xsp = jj_scanpos; - if (jj_3_19()) jj_scanpos = xsp; - if (jj_scan_token(IDENTIFIER_NAME)) return true; - xsp = jj_scanpos; - if (jj_3R_Call_1909_18_314()) jj_scanpos = xsp; - if (jj_3R_EndStatement_3225_17_128()) return true; - return false; - } - - private boolean jj_3R_ConditionalExpressionNoIn_2654_17_205() - { - if (jj_3R_LogicalORExpressionNoIn_2634_17_245()) return true; - Token xsp; - xsp = jj_scanpos; - if (jj_3R_ConditionalExpressionNoIn_2654_45_246()) jj_scanpos = xsp; - return false; - } - - private boolean jj_3R_LogicalORExpression_2628_41_248() - { - if (jj_3R_LogicalOROperator_2640_17_277()) return true; - if (jj_3R_LogicalANDExpression_2610_17_209()) return true; - return false; - } - - private boolean jj_3R_ConditionalExpression_2648_17_147() - { - if (jj_3R_LogicalORExpression_2628_17_179()) return true; - Token xsp; - xsp = jj_scanpos; - if (jj_3R_ConditionalExpression_2648_41_217()) jj_scanpos = xsp; - return false; - } - - private boolean jj_3R_LogicalANDExpressionNoIn_2616_44_295() - { - if (jj_3R_LogicalANDOperator_2622_17_298()) return true; - if (jj_3R_BitwiseORExpressionNoIn_2597_17_294()) return true; - return false; - } - - private boolean jj_3R_LogicalOROperator_2640_17_277() - { - if (jj_scan_token(SC_OR)) return true; - return false; - } - - private boolean jj_3R_ActionOnAssign_1868_19_114() - { - if (jj_scan_token(IDENTIFIER_NAME)) return true; - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3R_ActionOnAssign_1879_28_156()) { jj_scanpos = xsp; break; } - } - if (jj_scan_token(DOT)) return true; - return false; - } - - private boolean jj_3_16() - { - if (jj_3R_MemberExpressionPart_2362_17_67()) return true; - return false; - } - - private boolean jj_3R_LogicalORExpressionNoIn_2634_17_245() - { - if (jj_3R_LogicalANDExpressionNoIn_2616_17_273()) return true; - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3R_LogicalORExpressionNoIn_2634_45_274()) { jj_scanpos = xsp; break; } - } - return false; - } - - private boolean jj_3R_ActionOnAssign_1866_17_79() - { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_ActionOnAssign_1868_19_114()) jj_scanpos = xsp; - if (jj_3R_ExecOnAssign_2042_17_115()) return true; - return false; - } - - private boolean jj_3R_LogicalANDExpression_2610_40_276() - { - if (jj_3R_LogicalANDOperator_2622_17_298()) return true; - if (jj_3R_BitwiseORExpression_2591_17_247()) return true; - return false; - } - - private boolean jj_3R_LogicalORExpression_2628_17_179() - { - if (jj_3R_LogicalANDExpression_2610_17_209()) return true; - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3R_LogicalORExpression_2628_41_248()) { jj_scanpos = xsp; break; } - } - return false; - } - - private boolean jj_3R_BitwiseORExpressionNoIn_2597_45_329() - { - if (jj_3R_BitwiseOROperator_2603_17_332()) return true; - if (jj_3R_BitwiseXORExpressionNoIn_2579_17_328()) return true; - return false; - } - - private boolean jj_3R_Action_1846_28_123() - { - if (jj_3R_MemberExpressionPart_2362_17_67()) return true; - return false; - } - - private boolean jj_3R_Action_1854_19_127() - { - if (jj_3R_OutputAct_2067_12_169()) return true; - return false; - } - - private boolean jj_3R_LogicalANDOperator_2622_17_298() - { - if (jj_scan_token(SC_AND)) return true; - return false; - } - - private boolean jj_3R_Action_1853_19_126() - { - if (jj_3R_Perform_2024_17_168()) return true; - return false; - } - - private boolean jj_3R_Action_1852_19_125() - { - if (jj_3R_Define_2086_17_167()) return true; - return false; - } - - private boolean jj_3R_Action_1851_19_124() - { - if (jj_3R_Insert_1970_11_166()) return true; - return false; - } - - private boolean jj_3R_LogicalANDExpressionNoIn_2616_17_273() - { - if (jj_3R_BitwiseORExpressionNoIn_2597_17_294()) return true; - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3R_LogicalANDExpressionNoIn_2616_44_295()) { jj_scanpos = xsp; break; } - } - return false; - } - - private boolean jj_3R_BitwiseORExpression_2591_41_297() - { - if (jj_3R_BitwiseOROperator_2603_17_332()) return true; - if (jj_3R_BitwiseXORExpression_2573_17_275()) return true; - return false; - } - - private boolean jj_3R_LogicalANDExpression_2610_17_209() - { - if (jj_3R_BitwiseORExpression_2591_17_247()) return true; - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3R_LogicalANDExpression_2610_40_276()) { jj_scanpos = xsp; break; } - } - return false; - } - - private boolean jj_3R_BitwiseXORExpressionNoIn_2579_45_345() - { - if (jj_3R_BitwiseXOROperator_2585_17_348()) return true; - if (jj_3R_BitwiseANDExpressionNoIn_2561_17_344()) return true; - return false; - } - - private boolean jj_3R_BitwiseOROperator_2603_17_332() - { - if (jj_scan_token(BIT_OR)) return true; - return false; - } - - private boolean jj_3R_BitwiseXORExpression_2573_41_331() - { - if (jj_3R_BitwiseXOROperator_2585_17_348()) return true; - if (jj_3R_BitwiseANDExpression_2555_17_296()) return true; - return false; - } - - private boolean jj_3R_BitwiseORExpressionNoIn_2597_17_294() - { - if (jj_3R_BitwiseXORExpressionNoIn_2579_17_328()) return true; - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3R_BitwiseORExpressionNoIn_2597_45_329()) { jj_scanpos = xsp; break; } - } - return false; - } - - private boolean jj_3_15() - { - if (jj_scan_token(COMMA)) return true; - if (jj_3R_FourthSetOp_1610_17_65()) return true; - return false; - } - - private boolean jj_3R_BitwiseORExpression_2591_17_247() - { - if (jj_3R_BitwiseXORExpression_2573_17_275()) return true; - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3R_BitwiseORExpression_2591_41_297()) { jj_scanpos = xsp; break; } - } - return false; - } - - private boolean jj_3R_BitwiseANDExpressionNoIn_2561_43_358() - { - if (jj_3R_BitwiseANDOperator_2567_17_361()) return true; - if (jj_3R_EqualityExpressionNoIn_2541_17_357()) return true; - return false; - } - - private boolean jj_3R_Action_1826_11_82() - { - if (jj_scan_token(IDENTIFIER_NAME)) return true; - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3R_Action_1846_28_123()) { jj_scanpos = xsp; break; } - } - if (jj_scan_token(DOT)) return true; - xsp = jj_scanpos; - if (jj_3R_Action_1851_19_124()) { - jj_scanpos = xsp; - if (jj_3R_Action_1852_19_125()) { - jj_scanpos = xsp; - if (jj_3R_Action_1853_19_126()) { - jj_scanpos = xsp; - if (jj_3R_Action_1854_19_127()) return true; - } - } - } - if (jj_3R_EndStatement_3225_17_128()) return true; - return false; - } - - private boolean jj_3R_BitwiseXOROperator_2585_17_348() - { - if (jj_scan_token(XOR)) return true; - return false; - } - - private boolean jj_3R_SimpleAction_1811_21_310() - { - if (jj_3R_OutputAct_2067_12_169()) return true; - return false; - } - - private boolean jj_3R_SimpleAction_1809_21_309() - { - if (jj_3R_Perform_2024_17_168()) return true; - return false; - } - - private boolean jj_3R_BitwiseXORExpressionNoIn_2579_17_328() - { - if (jj_3R_BitwiseANDExpressionNoIn_2561_17_344()) return true; - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3R_BitwiseXORExpressionNoIn_2579_45_345()) { jj_scanpos = xsp; break; } - } - return false; - } - - private boolean jj_3R_BitwiseANDExpression_2555_40_347() - { - if (jj_3R_BitwiseANDOperator_2567_17_361()) return true; - if (jj_3R_EqualityExpression_2535_17_330()) return true; - return false; - } - - private boolean jj_3R_SimpleAction_1807_21_308() - { - if (jj_3R_Define_2086_17_167()) return true; - return false; - } - - private boolean jj_3R_SimpleAction_1805_21_307() - { - if (jj_3R_Insert_1970_11_166()) return true; - return false; - } - - private boolean jj_3R_BitwiseXORExpression_2573_17_275() - { - if (jj_3R_BitwiseANDExpression_2555_17_296()) return true; - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3R_BitwiseXORExpression_2573_41_331()) { jj_scanpos = xsp; break; } - } - return false; - } - - private boolean jj_3R_EqualityExpressionNoIn_2541_46_373() - { - if (jj_3R_EqualityOperator_2547_17_139()) return true; - if (jj_3R_RelationalExpressionNoIn_2519_17_372()) return true; - return false; - } - - private boolean jj_3R_BitwiseANDOperator_2567_17_361() - { - if (jj_scan_token(BIT_AND)) return true; - return false; - } - - private boolean jj_3R_SimpleAction_1804_13_282() - { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_SimpleAction_1805_21_307()) { - jj_scanpos = xsp; - if (jj_3R_SimpleAction_1807_21_308()) { - jj_scanpos = xsp; - if (jj_3R_SimpleAction_1809_21_309()) { - jj_scanpos = xsp; - if (jj_3R_SimpleAction_1811_21_310()) return true; - } - } - } - if (jj_3R_EndStatement_3225_17_128()) return true; - return false; - } - - private boolean jj_3R_BitwiseANDExpressionNoIn_2561_17_344() - { - if (jj_3R_EqualityExpressionNoIn_2541_17_357()) return true; - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3R_BitwiseANDExpressionNoIn_2561_43_358()) { jj_scanpos = xsp; break; } - } - return false; - } - - private boolean jj_3R_EqualityExpression_2535_42_360() - { - if (jj_3R_EqualityOperator_2547_17_139()) return true; - if (jj_3R_RelationalExpression_2506_17_346()) return true; - return false; - } - - private boolean jj_3R_BitwiseANDExpression_2555_17_296() - { - if (jj_3R_EqualityExpression_2535_17_330()) return true; - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3R_BitwiseANDExpression_2555_40_347()) { jj_scanpos = xsp; break; } - } - return false; - } - - private boolean jj_3R_EqualityOperator_2547_17_139() - { - Token xsp; - xsp = jj_scanpos; - if (jj_scan_token(96)) { - jj_scanpos = xsp; - if (jj_scan_token(97)) { - jj_scanpos = xsp; - if (jj_scan_token(99)) { - jj_scanpos = xsp; - if (jj_scan_token(100)) { - jj_scanpos = xsp; - if (jj_scan_token(98)) return true; - } - } - } - } - return false; - } - - private boolean jj_3R_EqualityExpressionNoIn_2541_17_357() - { - if (jj_3R_RelationalExpressionNoIn_2519_17_372()) return true; - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3R_EqualityExpressionNoIn_2541_46_373()) { jj_scanpos = xsp; break; } - } - return false; - } - - private boolean jj_3R_RelationalExpressionNoIn_2519_37_388() - { - if (jj_3R_RelationalNoInOperator_2526_17_395()) return true; - if (jj_3R_ShiftExpression_2491_17_359()) return true; - return false; - } - - private boolean jj_3R_SourceElement_3178_145_351() - { - if (jj_3R_Statement_2709_25_172()) return true; - return false; - } - - private boolean jj_3R_EqualityExpression_2535_17_330() - { - if (jj_3R_RelationalExpression_2506_17_346()) return true; - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3R_EqualityExpression_2535_42_360()) { jj_scanpos = xsp; break; } - } - return false; - } - - private boolean jj_3R_RelationalNoInOperator_2526_17_395() - { - Token xsp; - xsp = jj_scanpos; - if (jj_scan_token(92)) { - jj_scanpos = xsp; - if (jj_scan_token(93)) { - jj_scanpos = xsp; - if (jj_scan_token(94)) { - jj_scanpos = xsp; - if (jj_scan_token(95)) { - jj_scanpos = xsp; - if (jj_scan_token(131)) return true; - } - } - } - } - return false; - } - - private boolean jj_3R_RelationalExpression_2506_37_375() - { - if (jj_3R_RelationalOperator_2512_17_140()) return true; - if (jj_3R_ShiftExpression_2491_17_359()) return true; - return false; - } - - private boolean jj_3R_RelationalExpressionNoIn_2519_17_372() - { - if (jj_3R_ShiftExpression_2491_17_359()) return true; - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3R_RelationalExpressionNoIn_2519_37_388()) { jj_scanpos = xsp; break; } - } - return false; - } - - private boolean jj_3_14() - { - if (jj_scan_token(COMMA)) return true; - if (jj_3R_Identifier_2221_11_57()) return true; - return false; - } - - private boolean jj_3R_ShiftExpression_2491_40_390() - { - if (jj_3R_ShiftOperator_2497_17_398()) return true; - if (jj_3R_AdditiveExpression_2476_17_374()) return true; - return false; - } - - private boolean jj_3R_RelationalOperator_2512_17_140() - { - Token xsp; - xsp = jj_scanpos; - if (jj_scan_token(92)) { - jj_scanpos = xsp; - if (jj_scan_token(93)) { - jj_scanpos = xsp; - if (jj_scan_token(94)) { - jj_scanpos = xsp; - if (jj_scan_token(95)) { - jj_scanpos = xsp; - if (jj_scan_token(131)) { - jj_scanpos = xsp; - if (jj_scan_token(55)) return true; - } - } - } - } - } - return false; - } - - private boolean jj_3R_RelationalExpression_2506_17_346() - { - if (jj_3R_ShiftExpression_2491_17_359()) return true; - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3R_RelationalExpression_2506_37_375()) { jj_scanpos = xsp; break; } - } - return false; - } - - private boolean jj_3R_AdditiveExpression_2476_46_397() - { - if (jj_3R_AdditiveOperator_2482_17_405()) return true; - if (jj_3R_MultiplicativeExpression_2461_17_389()) return true; - return false; - } - - private boolean jj_3R_ShiftOperator_2497_17_398() - { - Token xsp; - xsp = jj_scanpos; - if (jj_scan_token(107)) { - jj_scanpos = xsp; - if (jj_scan_token(108)) { - jj_scanpos = xsp; - if (jj_scan_token(109)) return true; - } - } - return false; - } - - private boolean jj_3R_MemberExpressionPart_2363_149_97() - { - if (jj_scan_token(DOT)) return true; - if (jj_3R_noReservedIdentifier_1380_11_143()) return true; - return false; - } - - private boolean jj_3R_Arguments_2388_123_145() - { - if (jj_3R_ArgumentList_2406_17_178()) return true; - return false; - } - - private boolean jj_3R_ShiftExpression_2491_17_359() - { - if (jj_3R_AdditiveExpression_2476_17_374()) return true; - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3R_ShiftExpression_2491_40_390()) { jj_scanpos = xsp; break; } - } - return false; - } - - private boolean jj_3_63() - { - if (jj_scan_token(FUNCTION)) return true; - if (jj_3R_Identifier_2221_11_57()) return true; - return false; - } - - private boolean jj_3R_null_1670_68_95() - { - if (jj_3R_RelationalOperator_2512_17_140()) return true; - return false; - } - - private boolean jj_3R_AdditiveOperator_2482_17_405() - { - Token xsp; - xsp = jj_scanpos; - if (jj_scan_token(101)) { - jj_scanpos = xsp; - if (jj_scan_token(102)) return true; - } - return false; - } - - private boolean jj_3R_MultiplicativeExpression_2461_37_404() - { - if (jj_3R_MultiplicativeOperator_2468_17_412()) return true; - if (jj_3R_UnaryExpression_2444_17_396()) return true; - return false; - } - - private boolean jj_3R_SourceElement_3178_86_350() - { - if (jj_3R_FunctionDeclaration_3078_17_363()) return true; - return false; - } - - private boolean jj_3R_AdditiveExpression_2476_17_374() - { - if (jj_3R_MultiplicativeExpression_2461_17_389()) return true; - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3R_AdditiveExpression_2476_46_397()) { jj_scanpos = xsp; break; } - } - return false; - } - - private boolean jj_3R_LeftHandSideExpressionForIn_2420_69_393() - { - if (jj_3R_MemberExpressionForIn_2345_17_401()) return true; - return false; - } - - private boolean jj_3R_null_1670_49_94() - { - if (jj_3R_EqualityOperator_2547_17_139()) return true; - return false; - } - - private boolean jj_3R_MultiplicativeOperator_2468_17_412() - { - Token xsp; - xsp = jj_scanpos; - if (jj_scan_token(103)) { - jj_scanpos = xsp; - if (jj_scan_token(168)) { - jj_scanpos = xsp; - if (jj_scan_token(104)) return true; - } - } - return false; - } - - private boolean jj_3R_UnaryExpression_2444_39_403() - { - if (jj_3R_UnaryOperator_2450_17_411()) return true; - if (jj_3R_UnaryExpression_2444_17_396()) return true; - return false; - } - - private boolean jj_3R_LeftHandSideExpression_2413_70_99() - { - if (jj_3R_MemberExpression_2333_17_77()) return true; - return false; - } - - private boolean jj_3R_MultiplicativeExpression_2461_17_389() - { - if (jj_3R_UnaryExpression_2444_17_396()) return true; - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3R_MultiplicativeExpression_2461_37_404()) { jj_scanpos = xsp; break; } - } - return false; - } - - private boolean jj_3R_EndStatement_3225_17_128() - { - if (jj_scan_token(SEMICOLON)) return true; - return false; - } - - private boolean jj_3R_PostfixExpression_2428_44_413() - { - if (jj_3R_PostfixOperator_2434_17_414()) return true; - return false; - } - - private boolean jj_3_64() - { - if (jj_scan_token(DOT)) return true; - if (jj_scan_token(IDENTIFIER_NAME)) return true; - return false; - } - - private boolean jj_3R_UnaryOperator_2450_17_411() - { - Token xsp; - xsp = jj_scanpos; - if (jj_scan_token(49)) { - jj_scanpos = xsp; - if (jj_scan_token(64)) { - jj_scanpos = xsp; - if (jj_scan_token(62)) { - jj_scanpos = xsp; - if (jj_scan_token(105)) { - jj_scanpos = xsp; - if (jj_scan_token(106)) { - jj_scanpos = xsp; - if (jj_scan_token(101)) { - jj_scanpos = xsp; - if (jj_scan_token(102)) { - jj_scanpos = xsp; - if (jj_scan_token(114)) { - jj_scanpos = xsp; - if (jj_scan_token(113)) return true; - } - } - } - } - } - } - } - } - return false; - } - - private boolean jj_3R_null_1670_29_66() - { - if (jj_scan_token(IDENTIFIER_NAME)) return true; - Token xsp; - xsp = jj_scanpos; - if (jj_3R_null_1670_49_94()) { - jj_scanpos = xsp; - if (jj_3R_null_1670_68_95()) return true; - } - return false; - } - - private boolean jj_3_13() - { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_null_1670_29_66()) { - jj_scanpos = xsp; - if (jj_scan_token(85)) return true; - } - return false; - } - - private boolean jj_3R_CallExpressionPart_2382_82_111() - { - if (jj_scan_token(DOT)) return true; - if (jj_3R_noReservedIdentifier_1380_11_143()) return true; - return false; - } - - private boolean jj_3R_UnaryExpression_2444_17_402() - { - if (jj_3R_PostfixExpression_2428_17_410()) return true; - return false; - } - - private boolean jj_3R_UnaryExpression_2444_17_396() - { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_UnaryExpression_2444_17_402()) { - jj_scanpos = xsp; - if (jj_3R_UnaryExpression_2444_39_403()) return true; - } - return false; - } - - private boolean jj_3R_ImportStatement_3193_35_326() - { - if (jj_scan_token(DOT)) return true; - if (jj_scan_token(STAR)) return true; - return false; - } - - private boolean jj_3R_PostfixOperator_2434_17_414() - { - Token xsp; - xsp = jj_scanpos; - if (jj_scan_token(105)) { - jj_scanpos = xsp; - if (jj_scan_token(106)) return true; - } - return false; - } - - private boolean jj_3R_Name_3200_17_325() - { - if (jj_scan_token(IDENTIFIER_NAME)) return true; - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3_64()) { jj_scanpos = xsp; break; } - } - return false; - } - - private boolean jj_3_40() - { - if (jj_3R_CallExpression_2369_17_78()) return true; - return false; - } - - private boolean jj_3R_ArgumentList_2406_41_208() - { - if (jj_scan_token(COMMA)) return true; - if (jj_3R_AssignmentExpression_2663_17_72()) return true; - return false; - } - - private boolean jj_3R_PostfixExpression_2428_17_410() - { - if (jj_3R_LeftHandSideExpression_2413_17_68()) return true; - Token xsp; - xsp = jj_scanpos; - if (jj_3R_PostfixExpression_2428_44_413()) jj_scanpos = xsp; - return false; - } - - private boolean jj_3R_ImportStatement_3193_17_292() - { - if (jj_scan_token(IMPORT)) return true; - if (jj_3R_Name_3200_17_325()) return true; - Token xsp; - xsp = jj_scanpos; - if (jj_3R_ImportStatement_3193_35_326()) jj_scanpos = xsp; - if (jj_3R_EndStatement_3225_17_128()) return true; - return false; - } - - private boolean jj_3_39() - { - if (jj_3R_MemberExpression_2333_17_77()) return true; - if (jj_scan_token(LPAREN)) return true; - return false; - } - - private boolean jj_3_35() - { - if (jj_3R_MemberExpressionPart_2362_17_67()) return true; - return false; - } - - private boolean jj_3_62() - { - if (jj_scan_token(FUNCTION_GEN)) return true; - if (jj_3R_Identifier_2221_11_57()) return true; - return false; - } - - private boolean jj_3R_LeftHandSideExpressionForIn_2420_17_392() - { - if (jj_3R_CallExpressionForIn_2375_17_400()) return true; - return false; - } - - private boolean jj_3R_LeftHandSideExpressionForIn_2420_17_379() - { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_LeftHandSideExpressionForIn_2420_17_392()) { - jj_scanpos = xsp; - if (jj_3R_LeftHandSideExpressionForIn_2420_69_393()) return true; - } - return false; - } - - private boolean jj_3_12() - { - if (jj_scan_token(IDENTIFIER_NAME)) return true; - if (jj_scan_token(ASSIGN)) return true; - return false; - } - - private boolean jj_3R_LeftHandSideExpression_2413_17_98() - { - if (jj_3R_CallExpression_2369_17_78()) return true; - return false; - } - - private boolean jj_3R_LeftHandSideExpression_2413_17_68() - { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_LeftHandSideExpression_2413_17_98()) { - jj_scanpos = xsp; - if (jj_3R_LeftHandSideExpression_2413_70_99()) return true; - } - return false; - } - - private boolean jj_3_37() - { - if (jj_3R_CallExpressionPart_2381_17_75()) return true; - return false; - } - - private boolean jj_3R_NamedArgumentList_2394_35_207() - { - if (jj_scan_token(COMMA)) return true; - if (jj_3R_NamedArgument_2400_11_206()) return true; - return false; - } - - private boolean jj_3R_SourceElement_3178_17_349() - { - if (jj_3R_GeneratorFunctionDeclaration_3085_17_362()) return true; - return false; - } - - private boolean jj_3R_SourceElement_3178_17_333() - { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_SourceElement_3178_17_349()) { - jj_scanpos = xsp; - if (jj_3R_SourceElement_3178_86_350()) { - jj_scanpos = xsp; - if (jj_3R_SourceElement_3178_145_351()) return true; - } - } - return false; - } - - private boolean jj_3R_null_1579_82_61() - { - Token xsp; - xsp = jj_scanpos; - if (jj_scan_token(35)) { - jj_scanpos = xsp; - if (jj_scan_token(36)) return true; - } - return false; - } - - private boolean jj_3R_GeneratorFunctionExpression_3134_61_220() - { - if (jj_3R_FormalParameterList_3141_17_183()) return true; - return false; - } - - private boolean jj_3R_SourceElements_3172_18_299() - { - if (jj_3R_SourceElement_3178_17_333()) return true; - return false; - } - - private boolean jj_3R_ArgumentList_2406_17_178() - { - if (jj_3R_AssignmentExpression_2663_17_72()) return true; - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3R_ArgumentList_2406_41_208()) { jj_scanpos = xsp; break; } - } - return false; - } - - private boolean jj_3R_SourceElements_3172_17_278() - { - Token xsp; - if (jj_3R_SourceElements_3172_18_299()) return true; - while (true) { - xsp = jj_scanpos; - if (jj_3R_SourceElements_3172_18_299()) { jj_scanpos = xsp; break; } - } - return false; - } - - private boolean jj_3R_FirstSetOp_1623_32_176() - { - if (jj_scan_token(LPAREN)) return true; - if (jj_3R_FourthSetOp_1610_17_65()) return true; - if (jj_scan_token(RPAREN)) return true; - return false; - } - - private boolean jj_3R_FunctionExpression_3127_60_223() - { - if (jj_3R_FormalParameterList_3141_17_183()) return true; - return false; - } - - private boolean jj_3_36() - { - if (jj_3R_CallExpressionPart_2381_17_75()) return true; - return false; - } - - private boolean jj_3_38() - { - if (jj_3R_getNoReservedIdentifier_1363_11_76()) return true; - if (jj_scan_token(COLON)) return true; - return false; - } - - private boolean jj_3R_ThirdSetOp_1617_31_138() - { - Token xsp; - xsp = jj_scanpos; - if (jj_scan_token(118)) { - jj_scanpos = xsp; - if (jj_scan_token(110)) return true; - } - if (jj_3R_ThirdSetOp_1617_17_93()) return true; - return false; - } - - private boolean jj_3R_CallExpressionPart_2382_31_110() - { - if (jj_scan_token(LBRACKET)) return true; - if (jj_3R_Expression_2691_17_88()) return true; - if (jj_scan_token(RBRACKET)) return true; - return false; - } - - private boolean jj_3_34() - { - if (jj_3R_Arguments_2387_17_70()) return true; - return false; - } - - private boolean jj_3R_NamedArgumentList_2394_18_177() - { - if (jj_3R_NamedArgument_2400_11_206()) return true; - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3R_NamedArgumentList_2394_35_207()) { jj_scanpos = xsp; break; } - } - return false; - } - - private boolean jj_3R_NamedArgument_2400_11_206() - { - if (jj_3R_getNoReservedIdentifier_1363_11_76()) return true; - if (jj_scan_token(COLON)) return true; - if (jj_3R_AssignmentExpression_2663_17_72()) return true; - return false; - } - - private boolean jj_3R_Arguments_2387_22_100() - { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_Arguments_2387_22_144()) { - jj_scanpos = xsp; - if (jj_3R_Arguments_2388_123_145()) return true; - } - return false; - } - - private boolean jj_3R_Arguments_2387_22_144() - { - if (jj_3R_NamedArgumentList_2394_18_177()) return true; - return false; - } - - private boolean jj_3R_FunctionBody_3147_29_249() - { - if (jj_3R_SourceElements_3172_17_278()) return true; - return false; - } - - private boolean jj_3_11() - { - if (jj_scan_token(PLUS)) return true; - if (jj_3R_FourthSetOp_1610_17_65()) return true; - return false; - } - - private boolean jj_3_61() - { - if (jj_3R_ExpressionNoIn_2697_17_90()) return true; - return false; - } - - private boolean jj_3R_FormalParameterList_3141_34_218() - { - if (jj_scan_token(COMMA)) return true; - if (jj_3R_Identifier_2221_11_57()) return true; - return false; - } - - private boolean jj_3R_FirstSetOp_1623_17_137() - { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_FirstSetOp_1623_17_175()) { - jj_scanpos = xsp; - if (jj_3R_FirstSetOp_1623_32_176()) return true; - } - return false; - } - - private boolean jj_3R_FirstSetOp_1623_17_175() - { - if (jj_3R_Identifier_2221_11_57()) return true; - return false; - } - - private boolean jj_3R_MemberExpressionPart_2362_45_142() - { - if (jj_scan_token(LBRACE)) return true; - if (jj_3R_Expression_2691_17_88()) return true; - if (jj_scan_token(RBRACE)) return true; - return false; - } - - private boolean jj_3R_Arguments_2387_17_70() - { - if (jj_scan_token(LPAREN)) return true; - Token xsp; - xsp = jj_scanpos; - if (jj_3R_Arguments_2387_22_100()) jj_scanpos = xsp; - if (jj_scan_token(RPAREN)) return true; - return false; - } - - private boolean jj_3R_GeneratorFunctionExpression_3134_37_219() - { - if (jj_3R_Identifier_2221_11_57()) return true; - return false; - } - - private boolean jj_3R_AllocationExpression_2356_47_187() - { - if (jj_3R_Arguments_2387_17_70()) return true; - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3_35()) { jj_scanpos = xsp; break; } - } - return false; - } - - private boolean jj_3R_ThirdSetOp_1617_17_93() - { - if (jj_3R_FirstSetOp_1623_17_137()) return true; - Token xsp; - xsp = jj_scanpos; - if (jj_3R_ThirdSetOp_1617_31_138()) jj_scanpos = xsp; - return false; - } - - private boolean jj_3R_CallExpressionPart_2381_17_109() - { - if (jj_3R_Arguments_2387_17_70()) return true; - return false; - } - - private boolean jj_3R_CallExpressionPart_2381_17_75() - { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_CallExpressionPart_2381_17_109()) { - jj_scanpos = xsp; - if (jj_3R_CallExpressionPart_2382_31_110()) { - jj_scanpos = xsp; - if (jj_3R_CallExpressionPart_2382_82_111()) return true; - } - } - return false; - } - - private boolean jj_3R_ArrowFunctionExpression_3100_65_108() - { - if (jj_3R_ExpressionNoIn_2697_17_90()) return true; - return false; - } - - private boolean jj_3R_null_1601_29_64() - { - Token xsp; - xsp = jj_scanpos; - if (jj_scan_token(85)) jj_scanpos = xsp; - if (jj_3R_getNoReservedIdentifier_1363_11_76()) return true; - if (jj_scan_token(ASSIGN)) return true; - return false; - } - - private boolean jj_3R_FunctionBody_3147_17_221() - { - if (jj_scan_token(LBRACE)) return true; - Token xsp; - xsp = jj_scanpos; - if (jj_3R_FunctionBody_3147_29_249()) jj_scanpos = xsp; - if (jj_scan_token(RBRACE)) return true; - return false; - } - - private boolean jj_3R_FunctionExpression_3127_36_222() - { - if (jj_3R_Identifier_2221_11_57()) return true; - return false; - } - - private boolean jj_3R_FourthSetOp_1610_17_65() - { - if (jj_3R_ThirdSetOp_1617_17_93()) return true; - Token xsp; - xsp = jj_scanpos; - if (jj_3_11()) jj_scanpos = xsp; - return false; - } - - private boolean jj_3R_CallExpressionForIn_2375_17_400() - { - if (jj_3R_MemberExpressionForIn_2345_17_401()) return true; - if (jj_3R_Arguments_2387_17_70()) return true; - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3_37()) { jj_scanpos = xsp; break; } - } - return false; - } - - private boolean jj_3_9() - { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_null_1600_25_63()) { - jj_scanpos = xsp; - if (jj_3R_null_1601_29_64()) return true; - } - return false; - } - - private boolean jj_3R_null_1600_25_63() - { - if (jj_3R_getNoReservedIdentifier_1363_11_76()) return true; - Token xsp; - xsp = jj_scanpos; - if (jj_scan_token(83)) { - jj_scanpos = xsp; - if (jj_scan_token(89)) { - jj_scanpos = xsp; - if (jj_scan_token(43)) return true; - } - } - return false; - } - - private boolean jj_3_32() - { - if (jj_3R_ArrowFunctionExpression_3099_9_74()) return true; - return false; - } - - private boolean jj_3R_FormalParameterList_3141_17_183() - { - if (jj_3R_Identifier_2221_11_57()) return true; - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3R_FormalParameterList_3141_34_218()) { jj_scanpos = xsp; break; } - } - return false; - } - - private boolean jj_3_31() - { - if (jj_scan_token(FUNCTION)) return true; - return false; - } - - private boolean jj_3_30() - { - if (jj_scan_token(FUNCTION_GEN)) return true; - return false; - } - - private boolean jj_3R_null_1581_38_62() - { - if (jj_3R_Identifier_2221_11_57()) return true; - if (jj_scan_token(COLON)) return true; - return false; - } - - private boolean jj_3R_CallExpression_2369_17_78() - { - if (jj_3R_MemberExpression_2333_17_77()) return true; - if (jj_3R_Arguments_2387_17_70()) return true; - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3_36()) { jj_scanpos = xsp; break; } - } - return false; - } - - private boolean jj_3_8() - { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_null_1581_38_62()) jj_scanpos = xsp; - if (jj_scan_token(CONDITION)) return true; - return false; - } - - private boolean jj_3_10() - { - if (jj_3R_FourthSetOp_1610_17_65()) return true; - return false; - } - - private boolean jj_3R_null_1579_38_92() - { - if (jj_3R_Identifier_2221_11_57()) return true; - if (jj_scan_token(COLON)) return true; - return false; - } - - private boolean jj_3R_GeneratorFunctionExpression_3134_17_184() - { - if (jj_scan_token(FUNCTION_GEN)) return true; - Token xsp; - xsp = jj_scanpos; - if (jj_3R_GeneratorFunctionExpression_3134_37_219()) jj_scanpos = xsp; - if (jj_scan_token(LPAREN)) return true; - xsp = jj_scanpos; - if (jj_3R_GeneratorFunctionExpression_3134_61_220()) jj_scanpos = xsp; - if (jj_scan_token(RPAREN)) return true; - if (jj_3R_FunctionBody_3147_17_221()) return true; - return false; - } - - private boolean jj_3_7() - { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_null_1579_37_60()) { - jj_scanpos = xsp; - if (jj_3R_null_1579_82_61()) return true; - } - return false; - } - - private boolean jj_3R_null_1579_37_60() - { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_null_1579_38_92()) jj_scanpos = xsp; - xsp = jj_scanpos; - if (jj_scan_token(35)) { - jj_scanpos = xsp; - if (jj_scan_token(36)) return true; - } - return false; - } - - private boolean jj_3R_MemberExpressionForIn_2349_33_409() - { - if (jj_3R_PrimaryExpression_2121_13_186()) return true; - return false; - } - - private boolean jj_3R_null_1577_38_91() - { - if (jj_3R_Identifier_2221_11_57()) return true; - if (jj_scan_token(COLON)) return true; - return false; - } - - private boolean jj_3R_MemberExpressionForIn_2348_33_408() - { - if (jj_3R_ArrowFunctionExpression_3099_9_74()) return true; - return false; - } - - private boolean jj_3_6() - { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_null_1577_37_59()) { - jj_scanpos = xsp; - if (jj_scan_token(25)) return true; - } - return false; - } - - private boolean jj_3R_null_1577_37_59() - { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_null_1577_38_91()) jj_scanpos = xsp; - if (jj_scan_token(APPLY)) return true; - return false; - } - - private boolean jj_3R_MemberExpressionPart_2362_19_141() - { - if (jj_scan_token(LBRACKET)) return true; - if (jj_3R_Expression_2691_17_88()) return true; - if (jj_scan_token(RBRACKET)) return true; - return false; - } - - private boolean jj_3R_MemberExpressionForIn_2347_33_407() - { - if (jj_3R_FunctionExpression_3127_17_185()) return true; - return false; - } - - private boolean jj_3R_MemberExpressionForIn_2346_33_406() - { - if (jj_3R_GeneratorFunctionExpression_3134_17_184()) return true; - return false; - } - - private boolean jj_3R_MemberExpressionPart_2362_17_96() - { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_MemberExpressionPart_2362_19_141()) { - jj_scanpos = xsp; - if (jj_3R_MemberExpressionPart_2362_45_142()) return true; - } - return false; - } - - private boolean jj_3R_MemberExpressionPart_2362_17_67() - { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_MemberExpressionPart_2362_17_96()) { - jj_scanpos = xsp; - if (jj_3R_MemberExpressionPart_2363_149_97()) return true; - } - return false; - } - - private boolean jj_3_28() - { - if (jj_3R_ArrowFunctionExpression_3099_9_74()) return true; - return false; - } - - private boolean jj_3_27() - { - if (jj_scan_token(FUNCTION)) return true; - return false; - } - - private boolean jj_3R_ArrowFunctionExpression_3099_46_106() - { - if (jj_3R_Identifier_2221_11_57()) return true; - return false; - } - - private boolean jj_3_26() - { - if (jj_scan_token(FUNCTION_GEN)) return true; - return false; - } - - private boolean jj_3R_FunctionExpression_3127_17_185() - { - if (jj_scan_token(FUNCTION)) return true; - Token xsp; - xsp = jj_scanpos; - if (jj_3R_FunctionExpression_3127_36_222()) jj_scanpos = xsp; - if (jj_scan_token(LPAREN)) return true; - xsp = jj_scanpos; - if (jj_3R_FunctionExpression_3127_60_223()) jj_scanpos = xsp; - if (jj_scan_token(RPAREN)) return true; - if (jj_3R_FunctionBody_3147_17_221()) return true; - return false; - } - - private boolean jj_3R_null_1575_34_58() - { - if (jj_3R_Identifier_2221_11_57()) return true; - if (jj_scan_token(COLON)) return true; - return false; - } - - private boolean jj_3_5() - { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_null_1575_34_58()) jj_scanpos = xsp; - if (jj_scan_token(SELECT)) return true; - return false; - } - - private boolean jj_3R_GeneratorFunctionDeclaration_3085_56_376() - { - if (jj_3R_FormalParameterList_3141_17_183()) return true; - return false; - } - - private boolean jj_3R_AllocationExpression_2356_17_155() - { - if (jj_scan_token(NEW)) return true; - if (jj_3R_MemberExpression_2333_17_77()) return true; - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3R_AllocationExpression_2356_47_187()) { jj_scanpos = xsp; break; } - } - return false; - } - - private boolean jj_3_33() - { - if (jj_3R_MemberExpressionPart_2362_17_67()) return true; - return false; - } - - private boolean jj_3R_MemberExpression_2337_33_154() - { - if (jj_3R_PrimaryExpression_2121_13_186()) return true; - return false; - } - - private boolean jj_3R_MemberExpression_2336_33_153() - { - if (jj_3R_ArrowFunctionExpression_3099_9_74()) return true; - return false; - } - - private boolean jj_3R_MemberExpression_2335_33_152() - { - if (jj_3R_FunctionExpression_3127_17_185()) return true; - return false; - } - - private boolean jj_3R_MemberExpression_2334_33_151() - { - if (jj_3R_GeneratorFunctionExpression_3134_17_184()) return true; - return false; - } - - private boolean jj_3R_FunctionDeclaration_3078_55_377() - { - if (jj_3R_FormalParameterList_3141_17_183()) return true; - return false; - } - - private boolean jj_3R_MemberExpression_2339_26_113() - { - if (jj_3R_AllocationExpression_2356_17_155()) return true; - return false; - } - - private boolean jj_3R_MemberExpressionForIn_2345_17_401() - { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_MemberExpressionForIn_2346_33_406()) { - jj_scanpos = xsp; - if (jj_3R_MemberExpressionForIn_2347_33_407()) { - jj_scanpos = xsp; - if (jj_3R_MemberExpressionForIn_2348_33_408()) { - jj_scanpos = xsp; - if (jj_3R_MemberExpressionForIn_2349_33_409()) return true; - } - } - } - while (true) { - xsp = jj_scanpos; - if (jj_3_33()) { jj_scanpos = xsp; break; } - } - return false; - } - - private boolean jj_3_29() - { - if (jj_3R_MemberExpressionPart_2362_17_67()) return true; - return false; - } - - private boolean jj_3_25() - { - if (jj_scan_token(COMMA)) return true; - if (jj_3R_PropertyNameAndValue_2309_17_73()) return true; - return false; - } - - private boolean jj_3R_ArrowFunctionBody_3093_29_134() - { - if (jj_3R_Statement_2709_25_172()) return true; - return false; - } - - private boolean jj_3_60() - { - if (jj_3R_ArrowFunctionBody_3093_17_89()) return true; - return false; - } - - private boolean jj_3R_MemberExpression_2333_17_112() - { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_MemberExpression_2334_33_151()) { - jj_scanpos = xsp; - if (jj_3R_MemberExpression_2335_33_152()) { - jj_scanpos = xsp; - if (jj_3R_MemberExpression_2336_33_153()) { - jj_scanpos = xsp; - if (jj_3R_MemberExpression_2337_33_154()) return true; - } - } - } - while (true) { - xsp = jj_scanpos; - if (jj_3_29()) { jj_scanpos = xsp; break; } - } - return false; - } - - private boolean jj_3R_MemberExpression_2333_17_77() - { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_MemberExpression_2333_17_112()) { - jj_scanpos = xsp; - if (jj_3R_MemberExpression_2339_26_113()) return true; - } - return false; - } - - private boolean jj_3R_ArrowFunctionExpression_3099_16_150() - { - if (jj_3R_FormalParameterList_3141_17_183()) return true; - return false; - } - - private boolean jj_3R_PropertyNameAndValueList_2303_42_352() - { - if (jj_scan_token(COMMA)) return true; - if (jj_3R_PropertyNameAndValue_2309_17_73()) return true; - return false; - } - - private boolean jj_3R_PropertyNameAndValueList_2303_42_334() - { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_PropertyNameAndValueList_2303_42_352()) { - jj_scanpos = xsp; - if (jj_scan_token(91)) return true; - } - return false; - } - - private boolean jj_3R_ArrowFunctionExpression_3100_11_107() - { - if (jj_3R_ArrowFunctionBody_3093_17_89()) return true; - return false; - } - - private boolean jj_3R_TryStatement_3054_56_341() - { - if (jj_3R_Finally_3069_17_339()) return true; - return false; - } - - private boolean jj_3R_ArrowFunctionExpression_3099_11_105() - { - if (jj_scan_token(LPAREN)) return true; - Token xsp; - xsp = jj_scanpos; - if (jj_3R_ArrowFunctionExpression_3099_16_150()) jj_scanpos = xsp; - if (jj_scan_token(RPAREN)) return true; - return false; - } - - private boolean jj_3R_ArrowFunctionBody_3093_17_89() - { - if (jj_scan_token(LBRACE)) return true; - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3R_ArrowFunctionBody_3093_29_134()) { jj_scanpos = xsp; break; } - } - if (jj_scan_token(RBRACE)) return true; - return false; - } - - private boolean jj_3R_PropertyName_2317_25_149() - { - if (jj_3R_Literal_2152_17_180()) return true; - return false; - } - - private boolean jj_3R_ArrowFunctionExpression_3099_9_74() - { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_ArrowFunctionExpression_3099_11_105()) { - jj_scanpos = xsp; - if (jj_3R_ArrowFunctionExpression_3099_46_106()) return true; - } - if (jj_scan_token(ARROW)) return true; - xsp = jj_scanpos; - if (jj_3R_ArrowFunctionExpression_3100_11_107()) { - jj_scanpos = xsp; - if (jj_3R_ArrowFunctionExpression_3100_65_108()) return true; - } - return false; - } - - private boolean jj_3R_PropertyName_2315_21_104() - { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_PropertyName_2315_21_148()) { - jj_scanpos = xsp; - if (jj_3R_PropertyName_2317_25_149()) return true; - } - return false; - } - - private boolean jj_3R_PropertyName_2315_21_148() - { - if (jj_3R_noReservedIdentifier_1380_11_143()) return true; - return false; - } - - private boolean jj_3R_GeneratorFunctionDeclaration_3085_17_362() - { - if (jj_scan_token(FUNCTION_GEN)) return true; - if (jj_3R_Identifier_2221_11_57()) return true; - if (jj_scan_token(LPAREN)) return true; - Token xsp; - xsp = jj_scanpos; - if (jj_3R_GeneratorFunctionDeclaration_3085_56_376()) jj_scanpos = xsp; - if (jj_scan_token(RPAREN)) return true; - if (jj_3R_FunctionBody_3147_17_221()) return true; - return false; - } - - private boolean jj_3R_TryStatement_3054_47_306() - { - if (jj_3R_Catch_3062_17_340()) return true; - Token xsp; - xsp = jj_scanpos; - if (jj_3R_TryStatement_3054_56_341()) jj_scanpos = xsp; - return false; - } - - private boolean jj_3R_FunctionDeclaration_3078_17_363() - { - if (jj_scan_token(FUNCTION)) return true; - if (jj_3R_Identifier_2221_11_57()) return true; - if (jj_scan_token(LPAREN)) return true; - Token xsp; - xsp = jj_scanpos; - if (jj_3R_FunctionDeclaration_3078_55_377()) jj_scanpos = xsp; - if (jj_scan_token(RPAREN)) return true; - if (jj_3R_FunctionBody_3147_17_221()) return true; - return false; - } - - private boolean jj_3R_PropertyNameAndValue_2309_17_73() - { - if (jj_3R_PropertyName_2315_21_104()) return true; - if (jj_scan_token(COLON)) return true; - if (jj_3R_AssignmentExpression_2663_17_72()) return true; - return false; - } - - private boolean jj_3R_CaseBlock_3008_84_356() - { - if (jj_3R_CaseClauses_3016_17_354()) return true; - return false; - } - - private boolean jj_3R_CaseClause_3022_68_394() - { - if (jj_3R_StatementList_2793_17_232()) return true; - return false; - } - - private boolean jj_3R_TryStatement_3054_35_305() - { - if (jj_3R_Finally_3069_17_339()) return true; - return false; - } - - private boolean jj_3R_ObjectLiteral_2295_27_279() - { - if (jj_3R_PropertyNameAndValueList_2303_17_300()) return true; - return false; - } - - private boolean jj_3R_DefaultClause_3029_58_371() - { - if (jj_3R_StatementList_2793_17_232()) return true; - return false; - } - - private boolean jj_3R_PropertyNameAndValueList_2303_17_300() - { - if (jj_3R_PropertyNameAndValue_2309_17_73()) return true; - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3R_PropertyNameAndValueList_2303_42_334()) { jj_scanpos = xsp; break; } - } - return false; - } - - private boolean jj_3R_Finally_3069_17_339() - { - if (jj_scan_token(FINALLY)) return true; - if (jj_3R_Block_2784_17_159()) return true; - return false; - } - - private boolean jj_3R_Catch_3062_17_340() - { - if (jj_scan_token(CATCH)) return true; - if (jj_scan_token(LPAREN)) return true; - if (jj_3R_Identifier_2221_11_57()) return true; - if (jj_scan_token(RPAREN)) return true; - if (jj_3R_Block_2784_17_159()) return true; - return false; - } - - private boolean jj_3R_ObjectLiteral_2294_17_251() - { - if (jj_scan_token(LBRACE)) return true; - Token xsp; - xsp = jj_scanpos; - if (jj_3R_ObjectLiteral_2295_27_279()) jj_scanpos = xsp; - if (jj_scan_token(RBRACE)) return true; - return false; - } - - private boolean jj_3R_CaseBlock_3008_66_338() - { - if (jj_3R_DefaultClause_3029_17_355()) return true; - Token xsp; - xsp = jj_scanpos; - if (jj_3R_CaseBlock_3008_84_356()) jj_scanpos = xsp; - if (jj_scan_token(RBRACE)) return true; - return false; - } - - private boolean jj_3R_ElisionFirst_2286_19_353() - { - if (jj_scan_token(COMMA)) return true; - return false; - } - - private boolean jj_3R_ElisionFirst_2286_18_335() - { - Token xsp; - if (jj_3R_ElisionFirst_2286_19_353()) return true; - while (true) { - xsp = jj_scanpos; - if (jj_3R_ElisionFirst_2286_19_353()) { jj_scanpos = xsp; break; } - } - return false; - } - - private boolean jj_3R_ElisionFirst_2285_17_301() - { - if (jj_scan_token(COMMA)) return true; - Token xsp; - xsp = jj_scanpos; - if (jj_3R_ElisionFirst_2286_18_335()) jj_scanpos = xsp; - return false; - } - - private boolean jj_3R_TryStatement_3052_17_165() - { - if (jj_scan_token(TRY)) return true; - if (jj_3R_Block_2784_17_159()) return true; - Token xsp; - xsp = jj_scanpos; - if (jj_3R_TryStatement_3054_35_305()) { - jj_scanpos = xsp; - if (jj_3R_TryStatement_3054_47_306()) return true; - } - return false; - } - - /** Generated Token Manager. */ - public LARAEcmaScriptTokenManager token_source; - JavaCharStream jj_input_stream; - /** Current token. */ - public Token token; - /** Next token. */ - public Token jj_nt; - private int jj_ntk; - private Token jj_scanpos, jj_lastpos; - private int jj_la; - private int jj_gen; - final private int[] jj_la1 = new int[187]; - static private int[] jj_la1_0; - static private int[] jj_la1_1; - static private int[] jj_la1_2; - static private int[] jj_la1_3; - static private int[] jj_la1_4; - static private int[] jj_la1_5; - static { - jj_la1_init_0(); - jj_la1_init_1(); - jj_la1_init_2(); - jj_la1_init_3(); - jj_la1_init_4(); - jj_la1_init_5(); - } - private static void jj_la1_init_0() { - jj_la1_0 = new int[] {0xce640000,0xce640000,0x0,0x180000,0x180000,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0xe00000,0xe00000,0x0,0x0,0x7b000000,0x38000000,0x0,0x0,0x0,0x0,0x0,0x0,0xce640000,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x4000000,0x0,0x0,0x0,0x8000000,0x0,0xce640000,0x0,0x30000000,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0xce640000,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0xce640000,0x0,0x0,0xce640000,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0xce640000,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x38000000,0x0,0x10000000,0x0,0x0,0x0,0x38000000,0x38000000,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x38000000,0x38000000,0x0,0x0,0x0,0x0,0x38000000,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x38000000,0x38000000,0x38000000,0x38000000,0x0,0x0,0x0,}; - } - private static void jj_la1_init_1() { - jj_la1_1 = new int[] {0x98fc0978,0x98fe0978,0x0,0xa4300000,0xa4300000,0x0,0xa4300000,0x0,0x0,0x0,0x0,0x0,0x0,0x80300000,0x80300000,0x64320000,0x0,0x0,0x0,0x200,0x100,0xfc7b80df,0xfc7b80c7,0x400,0x0,0x0,0x0,0x0,0x0,0x98fc0978,0x0,0x0,0x0,0x64320000,0x64320000,0x0,0x0,0x0,0x800000,0x0,0x18,0x0,0x0,0x6000,0x6000,0x18,0x18,0x1000,0x0,0xc7,0xc7,0x0,0xa4300000,0x0,0x98fc0978,0x0,0x0,0x0,0x0,0x78,0x78,0x41,0x0,0x0,0x0,0x0,0x0,0x98fe0978,0x0,0x0,0x80000,0x20000000,0x0,0x0,0x0,0x0,0x64320000,0x0,0x0,0x0,0x0,0x0,0x98fe0978,0x0,0x0,0x98fe0978,0x20000000,0x24300000,0x20000000,0x0,0x0,0x0,0x64320000,0xfcfe0978,0x0,0x0,0x24300000,0x20300000,0x0,0x0,0x64320000,0x40020000,0x0,0x0,0x0,0x0,0x0,0x0,0x800000,0x800000,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x64320000,0x64320000,0x64320000,0x64320000,0x0,0x0,0x0,0xfc3380c7,0xc7,0x0,0x0,0x18018000,0x480000,0xfc7b80c7,0xfc7b80c7,0x0,0x0,0x0,0x0,0x0,0x64320000,0x24300000,0x40000,0x80000,0xa0300000,0x64320000,0x64320000,0x64320000,0x64320000,0x64320000,0x1800000,0x1800000,0xa0300000,0x2000000,0x0,0x0,0x0,0x0,0x0,0xfc7b80c7,0xfc7b80c7,0x0,0x0,0x0,0x0,0xfc7b80c7,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0xfc7b80c7,0xfc7b80c7,0xfc7b80c7,0xfc7b80c7,0x0,0x0,0x0,}; - } - private static void jj_la1_init_2() { - jj_la1_2 = new int[] {0x832a,0x832a,0x2000,0xa80000,0xa80000,0x4000000,0xa80000,0x0,0x10000000,0x0,0x200000,0x4000000,0x4000000,0x0,0x0,0xa80001,0x4000000,0x0,0x0,0x0,0x0,0x4aba207,0x4aba207,0x0,0x0,0x0,0x0,0x200000,0x200000,0x832a,0x80000,0x2000000,0x8000000,0xa80001,0xa80001,0x8000000,0x8000000,0x200000,0xf0000000,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0xa80000,0x200000,0x832a,0x20000000,0x0,0x20000000,0x10000000,0x0,0x10200000,0x0,0x200000,0x200000,0x200000,0x0,0x200000,0x20832a,0x0,0x8000000,0x0,0xa80000,0x0,0x0,0x0,0x8000000,0xa80001,0x8000000,0x8000000,0x8000000,0x8000000,0x8000000,0x832a,0x8000000,0x8000000,0x832a,0xa80000,0xa80000,0xa80000,0x880000,0x2880000,0x2a00000,0xa80001,0xa8832b,0x8000000,0x8000000,0xa80000,0xa80000,0x0,0x0,0xa80001,0x1,0x0,0x0,0x0,0x0,0x0,0x0,0xf0000000,0xf0000000,0xf0000000,0xf0000000,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0xa80001,0xa80001,0xa80001,0xa80001,0x0,0x8000000,0x8000000,0x4a82001,0x0,0x0,0x4000000,0x2000,0xb8206,0x4aba207,0x4aba207,0x8000000,0x8000000,0x0,0x0,0x0,0xa80001,0xa80000,0x0,0x202,0xa80000,0xa80001,0xa80001,0xa80001,0xa80001,0xa80001,0x0,0x0,0xa80000,0x200000,0x0,0x8,0x8,0x100100,0x8,0x4aba207,0x4aba207,0x1000,0x1010,0x0,0x0,0x4aba207,0x0,0x200000,0x0,0x0,0x0,0x0,0x8000000,0x4aba207,0x4aba207,0x4aba207,0x4aba207,0x2000000,0x8000000,0x0,}; - } - private static void jj_la1_init_3() { - jj_la1_3 = new int[] {0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x80,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x60660,0x0,0x0,0x0,0x0,0x0,0x60660,0x60660,0x0,0x0,0x404000,0x404000,0x0,0x0,0x0,0x0,0x0,0x0,0x60660,0x606e0,0x0,0x0,0x0,0x1f,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x60660,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x60660,0x60660,0x0,0x0,0x0,0x0,0x600,0x600,0x60660,0x60660,0x180,0x180,0x60,0x60,0x3800,0x3800,0x0,0x0,0x0,0x0,0x1f,0x1f,0x1f,0x4000,0x4000,0x10000,0x10000,0x8000,0x8000,0x80000,0x80000,0x100000,0x100000,0x200000,0x200000,0x60660,0x60660,0x60660,0x60660,0xff000000,0x0,0x0,0x60660,0x0,0x0,0x0,0x0,0x0,0x60660,0x60660,0x0,0x0,0x800000,0x1000000,0x1000000,0x60660,0x0,0x0,0x0,0x0,0x60660,0x60660,0x60660,0x60660,0x60660,0x0,0x0,0x0,0x0,0x80,0x0,0x0,0x0,0x0,0x60660,0x60660,0x0,0x0,0x0,0x0,0x60660,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x60660,0x60660,0x60660,0x60660,0x0,0x0,0x1000000,}; - } - private static void jj_la1_init_4() { - jj_la1_4 = new int[] {0x2000008,0x2000008,0x0,0x2803910,0x2803910,0x0,0x2803910,0x2000000,0x0,0x2000000,0x0,0x0,0x0,0x0,0x0,0x2803910,0x0,0x0,0x0,0x0,0x0,0x2803910,0x2803910,0x0,0x2000000,0x0,0x0,0x2000000,0x0,0x2000008,0x0,0x0,0x0,0x2803910,0x2803910,0x0,0x0,0x2000000,0x8,0x2000000,0x0,0x2000000,0x2000000,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x2000000,0x2803910,0x0,0x2000008,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x802000,0x802000,0x802000,0x2802000,0x2802000,0x2000008,0x2000000,0x0,0x0,0x2803910,0x803910,0x802000,0x3000000,0x0,0x2803910,0x0,0x0,0x0,0x0,0x0,0x2803918,0x0,0x0,0x2803918,0x2803910,0x2803910,0x2803910,0x0,0x0,0x0,0x2803910,0x2803918,0x0,0x0,0x2803910,0x2803910,0x0,0x0,0x2803910,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x8,0x8,0x8,0x8,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x2803910,0x2803910,0x2803910,0x2803910,0x7,0x0,0x0,0x2803910,0x0,0x0,0x0,0x0,0x0,0x2803910,0x2803910,0x0,0x0,0x0,0x0,0x0,0x2803910,0x2803910,0x0,0x0,0x2803910,0x2803910,0x2803910,0x2803910,0x2803910,0x2803910,0x0,0x0,0x2803910,0x0,0x0,0x0,0x0,0x0,0x0,0x2803910,0x2803910,0x0,0x0,0x2000000,0x2000000,0x2803910,0x2000000,0x2000000,0x2000000,0x2000000,0x2000000,0x2000000,0x0,0x2803910,0x2803910,0x2803910,0x2803910,0x0,0x0,0x0,}; - } - private static void jj_la1_init_5() { - jj_la1_5 = new int[] {0x0,0x0,0x0,0x200,0x200,0x0,0x200,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x200,0x0,0x0,0x0,0x0,0x0,0x200,0x200,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x200,0x200,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x200,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x200,0x200,0x0,0x0,0x0,0x200,0x0,0x0,0x0,0x0,0x0,0x200,0x0,0x0,0x200,0x200,0x200,0x200,0x0,0x0,0x0,0x200,0x200,0x0,0x0,0x200,0x200,0x0,0x0,0x200,0x0,0x100,0x100,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x200,0x200,0x200,0x200,0x80,0x0,0x0,0x200,0x0,0x0,0x0,0x0,0x0,0x200,0x200,0x0,0x0,0x0,0x0,0x0,0x200,0x200,0x0,0x0,0x200,0x200,0x200,0x200,0x200,0x200,0x0,0x0,0x200,0x0,0x0,0x0,0x0,0x0,0x0,0x200,0x200,0x0,0x0,0x0,0x0,0x200,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x200,0x200,0x200,0x200,0x0,0x0,0x0,}; - } - final private JJCalls[] jj_2_rtns = new JJCalls[64]; - private boolean jj_rescan = false; - private int jj_gc = 0; - - /** Constructor with InputStream. */ - public LARAEcmaScript(java.io.InputStream stream) { - this(stream, null); - } - /** Constructor with InputStream and supplied encoding */ - public LARAEcmaScript(java.io.InputStream stream, String encoding) { - try { jj_input_stream = new JavaCharStream(stream, encoding, 1, 1); } catch(java.io.UnsupportedEncodingException e) { throw new RuntimeException(e); } - token_source = new LARAEcmaScriptTokenManager(jj_input_stream); - token = new Token(); - jj_ntk = -1; - jj_gen = 0; - for (int i = 0; i < 187; i++) jj_la1[i] = -1; - for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls(); - } - - /** Reinitialise. */ - public void ReInit(java.io.InputStream stream) { - ReInit(stream, null); - } - /** Reinitialise. */ - public void ReInit(java.io.InputStream stream, String encoding) { - try { jj_input_stream.ReInit(stream, encoding, 1, 1); } catch(java.io.UnsupportedEncodingException e) { throw new RuntimeException(e); } - token_source.ReInit(jj_input_stream); - token = new Token(); - jj_ntk = -1; - jjtree.reset(); - jj_gen = 0; - for (int i = 0; i < 187; i++) jj_la1[i] = -1; - for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls(); - } - - /** Constructor. */ - public LARAEcmaScript(java.io.Reader stream) { - jj_input_stream = new JavaCharStream(stream, 1, 1); - token_source = new LARAEcmaScriptTokenManager(jj_input_stream); - token = new Token(); - jj_ntk = -1; - jj_gen = 0; - for (int i = 0; i < 187; i++) jj_la1[i] = -1; - for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls(); - } - - /** Reinitialise. */ - public void ReInit(java.io.Reader stream) { - if (jj_input_stream == null) { - jj_input_stream = new JavaCharStream(stream, 1, 1); - } else { - jj_input_stream.ReInit(stream, 1, 1); - } - if (token_source == null) { - token_source = new LARAEcmaScriptTokenManager(jj_input_stream); - } - - token_source.ReInit(jj_input_stream); - token = new Token(); - jj_ntk = -1; - jjtree.reset(); - jj_gen = 0; - for (int i = 0; i < 187; i++) jj_la1[i] = -1; - for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls(); - } - - /** Constructor with generated Token Manager. */ - public LARAEcmaScript(LARAEcmaScriptTokenManager tm) { - token_source = tm; - token = new Token(); - jj_ntk = -1; - jj_gen = 0; - for (int i = 0; i < 187; i++) jj_la1[i] = -1; - for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls(); - } - - /** Reinitialise. */ - public void ReInit(LARAEcmaScriptTokenManager tm) { - token_source = tm; - token = new Token(); - jj_ntk = -1; - jjtree.reset(); - jj_gen = 0; - for (int i = 0; i < 187; i++) jj_la1[i] = -1; - for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls(); - } - - private Token jj_consume_token(int kind) throws ParseException { - Token oldToken; - if ((oldToken = token).next != null) token = token.next; - else token = token.next = token_source.getNextToken(); - jj_ntk = -1; - if (token.kind == kind) { - jj_gen++; - if (++jj_gc > 100) { - jj_gc = 0; - for (int i = 0; i < jj_2_rtns.length; i++) { - JJCalls c = jj_2_rtns[i]; - while (c != null) { - if (c.gen < jj_gen) c.first = null; - c = c.next; - } - } - } - return token; - } - token = oldToken; - jj_kind = kind; - throw generateParseException(); - } - - @SuppressWarnings("serial") - static private final class LookaheadSuccess extends java.lang.Error { - @Override - public Throwable fillInStackTrace() { - return this; - } - } - static private final LookaheadSuccess jj_ls = new LookaheadSuccess(); - private boolean jj_scan_token(int kind) { - if (jj_scanpos == jj_lastpos) { - jj_la--; - if (jj_scanpos.next == null) { - jj_lastpos = jj_scanpos = jj_scanpos.next = token_source.getNextToken(); - } else { - jj_lastpos = jj_scanpos = jj_scanpos.next; - } - } else { - jj_scanpos = jj_scanpos.next; - } - if (jj_rescan) { - int i = 0; Token tok = token; - while (tok != null && tok != jj_scanpos) { i++; tok = tok.next; } - if (tok != null) jj_add_error_token(kind, i); - } - if (jj_scanpos.kind != kind) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) throw jj_ls; - return false; - } - - -/** Get the next Token. */ - final public Token getNextToken() { - if (token.next != null) token = token.next; - else token = token.next = token_source.getNextToken(); - jj_ntk = -1; - jj_gen++; - return token; - } - -/** Get the specific Token. */ - final public Token getToken(int index) { - Token t = token; - for (int i = 0; i < index; i++) { - if (t.next != null) t = t.next; - else t = t.next = token_source.getNextToken(); - } - return t; - } - - private int jj_ntk_f() { - if ((jj_nt=token.next) == null) - return (jj_ntk = (token.next=token_source.getNextToken()).kind); - else - return (jj_ntk = jj_nt.kind); - } - - private java.util.List jj_expentries = new java.util.ArrayList(); - private int[] jj_expentry; - private int jj_kind = -1; - private int[] jj_lasttokens = new int[100]; - private int jj_endpos; - - private void jj_add_error_token(int kind, int pos) { - if (pos >= 100) { - return; - } - - if (pos == jj_endpos + 1) { - jj_lasttokens[jj_endpos++] = kind; - } else if (jj_endpos != 0) { - jj_expentry = new int[jj_endpos]; - - for (int i = 0; i < jj_endpos; i++) { - jj_expentry[i] = jj_lasttokens[i]; - } - - for (int[] oldentry : jj_expentries) { - if (oldentry.length == jj_expentry.length) { - boolean isMatched = true; - - for (int i = 0; i < jj_expentry.length; i++) { - if (oldentry[i] != jj_expentry[i]) { - isMatched = false; - break; - } - - } - if (isMatched) { - jj_expentries.add(jj_expentry); - break; - } - } - } - - if (pos != 0) { - jj_lasttokens[(jj_endpos = pos) - 1] = kind; - } - } - } - - /** Generate ParseException. */ - public ParseException generateParseException() { - jj_expentries.clear(); - boolean[] la1tokens = new boolean[171]; - if (jj_kind >= 0) { - la1tokens[jj_kind] = true; - jj_kind = -1; - } - for (int i = 0; i < 187; i++) { - if (jj_la1[i] == jj_gen) { - for (int j = 0; j < 32; j++) { - if ((jj_la1_0[i] & (1< jj_gen) { - jj_la = p.arg; jj_lastpos = jj_scanpos = p.first; - switch (i) { - case 0: jj_3_1(); break; - case 1: jj_3_2(); break; - case 2: jj_3_3(); break; - case 3: jj_3_4(); break; - case 4: jj_3_5(); break; - case 5: jj_3_6(); break; - case 6: jj_3_7(); break; - case 7: jj_3_8(); break; - case 8: jj_3_9(); break; - case 9: jj_3_10(); break; - case 10: jj_3_11(); break; - case 11: jj_3_12(); break; - case 12: jj_3_13(); break; - case 13: jj_3_14(); break; - case 14: jj_3_15(); break; - case 15: jj_3_16(); break; - case 16: jj_3_17(); break; - case 17: jj_3_18(); break; - case 18: jj_3_19(); break; - case 19: jj_3_20(); break; - case 20: jj_3_21(); break; - case 21: jj_3_22(); break; - case 22: jj_3_23(); break; - case 23: jj_3_24(); break; - case 24: jj_3_25(); break; - case 25: jj_3_26(); break; - case 26: jj_3_27(); break; - case 27: jj_3_28(); break; - case 28: jj_3_29(); break; - case 29: jj_3_30(); break; - case 30: jj_3_31(); break; - case 31: jj_3_32(); break; - case 32: jj_3_33(); break; - case 33: jj_3_34(); break; - case 34: jj_3_35(); break; - case 35: jj_3_36(); break; - case 36: jj_3_37(); break; - case 37: jj_3_38(); break; - case 38: jj_3_39(); break; - case 39: jj_3_40(); break; - case 40: jj_3_41(); break; - case 41: jj_3_42(); break; - case 42: jj_3_43(); break; - case 43: jj_3_44(); break; - case 44: jj_3_45(); break; - case 45: jj_3_46(); break; - case 46: jj_3_47(); break; - case 47: jj_3_48(); break; - case 48: jj_3_49(); break; - case 49: jj_3_50(); break; - case 50: jj_3_51(); break; - case 51: jj_3_52(); break; - case 52: jj_3_53(); break; - case 53: jj_3_54(); break; - case 54: jj_3_55(); break; - case 55: jj_3_56(); break; - case 56: jj_3_57(); break; - case 57: jj_3_58(); break; - case 58: jj_3_59(); break; - case 59: jj_3_60(); break; - case 60: jj_3_61(); break; - case 61: jj_3_62(); break; - case 62: jj_3_63(); break; - case 63: jj_3_64(); break; - } - } - p = p.next; - } while (p != null); - - } catch(LookaheadSuccess ls) { } - } - jj_rescan = false; - } - - private void jj_save(int index, int xla) { - JJCalls p = jj_2_rtns[index]; - while (p.gen > jj_gen) { - if (p.next == null) { p = p.next = new JJCalls(); break; } - p = p.next; - } - - p.gen = jj_gen + xla - jj_la; - p.first = token; - p.arg = xla; - } - - static final class JJCalls { - int gen; - Token first; - int arg; - JJCalls next; - } - -} diff --git a/LARAC/src/org/dojo/jsl/parser/ast/LARAEcmaScript.jj b/LARAC/src/org/dojo/jsl/parser/ast/LARAEcmaScript.jj deleted file mode 100644 index 83c663018..000000000 --- a/LARAC/src/org/dojo/jsl/parser/ast/LARAEcmaScript.jj +++ /dev/null @@ -1,8109 +0,0 @@ -/*@bgen(jjtree) Generated By:JJTree: Do not edit this line. LARAEcmaScript.jj */ -/*@egen*//* - * Copyright 2013 SPeCS. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. under the License. - */ - - -options { - - /* - * Default value is true. If true, all methods and class variables - * are specified as static in the generated parser and token manager. This allows only - * one parser object to be present, but it improves the performance of the parser. - */ - STATIC = false; - - /* - * Options for obtaining debugging information - */ - DEBUG_PARSER = false; - - DEBUG_TOKEN_MANAGER = false; - - /* - * Default value is false. When set to true, the generated parser - * uses an input stream object that processes Java Unicode escapes before - * sending characters to the token manager. - */ - JAVA_UNICODE_ESCAPE = true; - - /* - * Default value is false. When set to true, the generated parser - * uses uses an input stream object that reads Unicode files. By default, ASCII files - * are assumed. - */ - UNICODE_INPUT = true; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - //sets first and last token of the node - /* - * JDK Version - */ - JDK_VERSION = "1.5"; - - /* - * Ignore case for keywords - */ - //IGNORE_CASE = true; -} - -PARSER_BEGIN(LARAEcmaScript) - -package org.dojo.jsl.parser.ast; - -import java.io.*; -import java.util.*; -import java.io.File; -import java.io.FileReader; -import java.io.BufferedReader; -import java.io.ByteArrayInputStream; -import larac.utils.output.ErrorMsg; -import larac.objects.Enums.Types; -import larac.exceptions.ParseExceptionData; -import larac.exceptions.StopParseException; - -public class LARAEcmaScript extends LARAParserBase/*@bgen(jjtree)*/implements LARAEcmaScriptTreeConstants/*@egen*/{/*@bgen(jjtree)*/ - protected JJTLARAEcmaScriptState jjtree = new JJTLARAEcmaScriptState(); - -/*@egen*/ - private static final int MAX_EXCEPTION_TOKEN_SIZE = 6; - private static final int MAXIMUM_SYNTAX_EXCEPTIONS = 5; - - public File inputAspectFile = null; - public FileReader inputAspectFr = null; - public BufferedReader inputAspectBr = null; - public List exceptions = new ArrayList() ; - private int exprBraceCount = 0; - - public ASTExpressionStatement parseExpression(String expression) throws ParseException{ - return ParseExpression(); - } - - public ASTStart parse() throws ParseException{ - this.exceptions = new ArrayList(); - - return this.Start(); - } - - /* Old Code */ - @Deprecated - public static ASTStart parseFile(String fileName){ - return parseFile(new File(fileName)); - } - @Deprecated - public static ASTStart parseFile(File laraFile){ - ASTStart start = null; - File inputAspectFile = laraFile; - FileReader inputAspectFr = null; - BufferedReader inputAspectBr = null; - try{ - inputAspectFr = new FileReader(inputAspectFile); - inputAspectBr = new BufferedReader(inputAspectFr); - LARAEcmaScript aspectParser = new LARAEcmaScript(inputAspectBr); - start = aspectParser.Start(); - } - catch (Exception e) - { - try { - if(inputAspectFr != null) - inputAspectFr.close(); - if(inputAspectBr != null) - inputAspectBr.close(); - } catch (IOException e1) { - throw new RuntimeException(e1); - } - } - - try { - if(inputAspectFr != null) - inputAspectFr.close(); - if(inputAspectBr != null) - inputAspectBr.close(); - - } catch (IOException e1) { - throw new RuntimeException(e1); - } - return start; - } - -} -PARSER_END(LARAEcmaScript) - -TOKEN_MGR_DECLS : { - public int htmlTokenNestingLevel = 0; - public boolean expectActionScript = false; -} - - -/***************************************** - * LEXICAL & REGEXP GRAMMARS STARTS HERE * - *****************************************/ - - -/* Section 7 : Lexical Conventions */ - -/* Section 7.2 : White Space */ - - -SKIP: //SPECIAL_TOKEN : -{ - | | | | > -| - < #TAB: " " | "\t" > /* TAB */ -| - < #VT: "\u000b" > /* Vertical Tab */ -| - < #FF: " " | "\f"> /* Form Feed */ -| - < #SP: " " | " " > /* Space */ -| - < #NBSP: "\u00a0" > /* No-break space */ -| - < #USP: /* Other Unicode space seperator */ - ["\u2000"] - | ["\u2001"] - | ["\u2002"] - | ["\u2003"] - | ["\u2004"] - | ["\u2005"] - | ["\u2006"] - | ["\u2007"] - | ["\u2008"] - | ["\u2009"] - | ["\u200a"] - | ["\u200b"] - | ["\u3000"] - > -} - -/* Section 7.3 : Line Terminators */ - - -SKIP: //SPECIAL_TOKEN : -{ - | | | > -| - < #LF: "\n" > /* Line Feed */ -| - < #CR: "\r" > /* Carriage Return */ -| - < #LS: "\u2028" > /* Line separator */ -| - < #PS: "\u2029" > /* Paragraph separator */ -} - - -/* Comments */ - - -MORE : -{ - "//" : IN_SINGLE_LINE_COMMENT -| - "/*" : IN_MULTI_LINE_COMMENT -//| -// "/**" : IN_MULTI_LINE_DOC -} - - -SPECIAL_TOKEN : -{ - : DEFAULT -} - - -SPECIAL_TOKEN : -{ - : DEFAULT -} - -// -//SPECIAL_TOKEN : -//{ -// : DEFAULT -//} - - -MORE : -{ - < ~[] > -} - - - -/* Section 7.5.1: Reserved Words */ - - -TOKEN : -{ - /************************** LARA TOKENS *************************************/ - : DEFAULT -| - : DEFAULT -| - : DEFAULT -| - : DEFAULT -| - : DEFAULT -| - < STATICDECL: "static" > : DEFAULT -| - : DEFAULT -| - : DEFAULT -| - : DEFAULT -| - : DEFAULT -| - : DEFAULT -| - : DEFAULT -| - : DEFAULT -| - : DEFAULT -| - : DEFAULT -| - : DEFAULT -| - : DEFAULT -| - : DEFAULT -| - : DEFAULT -| - : DEFAULT -| - : DEFAULT -| - : DEFAULT -| - : DEFAULT -| - : DEFAULT -| - : DEFAULT -| - : DEFAULT -| - /*******Tokens required for the dynamic apply ******/ - : DEFAULT -| - : DEFAULT -| - : DEFAULT -| - /************************** LARA TOKENS *************************************/ - < BREAK: "break" > : DEFAULT -| - < CONTINUE: "continue" > : DEFAULT -| - < DELETE: "delete" > : DEFAULT -| - < ELSE: "else" > : DEFAULT -| - < FOR: "for" > : DEFAULT -| - < FUNCTION: "function" > : DEFAULT -| - < FUNCTION_GEN: "function*" > : DEFAULT -| - < IF: "if" > : DEFAULT -| - < IN: "in" > : DEFAULT -| - < OF: "of" > : DEFAULT -| - < EACH: "each" > : DEFAULT -| - < NEW: "new" > : DEFAULT -| - < RETURN: "return" > : DEFAULT -| - < YIELD: "yield" > : DEFAULT -| - < THIS: "this" > : IN_REGEX -| - < TYPEOF: "typeof" > : DEFAULT -| - < VAR: "var" > : DEFAULT -| - < VOID: "void" > : DEFAULT -| - < WHILE: "while" > : DEFAULT -| - < WITH: "with" > : DEFAULT -| - < CASE: "case" > : DEFAULT -| - < CATCH: "catch" > : DEFAULT -| - < CLASS: "class" > : DEFAULT -| - < CONST: "const" > : DEFAULT -| - < DEBUGGER: "debugger" > : DEFAULT -| - < _DEFAULT: "default" > : DEFAULT -| - < DO: "do" > : DEFAULT -| - < ENUM: "enum" > : DEFAULT -| - < EXTENDS: "extends" > : DEFAULT -| - < FINALLY: "finally" > : DEFAULT -| - < IMPORT: "import" > : DEFAULT -| - < SUPER: "super" > : DEFAULT -| - < SWITCH: "switch" > : DEFAULT -| - < THROW: "throw" > : DEFAULT -| - < TRY: "try" > : DEFAULT -| - < ARROW: "=>" > : DEFAULT -//| -// < UTF8_BOM: "\u00ef\u00bb\u00bf" > : DEFAULT -} - - - -/* JScript .NET Tokens - -TOKEN : -{ - < BYTE: "byte" > - | < SBYTE: "sbyte" > - | < SHORT: "short" > - | < USHORT: "ushort" > - | < UINT: "uint" > - | < LONG: "long" > - | < ULONG: "ulong" > - | < FLOAT: "float" > - | < NUMBER: "Number" > - | < DOUBLE: "double" > - | < DECIMAL: "decimal" > - | < BOOLEAN: "boolean" > - | < STRING: "String" > - | < CHAR: "char" > -} - -*/ - - -/* Section 7.7: Punctuators */ - - -TOKEN : -{ - < LBRACE: "{" > : DEFAULT -| - < RBRACE: "}" > : IN_REGEX -| - < LPAREN: "(" > : DEFAULT -| - < RPAREN: ")" > : IN_REGEX -| - < LBRACKET: "[" > : DEFAULT -| - < RBRACKET: "]" > : IN_REGEX -| - < DOT: "." > : DEFAULT -| - < SEMICOLON: ";" > : DEFAULT -| - < COMMA: "," > : DEFAULT -| - < LT: "<" > : DEFAULT -| - < GT: ">" > : DEFAULT -| - < LE: "<=" > : DEFAULT -| - < GE: ">=" > : DEFAULT -| - < EQ: "==" > : DEFAULT -| - < NE: "!=" > : DEFAULT -| - : DEFAULT /* LARA operator */ -| - < SEQ: "===" > : DEFAULT /* Strict Equals Operator */ -| - < SNEQ: "!==" > : DEFAULT /* Strict Does-not-equal Operator */ -| - < PLUS: "+" > : DEFAULT -| - < MINUS: "-" > : DEFAULT -| - < STAR: "*" > : DEFAULT -| - < REM: "%" > : DEFAULT -| - < INCR: "++" > : IN_REGEX -| - < DECR: "--" > : IN_REGEX -| - < LSHIFT: "<<" > : DEFAULT -| - < RSHIFT: ">>" > : DEFAULT -| - < RUNSHIFT: ">>>" > : DEFAULT /* Unsigned Right Shift Operator */ -| - < BIT_AND: "&" > : DEFAULT -| - < BIT_OR: "|" > : DEFAULT -| - < XOR: "^" > : DEFAULT -| - < BANG: "!" > : DEFAULT -| - < TILDE: "~" > : IN_REGEX -| - < SC_AND: "&&" > : DEFAULT -| - < SC_OR: "||" > : DEFAULT -| - < HOOK: "?" > : DEFAULT -| - < NATURAL_JOIN: "::" > : DEFAULT /* LARA Operator*/ -| - < COLON: ":" > : DEFAULT -| - < ASSIGN: "=" > : DEFAULT -| - < PLUSASSIGN: "+=" > : DEFAULT -| - < MINUSASSIGN: "-=" > : DEFAULT -| - < STARASSIGN: "*=" > : DEFAULT -| - < REMASSIGN: "%=" > : DEFAULT -| - < LSHIFTASSIGN: "<<=" > : DEFAULT -| - < RSIGNEDSHIFTASSIGN: ">>=" > : DEFAULT -| - < RUNSIGNEDSHIFTASSIGN: ">>>=" > : DEFAULT -| - < ANDASSIGN: "&=" > : DEFAULT -| - < ORASSIGN: "|=" > : DEFAULT -| - < XORASSIGN: "^=" > : DEFAULT -| - < INTANCE_OF: "instanceof" > : DEFAULT -} - - -/* Section 7.8.3: Numeric Literals */ - - -TOKEN: -{ - < DECIMAL_LITERAL : - "." ()? ()? - | - "." ()? - | - ()? - > : IN_REGEX -| - < #NON_ZERO_DIGIT: ["1"-"9"] > -| - < #EXPONENT_PART: ("e" | "E") (["+","-"])? > -} - - -TOKEN: -{ - < DECIMAL_INTEGER_LITERAL: - "0" | ()? - > : IN_REGEX -} - - -TOKEN: -{ - < HEX_INTEGER_LITERAL: "0" ["x","X"] ()+ > : IN_REGEX -} - - -TOKEN: -{ < DECIMAL_DIGITS: ()+ > : IN_REGEX } - -TOKEN: -{ - < DECIMAL_DIGIT: ["0"-"9"] > -} - -/* Section 7.8.1: NULL Literals */ - - -TOKEN: -{ - < NULL_LITERAL: "null" > : IN_REGEX -} - -/* Section 7.8.2: Boolean Literals */ - - -TOKEN: -{ - < BOOLEAN_LITERAL: "true" | "false" > : IN_REGEX -} - - - -/* Section 7.8.4: String Literals */ - - -TOKEN: -{ - < STRING_LITERAL: - "\"" ()? "\"" | "'" ()? "'" - > : IN_REGEX -| - < #DOUBLE_STRING_CHARACTERS: ()* > -| - < #SINGLE_STRING_CHARACTERS: ()* > -| - < #DOUBLE_STRING_CHARACTER: - (~["\"","\\","\n","\r","\u2028","\u2029"])* - | "\\" - > -| - < #SINGLE_STRING_CHARACTER: - (~["'","\\","\n","\r","\u2028","\u2029"]) - | "\\" - > -| - < #ESCAPE_SEQUENCE: - - | - "0" - | - - | - - > -| - < #CHARACTER_ESCAPE_SEQUENCE: - | - > -| - < #SINGLE_ESCAPE_CHARACTER: ["'" , "\"" , "\\" , "b" , "f" , "n" , "r" , "t" , "v"] > -| - < #NON_ESCAPE_CHARACTER: - ~["\n","\r","\u2028","\u2029"] - | - ~["'" , "\"" , "\\" , "b" , "f" , "n" , "r" , "t" , "v", "x", "u"] - | - ~["0"-"9"] - > -} - -TOKEN: -{ - < HEX_ESCAPE_SEQUENCE: "x" > -} - -< DEFAULT, IN_REGEX > -TOKEN: -{ - : DEFAULT - -} - -/* -TOKEN: -{ - < ESCAPE_CHARACTER: - ["'" , "\"" , "\\" , "b" , "f" , "n" , "r" , "t" , "v"] - | ["0"-"9"] - | "x" - | "u" - > -} -*/ - -/* Section 7.6: Identifiers */ - - -TOKEN: -{ - < LABEL_IDENTIFIER: - "#" ()* - > : IN_REGEX -| - < IDENTIFIER_NAME: - ( ( | "*" | "#" | "^") ) - | - (( | < AT_SIGN >)? ()*) - > : IN_REGEX -| - < #IDENTIFIER_START: - - | - - | - - > -| - < #IDENTIFIER_PART: - - | - - | - - | - - | - - | - - > -| - < #DOLLAR_SIGN: "$" > -| - < #AT_SIGN: "@" > -| - < #UNDER_SCORE: "_" > -| - < #UNICODE_LETTER: - ["A"-"Z"] - | ["a"-"z"] - | ["A"-"Z"] - | ["a"-"z"] - | ["\u00aa"] - | ["\u00b5"] - | ["\u00ba"] - | ["\u00c0"-"\u00d6"] - | ["\u00d8"-"\u00f6"] - | ["\u00f8"-"\u021f"] - | ["\u0222"-"\u0233"] - | ["\u0250"-"\u02ad"] - | ["\u02b0"-"\u02b8"] - | ["\u02bb"-"\u02c1"] - | ["\u02d0"-"\u02d1"] - | ["\u02e0"-"\u02e4"] - | ["\u02ee"] - | ["\u037a"] - | ["\u0386"] - | ["\u0388"-"\u038a"] - | ["\u038c"] - | ["\u038e"-"\u03a1"] - | ["\u03a3"-"\u03ce"] - | ["\u03d0"-"\u03d7"] - | ["\u03da"-"\u03f3"] - | ["\u0400"-"\u0481"] - | ["\u048c"-"\u04c4"] - | ["\u04c7"-"\u04c8"] - | ["\u04cb"-"\u04cc"] - | ["\u04d0"-"\u04f5"] - | ["\u04f8"-"\u04f9"] - | ["\u0531"-"\u0556"] - | ["\u0559"] - | ["\u0561"-"\u0587"] - | ["\u05d0"-"\u05ea"] - | ["\u05f0"-"\u05f2"] - | ["\u0621"-"\u063a"] - | ["\u0640"-"\u064a"] - | ["\u0671"-"\u06d3"] - | ["\u06d5"] - | ["\u06e5"-"\u06e6"] - | ["\u06fa"-"\u06fc"] - | ["\u0710"] - | ["\u0712"-"\u072c"] - | ["\u0780"-"\u07a5"] - | ["\u0905"-"\u0939"] - | ["\u093d"] - | ["\u0950"] - | ["\u0958"-"\u0961"] - | ["\u0985"-"\u098c"] - | ["\u098f"-"\u0990"] - | ["\u0993"-"\u09a8"] - | ["\u09aa"-"\u09b0"] - | ["\u09b2"] - | ["\u09b6"-"\u09b9"] - | ["\u09dc"-"\u09dd"] - | ["\u09df"-"\u09e1"] - | ["\u09f0"-"\u09f1"] - | ["\u0a05"-"\u0a0a"] - | ["\u0a0f"-"\u0a10"] - | ["\u0a13"-"\u0a28"] - | ["\u0a2a"-"\u0a30"] - | ["\u0a32"-"\u0a33"] - | ["\u0a35"-"\u0a36"] - | ["\u0a38"-"\u0a39"] - | ["\u0a59"-"\u0a5c"] - | ["\u0a5e"] - | ["\u0a72"-"\u0a74"] - | ["\u0a85"-"\u0a8b"] - | ["\u0a8d"] - | ["\u0a8f"-"\u0a91"] - | ["\u0a93"-"\u0aa8"] - | ["\u0aaa"-"\u0ab0"] - | ["\u0ab2"-"\u0ab3"] - | ["\u0ab5"-"\u0ab9"] - | ["\u0abd"] - | ["\u0ad0"] - | ["\u0ae0"] - | ["\u0b05"-"\u0b0c"] - | ["\u0b0f"-"\u0b10"] - | ["\u0b13"-"\u0b28"] - | ["\u0b2a"-"\u0b30"] - | ["\u0b32"-"\u0b33"] - | ["\u0b36"-"\u0b39"] - | ["\u0b3d"] - | ["\u0b5c"-"\u0b5d"] - | ["\u0b5f"-"\u0b61"] - | ["\u0b85"-"\u0b8a"] - | ["\u0b8e"-"\u0b90"] - | ["\u0b92"-"\u0b95"] - | ["\u0b99"-"\u0b9a"] - | ["\u0b9c"] - | ["\u0b9e"-"\u0b9f"] - | ["\u0ba3"-"\u0ba4"] - | ["\u0ba8"-"\u0baa"] - | ["\u0bae"-"\u0bb5"] - | ["\u0bb7"-"\u0bb9"] - | ["\u0c05"-"\u0c0c"] - | ["\u0c0e"-"\u0c10"] - | ["\u0c12"-"\u0c28"] - | ["\u0c2a"-"\u0c33"] - | ["\u0c35"-"\u0c39"] - | ["\u0c60"-"\u0c61"] - | ["\u0c85"-"\u0c8c"] - | ["\u0c8e"-"\u0c90"] - | ["\u0c92"-"\u0ca8"] - | ["\u0caa"-"\u0cb3"] - | ["\u0cb5"-"\u0cb9"] - | ["\u0cde"] - | ["\u0ce0"-"\u0ce1"] - | ["\u0d05"-"\u0d0c"] - | ["\u0d0e"-"\u0d10"] - | ["\u0d12"-"\u0d28"] - | ["\u0d2a"-"\u0d39"] - | ["\u0d60"-"\u0d61"] - | ["\u0d85"-"\u0d96"] - | ["\u0d9a"-"\u0db1"] - | ["\u0db3"-"\u0dbb"] - | ["\u0dbd"] - | ["\u0dc0"-"\u0dc6"] - | ["\u0e01"-"\u0e30"] - | ["\u0e32"-"\u0e33"] - | ["\u0e40"-"\u0e46"] - | ["\u0e81"-"\u0e82"] - | ["\u0e84"] - | ["\u0e87"-"\u0e88"] - | ["\u0e8a"] - | ["\u0e8d"] - | ["\u0e94"-"\u0e97"] - | ["\u0e99"-"\u0e9f"] - | ["\u0ea1"-"\u0ea3"] - | ["\u0ea5"] - | ["\u0ea7"] - | ["\u0eaa"-"\u0eab"] - | ["\u0ead"-"\u0eb0"] - | ["\u0eb2"-"\u0eb3"] - | ["\u0ebd"-"\u0ec4"] - | ["\u0ec6"] - | ["\u0edc"-"\u0edd"] - | ["\u0f00"] - | ["\u0f40"-"\u0f6a"] - | ["\u0f88"-"\u0f8b"] - | ["\u1000"-"\u1021"] - | ["\u1023"-"\u1027"] - | ["\u1029"-"\u102a"] - | ["\u1050"-"\u1055"] - | ["\u10a0"-"\u10c5"] - | ["\u10d0"-"\u10f6"] - | ["\u1100"-"\u1159"] - | ["\u115f"-"\u11a2"] - | ["\u11a8"-"\u11f9"] - | ["\u1200"-"\u1206"] - | ["\u1208"-"\u1246"] - | ["\u1248"] - | ["\u124a"-"\u124d"] - | ["\u1250"-"\u1256"] - | ["\u1258"] - | ["\u125a"-"\u125d"] - | ["\u1260"-"\u1286"] - | ["\u1288"] - | ["\u128a"-"\u128d"] - | ["\u1290"-"\u12ae"] - | ["\u12b0"] - | ["\u12b2"-"\u12b5"] - | ["\u12b8"-"\u12be"] - | ["\u12c0"] - | ["\u12c2"-"\u12c5"] - | ["\u12c8"-"\u12ce"] - | ["\u12d0"-"\u12d6"] - | ["\u12d8"-"\u12ee"] - | ["\u12f0"-"\u130e"] - | ["\u1310"] - | ["\u1312"-"\u1315"] - | ["\u1318"-"\u131e"] - | ["\u1320"-"\u1346"] - | ["\u1348"-"\u135a"] - | ["\u13a0"-"\u13b0"] - | ["\u13b1"-"\u13f4"] - | ["\u1401"-"\u1676"] - | ["\u1681"-"\u169a"] - | ["\u16a0"-"\u16ea"] - | ["\u1780"-"\u17b3"] - | ["\u1820"-"\u1877"] - | ["\u1880"-"\u18a8"] - | ["\u1e00"-"\u1e9b"] - | ["\u1ea0"-"\u1ee0"] - | ["\u1ee1"-"\u1ef9"] - | ["\u1f00"-"\u1f15"] - | ["\u1f18"-"\u1f1d"] - | ["\u1f20"-"\u1f39"] - | ["\u1f3a"-"\u1f45"] - | ["\u1f48"-"\u1f4d"] - | ["\u1f50"-"\u1f57"] - | ["\u1f59"] - | ["\u1f5b"] - | ["\u1f5d"] - | ["\u1f5f"-"\u1f7d"] - | ["\u1f80"-"\u1fb4"] - | ["\u1fb6"-"\u1fbc"] - | ["\u1fbe"] - | ["\u1fc2"-"\u1fc4"] - | ["\u1fc6"-"\u1fcc"] - | ["\u1fd0"-"\u1fd3"] - | ["\u1fd6"-"\u1fdb"] - | ["\u1fe0"-"\u1fec"] - | ["\u1ff2"-"\u1ff4"] - | ["\u1ff6"-"\u1ffc"] - | ["\u207f"] - | ["\u2102"] - | ["\u2107"] - | ["\u210a"-"\u2113"] - | ["\u2115"] - | ["\u2119"-"\u211d"] - | ["\u2124"] - | ["\u2126"] - | ["\u2128"] - | ["\u212a"-"\u212d"] - | ["\u212f"-"\u2131"] - | ["\u2133"-"\u2139"] - | ["\u2160"-"\u2183"] - | ["\u3005"-"\u3007"] - | ["\u3021"-"\u3029"] - | ["\u3031"-"\u3035"] - | ["\u3038"-"\u303a"] - | ["\u3041"-"\u3094"] - | ["\u309d"-"\u309e"] - | ["\u30a1"-"\u30fa"] - | ["\u30fc"-"\u30fe"] - | ["\u3105"-"\u312c"] - | ["\u3131"-"\u318e"] - | ["\u31a0"-"\u31b7"] - | ["\u3400"] - | ["\u4db5"] - | ["\u4e00"] - | ["\u9fa5"] - | ["\ua000"-"\ua48c"] - | ["\uac00"] - | ["\ud7a3"] - | ["\uf900"-"\ufa2d"] - | ["\ufb00"-"\ufb06"] - | ["\ufb13"-"\ufb17"] - | ["\ufb1d"] - | ["\ufb1f"-"\ufb28"] - | ["\ufb2a"-"\ufb36"] - | ["\ufb38"-"\ufb3c"] - | ["\ufb3e"] - | ["\ufb40"-"\ufb41"] - | ["\ufb43"-"\ufb44"] - | ["\ufb46"-"\ufbb1"] - | ["\ufbd3"-"\ufd3d"] - | ["\ufd50"-"\ufd8f"] - | ["\ufd92"-"\ufdc7"] - | ["\ufdf0"-"\ufdfb"] - | ["\ufe70"-"\ufe72"] - | ["\ufe74"] - | ["\ufe76"-"\ufefc"] - | ["\uff21"-"\uff3a"] - | ["\uff41"-"\uff5a"] - | ["\uff66"-"\uffbe"] - | ["\uffc2"-"\uffc7"] - | ["\uffca"-"\uffcf"] - | ["\uffd2"-"\uffd7"] - | ["\uffda"-"\uffdc"] - > -} - -/* - * Unicode categories Non-spacing mark (MN) OR Combining spacing mark (MC) - */ -MORE: -{ - < UNICODE_COMBINING_MARK: | > -} - - -TOKEN: -{ - < MC: - ["\u0903"] - | ["\u093e"] - | ["\u093f"] - | ["\u0940"] - | ["\u0949"] - | ["\u094a"] - | ["\u094b"] - | ["\u094c"] - | ["\u0982"] - | ["\u0983"] - | ["\u09be"] - | ["\u09bf"] - | ["\u09c0"] - | ["\u09c7"] - | ["\u09c8"] - | ["\u09cb"] - | ["\u09cc"] - | ["\u09d7"] - | ["\u0a03"] - | ["\u0a3e"] - | ["\u0a3f"] - | ["\u0a40"] - | ["\u0a83"] - | ["\u0abe"] - | ["\u0abf"] - | ["\u0ac0"] - | ["\u0ac9"] - | ["\u0acb"] - | ["\u0acc"] - | ["\u0b02"] - | ["\u0b03"] - | ["\u0b3e"] - | ["\u0b40"] - | ["\u0b47"] - | ["\u0b48"] - | ["\u0b4b"] - | ["\u0b4c"] - | ["\u0b57"] - | ["\u0bbe"] - | ["\u0bbf"] - | ["\u0bc1"] - | ["\u0bc2"] - | ["\u0bc6"] - | ["\u0bc7"] - | ["\u0bc8"] - | ["\u0bca"] - | ["\u0bcb"] - | ["\u0bcc"] - | ["\u0bd7"] - | ["\u0c01"] - | ["\u0c02"] - | ["\u0c03"] - | ["\u0c41"] - | ["\u0c42"] - | ["\u0c43"] - | ["\u0c44"] - | ["\u0c82"] - | ["\u0c83"] - | ["\u0cbe"] - | ["\u0cc0"] - | ["\u0cc1"] - | ["\u0cc2"] - | ["\u0cc3"] - | ["\u0cc4"] - | ["\u0cc7"] - | ["\u0cc8"] - | ["\u0cca"] - | ["\u0ccb"] - | ["\u0cd5"] - | ["\u0cd6"] - | ["\u0d02"] - | ["\u0d03"] - | ["\u0d3e"] - | ["\u0d3f"] - | ["\u0d40"] - | ["\u0d46"] - | ["\u0d47"] - | ["\u0d48"] - | ["\u0d4a"] - | ["\u0d4b"] - | ["\u0d4c"] - | ["\u0d57"] - | ["\u0d82"] - | ["\u0d83"] - | ["\u0dcf"] - | ["\u0dd0"] - | ["\u0dd1"] - | ["\u0dd8"] - | ["\u0dd9"] - | ["\u0dda"] - | ["\u0ddb"] - | ["\u0ddc"] - | ["\u0ddd"] - | ["\u0dde"] - | ["\u0ddf"] - | ["\u0df2"] - | ["\u0df3"] - | ["\u0f3e"] - | ["\u0f3f"] - | ["\u0f7f"] - | ["\u102c"] - | ["\u1031"] - | ["\u1038"] - | ["\u1056"] - | ["\u1057"] - | ["\u17b6"] - | ["\u17be"] - | ["\u17bf"] - | ["\u17c0"] - | ["\u17c1"] - | ["\u17c2"] - | ["\u17c3"] - | ["\u17c4"] - | ["\u17c5"] - | ["\u17c7"] - | ["\u17c8"] - | ["\u1923"] - | ["\u1924"] - | ["\u1925"] - | ["\u1926"] - | ["\u1929"] - | ["\u192a"] - | ["\u192b"] - | ["\u1930"] - | ["\u1931"] - | ["\u1933"] - | ["\u1934"] - | ["\u1935"] - | ["\u1936"] - | ["\u1937"] - | ["\u1938"] - | ["\u19b0"] - | ["\u19b1"] - | ["\u19b2"] - | ["\u19b3"] - | ["\u19b4"] - | ["\u19b5"] - | ["\u19b6"] - | ["\u19b7"] - | ["\u19b8"] - | ["\u19b9"] - | ["\u19ba"] - | ["\u19bb"] - | ["\u19bc"] - | ["\u19bd"] - | ["\u19be"] - | ["\u19bf"] - | ["\u19c0"] - | ["\u19c8"] - | ["\u19c9"] - | ["\u1a19"] - | ["\u1a1a"] - | ["\u1a1b"] - | ["\ua802"] - | ["\ua823"] - | ["\ua824"] - | ["\ua827"] - | ["\u1d16"] - | ["\u1d16"] - | ["\u1d16"] - | ["\u1d16"] - | ["\u1d16"] - | ["\u1d17"] - | ["\u1d17"] - | ["\u1d17"] - > -| - < MN: - ["\u0300"-"\u034e"] - | ["\u0360"-"\u0362"] - | ["\u0483"-"\u0486"] - | ["\u0591"-"\u05a1"] - | ["\u05a3"-"\u05b9"] - | ["\u05bb"-"\u05bd"] - | ["\u05bf"] - | ["\u05c1"-"\u05c2"] - | ["\u05c4"] - | ["\u064b"-"\u0655"] - | ["\u0670"] - | ["\u06d6"-"\u06dc"] - | ["\u06df"-"\u06e4"] - | ["\u06e7"-"\u06e8"] - | ["\u06ea"-"\u06ed"] - | ["\u0711"] - | ["\u0730"-"\u074a"] - | ["\u07a6"-"\u07b0"] - | ["\u0901"-"\u0903"] - | ["\u093c"] - | ["\u093e"-"\u094d"] - | ["\u0951"-"\u0954"] - | ["\u0962"-"\u0963"] - | ["\u0981"-"\u0983"] - | ["\u09bc"-"\u09c4"] - | ["\u09c7"-"\u09c8"] - | ["\u09cb"-"\u09cd"] - | ["\u09d7"] - | ["\u09e2"-"\u09e3"] - | ["\u0a02"] - | ["\u0a3c"] - | ["\u0a3e"-"\u0a42"] - | ["\u0a47"-"\u0a48"] - | ["\u0a4b"-"\u0a4d"] - | ["\u0a70"-"\u0a71"] - | ["\u0a81"-"\u0a83"] - | ["\u0abc"] - | ["\u0abe"-"\u0ac5"] - | ["\u0ac7"-"\u0ac9"] - | ["\u0acb"-"\u0acd"] - | ["\u0b01"-"\u0b03"] - | ["\u0b3c"] - | ["\u0b3e"-"\u0b43"] - | ["\u0b47"-"\u0b48"] - | ["\u0b4b"-"\u0b4d"] - | ["\u0b56"-"\u0b57"] - | ["\u0b82"-"\u0b83"] - | ["\u0bbe"-"\u0bc2"] - | ["\u0bc6"-"\u0bc8"] - | ["\u0bca"-"\u0bcd"] - | ["\u0bd7"] - | ["\u0c01"-"\u0c03"] - | ["\u0c3e"-"\u0c44"] - | ["\u0c46"-"\u0c48"] - | ["\u0c4a"-"\u0c4d"] - | ["\u0c55"-"\u0c56"] - | ["\u0c82"-"\u0c83"] - | ["\u0cbe"-"\u0cc4"] - | ["\u0cc6"-"\u0cc8"] - | ["\u0cca"-"\u0ccd"] - | ["\u0cd5"-"\u0cd6"] - | ["\u0d02"-"\u0d03"] - | ["\u0d3e"-"\u0d43"] - | ["\u0d46"-"\u0d48"] - | ["\u0d4a"-"\u0d4d"] - | ["\u0d57"] - | ["\u0d82"-"\u0d83"] - | ["\u0dca"] - | ["\u0dcf"-"\u0dd4"] - | ["\u0dd6"] - | ["\u0dd8"-"\u0ddf"] - | ["\u0df2"-"\u0df3"] - | ["\u0e31"] - | ["\u0e34"-"\u0e3a"] - | ["\u0e47"-"\u0e4e"] - | ["\u0eb1"] - | ["\u0eb4"-"\u0eb9"] - | ["\u0ebb"-"\u0ebc"] - | ["\u0ec8"-"\u0ecd"] - | ["\u0f18"-"\u0f19"] - | ["\u0f35"] - | ["\u0f37"] - | ["\u0f39"] - | ["\u0f3e"-"\u0f3f"] - | ["\u0f71"-"\u0f84"] - | ["\u0f86"-"\u0f87"] - | ["\u0f90"-"\u0f97"] - | ["\u0f99"-"\u0fbc"] - | ["\u0fc6"] - | ["\u102c"-"\u1032"] - | ["\u1036"-"\u1039"] - | ["\u1056"-"\u1059"] - | ["\u17b4"-"\u17d3"] - | ["\u18a9"] - | ["\u20d0"-"\u20dc"] - | ["\u20e1"] - | ["\u302a"-"\u302f"] - | ["\u3099"-"\u309a"] - | ["\ufb1e"] - | ["\ufe20"-"\ufe23"] - > -} - -TOKEN: -{ - < UNICODE_DIGIT: - ["0"-"9"] - | ["\u0660"-"\u0669"] - | ["\u06f0"-"\u06f9"] - | ["\u0966"-"\u096f"] - | ["\u09e6"-"\u09ef"] - | ["\u0a66"-"\u0a6f"] - | ["\u0ae6"-"\u0aef"] - | ["\u0b66"-"\u0b6f"] - | ["\u0be7"-"\u0bef"] - | ["\u0c66"-"\u0c6f"] - | ["\u0ce6"-"\u0cef"] - | ["\u0d66"-"\u0d6f"] - | ["\u0e50"-"\u0e59"] - | ["\u0ed0"-"\u0ed9"] - | ["\u0f20"-"\u0f29"] - | ["\u1040"-"\u1049"] - | ["\u1369"-"\u1371"] - | ["\u17e0"-"\u17e9"] - | ["\u1810"-"\u1819"] - | ["\uff10"-"\uff19"] - > -} - -TOKEN: -{ - < UNICODE_CONNECTOR_PUNCTUATION: - ["_"] - | - ["\u203f"-"\u2040"] - | - ["\u30fb"] - | - ["\ufe33"-"\ufe34"] - | - ["\ufe4d"-"\ufe4f"] - | - ["\uff3f"] - | - ["\uff65"] - > -} - -TOKEN: -{ - < UNICODE_ESCAPE_SEQUENCE: "u" > -} - -TOKEN: -{ - < HEX_DIGIT: ["0"-"9"] | ["a"-"f"] | ["A"-"F"] > -} - - - - -TOKEN : -{ - < SLASHASSIGN: "/=" > : DEFAULT -| - < SLASH: "/" > : DEFAULT -} - - /* ************************* LARA TOKENS ************************************* - -TOKEN : /* JP IDENTIFIERS * -{ - < JPVAR: "$" ( | )> :DEFAULT | - < #IN_JPVAR: | | < END > | | | | | > -} - /* ************************* LARA TOKENS ************************************* / - -/* Section 7.8.5: Regular Expression Literals */ - - -TOKEN : -{ - < REGULAR_EXPRESSION_LITERAL: - "/" ( (~["\n","\r","\\","/","*"]) | ) - ( (~["\n","\r","\\","/"]) | )* "/" ()* - > : IN_REGEX -| - < #BACKSLASH_SEQUENCE: - "\\" (~["\n","\r"]) - > -} - - -/** Function that returns the join point identifier, which can be any identifier - or one of the following reserved words - **/ - Token getNoReservedIdentifier() : - {Token t;} - { - ( - t= | - t= | t= | t=< END > | - t= | t= | t= | t= | t= | - t= | t= | t= | t= | t=< SWITCH > | t=< CASE > | - t= | t= | t= | t=<_DEFAULT> | t= | t=< INTANCE_OF > | - t= | t= | t= | - t= | t= |t= | t= |t=< REPLACE > |t=< CHECK > |t=< APPLY > - ) - {return t;} - } - - - - void noReservedIdentifier() : - {/*@bgen(jjtree) Identifier */ - ASTIdentifier jjtn000 = new ASTIdentifier(JJTIDENTIFIER); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1)); -/*@egen*/Token t;} - {/*@bgen(jjtree) Identifier */ - try { -/*@egen*/ - ( - t= | - t= | t= | t=< END > | - t= | t= | t= | t= | t= | - t= | t= | t= | t= | t=< SWITCH > | t=< CASE > | - t= | t= | t= | t=<_DEFAULT> | t=< CLASS > | t=< INTANCE_OF > | - t= | t= | t= | - t= | t= |t= | t= | - t= |t=< REPLACE > | t=< CHECK > | t=< APPLY > - )/*@bgen(jjtree)*/ - { - jjtree.closeNodeScope(jjtn000, true); - jjtc000 = false; - jjtn000.jjtSetLastToken(getToken(0)); - } -/*@egen*/ - { jjtn000.setName(t.image);jjtn000.jjtSetValue(t.image); - //jjtThis.setCoord(t,t); - }/*@bgen(jjtree)*/ - } finally { - if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -/*@egen*/ - } - -/***************************************** - * ECMA SYNTACTIC GRAMMARS STARTS HERE * - *****************************************/ - -/******************************************************************************* - ************************ LARA SYNTACTIC GRAMMAR ************************* - *******************************************************************************/ - - /** - * A LARA file can contain zero or more includes and imports, followed by definitions of aspectdefs, - * codedefs, functions and global variables - **/ - ASTStart Start() : - {/*@bgen(jjtree) Start */ - ASTStart jjtn000 = new ASTStart(JJTSTART); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1)); -/*@egen*/} - {/*@bgen(jjtree) Start */ - try { -/*@egen*/ -// [] - (Import())* - (AspectDef() - | CodeDef() - | Declaration() - )* - /*@bgen(jjtree)*/ - { - jjtree.closeNodeScope(jjtn000, true); - jjtc000 = false; - jjtn000.jjtSetLastToken(getToken(0)); - } -/*@egen*/ - { return jjtn000; }/*@bgen(jjtree)*/ - } catch (Throwable jjte000) { - if (jjtc000) { - jjtree.clearNodeScope(jjtn000); - jjtc000 = false; - } else { - jjtree.popNode(); - } - if (jjte000 instanceof RuntimeException) { - throw (RuntimeException)jjte000; - } - if (jjte000 instanceof ParseException) { - throw (ParseException)jjte000; - } - throw (Error)jjte000; - } finally { - if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -/*@egen*/ - } - - void Declaration() : { } - { - - LOOKAHEAD(( ) Identifier()) GeneratorFunctionDeclaration() - | LOOKAHEAD(( ) Identifier()) FunctionDeclaration() - | VariableStatement() - // TODO: Enable this, disable the one below, implement declareGlobal - //| Expression() ( )? - - |/*@bgen(jjtree) AssignmentExpression */ - { - ASTAssignmentExpression jjtn001 = new ASTAssignmentExpression(JJTASSIGNMENTEXPRESSION); - boolean jjtc001 = true; - jjtree.openNodeScope(jjtn001); - jjtn001.jjtSetFirstToken(getToken(1)); - } - try { -/*@egen*/ - ( - - LeftHandSideExpression() AssignmentOperator() AssignmentExpression() [] - )/*@bgen(jjtree)*/ - } catch (Throwable jjte001) { - if (jjtc001) { - jjtree.clearNodeScope(jjtn001); - jjtc001 = false; - } else { - jjtree.popNode(); - } - if (jjte001 instanceof RuntimeException) { - throw (RuntimeException)jjte001; - } - if (jjte001 instanceof ParseException) { - throw (ParseException)jjte001; - } - throw (Error)jjte001; - } finally { - if (jjtc001) { - jjtree.closeNodeScope(jjtn001, true); - jjtn001.jjtSetLastToken(getToken(0)); - } - } -/*@egen*/ - - } - - /** - * The path to a file that is not in the same path of the invoked LARA file. With one import it is - * possible to import one or every file within a package - **/ - void Import() : - {/*@bgen(jjtree) Import */ - ASTImport jjtn000 = new ASTImport(JJTIMPORT); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1)); -/*@egen*/Token t; Token begin; Token end;} - {/*@bgen(jjtree) Import */ - try { -/*@egen*/ - begin= t=FilePath() end=EndStatement()/*@bgen(jjtree)*/ - { - jjtree.closeNodeScope(jjtn000, true); - jjtc000 = false; - jjtn000.jjtSetLastToken(getToken(0)); - } -/*@egen*/ - {jjtn000.jjtSetValue(t.image);}/*@bgen(jjtree)*/ - } catch (Throwable jjte000) { - if (jjtc000) { - jjtree.clearNodeScope(jjtn000); - jjtc000 = false; - } else { - jjtree.popNode(); - } - if (jjte000 instanceof RuntimeException) { - throw (RuntimeException)jjte000; - } - if (jjte000 instanceof ParseException) { - throw (ParseException)jjte000; - } - throw (Error)jjte000; - } finally { - if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -/*@egen*/ - // { jjtThis.setCoord(begin,end);} - } - /** FilePath - * gets the path to a file or all the files in the package - **/ - Token FilePath(): - {Token t;} - { - (LOOKAHEAD(2)Identifier())* (t= |t=) - {return t;} - } - - /** FilePathNoSTar - * gets the path to a file in a package - **/ - void FilePathNoSTar() : - {/*@bgen(jjtree) FilePath */ - ASTFilePath jjtn000 = new ASTFilePath(JJTFILEPATH); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1)); -/*@egen*/} - {/*@bgen(jjtree) FilePath */ - try { -/*@egen*/ - (LOOKAHEAD(2)Identifier())+/*@bgen(jjtree)*/ - } catch (Throwable jjte000) { - if (jjtc000) { - jjtree.clearNodeScope(jjtn000); - jjtc000 = false; - } else { - jjtree.popNode(); - } - if (jjte000 instanceof RuntimeException) { - throw (RuntimeException)jjte000; - } - if (jjte000 instanceof ParseException) { - throw (ParseException)jjte000; - } - throw (Error)jjte000; - } finally { - if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -/*@egen*/ - } - - /** - * Code Definition A parcel of native code or LARA-Code to be used by the insert/output action. To define the target - * language, one has to define the type of the codedef, such as: codedef, this means that the code to be inserted - * is written in C language. A code definition needs an identifier and its body is code that can contain a tag such - * as "" to insert information on the code such as: join point property or a variable value. To use those tags, - * the codedef must have input arguments to refer those to specific values. - **/ - void CodeDef() : - {/*@bgen(jjtree) CodeDef */ - ASTCodeDef jjtn000 = new ASTCodeDef(JJTCODEDEF); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1)); -/*@egen*/Token name, code, language, begin, end;} - {/*@bgen(jjtree) CodeDef */ - try { -/*@egen*/ - {jjtn000.setLanguage("native");} - begin=[ language= {jjtn000.setLanguage(language.image);}] - name= {jjtn000.setName(name.image);}/*@bgen(jjtree) #FormalParameterList(> 0) */ - { - ASTFormalParameterList jjtn001 = new ASTFormalParameterList(JJTFORMALPARAMETERLIST); - boolean jjtc001 = true; - jjtree.openNodeScope(jjtn001); - jjtn001.jjtSetFirstToken(getToken(1)); - } - try { -/*@egen*/ - ( [ [FormalParameterList()] ] )/*@bgen(jjtree)*/ - } catch (Throwable jjte001) { - if (jjtc001) { - jjtree.clearNodeScope(jjtn001); - jjtc001 = false; - } else { - jjtree.popNode(); - } - if (jjte001 instanceof RuntimeException) { - throw (RuntimeException)jjte001; - } - if (jjte001 instanceof ParseException) { - throw (ParseException)jjte001; - } - throw (Error)jjte001; - } finally { - if (jjtc001) { - jjtree.closeNodeScope(jjtn001, jjtree.nodeArity() > 0); - jjtn001.jjtSetLastToken(getToken(0)); - } - } -/*@egen*/ - code = - { - String simpleCode = code.image.substring(2,code.image.length()-2); - jjtn000.setCode(simpleCode); - } - end=/*@bgen(jjtree)*/ - } catch (Throwable jjte000) { - if (jjtc000) { - jjtree.clearNodeScope(jjtn000); - jjtc000 = false; - } else { - jjtree.popNode(); - } - if (jjte000 instanceof RuntimeException) { - throw (RuntimeException)jjte000; - } - if (jjte000 instanceof ParseException) { - throw (ParseException)jjte000; - } - throw (Error)jjte000; - } finally { - if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -/*@egen*/ - - // { jjtThis.setCoord(begin,end);} - } - - /** - * Input arguments The arguments to be defined when a "aspect-call" action is stated. They can be normal variables - * or variables referent to a specific join point. The normal variables can have a default value - **/ - void Input() : {/*@bgen(jjtree) Input */ - ASTInput jjtn000 = new ASTInput(JJTINPUT); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1)); -/*@egen*/ Token begin, end;} - {/*@bgen(jjtree) Input */ - try { -/*@egen*/ - begin= - VariableDeclarationList() ()? - end=/*@bgen(jjtree)*/ - } catch (Throwable jjte000) { - if (jjtc000) { - jjtree.clearNodeScope(jjtn000); - jjtc000 = false; - } else { - jjtree.popNode(); - } - if (jjte000 instanceof RuntimeException) { - throw (RuntimeException)jjte000; - } - if (jjte000 instanceof ParseException) { - throw (ParseException)jjte000; - } - throw (Error)jjte000; - } finally { - if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -/*@egen*/ - //{ jjtThis.setCoord(begin,end);} - } - - /** - * Output arguments List of normal variables or variables referent to a specific join point. The normal variables - * can have a default value - **/ - void Output() : {/*@bgen(jjtree) Output */ - ASTOutput jjtn000 = new ASTOutput(JJTOUTPUT); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1)); -/*@egen*/ Token begin, end;} - {/*@bgen(jjtree) Output */ - try { -/*@egen*/ - begin= - VariableDeclarationList() ()? - end=/*@bgen(jjtree)*/ - } catch (Throwable jjte000) { - if (jjtc000) { - jjtree.clearNodeScope(jjtn000); - jjtc000 = false; - } else { - jjtree.popNode(); - } - if (jjte000 instanceof RuntimeException) { - throw (RuntimeException)jjte000; - } - if (jjte000 instanceof ParseException) { - throw (ParseException)jjte000; - } - throw (Error)jjte000; - } finally { - if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -/*@egen*/ - } - - /** - * Static List of static variables and functions, which can be accessed statically in the aspect. The variables - * values are shared between all aspect instances - **/ - void Static() : {/*@bgen(jjtree) Static */ - ASTStatic jjtn000 = new ASTStatic(JJTSTATIC); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1)); -/*@egen*/} - {/*@bgen(jjtree) Static */ - try { -/*@egen*/ - - (VariableStatement()| GeneratorFunctionDeclaration() | FunctionDeclaration())* - /*@bgen(jjtree)*/ - } catch (Throwable jjte000) { - if (jjtc000) { - jjtree.clearNodeScope(jjtn000); - jjtc000 = false; - } else { - jjtree.popNode(); - } - if (jjte000 instanceof RuntimeException) { - throw (RuntimeException)jjte000; - } - if (jjte000 instanceof ParseException) { - throw (ParseException)jjte000; - } - throw (Error)jjte000; - } finally { - if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -/*@egen*/ - } - - /** Initialize - * Similar to a constructor. A block of JavaScript code to initialize variables, inter alia - **/ - void Initialize() : {/*@bgen(jjtree) Initialize */ - ASTInitialize jjtn000 = new ASTInitialize(JJTINITIALIZE); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1)); -/*@egen*/} - {/*@bgen(jjtree) Initialize */ - try { -/*@egen*/ - - JavaScript() - /*@bgen(jjtree)*/ - } catch (Throwable jjte000) { - if (jjtc000) { - jjtree.clearNodeScope(jjtn000); - jjtc000 = false; - } else { - jjtree.popNode(); - } - if (jjte000 instanceof RuntimeException) { - throw (RuntimeException)jjte000; - } - if (jjte000 instanceof ParseException) { - throw (ParseException)jjte000; - } - throw (Error)jjte000; - } finally { - if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -/*@egen*/ - } - /** Finalize - * Similar to a destructor. A block of JavaScript code to finalize output variables, inter alia - **/ - void Finalize() : {/*@bgen(jjtree) Finalize */ - ASTFinalize jjtn000 = new ASTFinalize(JJTFINALIZE); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1)); -/*@egen*/} - {/*@bgen(jjtree) Finalize */ - try { -/*@egen*/ - - JavaScript() - /*@bgen(jjtree)*/ - } catch (Throwable jjte000) { - if (jjtc000) { - jjtree.clearNodeScope(jjtn000); - jjtc000 = false; - } else { - jjtree.popNode(); - } - if (jjte000 instanceof RuntimeException) { - throw (RuntimeException)jjte000; - } - if (jjte000 instanceof ParseException) { - throw (ParseException)jjte000; - } - throw (Error)jjte000; - } finally { - if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -/*@egen*/ - } - - /** Check - * Set of conditions to verify input arguments and other important stats that specify if the aspect can be executed - **/ - void Check() : {/*@bgen(jjtree) Check */ - ASTCheck jjtn000 = new ASTCheck(JJTCHECK); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1)); -/*@egen*/} - {/*@bgen(jjtree) Check */ - try { -/*@egen*/ - - LogicalORExpression() [EndStatement() (LogicalORExpression() EndStatement())*] - /*@bgen(jjtree)*/ - } catch (Throwable jjte000) { - if (jjtc000) { - jjtree.clearNodeScope(jjtn000); - jjtc000 = false; - } else { - jjtree.popNode(); - } - if (jjte000 instanceof RuntimeException) { - throw (RuntimeException)jjte000; - } - if (jjte000 instanceof ParseException) { - throw (ParseException)jjte000; - } - throw (Error)jjte000; - } finally { - if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -/*@egen*/ - } - - /** Aspect Definition - * The aspect definition can contain outputs and inputs variables, a check to verify those variables, an initializer and a finalizer to deal with information to be handler before and after the aspect, respectively. - * The body of the aspect consists of selects, applies and conditions to apply the aspect in the target program, and afters, befores, function and variable declaration to assist the apply and condition section. - */ - void AspectDef() : - {/*@bgen(jjtree) AspectDef */ - ASTAspectDef jjtn000 = new ASTAspectDef(JJTASPECTDEF); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1)); -/*@egen*/Token aspName, begin, end;} - {/*@bgen(jjtree) AspectDef */ - try { -/*@egen*/ - begin= - aspName= - ( - Input() - | - Output() - | - Static() - )* - - [ Initialize() ] - [ Check() ] - ( - ( - LOOKAHEAD([Identifier() ] ( - LOOKAHEAD((getNoReservedIdentifier()(||)) - | ([]getNoReservedIdentifier() )) Pointcut() | - - LOOKAHEAD(2) FourthSetOp()) end=< END >/*@bgen(jjtree)*/ - } catch (Throwable jjte000) { - if (jjtc000) { - jjtree.clearNodeScope(jjtn000); - jjtc000 = false; - } else { - jjtree.popNode(); - } - if (jjte000 instanceof RuntimeException) { - throw (RuntimeException)jjte000; - } - if (jjte000 instanceof ParseException) { - throw (ParseException)jjte000; - } - throw (Error)jjte000; - } finally { - if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -/*@egen*/ - //{ jjtThis.setCoord(begin,end);} - } - - void FourthSetOp() : - {/*@bgen(jjtree) #Join(> 1) */ - ASTJoin jjtn000 = new ASTJoin(JJTJOIN); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1)); -/*@egen*/Token joinType;} - {/*@bgen(jjtree) #Join(> 1) */ - try { -/*@egen*/ - ThirdSetOp() [LOOKAHEAD(2)joinType=FourthSetOp() - {jjtn000.jjtSetValue(joinType.image);}]/*@bgen(jjtree)*/ - } catch (Throwable jjte000) { - if (jjtc000) { - jjtree.clearNodeScope(jjtn000); - jjtc000 = false; - } else { - jjtree.popNode(); - } - if (jjte000 instanceof RuntimeException) { - throw (RuntimeException)jjte000; - } - if (jjte000 instanceof ParseException) { - throw (ParseException)jjte000; - } - throw (Error)jjte000; - } finally { - if (jjtc000) { - jjtree.closeNodeScope(jjtn000, jjtree.nodeArity() > 1); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -/*@egen*/ - } - - void ThirdSetOp() : - {/*@bgen(jjtree) #Join(> 1) */ - ASTJoin jjtn000 = new ASTJoin(JJTJOIN); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1)); -/*@egen*/Token joinType;} - {/*@bgen(jjtree) #Join(> 1) */ - try { -/*@egen*/ - FirstSetOp() [(joinType=|joinType=) ThirdSetOp() - {jjtn000.jjtSetValue(joinType.image);}]/*@bgen(jjtree)*/ - } catch (Throwable jjte000) { - if (jjtc000) { - jjtree.clearNodeScope(jjtn000); - jjtc000 = false; - } else { - jjtree.popNode(); - } - if (jjte000 instanceof RuntimeException) { - throw (RuntimeException)jjte000; - } - if (jjte000 instanceof ParseException) { - throw (ParseException)jjte000; - } - throw (Error)jjte000; - } finally { - if (jjtc000) { - jjtree.closeNodeScope(jjtn000, jjtree.nodeArity() > 1); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -/*@egen*/ - } - - void FirstSetOp():{} - { - Identifier() | ( FourthSetOp()) - } - - /** Pointcut - * It can contain an identifier for the join point, a join point identifier and a possible property expression. - * Each join point can have a child, the join point down to its hierarchy - */ - void Pointcut() : - {/*@bgen(jjtree) Pointcut */ - ASTPointcut jjtn000 = new ASTPointcut(JJTPOINTCUT); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1)); -/*@egen*/Token joinPoint,reference;String referenceStr;} - {/*@bgen(jjtree) Pointcut */ - try { -/*@egen*/ - ( - //e.g.: ($l1=loop){...} - - reference = < IDENTIFIER_NAME> - joinPoint = getNoReservedIdentifier() - {referenceStr = reference.image;} - - | - LOOKAHEAD(< IDENTIFIER_NAME > ) //e.g.: $l1=loop{...} - reference = < IDENTIFIER_NAME> - joinPoint = getNoReservedIdentifier() - {referenceStr = reference.image;} - | - joinPoint = getNoReservedIdentifier() ////e.g.: loop{...} - {referenceStr = "$"+joinPoint.image;} - - ) - { - jjtn000.jjtSetValue(joinPoint.image); - jjtn000.setReference(referenceStr); - } - - [PointcutFilters()] - [ Pointcut()]/*@bgen(jjtree)*/ - } catch (Throwable jjte000) { - if (jjtc000) { - jjtree.clearNodeScope(jjtn000); - jjtc000 = false; - } else { - jjtree.popNode(); - } - if (jjte000 instanceof RuntimeException) { - throw (RuntimeException)jjte000; - } - if (jjte000 instanceof ParseException) { - throw (ParseException)jjte000; - } - throw (Error)jjte000; - } finally { - if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -/*@egen*/ - } - - /** Pointcut properties - * The properties of a pointcut can be declared in three different ways: - - it can be any property (*) - - a set of properties that will be mapped to the default attribute - - a property expression - */ - void PointcutFilters(): - {} - { - - (|/*@bgen(jjtree) PointcutFilters */ - { - ASTPointcutFilters jjtn002 = new ASTPointcutFilters(JJTPOINTCUTFILTERS); - boolean jjtc002 = true; - jjtree.openNodeScope(jjtn002); - jjtn002.jjtSetFirstToken(getToken(1)); - } - try { -/*@egen*/ - (LOOKAHEAD( (EqualityOperator()|RelationalOperator()) | ) - ( - OrFiltersExpr()/*@bgen(jjtree)*/ - { - jjtree.closeNodeScope(jjtn002, true); - jjtc002 = false; - jjtn002.jjtSetLastToken(getToken(0)); - } -/*@egen*/ - {jjtn002.setFullSpecified(true);} - ) - | - (/*@bgen(jjtree) #OrFiltersExpr(> 1) */ - { - ASTOrFiltersExpr jjtn001 = new ASTOrFiltersExpr(JJTORFILTERSEXPR); - boolean jjtc001 = true; - jjtree.openNodeScope(jjtn001); - jjtn001.jjtSetFirstToken(getToken(1)); - } - try { -/*@egen*/ - - ( ConditionalExpression() - ( ConditionalExpression())* - )/*@bgen(jjtree)*/ - } catch (Throwable jjte001) { - if (jjtc001) { - jjtree.clearNodeScope(jjtn001); - jjtc001 = false; - } else { - jjtree.popNode(); - } - if (jjte001 instanceof RuntimeException) { - throw (RuntimeException)jjte001; - } - if (jjte001 instanceof ParseException) { - throw (ParseException)jjte001; - } - throw (Error)jjte001; - } finally { - if (jjtc001) { - jjtree.closeNodeScope(jjtn001, jjtree.nodeArity() > 1); - jjtn001.jjtSetLastToken(getToken(0)); - } - } -/*@egen*/ /*@bgen(jjtree)*/ - { - jjtree.closeNodeScope(jjtn002, true); - jjtc002 = false; - jjtn002.jjtSetLastToken(getToken(0)); - } -/*@egen*/ - {jjtn002.setFullSpecified(false);} - ) - )/*@bgen(jjtree)*/ - } catch (Throwable jjte002) { - if (jjtc002) { - jjtree.clearNodeScope(jjtn002); - jjtc002 = false; - } else { - jjtree.popNode(); - } - if (jjte002 instanceof RuntimeException) { - throw (RuntimeException)jjte002; - } - if (jjte002 instanceof ParseException) { - throw (ParseException)jjte002; - } - throw (Error)jjte002; - } finally { - if (jjtc002) { - jjtree.closeNodeScope(jjtn002, true); - jjtn002.jjtSetLastToken(getToken(0)); - } - } -/*@egen*/ - - ) - - } - - /** "OR" Property Expr - * In the pointcut properties declaration, the comma is used as an OR operator (similar to ||) - **/ - void OrFiltersExpr() :{} - {/*@bgen(jjtree) #OrFiltersExpr(> 1) */ - { - ASTOrFiltersExpr jjtn001 = new ASTOrFiltersExpr(JJTORFILTERSEXPR); - boolean jjtc001 = true; - jjtree.openNodeScope(jjtn001); - jjtn001.jjtSetFirstToken(getToken(1)); - } - try { -/*@egen*/ - (ANDFiltersExpr() ( ANDFiltersExpr() )*)/*@bgen(jjtree)*/ - } catch (Throwable jjte001) { - if (jjtc001) { - jjtree.clearNodeScope(jjtn001); - jjtc001 = false; - } else { - jjtree.popNode(); - } - if (jjte001 instanceof RuntimeException) { - throw (RuntimeException)jjte001; - } - if (jjte001 instanceof ParseException) { - throw (ParseException)jjte001; - } - throw (Error)jjte001; - } finally { - if (jjtc001) { - jjtree.closeNodeScope(jjtn001, jjtree.nodeArity() > 1); - jjtn001.jjtSetLastToken(getToken(0)); - } - } -/*@egen*/ - } - - /** "AND" Property Expression - * To combine properties such as an AND operation, the properties are declared inside brackets, converting the comma (which is the OR operator) into an AND. - */ - void ANDFiltersExpr():{} - { - Filter() | /*@bgen(jjtree) #ANDFiltersExpr(> 1) */ - { - ASTANDFiltersExpr jjtn001 = new ASTANDFiltersExpr(JJTANDFILTERSEXPR); - boolean jjtc001 = true; - jjtree.openNodeScope(jjtn001); - jjtn001.jjtSetFirstToken(getToken(1)); - } - try { -/*@egen*/ (Filter() ( Filter() )*)/*@bgen(jjtree)*/ - } catch (Throwable jjte001) { - if (jjtc001) { - jjtree.clearNodeScope(jjtn001); - jjtc001 = false; - } else { - jjtree.popNode(); - } - if (jjte001 instanceof RuntimeException) { - throw (RuntimeException)jjte001; - } - if (jjte001 instanceof ParseException) { - throw (ParseException)jjte001; - } - throw (Error)jjte001; - } finally { - if (jjtc001) { - jjtree.closeNodeScope(jjtn001, jjtree.nodeArity() > 1); - jjtn001.jjtSetLastToken(getToken(0)); - } - } -/*@egen*/ - } - - /** Property - * The property is defined by comparing a join point attribute to a value - **/ - void Filter() : - {/*@bgen(jjtree) Filter */ - ASTFilter jjtn000 = new ASTFilter(JJTFILTER); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1)); -/*@egen*/Token prop,op;} - {/*@bgen(jjtree) Filter */ - try { -/*@egen*/ - prop= (EqualityOperator()|RelationalOperator()) ConditionalExpression()/*@bgen(jjtree)*/ - { - jjtree.closeNodeScope(jjtn000, true); - jjtc000 = false; - jjtn000.jjtSetLastToken(getToken(0)); - } -/*@egen*/ - {jjtn000.setProp(prop.image); - }/*@bgen(jjtree)*/ - } catch (Throwable jjte000) { - if (jjtc000) { - jjtree.clearNodeScope(jjtn000); - jjtc000 = false; - } else { - jjtree.popNode(); - } - if (jjte000 instanceof RuntimeException) { - throw (RuntimeException)jjte000; - } - if (jjte000 instanceof ParseException) { - throw (ParseException)jjte000; - } - throw (Error)jjte000; - } finally { - if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -/*@egen*/ - } - - - /** Around - * A Statement to occur around an apply - * It contains a list of applies that this statement refers to. The body of this statement is JavaScript, and can be used to prepare information for the applies. - **/ - void AroundApply() : - {/*@bgen(jjtree) AroundApply */ - ASTAroundApply jjtn000 = new ASTAroundApply(JJTAROUNDAPPLY); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1)); -/*@egen*/Token name,when, end; - String label = "";} - {/*@bgen(jjtree) AroundApply */ - try { -/*@egen*/ - [name= {label = name.image;}] ( when= | when= ) - [/*@bgen(jjtree) Applies */ - { - ASTApplies jjtn001 = new ASTApplies(JJTAPPLIES); - boolean jjtc001 = true; - jjtree.openNodeScope(jjtn001); - jjtn001.jjtSetFirstToken(getToken(1)); - } - try { -/*@egen*/(Identifier() ((LOOKAHEAD(2) Identifier())*))/*@bgen(jjtree)*/ - } catch (Throwable jjte001) { - if (jjtc001) { - jjtree.clearNodeScope(jjtn001); - jjtc001 = false; - } else { - jjtree.popNode(); - } - if (jjte001 instanceof RuntimeException) { - throw (RuntimeException)jjte001; - } - if (jjte001 instanceof ParseException) { - throw (ParseException)jjte001; - } - throw (Error)jjte001; - } finally { - if (jjtc001) { - jjtree.closeNodeScope(jjtn001, true); - jjtn001.jjtSetLastToken(getToken(0)); - } - } -/*@egen*/ ] - JavaScript() - - {jjtn000.setName(label); - jjtn000.setWhen(when.image);} - end=/*@bgen(jjtree)*/ - } catch (Throwable jjte000) { - if (jjtc000) { - jjtree.clearNodeScope(jjtn000); - jjtc000 = false; - } else { - jjtree.popNode(); - } - if (jjte000 instanceof RuntimeException) { - throw (RuntimeException)jjte000; - } - if (jjte000 instanceof ParseException) { - throw (ParseException)jjte000; - } - throw (Error)jjte000; - } finally { - if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -/*@egen*/ - //{ jjtThis.setCoord(when,end);} - - } - - /** Apply - * Old Version of apply, only static weaving - * Advice each join point of the related select(s). - * It can contain an unique label and a list of selects to be advised by the apply. If no select is inserted, the last select with no label will be used. - * The body contains JavaScript, in which the actions can be declared - ** - void Apply() #Apply: - {Token name, apply, end;} - { - [name={jjtThis.setName(name.image);} ] apply= [To()] - JavaScript() - end= - { jjtThis.setCoord(apply,end);} - } - /**/ - - /** Apply (Static/Dynamic) - * The new version of the Apply statement: static or dynamic weaving - * Advice each join point of the related select(s). - * It can contain an unique label and a list of selects to be advised by the apply. If no select is inserted, the last select with no label will be used. - * The body contains JavaScript, in which the actions can be declared - **/ - void Apply() : - {/*@bgen(jjtree) Apply */ - ASTApply jjtn000 = new ASTApply(JJTAPPLY); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1)); -/*@egen*/Token name, apply, end;} - {/*@bgen(jjtree) Apply */ - try { -/*@egen*/ - [name={jjtn000.setName(name.image);} ] - apply= - - [ - < DYNAMIC > {jjtn000.setDynamic(true);} - [ - < PARALLEL > {jjtn000.setConcurrent(true);} - | - < SEQUENCIAL > {jjtn000.setConcurrent(false);} - ] - [ - < BEFORE > {jjtn000.setTrigger("before");} - | - < AFTER > {jjtn000.setTrigger("after");} -// | -// //This needs to be fixed as it conflicts with the action "replace" -// < REPLACE > {jjtThis.setTrigger("around");} - ] - ] - - - [To()] - JavaScript() - end=/*@bgen(jjtree)*/ - } catch (Throwable jjte000) { - if (jjtc000) { - jjtree.clearNodeScope(jjtn000); - jjtc000 = false; - } else { - jjtree.popNode(); - } - if (jjte000 instanceof RuntimeException) { - throw (RuntimeException)jjte000; - } - if (jjte000 instanceof ParseException) { - throw (ParseException)jjte000; - } - throw (Error)jjte000; - } finally { - if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -/*@egen*/ - //{ jjtThis.setCoord(apply,end);} - - - } - - /** To - * list of selects that will be influenced by the apply - **/ - void To() : - {/*@bgen(jjtree) To */ - ASTTo jjtn000 = new ASTTo(JJTTO); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1)); -/*@egen*/} - {/*@bgen(jjtree) To */ - try { -/*@egen*/ - FourthSetOp() - (LOOKAHEAD( FourthSetOp()) FourthSetOp())*/*@bgen(jjtree)*/ - } catch (Throwable jjte000) { - if (jjtc000) { - jjtree.clearNodeScope(jjtn000); - jjtc000 = false; - } else { - jjtree.popNode(); - } - if (jjte000 instanceof RuntimeException) { - throw (RuntimeException)jjte000; - } - if (jjte000 instanceof ParseException) { - throw (ParseException)jjte000; - } - throw (Error)jjte000; - } finally { - if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -/*@egen*/ - } - - - void SimpleAction() : - {/*@bgen(jjtree) Action */ - ASTAction jjtn000 = new ASTAction(JJTACTION); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1)); -/*@egen*/Token t;} - {/*@bgen(jjtree) Action */ - try { -/*@egen*/ - ( - Insert() - | - Define() - | - Perform() - | - OutputAct() /**/ - ) - EndStatement()/*@bgen(jjtree)*/ - } catch (Throwable jjte000) { - if (jjtc000) { - jjtree.clearNodeScope(jjtn000); - jjtc000 = false; - } else { - jjtree.popNode(); - } - if (jjte000 instanceof RuntimeException) { - throw (RuntimeException)jjte000; - } - if (jjte000 instanceof ParseException) { - throw (ParseException)jjte000; - } - throw (Error)jjte000; - } finally { - if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -/*@egen*/ - - } - - /** Action - * Actions that can be used to influence the join points. - * A join point variable can be used to specify the targeted join point where the action takes place - **/ - void Action() : - { - Token t; - } - {/*@bgen(jjtree) Action */ - { - ASTAction jjtn003 = new ASTAction(JJTACTION); - boolean jjtc003 = true; - jjtree.openNodeScope(jjtn003); - jjtn003.jjtSetFirstToken(getToken(1)); - } - try { -/*@egen*/ -// -// LOOKAHEAD(LeftHandSideExpression() AssignmentOperator() ) ( -// LeftHandSideExpression() AssignmentOperator() -// ActionOnAssign() -// -// )#AssignmentExpression -// | - (/*@bgen(jjtree) #CompositeReference(> 1) */ - { - ASTCompositeReference jjtn002 = new ASTCompositeReference(JJTCOMPOSITEREFERENCE); - boolean jjtc002 = true; - jjtree.openNodeScope(jjtn002); - jjtn002.jjtSetFirstToken(getToken(1)); - } - try { -/*@egen*/ - ( - (/*@bgen(jjtree) Identifier */ - { - ASTIdentifier jjtn001 = new ASTIdentifier(JJTIDENTIFIER); - boolean jjtc001 = true; - jjtree.openNodeScope(jjtn001); - jjtn001.jjtSetFirstToken(getToken(1)); - } - try { -/*@egen*/ - ( - t=/*@bgen(jjtree)*/ - { - jjtree.closeNodeScope(jjtn001, true); - jjtc001 = false; - jjtn001.jjtSetLastToken(getToken(0)); - } -/*@egen*/ - { - jjtn001.setName(t.image);jjtn001.jjtSetValue(t.image); - //jjtThis.setCoord(t,t); - } - )/*@bgen(jjtree)*/ - } finally { - if (jjtc001) { - jjtree.closeNodeScope(jjtn001, true); - jjtn001.jjtSetLastToken(getToken(0)); - } - } -/*@egen*/ - ) - - (LOOKAHEAD(MemberExpressionPart())MemberExpressionPart())* - < DOT > - - )/*@bgen(jjtree)*/ - } catch (Throwable jjte002) { - if (jjtc002) { - jjtree.clearNodeScope(jjtn002); - jjtc002 = false; - } else { - jjtree.popNode(); - } - if (jjte002 instanceof RuntimeException) { - throw (RuntimeException)jjte002; - } - if (jjte002 instanceof ParseException) { - throw (ParseException)jjte002; - } - throw (Error)jjte002; - } finally { - if (jjtc002) { - jjtree.closeNodeScope(jjtn002, jjtree.nodeArity() > 1); - jjtn002.jjtSetLastToken(getToken(0)); - } - } -/*@egen*/ - ( - Insert() | - Define() | - Perform() | - OutputAct() - ) - )/*@bgen(jjtree)*/ - } catch (Throwable jjte003) { - if (jjtc003) { - jjtree.clearNodeScope(jjtn003); - jjtc003 = false; - } else { - jjtree.popNode(); - } - if (jjte003 instanceof RuntimeException) { - throw (RuntimeException)jjte003; - } - if (jjte003 instanceof ParseException) { - throw (ParseException)jjte003; - } - throw (Error)jjte003; - } finally { - if (jjtc003) { - jjtree.closeNodeScope(jjtn003, true); - jjtn003.jjtSetLastToken(getToken(0)); - } - } -/*@egen*/ - EndStatement() - } - - -void ActionOnAssign() : - {/*@bgen(jjtree) Action */ - ASTAction jjtn000 = new ASTAction(JJTACTION); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1)); -/*@egen*/ - Token t; - } - {/*@bgen(jjtree) Action */ - try { -/*@egen*/ - - (/*@bgen(jjtree) #CompositeReference(> 1) */ - { - ASTCompositeReference jjtn002 = new ASTCompositeReference(JJTCOMPOSITEREFERENCE); - boolean jjtc002 = true; - jjtree.openNodeScope(jjtn002); - jjtn002.jjtSetFirstToken(getToken(1)); - } - try { -/*@egen*/ ( - (/*@bgen(jjtree) Identifier */ - { - ASTIdentifier jjtn001 = new ASTIdentifier(JJTIDENTIFIER); - boolean jjtc001 = true; - jjtree.openNodeScope(jjtn001); - jjtn001.jjtSetFirstToken(getToken(1)); - } - try { -/*@egen*/ - ( - t=/*@bgen(jjtree)*/ - { - jjtree.closeNodeScope(jjtn001, true); - jjtc001 = false; - jjtn001.jjtSetLastToken(getToken(0)); - } -/*@egen*/ - { - jjtn001.setName(t.image);jjtn001.jjtSetValue(t.image); - //jjtThis.setCoord(t,t); - } - )/*@bgen(jjtree)*/ - } finally { - if (jjtc001) { - jjtree.closeNodeScope(jjtn001, true); - jjtn001.jjtSetLastToken(getToken(0)); - } - } -/*@egen*/ - ) - - (LOOKAHEAD(MemberExpressionPart())MemberExpressionPart())* - < DOT > - - )/*@bgen(jjtree)*/ - } catch (Throwable jjte002) { - if (jjtc002) { - jjtree.clearNodeScope(jjtn002); - jjtc002 = false; - } else { - jjtree.popNode(); - } - if (jjte002 instanceof RuntimeException) { - throw (RuntimeException)jjte002; - } - if (jjte002 instanceof ParseException) { - throw (ParseException)jjte002; - } - throw (Error)jjte002; - } finally { - if (jjtc002) { - jjtree.closeNodeScope(jjtn002, jjtree.nodeArity() > 1); - jjtn002.jjtSetLastToken(getToken(0)); - } - } -/*@egen*/ )? - - - ExecOnAssign()/*@bgen(jjtree)*/ - } catch (Throwable jjte000) { - if (jjtc000) { - jjtree.clearNodeScope(jjtn000); - jjtc000 = false; - } else { - jjtree.popNode(); - } - if (jjte000 instanceof RuntimeException) { - throw (RuntimeException)jjte000; - } - if (jjte000 instanceof ParseException) { - throw (ParseException)jjte000; - } - throw (Error)jjte000; - } finally { - if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -/*@egen*/ - } - - /** Call - * Action to invoke an aspect. - * The aspect is called with the input arguments that requires and the call instance can have a reference variable to be used to recover information from the invoked aspect. - **/ - void Call() : - {/*@bgen(jjtree) Call */ - ASTCall jjtn000 = new ASTCall(JJTCALL); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1)); -/*@egen*/Token aspVarName,aspName,ref, end;} - {/*@bgen(jjtree) Call */ - try { -/*@egen*/ - ( - [LOOKAHEAD(LeftHandSideExpression() ) - LeftHandSideExpression() ] - - | - < VAR > Identifier() < ASSIGN > - | - LeftHandSideExpression() < ASSIGN > - ) - - [LOOKAHEAD(2)FilePathNoSTar()] - aspName= - - [Arguments()] end=EndStatement()/*@bgen(jjtree)*/ - { - jjtree.closeNodeScope(jjtn000, true); - jjtc000 = false; - jjtn000.jjtSetLastToken(getToken(0)); - } -/*@egen*/ - - { - jjtn000.setAspName(aspName.image); - // jjtThis.setCoord(aspName,end); - }/*@bgen(jjtree)*/ - } catch (Throwable jjte000) { - if (jjtc000) { - jjtree.clearNodeScope(jjtn000); - jjtc000 = false; - } else { - jjtree.popNode(); - } - if (jjte000 instanceof RuntimeException) { - throw (RuntimeException)jjte000; - } - if (jjte000 instanceof ParseException) { - throw (ParseException)jjte000; - } - throw (Error)jjte000; - } finally { - if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -/*@egen*/ - } - - - - /** Run - * Execution of an external tool. - **/ - void Run() : - {/*@bgen(jjtree) Run */ - ASTRun jjtn000 = new ASTRun(JJTRUN); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1)); -/*@egen*/Token run, toolName, end;} - {/*@bgen(jjtree) Run */ - try { -/*@egen*/ - run= [LOOKAHEAD(LeftHandSideExpression() )LeftHandSideExpression() ] - [toolName=getNoReservedIdentifier() {jjtn000.setToolName(toolName.image);}] - Arguments() - [ AssignmentExpression()] - end=EndStatement()/*@bgen(jjtree)*/ - } catch (Throwable jjte000) { - if (jjtc000) { - jjtree.clearNodeScope(jjtn000); - jjtc000 = false; - } else { - jjtree.popNode(); - } - if (jjte000 instanceof RuntimeException) { - throw (RuntimeException)jjte000; - } - if (jjte000 instanceof ParseException) { - throw (ParseException)jjte000; - } - throw (Error)jjte000; - } finally { - if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -/*@egen*/ - - // {jjtThis.setCoord(run,end);} - } - - /** Command - * Execution of a command. - **/ - void Cmd() : - {/*@bgen(jjtree) Cmd */ - ASTCmd jjtn000 = new ASTCmd(JJTCMD); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1)); -/*@egen*/Token cmd, toolName, end;} - {/*@bgen(jjtree) Cmd */ - try { -/*@egen*/ - ( - cmd= | cmd= {jjtn000.setNewVersion(true);} ) - [LOOKAHEAD(LeftHandSideExpression() )LeftHandSideExpression() ] - Arguments() - [ AssignmentExpression()] - end=EndStatement()/*@bgen(jjtree)*/ - } catch (Throwable jjte000) { - if (jjtc000) { - jjtree.clearNodeScope(jjtn000); - jjtc000 = false; - } else { - jjtree.popNode(); - } - if (jjte000 instanceof RuntimeException) { - throw (RuntimeException)jjte000; - } - if (jjte000 instanceof ParseException) { - throw (ParseException)jjte000; - } - throw (Error)jjte000; - } finally { - if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -/*@egen*/ - //{jjtThis.setCoord(cmd,end);} - } - - /** OLD CALL ** - void Call() #Call: - {Token aspVarName,aspName,ref, end;} - { - [LOOKAHEAD( ) - aspVarName= - {jjtThis.setAspVarName(aspVarName.image);}] - [LOOKAHEAD(2)FilePathNoSTar()]aspName= - {jjtThis.setAspName(aspName.image);} - [LOOKAHEAD(Arguments())Arguments()] end= - // { jjtThis.setCoord(aspName,end);} - } - /***/ - - /** Insert - * The insertion of code is made by indicating a codedefinition's identifier with the required arguments or writing the desired code, with the possibility of using LARA-code to be defined into the target language, such as insert before %{\ufffd}%. - * It is also needed to say if the code is inserted before, after or around the pointcut. - **/ - void Insert() : - {/*@bgen(jjtree) Insert */ - ASTInsert jjtn000 = new ASTInsert(JJTINSERT); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1)); -/*@egen*/Token when,language, begin, end;} - {/*@bgen(jjtree) Insert */ - try { -/*@egen*/ - { - jjtn000.setLanguage("native"); - } - ( - ( - begin= - ( - ( - [ language= {jjtn000.setLanguage(language.image);}] - (when= | when= | when= | when=) - ConditionalExpression()/*@bgen(jjtree)*/ - { - jjtree.closeNodeScope(jjtn000, true); - jjtc000 = false; - jjtn000.jjtSetLastToken(getToken(0)); - } -/*@egen*/ -// ( -// TemplateLiteral() -// | -// ((Identifier() [LOOKAHEAD(Arguments())Arguments()]) #CompositeReference(>1)) -// ) - {jjtn000.setWhen(when.image);} - //{jjtThis.setCoord(begin,when);} - ) - | - ( - Arguments() - //{jjtThis.setCoord(begin,begin);} - ) - /*| - ( - TemplateLiteral() - | - ((Identifier() [LOOKAHEAD(Arguments())Arguments()]) #CompositeReference(>1)) - {jjtThis.setWhen("inside");} - //{jjtThis.setCoord(begin,begin);} - ) */ - ) - ) - | - ( - begin = ConditionalExpression()/*@bgen(jjtree)*/ - { - jjtree.closeNodeScope(jjtn000, true); - jjtc000 = false; - jjtn000.jjtSetLastToken(getToken(0)); - } -/*@egen*/ -// ( -// TemplateLiteral() -// | -// ((Identifier() [LOOKAHEAD(Arguments())Arguments()]) #CompositeReference(>1)) -// ) - {jjtn000.setWhen(begin.image);} - //{jjtThis.setCoord(begin,begin);} - ) - )/*@bgen(jjtree)*/ - } catch (Throwable jjte000) { - if (jjtc000) { - jjtree.clearNodeScope(jjtn000); - jjtc000 = false; - } else { - jjtree.popNode(); - } - if (jjte000 instanceof RuntimeException) { - throw (RuntimeException)jjte000; - } - if (jjte000 instanceof ParseException) { - throw (ParseException)jjte000; - } - throw (Error)jjte000; - } finally { - if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -/*@egen*/ - } - - /** Perform - * Perform an action over the join point - **/ - void Perform() : - {/*@bgen(jjtree) Perform */ - ASTPerform jjtn000 = new ASTPerform(JJTPERFORM); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1)); -/*@egen*/Token action, begin, end, t;} - {/*@bgen(jjtree) Perform */ - try { -/*@egen*/ - begin= - [LOOKAHEAD(< IDENTIFIER_NAME > < COLON > ) t=< IDENTIFIER_NAME > < COLON >{jjtn000.setVariable(t.image);} ] - action=getNoReservedIdentifier() - {jjtn000.setAction(action.image);} - //{jjtThis.setCoord(begin,action);} - [/*@bgen(jjtree) FunctionCallParameters */ - { - ASTFunctionCallParameters jjtn001 = new ASTFunctionCallParameters(JJTFUNCTIONCALLPARAMETERS); - boolean jjtc001 = true; - jjtree.openNodeScope(jjtn001); - jjtn001.jjtSetFirstToken(getToken(1)); - } - try { -/*@egen*/ - (TemplateLiteral())/*@bgen(jjtree)*/ - } catch (Throwable jjte001) { - if (jjtc001) { - jjtree.clearNodeScope(jjtn001); - jjtc001 = false; - } else { - jjtree.popNode(); - } - if (jjte001 instanceof RuntimeException) { - throw (RuntimeException)jjte001; - } - if (jjte001 instanceof ParseException) { - throw (ParseException)jjte001; - } - throw (Error)jjte001; - } finally { - if (jjtc001) { - jjtree.closeNodeScope(jjtn001, true); - jjtn001.jjtSetLastToken(getToken(0)); - } - } -/*@egen*/ - | - Arguments() - ]/*@bgen(jjtree)*/ - } catch (Throwable jjte000) { - if (jjtc000) { - jjtree.clearNodeScope(jjtn000); - jjtc000 = false; - } else { - jjtree.popNode(); - } - if (jjte000 instanceof RuntimeException) { - throw (RuntimeException)jjte000; - } - if (jjte000 instanceof ParseException) { - throw (ParseException)jjte000; - } - throw (Error)jjte000; - } finally { - if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -/*@egen*/ - } - - /** Perform - * Perform an action over the join point - **/ - void ExecOnAssign() : - {/*@bgen(jjtree) Perform */ - ASTPerform jjtn000 = new ASTPerform(JJTPERFORM); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1)); -/*@egen*/Token action, begin, end, t;} - {/*@bgen(jjtree) Perform */ - try { -/*@egen*/ - - //[LOOKAHEAD(< IDENTIFIER_NAME > < COLON > ) t=< IDENTIFIER_NAME > < COLON >{jjtThis.setVariable(t.image);} ] - action=getNoReservedIdentifier() - {jjtn000.setAction(action.image);} - //{jjtThis.setCoord(begin,action);} - (/*@bgen(jjtree) FunctionCallParameters */ - { - ASTFunctionCallParameters jjtn001 = new ASTFunctionCallParameters(JJTFUNCTIONCALLPARAMETERS); - boolean jjtc001 = true; - jjtree.openNodeScope(jjtn001); - jjtn001.jjtSetFirstToken(getToken(1)); - } - try { -/*@egen*/ - (TemplateLiteral())/*@bgen(jjtree)*/ - } catch (Throwable jjte001) { - if (jjtc001) { - jjtree.clearNodeScope(jjtn001); - jjtc001 = false; - } else { - jjtree.popNode(); - } - if (jjte001 instanceof RuntimeException) { - throw (RuntimeException)jjte001; - } - if (jjte001 instanceof ParseException) { - throw (ParseException)jjte001; - } - throw (Error)jjte001; - } finally { - if (jjtc001) { - jjtree.closeNodeScope(jjtn001, true); - jjtn001.jjtSetLastToken(getToken(0)); - } - } -/*@egen*/ - | - Arguments() - )/*@bgen(jjtree)*/ - } catch (Throwable jjte000) { - if (jjtc000) { - jjtree.clearNodeScope(jjtn000); - jjtc000 = false; - } else { - jjtree.popNode(); - } - if (jjte000 instanceof RuntimeException) { - throw (RuntimeException)jjte000; - } - if (jjte000 instanceof ParseException) { - throw (ParseException)jjte000; - } - throw (Error)jjte000; - } finally { - if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -/*@egen*/ - } - - -// void CodeLiteralOnlyArgument() #FunctionCallParameters: {} -// { -// TemplateLiteral() -// } - - /** Output - * Similar to Insert, however it is used to output in runtime - **/ - void OutputAct() : - {/*@bgen(jjtree) OutputAct */ - ASTOutputAct jjtn000 = new ASTOutputAct(JJTOUTPUTACT); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1)); -/*@egen*/Token begin;} - {/*@bgen(jjtree) OutputAct */ - try { -/*@egen*/ - begin= - ( - ( - TemplateLiteral() - | - (/*@bgen(jjtree) #CompositeReference(> 1) */ - { - ASTCompositeReference jjtn001 = new ASTCompositeReference(JJTCOMPOSITEREFERENCE); - boolean jjtc001 = true; - jjtree.openNodeScope(jjtn001); - jjtn001.jjtSetFirstToken(getToken(1)); - } - try { -/*@egen*/(Identifier() [LOOKAHEAD(Arguments())Arguments()])/*@bgen(jjtree)*/ - } catch (Throwable jjte001) { - if (jjtc001) { - jjtree.clearNodeScope(jjtn001); - jjtc001 = false; - } else { - jjtree.popNode(); - } - if (jjte001 instanceof RuntimeException) { - throw (RuntimeException)jjte001; - } - if (jjte001 instanceof ParseException) { - throw (ParseException)jjte001; - } - throw (Error)jjte001; - } finally { - if (jjtc001) { - jjtree.closeNodeScope(jjtn001, jjtree.nodeArity() > 1); - jjtn001.jjtSetLastToken(getToken(0)); - } - } -/*@egen*/ ) - ) - | - Arguments() - )/*@bgen(jjtree)*/ - } catch (Throwable jjte000) { - if (jjtc000) { - jjtree.clearNodeScope(jjtn000); - jjtc000 = false; - } else { - jjtree.popNode(); - } - if (jjte000 instanceof RuntimeException) { - throw (RuntimeException)jjte000; - } - if (jjte000 instanceof ParseException) { - throw (ParseException)jjte000; - } - throw (Error)jjte000; - } finally { - if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -/*@egen*/ - //{jjtThis.setCoord(begin,begin);} - } - - /** Define - * Assign a value to a join point attribute - **/ - void Define() : - {/*@bgen(jjtree) Define */ - ASTDefine jjtn000 = new ASTDefine(JJTDEFINE); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1)); -/*@egen*/Token begin;} - {/*@bgen(jjtree) Define */ - try { -/*@egen*/ - begin= - - ( - noReservedIdentifier() AssignmentExpression() - | - Arguments() - )/*@bgen(jjtree)*/ - } catch (Throwable jjte000) { - if (jjtc000) { - jjtree.clearNodeScope(jjtn000); - jjtc000 = false; - } else { - jjtree.popNode(); - } - if (jjte000 instanceof RuntimeException) { - throw (RuntimeException)jjte000; - } - if (jjte000 instanceof ParseException) { - throw (ParseException)jjte000; - } - throw (Error)jjte000; - } finally { - if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -/*@egen*/ - //{jjtThis.setCoord(begin,begin);} - } - - /** Condition - * Boolean expression that verifies if the apply can take place in a join point - **/ - void Condition() : - {/*@bgen(jjtree) Condition */ - ASTCondition jjtn000 = new ASTCondition(JJTCONDITION); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1)); -/*@egen*/Token t,begin, end;} - {/*@bgen(jjtree) Condition */ - try { -/*@egen*/ - [ t= { jjtn000.jjtSetValue(t.image); } ] - begin= [/*@bgen(jjtree) For */ - { - ASTFor jjtn001 = new ASTFor(JJTFOR); - boolean jjtc001 = true; - jjtree.openNodeScope(jjtn001); - jjtn001.jjtSetFirstToken(getToken(1)); - } - try { -/*@egen*/ (Identifier() ( Identifier())* )/*@bgen(jjtree)*/ - } catch (Throwable jjte001) { - if (jjtc001) { - jjtree.clearNodeScope(jjtn001); - jjtc001 = false; - } else { - jjtree.popNode(); - } - if (jjte001 instanceof RuntimeException) { - throw (RuntimeException)jjte001; - } - if (jjte001 instanceof ParseException) { - throw (ParseException)jjte001; - } - throw (Error)jjte001; - } finally { - if (jjtc001) { - jjtree.closeNodeScope(jjtn001, true); - jjtn001.jjtSetLastToken(getToken(0)); - } - } -/*@egen*/ ] - LogicalORExpression() - end=/*@bgen(jjtree)*/ - } catch (Throwable jjte000) { - if (jjtc000) { - jjtree.clearNodeScope(jjtn000); - jjtc000 = false; - } else { - jjtree.popNode(); - } - if (jjte000 instanceof RuntimeException) { - throw (RuntimeException)jjte000; - } - if (jjte000 instanceof ParseException) { - throw (ParseException)jjte000; - } - throw (Error)jjte000; - } finally { - if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -/*@egen*/ - //{jjtThis.setCoord(begin,end);} - } - -/******************************************************************************* - ********************** END OF LARA SYNTACTIC GRAMMAR ********************* - *******************************************************************************/ - - /* The following part of the grammar is the EcmaScript grammar created by The Dojo Foundation (2004-2005), and it was partially updated to conform to the requirements of LARA grammar, such as the use of actions and join point variables. - **/ - - /* Section 11.1: Primary Expressions */ - - void PrimaryExpression() : - {} - { - This() - | ObjectLiteral() - | ArrayLiteral() - | ParenExpression() - | Identifier() - | Literal() -// { return jjtThis; } - } - - void This() : - {/*@bgen(jjtree) ThisReference */ - ASTThisReference jjtn000 = new ASTThisReference(JJTTHISREFERENCE); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1)); -/*@egen*/} - {/*@bgen(jjtree) ThisReference */ - try { -/*@egen*//*@bgen(jjtree) ThisReference */ - { - ASTThisReference jjtn001 = new ASTThisReference(JJTTHISREFERENCE); - boolean jjtc001 = true; - jjtree.openNodeScope(jjtn001); - jjtn001.jjtSetFirstToken(getToken(1)); - } - try { -/*@egen*/ - "this"/*@bgen(jjtree)*/ - } finally { - if (jjtc001) { - jjtree.closeNodeScope(jjtn001, true); - jjtn001.jjtSetLastToken(getToken(0)); - } - } -/*@egen*/ /*@bgen(jjtree)*/ - } finally { - if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -/*@egen*/ - - } - - void ParenExpression() : - {/*@bgen(jjtree) ParenExpression */ - ASTParenExpression jjtn000 = new ASTParenExpression(JJTPARENEXPRESSION); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1)); -/*@egen*/} - {/*@bgen(jjtree) ParenExpression */ - try { -/*@egen*/ - "(" Expression() ")"/*@bgen(jjtree)*/ - } catch (Throwable jjte000) { - if (jjtc000) { - jjtree.clearNodeScope(jjtn000); - jjtc000 = false; - } else { - jjtree.popNode(); - } - if (jjte000 instanceof RuntimeException) { - throw (RuntimeException)jjte000; - } - if (jjte000 instanceof ParseException) { - throw (ParseException)jjte000; - } - throw (Error)jjte000; - } finally { - if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -/*@egen*/ - } - - /* Section 7.8: Literals */ - - void Literal() : - {/*@bgen(jjtree) Literal */ - ASTLiteral jjtn000 = new ASTLiteral(JJTLITERAL); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1)); -/*@egen*/ - Token t; - Map objLiteral; - List arrayLiteral; - } - {/*@bgen(jjtree) Literal */ - try { -/*@egen*/ - t = /*@bgen(jjtree)*/ - { - jjtree.closeNodeScope(jjtn000, true); - jjtc000 = false; - jjtn000.jjtSetLastToken(getToken(0)); - } -/*@egen*/ - { - jjtn000.setDecimalValue(t.image); - if(t.image.contains(".")) - jjtn000.setType(Types.Float); - else jjtn000.setType(Types.Int); - } - | - t = /*@bgen(jjtree)*/ - { - jjtree.closeNodeScope(jjtn000, true); - jjtc000 = false; - jjtn000.jjtSetLastToken(getToken(0)); - } -/*@egen*/ - { - jjtn000.setHexValue(t.image); - jjtn000.setType(Types.Int); - } - | - t = /*@bgen(jjtree)*/ - { - jjtree.closeNodeScope(jjtn000, true); - jjtc000 = false; - jjtn000.jjtSetLastToken(getToken(0)); - } -/*@egen*/ - { - jjtn000.setStringValue(t.image); - jjtn000.setType(Types.String); - } - | - t = /*@bgen(jjtree)*/ - { - jjtree.closeNodeScope(jjtn000, true); - jjtc000 = false; - jjtn000.jjtSetLastToken(getToken(0)); - } -/*@egen*/ - { - jjtn000.setBooleanValue(t.image); - jjtn000.setType(Types.Boolean); - } - | - t = /*@bgen(jjtree)*/ - { - jjtree.closeNodeScope(jjtn000, true); - jjtc000 = false; - jjtn000.jjtSetLastToken(getToken(0)); - } -/*@egen*/ - { - jjtn000.setNullValue(); - jjtn000.setType(Types.Null); - } - | - t = /*@bgen(jjtree)*/ - { - jjtree.closeNodeScope(jjtn000, true); - jjtc000 = false; - jjtn000.jjtSetLastToken(getToken(0)); - } -/*@egen*/ - { - jjtn000.setRegexValue(t.image); - jjtn000.setType(Types.RegEx); - } - | - t = /*@bgen(jjtree)*/ - { - jjtree.closeNodeScope(jjtn000, true); - jjtc000 = false; - jjtn000.jjtSetLastToken(getToken(0)); - } -/*@egen*/ - { - jjtn000.setCodeValue(t.image); - jjtn000.setType(Types.Code); - }/*@bgen(jjtree)*/ - } finally { - if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -/*@egen*/ - } - - void TemplateLiteral() : - {/*@bgen(jjtree) Literal */ - ASTLiteral jjtn000 = new ASTLiteral(JJTLITERAL); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1)); -/*@egen*/ - Token t; - } - {/*@bgen(jjtree) Literal */ - try { -/*@egen*/ - t = /*@bgen(jjtree)*/ - { - jjtree.closeNodeScope(jjtn000, true); - jjtc000 = false; - jjtn000.jjtSetLastToken(getToken(0)); - } -/*@egen*/ - { - jjtn000.setStringValue(t.image); - jjtn000.setType(Types.String); - } - | - t = /*@bgen(jjtree)*/ - { - jjtree.closeNodeScope(jjtn000, true); - jjtc000 = false; - jjtn000.jjtSetLastToken(getToken(0)); - } -/*@egen*/ - { - jjtn000.setCodeValue(t.image); - jjtn000.setType(Types.Code); - }/*@bgen(jjtree)*/ - } finally { - if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -/*@egen*/ - } - - - void Identifier() : - {/*@bgen(jjtree) Identifier */ - ASTIdentifier jjtn000 = new ASTIdentifier(JJTIDENTIFIER); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1)); -/*@egen*/ - Token t; - } - {/*@bgen(jjtree) Identifier */ - try { -/*@egen*/ - t=/*@bgen(jjtree)*/ - { - jjtree.closeNodeScope(jjtn000, true); - jjtc000 = false; - jjtn000.jjtSetLastToken(getToken(0)); - } -/*@egen*/ - { - jjtn000.setName(t.image);jjtn000.jjtSetValue(t.image); - /*{jjtThis.setCoord(t,t); }*/ - }/*@bgen(jjtree)*/ - } finally { - if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -/*@egen*/ - } - - - void LabelIdentifier() : - {/*@bgen(jjtree) Identifier */ - ASTIdentifier jjtn000 = new ASTIdentifier(JJTIDENTIFIER); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1)); -/*@egen*/ - Token t; - } - {/*@bgen(jjtree) Identifier */ - try { -/*@egen*/ - ( - t= | t=< IDENTIFIER_NAME>)/*@bgen(jjtree)*/ - { - jjtree.closeNodeScope(jjtn000, true); - jjtc000 = false; - jjtn000.jjtSetLastToken(getToken(0)); - } -/*@egen*/ - { - jjtn000.setName(t.image);jjtn000.jjtSetValue(t.image); - /*{jjtThis.setCoord(t,t); }*/ - }/*@bgen(jjtree)*/ - } finally { - if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -/*@egen*/ - } - - /* Section 11.1.4: Array Initialiser */ - - void ArrayLiteral() : - {/*@bgen(jjtree) ArrayLiteral */ - ASTArrayLiteral jjtn000 = new ASTArrayLiteral(JJTARRAYLITERAL); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1)); -/*@egen*/} - {/*@bgen(jjtree) ArrayLiteral */ - try { -/*@egen*/ - "[" ( - (ElisionFirst())? - ( - ElementList() - //LOOKAHEAD(ElementList() Elision()) ElementList() Elision() - //| ( ElementList() )? - )? - ) "]"/*@bgen(jjtree)*/ - } catch (Throwable jjte000) { - if (jjtc000) { - jjtree.clearNodeScope(jjtn000); - jjtc000 = false; - } else { - jjtree.popNode(); - } - if (jjte000 instanceof RuntimeException) { - throw (RuntimeException)jjte000; - } - if (jjte000 instanceof ParseException) { - throw (ParseException)jjte000; - } - throw (Error)jjte000; - } finally { - if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -/*@egen*/ - } - - - - void ElementList() : - {} - { - AssignmentExpression() - - ( LOOKAHEAD(2) - Elision() AssignmentExpression() )* [Elision()] - //(Elision() AssignmentExpression() )* - //(Elision())? - } - - void Elision() : - {} - { - (",") - [/*@bgen(jjtree) EmptyPositions */ - { - ASTEmptyPositions jjtn001 = new ASTEmptyPositions(JJTEMPTYPOSITIONS); - boolean jjtc001 = true; - jjtree.openNodeScope(jjtn001); - jjtn001.jjtSetFirstToken(getToken(1)); - } - try { -/*@egen*/("," {jjtn001.inc();})+/*@bgen(jjtree)*/ - } finally { - if (jjtc001) { - jjtree.closeNodeScope(jjtn001, true); - jjtn001.jjtSetLastToken(getToken(0)); - } - } -/*@egen*/ ] - } - - - void ElisionFirst() : - {/*@bgen(jjtree) EmptyPositions */ - ASTEmptyPositions jjtn000 = new ASTEmptyPositions(JJTEMPTYPOSITIONS); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1)); -/*@egen*/} - {/*@bgen(jjtree) EmptyPositions */ - try { -/*@egen*/ - (","){jjtn000.inc();} - [("," {jjtn000.inc();})+ ]/*@bgen(jjtree)*/ - } finally { - if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -/*@egen*/ - } - - /* Section 11.1.5: Object Initialiser */ - - void ObjectLiteral() : - {/*@bgen(jjtree) ObjectLiteral */ - ASTObjectLiteral jjtn000 = new ASTObjectLiteral(JJTOBJECTLITERAL); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1)); -/*@egen*/} - {/*@bgen(jjtree) ObjectLiteral */ - try { -/*@egen*/ - < LBRACE > {exprBraceCount++;} - ( PropertyNameAndValueList() )? - < RBRACE >/*@bgen(jjtree)*/ - { - jjtree.closeNodeScope(jjtn000, true); - jjtc000 = false; - jjtn000.jjtSetLastToken(getToken(0)); - } -/*@egen*/ {exprBraceCount--;}/*@bgen(jjtree)*/ - } catch (Throwable jjte000) { - if (jjtc000) { - jjtree.clearNodeScope(jjtn000); - jjtc000 = false; - } else { - jjtree.popNode(); - } - if (jjte000 instanceof RuntimeException) { - throw (RuntimeException)jjte000; - } - if (jjte000 instanceof ParseException) { - throw (ParseException)jjte000; - } - throw (Error)jjte000; - } finally { - if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -/*@egen*/ - } - - void PropertyNameAndValueList() : - {} - { - - PropertyNameAndValue() ( LOOKAHEAD( "," PropertyNameAndValue()) "," PropertyNameAndValue() | "," )* - } - - void PropertyNameAndValue() : - {/*@bgen(jjtree) LiteralField */ - ASTLiteralField jjtn000 = new ASTLiteralField(JJTLITERALFIELD); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1)); -/*@egen*/} - {/*@bgen(jjtree) LiteralField */ - try { -/*@egen*/ - PropertyName() ":" AssignmentExpression()/*@bgen(jjtree)*/ - } catch (Throwable jjte000) { - if (jjtc000) { - jjtree.clearNodeScope(jjtn000); - jjtc000 = false; - } else { - jjtree.popNode(); - } - if (jjte000 instanceof RuntimeException) { - throw (RuntimeException)jjte000; - } - if (jjte000 instanceof ParseException) { - throw (ParseException)jjte000; - } - throw (Error)jjte000; - } finally { - if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -/*@egen*/ - } - - void PropertyName() : - {} - { - noReservedIdentifier() - | - Literal() - /* OLD - Identifier() - | - #Literal - | - #Literal - */ - } - - - /* Section 11.2: Left-Hand-Side Expressions */ - - void MemberExpression() : - {} - {/*@bgen(jjtree) #CompositeReference(> 1) */ - { - ASTCompositeReference jjtn001 = new ASTCompositeReference(JJTCOMPOSITEREFERENCE); - boolean jjtc001 = true; - jjtree.openNodeScope(jjtn001); - jjtn001.jjtSetFirstToken(getToken(1)); - } - try { -/*@egen*/ - ( ( - LOOKAHEAD("function*") GeneratorFunctionExpression() | - LOOKAHEAD("function") FunctionExpression() | - LOOKAHEAD(ArrowFunctionExpression()) ArrowFunctionExpression() | - PrimaryExpression() - ) (LOOKAHEAD(2) MemberExpressionPart())* )/*@bgen(jjtree)*/ - } catch (Throwable jjte001) { - if (jjtc001) { - jjtree.clearNodeScope(jjtn001); - jjtc001 = false; - } else { - jjtree.popNode(); - } - if (jjte001 instanceof RuntimeException) { - throw (RuntimeException)jjte001; - } - if (jjte001 instanceof ParseException) { - throw (ParseException)jjte001; - } - throw (Error)jjte001; - } finally { - if (jjtc001) { - jjtree.closeNodeScope(jjtn001, jjtree.nodeArity() > 1); - jjtn001.jjtSetLastToken(getToken(0)); - } - } -/*@egen*/ - | AllocationExpression() - } - - void MemberExpressionForIn() : - {} - {/*@bgen(jjtree) #CompositeReference(> 1) */ - { - ASTCompositeReference jjtn001 = new ASTCompositeReference(JJTCOMPOSITEREFERENCE); - boolean jjtc001 = true; - jjtree.openNodeScope(jjtn001); - jjtn001.jjtSetFirstToken(getToken(1)); - } - try { -/*@egen*/ - ( ( - LOOKAHEAD("function*") GeneratorFunctionExpression() | - LOOKAHEAD("function") FunctionExpression() | - LOOKAHEAD(ArrowFunctionExpression()) ArrowFunctionExpression() | - PrimaryExpression() - ) (LOOKAHEAD(2) MemberExpressionPart())* )/*@bgen(jjtree)*/ - } catch (Throwable jjte001) { - if (jjtc001) { - jjtree.clearNodeScope(jjtn001); - jjtc001 = false; - } else { - jjtree.popNode(); - } - if (jjte001 instanceof RuntimeException) { - throw (RuntimeException)jjte001; - } - if (jjte001 instanceof ParseException) { - throw (ParseException)jjte001; - } - throw (Error)jjte001; - } finally { - if (jjtc001) { - jjtree.closeNodeScope(jjtn001, jjtree.nodeArity() > 1); - jjtn001.jjtSetLastToken(getToken(0)); - } - } -/*@egen*/ - } - - void AllocationExpression() : - {/*@bgen(jjtree) AllocationExpression */ - ASTAllocationExpression jjtn000 = new ASTAllocationExpression(JJTALLOCATIONEXPRESSION); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1)); -/*@egen*/} - {/*@bgen(jjtree) AllocationExpression */ - try { -/*@egen*//*@bgen(jjtree) #CompositeReference(> 1) */ - { - ASTCompositeReference jjtn001 = new ASTCompositeReference(JJTCOMPOSITEREFERENCE); - boolean jjtc001 = true; - jjtree.openNodeScope(jjtn001); - jjtn001.jjtSetFirstToken(getToken(1)); - } - try { -/*@egen*/ - ( "new" MemberExpression() ( (LOOKAHEAD(Arguments()) Arguments() (LOOKAHEAD(2) MemberExpressionPart())* ) * ) )/*@bgen(jjtree)*/ - } catch (Throwable jjte001) { - if (jjtc001) { - jjtree.clearNodeScope(jjtn001); - jjtc001 = false; - } else { - jjtree.popNode(); - } - if (jjte001 instanceof RuntimeException) { - throw (RuntimeException)jjte001; - } - if (jjte001 instanceof ParseException) { - throw (ParseException)jjte001; - } - throw (Error)jjte001; - } finally { - if (jjtc001) { - jjtree.closeNodeScope(jjtn001, jjtree.nodeArity() > 1); - jjtn001.jjtSetLastToken(getToken(0)); - } - } -/*@egen*/ /*@bgen(jjtree)*/ - } catch (Throwable jjte000) { - if (jjtc000) { - jjtree.clearNodeScope(jjtn000); - jjtc000 = false; - } else { - jjtree.popNode(); - } - if (jjte000 instanceof RuntimeException) { - throw (RuntimeException)jjte000; - } - if (jjte000 instanceof ParseException) { - throw (ParseException)jjte000; - } - throw (Error)jjte000; - } finally { - if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -/*@egen*/ - } - - void MemberExpressionPart() : - {} - {/*@bgen(jjtree) PropertyValueReference */ - { - ASTPropertyValueReference jjtn001 = new ASTPropertyValueReference(JJTPROPERTYVALUEREFERENCE); - boolean jjtc001 = true; - jjtree.openNodeScope(jjtn001); - jjtn001.jjtSetFirstToken(getToken(1)); - } - try { -/*@egen*/ - ( ("[" Expression() "]") | (< LBRACE > {exprBraceCount++;} Expression() < RBRACE >/*@bgen(jjtree)*/ - { - jjtree.closeNodeScope(jjtn001, true); - jjtc001 = false; - jjtn001.jjtSetLastToken(getToken(0)); - } -/*@egen*/ {exprBraceCount--;}))/*@bgen(jjtree)*/ - } catch (Throwable jjte001) { - if (jjtc001) { - jjtree.clearNodeScope(jjtn001); - jjtc001 = false; - } else { - jjtree.popNode(); - } - if (jjte001 instanceof RuntimeException) { - throw (RuntimeException)jjte001; - } - if (jjte001 instanceof ParseException) { - throw (ParseException)jjte001; - } - throw (Error)jjte001; - } finally { - if (jjtc001) { - jjtree.closeNodeScope(jjtn001, true); - jjtn001.jjtSetLastToken(getToken(0)); - } - } -/*@egen*/ |/*@bgen(jjtree) PropertyIdentifierReference */ - { - ASTPropertyIdentifierReference jjtn002 = new ASTPropertyIdentifierReference(JJTPROPERTYIDENTIFIERREFERENCE); - boolean jjtc002 = true; - jjtree.openNodeScope(jjtn002); - jjtn002.jjtSetFirstToken(getToken(1)); - } - try { -/*@egen*/ ( "." (noReservedIdentifier()))/*@bgen(jjtree)*/ - } catch (Throwable jjte002) { - if (jjtc002) { - jjtree.clearNodeScope(jjtn002); - jjtc002 = false; - } else { - jjtree.popNode(); - } - if (jjte002 instanceof RuntimeException) { - throw (RuntimeException)jjte002; - } - if (jjte002 instanceof ParseException) { - throw (ParseException)jjte002; - } - throw (Error)jjte002; - } finally { - if (jjtc002) { - jjtree.closeNodeScope(jjtn002, true); - jjtn002.jjtSetLastToken(getToken(0)); - } - } -/*@egen*/ - - } - - void CallExpression() : - {/*@bgen(jjtree) #CompositeReference(> 1) */ - ASTCompositeReference jjtn000 = new ASTCompositeReference(JJTCOMPOSITEREFERENCE); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1)); -/*@egen*/} - {/*@bgen(jjtree) #CompositeReference(> 1) */ - try { -/*@egen*/ - MemberExpression() Arguments() ( LOOKAHEAD(2) CallExpressionPart() )*/*@bgen(jjtree)*/ - } catch (Throwable jjte000) { - if (jjtc000) { - jjtree.clearNodeScope(jjtn000); - jjtc000 = false; - } else { - jjtree.popNode(); - } - if (jjte000 instanceof RuntimeException) { - throw (RuntimeException)jjte000; - } - if (jjte000 instanceof ParseException) { - throw (ParseException)jjte000; - } - throw (Error)jjte000; - } finally { - if (jjtc000) { - jjtree.closeNodeScope(jjtn000, jjtree.nodeArity() > 1); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -/*@egen*/ - } - - void CallExpressionForIn() : - {/*@bgen(jjtree) #CompositeReference(> 1) */ - ASTCompositeReference jjtn000 = new ASTCompositeReference(JJTCOMPOSITEREFERENCE); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1)); -/*@egen*/} - {/*@bgen(jjtree) #CompositeReference(> 1) */ - try { -/*@egen*/ - MemberExpressionForIn() Arguments() ( LOOKAHEAD(2) CallExpressionPart() )*/*@bgen(jjtree)*/ - } catch (Throwable jjte000) { - if (jjtc000) { - jjtree.clearNodeScope(jjtn000); - jjtc000 = false; - } else { - jjtree.popNode(); - } - if (jjte000 instanceof RuntimeException) { - throw (RuntimeException)jjte000; - } - if (jjte000 instanceof ParseException) { - throw (ParseException)jjte000; - } - throw (Error)jjte000; - } finally { - if (jjtc000) { - jjtree.closeNodeScope(jjtn000, jjtree.nodeArity() > 1); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -/*@egen*/ - } - - void CallExpressionPart() : - {} - { - Arguments() |/*@bgen(jjtree) PropertyValueReference */ - { - ASTPropertyValueReference jjtn001 = new ASTPropertyValueReference(JJTPROPERTYVALUEREFERENCE); - boolean jjtc001 = true; - jjtree.openNodeScope(jjtn001); - jjtn001.jjtSetFirstToken(getToken(1)); - } - try { -/*@egen*/ ( "[" Expression() "]" )/*@bgen(jjtree)*/ - } catch (Throwable jjte001) { - if (jjtc001) { - jjtree.clearNodeScope(jjtn001); - jjtc001 = false; - } else { - jjtree.popNode(); - } - if (jjte001 instanceof RuntimeException) { - throw (RuntimeException)jjte001; - } - if (jjte001 instanceof ParseException) { - throw (ParseException)jjte001; - } - throw (Error)jjte001; - } finally { - if (jjtc001) { - jjtree.closeNodeScope(jjtn001, true); - jjtn001.jjtSetLastToken(getToken(0)); - } - } -/*@egen*/ |/*@bgen(jjtree) PropertyIdentifierReference */ - { - ASTPropertyIdentifierReference jjtn002 = new ASTPropertyIdentifierReference(JJTPROPERTYIDENTIFIERREFERENCE); - boolean jjtc002 = true; - jjtree.openNodeScope(jjtn002); - jjtn002.jjtSetFirstToken(getToken(1)); - } - try { -/*@egen*/ ( "." noReservedIdentifier() )/*@bgen(jjtree)*/ - } catch (Throwable jjte002) { - if (jjtc002) { - jjtree.clearNodeScope(jjtn002); - jjtc002 = false; - } else { - jjtree.popNode(); - } - if (jjte002 instanceof RuntimeException) { - throw (RuntimeException)jjte002; - } - if (jjte002 instanceof ParseException) { - throw (ParseException)jjte002; - } - throw (Error)jjte002; - } finally { - if (jjtc002) { - jjtree.closeNodeScope(jjtn002, true); - jjtn002.jjtSetLastToken(getToken(0)); - } - } -/*@egen*/ - } - - void Arguments() : - {/*@bgen(jjtree) FunctionCallParameters */ - ASTFunctionCallParameters jjtn000 = new ASTFunctionCallParameters(JJTFUNCTIONCALLPARAMETERS); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1)); -/*@egen*/} - {/*@bgen(jjtree) FunctionCallParameters */ - try { -/*@egen*/ - "(" (LOOKAHEAD(getNoReservedIdentifier() ) (NamedArgumentList(){ jjtn000.areNamed = true;}) - | ArgumentList())? ")"/*@bgen(jjtree)*/ - } catch (Throwable jjte000) { - if (jjtc000) { - jjtree.clearNodeScope(jjtn000); - jjtc000 = false; - } else { - jjtree.popNode(); - } - if (jjte000 instanceof RuntimeException) { - throw (RuntimeException)jjte000; - } - if (jjte000 instanceof ParseException) { - throw (ParseException)jjte000; - } - throw (Error)jjte000; - } finally { - if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -/*@egen*/ - } - - void NamedArgumentList() : - {} - { - NamedArgument() ( NamedArgument())* - } - - void NamedArgument() : - {/*@bgen(jjtree) NamedArgument */ - ASTNamedArgument jjtn000 = new ASTNamedArgument(JJTNAMEDARGUMENT); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1)); -/*@egen*/Token argument;} - {/*@bgen(jjtree) NamedArgument */ - try { -/*@egen*/ - argument=getNoReservedIdentifier() {jjtn000.jjtSetValue(argument.image);} - AssignmentExpression()/*@bgen(jjtree)*/ - } catch (Throwable jjte000) { - if (jjtc000) { - jjtree.clearNodeScope(jjtn000); - jjtc000 = false; - } else { - jjtree.popNode(); - } - if (jjte000 instanceof RuntimeException) { - throw (RuntimeException)jjte000; - } - if (jjte000 instanceof ParseException) { - throw (ParseException)jjte000; - } - throw (Error)jjte000; - } finally { - if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -/*@egen*/ - } - void ArgumentList() : - {} - { - AssignmentExpression() ("," AssignmentExpression())* - } - - - void LeftHandSideExpression() : - {} - { - LOOKAHEAD(MemberExpression() "(") CallExpression() | MemberExpression() - } - - - void LeftHandSideExpressionForIn() : - {} - { - LOOKAHEAD(CallExpression()) CallExpressionForIn() | MemberExpressionForIn() - } - - /* Section 11.3 Postfix Expressions */ - - void PostfixExpression() : - {/*@bgen(jjtree) #PostfixExpression(> 1) */ - ASTPostfixExpression jjtn000 = new ASTPostfixExpression(JJTPOSTFIXEXPRESSION); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1)); -/*@egen*/} - {/*@bgen(jjtree) #PostfixExpression(> 1) */ - try { -/*@egen*/ - LeftHandSideExpression() [ LOOKAHEAD(1) PostfixOperator() ]/*@bgen(jjtree)*/ - } catch (Throwable jjte000) { - if (jjtc000) { - jjtree.clearNodeScope(jjtn000); - jjtc000 = false; - } else { - jjtree.popNode(); - } - if (jjte000 instanceof RuntimeException) { - throw (RuntimeException)jjte000; - } - if (jjte000 instanceof ParseException) { - throw (ParseException)jjte000; - } - throw (Error)jjte000; - } finally { - if (jjtc000) { - jjtree.closeNodeScope(jjtn000, jjtree.nodeArity() > 1); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -/*@egen*/ - } - - void PostfixOperator() : - {/*@bgen(jjtree) Operator */ - ASTOperator jjtn000 = new ASTOperator(JJTOPERATOR); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1)); -/*@egen*/Token op;} - {/*@bgen(jjtree) Operator */ - try { -/*@egen*/ - ( op="++" | op="--")/*@bgen(jjtree)*/ - { - jjtree.closeNodeScope(jjtn000, true); - jjtc000 = false; - jjtn000.jjtSetLastToken(getToken(0)); - } -/*@egen*/ - { jjtn000.jjtSetValue(op.image); }/*@bgen(jjtree)*/ - } finally { - if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -/*@egen*/ - } - - - /* Section 11.4 Unary Operators */ - - void UnaryExpression() : - {/*@bgen(jjtree) #UnaryExpression(> 1) */ - ASTUnaryExpression jjtn000 = new ASTUnaryExpression(JJTUNARYEXPRESSION); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1)); -/*@egen*/} - {/*@bgen(jjtree) #UnaryExpression(> 1) */ - try { -/*@egen*/ - PostfixExpression() | ( UnaryOperator() UnaryExpression() )/*@bgen(jjtree)*/ - } catch (Throwable jjte000) { - if (jjtc000) { - jjtree.clearNodeScope(jjtn000); - jjtc000 = false; - } else { - jjtree.popNode(); - } - if (jjte000 instanceof RuntimeException) { - throw (RuntimeException)jjte000; - } - if (jjte000 instanceof ParseException) { - throw (ParseException)jjte000; - } - throw (Error)jjte000; - } finally { - if (jjtc000) { - jjtree.closeNodeScope(jjtn000, jjtree.nodeArity() > 1); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -/*@egen*/ - } - - void UnaryOperator() : - {/*@bgen(jjtree) Operator */ - ASTOperator jjtn000 = new ASTOperator(JJTOPERATOR); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1)); -/*@egen*/Token op;} - {/*@bgen(jjtree) Operator */ - try { -/*@egen*/ - (op="delete" | op="void" | op="typeof" | op="++" | op="--" | op="+" | op="-" | op="~" | op="!")/*@bgen(jjtree)*/ - { - jjtree.closeNodeScope(jjtn000, true); - jjtc000 = false; - jjtn000.jjtSetLastToken(getToken(0)); - } -/*@egen*/ - { jjtn000.jjtSetValue(op.image);}/*@bgen(jjtree)*/ - } finally { - if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -/*@egen*/ - } - - - /* Section 11.5: Multiplicative Operators */ - - - void MultiplicativeExpression() : - {/*@bgen(jjtree) #BinaryExpressionSequence(> 1) */ - ASTBinaryExpressionSequence jjtn000 = new ASTBinaryExpressionSequence(JJTBINARYEXPRESSIONSEQUENCE); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1)); -/*@egen*/} - {/*@bgen(jjtree) #BinaryExpressionSequence(> 1) */ - try { -/*@egen*/ - UnaryExpression() ( MultiplicativeOperator() UnaryExpression() )*/*@bgen(jjtree)*/ - } catch (Throwable jjte000) { - if (jjtc000) { - jjtree.clearNodeScope(jjtn000); - jjtc000 = false; - } else { - jjtree.popNode(); - } - if (jjte000 instanceof RuntimeException) { - throw (RuntimeException)jjte000; - } - if (jjte000 instanceof ParseException) { - throw (ParseException)jjte000; - } - throw (Error)jjte000; - } finally { - if (jjtc000) { - jjtree.closeNodeScope(jjtn000, jjtree.nodeArity() > 1); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -/*@egen*/ - } - - - void MultiplicativeOperator() : - {/*@bgen(jjtree) Operator */ - ASTOperator jjtn000 = new ASTOperator(JJTOPERATOR); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1)); -/*@egen*/Token op;} - {/*@bgen(jjtree) Operator */ - try { -/*@egen*/ - (op="*" | op= | op="%")/*@bgen(jjtree)*/ - { - jjtree.closeNodeScope(jjtn000, true); - jjtc000 = false; - jjtn000.jjtSetLastToken(getToken(0)); - } -/*@egen*/ { jjtn000.jjtSetValue(op.image);}/*@bgen(jjtree)*/ - } finally { - if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -/*@egen*/ - } - - /* Section 11.6: Additive Operators */ - - void AdditiveExpression() : - {/*@bgen(jjtree) #BinaryExpressionSequence(> 1) */ - ASTBinaryExpressionSequence jjtn000 = new ASTBinaryExpressionSequence(JJTBINARYEXPRESSIONSEQUENCE); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1)); -/*@egen*/} - {/*@bgen(jjtree) #BinaryExpressionSequence(> 1) */ - try { -/*@egen*/ - MultiplicativeExpression() ( LOOKAHEAD(1) AdditiveOperator() MultiplicativeExpression())*/*@bgen(jjtree)*/ - } catch (Throwable jjte000) { - if (jjtc000) { - jjtree.clearNodeScope(jjtn000); - jjtc000 = false; - } else { - jjtree.popNode(); - } - if (jjte000 instanceof RuntimeException) { - throw (RuntimeException)jjte000; - } - if (jjte000 instanceof ParseException) { - throw (ParseException)jjte000; - } - throw (Error)jjte000; - } finally { - if (jjtc000) { - jjtree.closeNodeScope(jjtn000, jjtree.nodeArity() > 1); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -/*@egen*/ - } - - void AdditiveOperator() : - {/*@bgen(jjtree) Operator */ - ASTOperator jjtn000 = new ASTOperator(JJTOPERATOR); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1)); -/*@egen*/Token op;} - {/*@bgen(jjtree) Operator */ - try { -/*@egen*/ - (op="+" | op="-")/*@bgen(jjtree)*/ - { - jjtree.closeNodeScope(jjtn000, true); - jjtc000 = false; - jjtn000.jjtSetLastToken(getToken(0)); - } -/*@egen*/ { jjtn000.jjtSetValue(op.image);}/*@bgen(jjtree)*/ - } finally { - if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -/*@egen*/ - } - - - /* Section 11.7: Bitwise Shift Operators */ - - void ShiftExpression() : - {/*@bgen(jjtree) #BinaryExpressionSequence(> 1) */ - ASTBinaryExpressionSequence jjtn000 = new ASTBinaryExpressionSequence(JJTBINARYEXPRESSIONSEQUENCE); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1)); -/*@egen*/} - {/*@bgen(jjtree) #BinaryExpressionSequence(> 1) */ - try { -/*@egen*/ - AdditiveExpression() ( ShiftOperator() AdditiveExpression() )*/*@bgen(jjtree)*/ - } catch (Throwable jjte000) { - if (jjtc000) { - jjtree.clearNodeScope(jjtn000); - jjtc000 = false; - } else { - jjtree.popNode(); - } - if (jjte000 instanceof RuntimeException) { - throw (RuntimeException)jjte000; - } - if (jjte000 instanceof ParseException) { - throw (ParseException)jjte000; - } - throw (Error)jjte000; - } finally { - if (jjtc000) { - jjtree.closeNodeScope(jjtn000, jjtree.nodeArity() > 1); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -/*@egen*/ - } - - void ShiftOperator() : - {/*@bgen(jjtree) Operator */ - ASTOperator jjtn000 = new ASTOperator(JJTOPERATOR); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1)); -/*@egen*/Token op;} - {/*@bgen(jjtree) Operator */ - try { -/*@egen*/ - (op="<<" | op=">>" | op=">>>")/*@bgen(jjtree)*/ - { - jjtree.closeNodeScope(jjtn000, true); - jjtc000 = false; - jjtn000.jjtSetLastToken(getToken(0)); - } -/*@egen*/ - { jjtn000.jjtSetValue(op.image); }/*@bgen(jjtree)*/ - } finally { - if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -/*@egen*/ - } - - /* Section 11.4: Relational Operators */ - - void RelationalExpression() : - {/*@bgen(jjtree) #BinaryExpressionSequence(> 1) */ - ASTBinaryExpressionSequence jjtn000 = new ASTBinaryExpressionSequence(JJTBINARYEXPRESSIONSEQUENCE); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1)); -/*@egen*/} - {/*@bgen(jjtree) #BinaryExpressionSequence(> 1) */ - try { -/*@egen*/ - ShiftExpression() ( RelationalOperator() ShiftExpression() )*/*@bgen(jjtree)*/ - } catch (Throwable jjte000) { - if (jjtc000) { - jjtree.clearNodeScope(jjtn000); - jjtc000 = false; - } else { - jjtree.popNode(); - } - if (jjte000 instanceof RuntimeException) { - throw (RuntimeException)jjte000; - } - if (jjte000 instanceof ParseException) { - throw (ParseException)jjte000; - } - throw (Error)jjte000; - } finally { - if (jjtc000) { - jjtree.closeNodeScope(jjtn000, jjtree.nodeArity() > 1); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -/*@egen*/ - } - - void RelationalOperator() : - {/*@bgen(jjtree) Operator */ - ASTOperator jjtn000 = new ASTOperator(JJTOPERATOR); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1)); -/*@egen*/Token op;} - {/*@bgen(jjtree) Operator */ - try { -/*@egen*/ - (op="<" | op=">" | op="<=" | op=">=" | op="instanceof" | op="in")/*@bgen(jjtree)*/ - { - jjtree.closeNodeScope(jjtn000, true); - jjtc000 = false; - jjtn000.jjtSetLastToken(getToken(0)); - } -/*@egen*/ - { jjtn000.jjtSetValue(op.image); }/*@bgen(jjtree)*/ - } finally { - if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -/*@egen*/ - } - - void RelationalExpressionNoIn() : - {/*@bgen(jjtree) #BinaryExpressionSequence(> 1) */ - ASTBinaryExpressionSequence jjtn000 = new ASTBinaryExpressionSequence(JJTBINARYEXPRESSIONSEQUENCE); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1)); -/*@egen*/} - {/*@bgen(jjtree) #BinaryExpressionSequence(> 1) */ - try { -/*@egen*/ - ShiftExpression() ( RelationalNoInOperator() ShiftExpression() )*/*@bgen(jjtree)*/ - } catch (Throwable jjte000) { - if (jjtc000) { - jjtree.clearNodeScope(jjtn000); - jjtc000 = false; - } else { - jjtree.popNode(); - } - if (jjte000 instanceof RuntimeException) { - throw (RuntimeException)jjte000; - } - if (jjte000 instanceof ParseException) { - throw (ParseException)jjte000; - } - throw (Error)jjte000; - } finally { - if (jjtc000) { - jjtree.closeNodeScope(jjtn000, jjtree.nodeArity() > 1); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -/*@egen*/ - } - - - void RelationalNoInOperator() : - {/*@bgen(jjtree) Operator */ - ASTOperator jjtn000 = new ASTOperator(JJTOPERATOR); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1)); -/*@egen*/Token op;} - {/*@bgen(jjtree) Operator */ - try { -/*@egen*/ - (op="<" | op=">" | op="<=" | op=">=" | op="instanceof")/*@bgen(jjtree)*/ - { - jjtree.closeNodeScope(jjtn000, true); - jjtc000 = false; - jjtn000.jjtSetLastToken(getToken(0)); - } -/*@egen*/ - { jjtn000.jjtSetValue(op.image); }/*@bgen(jjtree)*/ - } finally { - if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -/*@egen*/ - } - - /* Section 11.9: Equality Operators */ - - void EqualityExpression() : - {/*@bgen(jjtree) #BinaryExpressionSequence(> 1) */ - ASTBinaryExpressionSequence jjtn000 = new ASTBinaryExpressionSequence(JJTBINARYEXPRESSIONSEQUENCE); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1)); -/*@egen*/} - {/*@bgen(jjtree) #BinaryExpressionSequence(> 1) */ - try { -/*@egen*/ - RelationalExpression() ( EqualityOperator() RelationalExpression() )*/*@bgen(jjtree)*/ - } catch (Throwable jjte000) { - if (jjtc000) { - jjtree.clearNodeScope(jjtn000); - jjtc000 = false; - } else { - jjtree.popNode(); - } - if (jjte000 instanceof RuntimeException) { - throw (RuntimeException)jjte000; - } - if (jjte000 instanceof ParseException) { - throw (ParseException)jjte000; - } - throw (Error)jjte000; - } finally { - if (jjtc000) { - jjtree.closeNodeScope(jjtn000, jjtree.nodeArity() > 1); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -/*@egen*/ - } - - void EqualityExpressionNoIn() : - {/*@bgen(jjtree) #BinaryExpressionSequence(> 1) */ - ASTBinaryExpressionSequence jjtn000 = new ASTBinaryExpressionSequence(JJTBINARYEXPRESSIONSEQUENCE); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1)); -/*@egen*/} - {/*@bgen(jjtree) #BinaryExpressionSequence(> 1) */ - try { -/*@egen*/ - RelationalExpressionNoIn() ( EqualityOperator() RelationalExpressionNoIn())*/*@bgen(jjtree)*/ - } catch (Throwable jjte000) { - if (jjtc000) { - jjtree.clearNodeScope(jjtn000); - jjtc000 = false; - } else { - jjtree.popNode(); - } - if (jjte000 instanceof RuntimeException) { - throw (RuntimeException)jjte000; - } - if (jjte000 instanceof ParseException) { - throw (ParseException)jjte000; - } - throw (Error)jjte000; - } finally { - if (jjtc000) { - jjtree.closeNodeScope(jjtn000, jjtree.nodeArity() > 1); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -/*@egen*/ - } - - void EqualityOperator() : - {/*@bgen(jjtree) Operator */ - ASTOperator jjtn000 = new ASTOperator(JJTOPERATOR); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1)); -/*@egen*/Token op;} - {/*@bgen(jjtree) Operator */ - try { -/*@egen*/ - (op="==" | op="!=" | op="===" | op="!==" | op=)/*@bgen(jjtree)*/ - { - jjtree.closeNodeScope(jjtn000, true); - jjtc000 = false; - jjtn000.jjtSetLastToken(getToken(0)); - } -/*@egen*/ { jjtn000.jjtSetValue(op.image);}/*@bgen(jjtree)*/ - } finally { - if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -/*@egen*/ - } - - /* Section 11.10: Binary Bitwise Operators */ - - void BitwiseANDExpression() : - {/*@bgen(jjtree) #BinaryExpressionSequence(> 1) */ - ASTBinaryExpressionSequence jjtn000 = new ASTBinaryExpressionSequence(JJTBINARYEXPRESSIONSEQUENCE); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1)); -/*@egen*/} - {/*@bgen(jjtree) #BinaryExpressionSequence(> 1) */ - try { -/*@egen*/ - EqualityExpression() ( BitwiseANDOperator() EqualityExpression())*/*@bgen(jjtree)*/ - } catch (Throwable jjte000) { - if (jjtc000) { - jjtree.clearNodeScope(jjtn000); - jjtc000 = false; - } else { - jjtree.popNode(); - } - if (jjte000 instanceof RuntimeException) { - throw (RuntimeException)jjte000; - } - if (jjte000 instanceof ParseException) { - throw (ParseException)jjte000; - } - throw (Error)jjte000; - } finally { - if (jjtc000) { - jjtree.closeNodeScope(jjtn000, jjtree.nodeArity() > 1); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -/*@egen*/ - } - - void BitwiseANDExpressionNoIn() : - {/*@bgen(jjtree) #BinaryExpressionSequence(> 1) */ - ASTBinaryExpressionSequence jjtn000 = new ASTBinaryExpressionSequence(JJTBINARYEXPRESSIONSEQUENCE); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1)); -/*@egen*/} - {/*@bgen(jjtree) #BinaryExpressionSequence(> 1) */ - try { -/*@egen*/ - EqualityExpressionNoIn() (BitwiseANDOperator() EqualityExpressionNoIn())*/*@bgen(jjtree)*/ - } catch (Throwable jjte000) { - if (jjtc000) { - jjtree.clearNodeScope(jjtn000); - jjtc000 = false; - } else { - jjtree.popNode(); - } - if (jjte000 instanceof RuntimeException) { - throw (RuntimeException)jjte000; - } - if (jjte000 instanceof ParseException) { - throw (ParseException)jjte000; - } - throw (Error)jjte000; - } finally { - if (jjtc000) { - jjtree.closeNodeScope(jjtn000, jjtree.nodeArity() > 1); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -/*@egen*/ - } - - void BitwiseANDOperator() : - {/*@bgen(jjtree) Operator */ - ASTOperator jjtn000 = new ASTOperator(JJTOPERATOR); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1)); -/*@egen*/Token op;} - {/*@bgen(jjtree) Operator */ - try { -/*@egen*/ - op="&"/*@bgen(jjtree)*/ - { - jjtree.closeNodeScope(jjtn000, true); - jjtc000 = false; - jjtn000.jjtSetLastToken(getToken(0)); - } -/*@egen*/ { jjtn000.jjtSetValue(op.image); }/*@bgen(jjtree)*/ - } finally { - if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -/*@egen*/ - } - - void BitwiseXORExpression() : - {/*@bgen(jjtree) #BinaryExpressionSequence(> 1) */ - ASTBinaryExpressionSequence jjtn000 = new ASTBinaryExpressionSequence(JJTBINARYEXPRESSIONSEQUENCE); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1)); -/*@egen*/} - {/*@bgen(jjtree) #BinaryExpressionSequence(> 1) */ - try { -/*@egen*/ - BitwiseANDExpression() (BitwiseXOROperator() BitwiseANDExpression())*/*@bgen(jjtree)*/ - } catch (Throwable jjte000) { - if (jjtc000) { - jjtree.clearNodeScope(jjtn000); - jjtc000 = false; - } else { - jjtree.popNode(); - } - if (jjte000 instanceof RuntimeException) { - throw (RuntimeException)jjte000; - } - if (jjte000 instanceof ParseException) { - throw (ParseException)jjte000; - } - throw (Error)jjte000; - } finally { - if (jjtc000) { - jjtree.closeNodeScope(jjtn000, jjtree.nodeArity() > 1); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -/*@egen*/ - } - - void BitwiseXORExpressionNoIn() : - {/*@bgen(jjtree) #BinaryExpressionSequence(> 1) */ - ASTBinaryExpressionSequence jjtn000 = new ASTBinaryExpressionSequence(JJTBINARYEXPRESSIONSEQUENCE); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1)); -/*@egen*/} - {/*@bgen(jjtree) #BinaryExpressionSequence(> 1) */ - try { -/*@egen*/ - BitwiseANDExpressionNoIn() (BitwiseXOROperator() BitwiseANDExpressionNoIn())*/*@bgen(jjtree)*/ - } catch (Throwable jjte000) { - if (jjtc000) { - jjtree.clearNodeScope(jjtn000); - jjtc000 = false; - } else { - jjtree.popNode(); - } - if (jjte000 instanceof RuntimeException) { - throw (RuntimeException)jjte000; - } - if (jjte000 instanceof ParseException) { - throw (ParseException)jjte000; - } - throw (Error)jjte000; - } finally { - if (jjtc000) { - jjtree.closeNodeScope(jjtn000, jjtree.nodeArity() > 1); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -/*@egen*/ - } - - void BitwiseXOROperator() : - {/*@bgen(jjtree) Operator */ - ASTOperator jjtn000 = new ASTOperator(JJTOPERATOR); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1)); -/*@egen*/Token op;} - {/*@bgen(jjtree) Operator */ - try { -/*@egen*/ - op="^"/*@bgen(jjtree)*/ - { - jjtree.closeNodeScope(jjtn000, true); - jjtc000 = false; - jjtn000.jjtSetLastToken(getToken(0)); - } -/*@egen*/ { jjtn000.jjtSetValue(op.image); }/*@bgen(jjtree)*/ - } finally { - if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -/*@egen*/ - } - - void BitwiseORExpression() : - {/*@bgen(jjtree) #BinaryExpressionSequence(> 1) */ - ASTBinaryExpressionSequence jjtn000 = new ASTBinaryExpressionSequence(JJTBINARYEXPRESSIONSEQUENCE); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1)); -/*@egen*/} - {/*@bgen(jjtree) #BinaryExpressionSequence(> 1) */ - try { -/*@egen*/ - BitwiseXORExpression() (BitwiseOROperator() BitwiseXORExpression())*/*@bgen(jjtree)*/ - } catch (Throwable jjte000) { - if (jjtc000) { - jjtree.clearNodeScope(jjtn000); - jjtc000 = false; - } else { - jjtree.popNode(); - } - if (jjte000 instanceof RuntimeException) { - throw (RuntimeException)jjte000; - } - if (jjte000 instanceof ParseException) { - throw (ParseException)jjte000; - } - throw (Error)jjte000; - } finally { - if (jjtc000) { - jjtree.closeNodeScope(jjtn000, jjtree.nodeArity() > 1); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -/*@egen*/ - } - - void BitwiseORExpressionNoIn() : - {/*@bgen(jjtree) #BinaryExpressionSequence(> 1) */ - ASTBinaryExpressionSequence jjtn000 = new ASTBinaryExpressionSequence(JJTBINARYEXPRESSIONSEQUENCE); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1)); -/*@egen*/} - {/*@bgen(jjtree) #BinaryExpressionSequence(> 1) */ - try { -/*@egen*/ - BitwiseXORExpressionNoIn() (BitwiseOROperator() BitwiseXORExpressionNoIn())*/*@bgen(jjtree)*/ - } catch (Throwable jjte000) { - if (jjtc000) { - jjtree.clearNodeScope(jjtn000); - jjtc000 = false; - } else { - jjtree.popNode(); - } - if (jjte000 instanceof RuntimeException) { - throw (RuntimeException)jjte000; - } - if (jjte000 instanceof ParseException) { - throw (ParseException)jjte000; - } - throw (Error)jjte000; - } finally { - if (jjtc000) { - jjtree.closeNodeScope(jjtn000, jjtree.nodeArity() > 1); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -/*@egen*/ - } - - void BitwiseOROperator() : - {/*@bgen(jjtree) Operator */ - ASTOperator jjtn000 = new ASTOperator(JJTOPERATOR); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1)); -/*@egen*/Token op;} - {/*@bgen(jjtree) Operator */ - try { -/*@egen*/ - op="|"/*@bgen(jjtree)*/ - { - jjtree.closeNodeScope(jjtn000, true); - jjtc000 = false; - jjtn000.jjtSetLastToken(getToken(0)); - } -/*@egen*/ { jjtn000.jjtSetValue(op.image); }/*@bgen(jjtree)*/ - } finally { - if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -/*@egen*/ - } - /* Section 11.11: Binary Logical Operators */ - - void LogicalANDExpression() : - {/*@bgen(jjtree) #AndExpressionSequence(> 1) */ - ASTAndExpressionSequence jjtn000 = new ASTAndExpressionSequence(JJTANDEXPRESSIONSEQUENCE); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1)); -/*@egen*/} - {/*@bgen(jjtree) #AndExpressionSequence(> 1) */ - try { -/*@egen*/ - BitwiseORExpression() (LogicalANDOperator() BitwiseORExpression())*/*@bgen(jjtree)*/ - } catch (Throwable jjte000) { - if (jjtc000) { - jjtree.clearNodeScope(jjtn000); - jjtc000 = false; - } else { - jjtree.popNode(); - } - if (jjte000 instanceof RuntimeException) { - throw (RuntimeException)jjte000; - } - if (jjte000 instanceof ParseException) { - throw (ParseException)jjte000; - } - throw (Error)jjte000; - } finally { - if (jjtc000) { - jjtree.closeNodeScope(jjtn000, jjtree.nodeArity() > 1); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -/*@egen*/ - } - - void LogicalANDExpressionNoIn() : - {/*@bgen(jjtree) #AndExpressionSequence(> 1) */ - ASTAndExpressionSequence jjtn000 = new ASTAndExpressionSequence(JJTANDEXPRESSIONSEQUENCE); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1)); -/*@egen*/} - {/*@bgen(jjtree) #AndExpressionSequence(> 1) */ - try { -/*@egen*/ - BitwiseORExpressionNoIn() (LogicalANDOperator() BitwiseORExpressionNoIn())*/*@bgen(jjtree)*/ - } catch (Throwable jjte000) { - if (jjtc000) { - jjtree.clearNodeScope(jjtn000); - jjtc000 = false; - } else { - jjtree.popNode(); - } - if (jjte000 instanceof RuntimeException) { - throw (RuntimeException)jjte000; - } - if (jjte000 instanceof ParseException) { - throw (ParseException)jjte000; - } - throw (Error)jjte000; - } finally { - if (jjtc000) { - jjtree.closeNodeScope(jjtn000, jjtree.nodeArity() > 1); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -/*@egen*/ - } - - void LogicalANDOperator() : - {/*@bgen(jjtree) Operator */ - ASTOperator jjtn000 = new ASTOperator(JJTOPERATOR); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1)); -/*@egen*/Token op;} - {/*@bgen(jjtree) Operator */ - try { -/*@egen*/ - op="&&"/*@bgen(jjtree)*/ - { - jjtree.closeNodeScope(jjtn000, true); - jjtc000 = false; - jjtn000.jjtSetLastToken(getToken(0)); - } -/*@egen*/ { jjtn000.jjtSetValue(op.image); }/*@bgen(jjtree)*/ - } finally { - if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -/*@egen*/ - } - - void LogicalORExpression() : - {/*@bgen(jjtree) #OrExpressionSequence(> 1) */ - ASTOrExpressionSequence jjtn000 = new ASTOrExpressionSequence(JJTOREXPRESSIONSEQUENCE); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1)); -/*@egen*/} - {/*@bgen(jjtree) #OrExpressionSequence(> 1) */ - try { -/*@egen*/ - LogicalANDExpression() (LogicalOROperator() LogicalANDExpression())*/*@bgen(jjtree)*/ - } catch (Throwable jjte000) { - if (jjtc000) { - jjtree.clearNodeScope(jjtn000); - jjtc000 = false; - } else { - jjtree.popNode(); - } - if (jjte000 instanceof RuntimeException) { - throw (RuntimeException)jjte000; - } - if (jjte000 instanceof ParseException) { - throw (ParseException)jjte000; - } - throw (Error)jjte000; - } finally { - if (jjtc000) { - jjtree.closeNodeScope(jjtn000, jjtree.nodeArity() > 1); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -/*@egen*/ - } - - void LogicalORExpressionNoIn() : - {/*@bgen(jjtree) #OrExpressionSequence(> 1) */ - ASTOrExpressionSequence jjtn000 = new ASTOrExpressionSequence(JJTOREXPRESSIONSEQUENCE); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1)); -/*@egen*/} - {/*@bgen(jjtree) #OrExpressionSequence(> 1) */ - try { -/*@egen*/ - LogicalANDExpressionNoIn() (LogicalOROperator() LogicalANDExpressionNoIn())*/*@bgen(jjtree)*/ - } catch (Throwable jjte000) { - if (jjtc000) { - jjtree.clearNodeScope(jjtn000); - jjtc000 = false; - } else { - jjtree.popNode(); - } - if (jjte000 instanceof RuntimeException) { - throw (RuntimeException)jjte000; - } - if (jjte000 instanceof ParseException) { - throw (ParseException)jjte000; - } - throw (Error)jjte000; - } finally { - if (jjtc000) { - jjtree.closeNodeScope(jjtn000, jjtree.nodeArity() > 1); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -/*@egen*/ - } - - void LogicalOROperator() : - {/*@bgen(jjtree) Operator */ - ASTOperator jjtn000 = new ASTOperator(JJTOPERATOR); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1)); -/*@egen*/Token op;} - {/*@bgen(jjtree) Operator */ - try { -/*@egen*/ - op="||"/*@bgen(jjtree)*/ - { - jjtree.closeNodeScope(jjtn000, true); - jjtc000 = false; - jjtn000.jjtSetLastToken(getToken(0)); - } -/*@egen*/ { jjtn000.jjtSetValue(op.image); }/*@bgen(jjtree)*/ - } finally { - if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -/*@egen*/ - } - - /* Section 11.12: Conditional Operator */ - - void ConditionalExpression() : - {/*@bgen(jjtree) #ConditionalExpression(> 1) */ - ASTConditionalExpression jjtn000 = new ASTConditionalExpression(JJTCONDITIONALEXPRESSION); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1)); -/*@egen*/} - {/*@bgen(jjtree) #ConditionalExpression(> 1) */ - try { -/*@egen*/ - LogicalORExpression() [ "?" AssignmentExpression() ":" AssignmentExpression() ]/*@bgen(jjtree)*/ - } catch (Throwable jjte000) { - if (jjtc000) { - jjtree.clearNodeScope(jjtn000); - jjtc000 = false; - } else { - jjtree.popNode(); - } - if (jjte000 instanceof RuntimeException) { - throw (RuntimeException)jjte000; - } - if (jjte000 instanceof ParseException) { - throw (ParseException)jjte000; - } - throw (Error)jjte000; - } finally { - if (jjtc000) { - jjtree.closeNodeScope(jjtn000, jjtree.nodeArity() > 1); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -/*@egen*/ - } - - void ConditionalExpressionNoIn() : - {/*@bgen(jjtree) #ConditionalExpression(> 1) */ - ASTConditionalExpression jjtn000 = new ASTConditionalExpression(JJTCONDITIONALEXPRESSION); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1)); -/*@egen*/} - {/*@bgen(jjtree) #ConditionalExpression(> 1) */ - try { -/*@egen*/ - LogicalORExpressionNoIn() [ "?" AssignmentExpression() ":" AssignmentExpressionNoIn() ]/*@bgen(jjtree)*/ - } catch (Throwable jjte000) { - if (jjtc000) { - jjtree.clearNodeScope(jjtn000); - jjtc000 = false; - } else { - jjtree.popNode(); - } - if (jjte000 instanceof RuntimeException) { - throw (RuntimeException)jjte000; - } - if (jjte000 instanceof ParseException) { - throw (ParseException)jjte000; - } - throw (Error)jjte000; - } finally { - if (jjtc000) { - jjtree.closeNodeScope(jjtn000, jjtree.nodeArity() > 1); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -/*@egen*/ - } - - - /* Section 11.13: Assignment Operators */ - - void AssignmentExpression() : - {/*@bgen(jjtree) #AssignmentExpression(> 1) */ - ASTAssignmentExpression jjtn000 = new ASTAssignmentExpression(JJTASSIGNMENTEXPRESSION); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1)); -/*@egen*/} - {/*@bgen(jjtree) #AssignmentExpression(> 1) */ - try { -/*@egen*/ - LOOKAHEAD(LeftHandSideExpression() AssignmentOperator()) LeftHandSideExpression() AssignmentOperator() - (LOOKAHEAD(ActionOnAssign())ActionOnAssign() |AssignmentExpression()) - | ConditionalExpression()/*@bgen(jjtree)*/ - } catch (Throwable jjte000) { - if (jjtc000) { - jjtree.clearNodeScope(jjtn000); - jjtc000 = false; - } else { - jjtree.popNode(); - } - if (jjte000 instanceof RuntimeException) { - throw (RuntimeException)jjte000; - } - if (jjte000 instanceof ParseException) { - throw (ParseException)jjte000; - } - throw (Error)jjte000; - } finally { - if (jjtc000) { - jjtree.closeNodeScope(jjtn000, jjtree.nodeArity() > 1); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -/*@egen*/ - } - - void AssignmentExpressionNoIn() : - {/*@bgen(jjtree) #AssignmentExpression(> 1) */ - ASTAssignmentExpression jjtn000 = new ASTAssignmentExpression(JJTASSIGNMENTEXPRESSION); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1)); -/*@egen*/} - {/*@bgen(jjtree) #AssignmentExpression(> 1) */ - try { -/*@egen*/ - LOOKAHEAD(LeftHandSideExpression() AssignmentOperator()) - - LeftHandSideExpression() AssignmentOperator() - (LOOKAHEAD(ActionOnAssign())ActionOnAssign() | AssignmentExpressionNoIn()) - | ConditionalExpressionNoIn()/*@bgen(jjtree)*/ - } catch (Throwable jjte000) { - if (jjtc000) { - jjtree.clearNodeScope(jjtn000); - jjtc000 = false; - } else { - jjtree.popNode(); - } - if (jjte000 instanceof RuntimeException) { - throw (RuntimeException)jjte000; - } - if (jjte000 instanceof ParseException) { - throw (ParseException)jjte000; - } - throw (Error)jjte000; - } finally { - if (jjtc000) { - jjtree.closeNodeScope(jjtn000, jjtree.nodeArity() > 1); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -/*@egen*/ - } - - void AssignmentOperator() : - {/*@bgen(jjtree) Operator */ - ASTOperator jjtn000 = new ASTOperator(JJTOPERATOR); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1)); -/*@egen*/Token op;} - {/*@bgen(jjtree) Operator */ - try { -/*@egen*/ - (op="=" | op="*=" | op= | op="%=" | op="+=" | op="-=" | op="<<=" | op=">>=" | op=">>>=" | op="&=" | op="^=" | op="|=")/*@bgen(jjtree)*/ - { - jjtree.closeNodeScope(jjtn000, true); - jjtc000 = false; - jjtn000.jjtSetLastToken(getToken(0)); - } -/*@egen*/ - { jjtn000.jjtSetValue(op.image); }/*@bgen(jjtree)*/ - } finally { - if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -/*@egen*/ - } - - - /* Section 11.14: Comma Operator */ - - void Expression() : - {/*@bgen(jjtree) #ExpressionList(> 1) */ - ASTExpressionList jjtn000 = new ASTExpressionList(JJTEXPRESSIONLIST); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1)); -/*@egen*/} - {/*@bgen(jjtree) #ExpressionList(> 1) */ - try { -/*@egen*/ - AssignmentExpression() ( "," AssignmentExpression() )*/*@bgen(jjtree)*/ - } catch (Throwable jjte000) { - if (jjtc000) { - jjtree.clearNodeScope(jjtn000); - jjtc000 = false; - } else { - jjtree.popNode(); - } - if (jjte000 instanceof RuntimeException) { - throw (RuntimeException)jjte000; - } - if (jjte000 instanceof ParseException) { - throw (ParseException)jjte000; - } - throw (Error)jjte000; - } finally { - if (jjtc000) { - jjtree.closeNodeScope(jjtn000, jjtree.nodeArity() > 1); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -/*@egen*/ - } - - void ExpressionNoIn() : - {} - { - AssignmentExpressionNoIn() ( "," AssignmentExpressionNoIn() )* - } - - - - /* Section 12: STATEMENTS */ - - void Statement() : - {{exprBraceCount =0;}} - { - - - LOOKAHEAD(2) BodiedStatement() - | - SingleStatement() -// }catch(ParseException e){ -// e.printStackTrace(); -// throw null; -// } - } - - void SingleStatement() : - {} - { - try - { - - SimpleAction() - | LOOKAHEAD(Action()) - Action() - | LOOKAHEAD(< CALL > | (< VAR > < IDENTIFIER_NAME > | LeftHandSideExpression() ) ) Call() - | LOOKAHEAD([] ) - Cmd() - | Run() - //| LOOKAHEAD(Block()) Block() - // | LOOKAHEAD("var" Identifier() ":") JScriptVarStatement() // JScript .NET declaration - | LOOKAHEAD("var" Identifier()) - VariableStatement() - | EmptyStatement() - | LOOKAHEAD(ExpressionStatement()) - ExpressionStatement() - | LOOKAHEAD(Identifier() ":") - LabelledStatement() - | ContinueStatement() - | YieldStatement() - | BreakStatement() - | ImportStatement() - | ReturnStatement() - }catch(ParseException e){ - error_skipto(e,SEMICOLON); - }catch(TokenMgrError error){ - exceptions.add(error); - if (exceptions.size() >= MAXIMUM_SYNTAX_EXCEPTIONS) { - Exception e = new larac.exceptions.LARACompilerException("Lexer problems", error); - error_skipto(new ParseException(error.getMessage()), SEMICOLON); - } - -// error_skipto(new ParseException(e.getMessage()),SEMICOLON); -// Exception e = new larac.exceptions.LARACompilerException("Lexer problems",error); -// exceptions.add(error); -// throw ; - } - - } - - void BodiedStatement() : - {} - { - try{ - - Block() - | IfStatement() - | IterationStatement() - | SwitchStatement() - | WithStatement() - | ThrowStatement() - | TryStatement() - }catch(ParseException e){ - error_skipto(e,LBRACE); - } - } - - /* 12.1 Block Statement */ - - void Block() : - {/*@bgen(jjtree) Block */ - ASTBlock jjtn000 = new ASTBlock(JJTBLOCK); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1)); -/*@egen*/Token begin, end;} - {/*@bgen(jjtree) Block */ - try { -/*@egen*/ - begin=< LBRACE > - ( StatementList() )? - end=< RBRACE >/*@bgen(jjtree)*/ - } catch (Throwable jjte000) { - if (jjtc000) { - jjtree.clearNodeScope(jjtn000); - jjtc000 = false; - } else { - jjtree.popNode(); - } - if (jjte000 instanceof RuntimeException) { - throw (RuntimeException)jjte000; - } - if (jjte000 instanceof ParseException) { - throw (ParseException)jjte000; - } - throw (Error)jjte000; - } finally { - if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -/*@egen*/ - //{jjtThis.setCoord(begin,end);} - } - - void StatementList() : - {/*@bgen(jjtree) #StatementList(> 1) */ - ASTStatementList jjtn000 = new ASTStatementList(JJTSTATEMENTLIST); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1)); -/*@egen*/} - {/*@bgen(jjtree) #StatementList(> 1) */ - try { -/*@egen*/ - ( Statement() )+/*@bgen(jjtree)*/ - } catch (Throwable jjte000) { - if (jjtc000) { - jjtree.clearNodeScope(jjtn000); - jjtc000 = false; - } else { - jjtree.popNode(); - } - if (jjte000 instanceof RuntimeException) { - throw (RuntimeException)jjte000; - } - if (jjte000 instanceof ParseException) { - throw (ParseException)jjte000; - } - throw (Error)jjte000; - } finally { - if (jjtc000) { - jjtree.closeNodeScope(jjtn000, jjtree.nodeArity() > 1); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -/*@egen*/ - } - - - /* Section 12.2: Variable statement */ - - void VariableStatement() : - {/*@bgen(jjtree) VariableStatement */ - ASTVariableStatement jjtn000 = new ASTVariableStatement(JJTVARIABLESTATEMENT); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1)); -/*@egen*/Token begin, end;} - {/*@bgen(jjtree) VariableStatement */ - try { -/*@egen*/ - - begin=< VAR > VariableDeclarationList() end=EndStatement()/*@bgen(jjtree)*/ - } catch (Throwable jjte000) { - if (jjtc000) { - jjtree.clearNodeScope(jjtn000); - jjtc000 = false; - } else { - jjtree.popNode(); - } - if (jjte000 instanceof RuntimeException) { - throw (RuntimeException)jjte000; - } - if (jjte000 instanceof ParseException) { - throw (ParseException)jjte000; - } - throw (Error)jjte000; - } finally { - if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -/*@egen*/ - //{ jjtThis.setCoord(begin,end);} - - } - - void VariableDeclarationList() : - {/*@bgen(jjtree) #VariableDeclarationList(> 1) */ - ASTVariableDeclarationList jjtn000 = new ASTVariableDeclarationList(JJTVARIABLEDECLARATIONLIST); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1)); -/*@egen*/} - {/*@bgen(jjtree) #VariableDeclarationList(> 1) */ - try { -/*@egen*/ - VariableDeclaration() ( "," VariableDeclaration() )*/*@bgen(jjtree)*/ - } catch (Throwable jjte000) { - if (jjtc000) { - jjtree.clearNodeScope(jjtn000); - jjtc000 = false; - } else { - jjtree.popNode(); - } - if (jjte000 instanceof RuntimeException) { - throw (RuntimeException)jjte000; - } - if (jjte000 instanceof ParseException) { - throw (ParseException)jjte000; - } - throw (Error)jjte000; - } finally { - if (jjtc000) { - jjtree.closeNodeScope(jjtn000, jjtree.nodeArity() > 1); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -/*@egen*/ - } - - void VariableDeclarationListNoIn() : - {/*@bgen(jjtree) #VariableDeclarationList(> 1) */ - ASTVariableDeclarationList jjtn000 = new ASTVariableDeclarationList(JJTVARIABLEDECLARATIONLIST); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1)); -/*@egen*/} - {/*@bgen(jjtree) #VariableDeclarationList(> 1) */ - try { -/*@egen*/ - VariableDeclarationNoIn() ( "," VariableDeclarationNoIn() )*/*@bgen(jjtree)*/ - } catch (Throwable jjte000) { - if (jjtc000) { - jjtree.clearNodeScope(jjtn000); - jjtc000 = false; - } else { - jjtree.popNode(); - } - if (jjte000 instanceof RuntimeException) { - throw (RuntimeException)jjte000; - } - if (jjte000 instanceof ParseException) { - throw (ParseException)jjte000; - } - throw (Error)jjte000; - } finally { - if (jjtc000) { - jjtree.closeNodeScope(jjtn000, jjtree.nodeArity() > 1); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -/*@egen*/ - } - - void VariableDeclaration() : - {/*@bgen(jjtree) VariableDeclaration */ - ASTVariableDeclaration jjtn000 = new ASTVariableDeclaration(JJTVARIABLEDECLARATION); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1)); -/*@egen*/Token type;} - {/*@bgen(jjtree) VariableDeclaration */ - try { -/*@egen*/ -// Identifier() ( Initialiser() )? - Identifier()[":" type=getNoReservedIdentifier() {jjtn000.setType(type.image);}] ( Initialiser() )?/*@bgen(jjtree)*/ - } catch (Throwable jjte000) { - if (jjtc000) { - jjtree.clearNodeScope(jjtn000); - jjtc000 = false; - } else { - jjtree.popNode(); - } - if (jjte000 instanceof RuntimeException) { - throw (RuntimeException)jjte000; - } - if (jjte000 instanceof ParseException) { - throw (ParseException)jjte000; - } - throw (Error)jjte000; - } finally { - if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -/*@egen*/ - } - - void VariableDeclarationNoIn() : - {} - { - Identifier()/*@bgen(jjtree) #EmptyExpression( jjtree . nodeArity ( ) == 0) */ - { - ASTEmptyExpression jjtn001 = new ASTEmptyExpression(JJTEMPTYEXPRESSION); - boolean jjtc001 = true; - jjtree.openNodeScope(jjtn001); - jjtn001.jjtSetFirstToken(getToken(1)); - } - try { -/*@egen*/ ( InitialiserNoIn() )?/*@bgen(jjtree)*/ - } catch (Throwable jjte001) { - if (jjtc001) { - jjtree.clearNodeScope(jjtn001); - jjtc001 = false; - } else { - jjtree.popNode(); - } - if (jjte001 instanceof RuntimeException) { - throw (RuntimeException)jjte001; - } - if (jjte001 instanceof ParseException) { - throw (ParseException)jjte001; - } - throw (Error)jjte001; - } finally { - if (jjtc001) { - jjtree.closeNodeScope(jjtn001, jjtree . nodeArity ( ) == 0); - jjtn001.jjtSetLastToken(getToken(0)); - } - } -/*@egen*/ - } - - void Initialiser() : - {} - { - "=" (LOOKAHEAD(ActionOnAssign() ) ActionOnAssign() | AssignmentExpression()) - } - - void InitialiserNoIn() : - {} - { - "=" AssignmentExpressionNoIn() - } - - - /* Section 12.3: Empty Statement */ - - void EmptyStatement() : - {/*@bgen(jjtree) EmptyStatement */ - ASTEmptyStatement jjtn000 = new ASTEmptyStatement(JJTEMPTYSTATEMENT); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1)); -/*@egen*/} - {/*@bgen(jjtree) EmptyStatement */ - try { -/*@egen*/ - ";"/*@bgen(jjtree)*/ - } finally { - if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -/*@egen*/ - } - - - /* Section 12.4: Expression Statement */ - - void ExpressionStatement() : - {/*@bgen(jjtree) ExpressionStatement */ - ASTExpressionStatement jjtn000 = new ASTExpressionStatement(JJTEXPRESSIONSTATEMENT); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1)); -/*@egen*/} - {/*@bgen(jjtree) ExpressionStatement */ - try { -/*@egen*/ - Expression() EndStatement()/*@bgen(jjtree)*/ - } catch (Throwable jjte000) { - if (jjtc000) { - jjtree.clearNodeScope(jjtn000); - jjtc000 = false; - } else { - jjtree.popNode(); - } - if (jjte000 instanceof RuntimeException) { - throw (RuntimeException)jjte000; - } - if (jjte000 instanceof ParseException) { - throw (ParseException)jjte000; - } - throw (Error)jjte000; - } finally { - if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -/*@egen*/ - } - - ASTExpressionStatement ParseExpression() : - {/*@bgen(jjtree) ExpressionStatement */ - ASTExpressionStatement jjtn000 = new ASTExpressionStatement(JJTEXPRESSIONSTATEMENT); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1)); -/*@egen*/} - {/*@bgen(jjtree) ExpressionStatement */ - try { -/*@egen*/ - //Expression() //To many things! just need a parser like the LeftHandSideExpression rule - //This is a simpler version, which is just what we need - ( - LOOKAHEAD(MemberExpression() "(") CallExpression() - | MemberExpression() - ) - /*@bgen(jjtree)*/ - { - jjtree.closeNodeScope(jjtn000, true); - jjtc000 = false; - jjtn000.jjtSetLastToken(getToken(0)); - } -/*@egen*/ - {return jjtn000;}/*@bgen(jjtree)*/ - } catch (Throwable jjte000) { - if (jjtc000) { - jjtree.clearNodeScope(jjtn000); - jjtc000 = false; - } else { - jjtree.popNode(); - } - if (jjte000 instanceof RuntimeException) { - throw (RuntimeException)jjte000; - } - if (jjte000 instanceof ParseException) { - throw (ParseException)jjte000; - } - throw (Error)jjte000; - } finally { - if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -/*@egen*/ - } - - - /* Section 12.5: The if Statement */ - - void IfStatement() : - {/*@bgen(jjtree) IfStatement */ - ASTIfStatement jjtn000 = new ASTIfStatement(JJTIFSTATEMENT); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1)); -/*@egen*/Token begin;} - {/*@bgen(jjtree) IfStatement */ - try { -/*@egen*/ - begin="if" "(" Expression() ")" Statement() [ LOOKAHEAD(1) "else" Statement() ]/*@bgen(jjtree)*/ - } catch (Throwable jjte000) { - if (jjtc000) { - jjtree.clearNodeScope(jjtn000); - jjtc000 = false; - } else { - jjtree.popNode(); - } - if (jjte000 instanceof RuntimeException) { - throw (RuntimeException)jjte000; - } - if (jjte000 instanceof ParseException) { - throw (ParseException)jjte000; - } - throw (Error)jjte000; - } finally { - if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -/*@egen*/ - //{jjtThis.setCoord(begin,begin); } - } - - - /* Section 12.6: Iteration Statements */ - void IterationStatement() : - {Token begin;Token end;} - { - DoStatement() - | WhileStatement() - | ForStatement() - } - - void DoStatement() : - {/*@bgen(jjtree) DoStatement */ - ASTDoStatement jjtn000 = new ASTDoStatement(JJTDOSTATEMENT); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1)); -/*@egen*/Token begin, end;} - {/*@bgen(jjtree) DoStatement */ - try { -/*@egen*/ - begin= Statement() end= Expression() EndStatement()/*@bgen(jjtree)*/ - } catch (Throwable jjte000) { - if (jjtc000) { - jjtree.clearNodeScope(jjtn000); - jjtc000 = false; - } else { - jjtree.popNode(); - } - if (jjte000 instanceof RuntimeException) { - throw (RuntimeException)jjte000; - } - if (jjte000 instanceof ParseException) { - throw (ParseException)jjte000; - } - throw (Error)jjte000; - } finally { - if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -/*@egen*/ - // {jjtThis.setCoord(begin,end);} - } - - void WhileStatement() : - {/*@bgen(jjtree) WhileStatement */ - ASTWhileStatement jjtn000 = new ASTWhileStatement(JJTWHILESTATEMENT); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1)); -/*@egen*/Token begin;} - {/*@bgen(jjtree) WhileStatement */ - try { -/*@egen*/ - begin= Expression() Statement()/*@bgen(jjtree)*/ - } catch (Throwable jjte000) { - if (jjtc000) { - jjtree.clearNodeScope(jjtn000); - jjtc000 = false; - } else { - jjtree.popNode(); - } - if (jjte000 instanceof RuntimeException) { - throw (RuntimeException)jjte000; - } - if (jjte000 instanceof ParseException) { - throw (ParseException)jjte000; - } - throw (Error)jjte000; - } finally { - if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -/*@egen*/ - // {jjtThis.setCoord(begin,begin);} - } - - void ForStatement() : - {Token begin;boolean isEach = false;} - { - begin=< FOR >( - (/*@bgen(jjtree) ForVarInStatement */ - { - ASTForVarInStatement jjtn001 = new ASTForVarInStatement(JJTFORVARINSTATEMENT); - boolean jjtc001 = true; - jjtree.openNodeScope(jjtn001); - jjtn001.jjtSetFirstToken(getToken(1)); - } - try { -/*@egen*/ //for each var - ("var" VariableDeclarationNoIn() Expression() Statement()/*@bgen(jjtree)*/ - { - jjtree.closeNodeScope(jjtn001, true); - jjtc001 = false; - jjtn001.jjtSetLastToken(getToken(0)); - } -/*@egen*/ - {jjtn001.setEach(true);} /*{jjtThis.setCoord(begin,begin);*/)/*@bgen(jjtree)*/ - } catch (Throwable jjte001) { - if (jjtc001) { - jjtree.clearNodeScope(jjtn001); - jjtc001 = false; - } else { - jjtree.popNode(); - } - if (jjte001 instanceof RuntimeException) { - throw (RuntimeException)jjte001; - } - if (jjte001 instanceof ParseException) { - throw (ParseException)jjte001; - } - throw (Error)jjte001; - } finally { - if (jjtc001) { - jjtree.closeNodeScope(jjtn001, true); - jjtn001.jjtSetLastToken(getToken(0)); - } - } -/*@egen*/ - |/*@bgen(jjtree) ForInStatement */ - { - ASTForInStatement jjtn002 = new ASTForInStatement(JJTFORINSTATEMENT); - boolean jjtc002 = true; - jjtree.openNodeScope(jjtn002); - jjtn002.jjtSetFirstToken(getToken(1)); - } - try { -/*@egen*///for each - ( LeftHandSideExpressionForIn() Expression() Statement()/*@bgen(jjtree)*/ - { - jjtree.closeNodeScope(jjtn002, true); - jjtc002 = false; - jjtn002.jjtSetLastToken(getToken(0)); - } -/*@egen*/ - {jjtn002.setEach(true);} /*{jjtThis.setCoord(begin,begin);*/)/*@bgen(jjtree)*/ - } catch (Throwable jjte002) { - if (jjtc002) { - jjtree.clearNodeScope(jjtn002); - jjtc002 = false; - } else { - jjtree.popNode(); - } - if (jjte002 instanceof RuntimeException) { - throw (RuntimeException)jjte002; - } - if (jjte002 instanceof ParseException) { - throw (ParseException)jjte002; - } - throw (Error)jjte002; - } finally { - if (jjtc002) { - jjtree.closeNodeScope(jjtn002, true); - jjtn002.jjtSetLastToken(getToken(0)); - } - } -/*@egen*/ - ) - | - ( //for ...;...;... - LOOKAHEAD( (ExpressionNoIn())? ";")/*@bgen(jjtree) ForStatement */ - { - ASTForStatement jjtn009 = new ASTForStatement(JJTFORSTATEMENT); - boolean jjtc009 = true; - jjtree.openNodeScope(jjtn009); - jjtn009.jjtSetFirstToken(getToken(1)); - } - try { -/*@egen*/ (/*@bgen(jjtree) #EmptyExpression( jjtree . nodeArity ( ) == 0) */ - { - ASTEmptyExpression jjtn004 = new ASTEmptyExpression(JJTEMPTYEXPRESSION); - boolean jjtc004 = true; - jjtree.openNodeScope(jjtn004); - jjtn004.jjtSetFirstToken(getToken(1)); - } - try { -/*@egen*/(/*@bgen(jjtree) PreAssignmentList */ - { - ASTPreAssignmentList jjtn003 = new ASTPreAssignmentList(JJTPREASSIGNMENTLIST); - boolean jjtc003 = true; - jjtree.openNodeScope(jjtn003); - jjtn003.jjtSetFirstToken(getToken(1)); - } - try { -/*@egen*/ ExpressionNoIn()/*@bgen(jjtree)*/ - } catch (Throwable jjte003) { - if (jjtc003) { - jjtree.clearNodeScope(jjtn003); - jjtc003 = false; - } else { - jjtree.popNode(); - } - if (jjte003 instanceof RuntimeException) { - throw (RuntimeException)jjte003; - } - if (jjte003 instanceof ParseException) { - throw (ParseException)jjte003; - } - throw (Error)jjte003; - } finally { - if (jjtc003) { - jjtree.closeNodeScope(jjtn003, true); - jjtn003.jjtSetLastToken(getToken(0)); - } - } -/*@egen*/ )?/*@bgen(jjtree)*/ - } catch (Throwable jjte004) { - if (jjtc004) { - jjtree.clearNodeScope(jjtn004); - jjtc004 = false; - } else { - jjtree.popNode(); - } - if (jjte004 instanceof RuntimeException) { - throw (RuntimeException)jjte004; - } - if (jjte004 instanceof ParseException) { - throw (ParseException)jjte004; - } - throw (Error)jjte004; - } finally { - if (jjtc004) { - jjtree.closeNodeScope(jjtn004, jjtree . nodeArity ( ) == 0); - jjtn004.jjtSetLastToken(getToken(0)); - } - } -/*@egen*/ ";"/*@bgen(jjtree) #EmptyExpression( jjtree . nodeArity ( ) == 0) */ - { - ASTEmptyExpression jjtn006 = new ASTEmptyExpression(JJTEMPTYEXPRESSION); - boolean jjtc006 = true; - jjtree.openNodeScope(jjtn006); - jjtn006.jjtSetFirstToken(getToken(1)); - } - try { -/*@egen*/ - (/*@bgen(jjtree) ForConditionList */ - { - ASTForConditionList jjtn005 = new ASTForConditionList(JJTFORCONDITIONLIST); - boolean jjtc005 = true; - jjtree.openNodeScope(jjtn005); - jjtn005.jjtSetFirstToken(getToken(1)); - } - try { -/*@egen*/ Expression()/*@bgen(jjtree)*/ - } catch (Throwable jjte005) { - if (jjtc005) { - jjtree.clearNodeScope(jjtn005); - jjtc005 = false; - } else { - jjtree.popNode(); - } - if (jjte005 instanceof RuntimeException) { - throw (RuntimeException)jjte005; - } - if (jjte005 instanceof ParseException) { - throw (ParseException)jjte005; - } - throw (Error)jjte005; - } finally { - if (jjtc005) { - jjtree.closeNodeScope(jjtn005, true); - jjtn005.jjtSetLastToken(getToken(0)); - } - } -/*@egen*/ )?/*@bgen(jjtree)*/ - } catch (Throwable jjte006) { - if (jjtc006) { - jjtree.clearNodeScope(jjtn006); - jjtc006 = false; - } else { - jjtree.popNode(); - } - if (jjte006 instanceof RuntimeException) { - throw (RuntimeException)jjte006; - } - if (jjte006 instanceof ParseException) { - throw (ParseException)jjte006; - } - throw (Error)jjte006; - } finally { - if (jjtc006) { - jjtree.closeNodeScope(jjtn006, jjtree . nodeArity ( ) == 0); - jjtn006.jjtSetLastToken(getToken(0)); - } - } -/*@egen*/ ";"/*@bgen(jjtree) #EmptyExpression( jjtree . nodeArity ( ) == 0) */ - { - ASTEmptyExpression jjtn008 = new ASTEmptyExpression(JJTEMPTYEXPRESSION); - boolean jjtc008 = true; - jjtree.openNodeScope(jjtn008); - jjtn008.jjtSetFirstToken(getToken(1)); - } - try { -/*@egen*/ - (/*@bgen(jjtree) PostAssignmentList */ - { - ASTPostAssignmentList jjtn007 = new ASTPostAssignmentList(JJTPOSTASSIGNMENTLIST); - boolean jjtc007 = true; - jjtree.openNodeScope(jjtn007); - jjtn007.jjtSetFirstToken(getToken(1)); - } - try { -/*@egen*/ Expression()/*@bgen(jjtree)*/ - } catch (Throwable jjte007) { - if (jjtc007) { - jjtree.clearNodeScope(jjtn007); - jjtc007 = false; - } else { - jjtree.popNode(); - } - if (jjte007 instanceof RuntimeException) { - throw (RuntimeException)jjte007; - } - if (jjte007 instanceof ParseException) { - throw (ParseException)jjte007; - } - throw (Error)jjte007; - } finally { - if (jjtc007) { - jjtree.closeNodeScope(jjtn007, true); - jjtn007.jjtSetLastToken(getToken(0)); - } - } -/*@egen*/ )?/*@bgen(jjtree)*/ - } catch (Throwable jjte008) { - if (jjtc008) { - jjtree.clearNodeScope(jjtn008); - jjtc008 = false; - } else { - jjtree.popNode(); - } - if (jjte008 instanceof RuntimeException) { - throw (RuntimeException)jjte008; - } - if (jjte008 instanceof ParseException) { - throw (ParseException)jjte008; - } - throw (Error)jjte008; - } finally { - if (jjtc008) { - jjtree.closeNodeScope(jjtn008, jjtree . nodeArity ( ) == 0); - jjtn008.jjtSetLastToken(getToken(0)); - } - } -/*@egen*/ ")" - Statement() /*{jjtThis.setCoord(begin,begin); }*/)/*@bgen(jjtree)*/ - } catch (Throwable jjte009) { - if (jjtc009) { - jjtree.clearNodeScope(jjtn009); - jjtc009 = false; - } else { - jjtree.popNode(); - } - if (jjte009 instanceof RuntimeException) { - throw (RuntimeException)jjte009; - } - if (jjte009 instanceof ParseException) { - throw (ParseException)jjte009; - } - throw (Error)jjte009; - } finally { - if (jjtc009) { - jjtree.closeNodeScope(jjtn009, true); - jjtn009.jjtSetLastToken(getToken(0)); - } - } -/*@egen*/ - |//for var ...;...;... - LOOKAHEAD("var" VariableDeclarationList() ";")/*@bgen(jjtree) ForVarStatement */ - { - ASTForVarStatement jjtn015 = new ASTForVarStatement(JJTFORVARSTATEMENT); - boolean jjtc015 = true; - jjtree.openNodeScope(jjtn015); - jjtn015.jjtSetFirstToken(getToken(1)); - } - try { -/*@egen*/ ("var"/*@bgen(jjtree) PreAssignmentList */ - { - ASTPreAssignmentList jjtn010 = new ASTPreAssignmentList(JJTPREASSIGNMENTLIST); - boolean jjtc010 = true; - jjtree.openNodeScope(jjtn010); - jjtn010.jjtSetFirstToken(getToken(1)); - } - try { -/*@egen*/ VariableDeclarationList()/*@bgen(jjtree)*/ - } catch (Throwable jjte010) { - if (jjtc010) { - jjtree.clearNodeScope(jjtn010); - jjtc010 = false; - } else { - jjtree.popNode(); - } - if (jjte010 instanceof RuntimeException) { - throw (RuntimeException)jjte010; - } - if (jjte010 instanceof ParseException) { - throw (ParseException)jjte010; - } - throw (Error)jjte010; - } finally { - if (jjtc010) { - jjtree.closeNodeScope(jjtn010, true); - jjtn010.jjtSetLastToken(getToken(0)); - } - } -/*@egen*/ ";"/*@bgen(jjtree) #EmptyExpression( jjtree . nodeArity ( ) == 0) */ - { - ASTEmptyExpression jjtn012 = new ASTEmptyExpression(JJTEMPTYEXPRESSION); - boolean jjtc012 = true; - jjtree.openNodeScope(jjtn012); - jjtn012.jjtSetFirstToken(getToken(1)); - } - try { -/*@egen*/ - (/*@bgen(jjtree) ForConditionList */ - { - ASTForConditionList jjtn011 = new ASTForConditionList(JJTFORCONDITIONLIST); - boolean jjtc011 = true; - jjtree.openNodeScope(jjtn011); - jjtn011.jjtSetFirstToken(getToken(1)); - } - try { -/*@egen*/ Expression()/*@bgen(jjtree)*/ - } catch (Throwable jjte011) { - if (jjtc011) { - jjtree.clearNodeScope(jjtn011); - jjtc011 = false; - } else { - jjtree.popNode(); - } - if (jjte011 instanceof RuntimeException) { - throw (RuntimeException)jjte011; - } - if (jjte011 instanceof ParseException) { - throw (ParseException)jjte011; - } - throw (Error)jjte011; - } finally { - if (jjtc011) { - jjtree.closeNodeScope(jjtn011, true); - jjtn011.jjtSetLastToken(getToken(0)); - } - } -/*@egen*/ )?/*@bgen(jjtree)*/ - } catch (Throwable jjte012) { - if (jjtc012) { - jjtree.clearNodeScope(jjtn012); - jjtc012 = false; - } else { - jjtree.popNode(); - } - if (jjte012 instanceof RuntimeException) { - throw (RuntimeException)jjte012; - } - if (jjte012 instanceof ParseException) { - throw (ParseException)jjte012; - } - throw (Error)jjte012; - } finally { - if (jjtc012) { - jjtree.closeNodeScope(jjtn012, jjtree . nodeArity ( ) == 0); - jjtn012.jjtSetLastToken(getToken(0)); - } - } -/*@egen*/ ";"/*@bgen(jjtree) #EmptyExpression( jjtree . nodeArity ( ) == 0) */ - { - ASTEmptyExpression jjtn014 = new ASTEmptyExpression(JJTEMPTYEXPRESSION); - boolean jjtc014 = true; - jjtree.openNodeScope(jjtn014); - jjtn014.jjtSetFirstToken(getToken(1)); - } - try { -/*@egen*/ - (/*@bgen(jjtree) PostAssignmentList */ - { - ASTPostAssignmentList jjtn013 = new ASTPostAssignmentList(JJTPOSTASSIGNMENTLIST); - boolean jjtc013 = true; - jjtree.openNodeScope(jjtn013); - jjtn013.jjtSetFirstToken(getToken(1)); - } - try { -/*@egen*/ Expression()/*@bgen(jjtree)*/ - } catch (Throwable jjte013) { - if (jjtc013) { - jjtree.clearNodeScope(jjtn013); - jjtc013 = false; - } else { - jjtree.popNode(); - } - if (jjte013 instanceof RuntimeException) { - throw (RuntimeException)jjte013; - } - if (jjte013 instanceof ParseException) { - throw (ParseException)jjte013; - } - throw (Error)jjte013; - } finally { - if (jjtc013) { - jjtree.closeNodeScope(jjtn013, true); - jjtn013.jjtSetLastToken(getToken(0)); - } - } -/*@egen*/ )?/*@bgen(jjtree)*/ - } catch (Throwable jjte014) { - if (jjtc014) { - jjtree.clearNodeScope(jjtn014); - jjtc014 = false; - } else { - jjtree.popNode(); - } - if (jjte014 instanceof RuntimeException) { - throw (RuntimeException)jjte014; - } - if (jjte014 instanceof ParseException) { - throw (ParseException)jjte014; - } - throw (Error)jjte014; - } finally { - if (jjtc014) { - jjtree.closeNodeScope(jjtn014, jjtree . nodeArity ( ) == 0); - jjtn014.jjtSetLastToken(getToken(0)); - } - } -/*@egen*/ - Statement() /*{jjtThis.setCoord(begin,begin);}*/)/*@bgen(jjtree)*/ - } catch (Throwable jjte015) { - if (jjtc015) { - jjtree.clearNodeScope(jjtn015); - jjtc015 = false; - } else { - jjtree.popNode(); - } - if (jjte015 instanceof RuntimeException) { - throw (RuntimeException)jjte015; - } - if (jjte015 instanceof ParseException) { - throw (ParseException)jjte015; - } - throw (Error)jjte015; - } finally { - if (jjtc015) { - jjtree.closeNodeScope(jjtn015, true); - jjtn015.jjtSetLastToken(getToken(0)); - } - } -/*@egen*/ - |/*@bgen(jjtree) ForVarInStatement */ - { - ASTForVarInStatement jjtn016 = new ASTForVarInStatement(JJTFORVARINSTATEMENT); - boolean jjtc016 = true; - jjtree.openNodeScope(jjtn016); - jjtn016.jjtSetFirstToken(getToken(1)); - } - try { -/*@egen*/ //for var in/of - ( "var" VariableDeclarationNoIn() (|( {isEach = true;})) Expression() Statement()/*@bgen(jjtree)*/ - { - jjtree.closeNodeScope(jjtn016, true); - jjtc016 = false; - jjtn016.jjtSetLastToken(getToken(0)); - } -/*@egen*/ - {jjtn016.setEach(isEach);} /*{jjtThis.setCoord(begin,begin); }*/)/*@bgen(jjtree)*/ - } catch (Throwable jjte016) { - if (jjtc016) { - jjtree.clearNodeScope(jjtn016); - jjtc016 = false; - } else { - jjtree.popNode(); - } - if (jjte016 instanceof RuntimeException) { - throw (RuntimeException)jjte016; - } - if (jjte016 instanceof ParseException) { - throw (ParseException)jjte016; - } - throw (Error)jjte016; - } finally { - if (jjtc016) { - jjtree.closeNodeScope(jjtn016, true); - jjtn016.jjtSetLastToken(getToken(0)); - } - } -/*@egen*/ - |/*@bgen(jjtree) ForInStatement */ - { - ASTForInStatement jjtn017 = new ASTForInStatement(JJTFORINSTATEMENT); - boolean jjtc017 = true; - jjtree.openNodeScope(jjtn017); - jjtn017.jjtSetFirstToken(getToken(1)); - } - try { -/*@egen*/ //for in/of - ( LeftHandSideExpressionForIn() (|( {isEach = true;})) Expression() Statement()/*@bgen(jjtree)*/ - { - jjtree.closeNodeScope(jjtn017, true); - jjtc017 = false; - jjtn017.jjtSetLastToken(getToken(0)); - } -/*@egen*/ - {jjtn017.setEach(isEach);}/*{jjtThis.setCoord(begin,begin); }*/)/*@bgen(jjtree)*/ - } catch (Throwable jjte017) { - if (jjtc017) { - jjtree.clearNodeScope(jjtn017); - jjtc017 = false; - } else { - jjtree.popNode(); - } - if (jjte017 instanceof RuntimeException) { - throw (RuntimeException)jjte017; - } - if (jjte017 instanceof ParseException) { - throw (ParseException)jjte017; - } - throw (Error)jjte017; - } finally { - if (jjtc017) { - jjtree.closeNodeScope(jjtn017, true); - jjtn017.jjtSetLastToken(getToken(0)); - } - } -/*@egen*/ - ) - ) - } - /* Section 12.7: The continue Statement */ - - void ContinueStatement() : - {/*@bgen(jjtree) ContinueStatement */ - ASTContinueStatement jjtn000 = new ASTContinueStatement(JJTCONTINUESTATEMENT); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1)); -/*@egen*/Token begin;} - {/*@bgen(jjtree) ContinueStatement */ - try { -/*@egen*/ - begin="continue" ( LOOKAHEAD(LabelIdentifier()) LabelIdentifier() )? EndStatement()/*@bgen(jjtree)*/ - } catch (Throwable jjte000) { - if (jjtc000) { - jjtree.clearNodeScope(jjtn000); - jjtc000 = false; - } else { - jjtree.popNode(); - } - if (jjte000 instanceof RuntimeException) { - throw (RuntimeException)jjte000; - } - if (jjte000 instanceof ParseException) { - throw (ParseException)jjte000; - } - throw (Error)jjte000; - } finally { - if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -/*@egen*/ - /*{jjtThis.setCoord(begin,begin); }*/ - } - - - - /* Section 12.8: The break Statement */ - - void BreakStatement() : - {/*@bgen(jjtree) BreakStatement */ - ASTBreakStatement jjtn000 = new ASTBreakStatement(JJTBREAKSTATEMENT); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1)); -/*@egen*/Token begin;} - {/*@bgen(jjtree) BreakStatement */ - try { -/*@egen*/ - begin="break"( LOOKAHEAD(LabelIdentifier()) LabelIdentifier() )? EndStatement()/*@bgen(jjtree)*/ - } catch (Throwable jjte000) { - if (jjtc000) { - jjtree.clearNodeScope(jjtn000); - jjtc000 = false; - } else { - jjtree.popNode(); - } - if (jjte000 instanceof RuntimeException) { - throw (RuntimeException)jjte000; - } - if (jjte000 instanceof ParseException) { - throw (ParseException)jjte000; - } - throw (Error)jjte000; - } finally { - if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -/*@egen*/ - /*{jjtThis.setCoord(begin,begin); }*/ - } - - - /* Section 12.9 The return Statement */ - - void ReturnStatement() : - {/*@bgen(jjtree) ReturnStatement */ - ASTReturnStatement jjtn000 = new ASTReturnStatement(JJTRETURNSTATEMENT); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1)); -/*@egen*/} - {/*@bgen(jjtree) ReturnStatement */ - try { -/*@egen*/ - "return"/*@bgen(jjtree) #EmptyExpression( jjtree . nodeArity ( ) == 0) */ - { - ASTEmptyExpression jjtn001 = new ASTEmptyExpression(JJTEMPTYEXPRESSION); - boolean jjtc001 = true; - jjtree.openNodeScope(jjtn001); - jjtn001.jjtSetFirstToken(getToken(1)); - } - try { -/*@egen*/ ( LOOKAHEAD(Expression()) Expression() )?/*@bgen(jjtree)*/ - } catch (Throwable jjte001) { - if (jjtc001) { - jjtree.clearNodeScope(jjtn001); - jjtc001 = false; - } else { - jjtree.popNode(); - } - if (jjte001 instanceof RuntimeException) { - throw (RuntimeException)jjte001; - } - if (jjte001 instanceof ParseException) { - throw (ParseException)jjte001; - } - throw (Error)jjte001; - } finally { - if (jjtc001) { - jjtree.closeNodeScope(jjtn001, jjtree . nodeArity ( ) == 0); - jjtn001.jjtSetLastToken(getToken(0)); - } - } -/*@egen*/ EndStatement()/*@bgen(jjtree)*/ - } catch (Throwable jjte000) { - if (jjtc000) { - jjtree.clearNodeScope(jjtn000); - jjtc000 = false; - } else { - jjtree.popNode(); - } - if (jjte000 instanceof RuntimeException) { - throw (RuntimeException)jjte000; - } - if (jjte000 instanceof ParseException) { - throw (ParseException)jjte000; - } - throw (Error)jjte000; - } finally { - if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -/*@egen*/ - } - - - /* Custom */ - void YieldStatement() : - {/*@bgen(jjtree) YieldStatement */ - ASTYieldStatement jjtn000 = new ASTYieldStatement(JJTYIELDSTATEMENT); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1)); -/*@egen*/Token begin;} - {/*@bgen(jjtree) YieldStatement */ - try { -/*@egen*/ - begin="yield" ( YieldStar() )?/*@bgen(jjtree) #EmptyExpression( jjtree . nodeArity ( ) == 0) */ - { - ASTEmptyExpression jjtn001 = new ASTEmptyExpression(JJTEMPTYEXPRESSION); - boolean jjtc001 = true; - jjtree.openNodeScope(jjtn001); - jjtn001.jjtSetFirstToken(getToken(1)); - } - try { -/*@egen*/ ( LOOKAHEAD(Expression()) Expression() )?/*@bgen(jjtree)*/ - } catch (Throwable jjte001) { - if (jjtc001) { - jjtree.clearNodeScope(jjtn001); - jjtc001 = false; - } else { - jjtree.popNode(); - } - if (jjte001 instanceof RuntimeException) { - throw (RuntimeException)jjte001; - } - if (jjte001 instanceof ParseException) { - throw (ParseException)jjte001; - } - throw (Error)jjte001; - } finally { - if (jjtc001) { - jjtree.closeNodeScope(jjtn001, jjtree . nodeArity ( ) == 0); - jjtn001.jjtSetLastToken(getToken(0)); - } - } -/*@egen*/ EndStatement()/*@bgen(jjtree)*/ - } catch (Throwable jjte000) { - if (jjtc000) { - jjtree.clearNodeScope(jjtn000); - jjtc000 = false; - } else { - jjtree.popNode(); - } - if (jjte000 instanceof RuntimeException) { - throw (RuntimeException)jjte000; - } - if (jjte000 instanceof ParseException) { - throw (ParseException)jjte000; - } - throw (Error)jjte000; - } finally { - if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -/*@egen*/ - } - - - void YieldStar() : - {/*@bgen(jjtree) YieldStar */ - ASTYieldStar jjtn000 = new ASTYieldStar(JJTYIELDSTAR); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1)); -/*@egen*/} - {/*@bgen(jjtree) YieldStar */ - try { -/*@egen*/ - "*"/*@bgen(jjtree)*/ - } finally { - if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -/*@egen*/ - } - - /* Section 12.10: The with Statement */ - - void WithStatement() : - {/*@bgen(jjtree) WithStatement */ - ASTWithStatement jjtn000 = new ASTWithStatement(JJTWITHSTATEMENT); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1)); -/*@egen*/} - {/*@bgen(jjtree) WithStatement */ - try { -/*@egen*/ - "with" "(" Expression() ")" Statement()/*@bgen(jjtree)*/ - } catch (Throwable jjte000) { - if (jjtc000) { - jjtree.clearNodeScope(jjtn000); - jjtc000 = false; - } else { - jjtree.popNode(); - } - if (jjte000 instanceof RuntimeException) { - throw (RuntimeException)jjte000; - } - if (jjte000 instanceof ParseException) { - throw (ParseException)jjte000; - } - throw (Error)jjte000; - } finally { - if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -/*@egen*/ - } - - - /* 12.11 The switch Statement */ - - void SwitchStatement() : - {/*@bgen(jjtree) SwitchStatement */ - ASTSwitchStatement jjtn000 = new ASTSwitchStatement(JJTSWITCHSTATEMENT); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1)); -/*@egen*/Token begin;} - {/*@bgen(jjtree) SwitchStatement */ - try { -/*@egen*/ - begin="switch" "(" Expression() ")" CaseBlock()/*@bgen(jjtree)*/ - } catch (Throwable jjte000) { - if (jjtc000) { - jjtree.clearNodeScope(jjtn000); - jjtc000 = false; - } else { - jjtree.popNode(); - } - if (jjte000 instanceof RuntimeException) { - throw (RuntimeException)jjte000; - } - if (jjte000 instanceof ParseException) { - throw (ParseException)jjte000; - } - throw (Error)jjte000; - } finally { - if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -/*@egen*/ - /*{jjtThis.setCoord(begin,begin); }*/ - } - - void CaseBlock() : - {/*@bgen(jjtree) CaseGroups */ - ASTCaseGroups jjtn000 = new ASTCaseGroups(JJTCASEGROUPS); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1)); -/*@egen*/Token begin,end;} - {/*@bgen(jjtree) CaseGroups */ - try { -/*@egen*/ - begin=< LBRACE > ( CaseClauses() )? - ( - end=< RBRACE > | DefaultClause() ( CaseClauses() )? end=< RBRACE > - )/*@bgen(jjtree)*/ - } catch (Throwable jjte000) { - if (jjtc000) { - jjtree.clearNodeScope(jjtn000); - jjtc000 = false; - } else { - jjtree.popNode(); - } - if (jjte000 instanceof RuntimeException) { - throw (RuntimeException)jjte000; - } - if (jjte000 instanceof ParseException) { - throw (ParseException)jjte000; - } - throw (Error)jjte000; - } finally { - if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -/*@egen*/ - /*{jjtThis.setCoord(begin,end); }*/ - } - - void CaseClauses() : - {} - { - ( CaseClause() )+ - } - - void CaseClause() : - {/*@bgen(jjtree) CaseGroup */ - ASTCaseGroup jjtn000 = new ASTCaseGroup(JJTCASEGROUP); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1)); -/*@egen*/Token begin;} - {/*@bgen(jjtree) CaseGroup */ - try { -/*@egen*/ - (/*@bgen(jjtree) CaseGuard */ - { - ASTCaseGuard jjtn001 = new ASTCaseGuard(JJTCASEGUARD); - boolean jjtc001 = true; - jjtree.openNodeScope(jjtn001); - jjtn001.jjtSetFirstToken(getToken(1)); - } - try { -/*@egen*/ ( begin="case" Expression() ":" )/*@bgen(jjtree)*/ - } catch (Throwable jjte001) { - if (jjtc001) { - jjtree.clearNodeScope(jjtn001); - jjtc001 = false; - } else { - jjtree.popNode(); - } - if (jjte001 instanceof RuntimeException) { - throw (RuntimeException)jjte001; - } - if (jjte001 instanceof ParseException) { - throw (ParseException)jjte001; - } - throw (Error)jjte001; - } finally { - if (jjtc001) { - jjtree.closeNodeScope(jjtn001, true); - jjtn001.jjtSetLastToken(getToken(0)); - } - } -/*@egen*/ ) ( StatementList() )?/*@bgen(jjtree)*/ - } catch (Throwable jjte000) { - if (jjtc000) { - jjtree.clearNodeScope(jjtn000); - jjtc000 = false; - } else { - jjtree.popNode(); - } - if (jjte000 instanceof RuntimeException) { - throw (RuntimeException)jjte000; - } - if (jjte000 instanceof ParseException) { - throw (ParseException)jjte000; - } - throw (Error)jjte000; - } finally { - if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -/*@egen*/ - /*{jjtThis.setCoord(begin,begin); }*/ - } - - void DefaultClause() : - {/*@bgen(jjtree) CaseGroup */ - ASTCaseGroup jjtn000 = new ASTCaseGroup(JJTCASEGROUP); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1)); -/*@egen*/Token begin;} - {/*@bgen(jjtree) CaseGroup */ - try { -/*@egen*/ - (/*@bgen(jjtree) CaseGuard */ - { - ASTCaseGuard jjtn001 = new ASTCaseGuard(JJTCASEGUARD); - boolean jjtc001 = true; - jjtree.openNodeScope(jjtn001); - jjtn001.jjtSetFirstToken(getToken(1)); - } - try { -/*@egen*/ ( begin="default" ":" )/*@bgen(jjtree)*/ - } finally { - if (jjtc001) { - jjtree.closeNodeScope(jjtn001, true); - jjtn001.jjtSetLastToken(getToken(0)); - } - } -/*@egen*/ ) ( StatementList() )?/*@bgen(jjtree)*/ - } catch (Throwable jjte000) { - if (jjtc000) { - jjtree.clearNodeScope(jjtn000); - jjtc000 = false; - } else { - jjtree.popNode(); - } - if (jjte000 instanceof RuntimeException) { - throw (RuntimeException)jjte000; - } - if (jjte000 instanceof ParseException) { - throw (ParseException)jjte000; - } - throw (Error)jjte000; - } finally { - if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -/*@egen*/ - /*{jjtThis.setCoord(begin,begin); }*/ - } - - - /* Section 12.12: Labelled Statements */ - - void LabelledStatement() : - {/*@bgen(jjtree) LabelledStatement */ - ASTLabelledStatement jjtn000 = new ASTLabelledStatement(JJTLABELLEDSTATEMENT); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1)); -/*@egen*/} - {/*@bgen(jjtree) LabelledStatement */ - try { -/*@egen*/ - Identifier() ":" Statement()/*@bgen(jjtree)*/ - } catch (Throwable jjte000) { - if (jjtc000) { - jjtree.clearNodeScope(jjtn000); - jjtc000 = false; - } else { - jjtree.popNode(); - } - if (jjte000 instanceof RuntimeException) { - throw (RuntimeException)jjte000; - } - if (jjte000 instanceof ParseException) { - throw (ParseException)jjte000; - } - throw (Error)jjte000; - } finally { - if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -/*@egen*/ - } - - void ThrowStatement() : - {/*@bgen(jjtree) ThrowStatement */ - ASTThrowStatement jjtn000 = new ASTThrowStatement(JJTTHROWSTATEMENT); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1)); -/*@egen*/Token begin;} - {/*@bgen(jjtree) ThrowStatement */ - try { -/*@egen*/ - begin="throw" Expression() EndStatement()/*@bgen(jjtree)*/ - } catch (Throwable jjte000) { - if (jjtc000) { - jjtree.clearNodeScope(jjtn000); - jjtc000 = false; - } else { - jjtree.popNode(); - } - if (jjte000 instanceof RuntimeException) { - throw (RuntimeException)jjte000; - } - if (jjte000 instanceof ParseException) { - throw (ParseException)jjte000; - } - throw (Error)jjte000; - } finally { - if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -/*@egen*/ - /*{jjtThis.setCoord(begin,begin); }*/ - } - - void TryStatement() : - {/*@bgen(jjtree) TryStatement */ - ASTTryStatement jjtn000 = new ASTTryStatement(JJTTRYSTATEMENT); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1)); -/*@egen*/Token begin;} - {/*@bgen(jjtree) TryStatement */ - try { -/*@egen*/ - begin="try" Block() - ( - ( Finally() | Catch() [Finally()]) - )/*@bgen(jjtree)*/ - } catch (Throwable jjte000) { - if (jjtc000) { - jjtree.clearNodeScope(jjtn000); - jjtc000 = false; - } else { - jjtree.popNode(); - } - if (jjte000 instanceof RuntimeException) { - throw (RuntimeException)jjte000; - } - if (jjte000 instanceof ParseException) { - throw (ParseException)jjte000; - } - throw (Error)jjte000; - } finally { - if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -/*@egen*/ - /*{jjtThis.setCoord(begin,begin); }*/ - } - - void Catch() : - {/*@bgen(jjtree) CatchClause */ - ASTCatchClause jjtn000 = new ASTCatchClause(JJTCATCHCLAUSE); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1)); -/*@egen*/Token begin;} - {/*@bgen(jjtree) CatchClause */ - try { -/*@egen*/ - begin="catch" "(" Identifier() ")" Block()/*@bgen(jjtree)*/ - } catch (Throwable jjte000) { - if (jjtc000) { - jjtree.clearNodeScope(jjtn000); - jjtc000 = false; - } else { - jjtree.popNode(); - } - if (jjte000 instanceof RuntimeException) { - throw (RuntimeException)jjte000; - } - if (jjte000 instanceof ParseException) { - throw (ParseException)jjte000; - } - throw (Error)jjte000; - } finally { - if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -/*@egen*/ - /*{jjtThis.setCoord(begin,begin); }*/ - } - - void Finally() : - {/*@bgen(jjtree) FinallyClause */ - ASTFinallyClause jjtn000 = new ASTFinallyClause(JJTFINALLYCLAUSE); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1)); -/*@egen*/Token begin;} - {/*@bgen(jjtree) FinallyClause */ - try { -/*@egen*/ - begin="finally" Block()/*@bgen(jjtree)*/ - } catch (Throwable jjte000) { - if (jjtc000) { - jjtree.clearNodeScope(jjtn000); - jjtc000 = false; - } else { - jjtree.popNode(); - } - if (jjte000 instanceof RuntimeException) { - throw (RuntimeException)jjte000; - } - if (jjte000 instanceof ParseException) { - throw (ParseException)jjte000; - } - throw (Error)jjte000; - } finally { - if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -/*@egen*/ - /*{jjtThis.setCoord(begin,begin); }*/ - } - - /* Section 13: Function Definition */ - - void FunctionDeclaration() : - {/*@bgen(jjtree) FunctionDeclaration */ - ASTFunctionDeclaration jjtn000 = new ASTFunctionDeclaration(JJTFUNCTIONDECLARATION); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1)); -/*@egen*/Token begin;} - {/*@bgen(jjtree) FunctionDeclaration */ - try { -/*@egen*/ - begin="function" Identifier()/*@bgen(jjtree) FormalParameterList */ - { - ASTFormalParameterList jjtn001 = new ASTFormalParameterList(JJTFORMALPARAMETERLIST); - boolean jjtc001 = true; - jjtree.openNodeScope(jjtn001); - jjtn001.jjtSetFirstToken(getToken(1)); - } - try { -/*@egen*/ ( "(" ( FormalParameterList() )? ")" )/*@bgen(jjtree)*/ - } catch (Throwable jjte001) { - if (jjtc001) { - jjtree.clearNodeScope(jjtn001); - jjtc001 = false; - } else { - jjtree.popNode(); - } - if (jjte001 instanceof RuntimeException) { - throw (RuntimeException)jjte001; - } - if (jjte001 instanceof ParseException) { - throw (ParseException)jjte001; - } - throw (Error)jjte001; - } finally { - if (jjtc001) { - jjtree.closeNodeScope(jjtn001, true); - jjtn001.jjtSetLastToken(getToken(0)); - } - } -/*@egen*/ FunctionBody()/*@bgen(jjtree)*/ - } catch (Throwable jjte000) { - if (jjtc000) { - jjtree.clearNodeScope(jjtn000); - jjtc000 = false; - } else { - jjtree.popNode(); - } - if (jjte000 instanceof RuntimeException) { - throw (RuntimeException)jjte000; - } - if (jjte000 instanceof ParseException) { - throw (ParseException)jjte000; - } - throw (Error)jjte000; - } finally { - if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -/*@egen*/ - /*{jjtThis.setCoord(begin,begin); }*/ - } - - void GeneratorFunctionDeclaration() : - {/*@bgen(jjtree) GeneratorFunctionDeclaration */ - ASTGeneratorFunctionDeclaration jjtn000 = new ASTGeneratorFunctionDeclaration(JJTGENERATORFUNCTIONDECLARATION); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1)); -/*@egen*/Token begin;} - {/*@bgen(jjtree) GeneratorFunctionDeclaration */ - try { -/*@egen*/ - begin="function*" Identifier()/*@bgen(jjtree) FormalParameterList */ - { - ASTFormalParameterList jjtn001 = new ASTFormalParameterList(JJTFORMALPARAMETERLIST); - boolean jjtc001 = true; - jjtree.openNodeScope(jjtn001); - jjtn001.jjtSetFirstToken(getToken(1)); - } - try { -/*@egen*/ ( "(" ( FormalParameterList() )? ")" )/*@bgen(jjtree)*/ - } catch (Throwable jjte001) { - if (jjtc001) { - jjtree.clearNodeScope(jjtn001); - jjtc001 = false; - } else { - jjtree.popNode(); - } - if (jjte001 instanceof RuntimeException) { - throw (RuntimeException)jjte001; - } - if (jjte001 instanceof ParseException) { - throw (ParseException)jjte001; - } - throw (Error)jjte001; - } finally { - if (jjtc001) { - jjtree.closeNodeScope(jjtn001, true); - jjtn001.jjtSetLastToken(getToken(0)); - } - } -/*@egen*/ FunctionBody()/*@bgen(jjtree)*/ - } catch (Throwable jjte000) { - if (jjtc000) { - jjtree.clearNodeScope(jjtn000); - jjtc000 = false; - } else { - jjtree.popNode(); - } - if (jjte000 instanceof RuntimeException) { - throw (RuntimeException)jjte000; - } - if (jjte000 instanceof ParseException) { - throw (ParseException)jjte000; - } - throw (Error)jjte000; - } finally { - if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -/*@egen*/ - /*{jjtThis.setCoord(begin,begin); }*/ - } - - - void ArrowFunctionBody() : - {/*@bgen(jjtree) Block */ - ASTBlock jjtn000 = new ASTBlock(JJTBLOCK); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1)); -/*@egen*/} - {/*@bgen(jjtree) Block */ - try { -/*@egen*/ - < LBRACE > (Statement())* < RBRACE >/*@bgen(jjtree)*/ - } catch (Throwable jjte000) { - if (jjtc000) { - jjtree.clearNodeScope(jjtn000); - jjtc000 = false; - } else { - jjtree.popNode(); - } - if (jjte000 instanceof RuntimeException) { - throw (RuntimeException)jjte000; - } - if (jjte000 instanceof ParseException) { - throw (ParseException)jjte000; - } - throw (Error)jjte000; - } finally { - if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -/*@egen*/ - } - - void ArrowFunctionExpression() : - {/*@bgen(jjtree) ArrowFunctionExpression */ - ASTArrowFunctionExpression jjtn000 = new ASTArrowFunctionExpression(JJTARROWFUNCTIONEXPRESSION); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1)); -/*@egen*/} - {/*@bgen(jjtree) ArrowFunctionExpression */ - try { -/*@egen*//*@bgen(jjtree) FormalParameterList */ - { - ASTFormalParameterList jjtn001 = new ASTFormalParameterList(JJTFORMALPARAMETERLIST); - boolean jjtc001 = true; - jjtree.openNodeScope(jjtn001); - jjtn001.jjtSetFirstToken(getToken(1)); - } - try { -/*@egen*/ - ( "(" (FormalParameterList())? ")" | Identifier() )/*@bgen(jjtree)*/ - } catch (Throwable jjte001) { - if (jjtc001) { - jjtree.clearNodeScope(jjtn001); - jjtc001 = false; - } else { - jjtree.popNode(); - } - if (jjte001 instanceof RuntimeException) { - throw (RuntimeException)jjte001; - } - if (jjte001 instanceof ParseException) { - throw (ParseException)jjte001; - } - throw (Error)jjte001; - } finally { - if (jjtc001) { - jjtree.closeNodeScope(jjtn001, true); - jjtn001.jjtSetLastToken(getToken(0)); - } - } -/*@egen*/ - ( LOOKAHEAD(ArrowFunctionBody()) ArrowFunctionBody() | LOOKAHEAD(ExpressionNoIn()) ExpressionNoIn() )/*@bgen(jjtree)*/ - } catch (Throwable jjte000) { - if (jjtc000) { - jjtree.clearNodeScope(jjtn000); - jjtc000 = false; - } else { - jjtree.popNode(); - } - if (jjte000 instanceof RuntimeException) { - throw (RuntimeException)jjte000; - } - if (jjte000 instanceof ParseException) { - throw (ParseException)jjte000; - } - throw (Error)jjte000; - } finally { - if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -/*@egen*/ - - -//ActionOnAssign() -// | Expression() - -//LOOKAHEAD(ArrowFunctionBody() -//LOOKAHEAD(ExpressionNoIn()) - //| LOOKAHEAD(PrimaryExpression()) PrimaryExpression() - // LOOKAHEAD(ActionOnAssign()) ActionOnAssign() - //| ConditionalExpression() - - //( LOOKAHEAD(ArrowFunctionBody()) ArrowFunctionBody() | LOOKAHEAD(Expression())Expression()) - //ConditionalExpression() - //( (LOOKAHEAD(FunctionBody()) FunctionBody()) | (LOOKAHEAD(Expression()) Expression()) ) - //(ArrowFunctionBody() | PrimaryExpression()) - //(ArrowFunctionBody() | ( LOOKAHEAD(MemberExpression() "(") CallExpression() | MemberExpression() )) - //(ArrowFunctionBody() | ( LOOKAHEAD(MemberExpression() "(") CallExpression() | MemberExpression() )) - //( "(" FormalParameterList() ")" | Identifier() ) #FormalParameterList (FunctionBody() | ActionOnAssign() | LogicalORExpression()) - //"(" ( FormalParameterList() )? ")" #ArrowParameterList "=>" (FunctionBody()) - //( ("(" ( FormalParameterList() )? ")") | Identifier()) #ArrowParameterList "=>" FunctionBody() - /*{jjtThis.setCoord(begin,begin); }*/ - } - - void FunctionExpression() : - {/*@bgen(jjtree) FunctionExpression */ - ASTFunctionExpression jjtn000 = new ASTFunctionExpression(JJTFUNCTIONEXPRESSION); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1)); -/*@egen*/Token begin;} - {/*@bgen(jjtree) FunctionExpression */ - try { -/*@egen*/ - begin="function" ( Identifier() )?/*@bgen(jjtree) FormalParameterList */ - { - ASTFormalParameterList jjtn001 = new ASTFormalParameterList(JJTFORMALPARAMETERLIST); - boolean jjtc001 = true; - jjtree.openNodeScope(jjtn001); - jjtn001.jjtSetFirstToken(getToken(1)); - } - try { -/*@egen*/ ( "(" ( FormalParameterList() )? ")" )/*@bgen(jjtree)*/ - } catch (Throwable jjte001) { - if (jjtc001) { - jjtree.clearNodeScope(jjtn001); - jjtc001 = false; - } else { - jjtree.popNode(); - } - if (jjte001 instanceof RuntimeException) { - throw (RuntimeException)jjte001; - } - if (jjte001 instanceof ParseException) { - throw (ParseException)jjte001; - } - throw (Error)jjte001; - } finally { - if (jjtc001) { - jjtree.closeNodeScope(jjtn001, true); - jjtn001.jjtSetLastToken(getToken(0)); - } - } -/*@egen*/ FunctionBody()/*@bgen(jjtree)*/ - } catch (Throwable jjte000) { - if (jjtc000) { - jjtree.clearNodeScope(jjtn000); - jjtc000 = false; - } else { - jjtree.popNode(); - } - if (jjte000 instanceof RuntimeException) { - throw (RuntimeException)jjte000; - } - if (jjte000 instanceof ParseException) { - throw (ParseException)jjte000; - } - throw (Error)jjte000; - } finally { - if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -/*@egen*/ - /*{jjtThis.setCoord(begin,begin); }*/ - } - - void GeneratorFunctionExpression() : - {/*@bgen(jjtree) GeneratorFunctionExpression */ - ASTGeneratorFunctionExpression jjtn000 = new ASTGeneratorFunctionExpression(JJTGENERATORFUNCTIONEXPRESSION); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1)); -/*@egen*/Token begin;} - {/*@bgen(jjtree) GeneratorFunctionExpression */ - try { -/*@egen*/ - begin="function*" ( Identifier() )?/*@bgen(jjtree) FormalParameterList */ - { - ASTFormalParameterList jjtn001 = new ASTFormalParameterList(JJTFORMALPARAMETERLIST); - boolean jjtc001 = true; - jjtree.openNodeScope(jjtn001); - jjtn001.jjtSetFirstToken(getToken(1)); - } - try { -/*@egen*/ ( "(" ( FormalParameterList() )? ")" )/*@bgen(jjtree)*/ - } catch (Throwable jjte001) { - if (jjtc001) { - jjtree.clearNodeScope(jjtn001); - jjtc001 = false; - } else { - jjtree.popNode(); - } - if (jjte001 instanceof RuntimeException) { - throw (RuntimeException)jjte001; - } - if (jjte001 instanceof ParseException) { - throw (ParseException)jjte001; - } - throw (Error)jjte001; - } finally { - if (jjtc001) { - jjtree.closeNodeScope(jjtn001, true); - jjtn001.jjtSetLastToken(getToken(0)); - } - } -/*@egen*/ FunctionBody()/*@bgen(jjtree)*/ - } catch (Throwable jjte000) { - if (jjtc000) { - jjtree.clearNodeScope(jjtn000); - jjtc000 = false; - } else { - jjtree.popNode(); - } - if (jjte000 instanceof RuntimeException) { - throw (RuntimeException)jjte000; - } - if (jjte000 instanceof ParseException) { - throw (ParseException)jjte000; - } - throw (Error)jjte000; - } finally { - if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -/*@egen*/ - /*{jjtThis.setCoord(begin,begin); }*/ - } - - void FormalParameterList() : - {} - { - (Identifier()) ( "," (Identifier()) )* - } - - void FunctionBody() : - {/*@bgen(jjtree) Block */ - ASTBlock jjtn000 = new ASTBlock(JJTBLOCK); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1)); -/*@egen*/} - {/*@bgen(jjtree) Block */ - try { -/*@egen*/ - < LBRACE > (SourceElements())? < RBRACE >/*@bgen(jjtree)*/ - } catch (Throwable jjte000) { - if (jjtc000) { - jjtree.clearNodeScope(jjtn000); - jjtc000 = false; - } else { - jjtree.popNode(); - } - if (jjte000 instanceof RuntimeException) { - throw (RuntimeException)jjte000; - } - if (jjte000 instanceof ParseException) { - throw (ParseException)jjte000; - } - throw (Error)jjte000; - } finally { - if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -/*@egen*/ - } - - - /* Section 14: Program * - - ASTProgram Program() #Program : - {} - { - JavaScript() - - { return jjtThis; } - } - /**/ - - void JavaScript() : - {/*@bgen(jjtree) JavaScript */ - ASTJavaScript jjtn000 = new ASTJavaScript(JJTJAVASCRIPT); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1)); -/*@egen*/} - {/*@bgen(jjtree) JavaScript */ - try { -/*@egen*/ - (SourceElements())?/*@bgen(jjtree)*/ - } catch (Throwable jjte000) { - if (jjtc000) { - jjtree.clearNodeScope(jjtn000); - jjtc000 = false; - } else { - jjtree.popNode(); - } - if (jjte000 instanceof RuntimeException) { - throw (RuntimeException)jjte000; - } - if (jjte000 instanceof ParseException) { - throw (ParseException)jjte000; - } - throw (Error)jjte000; - } finally { - if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -/*@egen*/ - } - - - void SourceElements() : - {} - { - (SourceElement())+ - } - - void SourceElement() : - {} - { - LOOKAHEAD("function*" Identifier()) GeneratorFunctionDeclaration() | LOOKAHEAD("function" Identifier()) FunctionDeclaration() | Statement() - } - - - - - - /* - * Grammar for parsing JScript .NET contructs: ( import System; var contents : - * String = reader.ReadToEnd(); ) Refer: src/hostenv_jsc.js - */ - - void ImportStatement(): - {} - { - "import" Name() [ "." "*" ] EndStatement() - } - - - void Name(): - {} - { - ( LOOKAHEAD(2) < DOT > )* - } - - - void JScriptVarStatement() : - {/*@bgen(jjtree) VariableStatement */ - ASTVariableStatement jjtn000 = new ASTVariableStatement(JJTVARIABLESTATEMENT); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1)); -/*@egen*/} - {/*@bgen(jjtree) VariableStatement */ - try { -/*@egen*/ - < VAR > JScriptVarDeclarationList() EndStatement()/*@bgen(jjtree)*/ - } catch (Throwable jjte000) { - if (jjtc000) { - jjtree.clearNodeScope(jjtn000); - jjtc000 = false; - } else { - jjtree.popNode(); - } - if (jjte000 instanceof RuntimeException) { - throw (RuntimeException)jjte000; - } - if (jjte000 instanceof ParseException) { - throw (ParseException)jjte000; - } - throw (Error)jjte000; - } finally { - if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -/*@egen*/ - } - - void JScriptVarDeclarationList() : - {/*@bgen(jjtree) #VariableDeclarationList(> 1) */ - ASTVariableDeclarationList jjtn000 = new ASTVariableDeclarationList(JJTVARIABLEDECLARATIONLIST); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1)); -/*@egen*/} - {/*@bgen(jjtree) #VariableDeclarationList(> 1) */ - try { -/*@egen*/ - JScriptVarDeclaration() ( < COMMA > JScriptVarDeclaration() )*/*@bgen(jjtree)*/ - } catch (Throwable jjte000) { - if (jjtc000) { - jjtree.clearNodeScope(jjtn000); - jjtc000 = false; - } else { - jjtree.popNode(); - } - if (jjte000 instanceof RuntimeException) { - throw (RuntimeException)jjte000; - } - if (jjte000 instanceof ParseException) { - throw (ParseException)jjte000; - } - throw (Error)jjte000; - } finally { - if (jjtc000) { - jjtree.closeNodeScope(jjtn000, jjtree.nodeArity() > 1); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -/*@egen*/ - } - - void JScriptVarDeclaration() : - {/*@bgen(jjtree) VariableDeclaration */ - ASTVariableDeclaration jjtn000 = new ASTVariableDeclaration(JJTVARIABLEDECLARATION); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - jjtn000.jjtSetFirstToken(getToken(1)); -/*@egen*/} - {/*@bgen(jjtree) VariableDeclaration */ - try { -/*@egen*/ - Identifier() ":" ( Initialiser() )?/*@bgen(jjtree)*/ - } catch (Throwable jjte000) { - if (jjtc000) { - jjtree.clearNodeScope(jjtn000); - jjtc000 = false; - } else { - jjtree.popNode(); - } - if (jjte000 instanceof RuntimeException) { - throw (RuntimeException)jjte000; - } - if (jjte000 instanceof ParseException) { - throw (ParseException)jjte000; - } - throw (Error)jjte000; - } finally { - if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - jjtn000.jjtSetLastToken(getToken(0)); - } - } -/*@egen*/ - } - - Token EndStatement() : - {Token end;} - { - try - { - end=< SEMICOLON > - {return end;} - - }catch(ParseException e) - { - if(e.expectedTokenSet.size() > MAX_EXCEPTION_TOKEN_SIZE - || (e.expectedTokenSet.size() == 1 && e.expectedTokenSet.get(0).equals(";"))){ - - Token foundToken = getToken(1); - String line = "at line " + e.currentToken.beginLine + ", column " + e.currentToken.beginColumn; - String message = line+": did you forget a ';'?"; - if (foundToken != null){ - message+=" (possible errant token: "+ foundToken + ")"; - } - e = new ParseException(message); - SimpleNode currNode = getCurrentNode(); - exceptions.add(e); - ParseExceptionData excData = new ParseExceptionData(e); - if (currNode != null){ - currNode.setExceptionData(excData); - } - }else{ - error_skipto(e, SEMICOLON); - } - - // - } - - {return new Token(SEMICOLON);} - - } - -JAVACODE -void error_skipto(ParseException e, int kind) { -// ParseException e = generateParseException(); // generate the exception object. -// System.out.println(e.toString()); // print the error message - exceptions.add(e); - SimpleNode currNode = getCurrentNode(); - ParseExceptionData excData = new ParseExceptionData(e); - excData.setSkippedToToken(kind); - Token t = null; -// int braceCount = 0; - skipper: do { - Token test = getToken(1); -// System.out.println(exprBraceCount); - if(test == null || test.kind == END) - { -// System.out.println("I'm breaking here with:"+test); - break; - } - switch(test.kind) - { - case RBRACE: - exprBraceCount--; - if(exprBraceCount < 0) - break skipper; - break; - } - - - t = getNextToken(); - - if(t != null) - excData.addSkippedToken(t); -// System.out.println("Skipped: "+t+" token("+test+")"); - } while (t != null && (t.kind != kind && t.kind != EOF)); - // The above loop consumes tokens all the way up to a token of -// "kind". We use a do-while loop rather than a while because the -// current token is the one immediately before the erroneous token -// (in our case the token immediately before what should have been -// "if"/"while". - - if (currNode != null){ - currNode.setExceptionData(excData); - } - if(t == null || t.kind == EOF){ - throw new StopParseException(); - } -} - -JAVACODE -void error_noSkip(ParseException e) { - System.out.println("--------------NO SKIP-----------------"); -// ParseException e = generateParseException(); // generate the exception object. -// System.out.println(e.toString()); // print the error message - SimpleNode currNode = getCurrentNode(); - ParseExceptionData excData = new ParseExceptionData(e); - if (currNode != null){ - currNode.setExceptionData(excData); - } -} \ No newline at end of file diff --git a/LARAC/src/org/dojo/jsl/parser/ast/LARAEcmaScriptConstants.java b/LARAC/src/org/dojo/jsl/parser/ast/LARAEcmaScriptConstants.java deleted file mode 100644 index 636e6372b..000000000 --- a/LARAC/src/org/dojo/jsl/parser/ast/LARAEcmaScriptConstants.java +++ /dev/null @@ -1,534 +0,0 @@ -/* Generated By:JJTree&JavaCC: Do not edit this line. LARAEcmaScriptConstants.java */ -package org.dojo.jsl.parser.ast; - - -/** - * Token literal values and constants. - * Generated by org.javacc.parser.OtherFilesGen#start() - */ -public interface LARAEcmaScriptConstants { - - /** End of File. */ - int EOF = 0; - /** RegularExpression Id. */ - int WHITE_SPACE = 1; - /** RegularExpression Id. */ - int TAB = 2; - /** RegularExpression Id. */ - int VT = 3; - /** RegularExpression Id. */ - int FF = 4; - /** RegularExpression Id. */ - int SP = 5; - /** RegularExpression Id. */ - int NBSP = 6; - /** RegularExpression Id. */ - int USP = 7; - /** RegularExpression Id. */ - int LINE_TERMINATOR = 8; - /** RegularExpression Id. */ - int LF = 9; - /** RegularExpression Id. */ - int CR = 10; - /** RegularExpression Id. */ - int LS = 11; - /** RegularExpression Id. */ - int PS = 12; - /** RegularExpression Id. */ - int SINGLE_LINE_COMMENT = 15; - /** RegularExpression Id. */ - int MULTI_LINE_COMMENT = 16; - /** RegularExpression Id. */ - int INCLUDE = 18; - /** RegularExpression Id. */ - int ASPECTDEF = 19; - /** RegularExpression Id. */ - int CODEDEF = 20; - /** RegularExpression Id. */ - int INPUT = 21; - /** RegularExpression Id. */ - int OUTPUT = 22; - /** RegularExpression Id. */ - int STATICDECL = 23; - /** RegularExpression Id. */ - int SELECT = 24; - /** RegularExpression Id. */ - int APPLY = 25; - /** RegularExpression Id. */ - int TO = 26; - /** RegularExpression Id. */ - int CALL = 27; - /** RegularExpression Id. */ - int RUN = 28; - /** RegularExpression Id. */ - int CMD = 29; - /** RegularExpression Id. */ - int CONDITION = 30; - /** RegularExpression Id. */ - int BEGIN = 31; - /** RegularExpression Id. */ - int INSERT = 32; - /** RegularExpression Id. */ - int EXEC = 33; - /** RegularExpression Id. */ - int OUTPUT_ACT = 34; - /** RegularExpression Id. */ - int BEFORE = 35; - /** RegularExpression Id. */ - int AFTER = 36; - /** RegularExpression Id. */ - int AROUND = 37; - /** RegularExpression Id. */ - int REPLACE = 38; - /** RegularExpression Id. */ - int DEFINE = 39; - /** RegularExpression Id. */ - int CHECK = 40; - /** RegularExpression Id. */ - int INITIALIZE = 41; - /** RegularExpression Id. */ - int FINALIZE = 42; - /** RegularExpression Id. */ - int END = 43; - /** RegularExpression Id. */ - int DYNAMIC = 44; - /** RegularExpression Id. */ - int SEQUENCIAL = 45; - /** RegularExpression Id. */ - int PARALLEL = 46; - /** RegularExpression Id. */ - int BREAK = 47; - /** RegularExpression Id. */ - int CONTINUE = 48; - /** RegularExpression Id. */ - int DELETE = 49; - /** RegularExpression Id. */ - int ELSE = 50; - /** RegularExpression Id. */ - int FOR = 51; - /** RegularExpression Id. */ - int FUNCTION = 52; - /** RegularExpression Id. */ - int FUNCTION_GEN = 53; - /** RegularExpression Id. */ - int IF = 54; - /** RegularExpression Id. */ - int IN = 55; - /** RegularExpression Id. */ - int OF = 56; - /** RegularExpression Id. */ - int EACH = 57; - /** RegularExpression Id. */ - int NEW = 58; - /** RegularExpression Id. */ - int RETURN = 59; - /** RegularExpression Id. */ - int YIELD = 60; - /** RegularExpression Id. */ - int THIS = 61; - /** RegularExpression Id. */ - int TYPEOF = 62; - /** RegularExpression Id. */ - int VAR = 63; - /** RegularExpression Id. */ - int VOID = 64; - /** RegularExpression Id. */ - int WHILE = 65; - /** RegularExpression Id. */ - int WITH = 66; - /** RegularExpression Id. */ - int CASE = 67; - /** RegularExpression Id. */ - int CATCH = 68; - /** RegularExpression Id. */ - int CLASS = 69; - /** RegularExpression Id. */ - int CONST = 70; - /** RegularExpression Id. */ - int DEBUGGER = 71; - /** RegularExpression Id. */ - int _DEFAULT = 72; - /** RegularExpression Id. */ - int DO = 73; - /** RegularExpression Id. */ - int ENUM = 74; - /** RegularExpression Id. */ - int EXTENDS = 75; - /** RegularExpression Id. */ - int FINALLY = 76; - /** RegularExpression Id. */ - int IMPORT = 77; - /** RegularExpression Id. */ - int SUPER = 78; - /** RegularExpression Id. */ - int SWITCH = 79; - /** RegularExpression Id. */ - int THROW = 80; - /** RegularExpression Id. */ - int TRY = 81; - /** RegularExpression Id. */ - int ARROW = 82; - /** RegularExpression Id. */ - int LBRACE = 83; - /** RegularExpression Id. */ - int RBRACE = 84; - /** RegularExpression Id. */ - int LPAREN = 85; - /** RegularExpression Id. */ - int RPAREN = 86; - /** RegularExpression Id. */ - int LBRACKET = 87; - /** RegularExpression Id. */ - int RBRACKET = 88; - /** RegularExpression Id. */ - int DOT = 89; - /** RegularExpression Id. */ - int SEMICOLON = 90; - /** RegularExpression Id. */ - int COMMA = 91; - /** RegularExpression Id. */ - int LT = 92; - /** RegularExpression Id. */ - int GT = 93; - /** RegularExpression Id. */ - int LE = 94; - /** RegularExpression Id. */ - int GE = 95; - /** RegularExpression Id. */ - int EQ = 96; - /** RegularExpression Id. */ - int NE = 97; - /** RegularExpression Id. */ - int MATCH = 98; - /** RegularExpression Id. */ - int SEQ = 99; - /** RegularExpression Id. */ - int SNEQ = 100; - /** RegularExpression Id. */ - int PLUS = 101; - /** RegularExpression Id. */ - int MINUS = 102; - /** RegularExpression Id. */ - int STAR = 103; - /** RegularExpression Id. */ - int REM = 104; - /** RegularExpression Id. */ - int INCR = 105; - /** RegularExpression Id. */ - int DECR = 106; - /** RegularExpression Id. */ - int LSHIFT = 107; - /** RegularExpression Id. */ - int RSHIFT = 108; - /** RegularExpression Id. */ - int RUNSHIFT = 109; - /** RegularExpression Id. */ - int BIT_AND = 110; - /** RegularExpression Id. */ - int BIT_OR = 111; - /** RegularExpression Id. */ - int XOR = 112; - /** RegularExpression Id. */ - int BANG = 113; - /** RegularExpression Id. */ - int TILDE = 114; - /** RegularExpression Id. */ - int SC_AND = 115; - /** RegularExpression Id. */ - int SC_OR = 116; - /** RegularExpression Id. */ - int HOOK = 117; - /** RegularExpression Id. */ - int NATURAL_JOIN = 118; - /** RegularExpression Id. */ - int COLON = 119; - /** RegularExpression Id. */ - int ASSIGN = 120; - /** RegularExpression Id. */ - int PLUSASSIGN = 121; - /** RegularExpression Id. */ - int MINUSASSIGN = 122; - /** RegularExpression Id. */ - int STARASSIGN = 123; - /** RegularExpression Id. */ - int REMASSIGN = 124; - /** RegularExpression Id. */ - int LSHIFTASSIGN = 125; - /** RegularExpression Id. */ - int RSIGNEDSHIFTASSIGN = 126; - /** RegularExpression Id. */ - int RUNSIGNEDSHIFTASSIGN = 127; - /** RegularExpression Id. */ - int ANDASSIGN = 128; - /** RegularExpression Id. */ - int ORASSIGN = 129; - /** RegularExpression Id. */ - int XORASSIGN = 130; - /** RegularExpression Id. */ - int INTANCE_OF = 131; - /** RegularExpression Id. */ - int DECIMAL_LITERAL = 132; - /** RegularExpression Id. */ - int NON_ZERO_DIGIT = 133; - /** RegularExpression Id. */ - int EXPONENT_PART = 134; - /** RegularExpression Id. */ - int DECIMAL_INTEGER_LITERAL = 135; - /** RegularExpression Id. */ - int HEX_INTEGER_LITERAL = 136; - /** RegularExpression Id. */ - int DECIMAL_DIGITS = 137; - /** RegularExpression Id. */ - int DECIMAL_DIGIT = 138; - /** RegularExpression Id. */ - int NULL_LITERAL = 139; - /** RegularExpression Id. */ - int BOOLEAN_LITERAL = 140; - /** RegularExpression Id. */ - int STRING_LITERAL = 141; - /** RegularExpression Id. */ - int DOUBLE_STRING_CHARACTERS = 142; - /** RegularExpression Id. */ - int SINGLE_STRING_CHARACTERS = 143; - /** RegularExpression Id. */ - int DOUBLE_STRING_CHARACTER = 144; - /** RegularExpression Id. */ - int SINGLE_STRING_CHARACTER = 145; - /** RegularExpression Id. */ - int ESCAPE_SEQUENCE = 146; - /** RegularExpression Id. */ - int CHARACTER_ESCAPE_SEQUENCE = 147; - /** RegularExpression Id. */ - int SINGLE_ESCAPE_CHARACTER = 148; - /** RegularExpression Id. */ - int NON_ESCAPE_CHARACTER = 149; - /** RegularExpression Id. */ - int HEX_ESCAPE_SEQUENCE = 150; - /** RegularExpression Id. */ - int CODE_LITERAL = 151; - /** RegularExpression Id. */ - int LABEL_IDENTIFIER = 152; - /** RegularExpression Id. */ - int IDENTIFIER_NAME = 153; - /** RegularExpression Id. */ - int IDENTIFIER_START = 154; - /** RegularExpression Id. */ - int IDENTIFIER_PART = 155; - /** RegularExpression Id. */ - int DOLLAR_SIGN = 156; - /** RegularExpression Id. */ - int AT_SIGN = 157; - /** RegularExpression Id. */ - int UNDER_SCORE = 158; - /** RegularExpression Id. */ - int UNICODE_LETTER = 159; - /** RegularExpression Id. */ - int UNICODE_COMBINING_MARK = 160; - /** RegularExpression Id. */ - int MC = 161; - /** RegularExpression Id. */ - int MN = 162; - /** RegularExpression Id. */ - int UNICODE_DIGIT = 163; - /** RegularExpression Id. */ - int UNICODE_CONNECTOR_PUNCTUATION = 164; - /** RegularExpression Id. */ - int UNICODE_ESCAPE_SEQUENCE = 165; - /** RegularExpression Id. */ - int HEX_DIGIT = 166; - /** RegularExpression Id. */ - int SLASHASSIGN = 167; - /** RegularExpression Id. */ - int SLASH = 168; - /** RegularExpression Id. */ - int REGULAR_EXPRESSION_LITERAL = 169; - /** RegularExpression Id. */ - int BACKSLASH_SEQUENCE = 170; - - /** Lexical state. */ - int DEFAULT = 0; - /** Lexical state. */ - int IN_REGEX = 1; - /** Lexical state. */ - int IN_SINGLE_LINE_COMMENT = 2; - /** Lexical state. */ - int IN_MULTI_LINE_COMMENT = 3; - /** Lexical state. */ - int IN_PATTERN = 4; - - /** Literal token values. */ - String[] tokenImage = { - "", - "", - "", - "\"\\u000b\"", - "", - "", - "\"\\u00a0\"", - "", - "", - "\"\\n\"", - "\"\\r\"", - "\"\\u2028\"", - "\"\\u2029\"", - "\"//\"", - "\"/*\"", - "", - "\"*/\"", - "", - "\"include\"", - "\"aspectdef\"", - "\"codedef\"", - "\"input\"", - "\"output\"", - "\"static\"", - "\"select\"", - "\"apply\"", - "\"to\"", - "\"call\"", - "\"run\"", - "\"cmd\"", - "\"condition\"", - "\"begin\"", - "\"insert\"", - "\"exec\"", - "\"out\"", - "\"before\"", - "\"after\"", - "\"around\"", - "\"replace\"", - "\"def\"", - "\"check\"", - "\"initialize\"", - "\"finalize\"", - "\"end\"", - "\"dynamic\"", - "\"seq\"", - "\"par\"", - "\"break\"", - "\"continue\"", - "\"delete\"", - "\"else\"", - "\"for\"", - "\"function\"", - "\"function*\"", - "\"if\"", - "\"in\"", - "\"of\"", - "\"each\"", - "\"new\"", - "\"return\"", - "\"yield\"", - "\"this\"", - "\"typeof\"", - "\"var\"", - "\"void\"", - "\"while\"", - "\"with\"", - "\"case\"", - "\"catch\"", - "\"class\"", - "\"const\"", - "\"debugger\"", - "\"default\"", - "\"do\"", - "\"enum\"", - "\"extends\"", - "\"finally\"", - "\"import\"", - "\"super\"", - "\"switch\"", - "\"throw\"", - "\"try\"", - "\"=>\"", - "\"{\"", - "\"}\"", - "\"(\"", - "\")\"", - "\"[\"", - "\"]\"", - "\".\"", - "\";\"", - "\",\"", - "\"<\"", - "\">\"", - "\"<=\"", - "\">=\"", - "\"==\"", - "\"!=\"", - "\"~=\"", - "\"===\"", - "\"!==\"", - "\"+\"", - "\"-\"", - "\"*\"", - "\"%\"", - "\"++\"", - "\"--\"", - "\"<<\"", - "\">>\"", - "\">>>\"", - "\"&\"", - "\"|\"", - "\"^\"", - "\"!\"", - "\"~\"", - "\"&&\"", - "\"||\"", - "\"?\"", - "\"::\"", - "\":\"", - "\"=\"", - "\"+=\"", - "\"-=\"", - "\"*=\"", - "\"%=\"", - "\"<<=\"", - "\">>=\"", - "\">>>=\"", - "\"&=\"", - "\"|=\"", - "\"^=\"", - "\"instanceof\"", - "", - "", - "", - "", - "", - "", - "", - "\"null\"", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "\"$\"", - "\"@\"", - "\"_\"", - "", - "", - "", - "", - "", - "", - "", - "", - "\"/=\"", - "\"/\"", - "", - "", - }; - -} diff --git a/LARAC/src/org/dojo/jsl/parser/ast/LARAEcmaScriptTokenManager.java b/LARAC/src/org/dojo/jsl/parser/ast/LARAEcmaScriptTokenManager.java deleted file mode 100644 index d513e71de..000000000 --- a/LARAC/src/org/dojo/jsl/parser/ast/LARAEcmaScriptTokenManager.java +++ /dev/null @@ -1,5072 +0,0 @@ -/* LARAEcmaScriptTokenManager.java */ -/* Generated By:JJTree&JavaCC: Do not edit this line. LARAEcmaScriptTokenManager.java */ -package org.dojo.jsl.parser.ast; -import java.io.*; -import java.util.*; -import java.io.File; -import java.io.FileReader; -import java.io.BufferedReader; -import java.io.ByteArrayInputStream; -import larac.utils.output.ErrorMsg; -import larac.objects.Enums.Types; -import larac.exceptions.ParseExceptionData; -import larac.exceptions.StopParseException; - -/** Token Manager. */ -@SuppressWarnings ("unused") -public class LARAEcmaScriptTokenManager implements LARAEcmaScriptConstants { - public int htmlTokenNestingLevel = 0; - public boolean expectActionScript = false; - - /** Debug output. */ - public java.io.PrintStream debugStream = System.out; - /** Set debug output. */ - public void setDebugStream(java.io.PrintStream ds) { debugStream = ds; } -private final int jjStopStringLiteralDfa_0(int pos, long active0, long active1, long active2){ - switch (pos) - { - case 0: - if ((active0 & 0x6000000004000000L) != 0L || (active1 & 0x30000L) != 0L) - { - jjmatchedKind = 153; - return 9; - } - if ((active0 & 0x6000L) != 0L) - return 83; - if ((active1 & 0x2000000L) != 0L) - return 3; - if ((active0 & 0x38040000000000L) != 0L || (active1 & 0x1000L) != 0L) - { - jjmatchedKind = 153; - return 13; - } - if ((active0 & 0x9fc7fbfffbfc0000L) != 0L || (active1 & 0xefffL) != 0L || (active2 & 0x808L) != 0L) - { - jjmatchedKind = 153; - return 119; - } - if ((active1 & 0x1000010000000000L) != 0L) - return 42; - return -1; - case 1: - if ((active0 & 0x30000410400000L) != 0L || (active1 & 0x4000L) != 0L || (active2 & 0x800L) != 0L) - { - if (jjmatchedPos != 1) - { - jjmatchedKind = 153; - jjmatchedPos = 1; - } - return 65; - } - if ((active0 & 0xfe0ffdfaeb980000L) != 0L || (active1 & 0x1bdffL) != 0L) - { - if (jjmatchedPos != 1) - { - jjmatchedKind = 153; - jjmatchedPos = 1; - } - return 119; - } - if ((active0 & 0x1c0020104240000L) != 0L || (active1 & 0x200L) != 0L || (active2 & 0x8L) != 0L) - return 119; - if ((active1 & 0x20000L) != 0L) - { - if (jjmatchedPos != 1) - { - jjmatchedKind = 153; - jjmatchedPos = 1; - } - return 8; - } - return -1; - case 2: - if ((active1 & 0x400L) != 0L) - { - if (jjmatchedPos != 2) - { - jjmatchedKind = 153; - jjmatchedPos = 2; - } - return 65; - } - if ((active0 & 0x7a37977bcbbc0000L) != 0L || (active1 & 0x1f8ffL) != 0L || (active2 & 0x808L) != 0L) - { - if (jjmatchedPos != 2) - { - jjmatchedKind = 153; - jjmatchedPos = 2; - } - return 119; - } - if ((active0 & 0x8408688430400000L) != 0L || (active1 & 0x20100L) != 0L) - return 119; - return -1; - case 3: - if ((active0 & 0x50339759c3dc0000L) != 0L || (active1 & 0x1f972L) != 0L || (active2 & 0x8L) != 0L) - { - jjmatchedKind = 153; - jjmatchedPos = 3; - return 119; - } - if ((active0 & 0x2204000208000000L) != 0L || (active1 & 0x40dL) != 0L || (active2 & 0x800L) != 0L) - return 119; - if ((active0 & 0x800002000200000L) != 0L || (active1 & 0x80L) != 0L) - { - jjmatchedKind = 153; - jjmatchedPos = 3; - return 65; - } - return -1; - case 4: - if ((active0 & 0x4833166941980000L) != 0L || (active1 & 0xb880L) != 0L || (active2 & 0x8L) != 0L) - { - jjmatchedKind = 153; - jjmatchedPos = 4; - return 119; - } - if ((active0 & 0x440000L) != 0L || (active1 & 0x100L) != 0L) - { - jjmatchedKind = 153; - jjmatchedPos = 4; - return 65; - } - if ((active0 & 0x1000811082200000L) != 0L || (active1 & 0x14072L) != 0L) - return 119; - return -1; - case 5: - if ((active0 & 0x31164040180000L) != 0L || (active1 & 0x1980L) != 0L || (active2 & 0x8L) != 0L) - { - jjmatchedKind = 153; - jjmatchedPos = 5; - return 119; - } - if ((active0 & 0x4802002901c00000L) != 0L || (active1 & 0xa000L) != 0L) - return 119; - if ((active0 & 0x40000L) != 0L) - { - jjmatchedKind = 153; - jjmatchedPos = 5; - return 66; - } - return -1; - case 6: - if ((active0 & 0x1000000000000L) != 0L) - { - jjmatchedKind = 153; - jjmatchedPos = 6; - return 65; - } - if ((active0 & 0x30060040080000L) != 0L || (active1 & 0x80L) != 0L || (active2 & 0x8L) != 0L) - { - jjmatchedKind = 153; - jjmatchedPos = 6; - return 119; - } - if ((active0 & 0x40000L) != 0L) - return 67; - if ((active0 & 0x104000100000L) != 0L || (active1 & 0x1900L) != 0L) - return 119; - return -1; - case 7: - if ((active0 & 0x1000000000000L) != 0L) - return 66; - if ((active0 & 0x20040080000L) != 0L || (active2 & 0x8L) != 0L) - { - if (jjmatchedPos != 7) - { - jjmatchedKind = 153; - jjmatchedPos = 7; - } - return 119; - } - if ((active0 & 0x30040000000000L) != 0L || (active1 & 0x80L) != 0L) - return 119; - return -1; - case 8: - if ((active0 & 0x20000000000L) != 0L || (active2 & 0x8L) != 0L) - { - jjmatchedKind = 153; - jjmatchedPos = 8; - return 119; - } - if ((active0 & 0x40080000L) != 0L) - return 119; - return -1; - default : - return -1; - } -} -private final int jjStartNfa_0(int pos, long active0, long active1, long active2){ - return jjMoveNfa_0(jjStopStringLiteralDfa_0(pos, active0, active1, active2), pos + 1); -} -private int jjStopAtPos(int pos, int kind) -{ - jjmatchedKind = kind; - jjmatchedPos = pos; - return pos + 1; -} -private int jjMoveStringLiteralDfa0_0(){ - switch(curChar) - { - case 33: - jjmatchedKind = 113; - return jjMoveStringLiteralDfa1_0(0x0L, 0x1200000000L, 0x0L); - case 37: - jjmatchedKind = 104; - return jjMoveStringLiteralDfa1_0(0x0L, 0x1000000000000000L, 0x0L); - case 38: - jjmatchedKind = 110; - return jjMoveStringLiteralDfa1_0(0x0L, 0x8000000000000L, 0x1L); - case 40: - return jjStopAtPos(0, 85); - case 41: - return jjStopAtPos(0, 86); - case 42: - jjmatchedKind = 103; - return jjMoveStringLiteralDfa1_0(0x0L, 0x800000000000000L, 0x0L); - case 43: - jjmatchedKind = 101; - return jjMoveStringLiteralDfa1_0(0x0L, 0x200020000000000L, 0x0L); - case 44: - return jjStopAtPos(0, 91); - case 45: - jjmatchedKind = 102; - return jjMoveStringLiteralDfa1_0(0x0L, 0x400040000000000L, 0x0L); - case 46: - return jjStartNfaWithStates_0(0, 89, 3); - case 47: - return jjMoveStringLiteralDfa1_0(0x6000L, 0x0L, 0x0L); - case 58: - jjmatchedKind = 119; - return jjMoveStringLiteralDfa1_0(0x0L, 0x40000000000000L, 0x0L); - case 59: - return jjStopAtPos(0, 90); - case 60: - jjmatchedKind = 92; - return jjMoveStringLiteralDfa1_0(0x0L, 0x2000080040000000L, 0x0L); - case 61: - jjmatchedKind = 120; - return jjMoveStringLiteralDfa1_0(0x0L, 0x900040000L, 0x0L); - case 62: - jjmatchedKind = 93; - return jjMoveStringLiteralDfa1_0(0x0L, 0xc000300080000000L, 0x0L); - case 63: - return jjStopAtPos(0, 117); - case 91: - return jjStopAtPos(0, 87); - case 93: - return jjStopAtPos(0, 88); - case 94: - jjmatchedKind = 112; - return jjMoveStringLiteralDfa1_0(0x0L, 0x0L, 0x4L); - case 97: - return jjMoveStringLiteralDfa1_0(0x3002080000L, 0x0L, 0x0L); - case 98: - return jjMoveStringLiteralDfa1_0(0x800880000000L, 0x0L, 0x0L); - case 99: - return jjMoveStringLiteralDfa1_0(0x1010068100000L, 0x78L, 0x0L); - case 100: - return jjMoveStringLiteralDfa1_0(0x2108000000000L, 0x380L, 0x0L); - case 101: - return jjMoveStringLiteralDfa1_0(0x204080200000000L, 0xc00L, 0x0L); - case 102: - return jjMoveStringLiteralDfa1_0(0x38040000000000L, 0x1000L, 0x0L); - case 105: - return jjMoveStringLiteralDfa1_0(0xc0020100240000L, 0x2000L, 0x8L); - case 110: - return jjMoveStringLiteralDfa1_0(0x400000000000000L, 0x0L, 0x800L); - case 111: - return jjMoveStringLiteralDfa1_0(0x100000400400000L, 0x0L, 0x0L); - case 112: - return jjMoveStringLiteralDfa1_0(0x400000000000L, 0x0L, 0x0L); - case 114: - return jjMoveStringLiteralDfa1_0(0x800004010000000L, 0x0L, 0x0L); - case 115: - return jjMoveStringLiteralDfa1_0(0x200001800000L, 0xc000L, 0x0L); - case 116: - return jjMoveStringLiteralDfa1_0(0x6000000004000000L, 0x30000L, 0x0L); - case 118: - return jjMoveStringLiteralDfa1_0(0x8000000000000000L, 0x1L, 0x0L); - case 119: - return jjMoveStringLiteralDfa1_0(0x0L, 0x6L, 0x0L); - case 121: - return jjMoveStringLiteralDfa1_0(0x1000000000000000L, 0x0L, 0x0L); - case 123: - return jjStopAtPos(0, 83); - case 124: - jjmatchedKind = 111; - return jjMoveStringLiteralDfa1_0(0x0L, 0x10000000000000L, 0x2L); - case 125: - return jjStopAtPos(0, 84); - case 126: - jjmatchedKind = 114; - return jjMoveStringLiteralDfa1_0(0x0L, 0x400000000L, 0x0L); - default : - return jjMoveNfa_0(0, 0); - } -} -private int jjMoveStringLiteralDfa1_0(long active0, long active1, long active2){ - try { curChar = input_stream.readChar(); } - catch(java.io.IOException e) { - jjStopStringLiteralDfa_0(0, active0, active1, active2); - return 1; - } - switch(curChar) - { - case 38: - if ((active1 & 0x8000000000000L) != 0L) - return jjStopAtPos(1, 115); - break; - case 42: - if ((active0 & 0x4000L) != 0L) - return jjStopAtPos(1, 14); - break; - case 43: - if ((active1 & 0x20000000000L) != 0L) - return jjStopAtPos(1, 105); - break; - case 45: - if ((active1 & 0x40000000000L) != 0L) - return jjStopAtPos(1, 106); - break; - case 47: - if ((active0 & 0x2000L) != 0L) - return jjStopAtPos(1, 13); - break; - case 58: - if ((active1 & 0x40000000000000L) != 0L) - return jjStopAtPos(1, 118); - break; - case 60: - if ((active1 & 0x80000000000L) != 0L) - { - jjmatchedKind = 107; - jjmatchedPos = 1; - } - return jjMoveStringLiteralDfa2_0(active0, 0L, active1, 0x2000000000000000L, active2, 0L); - case 61: - if ((active1 & 0x40000000L) != 0L) - return jjStopAtPos(1, 94); - else if ((active1 & 0x80000000L) != 0L) - return jjStopAtPos(1, 95); - else if ((active1 & 0x100000000L) != 0L) - { - jjmatchedKind = 96; - jjmatchedPos = 1; - } - else if ((active1 & 0x200000000L) != 0L) - { - jjmatchedKind = 97; - jjmatchedPos = 1; - } - else if ((active1 & 0x400000000L) != 0L) - return jjStopAtPos(1, 98); - else if ((active1 & 0x200000000000000L) != 0L) - return jjStopAtPos(1, 121); - else if ((active1 & 0x400000000000000L) != 0L) - return jjStopAtPos(1, 122); - else if ((active1 & 0x800000000000000L) != 0L) - return jjStopAtPos(1, 123); - else if ((active1 & 0x1000000000000000L) != 0L) - return jjStopAtPos(1, 124); - else if ((active2 & 0x1L) != 0L) - return jjStopAtPos(1, 128); - else if ((active2 & 0x2L) != 0L) - return jjStopAtPos(1, 129); - else if ((active2 & 0x4L) != 0L) - return jjStopAtPos(1, 130); - return jjMoveStringLiteralDfa2_0(active0, 0L, active1, 0x1800000000L, active2, 0L); - case 62: - if ((active1 & 0x40000L) != 0L) - return jjStopAtPos(1, 82); - else if ((active1 & 0x100000000000L) != 0L) - { - jjmatchedKind = 108; - jjmatchedPos = 1; - } - return jjMoveStringLiteralDfa2_0(active0, 0L, active1, 0xc000200000000000L, active2, 0L); - case 97: - return jjMoveStringLiteralDfa2_0(active0, 0x8200400008000000L, active1, 0x18L, active2, 0L); - case 101: - return jjMoveStringLiteralDfa2_0(active0, 0xc0220c881000000L, active1, 0x180L, active2, 0L); - case 102: - if ((active0 & 0x40000000000000L) != 0L) - return jjStartNfaWithStates_0(1, 54, 119); - else if ((active0 & 0x100000000000000L) != 0L) - return jjStartNfaWithStates_0(1, 56, 119); - return jjMoveStringLiteralDfa2_0(active0, 0x1000000000L, active1, 0L, active2, 0L); - case 104: - return jjMoveStringLiteralDfa2_0(active0, 0x2000010000000000L, active1, 0x10002L, active2, 0L); - case 105: - return jjMoveStringLiteralDfa2_0(active0, 0x1000040000000000L, active1, 0x1004L, active2, 0L); - case 108: - return jjMoveStringLiteralDfa2_0(active0, 0x4000000000000L, active1, 0x20L, active2, 0L); - case 109: - return jjMoveStringLiteralDfa2_0(active0, 0x20000000L, active1, 0x2000L, active2, 0L); - case 110: - if ((active0 & 0x80000000000000L) != 0L) - { - jjmatchedKind = 55; - jjmatchedPos = 1; - } - return jjMoveStringLiteralDfa2_0(active0, 0xa0100240000L, active1, 0x400L, active2, 0x8L); - case 111: - if ((active0 & 0x4000000L) != 0L) - return jjStartNfaWithStates_0(1, 26, 119); - else if ((active1 & 0x200L) != 0L) - return jjStartNfaWithStates_0(1, 73, 119); - return jjMoveStringLiteralDfa2_0(active0, 0x9000040100000L, active1, 0x41L, active2, 0L); - case 112: - return jjMoveStringLiteralDfa2_0(active0, 0x2000000L, active1, 0L, active2, 0L); - case 114: - return jjMoveStringLiteralDfa2_0(active0, 0x802000000000L, active1, 0x20000L, active2, 0L); - case 115: - return jjMoveStringLiteralDfa2_0(active0, 0x80000L, active1, 0L, active2, 0L); - case 116: - return jjMoveStringLiteralDfa2_0(active0, 0x800000L, active1, 0L, active2, 0L); - case 117: - return jjMoveStringLiteralDfa2_0(active0, 0x30000410400000L, active1, 0x4000L, active2, 0x800L); - case 119: - return jjMoveStringLiteralDfa2_0(active0, 0L, active1, 0x8000L, active2, 0L); - case 120: - return jjMoveStringLiteralDfa2_0(active0, 0x200000000L, active1, 0x800L, active2, 0L); - case 121: - return jjMoveStringLiteralDfa2_0(active0, 0x4000100000000000L, active1, 0L, active2, 0L); - case 124: - if ((active1 & 0x10000000000000L) != 0L) - return jjStopAtPos(1, 116); - break; - default : - break; - } - return jjStartNfa_0(0, active0, active1, active2); -} -private int jjMoveStringLiteralDfa2_0(long old0, long active0, long old1, long active1, long old2, long active2){ - if (((active0 &= old0) | (active1 &= old1) | (active2 &= old2)) == 0L) - return jjStartNfa_0(0, old0, old1, old2); - try { curChar = input_stream.readChar(); } - catch(java.io.IOException e) { - jjStopStringLiteralDfa_0(1, active0, active1, active2); - return 2; - } - switch(curChar) - { - case 61: - if ((active1 & 0x800000000L) != 0L) - return jjStopAtPos(2, 99); - else if ((active1 & 0x1000000000L) != 0L) - return jjStopAtPos(2, 100); - else if ((active1 & 0x2000000000000000L) != 0L) - return jjStopAtPos(2, 125); - else if ((active1 & 0x4000000000000000L) != 0L) - return jjStopAtPos(2, 126); - break; - case 62: - if ((active1 & 0x200000000000L) != 0L) - { - jjmatchedKind = 109; - jjmatchedPos = 2; - } - return jjMoveStringLiteralDfa3_0(active0, 0L, active1, 0x8000000000000000L, active2, 0L); - case 97: - return jjMoveStringLiteralDfa3_0(active0, 0x800000L, active1, 0x20L, active2, 0L); - case 98: - return jjMoveStringLiteralDfa3_0(active0, 0L, active1, 0x80L, active2, 0L); - case 99: - return jjMoveStringLiteralDfa3_0(active0, 0x200000000040000L, active1, 0L, active2, 0L); - case 100: - if ((active0 & 0x20000000L) != 0L) - return jjStartNfaWithStates_0(2, 29, 119); - else if ((active0 & 0x80000000000L) != 0L) - return jjStartNfaWithStates_0(2, 43, 119); - return jjMoveStringLiteralDfa3_0(active0, 0x100000L, active1, 0L, active2, 0L); - case 101: - return jjMoveStringLiteralDfa3_0(active0, 0x1000810200000000L, active1, 0L, active2, 0L); - case 102: - if ((active0 & 0x8000000000L) != 0L) - { - jjmatchedKind = 39; - jjmatchedPos = 2; - } - return jjMoveStringLiteralDfa3_0(active0, 0x800000000L, active1, 0x100L, active2, 0L); - case 103: - return jjMoveStringLiteralDfa3_0(active0, 0x80000000L, active1, 0L, active2, 0L); - case 105: - return jjMoveStringLiteralDfa3_0(active0, 0x2000020000000000L, active1, 0x8003L, active2, 0L); - case 108: - return jjMoveStringLiteralDfa3_0(active0, 0x2000009000000L, active1, 0L, active2, 0x800L); - case 110: - if ((active0 & 0x10000000L) != 0L) - return jjStartNfaWithStates_0(2, 28, 119); - return jjMoveStringLiteralDfa3_0(active0, 0x31140040000000L, active1, 0x1040L, active2, 0L); - case 111: - return jjMoveStringLiteralDfa3_0(active0, 0x2000000000L, active1, 0L, active2, 0L); - case 112: - return jjMoveStringLiteralDfa3_0(active0, 0x4000004002280000L, active1, 0x6000L, active2, 0L); - case 113: - if ((active0 & 0x200000000000L) != 0L) - return jjStartNfaWithStates_0(2, 45, 119); - break; - case 114: - if ((active0 & 0x400000000000L) != 0L) - return jjStartNfaWithStates_0(2, 46, 119); - else if ((active0 & 0x8000000000000L) != 0L) - return jjStartNfaWithStates_0(2, 51, 119); - else if ((active0 & 0x8000000000000000L) != 0L) - return jjStartNfaWithStates_0(2, 63, 119); - return jjMoveStringLiteralDfa3_0(active0, 0L, active1, 0x10000L, active2, 0L); - case 115: - return jjMoveStringLiteralDfa3_0(active0, 0x4000100000000L, active1, 0x8L, active2, 0x8L); - case 116: - if ((active0 & 0x400000000L) != 0L) - { - jjmatchedKind = 34; - jjmatchedPos = 2; - } - return jjMoveStringLiteralDfa3_0(active0, 0x800001000400000L, active1, 0x814L, active2, 0L); - case 117: - return jjMoveStringLiteralDfa3_0(active0, 0L, active1, 0x400L, active2, 0L); - case 119: - if ((active0 & 0x400000000000000L) != 0L) - return jjStartNfaWithStates_0(2, 58, 119); - break; - case 121: - if ((active1 & 0x20000L) != 0L) - return jjStartNfaWithStates_0(2, 81, 119); - break; - default : - break; - } - return jjStartNfa_0(1, active0, active1, active2); -} -private int jjMoveStringLiteralDfa3_0(long old0, long active0, long old1, long active1, long old2, long active2){ - if (((active0 &= old0) | (active1 &= old1) | (active2 &= old2)) == 0L) - return jjStartNfa_0(1, old0, old1, old2); - try { curChar = input_stream.readChar(); } - catch(java.io.IOException e) { - jjStopStringLiteralDfa_0(2, active0, active1, active2); - return 3; - } - switch(curChar) - { - case 61: - if ((active1 & 0x8000000000000000L) != 0L) - return jjStopAtPos(3, 127); - break; - case 97: - return jjMoveStringLiteralDfa4_0(active0, 0x940000000000L, active1, 0x1100L, active2, 0L); - case 99: - if ((active0 & 0x200000000L) != 0L) - return jjStartNfaWithStates_0(3, 33, 119); - return jjMoveStringLiteralDfa4_0(active0, 0x30010000000000L, active1, 0x10L, active2, 0L); - case 100: - if ((active1 & 0x1L) != 0L) - return jjStartNfaWithStates_0(3, 64, 119); - return jjMoveStringLiteralDfa4_0(active0, 0x40000000L, active1, 0L, active2, 0L); - case 101: - if ((active0 & 0x4000000000000L) != 0L) - return jjStartNfaWithStates_0(3, 50, 119); - else if ((active1 & 0x8L) != 0L) - return jjStartNfaWithStates_0(3, 67, 119); - return jjMoveStringLiteralDfa4_0(active0, 0x4002001101180000L, active1, 0x4800L, active2, 0L); - case 104: - if ((active0 & 0x200000000000000L) != 0L) - return jjStartNfaWithStates_0(3, 57, 119); - else if ((active1 & 0x4L) != 0L) - return jjStartNfaWithStates_0(3, 66, 119); - break; - case 105: - return jjMoveStringLiteralDfa4_0(active0, 0x80000000L, active1, 0L, active2, 0L); - case 108: - if ((active0 & 0x8000000L) != 0L) - return jjStartNfaWithStates_0(3, 27, 119); - else if ((active2 & 0x800L) != 0L) - return jjStartNfaWithStates_0(3, 139, 119); - return jjMoveStringLiteralDfa4_0(active0, 0x1000004002040000L, active1, 0x2L, active2, 0L); - case 109: - if ((active1 & 0x400L) != 0L) - return jjStartNfaWithStates_0(3, 74, 119); - break; - case 111: - return jjMoveStringLiteralDfa4_0(active0, 0x800000000L, active1, 0x12000L, active2, 0L); - case 112: - return jjMoveStringLiteralDfa4_0(active0, 0x400000L, active1, 0L, active2, 0L); - case 115: - if ((active0 & 0x2000000000000000L) != 0L) - return jjStartNfaWithStates_0(3, 61, 119); - return jjMoveStringLiteralDfa4_0(active0, 0L, active1, 0x60L, active2, 0L); - case 116: - return jjMoveStringLiteralDfa4_0(active0, 0x1020000800000L, active1, 0x8000L, active2, 0x8L); - case 117: - return jjMoveStringLiteralDfa4_0(active0, 0x800002000200000L, active1, 0x80L, active2, 0L); - default : - break; - } - return jjStartNfa_0(2, active0, active1, active2); -} -private int jjMoveStringLiteralDfa4_0(long old0, long active0, long old1, long active1, long old2, long active2){ - if (((active0 &= old0) | (active1 &= old1) | (active2 &= old2)) == 0L) - return jjStartNfa_0(2, old0, old1, old2); - try { curChar = input_stream.readChar(); } - catch(java.io.IOException e) { - jjStopStringLiteralDfa_0(3, active0, active1, active2); - return 4; - } - switch(curChar) - { - case 97: - return jjMoveStringLiteralDfa5_0(active0, 0x4000000000L, active1, 0L, active2, 0x8L); - case 99: - return jjMoveStringLiteralDfa5_0(active0, 0x1080000L, active1, 0x8000L, active2, 0L); - case 100: - if ((active0 & 0x1000000000000000L) != 0L) - return jjStartNfaWithStates_0(4, 60, 119); - return jjMoveStringLiteralDfa5_0(active0, 0x100000L, active1, 0L, active2, 0L); - case 101: - if ((active1 & 0x2L) != 0L) - return jjStartNfaWithStates_0(4, 65, 119); - break; - case 103: - return jjMoveStringLiteralDfa5_0(active0, 0L, active1, 0x80L, active2, 0L); - case 104: - if ((active1 & 0x10L) != 0L) - return jjStartNfaWithStates_0(4, 68, 119); - break; - case 105: - return jjMoveStringLiteralDfa5_0(active0, 0x1020040800000L, active1, 0L, active2, 0L); - case 107: - if ((active0 & 0x10000000000L) != 0L) - return jjStartNfaWithStates_0(4, 40, 119); - else if ((active0 & 0x800000000000L) != 0L) - return jjStartNfaWithStates_0(4, 47, 119); - break; - case 108: - return jjMoveStringLiteralDfa5_0(active0, 0x40000000000L, active1, 0x1000L, active2, 0L); - case 109: - return jjMoveStringLiteralDfa5_0(active0, 0x100000000000L, active1, 0L, active2, 0L); - case 110: - if ((active0 & 0x80000000L) != 0L) - return jjStartNfaWithStates_0(4, 31, 119); - return jjMoveStringLiteralDfa5_0(active0, 0x2000000000L, active1, 0x800L, active2, 0L); - case 111: - return jjMoveStringLiteralDfa5_0(active0, 0x4000000000000000L, active1, 0L, active2, 0L); - case 114: - if ((active0 & 0x1000000000L) != 0L) - return jjStartNfaWithStates_0(4, 36, 119); - else if ((active1 & 0x4000L) != 0L) - return jjStartNfaWithStates_0(4, 78, 119); - return jjMoveStringLiteralDfa5_0(active0, 0x800000900000000L, active1, 0x2000L, active2, 0L); - case 115: - if ((active1 & 0x20L) != 0L) - return jjStartNfaWithStates_0(4, 69, 119); - break; - case 116: - if ((active0 & 0x200000L) != 0L) - return jjStartNfaWithStates_0(4, 21, 119); - else if ((active1 & 0x40L) != 0L) - return jjStartNfaWithStates_0(4, 70, 119); - return jjMoveStringLiteralDfa5_0(active0, 0x32000000000000L, active1, 0L, active2, 0L); - case 117: - return jjMoveStringLiteralDfa5_0(active0, 0x440000L, active1, 0x100L, active2, 0L); - case 119: - if ((active1 & 0x10000L) != 0L) - return jjStartNfaWithStates_0(4, 80, 119); - break; - case 121: - if ((active0 & 0x2000000L) != 0L) - return jjStartNfaWithStates_0(4, 25, 119); - break; - default : - break; - } - return jjStartNfa_0(3, active0, active1, active2); -} -private int jjMoveStringLiteralDfa5_0(long old0, long active0, long old1, long active1, long old2, long active2){ - if (((active0 &= old0) | (active1 &= old1) | (active2 &= old2)) == 0L) - return jjStartNfa_0(3, old0, old1, old2); - try { curChar = input_stream.readChar(); } - catch(java.io.IOException e) { - jjStopStringLiteralDfa_0(4, active0, active1, active2); - return 5; - } - switch(curChar) - { - case 97: - return jjMoveStringLiteralDfa6_0(active0, 0x20000000000L, active1, 0L, active2, 0L); - case 99: - if ((active0 & 0x800000L) != 0L) - return jjStartNfaWithStates_0(5, 23, 119); - return jjMoveStringLiteralDfa6_0(active0, 0x4000000000L, active1, 0L, active2, 0L); - case 100: - if ((active0 & 0x2000000000L) != 0L) - return jjStartNfaWithStates_0(5, 37, 119); - return jjMoveStringLiteralDfa6_0(active0, 0x40000L, active1, 0x800L, active2, 0L); - case 101: - if ((active0 & 0x800000000L) != 0L) - return jjStartNfaWithStates_0(5, 35, 119); - else if ((active0 & 0x2000000000000L) != 0L) - return jjStartNfaWithStates_0(5, 49, 119); - return jjMoveStringLiteralDfa6_0(active0, 0x100000L, active1, 0L, active2, 0L); - case 102: - if ((active0 & 0x4000000000000000L) != 0L) - return jjStartNfaWithStates_0(5, 62, 119); - break; - case 103: - return jjMoveStringLiteralDfa6_0(active0, 0L, active1, 0x80L, active2, 0L); - case 104: - if ((active1 & 0x8000L) != 0L) - return jjStartNfaWithStates_0(5, 79, 119); - break; - case 105: - return jjMoveStringLiteralDfa6_0(active0, 0x30140000000000L, active1, 0L, active2, 0L); - case 108: - return jjMoveStringLiteralDfa6_0(active0, 0L, active1, 0x1100L, active2, 0L); - case 110: - if ((active0 & 0x800000000000000L) != 0L) - return jjStartNfaWithStates_0(5, 59, 119); - return jjMoveStringLiteralDfa6_0(active0, 0x1000000000000L, active1, 0L, active2, 0x8L); - case 116: - if ((active0 & 0x400000L) != 0L) - return jjStartNfaWithStates_0(5, 22, 119); - else if ((active0 & 0x1000000L) != 0L) - return jjStartNfaWithStates_0(5, 24, 119); - else if ((active0 & 0x100000000L) != 0L) - return jjStartNfaWithStates_0(5, 32, 119); - else if ((active1 & 0x2000L) != 0L) - return jjStartNfaWithStates_0(5, 77, 119); - return jjMoveStringLiteralDfa6_0(active0, 0x40080000L, active1, 0L, active2, 0L); - default : - break; - } - return jjStartNfa_0(4, active0, active1, active2); -} -private int jjMoveStringLiteralDfa6_0(long old0, long active0, long old1, long active1, long old2, long active2){ - if (((active0 &= old0) | (active1 &= old1) | (active2 &= old2)) == 0L) - return jjStartNfa_0(4, old0, old1, old2); - try { curChar = input_stream.readChar(); } - catch(java.io.IOException e) { - jjStopStringLiteralDfa_0(5, active0, active1, active2); - return 6; - } - switch(curChar) - { - case 99: - if ((active0 & 0x100000000000L) != 0L) - return jjStartNfaWithStates_0(6, 44, 119); - return jjMoveStringLiteralDfa7_0(active0, 0L, active1, 0L, active2, 0x8L); - case 100: - return jjMoveStringLiteralDfa7_0(active0, 0x80000L, active1, 0L, active2, 0L); - case 101: - if ((active0 & 0x40000L) != 0L) - return jjStartNfaWithStates_0(6, 18, 67); - else if ((active0 & 0x4000000000L) != 0L) - return jjStartNfaWithStates_0(6, 38, 119); - return jjMoveStringLiteralDfa7_0(active0, 0L, active1, 0x80L, active2, 0L); - case 102: - if ((active0 & 0x100000L) != 0L) - return jjStartNfaWithStates_0(6, 20, 119); - break; - case 105: - return jjMoveStringLiteralDfa7_0(active0, 0x40000000L, active1, 0L, active2, 0L); - case 108: - return jjMoveStringLiteralDfa7_0(active0, 0x20000000000L, active1, 0L, active2, 0L); - case 111: - return jjMoveStringLiteralDfa7_0(active0, 0x30000000000000L, active1, 0L, active2, 0L); - case 115: - if ((active1 & 0x800L) != 0L) - return jjStartNfaWithStates_0(6, 75, 119); - break; - case 116: - if ((active1 & 0x100L) != 0L) - return jjStartNfaWithStates_0(6, 72, 119); - break; - case 117: - return jjMoveStringLiteralDfa7_0(active0, 0x1000000000000L, active1, 0L, active2, 0L); - case 121: - if ((active1 & 0x1000L) != 0L) - return jjStartNfaWithStates_0(6, 76, 119); - break; - case 122: - return jjMoveStringLiteralDfa7_0(active0, 0x40000000000L, active1, 0L, active2, 0L); - default : - break; - } - return jjStartNfa_0(5, active0, active1, active2); -} -private int jjMoveStringLiteralDfa7_0(long old0, long active0, long old1, long active1, long old2, long active2){ - if (((active0 &= old0) | (active1 &= old1) | (active2 &= old2)) == 0L) - return jjStartNfa_0(5, old0, old1, old2); - try { curChar = input_stream.readChar(); } - catch(java.io.IOException e) { - jjStopStringLiteralDfa_0(6, active0, active1, active2); - return 7; - } - switch(curChar) - { - case 101: - if ((active0 & 0x40000000000L) != 0L) - return jjStartNfaWithStates_0(7, 42, 119); - else if ((active0 & 0x1000000000000L) != 0L) - return jjStartNfaWithStates_0(7, 48, 66); - return jjMoveStringLiteralDfa8_0(active0, 0x80000L, active1, 0L, active2, 0x8L); - case 105: - return jjMoveStringLiteralDfa8_0(active0, 0x20000000000L, active1, 0L, active2, 0L); - case 110: - if ((active0 & 0x10000000000000L) != 0L) - { - jjmatchedKind = 52; - jjmatchedPos = 7; - } - return jjMoveStringLiteralDfa8_0(active0, 0x20000000000000L, active1, 0L, active2, 0L); - case 111: - return jjMoveStringLiteralDfa8_0(active0, 0x40000000L, active1, 0L, active2, 0L); - case 114: - if ((active1 & 0x80L) != 0L) - return jjStartNfaWithStates_0(7, 71, 119); - break; - default : - break; - } - return jjStartNfa_0(6, active0, active1, active2); -} -private int jjMoveStringLiteralDfa8_0(long old0, long active0, long old1, long active1, long old2, long active2){ - if (((active0 &= old0) | (active1 &= old1) | (active2 &= old2)) == 0L) - return jjStartNfa_0(6, old0, old1, old2); - try { curChar = input_stream.readChar(); } - catch(java.io.IOException e) { - jjStopStringLiteralDfa_0(7, active0, 0L, active2); - return 8; - } - switch(curChar) - { - case 42: - if ((active0 & 0x20000000000000L) != 0L) - return jjStopAtPos(8, 53); - break; - case 102: - if ((active0 & 0x80000L) != 0L) - return jjStartNfaWithStates_0(8, 19, 119); - break; - case 110: - if ((active0 & 0x40000000L) != 0L) - return jjStartNfaWithStates_0(8, 30, 119); - break; - case 111: - return jjMoveStringLiteralDfa9_0(active0, 0L, active2, 0x8L); - case 122: - return jjMoveStringLiteralDfa9_0(active0, 0x20000000000L, active2, 0L); - default : - break; - } - return jjStartNfa_0(7, active0, 0L, active2); -} -private int jjMoveStringLiteralDfa9_0(long old0, long active0, long old2, long active2){ - if (((active0 &= old0) | (active2 &= old2)) == 0L) - return jjStartNfa_0(7, old0, 0L, old2); - try { curChar = input_stream.readChar(); } - catch(java.io.IOException e) { - jjStopStringLiteralDfa_0(8, active0, 0L, active2); - return 9; - } - switch(curChar) - { - case 101: - if ((active0 & 0x20000000000L) != 0L) - return jjStartNfaWithStates_0(9, 41, 119); - break; - case 102: - if ((active2 & 0x8L) != 0L) - return jjStartNfaWithStates_0(9, 131, 119); - break; - default : - break; - } - return jjStartNfa_0(8, active0, 0L, active2); -} -private int jjStartNfaWithStates_0(int pos, int kind, int state) -{ - jjmatchedKind = kind; - jjmatchedPos = pos; - try { curChar = input_stream.readChar(); } - catch(java.io.IOException e) { return pos + 1; } - return jjMoveNfa_0(state, pos + 1); -} -static final long[] jjbitVec0 = { - 0x0L, 0x0L, 0x100000000L, 0x0L -}; -static final long[] jjbitVec1 = { - 0x30000000000L, 0x0L, 0x0L, 0x0L -}; -static final long[] jjbitVec2 = { - 0xfffffffefffffffeL, 0xffffffffffffffffL, 0xffffffffffffffffL, 0xffffffffffffffffL -}; -static final long[] jjbitVec4 = { - 0x0L, 0x0L, 0xffffffffffffffffL, 0xffffffffffffffffL -}; -static final long[] jjbitVec5 = { - 0xfffffcffffffffffL, 0xffffffffffffffffL, 0xffffffffffffffffL, 0xffffffffffffffffL -}; -static final long[] jjbitVec6 = { - 0xfffffffffffffffeL, 0xffffffffffffffffL, 0xffffffffffffffffL, 0xffffffffffffffffL -}; -static final long[] jjbitVec7 = { - 0x200002L, 0x0L, 0xf00000000L, 0x1200000000000000L -}; -static final long[] jjbitVec8 = { - 0x10000000000000L, 0x4000L, 0x100000000000L, 0x0L -}; -static final long[] jjbitVec9 = { - 0x1L, 0x0L, 0x0L, 0x0L -}; -static final long[] jjbitVec10 = { - 0x0L, 0x0L, 0x420040000000000L, 0xff7fffffff7fffffL -}; -static final long[] jjbitVec11 = { - 0xffffcffffffffL, 0xffffffffffff0000L, 0xf9ff3fffffffffffL, 0x401f00030003L -}; -static final long[] jjbitVec12 = { - 0xffffffffffffffffL, 0x400000700007fffL, 0xfffffffbffffd740L, 0xffffffcff7fffL -}; -static final long[] jjbitVec13 = { - 0xffffffffffffffffL, 0xffffffffffffffffL, 0xfffffffffffff07bL, 0x33fffffffff199fL -}; -static final long[] jjbitVec14 = { - 0xfffe000000000000L, 0xfffffffe027fffffL, 0xbbfffffbfffe00ffL, 0x707ffffff0016L -}; -static final long[] jjbitVec15 = { - 0x7fffffe00000000L, 0xffff03ff003fffffL, 0xffffffffffffffffL, 0x1fff3dff9fefffffL -}; -static final long[] jjbitVec16 = { - 0xffff1fffffff0000L, 0x7ffL, 0x1ffffffffffffL, 0x0L -}; -static final long[] jjbitVec17 = { - 0xf3ffffffffffffeeL, 0xffcfff1f3fffL, 0xf3c5fdfffff99feeL, 0x3ffcfb080399fL -}; -static final long[] jjbitVec18 = { - 0xd36dfdfffff987ecL, 0x1fffc05e003987L, 0xf3edfdfffffbafeeL, 0xffc100013bbfL -}; -static final long[] jjbitVec19 = { - 0xf3cdfdfffff99feeL, 0xffc3b0c0398fL, 0xc3bfc718d63dc7ecL, 0xff8000803dc7L -}; -static final long[] jjbitVec20 = { - 0xc3effdfffffddfeeL, 0xffc300603ddfL, 0xc3effdfffffddfecL, 0xffc340603ddfL -}; -static final long[] jjbitVec21 = { - 0xc3fffdfffffddfecL, 0xffc300803dcfL, 0x2ffbfffffc7fffecL, 0xc0000ff5f847fL -}; -static final long[] jjbitVec22 = { - 0x7fffffffffffffeL, 0x3ff7fffL, 0xfbffecaefef02596L, 0x33ff3f5fL -}; -static final long[] jjbitVec23 = { - 0xc2a003ff03000001L, 0xfffe07ffffffffffL, 0x1ffffffffeff0fdfL, 0x40L -}; -static final long[] jjbitVec24 = { - 0x3c7f6fbffffffffL, 0x3ff03ffL, 0xffffffff00000000L, 0x7fffffffff003fL -}; -static final long[] jjbitVec25 = { - 0xffffffffffffffffL, 0xffffffff83ffffffL, 0xffffff07ffffffffL, 0x3ffffffffffffffL -}; -static final long[] jjbitVec26 = { - 0xffffffffffffff7fL, 0xffffffff3d7f3d7fL, 0x7f3d7fffffff3d7fL, 0xffff7fffff7f7f3dL -}; -static final long[] jjbitVec27 = { - 0xffffffff7f3d7fffL, 0x3fe0007ffff7fL, 0xffffffff00000000L, 0x1fffffffffffffL -}; -static final long[] jjbitVec28 = { - 0xffffffffffffffffL, 0x7fffffffffffffL, 0xffffffff07fffffeL, 0x7ffffffffffL -}; -static final long[] jjbitVec29 = { - 0x0L, 0x0L, 0xffffffffffffffffL, 0x3ff000fffffL -}; -static final long[] jjbitVec30 = { - 0xffffffff03ff0000L, 0xffffffffffffffL, 0x3ffffffffffL, 0x0L -}; -static final long[] jjbitVec31 = { - 0x1fb0e7800000000L, 0x0L, 0xffff000000000000L, 0x301L -}; -static final long[] jjbitVec32 = { - 0xe000000L, 0x0L, 0x0L, 0x0L -}; -static final long[] jjbitVec33 = { - 0xc00000L, 0x0L, 0x0L, 0x0L -}; -static final long[] jjbitVec34 = { - 0xffffffffffffffffL, 0xffffffffffffffffL, 0xffffffff0fffffffL, 0x3ffffffffffffffL -}; -static final long[] jjbitVec35 = { - 0xffffffff3f3fffffL, 0x3fffffffaaff3f3fL, 0x5fdfffffffffffffL, 0x1fdc1fff0fcf1fdcL -}; -static final long[] jjbitVec36 = { - 0x8000000000000000L, 0x8000000000000001L, 0x0L, 0x21fff0000L -}; -static final long[] jjbitVec37 = { - 0x3fbbd503e2ffc84L, 0xffffffff00000000L, 0xfL, 0x0L -}; -static final long[] jjbitVec38 = { - 0x73efffe000000e0L, 0xfffffffffffffffeL, 0xfffffffe661fffffL, 0x7fffffffffffffffL -}; -static final long[] jjbitVec39 = { - 0xfffe1fffffffffe0L, 0xffffffffffffffffL, 0xffffff00007fffL, 0x0L -}; -static final long[] jjbitVec40 = { - 0x0L, 0x0L, 0x20000000000000L, 0x0L -}; -static final long[] jjbitVec41 = { - 0x0L, 0x0L, 0x2000000000L, 0x0L -}; -static final long[] jjbitVec42 = { - 0xffffffffffffffffL, 0xffffffffffffffffL, 0x1fffL, 0x0L -}; -static final long[] jjbitVec43 = { - 0x9800000004L, 0x0L, 0x0L, 0x0L -}; -static final long[] jjbitVec44 = { - 0x0L, 0x0L, 0x800000000L, 0x0L -}; -static final long[] jjbitVec45 = { - 0x3fffffffffffL, 0x0L, 0x0L, 0x0L -}; -static final long[] jjbitVec46 = { - 0x5f7ffdffe0f8007fL, 0xffffffffffffffdbL, 0x3ffffffffffffL, 0xfffffffffff80000L -}; -static final long[] jjbitVec47 = { - 0x3fffffffffffffffL, 0xffffffffffff0000L, 0xfffffffffffcffffL, 0xfff0000000000ffL -}; -static final long[] jjbitVec48 = { - 0x18000f00000000L, 0xffd700000000e000L, 0xffffffffffffffffL, 0x1fffffffffffffffL -}; -static final long[] jjbitVec49 = { - 0x87fffffe03ff0000L, 0xffffffe007fffffeL, 0x7fffffffffffffffL, 0x1cfcfcfcL -}; -static final long[] jjbitVec50 = { - 0x0L, 0x400000000000000L, 0xfffffffbffffd740L, 0xffffffcff7fffL -}; -static final long[] jjbitVec51 = { - 0xffffffffffffffffL, 0xffffffffffffffffL, 0xfffffffffffff003L, 0x33fffffffff199fL -}; -static final long[] jjbitVec52 = { - 0xfffe000000000000L, 0xfffffffe027fffffL, 0xffL, 0x707ffffff0000L -}; -static final long[] jjbitVec53 = { - 0x7fffffe00000000L, 0xfffe0000000007ffL, 0xffffffffffffffffL, 0x1c000060002fffffL -}; -static final long[] jjbitVec54 = { - 0x1ffffffd0000L, 0x0L, 0x3fffffffffL, 0x0L -}; -static final long[] jjbitVec55 = { - 0x23ffffffffffffe0L, 0x3ff010000L, 0x3c5fdfffff99fe0L, 0x30003b0000000L -}; -static final long[] jjbitVec56 = { - 0x36dfdfffff987e0L, 0x1c00005e000000L, 0x23edfdfffffbafe0L, 0x100010000L -}; -static final long[] jjbitVec57 = { - 0x23cdfdfffff99fe0L, 0x3b0000000L, 0x3bfc718d63dc7e0L, 0x0L -}; -static final long[] jjbitVec58 = { - 0x3effdfffffddfe0L, 0x300000000L, 0x3effdfffffddfe0L, 0x340000000L -}; -static final long[] jjbitVec59 = { - 0x3fffdfffffddfe0L, 0x300000000L, 0x2ffbfffffc7fffe0L, 0x7fL -}; -static final long[] jjbitVec60 = { - 0xdfffffffffffeL, 0x7fL, 0xe00decaefef02596L, 0x3000005fL -}; -static final long[] jjbitVec61 = { - 0x1L, 0x7ffffffffffL, 0xf00L, 0x0L -}; -static final long[] jjbitVec62 = { - 0x6fbffffffffL, 0x3f0000L, 0xffffffff00000000L, 0x7fffffffff003fL -}; -static final long[] jjbitVec63 = { - 0xffffffff7f3d7fffL, 0x7ffff7fL, 0xffffffff00000000L, 0x1fffffffffffffL -}; -static final long[] jjbitVec64 = { - 0x0L, 0x0L, 0xfffffffffffffL, 0x0L -}; -static final long[] jjbitVec65 = { - 0xffffffff00000000L, 0xffffffffffffffL, 0x1ffffffffffL, 0x0L -}; -static final long[] jjbitVec66 = { - 0x0L, 0x8000000000000000L, 0x0L, 0x0L -}; -static final long[] jjbitVec67 = { - 0x73e03fe000000e0L, 0xfffffffffffffffeL, 0xfffffffe601fffffL, 0x77ffffffffffffffL -}; -static final long[] jjbitVec68 = { - 0x5f7ffdffa0f8007fL, 0xffffffffffffffdbL, 0x3ffffffffffffL, 0xfffffffffff80000L -}; -static final long[] jjbitVec69 = { - 0x0L, 0xffd7000000000000L, 0xffffffffffffffffL, 0x1fffffffffffffffL -}; -static final long[] jjbitVec70 = { - 0x7fffffe00000000L, 0xffffffc007fffffeL, 0x7fffffffffffffffL, 0x1cfcfcfcL -}; -static final long[] jjbitVec71 = { - 0xffffffffffffffffL, 0x700007fffL, 0x0L, 0x0L -}; -static final long[] jjbitVec72 = { - 0x0L, 0x0L, 0x78L, 0x0L -}; -static final long[] jjbitVec73 = { - 0x0L, 0x0L, 0xbbfffffbfffe0000L, 0x16L -}; -static final long[] jjbitVec74 = { - 0x0L, 0x10000003ff800L, 0x0L, 0x3d9f9fc00000L -}; -static final long[] jjbitVec75 = { - 0xffff000000020000L, 0x7ffL, 0x1ffc000000000L, 0x0L -}; -static final long[] jjbitVec76 = { - 0xd00000000000000eL, 0xc001e3fffL, 0xf00000000000000eL, 0xc0080399fL -}; -static final long[] jjbitVec77 = { - 0xd00000000000000cL, 0x3000000003987L, 0xd00000000000000eL, 0x3bbfL -}; -static final long[] jjbitVec78 = { - 0xd00000000000000eL, 0xc0398fL, 0xc00000000000000cL, 0x803dc7L -}; -static final long[] jjbitVec79 = { - 0xc00000000000000eL, 0x603ddfL, 0xc00000000000000cL, 0x603ddfL -}; -static final long[] jjbitVec80 = { - 0xc00000000000000cL, 0x803dcfL, 0xcL, 0xc0000ff5f8400L -}; -static final long[] jjbitVec81 = { - 0x7f2000000000000L, 0x7f80L, 0x1bf2000000000000L, 0x3f00L -}; -static final long[] jjbitVec82 = { - 0xc2a0000003000000L, 0xfffe000000000000L, 0x1ffffffffeff00dfL, 0x40L -}; -static final long[] jjbitVec83 = { - 0x3c7f00000000000L, 0x3c00000L, 0x0L, 0x0L -}; -static final long[] jjbitVec84 = { - 0x0L, 0x0L, 0xfff0000000000000L, 0xfffffL -}; -static final long[] jjbitVec85 = { - 0x0L, 0x0L, 0x20000000000L, 0x0L -}; -static final long[] jjbitVec86 = { - 0x0L, 0x0L, 0x0L, 0x21fff0000L -}; -static final long[] jjbitVec87 = { - 0xfc0000000000L, 0x0L, 0x6000000L, 0x0L -}; -static final long[] jjbitVec88 = { - 0x40000000L, 0x0L, 0x0L, 0x0L -}; -static final long[] jjbitVec89 = { - 0xf00000000L, 0x0L, 0x0L, 0x0L -}; -static final long[] jjbitVec90 = { - 0xc000000000000008L, 0x1e01L, 0xc00000000000000cL, 0x801981L -}; -static final long[] jjbitVec91 = { - 0xc000000000000008L, 0x1L, 0xc000000000000008L, 0x1a01L -}; -static final long[] jjbitVec92 = { - 0x400000000000000cL, 0x801981L, 0xc000000000000000L, 0x801dc6L -}; -static final long[] jjbitVec93 = { - 0xeL, 0x1eL, 0x400000000000000cL, 0x600d9fL -}; -static final long[] jjbitVec94 = { - 0xc00000000000000cL, 0x801dc1L, 0xcL, 0xc0000ff038000L -}; -static final long[] jjbitVec95 = { - 0xc000000000000000L, 0x8000000000000000L, 0x0L, 0x0L -}; -static final long[] jjbitVec96 = { - 0x102100000000000L, 0xc00000L, 0x0L, 0x0L -}; -static final long[] jjbitVec97 = { - 0x0L, 0x0L, 0xc040000000000000L, 0x1bfL -}; -static final long[] jjbitVec98 = { - 0xd000000000000004L, 0x3000000003987L, 0xd00000000000000eL, 0x3bbfL -}; -static final long[] jjbitVec99 = { - 0x1600L, 0x0L, 0x0L, 0x0L -}; -static final long[] jjbitVec100 = { - 0x0L, 0xffc000000000L, 0x0L, 0xffc000000000L -}; -static final long[] jjbitVec101 = { - 0x1000000L, 0x0L, 0x0L, 0x8000000000000000L -}; -static final long[] jjbitVec102 = { - 0x3ff0000L, 0x0L, 0x0L, 0x0L -}; -static final long[] jjbitVec103 = { - 0x0L, 0x3ff00000000L, 0x0L, 0x3ff000000000000L -}; -static final long[] jjbitVec104 = { - 0x0L, 0xffc000000000L, 0x0L, 0xff8000000000L -}; -static final long[] jjbitVec105 = { - 0x0L, 0xffc000000000L, 0x0L, 0x0L -}; -static final long[] jjbitVec106 = { - 0x0L, 0x3ff0000L, 0x0L, 0x3ff0000L -}; -static final long[] jjbitVec107 = { - 0x3ff00000000L, 0x0L, 0x0L, 0x0L -}; -static final long[] jjbitVec108 = { - 0x0L, 0x3ffL, 0x0L, 0x0L -}; -static final long[] jjbitVec109 = { - 0x0L, 0x3fe0000000000L, 0x0L, 0x0L -}; -static final long[] jjbitVec110 = { - 0x0L, 0x0L, 0x0L, 0x3ff00000000L -}; -static final long[] jjbitVec111 = { - 0x8000000000000000L, 0x1L, 0x0L, 0x0L -}; -static final long[] jjbitVec112 = { - 0x0L, 0x0L, 0x0L, 0x800000000000000L -}; -static final long[] jjbitVec113 = { - 0x18000000000000L, 0xe000L, 0x0L, 0x0L -}; -static final long[] jjbitVec114 = { - 0x8000000000000000L, 0x2000000000L, 0x0L, 0x0L -}; -private int jjMoveNfa_0(int startState, int curPos) -{ - int startsAt = 0; - jjnewStateCnt = 119; - int i = 1; - jjstateSet[0] = startState; - int kind = 0x7fffffff; - for (;;) - { - if (++jjround == 0x7fffffff) - ReInitRounds(); - if (curChar < 64) - { - long l = 1L << curChar; - do - { - switch(jjstateSet[--i]) - { - case 67: - if ((0x3ff001000000000L & l) != 0L) - { - if (kind > 153) - kind = 153; - { jjCheckNAddTwoStates(63, 64); } - } - if ((0x3ff000000000000L & l) != 0L) - { jjCheckNAdd(68); } - if ((0x3ff000000000000L & l) != 0L) - { jjCheckNAdd(68); } - break; - case 83: - if ((0xffff7bffffffdbffL & l) != 0L) - { jjCheckNAddStates(0, 2); } - break; - case 8: - case 63: - if ((0x3ff001000000000L & l) == 0L) - break; - if (kind > 153) - kind = 153; - { jjCheckNAddTwoStates(63, 64); } - break; - case 13: - if ((0x3ff001000000000L & l) == 0L) - break; - if (kind > 153) - kind = 153; - { jjCheckNAddTwoStates(63, 64); } - break; - case 66: - if ((0x3ff001000000000L & l) != 0L) - { - if (kind > 153) - kind = 153; - { jjCheckNAddTwoStates(63, 64); } - } - if ((0x3ff000000000000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 71; - if ((0x3ff000000000000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 67; - break; - case 119: - if ((0x3ff001000000000L & l) == 0L) - break; - if (kind > 153) - kind = 153; - { jjCheckNAddTwoStates(63, 64); } - break; - case 0: - if ((0x3ff000000000000L & l) != 0L) - { - if (kind > 137) - kind = 137; - { jjCheckNAdd(113); } - } - else if ((0x100001a00L & l) != 0L) - { - if (kind > 1) - kind = 1; - } - else if ((0x2400L & l) != 0L) - { - if (kind > 8) - kind = 8; - } - else if (curChar == 47) - { jjAddStates(3, 4); } - else if (curChar == 36) - { jjAddStates(5, 6); } - else if (curChar == 35) - { - if (kind > 152) - kind = 152; - { jjCheckNAddTwoStates(50, 51); } - } - else if (curChar == 37) - jjstateSet[jjnewStateCnt++] = 42; - else if (curChar == 39) - { jjCheckNAddStates(7, 9); } - else if (curChar == 34) - { jjCheckNAddStates(10, 12); } - else if (curChar == 46) - { jjCheckNAdd(3); } - if ((0x3ff000000000000L & l) != 0L) - { - if (kind > 166) - kind = 166; - } - else if (curChar == 36) - jjstateSet[jjnewStateCnt++] = 60; - if ((0x3ff000000000000L & l) != 0L) - { - if (kind > 163) - kind = 163; - } - if ((0x3fe000000000000L & l) != 0L) - { - if (kind > 132) - kind = 132; - { jjCheckNAddStates(13, 17); } - } - else if (curChar == 48) - { - if (kind > 132) - kind = 132; - { jjCheckNAddStates(18, 20); } - } - break; - case 9: - if ((0x3ff001000000000L & l) == 0L) - break; - if (kind > 153) - kind = 153; - { jjCheckNAddTwoStates(63, 64); } - break; - case 65: - if ((0x3ff001000000000L & l) != 0L) - { - if (kind > 153) - kind = 153; - { jjCheckNAddTwoStates(63, 64); } - } - if ((0x3ff000000000000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 70; - if ((0x3ff000000000000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 66; - break; - case 1: - if ((0x2400L & l) != 0L && kind > 8) - kind = 8; - break; - case 2: - if (curChar == 46) - { jjCheckNAdd(3); } - break; - case 3: - if ((0x3ff000000000000L & l) == 0L) - break; - if (kind > 132) - kind = 132; - { jjCheckNAddTwoStates(3, 4); } - break; - case 5: - if ((0x280000000000L & l) != 0L) - { jjCheckNAdd(6); } - break; - case 6: - if ((0x3ff000000000000L & l) == 0L) - break; - if (kind > 132) - kind = 132; - { jjCheckNAdd(6); } - break; - case 15: - if (curChar == 34) - { jjCheckNAddStates(10, 12); } - break; - case 16: - if ((0xfffffffbffffdbffL & l) != 0L) - { jjCheckNAddStates(10, 12); } - break; - case 18: - { jjCheckNAddStates(10, 12); } - break; - case 19: - if (curChar == 34 && kind > 141) - kind = 141; - break; - case 21: - case 26: - if ((0x3ff000000000000L & l) != 0L) - { jjCheckNAdd(22); } - break; - case 22: - if ((0x3ff000000000000L & l) != 0L) - { jjCheckNAddStates(10, 12); } - break; - case 24: - if ((0x3ff000000000000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 25; - break; - case 25: - if ((0x3ff000000000000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 26; - break; - case 27: - if (curChar == 39) - { jjCheckNAddStates(7, 9); } - break; - case 28: - if ((0xffffff7fffffdbffL & l) != 0L) - { jjCheckNAddStates(7, 9); } - break; - case 30: - { jjCheckNAddStates(7, 9); } - break; - case 31: - if (curChar == 39 && kind > 141) - kind = 141; - break; - case 33: - case 38: - if ((0x3ff000000000000L & l) != 0L) - { jjCheckNAdd(34); } - break; - case 34: - if ((0x3ff000000000000L & l) != 0L) - { jjCheckNAddStates(7, 9); } - break; - case 36: - if ((0x3ff000000000000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 37; - break; - case 37: - if ((0x3ff000000000000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 38; - break; - case 40: - if ((0x3ff000000000000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 41; - break; - case 41: - if ((0x3ff000000000000L & l) != 0L && kind > 150) - kind = 150; - break; - case 43: - { jjCheckNAddTwoStates(43, 44); } - break; - case 45: - if ((0xffffffdfffffffffL & l) != 0L) - { jjCheckNAddTwoStates(46, 44); } - break; - case 46: - { jjCheckNAddTwoStates(46, 44); } - break; - case 47: - if (curChar == 37 && kind > 151) - kind = 151; - break; - case 48: - if (curChar == 37) - jjstateSet[jjnewStateCnt++] = 42; - break; - case 49: - if (curChar != 35) - break; - if (kind > 152) - kind = 152; - { jjCheckNAddTwoStates(50, 51); } - break; - case 50: - if ((0x3ff001000000000L & l) == 0L) - break; - if (kind > 152) - kind = 152; - { jjCheckNAddTwoStates(50, 51); } - break; - case 52: - if ((0x3ff000000000000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 53; - break; - case 53: - if ((0x3ff000000000000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 54; - break; - case 54: - case 58: - if ((0x3ff000000000000L & l) != 0L) - { jjCheckNAdd(55); } - break; - case 55: - if ((0x3ff000000000000L & l) == 0L) - break; - if (kind > 152) - kind = 152; - { jjCheckNAddTwoStates(50, 51); } - break; - case 56: - if ((0x3ff000000000000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 57; - break; - case 57: - if ((0x3ff000000000000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 58; - break; - case 59: - if (curChar == 36) - jjstateSet[jjnewStateCnt++] = 60; - break; - case 60: - if ((0x41800000000L & l) != 0L && kind > 153) - kind = 153; - break; - case 61: - if (curChar == 36) - { jjAddStates(5, 6); } - break; - case 68: - if ((0x3ff000000000000L & l) == 0L) - break; - if (kind > 153) - kind = 153; - { jjCheckNAddTwoStates(63, 64); } - break; - case 69: - if ((0x3ff000000000000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 70; - break; - case 70: - if ((0x3ff000000000000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 71; - break; - case 71: - case 75: - if ((0x3ff000000000000L & l) != 0L) - { jjCheckNAdd(68); } - break; - case 73: - if ((0x3ff000000000000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 74; - break; - case 74: - if ((0x3ff000000000000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 75; - break; - case 79: - if ((0x3ff000000000000L & l) != 0L && kind > 163) - kind = 163; - break; - case 81: - if ((0x3ff000000000000L & l) != 0L && kind > 166) - kind = 166; - break; - case 82: - if (curChar == 47) - { jjAddStates(3, 4); } - break; - case 84: - if ((0xffff7fffffffdbffL & l) != 0L) - { jjCheckNAddStates(0, 2); } - break; - case 86: - if ((0xffffffffffffdbffL & l) != 0L) - { jjCheckNAddStates(0, 2); } - break; - case 87: - if (curChar != 47) - break; - if (kind > 169) - kind = 169; - { jjCheckNAddTwoStates(88, 89); } - break; - case 88: - if ((0x3ff001000000000L & l) == 0L) - break; - if (kind > 169) - kind = 169; - { jjCheckNAddTwoStates(88, 89); } - break; - case 90: - if ((0x3ff000000000000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 91; - break; - case 91: - if ((0x3ff000000000000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 92; - break; - case 92: - case 96: - if ((0x3ff000000000000L & l) != 0L) - { jjCheckNAdd(93); } - break; - case 93: - if ((0x3ff000000000000L & l) == 0L) - break; - if (kind > 169) - kind = 169; - { jjCheckNAddTwoStates(88, 89); } - break; - case 94: - if ((0x3ff000000000000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 95; - break; - case 95: - if ((0x3ff000000000000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 96; - break; - case 98: - if (curChar != 48) - break; - if (kind > 132) - kind = 132; - { jjCheckNAddStates(18, 20); } - break; - case 99: - if (curChar != 46) - break; - if (kind > 132) - kind = 132; - { jjCheckNAddTwoStates(100, 101); } - break; - case 100: - if ((0x3ff000000000000L & l) == 0L) - break; - if (kind > 132) - kind = 132; - { jjCheckNAddTwoStates(100, 101); } - break; - case 102: - if ((0x280000000000L & l) != 0L) - { jjCheckNAdd(103); } - break; - case 103: - if ((0x3ff000000000000L & l) == 0L) - break; - if (kind > 132) - kind = 132; - { jjCheckNAdd(103); } - break; - case 105: - if ((0x280000000000L & l) != 0L) - { jjCheckNAdd(106); } - break; - case 106: - if ((0x3ff000000000000L & l) == 0L) - break; - if (kind > 132) - kind = 132; - { jjCheckNAdd(106); } - break; - case 108: - if ((0x3ff000000000000L & l) == 0L) - break; - if (kind > 136) - kind = 136; - jjstateSet[jjnewStateCnt++] = 108; - break; - case 109: - if ((0x3fe000000000000L & l) == 0L) - break; - if (kind > 132) - kind = 132; - { jjCheckNAddStates(13, 17); } - break; - case 110: - if ((0x3ff000000000000L & l) != 0L) - { jjCheckNAddTwoStates(110, 99); } - break; - case 111: - if ((0x3ff000000000000L & l) == 0L) - break; - if (kind > 132) - kind = 132; - { jjCheckNAddTwoStates(111, 104); } - break; - case 112: - if ((0x3ff000000000000L & l) == 0L) - break; - if (kind > 135) - kind = 135; - { jjCheckNAdd(112); } - break; - case 113: - if ((0x3ff000000000000L & l) == 0L) - break; - if (kind > 137) - kind = 137; - { jjCheckNAdd(113); } - break; - case 115: - if ((0x3ff000000000000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 116; - break; - case 116: - if ((0x3ff000000000000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 117; - break; - case 117: - if ((0x3ff000000000000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 118; - break; - case 118: - if ((0x3ff000000000000L & l) != 0L && kind > 165) - kind = 165; - break; - default : break; - } - } while(i != startsAt); - } - else if (curChar < 128) - { - long l = 1L << (curChar & 077); - do - { - switch(jjstateSet[--i]) - { - case 67: - if ((0x7fffffe87fffffeL & l) != 0L) - { - if (kind > 153) - kind = 153; - { jjCheckNAddTwoStates(63, 64); } - } - if ((0x7e0000007eL & l) != 0L) - { jjCheckNAdd(68); } - else if (curChar == 117) - { jjAddStates(21, 22); } - if ((0x7e0000007eL & l) != 0L) - { jjCheckNAdd(68); } - break; - case 83: - if ((0xffffffffefffffffL & l) != 0L) - { jjCheckNAddStates(0, 2); } - else if (curChar == 92) - { jjCheckNAdd(86); } - break; - case 8: - if ((0x7fffffe87fffffeL & l) != 0L) - { - if (kind > 153) - kind = 153; - { jjCheckNAddTwoStates(63, 64); } - } - if (curChar == 117) - { jjAddStates(21, 22); } - if (curChar == 117) - { jjCheckNAdd(7); } - break; - case 13: - if ((0x7fffffe87fffffeL & l) != 0L) - { - if (kind > 153) - kind = 153; - { jjCheckNAddTwoStates(63, 64); } - } - if (curChar == 117) - { jjAddStates(21, 22); } - else if (curChar == 97) - jjstateSet[jjnewStateCnt++] = 12; - break; - case 66: - if ((0x7fffffe87fffffeL & l) != 0L) - { - if (kind > 153) - kind = 153; - { jjCheckNAddTwoStates(63, 64); } - } - if ((0x7e0000007eL & l) != 0L) - jjstateSet[jjnewStateCnt++] = 71; - else if (curChar == 117) - { jjAddStates(21, 22); } - if ((0x7e0000007eL & l) != 0L) - jjstateSet[jjnewStateCnt++] = 67; - break; - case 119: - if ((0x7fffffe87fffffeL & l) != 0L) - { - if (kind > 153) - kind = 153; - { jjCheckNAddTwoStates(63, 64); } - } - if (curChar == 117) - { jjAddStates(21, 22); } - break; - case 0: - if ((0x7fffffe87fffffeL & l) != 0L) - { - if (kind > 153) - kind = 153; - { jjCheckNAddTwoStates(63, 64); } - } - else if (curChar == 64) - { jjAddStates(5, 6); } - if ((0x7e0000007eL & l) != 0L) - { - if (kind > 166) - kind = 166; - } - else if (curChar == 117) - { jjCheckNAddTwoStates(73, 115); } - else if (curChar == 95) - { - if (kind > 164) - kind = 164; - } - else if (curChar == 120) - jjstateSet[jjnewStateCnt++] = 40; - else if (curChar == 116) - jjstateSet[jjnewStateCnt++] = 9; - if (curChar == 102) - jjstateSet[jjnewStateCnt++] = 13; - break; - case 9: - if ((0x7fffffe87fffffeL & l) != 0L) - { - if (kind > 153) - kind = 153; - { jjCheckNAddTwoStates(63, 64); } - } - if (curChar == 117) - { jjAddStates(21, 22); } - else if (curChar == 114) - jjstateSet[jjnewStateCnt++] = 8; - break; - case 65: - if ((0x7fffffe87fffffeL & l) != 0L) - { - if (kind > 153) - kind = 153; - { jjCheckNAddTwoStates(63, 64); } - } - if ((0x7e0000007eL & l) != 0L) - jjstateSet[jjnewStateCnt++] = 70; - else if (curChar == 117) - { jjAddStates(21, 22); } - if ((0x7e0000007eL & l) != 0L) - jjstateSet[jjnewStateCnt++] = 66; - break; - case 4: - if ((0x2000000020L & l) != 0L) - { jjAddStates(23, 24); } - break; - case 7: - if (curChar == 101 && kind > 140) - kind = 140; - break; - case 10: - if (curChar == 116) - jjstateSet[jjnewStateCnt++] = 9; - break; - case 11: - if (curChar == 115) - { jjCheckNAdd(7); } - break; - case 12: - if (curChar == 108) - jjstateSet[jjnewStateCnt++] = 11; - break; - case 14: - if (curChar == 102) - jjstateSet[jjnewStateCnt++] = 13; - break; - case 16: - if ((0xffffffffefffffffL & l) != 0L) - { jjCheckNAddStates(10, 12); } - break; - case 17: - if (curChar == 92) - { jjAddStates(25, 27); } - break; - case 18: - { jjCheckNAddStates(10, 12); } - break; - case 20: - if (curChar == 120) - jjstateSet[jjnewStateCnt++] = 21; - break; - case 21: - case 26: - if ((0x7e0000007eL & l) != 0L) - { jjCheckNAdd(22); } - break; - case 22: - if ((0x7e0000007eL & l) != 0L) - { jjCheckNAddStates(10, 12); } - break; - case 23: - if (curChar == 117) - jjstateSet[jjnewStateCnt++] = 24; - break; - case 24: - if ((0x7e0000007eL & l) != 0L) - jjstateSet[jjnewStateCnt++] = 25; - break; - case 25: - if ((0x7e0000007eL & l) != 0L) - jjstateSet[jjnewStateCnt++] = 26; - break; - case 28: - if ((0xffffffffefffffffL & l) != 0L) - { jjCheckNAddStates(7, 9); } - break; - case 29: - if (curChar == 92) - { jjAddStates(28, 30); } - break; - case 30: - { jjCheckNAddStates(7, 9); } - break; - case 32: - if (curChar == 120) - jjstateSet[jjnewStateCnt++] = 33; - break; - case 33: - case 38: - if ((0x7e0000007eL & l) != 0L) - { jjCheckNAdd(34); } - break; - case 34: - if ((0x7e0000007eL & l) != 0L) - { jjCheckNAddStates(7, 9); } - break; - case 35: - if (curChar == 117) - jjstateSet[jjnewStateCnt++] = 36; - break; - case 36: - if ((0x7e0000007eL & l) != 0L) - jjstateSet[jjnewStateCnt++] = 37; - break; - case 37: - if ((0x7e0000007eL & l) != 0L) - jjstateSet[jjnewStateCnt++] = 38; - break; - case 39: - if (curChar == 120) - jjstateSet[jjnewStateCnt++] = 40; - break; - case 40: - if ((0x7e0000007eL & l) != 0L) - jjstateSet[jjnewStateCnt++] = 41; - break; - case 41: - if ((0x7e0000007eL & l) != 0L && kind > 150) - kind = 150; - break; - case 42: - if (curChar == 123) - { jjCheckNAddTwoStates(43, 44); } - break; - case 43: - if ((0xdfffffffffffffffL & l) != 0L) - { jjCheckNAddTwoStates(43, 44); } - break; - case 44: - if (curChar == 125) - { jjCheckNAddStates(31, 33); } - break; - case 45: - case 46: - if ((0xdfffffffffffffffL & l) != 0L) - { jjCheckNAddTwoStates(46, 44); } - break; - case 50: - if ((0x7fffffe87fffffeL & l) == 0L) - break; - if (kind > 152) - kind = 152; - { jjCheckNAddTwoStates(50, 51); } - break; - case 51: - if (curChar == 117) - { jjAddStates(34, 35); } - break; - case 52: - if ((0x7e0000007eL & l) != 0L) - jjstateSet[jjnewStateCnt++] = 53; - break; - case 53: - if ((0x7e0000007eL & l) != 0L) - jjstateSet[jjnewStateCnt++] = 54; - break; - case 54: - case 58: - if ((0x7e0000007eL & l) != 0L) - { jjCheckNAdd(55); } - break; - case 55: - if ((0x7e0000007eL & l) == 0L) - break; - if (kind > 152) - kind = 152; - { jjCheckNAddTwoStates(50, 51); } - break; - case 56: - if ((0x7e0000007eL & l) != 0L) - jjstateSet[jjnewStateCnt++] = 57; - break; - case 57: - if ((0x7e0000007eL & l) != 0L) - jjstateSet[jjnewStateCnt++] = 58; - break; - case 60: - if (curChar == 94 && kind > 153) - kind = 153; - break; - case 61: - if (curChar == 64) - { jjAddStates(5, 6); } - break; - case 62: - if ((0x7fffffe87fffffeL & l) == 0L) - break; - if (kind > 153) - kind = 153; - { jjCheckNAddTwoStates(63, 64); } - break; - case 63: - if ((0x7fffffe87fffffeL & l) == 0L) - break; - if (kind > 153) - kind = 153; - { jjCheckNAddTwoStates(63, 64); } - break; - case 64: - if (curChar == 117) - { jjAddStates(21, 22); } - break; - case 68: - if ((0x7e0000007eL & l) == 0L) - break; - if (kind > 153) - kind = 153; - { jjCheckNAddTwoStates(63, 64); } - break; - case 69: - if ((0x7e0000007eL & l) != 0L) - jjstateSet[jjnewStateCnt++] = 70; - break; - case 70: - if ((0x7e0000007eL & l) != 0L) - jjstateSet[jjnewStateCnt++] = 71; - break; - case 71: - case 75: - if ((0x7e0000007eL & l) != 0L) - { jjCheckNAdd(68); } - break; - case 72: - if (curChar == 117) - { jjCheckNAdd(73); } - break; - case 73: - if ((0x7e0000007eL & l) != 0L) - jjstateSet[jjnewStateCnt++] = 74; - break; - case 74: - if ((0x7e0000007eL & l) != 0L) - jjstateSet[jjnewStateCnt++] = 75; - break; - case 80: - if (curChar == 95 && kind > 164) - kind = 164; - break; - case 81: - if ((0x7e0000007eL & l) != 0L && kind > 166) - kind = 166; - break; - case 84: - if ((0xffffffffefffffffL & l) != 0L) - { jjCheckNAddStates(0, 2); } - break; - case 85: - if (curChar == 92) - { jjCheckNAdd(86); } - break; - case 86: - { jjCheckNAddStates(0, 2); } - break; - case 88: - if ((0x7fffffe87fffffeL & l) == 0L) - break; - if (kind > 169) - kind = 169; - { jjCheckNAddTwoStates(88, 89); } - break; - case 89: - if (curChar == 117) - { jjAddStates(36, 37); } - break; - case 90: - if ((0x7e0000007eL & l) != 0L) - jjstateSet[jjnewStateCnt++] = 91; - break; - case 91: - if ((0x7e0000007eL & l) != 0L) - jjstateSet[jjnewStateCnt++] = 92; - break; - case 92: - case 96: - if ((0x7e0000007eL & l) != 0L) - { jjCheckNAdd(93); } - break; - case 93: - if ((0x7e0000007eL & l) == 0L) - break; - if (kind > 169) - kind = 169; - { jjCheckNAddTwoStates(88, 89); } - break; - case 94: - if ((0x7e0000007eL & l) != 0L) - jjstateSet[jjnewStateCnt++] = 95; - break; - case 95: - if ((0x7e0000007eL & l) != 0L) - jjstateSet[jjnewStateCnt++] = 96; - break; - case 97: - if (curChar == 92) - { jjCheckNAdd(86); } - break; - case 101: - if ((0x2000000020L & l) != 0L) - { jjAddStates(38, 39); } - break; - case 104: - if ((0x2000000020L & l) != 0L) - { jjAddStates(40, 41); } - break; - case 107: - if ((0x100000001000000L & l) != 0L) - { jjCheckNAdd(108); } - break; - case 108: - if ((0x7e0000007eL & l) == 0L) - break; - if (kind > 136) - kind = 136; - { jjCheckNAdd(108); } - break; - case 114: - if (curChar == 117) - { jjCheckNAddTwoStates(73, 115); } - break; - case 115: - if ((0x7e0000007eL & l) != 0L) - jjstateSet[jjnewStateCnt++] = 116; - break; - case 116: - if ((0x7e0000007eL & l) != 0L) - jjstateSet[jjnewStateCnt++] = 117; - break; - case 117: - if ((0x7e0000007eL & l) != 0L) - jjstateSet[jjnewStateCnt++] = 118; - break; - case 118: - if ((0x7e0000007eL & l) != 0L && kind > 165) - kind = 165; - break; - default : break; - } - } while(i != startsAt); - } - else - { - int hiByte = (curChar >> 8); - int i1 = hiByte >> 6; - long l1 = 1L << (hiByte & 077); - int i2 = (curChar & 0xff) >> 6; - long l2 = 1L << (curChar & 077); - do - { - switch(jjstateSet[--i]) - { - case 67: - case 63: - if (!jjCanMove_4(hiByte, i1, i2, l1, l2)) - break; - if (kind > 153) - kind = 153; - { jjCheckNAddTwoStates(63, 64); } - break; - case 83: - case 84: - case 86: - if (jjCanMove_3(hiByte, i1, i2, l1, l2)) - { jjCheckNAddStates(0, 2); } - break; - case 8: - if (!jjCanMove_4(hiByte, i1, i2, l1, l2)) - break; - if (kind > 153) - kind = 153; - { jjCheckNAddTwoStates(63, 64); } - break; - case 13: - if (!jjCanMove_4(hiByte, i1, i2, l1, l2)) - break; - if (kind > 153) - kind = 153; - { jjCheckNAddTwoStates(63, 64); } - break; - case 66: - if (!jjCanMove_4(hiByte, i1, i2, l1, l2)) - break; - if (kind > 153) - kind = 153; - { jjCheckNAddTwoStates(63, 64); } - break; - case 119: - if (!jjCanMove_4(hiByte, i1, i2, l1, l2)) - break; - if (kind > 153) - kind = 153; - { jjCheckNAddTwoStates(63, 64); } - break; - case 0: - if (jjCanMove_0(hiByte, i1, i2, l1, l2)) - { - if (kind > 1) - kind = 1; - } - if (jjCanMove_1(hiByte, i1, i2, l1, l2)) - { - if (kind > 8) - kind = 8; - } - if (jjCanMove_5(hiByte, i1, i2, l1, l2)) - { - if (kind > 153) - kind = 153; - { jjCheckNAddTwoStates(63, 64); } - } - if (jjCanMove_6(hiByte, i1, i2, l1, l2)) - { - if (kind > 160) - kind = 160; - } - if (jjCanMove_7(hiByte, i1, i2, l1, l2)) - { - if (kind > 161) - kind = 161; - } - if (jjCanMove_8(hiByte, i1, i2, l1, l2)) - { - if (kind > 162) - kind = 162; - } - if (jjCanMove_9(hiByte, i1, i2, l1, l2)) - { - if (kind > 163) - kind = 163; - } - if (jjCanMove_10(hiByte, i1, i2, l1, l2)) - { - if (kind > 164) - kind = 164; - } - break; - case 9: - if (!jjCanMove_4(hiByte, i1, i2, l1, l2)) - break; - if (kind > 153) - kind = 153; - { jjCheckNAddTwoStates(63, 64); } - break; - case 65: - if (!jjCanMove_4(hiByte, i1, i2, l1, l2)) - break; - if (kind > 153) - kind = 153; - { jjCheckNAddTwoStates(63, 64); } - break; - case 1: - if (jjCanMove_1(hiByte, i1, i2, l1, l2) && kind > 8) - kind = 8; - break; - case 16: - if (jjCanMove_2(hiByte, i1, i2, l1, l2)) - { jjCheckNAddStates(10, 12); } - break; - case 18: - if (jjCanMove_3(hiByte, i1, i2, l1, l2)) - { jjCheckNAddStates(10, 12); } - break; - case 28: - if (jjCanMove_2(hiByte, i1, i2, l1, l2)) - { jjCheckNAddStates(7, 9); } - break; - case 30: - if (jjCanMove_3(hiByte, i1, i2, l1, l2)) - { jjCheckNAddStates(7, 9); } - break; - case 43: - if (jjCanMove_3(hiByte, i1, i2, l1, l2)) - { jjCheckNAddTwoStates(43, 44); } - break; - case 45: - case 46: - if (jjCanMove_3(hiByte, i1, i2, l1, l2)) - { jjCheckNAddTwoStates(46, 44); } - break; - case 50: - if (!jjCanMove_4(hiByte, i1, i2, l1, l2)) - break; - if (kind > 152) - kind = 152; - { jjAddStates(42, 43); } - break; - case 62: - if (!jjCanMove_5(hiByte, i1, i2, l1, l2)) - break; - if (kind > 153) - kind = 153; - { jjCheckNAddTwoStates(63, 64); } - break; - case 76: - if (jjCanMove_6(hiByte, i1, i2, l1, l2) && kind > 160) - kind = 160; - break; - case 77: - if (jjCanMove_7(hiByte, i1, i2, l1, l2) && kind > 161) - kind = 161; - break; - case 78: - if (jjCanMove_8(hiByte, i1, i2, l1, l2) && kind > 162) - kind = 162; - break; - case 79: - if (jjCanMove_9(hiByte, i1, i2, l1, l2) && kind > 163) - kind = 163; - break; - case 80: - if (jjCanMove_10(hiByte, i1, i2, l1, l2) && kind > 164) - kind = 164; - break; - case 88: - if (!jjCanMove_4(hiByte, i1, i2, l1, l2)) - break; - if (kind > 169) - kind = 169; - { jjAddStates(44, 45); } - break; - default : if (i1 == 0 || l1 == 0 || i2 == 0 || l2 == 0) break; else break; - } - } while(i != startsAt); - } - if (kind != 0x7fffffff) - { - jjmatchedKind = kind; - jjmatchedPos = curPos; - kind = 0x7fffffff; - } - ++curPos; - if ((i = jjnewStateCnt) == (startsAt = 119 - (jjnewStateCnt = startsAt))) - return curPos; - try { curChar = input_stream.readChar(); } - catch(java.io.IOException e) { return curPos; } - } -} -private int jjMoveStringLiteralDfa0_3(){ - switch(curChar) - { - case 42: - return jjMoveStringLiteralDfa1_3(0x10000L); - default : - return 1; - } -} -private int jjMoveStringLiteralDfa1_3(long active0){ - try { curChar = input_stream.readChar(); } - catch(java.io.IOException e) { - return 1; - } - switch(curChar) - { - case 47: - if ((active0 & 0x10000L) != 0L) - return jjStopAtPos(1, 16); - break; - default : - return 2; - } - return 2; -} -private int jjMoveStringLiteralDfa0_2() -{ - return jjMoveNfa_2(4, 0); -} -private int jjMoveNfa_2(int startState, int curPos) -{ - int startsAt = 0; - jjnewStateCnt = 4; - int i = 1; - jjstateSet[0] = startState; - int kind = 0x7fffffff; - for (;;) - { - if (++jjround == 0x7fffffff) - ReInitRounds(); - if (curChar < 64) - { - long l = 1L << curChar; - do - { - switch(jjstateSet[--i]) - { - case 4: - if ((0xffffffffffffdbffL & l) != 0L) - { - if (kind > 15) - kind = 15; - { jjCheckNAddStates(46, 48); } - } - else if ((0x2400L & l) != 0L) - { - if (kind > 15) - kind = 15; - } - if (curChar == 13) - jjstateSet[jjnewStateCnt++] = 2; - break; - case 0: - if ((0xffffffffffffdbffL & l) == 0L) - break; - kind = 15; - { jjCheckNAddStates(46, 48); } - break; - case 1: - if ((0x2400L & l) != 0L && kind > 15) - kind = 15; - break; - case 2: - if (curChar == 10 && kind > 15) - kind = 15; - break; - case 3: - if (curChar == 13) - jjstateSet[jjnewStateCnt++] = 2; - break; - default : break; - } - } while(i != startsAt); - } - else if (curChar < 128) - { - long l = 1L << (curChar & 077); - do - { - switch(jjstateSet[--i]) - { - case 4: - case 0: - kind = 15; - { jjCheckNAddStates(46, 48); } - break; - default : break; - } - } while(i != startsAt); - } - else - { - int hiByte = (curChar >> 8); - int i1 = hiByte >> 6; - long l1 = 1L << (hiByte & 077); - int i2 = (curChar & 0xff) >> 6; - long l2 = 1L << (curChar & 077); - do - { - switch(jjstateSet[--i]) - { - case 4: - case 0: - if (!jjCanMove_3(hiByte, i1, i2, l1, l2)) - break; - if (kind > 15) - kind = 15; - { jjCheckNAddStates(46, 48); } - break; - default : if (i1 == 0 || l1 == 0 || i2 == 0 || l2 == 0) break; else break; - } - } while(i != startsAt); - } - if (kind != 0x7fffffff) - { - jjmatchedKind = kind; - jjmatchedPos = curPos; - kind = 0x7fffffff; - } - ++curPos; - if ((i = jjnewStateCnt) == (startsAt = 4 - (jjnewStateCnt = startsAt))) - return curPos; - try { curChar = input_stream.readChar(); } - catch(java.io.IOException e) { return curPos; } - } -} -private int jjMoveStringLiteralDfa0_4() -{ - return 1; -} -private final int jjStopStringLiteralDfa_1(int pos, long active0, long active1, long active2){ - switch (pos) - { - case 0: - if ((active0 & 0x38040000000000L) != 0L || (active1 & 0x1000L) != 0L) - { - jjmatchedKind = 153; - return 14; - } - if ((active1 & 0x2000000L) != 0L) - return 3; - if ((active1 & 0x1000010000000000L) != 0L) - return 40; - if ((active0 & 0x9fc7fbfffbfc0000L) != 0L || (active1 & 0xefffL) != 0L || (active2 & 0x808L) != 0L) - { - jjmatchedKind = 153; - return 89; - } - if ((active0 & 0x6000000004000000L) != 0L || (active1 & 0x30000L) != 0L) - { - jjmatchedKind = 153; - return 10; - } - return -1; - case 1: - if ((active1 & 0x20000L) != 0L) - { - if (jjmatchedPos != 1) - { - jjmatchedKind = 153; - jjmatchedPos = 1; - } - return 9; - } - if ((active0 & 0x30000410400000L) != 0L || (active1 & 0x4000L) != 0L || (active2 & 0x800L) != 0L) - { - if (jjmatchedPos != 1) - { - jjmatchedKind = 153; - jjmatchedPos = 1; - } - return 63; - } - if ((active0 & 0xfe0ffdfaeb980000L) != 0L || (active1 & 0x1bdffL) != 0L) - { - if (jjmatchedPos != 1) - { - jjmatchedKind = 153; - jjmatchedPos = 1; - } - return 89; - } - if ((active0 & 0x1c0020104240000L) != 0L || (active1 & 0x200L) != 0L || (active2 & 0x8L) != 0L) - return 89; - return -1; - case 2: - if ((active0 & 0x7a37977bcbbc0000L) != 0L || (active1 & 0x1f8ffL) != 0L || (active2 & 0x808L) != 0L) - { - if (jjmatchedPos != 2) - { - jjmatchedKind = 153; - jjmatchedPos = 2; - } - return 89; - } - if ((active1 & 0x400L) != 0L) - { - if (jjmatchedPos != 2) - { - jjmatchedKind = 153; - jjmatchedPos = 2; - } - return 63; - } - if ((active0 & 0x8408688430400000L) != 0L || (active1 & 0x20100L) != 0L) - return 89; - return -1; - case 3: - if ((active0 & 0x800002000200000L) != 0L || (active1 & 0x80L) != 0L) - { - jjmatchedKind = 153; - jjmatchedPos = 3; - return 63; - } - if ((active0 & 0x50339759c3dc0000L) != 0L || (active1 & 0x1f972L) != 0L || (active2 & 0x8L) != 0L) - { - jjmatchedKind = 153; - jjmatchedPos = 3; - return 89; - } - if ((active0 & 0x2204000208000000L) != 0L || (active1 & 0x40dL) != 0L || (active2 & 0x800L) != 0L) - return 89; - return -1; - case 4: - if ((active0 & 0x4833166941980000L) != 0L || (active1 & 0xb880L) != 0L || (active2 & 0x8L) != 0L) - { - jjmatchedKind = 153; - jjmatchedPos = 4; - return 89; - } - if ((active0 & 0x440000L) != 0L || (active1 & 0x100L) != 0L) - { - jjmatchedKind = 153; - jjmatchedPos = 4; - return 63; - } - if ((active0 & 0x1000811082200000L) != 0L || (active1 & 0x14072L) != 0L) - return 89; - return -1; - case 5: - if ((active0 & 0x31164040180000L) != 0L || (active1 & 0x1980L) != 0L || (active2 & 0x8L) != 0L) - { - jjmatchedKind = 153; - jjmatchedPos = 5; - return 89; - } - if ((active0 & 0x40000L) != 0L) - { - jjmatchedKind = 153; - jjmatchedPos = 5; - return 64; - } - if ((active0 & 0x4802002901c00000L) != 0L || (active1 & 0xa000L) != 0L) - return 89; - return -1; - case 6: - if ((active0 & 0x1000000000000L) != 0L) - { - jjmatchedKind = 153; - jjmatchedPos = 6; - return 63; - } - if ((active0 & 0x40000L) != 0L) - return 65; - if ((active0 & 0x30060040080000L) != 0L || (active1 & 0x80L) != 0L || (active2 & 0x8L) != 0L) - { - jjmatchedKind = 153; - jjmatchedPos = 6; - return 89; - } - if ((active0 & 0x104000100000L) != 0L || (active1 & 0x1900L) != 0L) - return 89; - return -1; - case 7: - if ((active0 & 0x1000000000000L) != 0L) - return 64; - if ((active0 & 0x20040080000L) != 0L || (active2 & 0x8L) != 0L) - { - if (jjmatchedPos != 7) - { - jjmatchedKind = 153; - jjmatchedPos = 7; - } - return 89; - } - if ((active0 & 0x30040000000000L) != 0L || (active1 & 0x80L) != 0L) - return 89; - return -1; - case 8: - if ((active0 & 0x20000000000L) != 0L || (active2 & 0x8L) != 0L) - { - jjmatchedKind = 153; - jjmatchedPos = 8; - return 89; - } - if ((active0 & 0x40080000L) != 0L) - return 89; - return -1; - default : - return -1; - } -} -private final int jjStartNfa_1(int pos, long active0, long active1, long active2){ - return jjMoveNfa_1(jjStopStringLiteralDfa_1(pos, active0, active1, active2), pos + 1); -} -private int jjMoveStringLiteralDfa0_1(){ - switch(curChar) - { - case 33: - jjmatchedKind = 113; - return jjMoveStringLiteralDfa1_1(0x0L, 0x1200000000L, 0x0L); - case 37: - jjmatchedKind = 104; - return jjMoveStringLiteralDfa1_1(0x0L, 0x1000000000000000L, 0x0L); - case 38: - jjmatchedKind = 110; - return jjMoveStringLiteralDfa1_1(0x0L, 0x8000000000000L, 0x1L); - case 40: - return jjStopAtPos(0, 85); - case 41: - return jjStopAtPos(0, 86); - case 42: - jjmatchedKind = 103; - return jjMoveStringLiteralDfa1_1(0x0L, 0x800000000000000L, 0x0L); - case 43: - jjmatchedKind = 101; - return jjMoveStringLiteralDfa1_1(0x0L, 0x200020000000000L, 0x0L); - case 44: - return jjStopAtPos(0, 91); - case 45: - jjmatchedKind = 102; - return jjMoveStringLiteralDfa1_1(0x0L, 0x400040000000000L, 0x0L); - case 46: - return jjStartNfaWithStates_1(0, 89, 3); - case 47: - jjmatchedKind = 168; - return jjMoveStringLiteralDfa1_1(0x6000L, 0x0L, 0x8000000000L); - case 58: - jjmatchedKind = 119; - return jjMoveStringLiteralDfa1_1(0x0L, 0x40000000000000L, 0x0L); - case 59: - return jjStopAtPos(0, 90); - case 60: - jjmatchedKind = 92; - return jjMoveStringLiteralDfa1_1(0x0L, 0x2000080040000000L, 0x0L); - case 61: - jjmatchedKind = 120; - return jjMoveStringLiteralDfa1_1(0x0L, 0x900040000L, 0x0L); - case 62: - jjmatchedKind = 93; - return jjMoveStringLiteralDfa1_1(0x0L, 0xc000300080000000L, 0x0L); - case 63: - return jjStopAtPos(0, 117); - case 91: - return jjStopAtPos(0, 87); - case 93: - return jjStopAtPos(0, 88); - case 94: - jjmatchedKind = 112; - return jjMoveStringLiteralDfa1_1(0x0L, 0x0L, 0x4L); - case 97: - return jjMoveStringLiteralDfa1_1(0x3002080000L, 0x0L, 0x0L); - case 98: - return jjMoveStringLiteralDfa1_1(0x800880000000L, 0x0L, 0x0L); - case 99: - return jjMoveStringLiteralDfa1_1(0x1010068100000L, 0x78L, 0x0L); - case 100: - return jjMoveStringLiteralDfa1_1(0x2108000000000L, 0x380L, 0x0L); - case 101: - return jjMoveStringLiteralDfa1_1(0x204080200000000L, 0xc00L, 0x0L); - case 102: - return jjMoveStringLiteralDfa1_1(0x38040000000000L, 0x1000L, 0x0L); - case 105: - return jjMoveStringLiteralDfa1_1(0xc0020100240000L, 0x2000L, 0x8L); - case 110: - return jjMoveStringLiteralDfa1_1(0x400000000000000L, 0x0L, 0x800L); - case 111: - return jjMoveStringLiteralDfa1_1(0x100000400400000L, 0x0L, 0x0L); - case 112: - return jjMoveStringLiteralDfa1_1(0x400000000000L, 0x0L, 0x0L); - case 114: - return jjMoveStringLiteralDfa1_1(0x800004010000000L, 0x0L, 0x0L); - case 115: - return jjMoveStringLiteralDfa1_1(0x200001800000L, 0xc000L, 0x0L); - case 116: - return jjMoveStringLiteralDfa1_1(0x6000000004000000L, 0x30000L, 0x0L); - case 118: - return jjMoveStringLiteralDfa1_1(0x8000000000000000L, 0x1L, 0x0L); - case 119: - return jjMoveStringLiteralDfa1_1(0x0L, 0x6L, 0x0L); - case 121: - return jjMoveStringLiteralDfa1_1(0x1000000000000000L, 0x0L, 0x0L); - case 123: - return jjStopAtPos(0, 83); - case 124: - jjmatchedKind = 111; - return jjMoveStringLiteralDfa1_1(0x0L, 0x10000000000000L, 0x2L); - case 125: - return jjStopAtPos(0, 84); - case 126: - jjmatchedKind = 114; - return jjMoveStringLiteralDfa1_1(0x0L, 0x400000000L, 0x0L); - default : - return jjMoveNfa_1(0, 0); - } -} -private int jjMoveStringLiteralDfa1_1(long active0, long active1, long active2){ - try { curChar = input_stream.readChar(); } - catch(java.io.IOException e) { - jjStopStringLiteralDfa_1(0, active0, active1, active2); - return 1; - } - switch(curChar) - { - case 38: - if ((active1 & 0x8000000000000L) != 0L) - return jjStopAtPos(1, 115); - break; - case 42: - if ((active0 & 0x4000L) != 0L) - return jjStopAtPos(1, 14); - break; - case 43: - if ((active1 & 0x20000000000L) != 0L) - return jjStopAtPos(1, 105); - break; - case 45: - if ((active1 & 0x40000000000L) != 0L) - return jjStopAtPos(1, 106); - break; - case 47: - if ((active0 & 0x2000L) != 0L) - return jjStopAtPos(1, 13); - break; - case 58: - if ((active1 & 0x40000000000000L) != 0L) - return jjStopAtPos(1, 118); - break; - case 60: - if ((active1 & 0x80000000000L) != 0L) - { - jjmatchedKind = 107; - jjmatchedPos = 1; - } - return jjMoveStringLiteralDfa2_1(active0, 0L, active1, 0x2000000000000000L, active2, 0L); - case 61: - if ((active1 & 0x40000000L) != 0L) - return jjStopAtPos(1, 94); - else if ((active1 & 0x80000000L) != 0L) - return jjStopAtPos(1, 95); - else if ((active1 & 0x100000000L) != 0L) - { - jjmatchedKind = 96; - jjmatchedPos = 1; - } - else if ((active1 & 0x200000000L) != 0L) - { - jjmatchedKind = 97; - jjmatchedPos = 1; - } - else if ((active1 & 0x400000000L) != 0L) - return jjStopAtPos(1, 98); - else if ((active1 & 0x200000000000000L) != 0L) - return jjStopAtPos(1, 121); - else if ((active1 & 0x400000000000000L) != 0L) - return jjStopAtPos(1, 122); - else if ((active1 & 0x800000000000000L) != 0L) - return jjStopAtPos(1, 123); - else if ((active1 & 0x1000000000000000L) != 0L) - return jjStopAtPos(1, 124); - else if ((active2 & 0x1L) != 0L) - return jjStopAtPos(1, 128); - else if ((active2 & 0x2L) != 0L) - return jjStopAtPos(1, 129); - else if ((active2 & 0x4L) != 0L) - return jjStopAtPos(1, 130); - else if ((active2 & 0x8000000000L) != 0L) - return jjStopAtPos(1, 167); - return jjMoveStringLiteralDfa2_1(active0, 0L, active1, 0x1800000000L, active2, 0L); - case 62: - if ((active1 & 0x40000L) != 0L) - return jjStopAtPos(1, 82); - else if ((active1 & 0x100000000000L) != 0L) - { - jjmatchedKind = 108; - jjmatchedPos = 1; - } - return jjMoveStringLiteralDfa2_1(active0, 0L, active1, 0xc000200000000000L, active2, 0L); - case 97: - return jjMoveStringLiteralDfa2_1(active0, 0x8200400008000000L, active1, 0x18L, active2, 0L); - case 101: - return jjMoveStringLiteralDfa2_1(active0, 0xc0220c881000000L, active1, 0x180L, active2, 0L); - case 102: - if ((active0 & 0x40000000000000L) != 0L) - return jjStartNfaWithStates_1(1, 54, 89); - else if ((active0 & 0x100000000000000L) != 0L) - return jjStartNfaWithStates_1(1, 56, 89); - return jjMoveStringLiteralDfa2_1(active0, 0x1000000000L, active1, 0L, active2, 0L); - case 104: - return jjMoveStringLiteralDfa2_1(active0, 0x2000010000000000L, active1, 0x10002L, active2, 0L); - case 105: - return jjMoveStringLiteralDfa2_1(active0, 0x1000040000000000L, active1, 0x1004L, active2, 0L); - case 108: - return jjMoveStringLiteralDfa2_1(active0, 0x4000000000000L, active1, 0x20L, active2, 0L); - case 109: - return jjMoveStringLiteralDfa2_1(active0, 0x20000000L, active1, 0x2000L, active2, 0L); - case 110: - if ((active0 & 0x80000000000000L) != 0L) - { - jjmatchedKind = 55; - jjmatchedPos = 1; - } - return jjMoveStringLiteralDfa2_1(active0, 0xa0100240000L, active1, 0x400L, active2, 0x8L); - case 111: - if ((active0 & 0x4000000L) != 0L) - return jjStartNfaWithStates_1(1, 26, 89); - else if ((active1 & 0x200L) != 0L) - return jjStartNfaWithStates_1(1, 73, 89); - return jjMoveStringLiteralDfa2_1(active0, 0x9000040100000L, active1, 0x41L, active2, 0L); - case 112: - return jjMoveStringLiteralDfa2_1(active0, 0x2000000L, active1, 0L, active2, 0L); - case 114: - return jjMoveStringLiteralDfa2_1(active0, 0x802000000000L, active1, 0x20000L, active2, 0L); - case 115: - return jjMoveStringLiteralDfa2_1(active0, 0x80000L, active1, 0L, active2, 0L); - case 116: - return jjMoveStringLiteralDfa2_1(active0, 0x800000L, active1, 0L, active2, 0L); - case 117: - return jjMoveStringLiteralDfa2_1(active0, 0x30000410400000L, active1, 0x4000L, active2, 0x800L); - case 119: - return jjMoveStringLiteralDfa2_1(active0, 0L, active1, 0x8000L, active2, 0L); - case 120: - return jjMoveStringLiteralDfa2_1(active0, 0x200000000L, active1, 0x800L, active2, 0L); - case 121: - return jjMoveStringLiteralDfa2_1(active0, 0x4000100000000000L, active1, 0L, active2, 0L); - case 124: - if ((active1 & 0x10000000000000L) != 0L) - return jjStopAtPos(1, 116); - break; - default : - break; - } - return jjStartNfa_1(0, active0, active1, active2); -} -private int jjMoveStringLiteralDfa2_1(long old0, long active0, long old1, long active1, long old2, long active2){ - if (((active0 &= old0) | (active1 &= old1) | (active2 &= old2)) == 0L) - return jjStartNfa_1(0, old0, old1, old2); - try { curChar = input_stream.readChar(); } - catch(java.io.IOException e) { - jjStopStringLiteralDfa_1(1, active0, active1, active2); - return 2; - } - switch(curChar) - { - case 61: - if ((active1 & 0x800000000L) != 0L) - return jjStopAtPos(2, 99); - else if ((active1 & 0x1000000000L) != 0L) - return jjStopAtPos(2, 100); - else if ((active1 & 0x2000000000000000L) != 0L) - return jjStopAtPos(2, 125); - else if ((active1 & 0x4000000000000000L) != 0L) - return jjStopAtPos(2, 126); - break; - case 62: - if ((active1 & 0x200000000000L) != 0L) - { - jjmatchedKind = 109; - jjmatchedPos = 2; - } - return jjMoveStringLiteralDfa3_1(active0, 0L, active1, 0x8000000000000000L, active2, 0L); - case 97: - return jjMoveStringLiteralDfa3_1(active0, 0x800000L, active1, 0x20L, active2, 0L); - case 98: - return jjMoveStringLiteralDfa3_1(active0, 0L, active1, 0x80L, active2, 0L); - case 99: - return jjMoveStringLiteralDfa3_1(active0, 0x200000000040000L, active1, 0L, active2, 0L); - case 100: - if ((active0 & 0x20000000L) != 0L) - return jjStartNfaWithStates_1(2, 29, 89); - else if ((active0 & 0x80000000000L) != 0L) - return jjStartNfaWithStates_1(2, 43, 89); - return jjMoveStringLiteralDfa3_1(active0, 0x100000L, active1, 0L, active2, 0L); - case 101: - return jjMoveStringLiteralDfa3_1(active0, 0x1000810200000000L, active1, 0L, active2, 0L); - case 102: - if ((active0 & 0x8000000000L) != 0L) - { - jjmatchedKind = 39; - jjmatchedPos = 2; - } - return jjMoveStringLiteralDfa3_1(active0, 0x800000000L, active1, 0x100L, active2, 0L); - case 103: - return jjMoveStringLiteralDfa3_1(active0, 0x80000000L, active1, 0L, active2, 0L); - case 105: - return jjMoveStringLiteralDfa3_1(active0, 0x2000020000000000L, active1, 0x8003L, active2, 0L); - case 108: - return jjMoveStringLiteralDfa3_1(active0, 0x2000009000000L, active1, 0L, active2, 0x800L); - case 110: - if ((active0 & 0x10000000L) != 0L) - return jjStartNfaWithStates_1(2, 28, 89); - return jjMoveStringLiteralDfa3_1(active0, 0x31140040000000L, active1, 0x1040L, active2, 0L); - case 111: - return jjMoveStringLiteralDfa3_1(active0, 0x2000000000L, active1, 0L, active2, 0L); - case 112: - return jjMoveStringLiteralDfa3_1(active0, 0x4000004002280000L, active1, 0x6000L, active2, 0L); - case 113: - if ((active0 & 0x200000000000L) != 0L) - return jjStartNfaWithStates_1(2, 45, 89); - break; - case 114: - if ((active0 & 0x400000000000L) != 0L) - return jjStartNfaWithStates_1(2, 46, 89); - else if ((active0 & 0x8000000000000L) != 0L) - return jjStartNfaWithStates_1(2, 51, 89); - else if ((active0 & 0x8000000000000000L) != 0L) - return jjStartNfaWithStates_1(2, 63, 89); - return jjMoveStringLiteralDfa3_1(active0, 0L, active1, 0x10000L, active2, 0L); - case 115: - return jjMoveStringLiteralDfa3_1(active0, 0x4000100000000L, active1, 0x8L, active2, 0x8L); - case 116: - if ((active0 & 0x400000000L) != 0L) - { - jjmatchedKind = 34; - jjmatchedPos = 2; - } - return jjMoveStringLiteralDfa3_1(active0, 0x800001000400000L, active1, 0x814L, active2, 0L); - case 117: - return jjMoveStringLiteralDfa3_1(active0, 0L, active1, 0x400L, active2, 0L); - case 119: - if ((active0 & 0x400000000000000L) != 0L) - return jjStartNfaWithStates_1(2, 58, 89); - break; - case 121: - if ((active1 & 0x20000L) != 0L) - return jjStartNfaWithStates_1(2, 81, 89); - break; - default : - break; - } - return jjStartNfa_1(1, active0, active1, active2); -} -private int jjMoveStringLiteralDfa3_1(long old0, long active0, long old1, long active1, long old2, long active2){ - if (((active0 &= old0) | (active1 &= old1) | (active2 &= old2)) == 0L) - return jjStartNfa_1(1, old0, old1, old2); - try { curChar = input_stream.readChar(); } - catch(java.io.IOException e) { - jjStopStringLiteralDfa_1(2, active0, active1, active2); - return 3; - } - switch(curChar) - { - case 61: - if ((active1 & 0x8000000000000000L) != 0L) - return jjStopAtPos(3, 127); - break; - case 97: - return jjMoveStringLiteralDfa4_1(active0, 0x940000000000L, active1, 0x1100L, active2, 0L); - case 99: - if ((active0 & 0x200000000L) != 0L) - return jjStartNfaWithStates_1(3, 33, 89); - return jjMoveStringLiteralDfa4_1(active0, 0x30010000000000L, active1, 0x10L, active2, 0L); - case 100: - if ((active1 & 0x1L) != 0L) - return jjStartNfaWithStates_1(3, 64, 89); - return jjMoveStringLiteralDfa4_1(active0, 0x40000000L, active1, 0L, active2, 0L); - case 101: - if ((active0 & 0x4000000000000L) != 0L) - return jjStartNfaWithStates_1(3, 50, 89); - else if ((active1 & 0x8L) != 0L) - return jjStartNfaWithStates_1(3, 67, 89); - return jjMoveStringLiteralDfa4_1(active0, 0x4002001101180000L, active1, 0x4800L, active2, 0L); - case 104: - if ((active0 & 0x200000000000000L) != 0L) - return jjStartNfaWithStates_1(3, 57, 89); - else if ((active1 & 0x4L) != 0L) - return jjStartNfaWithStates_1(3, 66, 89); - break; - case 105: - return jjMoveStringLiteralDfa4_1(active0, 0x80000000L, active1, 0L, active2, 0L); - case 108: - if ((active0 & 0x8000000L) != 0L) - return jjStartNfaWithStates_1(3, 27, 89); - else if ((active2 & 0x800L) != 0L) - return jjStartNfaWithStates_1(3, 139, 89); - return jjMoveStringLiteralDfa4_1(active0, 0x1000004002040000L, active1, 0x2L, active2, 0L); - case 109: - if ((active1 & 0x400L) != 0L) - return jjStartNfaWithStates_1(3, 74, 89); - break; - case 111: - return jjMoveStringLiteralDfa4_1(active0, 0x800000000L, active1, 0x12000L, active2, 0L); - case 112: - return jjMoveStringLiteralDfa4_1(active0, 0x400000L, active1, 0L, active2, 0L); - case 115: - if ((active0 & 0x2000000000000000L) != 0L) - return jjStartNfaWithStates_1(3, 61, 89); - return jjMoveStringLiteralDfa4_1(active0, 0L, active1, 0x60L, active2, 0L); - case 116: - return jjMoveStringLiteralDfa4_1(active0, 0x1020000800000L, active1, 0x8000L, active2, 0x8L); - case 117: - return jjMoveStringLiteralDfa4_1(active0, 0x800002000200000L, active1, 0x80L, active2, 0L); - default : - break; - } - return jjStartNfa_1(2, active0, active1, active2); -} -private int jjMoveStringLiteralDfa4_1(long old0, long active0, long old1, long active1, long old2, long active2){ - if (((active0 &= old0) | (active1 &= old1) | (active2 &= old2)) == 0L) - return jjStartNfa_1(2, old0, old1, old2); - try { curChar = input_stream.readChar(); } - catch(java.io.IOException e) { - jjStopStringLiteralDfa_1(3, active0, active1, active2); - return 4; - } - switch(curChar) - { - case 97: - return jjMoveStringLiteralDfa5_1(active0, 0x4000000000L, active1, 0L, active2, 0x8L); - case 99: - return jjMoveStringLiteralDfa5_1(active0, 0x1080000L, active1, 0x8000L, active2, 0L); - case 100: - if ((active0 & 0x1000000000000000L) != 0L) - return jjStartNfaWithStates_1(4, 60, 89); - return jjMoveStringLiteralDfa5_1(active0, 0x100000L, active1, 0L, active2, 0L); - case 101: - if ((active1 & 0x2L) != 0L) - return jjStartNfaWithStates_1(4, 65, 89); - break; - case 103: - return jjMoveStringLiteralDfa5_1(active0, 0L, active1, 0x80L, active2, 0L); - case 104: - if ((active1 & 0x10L) != 0L) - return jjStartNfaWithStates_1(4, 68, 89); - break; - case 105: - return jjMoveStringLiteralDfa5_1(active0, 0x1020040800000L, active1, 0L, active2, 0L); - case 107: - if ((active0 & 0x10000000000L) != 0L) - return jjStartNfaWithStates_1(4, 40, 89); - else if ((active0 & 0x800000000000L) != 0L) - return jjStartNfaWithStates_1(4, 47, 89); - break; - case 108: - return jjMoveStringLiteralDfa5_1(active0, 0x40000000000L, active1, 0x1000L, active2, 0L); - case 109: - return jjMoveStringLiteralDfa5_1(active0, 0x100000000000L, active1, 0L, active2, 0L); - case 110: - if ((active0 & 0x80000000L) != 0L) - return jjStartNfaWithStates_1(4, 31, 89); - return jjMoveStringLiteralDfa5_1(active0, 0x2000000000L, active1, 0x800L, active2, 0L); - case 111: - return jjMoveStringLiteralDfa5_1(active0, 0x4000000000000000L, active1, 0L, active2, 0L); - case 114: - if ((active0 & 0x1000000000L) != 0L) - return jjStartNfaWithStates_1(4, 36, 89); - else if ((active1 & 0x4000L) != 0L) - return jjStartNfaWithStates_1(4, 78, 89); - return jjMoveStringLiteralDfa5_1(active0, 0x800000900000000L, active1, 0x2000L, active2, 0L); - case 115: - if ((active1 & 0x20L) != 0L) - return jjStartNfaWithStates_1(4, 69, 89); - break; - case 116: - if ((active0 & 0x200000L) != 0L) - return jjStartNfaWithStates_1(4, 21, 89); - else if ((active1 & 0x40L) != 0L) - return jjStartNfaWithStates_1(4, 70, 89); - return jjMoveStringLiteralDfa5_1(active0, 0x32000000000000L, active1, 0L, active2, 0L); - case 117: - return jjMoveStringLiteralDfa5_1(active0, 0x440000L, active1, 0x100L, active2, 0L); - case 119: - if ((active1 & 0x10000L) != 0L) - return jjStartNfaWithStates_1(4, 80, 89); - break; - case 121: - if ((active0 & 0x2000000L) != 0L) - return jjStartNfaWithStates_1(4, 25, 89); - break; - default : - break; - } - return jjStartNfa_1(3, active0, active1, active2); -} -private int jjMoveStringLiteralDfa5_1(long old0, long active0, long old1, long active1, long old2, long active2){ - if (((active0 &= old0) | (active1 &= old1) | (active2 &= old2)) == 0L) - return jjStartNfa_1(3, old0, old1, old2); - try { curChar = input_stream.readChar(); } - catch(java.io.IOException e) { - jjStopStringLiteralDfa_1(4, active0, active1, active2); - return 5; - } - switch(curChar) - { - case 97: - return jjMoveStringLiteralDfa6_1(active0, 0x20000000000L, active1, 0L, active2, 0L); - case 99: - if ((active0 & 0x800000L) != 0L) - return jjStartNfaWithStates_1(5, 23, 89); - return jjMoveStringLiteralDfa6_1(active0, 0x4000000000L, active1, 0L, active2, 0L); - case 100: - if ((active0 & 0x2000000000L) != 0L) - return jjStartNfaWithStates_1(5, 37, 89); - return jjMoveStringLiteralDfa6_1(active0, 0x40000L, active1, 0x800L, active2, 0L); - case 101: - if ((active0 & 0x800000000L) != 0L) - return jjStartNfaWithStates_1(5, 35, 89); - else if ((active0 & 0x2000000000000L) != 0L) - return jjStartNfaWithStates_1(5, 49, 89); - return jjMoveStringLiteralDfa6_1(active0, 0x100000L, active1, 0L, active2, 0L); - case 102: - if ((active0 & 0x4000000000000000L) != 0L) - return jjStartNfaWithStates_1(5, 62, 89); - break; - case 103: - return jjMoveStringLiteralDfa6_1(active0, 0L, active1, 0x80L, active2, 0L); - case 104: - if ((active1 & 0x8000L) != 0L) - return jjStartNfaWithStates_1(5, 79, 89); - break; - case 105: - return jjMoveStringLiteralDfa6_1(active0, 0x30140000000000L, active1, 0L, active2, 0L); - case 108: - return jjMoveStringLiteralDfa6_1(active0, 0L, active1, 0x1100L, active2, 0L); - case 110: - if ((active0 & 0x800000000000000L) != 0L) - return jjStartNfaWithStates_1(5, 59, 89); - return jjMoveStringLiteralDfa6_1(active0, 0x1000000000000L, active1, 0L, active2, 0x8L); - case 116: - if ((active0 & 0x400000L) != 0L) - return jjStartNfaWithStates_1(5, 22, 89); - else if ((active0 & 0x1000000L) != 0L) - return jjStartNfaWithStates_1(5, 24, 89); - else if ((active0 & 0x100000000L) != 0L) - return jjStartNfaWithStates_1(5, 32, 89); - else if ((active1 & 0x2000L) != 0L) - return jjStartNfaWithStates_1(5, 77, 89); - return jjMoveStringLiteralDfa6_1(active0, 0x40080000L, active1, 0L, active2, 0L); - default : - break; - } - return jjStartNfa_1(4, active0, active1, active2); -} -private int jjMoveStringLiteralDfa6_1(long old0, long active0, long old1, long active1, long old2, long active2){ - if (((active0 &= old0) | (active1 &= old1) | (active2 &= old2)) == 0L) - return jjStartNfa_1(4, old0, old1, old2); - try { curChar = input_stream.readChar(); } - catch(java.io.IOException e) { - jjStopStringLiteralDfa_1(5, active0, active1, active2); - return 6; - } - switch(curChar) - { - case 99: - if ((active0 & 0x100000000000L) != 0L) - return jjStartNfaWithStates_1(6, 44, 89); - return jjMoveStringLiteralDfa7_1(active0, 0L, active1, 0L, active2, 0x8L); - case 100: - return jjMoveStringLiteralDfa7_1(active0, 0x80000L, active1, 0L, active2, 0L); - case 101: - if ((active0 & 0x40000L) != 0L) - return jjStartNfaWithStates_1(6, 18, 65); - else if ((active0 & 0x4000000000L) != 0L) - return jjStartNfaWithStates_1(6, 38, 89); - return jjMoveStringLiteralDfa7_1(active0, 0L, active1, 0x80L, active2, 0L); - case 102: - if ((active0 & 0x100000L) != 0L) - return jjStartNfaWithStates_1(6, 20, 89); - break; - case 105: - return jjMoveStringLiteralDfa7_1(active0, 0x40000000L, active1, 0L, active2, 0L); - case 108: - return jjMoveStringLiteralDfa7_1(active0, 0x20000000000L, active1, 0L, active2, 0L); - case 111: - return jjMoveStringLiteralDfa7_1(active0, 0x30000000000000L, active1, 0L, active2, 0L); - case 115: - if ((active1 & 0x800L) != 0L) - return jjStartNfaWithStates_1(6, 75, 89); - break; - case 116: - if ((active1 & 0x100L) != 0L) - return jjStartNfaWithStates_1(6, 72, 89); - break; - case 117: - return jjMoveStringLiteralDfa7_1(active0, 0x1000000000000L, active1, 0L, active2, 0L); - case 121: - if ((active1 & 0x1000L) != 0L) - return jjStartNfaWithStates_1(6, 76, 89); - break; - case 122: - return jjMoveStringLiteralDfa7_1(active0, 0x40000000000L, active1, 0L, active2, 0L); - default : - break; - } - return jjStartNfa_1(5, active0, active1, active2); -} -private int jjMoveStringLiteralDfa7_1(long old0, long active0, long old1, long active1, long old2, long active2){ - if (((active0 &= old0) | (active1 &= old1) | (active2 &= old2)) == 0L) - return jjStartNfa_1(5, old0, old1, old2); - try { curChar = input_stream.readChar(); } - catch(java.io.IOException e) { - jjStopStringLiteralDfa_1(6, active0, active1, active2); - return 7; - } - switch(curChar) - { - case 101: - if ((active0 & 0x40000000000L) != 0L) - return jjStartNfaWithStates_1(7, 42, 89); - else if ((active0 & 0x1000000000000L) != 0L) - return jjStartNfaWithStates_1(7, 48, 64); - return jjMoveStringLiteralDfa8_1(active0, 0x80000L, active1, 0L, active2, 0x8L); - case 105: - return jjMoveStringLiteralDfa8_1(active0, 0x20000000000L, active1, 0L, active2, 0L); - case 110: - if ((active0 & 0x10000000000000L) != 0L) - { - jjmatchedKind = 52; - jjmatchedPos = 7; - } - return jjMoveStringLiteralDfa8_1(active0, 0x20000000000000L, active1, 0L, active2, 0L); - case 111: - return jjMoveStringLiteralDfa8_1(active0, 0x40000000L, active1, 0L, active2, 0L); - case 114: - if ((active1 & 0x80L) != 0L) - return jjStartNfaWithStates_1(7, 71, 89); - break; - default : - break; - } - return jjStartNfa_1(6, active0, active1, active2); -} -private int jjMoveStringLiteralDfa8_1(long old0, long active0, long old1, long active1, long old2, long active2){ - if (((active0 &= old0) | (active1 &= old1) | (active2 &= old2)) == 0L) - return jjStartNfa_1(6, old0, old1, old2); - try { curChar = input_stream.readChar(); } - catch(java.io.IOException e) { - jjStopStringLiteralDfa_1(7, active0, 0L, active2); - return 8; - } - switch(curChar) - { - case 42: - if ((active0 & 0x20000000000000L) != 0L) - return jjStopAtPos(8, 53); - break; - case 102: - if ((active0 & 0x80000L) != 0L) - return jjStartNfaWithStates_1(8, 19, 89); - break; - case 110: - if ((active0 & 0x40000000L) != 0L) - return jjStartNfaWithStates_1(8, 30, 89); - break; - case 111: - return jjMoveStringLiteralDfa9_1(active0, 0L, active2, 0x8L); - case 122: - return jjMoveStringLiteralDfa9_1(active0, 0x20000000000L, active2, 0L); - default : - break; - } - return jjStartNfa_1(7, active0, 0L, active2); -} -private int jjMoveStringLiteralDfa9_1(long old0, long active0, long old2, long active2){ - if (((active0 &= old0) | (active2 &= old2)) == 0L) - return jjStartNfa_1(7, old0, 0L, old2); - try { curChar = input_stream.readChar(); } - catch(java.io.IOException e) { - jjStopStringLiteralDfa_1(8, active0, 0L, active2); - return 9; - } - switch(curChar) - { - case 101: - if ((active0 & 0x20000000000L) != 0L) - return jjStartNfaWithStates_1(9, 41, 89); - break; - case 102: - if ((active2 & 0x8L) != 0L) - return jjStartNfaWithStates_1(9, 131, 89); - break; - default : - break; - } - return jjStartNfa_1(8, active0, 0L, active2); -} -private int jjStartNfaWithStates_1(int pos, int kind, int state) -{ - jjmatchedKind = kind; - jjmatchedPos = pos; - try { curChar = input_stream.readChar(); } - catch(java.io.IOException e) { return pos + 1; } - return jjMoveNfa_1(state, pos + 1); -} -private int jjMoveNfa_1(int startState, int curPos) -{ - int startsAt = 0; - jjnewStateCnt = 89; - int i = 1; - jjstateSet[0] = startState; - int kind = 0x7fffffff; - for (;;) - { - if (++jjround == 0x7fffffff) - ReInitRounds(); - if (curChar < 64) - { - long l = 1L << curChar; - do - { - switch(jjstateSet[--i]) - { - case 89: - case 61: - if ((0x3ff001000000000L & l) == 0L) - break; - if (kind > 153) - kind = 153; - { jjCheckNAddTwoStates(61, 62); } - break; - case 14: - if ((0x3ff001000000000L & l) == 0L) - break; - if (kind > 153) - kind = 153; - { jjCheckNAddTwoStates(61, 62); } - break; - case 65: - if ((0x3ff001000000000L & l) != 0L) - { - if (kind > 153) - kind = 153; - { jjCheckNAddTwoStates(61, 62); } - } - if ((0x3ff000000000000L & l) != 0L) - { jjCheckNAdd(66); } - if ((0x3ff000000000000L & l) != 0L) - { jjCheckNAdd(66); } - break; - case 9: - if ((0x3ff001000000000L & l) == 0L) - break; - if (kind > 153) - kind = 153; - { jjCheckNAddTwoStates(61, 62); } - break; - case 10: - if ((0x3ff001000000000L & l) == 0L) - break; - if (kind > 153) - kind = 153; - { jjCheckNAddTwoStates(61, 62); } - break; - case 0: - if ((0x3ff000000000000L & l) != 0L) - { - if (kind > 137) - kind = 137; - { jjCheckNAdd(7); } - } - else if ((0x100001a00L & l) != 0L) - { - if (kind > 1) - kind = 1; - } - else if ((0x2400L & l) != 0L) - { - if (kind > 8) - kind = 8; - } - else if (curChar == 36) - { jjAddStates(49, 50); } - else if (curChar == 35) - { - if (kind > 152) - kind = 152; - { jjCheckNAddTwoStates(48, 49); } - } - else if (curChar == 37) - jjstateSet[jjnewStateCnt++] = 40; - else if (curChar == 39) - { jjCheckNAddStates(51, 53); } - else if (curChar == 34) - { jjCheckNAddStates(54, 56); } - else if (curChar == 46) - { jjCheckNAdd(3); } - if ((0x3fe000000000000L & l) != 0L) - { - if (kind > 132) - kind = 132; - { jjCheckNAddStates(57, 61); } - } - else if (curChar == 48) - { - if (kind > 132) - kind = 132; - { jjCheckNAddStates(62, 64); } - } - else if (curChar == 36) - jjstateSet[jjnewStateCnt++] = 58; - break; - case 64: - if ((0x3ff001000000000L & l) != 0L) - { - if (kind > 153) - kind = 153; - { jjCheckNAddTwoStates(61, 62); } - } - if ((0x3ff000000000000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 69; - if ((0x3ff000000000000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 65; - break; - case 63: - if ((0x3ff001000000000L & l) != 0L) - { - if (kind > 153) - kind = 153; - { jjCheckNAddTwoStates(61, 62); } - } - if ((0x3ff000000000000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 68; - if ((0x3ff000000000000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 64; - break; - case 1: - if ((0x2400L & l) != 0L && kind > 8) - kind = 8; - break; - case 2: - if (curChar == 46) - { jjCheckNAdd(3); } - break; - case 3: - if ((0x3ff000000000000L & l) == 0L) - break; - if (kind > 132) - kind = 132; - { jjCheckNAddTwoStates(3, 4); } - break; - case 5: - if ((0x280000000000L & l) != 0L) - { jjCheckNAdd(6); } - break; - case 6: - if ((0x3ff000000000000L & l) == 0L) - break; - if (kind > 132) - kind = 132; - { jjCheckNAdd(6); } - break; - case 7: - if ((0x3ff000000000000L & l) == 0L) - break; - if (kind > 137) - kind = 137; - { jjCheckNAdd(7); } - break; - case 16: - if (curChar == 34) - { jjCheckNAddStates(54, 56); } - break; - case 17: - if ((0xfffffffbffffdbffL & l) != 0L) - { jjCheckNAddStates(54, 56); } - break; - case 19: - { jjCheckNAddStates(54, 56); } - break; - case 20: - if (curChar == 34 && kind > 141) - kind = 141; - break; - case 22: - case 27: - if ((0x3ff000000000000L & l) != 0L) - { jjCheckNAdd(23); } - break; - case 23: - if ((0x3ff000000000000L & l) != 0L) - { jjCheckNAddStates(54, 56); } - break; - case 25: - if ((0x3ff000000000000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 26; - break; - case 26: - if ((0x3ff000000000000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 27; - break; - case 28: - if (curChar == 39) - { jjCheckNAddStates(51, 53); } - break; - case 29: - if ((0xffffff7fffffdbffL & l) != 0L) - { jjCheckNAddStates(51, 53); } - break; - case 31: - { jjCheckNAddStates(51, 53); } - break; - case 32: - if (curChar == 39 && kind > 141) - kind = 141; - break; - case 34: - case 39: - if ((0x3ff000000000000L & l) != 0L) - { jjCheckNAdd(35); } - break; - case 35: - if ((0x3ff000000000000L & l) != 0L) - { jjCheckNAddStates(51, 53); } - break; - case 37: - if ((0x3ff000000000000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 38; - break; - case 38: - if ((0x3ff000000000000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 39; - break; - case 41: - { jjCheckNAddTwoStates(41, 42); } - break; - case 43: - if ((0xffffffdfffffffffL & l) != 0L) - { jjCheckNAddTwoStates(44, 42); } - break; - case 44: - { jjCheckNAddTwoStates(44, 42); } - break; - case 45: - if (curChar == 37 && kind > 151) - kind = 151; - break; - case 46: - if (curChar == 37) - jjstateSet[jjnewStateCnt++] = 40; - break; - case 47: - if (curChar != 35) - break; - if (kind > 152) - kind = 152; - { jjCheckNAddTwoStates(48, 49); } - break; - case 48: - if ((0x3ff001000000000L & l) == 0L) - break; - if (kind > 152) - kind = 152; - { jjCheckNAddTwoStates(48, 49); } - break; - case 50: - if ((0x3ff000000000000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 51; - break; - case 51: - if ((0x3ff000000000000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 52; - break; - case 52: - case 56: - if ((0x3ff000000000000L & l) != 0L) - { jjCheckNAdd(53); } - break; - case 53: - if ((0x3ff000000000000L & l) == 0L) - break; - if (kind > 152) - kind = 152; - { jjCheckNAddTwoStates(48, 49); } - break; - case 54: - if ((0x3ff000000000000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 55; - break; - case 55: - if ((0x3ff000000000000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 56; - break; - case 57: - if (curChar == 36) - jjstateSet[jjnewStateCnt++] = 58; - break; - case 58: - if ((0x41800000000L & l) != 0L && kind > 153) - kind = 153; - break; - case 59: - if (curChar == 36) - { jjAddStates(49, 50); } - break; - case 66: - if ((0x3ff000000000000L & l) == 0L) - break; - if (kind > 153) - kind = 153; - { jjCheckNAddTwoStates(61, 62); } - break; - case 67: - if ((0x3ff000000000000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 68; - break; - case 68: - if ((0x3ff000000000000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 69; - break; - case 69: - case 73: - if ((0x3ff000000000000L & l) != 0L) - { jjCheckNAdd(66); } - break; - case 71: - if ((0x3ff000000000000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 72; - break; - case 72: - if ((0x3ff000000000000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 73; - break; - case 74: - if (curChar != 48) - break; - if (kind > 132) - kind = 132; - { jjCheckNAddStates(62, 64); } - break; - case 75: - if (curChar != 46) - break; - if (kind > 132) - kind = 132; - { jjCheckNAddTwoStates(76, 77); } - break; - case 76: - if ((0x3ff000000000000L & l) == 0L) - break; - if (kind > 132) - kind = 132; - { jjCheckNAddTwoStates(76, 77); } - break; - case 78: - if ((0x280000000000L & l) != 0L) - { jjCheckNAdd(79); } - break; - case 79: - if ((0x3ff000000000000L & l) == 0L) - break; - if (kind > 132) - kind = 132; - { jjCheckNAdd(79); } - break; - case 81: - if ((0x280000000000L & l) != 0L) - { jjCheckNAdd(82); } - break; - case 82: - if ((0x3ff000000000000L & l) == 0L) - break; - if (kind > 132) - kind = 132; - { jjCheckNAdd(82); } - break; - case 84: - if ((0x3ff000000000000L & l) == 0L) - break; - if (kind > 136) - kind = 136; - jjstateSet[jjnewStateCnt++] = 84; - break; - case 85: - if ((0x3fe000000000000L & l) == 0L) - break; - if (kind > 132) - kind = 132; - { jjCheckNAddStates(57, 61); } - break; - case 86: - if ((0x3ff000000000000L & l) != 0L) - { jjCheckNAddTwoStates(86, 75); } - break; - case 87: - if ((0x3ff000000000000L & l) == 0L) - break; - if (kind > 132) - kind = 132; - { jjCheckNAddTwoStates(87, 80); } - break; - case 88: - if ((0x3ff000000000000L & l) == 0L) - break; - if (kind > 135) - kind = 135; - { jjCheckNAdd(88); } - break; - default : break; - } - } while(i != startsAt); - } - else if (curChar < 128) - { - long l = 1L << (curChar & 077); - do - { - switch(jjstateSet[--i]) - { - case 89: - if ((0x7fffffe87fffffeL & l) != 0L) - { - if (kind > 153) - kind = 153; - { jjCheckNAddTwoStates(61, 62); } - } - if (curChar == 117) - { jjAddStates(65, 66); } - break; - case 14: - if ((0x7fffffe87fffffeL & l) != 0L) - { - if (kind > 153) - kind = 153; - { jjCheckNAddTwoStates(61, 62); } - } - if (curChar == 117) - { jjAddStates(65, 66); } - else if (curChar == 97) - jjstateSet[jjnewStateCnt++] = 13; - break; - case 65: - if ((0x7fffffe87fffffeL & l) != 0L) - { - if (kind > 153) - kind = 153; - { jjCheckNAddTwoStates(61, 62); } - } - if ((0x7e0000007eL & l) != 0L) - { jjCheckNAdd(66); } - else if (curChar == 117) - { jjAddStates(65, 66); } - if ((0x7e0000007eL & l) != 0L) - { jjCheckNAdd(66); } - break; - case 9: - if ((0x7fffffe87fffffeL & l) != 0L) - { - if (kind > 153) - kind = 153; - { jjCheckNAddTwoStates(61, 62); } - } - if (curChar == 117) - { jjAddStates(65, 66); } - if (curChar == 117) - { jjCheckNAdd(8); } - break; - case 10: - if ((0x7fffffe87fffffeL & l) != 0L) - { - if (kind > 153) - kind = 153; - { jjCheckNAddTwoStates(61, 62); } - } - if (curChar == 117) - { jjAddStates(65, 66); } - else if (curChar == 114) - jjstateSet[jjnewStateCnt++] = 9; - break; - case 0: - if ((0x7fffffe87fffffeL & l) != 0L) - { - if (kind > 153) - kind = 153; - { jjCheckNAddTwoStates(61, 62); } - } - else if (curChar == 64) - { jjAddStates(49, 50); } - if (curChar == 117) - jjstateSet[jjnewStateCnt++] = 71; - else if (curChar == 102) - jjstateSet[jjnewStateCnt++] = 14; - else if (curChar == 116) - jjstateSet[jjnewStateCnt++] = 10; - break; - case 64: - if ((0x7fffffe87fffffeL & l) != 0L) - { - if (kind > 153) - kind = 153; - { jjCheckNAddTwoStates(61, 62); } - } - if ((0x7e0000007eL & l) != 0L) - jjstateSet[jjnewStateCnt++] = 69; - else if (curChar == 117) - { jjAddStates(65, 66); } - if ((0x7e0000007eL & l) != 0L) - jjstateSet[jjnewStateCnt++] = 65; - break; - case 63: - if ((0x7fffffe87fffffeL & l) != 0L) - { - if (kind > 153) - kind = 153; - { jjCheckNAddTwoStates(61, 62); } - } - if ((0x7e0000007eL & l) != 0L) - jjstateSet[jjnewStateCnt++] = 68; - else if (curChar == 117) - { jjAddStates(65, 66); } - if ((0x7e0000007eL & l) != 0L) - jjstateSet[jjnewStateCnt++] = 64; - break; - case 4: - if ((0x2000000020L & l) != 0L) - { jjAddStates(23, 24); } - break; - case 8: - if (curChar == 101 && kind > 140) - kind = 140; - break; - case 11: - if (curChar == 116) - jjstateSet[jjnewStateCnt++] = 10; - break; - case 12: - if (curChar == 115) - { jjCheckNAdd(8); } - break; - case 13: - if (curChar == 108) - jjstateSet[jjnewStateCnt++] = 12; - break; - case 15: - if (curChar == 102) - jjstateSet[jjnewStateCnt++] = 14; - break; - case 17: - if ((0xffffffffefffffffL & l) != 0L) - { jjCheckNAddStates(54, 56); } - break; - case 18: - if (curChar == 92) - { jjAddStates(67, 69); } - break; - case 19: - { jjCheckNAddStates(54, 56); } - break; - case 21: - if (curChar == 120) - jjstateSet[jjnewStateCnt++] = 22; - break; - case 22: - case 27: - if ((0x7e0000007eL & l) != 0L) - { jjCheckNAdd(23); } - break; - case 23: - if ((0x7e0000007eL & l) != 0L) - { jjCheckNAddStates(54, 56); } - break; - case 24: - if (curChar == 117) - jjstateSet[jjnewStateCnt++] = 25; - break; - case 25: - if ((0x7e0000007eL & l) != 0L) - jjstateSet[jjnewStateCnt++] = 26; - break; - case 26: - if ((0x7e0000007eL & l) != 0L) - jjstateSet[jjnewStateCnt++] = 27; - break; - case 29: - if ((0xffffffffefffffffL & l) != 0L) - { jjCheckNAddStates(51, 53); } - break; - case 30: - if (curChar == 92) - { jjAddStates(70, 72); } - break; - case 31: - { jjCheckNAddStates(51, 53); } - break; - case 33: - if (curChar == 120) - jjstateSet[jjnewStateCnt++] = 34; - break; - case 34: - case 39: - if ((0x7e0000007eL & l) != 0L) - { jjCheckNAdd(35); } - break; - case 35: - if ((0x7e0000007eL & l) != 0L) - { jjCheckNAddStates(51, 53); } - break; - case 36: - if (curChar == 117) - jjstateSet[jjnewStateCnt++] = 37; - break; - case 37: - if ((0x7e0000007eL & l) != 0L) - jjstateSet[jjnewStateCnt++] = 38; - break; - case 38: - if ((0x7e0000007eL & l) != 0L) - jjstateSet[jjnewStateCnt++] = 39; - break; - case 40: - if (curChar == 123) - { jjCheckNAddTwoStates(41, 42); } - break; - case 41: - if ((0xdfffffffffffffffL & l) != 0L) - { jjCheckNAddTwoStates(41, 42); } - break; - case 42: - if (curChar == 125) - { jjCheckNAddStates(73, 75); } - break; - case 43: - case 44: - if ((0xdfffffffffffffffL & l) != 0L) - { jjCheckNAddTwoStates(44, 42); } - break; - case 48: - if ((0x7fffffe87fffffeL & l) == 0L) - break; - if (kind > 152) - kind = 152; - { jjCheckNAddTwoStates(48, 49); } - break; - case 49: - if (curChar == 117) - { jjAddStates(76, 77); } - break; - case 50: - if ((0x7e0000007eL & l) != 0L) - jjstateSet[jjnewStateCnt++] = 51; - break; - case 51: - if ((0x7e0000007eL & l) != 0L) - jjstateSet[jjnewStateCnt++] = 52; - break; - case 52: - case 56: - if ((0x7e0000007eL & l) != 0L) - { jjCheckNAdd(53); } - break; - case 53: - if ((0x7e0000007eL & l) == 0L) - break; - if (kind > 152) - kind = 152; - { jjCheckNAddTwoStates(48, 49); } - break; - case 54: - if ((0x7e0000007eL & l) != 0L) - jjstateSet[jjnewStateCnt++] = 55; - break; - case 55: - if ((0x7e0000007eL & l) != 0L) - jjstateSet[jjnewStateCnt++] = 56; - break; - case 58: - if (curChar == 94 && kind > 153) - kind = 153; - break; - case 59: - if (curChar == 64) - { jjAddStates(49, 50); } - break; - case 60: - if ((0x7fffffe87fffffeL & l) == 0L) - break; - if (kind > 153) - kind = 153; - { jjCheckNAddTwoStates(61, 62); } - break; - case 61: - if ((0x7fffffe87fffffeL & l) == 0L) - break; - if (kind > 153) - kind = 153; - { jjCheckNAddTwoStates(61, 62); } - break; - case 62: - if (curChar == 117) - { jjAddStates(65, 66); } - break; - case 66: - if ((0x7e0000007eL & l) == 0L) - break; - if (kind > 153) - kind = 153; - { jjCheckNAddTwoStates(61, 62); } - break; - case 67: - if ((0x7e0000007eL & l) != 0L) - jjstateSet[jjnewStateCnt++] = 68; - break; - case 68: - if ((0x7e0000007eL & l) != 0L) - jjstateSet[jjnewStateCnt++] = 69; - break; - case 69: - case 73: - if ((0x7e0000007eL & l) != 0L) - { jjCheckNAdd(66); } - break; - case 70: - if (curChar == 117) - jjstateSet[jjnewStateCnt++] = 71; - break; - case 71: - if ((0x7e0000007eL & l) != 0L) - jjstateSet[jjnewStateCnt++] = 72; - break; - case 72: - if ((0x7e0000007eL & l) != 0L) - jjstateSet[jjnewStateCnt++] = 73; - break; - case 77: - if ((0x2000000020L & l) != 0L) - { jjAddStates(78, 79); } - break; - case 80: - if ((0x2000000020L & l) != 0L) - { jjAddStates(80, 81); } - break; - case 83: - if ((0x100000001000000L & l) != 0L) - { jjCheckNAdd(84); } - break; - case 84: - if ((0x7e0000007eL & l) == 0L) - break; - if (kind > 136) - kind = 136; - { jjCheckNAdd(84); } - break; - default : break; - } - } while(i != startsAt); - } - else - { - int hiByte = (curChar >> 8); - int i1 = hiByte >> 6; - long l1 = 1L << (hiByte & 077); - int i2 = (curChar & 0xff) >> 6; - long l2 = 1L << (curChar & 077); - do - { - switch(jjstateSet[--i]) - { - case 89: - case 61: - if (!jjCanMove_4(hiByte, i1, i2, l1, l2)) - break; - if (kind > 153) - kind = 153; - { jjCheckNAddTwoStates(61, 62); } - break; - case 14: - if (!jjCanMove_4(hiByte, i1, i2, l1, l2)) - break; - if (kind > 153) - kind = 153; - { jjCheckNAddTwoStates(61, 62); } - break; - case 65: - if (!jjCanMove_4(hiByte, i1, i2, l1, l2)) - break; - if (kind > 153) - kind = 153; - { jjCheckNAddTwoStates(61, 62); } - break; - case 9: - if (!jjCanMove_4(hiByte, i1, i2, l1, l2)) - break; - if (kind > 153) - kind = 153; - { jjCheckNAddTwoStates(61, 62); } - break; - case 10: - if (!jjCanMove_4(hiByte, i1, i2, l1, l2)) - break; - if (kind > 153) - kind = 153; - { jjCheckNAddTwoStates(61, 62); } - break; - case 0: - if (jjCanMove_0(hiByte, i1, i2, l1, l2)) - { - if (kind > 1) - kind = 1; - } - if (jjCanMove_1(hiByte, i1, i2, l1, l2)) - { - if (kind > 8) - kind = 8; - } - if (jjCanMove_5(hiByte, i1, i2, l1, l2)) - { - if (kind > 153) - kind = 153; - { jjCheckNAddTwoStates(61, 62); } - } - break; - case 64: - if (!jjCanMove_4(hiByte, i1, i2, l1, l2)) - break; - if (kind > 153) - kind = 153; - { jjCheckNAddTwoStates(61, 62); } - break; - case 63: - if (!jjCanMove_4(hiByte, i1, i2, l1, l2)) - break; - if (kind > 153) - kind = 153; - { jjCheckNAddTwoStates(61, 62); } - break; - case 1: - if (jjCanMove_1(hiByte, i1, i2, l1, l2) && kind > 8) - kind = 8; - break; - case 17: - if (jjCanMove_2(hiByte, i1, i2, l1, l2)) - { jjCheckNAddStates(54, 56); } - break; - case 19: - if (jjCanMove_3(hiByte, i1, i2, l1, l2)) - { jjCheckNAddStates(54, 56); } - break; - case 29: - if (jjCanMove_2(hiByte, i1, i2, l1, l2)) - { jjCheckNAddStates(51, 53); } - break; - case 31: - if (jjCanMove_3(hiByte, i1, i2, l1, l2)) - { jjCheckNAddStates(51, 53); } - break; - case 41: - if (jjCanMove_3(hiByte, i1, i2, l1, l2)) - { jjCheckNAddTwoStates(41, 42); } - break; - case 43: - case 44: - if (jjCanMove_3(hiByte, i1, i2, l1, l2)) - { jjCheckNAddTwoStates(44, 42); } - break; - case 48: - if (!jjCanMove_4(hiByte, i1, i2, l1, l2)) - break; - if (kind > 152) - kind = 152; - { jjAddStates(82, 83); } - break; - case 60: - if (!jjCanMove_5(hiByte, i1, i2, l1, l2)) - break; - if (kind > 153) - kind = 153; - { jjCheckNAddTwoStates(61, 62); } - break; - default : if (i1 == 0 || l1 == 0 || i2 == 0 || l2 == 0) break; else break; - } - } while(i != startsAt); - } - if (kind != 0x7fffffff) - { - jjmatchedKind = kind; - jjmatchedPos = curPos; - kind = 0x7fffffff; - } - ++curPos; - if ((i = jjnewStateCnt) == (startsAt = 89 - (jjnewStateCnt = startsAt))) - return curPos; - try { curChar = input_stream.readChar(); } - catch(java.io.IOException e) { return curPos; } - } -} - -/** Token literal values. */ -public static final String[] jjstrLiteralImages = { -null, null, null, null, null, null, null, null, null, null, null, null, null, -null, null, null, null, null, "\151\156\143\154\165\144\145", -"\141\163\160\145\143\164\144\145\146", "\143\157\144\145\144\145\146", "\151\156\160\165\164", -"\157\165\164\160\165\164", "\163\164\141\164\151\143", "\163\145\154\145\143\164", -"\141\160\160\154\171", "\164\157", "\143\141\154\154", "\162\165\156", "\143\155\144", -"\143\157\156\144\151\164\151\157\156", "\142\145\147\151\156", "\151\156\163\145\162\164", "\145\170\145\143", -"\157\165\164", "\142\145\146\157\162\145", "\141\146\164\145\162", -"\141\162\157\165\156\144", "\162\145\160\154\141\143\145", "\144\145\146", "\143\150\145\143\153", -"\151\156\151\164\151\141\154\151\172\145", "\146\151\156\141\154\151\172\145", "\145\156\144", -"\144\171\156\141\155\151\143", "\163\145\161", "\160\141\162", "\142\162\145\141\153", -"\143\157\156\164\151\156\165\145", "\144\145\154\145\164\145", "\145\154\163\145", "\146\157\162", -"\146\165\156\143\164\151\157\156", "\146\165\156\143\164\151\157\156\52", "\151\146", "\151\156", "\157\146", -"\145\141\143\150", "\156\145\167", "\162\145\164\165\162\156", "\171\151\145\154\144", -"\164\150\151\163", "\164\171\160\145\157\146", "\166\141\162", "\166\157\151\144", -"\167\150\151\154\145", "\167\151\164\150", "\143\141\163\145", "\143\141\164\143\150", -"\143\154\141\163\163", "\143\157\156\163\164", "\144\145\142\165\147\147\145\162", -"\144\145\146\141\165\154\164", "\144\157", "\145\156\165\155", "\145\170\164\145\156\144\163", -"\146\151\156\141\154\154\171", "\151\155\160\157\162\164", "\163\165\160\145\162", -"\163\167\151\164\143\150", "\164\150\162\157\167", "\164\162\171", "\75\76", "\173", "\175", "\50", -"\51", "\133", "\135", "\56", "\73", "\54", "\74", "\76", "\74\75", "\76\75", -"\75\75", "\41\75", "\176\75", "\75\75\75", "\41\75\75", "\53", "\55", "\52", "\45", -"\53\53", "\55\55", "\74\74", "\76\76", "\76\76\76", "\46", "\174", "\136", "\41", -"\176", "\46\46", "\174\174", "\77", "\72\72", "\72", "\75", "\53\75", "\55\75", -"\52\75", "\45\75", "\74\74\75", "\76\76\75", "\76\76\76\75", "\46\75", "\174\75", -"\136\75", "\151\156\163\164\141\156\143\145\157\146", null, null, null, null, null, null, -null, "\156\165\154\154", null, null, null, null, null, null, null, null, null, null, -null, null, null, null, null, null, null, null, null, null, null, null, null, null, -null, null, null, "\57\75", "\57", null, null, }; -protected Token jjFillToken() -{ - final Token t; - final String curTokenImage; - final int beginLine; - final int endLine; - final int beginColumn; - final int endColumn; - if (jjmatchedPos < 0) - { - if (image == null) - curTokenImage = ""; - else - curTokenImage = image.toString(); - beginLine = endLine = input_stream.getEndLine(); - beginColumn = endColumn = input_stream.getEndColumn(); - } - else - { - String im = jjstrLiteralImages[jjmatchedKind]; - curTokenImage = (im == null) ? input_stream.GetImage() : im; - beginLine = input_stream.getBeginLine(); - beginColumn = input_stream.getBeginColumn(); - endLine = input_stream.getEndLine(); - endColumn = input_stream.getEndColumn(); - } - t = Token.newToken(jjmatchedKind, curTokenImage); - - t.beginLine = beginLine; - t.endLine = endLine; - t.beginColumn = beginColumn; - t.endColumn = endColumn; - - return t; -} -static final int[] jjnextStates = { - 84, 85, 87, 83, 97, 62, 72, 28, 29, 31, 16, 17, 19, 110, 99, 111, - 104, 112, 99, 104, 107, 65, 69, 5, 6, 18, 20, 23, 30, 32, 35, 44, - 45, 47, 52, 56, 90, 94, 102, 103, 105, 106, 50, 51, 88, 89, 0, 1, - 3, 60, 70, 29, 30, 32, 17, 18, 20, 86, 75, 87, 80, 88, 75, 80, - 83, 63, 67, 19, 21, 24, 31, 33, 36, 42, 43, 45, 50, 54, 78, 79, - 81, 82, 48, 49, -}; -private static final boolean jjCanMove_0(int hiByte, int i1, int i2, long l1, long l2) -{ - switch(hiByte) - { - case 0: - return ((jjbitVec0[i2] & l2) != 0L); - default : - return false; - } -} -private static final boolean jjCanMove_1(int hiByte, int i1, int i2, long l1, long l2) -{ - switch(hiByte) - { - case 32: - return ((jjbitVec1[i2] & l2) != 0L); - default : - return false; - } -} -private static final boolean jjCanMove_2(int hiByte, int i1, int i2, long l1, long l2) -{ - switch(hiByte) - { - case 0: - return ((jjbitVec4[i2] & l2) != 0L); - case 32: - return ((jjbitVec5[i2] & l2) != 0L); - default : - if ((jjbitVec2[i1] & l1) != 0L) - return true; - return false; - } -} -private static final boolean jjCanMove_3(int hiByte, int i1, int i2, long l1, long l2) -{ - switch(hiByte) - { - case 0: - return ((jjbitVec4[i2] & l2) != 0L); - default : - if ((jjbitVec6[i1] & l1) != 0L) - return true; - return false; - } -} -private static final boolean jjCanMove_4(int hiByte, int i1, int i2, long l1, long l2) -{ - switch(hiByte) - { - case 0: - return ((jjbitVec10[i2] & l2) != 0L); - case 2: - return ((jjbitVec11[i2] & l2) != 0L); - case 3: - return ((jjbitVec12[i2] & l2) != 0L); - case 4: - return ((jjbitVec13[i2] & l2) != 0L); - case 5: - return ((jjbitVec14[i2] & l2) != 0L); - case 6: - return ((jjbitVec15[i2] & l2) != 0L); - case 7: - return ((jjbitVec16[i2] & l2) != 0L); - case 9: - return ((jjbitVec17[i2] & l2) != 0L); - case 10: - return ((jjbitVec18[i2] & l2) != 0L); - case 11: - return ((jjbitVec19[i2] & l2) != 0L); - case 12: - return ((jjbitVec20[i2] & l2) != 0L); - case 13: - return ((jjbitVec21[i2] & l2) != 0L); - case 14: - return ((jjbitVec22[i2] & l2) != 0L); - case 15: - return ((jjbitVec23[i2] & l2) != 0L); - case 16: - return ((jjbitVec24[i2] & l2) != 0L); - case 17: - return ((jjbitVec25[i2] & l2) != 0L); - case 18: - return ((jjbitVec26[i2] & l2) != 0L); - case 19: - return ((jjbitVec27[i2] & l2) != 0L); - case 20: - return ((jjbitVec6[i2] & l2) != 0L); - case 22: - return ((jjbitVec28[i2] & l2) != 0L); - case 23: - return ((jjbitVec29[i2] & l2) != 0L); - case 24: - return ((jjbitVec30[i2] & l2) != 0L); - case 25: - return ((jjbitVec31[i2] & l2) != 0L); - case 26: - return ((jjbitVec32[i2] & l2) != 0L); - case 29: - return ((jjbitVec33[i2] & l2) != 0L); - case 30: - return ((jjbitVec34[i2] & l2) != 0L); - case 31: - return ((jjbitVec35[i2] & l2) != 0L); - case 32: - return ((jjbitVec36[i2] & l2) != 0L); - case 33: - return ((jjbitVec37[i2] & l2) != 0L); - case 48: - return ((jjbitVec38[i2] & l2) != 0L); - case 49: - return ((jjbitVec39[i2] & l2) != 0L); - case 77: - return ((jjbitVec40[i2] & l2) != 0L); - case 159: - return ((jjbitVec41[i2] & l2) != 0L); - case 164: - return ((jjbitVec42[i2] & l2) != 0L); - case 168: - return ((jjbitVec43[i2] & l2) != 0L); - case 215: - return ((jjbitVec44[i2] & l2) != 0L); - case 250: - return ((jjbitVec45[i2] & l2) != 0L); - case 251: - return ((jjbitVec46[i2] & l2) != 0L); - case 253: - return ((jjbitVec47[i2] & l2) != 0L); - case 254: - return ((jjbitVec48[i2] & l2) != 0L); - case 255: - return ((jjbitVec49[i2] & l2) != 0L); - default : - if ((jjbitVec8[i1] & l1) != 0L) - if ((jjbitVec9[i2] & l2) == 0L) - return false; - else - return true; - if ((jjbitVec7[i1] & l1) != 0L) - return true; - return false; - } -} -private static final boolean jjCanMove_5(int hiByte, int i1, int i2, long l1, long l2) -{ - switch(hiByte) - { - case 0: - return ((jjbitVec10[i2] & l2) != 0L); - case 2: - return ((jjbitVec11[i2] & l2) != 0L); - case 3: - return ((jjbitVec50[i2] & l2) != 0L); - case 4: - return ((jjbitVec51[i2] & l2) != 0L); - case 5: - return ((jjbitVec52[i2] & l2) != 0L); - case 6: - return ((jjbitVec53[i2] & l2) != 0L); - case 7: - return ((jjbitVec54[i2] & l2) != 0L); - case 9: - return ((jjbitVec55[i2] & l2) != 0L); - case 10: - return ((jjbitVec56[i2] & l2) != 0L); - case 11: - return ((jjbitVec57[i2] & l2) != 0L); - case 12: - return ((jjbitVec58[i2] & l2) != 0L); - case 13: - return ((jjbitVec59[i2] & l2) != 0L); - case 14: - return ((jjbitVec60[i2] & l2) != 0L); - case 15: - return ((jjbitVec61[i2] & l2) != 0L); - case 16: - return ((jjbitVec62[i2] & l2) != 0L); - case 17: - return ((jjbitVec25[i2] & l2) != 0L); - case 18: - return ((jjbitVec26[i2] & l2) != 0L); - case 19: - return ((jjbitVec63[i2] & l2) != 0L); - case 20: - return ((jjbitVec6[i2] & l2) != 0L); - case 22: - return ((jjbitVec28[i2] & l2) != 0L); - case 23: - return ((jjbitVec64[i2] & l2) != 0L); - case 24: - return ((jjbitVec65[i2] & l2) != 0L); - case 30: - return ((jjbitVec34[i2] & l2) != 0L); - case 31: - return ((jjbitVec35[i2] & l2) != 0L); - case 32: - return ((jjbitVec66[i2] & l2) != 0L); - case 33: - return ((jjbitVec37[i2] & l2) != 0L); - case 48: - return ((jjbitVec67[i2] & l2) != 0L); - case 49: - return ((jjbitVec39[i2] & l2) != 0L); - case 77: - return ((jjbitVec40[i2] & l2) != 0L); - case 159: - return ((jjbitVec41[i2] & l2) != 0L); - case 164: - return ((jjbitVec42[i2] & l2) != 0L); - case 215: - return ((jjbitVec44[i2] & l2) != 0L); - case 250: - return ((jjbitVec45[i2] & l2) != 0L); - case 251: - return ((jjbitVec68[i2] & l2) != 0L); - case 253: - return ((jjbitVec47[i2] & l2) != 0L); - case 254: - return ((jjbitVec69[i2] & l2) != 0L); - case 255: - return ((jjbitVec70[i2] & l2) != 0L); - default : - if ((jjbitVec8[i1] & l1) != 0L) - if ((jjbitVec9[i2] & l2) == 0L) - return false; - else - return true; - if ((jjbitVec7[i1] & l1) != 0L) - return true; - return false; - } -} -private static final boolean jjCanMove_6(int hiByte, int i1, int i2, long l1, long l2) -{ - switch(hiByte) - { - case 3: - return ((jjbitVec71[i2] & l2) != 0L); - case 4: - return ((jjbitVec72[i2] & l2) != 0L); - case 5: - return ((jjbitVec73[i2] & l2) != 0L); - case 6: - return ((jjbitVec74[i2] & l2) != 0L); - case 7: - return ((jjbitVec75[i2] & l2) != 0L); - case 9: - return ((jjbitVec76[i2] & l2) != 0L); - case 10: - return ((jjbitVec77[i2] & l2) != 0L); - case 11: - return ((jjbitVec78[i2] & l2) != 0L); - case 12: - return ((jjbitVec79[i2] & l2) != 0L); - case 13: - return ((jjbitVec80[i2] & l2) != 0L); - case 14: - return ((jjbitVec81[i2] & l2) != 0L); - case 15: - return ((jjbitVec82[i2] & l2) != 0L); - case 16: - return ((jjbitVec83[i2] & l2) != 0L); - case 23: - return ((jjbitVec84[i2] & l2) != 0L); - case 24: - return ((jjbitVec85[i2] & l2) != 0L); - case 25: - return ((jjbitVec31[i2] & l2) != 0L); - case 26: - return ((jjbitVec32[i2] & l2) != 0L); - case 29: - return ((jjbitVec33[i2] & l2) != 0L); - case 32: - return ((jjbitVec86[i2] & l2) != 0L); - case 48: - return ((jjbitVec87[i2] & l2) != 0L); - case 168: - return ((jjbitVec43[i2] & l2) != 0L); - case 251: - return ((jjbitVec88[i2] & l2) != 0L); - case 254: - return ((jjbitVec89[i2] & l2) != 0L); - default : - return false; - } -} -private static final boolean jjCanMove_7(int hiByte, int i1, int i2, long l1, long l2) -{ - switch(hiByte) - { - case 9: - return ((jjbitVec90[i2] & l2) != 0L); - case 10: - return ((jjbitVec91[i2] & l2) != 0L); - case 11: - return ((jjbitVec92[i2] & l2) != 0L); - case 12: - return ((jjbitVec93[i2] & l2) != 0L); - case 13: - return ((jjbitVec94[i2] & l2) != 0L); - case 15: - return ((jjbitVec95[i2] & l2) != 0L); - case 16: - return ((jjbitVec96[i2] & l2) != 0L); - case 23: - return ((jjbitVec97[i2] & l2) != 0L); - case 25: - return ((jjbitVec31[i2] & l2) != 0L); - case 26: - return ((jjbitVec32[i2] & l2) != 0L); - case 29: - return ((jjbitVec33[i2] & l2) != 0L); - case 168: - return ((jjbitVec43[i2] & l2) != 0L); - default : - return false; - } -} -private static final boolean jjCanMove_8(int hiByte, int i1, int i2, long l1, long l2) -{ - switch(hiByte) - { - case 3: - return ((jjbitVec71[i2] & l2) != 0L); - case 4: - return ((jjbitVec72[i2] & l2) != 0L); - case 5: - return ((jjbitVec73[i2] & l2) != 0L); - case 6: - return ((jjbitVec74[i2] & l2) != 0L); - case 7: - return ((jjbitVec75[i2] & l2) != 0L); - case 9: - return ((jjbitVec76[i2] & l2) != 0L); - case 10: - return ((jjbitVec98[i2] & l2) != 0L); - case 11: - return ((jjbitVec78[i2] & l2) != 0L); - case 12: - return ((jjbitVec79[i2] & l2) != 0L); - case 13: - return ((jjbitVec80[i2] & l2) != 0L); - case 14: - return ((jjbitVec81[i2] & l2) != 0L); - case 15: - return ((jjbitVec82[i2] & l2) != 0L); - case 16: - return ((jjbitVec83[i2] & l2) != 0L); - case 23: - return ((jjbitVec84[i2] & l2) != 0L); - case 24: - return ((jjbitVec85[i2] & l2) != 0L); - case 32: - return ((jjbitVec86[i2] & l2) != 0L); - case 48: - return ((jjbitVec87[i2] & l2) != 0L); - case 251: - return ((jjbitVec88[i2] & l2) != 0L); - case 254: - return ((jjbitVec89[i2] & l2) != 0L); - default : - return false; - } -} -private static final boolean jjCanMove_9(int hiByte, int i1, int i2, long l1, long l2) -{ - switch(hiByte) - { - case 6: - return ((jjbitVec103[i2] & l2) != 0L); - case 11: - return ((jjbitVec104[i2] & l2) != 0L); - case 13: - return ((jjbitVec105[i2] & l2) != 0L); - case 14: - return ((jjbitVec106[i2] & l2) != 0L); - case 15: - return ((jjbitVec107[i2] & l2) != 0L); - case 16: - return ((jjbitVec108[i2] & l2) != 0L); - case 19: - return ((jjbitVec109[i2] & l2) != 0L); - case 23: - return ((jjbitVec110[i2] & l2) != 0L); - default : - if ((jjbitVec101[i1] & l1) != 0L) - if ((jjbitVec102[i2] & l2) == 0L) - return false; - else - return true; - if ((jjbitVec99[i1] & l1) != 0L) - if ((jjbitVec100[i2] & l2) == 0L) - return false; - else - return true; - return false; - } -} -private static final boolean jjCanMove_10(int hiByte, int i1, int i2, long l1, long l2) -{ - switch(hiByte) - { - case 32: - return ((jjbitVec111[i2] & l2) != 0L); - case 48: - return ((jjbitVec112[i2] & l2) != 0L); - case 254: - return ((jjbitVec113[i2] & l2) != 0L); - case 255: - return ((jjbitVec114[i2] & l2) != 0L); - default : - return false; - } -} - -int curLexState = 0; -int defaultLexState = 0; -int jjnewStateCnt; -int jjround; -int jjmatchedPos; -int jjmatchedKind; - -/** Get the next Token. */ -public Token getNextToken() -{ - Token specialToken = null; - Token matchedToken; - int curPos = 0; - - EOFLoop : - for (;;) - { - try - { - curChar = input_stream.BeginToken(); - } - catch(Exception e) - { - jjmatchedKind = 0; - jjmatchedPos = -1; - matchedToken = jjFillToken(); - matchedToken.specialToken = specialToken; - return matchedToken; - } - image = jjimage; - image.setLength(0); - jjimageLen = 0; - - for (;;) - { - switch(curLexState) - { - case 0: - jjmatchedKind = 0x7fffffff; - jjmatchedPos = 0; - curPos = jjMoveStringLiteralDfa0_0(); - break; - case 1: - jjmatchedKind = 0x7fffffff; - jjmatchedPos = 0; - curPos = jjMoveStringLiteralDfa0_1(); - break; - case 2: - jjmatchedKind = 15; - jjmatchedPos = -1; - curPos = 0; - curPos = jjMoveStringLiteralDfa0_2(); - if (jjmatchedPos < 0 || (jjmatchedPos == 0 && jjmatchedKind > 17)) - { - jjmatchedKind = 17; - jjmatchedPos = 0; - } - break; - case 3: - jjmatchedKind = 0x7fffffff; - jjmatchedPos = 0; - curPos = jjMoveStringLiteralDfa0_3(); - if (jjmatchedPos == 0 && jjmatchedKind > 17) - { - jjmatchedKind = 17; - } - break; - case 4: - jjmatchedKind = 0x7fffffff; - jjmatchedPos = 0; - curPos = jjMoveStringLiteralDfa0_4(); - if (jjmatchedPos == 0 && jjmatchedKind > 17) - { - jjmatchedKind = 17; - } - break; - } - if (jjmatchedKind != 0x7fffffff) - { - if (jjmatchedPos + 1 < curPos) - input_stream.backup(curPos - jjmatchedPos - 1); - if ((jjtoToken[jjmatchedKind >> 6] & (1L << (jjmatchedKind & 077))) != 0L) - { - matchedToken = jjFillToken(); - matchedToken.specialToken = specialToken; - if (jjnewLexState[jjmatchedKind] != -1) - curLexState = jjnewLexState[jjmatchedKind]; - return matchedToken; - } - else if ((jjtoSkip[jjmatchedKind >> 6] & (1L << (jjmatchedKind & 077))) != 0L) - { - if ((jjtoSpecial[jjmatchedKind >> 6] & (1L << (jjmatchedKind & 077))) != 0L) - { - matchedToken = jjFillToken(); - if (specialToken == null) - specialToken = matchedToken; - else - { - matchedToken.specialToken = specialToken; - specialToken = (specialToken.next = matchedToken); - } - SkipLexicalActions(matchedToken); - } - else - SkipLexicalActions(null); - if (jjnewLexState[jjmatchedKind] != -1) - curLexState = jjnewLexState[jjmatchedKind]; - continue EOFLoop; - } - jjimageLen += jjmatchedPos + 1; - if (jjnewLexState[jjmatchedKind] != -1) - curLexState = jjnewLexState[jjmatchedKind]; - curPos = 0; - jjmatchedKind = 0x7fffffff; - try { - curChar = input_stream.readChar(); - continue; - } - catch (java.io.IOException e1) { } - } - int error_line = input_stream.getEndLine(); - int error_column = input_stream.getEndColumn(); - String error_after = null; - boolean EOFSeen = false; - try { input_stream.readChar(); input_stream.backup(1); } - catch (java.io.IOException e1) { - EOFSeen = true; - error_after = curPos <= 1 ? "" : input_stream.GetImage(); - if (curChar == '\n' || curChar == '\r') { - error_line++; - error_column = 0; - } - else - error_column++; - } - if (!EOFSeen) { - input_stream.backup(1); - error_after = curPos <= 1 ? "" : input_stream.GetImage(); - } - throw new TokenMgrError(EOFSeen, curLexState, error_line, error_column, error_after, curChar, TokenMgrError.LEXICAL_ERROR); - } - } -} - -void SkipLexicalActions(Token matchedToken) -{ - switch(jjmatchedKind) - { - default : - break; - } -} -void MoreLexicalActions() -{ - jjimageLen += (lengthOfMatch = jjmatchedPos + 1); - switch(jjmatchedKind) - { - default : - break; - } -} -void TokenLexicalActions(Token matchedToken) -{ - switch(jjmatchedKind) - { - default : - break; - } -} -private void jjCheckNAdd(int state) -{ - if (jjrounds[state] != jjround) - { - jjstateSet[jjnewStateCnt++] = state; - jjrounds[state] = jjround; - } -} -private void jjAddStates(int start, int end) -{ - do { - jjstateSet[jjnewStateCnt++] = jjnextStates[start]; - } while (start++ != end); -} -private void jjCheckNAddTwoStates(int state1, int state2) -{ - jjCheckNAdd(state1); - jjCheckNAdd(state2); -} - -private void jjCheckNAddStates(int start, int end) -{ - do { - jjCheckNAdd(jjnextStates[start]); - } while (start++ != end); -} - - /** Constructor. */ - public LARAEcmaScriptTokenManager(JavaCharStream stream){ - - if (JavaCharStream.staticFlag) - throw new Error("ERROR: Cannot use a static CharStream class with a non-static lexical analyzer."); - - input_stream = stream; - } - - /** Constructor. */ - public LARAEcmaScriptTokenManager (JavaCharStream stream, int lexState){ - ReInit(stream); - SwitchTo(lexState); - } - - /** Reinitialise parser. */ - - public void ReInit(JavaCharStream stream) - { - - - jjmatchedPos = - jjnewStateCnt = - 0; - curLexState = defaultLexState; - input_stream = stream; - ReInitRounds(); - } - - private void ReInitRounds() - { - int i; - jjround = 0x80000001; - for (i = 119; i-- > 0;) - jjrounds[i] = 0x80000000; - } - - /** Reinitialise parser. */ - public void ReInit(JavaCharStream stream, int lexState) - - { - ReInit(stream); - SwitchTo(lexState); - } - - /** Switch to specified lex state. */ - public void SwitchTo(int lexState) - { - if (lexState >= 5 || lexState < 0) - throw new TokenMgrError("Error: Ignoring invalid lexical state : " + lexState + ". State unchanged.", TokenMgrError.INVALID_LEXICAL_STATE); - else - curLexState = lexState; - } - - -/** Lexer state names. */ -public static final String[] lexStateNames = { - "DEFAULT", - "IN_REGEX", - "IN_SINGLE_LINE_COMMENT", - "IN_MULTI_LINE_COMMENT", - "IN_PATTERN", -}; - -/** Lex State array. */ -public static final int[] jjnewLexState = { - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2, 3, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 1, -1, -1, 1, 1, 1, -1, 1, 1, 1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 0, 1, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 0, 1, -1, -}; -static final long[] jjtoToken = { - 0xfffffffffffc0001L, 0xffffffffffffffffL, 0x3fe03c03f9fL, -}; -static final long[] jjtoSkip = { - 0x18102L, 0x0L, 0x0L, -}; -static final long[] jjtoSpecial = { - 0x18000L, 0x0L, 0x0L, -}; -static final long[] jjtoMore = { - 0x26000L, 0x0L, 0x100000000L, -}; - protected JavaCharStream input_stream; - - private final int[] jjrounds = new int[119]; - private final int[] jjstateSet = new int[2 * 119]; - private final StringBuilder jjimage = new StringBuilder(); - private StringBuilder image = jjimage; - private int jjimageLen; - private int lengthOfMatch; - protected int curChar; -} diff --git a/LARAC/src/org/dojo/jsl/parser/ast/LARAEcmaScriptTreeConstants.java b/LARAC/src/org/dojo/jsl/parser/ast/LARAEcmaScriptTreeConstants.java deleted file mode 100644 index 00201ea56..000000000 --- a/LARAC/src/org/dojo/jsl/parser/ast/LARAEcmaScriptTreeConstants.java +++ /dev/null @@ -1,203 +0,0 @@ -/* Generated By:JavaCC: Do not edit this line. LARAEcmaScriptTreeConstants.java Version 7.0.12 */ -package org.dojo.jsl.parser.ast; - -public interface LARAEcmaScriptTreeConstants -{ - public int JJTVOID = 0; - public int JJTIDENTIFIER = 1; - public int JJTSTART = 2; - public int JJTASSIGNMENTEXPRESSION = 3; - public int JJTIMPORT = 4; - public int JJTFILEPATH = 5; - public int JJTCODEDEF = 6; - public int JJTFORMALPARAMETERLIST = 7; - public int JJTINPUT = 8; - public int JJTOUTPUT = 9; - public int JJTSTATIC = 10; - public int JJTINITIALIZE = 11; - public int JJTFINALIZE = 12; - public int JJTCHECK = 13; - public int JJTASPECTDEF = 14; - public int JJTSELECT = 15; - public int JJTJOIN = 16; - public int JJTPOINTCUT = 17; - public int JJTORFILTERSEXPR = 18; - public int JJTPOINTCUTFILTERS = 19; - public int JJTANDFILTERSEXPR = 20; - public int JJTFILTER = 21; - public int JJTAROUNDAPPLY = 22; - public int JJTAPPLIES = 23; - public int JJTAPPLY = 24; - public int JJTTO = 25; - public int JJTACTION = 26; - public int JJTCOMPOSITEREFERENCE = 27; - public int JJTCALL = 28; - public int JJTRUN = 29; - public int JJTCMD = 30; - public int JJTINSERT = 31; - public int JJTPERFORM = 32; - public int JJTFUNCTIONCALLPARAMETERS = 33; - public int JJTOUTPUTACT = 34; - public int JJTDEFINE = 35; - public int JJTCONDITION = 36; - public int JJTFOR = 37; - public int JJTTHISREFERENCE = 38; - public int JJTPARENEXPRESSION = 39; - public int JJTLITERAL = 40; - public int JJTARRAYLITERAL = 41; - public int JJTEMPTYPOSITIONS = 42; - public int JJTOBJECTLITERAL = 43; - public int JJTLITERALFIELD = 44; - public int JJTALLOCATIONEXPRESSION = 45; - public int JJTPROPERTYVALUEREFERENCE = 46; - public int JJTPROPERTYIDENTIFIERREFERENCE = 47; - public int JJTNAMEDARGUMENT = 48; - public int JJTPOSTFIXEXPRESSION = 49; - public int JJTOPERATOR = 50; - public int JJTUNARYEXPRESSION = 51; - public int JJTBINARYEXPRESSIONSEQUENCE = 52; - public int JJTANDEXPRESSIONSEQUENCE = 53; - public int JJTOREXPRESSIONSEQUENCE = 54; - public int JJTCONDITIONALEXPRESSION = 55; - public int JJTEXPRESSIONLIST = 56; - public int JJTBLOCK = 57; - public int JJTSTATEMENTLIST = 58; - public int JJTVARIABLESTATEMENT = 59; - public int JJTVARIABLEDECLARATIONLIST = 60; - public int JJTVARIABLEDECLARATION = 61; - public int JJTEMPTYEXPRESSION = 62; - public int JJTEMPTYSTATEMENT = 63; - public int JJTEXPRESSIONSTATEMENT = 64; - public int JJTIFSTATEMENT = 65; - public int JJTDOSTATEMENT = 66; - public int JJTWHILESTATEMENT = 67; - public int JJTFORVARINSTATEMENT = 68; - public int JJTFORINSTATEMENT = 69; - public int JJTPREASSIGNMENTLIST = 70; - public int JJTFORCONDITIONLIST = 71; - public int JJTPOSTASSIGNMENTLIST = 72; - public int JJTFORSTATEMENT = 73; - public int JJTFORVARSTATEMENT = 74; - public int JJTCONTINUESTATEMENT = 75; - public int JJTBREAKSTATEMENT = 76; - public int JJTRETURNSTATEMENT = 77; - public int JJTYIELDSTATEMENT = 78; - public int JJTYIELDSTAR = 79; - public int JJTWITHSTATEMENT = 80; - public int JJTSWITCHSTATEMENT = 81; - public int JJTCASEGROUPS = 82; - public int JJTCASEGROUP = 83; - public int JJTCASEGUARD = 84; - public int JJTLABELLEDSTATEMENT = 85; - public int JJTTHROWSTATEMENT = 86; - public int JJTTRYSTATEMENT = 87; - public int JJTCATCHCLAUSE = 88; - public int JJTFINALLYCLAUSE = 89; - public int JJTFUNCTIONDECLARATION = 90; - public int JJTGENERATORFUNCTIONDECLARATION = 91; - public int JJTARROWFUNCTIONEXPRESSION = 92; - public int JJTFUNCTIONEXPRESSION = 93; - public int JJTGENERATORFUNCTIONEXPRESSION = 94; - public int JJTJAVASCRIPT = 95; - - - public String[] jjtNodeName = { - "void", - "Identifier", - "Start", - "AssignmentExpression", - "Import", - "FilePath", - "CodeDef", - "FormalParameterList", - "Input", - "Output", - "Static", - "Initialize", - "Finalize", - "Check", - "AspectDef", - "Select", - "Join", - "Pointcut", - "OrFiltersExpr", - "PointcutFilters", - "ANDFiltersExpr", - "Filter", - "AroundApply", - "Applies", - "Apply", - "To", - "Action", - "CompositeReference", - "Call", - "Run", - "Cmd", - "Insert", - "Perform", - "FunctionCallParameters", - "OutputAct", - "Define", - "Condition", - "For", - "ThisReference", - "ParenExpression", - "Literal", - "ArrayLiteral", - "EmptyPositions", - "ObjectLiteral", - "LiteralField", - "AllocationExpression", - "PropertyValueReference", - "PropertyIdentifierReference", - "NamedArgument", - "PostfixExpression", - "Operator", - "UnaryExpression", - "BinaryExpressionSequence", - "AndExpressionSequence", - "OrExpressionSequence", - "ConditionalExpression", - "ExpressionList", - "Block", - "StatementList", - "VariableStatement", - "VariableDeclarationList", - "VariableDeclaration", - "EmptyExpression", - "EmptyStatement", - "ExpressionStatement", - "IfStatement", - "DoStatement", - "WhileStatement", - "ForVarInStatement", - "ForInStatement", - "PreAssignmentList", - "ForConditionList", - "PostAssignmentList", - "ForStatement", - "ForVarStatement", - "ContinueStatement", - "BreakStatement", - "ReturnStatement", - "YieldStatement", - "YieldStar", - "WithStatement", - "SwitchStatement", - "CaseGroups", - "CaseGroup", - "CaseGuard", - "LabelledStatement", - "ThrowStatement", - "TryStatement", - "CatchClause", - "FinallyClause", - "FunctionDeclaration", - "GeneratorFunctionDeclaration", - "ArrowFunctionExpression", - "FunctionExpression", - "GeneratorFunctionExpression", - "JavaScript", - }; -} -/* JavaCC - OriginalChecksum=b7cc01a355f87089dd5cd6deabc99a95 (do not edit this line) */ diff --git a/LARAC/src/org/dojo/jsl/parser/ast/LARAParserBase.java b/LARAC/src/org/dojo/jsl/parser/ast/LARAParserBase.java deleted file mode 100644 index 5a1ff78c0..000000000 --- a/LARAC/src/org/dojo/jsl/parser/ast/LARAParserBase.java +++ /dev/null @@ -1,67 +0,0 @@ -/** - * Copyright 2015 SPeCS. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. under the License. - */ - -package org.dojo.jsl.parser.ast; - -import java.util.Stack; - -public class LARAParserBase implements LARAEcmaScriptTreeConstants, - LARAEcmaScriptConstants { - - Stack nodeStack = new Stack<>(); - - // ArrayList functions = new ArrayList(); - // ArrayList variables = new ArrayList(); - - protected void jjtreeOpenNodeScope(SimpleNode astNode) { - nodeStack.push(astNode); - } - - protected void jjtreeCloseNodeScope(SimpleNode astNode) { - if (nodeStack.size() > 0) { - nodeStack.pop(); - } - - // if (astNode instanceof ASTFunctionDef) - // addFunction((ASTFunctionDef) astNode); - // else if (astNode instanceof ASTPoint) - // addVariable(astNode); - } - - protected SimpleNode getCurrentNode() { - if (nodeStack.size() > 0) { - return nodeStack.peek(); - } - return null; - } - - // void addFunction(ASTFunctionDef function) - // { - // functions.add(function); - // } - // - // public ArrayList getFunctions() - // { - // return functions; - // } - // - // void addVariable (SimpleNode varNode) - // { - // variables.add(varNode); - // } - // - // public ArrayList getVriables() - // { - // return variables; - // } -} diff --git a/LARAC/src/org/dojo/jsl/parser/ast/Node.java b/LARAC/src/org/dojo/jsl/parser/ast/Node.java deleted file mode 100644 index c06f68d62..000000000 --- a/LARAC/src/org/dojo/jsl/parser/ast/Node.java +++ /dev/null @@ -1,38 +0,0 @@ -/* Generated By:JJTree: Do not edit this line. Node.java Version 7.0 */ -/* JavaCCOptions:MULTI=true,NODE_USES_PARSER=false,VISITOR=false,TRACK_TOKENS=true,NODE_PREFIX=AST,NODE_EXTENDS=,NODE_FACTORY=,SUPPORT_CLASS_VISIBILITY_PUBLIC=true */ -package org.dojo.jsl.parser.ast; - -/* All AST nodes must implement this interface. It provides basic - machinery for constructing the parent and child relationships - between nodes. */ - -public -interface Node { - - /** This method is called after the node has been made the current - node. It indicates that child nodes can now be added to it. */ - public void jjtOpen(); - - /** This method is called after all the child nodes have been - added. */ - public void jjtClose(); - - /** This pair of methods are used to inform the node of its - parent. */ - public void jjtSetParent(Node n); - public Node jjtGetParent(); - - /** This method tells the node to add its argument to the node's - list of children. */ - public void jjtAddChild(Node n, int i); - - /** This method returns a child node. The children are numbered - from zero, left to right. */ - public Node jjtGetChild(int i); - - /** Return the number of children the node has. */ - public int jjtGetNumChildren(); - - public int getId(); -} -/* JavaCC - OriginalChecksum=b35e9d784b187d71d84b7438426a3c21 (do not edit this line) */ diff --git a/LARAC/src/org/dojo/jsl/parser/ast/ParseException.java b/LARAC/src/org/dojo/jsl/parser/ast/ParseException.java deleted file mode 100644 index 719cd5bfe..000000000 --- a/LARAC/src/org/dojo/jsl/parser/ast/ParseException.java +++ /dev/null @@ -1,213 +0,0 @@ -/* Generated By:JavaCC: Do not edit this line. ParseException.java Version 5.0 */ -/* JavaCCOptions:KEEP_LINE_COL=null */ -package org.dojo.jsl.parser.ast; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; -import java.util.function.Function; - -import tdrc.utils.StringUtils; - -/** - * This exception is thrown when parse errors are encountered. You can explicitly create objects of this exception type - * by calling the method generateParseException in the generated parser. - * - * You can modify this class to customize your error reporting mechanisms so long as you retain the public fields. - */ -@SuppressWarnings("all") -public class ParseException extends Exception { - - /** - * The version identifier for this Serializable class. Increment only if the serialized form of the class - * changes. - */ - private static final long serialVersionUID = 1L; - - /** - * This constructor is used by the method "generateParseException" in the generated parser. Calling this constructor - * generates a new object of this type with the fields "currentToken", "expectedTokenSequences", and "tokenImage" - * set. - */ - public ParseException(Token currentTokenVal, int[][] expectedTokenSequencesVal, String[] tokenImageVal) { - super(initialise(currentTokenVal, expectedTokenSequencesVal, tokenImageVal)); - currentToken = currentTokenVal; - expectedTokenSequences = expectedTokenSequencesVal; - tokenImage = tokenImageVal; - nextToken = currentTokenVal.next; - errorMessage = getMessage().substring(getMessage().indexOf(":") + 1); - expectedTokenSet = buildSequenceList(expectedTokenSequences, tokenImage); - } - - private static List buildSequenceList(int[][] expectedTokenSequences, String[] tokenImage) { - // this.expectedTokenSet = new HashSet<>(); - List tokens = new ArrayList<>(); - for (int i = 0; i < expectedTokenSequences.length; i++) { - for (int j = 0; j < expectedTokenSequences[i].length; j++) { - String token = (tokenImage[expectedTokenSequences[i][j]]); - if (!tokens.contains(token)) { - tokens.add(token); - } - } - } - String semiColon = tokenImage[LARAEcmaScriptConstants.SEMICOLON]; - if (tokens.contains(semiColon)) { - Collections.rotate(tokens.subList(0, tokens.indexOf(semiColon) + 1), 1); - } - return tokens; - } - - /** - * The following constructors are for use by you for whatever purpose you can think of. Constructing the exception - * in this manner makes the exception behave in the normal way - i.e., as documented in the class "Throwable". The - * fields "errorToken", "expectedTokenSequences", and "tokenImage" do not contain relevant information. The JavaCC - * generated code does not use these constructors. - */ - - public ParseException() { - super(); - } - - /** Constructor with message. */ - public ParseException(String message) { - super(message); - } - - /** - * This is the last token that has been consumed successfully. If this object has been created due to a parse error, - * the token followng this token will (therefore) be the first error token. - */ - public Token currentToken; - private Token nextToken; - private String errorMessage; - - /** - * Each entry in this array is an array of integers. Each array of integers represents a sequence of tokens (by - * their ordinal values) that is expected at this point of the parse. - */ - public int[][] expectedTokenSequences; - public List expectedTokenSet; - - /** - * This is a reference to the "tokenImage" array of the generated parser within which the parse error occurred. This - * array is defined in the generated ...Constants interface. - */ - public String[] tokenImage; - - /** - * It uses "currentToken" and "expectedTokenSequences" to generate a parse error message and returns it. If this - * object has been created due to a parse error, and you do not catch it (it gets thrown from the parser) the - * correct error message gets displayed. - */ - private static String initialise(Token currentToken, int[][] expectedTokenSequences, String[] tokenImage) { - String eol = System.getProperty("line.separator", "\n"); - StringBuffer expected = new StringBuffer(); - int maxSize = 0; - List expectedList = buildSequenceList(expectedTokenSequences, tokenImage); - for (int i = 0; i < expectedTokenSequences.length; i++) { - if (maxSize < expectedTokenSequences[i].length) { - maxSize = expectedTokenSequences[i].length; - } - } - // String semiColon = tokenImage[LARAEcmaScriptConstants.SEMICOLON]; - // if (expectedList.contains(semiColon)) { - // Collections.rotate(expectedList.subList(0, expectedList.indexOf(semiColon) + 1), 1); - // } - - Function quote2tick = s -> s.replace("\"", "'"); - String expectedListStr = "\n\t" + StringUtils.join(expectedList, quote2tick, "\n\t"); - expected.append(expectedListStr); - // String retval = "Parse Exception: encountered ";// token "; - Token nextToken = currentToken.next; - String retval = "at line " + nextToken.beginLine + ", column " + nextToken.beginColumn + ":"; - String errorMessage = "encountered "; - Token tok = nextToken; - for (int i = 0; i < maxSize; i++) { - - if (tok.kind == 0) { - errorMessage += tokenImage[0]; - break; - } - errorMessage += " \""; - errorMessage += add_escapes(tok.image); - errorMessage += "\""; - tok = tok.next; - } - - errorMessage += ", "; - if (expectedTokenSequences.length == 1) { - errorMessage += "was expecting: "; // + eol + " "; - } else { - errorMessage += "was expecting: "; // + eol + " "; - } - errorMessage += expected.toString(); - - return retval + errorMessage; - } - - /** - * The end of line string for this machine. - */ - protected String eol = System.getProperty("line.separator", "\n"); - - /** - * Used to convert raw characters to their escaped version when these raw version cannot be used as part of an ASCII - * string literal. - */ - static String add_escapes(String str) { - StringBuffer retval = new StringBuffer(); - char ch; - for (int i = 0; i < str.length(); i++) { - switch (str.charAt(i)) { - case 0: - continue; - case '\b': - retval.append("\\b"); - continue; - case '\t': - retval.append("\\t"); - continue; - case '\n': - retval.append("\\n"); - continue; - case '\f': - retval.append("\\f"); - continue; - case '\r': - retval.append("\\r"); - continue; - case '\"': - retval.append("\\\""); - continue; - case '\'': - retval.append("\\\'"); - continue; - case '\\': - retval.append("\\\\"); - continue; - default: - if ((ch = str.charAt(i)) < 0x20 || ch > 0x7e) { - String s = "0000" + Integer.toString(ch, 16); - retval.append("\\u" + s.substring(s.length() - 4, s.length())); - } else { - retval.append(ch); - } - continue; - } - } - return retval.toString(); - } - - public String getErrorMessage() { - return errorMessage; - } - - public Token getNextToken() { - return nextToken; - } - -} -/* - * JavaCC - OriginalChecksum=aa856bee2d7bc1f2756879db49b0ff38 (do not edit this - * line) - */ \ No newline at end of file diff --git a/LARAC/src/org/dojo/jsl/parser/ast/SimpleNode.java b/LARAC/src/org/dojo/jsl/parser/ast/SimpleNode.java deleted file mode 100644 index 6bb0a8098..000000000 --- a/LARAC/src/org/dojo/jsl/parser/ast/SimpleNode.java +++ /dev/null @@ -1,726 +0,0 @@ -/* Generated By:JJTree: Do not edit this line. SimpleNode.java Version 4.3 */ -/* - * JavaCCOptions:MULTI=true,NODE_USES_PARSER=false,VISITOR=false,TRACK_TOKENS=false,NODE_PREFIX=AST,NODE_EXTENDS=, - * NODE_FACTORY=,SUPPORT_CLASS_VISIBILITY_PUBLIC=true - */ -/* - * Copyright 2013 SPeCS. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. under the License. - */ -package org.dojo.jsl.parser.ast; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; -import java.util.Optional; -import java.util.stream.Collectors; - -import org.apache.commons.lang3.StringEscapeUtils; -import org.lara.language.specification.dsl.LanguageSpecificationV2; -import org.w3c.dom.Document; -import org.w3c.dom.Element; - -import larac.LaraC; -import larac.exceptions.LARACompilerException; -import larac.exceptions.ParseExceptionData; -import larac.objects.Enums; -import larac.objects.Enums.Types; -import larac.objects.Variable; -import larac.utils.OrganizeUtils; -import pt.up.fe.specs.util.Preconditions; -import pt.up.fe.specs.util.exceptions.NotImplementedException; -import tdrc.utils.StringUtils; - -public class SimpleNode implements Node { - // protected int beginLine = -1; - // protected int endLine = -1; - // protected int beginColumn = -1; - // protected int endColumn = -1; - // public int lineNumber = 0; - protected Node parent; - protected Node[] children; - protected int id; - protected Object value; - protected String label = ""; - protected LARAEcmaScript parser; - protected boolean insertTag = true; - // private boolean coords = false; - protected boolean isTemplate = false; - protected ParseExceptionData exceptionData; - protected Token firstToken; - protected Token lastToken; - - public SimpleNode(int i) { - this(null, i); - } - - public SimpleNode(LARAEcmaScript p, int i) { - id = i; - parser = p; - } - - /////////////////////////////////////////////////////// - ////////////// Node Related Methods /////////////////// - /////////////////////////////////////////////////////// - - @Override - public void jjtOpen() { - // System.out.println("OPENING a " + LARAEcmaScriptTreeConstants.jjtNodeName[id]); - } - - @Override - public void jjtClose() { - } - - @Override - public void jjtSetParent(Node n) { - parent = n; - } - - @Override - public Node jjtGetParent() { - return parent; - } - - @Override - public void jjtAddChild(Node n, int i) { - if (getChildren() == null) { - setChildren(new Node[i + 1]); - } else if (i >= getChildren().length) { - final Node c[] = new Node[i + 1]; - System.arraycopy(getChildren(), 0, c, 0, getChildren().length); - setChildren(c); - } - getChildren()[i] = n; - } - - public void appendChildAsFirst(Node n) { - if (getChildren() == null) { - setChildren(new Node[1]); - } else { - final Node c[] = new Node[children.length + 1]; - System.arraycopy(getChildren(), 0, c, 1, getChildren().length); - setChildren(c); - } - getChildren()[0] = n; - } - - /** - * Returns a child as a {@link Node} - */ - @Override - public Node jjtGetChild(int i) { - return getChildren()[i]; - } - - /** - * Returns a child casted as {@link SimpleNode} - * - * @param i - * @return - */ - public SimpleNode getChild(int i) { - return (SimpleNode) getChildren()[i]; - } - - public T getChildAs(int i, Class cast) { - Node childI = children[i]; - Preconditions.checkArgument(cast.isInstance(childI), - "Cannot cast node of type " + LARAEcmaScriptTreeConstants.jjtNodeName[this.id] + " to " - + cast.getName()); - return cast.cast(childI); - } - - @Override - public int jjtGetNumChildren() { - return (getChildren() == null) ? 0 : getChildren().length; - } - - /** - * @param children - * the children to set - */ - public void setChildren(Node[] children) { - this.children = children; - } - - /** - * @return the children - */ - public Node[] getChildren() { - return children; - } - - /** - * @return the children - */ - public List getSimpleNodeChildren() { - return Arrays.asList(children).stream().map(n -> (SimpleNode) n).collect(Collectors.toList()); - } - - public void jjtSetValue(Object value) { - this.value = value; - } - - public Object jjtGetValue() { - return value; - } - - /* - * You can override these two methods in subclasses of SimpleNode to - * customize the way the node appears when the tree is dumped. If your - * output uses more than one line you should override toString(String), - * otherwise overriding toString() is probably all you need to do. - */ - - @Override - public String toString() { - return LARAEcmaScriptTreeConstants.jjtNodeName[id] + (value != null ? " [" + value + "]" : ""); - } - - public String toString(String prefix) { - return prefix + toString(); - } - - /* - * Override this method if you want to customize how the node dumps out its - * children. - */ - - public void dump(String prefix) { - LaraC lara = getLara(); - String string = toString(prefix); - // Token specialToken = jjtGetFirstToken().specialToken; - // if (specialToken != null) { - // string += " special: " + specialToken.image; - // } - if (lara == null) { - System.out.println(string); - } else { - lara.println(string); - } - if (getChildren() != null) { - for (int i = 0; i < getChildren().length; ++i) { - final SimpleNode n = (SimpleNode) getChildren()[i]; - if (n != null) { - n.dump(prefix + " "); - } - } - } - } - - public String dumpToString(String prefix) { - String out = toString(prefix) + "\n"; - if (getChildren() != null) { - for (int i = 0; i < getChildren().length; ++i) { - final SimpleNode n = (SimpleNode) getChildren()[i]; - if (n != null) { - out += n.dumpToString(prefix + "\t"); - } - } - } - return out; - } - - public void associateChild(SimpleNode child, int i) { - jjtAddChild(child, i); - child.parent = this; - } - - public LaraC getLara() { - if (parent == null) { - return null; - } - return ((SimpleNode) parent).getLara(); - } - - protected SimpleNode getParentById(int id) { - if (this.id == id) { - return this; - } - if (parent != null) { - return ((SimpleNode) parent).getParentById(id); - } - return null; - } - - public RuntimeException newException(String error) { - // if (beginColumn != -1) { - // String message = "in line " + beginLine + ", column " + beginColumn + ": " + error; - // return new LARACompilerException(message); - // } - String message = "in line " + jjtGetFirstToken().beginLine + ", column " + jjtGetFirstToken().beginColumn + ": " - + error; - return new LARACompilerException(message); - - // if (parent != null) { - // return ((SimpleNode) parent).newException(error); - // } - // - // return new LARACompilerException(error); - // throw new LaraException(error); - } - - public ParseExceptionData getExceptionData() { - return exceptionData; - } - - public void setExceptionData(ParseExceptionData exceptionData) { - this.exceptionData = exceptionData; - } - - public Token jjtGetFirstToken() { - return firstToken; - } - - public void jjtSetFirstToken(Token token) { - firstToken = token; - } - - public Token jjtGetLastToken() { - return lastToken; - } - - public void jjtSetLastToken(Token token) { - lastToken = token; - } - - protected ASTAspectDef getAspectDefForDeclStmt(String typeOfStatement) { - return getAncestorOfType(ASTAspectDef.class) - .orElseThrow( - () -> new LARACompilerException( - typeOfStatement + " statement can only be used inside an aspectdef")); - } - - public Optional getAncestorOfType(Class type) { - if (parent == null) { - return Optional.empty(); - } - - if (type.isInstance(parent)) { - return Optional.of(type.cast(parent)); - } - return ((SimpleNode) parent).getAncestorOfType(type); - } - - public List getDescendantsOfType(Class type) { - - if (children == null || children.length == 0) { - return Collections.emptyList(); - } - List descendants = new ArrayList<>(); - for (Node node : children) { - SimpleNode simpleNode = (SimpleNode) node; - if (type.isInstance(node)) { - descendants.add(type.cast(simpleNode)); - } - descendants.addAll(simpleNode.getDescendantsOfType(type)); - - } - - return descendants; - } - - /** - * Verifies if a node is equal or descendant of this node - * - * @param descendant - * @return - */ - public boolean isDescendant(Node descendant) { - if (equals(descendant)) { - return true; - } - if (children == null || children.length == 0) { - return false; - } - - for (Node node : children) { - SimpleNode simpleNode = (SimpleNode) node; - boolean childDescendant = simpleNode.isDescendant(descendant); - if (childDescendant) { - return true; - } - } - return false; - } - - /////////////////////////////////////////////////////// - //////////// Organize Related Methods ///////////////// - /////////////////////////////////////////////////////// - public Object organizeFirst(Object obj, int i) { - getLara().warnln( - "Organize(Object,int): Node \"" + LARAEcmaScriptTreeConstants.jjtNodeName[id] - + "\" not supported"); - return null; - } - - public Object organize(Object obj) { - getLara().warnln("Organize(Object,ASTSelect): Node \"" + LARAEcmaScriptTreeConstants.jjtNodeName[id] - + "\" not supported"); - return null; - } - - public void declareGlobal(LaraC lara) { - throw new RuntimeException("Global declaration is not supported for node type '" - + LARAEcmaScriptTreeConstants.jjtNodeName[id] + "'"); - } - - public boolean hasFilter() { - return false; - } - - public String organize(String type, LanguageSpecificationV2 langSpec) { - // getLara().warnln("Organize: Node \"" + LARAEcmaScriptTreeConstants.jjtNodeName[id] + "\" not supported"); - // return null; - throw new RuntimeException( - "Organize: Node \"" + LARAEcmaScriptTreeConstants.jjtNodeName[id] + "\" not supported"); - } - - public Types getExpressionType() { - // getLara().warnln("ExpressionType: Node - // \""+LARAEcmaScriptTreeConstants.jjtNodeName[id]+ - // "\" not supported\n"); - return Types.getDefault(); - } - - public Object organize(Object obj, Object obj2) { - getLara() - .warnln("Organize(2): Node \"" + LARAEcmaScriptTreeConstants.jjtNodeName[id] + "\" not supported"); - return null; - } - - public void secondOrganize(ASTSelect sel) { - if (children != null) { - for (final Node n : children) { - ((SimpleNode) n).secondOrganize(sel); - } - } - } - - public Variable lookup(String var) { - if (parent == null) { - getLara().warnln("Variable was not found: " + var); - return null; - } - return ((SimpleNode) parent).lookup(var); - } - - public Variable lookupNoError(String var) { - if (parent == null) { - return null; - } - return ((SimpleNode) parent).lookupNoError(var); - } - - public HashMap getHMVars() { - if (parent == null) { - throw newException("Could not found any SymbolTable for variables. Last node was: " + toString()); - } - - return ((SimpleNode) parent).getHMVars(); - } - - public Variable lookupLastJPVariable() { - getLara().warnln( - "lookupLastJPVariable: Node \"" + LARAEcmaScriptTreeConstants.jjtNodeName[id] - + "\" not supported"); - return null; - } - - protected SimpleNode lookupLabel(String label) { - if (this.label.equals(label)) { - return this; - } - if (parent != null) { - return ((SimpleNode) parent).lookupLabel(label); - } - return null; - } - - public void organizeLHS(Types type) { - getLara().warnln( - "organizeLHS(1): Node \"" + LARAEcmaScriptTreeConstants.jjtNodeName[id] + "\" not supported"); - } - - public void organizePointcutReference(ASTPointcut pc) { - } - - public void organizeActionReference(ASTPointcut pc) { - } - - public String getMethodId() { - return null; - } - - public String getVarName() { - throw newException( - "getVarName(0): Node \"" + LARAEcmaScriptTreeConstants.jjtNodeName[id] + "\" not supported"); - // return null; - } - - public void setIdVar(Variable var) { - } - - public List getCodeArguments(String code) { - final List codeParams = new ArrayList<>(OrganizeUtils.getTagValues(code)); - return codeParams; - } - - protected void verifyCodeArguments(List codeParams) { - for (final String param : codeParams) { - - // Change this to accept a[0], a[0][0][0], a(), a(0,1)... - // - // if (param.contains("[") || param.contains("(")) { - // throw newException("Complex reference using \"[ ]\" and/or \"( )\" : " + param - // + ". Only simple reference can be defined here."); - // } - if (param.startsWith("$")) { - continue; - } - if (param.contains(".")) { - if (lookup(param.substring(0, param.indexOf("."))) == null) { - throw newException("Variable '" + param.substring(0, param.indexOf(".")) + "' is undefined"); - } - - } else if (lookup(param) == null) { - throw newException("Variable '" + param + "' is undefined"); - } - } - } - - public String nodeCoords() { - final LaraC lara = getLara(); - String path = ""; - if (lara != null) { - path = lara.getLaraPath(); - } - return path + ":" + firstToken.beginLine + ":" + firstToken.beginColumn + ":" + lastToken.endLine - + ":" - + lastToken.endColumn; - } - - public String getCoords() { - return nodeCoords(); - } - - /////////////////////////////////////////////////////// - //////////// TO REMOVE //////////////// - /////////////////////////////////////////////////////// - - // public String getCoords() { - // String coords = lookDownCoords(); - // if (coords != null) { - // return coords; - // } - // coords = lookupCoords(); - // if (coords != null) { - // return coords; - // } - // final LaraC lara = getLara(); - // return lara.getLaraPath() + ":0:0:0:0"; - // } - // /** - // * Should be replace with this.firstToken and lastToken - // * - // * @param begin - // * @param end - // */ - // @Deprecated - // public void setCoord(Token begin, Token end) { - // beginLine = begin.beginLine; - // endLine = end.endLine; - // beginColumn = begin.beginColumn; - // endColumn = end.endColumn; - // setCoords(true); - // } - // /** - // * @param coords - // * the coords to set - // */ - // public void setCoords(boolean coords) { - // this.coords = coords; - // } - // - // /** - // * @return the coords - // */ - // public boolean hasCoords() { - // return coords; - // } - - // public String lookDownCoords() { - // if (hasCoords()) { - // return nodeCoords(); - // } - // if (children != null) { - // for (final Node child : children) { - // final String coords = ((SimpleNode) child).lookDownCoords(); - // if (coords != null) { - // return coords; - // } - // } - // } - // return null; - // } - // - // public String lookupCoords() { - // if (hasCoords()) { - // return nodeCoords(); - // } - // if (parent != null) { - // return ((SimpleNode) parent).lookupCoords(); - // } - // return null; - // } - - /////////////////////////////////////////////////////// - //////////// Aspect-IR Related Methods //////////////// - /////////////////////////////////////////////////////// - - /////////////////////////////////////////////////////// - //////////// XML Related Methods ////////////////////// - /////////////////////////////////////////////////////// - - public void toXML(Document doc, Element parent) { - getLara().warnln( - "toXML(Document,Element): Node \"" + LARAEcmaScriptTreeConstants.jjtNodeName[id] - + "\" not supported"); - final Element el = doc.createElement(LARAEcmaScriptTreeConstants.jjtNodeName[id]); - if (value != null) { - el.setAttribute("value", value.toString()); - } - el.setAttribute("isSupported", "false"); - parent.appendChild(el); - } - - public void globalToXML(Document doc, Element parent) { - throw new RuntimeException("Global declaration to XML is not supported for node type '" - + LARAEcmaScriptTreeConstants.jjtNodeName[id] + "'"); - - } - - public Element getFilterElement(Document doc) { - // getLara().warnln("Get Filter Element: Node \""+LARAEcmaScriptTreeConstants.jjtNodeName[id]+"\" not - // supported"); - return null; - } - - public Element getXML(Document doc) { - return doc.createElement("getXML:NOT_DONE"); - } - - public void toXMLTemplate(Document doc, Element callEl) { - throw newException( - "When using actions, parameters of type 'template' can only be of type: \n\t-> literal string\n\t-> literal code\n\t-> codedef"); - } - - public void codeTemplateArgumentsToXML(Document doc, Element parent, List codeParams) { - for (final String param : codeParams) { - - final Element propertyKeyEl = doc.createElement("key"); - parent.appendChild(propertyKeyEl); - propertyKeyEl.setAttribute("name", Enums.SYMBOL_BEGIN + param + Enums.SYMBOL_END); - SimpleNode expression = OrganizeUtils.parseExpression(param.trim()); - expression.toXML(doc, propertyKeyEl); - } - } - - /** - * Return the LARA source code of the AST
- * This code is not equal to the input as it is automatically generated - * - * @return - */ - public final String toSource() { - return toSource(0); - } - - /** - * Return the LARA source code of the AST - * - * @see SimpleNode#toSource() - * @param indentation - * @return - */ - public String toSource(int indentation) { - throw new NotImplementedException( - "To source method not supported for AST node type " + LARAEcmaScriptTreeConstants.jjtNodeName[id]); - } - - protected static String indent(int indentation) { - return StringUtils.repeat("\t", indentation); - } - - public void addXMLComent(Element el) { - - List comments = new ArrayList(); - Token special = jjtGetFirstToken().specialToken; - while (special != null) { - comments.add(special.image); - special = special.specialToken; - } - if (!comments.isEmpty()) { - Collections.reverse(comments); - escapeHTML(el, StringUtils.join(comments, "\n")); - // base64(el, comment); - } - } - - /** - * @param el - * @param comment - */ - // private void base64(Element el, String comment) { - // try { - // String content = DatatypeConverter.printBase64Binary(comment.getBytes("UTF-8")); - // el.setAttribute("comment", content); - // } catch (UnsupportedEncodingException e) { - // getLara().warnln( - // "Could not add the following comment(s) to aspect-ir: " + comment.toString() + ". Reason: " - // + e.getMessage()); - // } - // } - - /** - * @param el - * @param string - */ - private static void escapeHTML(Element el, String string) { - String content; - content = StringEscapeUtils.escapeHtml4(string); - el.setAttribute("comment", content); - } - - protected void addCoords(Element el) { - final LaraC lara = getLara(); - String path = ""; - if (lara != null) { - path = lara.getLaraPath(); - } - String coordStr = path + ":" + jjtGetFirstToken().beginLine + ":" + jjtGetFirstToken().beginColumn + ":" - + jjtGetLastToken().endLine - + ":" + jjtGetLastToken().endColumn; - el.setAttribute("coord", coordStr); - } - - public int getId() { - return id; - } -} - -/* - * JavaCC - OriginalChecksum=d27917bd78bc237db3717563f5dd3d25 (do not edit this - * line) - */ diff --git a/LARAC/src/org/dojo/jsl/parser/ast/Token.java b/LARAC/src/org/dojo/jsl/parser/ast/Token.java deleted file mode 100644 index bf1a3299e..000000000 --- a/LARAC/src/org/dojo/jsl/parser/ast/Token.java +++ /dev/null @@ -1,132 +0,0 @@ -/* Generated By:JavaCC: Do not edit this line. Token.java Version 7.0 */ -/* JavaCCOptions:TOKEN_EXTENDS=,KEEP_LINE_COLUMN=true,SUPPORT_CLASS_VISIBILITY_PUBLIC=true */ -package org.dojo.jsl.parser.ast; - -/** - * Describes the input token stream. - */ - -public class Token implements java.io.Serializable { - - /** - * The version identifier for this Serializable class. - * Increment only if the serialized form of the - * class changes. - */ - private static final long serialVersionUID = 1L; - - /** - * An integer that describes the kind of this token. This numbering - * system is determined by JavaCCParser, and a table of these numbers is - * stored in the file ...Constants.java. - */ - public int kind; - - /** The line number of the first character of this Token. */ - public int beginLine; - /** The column number of the first character of this Token. */ - public int beginColumn; - /** The line number of the last character of this Token. */ - public int endLine; - /** The column number of the last character of this Token. */ - public int endColumn; - - /** - * The string image of the token. - */ - public String image; - - /** - * A reference to the next regular (non-special) token from the input - * stream. If this is the last token from the input stream, or if the - * token manager has not read tokens beyond this one, this field is - * set to null. This is true only if this token is also a regular - * token. Otherwise, see below for a description of the contents of - * this field. - */ - public Token next; - - /** - * This field is used to access special tokens that occur prior to this - * token, but after the immediately preceding regular (non-special) token. - * If there are no such special tokens, this field is set to null. - * When there are more than one such special token, this field refers - * to the last of these special tokens, which in turn refers to the next - * previous special token through its specialToken field, and so on - * until the first special token (whose specialToken field is null). - * The next fields of special tokens refer to other special tokens that - * immediately follow it (without an intervening regular token). If there - * is no such token, this field is null. - */ - public Token specialToken; - - /** - * An optional attribute value of the Token. - * Tokens which are not used as syntactic sugar will often contain - * meaningful values that will be used later on by the compiler or - * interpreter. This attribute value is often different from the image. - * Any subclass of Token that actually wants to return a non-null value can - * override this method as appropriate. - */ - public Object getValue() { - return null; - } - - /** - * No-argument constructor - */ - public Token() {} - - /** - * Constructs a new token for the specified Image. - */ - public Token(int kind) - { - this(kind, null); - } - - /** - * Constructs a new token for the specified Image and Kind. - */ - public Token(int kind, String image) - { - this.kind = kind; - this.image = image; - } - - /** - * Returns the image. - */ - @Override - public String toString() - { - return image; - } - - /** - * Returns a new Token object, by default. However, if you want, you - * can create and return subclass objects based on the value of ofKind. - * Simply add the cases to the switch for all those special cases. - * For example, if you have a subclass of Token called IDToken that - * you want to create if ofKind is ID, simply add something like : - * - * case MyParserConstants.ID : return new IDToken(ofKind, image); - * - * to the following switch statement. Then you can cast matchedToken - * variable to the appropriate type and use sit in your lexical actions. - */ - public static Token newToken(int ofKind, String image) - { - switch(ofKind) - { - default : return new Token(ofKind, image); - } - } - - public static Token newToken(int ofKind) - { - return newToken(ofKind, null); - } - -} -/* JavaCC - OriginalChecksum=a5eed70842fec789f0bf58b1376f5659 (do not edit this line) */ diff --git a/LARAC/src/org/dojo/jsl/parser/ast/TokenMgrError.java b/LARAC/src/org/dojo/jsl/parser/ast/TokenMgrError.java deleted file mode 100644 index 68eaac5cd..000000000 --- a/LARAC/src/org/dojo/jsl/parser/ast/TokenMgrError.java +++ /dev/null @@ -1,174 +0,0 @@ -/* Generated By:JavaCC: Do not edit this line. TokenMgrError.java Version 5.0 */ -/* JavaCCOptions: */ -package org.dojo.jsl.parser.ast; - -/** Token Manager Error. */ -@SuppressWarnings("all") -public class TokenMgrError extends Error { - - /** - * The version identifier for this Serializable class. Increment only if the serialized form of the class - * changes. - */ - private static final long serialVersionUID = 1L; - - /* - * Ordinals for various reasons why an Error of this type can be thrown. - */ - - /** - * Lexical error occurred. - */ - static final int LEXICAL_ERROR = 0; - - /** - * An attempt was made to create a second instance of a static token manager. - */ - static final int STATIC_LEXER_ERROR = 1; - - /** - * Tried to change to an invalid lexical state. - */ - static final int INVALID_LEXICAL_STATE = 2; - - /** - * Detected (and bailed out of) an infinite loop in the token manager. - */ - static final int LOOP_DETECTED = 3; - - /** - * Indicates the reason why the exception is thrown. It will have one of the above 4 values. - */ - int errorCode; - - private int errorLine; - - private int errorColumn; - - private String lexicalError; - - /** - * Replaces unprintable characters by their escaped (or unicode escaped) equivalents in the given string - */ - protected static final String addEscapes(String str) { - StringBuffer retval = new StringBuffer(); - char ch; - for (int i = 0; i < str.length(); i++) { - switch (str.charAt(i)) { - case 0: - continue; - case '\b': - retval.append("\\b"); - continue; - case '\t': - retval.append("\\t"); - continue; - case '\n': - retval.append("\\n"); - continue; - case '\f': - retval.append("\\f"); - continue; - case '\r': - retval.append("\\r"); - continue; - case '\"': - retval.append("\\\""); - continue; - case '\'': - retval.append("\\\'"); - continue; - case '\\': - retval.append("\\\\"); - continue; - default: - if ((ch = str.charAt(i)) < 0x20 || ch > 0x7e) { - String s = "0000" + Integer.toString(ch, 16); - retval.append("\\u" + s.substring(s.length() - 4, s.length())); - } else { - retval.append(ch); - } - continue; - } - } - return retval.toString(); - } - - /** - * Returns a detailed message for the Error when it is thrown by the token manager to indicate a lexical error. - * Parameters : EOFSeen : indicates if EOF caused the lexical error curLexState : lexical state in which this error - * occurred errorLine : line number when the error occurred errorColumn : column number when the error occurred - * errorAfter : prefix that was seen before this error occurred curchar : the offending character Note: You can - * customize the lexical error message by modifying this method. - */ - protected static String LexicalError(boolean EOFSeen, int lexState, int errorLine, int errorColumn, - String errorAfter, char curChar) { - String lexicalError = generateLexicalError(EOFSeen, errorAfter, curChar); - return ("at line " + errorLine + ", column " + errorColumn + ". " + lexicalError); - } - - private static String generateLexicalError(boolean EOFSeen, String errorAfter, char curChar) { - String string = "Lexical error: encountered " - + (EOFSeen ? " " - : ("\"" + addEscapes(String.valueOf(curChar)) + "\"") + " (" + (int) curChar + "), ") - + "after : \"" + addEscapes(errorAfter) + "\""; - return string; - } - - /** - * You can also modify the body of this method to customize your error messages. For example, cases like - * LOOP_DETECTED and INVALID_LEXICAL_STATE are not of end-users concern, so you can return something like : - * - * "Internal Error : Please file a bug report .... " - * - * from this method for such cases in the release version of your parser. - */ - @Override - public String getMessage() { - return super.getMessage(); - } - - /* - * Constructors of various flavors follow. - */ - - /** No arg constructor. */ - public TokenMgrError() { - } - - /** Constructor with message and reason. */ - public TokenMgrError(String message, int reason) { - super(message); - errorCode = reason; - } - - /** Full Constructor. */ - public TokenMgrError(boolean EOFSeen, int lexState, int errorLine, int errorColumn, String errorAfter, int curChar, - int reason) { - this(LexicalError(EOFSeen, lexState, errorLine, errorColumn, errorAfter, (char) curChar), reason); - this.errorLine = errorLine; - this.errorColumn = errorColumn; - lexicalError = generateLexicalError(EOFSeen, errorAfter, (char) curChar); - - } - - public int getErrorCode() { - return errorCode; - } - - public int getErrorLine() { - return errorLine; - } - - public int getErrorColumn() { - return errorColumn; - } - - public String getLexicalError() { - return lexicalError; - } -} -/* - * JavaCC - OriginalChecksum=fd878cd9d356d43d5dde3f58d32a5265 (do not edit this - * line) - */ diff --git a/LARAC/src/org/dojo/jsl/parser/ast/utils/ASTJSImport.java b/LARAC/src/org/dojo/jsl/parser/ast/utils/ASTJSImport.java deleted file mode 100644 index 23321a098..000000000 --- a/LARAC/src/org/dojo/jsl/parser/ast/utils/ASTJSImport.java +++ /dev/null @@ -1,92 +0,0 @@ -/** - * Copyright 2021 SPeCS. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. under the License. - */ - -package org.dojo.jsl.parser.ast.utils; - -import java.util.List; -import java.util.stream.Collectors; - -import org.dojo.jsl.parser.ast.SimpleNode; -import org.w3c.dom.Document; -import org.w3c.dom.Element; -import org.w3c.dom.Node; - -import pt.up.fe.specs.util.SpecsCheck; - -public class ASTJSImport extends SimpleNode { - - private static final String NODE_NAME = "JSImport"; - - private final List qualifiedImport; - - public ASTJSImport(List qualifiedImport) { - super(-1); - - this.qualifiedImport = qualifiedImport; - } - - @Override - public Object organize(Object obj) { - // Do nothing - return null; - } - - @Override - public void globalToXML(Document doc, Element parent) { - SpecsCheck.checkArgument(parent.getNodeName().equals("aspects"), - () -> "Expected node to be 'aspects', is '" + parent.getNodeName() + "'"); - - // HACK: To avoid regeneration the Java classes from XML, using attributes Statement already has - final Element statementDeclEl = doc.createElement("declaration"); - statementDeclEl.setAttribute("name", NODE_NAME); - // statementDeclEl.setAttribute("coord", path); - statementDeclEl.setAttribute("desc", qualifiedImport.stream().collect(Collectors.joining("/", "", ".js"))); - - // parent.appendChild(statementDeclEl); - - // Get first node that is not a JSImport, or null if there are no nodes or only has imports - var insertPoint = getInsertPoint(parent); - parent.insertBefore(statementDeclEl, insertPoint); - - toXML(doc, statementDeclEl); - } - - private Node getInsertPoint(Element parent) { - var nodeList = parent.getChildNodes(); - - for (int i = 0; i < nodeList.getLength(); i++) { - var item = nodeList.item(i); - - // If JSImport, skip - if (item.getNodeName().equals("declaration") && - NODE_NAME.equals(item.getAttributes().getNamedItem("name").getNodeValue())) { - continue; - } - - // Found item - return item; - } - - return null; - } - - @Override - public void toXML(Document doc, Element parent) { - // Do nothing - } - - @Override - public String toString() { - return "JSScript (" + qualifiedImport + ")"; - } -} diff --git a/LARAC/src/org/dojo/jsl/parser/ast/utils/ASTLaraImport.java b/LARAC/src/org/dojo/jsl/parser/ast/utils/ASTLaraImport.java deleted file mode 100644 index 2faa0d880..000000000 --- a/LARAC/src/org/dojo/jsl/parser/ast/utils/ASTLaraImport.java +++ /dev/null @@ -1,90 +0,0 @@ -/** - * Copyright 2021 SPeCS. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. under the License. - */ - -package org.dojo.jsl.parser.ast.utils; - -import java.util.List; -import java.util.stream.Collectors; - -import org.dojo.jsl.parser.ast.SimpleNode; -import org.w3c.dom.Document; -import org.w3c.dom.Element; -import org.w3c.dom.Node; - -import pt.up.fe.specs.util.SpecsCheck; - -public class ASTLaraImport extends SimpleNode { - - private static final String NODE_NAME = "LaraImport"; - - private final List qualifiedImport; - - public ASTLaraImport(List qualifiedImport) { - super(-1); - - this.qualifiedImport = qualifiedImport; - } - - @Override - public Object organize(Object obj) { - // Do nothing - return null; - } - - @Override - public void globalToXML(Document doc, Element parent) { - SpecsCheck.checkArgument(parent.getNodeName().equals("aspects"), - () -> "Expected node to be 'aspects', is '" + parent.getNodeName() + "'"); - - // HACK: To avoid regeneration the Java classes from XML, using attributes Statement already has - final Element statementDeclEl = doc.createElement("declaration"); - statementDeclEl.setAttribute("name", NODE_NAME); - statementDeclEl.setAttribute("desc", - "laraImport(\'" + qualifiedImport.stream().collect(Collectors.joining(".")) + "\')"); - - // Get first node that is not a LaraImport, or null if there are no nodes or only has imports - var insertPoint = getInsertPoint(parent); - parent.insertBefore(statementDeclEl, insertPoint); - - toXML(doc, statementDeclEl); - } - - private Node getInsertPoint(Element parent) { - var nodeList = parent.getChildNodes(); - - for (int i = 0; i < nodeList.getLength(); i++) { - var item = nodeList.item(i); - - // If LaraImport, skip - if (item.getNodeName().equals("declaration") && - NODE_NAME.equals(item.getAttributes().getNamedItem("name").getNodeValue())) { - continue; - } - - // Found item - return item; - } - - return null; - } - - @Override - public void toXML(Document doc, Element parent) { - // Do nothing - } - - @Override - public String toString() { - return "LaraImport (" + qualifiedImport + ")"; - } -} diff --git a/LARAC/src/org/dojo/jsl/parser/ast/utils/ASTScriptImport.java b/LARAC/src/org/dojo/jsl/parser/ast/utils/ASTScriptImport.java deleted file mode 100644 index 6bbff690c..000000000 --- a/LARAC/src/org/dojo/jsl/parser/ast/utils/ASTScriptImport.java +++ /dev/null @@ -1,93 +0,0 @@ -/** - * Copyright 2021 SPeCS. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. under the License. - */ - -package org.dojo.jsl.parser.ast.utils; - -import java.io.InputStream; - -import org.dojo.jsl.parser.ast.SimpleNode; -import org.w3c.dom.Document; -import org.w3c.dom.Element; - -import larac.LaraC; -import pt.up.fe.specs.util.SpecsCheck; -import pt.up.fe.specs.util.SpecsIo; -import pt.up.fe.specs.util.lazy.Lazy; -import pt.up.fe.specs.util.utilities.Incrementer; - -public class ASTScriptImport extends SimpleNode { - - private static final ThreadLocal CURRENT_INDEX = ThreadLocal.withInitial(() -> new Incrementer()); - - private final String path; - private final Lazy scriptContents; - - public ASTScriptImport(InputStream scriptContents, String path) { - super(-1); - - // To ensure the stream is read only once - this.scriptContents = Lazy.newInstance(() -> SpecsIo.read(scriptContents)); - this.path = path; - } - - public String getScriptContents() { - return scriptContents.get(); - } - - @Override - public Object organize(Object obj) { - // Do nothing - return null; - } - - @Override - public void declareGlobal(LaraC lara) { - lara.aspectIR().addGlobalElement("ScriptImport_" + CURRENT_INDEX.get().getAndIncrement(), this); - } - - @Override - public void globalToXML(Document doc, Element parent) { - SpecsCheck.checkArgument(parent.getNodeName().equals("aspects"), - () -> "Expected node to be 'aspects', is '" + parent.getNodeName() + "'"); - - // HACK: To avoid regeneration the Java classes from XML, using attributes Statement already has - final Element statementDeclEl = doc.createElement("declaration"); - statementDeclEl.setAttribute("name", "ScriptImport"); - statementDeclEl.setAttribute("coord", path); - statementDeclEl.setAttribute("desc", scriptContents.get()); - // statementDeclEl.setAttribute("script", scriptContents.get()); - // final Element statementDeclEl = doc.createElement("scriptImport"); - // statementDeclEl.setNodeValue(scriptContents.get()); - - // System.out.println("PARENT: " + parent.getNodeName()); - // final Element statementDeclEl = doc.createElement("scriptImport"); - // statementDeclEl.setNodeValue(scriptContents.get()); - // statementDeclEl.setAttribute("name", "scriptImport"); - // statementDeclEl.setAttribute("path", path); - // statementDeclEl.setAttribute("script", scriptContents.get()); - // statementDeclEl.setAttribute("coord", getCoords()); - // addXMLComent(statementDeclEl); - parent.appendChild(statementDeclEl); - toXML(doc, statementDeclEl); - } - - @Override - public void toXML(Document doc, Element parent) { - // Do nothing - } - - @Override - public String toString() { - return "ImportedScript (" + path + ")"; - } -} diff --git a/LARAC/src/org/dojo/jsl/parser/ast/utils/LARACConstantPool.java b/LARAC/src/org/dojo/jsl/parser/ast/utils/LARACConstantPool.java deleted file mode 100644 index c2b0f4e4e..000000000 --- a/LARAC/src/org/dojo/jsl/parser/ast/utils/LARACConstantPool.java +++ /dev/null @@ -1,22 +0,0 @@ -/** - * Copyright 2015 SPeCS. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. under the License. - */ - -package org.dojo.jsl.parser.ast.utils; - -public class LARACConstantPool { - - public static final String HIDDEN_TAG = "_hidden_"; - public static final String DISABLED_TAG = "_disabled_"; - public static final String USER_DEFINED = "USER_DEFINED"; - -} diff --git a/LARAC/src/org/dojo/jsl/parser/ast/utils/LaraCNodeFactory.java b/LARAC/src/org/dojo/jsl/parser/ast/utils/LaraCNodeFactory.java deleted file mode 100644 index 4d8ec0ea2..000000000 --- a/LARAC/src/org/dojo/jsl/parser/ast/utils/LaraCNodeFactory.java +++ /dev/null @@ -1,40 +0,0 @@ -/** - * Copyright 2016 SPeCS. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. under the License. - */ - -package org.dojo.jsl.parser.ast.utils; - -import org.dojo.jsl.parser.ast.ASTAllocationExpression; -import org.dojo.jsl.parser.ast.ASTIdentifier; -import org.dojo.jsl.parser.ast.LARAEcmaScriptConstants; -import org.dojo.jsl.parser.ast.LARAEcmaScriptTreeConstants; - -public class LaraCNodeFactory { - - public static ASTIdentifier newIdentifier(String name) { - ASTIdentifier id = new ASTIdentifier(LARAEcmaScriptConstants.IDENTIFIER_NAME); - id.setName(name); - return id; - } - - /** - * - * @param methodID - * @return - */ - public static ASTAllocationExpression newAllocExpr(String methodID) { - final ASTAllocationExpression alloc = new ASTAllocationExpression( - LARAEcmaScriptTreeConstants.JJTALLOCATIONEXPRESSION); - alloc.setMethodID(methodID); - return alloc; - } -} diff --git a/LARAC/test/specs/actionModel.xml b/LARAC/test/specs/actionModel.xml deleted file mode 100644 index 26000a731..000000000 --- a/LARAC/test/specs/actionModel.xml +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/LARAC/test/specs/artifacts.xml b/LARAC/test/specs/artifacts.xml deleted file mode 100644 index dc11b38ea..000000000 --- a/LARAC/test/specs/artifacts.xml +++ /dev/null @@ -1,159 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/LARAC/test/specs/joinPointModel.xml b/LARAC/test/specs/joinPointModel.xml deleted file mode 100644 index 158a6d3a3..000000000 --- a/LARAC/test/specs/joinPointModel.xml +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/LARAI/.classpath b/LARAI/.classpath index ba84200c9..e72216160 100644 --- a/LARAI/.classpath +++ b/LARAI/.classpath @@ -1,16 +1,27 @@ - - - - + - + + - - - + + + + + + + + + + + + + + + + @@ -22,5 +33,5 @@ - + diff --git a/LARAI/.project b/LARAI/.project index 59cb7c4c5..8af53b60a 100644 --- a/LARAI/.project +++ b/LARAI/.project @@ -10,14 +10,20 @@ + + org.eclipse.buildship.core.gradleprojectbuilder + + + org.eclipse.jdt.core.javanature org.apache.ivyde.eclipse.ivynature + org.eclipse.buildship.core.gradleprojectnature - 1665246567168 + 1727907273616 30 diff --git a/LARAI/ant/[LAPTOP]lara_cetus.xml b/LARAI/ant/[LAPTOP]lara_cetus.xml index 8e4de0640..c371a2cbf 100644 --- a/LARAI/ant/[LAPTOP]lara_cetus.xml +++ b/LARAI/ant/[LAPTOP]lara_cetus.xml @@ -9,7 +9,6 @@ - diff --git a/LARAI/ant/lara_lalp.xml b/LARAI/ant/lara_lalp.xml index 0c7515583..fb13b61e8 100644 --- a/LARAI/ant/lara_lalp.xml +++ b/LARAI/ant/lara_lalp.xml @@ -9,7 +9,6 @@ - diff --git a/LARAI/ant/larai.xml b/LARAI/ant/larai.xml index a531db075..a2a539fea 100644 --- a/LARAI/ant/larai.xml +++ b/LARAI/ant/larai.xml @@ -9,7 +9,6 @@ - diff --git a/LARAI/ant/larai_cetus.xml b/LARAI/ant/larai_cetus.xml index ef7444255..b456fa204 100644 --- a/LARAI/ant/larai_cetus.xml +++ b/LARAI/ant/larai_cetus.xml @@ -9,7 +9,6 @@ - diff --git a/LARAI/build.gradle b/LARAI/build.gradle index c84185ab6..f34e9fe4d 100644 --- a/LARAI/build.gradle +++ b/LARAI/build.gradle @@ -30,7 +30,6 @@ dependencies { implementation ':LaraApi' implementation ':LARAC' implementation ':LaraCommonLanguage' - implementation ':LaraLoc' implementation ':LaraUtils' implementation ':WeaverInterface' diff --git a/LARAI/run/[Generate]DefaultWeaver.launch b/LARAI/run/[Generate]DefaultWeaver.launch index 7dc8a6148..6cce50558 100644 --- a/LARAI/run/[Generate]DefaultWeaver.launch +++ b/LARAI/run/[Generate]DefaultWeaver.launch @@ -9,7 +9,6 @@ - diff --git a/LARAI/settings.gradle b/LARAI/settings.gradle index 13748c2a1..0f8b362b3 100644 --- a/LARAI/settings.gradle +++ b/LARAI/settings.gradle @@ -11,6 +11,5 @@ includeBuild("../../lara-framework/LanguageSpecification") includeBuild("../../lara-framework/LaraApi") includeBuild("../../lara-framework/LARAC") includeBuild("../../lara-framework/LaraCommonLanguage") -includeBuild("../../lara-framework/LaraLoc") includeBuild("../../lara-framework/LaraUtils") includeBuild("../../lara-framework/WeaverInterface") \ No newline at end of file diff --git a/LARAI/src/larai/LaraI.java b/LARAI/src/larai/LaraI.java index 263141bd9..8bac6713f 100644 --- a/LARAI/src/larai/LaraI.java +++ b/LARAI/src/larai/LaraI.java @@ -12,22 +12,17 @@ */ package larai; -import larac.LaraC; import larac.utils.output.Output; import org.apache.commons.cli.CommandLine; import org.apache.commons.cli.Options; import org.lara.interpreter.Interpreter; -import org.lara.interpreter.cli.CLIConfigOption; import org.lara.interpreter.cli.LaraCli; import org.lara.interpreter.cli.OptionsConverter; import org.lara.interpreter.cli.OptionsParser; import org.lara.interpreter.cli.OptionsParser.ExecutionMode; import org.lara.interpreter.exception.LaraIException; -import org.lara.interpreter.generator.stmt.AspectClassProcessor; import org.lara.interpreter.joptions.config.interpreter.LaraIDataStore; import org.lara.interpreter.joptions.config.interpreter.LaraiKeys; -import org.lara.interpreter.joptions.gui.LaraLauncher; -import org.lara.interpreter.joptions.keys.FileList; import org.lara.interpreter.profile.BasicWeaverProfiler; import org.lara.interpreter.profile.ReportField; import org.lara.interpreter.profile.WeaverProfiler; @@ -39,7 +34,6 @@ import org.lara.interpreter.weaver.interf.WeaverEngine; import org.lara.interpreter.weaver.interf.events.Stage; import org.lara.interpreter.weaver.utils.LaraResourceProvider; -import org.lara.language.specification.dsl.LanguageSpecificationV2; import org.suikasoft.jOptions.Interfaces.DataStore; import org.suikasoft.jOptions.JOptionKeys; import org.suikasoft.jOptions.app.AppPersistence; @@ -50,7 +44,6 @@ import pt.up.fe.specs.jsengine.JsEngine; import pt.up.fe.specs.jsengine.JsEngineType; import pt.up.fe.specs.jsengine.JsFileType; -import pt.up.fe.specs.lara.LaraCompiler; import pt.up.fe.specs.lara.LaraSystemTools; import pt.up.fe.specs.lara.aspectir.Aspects; import pt.up.fe.specs.lara.importer.LaraImporter; @@ -63,8 +56,6 @@ import pt.up.fe.specs.util.providers.ResourceProvider; import pt.up.fe.specs.util.utilities.Replacer; import pt.up.fe.specs.util.utilities.SpecsThreadLocal; -import tdrc.utils.Pair; - import java.io.File; import java.io.OutputStream; import java.nio.file.Path; @@ -87,8 +78,7 @@ public class LaraI { public static final double LARA_VERSION = 3.1; // Since we are using GraalVM public static final String LARAI_VERSION_TEXT = "Lara interpreter version: " + LaraI.LARA_VERSION; public static final String DEFAULT_WEAVER = DefaultWeaver.class.getName(); - public static final String PROPERTY_JAR_PATH = LaraC.PROPERTY_JAR_PATH; - + public static final String PROPERTY_JAR_PATH = "lara.jarpath"; private static final ThreadLocal RUNNING_GUI = ThreadLocal.withInitial(() -> false); private static final ThreadLocal SERVER_MODE = ThreadLocal.withInitial(() -> false); @@ -225,7 +215,6 @@ public static boolean execPrivate(DataStore dataStore, WeaverEngine weaverEngine prepareDataStore(dataStore, weaverEngine); MessageConstants.order = 1; - larac.utils.output.MessageConstants.order = 1; LaraI larai = null; try { @@ -354,9 +343,6 @@ public static Optional convertArgsToDataStore(Object[] objArgs, Weave // convert configuration file to data store and run case CONFIG -> Optional.of(OptionsConverter.configFile2DataStore(weaverEngine, cmd)); - // get the configuration file and execute GUI - case CONFIG_GUI -> Optional.empty(); - // convert options to data store and run case OPTIONS -> Optional.of(OptionsConverter.commandLine2DataStore(args[0], cmd, weaverEngine.getOptions())); @@ -364,9 +350,6 @@ public static Optional convertArgsToDataStore(Object[] objArgs, Weave // convert configuration file to data store, override with extra options and run case CONFIG_OPTIONS -> Optional.of(OptionsConverter.configExtraOptions2DataStore(args[0], cmd, weaverEngine)); - - // launch GUI - case GUI -> Optional.empty(); }; } @@ -378,12 +361,6 @@ public static LaraiResult execPrivate(String[] args, WeaverEngine weaverEngine) // Reset global state MessageConstants.order = 1; - if (CLIConfigOption.ALLOW_GUI && OptionsParser.guiMode(args)) { - - LaraLauncher.launchGUI(weaverEngine, Optional.empty()); - // return true; - return LaraiResult.newInstance(true, true); - } try { // Collection
",e.querySelectorAll("[msallowcapture^='']").length&&y.push("[*^$]="+M+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||y.push("\\["+M+"*(?:value|"+R+")"),e.querySelectorAll("[id~="+S+"-]").length||y.push("~="),(t=C.createElement("input")).setAttribute("name",""),e.appendChild(t),e.querySelectorAll("[name='']").length||y.push("\\["+M+"*name"+M+"*="+M+"*(?:''|\"\")"),e.querySelectorAll(":checked").length||y.push(":checked"),e.querySelectorAll("a#"+S+"+*").length||y.push(".#.+[+~]"),e.querySelectorAll("\\\f"),y.push("[\\r\\n\\f]")}),ce(function(e){e.innerHTML="";var t=C.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&y.push("name"+M+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&y.push(":enabled",":disabled"),a.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&y.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),y.push(",.*:")})),(d.matchesSelector=K.test(c=a.matches||a.webkitMatchesSelector||a.mozMatchesSelector||a.oMatchesSelector||a.msMatchesSelector))&&ce(function(e){d.disconnectedMatch=c.call(e,"*"),c.call(e,"[s!='']:x"),s.push("!=",F)}),d.cssHas||y.push(":has"),y=y.length&&new RegExp(y.join("|")),s=s.length&&new RegExp(s.join("|")),t=K.test(a.compareDocumentPosition),v=t||K.test(a.contains)?function(e,t){var n=9===e.nodeType&&e.documentElement||e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)while(t=t.parentNode)if(t===e)return!0;return!1},j=t?function(e,t){if(e===t)return l=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n||(1&(n=(e.ownerDocument||e)==(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!d.sortDetached&&t.compareDocumentPosition(e)===n?e==C||e.ownerDocument==p&&v(p,e)?-1:t==C||t.ownerDocument==p&&v(p,t)?1:u?P(u,e)-P(u,t):0:4&n?-1:1)}:function(e,t){if(e===t)return l=!0,0;var n,r=0,i=e.parentNode,o=t.parentNode,a=[e],s=[t];if(!i||!o)return e==C?-1:t==C?1:i?-1:o?1:u?P(u,e)-P(u,t):0;if(i===o)return pe(e,t);n=e;while(n=n.parentNode)a.unshift(n);n=t;while(n=n.parentNode)s.unshift(n);while(a[r]===s[r])r++;return r?pe(a[r],s[r]):a[r]==p?-1:s[r]==p?1:0}),C},se.matches=function(e,t){return se(e,null,null,t)},se.matchesSelector=function(e,t){if(T(e),d.matchesSelector&&E&&!N[t+" "]&&(!s||!s.test(t))&&(!y||!y.test(t)))try{var n=c.call(e,t);if(n||d.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(e){N(t,!0)}return 0":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(te,ne),e[3]=(e[3]||e[4]||e[5]||"").replace(te,ne),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||se.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&se.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return G.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&X.test(n)&&(t=h(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(te,ne).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=m[e+" "];return t||(t=new RegExp("(^|"+M+")"+e+"("+M+"|$)"))&&m(e,function(e){return t.test("string"==typeof e.className&&e.className||"undefined"!=typeof e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(n,r,i){return function(e){var t=se.attr(e,n);return null==t?"!="===r:!r||(t+="","="===r?t===i:"!="===r?t!==i:"^="===r?i&&0===t.indexOf(i):"*="===r?i&&-1:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function j(e,n,r){return m(n)?S.grep(e,function(e,t){return!!n.call(e,t,e)!==r}):n.nodeType?S.grep(e,function(e){return e===n!==r}):"string"!=typeof n?S.grep(e,function(e){return-1)[^>]*|#([\w-]+))$/;(S.fn.init=function(e,t,n){var r,i;if(!e)return this;if(n=n||D,"string"==typeof e){if(!(r="<"===e[0]&&">"===e[e.length-1]&&3<=e.length?[null,e,null]:q.exec(e))||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1]){if(t=t instanceof S?t[0]:t,S.merge(this,S.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:E,!0)),N.test(r[1])&&S.isPlainObject(t))for(r in t)m(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}return(i=E.getElementById(r[2]))&&(this[0]=i,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):m(e)?void 0!==n.ready?n.ready(e):e(S):S.makeArray(e,this)}).prototype=S.fn,D=S(E);var L=/^(?:parents|prev(?:Until|All))/,H={children:!0,contents:!0,next:!0,prev:!0};function O(e,t){while((e=e[t])&&1!==e.nodeType);return e}S.fn.extend({has:function(e){var t=S(e,this),n=t.length;return this.filter(function(){for(var e=0;e\x20\t\r\n\f]*)/i,he=/^$|^module$|\/(?:java|ecma)script/i;ce=E.createDocumentFragment().appendChild(E.createElement("div")),(fe=E.createElement("input")).setAttribute("type","radio"),fe.setAttribute("checked","checked"),fe.setAttribute("name","t"),ce.appendChild(fe),v.checkClone=ce.cloneNode(!0).cloneNode(!0).lastChild.checked,ce.innerHTML="",v.noCloneChecked=!!ce.cloneNode(!0).lastChild.defaultValue,ce.innerHTML="",v.option=!!ce.lastChild;var ge={thead:[1,"","
"],col:[2,"","
"],tr:[2,"","
"],td:[3,"","
"],_default:[0,"",""]};function ye(e,t){var n;return n="undefined"!=typeof e.getElementsByTagName?e.getElementsByTagName(t||"*"):"undefined"!=typeof e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&A(e,t)?S.merge([e],n):n}function ve(e,t){for(var n=0,r=e.length;n",""]);var me=/<|&#?\w+;/;function xe(e,t,n,r,i){for(var o,a,s,u,l,c,f=t.createDocumentFragment(),p=[],d=0,h=e.length;d\s*$/g;function je(e,t){return A(e,"table")&&A(11!==t.nodeType?t:t.firstChild,"tr")&&S(e).children("tbody")[0]||e}function De(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function qe(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function Le(e,t){var n,r,i,o,a,s;if(1===t.nodeType){if(Y.hasData(e)&&(s=Y.get(e).events))for(i in Y.remove(t,"handle events"),s)for(n=0,r=s[i].length;n").attr(n.scriptAttrs||{}).prop({charset:n.scriptCharset,src:n.url}).on("load error",i=function(e){r.remove(),i=null,e&&t("error"===e.type?404:200,e.type)}),E.head.appendChild(r[0])},abort:function(){i&&i()}}});var Ut,Xt=[],Vt=/(=)\?(?=&|$)|\?\?/;S.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Xt.pop()||S.expando+"_"+Ct.guid++;return this[e]=!0,e}}),S.ajaxPrefilter("json jsonp",function(e,t,n){var r,i,o,a=!1!==e.jsonp&&(Vt.test(e.url)?"url":"string"==typeof e.data&&0===(e.contentType||"").indexOf("application/x-www-form-urlencoded")&&Vt.test(e.data)&&"data");if(a||"jsonp"===e.dataTypes[0])return r=e.jsonpCallback=m(e.jsonpCallback)?e.jsonpCallback():e.jsonpCallback,a?e[a]=e[a].replace(Vt,"$1"+r):!1!==e.jsonp&&(e.url+=(Et.test(e.url)?"&":"?")+e.jsonp+"="+r),e.converters["script json"]=function(){return o||S.error(r+" was not called"),o[0]},e.dataTypes[0]="json",i=C[r],C[r]=function(){o=arguments},n.always(function(){void 0===i?S(C).removeProp(r):C[r]=i,e[r]&&(e.jsonpCallback=t.jsonpCallback,Xt.push(r)),o&&m(i)&&i(o[0]),o=i=void 0}),"script"}),v.createHTMLDocument=((Ut=E.implementation.createHTMLDocument("").body).innerHTML="
",2===Ut.childNodes.length),S.parseHTML=function(e,t,n){return"string"!=typeof e?[]:("boolean"==typeof t&&(n=t,t=!1),t||(v.createHTMLDocument?((r=(t=E.implementation.createHTMLDocument("")).createElement("base")).href=E.location.href,t.head.appendChild(r)):t=E),o=!n&&[],(i=N.exec(e))?[t.createElement(i[1])]:(i=xe([e],t,o),o&&o.length&&S(o).remove(),S.merge([],i.childNodes)));var r,i,o},S.fn.load=function(e,t,n){var r,i,o,a=this,s=e.indexOf(" ");return-1").append(S.parseHTML(e)).find(r):e)}).always(n&&function(e,t){a.each(function(){n.apply(this,o||[e.responseText,t,e])})}),this},S.expr.pseudos.animated=function(t){return S.grep(S.timers,function(e){return t===e.elem}).length},S.offset={setOffset:function(e,t,n){var r,i,o,a,s,u,l=S.css(e,"position"),c=S(e),f={};"static"===l&&(e.style.position="relative"),s=c.offset(),o=S.css(e,"top"),u=S.css(e,"left"),("absolute"===l||"fixed"===l)&&-1<(o+u).indexOf("auto")?(a=(r=c.position()).top,i=r.left):(a=parseFloat(o)||0,i=parseFloat(u)||0),m(t)&&(t=t.call(e,n,S.extend({},s))),null!=t.top&&(f.top=t.top-s.top+a),null!=t.left&&(f.left=t.left-s.left+i),"using"in t?t.using.call(e,f):c.css(f)}},S.fn.extend({offset:function(t){if(arguments.length)return void 0===t?this:this.each(function(e){S.offset.setOffset(this,t,e)});var e,n,r=this[0];return r?r.getClientRects().length?(e=r.getBoundingClientRect(),n=r.ownerDocument.defaultView,{top:e.top+n.pageYOffset,left:e.left+n.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var e,t,n,r=this[0],i={top:0,left:0};if("fixed"===S.css(r,"position"))t=r.getBoundingClientRect();else{t=this.offset(),n=r.ownerDocument,e=r.offsetParent||n.documentElement;while(e&&(e===n.body||e===n.documentElement)&&"static"===S.css(e,"position"))e=e.parentNode;e&&e!==r&&1===e.nodeType&&((i=S(e).offset()).top+=S.css(e,"borderTopWidth",!0),i.left+=S.css(e,"borderLeftWidth",!0))}return{top:t.top-i.top-S.css(r,"marginTop",!0),left:t.left-i.left-S.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var e=this.offsetParent;while(e&&"static"===S.css(e,"position"))e=e.offsetParent;return e||re})}}),S.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(t,i){var o="pageYOffset"===i;S.fn[t]=function(e){return B(this,function(e,t,n){var r;if(x(e)?r=e:9===e.nodeType&&(r=e.defaultView),void 0===n)return r?r[i]:e[t];r?r.scrollTo(o?r.pageXOffset:n,o?n:r.pageYOffset):e[t]=n},t,e,arguments.length)}}),S.each(["top","left"],function(e,n){S.cssHooks[n]=_e(v.pixelPosition,function(e,t){if(t)return t=Be(e,n),Pe.test(t)?S(e).position()[n]+"px":t})}),S.each({Height:"height",Width:"width"},function(a,s){S.each({padding:"inner"+a,content:s,"":"outer"+a},function(r,o){S.fn[o]=function(e,t){var n=arguments.length&&(r||"boolean"!=typeof e),i=r||(!0===e||!0===t?"margin":"border");return B(this,function(e,t,n){var r;return x(e)?0===o.indexOf("outer")?e["inner"+a]:e.document.documentElement["client"+a]:9===e.nodeType?(r=e.documentElement,Math.max(e.body["scroll"+a],r["scroll"+a],e.body["offset"+a],r["offset"+a],r["client"+a])):void 0===n?S.css(e,t,i):S.style(e,t,n,i)},s,n?e:void 0,n)}})}),S.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){S.fn[t]=function(e){return this.on(t,e)}}),S.fn.extend({bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)},hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}}),S.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(e,n){S.fn[n]=function(e,t){return 0