diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..3a546f5 --- /dev/null +++ b/.gitignore @@ -0,0 +1,25 @@ +# Eclipse +.classpath +.project +.settings/ + +# Intellij +.idea/ +*.iml +*.iws + +# Maven +log/ +target/ + +### Gradle ### +.gradle +/build/ + +settings.xml +/.gradle/ + +# Logging +Logging.html +Logging.txt +*.lck diff --git a/README.md b/README.md index e98c356..0f14783 100644 --- a/README.md +++ b/README.md @@ -1 +1,2 @@ # ServerlessCoverageTesting +This tool can be used for the instrumentation of serverless functions of a serverless application which is modeled by this tool. \ No newline at end of file diff --git a/build.gradle b/build.gradle new file mode 100644 index 0000000..c7d3e7f --- /dev/null +++ b/build.gradle @@ -0,0 +1,56 @@ +plugins { + id 'java' + id 'application' + id 'org.openjfx.javafxplugin' version '0.0.8' + id 'antlr' +} +group = 'de.uni-bamberg.pi' +version = '0.0.1-SNAPSHOT' + +description = """testcasegenerator""" + +tasks.withType(JavaCompile) { + options.encoding = 'UTF-8' +} + + + +repositories { + jcenter() +} +dependencies { + implementation group: 'com.google.code.gson', name: 'gson', version: '2.7' + implementation group: 'com.github.curious-odd-man', name: 'rgxgen', version: '1.3' + implementation group: 'com.amazonaws', name: 'aws-java-sdk-lambda', version: '1.12.30' + implementation group: 'com.amazonaws', name: 'aws-java-sdk-logs', version: '1.12.30' + implementation group: 'com.amazonaws', name: 'aws-java-sdk-cloudwatch', version: '1.12.30' + + + testImplementation group: 'junit', name: 'junit', version:'3.8.1' + antlr "org.antlr:antlr4:4.5" +} +/* +generateGrammarSource { + maxHeapSize = "64m" + arguments += ["-visitor", "-long-messages"] + doLast { + println "Copying generated grammar lexer/parser files to main directory." + copy { + from "${buildDir}/generated-src/antlr/main" + into "src/main/java/antlr" + } + } +} +*/ +javafx { + version = "14" + modules = [ 'javafx.base', 'javafx.controls', 'javafx.fxml' ] +} + +gradle.projectsEvaluated { + tasks.withType(JavaCompile) { + options.compilerArgs << "-Xlint:unchecked" + } +} + +mainClassName = 'gui.view.MainApp' \ No newline at end of file diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar new file mode 100644 index 0000000..d9b7505 Binary files /dev/null and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 0000000..cea3ac8 --- /dev/null +++ b/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,5 @@ +distributionUrl=https\://services.gradle.org/distributions/gradle-6.6.1-bin.zip +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +zipStorePath=wrapper/dists +zipStoreBase=GRADLE_USER_HOME diff --git a/gradlew b/gradlew new file mode 100644 index 0000000..cccdd3d --- /dev/null +++ b/gradlew @@ -0,0 +1,172 @@ +#!/usr/bin/env sh + +############################################################################## +## +## Gradle start up script for UN*X +## +############################################################################## + +# Attempt to set APP_HOME +# Resolve links: $0 may be a link +PRG="$0" +# Need this for relative symlinks. +while [ -h "$PRG" ] ; do + ls=`ls -ld "$PRG"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + PRG="$link" + else + PRG=`dirname "$PRG"`"/$link" + fi +done +SAVED="`pwd`" +cd "`dirname \"$PRG\"`/" >/dev/null +APP_HOME="`pwd -P`" +cd "$SAVED" >/dev/null + +APP_NAME="Gradle" +APP_BASE_NAME=`basename "$0"` + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS="" + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD="maximum" + +warn () { + echo "$*" +} + +die () { + echo + echo "$*" + echo + exit 1 +} + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "`uname`" in + CYGWIN* ) + cygwin=true + ;; + Darwin* ) + darwin=true + ;; + MINGW* ) + msys=true + ;; + NONSTOP* ) + nonstop=true + ;; +esac + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD="$JAVA_HOME/jre/sh/java" + else + JAVACMD="$JAVA_HOME/bin/java" + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD="java" + which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi + +# Increase the maximum file descriptors if we can. +if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then + MAX_FD_LIMIT=`ulimit -H -n` + if [ $? -eq 0 ] ; then + if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then + MAX_FD="$MAX_FD_LIMIT" + fi + ulimit -n $MAX_FD + if [ $? -ne 0 ] ; then + warn "Could not set maximum file descriptor limit: $MAX_FD" + fi + else + warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" + fi +fi + +# For Darwin, add options to specify how the application appears in the dock +if $darwin; then + GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" +fi + +# For Cygwin, switch paths to Windows format before running java +if $cygwin ; then + APP_HOME=`cygpath --path --mixed "$APP_HOME"` + CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` + JAVACMD=`cygpath --unix "$JAVACMD"` + + # We build the pattern for arguments to be converted via cygpath + ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` + SEP="" + for dir in $ROOTDIRSRAW ; do + ROOTDIRS="$ROOTDIRS$SEP$dir" + SEP="|" + done + OURCYGPATTERN="(^($ROOTDIRS))" + # Add a user-defined pattern to the cygpath arguments + if [ "$GRADLE_CYGPATTERN" != "" ] ; then + OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" + fi + # Now convert the arguments - kludge to limit ourselves to /bin/sh + i=0 + for arg in "$@" ; do + CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` + CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option + + if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition + eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` + else + eval `echo args$i`="\"$arg\"" + fi + i=$((i+1)) + done + case $i in + (0) set -- ;; + (1) set -- "$args0" ;; + (2) set -- "$args0" "$args1" ;; + (3) set -- "$args0" "$args1" "$args2" ;; + (4) set -- "$args0" "$args1" "$args2" "$args3" ;; + (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; + (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; + (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; + (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; + (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; + esac +fi + +# Escape application args +save () { + for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done + echo " " +} +APP_ARGS=$(save "$@") + +# Collect all arguments for the java command, following the shell quoting and substitution rules +eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" + +# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong +if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then + cd "$(dirname "$0")" +fi + +exec "$JAVACMD" "$@" diff --git a/gradlew.bat b/gradlew.bat new file mode 100644 index 0000000..f955316 --- /dev/null +++ b/gradlew.bat @@ -0,0 +1,84 @@ +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS= + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto init + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto init + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:init +@rem Get command-line arguments, handling Windows variants + +if not "%OS%" == "Windows_NT" goto win9xME_args + +:win9xME_args +@rem Slurp the command line arguments. +set CMD_LINE_ARGS= +set _SKIP=2 + +:win9xME_args_slurp +if "x%~1" == "x" goto execute + +set CMD_LINE_ARGS=%* + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/images/Images.pptx b/images/Images.pptx new file mode 100644 index 0000000..31bb7c5 Binary files /dev/null and b/images/Images.pptx differ diff --git a/images/database.png b/images/database.png new file mode 100644 index 0000000..9ab65b3 Binary files /dev/null and b/images/database.png differ diff --git a/images/dynamo.png b/images/dynamo.png new file mode 100644 index 0000000..e5d12dd Binary files /dev/null and b/images/dynamo.png differ diff --git a/images/lambda.png b/images/lambda.png new file mode 100644 index 0000000..28cf0b9 Binary files /dev/null and b/images/lambda.png differ diff --git a/images/s3.png b/images/s3.png new file mode 100644 index 0000000..808eabe Binary files /dev/null and b/images/s3.png differ diff --git a/settings.gradle b/settings.gradle new file mode 100644 index 0000000..5c368fd --- /dev/null +++ b/settings.gradle @@ -0,0 +1 @@ +rootProject.name = 'testcasegenerator' diff --git a/src/main/java/antlr/autogenerated/JavaScriptLexer.java b/src/main/java/antlr/autogenerated/JavaScriptLexer.java new file mode 100644 index 0000000..6ec0a2e --- /dev/null +++ b/src/main/java/antlr/autogenerated/JavaScriptLexer.java @@ -0,0 +1,827 @@ +package antlr.autogenerated; +// Generated from JavaScriptLexerUsedForParserCreation by ANTLR 4.5 + +import org.antlr.v4.runtime.*; +import org.antlr.v4.runtime.atn.ATN; +import org.antlr.v4.runtime.atn.ATNDeserializer; +import org.antlr.v4.runtime.atn.LexerATNSimulator; +import org.antlr.v4.runtime.atn.PredictionContextCache; +import org.antlr.v4.runtime.dfa.DFA; + +@SuppressWarnings({"all", "warnings", "unchecked", "unused", "cast"}) +public class JavaScriptLexer extends JavaScriptLexerBase { + static { RuntimeMetaData.checkVersion("4.5", RuntimeMetaData.VERSION); } + + protected static final DFA[] _decisionToDFA; + protected static final PredictionContextCache _sharedContextCache = + new PredictionContextCache(); + public static final int + HashBangLine=1, MultiLineComment=2, SingleLineComment=3, RegularExpressionLiteral=4, + OpenBracket=5, CloseBracket=6, OpenParen=7, CloseParen=8, OpenBrace=9, + CloseBrace=10, SemiColon=11, Comma=12, Assign=13, QuestionMark=14, Colon=15, + Ellipsis=16, Dot=17, PlusPlus=18, MinusMinus=19, Plus=20, Minus=21, BitNot=22, + Not=23, Multiply=24, Divide=25, Modulus=26, Power=27, NullCoalesce=28, + Hashtag=29, RightShiftArithmetic=30, LeftShiftArithmetic=31, RightShiftLogical=32, + LessThan=33, MoreThan=34, LessThanEquals=35, GreaterThanEquals=36, Equals_=37, + NotEquals=38, IdentityEquals=39, IdentityNotEquals=40, BitAnd=41, BitXOr=42, + BitOr=43, And=44, Or=45, MultiplyAssign=46, DivideAssign=47, ModulusAssign=48, + PlusAssign=49, MinusAssign=50, LeftShiftArithmeticAssign=51, RightShiftArithmeticAssign=52, + RightShiftLogicalAssign=53, BitAndAssign=54, BitXorAssign=55, BitOrAssign=56, + PowerAssign=57, ARROW=58, NullLiteral=59, BooleanLiteral=60, DecimalLiteral=61, + HexIntegerLiteral=62, OctalIntegerLiteral=63, OctalIntegerLiteral2=64, + BinaryIntegerLiteral=65, BigHexIntegerLiteral=66, BigOctalIntegerLiteral=67, + BigBinaryIntegerLiteral=68, BigDecimalIntegerLiteral=69, Break=70, Do=71, + Instanceof=72, Typeof=73, Case=74, Else=75, New=76, Var=77, Catch=78, + Finally=79, Return=80, Void=81, Continue=82, For=83, Switch=84, While=85, + Debugger=86, Function=87, This=88, With=89, Default=90, If=91, Throw=92, + Delete=93, In=94, Try=95, As=96, From=97, Class=98, Enum=99, Extends=100, + Super=101, Const=102, Export=103, Import=104, Async=105, Await=106, Implements=107, + StrictLet=108, NonStrictLet=109, Private=110, Public=111, Interface=112, + Package=113, Protected=114, Static=115, Yield=116, Identifier=117, StringLiteral=118, + TemplateStringLiteral=119, WhiteSpaces=120, LineTerminator=121, HtmlComment=122, + CDataComment=123, UnexpectedCharacter=124; + public static final int + ERROR=2; + public static String[] modeNames = { + "DEFAULT_MODE" + }; + + public static final String[] ruleNames = { + "HashBangLine", "MultiLineComment", "SingleLineComment", "RegularExpressionLiteral", + "OpenBracket", "CloseBracket", "OpenParen", "CloseParen", "OpenBrace", + "CloseBrace", "SemiColon", "Comma", "Assign", "QuestionMark", "Colon", + "Ellipsis", "Dot", "PlusPlus", "MinusMinus", "Plus", "Minus", "BitNot", + "Not", "Multiply", "Divide", "Modulus", "Power", "NullCoalesce", "Hashtag", + "RightShiftArithmetic", "LeftShiftArithmetic", "RightShiftLogical", "LessThan", + "MoreThan", "LessThanEquals", "GreaterThanEquals", "Equals_", "NotEquals", + "IdentityEquals", "IdentityNotEquals", "BitAnd", "BitXOr", "BitOr", "And", + "Or", "MultiplyAssign", "DivideAssign", "ModulusAssign", "PlusAssign", + "MinusAssign", "LeftShiftArithmeticAssign", "RightShiftArithmeticAssign", + "RightShiftLogicalAssign", "BitAndAssign", "BitXorAssign", "BitOrAssign", + "PowerAssign", "ARROW", "NullLiteral", "BooleanLiteral", "DecimalLiteral", + "HexIntegerLiteral", "OctalIntegerLiteral", "OctalIntegerLiteral2", "BinaryIntegerLiteral", + "BigHexIntegerLiteral", "BigOctalIntegerLiteral", "BigBinaryIntegerLiteral", + "BigDecimalIntegerLiteral", "Break", "Do", "Instanceof", "Typeof", "Case", + "Else", "New", "Var", "Catch", "Finally", "Return", "Void", "Continue", + "For", "Switch", "While", "Debugger", "Function", "This", "With", "Default", + "If", "Throw", "Delete", "In", "Try", "As", "From", "Class", "Enum", "Extends", + "Super", "Const", "Export", "Import", "Async", "Await", "Implements", + "StrictLet", "NonStrictLet", "Private", "Public", "Interface", "Package", + "Protected", "Static", "Yield", "Identifier", "StringLiteral", "TemplateStringLiteral", + "WhiteSpaces", "LineTerminator", "HtmlComment", "CDataComment", "UnexpectedCharacter", + "DoubleStringCharacter", "SingleStringCharacter", "EscapeSequence", "CharacterEscapeSequence", + "HexEscapeSequence", "UnicodeEscapeSequence", "ExtendedUnicodeEscapeSequence", + "SingleEscapeCharacter", "NonEscapeCharacter", "EscapeCharacter", "LineContinuation", + "HexDigit", "DecimalIntegerLiteral", "ExponentPart", "IdentifierPart", + "IdentifierStart", "UnicodeLetter", "UnicodeCombiningMark", "UnicodeDigit", + "UnicodeConnectorPunctuation", "RegularExpressionFirstChar", "RegularExpressionChar", + "RegularExpressionClassChar", "RegularExpressionBackslashSequence" + }; + + private static final String[] _LITERAL_NAMES = { + null, null, null, null, null, "'['", "']'", "'('", "')'", "'{'", "'}'", + "';'", "','", "'='", "'?'", "':'", "'...'", "'.'", "'++'", "'--'", "'+'", + "'-'", "'~'", "'!'", "'*'", "'/'", "'%'", "'**'", "'??'", "'#'", "'>>'", + "'<<'", "'>>>'", "'<'", "'>'", "'<='", "'>='", "'=='", "'!='", "'==='", + "'!=='", "'&'", "'^'", "'|'", "'&&'", "'||'", "'*='", "'/='", "'%='", + "'+='", "'-='", "'<<='", "'>>='", "'>>>='", "'&='", "'^='", "'|='", "'**='", + "'=>'", "'null'", null, null, null, null, null, null, null, null, null, + null, "'break'", "'do'", "'instanceof'", "'typeof'", "'case'", "'else'", + "'new'", "'var'", "'catch'", "'finally'", "'return'", "'void'", "'continue'", + "'for'", "'switch'", "'while'", "'debugger'", "'function'", "'this'", + "'with'", "'default'", "'if'", "'throw'", "'delete'", "'in'", "'try'", + "'as'", "'from'", "'class'", "'enum'", "'extends'", "'super'", "'const'", + "'export'", "'import'", "'async'", "'await'", "'implements'", null, null, + "'private'", "'public'", "'interface'", "'package'", "'protected'", "'static'", + "'yield'" + }; + private static final String[] _SYMBOLIC_NAMES = { + null, "HashBangLine", "MultiLineComment", "SingleLineComment", "RegularExpressionLiteral", + "OpenBracket", "CloseBracket", "OpenParen", "CloseParen", "OpenBrace", + "CloseBrace", "SemiColon", "Comma", "Assign", "QuestionMark", "Colon", + "Ellipsis", "Dot", "PlusPlus", "MinusMinus", "Plus", "Minus", "BitNot", + "Not", "Multiply", "Divide", "Modulus", "Power", "NullCoalesce", "Hashtag", + "RightShiftArithmetic", "LeftShiftArithmetic", "RightShiftLogical", "LessThan", + "MoreThan", "LessThanEquals", "GreaterThanEquals", "Equals_", "NotEquals", + "IdentityEquals", "IdentityNotEquals", "BitAnd", "BitXOr", "BitOr", "And", + "Or", "MultiplyAssign", "DivideAssign", "ModulusAssign", "PlusAssign", + "MinusAssign", "LeftShiftArithmeticAssign", "RightShiftArithmeticAssign", + "RightShiftLogicalAssign", "BitAndAssign", "BitXorAssign", "BitOrAssign", + "PowerAssign", "ARROW", "NullLiteral", "BooleanLiteral", "DecimalLiteral", + "HexIntegerLiteral", "OctalIntegerLiteral", "OctalIntegerLiteral2", "BinaryIntegerLiteral", + "BigHexIntegerLiteral", "BigOctalIntegerLiteral", "BigBinaryIntegerLiteral", + "BigDecimalIntegerLiteral", "Break", "Do", "Instanceof", "Typeof", "Case", + "Else", "New", "Var", "Catch", "Finally", "Return", "Void", "Continue", + "For", "Switch", "While", "Debugger", "Function", "This", "With", "Default", + "If", "Throw", "Delete", "In", "Try", "As", "From", "Class", "Enum", "Extends", + "Super", "Const", "Export", "Import", "Async", "Await", "Implements", + "StrictLet", "NonStrictLet", "Private", "Public", "Interface", "Package", + "Protected", "Static", "Yield", "Identifier", "StringLiteral", "TemplateStringLiteral", + "WhiteSpaces", "LineTerminator", "HtmlComment", "CDataComment", "UnexpectedCharacter" + }; + public static final Vocabulary VOCABULARY = new VocabularyImpl(_LITERAL_NAMES, _SYMBOLIC_NAMES); + + /** + * @deprecated Use {@link #VOCABULARY} instead. + */ + @Deprecated + public static final String[] tokenNames; + static { + tokenNames = new String[_SYMBOLIC_NAMES.length]; + for (int i = 0; i < tokenNames.length; i++) { + tokenNames[i] = VOCABULARY.getLiteralName(i); + if (tokenNames[i] == null) { + tokenNames[i] = VOCABULARY.getSymbolicName(i); + } + + if (tokenNames[i] == null) { + tokenNames[i] = ""; + } + } + } + + @Override + @Deprecated + public String[] getTokenNames() { + return tokenNames; + } + + @Override + + public Vocabulary getVocabulary() { + return VOCABULARY; + } + + + public JavaScriptLexer(CharStream input) { + super(input); + _interp = new LexerATNSimulator(this,_ATN,_decisionToDFA,_sharedContextCache); + } + + @Override + public String getGrammarFileName() { return "JavaScriptLexerUsedForParserCreation"; } + + @Override + public String[] getRuleNames() { return ruleNames; } + + @Override + public String getSerializedATN() { return _serializedATN; } + + @Override + public String[] getModeNames() { return modeNames; } + + @Override + public ATN getATN() { return _ATN; } + + @Override + public void action(RuleContext _localctx, int ruleIndex, int actionIndex) { + switch (ruleIndex) { + case 8: + OpenBrace_action((RuleContext)_localctx, actionIndex); + break; + case 9: + CloseBrace_action((RuleContext)_localctx, actionIndex); + break; + case 117: + StringLiteral_action((RuleContext)_localctx, actionIndex); + break; + } + } + private void OpenBrace_action(RuleContext _localctx, int actionIndex) { + switch (actionIndex) { + case 0: + this.ProcessOpenBrace(); + break; + } + } + private void CloseBrace_action(RuleContext _localctx, int actionIndex) { + switch (actionIndex) { + case 1: + this.ProcessCloseBrace(); + break; + } + } + private void StringLiteral_action(RuleContext _localctx, int actionIndex) { + switch (actionIndex) { + case 2: + this.ProcessStringLiteral(); + break; + } + } + @Override + public boolean sempred(RuleContext _localctx, int ruleIndex, int predIndex) { + switch (ruleIndex) { + case 0: + return HashBangLine_sempred((RuleContext)_localctx, predIndex); + case 3: + return RegularExpressionLiteral_sempred((RuleContext)_localctx, predIndex); + case 62: + return OctalIntegerLiteral_sempred((RuleContext)_localctx, predIndex); + case 106: + return Implements_sempred((RuleContext)_localctx, predIndex); + case 107: + return StrictLet_sempred((RuleContext)_localctx, predIndex); + case 108: + return NonStrictLet_sempred((RuleContext)_localctx, predIndex); + case 109: + return Private_sempred((RuleContext)_localctx, predIndex); + case 110: + return Public_sempred((RuleContext)_localctx, predIndex); + case 111: + return Interface_sempred((RuleContext)_localctx, predIndex); + case 112: + return Package_sempred((RuleContext)_localctx, predIndex); + case 113: + return Protected_sempred((RuleContext)_localctx, predIndex); + case 114: + return Static_sempred((RuleContext)_localctx, predIndex); + case 115: + return Yield_sempred((RuleContext)_localctx, predIndex); + } + return true; + } + private boolean HashBangLine_sempred(RuleContext _localctx, int predIndex) { + switch (predIndex) { + case 0: + return this.IsStartOfFile(); + } + return true; + } + private boolean RegularExpressionLiteral_sempred(RuleContext _localctx, int predIndex) { + switch (predIndex) { + case 1: + return this.IsRegexPossible(); + } + return true; + } + private boolean OctalIntegerLiteral_sempred(RuleContext _localctx, int predIndex) { + switch (predIndex) { + case 2: + return !this.IsStrictMode(); + } + return true; + } + private boolean Implements_sempred(RuleContext _localctx, int predIndex) { + switch (predIndex) { + case 3: + return this.IsStrictMode(); + } + return true; + } + private boolean StrictLet_sempred(RuleContext _localctx, int predIndex) { + switch (predIndex) { + case 4: + return this.IsStrictMode(); + } + return true; + } + private boolean NonStrictLet_sempred(RuleContext _localctx, int predIndex) { + switch (predIndex) { + case 5: + return !this.IsStrictMode(); + } + return true; + } + private boolean Private_sempred(RuleContext _localctx, int predIndex) { + switch (predIndex) { + case 6: + return this.IsStrictMode(); + } + return true; + } + private boolean Public_sempred(RuleContext _localctx, int predIndex) { + switch (predIndex) { + case 7: + return this.IsStrictMode(); + } + return true; + } + private boolean Interface_sempred(RuleContext _localctx, int predIndex) { + switch (predIndex) { + case 8: + return this.IsStrictMode(); + } + return true; + } + private boolean Package_sempred(RuleContext _localctx, int predIndex) { + switch (predIndex) { + case 9: + return this.IsStrictMode(); + } + return true; + } + private boolean Protected_sempred(RuleContext _localctx, int predIndex) { + switch (predIndex) { + case 10: + return this.IsStrictMode(); + } + return true; + } + private boolean Static_sempred(RuleContext _localctx, int predIndex) { + switch (predIndex) { + case 11: + return this.IsStrictMode(); + } + return true; + } + private boolean Yield_sempred(RuleContext _localctx, int predIndex) { + switch (predIndex) { + case 12: + return this.IsStrictMode(); + } + return true; + } + + public static final String _serializedATN = + "\3\u0430\ud6d1\u8206\uad2d\u4417\uaef1\u8d80\uaadd\2~\u048c\b\1\4\2\t"+ + "\2\4\3\t\3\4\4\t\4\4\5\t\5\4\6\t\6\4\7\t\7\4\b\t\b\4\t\t\t\4\n\t\n\4\13"+ + "\t\13\4\f\t\f\4\r\t\r\4\16\t\16\4\17\t\17\4\20\t\20\4\21\t\21\4\22\t\22"+ + "\4\23\t\23\4\24\t\24\4\25\t\25\4\26\t\26\4\27\t\27\4\30\t\30\4\31\t\31"+ + "\4\32\t\32\4\33\t\33\4\34\t\34\4\35\t\35\4\36\t\36\4\37\t\37\4 \t \4!"+ + "\t!\4\"\t\"\4#\t#\4$\t$\4%\t%\4&\t&\4\'\t\'\4(\t(\4)\t)\4*\t*\4+\t+\4"+ + ",\t,\4-\t-\4.\t.\4/\t/\4\60\t\60\4\61\t\61\4\62\t\62\4\63\t\63\4\64\t"+ + "\64\4\65\t\65\4\66\t\66\4\67\t\67\48\t8\49\t9\4:\t:\4;\t;\4<\t<\4=\t="+ + "\4>\t>\4?\t?\4@\t@\4A\tA\4B\tB\4C\tC\4D\tD\4E\tE\4F\tF\4G\tG\4H\tH\4I"+ + "\tI\4J\tJ\4K\tK\4L\tL\4M\tM\4N\tN\4O\tO\4P\tP\4Q\tQ\4R\tR\4S\tS\4T\tT"+ + "\4U\tU\4V\tV\4W\tW\4X\tX\4Y\tY\4Z\tZ\4[\t[\4\\\t\\\4]\t]\4^\t^\4_\t_\4"+ + "`\t`\4a\ta\4b\tb\4c\tc\4d\td\4e\te\4f\tf\4g\tg\4h\th\4i\ti\4j\tj\4k\t"+ + "k\4l\tl\4m\tm\4n\tn\4o\to\4p\tp\4q\tq\4r\tr\4s\ts\4t\tt\4u\tu\4v\tv\4"+ + "w\tw\4x\tx\4y\ty\4z\tz\4{\t{\4|\t|\4}\t}\4~\t~\4\177\t\177\4\u0080\t\u0080"+ + "\4\u0081\t\u0081\4\u0082\t\u0082\4\u0083\t\u0083\4\u0084\t\u0084\4\u0085"+ + "\t\u0085\4\u0086\t\u0086\4\u0087\t\u0087\4\u0088\t\u0088\4\u0089\t\u0089"+ + "\4\u008a\t\u008a\4\u008b\t\u008b\4\u008c\t\u008c\4\u008d\t\u008d\4\u008e"+ + "\t\u008e\4\u008f\t\u008f\4\u0090\t\u0090\4\u0091\t\u0091\4\u0092\t\u0092"+ + "\4\u0093\t\u0093\4\u0094\t\u0094\4\u0095\t\u0095\3\2\3\2\3\2\3\2\3\2\7"+ + "\2\u0131\n\2\f\2\16\2\u0134\13\2\3\3\3\3\3\3\3\3\7\3\u013a\n\3\f\3\16"+ + "\3\u013d\13\3\3\3\3\3\3\3\3\3\3\3\3\4\3\4\3\4\3\4\7\4\u0148\n\4\f\4\16"+ + "\4\u014b\13\4\3\4\3\4\3\5\3\5\3\5\7\5\u0152\n\5\f\5\16\5\u0155\13\5\3"+ + "\5\3\5\3\5\7\5\u015a\n\5\f\5\16\5\u015d\13\5\3\6\3\6\3\7\3\7\3\b\3\b\3"+ + "\t\3\t\3\n\3\n\3\n\3\13\3\13\3\13\3\f\3\f\3\r\3\r\3\16\3\16\3\17\3\17"+ + "\3\20\3\20\3\21\3\21\3\21\3\21\3\22\3\22\3\23\3\23\3\23\3\24\3\24\3\24"+ + "\3\25\3\25\3\26\3\26\3\27\3\27\3\30\3\30\3\31\3\31\3\32\3\32\3\33\3\33"+ + "\3\34\3\34\3\34\3\35\3\35\3\35\3\36\3\36\3\37\3\37\3\37\3 \3 \3 \3!\3"+ + "!\3!\3!\3\"\3\"\3#\3#\3$\3$\3$\3%\3%\3%\3&\3&\3&\3\'\3\'\3\'\3(\3(\3("+ + "\3(\3)\3)\3)\3)\3*\3*\3+\3+\3,\3,\3-\3-\3-\3.\3.\3.\3/\3/\3/\3\60\3\60"+ + "\3\60\3\61\3\61\3\61\3\62\3\62\3\62\3\63\3\63\3\63\3\64\3\64\3\64\3\64"+ + "\3\65\3\65\3\65\3\65\3\66\3\66\3\66\3\66\3\66\3\67\3\67\3\67\38\38\38"+ + "\39\39\39\3:\3:\3:\3:\3;\3;\3;\3<\3<\3<\3<\3<\3=\3=\3=\3=\3=\3=\3=\3="+ + "\3=\5=\u0201\n=\3>\3>\3>\3>\7>\u0207\n>\f>\16>\u020a\13>\3>\5>\u020d\n"+ + ">\3>\3>\3>\7>\u0212\n>\f>\16>\u0215\13>\3>\5>\u0218\n>\3>\3>\5>\u021c"+ + "\n>\5>\u021e\n>\3?\3?\3?\3?\7?\u0224\n?\f?\16?\u0227\13?\3@\3@\6@\u022b"+ + "\n@\r@\16@\u022c\3@\3@\3A\3A\3A\3A\7A\u0235\nA\fA\16A\u0238\13A\3B\3B"+ + "\3B\3B\7B\u023e\nB\fB\16B\u0241\13B\3C\3C\3C\3C\7C\u0247\nC\fC\16C\u024a"+ + "\13C\3C\3C\3D\3D\3D\3D\7D\u0252\nD\fD\16D\u0255\13D\3D\3D\3E\3E\3E\3E"+ + "\7E\u025d\nE\fE\16E\u0260\13E\3E\3E\3F\3F\3F\3G\3G\3G\3G\3G\3G\3H\3H\3"+ + "H\3I\3I\3I\3I\3I\3I\3I\3I\3I\3I\3I\3J\3J\3J\3J\3J\3J\3J\3K\3K\3K\3K\3"+ + "K\3L\3L\3L\3L\3L\3M\3M\3M\3M\3N\3N\3N\3N\3O\3O\3O\3O\3O\3O\3P\3P\3P\3"+ + "P\3P\3P\3P\3P\3Q\3Q\3Q\3Q\3Q\3Q\3Q\3R\3R\3R\3R\3R\3S\3S\3S\3S\3S\3S\3"+ + "S\3S\3S\3T\3T\3T\3T\3U\3U\3U\3U\3U\3U\3U\3V\3V\3V\3V\3V\3V\3W\3W\3W\3"+ + "W\3W\3W\3W\3W\3W\3X\3X\3X\3X\3X\3X\3X\3X\3X\3Y\3Y\3Y\3Y\3Y\3Z\3Z\3Z\3"+ + "Z\3Z\3[\3[\3[\3[\3[\3[\3[\3[\3\\\3\\\3\\\3]\3]\3]\3]\3]\3]\3^\3^\3^\3"+ + "^\3^\3^\3^\3_\3_\3_\3`\3`\3`\3`\3a\3a\3a\3b\3b\3b\3b\3b\3c\3c\3c\3c\3"+ + "c\3c\3d\3d\3d\3d\3d\3e\3e\3e\3e\3e\3e\3e\3e\3f\3f\3f\3f\3f\3f\3g\3g\3"+ + "g\3g\3g\3g\3h\3h\3h\3h\3h\3h\3h\3i\3i\3i\3i\3i\3i\3i\3j\3j\3j\3j\3j\3"+ + "j\3k\3k\3k\3k\3k\3k\3l\3l\3l\3l\3l\3l\3l\3l\3l\3l\3l\3l\3l\3m\3m\3m\3"+ + "m\3m\3m\3n\3n\3n\3n\3n\3n\3o\3o\3o\3o\3o\3o\3o\3o\3o\3o\3p\3p\3p\3p\3"+ + "p\3p\3p\3p\3p\3q\3q\3q\3q\3q\3q\3q\3q\3q\3q\3q\3q\3r\3r\3r\3r\3r\3r\3"+ + "r\3r\3r\3r\3s\3s\3s\3s\3s\3s\3s\3s\3s\3s\3s\3s\3t\3t\3t\3t\3t\3t\3t\3"+ + "t\3t\3u\3u\3u\3u\3u\3u\3u\3u\3v\3v\7v\u03a5\nv\fv\16v\u03a8\13v\3w\3w"+ + "\7w\u03ac\nw\fw\16w\u03af\13w\3w\3w\3w\7w\u03b4\nw\fw\16w\u03b7\13w\3"+ + "w\5w\u03ba\nw\3w\3w\3x\3x\3x\3x\7x\u03c2\nx\fx\16x\u03c5\13x\3x\3x\3y"+ + "\6y\u03ca\ny\ry\16y\u03cb\3y\3y\3z\3z\3z\3z\3{\3{\3{\3{\3{\3{\7{\u03da"+ + "\n{\f{\16{\u03dd\13{\3{\3{\3{\3{\3{\3{\3|\3|\3|\3|\3|\3|\3|\3|\3|\3|\3"+ + "|\7|\u03f0\n|\f|\16|\u03f3\13|\3|\3|\3|\3|\3|\3|\3}\3}\3}\3}\3~\3~\3~"+ + "\3~\5~\u0403\n~\3\177\3\177\3\177\3\177\5\177\u0409\n\177\3\u0080\3\u0080"+ + "\3\u0080\3\u0080\3\u0080\5\u0080\u0410\n\u0080\3\u0081\3\u0081\5\u0081"+ + "\u0414\n\u0081\3\u0082\3\u0082\3\u0082\3\u0082\3\u0083\3\u0083\3\u0083"+ + "\3\u0083\3\u0083\3\u0083\3\u0083\3\u0083\3\u0083\3\u0083\6\u0083\u0424"+ + "\n\u0083\r\u0083\16\u0083\u0425\3\u0083\3\u0083\5\u0083\u042a\n\u0083"+ + "\3\u0084\3\u0084\3\u0084\6\u0084\u042f\n\u0084\r\u0084\16\u0084\u0430"+ + "\3\u0084\3\u0084\3\u0085\3\u0085\3\u0086\3\u0086\3\u0087\3\u0087\5\u0087"+ + "\u043b\n\u0087\3\u0088\3\u0088\3\u0088\3\u0089\3\u0089\3\u008a\3\u008a"+ + "\3\u008a\7\u008a\u0445\n\u008a\f\u008a\16\u008a\u0448\13\u008a\5\u008a"+ + "\u044a\n\u008a\3\u008b\3\u008b\5\u008b\u044e\n\u008b\3\u008b\6\u008b\u0451"+ + "\n\u008b\r\u008b\16\u008b\u0452\3\u008c\3\u008c\3\u008c\3\u008c\3\u008c"+ + "\5\u008c\u045a\n\u008c\3\u008d\3\u008d\3\u008d\3\u008d\5\u008d\u0460\n"+ + "\u008d\3\u008e\5\u008e\u0463\n\u008e\3\u008f\5\u008f\u0466\n\u008f\3\u0090"+ + "\5\u0090\u0469\n\u0090\3\u0091\5\u0091\u046c\n\u0091\3\u0092\3\u0092\3"+ + "\u0092\3\u0092\7\u0092\u0472\n\u0092\f\u0092\16\u0092\u0475\13\u0092\3"+ + "\u0092\5\u0092\u0478\n\u0092\3\u0093\3\u0093\3\u0093\3\u0093\7\u0093\u047e"+ + "\n\u0093\f\u0093\16\u0093\u0481\13\u0093\3\u0093\5\u0093\u0484\n\u0093"+ + "\3\u0094\3\u0094\5\u0094\u0488\n\u0094\3\u0095\3\u0095\3\u0095\5\u013b"+ + "\u03db\u03f1\2\u0096\3\3\5\4\7\5\t\6\13\7\r\b\17\t\21\n\23\13\25\f\27"+ + "\r\31\16\33\17\35\20\37\21!\22#\23%\24\'\25)\26+\27-\30/\31\61\32\63\33"+ + "\65\34\67\359\36;\37= ?!A\"C#E$G%I&K\'M(O)Q*S+U,W-Y.[/]\60_\61a\62c\63"+ + "e\64g\65i\66k\67m8o9q:s;u{?}@\177A\u0081B\u0083C\u0085D\u0087E\u0089"+ + "F\u008bG\u008dH\u008fI\u0091J\u0093K\u0095L\u0097M\u0099N\u009bO\u009d"+ + "P\u009fQ\u00a1R\u00a3S\u00a5T\u00a7U\u00a9V\u00abW\u00adX\u00afY\u00b1"+ + "Z\u00b3[\u00b5\\\u00b7]\u00b9^\u00bb_\u00bd`\u00bfa\u00c1b\u00c3c\u00c5"+ + "d\u00c7e\u00c9f\u00cbg\u00cdh\u00cfi\u00d1j\u00d3k\u00d5l\u00d7m\u00d9"+ + "n\u00dbo\u00ddp\u00dfq\u00e1r\u00e3s\u00e5t\u00e7u\u00e9v\u00ebw\u00ed"+ + "x\u00efy\u00f1z\u00f3{\u00f5|\u00f7}\u00f9~\u00fb\2\u00fd\2\u00ff\2\u0101"+ + "\2\u0103\2\u0105\2\u0107\2\u0109\2\u010b\2\u010d\2\u010f\2\u0111\2\u0113"+ + "\2\u0115\2\u0117\2\u0119\2\u011b\2\u011d\2\u011f\2\u0121\2\u0123\2\u0125"+ + "\2\u0127\2\u0129\2\3\2 \5\2\f\f\17\17\u202a\u202b\3\2\62;\4\2\62;aa\4"+ + "\2ZZzz\5\2\62;CHch\3\2\629\4\2QQqq\4\2\629aa\4\2DDdd\3\2\62\63\4\2\62"+ + "\63aa\3\2bb\6\2\13\13\r\16\"\"\u00a2\u00a2\6\2\f\f\17\17$$^^\6\2\f\f\17"+ + "\17))^^\13\2$$))^^ddhhppttvvxx\16\2\f\f\17\17$$))\62;^^ddhhppttvxzz\5"+ + "\2\62;wwzz\6\2\62;CHaach\3\2\63;\4\2GGgg\4\2--//\4\2&&aa\u0101\2C\\c|"+ + "\u00ac\u00ac\u00b7\u00b7\u00bc\u00bc\u00c2\u00d8\u00da\u00f8\u00fa\u0221"+ + "\u0224\u0235\u0252\u02af\u02b2\u02ba\u02bd\u02c3\u02d2\u02d3\u02e2\u02e6"+ + "\u02f0\u02f0\u037c\u037c\u0388\u0388\u038a\u038c\u038e\u038e\u0390\u03a3"+ + "\u03a5\u03d0\u03d2\u03d9\u03dc\u03f5\u0402\u0483\u048e\u04c6\u04c9\u04ca"+ + "\u04cd\u04ce\u04d2\u04f7\u04fa\u04fb\u0533\u0558\u055b\u055b\u0563\u0589"+ + "\u05d2\u05ec\u05f2\u05f4\u0623\u063c\u0642\u064c\u0673\u06d5\u06d7\u06d7"+ + "\u06e7\u06e8\u06fc\u06fe\u0712\u0712\u0714\u072e\u0782\u07a7\u0907\u093b"+ + "\u093f\u093f\u0952\u0952\u095a\u0963\u0987\u098e\u0991\u0992\u0995\u09aa"+ + "\u09ac\u09b2\u09b4\u09b4\u09b8\u09bb\u09de\u09df\u09e1\u09e3\u09f2\u09f3"+ + "\u0a07\u0a0c\u0a11\u0a12\u0a15\u0a2a\u0a2c\u0a32\u0a34\u0a35\u0a37\u0a38"+ + "\u0a3a\u0a3b\u0a5b\u0a5e\u0a60\u0a60\u0a74\u0a76\u0a87\u0a8d\u0a8f\u0a8f"+ + "\u0a91\u0a93\u0a95\u0aaa\u0aac\u0ab2\u0ab4\u0ab5\u0ab7\u0abb\u0abf\u0abf"+ + "\u0ad2\u0ad2\u0ae2\u0ae2\u0b07\u0b0e\u0b11\u0b12\u0b15\u0b2a\u0b2c\u0b32"+ + "\u0b34\u0b35\u0b38\u0b3b\u0b3f\u0b3f\u0b5e\u0b5f\u0b61\u0b63\u0b87\u0b8c"+ + "\u0b90\u0b92\u0b94\u0b97\u0b9b\u0b9c\u0b9e\u0b9e\u0ba0\u0ba1\u0ba5\u0ba6"+ + "\u0baa\u0bac\u0bb0\u0bb7\u0bb9\u0bbb\u0c07\u0c0e\u0c10\u0c12\u0c14\u0c2a"+ + "\u0c2c\u0c35\u0c37\u0c3b\u0c62\u0c63\u0c87\u0c8e\u0c90\u0c92\u0c94\u0caa"+ + "\u0cac\u0cb5\u0cb7\u0cbb\u0ce0\u0ce0\u0ce2\u0ce3\u0d07\u0d0e\u0d10\u0d12"+ + "\u0d14\u0d2a\u0d2c\u0d3b\u0d62\u0d63\u0d87\u0d98\u0d9c\u0db3\u0db5\u0dbd"+ + "\u0dbf\u0dbf\u0dc2\u0dc8\u0e03\u0e32\u0e34\u0e35\u0e42\u0e48\u0e83\u0e84"+ + "\u0e86\u0e86\u0e89\u0e8a\u0e8c\u0e8c\u0e8f\u0e8f\u0e96\u0e99\u0e9b\u0ea1"+ + "\u0ea3\u0ea5\u0ea7\u0ea7\u0ea9\u0ea9\u0eac\u0ead\u0eaf\u0eb2\u0eb4\u0eb5"+ + "\u0ebf\u0ec6\u0ec8\u0ec8\u0ede\u0edf\u0f02\u0f02\u0f42\u0f6c\u0f8a\u0f8d"+ + "\u1002\u1023\u1025\u1029\u102b\u102c\u1052\u1057\u10a2\u10c7\u10d2\u10f8"+ + "\u1102\u115b\u1161\u11a4\u11aa\u11fb\u1202\u1208\u120a\u1248\u124a\u124a"+ + "\u124c\u124f\u1252\u1258\u125a\u125a\u125c\u125f\u1262\u1288\u128a\u128a"+ + "\u128c\u128f\u1292\u12b0\u12b2\u12b2\u12b4\u12b7\u12ba\u12c0\u12c2\u12c2"+ + "\u12c4\u12c7\u12ca\u12d0\u12d2\u12d8\u12da\u12f0\u12f2\u1310\u1312\u1312"+ + "\u1314\u1317\u131a\u1320\u1322\u1348\u134a\u135c\u13a2\u13f6\u1403\u1678"+ + "\u1683\u169c\u16a2\u16ec\u1782\u17b5\u1822\u1879\u1882\u18aa\u1e02\u1e9d"+ + "\u1ea2\u1efb\u1f02\u1f17\u1f1a\u1f1f\u1f22\u1f47\u1f4a\u1f4f\u1f52\u1f59"+ + "\u1f5b\u1f5b\u1f5d\u1f5d\u1f5f\u1f5f\u1f61\u1f7f\u1f82\u1fb6\u1fb8\u1fbe"+ + "\u1fc0\u1fc0\u1fc4\u1fc6\u1fc8\u1fce\u1fd2\u1fd5\u1fd8\u1fdd\u1fe2\u1fee"+ + "\u1ff4\u1ff6\u1ff8\u1ffe\u2081\u2081\u2104\u2104\u2109\u2109\u210c\u2115"+ + "\u2117\u2117\u211b\u211f\u2126\u2126\u2128\u2128\u212a\u212a\u212c\u212f"+ + "\u2131\u2133\u2135\u213b\u2162\u2185\u3007\u3009\u3023\u302b\u3033\u3037"+ + "\u303a\u303c\u3043\u3096\u309f\u30a0\u30a3\u30fc\u30fe\u3100\u3107\u312e"+ + "\u3133\u3190\u31a2\u31b9\u3402\u4dc1\u4e02\ua48e\uac02\uac02\ud7a5\ud7a5"+ + "\uf902\ufa2f\ufb02\ufb08\ufb15\ufb19\ufb1f\ufb1f\ufb21\ufb2a\ufb2c\ufb38"+ + "\ufb3a\ufb3e\ufb40\ufb40\ufb42\ufb43\ufb45\ufb46\ufb48\ufbb3\ufbd5\ufd3f"+ + "\ufd52\ufd91\ufd94\ufdc9\ufdf2\ufdfd\ufe72\ufe74\ufe76\ufe76\ufe78\ufefe"+ + "\uff23\uff3c\uff43\uff5c\uff68\uffc0\uffc4\uffc9\uffcc\uffd1\uffd4\uffd9"+ + "\uffdc\uffdef\2\u0302\u0350\u0362\u0364\u0485\u0488\u0593\u05a3\u05a5"+ + "\u05bb\u05bd\u05bf\u05c1\u05c1\u05c3\u05c4\u05c6\u05c6\u064d\u0657\u0672"+ + "\u0672\u06d8\u06de\u06e1\u06e6\u06e9\u06ea\u06ec\u06ef\u0713\u0713\u0732"+ + "\u074c\u07a8\u07b2\u0903\u0905\u093e\u093e\u0940\u094f\u0953\u0956\u0964"+ + "\u0965\u0983\u0985\u09be\u09c6\u09c9\u09ca\u09cd\u09cf\u09d9\u09d9\u09e4"+ + "\u09e5\u0a04\u0a04\u0a3e\u0a3e\u0a40\u0a44\u0a49\u0a4a\u0a4d\u0a4f\u0a72"+ + "\u0a73\u0a83\u0a85\u0abe\u0abe\u0ac0\u0ac7\u0ac9\u0acb\u0acd\u0acf\u0b03"+ + "\u0b05\u0b3e\u0b3e\u0b40\u0b45\u0b49\u0b4a\u0b4d\u0b4f\u0b58\u0b59\u0b84"+ + "\u0b85\u0bc0\u0bc4\u0bc8\u0bca\u0bcc\u0bcf\u0bd9\u0bd9\u0c03\u0c05\u0c40"+ + "\u0c46\u0c48\u0c4a\u0c4c\u0c4f\u0c57\u0c58\u0c84\u0c85\u0cc0\u0cc6\u0cc8"+ + "\u0cca\u0ccc\u0ccf\u0cd7\u0cd8\u0d04\u0d05\u0d40\u0d45\u0d48\u0d4a\u0d4c"+ + "\u0d4f\u0d59\u0d59\u0d84\u0d85\u0dcc\u0dcc\u0dd1\u0dd6\u0dd8\u0dd8\u0dda"+ + "\u0de1\u0df4\u0df5\u0e33\u0e33\u0e36\u0e3c\u0e49\u0e50\u0eb3\u0eb3\u0eb6"+ + "\u0ebb\u0ebd\u0ebe\u0eca\u0ecf\u0f1a\u0f1b\u0f37\u0f37\u0f39\u0f39\u0f3b"+ + "\u0f3b\u0f40\u0f41\u0f73\u0f86\u0f88\u0f89\u0f92\u0f99\u0f9b\u0fbe\u0fc8"+ + "\u0fc8\u102e\u1034\u1038\u103b\u1058\u105b\u17b6\u17d5\u18ab\u18ab\u20d2"+ + "\u20de\u20e3\u20e3\u302c\u3031\u309b\u309c\ufb20\ufb20\ufe22\ufe25\26"+ + "\2\62;\u0662\u066b\u06f2\u06fb\u0968\u0971\u09e8\u09f1\u0a68\u0a71\u0ae8"+ + "\u0af1\u0b68\u0b71\u0be9\u0bf1\u0c68\u0c71\u0ce8\u0cf1\u0d68\u0d71\u0e52"+ + "\u0e5b\u0ed2\u0edb\u0f22\u0f2b\u1042\u104b\u136b\u1373\u17e2\u17eb\u1812"+ + "\u181b\uff12\uff1b\t\2aa\u2041\u2042\u30fd\u30fd\ufe35\ufe36\ufe4f\ufe51"+ + "\uff41\uff41\uff67\uff67\b\2\f\f\17\17,,\61\61]^\u202a\u202b\7\2\f\f\17"+ + "\17\61\61]^\u202a\u202b\6\2\f\f\17\17^_\u202a\u202b\u04ae\2\3\3\2\2\2"+ + "\2\5\3\2\2\2\2\7\3\2\2\2\2\t\3\2\2\2\2\13\3\2\2\2\2\r\3\2\2\2\2\17\3\2"+ + "\2\2\2\21\3\2\2\2\2\23\3\2\2\2\2\25\3\2\2\2\2\27\3\2\2\2\2\31\3\2\2\2"+ + "\2\33\3\2\2\2\2\35\3\2\2\2\2\37\3\2\2\2\2!\3\2\2\2\2#\3\2\2\2\2%\3\2\2"+ + "\2\2\'\3\2\2\2\2)\3\2\2\2\2+\3\2\2\2\2-\3\2\2\2\2/\3\2\2\2\2\61\3\2\2"+ + "\2\2\63\3\2\2\2\2\65\3\2\2\2\2\67\3\2\2\2\29\3\2\2\2\2;\3\2\2\2\2=\3\2"+ + "\2\2\2?\3\2\2\2\2A\3\2\2\2\2C\3\2\2\2\2E\3\2\2\2\2G\3\2\2\2\2I\3\2\2\2"+ + "\2K\3\2\2\2\2M\3\2\2\2\2O\3\2\2\2\2Q\3\2\2\2\2S\3\2\2\2\2U\3\2\2\2\2W"+ + "\3\2\2\2\2Y\3\2\2\2\2[\3\2\2\2\2]\3\2\2\2\2_\3\2\2\2\2a\3\2\2\2\2c\3\2"+ + "\2\2\2e\3\2\2\2\2g\3\2\2\2\2i\3\2\2\2\2k\3\2\2\2\2m\3\2\2\2\2o\3\2\2\2"+ + "\2q\3\2\2\2\2s\3\2\2\2\2u\3\2\2\2\2w\3\2\2\2\2y\3\2\2\2\2{\3\2\2\2\2}"+ + "\3\2\2\2\2\177\3\2\2\2\2\u0081\3\2\2\2\2\u0083\3\2\2\2\2\u0085\3\2\2\2"+ + "\2\u0087\3\2\2\2\2\u0089\3\2\2\2\2\u008b\3\2\2\2\2\u008d\3\2\2\2\2\u008f"+ + "\3\2\2\2\2\u0091\3\2\2\2\2\u0093\3\2\2\2\2\u0095\3\2\2\2\2\u0097\3\2\2"+ + "\2\2\u0099\3\2\2\2\2\u009b\3\2\2\2\2\u009d\3\2\2\2\2\u009f\3\2\2\2\2\u00a1"+ + "\3\2\2\2\2\u00a3\3\2\2\2\2\u00a5\3\2\2\2\2\u00a7\3\2\2\2\2\u00a9\3\2\2"+ + "\2\2\u00ab\3\2\2\2\2\u00ad\3\2\2\2\2\u00af\3\2\2\2\2\u00b1\3\2\2\2\2\u00b3"+ + "\3\2\2\2\2\u00b5\3\2\2\2\2\u00b7\3\2\2\2\2\u00b9\3\2\2\2\2\u00bb\3\2\2"+ + "\2\2\u00bd\3\2\2\2\2\u00bf\3\2\2\2\2\u00c1\3\2\2\2\2\u00c3\3\2\2\2\2\u00c5"+ + "\3\2\2\2\2\u00c7\3\2\2\2\2\u00c9\3\2\2\2\2\u00cb\3\2\2\2\2\u00cd\3\2\2"+ + "\2\2\u00cf\3\2\2\2\2\u00d1\3\2\2\2\2\u00d3\3\2\2\2\2\u00d5\3\2\2\2\2\u00d7"+ + "\3\2\2\2\2\u00d9\3\2\2\2\2\u00db\3\2\2\2\2\u00dd\3\2\2\2\2\u00df\3\2\2"+ + "\2\2\u00e1\3\2\2\2\2\u00e3\3\2\2\2\2\u00e5\3\2\2\2\2\u00e7\3\2\2\2\2\u00e9"+ + "\3\2\2\2\2\u00eb\3\2\2\2\2\u00ed\3\2\2\2\2\u00ef\3\2\2\2\2\u00f1\3\2\2"+ + "\2\2\u00f3\3\2\2\2\2\u00f5\3\2\2\2\2\u00f7\3\2\2\2\2\u00f9\3\2\2\2\3\u012b"+ + "\3\2\2\2\5\u0135\3\2\2\2\7\u0143\3\2\2\2\t\u014e\3\2\2\2\13\u015e\3\2"+ + "\2\2\r\u0160\3\2\2\2\17\u0162\3\2\2\2\21\u0164\3\2\2\2\23\u0166\3\2\2"+ + "\2\25\u0169\3\2\2\2\27\u016c\3\2\2\2\31\u016e\3\2\2\2\33\u0170\3\2\2\2"+ + "\35\u0172\3\2\2\2\37\u0174\3\2\2\2!\u0176\3\2\2\2#\u017a\3\2\2\2%\u017c"+ + "\3\2\2\2\'\u017f\3\2\2\2)\u0182\3\2\2\2+\u0184\3\2\2\2-\u0186\3\2\2\2"+ + "/\u0188\3\2\2\2\61\u018a\3\2\2\2\63\u018c\3\2\2\2\65\u018e\3\2\2\2\67"+ + "\u0190\3\2\2\29\u0193\3\2\2\2;\u0196\3\2\2\2=\u0198\3\2\2\2?\u019b\3\2"+ + "\2\2A\u019e\3\2\2\2C\u01a2\3\2\2\2E\u01a4\3\2\2\2G\u01a6\3\2\2\2I\u01a9"+ + "\3\2\2\2K\u01ac\3\2\2\2M\u01af\3\2\2\2O\u01b2\3\2\2\2Q\u01b6\3\2\2\2S"+ + "\u01ba\3\2\2\2U\u01bc\3\2\2\2W\u01be\3\2\2\2Y\u01c0\3\2\2\2[\u01c3\3\2"+ + "\2\2]\u01c6\3\2\2\2_\u01c9\3\2\2\2a\u01cc\3\2\2\2c\u01cf\3\2\2\2e\u01d2"+ + "\3\2\2\2g\u01d5\3\2\2\2i\u01d9\3\2\2\2k\u01dd\3\2\2\2m\u01e2\3\2\2\2o"+ + "\u01e5\3\2\2\2q\u01e8\3\2\2\2s\u01eb\3\2\2\2u\u01ef\3\2\2\2w\u01f2\3\2"+ + "\2\2y\u0200\3\2\2\2{\u021d\3\2\2\2}\u021f\3\2\2\2\177\u0228\3\2\2\2\u0081"+ + "\u0230\3\2\2\2\u0083\u0239\3\2\2\2\u0085\u0242\3\2\2\2\u0087\u024d\3\2"+ + "\2\2\u0089\u0258\3\2\2\2\u008b\u0263\3\2\2\2\u008d\u0266\3\2\2\2\u008f"+ + "\u026c\3\2\2\2\u0091\u026f\3\2\2\2\u0093\u027a\3\2\2\2\u0095\u0281\3\2"+ + "\2\2\u0097\u0286\3\2\2\2\u0099\u028b\3\2\2\2\u009b\u028f\3\2\2\2\u009d"+ + "\u0293\3\2\2\2\u009f\u0299\3\2\2\2\u00a1\u02a1\3\2\2\2\u00a3\u02a8\3\2"+ + "\2\2\u00a5\u02ad\3\2\2\2\u00a7\u02b6\3\2\2\2\u00a9\u02ba\3\2\2\2\u00ab"+ + "\u02c1\3\2\2\2\u00ad\u02c7\3\2\2\2\u00af\u02d0\3\2\2\2\u00b1\u02d9\3\2"+ + "\2\2\u00b3\u02de\3\2\2\2\u00b5\u02e3\3\2\2\2\u00b7\u02eb\3\2\2\2\u00b9"+ + "\u02ee\3\2\2\2\u00bb\u02f4\3\2\2\2\u00bd\u02fb\3\2\2\2\u00bf\u02fe\3\2"+ + "\2\2\u00c1\u0302\3\2\2\2\u00c3\u0305\3\2\2\2\u00c5\u030a\3\2\2\2\u00c7"+ + "\u0310\3\2\2\2\u00c9\u0315\3\2\2\2\u00cb\u031d\3\2\2\2\u00cd\u0323\3\2"+ + "\2\2\u00cf\u0329\3\2\2\2\u00d1\u0330\3\2\2\2\u00d3\u0337\3\2\2\2\u00d5"+ + "\u033d\3\2\2\2\u00d7\u0343\3\2\2\2\u00d9\u0350\3\2\2\2\u00db\u0356\3\2"+ + "\2\2\u00dd\u035c\3\2\2\2\u00df\u0366\3\2\2\2\u00e1\u036f\3\2\2\2\u00e3"+ + "\u037b\3\2\2\2\u00e5\u0385\3\2\2\2\u00e7\u0391\3\2\2\2\u00e9\u039a\3\2"+ + "\2\2\u00eb\u03a2\3\2\2\2\u00ed\u03b9\3\2\2\2\u00ef\u03bd\3\2\2\2\u00f1"+ + "\u03c9\3\2\2\2\u00f3\u03cf\3\2\2\2\u00f5\u03d3\3\2\2\2\u00f7\u03e4\3\2"+ + "\2\2\u00f9\u03fa\3\2\2\2\u00fb\u0402\3\2\2\2\u00fd\u0408\3\2\2\2\u00ff"+ + "\u040f\3\2\2\2\u0101\u0413\3\2\2\2\u0103\u0415\3\2\2\2\u0105\u0429\3\2"+ + "\2\2\u0107\u042b\3\2\2\2\u0109\u0434\3\2\2\2\u010b\u0436\3\2\2\2\u010d"+ + "\u043a\3\2\2\2\u010f\u043c\3\2\2\2\u0111\u043f\3\2\2\2\u0113\u0449\3\2"+ + "\2\2\u0115\u044b\3\2\2\2\u0117\u0459\3\2\2\2\u0119\u045f\3\2\2\2\u011b"+ + "\u0462\3\2\2\2\u011d\u0465\3\2\2\2\u011f\u0468\3\2\2\2\u0121\u046b\3\2"+ + "\2\2\u0123\u0477\3\2\2\2\u0125\u0483\3\2\2\2\u0127\u0487\3\2\2\2\u0129"+ + "\u0489\3\2\2\2\u012b\u012c\6\2\2\2\u012c\u012d\7%\2\2\u012d\u012e\7#\2"+ + "\2\u012e\u0132\3\2\2\2\u012f\u0131\n\2\2\2\u0130\u012f\3\2\2\2\u0131\u0134"+ + "\3\2\2\2\u0132\u0130\3\2\2\2\u0132\u0133\3\2\2\2\u0133\4\3\2\2\2\u0134"+ + "\u0132\3\2\2\2\u0135\u0136\7\61\2\2\u0136\u0137\7,\2\2\u0137\u013b\3\2"+ + "\2\2\u0138\u013a\13\2\2\2\u0139\u0138\3\2\2\2\u013a\u013d\3\2\2\2\u013b"+ + "\u013c\3\2\2\2\u013b\u0139\3\2\2\2\u013c\u013e\3\2\2\2\u013d\u013b\3\2"+ + "\2\2\u013e\u013f\7,\2\2\u013f\u0140\7\61\2\2\u0140\u0141\3\2\2\2\u0141"+ + "\u0142\b\3\2\2\u0142\6\3\2\2\2\u0143\u0144\7\61\2\2\u0144\u0145\7\61\2"+ + "\2\u0145\u0149\3\2\2\2\u0146\u0148\n\2\2\2\u0147\u0146\3\2\2\2\u0148\u014b"+ + "\3\2\2\2\u0149\u0147\3\2\2\2\u0149\u014a\3\2\2\2\u014a\u014c\3\2\2\2\u014b"+ + "\u0149\3\2\2\2\u014c\u014d\b\4\2\2\u014d\b\3\2\2\2\u014e\u014f\7\61\2"+ + "\2\u014f\u0153\5\u0123\u0092\2\u0150\u0152\5\u0125\u0093\2\u0151\u0150"+ + "\3\2\2\2\u0152\u0155\3\2\2\2\u0153\u0151\3\2\2\2\u0153\u0154\3\2\2\2\u0154"+ + "\u0156\3\2\2\2\u0155\u0153\3\2\2\2\u0156\u0157\6\5\3\2\u0157\u015b\7\61"+ + "\2\2\u0158\u015a\5\u0117\u008c\2\u0159\u0158\3\2\2\2\u015a\u015d\3\2\2"+ + "\2\u015b\u0159\3\2\2\2\u015b\u015c\3\2\2\2\u015c\n\3\2\2\2\u015d\u015b"+ + "\3\2\2\2\u015e\u015f\7]\2\2\u015f\f\3\2\2\2\u0160\u0161\7_\2\2\u0161\16"+ + "\3\2\2\2\u0162\u0163\7*\2\2\u0163\20\3\2\2\2\u0164\u0165\7+\2\2\u0165"+ + "\22\3\2\2\2\u0166\u0167\7}\2\2\u0167\u0168\b\n\3\2\u0168\24\3\2\2\2\u0169"+ + "\u016a\7\177\2\2\u016a\u016b\b\13\4\2\u016b\26\3\2\2\2\u016c\u016d\7="+ + "\2\2\u016d\30\3\2\2\2\u016e\u016f\7.\2\2\u016f\32\3\2\2\2\u0170\u0171"+ + "\7?\2\2\u0171\34\3\2\2\2\u0172\u0173\7A\2\2\u0173\36\3\2\2\2\u0174\u0175"+ + "\7<\2\2\u0175 \3\2\2\2\u0176\u0177\7\60\2\2\u0177\u0178\7\60\2\2\u0178"+ + "\u0179\7\60\2\2\u0179\"\3\2\2\2\u017a\u017b\7\60\2\2\u017b$\3\2\2\2\u017c"+ + "\u017d\7-\2\2\u017d\u017e\7-\2\2\u017e&\3\2\2\2\u017f\u0180\7/\2\2\u0180"+ + "\u0181\7/\2\2\u0181(\3\2\2\2\u0182\u0183\7-\2\2\u0183*\3\2\2\2\u0184\u0185"+ + "\7/\2\2\u0185,\3\2\2\2\u0186\u0187\7\u0080\2\2\u0187.\3\2\2\2\u0188\u0189"+ + "\7#\2\2\u0189\60\3\2\2\2\u018a\u018b\7,\2\2\u018b\62\3\2\2\2\u018c\u018d"+ + "\7\61\2\2\u018d\64\3\2\2\2\u018e\u018f\7\'\2\2\u018f\66\3\2\2\2\u0190"+ + "\u0191\7,\2\2\u0191\u0192\7,\2\2\u01928\3\2\2\2\u0193\u0194\7A\2\2\u0194"+ + "\u0195\7A\2\2\u0195:\3\2\2\2\u0196\u0197\7%\2\2\u0197<\3\2\2\2\u0198\u0199"+ + "\7@\2\2\u0199\u019a\7@\2\2\u019a>\3\2\2\2\u019b\u019c\7>\2\2\u019c\u019d"+ + "\7>\2\2\u019d@\3\2\2\2\u019e\u019f\7@\2\2\u019f\u01a0\7@\2\2\u01a0\u01a1"+ + "\7@\2\2\u01a1B\3\2\2\2\u01a2\u01a3\7>\2\2\u01a3D\3\2\2\2\u01a4\u01a5\7"+ + "@\2\2\u01a5F\3\2\2\2\u01a6\u01a7\7>\2\2\u01a7\u01a8\7?\2\2\u01a8H\3\2"+ + "\2\2\u01a9\u01aa\7@\2\2\u01aa\u01ab\7?\2\2\u01abJ\3\2\2\2\u01ac\u01ad"+ + "\7?\2\2\u01ad\u01ae\7?\2\2\u01aeL\3\2\2\2\u01af\u01b0\7#\2\2\u01b0\u01b1"+ + "\7?\2\2\u01b1N\3\2\2\2\u01b2\u01b3\7?\2\2\u01b3\u01b4\7?\2\2\u01b4\u01b5"+ + "\7?\2\2\u01b5P\3\2\2\2\u01b6\u01b7\7#\2\2\u01b7\u01b8\7?\2\2\u01b8\u01b9"+ + "\7?\2\2\u01b9R\3\2\2\2\u01ba\u01bb\7(\2\2\u01bbT\3\2\2\2\u01bc\u01bd\7"+ + "`\2\2\u01bdV\3\2\2\2\u01be\u01bf\7~\2\2\u01bfX\3\2\2\2\u01c0\u01c1\7("+ + "\2\2\u01c1\u01c2\7(\2\2\u01c2Z\3\2\2\2\u01c3\u01c4\7~\2\2\u01c4\u01c5"+ + "\7~\2\2\u01c5\\\3\2\2\2\u01c6\u01c7\7,\2\2\u01c7\u01c8\7?\2\2\u01c8^\3"+ + "\2\2\2\u01c9\u01ca\7\61\2\2\u01ca\u01cb\7?\2\2\u01cb`\3\2\2\2\u01cc\u01cd"+ + "\7\'\2\2\u01cd\u01ce\7?\2\2\u01ceb\3\2\2\2\u01cf\u01d0\7-\2\2\u01d0\u01d1"+ + "\7?\2\2\u01d1d\3\2\2\2\u01d2\u01d3\7/\2\2\u01d3\u01d4\7?\2\2\u01d4f\3"+ + "\2\2\2\u01d5\u01d6\7>\2\2\u01d6\u01d7\7>\2\2\u01d7\u01d8\7?\2\2\u01d8"+ + "h\3\2\2\2\u01d9\u01da\7@\2\2\u01da\u01db\7@\2\2\u01db\u01dc\7?\2\2\u01dc"+ + "j\3\2\2\2\u01dd\u01de\7@\2\2\u01de\u01df\7@\2\2\u01df\u01e0\7@\2\2\u01e0"+ + "\u01e1\7?\2\2\u01e1l\3\2\2\2\u01e2\u01e3\7(\2\2\u01e3\u01e4\7?\2\2\u01e4"+ + "n\3\2\2\2\u01e5\u01e6\7`\2\2\u01e6\u01e7\7?\2\2\u01e7p\3\2\2\2\u01e8\u01e9"+ + "\7~\2\2\u01e9\u01ea\7?\2\2\u01ear\3\2\2\2\u01eb\u01ec\7,\2\2\u01ec\u01ed"+ + "\7,\2\2\u01ed\u01ee\7?\2\2\u01eet\3\2\2\2\u01ef\u01f0\7?\2\2\u01f0\u01f1"+ + "\7@\2\2\u01f1v\3\2\2\2\u01f2\u01f3\7p\2\2\u01f3\u01f4\7w\2\2\u01f4\u01f5"+ + "\7n\2\2\u01f5\u01f6\7n\2\2\u01f6x\3\2\2\2\u01f7\u01f8\7v\2\2\u01f8\u01f9"+ + "\7t\2\2\u01f9\u01fa\7w\2\2\u01fa\u0201\7g\2\2\u01fb\u01fc\7h\2\2\u01fc"+ + "\u01fd\7c\2\2\u01fd\u01fe\7n\2\2\u01fe\u01ff\7u\2\2\u01ff\u0201\7g\2\2"+ + "\u0200\u01f7\3\2\2\2\u0200\u01fb\3\2\2\2\u0201z\3\2\2\2\u0202\u0203\5"+ + "\u0113\u008a\2\u0203\u0204\7\60\2\2\u0204\u0208\t\3\2\2\u0205\u0207\t"+ + "\4\2\2\u0206\u0205\3\2\2\2\u0207\u020a\3\2\2\2\u0208\u0206\3\2\2\2\u0208"+ + "\u0209\3\2\2\2\u0209\u020c\3\2\2\2\u020a\u0208\3\2\2\2\u020b\u020d\5\u0115"+ + "\u008b\2\u020c\u020b\3\2\2\2\u020c\u020d\3\2\2\2\u020d\u021e\3\2\2\2\u020e"+ + "\u020f\7\60\2\2\u020f\u0213\t\3\2\2\u0210\u0212\t\4\2\2\u0211\u0210\3"+ + "\2\2\2\u0212\u0215\3\2\2\2\u0213\u0211\3\2\2\2\u0213\u0214\3\2\2\2\u0214"+ + "\u0217\3\2\2\2\u0215\u0213\3\2\2\2\u0216\u0218\5\u0115\u008b\2\u0217\u0216"+ + "\3\2\2\2\u0217\u0218\3\2\2\2\u0218\u021e\3\2\2\2\u0219\u021b\5\u0113\u008a"+ + "\2\u021a\u021c\5\u0115\u008b\2\u021b\u021a\3\2\2\2\u021b\u021c\3\2\2\2"+ + "\u021c\u021e\3\2\2\2\u021d\u0202\3\2\2\2\u021d\u020e\3\2\2\2\u021d\u0219"+ + "\3\2\2\2\u021e|\3\2\2\2\u021f\u0220\7\62\2\2\u0220\u0221\t\5\2\2\u0221"+ + "\u0225\t\6\2\2\u0222\u0224\5\u0111\u0089\2\u0223\u0222\3\2\2\2\u0224\u0227"+ + "\3\2\2\2\u0225\u0223\3\2\2\2\u0225\u0226\3\2\2\2\u0226~\3\2\2\2\u0227"+ + "\u0225\3\2\2\2\u0228\u022a\7\62\2\2\u0229\u022b\t\7\2\2\u022a\u0229\3"+ + "\2\2\2\u022b\u022c\3\2\2\2\u022c\u022a\3\2\2\2\u022c\u022d\3\2\2\2\u022d"+ + "\u022e\3\2\2\2\u022e\u022f\6@\4\2\u022f\u0080\3\2\2\2\u0230\u0231\7\62"+ + "\2\2\u0231\u0232\t\b\2\2\u0232\u0236\t\7\2\2\u0233\u0235\t\t\2\2\u0234"+ + "\u0233\3\2\2\2\u0235\u0238\3\2\2\2\u0236\u0234\3\2\2\2\u0236\u0237\3\2"+ + "\2\2\u0237\u0082\3\2\2\2\u0238\u0236\3\2\2\2\u0239\u023a\7\62\2\2\u023a"+ + "\u023b\t\n\2\2\u023b\u023f\t\13\2\2\u023c\u023e\t\f\2\2\u023d\u023c\3"+ + "\2\2\2\u023e\u0241\3\2\2\2\u023f\u023d\3\2\2\2\u023f\u0240\3\2\2\2\u0240"+ + "\u0084\3\2\2\2\u0241\u023f\3\2\2\2\u0242\u0243\7\62\2\2\u0243\u0244\t"+ + "\5\2\2\u0244\u0248\t\6\2\2\u0245\u0247\5\u0111\u0089\2\u0246\u0245\3\2"+ + "\2\2\u0247\u024a\3\2\2\2\u0248\u0246\3\2\2\2\u0248\u0249\3\2\2\2\u0249"+ + "\u024b\3\2\2\2\u024a\u0248\3\2\2\2\u024b\u024c\7p\2\2\u024c\u0086\3\2"+ + "\2\2\u024d\u024e\7\62\2\2\u024e\u024f\t\b\2\2\u024f\u0253\t\7\2\2\u0250"+ + "\u0252\t\t\2\2\u0251\u0250\3\2\2\2\u0252\u0255\3\2\2\2\u0253\u0251\3\2"+ + "\2\2\u0253\u0254\3\2\2\2\u0254\u0256\3\2\2\2\u0255\u0253\3\2\2\2\u0256"+ + "\u0257\7p\2\2\u0257\u0088\3\2\2\2\u0258\u0259\7\62\2\2\u0259\u025a\t\n"+ + "\2\2\u025a\u025e\t\13\2\2\u025b\u025d\t\f\2\2\u025c\u025b\3\2\2\2\u025d"+ + "\u0260\3\2\2\2\u025e\u025c\3\2\2\2\u025e\u025f\3\2\2\2\u025f\u0261\3\2"+ + "\2\2\u0260\u025e\3\2\2\2\u0261\u0262\7p\2\2\u0262\u008a\3\2\2\2\u0263"+ + "\u0264\5\u0113\u008a\2\u0264\u0265\7p\2\2\u0265\u008c\3\2\2\2\u0266\u0267"+ + "\7d\2\2\u0267\u0268\7t\2\2\u0268\u0269\7g\2\2\u0269\u026a\7c\2\2\u026a"+ + "\u026b\7m\2\2\u026b\u008e\3\2\2\2\u026c\u026d\7f\2\2\u026d\u026e\7q\2"+ + "\2\u026e\u0090\3\2\2\2\u026f\u0270\7k\2\2\u0270\u0271\7p\2\2\u0271\u0272"+ + "\7u\2\2\u0272\u0273\7v\2\2\u0273\u0274\7c\2\2\u0274\u0275\7p\2\2\u0275"+ + "\u0276\7e\2\2\u0276\u0277\7g\2\2\u0277\u0278\7q\2\2\u0278\u0279\7h\2\2"+ + "\u0279\u0092\3\2\2\2\u027a\u027b\7v\2\2\u027b\u027c\7{\2\2\u027c\u027d"+ + "\7r\2\2\u027d\u027e\7g\2\2\u027e\u027f\7q\2\2\u027f\u0280\7h\2\2\u0280"+ + "\u0094\3\2\2\2\u0281\u0282\7e\2\2\u0282\u0283\7c\2\2\u0283\u0284\7u\2"+ + "\2\u0284\u0285\7g\2\2\u0285\u0096\3\2\2\2\u0286\u0287\7g\2\2\u0287\u0288"+ + "\7n\2\2\u0288\u0289\7u\2\2\u0289\u028a\7g\2\2\u028a\u0098\3\2\2\2\u028b"+ + "\u028c\7p\2\2\u028c\u028d\7g\2\2\u028d\u028e\7y\2\2\u028e\u009a\3\2\2"+ + "\2\u028f\u0290\7x\2\2\u0290\u0291\7c\2\2\u0291\u0292\7t\2\2\u0292\u009c"+ + "\3\2\2\2\u0293\u0294\7e\2\2\u0294\u0295\7c\2\2\u0295\u0296\7v\2\2\u0296"+ + "\u0297\7e\2\2\u0297\u0298\7j\2\2\u0298\u009e\3\2\2\2\u0299\u029a\7h\2"+ + "\2\u029a\u029b\7k\2\2\u029b\u029c\7p\2\2\u029c\u029d\7c\2\2\u029d\u029e"+ + "\7n\2\2\u029e\u029f\7n\2\2\u029f\u02a0\7{\2\2\u02a0\u00a0\3\2\2\2\u02a1"+ + "\u02a2\7t\2\2\u02a2\u02a3\7g\2\2\u02a3\u02a4\7v\2\2\u02a4\u02a5\7w\2\2"+ + "\u02a5\u02a6\7t\2\2\u02a6\u02a7\7p\2\2\u02a7\u00a2\3\2\2\2\u02a8\u02a9"+ + "\7x\2\2\u02a9\u02aa\7q\2\2\u02aa\u02ab\7k\2\2\u02ab\u02ac\7f\2\2\u02ac"+ + "\u00a4\3\2\2\2\u02ad\u02ae\7e\2\2\u02ae\u02af\7q\2\2\u02af\u02b0\7p\2"+ + "\2\u02b0\u02b1\7v\2\2\u02b1\u02b2\7k\2\2\u02b2\u02b3\7p\2\2\u02b3\u02b4"+ + "\7w\2\2\u02b4\u02b5\7g\2\2\u02b5\u00a6\3\2\2\2\u02b6\u02b7\7h\2\2\u02b7"+ + "\u02b8\7q\2\2\u02b8\u02b9\7t\2\2\u02b9\u00a8\3\2\2\2\u02ba\u02bb\7u\2"+ + "\2\u02bb\u02bc\7y\2\2\u02bc\u02bd\7k\2\2\u02bd\u02be\7v\2\2\u02be\u02bf"+ + "\7e\2\2\u02bf\u02c0\7j\2\2\u02c0\u00aa\3\2\2\2\u02c1\u02c2\7y\2\2\u02c2"+ + "\u02c3\7j\2\2\u02c3\u02c4\7k\2\2\u02c4\u02c5\7n\2\2\u02c5\u02c6\7g\2\2"+ + "\u02c6\u00ac\3\2\2\2\u02c7\u02c8\7f\2\2\u02c8\u02c9\7g\2\2\u02c9\u02ca"+ + "\7d\2\2\u02ca\u02cb\7w\2\2\u02cb\u02cc\7i\2\2\u02cc\u02cd\7i\2\2\u02cd"+ + "\u02ce\7g\2\2\u02ce\u02cf\7t\2\2\u02cf\u00ae\3\2\2\2\u02d0\u02d1\7h\2"+ + "\2\u02d1\u02d2\7w\2\2\u02d2\u02d3\7p\2\2\u02d3\u02d4\7e\2\2\u02d4\u02d5"+ + "\7v\2\2\u02d5\u02d6\7k\2\2\u02d6\u02d7\7q\2\2\u02d7\u02d8\7p\2\2\u02d8"+ + "\u00b0\3\2\2\2\u02d9\u02da\7v\2\2\u02da\u02db\7j\2\2\u02db\u02dc\7k\2"+ + "\2\u02dc\u02dd\7u\2\2\u02dd\u00b2\3\2\2\2\u02de\u02df\7y\2\2\u02df\u02e0"+ + "\7k\2\2\u02e0\u02e1\7v\2\2\u02e1\u02e2\7j\2\2\u02e2\u00b4\3\2\2\2\u02e3"+ + "\u02e4\7f\2\2\u02e4\u02e5\7g\2\2\u02e5\u02e6\7h\2\2\u02e6\u02e7\7c\2\2"+ + "\u02e7\u02e8\7w\2\2\u02e8\u02e9\7n\2\2\u02e9\u02ea\7v\2\2\u02ea\u00b6"+ + "\3\2\2\2\u02eb\u02ec\7k\2\2\u02ec\u02ed\7h\2\2\u02ed\u00b8\3\2\2\2\u02ee"+ + "\u02ef\7v\2\2\u02ef\u02f0\7j\2\2\u02f0\u02f1\7t\2\2\u02f1\u02f2\7q\2\2"+ + "\u02f2\u02f3\7y\2\2\u02f3\u00ba\3\2\2\2\u02f4\u02f5\7f\2\2\u02f5\u02f6"+ + "\7g\2\2\u02f6\u02f7\7n\2\2\u02f7\u02f8\7g\2\2\u02f8\u02f9\7v\2\2\u02f9"+ + "\u02fa\7g\2\2\u02fa\u00bc\3\2\2\2\u02fb\u02fc\7k\2\2\u02fc\u02fd\7p\2"+ + "\2\u02fd\u00be\3\2\2\2\u02fe\u02ff\7v\2\2\u02ff\u0300\7t\2\2\u0300\u0301"+ + "\7{\2\2\u0301\u00c0\3\2\2\2\u0302\u0303\7c\2\2\u0303\u0304\7u\2\2\u0304"+ + "\u00c2\3\2\2\2\u0305\u0306\7h\2\2\u0306\u0307\7t\2\2\u0307\u0308\7q\2"+ + "\2\u0308\u0309\7o\2\2\u0309\u00c4\3\2\2\2\u030a\u030b\7e\2\2\u030b\u030c"+ + "\7n\2\2\u030c\u030d\7c\2\2\u030d\u030e\7u\2\2\u030e\u030f\7u\2\2\u030f"+ + "\u00c6\3\2\2\2\u0310\u0311\7g\2\2\u0311\u0312\7p\2\2\u0312\u0313\7w\2"+ + "\2\u0313\u0314\7o\2\2\u0314\u00c8\3\2\2\2\u0315\u0316\7g\2\2\u0316\u0317"+ + "\7z\2\2\u0317\u0318\7v\2\2\u0318\u0319\7g\2\2\u0319\u031a\7p\2\2\u031a"+ + "\u031b\7f\2\2\u031b\u031c\7u\2\2\u031c\u00ca\3\2\2\2\u031d\u031e\7u\2"+ + "\2\u031e\u031f\7w\2\2\u031f\u0320\7r\2\2\u0320\u0321\7g\2\2\u0321\u0322"+ + "\7t\2\2\u0322\u00cc\3\2\2\2\u0323\u0324\7e\2\2\u0324\u0325\7q\2\2\u0325"+ + "\u0326\7p\2\2\u0326\u0327\7u\2\2\u0327\u0328\7v\2\2\u0328\u00ce\3\2\2"+ + "\2\u0329\u032a\7g\2\2\u032a\u032b\7z\2\2\u032b\u032c\7r\2\2\u032c\u032d"+ + "\7q\2\2\u032d\u032e\7t\2\2\u032e\u032f\7v\2\2\u032f\u00d0\3\2\2\2\u0330"+ + "\u0331\7k\2\2\u0331\u0332\7o\2\2\u0332\u0333\7r\2\2\u0333\u0334\7q\2\2"+ + "\u0334\u0335\7t\2\2\u0335\u0336\7v\2\2\u0336\u00d2\3\2\2\2\u0337\u0338"+ + "\7c\2\2\u0338\u0339\7u\2\2\u0339\u033a\7{\2\2\u033a\u033b\7p\2\2\u033b"+ + "\u033c\7e\2\2\u033c\u00d4\3\2\2\2\u033d\u033e\7c\2\2\u033e\u033f\7y\2"+ + "\2\u033f\u0340\7c\2\2\u0340\u0341\7k\2\2\u0341\u0342\7v\2\2\u0342\u00d6"+ + "\3\2\2\2\u0343\u0344\7k\2\2\u0344\u0345\7o\2\2\u0345\u0346\7r\2\2\u0346"+ + "\u0347\7n\2\2\u0347\u0348\7g\2\2\u0348\u0349\7o\2\2\u0349\u034a\7g\2\2"+ + "\u034a\u034b\7p\2\2\u034b\u034c\7v\2\2\u034c\u034d\7u\2\2\u034d\u034e"+ + "\3\2\2\2\u034e\u034f\6l\5\2\u034f\u00d8\3\2\2\2\u0350\u0351\7n\2\2\u0351"+ + "\u0352\7g\2\2\u0352\u0353\7v\2\2\u0353\u0354\3\2\2\2\u0354\u0355\6m\6"+ + "\2\u0355\u00da\3\2\2\2\u0356\u0357\7n\2\2\u0357\u0358\7g\2\2\u0358\u0359"+ + "\7v\2\2\u0359\u035a\3\2\2\2\u035a\u035b\6n\7\2\u035b\u00dc\3\2\2\2\u035c"+ + "\u035d\7r\2\2\u035d\u035e\7t\2\2\u035e\u035f\7k\2\2\u035f\u0360\7x\2\2"+ + "\u0360\u0361\7c\2\2\u0361\u0362\7v\2\2\u0362\u0363\7g\2\2\u0363\u0364"+ + "\3\2\2\2\u0364\u0365\6o\b\2\u0365\u00de\3\2\2\2\u0366\u0367\7r\2\2\u0367"+ + "\u0368\7w\2\2\u0368\u0369\7d\2\2\u0369\u036a\7n\2\2\u036a\u036b\7k\2\2"+ + "\u036b\u036c\7e\2\2\u036c\u036d\3\2\2\2\u036d\u036e\6p\t\2\u036e\u00e0"+ + "\3\2\2\2\u036f\u0370\7k\2\2\u0370\u0371\7p\2\2\u0371\u0372\7v\2\2\u0372"+ + "\u0373\7g\2\2\u0373\u0374\7t\2\2\u0374\u0375\7h\2\2\u0375\u0376\7c\2\2"+ + "\u0376\u0377\7e\2\2\u0377\u0378\7g\2\2\u0378\u0379\3\2\2\2\u0379\u037a"+ + "\6q\n\2\u037a\u00e2\3\2\2\2\u037b\u037c\7r\2\2\u037c\u037d\7c\2\2\u037d"+ + "\u037e\7e\2\2\u037e\u037f\7m\2\2\u037f\u0380\7c\2\2\u0380\u0381\7i\2\2"+ + "\u0381\u0382\7g\2\2\u0382\u0383\3\2\2\2\u0383\u0384\6r\13\2\u0384\u00e4"+ + "\3\2\2\2\u0385\u0386\7r\2\2\u0386\u0387\7t\2\2\u0387\u0388\7q\2\2\u0388"+ + "\u0389\7v\2\2\u0389\u038a\7g\2\2\u038a\u038b\7e\2\2\u038b\u038c\7v\2\2"+ + "\u038c\u038d\7g\2\2\u038d\u038e\7f\2\2\u038e\u038f\3\2\2\2\u038f\u0390"+ + "\6s\f\2\u0390\u00e6\3\2\2\2\u0391\u0392\7u\2\2\u0392\u0393\7v\2\2\u0393"+ + "\u0394\7c\2\2\u0394\u0395\7v\2\2\u0395\u0396\7k\2\2\u0396\u0397\7e\2\2"+ + "\u0397\u0398\3\2\2\2\u0398\u0399\6t\r\2\u0399\u00e8\3\2\2\2\u039a\u039b"+ + "\7{\2\2\u039b\u039c\7k\2\2\u039c\u039d\7g\2\2\u039d\u039e\7n\2\2\u039e"+ + "\u039f\7f\2\2\u039f\u03a0\3\2\2\2\u03a0\u03a1\6u\16\2\u03a1\u00ea\3\2"+ + "\2\2\u03a2\u03a6\5\u0119\u008d\2\u03a3\u03a5\5\u0117\u008c\2\u03a4\u03a3"+ + "\3\2\2\2\u03a5\u03a8\3\2\2\2\u03a6\u03a4\3\2\2\2\u03a6\u03a7\3\2\2\2\u03a7"+ + "\u00ec\3\2\2\2\u03a8\u03a6\3\2\2\2\u03a9\u03ad\7$\2\2\u03aa\u03ac\5\u00fb"+ + "~\2\u03ab\u03aa\3\2\2\2\u03ac\u03af\3\2\2\2\u03ad\u03ab\3\2\2\2\u03ad"+ + "\u03ae\3\2\2\2\u03ae\u03b0\3\2\2\2\u03af\u03ad\3\2\2\2\u03b0\u03ba\7$"+ + "\2\2\u03b1\u03b5\7)\2\2\u03b2\u03b4\5\u00fd\177\2\u03b3\u03b2\3\2\2\2"+ + "\u03b4\u03b7\3\2\2\2\u03b5\u03b3\3\2\2\2\u03b5\u03b6\3\2\2\2\u03b6\u03b8"+ + "\3\2\2\2\u03b7\u03b5\3\2\2\2\u03b8\u03ba\7)\2\2\u03b9\u03a9\3\2\2\2\u03b9"+ + "\u03b1\3\2\2\2\u03ba\u03bb\3\2\2\2\u03bb\u03bc\bw\5\2\u03bc\u00ee\3\2"+ + "\2\2\u03bd\u03c3\7b\2\2\u03be\u03bf\7^\2\2\u03bf\u03c2\7b\2\2\u03c0\u03c2"+ + "\n\r\2\2\u03c1\u03be\3\2\2\2\u03c1\u03c0\3\2\2\2\u03c2\u03c5\3\2\2\2\u03c3"+ + "\u03c1\3\2\2\2\u03c3\u03c4\3\2\2\2\u03c4\u03c6\3\2\2\2\u03c5\u03c3\3\2"+ + "\2\2\u03c6\u03c7\7b\2\2\u03c7\u00f0\3\2\2\2\u03c8\u03ca\t\16\2\2\u03c9"+ + "\u03c8\3\2\2\2\u03ca\u03cb\3\2\2\2\u03cb\u03c9\3\2\2\2\u03cb\u03cc\3\2"+ + "\2\2\u03cc\u03cd\3\2\2\2\u03cd\u03ce\by\2\2\u03ce\u00f2\3\2\2\2\u03cf"+ + "\u03d0\t\2\2\2\u03d0\u03d1\3\2\2\2\u03d1\u03d2\bz\2\2\u03d2\u00f4\3\2"+ + "\2\2\u03d3\u03d4\7>\2\2\u03d4\u03d5\7#\2\2\u03d5\u03d6\7/\2\2\u03d6\u03d7"+ + "\7/\2\2\u03d7\u03db\3\2\2\2\u03d8\u03da\13\2\2\2\u03d9\u03d8\3\2\2\2\u03da"+ + "\u03dd\3\2\2\2\u03db\u03dc\3\2\2\2\u03db\u03d9\3\2\2\2\u03dc\u03de\3\2"+ + "\2\2\u03dd\u03db\3\2\2\2\u03de\u03df\7/\2\2\u03df\u03e0\7/\2\2\u03e0\u03e1"+ + "\7@\2\2\u03e1\u03e2\3\2\2\2\u03e2\u03e3\b{\2\2\u03e3\u00f6\3\2\2\2\u03e4"+ + "\u03e5\7>\2\2\u03e5\u03e6\7#\2\2\u03e6\u03e7\7]\2\2\u03e7\u03e8\7E\2\2"+ + "\u03e8\u03e9\7F\2\2\u03e9\u03ea\7C\2\2\u03ea\u03eb\7V\2\2\u03eb\u03ec"+ + "\7C\2\2\u03ec\u03ed\7]\2\2\u03ed\u03f1\3\2\2\2\u03ee\u03f0\13\2\2\2\u03ef"+ + "\u03ee\3\2\2\2\u03f0\u03f3\3\2\2\2\u03f1\u03f2\3\2\2\2\u03f1\u03ef\3\2"+ + "\2\2\u03f2\u03f4\3\2\2\2\u03f3\u03f1\3\2\2\2\u03f4\u03f5\7_\2\2\u03f5"+ + "\u03f6\7_\2\2\u03f6\u03f7\7@\2\2\u03f7\u03f8\3\2\2\2\u03f8\u03f9\b|\2"+ + "\2\u03f9\u00f8\3\2\2\2\u03fa\u03fb\13\2\2\2\u03fb\u03fc\3\2\2\2\u03fc"+ + "\u03fd\b}\6\2\u03fd\u00fa\3\2\2\2\u03fe\u0403\n\17\2\2\u03ff\u0400\7^"+ + "\2\2\u0400\u0403\5\u00ff\u0080\2\u0401\u0403\5\u010f\u0088\2\u0402\u03fe"+ + "\3\2\2\2\u0402\u03ff\3\2\2\2\u0402\u0401\3\2\2\2\u0403\u00fc\3\2\2\2\u0404"+ + "\u0409\n\20\2\2\u0405\u0406\7^\2\2\u0406\u0409\5\u00ff\u0080\2\u0407\u0409"+ + "\5\u010f\u0088\2\u0408\u0404\3\2\2\2\u0408\u0405\3\2\2\2\u0408\u0407\3"+ + "\2\2\2\u0409\u00fe\3\2\2\2\u040a\u0410\5\u0101\u0081\2\u040b\u0410\7\62"+ + "\2\2\u040c\u0410\5\u0103\u0082\2\u040d\u0410\5\u0105\u0083\2\u040e\u0410"+ + "\5\u0107\u0084\2\u040f\u040a\3\2\2\2\u040f\u040b\3\2\2\2\u040f\u040c\3"+ + "\2\2\2\u040f\u040d\3\2\2\2\u040f\u040e\3\2\2\2\u0410\u0100\3\2\2\2\u0411"+ + "\u0414\5\u0109\u0085\2\u0412\u0414\5\u010b\u0086\2\u0413\u0411\3\2\2\2"+ + "\u0413\u0412\3\2\2\2\u0414\u0102\3\2\2\2\u0415\u0416\7z\2\2\u0416\u0417"+ + "\5\u0111\u0089\2\u0417\u0418\5\u0111\u0089\2\u0418\u0104\3\2\2\2\u0419"+ + "\u041a\7w\2\2\u041a\u041b\5\u0111\u0089\2\u041b\u041c\5\u0111\u0089\2"+ + "\u041c\u041d\5\u0111\u0089\2\u041d\u041e\5\u0111\u0089\2\u041e\u042a\3"+ + "\2\2\2\u041f\u0420\7w\2\2\u0420\u0421\7}\2\2\u0421\u0423\5\u0111\u0089"+ + "\2\u0422\u0424\5\u0111\u0089\2\u0423\u0422\3\2\2\2\u0424\u0425\3\2\2\2"+ + "\u0425\u0423\3\2\2\2\u0425\u0426\3\2\2\2\u0426\u0427\3\2\2\2\u0427\u0428"+ + "\7\177\2\2\u0428\u042a\3\2\2\2\u0429\u0419\3\2\2\2\u0429\u041f\3\2\2\2"+ + "\u042a\u0106\3\2\2\2\u042b\u042c\7w\2\2\u042c\u042e\7}\2\2\u042d\u042f"+ + "\5\u0111\u0089\2\u042e\u042d\3\2\2\2\u042f\u0430\3\2\2\2\u0430\u042e\3"+ + "\2\2\2\u0430\u0431\3\2\2\2\u0431\u0432\3\2\2\2\u0432\u0433\7\177\2\2\u0433"+ + "\u0108\3\2\2\2\u0434\u0435\t\21\2\2\u0435\u010a\3\2\2\2\u0436\u0437\n"+ + "\22\2\2\u0437\u010c\3\2\2\2\u0438\u043b\5\u0109\u0085\2\u0439\u043b\t"+ + "\23\2\2\u043a\u0438\3\2\2\2\u043a\u0439\3\2\2\2\u043b\u010e\3\2\2\2\u043c"+ + "\u043d\7^\2\2\u043d\u043e\t\2\2\2\u043e\u0110\3\2\2\2\u043f\u0440\t\24"+ + "\2\2\u0440\u0112\3\2\2\2\u0441\u044a\7\62\2\2\u0442\u0446\t\25\2\2\u0443"+ + "\u0445\t\4\2\2\u0444\u0443\3\2\2\2\u0445\u0448\3\2\2\2\u0446\u0444\3\2"+ + "\2\2\u0446\u0447\3\2\2\2\u0447\u044a\3\2\2\2\u0448\u0446\3\2\2\2\u0449"+ + "\u0441\3\2\2\2\u0449\u0442\3\2\2\2\u044a\u0114\3\2\2\2\u044b\u044d\t\26"+ + "\2\2\u044c\u044e\t\27\2\2\u044d\u044c\3\2\2\2\u044d\u044e\3\2\2\2\u044e"+ + "\u0450\3\2\2\2\u044f\u0451\t\4\2\2\u0450\u044f\3\2\2\2\u0451\u0452\3\2"+ + "\2\2\u0452\u0450\3\2\2\2\u0452\u0453\3\2\2\2\u0453\u0116\3\2\2\2\u0454"+ + "\u045a\5\u0119\u008d\2\u0455\u045a\5\u011d\u008f\2\u0456\u045a\5\u011f"+ + "\u0090\2\u0457\u045a\5\u0121\u0091\2\u0458\u045a\4\u200e\u200f\2\u0459"+ + "\u0454\3\2\2\2\u0459\u0455\3\2\2\2\u0459\u0456\3\2\2\2\u0459\u0457\3\2"+ + "\2\2\u0459\u0458\3\2\2\2\u045a\u0118\3\2\2\2\u045b\u0460\5\u011b\u008e"+ + "\2\u045c\u0460\t\30\2\2\u045d\u045e\7^\2\2\u045e\u0460\5\u0105\u0083\2"+ + "\u045f\u045b\3\2\2\2\u045f\u045c\3\2\2\2\u045f\u045d\3\2\2\2\u0460\u011a"+ + "\3\2\2\2\u0461\u0463\t\31\2\2\u0462\u0461\3\2\2\2\u0463\u011c\3\2\2\2"+ + "\u0464\u0466\t\32\2\2\u0465\u0464\3\2\2\2\u0466\u011e\3\2\2\2\u0467\u0469"+ + "\t\33\2\2\u0468\u0467\3\2\2\2\u0469\u0120\3\2\2\2\u046a\u046c\t\34\2\2"+ + "\u046b\u046a\3\2\2\2\u046c\u0122\3\2\2\2\u046d\u0478\n\35\2\2\u046e\u0478"+ + "\5\u0129\u0095\2\u046f\u0473\7]\2\2\u0470\u0472\5\u0127\u0094\2\u0471"+ + "\u0470\3\2\2\2\u0472\u0475\3\2\2\2\u0473\u0471\3\2\2\2\u0473\u0474\3\2"+ + "\2\2\u0474\u0476\3\2\2\2\u0475\u0473\3\2\2\2\u0476\u0478\7_\2\2\u0477"+ + "\u046d\3\2\2\2\u0477\u046e\3\2\2\2\u0477\u046f\3\2\2\2\u0478\u0124\3\2"+ + "\2\2\u0479\u0484\n\36\2\2\u047a\u0484\5\u0129\u0095\2\u047b\u047f\7]\2"+ + "\2\u047c\u047e\5\u0127\u0094\2\u047d\u047c\3\2\2\2\u047e\u0481\3\2\2\2"+ + "\u047f\u047d\3\2\2\2\u047f\u0480\3\2\2\2\u0480\u0482\3\2\2\2\u0481\u047f"+ + "\3\2\2\2\u0482\u0484\7_\2\2\u0483\u0479\3\2\2\2\u0483\u047a\3\2\2\2\u0483"+ + "\u047b\3\2\2\2\u0484\u0126\3\2\2\2\u0485\u0488\n\37\2\2\u0486\u0488\5"+ + "\u0129\u0095\2\u0487\u0485\3\2\2\2\u0487\u0486\3\2\2\2\u0488\u0128\3\2"+ + "\2\2\u0489\u048a\7^\2\2\u048a\u048b\n\2\2\2\u048b\u012a\3\2\2\2\66\2\u0132"+ + "\u013b\u0149\u0153\u015b\u0200\u0208\u020c\u0213\u0217\u021b\u021d\u0225"+ + "\u022c\u0236\u023f\u0248\u0253\u025e\u03a6\u03ad\u03b5\u03b9\u03c1\u03c3"+ + "\u03cb\u03db\u03f1\u0402\u0408\u040f\u0413\u0425\u0429\u0430\u043a\u0446"+ + "\u0449\u044d\u0452\u0459\u045f\u0462\u0465\u0468\u046b\u0473\u0477\u047f"+ + "\u0483\u0487\7\2\3\2\3\n\2\3\13\3\3w\4\2\4\2"; + public static final ATN _ATN = + new ATNDeserializer().deserialize(_serializedATN.toCharArray()); + static { + _decisionToDFA = new DFA[_ATN.getNumberOfDecisions()]; + for (int i = 0; i < _ATN.getNumberOfDecisions(); i++) { + _decisionToDFA[i] = new DFA(_ATN.getDecisionState(i), i); + } + } +} \ No newline at end of file diff --git a/src/main/java/antlr/autogenerated/JavaScriptLexer.tokens b/src/main/java/antlr/autogenerated/JavaScriptLexer.tokens new file mode 100644 index 0000000..4d87a03 --- /dev/null +++ b/src/main/java/antlr/autogenerated/JavaScriptLexer.tokens @@ -0,0 +1,224 @@ +HashBangLine=1 +MultiLineComment=2 +SingleLineComment=3 +RegularExpressionLiteral=4 +OpenBracket=5 +CloseBracket=6 +OpenParen=7 +CloseParen=8 +OpenBrace=9 +CloseBrace=10 +SemiColon=11 +Comma=12 +Assign=13 +QuestionMark=14 +Colon=15 +Ellipsis=16 +Dot=17 +PlusPlus=18 +MinusMinus=19 +Plus=20 +Minus=21 +BitNot=22 +Not=23 +Multiply=24 +Divide=25 +Modulus=26 +Power=27 +NullCoalesce=28 +Hashtag=29 +RightShiftArithmetic=30 +LeftShiftArithmetic=31 +RightShiftLogical=32 +LessThan=33 +MoreThan=34 +LessThanEquals=35 +GreaterThanEquals=36 +Equals_=37 +NotEquals=38 +IdentityEquals=39 +IdentityNotEquals=40 +BitAnd=41 +BitXOr=42 +BitOr=43 +And=44 +Or=45 +MultiplyAssign=46 +DivideAssign=47 +ModulusAssign=48 +PlusAssign=49 +MinusAssign=50 +LeftShiftArithmeticAssign=51 +RightShiftArithmeticAssign=52 +RightShiftLogicalAssign=53 +BitAndAssign=54 +BitXorAssign=55 +BitOrAssign=56 +PowerAssign=57 +ARROW=58 +NullLiteral=59 +BooleanLiteral=60 +DecimalLiteral=61 +HexIntegerLiteral=62 +OctalIntegerLiteral=63 +OctalIntegerLiteral2=64 +BinaryIntegerLiteral=65 +BigHexIntegerLiteral=66 +BigOctalIntegerLiteral=67 +BigBinaryIntegerLiteral=68 +BigDecimalIntegerLiteral=69 +Break=70 +Do=71 +Instanceof=72 +Typeof=73 +Case=74 +Else=75 +New=76 +Var=77 +Catch=78 +Finally=79 +Return=80 +Void=81 +Continue=82 +For=83 +Switch=84 +While=85 +Debugger=86 +Function=87 +This=88 +With=89 +Default=90 +If=91 +Throw=92 +Delete=93 +In=94 +Try=95 +As=96 +From=97 +Class=98 +Enum=99 +Extends=100 +Super=101 +Const=102 +Export=103 +Import=104 +Async=105 +Await=106 +Implements=107 +StrictLet=108 +NonStrictLet=109 +Private=110 +Public=111 +Interface=112 +Package=113 +Protected=114 +Static=115 +Yield=116 +Identifier=117 +StringLiteral=118 +TemplateStringLiteral=119 +WhiteSpaces=120 +LineTerminator=121 +HtmlComment=122 +CDataComment=123 +UnexpectedCharacter=124 +'['=5 +']'=6 +'('=7 +')'=8 +'{'=9 +'}'=10 +';'=11 +','=12 +'='=13 +'?'=14 +':'=15 +'...'=16 +'.'=17 +'++'=18 +'--'=19 +'+'=20 +'-'=21 +'~'=22 +'!'=23 +'*'=24 +'/'=25 +'%'=26 +'**'=27 +'??'=28 +'#'=29 +'>>'=30 +'<<'=31 +'>>>'=32 +'<'=33 +'>'=34 +'<='=35 +'>='=36 +'=='=37 +'!='=38 +'==='=39 +'!=='=40 +'&'=41 +'^'=42 +'|'=43 +'&&'=44 +'||'=45 +'*='=46 +'/='=47 +'%='=48 +'+='=49 +'-='=50 +'<<='=51 +'>>='=52 +'>>>='=53 +'&='=54 +'^='=55 +'|='=56 +'**='=57 +'=>'=58 +'null'=59 +'break'=70 +'do'=71 +'instanceof'=72 +'typeof'=73 +'case'=74 +'else'=75 +'new'=76 +'var'=77 +'catch'=78 +'finally'=79 +'return'=80 +'void'=81 +'continue'=82 +'for'=83 +'switch'=84 +'while'=85 +'debugger'=86 +'function'=87 +'this'=88 +'with'=89 +'default'=90 +'if'=91 +'throw'=92 +'delete'=93 +'in'=94 +'try'=95 +'as'=96 +'from'=97 +'class'=98 +'enum'=99 +'extends'=100 +'super'=101 +'const'=102 +'export'=103 +'import'=104 +'async'=105 +'await'=106 +'implements'=107 +'private'=110 +'public'=111 +'interface'=112 +'package'=113 +'protected'=114 +'static'=115 +'yield'=116 diff --git a/src/main/java/antlr/autogenerated/JavaScriptLexerBase.java b/src/main/java/antlr/autogenerated/JavaScriptLexerBase.java new file mode 100644 index 0000000..b1da687 --- /dev/null +++ b/src/main/java/antlr/autogenerated/JavaScriptLexerBase.java @@ -0,0 +1,132 @@ +package antlr.autogenerated; + +import org.antlr.v4.runtime.CharStream; +import org.antlr.v4.runtime.Lexer; +import org.antlr.v4.runtime.Token; + +import java.util.Stack; + +/** + * All lexer methods that used in grammar (IsStrictMode) + * should start with Upper Case Char similar to Lexer rules. + */ +public abstract class JavaScriptLexerBase extends Lexer +{ + /** + * Stores values of nested modes. By default mode is strict or + * defined externally (useStrictDefault) + */ + private final Stack scopeStrictModes = new Stack(); + + private Token lastToken = null; + /** + * Default value of strict mode + * Can be defined externally by setUseStrictDefault + */ + private boolean useStrictDefault = false; + /** + * Current value of strict mode + * Can be defined during parsing, see StringFunctions.js and StringGlobal.js samples + */ + private boolean useStrictCurrent = false; + + public JavaScriptLexerBase(CharStream input) { + super(input); + } + + public boolean IsStartOfFile() { + return lastToken == null; + } + + public boolean getStrictDefault() { + return useStrictDefault; + } + + public void setUseStrictDefault(boolean value) { + useStrictDefault = value; + useStrictCurrent = value; + } + + public boolean IsStrictMode() { + return useStrictCurrent; + } + + /** + * Return the next token from the character stream and records this last + * token in case it resides on the default channel. This recorded token + * is used to determine when the lexer could possibly match a regex + * literal. Also changes scopeStrictModes stack if tokenize special + * string 'use strict'; + * + * @return the next token from the character stream. + */ + @Override + public Token nextToken() { + Token next = super.nextToken(); + + if (next.getChannel() == Token.DEFAULT_CHANNEL) { + // Keep track of the last token on the default channel. + this.lastToken = next; + } + + return next; + } + + protected void ProcessOpenBrace() + { + useStrictCurrent = scopeStrictModes.size() > 0 && scopeStrictModes.peek() || useStrictDefault; + scopeStrictModes.push(useStrictCurrent); + } + + protected void ProcessCloseBrace() + { + useStrictCurrent = scopeStrictModes.size() > 0 ? scopeStrictModes.pop() : useStrictDefault; + } + + protected void ProcessStringLiteral() + { + if (lastToken == null || lastToken.getType() == JavaScriptLexer.OpenBrace) + { + String text = getText(); + if (text.equals("\"use strict\"") || text.equals("'use strict'")) + { + if (scopeStrictModes.size() > 0) + scopeStrictModes.pop(); + useStrictCurrent = true; + scopeStrictModes.push(useStrictCurrent); + } + } + } + + /** + * Returns {@code true} if the lexer can match a regex literal. + */ + protected boolean IsRegexPossible() { + + if (this.lastToken == null) { + // No token has been produced yet: at the start of the input, + // no division is possible, so a regex literal _is_ possible. + return true; + } + + switch (this.lastToken.getType()) { + case JavaScriptLexer.Identifier: + case JavaScriptLexer.NullLiteral: + case JavaScriptLexer.BooleanLiteral: + case JavaScriptLexer.This: + case JavaScriptLexer.CloseBracket: + case JavaScriptLexer.CloseParen: + case JavaScriptLexer.OctalIntegerLiteral: + case JavaScriptLexer.DecimalLiteral: + case JavaScriptLexer.HexIntegerLiteral: + case JavaScriptLexer.StringLiteral: + case JavaScriptLexer.PlusPlus: + case JavaScriptLexer.MinusMinus: + // After any of the tokens above, no regex literal can follow. + return false; + default: + // In all other cases, a regex literal _is_ possible. + return true; + } + } +} diff --git a/src/main/java/antlr/autogenerated/JavaScriptParser.java b/src/main/java/antlr/autogenerated/JavaScriptParser.java new file mode 100644 index 0000000..6b84b6e --- /dev/null +++ b/src/main/java/antlr/autogenerated/JavaScriptParser.java @@ -0,0 +1,8819 @@ +package antlr.autogenerated; + +// Generated from JavaScriptParserUsedForParserCreation by ANTLR 4.5 +import org.antlr.v4.runtime.atn.*; +import org.antlr.v4.runtime.dfa.DFA; +import org.antlr.v4.runtime.*; +import org.antlr.v4.runtime.tree.*; +import java.util.List; + +@SuppressWarnings({"all", "warnings", "unchecked", "unused", "cast"}) +public class JavaScriptParser extends JavaScriptParserBase { + static { RuntimeMetaData.checkVersion("4.5", RuntimeMetaData.VERSION); } + + protected static final DFA[] _decisionToDFA; + protected static final PredictionContextCache _sharedContextCache = + new PredictionContextCache(); + public static final int + HashBangLine=1, MultiLineComment=2, SingleLineComment=3, RegularExpressionLiteral=4, + OpenBracket=5, CloseBracket=6, OpenParen=7, CloseParen=8, OpenBrace=9, + CloseBrace=10, SemiColon=11, Comma=12, Assign=13, QuestionMark=14, Colon=15, + Ellipsis=16, Dot=17, PlusPlus=18, MinusMinus=19, Plus=20, Minus=21, BitNot=22, + Not=23, Multiply=24, Divide=25, Modulus=26, Power=27, NullCoalesce=28, + Hashtag=29, RightShiftArithmetic=30, LeftShiftArithmetic=31, RightShiftLogical=32, + LessThan=33, MoreThan=34, LessThanEquals=35, GreaterThanEquals=36, Equals_=37, + NotEquals=38, IdentityEquals=39, IdentityNotEquals=40, BitAnd=41, BitXOr=42, + BitOr=43, And=44, Or=45, MultiplyAssign=46, DivideAssign=47, ModulusAssign=48, + PlusAssign=49, MinusAssign=50, LeftShiftArithmeticAssign=51, RightShiftArithmeticAssign=52, + RightShiftLogicalAssign=53, BitAndAssign=54, BitXorAssign=55, BitOrAssign=56, + PowerAssign=57, ARROW=58, NullLiteral=59, BooleanLiteral=60, DecimalLiteral=61, + HexIntegerLiteral=62, OctalIntegerLiteral=63, OctalIntegerLiteral2=64, + BinaryIntegerLiteral=65, BigHexIntegerLiteral=66, BigOctalIntegerLiteral=67, + BigBinaryIntegerLiteral=68, BigDecimalIntegerLiteral=69, Break=70, Do=71, + Instanceof=72, Typeof=73, Case=74, Else=75, New=76, Var=77, Catch=78, + Finally=79, Return=80, Void=81, Continue=82, For=83, Switch=84, While=85, + Debugger=86, Function=87, This=88, With=89, Default=90, If=91, Throw=92, + Delete=93, In=94, Try=95, As=96, From=97, Class=98, Enum=99, Extends=100, + Super=101, Const=102, Export=103, Import=104, Async=105, Await=106, Implements=107, + StrictLet=108, NonStrictLet=109, Private=110, Public=111, Interface=112, + Package=113, Protected=114, Static=115, Yield=116, Identifier=117, StringLiteral=118, + TemplateStringLiteral=119, WhiteSpaces=120, LineTerminator=121, HtmlComment=122, + CDataComment=123, UnexpectedCharacter=124; + public static final int + RULE_program = 0, RULE_sourceElement = 1, RULE_statement = 2, RULE_block = 3, + RULE_statementList = 4, RULE_importStatement = 5, RULE_importFromBlock = 6, + RULE_moduleItems = 7, RULE_importDefault = 8, RULE_importNamespace = 9, + RULE_importFrom = 10, RULE_aliasName = 11, RULE_exportStatement = 12, + RULE_exportFromBlock = 13, RULE_declaration = 14, RULE_variableStatement = 15, + RULE_variableDeclarationList = 16, RULE_variableDeclaration = 17, RULE_emptyStatement = 18, + RULE_expressionStatement = 19, RULE_ifStatement = 20, RULE_iterationStatement = 21, + RULE_varModifier = 22, RULE_continueStatement = 23, RULE_breakStatement = 24, + RULE_returnStatement = 25, RULE_yieldStatement = 26, RULE_withStatement = 27, + RULE_switchStatement = 28, RULE_caseBlock = 29, RULE_caseClauses = 30, + RULE_caseClause = 31, RULE_defaultClause = 32, RULE_labelledStatement = 33, + RULE_throwStatement = 34, RULE_tryStatement = 35, RULE_catchProduction = 36, + RULE_finallyProduction = 37, RULE_debuggerStatement = 38, RULE_functionDeclaration = 39, + RULE_classDeclaration = 40, RULE_classTail = 41, RULE_classElement = 42, + RULE_methodDefinition = 43, RULE_formalParameterList = 44, RULE_formalParameterArg = 45, + RULE_lastFormalParameterArg = 46, RULE_functionBody = 47, RULE_sourceElements = 48, + RULE_arrayLiteral = 49, RULE_elementList = 50, RULE_arrayElement = 51, + RULE_propertyAssignment = 52, RULE_propertyName = 53, RULE_arguments = 54, + RULE_argument = 55, RULE_expressionSequence = 56, RULE_singleExpression = 57, + RULE_assignable = 58, RULE_objectLiteral = 59, RULE_anoymousFunction = 60, + RULE_arrowFunctionParameters = 61, RULE_arrowFunctionBody = 62, RULE_assignmentOperator = 63, + RULE_literal = 64, RULE_numericLiteral = 65, RULE_bigintLiteral = 66, + RULE_getter = 67, RULE_setter = 68, RULE_identifierName = 69, RULE_identifier = 70, + RULE_reservedWord = 71, RULE_keyword = 72, RULE_let = 73, RULE_eos = 74; + public static final String[] ruleNames = { + "program", "sourceElement", "statement", "block", "statementList", "importStatement", + "importFromBlock", "moduleItems", "importDefault", "importNamespace", + "importFrom", "aliasName", "exportStatement", "exportFromBlock", "declaration", + "variableStatement", "variableDeclarationList", "variableDeclaration", + "emptyStatement", "expressionStatement", "ifStatement", "iterationStatement", + "varModifier", "continueStatement", "breakStatement", "returnStatement", + "yieldStatement", "withStatement", "switchStatement", "caseBlock", "caseClauses", + "caseClause", "defaultClause", "labelledStatement", "throwStatement", + "tryStatement", "catchProduction", "finallyProduction", "debuggerStatement", + "functionDeclaration", "classDeclaration", "classTail", "classElement", + "methodDefinition", "formalParameterList", "formalParameterArg", "lastFormalParameterArg", + "functionBody", "sourceElements", "arrayLiteral", "elementList", "arrayElement", + "propertyAssignment", "propertyName", "arguments", "argument", "expressionSequence", + "singleExpression", "assignable", "objectLiteral", "anoymousFunction", + "arrowFunctionParameters", "arrowFunctionBody", "assignmentOperator", + "literal", "numericLiteral", "bigintLiteral", "getter", "setter", "identifierName", + "identifier", "reservedWord", "keyword", "let", "eos" + }; + + private static final String[] _LITERAL_NAMES = { + null, null, null, null, null, "'['", "']'", "'('", "')'", "'{'", "'}'", + "';'", "','", "'='", "'?'", "':'", "'...'", "'.'", "'++'", "'--'", "'+'", + "'-'", "'~'", "'!'", "'*'", "'/'", "'%'", "'**'", "'??'", "'#'", "'>>'", + "'<<'", "'>>>'", "'<'", "'>'", "'<='", "'>='", "'=='", "'!='", "'==='", + "'!=='", "'&'", "'^'", "'|'", "'&&'", "'||'", "'*='", "'/='", "'%='", + "'+='", "'-='", "'<<='", "'>>='", "'>>>='", "'&='", "'^='", "'|='", "'**='", + "'=>'", "'null'", null, null, null, null, null, null, null, null, null, + null, "'break'", "'do'", "'instanceof'", "'typeof'", "'case'", "'else'", + "'new'", "'var'", "'catch'", "'finally'", "'return'", "'void'", "'continue'", + "'for'", "'switch'", "'while'", "'debugger'", "'function'", "'this'", + "'with'", "'default'", "'if'", "'throw'", "'delete'", "'in'", "'try'", + "'as'", "'from'", "'class'", "'enum'", "'extends'", "'super'", "'const'", + "'export'", "'import'", "'async'", "'await'", "'implements'", null, null, + "'private'", "'public'", "'interface'", "'package'", "'protected'", "'static'", + "'yield'" + }; + private static final String[] _SYMBOLIC_NAMES = { + null, "HashBangLine", "MultiLineComment", "SingleLineComment", "RegularExpressionLiteral", + "OpenBracket", "CloseBracket", "OpenParen", "CloseParen", "OpenBrace", + "CloseBrace", "SemiColon", "Comma", "Assign", "QuestionMark", "Colon", + "Ellipsis", "Dot", "PlusPlus", "MinusMinus", "Plus", "Minus", "BitNot", + "Not", "Multiply", "Divide", "Modulus", "Power", "NullCoalesce", "Hashtag", + "RightShiftArithmetic", "LeftShiftArithmetic", "RightShiftLogical", "LessThan", + "MoreThan", "LessThanEquals", "GreaterThanEquals", "Equals_", "NotEquals", + "IdentityEquals", "IdentityNotEquals", "BitAnd", "BitXOr", "BitOr", "And", + "Or", "MultiplyAssign", "DivideAssign", "ModulusAssign", "PlusAssign", + "MinusAssign", "LeftShiftArithmeticAssign", "RightShiftArithmeticAssign", + "RightShiftLogicalAssign", "BitAndAssign", "BitXorAssign", "BitOrAssign", + "PowerAssign", "ARROW", "NullLiteral", "BooleanLiteral", "DecimalLiteral", + "HexIntegerLiteral", "OctalIntegerLiteral", "OctalIntegerLiteral2", "BinaryIntegerLiteral", + "BigHexIntegerLiteral", "BigOctalIntegerLiteral", "BigBinaryIntegerLiteral", + "BigDecimalIntegerLiteral", "Break", "Do", "Instanceof", "Typeof", "Case", + "Else", "New", "Var", "Catch", "Finally", "Return", "Void", "Continue", + "For", "Switch", "While", "Debugger", "Function", "This", "With", "Default", + "If", "Throw", "Delete", "In", "Try", "As", "From", "Class", "Enum", "Extends", + "Super", "Const", "Export", "Import", "Async", "Await", "Implements", + "StrictLet", "NonStrictLet", "Private", "Public", "Interface", "Package", + "Protected", "Static", "Yield", "Identifier", "StringLiteral", "TemplateStringLiteral", + "WhiteSpaces", "LineTerminator", "HtmlComment", "CDataComment", "UnexpectedCharacter" + }; + public static final Vocabulary VOCABULARY = new VocabularyImpl(_LITERAL_NAMES, _SYMBOLIC_NAMES); + + /** + * @deprecated Use {@link #VOCABULARY} instead. + */ + @Deprecated + public static final String[] tokenNames; + static { + tokenNames = new String[_SYMBOLIC_NAMES.length]; + for (int i = 0; i < tokenNames.length; i++) { + tokenNames[i] = VOCABULARY.getLiteralName(i); + if (tokenNames[i] == null) { + tokenNames[i] = VOCABULARY.getSymbolicName(i); + } + + if (tokenNames[i] == null) { + tokenNames[i] = ""; + } + } + } + + @Override + @Deprecated + public String[] getTokenNames() { + return tokenNames; + } + + @Override + + public Vocabulary getVocabulary() { + return VOCABULARY; + } + + @Override + public String getGrammarFileName() { return "JavaScriptParserUsedForParserCreation"; } + + @Override + public String[] getRuleNames() { return ruleNames; } + + @Override + public String getSerializedATN() { return _serializedATN; } + + @Override + public ATN getATN() { return _ATN; } + + public JavaScriptParser(TokenStream input) { + super(input); + _interp = new ParserATNSimulator(this,_ATN,_decisionToDFA,_sharedContextCache); + } + public static class ProgramContext extends ParserRuleContext { + public TerminalNode EOF() { return getToken(JavaScriptParser.EOF, 0); } + public TerminalNode HashBangLine() { return getToken(JavaScriptParser.HashBangLine, 0); } + public SourceElementsContext sourceElements() { + return getRuleContext(SourceElementsContext.class,0); + } + public ProgramContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_program; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).enterProgram(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).exitProgram(this); + } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof JavaScriptParserVisitor ) return ((JavaScriptParserVisitor)visitor).visitProgram(this); + else return visitor.visitChildren(this); + } + } + + public final ProgramContext program() throws RecognitionException { + ProgramContext _localctx = new ProgramContext(_ctx, getState()); + enterRule(_localctx, 0, RULE_program); + try { + enterOuterAlt(_localctx, 1); + { + setState(151); + switch ( getInterpreter().adaptivePredict(_input,0,_ctx) ) { + case 1: + { + setState(150); + match(HashBangLine); + } + break; + } + setState(154); + switch ( getInterpreter().adaptivePredict(_input,1,_ctx) ) { + case 1: + { + setState(153); + sourceElements(); + } + break; + } + setState(156); + match(EOF); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class SourceElementContext extends ParserRuleContext { + public StatementContext statement() { + return getRuleContext(StatementContext.class,0); + } + public SourceElementContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_sourceElement; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).enterSourceElement(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).exitSourceElement(this); + } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof JavaScriptParserVisitor ) return ((JavaScriptParserVisitor)visitor).visitSourceElement(this); + else return visitor.visitChildren(this); + } + } + + public final SourceElementContext sourceElement() throws RecognitionException { + SourceElementContext _localctx = new SourceElementContext(_ctx, getState()); + enterRule(_localctx, 2, RULE_sourceElement); + try { + enterOuterAlt(_localctx, 1); + { + setState(158); + statement(); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class StatementContext extends ParserRuleContext { + public BlockContext block() { + return getRuleContext(BlockContext.class,0); + } + public VariableStatementContext variableStatement() { + return getRuleContext(VariableStatementContext.class,0); + } + public ImportStatementContext importStatement() { + return getRuleContext(ImportStatementContext.class,0); + } + public ExportStatementContext exportStatement() { + return getRuleContext(ExportStatementContext.class,0); + } + public EmptyStatementContext emptyStatement() { + return getRuleContext(EmptyStatementContext.class,0); + } + public ClassDeclarationContext classDeclaration() { + return getRuleContext(ClassDeclarationContext.class,0); + } + public ExpressionStatementContext expressionStatement() { + return getRuleContext(ExpressionStatementContext.class,0); + } + public IfStatementContext ifStatement() { + return getRuleContext(IfStatementContext.class,0); + } + public IterationStatementContext iterationStatement() { + return getRuleContext(IterationStatementContext.class,0); + } + public ContinueStatementContext continueStatement() { + return getRuleContext(ContinueStatementContext.class,0); + } + public BreakStatementContext breakStatement() { + return getRuleContext(BreakStatementContext.class,0); + } + public ReturnStatementContext returnStatement() { + return getRuleContext(ReturnStatementContext.class,0); + } + public YieldStatementContext yieldStatement() { + return getRuleContext(YieldStatementContext.class,0); + } + public WithStatementContext withStatement() { + return getRuleContext(WithStatementContext.class,0); + } + public LabelledStatementContext labelledStatement() { + return getRuleContext(LabelledStatementContext.class,0); + } + public SwitchStatementContext switchStatement() { + return getRuleContext(SwitchStatementContext.class,0); + } + public ThrowStatementContext throwStatement() { + return getRuleContext(ThrowStatementContext.class,0); + } + public TryStatementContext tryStatement() { + return getRuleContext(TryStatementContext.class,0); + } + public DebuggerStatementContext debuggerStatement() { + return getRuleContext(DebuggerStatementContext.class,0); + } + public FunctionDeclarationContext functionDeclaration() { + return getRuleContext(FunctionDeclarationContext.class,0); + } + public StatementContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_statement; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).enterStatement(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).exitStatement(this); + } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof JavaScriptParserVisitor ) return ((JavaScriptParserVisitor)visitor).visitStatement(this); + else return visitor.visitChildren(this); + } + } + + public final StatementContext statement() throws RecognitionException { + StatementContext _localctx = new StatementContext(_ctx, getState()); + enterRule(_localctx, 4, RULE_statement); + try { + setState(180); + switch ( getInterpreter().adaptivePredict(_input,2,_ctx) ) { + case 1: + enterOuterAlt(_localctx, 1); + { + setState(160); + block(); + } + break; + case 2: + enterOuterAlt(_localctx, 2); + { + setState(161); + variableStatement(); + } + break; + case 3: + enterOuterAlt(_localctx, 3); + { + setState(162); + importStatement(); + } + break; + case 4: + enterOuterAlt(_localctx, 4); + { + setState(163); + exportStatement(); + } + break; + case 5: + enterOuterAlt(_localctx, 5); + { + setState(164); + emptyStatement(); + } + break; + case 6: + enterOuterAlt(_localctx, 6); + { + setState(165); + classDeclaration(); + } + break; + case 7: + enterOuterAlt(_localctx, 7); + { + setState(166); + expressionStatement(); + } + break; + case 8: + enterOuterAlt(_localctx, 8); + { + setState(167); + ifStatement(); + } + break; + case 9: + enterOuterAlt(_localctx, 9); + { + setState(168); + iterationStatement(); + } + break; + case 10: + enterOuterAlt(_localctx, 10); + { + setState(169); + continueStatement(); + } + break; + case 11: + enterOuterAlt(_localctx, 11); + { + setState(170); + breakStatement(); + } + break; + case 12: + enterOuterAlt(_localctx, 12); + { + setState(171); + returnStatement(); + } + break; + case 13: + enterOuterAlt(_localctx, 13); + { + setState(172); + yieldStatement(); + } + break; + case 14: + enterOuterAlt(_localctx, 14); + { + setState(173); + withStatement(); + } + break; + case 15: + enterOuterAlt(_localctx, 15); + { + setState(174); + labelledStatement(); + } + break; + case 16: + enterOuterAlt(_localctx, 16); + { + setState(175); + switchStatement(); + } + break; + case 17: + enterOuterAlt(_localctx, 17); + { + setState(176); + throwStatement(); + } + break; + case 18: + enterOuterAlt(_localctx, 18); + { + setState(177); + tryStatement(); + } + break; + case 19: + enterOuterAlt(_localctx, 19); + { + setState(178); + debuggerStatement(); + } + break; + case 20: + enterOuterAlt(_localctx, 20); + { + setState(179); + functionDeclaration(); + } + break; + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class BlockContext extends ParserRuleContext { + public StatementListContext statementList() { + return getRuleContext(StatementListContext.class,0); + } + public BlockContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_block; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).enterBlock(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).exitBlock(this); + } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof JavaScriptParserVisitor ) return ((JavaScriptParserVisitor)visitor).visitBlock(this); + else return visitor.visitChildren(this); + } + } + + public final BlockContext block() throws RecognitionException { + BlockContext _localctx = new BlockContext(_ctx, getState()); + enterRule(_localctx, 6, RULE_block); + try { + enterOuterAlt(_localctx, 1); + { + setState(182); + match(OpenBrace); + setState(184); + switch ( getInterpreter().adaptivePredict(_input,3,_ctx) ) { + case 1: + { + setState(183); + statementList(); + } + break; + } + setState(186); + match(CloseBrace); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class StatementListContext extends ParserRuleContext { + public List statement() { + return getRuleContexts(StatementContext.class); + } + public StatementContext statement(int i) { + return getRuleContext(StatementContext.class,i); + } + public StatementListContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_statementList; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).enterStatementList(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).exitStatementList(this); + } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof JavaScriptParserVisitor ) return ((JavaScriptParserVisitor)visitor).visitStatementList(this); + else return visitor.visitChildren(this); + } + } + + public final StatementListContext statementList() throws RecognitionException { + StatementListContext _localctx = new StatementListContext(_ctx, getState()); + enterRule(_localctx, 8, RULE_statementList); + try { + int _alt; + enterOuterAlt(_localctx, 1); + { + setState(189); + _errHandler.sync(this); + _alt = 1; + do { + switch (_alt) { + case 1: + { + { + setState(188); + statement(); + } + } + break; + default: + throw new NoViableAltException(this); + } + setState(191); + _errHandler.sync(this); + _alt = getInterpreter().adaptivePredict(_input,4,_ctx); + } while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class ImportStatementContext extends ParserRuleContext { + public TerminalNode Import() { return getToken(JavaScriptParser.Import, 0); } + public ImportFromBlockContext importFromBlock() { + return getRuleContext(ImportFromBlockContext.class,0); + } + public ImportStatementContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_importStatement; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).enterImportStatement(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).exitImportStatement(this); + } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof JavaScriptParserVisitor ) return ((JavaScriptParserVisitor)visitor).visitImportStatement(this); + else return visitor.visitChildren(this); + } + } + + public final ImportStatementContext importStatement() throws RecognitionException { + ImportStatementContext _localctx = new ImportStatementContext(_ctx, getState()); + enterRule(_localctx, 10, RULE_importStatement); + try { + enterOuterAlt(_localctx, 1); + { + setState(193); + match(Import); + setState(194); + importFromBlock(); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class ImportFromBlockContext extends ParserRuleContext { + public ImportFromContext importFrom() { + return getRuleContext(ImportFromContext.class,0); + } + public EosContext eos() { + return getRuleContext(EosContext.class,0); + } + public ImportNamespaceContext importNamespace() { + return getRuleContext(ImportNamespaceContext.class,0); + } + public ModuleItemsContext moduleItems() { + return getRuleContext(ModuleItemsContext.class,0); + } + public ImportDefaultContext importDefault() { + return getRuleContext(ImportDefaultContext.class,0); + } + public TerminalNode StringLiteral() { return getToken(JavaScriptParser.StringLiteral, 0); } + public ImportFromBlockContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_importFromBlock; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).enterImportFromBlock(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).exitImportFromBlock(this); + } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof JavaScriptParserVisitor ) return ((JavaScriptParserVisitor)visitor).visitImportFromBlock(this); + else return visitor.visitChildren(this); + } + } + + public final ImportFromBlockContext importFromBlock() throws RecognitionException { + ImportFromBlockContext _localctx = new ImportFromBlockContext(_ctx, getState()); + enterRule(_localctx, 12, RULE_importFromBlock); + try { + setState(208); + switch (_input.LA(1)) { + case OpenBrace: + case Multiply: + case NullLiteral: + case BooleanLiteral: + case Break: + case Do: + case Instanceof: + case Typeof: + case Case: + case Else: + case New: + case Var: + case Catch: + case Finally: + case Return: + case Void: + case Continue: + case For: + case Switch: + case While: + case Debugger: + case Function: + case This: + case With: + case Default: + case If: + case Throw: + case Delete: + case In: + case Try: + case As: + case From: + case Class: + case Enum: + case Extends: + case Super: + case Const: + case Export: + case Import: + case Async: + case Await: + case Implements: + case StrictLet: + case NonStrictLet: + case Private: + case Public: + case Interface: + case Package: + case Protected: + case Static: + case Yield: + case Identifier: + enterOuterAlt(_localctx, 1); + { + setState(197); + switch ( getInterpreter().adaptivePredict(_input,5,_ctx) ) { + case 1: + { + setState(196); + importDefault(); + } + break; + } + setState(201); + switch (_input.LA(1)) { + case Multiply: + case NullLiteral: + case BooleanLiteral: + case Break: + case Do: + case Instanceof: + case Typeof: + case Case: + case Else: + case New: + case Var: + case Catch: + case Finally: + case Return: + case Void: + case Continue: + case For: + case Switch: + case While: + case Debugger: + case Function: + case This: + case With: + case Default: + case If: + case Throw: + case Delete: + case In: + case Try: + case As: + case From: + case Class: + case Enum: + case Extends: + case Super: + case Const: + case Export: + case Import: + case Async: + case Await: + case Implements: + case StrictLet: + case NonStrictLet: + case Private: + case Public: + case Interface: + case Package: + case Protected: + case Static: + case Yield: + case Identifier: + { + setState(199); + importNamespace(); + } + break; + case OpenBrace: + { + setState(200); + moduleItems(); + } + break; + default: + throw new NoViableAltException(this); + } + setState(203); + importFrom(); + setState(204); + eos(); + } + break; + case StringLiteral: + enterOuterAlt(_localctx, 2); + { + setState(206); + match(StringLiteral); + setState(207); + eos(); + } + break; + default: + throw new NoViableAltException(this); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class ModuleItemsContext extends ParserRuleContext { + public List aliasName() { + return getRuleContexts(AliasNameContext.class); + } + public AliasNameContext aliasName(int i) { + return getRuleContext(AliasNameContext.class,i); + } + public ModuleItemsContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_moduleItems; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).enterModuleItems(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).exitModuleItems(this); + } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof JavaScriptParserVisitor ) return ((JavaScriptParserVisitor)visitor).visitModuleItems(this); + else return visitor.visitChildren(this); + } + } + + public final ModuleItemsContext moduleItems() throws RecognitionException { + ModuleItemsContext _localctx = new ModuleItemsContext(_ctx, getState()); + enterRule(_localctx, 14, RULE_moduleItems); + int _la; + try { + int _alt; + enterOuterAlt(_localctx, 1); + { + setState(210); + match(OpenBrace); + setState(216); + _errHandler.sync(this); + _alt = getInterpreter().adaptivePredict(_input,8,_ctx); + while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) { + if ( _alt==1 ) { + { + { + setState(211); + aliasName(); + setState(212); + match(Comma); + } + } + } + setState(218); + _errHandler.sync(this); + _alt = getInterpreter().adaptivePredict(_input,8,_ctx); + } + setState(223); + _la = _input.LA(1); + if (((((_la - 59)) & ~0x3f) == 0 && ((1L << (_la - 59)) & ((1L << (NullLiteral - 59)) | (1L << (BooleanLiteral - 59)) | (1L << (Break - 59)) | (1L << (Do - 59)) | (1L << (Instanceof - 59)) | (1L << (Typeof - 59)) | (1L << (Case - 59)) | (1L << (Else - 59)) | (1L << (New - 59)) | (1L << (Var - 59)) | (1L << (Catch - 59)) | (1L << (Finally - 59)) | (1L << (Return - 59)) | (1L << (Void - 59)) | (1L << (Continue - 59)) | (1L << (For - 59)) | (1L << (Switch - 59)) | (1L << (While - 59)) | (1L << (Debugger - 59)) | (1L << (Function - 59)) | (1L << (This - 59)) | (1L << (With - 59)) | (1L << (Default - 59)) | (1L << (If - 59)) | (1L << (Throw - 59)) | (1L << (Delete - 59)) | (1L << (In - 59)) | (1L << (Try - 59)) | (1L << (As - 59)) | (1L << (From - 59)) | (1L << (Class - 59)) | (1L << (Enum - 59)) | (1L << (Extends - 59)) | (1L << (Super - 59)) | (1L << (Const - 59)) | (1L << (Export - 59)) | (1L << (Import - 59)) | (1L << (Async - 59)) | (1L << (Await - 59)) | (1L << (Implements - 59)) | (1L << (StrictLet - 59)) | (1L << (NonStrictLet - 59)) | (1L << (Private - 59)) | (1L << (Public - 59)) | (1L << (Interface - 59)) | (1L << (Package - 59)) | (1L << (Protected - 59)) | (1L << (Static - 59)) | (1L << (Yield - 59)) | (1L << (Identifier - 59)))) != 0)) { + { + setState(219); + aliasName(); + setState(221); + _la = _input.LA(1); + if (_la==Comma) { + { + setState(220); + match(Comma); + } + } + + } + } + + setState(225); + match(CloseBrace); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class ImportDefaultContext extends ParserRuleContext { + public AliasNameContext aliasName() { + return getRuleContext(AliasNameContext.class,0); + } + public ImportDefaultContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_importDefault; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).enterImportDefault(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).exitImportDefault(this); + } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof JavaScriptParserVisitor ) return ((JavaScriptParserVisitor)visitor).visitImportDefault(this); + else return visitor.visitChildren(this); + } + } + + public final ImportDefaultContext importDefault() throws RecognitionException { + ImportDefaultContext _localctx = new ImportDefaultContext(_ctx, getState()); + enterRule(_localctx, 16, RULE_importDefault); + try { + enterOuterAlt(_localctx, 1); + { + setState(227); + aliasName(); + setState(228); + match(Comma); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class ImportNamespaceContext extends ParserRuleContext { + public List identifierName() { + return getRuleContexts(IdentifierNameContext.class); + } + public IdentifierNameContext identifierName(int i) { + return getRuleContext(IdentifierNameContext.class,i); + } + public TerminalNode As() { return getToken(JavaScriptParser.As, 0); } + public ImportNamespaceContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_importNamespace; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).enterImportNamespace(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).exitImportNamespace(this); + } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof JavaScriptParserVisitor ) return ((JavaScriptParserVisitor)visitor).visitImportNamespace(this); + else return visitor.visitChildren(this); + } + } + + public final ImportNamespaceContext importNamespace() throws RecognitionException { + ImportNamespaceContext _localctx = new ImportNamespaceContext(_ctx, getState()); + enterRule(_localctx, 18, RULE_importNamespace); + int _la; + try { + enterOuterAlt(_localctx, 1); + { + setState(232); + switch (_input.LA(1)) { + case Multiply: + { + setState(230); + match(Multiply); + } + break; + case NullLiteral: + case BooleanLiteral: + case Break: + case Do: + case Instanceof: + case Typeof: + case Case: + case Else: + case New: + case Var: + case Catch: + case Finally: + case Return: + case Void: + case Continue: + case For: + case Switch: + case While: + case Debugger: + case Function: + case This: + case With: + case Default: + case If: + case Throw: + case Delete: + case In: + case Try: + case As: + case From: + case Class: + case Enum: + case Extends: + case Super: + case Const: + case Export: + case Import: + case Async: + case Await: + case Implements: + case StrictLet: + case NonStrictLet: + case Private: + case Public: + case Interface: + case Package: + case Protected: + case Static: + case Yield: + case Identifier: + { + setState(231); + identifierName(); + } + break; + default: + throw new NoViableAltException(this); + } + setState(236); + _la = _input.LA(1); + if (_la==As) { + { + setState(234); + match(As); + setState(235); + identifierName(); + } + } + + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class ImportFromContext extends ParserRuleContext { + public TerminalNode From() { return getToken(JavaScriptParser.From, 0); } + public TerminalNode StringLiteral() { return getToken(JavaScriptParser.StringLiteral, 0); } + public ImportFromContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_importFrom; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).enterImportFrom(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).exitImportFrom(this); + } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof JavaScriptParserVisitor ) return ((JavaScriptParserVisitor)visitor).visitImportFrom(this); + else return visitor.visitChildren(this); + } + } + + public final ImportFromContext importFrom() throws RecognitionException { + ImportFromContext _localctx = new ImportFromContext(_ctx, getState()); + enterRule(_localctx, 20, RULE_importFrom); + try { + enterOuterAlt(_localctx, 1); + { + setState(238); + match(From); + setState(239); + match(StringLiteral); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class AliasNameContext extends ParserRuleContext { + public List identifierName() { + return getRuleContexts(IdentifierNameContext.class); + } + public IdentifierNameContext identifierName(int i) { + return getRuleContext(IdentifierNameContext.class,i); + } + public TerminalNode As() { return getToken(JavaScriptParser.As, 0); } + public AliasNameContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_aliasName; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).enterAliasName(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).exitAliasName(this); + } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof JavaScriptParserVisitor ) return ((JavaScriptParserVisitor)visitor).visitAliasName(this); + else return visitor.visitChildren(this); + } + } + + public final AliasNameContext aliasName() throws RecognitionException { + AliasNameContext _localctx = new AliasNameContext(_ctx, getState()); + enterRule(_localctx, 22, RULE_aliasName); + int _la; + try { + enterOuterAlt(_localctx, 1); + { + setState(241); + identifierName(); + setState(244); + _la = _input.LA(1); + if (_la==As) { + { + setState(242); + match(As); + setState(243); + identifierName(); + } + } + + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class ExportStatementContext extends ParserRuleContext { + public ExportStatementContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_exportStatement; } + + public ExportStatementContext() { } + public void copyFrom(ExportStatementContext ctx) { + super.copyFrom(ctx); + } + } + public static class ExportDefaultDeclarationContext extends ExportStatementContext { + public TerminalNode Export() { return getToken(JavaScriptParser.Export, 0); } + public TerminalNode Default() { return getToken(JavaScriptParser.Default, 0); } + public SingleExpressionContext singleExpression() { + return getRuleContext(SingleExpressionContext.class,0); + } + public EosContext eos() { + return getRuleContext(EosContext.class,0); + } + public ExportDefaultDeclarationContext(ExportStatementContext ctx) { copyFrom(ctx); } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).enterExportDefaultDeclaration(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).exitExportDefaultDeclaration(this); + } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof JavaScriptParserVisitor ) return ((JavaScriptParserVisitor)visitor).visitExportDefaultDeclaration(this); + else return visitor.visitChildren(this); + } + } + public static class ExportDeclarationContext extends ExportStatementContext { + public TerminalNode Export() { return getToken(JavaScriptParser.Export, 0); } + public EosContext eos() { + return getRuleContext(EosContext.class,0); + } + public ExportFromBlockContext exportFromBlock() { + return getRuleContext(ExportFromBlockContext.class,0); + } + public DeclarationContext declaration() { + return getRuleContext(DeclarationContext.class,0); + } + public ExportDeclarationContext(ExportStatementContext ctx) { copyFrom(ctx); } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).enterExportDeclaration(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).exitExportDeclaration(this); + } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof JavaScriptParserVisitor ) return ((JavaScriptParserVisitor)visitor).visitExportDeclaration(this); + else return visitor.visitChildren(this); + } + } + + public final ExportStatementContext exportStatement() throws RecognitionException { + ExportStatementContext _localctx = new ExportStatementContext(_ctx, getState()); + enterRule(_localctx, 24, RULE_exportStatement); + try { + setState(258); + switch ( getInterpreter().adaptivePredict(_input,15,_ctx) ) { + case 1: + _localctx = new ExportDeclarationContext(_localctx); + enterOuterAlt(_localctx, 1); + { + setState(246); + match(Export); + setState(249); + switch ( getInterpreter().adaptivePredict(_input,14,_ctx) ) { + case 1: + { + setState(247); + exportFromBlock(); + } + break; + case 2: + { + setState(248); + declaration(); + } + break; + } + setState(251); + eos(); + } + break; + case 2: + _localctx = new ExportDefaultDeclarationContext(_localctx); + enterOuterAlt(_localctx, 2); + { + setState(253); + match(Export); + setState(254); + match(Default); + setState(255); + singleExpression(0); + setState(256); + eos(); + } + break; + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class ExportFromBlockContext extends ParserRuleContext { + public ImportNamespaceContext importNamespace() { + return getRuleContext(ImportNamespaceContext.class,0); + } + public ImportFromContext importFrom() { + return getRuleContext(ImportFromContext.class,0); + } + public EosContext eos() { + return getRuleContext(EosContext.class,0); + } + public ModuleItemsContext moduleItems() { + return getRuleContext(ModuleItemsContext.class,0); + } + public ExportFromBlockContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_exportFromBlock; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).enterExportFromBlock(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).exitExportFromBlock(this); + } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof JavaScriptParserVisitor ) return ((JavaScriptParserVisitor)visitor).visitExportFromBlock(this); + else return visitor.visitChildren(this); + } + } + + public final ExportFromBlockContext exportFromBlock() throws RecognitionException { + ExportFromBlockContext _localctx = new ExportFromBlockContext(_ctx, getState()); + enterRule(_localctx, 26, RULE_exportFromBlock); + try { + setState(270); + switch (_input.LA(1)) { + case Multiply: + case NullLiteral: + case BooleanLiteral: + case Break: + case Do: + case Instanceof: + case Typeof: + case Case: + case Else: + case New: + case Var: + case Catch: + case Finally: + case Return: + case Void: + case Continue: + case For: + case Switch: + case While: + case Debugger: + case Function: + case This: + case With: + case Default: + case If: + case Throw: + case Delete: + case In: + case Try: + case As: + case From: + case Class: + case Enum: + case Extends: + case Super: + case Const: + case Export: + case Import: + case Async: + case Await: + case Implements: + case StrictLet: + case NonStrictLet: + case Private: + case Public: + case Interface: + case Package: + case Protected: + case Static: + case Yield: + case Identifier: + enterOuterAlt(_localctx, 1); + { + setState(260); + importNamespace(); + setState(261); + importFrom(); + setState(262); + eos(); + } + break; + case OpenBrace: + enterOuterAlt(_localctx, 2); + { + setState(264); + moduleItems(); + setState(266); + switch ( getInterpreter().adaptivePredict(_input,16,_ctx) ) { + case 1: + { + setState(265); + importFrom(); + } + break; + } + setState(268); + eos(); + } + break; + default: + throw new NoViableAltException(this); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class DeclarationContext extends ParserRuleContext { + public VariableStatementContext variableStatement() { + return getRuleContext(VariableStatementContext.class,0); + } + public ClassDeclarationContext classDeclaration() { + return getRuleContext(ClassDeclarationContext.class,0); + } + public FunctionDeclarationContext functionDeclaration() { + return getRuleContext(FunctionDeclarationContext.class,0); + } + public DeclarationContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_declaration; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).enterDeclaration(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).exitDeclaration(this); + } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof JavaScriptParserVisitor ) return ((JavaScriptParserVisitor)visitor).visitDeclaration(this); + else return visitor.visitChildren(this); + } + } + + public final DeclarationContext declaration() throws RecognitionException { + DeclarationContext _localctx = new DeclarationContext(_ctx, getState()); + enterRule(_localctx, 28, RULE_declaration); + try { + setState(275); + switch (_input.LA(1)) { + case Var: + case Const: + case StrictLet: + case NonStrictLet: + enterOuterAlt(_localctx, 1); + { + setState(272); + variableStatement(); + } + break; + case Class: + enterOuterAlt(_localctx, 2); + { + setState(273); + classDeclaration(); + } + break; + case Function: + case Async: + enterOuterAlt(_localctx, 3); + { + setState(274); + functionDeclaration(); + } + break; + default: + throw new NoViableAltException(this); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class VariableStatementContext extends ParserRuleContext { + public VariableDeclarationListContext variableDeclarationList() { + return getRuleContext(VariableDeclarationListContext.class,0); + } + public EosContext eos() { + return getRuleContext(EosContext.class,0); + } + public VariableStatementContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_variableStatement; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).enterVariableStatement(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).exitVariableStatement(this); + } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof JavaScriptParserVisitor ) return ((JavaScriptParserVisitor)visitor).visitVariableStatement(this); + else return visitor.visitChildren(this); + } + } + + public final VariableStatementContext variableStatement() throws RecognitionException { + VariableStatementContext _localctx = new VariableStatementContext(_ctx, getState()); + enterRule(_localctx, 30, RULE_variableStatement); + try { + enterOuterAlt(_localctx, 1); + { + setState(277); + variableDeclarationList(); + setState(278); + eos(); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class VariableDeclarationListContext extends ParserRuleContext { + public VarModifierContext varModifier() { + return getRuleContext(VarModifierContext.class,0); + } + public List variableDeclaration() { + return getRuleContexts(VariableDeclarationContext.class); + } + public VariableDeclarationContext variableDeclaration(int i) { + return getRuleContext(VariableDeclarationContext.class,i); + } + public VariableDeclarationListContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_variableDeclarationList; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).enterVariableDeclarationList(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).exitVariableDeclarationList(this); + } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof JavaScriptParserVisitor ) return ((JavaScriptParserVisitor)visitor).visitVariableDeclarationList(this); + else return visitor.visitChildren(this); + } + } + + public final VariableDeclarationListContext variableDeclarationList() throws RecognitionException { + VariableDeclarationListContext _localctx = new VariableDeclarationListContext(_ctx, getState()); + enterRule(_localctx, 32, RULE_variableDeclarationList); + try { + int _alt; + enterOuterAlt(_localctx, 1); + { + setState(280); + varModifier(); + setState(281); + variableDeclaration(); + setState(286); + _errHandler.sync(this); + _alt = getInterpreter().adaptivePredict(_input,19,_ctx); + while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) { + if ( _alt==1 ) { + { + { + setState(282); + match(Comma); + setState(283); + variableDeclaration(); + } + } + } + setState(288); + _errHandler.sync(this); + _alt = getInterpreter().adaptivePredict(_input,19,_ctx); + } + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class VariableDeclarationContext extends ParserRuleContext { + public AssignableContext assignable() { + return getRuleContext(AssignableContext.class,0); + } + public SingleExpressionContext singleExpression() { + return getRuleContext(SingleExpressionContext.class,0); + } + public VariableDeclarationContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_variableDeclaration; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).enterVariableDeclaration(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).exitVariableDeclaration(this); + } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof JavaScriptParserVisitor ) return ((JavaScriptParserVisitor)visitor).visitVariableDeclaration(this); + else return visitor.visitChildren(this); + } + } + + public final VariableDeclarationContext variableDeclaration() throws RecognitionException { + VariableDeclarationContext _localctx = new VariableDeclarationContext(_ctx, getState()); + enterRule(_localctx, 34, RULE_variableDeclaration); + try { + enterOuterAlt(_localctx, 1); + { + setState(289); + assignable(); + setState(292); + switch ( getInterpreter().adaptivePredict(_input,20,_ctx) ) { + case 1: + { + setState(290); + match(Assign); + setState(291); + singleExpression(0); + } + break; + } + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class EmptyStatementContext extends ParserRuleContext { + public TerminalNode SemiColon() { return getToken(JavaScriptParser.SemiColon, 0); } + public EmptyStatementContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_emptyStatement; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).enterEmptyStatement(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).exitEmptyStatement(this); + } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof JavaScriptParserVisitor ) return ((JavaScriptParserVisitor)visitor).visitEmptyStatement(this); + else return visitor.visitChildren(this); + } + } + + public final EmptyStatementContext emptyStatement() throws RecognitionException { + EmptyStatementContext _localctx = new EmptyStatementContext(_ctx, getState()); + enterRule(_localctx, 36, RULE_emptyStatement); + try { + enterOuterAlt(_localctx, 1); + { + setState(294); + match(SemiColon); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class ExpressionStatementContext extends ParserRuleContext { + public ExpressionSequenceContext expressionSequence() { + return getRuleContext(ExpressionSequenceContext.class,0); + } + public EosContext eos() { + return getRuleContext(EosContext.class,0); + } + public ExpressionStatementContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_expressionStatement; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).enterExpressionStatement(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).exitExpressionStatement(this); + } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof JavaScriptParserVisitor ) return ((JavaScriptParserVisitor)visitor).visitExpressionStatement(this); + else return visitor.visitChildren(this); + } + } + + public final ExpressionStatementContext expressionStatement() throws RecognitionException { + ExpressionStatementContext _localctx = new ExpressionStatementContext(_ctx, getState()); + enterRule(_localctx, 38, RULE_expressionStatement); + try { + enterOuterAlt(_localctx, 1); + { + setState(296); + if (!(this.notOpenBraceAndNotFunction())) throw new FailedPredicateException(this, "this.notOpenBraceAndNotFunction()"); + setState(297); + expressionSequence(); + setState(298); + eos(); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class IfStatementContext extends ParserRuleContext { + public TerminalNode If() { return getToken(JavaScriptParser.If, 0); } + public ExpressionSequenceContext expressionSequence() { + return getRuleContext(ExpressionSequenceContext.class,0); + } + public List statement() { + return getRuleContexts(StatementContext.class); + } + public StatementContext statement(int i) { + return getRuleContext(StatementContext.class,i); + } + public TerminalNode Else() { return getToken(JavaScriptParser.Else, 0); } + public IfStatementContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_ifStatement; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).enterIfStatement(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).exitIfStatement(this); + } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof JavaScriptParserVisitor ) return ((JavaScriptParserVisitor)visitor).visitIfStatement(this); + else return visitor.visitChildren(this); + } + } + + public final IfStatementContext ifStatement() throws RecognitionException { + IfStatementContext _localctx = new IfStatementContext(_ctx, getState()); + enterRule(_localctx, 40, RULE_ifStatement); + try { + enterOuterAlt(_localctx, 1); + { + setState(300); + match(If); + setState(301); + match(OpenParen); + setState(302); + expressionSequence(); + setState(303); + match(CloseParen); + setState(304); + statement(); + setState(307); + switch ( getInterpreter().adaptivePredict(_input,21,_ctx) ) { + case 1: + { + setState(305); + match(Else); + setState(306); + statement(); + } + break; + } + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class IterationStatementContext extends ParserRuleContext { + public IterationStatementContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_iterationStatement; } + + public IterationStatementContext() { } + public void copyFrom(IterationStatementContext ctx) { + super.copyFrom(ctx); + } + } + public static class DoStatementContext extends IterationStatementContext { + public TerminalNode Do() { return getToken(JavaScriptParser.Do, 0); } + public StatementContext statement() { + return getRuleContext(StatementContext.class,0); + } + public TerminalNode While() { return getToken(JavaScriptParser.While, 0); } + public ExpressionSequenceContext expressionSequence() { + return getRuleContext(ExpressionSequenceContext.class,0); + } + public EosContext eos() { + return getRuleContext(EosContext.class,0); + } + public DoStatementContext(IterationStatementContext ctx) { copyFrom(ctx); } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).enterDoStatement(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).exitDoStatement(this); + } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof JavaScriptParserVisitor ) return ((JavaScriptParserVisitor)visitor).visitDoStatement(this); + else return visitor.visitChildren(this); + } + } + public static class WhileStatementContext extends IterationStatementContext { + public TerminalNode While() { return getToken(JavaScriptParser.While, 0); } + public ExpressionSequenceContext expressionSequence() { + return getRuleContext(ExpressionSequenceContext.class,0); + } + public StatementContext statement() { + return getRuleContext(StatementContext.class,0); + } + public WhileStatementContext(IterationStatementContext ctx) { copyFrom(ctx); } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).enterWhileStatement(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).exitWhileStatement(this); + } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof JavaScriptParserVisitor ) return ((JavaScriptParserVisitor)visitor).visitWhileStatement(this); + else return visitor.visitChildren(this); + } + } + public static class ForStatementContext extends IterationStatementContext { + public TerminalNode For() { return getToken(JavaScriptParser.For, 0); } + public StatementContext statement() { + return getRuleContext(StatementContext.class,0); + } + public List expressionSequence() { + return getRuleContexts(ExpressionSequenceContext.class); + } + public ExpressionSequenceContext expressionSequence(int i) { + return getRuleContext(ExpressionSequenceContext.class,i); + } + public VariableDeclarationListContext variableDeclarationList() { + return getRuleContext(VariableDeclarationListContext.class,0); + } + public ForStatementContext(IterationStatementContext ctx) { copyFrom(ctx); } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).enterForStatement(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).exitForStatement(this); + } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof JavaScriptParserVisitor ) return ((JavaScriptParserVisitor)visitor).visitForStatement(this); + else return visitor.visitChildren(this); + } + } + public static class ForInStatementContext extends IterationStatementContext { + public TerminalNode For() { return getToken(JavaScriptParser.For, 0); } + public TerminalNode In() { return getToken(JavaScriptParser.In, 0); } + public ExpressionSequenceContext expressionSequence() { + return getRuleContext(ExpressionSequenceContext.class,0); + } + public StatementContext statement() { + return getRuleContext(StatementContext.class,0); + } + public SingleExpressionContext singleExpression() { + return getRuleContext(SingleExpressionContext.class,0); + } + public VariableDeclarationListContext variableDeclarationList() { + return getRuleContext(VariableDeclarationListContext.class,0); + } + public ForInStatementContext(IterationStatementContext ctx) { copyFrom(ctx); } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).enterForInStatement(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).exitForInStatement(this); + } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof JavaScriptParserVisitor ) return ((JavaScriptParserVisitor)visitor).visitForInStatement(this); + else return visitor.visitChildren(this); + } + } + public static class ForOfStatementContext extends IterationStatementContext { + public TerminalNode For() { return getToken(JavaScriptParser.For, 0); } + public IdentifierContext identifier() { + return getRuleContext(IdentifierContext.class,0); + } + public ExpressionSequenceContext expressionSequence() { + return getRuleContext(ExpressionSequenceContext.class,0); + } + public StatementContext statement() { + return getRuleContext(StatementContext.class,0); + } + public SingleExpressionContext singleExpression() { + return getRuleContext(SingleExpressionContext.class,0); + } + public VariableDeclarationListContext variableDeclarationList() { + return getRuleContext(VariableDeclarationListContext.class,0); + } + public TerminalNode Await() { return getToken(JavaScriptParser.Await, 0); } + public ForOfStatementContext(IterationStatementContext ctx) { copyFrom(ctx); } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).enterForOfStatement(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).exitForOfStatement(this); + } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof JavaScriptParserVisitor ) return ((JavaScriptParserVisitor)visitor).visitForOfStatement(this); + else return visitor.visitChildren(this); + } + } + + public final IterationStatementContext iterationStatement() throws RecognitionException { + IterationStatementContext _localctx = new IterationStatementContext(_ctx, getState()); + enterRule(_localctx, 42, RULE_iterationStatement); + int _la; + try { + setState(365); + switch ( getInterpreter().adaptivePredict(_input,28,_ctx) ) { + case 1: + _localctx = new DoStatementContext(_localctx); + enterOuterAlt(_localctx, 1); + { + setState(309); + match(Do); + setState(310); + statement(); + setState(311); + match(While); + setState(312); + match(OpenParen); + setState(313); + expressionSequence(); + setState(314); + match(CloseParen); + setState(315); + eos(); + } + break; + case 2: + _localctx = new WhileStatementContext(_localctx); + enterOuterAlt(_localctx, 2); + { + setState(317); + match(While); + setState(318); + match(OpenParen); + setState(319); + expressionSequence(); + setState(320); + match(CloseParen); + setState(321); + statement(); + } + break; + case 3: + _localctx = new ForStatementContext(_localctx); + enterOuterAlt(_localctx, 3); + { + setState(323); + match(For); + setState(324); + match(OpenParen); + setState(327); + switch ( getInterpreter().adaptivePredict(_input,22,_ctx) ) { + case 1: + { + setState(325); + expressionSequence(); + } + break; + case 2: + { + setState(326); + variableDeclarationList(); + } + break; + } + setState(329); + match(SemiColon); + setState(331); + _la = _input.LA(1); + if ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << RegularExpressionLiteral) | (1L << OpenBracket) | (1L << OpenParen) | (1L << OpenBrace) | (1L << PlusPlus) | (1L << MinusMinus) | (1L << Plus) | (1L << Minus) | (1L << BitNot) | (1L << Not) | (1L << NullLiteral) | (1L << BooleanLiteral) | (1L << DecimalLiteral) | (1L << HexIntegerLiteral) | (1L << OctalIntegerLiteral))) != 0) || ((((_la - 64)) & ~0x3f) == 0 && ((1L << (_la - 64)) & ((1L << (OctalIntegerLiteral2 - 64)) | (1L << (BinaryIntegerLiteral - 64)) | (1L << (BigHexIntegerLiteral - 64)) | (1L << (BigOctalIntegerLiteral - 64)) | (1L << (BigBinaryIntegerLiteral - 64)) | (1L << (BigDecimalIntegerLiteral - 64)) | (1L << (Typeof - 64)) | (1L << (New - 64)) | (1L << (Void - 64)) | (1L << (Function - 64)) | (1L << (This - 64)) | (1L << (Delete - 64)) | (1L << (Class - 64)) | (1L << (Super - 64)) | (1L << (Import - 64)) | (1L << (Async - 64)) | (1L << (Await - 64)) | (1L << (NonStrictLet - 64)) | (1L << (Yield - 64)) | (1L << (Identifier - 64)) | (1L << (StringLiteral - 64)) | (1L << (TemplateStringLiteral - 64)))) != 0)) { + { + setState(330); + expressionSequence(); + } + } + + setState(333); + match(SemiColon); + setState(335); + _la = _input.LA(1); + if ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << RegularExpressionLiteral) | (1L << OpenBracket) | (1L << OpenParen) | (1L << OpenBrace) | (1L << PlusPlus) | (1L << MinusMinus) | (1L << Plus) | (1L << Minus) | (1L << BitNot) | (1L << Not) | (1L << NullLiteral) | (1L << BooleanLiteral) | (1L << DecimalLiteral) | (1L << HexIntegerLiteral) | (1L << OctalIntegerLiteral))) != 0) || ((((_la - 64)) & ~0x3f) == 0 && ((1L << (_la - 64)) & ((1L << (OctalIntegerLiteral2 - 64)) | (1L << (BinaryIntegerLiteral - 64)) | (1L << (BigHexIntegerLiteral - 64)) | (1L << (BigOctalIntegerLiteral - 64)) | (1L << (BigBinaryIntegerLiteral - 64)) | (1L << (BigDecimalIntegerLiteral - 64)) | (1L << (Typeof - 64)) | (1L << (New - 64)) | (1L << (Void - 64)) | (1L << (Function - 64)) | (1L << (This - 64)) | (1L << (Delete - 64)) | (1L << (Class - 64)) | (1L << (Super - 64)) | (1L << (Import - 64)) | (1L << (Async - 64)) | (1L << (Await - 64)) | (1L << (NonStrictLet - 64)) | (1L << (Yield - 64)) | (1L << (Identifier - 64)) | (1L << (StringLiteral - 64)) | (1L << (TemplateStringLiteral - 64)))) != 0)) { + { + setState(334); + expressionSequence(); + } + } + + setState(337); + match(CloseParen); + setState(338); + statement(); + } + break; + case 4: + _localctx = new ForInStatementContext(_localctx); + enterOuterAlt(_localctx, 4); + { + setState(339); + match(For); + setState(340); + match(OpenParen); + setState(343); + switch ( getInterpreter().adaptivePredict(_input,25,_ctx) ) { + case 1: + { + setState(341); + singleExpression(0); + } + break; + case 2: + { + setState(342); + variableDeclarationList(); + } + break; + } + setState(345); + match(In); + setState(346); + expressionSequence(); + setState(347); + match(CloseParen); + setState(348); + statement(); + } + break; + case 5: + _localctx = new ForOfStatementContext(_localctx); + enterOuterAlt(_localctx, 5); + { + setState(350); + match(For); + setState(352); + _la = _input.LA(1); + if (_la==Await) { + { + setState(351); + match(Await); + } + } + + setState(354); + match(OpenParen); + setState(357); + switch ( getInterpreter().adaptivePredict(_input,27,_ctx) ) { + case 1: + { + setState(355); + singleExpression(0); + } + break; + case 2: + { + setState(356); + variableDeclarationList(); + } + break; + } + setState(359); + identifier(); + setState(360); + if (!(this.p("of"))) throw new FailedPredicateException(this, "this.p(\"of\")"); + setState(361); + expressionSequence(); + setState(362); + match(CloseParen); + setState(363); + statement(); + } + break; + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class VarModifierContext extends ParserRuleContext { + public TerminalNode Var() { return getToken(JavaScriptParser.Var, 0); } + public LetContext let() { + return getRuleContext(LetContext.class,0); + } + public TerminalNode Const() { return getToken(JavaScriptParser.Const, 0); } + public VarModifierContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_varModifier; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).enterVarModifier(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).exitVarModifier(this); + } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof JavaScriptParserVisitor ) return ((JavaScriptParserVisitor)visitor).visitVarModifier(this); + else return visitor.visitChildren(this); + } + } + + public final VarModifierContext varModifier() throws RecognitionException { + VarModifierContext _localctx = new VarModifierContext(_ctx, getState()); + enterRule(_localctx, 44, RULE_varModifier); + try { + setState(370); + switch (_input.LA(1)) { + case Var: + enterOuterAlt(_localctx, 1); + { + setState(367); + match(Var); + } + break; + case StrictLet: + case NonStrictLet: + enterOuterAlt(_localctx, 2); + { + setState(368); + let(); + } + break; + case Const: + enterOuterAlt(_localctx, 3); + { + setState(369); + match(Const); + } + break; + default: + throw new NoViableAltException(this); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class ContinueStatementContext extends ParserRuleContext { + public TerminalNode Continue() { return getToken(JavaScriptParser.Continue, 0); } + public EosContext eos() { + return getRuleContext(EosContext.class,0); + } + public IdentifierContext identifier() { + return getRuleContext(IdentifierContext.class,0); + } + public ContinueStatementContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_continueStatement; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).enterContinueStatement(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).exitContinueStatement(this); + } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof JavaScriptParserVisitor ) return ((JavaScriptParserVisitor)visitor).visitContinueStatement(this); + else return visitor.visitChildren(this); + } + } + + public final ContinueStatementContext continueStatement() throws RecognitionException { + ContinueStatementContext _localctx = new ContinueStatementContext(_ctx, getState()); + enterRule(_localctx, 46, RULE_continueStatement); + try { + enterOuterAlt(_localctx, 1); + { + setState(372); + match(Continue); + setState(375); + switch ( getInterpreter().adaptivePredict(_input,30,_ctx) ) { + case 1: + { + setState(373); + if (!(this.notLineTerminator())) throw new FailedPredicateException(this, "this.notLineTerminator()"); + setState(374); + identifier(); + } + break; + } + setState(377); + eos(); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class BreakStatementContext extends ParserRuleContext { + public TerminalNode Break() { return getToken(JavaScriptParser.Break, 0); } + public EosContext eos() { + return getRuleContext(EosContext.class,0); + } + public IdentifierContext identifier() { + return getRuleContext(IdentifierContext.class,0); + } + public BreakStatementContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_breakStatement; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).enterBreakStatement(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).exitBreakStatement(this); + } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof JavaScriptParserVisitor ) return ((JavaScriptParserVisitor)visitor).visitBreakStatement(this); + else return visitor.visitChildren(this); + } + } + + public final BreakStatementContext breakStatement() throws RecognitionException { + BreakStatementContext _localctx = new BreakStatementContext(_ctx, getState()); + enterRule(_localctx, 48, RULE_breakStatement); + try { + enterOuterAlt(_localctx, 1); + { + setState(379); + match(Break); + setState(382); + switch ( getInterpreter().adaptivePredict(_input,31,_ctx) ) { + case 1: + { + setState(380); + if (!(this.notLineTerminator())) throw new FailedPredicateException(this, "this.notLineTerminator()"); + setState(381); + identifier(); + } + break; + } + setState(384); + eos(); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class ReturnStatementContext extends ParserRuleContext { + public TerminalNode Return() { return getToken(JavaScriptParser.Return, 0); } + public EosContext eos() { + return getRuleContext(EosContext.class,0); + } + public ExpressionSequenceContext expressionSequence() { + return getRuleContext(ExpressionSequenceContext.class,0); + } + public ReturnStatementContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_returnStatement; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).enterReturnStatement(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).exitReturnStatement(this); + } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof JavaScriptParserVisitor ) return ((JavaScriptParserVisitor)visitor).visitReturnStatement(this); + else return visitor.visitChildren(this); + } + } + + public final ReturnStatementContext returnStatement() throws RecognitionException { + ReturnStatementContext _localctx = new ReturnStatementContext(_ctx, getState()); + enterRule(_localctx, 50, RULE_returnStatement); + try { + enterOuterAlt(_localctx, 1); + { + setState(386); + match(Return); + setState(389); + switch ( getInterpreter().adaptivePredict(_input,32,_ctx) ) { + case 1: + { + setState(387); + if (!(this.notLineTerminator())) throw new FailedPredicateException(this, "this.notLineTerminator()"); + setState(388); + expressionSequence(); + } + break; + } + setState(391); + eos(); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class YieldStatementContext extends ParserRuleContext { + public TerminalNode Yield() { return getToken(JavaScriptParser.Yield, 0); } + public EosContext eos() { + return getRuleContext(EosContext.class,0); + } + public ExpressionSequenceContext expressionSequence() { + return getRuleContext(ExpressionSequenceContext.class,0); + } + public YieldStatementContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_yieldStatement; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).enterYieldStatement(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).exitYieldStatement(this); + } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof JavaScriptParserVisitor ) return ((JavaScriptParserVisitor)visitor).visitYieldStatement(this); + else return visitor.visitChildren(this); + } + } + + public final YieldStatementContext yieldStatement() throws RecognitionException { + YieldStatementContext _localctx = new YieldStatementContext(_ctx, getState()); + enterRule(_localctx, 52, RULE_yieldStatement); + try { + enterOuterAlt(_localctx, 1); + { + setState(393); + match(Yield); + setState(396); + switch ( getInterpreter().adaptivePredict(_input,33,_ctx) ) { + case 1: + { + setState(394); + if (!(this.notLineTerminator())) throw new FailedPredicateException(this, "this.notLineTerminator()"); + setState(395); + expressionSequence(); + } + break; + } + setState(398); + eos(); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class WithStatementContext extends ParserRuleContext { + public TerminalNode With() { return getToken(JavaScriptParser.With, 0); } + public ExpressionSequenceContext expressionSequence() { + return getRuleContext(ExpressionSequenceContext.class,0); + } + public StatementContext statement() { + return getRuleContext(StatementContext.class,0); + } + public WithStatementContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_withStatement; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).enterWithStatement(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).exitWithStatement(this); + } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof JavaScriptParserVisitor ) return ((JavaScriptParserVisitor)visitor).visitWithStatement(this); + else return visitor.visitChildren(this); + } + } + + public final WithStatementContext withStatement() throws RecognitionException { + WithStatementContext _localctx = new WithStatementContext(_ctx, getState()); + enterRule(_localctx, 54, RULE_withStatement); + try { + enterOuterAlt(_localctx, 1); + { + setState(400); + match(With); + setState(401); + match(OpenParen); + setState(402); + expressionSequence(); + setState(403); + match(CloseParen); + setState(404); + statement(); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class SwitchStatementContext extends ParserRuleContext { + public TerminalNode Switch() { return getToken(JavaScriptParser.Switch, 0); } + public ExpressionSequenceContext expressionSequence() { + return getRuleContext(ExpressionSequenceContext.class,0); + } + public CaseBlockContext caseBlock() { + return getRuleContext(CaseBlockContext.class,0); + } + public SwitchStatementContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_switchStatement; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).enterSwitchStatement(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).exitSwitchStatement(this); + } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof JavaScriptParserVisitor ) return ((JavaScriptParserVisitor)visitor).visitSwitchStatement(this); + else return visitor.visitChildren(this); + } + } + + public final SwitchStatementContext switchStatement() throws RecognitionException { + SwitchStatementContext _localctx = new SwitchStatementContext(_ctx, getState()); + enterRule(_localctx, 56, RULE_switchStatement); + try { + enterOuterAlt(_localctx, 1); + { + setState(406); + match(Switch); + setState(407); + match(OpenParen); + setState(408); + expressionSequence(); + setState(409); + match(CloseParen); + setState(410); + caseBlock(); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class CaseBlockContext extends ParserRuleContext { + public List caseClauses() { + return getRuleContexts(CaseClausesContext.class); + } + public CaseClausesContext caseClauses(int i) { + return getRuleContext(CaseClausesContext.class,i); + } + public DefaultClauseContext defaultClause() { + return getRuleContext(DefaultClauseContext.class,0); + } + public CaseBlockContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_caseBlock; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).enterCaseBlock(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).exitCaseBlock(this); + } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof JavaScriptParserVisitor ) return ((JavaScriptParserVisitor)visitor).visitCaseBlock(this); + else return visitor.visitChildren(this); + } + } + + public final CaseBlockContext caseBlock() throws RecognitionException { + CaseBlockContext _localctx = new CaseBlockContext(_ctx, getState()); + enterRule(_localctx, 58, RULE_caseBlock); + int _la; + try { + enterOuterAlt(_localctx, 1); + { + setState(412); + match(OpenBrace); + setState(414); + _la = _input.LA(1); + if (_la==Case) { + { + setState(413); + caseClauses(); + } + } + + setState(420); + _la = _input.LA(1); + if (_la==Default) { + { + setState(416); + defaultClause(); + setState(418); + _la = _input.LA(1); + if (_la==Case) { + { + setState(417); + caseClauses(); + } + } + + } + } + + setState(422); + match(CloseBrace); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class CaseClausesContext extends ParserRuleContext { + public List caseClause() { + return getRuleContexts(CaseClauseContext.class); + } + public CaseClauseContext caseClause(int i) { + return getRuleContext(CaseClauseContext.class,i); + } + public CaseClausesContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_caseClauses; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).enterCaseClauses(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).exitCaseClauses(this); + } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof JavaScriptParserVisitor ) return ((JavaScriptParserVisitor)visitor).visitCaseClauses(this); + else return visitor.visitChildren(this); + } + } + + public final CaseClausesContext caseClauses() throws RecognitionException { + CaseClausesContext _localctx = new CaseClausesContext(_ctx, getState()); + enterRule(_localctx, 60, RULE_caseClauses); + int _la; + try { + enterOuterAlt(_localctx, 1); + { + setState(425); + _errHandler.sync(this); + _la = _input.LA(1); + do { + { + { + setState(424); + caseClause(); + } + } + setState(427); + _errHandler.sync(this); + _la = _input.LA(1); + } while ( _la==Case ); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class CaseClauseContext extends ParserRuleContext { + public TerminalNode Case() { return getToken(JavaScriptParser.Case, 0); } + public ExpressionSequenceContext expressionSequence() { + return getRuleContext(ExpressionSequenceContext.class,0); + } + public StatementListContext statementList() { + return getRuleContext(StatementListContext.class,0); + } + public CaseClauseContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_caseClause; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).enterCaseClause(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).exitCaseClause(this); + } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof JavaScriptParserVisitor ) return ((JavaScriptParserVisitor)visitor).visitCaseClause(this); + else return visitor.visitChildren(this); + } + } + + public final CaseClauseContext caseClause() throws RecognitionException { + CaseClauseContext _localctx = new CaseClauseContext(_ctx, getState()); + enterRule(_localctx, 62, RULE_caseClause); + try { + enterOuterAlt(_localctx, 1); + { + setState(429); + match(Case); + setState(430); + expressionSequence(); + setState(431); + match(Colon); + setState(433); + switch ( getInterpreter().adaptivePredict(_input,38,_ctx) ) { + case 1: + { + setState(432); + statementList(); + } + break; + } + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class DefaultClauseContext extends ParserRuleContext { + public TerminalNode Default() { return getToken(JavaScriptParser.Default, 0); } + public StatementListContext statementList() { + return getRuleContext(StatementListContext.class,0); + } + public DefaultClauseContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_defaultClause; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).enterDefaultClause(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).exitDefaultClause(this); + } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof JavaScriptParserVisitor ) return ((JavaScriptParserVisitor)visitor).visitDefaultClause(this); + else return visitor.visitChildren(this); + } + } + + public final DefaultClauseContext defaultClause() throws RecognitionException { + DefaultClauseContext _localctx = new DefaultClauseContext(_ctx, getState()); + enterRule(_localctx, 64, RULE_defaultClause); + try { + enterOuterAlt(_localctx, 1); + { + setState(435); + match(Default); + setState(436); + match(Colon); + setState(438); + switch ( getInterpreter().adaptivePredict(_input,39,_ctx) ) { + case 1: + { + setState(437); + statementList(); + } + break; + } + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class LabelledStatementContext extends ParserRuleContext { + public IdentifierContext identifier() { + return getRuleContext(IdentifierContext.class,0); + } + public StatementContext statement() { + return getRuleContext(StatementContext.class,0); + } + public LabelledStatementContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_labelledStatement; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).enterLabelledStatement(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).exitLabelledStatement(this); + } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof JavaScriptParserVisitor ) return ((JavaScriptParserVisitor)visitor).visitLabelledStatement(this); + else return visitor.visitChildren(this); + } + } + + public final LabelledStatementContext labelledStatement() throws RecognitionException { + LabelledStatementContext _localctx = new LabelledStatementContext(_ctx, getState()); + enterRule(_localctx, 66, RULE_labelledStatement); + try { + enterOuterAlt(_localctx, 1); + { + setState(440); + identifier(); + setState(441); + match(Colon); + setState(442); + statement(); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class ThrowStatementContext extends ParserRuleContext { + public TerminalNode Throw() { return getToken(JavaScriptParser.Throw, 0); } + public ExpressionSequenceContext expressionSequence() { + return getRuleContext(ExpressionSequenceContext.class,0); + } + public EosContext eos() { + return getRuleContext(EosContext.class,0); + } + public ThrowStatementContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_throwStatement; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).enterThrowStatement(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).exitThrowStatement(this); + } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof JavaScriptParserVisitor ) return ((JavaScriptParserVisitor)visitor).visitThrowStatement(this); + else return visitor.visitChildren(this); + } + } + + public final ThrowStatementContext throwStatement() throws RecognitionException { + ThrowStatementContext _localctx = new ThrowStatementContext(_ctx, getState()); + enterRule(_localctx, 68, RULE_throwStatement); + try { + enterOuterAlt(_localctx, 1); + { + setState(444); + match(Throw); + setState(445); + if (!(this.notLineTerminator())) throw new FailedPredicateException(this, "this.notLineTerminator()"); + setState(446); + expressionSequence(); + setState(447); + eos(); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class TryStatementContext extends ParserRuleContext { + public TerminalNode Try() { return getToken(JavaScriptParser.Try, 0); } + public BlockContext block() { + return getRuleContext(BlockContext.class,0); + } + public CatchProductionContext catchProduction() { + return getRuleContext(CatchProductionContext.class,0); + } + public FinallyProductionContext finallyProduction() { + return getRuleContext(FinallyProductionContext.class,0); + } + public TryStatementContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_tryStatement; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).enterTryStatement(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).exitTryStatement(this); + } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof JavaScriptParserVisitor ) return ((JavaScriptParserVisitor)visitor).visitTryStatement(this); + else return visitor.visitChildren(this); + } + } + + public final TryStatementContext tryStatement() throws RecognitionException { + TryStatementContext _localctx = new TryStatementContext(_ctx, getState()); + enterRule(_localctx, 70, RULE_tryStatement); + try { + enterOuterAlt(_localctx, 1); + { + setState(449); + match(Try); + setState(450); + block(); + setState(456); + switch (_input.LA(1)) { + case Catch: + { + setState(451); + catchProduction(); + setState(453); + switch ( getInterpreter().adaptivePredict(_input,40,_ctx) ) { + case 1: + { + setState(452); + finallyProduction(); + } + break; + } + } + break; + case Finally: + { + setState(455); + finallyProduction(); + } + break; + default: + throw new NoViableAltException(this); + } + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class CatchProductionContext extends ParserRuleContext { + public TerminalNode Catch() { return getToken(JavaScriptParser.Catch, 0); } + public BlockContext block() { + return getRuleContext(BlockContext.class,0); + } + public AssignableContext assignable() { + return getRuleContext(AssignableContext.class,0); + } + public CatchProductionContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_catchProduction; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).enterCatchProduction(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).exitCatchProduction(this); + } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof JavaScriptParserVisitor ) return ((JavaScriptParserVisitor)visitor).visitCatchProduction(this); + else return visitor.visitChildren(this); + } + } + + public final CatchProductionContext catchProduction() throws RecognitionException { + CatchProductionContext _localctx = new CatchProductionContext(_ctx, getState()); + enterRule(_localctx, 72, RULE_catchProduction); + int _la; + try { + enterOuterAlt(_localctx, 1); + { + setState(458); + match(Catch); + setState(464); + _la = _input.LA(1); + if (_la==OpenParen) { + { + setState(459); + match(OpenParen); + setState(461); + _la = _input.LA(1); + if (_la==OpenBracket || _la==OpenBrace || ((((_la - 105)) & ~0x3f) == 0 && ((1L << (_la - 105)) & ((1L << (Async - 105)) | (1L << (NonStrictLet - 105)) | (1L << (Identifier - 105)))) != 0)) { + { + setState(460); + assignable(); + } + } + + setState(463); + match(CloseParen); + } + } + + setState(466); + block(); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class FinallyProductionContext extends ParserRuleContext { + public TerminalNode Finally() { return getToken(JavaScriptParser.Finally, 0); } + public BlockContext block() { + return getRuleContext(BlockContext.class,0); + } + public FinallyProductionContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_finallyProduction; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).enterFinallyProduction(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).exitFinallyProduction(this); + } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof JavaScriptParserVisitor ) return ((JavaScriptParserVisitor)visitor).visitFinallyProduction(this); + else return visitor.visitChildren(this); + } + } + + public final FinallyProductionContext finallyProduction() throws RecognitionException { + FinallyProductionContext _localctx = new FinallyProductionContext(_ctx, getState()); + enterRule(_localctx, 74, RULE_finallyProduction); + try { + enterOuterAlt(_localctx, 1); + { + setState(468); + match(Finally); + setState(469); + block(); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class DebuggerStatementContext extends ParserRuleContext { + public TerminalNode Debugger() { return getToken(JavaScriptParser.Debugger, 0); } + public EosContext eos() { + return getRuleContext(EosContext.class,0); + } + public DebuggerStatementContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_debuggerStatement; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).enterDebuggerStatement(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).exitDebuggerStatement(this); + } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof JavaScriptParserVisitor ) return ((JavaScriptParserVisitor)visitor).visitDebuggerStatement(this); + else return visitor.visitChildren(this); + } + } + + public final DebuggerStatementContext debuggerStatement() throws RecognitionException { + DebuggerStatementContext _localctx = new DebuggerStatementContext(_ctx, getState()); + enterRule(_localctx, 76, RULE_debuggerStatement); + try { + enterOuterAlt(_localctx, 1); + { + setState(471); + match(Debugger); + setState(472); + eos(); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class FunctionDeclarationContext extends ParserRuleContext { + public TerminalNode Function() { return getToken(JavaScriptParser.Function, 0); } + public IdentifierContext identifier() { + return getRuleContext(IdentifierContext.class,0); + } + public FunctionBodyContext functionBody() { + return getRuleContext(FunctionBodyContext.class,0); + } + public TerminalNode Async() { return getToken(JavaScriptParser.Async, 0); } + public FormalParameterListContext formalParameterList() { + return getRuleContext(FormalParameterListContext.class,0); + } + public FunctionDeclarationContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_functionDeclaration; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).enterFunctionDeclaration(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).exitFunctionDeclaration(this); + } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof JavaScriptParserVisitor ) return ((JavaScriptParserVisitor)visitor).visitFunctionDeclaration(this); + else return visitor.visitChildren(this); + } + } + + public final FunctionDeclarationContext functionDeclaration() throws RecognitionException { + FunctionDeclarationContext _localctx = new FunctionDeclarationContext(_ctx, getState()); + enterRule(_localctx, 78, RULE_functionDeclaration); + int _la; + try { + enterOuterAlt(_localctx, 1); + { + setState(475); + _la = _input.LA(1); + if (_la==Async) { + { + setState(474); + match(Async); + } + } + + setState(477); + match(Function); + setState(479); + _la = _input.LA(1); + if (_la==Multiply) { + { + setState(478); + match(Multiply); + } + } + + setState(481); + identifier(); + setState(482); + match(OpenParen); + setState(484); + _la = _input.LA(1); + if ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << OpenBracket) | (1L << OpenBrace) | (1L << Ellipsis))) != 0) || ((((_la - 105)) & ~0x3f) == 0 && ((1L << (_la - 105)) & ((1L << (Async - 105)) | (1L << (NonStrictLet - 105)) | (1L << (Identifier - 105)))) != 0)) { + { + setState(483); + formalParameterList(); + } + } + + setState(486); + match(CloseParen); + setState(487); + match(OpenBrace); + setState(488); + functionBody(); + setState(489); + match(CloseBrace); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class ClassDeclarationContext extends ParserRuleContext { + public TerminalNode Class() { return getToken(JavaScriptParser.Class, 0); } + public IdentifierContext identifier() { + return getRuleContext(IdentifierContext.class,0); + } + public ClassTailContext classTail() { + return getRuleContext(ClassTailContext.class,0); + } + public ClassDeclarationContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_classDeclaration; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).enterClassDeclaration(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).exitClassDeclaration(this); + } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof JavaScriptParserVisitor ) return ((JavaScriptParserVisitor)visitor).visitClassDeclaration(this); + else return visitor.visitChildren(this); + } + } + + public final ClassDeclarationContext classDeclaration() throws RecognitionException { + ClassDeclarationContext _localctx = new ClassDeclarationContext(_ctx, getState()); + enterRule(_localctx, 80, RULE_classDeclaration); + try { + enterOuterAlt(_localctx, 1); + { + setState(491); + match(Class); + setState(492); + identifier(); + setState(493); + classTail(); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class ClassTailContext extends ParserRuleContext { + public TerminalNode Extends() { return getToken(JavaScriptParser.Extends, 0); } + public SingleExpressionContext singleExpression() { + return getRuleContext(SingleExpressionContext.class,0); + } + public List classElement() { + return getRuleContexts(ClassElementContext.class); + } + public ClassElementContext classElement(int i) { + return getRuleContext(ClassElementContext.class,i); + } + public ClassTailContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_classTail; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).enterClassTail(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).exitClassTail(this); + } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof JavaScriptParserVisitor ) return ((JavaScriptParserVisitor)visitor).visitClassTail(this); + else return visitor.visitChildren(this); + } + } + + public final ClassTailContext classTail() throws RecognitionException { + ClassTailContext _localctx = new ClassTailContext(_ctx, getState()); + enterRule(_localctx, 82, RULE_classTail); + int _la; + try { + int _alt; + enterOuterAlt(_localctx, 1); + { + setState(497); + _la = _input.LA(1); + if (_la==Extends) { + { + setState(495); + match(Extends); + setState(496); + singleExpression(0); + } + } + + setState(499); + match(OpenBrace); + setState(503); + _errHandler.sync(this); + _alt = getInterpreter().adaptivePredict(_input,48,_ctx); + while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) { + if ( _alt==1 ) { + { + { + setState(500); + classElement(); + } + } + } + setState(505); + _errHandler.sync(this); + _alt = getInterpreter().adaptivePredict(_input,48,_ctx); + } + setState(506); + match(CloseBrace); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class ClassElementContext extends ParserRuleContext { + public MethodDefinitionContext methodDefinition() { + return getRuleContext(MethodDefinitionContext.class,0); + } + public AssignableContext assignable() { + return getRuleContext(AssignableContext.class,0); + } + public ObjectLiteralContext objectLiteral() { + return getRuleContext(ObjectLiteralContext.class,0); + } + public List Static() { return getTokens(JavaScriptParser.Static); } + public TerminalNode Static(int i) { + return getToken(JavaScriptParser.Static, i); + } + public List identifier() { + return getRuleContexts(IdentifierContext.class); + } + public IdentifierContext identifier(int i) { + return getRuleContext(IdentifierContext.class,i); + } + public List Async() { return getTokens(JavaScriptParser.Async); } + public TerminalNode Async(int i) { + return getToken(JavaScriptParser.Async, i); + } + public EmptyStatementContext emptyStatement() { + return getRuleContext(EmptyStatementContext.class,0); + } + public PropertyNameContext propertyName() { + return getRuleContext(PropertyNameContext.class,0); + } + public SingleExpressionContext singleExpression() { + return getRuleContext(SingleExpressionContext.class,0); + } + public ClassElementContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_classElement; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).enterClassElement(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).exitClassElement(this); + } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof JavaScriptParserVisitor ) return ((JavaScriptParserVisitor)visitor).visitClassElement(this); + else return visitor.visitChildren(this); + } + } + + public final ClassElementContext classElement() throws RecognitionException { + ClassElementContext _localctx = new ClassElementContext(_ctx, getState()); + enterRule(_localctx, 84, RULE_classElement); + int _la; + try { + int _alt; + setState(533); + switch ( getInterpreter().adaptivePredict(_input,53,_ctx) ) { + case 1: + enterOuterAlt(_localctx, 1); + { + setState(514); + _errHandler.sync(this); + _alt = getInterpreter().adaptivePredict(_input,50,_ctx); + while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) { + if ( _alt==1 ) { + { + setState(512); + switch ( getInterpreter().adaptivePredict(_input,49,_ctx) ) { + case 1: + { + setState(508); + match(Static); + } + break; + case 2: + { + setState(509); + if (!(this.n("static"))) throw new FailedPredicateException(this, "this.n(\"static\")"); + setState(510); + identifier(); + } + break; + case 3: + { + setState(511); + match(Async); + } + break; + } + } + } + setState(516); + _errHandler.sync(this); + _alt = getInterpreter().adaptivePredict(_input,50,_ctx); + } + setState(523); + switch ( getInterpreter().adaptivePredict(_input,51,_ctx) ) { + case 1: + { + setState(517); + methodDefinition(); + } + break; + case 2: + { + setState(518); + assignable(); + setState(519); + match(Assign); + setState(520); + objectLiteral(); + setState(521); + match(SemiColon); + } + break; + } + } + break; + case 2: + enterOuterAlt(_localctx, 2); + { + setState(525); + emptyStatement(); + } + break; + case 3: + enterOuterAlt(_localctx, 3); + { + setState(527); + _la = _input.LA(1); + if (_la==Hashtag) { + { + setState(526); + match(Hashtag); + } + } + + setState(529); + propertyName(); + setState(530); + match(Assign); + setState(531); + singleExpression(0); + } + break; + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class MethodDefinitionContext extends ParserRuleContext { + public PropertyNameContext propertyName() { + return getRuleContext(PropertyNameContext.class,0); + } + public FunctionBodyContext functionBody() { + return getRuleContext(FunctionBodyContext.class,0); + } + public FormalParameterListContext formalParameterList() { + return getRuleContext(FormalParameterListContext.class,0); + } + public GetterContext getter() { + return getRuleContext(GetterContext.class,0); + } + public SetterContext setter() { + return getRuleContext(SetterContext.class,0); + } + public MethodDefinitionContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_methodDefinition; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).enterMethodDefinition(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).exitMethodDefinition(this); + } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof JavaScriptParserVisitor ) return ((JavaScriptParserVisitor)visitor).visitMethodDefinition(this); + else return visitor.visitChildren(this); + } + } + + public final MethodDefinitionContext methodDefinition() throws RecognitionException { + MethodDefinitionContext _localctx = new MethodDefinitionContext(_ctx, getState()); + enterRule(_localctx, 86, RULE_methodDefinition); + int _la; + try { + setState(580); + switch ( getInterpreter().adaptivePredict(_input,62,_ctx) ) { + case 1: + enterOuterAlt(_localctx, 1); + { + setState(536); + _la = _input.LA(1); + if (_la==Multiply) { + { + setState(535); + match(Multiply); + } + } + + setState(539); + _la = _input.LA(1); + if (_la==Hashtag) { + { + setState(538); + match(Hashtag); + } + } + + setState(541); + propertyName(); + setState(542); + match(OpenParen); + setState(544); + _la = _input.LA(1); + if ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << OpenBracket) | (1L << OpenBrace) | (1L << Ellipsis))) != 0) || ((((_la - 105)) & ~0x3f) == 0 && ((1L << (_la - 105)) & ((1L << (Async - 105)) | (1L << (NonStrictLet - 105)) | (1L << (Identifier - 105)))) != 0)) { + { + setState(543); + formalParameterList(); + } + } + + setState(546); + match(CloseParen); + setState(547); + match(OpenBrace); + setState(548); + functionBody(); + setState(549); + match(CloseBrace); + } + break; + case 2: + enterOuterAlt(_localctx, 2); + { + setState(552); + switch ( getInterpreter().adaptivePredict(_input,57,_ctx) ) { + case 1: + { + setState(551); + match(Multiply); + } + break; + } + setState(555); + switch ( getInterpreter().adaptivePredict(_input,58,_ctx) ) { + case 1: + { + setState(554); + match(Hashtag); + } + break; + } + setState(557); + getter(); + setState(558); + match(OpenParen); + setState(559); + match(CloseParen); + setState(560); + match(OpenBrace); + setState(561); + functionBody(); + setState(562); + match(CloseBrace); + } + break; + case 3: + enterOuterAlt(_localctx, 3); + { + setState(565); + switch ( getInterpreter().adaptivePredict(_input,59,_ctx) ) { + case 1: + { + setState(564); + match(Multiply); + } + break; + } + setState(568); + switch ( getInterpreter().adaptivePredict(_input,60,_ctx) ) { + case 1: + { + setState(567); + match(Hashtag); + } + break; + } + setState(570); + setter(); + setState(571); + match(OpenParen); + setState(573); + _la = _input.LA(1); + if ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << OpenBracket) | (1L << OpenBrace) | (1L << Ellipsis))) != 0) || ((((_la - 105)) & ~0x3f) == 0 && ((1L << (_la - 105)) & ((1L << (Async - 105)) | (1L << (NonStrictLet - 105)) | (1L << (Identifier - 105)))) != 0)) { + { + setState(572); + formalParameterList(); + } + } + + setState(575); + match(CloseParen); + setState(576); + match(OpenBrace); + setState(577); + functionBody(); + setState(578); + match(CloseBrace); + } + break; + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class FormalParameterListContext extends ParserRuleContext { + public List formalParameterArg() { + return getRuleContexts(FormalParameterArgContext.class); + } + public FormalParameterArgContext formalParameterArg(int i) { + return getRuleContext(FormalParameterArgContext.class,i); + } + public LastFormalParameterArgContext lastFormalParameterArg() { + return getRuleContext(LastFormalParameterArgContext.class,0); + } + public FormalParameterListContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_formalParameterList; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).enterFormalParameterList(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).exitFormalParameterList(this); + } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof JavaScriptParserVisitor ) return ((JavaScriptParserVisitor)visitor).visitFormalParameterList(this); + else return visitor.visitChildren(this); + } + } + + public final FormalParameterListContext formalParameterList() throws RecognitionException { + FormalParameterListContext _localctx = new FormalParameterListContext(_ctx, getState()); + enterRule(_localctx, 88, RULE_formalParameterList); + int _la; + try { + int _alt; + setState(595); + switch (_input.LA(1)) { + case OpenBracket: + case OpenBrace: + case Async: + case NonStrictLet: + case Identifier: + enterOuterAlt(_localctx, 1); + { + setState(582); + formalParameterArg(); + setState(587); + _errHandler.sync(this); + _alt = getInterpreter().adaptivePredict(_input,63,_ctx); + while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) { + if ( _alt==1 ) { + { + { + setState(583); + match(Comma); + setState(584); + formalParameterArg(); + } + } + } + setState(589); + _errHandler.sync(this); + _alt = getInterpreter().adaptivePredict(_input,63,_ctx); + } + setState(592); + _la = _input.LA(1); + if (_la==Comma) { + { + setState(590); + match(Comma); + setState(591); + lastFormalParameterArg(); + } + } + + } + break; + case Ellipsis: + enterOuterAlt(_localctx, 2); + { + setState(594); + lastFormalParameterArg(); + } + break; + default: + throw new NoViableAltException(this); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class FormalParameterArgContext extends ParserRuleContext { + public AssignableContext assignable() { + return getRuleContext(AssignableContext.class,0); + } + public SingleExpressionContext singleExpression() { + return getRuleContext(SingleExpressionContext.class,0); + } + public FormalParameterArgContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_formalParameterArg; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).enterFormalParameterArg(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).exitFormalParameterArg(this); + } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof JavaScriptParserVisitor ) return ((JavaScriptParserVisitor)visitor).visitFormalParameterArg(this); + else return visitor.visitChildren(this); + } + } + + public final FormalParameterArgContext formalParameterArg() throws RecognitionException { + FormalParameterArgContext _localctx = new FormalParameterArgContext(_ctx, getState()); + enterRule(_localctx, 90, RULE_formalParameterArg); + int _la; + try { + enterOuterAlt(_localctx, 1); + { + setState(597); + assignable(); + setState(600); + _la = _input.LA(1); + if (_la==Assign) { + { + setState(598); + match(Assign); + setState(599); + singleExpression(0); + } + } + + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class LastFormalParameterArgContext extends ParserRuleContext { + public TerminalNode Ellipsis() { return getToken(JavaScriptParser.Ellipsis, 0); } + public SingleExpressionContext singleExpression() { + return getRuleContext(SingleExpressionContext.class,0); + } + public LastFormalParameterArgContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_lastFormalParameterArg; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).enterLastFormalParameterArg(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).exitLastFormalParameterArg(this); + } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof JavaScriptParserVisitor ) return ((JavaScriptParserVisitor)visitor).visitLastFormalParameterArg(this); + else return visitor.visitChildren(this); + } + } + + public final LastFormalParameterArgContext lastFormalParameterArg() throws RecognitionException { + LastFormalParameterArgContext _localctx = new LastFormalParameterArgContext(_ctx, getState()); + enterRule(_localctx, 92, RULE_lastFormalParameterArg); + try { + enterOuterAlt(_localctx, 1); + { + setState(602); + match(Ellipsis); + setState(603); + singleExpression(0); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class FunctionBodyContext extends ParserRuleContext { + public SourceElementsContext sourceElements() { + return getRuleContext(SourceElementsContext.class,0); + } + public FunctionBodyContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_functionBody; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).enterFunctionBody(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).exitFunctionBody(this); + } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof JavaScriptParserVisitor ) return ((JavaScriptParserVisitor)visitor).visitFunctionBody(this); + else return visitor.visitChildren(this); + } + } + + public final FunctionBodyContext functionBody() throws RecognitionException { + FunctionBodyContext _localctx = new FunctionBodyContext(_ctx, getState()); + enterRule(_localctx, 94, RULE_functionBody); + try { + enterOuterAlt(_localctx, 1); + { + setState(606); + switch ( getInterpreter().adaptivePredict(_input,67,_ctx) ) { + case 1: + { + setState(605); + sourceElements(); + } + break; + } + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class SourceElementsContext extends ParserRuleContext { + public List sourceElement() { + return getRuleContexts(SourceElementContext.class); + } + public SourceElementContext sourceElement(int i) { + return getRuleContext(SourceElementContext.class,i); + } + public SourceElementsContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_sourceElements; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).enterSourceElements(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).exitSourceElements(this); + } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof JavaScriptParserVisitor ) return ((JavaScriptParserVisitor)visitor).visitSourceElements(this); + else return visitor.visitChildren(this); + } + } + + public final SourceElementsContext sourceElements() throws RecognitionException { + SourceElementsContext _localctx = new SourceElementsContext(_ctx, getState()); + enterRule(_localctx, 96, RULE_sourceElements); + try { + int _alt; + enterOuterAlt(_localctx, 1); + { + setState(609); + _errHandler.sync(this); + _alt = 1; + do { + switch (_alt) { + case 1: + { + { + setState(608); + sourceElement(); + } + } + break; + default: + throw new NoViableAltException(this); + } + setState(611); + _errHandler.sync(this); + _alt = getInterpreter().adaptivePredict(_input,68,_ctx); + } while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class ArrayLiteralContext extends ParserRuleContext { + public ElementListContext elementList() { + return getRuleContext(ElementListContext.class,0); + } + public ArrayLiteralContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_arrayLiteral; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).enterArrayLiteral(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).exitArrayLiteral(this); + } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof JavaScriptParserVisitor ) return ((JavaScriptParserVisitor)visitor).visitArrayLiteral(this); + else return visitor.visitChildren(this); + } + } + + public final ArrayLiteralContext arrayLiteral() throws RecognitionException { + ArrayLiteralContext _localctx = new ArrayLiteralContext(_ctx, getState()); + enterRule(_localctx, 98, RULE_arrayLiteral); + try { + enterOuterAlt(_localctx, 1); + { + { + setState(613); + match(OpenBracket); + setState(614); + elementList(); + setState(615); + match(CloseBracket); + } + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class ElementListContext extends ParserRuleContext { + public List arrayElement() { + return getRuleContexts(ArrayElementContext.class); + } + public ArrayElementContext arrayElement(int i) { + return getRuleContext(ArrayElementContext.class,i); + } + public ElementListContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_elementList; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).enterElementList(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).exitElementList(this); + } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof JavaScriptParserVisitor ) return ((JavaScriptParserVisitor)visitor).visitElementList(this); + else return visitor.visitChildren(this); + } + } + + public final ElementListContext elementList() throws RecognitionException { + ElementListContext _localctx = new ElementListContext(_ctx, getState()); + enterRule(_localctx, 100, RULE_elementList); + int _la; + try { + int _alt; + enterOuterAlt(_localctx, 1); + { + setState(620); + _errHandler.sync(this); + _alt = getInterpreter().adaptivePredict(_input,69,_ctx); + while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) { + if ( _alt==1 ) { + { + { + setState(617); + match(Comma); + } + } + } + setState(622); + _errHandler.sync(this); + _alt = getInterpreter().adaptivePredict(_input,69,_ctx); + } + setState(624); + _la = _input.LA(1); + if ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << RegularExpressionLiteral) | (1L << OpenBracket) | (1L << OpenParen) | (1L << OpenBrace) | (1L << Ellipsis) | (1L << PlusPlus) | (1L << MinusMinus) | (1L << Plus) | (1L << Minus) | (1L << BitNot) | (1L << Not) | (1L << NullLiteral) | (1L << BooleanLiteral) | (1L << DecimalLiteral) | (1L << HexIntegerLiteral) | (1L << OctalIntegerLiteral))) != 0) || ((((_la - 64)) & ~0x3f) == 0 && ((1L << (_la - 64)) & ((1L << (OctalIntegerLiteral2 - 64)) | (1L << (BinaryIntegerLiteral - 64)) | (1L << (BigHexIntegerLiteral - 64)) | (1L << (BigOctalIntegerLiteral - 64)) | (1L << (BigBinaryIntegerLiteral - 64)) | (1L << (BigDecimalIntegerLiteral - 64)) | (1L << (Typeof - 64)) | (1L << (New - 64)) | (1L << (Void - 64)) | (1L << (Function - 64)) | (1L << (This - 64)) | (1L << (Delete - 64)) | (1L << (Class - 64)) | (1L << (Super - 64)) | (1L << (Import - 64)) | (1L << (Async - 64)) | (1L << (Await - 64)) | (1L << (NonStrictLet - 64)) | (1L << (Yield - 64)) | (1L << (Identifier - 64)) | (1L << (StringLiteral - 64)) | (1L << (TemplateStringLiteral - 64)))) != 0)) { + { + setState(623); + arrayElement(); + } + } + + setState(634); + _errHandler.sync(this); + _alt = getInterpreter().adaptivePredict(_input,72,_ctx); + while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) { + if ( _alt==1 ) { + { + { + setState(627); + _errHandler.sync(this); + _la = _input.LA(1); + do { + { + { + setState(626); + match(Comma); + } + } + setState(629); + _errHandler.sync(this); + _la = _input.LA(1); + } while ( _la==Comma ); + setState(631); + arrayElement(); + } + } + } + setState(636); + _errHandler.sync(this); + _alt = getInterpreter().adaptivePredict(_input,72,_ctx); + } + setState(640); + _errHandler.sync(this); + _la = _input.LA(1); + while (_la==Comma) { + { + { + setState(637); + match(Comma); + } + } + setState(642); + _errHandler.sync(this); + _la = _input.LA(1); + } + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class ArrayElementContext extends ParserRuleContext { + public SingleExpressionContext singleExpression() { + return getRuleContext(SingleExpressionContext.class,0); + } + public TerminalNode Ellipsis() { return getToken(JavaScriptParser.Ellipsis, 0); } + public ArrayElementContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_arrayElement; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).enterArrayElement(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).exitArrayElement(this); + } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof JavaScriptParserVisitor ) return ((JavaScriptParserVisitor)visitor).visitArrayElement(this); + else return visitor.visitChildren(this); + } + } + + public final ArrayElementContext arrayElement() throws RecognitionException { + ArrayElementContext _localctx = new ArrayElementContext(_ctx, getState()); + enterRule(_localctx, 102, RULE_arrayElement); + int _la; + try { + enterOuterAlt(_localctx, 1); + { + setState(644); + _la = _input.LA(1); + if (_la==Ellipsis) { + { + setState(643); + match(Ellipsis); + } + } + + setState(646); + singleExpression(0); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class PropertyAssignmentContext extends ParserRuleContext { + public PropertyAssignmentContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_propertyAssignment; } + + public PropertyAssignmentContext() { } + public void copyFrom(PropertyAssignmentContext ctx) { + super.copyFrom(ctx); + } + } + public static class PropertyExpressionAssignmentContext extends PropertyAssignmentContext { + public PropertyNameContext propertyName() { + return getRuleContext(PropertyNameContext.class,0); + } + public SingleExpressionContext singleExpression() { + return getRuleContext(SingleExpressionContext.class,0); + } + public PropertyExpressionAssignmentContext(PropertyAssignmentContext ctx) { copyFrom(ctx); } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).enterPropertyExpressionAssignment(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).exitPropertyExpressionAssignment(this); + } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof JavaScriptParserVisitor ) return ((JavaScriptParserVisitor)visitor).visitPropertyExpressionAssignment(this); + else return visitor.visitChildren(this); + } + } + public static class ComputedPropertyExpressionAssignmentContext extends PropertyAssignmentContext { + public List singleExpression() { + return getRuleContexts(SingleExpressionContext.class); + } + public SingleExpressionContext singleExpression(int i) { + return getRuleContext(SingleExpressionContext.class,i); + } + public ComputedPropertyExpressionAssignmentContext(PropertyAssignmentContext ctx) { copyFrom(ctx); } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).enterComputedPropertyExpressionAssignment(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).exitComputedPropertyExpressionAssignment(this); + } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof JavaScriptParserVisitor ) return ((JavaScriptParserVisitor)visitor).visitComputedPropertyExpressionAssignment(this); + else return visitor.visitChildren(this); + } + } + public static class PropertyShorthandContext extends PropertyAssignmentContext { + public SingleExpressionContext singleExpression() { + return getRuleContext(SingleExpressionContext.class,0); + } + public TerminalNode Ellipsis() { return getToken(JavaScriptParser.Ellipsis, 0); } + public PropertyShorthandContext(PropertyAssignmentContext ctx) { copyFrom(ctx); } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).enterPropertyShorthand(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).exitPropertyShorthand(this); + } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof JavaScriptParserVisitor ) return ((JavaScriptParserVisitor)visitor).visitPropertyShorthand(this); + else return visitor.visitChildren(this); + } + } + public static class PropertySetterContext extends PropertyAssignmentContext { + public SetterContext setter() { + return getRuleContext(SetterContext.class,0); + } + public FormalParameterArgContext formalParameterArg() { + return getRuleContext(FormalParameterArgContext.class,0); + } + public FunctionBodyContext functionBody() { + return getRuleContext(FunctionBodyContext.class,0); + } + public PropertySetterContext(PropertyAssignmentContext ctx) { copyFrom(ctx); } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).enterPropertySetter(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).exitPropertySetter(this); + } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof JavaScriptParserVisitor ) return ((JavaScriptParserVisitor)visitor).visitPropertySetter(this); + else return visitor.visitChildren(this); + } + } + public static class PropertyGetterContext extends PropertyAssignmentContext { + public GetterContext getter() { + return getRuleContext(GetterContext.class,0); + } + public FunctionBodyContext functionBody() { + return getRuleContext(FunctionBodyContext.class,0); + } + public PropertyGetterContext(PropertyAssignmentContext ctx) { copyFrom(ctx); } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).enterPropertyGetter(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).exitPropertyGetter(this); + } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof JavaScriptParserVisitor ) return ((JavaScriptParserVisitor)visitor).visitPropertyGetter(this); + else return visitor.visitChildren(this); + } + } + public static class FunctionPropertyContext extends PropertyAssignmentContext { + public PropertyNameContext propertyName() { + return getRuleContext(PropertyNameContext.class,0); + } + public FunctionBodyContext functionBody() { + return getRuleContext(FunctionBodyContext.class,0); + } + public TerminalNode Async() { return getToken(JavaScriptParser.Async, 0); } + public FormalParameterListContext formalParameterList() { + return getRuleContext(FormalParameterListContext.class,0); + } + public FunctionPropertyContext(PropertyAssignmentContext ctx) { copyFrom(ctx); } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).enterFunctionProperty(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).exitFunctionProperty(this); + } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof JavaScriptParserVisitor ) return ((JavaScriptParserVisitor)visitor).visitFunctionProperty(this); + else return visitor.visitChildren(this); + } + } + + public final PropertyAssignmentContext propertyAssignment() throws RecognitionException { + PropertyAssignmentContext _localctx = new PropertyAssignmentContext(_ctx, getState()); + enterRule(_localctx, 104, RULE_propertyAssignment); + int _la; + try { + setState(693); + switch ( getInterpreter().adaptivePredict(_input,79,_ctx) ) { + case 1: + _localctx = new PropertyExpressionAssignmentContext(_localctx); + enterOuterAlt(_localctx, 1); + { + setState(648); + propertyName(); + setState(649); + match(Colon); + setState(650); + singleExpression(0); + } + break; + case 2: + _localctx = new ComputedPropertyExpressionAssignmentContext(_localctx); + enterOuterAlt(_localctx, 2); + { + setState(652); + match(OpenBracket); + setState(653); + singleExpression(0); + setState(654); + match(CloseBracket); + setState(655); + match(Colon); + setState(656); + singleExpression(0); + } + break; + case 3: + _localctx = new FunctionPropertyContext(_localctx); + enterOuterAlt(_localctx, 3); + { + setState(659); + switch ( getInterpreter().adaptivePredict(_input,75,_ctx) ) { + case 1: + { + setState(658); + match(Async); + } + break; + } + setState(662); + _la = _input.LA(1); + if (_la==Multiply) { + { + setState(661); + match(Multiply); + } + } + + setState(664); + propertyName(); + setState(665); + match(OpenParen); + setState(667); + _la = _input.LA(1); + if ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << OpenBracket) | (1L << OpenBrace) | (1L << Ellipsis))) != 0) || ((((_la - 105)) & ~0x3f) == 0 && ((1L << (_la - 105)) & ((1L << (Async - 105)) | (1L << (NonStrictLet - 105)) | (1L << (Identifier - 105)))) != 0)) { + { + setState(666); + formalParameterList(); + } + } + + setState(669); + match(CloseParen); + setState(670); + match(OpenBrace); + setState(671); + functionBody(); + setState(672); + match(CloseBrace); + } + break; + case 4: + _localctx = new PropertyGetterContext(_localctx); + enterOuterAlt(_localctx, 4); + { + setState(674); + getter(); + setState(675); + match(OpenParen); + setState(676); + match(CloseParen); + setState(677); + match(OpenBrace); + setState(678); + functionBody(); + setState(679); + match(CloseBrace); + } + break; + case 5: + _localctx = new PropertySetterContext(_localctx); + enterOuterAlt(_localctx, 5); + { + setState(681); + setter(); + setState(682); + match(OpenParen); + setState(683); + formalParameterArg(); + setState(684); + match(CloseParen); + setState(685); + match(OpenBrace); + setState(686); + functionBody(); + setState(687); + match(CloseBrace); + } + break; + case 6: + _localctx = new PropertyShorthandContext(_localctx); + enterOuterAlt(_localctx, 6); + { + setState(690); + _la = _input.LA(1); + if (_la==Ellipsis) { + { + setState(689); + match(Ellipsis); + } + } + + setState(692); + singleExpression(0); + } + break; + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class PropertyNameContext extends ParserRuleContext { + public IdentifierNameContext identifierName() { + return getRuleContext(IdentifierNameContext.class,0); + } + public TerminalNode StringLiteral() { return getToken(JavaScriptParser.StringLiteral, 0); } + public NumericLiteralContext numericLiteral() { + return getRuleContext(NumericLiteralContext.class,0); + } + public SingleExpressionContext singleExpression() { + return getRuleContext(SingleExpressionContext.class,0); + } + public PropertyNameContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_propertyName; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).enterPropertyName(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).exitPropertyName(this); + } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof JavaScriptParserVisitor ) return ((JavaScriptParserVisitor)visitor).visitPropertyName(this); + else return visitor.visitChildren(this); + } + } + + public final PropertyNameContext propertyName() throws RecognitionException { + PropertyNameContext _localctx = new PropertyNameContext(_ctx, getState()); + enterRule(_localctx, 106, RULE_propertyName); + try { + setState(702); + switch (_input.LA(1)) { + case NullLiteral: + case BooleanLiteral: + case Break: + case Do: + case Instanceof: + case Typeof: + case Case: + case Else: + case New: + case Var: + case Catch: + case Finally: + case Return: + case Void: + case Continue: + case For: + case Switch: + case While: + case Debugger: + case Function: + case This: + case With: + case Default: + case If: + case Throw: + case Delete: + case In: + case Try: + case As: + case From: + case Class: + case Enum: + case Extends: + case Super: + case Const: + case Export: + case Import: + case Async: + case Await: + case Implements: + case StrictLet: + case NonStrictLet: + case Private: + case Public: + case Interface: + case Package: + case Protected: + case Static: + case Yield: + case Identifier: + enterOuterAlt(_localctx, 1); + { + setState(695); + identifierName(); + } + break; + case StringLiteral: + enterOuterAlt(_localctx, 2); + { + setState(696); + match(StringLiteral); + } + break; + case DecimalLiteral: + case HexIntegerLiteral: + case OctalIntegerLiteral: + case OctalIntegerLiteral2: + case BinaryIntegerLiteral: + enterOuterAlt(_localctx, 3); + { + setState(697); + numericLiteral(); + } + break; + case OpenBracket: + enterOuterAlt(_localctx, 4); + { + setState(698); + match(OpenBracket); + setState(699); + singleExpression(0); + setState(700); + match(CloseBracket); + } + break; + default: + throw new NoViableAltException(this); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class ArgumentsContext extends ParserRuleContext { + public List argument() { + return getRuleContexts(ArgumentContext.class); + } + public ArgumentContext argument(int i) { + return getRuleContext(ArgumentContext.class,i); + } + public ArgumentsContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_arguments; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).enterArguments(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).exitArguments(this); + } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof JavaScriptParserVisitor ) return ((JavaScriptParserVisitor)visitor).visitArguments(this); + else return visitor.visitChildren(this); + } + } + + public final ArgumentsContext arguments() throws RecognitionException { + ArgumentsContext _localctx = new ArgumentsContext(_ctx, getState()); + enterRule(_localctx, 108, RULE_arguments); + int _la; + try { + int _alt; + enterOuterAlt(_localctx, 1); + { + setState(704); + match(OpenParen); + setState(716); + _la = _input.LA(1); + if ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << RegularExpressionLiteral) | (1L << OpenBracket) | (1L << OpenParen) | (1L << OpenBrace) | (1L << Ellipsis) | (1L << PlusPlus) | (1L << MinusMinus) | (1L << Plus) | (1L << Minus) | (1L << BitNot) | (1L << Not) | (1L << NullLiteral) | (1L << BooleanLiteral) | (1L << DecimalLiteral) | (1L << HexIntegerLiteral) | (1L << OctalIntegerLiteral))) != 0) || ((((_la - 64)) & ~0x3f) == 0 && ((1L << (_la - 64)) & ((1L << (OctalIntegerLiteral2 - 64)) | (1L << (BinaryIntegerLiteral - 64)) | (1L << (BigHexIntegerLiteral - 64)) | (1L << (BigOctalIntegerLiteral - 64)) | (1L << (BigBinaryIntegerLiteral - 64)) | (1L << (BigDecimalIntegerLiteral - 64)) | (1L << (Typeof - 64)) | (1L << (New - 64)) | (1L << (Void - 64)) | (1L << (Function - 64)) | (1L << (This - 64)) | (1L << (Delete - 64)) | (1L << (Class - 64)) | (1L << (Super - 64)) | (1L << (Import - 64)) | (1L << (Async - 64)) | (1L << (Await - 64)) | (1L << (NonStrictLet - 64)) | (1L << (Yield - 64)) | (1L << (Identifier - 64)) | (1L << (StringLiteral - 64)) | (1L << (TemplateStringLiteral - 64)))) != 0)) { + { + setState(705); + argument(); + setState(710); + _errHandler.sync(this); + _alt = getInterpreter().adaptivePredict(_input,81,_ctx); + while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) { + if ( _alt==1 ) { + { + { + setState(706); + match(Comma); + setState(707); + argument(); + } + } + } + setState(712); + _errHandler.sync(this); + _alt = getInterpreter().adaptivePredict(_input,81,_ctx); + } + setState(714); + _la = _input.LA(1); + if (_la==Comma) { + { + setState(713); + match(Comma); + } + } + + } + } + + setState(718); + match(CloseParen); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class ArgumentContext extends ParserRuleContext { + public SingleExpressionContext singleExpression() { + return getRuleContext(SingleExpressionContext.class,0); + } + public IdentifierContext identifier() { + return getRuleContext(IdentifierContext.class,0); + } + public TerminalNode Ellipsis() { return getToken(JavaScriptParser.Ellipsis, 0); } + public ArgumentContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_argument; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).enterArgument(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).exitArgument(this); + } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof JavaScriptParserVisitor ) return ((JavaScriptParserVisitor)visitor).visitArgument(this); + else return visitor.visitChildren(this); + } + } + + public final ArgumentContext argument() throws RecognitionException { + ArgumentContext _localctx = new ArgumentContext(_ctx, getState()); + enterRule(_localctx, 110, RULE_argument); + int _la; + try { + enterOuterAlt(_localctx, 1); + { + setState(721); + _la = _input.LA(1); + if (_la==Ellipsis) { + { + setState(720); + match(Ellipsis); + } + } + + setState(725); + switch ( getInterpreter().adaptivePredict(_input,85,_ctx) ) { + case 1: + { + setState(723); + singleExpression(0); + } + break; + case 2: + { + setState(724); + identifier(); + } + break; + } + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class ExpressionSequenceContext extends ParserRuleContext { + public List singleExpression() { + return getRuleContexts(SingleExpressionContext.class); + } + public SingleExpressionContext singleExpression(int i) { + return getRuleContext(SingleExpressionContext.class,i); + } + public ExpressionSequenceContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_expressionSequence; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).enterExpressionSequence(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).exitExpressionSequence(this); + } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof JavaScriptParserVisitor ) return ((JavaScriptParserVisitor)visitor).visitExpressionSequence(this); + else return visitor.visitChildren(this); + } + } + + public final ExpressionSequenceContext expressionSequence() throws RecognitionException { + ExpressionSequenceContext _localctx = new ExpressionSequenceContext(_ctx, getState()); + enterRule(_localctx, 112, RULE_expressionSequence); + try { + int _alt; + enterOuterAlt(_localctx, 1); + { + setState(727); + singleExpression(0); + setState(732); + _errHandler.sync(this); + _alt = getInterpreter().adaptivePredict(_input,86,_ctx); + while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) { + if ( _alt==1 ) { + { + { + setState(728); + match(Comma); + setState(729); + singleExpression(0); + } + } + } + setState(734); + _errHandler.sync(this); + _alt = getInterpreter().adaptivePredict(_input,86,_ctx); + } + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class SingleExpressionContext extends ParserRuleContext { + public SingleExpressionContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_singleExpression; } + + public SingleExpressionContext() { } + public void copyFrom(SingleExpressionContext ctx) { + super.copyFrom(ctx); + } + } + public static class TemplateStringExpressionContext extends SingleExpressionContext { + public SingleExpressionContext singleExpression() { + return getRuleContext(SingleExpressionContext.class,0); + } + public TerminalNode TemplateStringLiteral() { return getToken(JavaScriptParser.TemplateStringLiteral, 0); } + public TemplateStringExpressionContext(SingleExpressionContext ctx) { copyFrom(ctx); } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).enterTemplateStringExpression(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).exitTemplateStringExpression(this); + } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof JavaScriptParserVisitor ) return ((JavaScriptParserVisitor)visitor).visitTemplateStringExpression(this); + else return visitor.visitChildren(this); + } + } + public static class TernaryExpressionContext extends SingleExpressionContext { + public List singleExpression() { + return getRuleContexts(SingleExpressionContext.class); + } + public SingleExpressionContext singleExpression(int i) { + return getRuleContext(SingleExpressionContext.class,i); + } + public TernaryExpressionContext(SingleExpressionContext ctx) { copyFrom(ctx); } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).enterTernaryExpression(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).exitTernaryExpression(this); + } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof JavaScriptParserVisitor ) return ((JavaScriptParserVisitor)visitor).visitTernaryExpression(this); + else return visitor.visitChildren(this); + } + } + public static class LogicalAndExpressionContext extends SingleExpressionContext { + public List singleExpression() { + return getRuleContexts(SingleExpressionContext.class); + } + public SingleExpressionContext singleExpression(int i) { + return getRuleContext(SingleExpressionContext.class,i); + } + public LogicalAndExpressionContext(SingleExpressionContext ctx) { copyFrom(ctx); } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).enterLogicalAndExpression(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).exitLogicalAndExpression(this); + } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof JavaScriptParserVisitor ) return ((JavaScriptParserVisitor)visitor).visitLogicalAndExpression(this); + else return visitor.visitChildren(this); + } + } + public static class PowerExpressionContext extends SingleExpressionContext { + public List singleExpression() { + return getRuleContexts(SingleExpressionContext.class); + } + public SingleExpressionContext singleExpression(int i) { + return getRuleContext(SingleExpressionContext.class,i); + } + public PowerExpressionContext(SingleExpressionContext ctx) { copyFrom(ctx); } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).enterPowerExpression(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).exitPowerExpression(this); + } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof JavaScriptParserVisitor ) return ((JavaScriptParserVisitor)visitor).visitPowerExpression(this); + else return visitor.visitChildren(this); + } + } + public static class PreIncrementExpressionContext extends SingleExpressionContext { + public SingleExpressionContext singleExpression() { + return getRuleContext(SingleExpressionContext.class,0); + } + public PreIncrementExpressionContext(SingleExpressionContext ctx) { copyFrom(ctx); } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).enterPreIncrementExpression(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).exitPreIncrementExpression(this); + } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof JavaScriptParserVisitor ) return ((JavaScriptParserVisitor)visitor).visitPreIncrementExpression(this); + else return visitor.visitChildren(this); + } + } + public static class ObjectLiteralExpressionContext extends SingleExpressionContext { + public ObjectLiteralContext objectLiteral() { + return getRuleContext(ObjectLiteralContext.class,0); + } + public ObjectLiteralExpressionContext(SingleExpressionContext ctx) { copyFrom(ctx); } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).enterObjectLiteralExpression(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).exitObjectLiteralExpression(this); + } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof JavaScriptParserVisitor ) return ((JavaScriptParserVisitor)visitor).visitObjectLiteralExpression(this); + else return visitor.visitChildren(this); + } + } + public static class MetaExpressionContext extends SingleExpressionContext { + public TerminalNode New() { return getToken(JavaScriptParser.New, 0); } + public IdentifierContext identifier() { + return getRuleContext(IdentifierContext.class,0); + } + public MetaExpressionContext(SingleExpressionContext ctx) { copyFrom(ctx); } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).enterMetaExpression(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).exitMetaExpression(this); + } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof JavaScriptParserVisitor ) return ((JavaScriptParserVisitor)visitor).visitMetaExpression(this); + else return visitor.visitChildren(this); + } + } + public static class InExpressionContext extends SingleExpressionContext { + public List singleExpression() { + return getRuleContexts(SingleExpressionContext.class); + } + public SingleExpressionContext singleExpression(int i) { + return getRuleContext(SingleExpressionContext.class,i); + } + public TerminalNode In() { return getToken(JavaScriptParser.In, 0); } + public InExpressionContext(SingleExpressionContext ctx) { copyFrom(ctx); } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).enterInExpression(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).exitInExpression(this); + } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof JavaScriptParserVisitor ) return ((JavaScriptParserVisitor)visitor).visitInExpression(this); + else return visitor.visitChildren(this); + } + } + public static class LogicalOrExpressionContext extends SingleExpressionContext { + public List singleExpression() { + return getRuleContexts(SingleExpressionContext.class); + } + public SingleExpressionContext singleExpression(int i) { + return getRuleContext(SingleExpressionContext.class,i); + } + public LogicalOrExpressionContext(SingleExpressionContext ctx) { copyFrom(ctx); } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).enterLogicalOrExpression(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).exitLogicalOrExpression(this); + } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof JavaScriptParserVisitor ) return ((JavaScriptParserVisitor)visitor).visitLogicalOrExpression(this); + else return visitor.visitChildren(this); + } + } + public static class NotExpressionContext extends SingleExpressionContext { + public SingleExpressionContext singleExpression() { + return getRuleContext(SingleExpressionContext.class,0); + } + public NotExpressionContext(SingleExpressionContext ctx) { copyFrom(ctx); } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).enterNotExpression(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).exitNotExpression(this); + } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof JavaScriptParserVisitor ) return ((JavaScriptParserVisitor)visitor).visitNotExpression(this); + else return visitor.visitChildren(this); + } + } + public static class PreDecreaseExpressionContext extends SingleExpressionContext { + public SingleExpressionContext singleExpression() { + return getRuleContext(SingleExpressionContext.class,0); + } + public PreDecreaseExpressionContext(SingleExpressionContext ctx) { copyFrom(ctx); } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).enterPreDecreaseExpression(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).exitPreDecreaseExpression(this); + } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof JavaScriptParserVisitor ) return ((JavaScriptParserVisitor)visitor).visitPreDecreaseExpression(this); + else return visitor.visitChildren(this); + } + } + public static class ArgumentsExpressionContext extends SingleExpressionContext { + public SingleExpressionContext singleExpression() { + return getRuleContext(SingleExpressionContext.class,0); + } + public ArgumentsContext arguments() { + return getRuleContext(ArgumentsContext.class,0); + } + public ArgumentsExpressionContext(SingleExpressionContext ctx) { copyFrom(ctx); } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).enterArgumentsExpression(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).exitArgumentsExpression(this); + } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof JavaScriptParserVisitor ) return ((JavaScriptParserVisitor)visitor).visitArgumentsExpression(this); + else return visitor.visitChildren(this); + } + } + public static class AwaitExpressionContext extends SingleExpressionContext { + public TerminalNode Await() { return getToken(JavaScriptParser.Await, 0); } + public SingleExpressionContext singleExpression() { + return getRuleContext(SingleExpressionContext.class,0); + } + public AwaitExpressionContext(SingleExpressionContext ctx) { copyFrom(ctx); } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).enterAwaitExpression(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).exitAwaitExpression(this); + } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof JavaScriptParserVisitor ) return ((JavaScriptParserVisitor)visitor).visitAwaitExpression(this); + else return visitor.visitChildren(this); + } + } + public static class ThisExpressionContext extends SingleExpressionContext { + public TerminalNode This() { return getToken(JavaScriptParser.This, 0); } + public ThisExpressionContext(SingleExpressionContext ctx) { copyFrom(ctx); } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).enterThisExpression(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).exitThisExpression(this); + } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof JavaScriptParserVisitor ) return ((JavaScriptParserVisitor)visitor).visitThisExpression(this); + else return visitor.visitChildren(this); + } + } + public static class FunctionExpressionContext extends SingleExpressionContext { + public AnoymousFunctionContext anoymousFunction() { + return getRuleContext(AnoymousFunctionContext.class,0); + } + public FunctionExpressionContext(SingleExpressionContext ctx) { copyFrom(ctx); } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).enterFunctionExpression(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).exitFunctionExpression(this); + } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof JavaScriptParserVisitor ) return ((JavaScriptParserVisitor)visitor).visitFunctionExpression(this); + else return visitor.visitChildren(this); + } + } + public static class UnaryMinusExpressionContext extends SingleExpressionContext { + public SingleExpressionContext singleExpression() { + return getRuleContext(SingleExpressionContext.class,0); + } + public UnaryMinusExpressionContext(SingleExpressionContext ctx) { copyFrom(ctx); } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).enterUnaryMinusExpression(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).exitUnaryMinusExpression(this); + } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof JavaScriptParserVisitor ) return ((JavaScriptParserVisitor)visitor).visitUnaryMinusExpression(this); + else return visitor.visitChildren(this); + } + } + public static class AssignmentExpressionContext extends SingleExpressionContext { + public List singleExpression() { + return getRuleContexts(SingleExpressionContext.class); + } + public SingleExpressionContext singleExpression(int i) { + return getRuleContext(SingleExpressionContext.class,i); + } + public AssignmentExpressionContext(SingleExpressionContext ctx) { copyFrom(ctx); } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).enterAssignmentExpression(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).exitAssignmentExpression(this); + } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof JavaScriptParserVisitor ) return ((JavaScriptParserVisitor)visitor).visitAssignmentExpression(this); + else return visitor.visitChildren(this); + } + } + public static class PostDecreaseExpressionContext extends SingleExpressionContext { + public SingleExpressionContext singleExpression() { + return getRuleContext(SingleExpressionContext.class,0); + } + public PostDecreaseExpressionContext(SingleExpressionContext ctx) { copyFrom(ctx); } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).enterPostDecreaseExpression(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).exitPostDecreaseExpression(this); + } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof JavaScriptParserVisitor ) return ((JavaScriptParserVisitor)visitor).visitPostDecreaseExpression(this); + else return visitor.visitChildren(this); + } + } + public static class TypeofExpressionContext extends SingleExpressionContext { + public TerminalNode Typeof() { return getToken(JavaScriptParser.Typeof, 0); } + public SingleExpressionContext singleExpression() { + return getRuleContext(SingleExpressionContext.class,0); + } + public TypeofExpressionContext(SingleExpressionContext ctx) { copyFrom(ctx); } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).enterTypeofExpression(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).exitTypeofExpression(this); + } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof JavaScriptParserVisitor ) return ((JavaScriptParserVisitor)visitor).visitTypeofExpression(this); + else return visitor.visitChildren(this); + } + } + public static class InstanceofExpressionContext extends SingleExpressionContext { + public List singleExpression() { + return getRuleContexts(SingleExpressionContext.class); + } + public SingleExpressionContext singleExpression(int i) { + return getRuleContext(SingleExpressionContext.class,i); + } + public TerminalNode Instanceof() { return getToken(JavaScriptParser.Instanceof, 0); } + public InstanceofExpressionContext(SingleExpressionContext ctx) { copyFrom(ctx); } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).enterInstanceofExpression(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).exitInstanceofExpression(this); + } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof JavaScriptParserVisitor ) return ((JavaScriptParserVisitor)visitor).visitInstanceofExpression(this); + else return visitor.visitChildren(this); + } + } + public static class UnaryPlusExpressionContext extends SingleExpressionContext { + public SingleExpressionContext singleExpression() { + return getRuleContext(SingleExpressionContext.class,0); + } + public UnaryPlusExpressionContext(SingleExpressionContext ctx) { copyFrom(ctx); } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).enterUnaryPlusExpression(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).exitUnaryPlusExpression(this); + } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof JavaScriptParserVisitor ) return ((JavaScriptParserVisitor)visitor).visitUnaryPlusExpression(this); + else return visitor.visitChildren(this); + } + } + public static class DeleteExpressionContext extends SingleExpressionContext { + public TerminalNode Delete() { return getToken(JavaScriptParser.Delete, 0); } + public SingleExpressionContext singleExpression() { + return getRuleContext(SingleExpressionContext.class,0); + } + public DeleteExpressionContext(SingleExpressionContext ctx) { copyFrom(ctx); } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).enterDeleteExpression(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).exitDeleteExpression(this); + } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof JavaScriptParserVisitor ) return ((JavaScriptParserVisitor)visitor).visitDeleteExpression(this); + else return visitor.visitChildren(this); + } + } + public static class ImportExpressionContext extends SingleExpressionContext { + public TerminalNode Import() { return getToken(JavaScriptParser.Import, 0); } + public SingleExpressionContext singleExpression() { + return getRuleContext(SingleExpressionContext.class,0); + } + public ImportExpressionContext(SingleExpressionContext ctx) { copyFrom(ctx); } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).enterImportExpression(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).exitImportExpression(this); + } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof JavaScriptParserVisitor ) return ((JavaScriptParserVisitor)visitor).visitImportExpression(this); + else return visitor.visitChildren(this); + } + } + public static class EqualityExpressionContext extends SingleExpressionContext { + public List singleExpression() { + return getRuleContexts(SingleExpressionContext.class); + } + public SingleExpressionContext singleExpression(int i) { + return getRuleContext(SingleExpressionContext.class,i); + } + public EqualityExpressionContext(SingleExpressionContext ctx) { copyFrom(ctx); } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).enterEqualityExpression(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).exitEqualityExpression(this); + } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof JavaScriptParserVisitor ) return ((JavaScriptParserVisitor)visitor).visitEqualityExpression(this); + else return visitor.visitChildren(this); + } + } + public static class BitXOrExpressionContext extends SingleExpressionContext { + public List singleExpression() { + return getRuleContexts(SingleExpressionContext.class); + } + public SingleExpressionContext singleExpression(int i) { + return getRuleContext(SingleExpressionContext.class,i); + } + public BitXOrExpressionContext(SingleExpressionContext ctx) { copyFrom(ctx); } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).enterBitXOrExpression(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).exitBitXOrExpression(this); + } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof JavaScriptParserVisitor ) return ((JavaScriptParserVisitor)visitor).visitBitXOrExpression(this); + else return visitor.visitChildren(this); + } + } + public static class SuperExpressionContext extends SingleExpressionContext { + public TerminalNode Super() { return getToken(JavaScriptParser.Super, 0); } + public SuperExpressionContext(SingleExpressionContext ctx) { copyFrom(ctx); } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).enterSuperExpression(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).exitSuperExpression(this); + } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof JavaScriptParserVisitor ) return ((JavaScriptParserVisitor)visitor).visitSuperExpression(this); + else return visitor.visitChildren(this); + } + } + public static class MultiplicativeExpressionContext extends SingleExpressionContext { + public List singleExpression() { + return getRuleContexts(SingleExpressionContext.class); + } + public SingleExpressionContext singleExpression(int i) { + return getRuleContext(SingleExpressionContext.class,i); + } + public MultiplicativeExpressionContext(SingleExpressionContext ctx) { copyFrom(ctx); } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).enterMultiplicativeExpression(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).exitMultiplicativeExpression(this); + } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof JavaScriptParserVisitor ) return ((JavaScriptParserVisitor)visitor).visitMultiplicativeExpression(this); + else return visitor.visitChildren(this); + } + } + public static class BitShiftExpressionContext extends SingleExpressionContext { + public List singleExpression() { + return getRuleContexts(SingleExpressionContext.class); + } + public SingleExpressionContext singleExpression(int i) { + return getRuleContext(SingleExpressionContext.class,i); + } + public BitShiftExpressionContext(SingleExpressionContext ctx) { copyFrom(ctx); } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).enterBitShiftExpression(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).exitBitShiftExpression(this); + } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof JavaScriptParserVisitor ) return ((JavaScriptParserVisitor)visitor).visitBitShiftExpression(this); + else return visitor.visitChildren(this); + } + } + public static class ParenthesizedExpressionContext extends SingleExpressionContext { + public ExpressionSequenceContext expressionSequence() { + return getRuleContext(ExpressionSequenceContext.class,0); + } + public ParenthesizedExpressionContext(SingleExpressionContext ctx) { copyFrom(ctx); } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).enterParenthesizedExpression(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).exitParenthesizedExpression(this); + } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof JavaScriptParserVisitor ) return ((JavaScriptParserVisitor)visitor).visitParenthesizedExpression(this); + else return visitor.visitChildren(this); + } + } + public static class AdditiveExpressionContext extends SingleExpressionContext { + public List singleExpression() { + return getRuleContexts(SingleExpressionContext.class); + } + public SingleExpressionContext singleExpression(int i) { + return getRuleContext(SingleExpressionContext.class,i); + } + public AdditiveExpressionContext(SingleExpressionContext ctx) { copyFrom(ctx); } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).enterAdditiveExpression(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).exitAdditiveExpression(this); + } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof JavaScriptParserVisitor ) return ((JavaScriptParserVisitor)visitor).visitAdditiveExpression(this); + else return visitor.visitChildren(this); + } + } + public static class RelationalExpressionContext extends SingleExpressionContext { + public List singleExpression() { + return getRuleContexts(SingleExpressionContext.class); + } + public SingleExpressionContext singleExpression(int i) { + return getRuleContext(SingleExpressionContext.class,i); + } + public RelationalExpressionContext(SingleExpressionContext ctx) { copyFrom(ctx); } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).enterRelationalExpression(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).exitRelationalExpression(this); + } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof JavaScriptParserVisitor ) return ((JavaScriptParserVisitor)visitor).visitRelationalExpression(this); + else return visitor.visitChildren(this); + } + } + public static class PostIncrementExpressionContext extends SingleExpressionContext { + public SingleExpressionContext singleExpression() { + return getRuleContext(SingleExpressionContext.class,0); + } + public PostIncrementExpressionContext(SingleExpressionContext ctx) { copyFrom(ctx); } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).enterPostIncrementExpression(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).exitPostIncrementExpression(this); + } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof JavaScriptParserVisitor ) return ((JavaScriptParserVisitor)visitor).visitPostIncrementExpression(this); + else return visitor.visitChildren(this); + } + } + public static class YieldExpressionContext extends SingleExpressionContext { + public YieldStatementContext yieldStatement() { + return getRuleContext(YieldStatementContext.class,0); + } + public YieldExpressionContext(SingleExpressionContext ctx) { copyFrom(ctx); } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).enterYieldExpression(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).exitYieldExpression(this); + } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof JavaScriptParserVisitor ) return ((JavaScriptParserVisitor)visitor).visitYieldExpression(this); + else return visitor.visitChildren(this); + } + } + public static class BitNotExpressionContext extends SingleExpressionContext { + public SingleExpressionContext singleExpression() { + return getRuleContext(SingleExpressionContext.class,0); + } + public BitNotExpressionContext(SingleExpressionContext ctx) { copyFrom(ctx); } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).enterBitNotExpression(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).exitBitNotExpression(this); + } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof JavaScriptParserVisitor ) return ((JavaScriptParserVisitor)visitor).visitBitNotExpression(this); + else return visitor.visitChildren(this); + } + } + public static class NewExpressionContext extends SingleExpressionContext { + public TerminalNode New() { return getToken(JavaScriptParser.New, 0); } + public SingleExpressionContext singleExpression() { + return getRuleContext(SingleExpressionContext.class,0); + } + public ArgumentsContext arguments() { + return getRuleContext(ArgumentsContext.class,0); + } + public NewExpressionContext(SingleExpressionContext ctx) { copyFrom(ctx); } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).enterNewExpression(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).exitNewExpression(this); + } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof JavaScriptParserVisitor ) return ((JavaScriptParserVisitor)visitor).visitNewExpression(this); + else return visitor.visitChildren(this); + } + } + public static class LiteralExpressionContext extends SingleExpressionContext { + public LiteralContext literal() { + return getRuleContext(LiteralContext.class,0); + } + public LiteralExpressionContext(SingleExpressionContext ctx) { copyFrom(ctx); } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).enterLiteralExpression(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).exitLiteralExpression(this); + } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof JavaScriptParserVisitor ) return ((JavaScriptParserVisitor)visitor).visitLiteralExpression(this); + else return visitor.visitChildren(this); + } + } + public static class ArrayLiteralExpressionContext extends SingleExpressionContext { + public ArrayLiteralContext arrayLiteral() { + return getRuleContext(ArrayLiteralContext.class,0); + } + public ArrayLiteralExpressionContext(SingleExpressionContext ctx) { copyFrom(ctx); } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).enterArrayLiteralExpression(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).exitArrayLiteralExpression(this); + } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof JavaScriptParserVisitor ) return ((JavaScriptParserVisitor)visitor).visitArrayLiteralExpression(this); + else return visitor.visitChildren(this); + } + } + public static class MemberDotExpressionContext extends SingleExpressionContext { + public SingleExpressionContext singleExpression() { + return getRuleContext(SingleExpressionContext.class,0); + } + public IdentifierNameContext identifierName() { + return getRuleContext(IdentifierNameContext.class,0); + } + public MemberDotExpressionContext(SingleExpressionContext ctx) { copyFrom(ctx); } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).enterMemberDotExpression(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).exitMemberDotExpression(this); + } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof JavaScriptParserVisitor ) return ((JavaScriptParserVisitor)visitor).visitMemberDotExpression(this); + else return visitor.visitChildren(this); + } + } + public static class ClassExpressionContext extends SingleExpressionContext { + public TerminalNode Class() { return getToken(JavaScriptParser.Class, 0); } + public ClassTailContext classTail() { + return getRuleContext(ClassTailContext.class,0); + } + public IdentifierContext identifier() { + return getRuleContext(IdentifierContext.class,0); + } + public ClassExpressionContext(SingleExpressionContext ctx) { copyFrom(ctx); } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).enterClassExpression(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).exitClassExpression(this); + } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof JavaScriptParserVisitor ) return ((JavaScriptParserVisitor)visitor).visitClassExpression(this); + else return visitor.visitChildren(this); + } + } + public static class MemberIndexExpressionContext extends SingleExpressionContext { + public SingleExpressionContext singleExpression() { + return getRuleContext(SingleExpressionContext.class,0); + } + public ExpressionSequenceContext expressionSequence() { + return getRuleContext(ExpressionSequenceContext.class,0); + } + public MemberIndexExpressionContext(SingleExpressionContext ctx) { copyFrom(ctx); } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).enterMemberIndexExpression(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).exitMemberIndexExpression(this); + } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof JavaScriptParserVisitor ) return ((JavaScriptParserVisitor)visitor).visitMemberIndexExpression(this); + else return visitor.visitChildren(this); + } + } + public static class IdentifierExpressionContext extends SingleExpressionContext { + public IdentifierContext identifier() { + return getRuleContext(IdentifierContext.class,0); + } + public IdentifierExpressionContext(SingleExpressionContext ctx) { copyFrom(ctx); } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).enterIdentifierExpression(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).exitIdentifierExpression(this); + } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof JavaScriptParserVisitor ) return ((JavaScriptParserVisitor)visitor).visitIdentifierExpression(this); + else return visitor.visitChildren(this); + } + } + public static class BitAndExpressionContext extends SingleExpressionContext { + public List singleExpression() { + return getRuleContexts(SingleExpressionContext.class); + } + public SingleExpressionContext singleExpression(int i) { + return getRuleContext(SingleExpressionContext.class,i); + } + public BitAndExpressionContext(SingleExpressionContext ctx) { copyFrom(ctx); } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).enterBitAndExpression(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).exitBitAndExpression(this); + } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof JavaScriptParserVisitor ) return ((JavaScriptParserVisitor)visitor).visitBitAndExpression(this); + else return visitor.visitChildren(this); + } + } + public static class BitOrExpressionContext extends SingleExpressionContext { + public List singleExpression() { + return getRuleContexts(SingleExpressionContext.class); + } + public SingleExpressionContext singleExpression(int i) { + return getRuleContext(SingleExpressionContext.class,i); + } + public BitOrExpressionContext(SingleExpressionContext ctx) { copyFrom(ctx); } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).enterBitOrExpression(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).exitBitOrExpression(this); + } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof JavaScriptParserVisitor ) return ((JavaScriptParserVisitor)visitor).visitBitOrExpression(this); + else return visitor.visitChildren(this); + } + } + public static class AssignmentOperatorExpressionContext extends SingleExpressionContext { + public List singleExpression() { + return getRuleContexts(SingleExpressionContext.class); + } + public SingleExpressionContext singleExpression(int i) { + return getRuleContext(SingleExpressionContext.class,i); + } + public AssignmentOperatorContext assignmentOperator() { + return getRuleContext(AssignmentOperatorContext.class,0); + } + public AssignmentOperatorExpressionContext(SingleExpressionContext ctx) { copyFrom(ctx); } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).enterAssignmentOperatorExpression(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).exitAssignmentOperatorExpression(this); + } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof JavaScriptParserVisitor ) return ((JavaScriptParserVisitor)visitor).visitAssignmentOperatorExpression(this); + else return visitor.visitChildren(this); + } + } + public static class VoidExpressionContext extends SingleExpressionContext { + public TerminalNode Void() { return getToken(JavaScriptParser.Void, 0); } + public SingleExpressionContext singleExpression() { + return getRuleContext(SingleExpressionContext.class,0); + } + public VoidExpressionContext(SingleExpressionContext ctx) { copyFrom(ctx); } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).enterVoidExpression(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).exitVoidExpression(this); + } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof JavaScriptParserVisitor ) return ((JavaScriptParserVisitor)visitor).visitVoidExpression(this); + else return visitor.visitChildren(this); + } + } + public static class CoalesceExpressionContext extends SingleExpressionContext { + public List singleExpression() { + return getRuleContexts(SingleExpressionContext.class); + } + public SingleExpressionContext singleExpression(int i) { + return getRuleContext(SingleExpressionContext.class,i); + } + public CoalesceExpressionContext(SingleExpressionContext ctx) { copyFrom(ctx); } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).enterCoalesceExpression(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).exitCoalesceExpression(this); + } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof JavaScriptParserVisitor ) return ((JavaScriptParserVisitor)visitor).visitCoalesceExpression(this); + else return visitor.visitChildren(this); + } + } + + public final SingleExpressionContext singleExpression() throws RecognitionException { + return singleExpression(0); + } + + private SingleExpressionContext singleExpression(int _p) throws RecognitionException { + ParserRuleContext _parentctx = _ctx; + int _parentState = getState(); + SingleExpressionContext _localctx = new SingleExpressionContext(_ctx, _parentState); + SingleExpressionContext _prevctx = _localctx; + int _startState = 114; + enterRecursionRule(_localctx, 114, RULE_singleExpression, _p); + int _la; + try { + int _alt; + enterOuterAlt(_localctx, 1); + { + setState(786); + switch ( getInterpreter().adaptivePredict(_input,89,_ctx) ) { + case 1: + { + _localctx = new DeleteExpressionContext(_localctx); + _ctx = _localctx; + _prevctx = _localctx; + + setState(736); + match(Delete); + setState(737); + singleExpression(37); + } + break; + case 2: + { + _localctx = new VoidExpressionContext(_localctx); + _ctx = _localctx; + _prevctx = _localctx; + setState(738); + match(Void); + setState(739); + singleExpression(36); + } + break; + case 3: + { + _localctx = new TypeofExpressionContext(_localctx); + _ctx = _localctx; + _prevctx = _localctx; + setState(740); + match(Typeof); + setState(741); + singleExpression(35); + } + break; + case 4: + { + _localctx = new PreIncrementExpressionContext(_localctx); + _ctx = _localctx; + _prevctx = _localctx; + setState(742); + match(PlusPlus); + setState(743); + singleExpression(34); + } + break; + case 5: + { + _localctx = new PreDecreaseExpressionContext(_localctx); + _ctx = _localctx; + _prevctx = _localctx; + setState(744); + match(MinusMinus); + setState(745); + singleExpression(33); + } + break; + case 6: + { + _localctx = new UnaryPlusExpressionContext(_localctx); + _ctx = _localctx; + _prevctx = _localctx; + setState(746); + match(Plus); + setState(747); + singleExpression(32); + } + break; + case 7: + { + _localctx = new UnaryMinusExpressionContext(_localctx); + _ctx = _localctx; + _prevctx = _localctx; + setState(748); + match(Minus); + setState(749); + singleExpression(31); + } + break; + case 8: + { + _localctx = new BitNotExpressionContext(_localctx); + _ctx = _localctx; + _prevctx = _localctx; + setState(750); + match(BitNot); + setState(751); + singleExpression(30); + } + break; + case 9: + { + _localctx = new NotExpressionContext(_localctx); + _ctx = _localctx; + _prevctx = _localctx; + setState(752); + match(Not); + setState(753); + singleExpression(29); + } + break; + case 10: + { + _localctx = new AwaitExpressionContext(_localctx); + _ctx = _localctx; + _prevctx = _localctx; + setState(754); + match(Await); + setState(755); + singleExpression(28); + } + break; + case 11: + { + _localctx = new FunctionExpressionContext(_localctx); + _ctx = _localctx; + _prevctx = _localctx; + setState(756); + anoymousFunction(); + } + break; + case 12: + { + _localctx = new ClassExpressionContext(_localctx); + _ctx = _localctx; + _prevctx = _localctx; + setState(757); + match(Class); + setState(759); + _la = _input.LA(1); + if (((((_la - 105)) & ~0x3f) == 0 && ((1L << (_la - 105)) & ((1L << (Async - 105)) | (1L << (NonStrictLet - 105)) | (1L << (Identifier - 105)))) != 0)) { + { + setState(758); + identifier(); + } + } + + setState(761); + classTail(); + } + break; + case 13: + { + _localctx = new NewExpressionContext(_localctx); + _ctx = _localctx; + _prevctx = _localctx; + setState(762); + match(New); + setState(763); + singleExpression(0); + setState(765); + switch ( getInterpreter().adaptivePredict(_input,88,_ctx) ) { + case 1: + { + setState(764); + arguments(); + } + break; + } + } + break; + case 14: + { + _localctx = new MetaExpressionContext(_localctx); + _ctx = _localctx; + _prevctx = _localctx; + setState(767); + match(New); + setState(768); + match(Dot); + setState(769); + identifier(); + } + break; + case 15: + { + _localctx = new ImportExpressionContext(_localctx); + _ctx = _localctx; + _prevctx = _localctx; + setState(770); + match(Import); + setState(771); + match(OpenParen); + setState(772); + singleExpression(0); + setState(773); + match(CloseParen); + } + break; + case 16: + { + _localctx = new YieldExpressionContext(_localctx); + _ctx = _localctx; + _prevctx = _localctx; + setState(775); + yieldStatement(); + } + break; + case 17: + { + _localctx = new ThisExpressionContext(_localctx); + _ctx = _localctx; + _prevctx = _localctx; + setState(776); + match(This); + } + break; + case 18: + { + _localctx = new IdentifierExpressionContext(_localctx); + _ctx = _localctx; + _prevctx = _localctx; + setState(777); + identifier(); + } + break; + case 19: + { + _localctx = new SuperExpressionContext(_localctx); + _ctx = _localctx; + _prevctx = _localctx; + setState(778); + match(Super); + } + break; + case 20: + { + _localctx = new LiteralExpressionContext(_localctx); + _ctx = _localctx; + _prevctx = _localctx; + setState(779); + literal(); + } + break; + case 21: + { + _localctx = new ArrayLiteralExpressionContext(_localctx); + _ctx = _localctx; + _prevctx = _localctx; + setState(780); + arrayLiteral(); + } + break; + case 22: + { + _localctx = new ObjectLiteralExpressionContext(_localctx); + _ctx = _localctx; + _prevctx = _localctx; + setState(781); + objectLiteral(); + } + break; + case 23: + { + _localctx = new ParenthesizedExpressionContext(_localctx); + _ctx = _localctx; + _prevctx = _localctx; + setState(782); + match(OpenParen); + setState(783); + expressionSequence(); + setState(784); + match(CloseParen); + } + break; + } + _ctx.stop = _input.LT(-1); + setState(869); + _errHandler.sync(this); + _alt = getInterpreter().adaptivePredict(_input,93,_ctx); + while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) { + if ( _alt==1 ) { + if ( _parseListeners!=null ) triggerExitRuleEvent(); + _prevctx = _localctx; + { + setState(867); + switch ( getInterpreter().adaptivePredict(_input,92,_ctx) ) { + case 1: + { + _localctx = new PowerExpressionContext(new SingleExpressionContext(_parentctx, _parentState)); + pushNewRecursionContext(_localctx, _startState, RULE_singleExpression); + setState(788); + if (!(precpred(_ctx, 27))) throw new FailedPredicateException(this, "precpred(_ctx, 27)"); + setState(789); + match(Power); + setState(790); + singleExpression(27); + } + break; + case 2: + { + _localctx = new MultiplicativeExpressionContext(new SingleExpressionContext(_parentctx, _parentState)); + pushNewRecursionContext(_localctx, _startState, RULE_singleExpression); + setState(791); + if (!(precpred(_ctx, 26))) throw new FailedPredicateException(this, "precpred(_ctx, 26)"); + setState(792); + _la = _input.LA(1); + if ( !((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << Multiply) | (1L << Divide) | (1L << Modulus))) != 0)) ) { + _errHandler.recoverInline(this); + } else { + consume(); + } + setState(793); + singleExpression(27); + } + break; + case 3: + { + _localctx = new AdditiveExpressionContext(new SingleExpressionContext(_parentctx, _parentState)); + pushNewRecursionContext(_localctx, _startState, RULE_singleExpression); + setState(794); + if (!(precpred(_ctx, 25))) throw new FailedPredicateException(this, "precpred(_ctx, 25)"); + setState(795); + _la = _input.LA(1); + if ( !(_la==Plus || _la==Minus) ) { + _errHandler.recoverInline(this); + } else { + consume(); + } + setState(796); + singleExpression(26); + } + break; + case 4: + { + _localctx = new CoalesceExpressionContext(new SingleExpressionContext(_parentctx, _parentState)); + pushNewRecursionContext(_localctx, _startState, RULE_singleExpression); + setState(797); + if (!(precpred(_ctx, 24))) throw new FailedPredicateException(this, "precpred(_ctx, 24)"); + setState(798); + match(NullCoalesce); + setState(799); + singleExpression(25); + } + break; + case 5: + { + _localctx = new BitShiftExpressionContext(new SingleExpressionContext(_parentctx, _parentState)); + pushNewRecursionContext(_localctx, _startState, RULE_singleExpression); + setState(800); + if (!(precpred(_ctx, 23))) throw new FailedPredicateException(this, "precpred(_ctx, 23)"); + setState(801); + _la = _input.LA(1); + if ( !((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << RightShiftArithmetic) | (1L << LeftShiftArithmetic) | (1L << RightShiftLogical))) != 0)) ) { + _errHandler.recoverInline(this); + } else { + consume(); + } + setState(802); + singleExpression(24); + } + break; + case 6: + { + _localctx = new RelationalExpressionContext(new SingleExpressionContext(_parentctx, _parentState)); + pushNewRecursionContext(_localctx, _startState, RULE_singleExpression); + setState(803); + if (!(precpred(_ctx, 22))) throw new FailedPredicateException(this, "precpred(_ctx, 22)"); + setState(804); + _la = _input.LA(1); + if ( !((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << LessThan) | (1L << MoreThan) | (1L << LessThanEquals) | (1L << GreaterThanEquals))) != 0)) ) { + _errHandler.recoverInline(this); + } else { + consume(); + } + setState(805); + singleExpression(23); + } + break; + case 7: + { + _localctx = new InstanceofExpressionContext(new SingleExpressionContext(_parentctx, _parentState)); + pushNewRecursionContext(_localctx, _startState, RULE_singleExpression); + setState(806); + if (!(precpred(_ctx, 21))) throw new FailedPredicateException(this, "precpred(_ctx, 21)"); + setState(807); + match(Instanceof); + setState(808); + singleExpression(22); + } + break; + case 8: + { + _localctx = new InExpressionContext(new SingleExpressionContext(_parentctx, _parentState)); + pushNewRecursionContext(_localctx, _startState, RULE_singleExpression); + setState(809); + if (!(precpred(_ctx, 20))) throw new FailedPredicateException(this, "precpred(_ctx, 20)"); + setState(810); + match(In); + setState(811); + singleExpression(21); + } + break; + case 9: + { + _localctx = new EqualityExpressionContext(new SingleExpressionContext(_parentctx, _parentState)); + pushNewRecursionContext(_localctx, _startState, RULE_singleExpression); + setState(812); + if (!(precpred(_ctx, 19))) throw new FailedPredicateException(this, "precpred(_ctx, 19)"); + setState(813); + _la = _input.LA(1); + if ( !((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << Equals_) | (1L << NotEquals) | (1L << IdentityEquals) | (1L << IdentityNotEquals))) != 0)) ) { + _errHandler.recoverInline(this); + } else { + consume(); + } + setState(814); + singleExpression(20); + } + break; + case 10: + { + _localctx = new BitAndExpressionContext(new SingleExpressionContext(_parentctx, _parentState)); + pushNewRecursionContext(_localctx, _startState, RULE_singleExpression); + setState(815); + if (!(precpred(_ctx, 18))) throw new FailedPredicateException(this, "precpred(_ctx, 18)"); + setState(816); + match(BitAnd); + setState(817); + singleExpression(19); + } + break; + case 11: + { + _localctx = new BitXOrExpressionContext(new SingleExpressionContext(_parentctx, _parentState)); + pushNewRecursionContext(_localctx, _startState, RULE_singleExpression); + setState(818); + if (!(precpred(_ctx, 17))) throw new FailedPredicateException(this, "precpred(_ctx, 17)"); + setState(819); + match(BitXOr); + setState(820); + singleExpression(18); + } + break; + case 12: + { + _localctx = new BitOrExpressionContext(new SingleExpressionContext(_parentctx, _parentState)); + pushNewRecursionContext(_localctx, _startState, RULE_singleExpression); + setState(821); + if (!(precpred(_ctx, 16))) throw new FailedPredicateException(this, "precpred(_ctx, 16)"); + setState(822); + match(BitOr); + setState(823); + singleExpression(17); + } + break; + case 13: + { + _localctx = new LogicalAndExpressionContext(new SingleExpressionContext(_parentctx, _parentState)); + pushNewRecursionContext(_localctx, _startState, RULE_singleExpression); + setState(824); + if (!(precpred(_ctx, 15))) throw new FailedPredicateException(this, "precpred(_ctx, 15)"); + setState(825); + match(And); + setState(826); + singleExpression(16); + } + break; + case 14: + { + _localctx = new LogicalOrExpressionContext(new SingleExpressionContext(_parentctx, _parentState)); + pushNewRecursionContext(_localctx, _startState, RULE_singleExpression); + setState(827); + if (!(precpred(_ctx, 14))) throw new FailedPredicateException(this, "precpred(_ctx, 14)"); + setState(828); + match(Or); + setState(829); + singleExpression(15); + } + break; + case 15: + { + _localctx = new TernaryExpressionContext(new SingleExpressionContext(_parentctx, _parentState)); + pushNewRecursionContext(_localctx, _startState, RULE_singleExpression); + setState(830); + if (!(precpred(_ctx, 13))) throw new FailedPredicateException(this, "precpred(_ctx, 13)"); + setState(831); + match(QuestionMark); + setState(832); + singleExpression(0); + setState(833); + match(Colon); + setState(834); + singleExpression(14); + } + break; + case 16: + { + _localctx = new AssignmentExpressionContext(new SingleExpressionContext(_parentctx, _parentState)); + pushNewRecursionContext(_localctx, _startState, RULE_singleExpression); + setState(836); + if (!(precpred(_ctx, 12))) throw new FailedPredicateException(this, "precpred(_ctx, 12)"); + setState(837); + match(Assign); + setState(838); + singleExpression(12); + } + break; + case 17: + { + _localctx = new AssignmentOperatorExpressionContext(new SingleExpressionContext(_parentctx, _parentState)); + pushNewRecursionContext(_localctx, _startState, RULE_singleExpression); + setState(839); + if (!(precpred(_ctx, 11))) throw new FailedPredicateException(this, "precpred(_ctx, 11)"); + setState(840); + assignmentOperator(); + setState(841); + singleExpression(11); + } + break; + case 18: + { + _localctx = new MemberIndexExpressionContext(new SingleExpressionContext(_parentctx, _parentState)); + pushNewRecursionContext(_localctx, _startState, RULE_singleExpression); + setState(843); + if (!(precpred(_ctx, 44))) throw new FailedPredicateException(this, "precpred(_ctx, 44)"); + setState(844); + match(OpenBracket); + setState(845); + expressionSequence(); + setState(846); + match(CloseBracket); + } + break; + case 19: + { + _localctx = new MemberDotExpressionContext(new SingleExpressionContext(_parentctx, _parentState)); + pushNewRecursionContext(_localctx, _startState, RULE_singleExpression); + setState(848); + if (!(precpred(_ctx, 43))) throw new FailedPredicateException(this, "precpred(_ctx, 43)"); + setState(850); + _la = _input.LA(1); + if (_la==QuestionMark) { + { + setState(849); + match(QuestionMark); + } + } + + setState(852); + match(Dot); + setState(854); + _la = _input.LA(1); + if (_la==Hashtag) { + { + setState(853); + match(Hashtag); + } + } + + setState(856); + identifierName(); + } + break; + case 20: + { + _localctx = new ArgumentsExpressionContext(new SingleExpressionContext(_parentctx, _parentState)); + pushNewRecursionContext(_localctx, _startState, RULE_singleExpression); + setState(857); + if (!(precpred(_ctx, 42))) throw new FailedPredicateException(this, "precpred(_ctx, 42)"); + setState(858); + arguments(); + } + break; + case 21: + { + _localctx = new PostIncrementExpressionContext(new SingleExpressionContext(_parentctx, _parentState)); + pushNewRecursionContext(_localctx, _startState, RULE_singleExpression); + setState(859); + if (!(precpred(_ctx, 39))) throw new FailedPredicateException(this, "precpred(_ctx, 39)"); + setState(860); + if (!(this.notLineTerminator())) throw new FailedPredicateException(this, "this.notLineTerminator()"); + setState(861); + match(PlusPlus); + } + break; + case 22: + { + _localctx = new PostDecreaseExpressionContext(new SingleExpressionContext(_parentctx, _parentState)); + pushNewRecursionContext(_localctx, _startState, RULE_singleExpression); + setState(862); + if (!(precpred(_ctx, 38))) throw new FailedPredicateException(this, "precpred(_ctx, 38)"); + setState(863); + if (!(this.notLineTerminator())) throw new FailedPredicateException(this, "this.notLineTerminator()"); + setState(864); + match(MinusMinus); + } + break; + case 23: + { + _localctx = new TemplateStringExpressionContext(new SingleExpressionContext(_parentctx, _parentState)); + pushNewRecursionContext(_localctx, _startState, RULE_singleExpression); + setState(865); + if (!(precpred(_ctx, 9))) throw new FailedPredicateException(this, "precpred(_ctx, 9)"); + setState(866); + match(TemplateStringLiteral); + } + break; + } + } + } + setState(871); + _errHandler.sync(this); + _alt = getInterpreter().adaptivePredict(_input,93,_ctx); + } + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + unrollRecursionContexts(_parentctx); + } + return _localctx; + } + + public static class AssignableContext extends ParserRuleContext { + public IdentifierContext identifier() { + return getRuleContext(IdentifierContext.class,0); + } + public ArrayLiteralContext arrayLiteral() { + return getRuleContext(ArrayLiteralContext.class,0); + } + public ObjectLiteralContext objectLiteral() { + return getRuleContext(ObjectLiteralContext.class,0); + } + public AssignableContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_assignable; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).enterAssignable(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).exitAssignable(this); + } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof JavaScriptParserVisitor ) return ((JavaScriptParserVisitor)visitor).visitAssignable(this); + else return visitor.visitChildren(this); + } + } + + public final AssignableContext assignable() throws RecognitionException { + AssignableContext _localctx = new AssignableContext(_ctx, getState()); + enterRule(_localctx, 116, RULE_assignable); + try { + setState(875); + switch (_input.LA(1)) { + case Async: + case NonStrictLet: + case Identifier: + enterOuterAlt(_localctx, 1); + { + setState(872); + identifier(); + } + break; + case OpenBracket: + enterOuterAlt(_localctx, 2); + { + setState(873); + arrayLiteral(); + } + break; + case OpenBrace: + enterOuterAlt(_localctx, 3); + { + setState(874); + objectLiteral(); + } + break; + default: + throw new NoViableAltException(this); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class ObjectLiteralContext extends ParserRuleContext { + public List propertyAssignment() { + return getRuleContexts(PropertyAssignmentContext.class); + } + public PropertyAssignmentContext propertyAssignment(int i) { + return getRuleContext(PropertyAssignmentContext.class,i); + } + public ObjectLiteralContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_objectLiteral; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).enterObjectLiteral(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).exitObjectLiteral(this); + } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof JavaScriptParserVisitor ) return ((JavaScriptParserVisitor)visitor).visitObjectLiteral(this); + else return visitor.visitChildren(this); + } + } + + public final ObjectLiteralContext objectLiteral() throws RecognitionException { + ObjectLiteralContext _localctx = new ObjectLiteralContext(_ctx, getState()); + enterRule(_localctx, 118, RULE_objectLiteral); + int _la; + try { + int _alt; + enterOuterAlt(_localctx, 1); + { + setState(877); + match(OpenBrace); + setState(886); + switch ( getInterpreter().adaptivePredict(_input,96,_ctx) ) { + case 1: + { + setState(878); + propertyAssignment(); + setState(883); + _errHandler.sync(this); + _alt = getInterpreter().adaptivePredict(_input,95,_ctx); + while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) { + if ( _alt==1 ) { + { + { + setState(879); + match(Comma); + setState(880); + propertyAssignment(); + } + } + } + setState(885); + _errHandler.sync(this); + _alt = getInterpreter().adaptivePredict(_input,95,_ctx); + } + } + break; + } + setState(889); + _la = _input.LA(1); + if (_la==Comma) { + { + setState(888); + match(Comma); + } + } + + setState(891); + match(CloseBrace); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class AnoymousFunctionContext extends ParserRuleContext { + public AnoymousFunctionContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_anoymousFunction; } + + public AnoymousFunctionContext() { } + public void copyFrom(AnoymousFunctionContext ctx) { + super.copyFrom(ctx); + } + } + public static class AnoymousFunctionDeclContext extends AnoymousFunctionContext { + public TerminalNode Function() { return getToken(JavaScriptParser.Function, 0); } + public FunctionBodyContext functionBody() { + return getRuleContext(FunctionBodyContext.class,0); + } + public TerminalNode Async() { return getToken(JavaScriptParser.Async, 0); } + public FormalParameterListContext formalParameterList() { + return getRuleContext(FormalParameterListContext.class,0); + } + public AnoymousFunctionDeclContext(AnoymousFunctionContext ctx) { copyFrom(ctx); } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).enterAnoymousFunctionDecl(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).exitAnoymousFunctionDecl(this); + } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof JavaScriptParserVisitor ) return ((JavaScriptParserVisitor)visitor).visitAnoymousFunctionDecl(this); + else return visitor.visitChildren(this); + } + } + public static class ArrowFunctionContext extends AnoymousFunctionContext { + public ArrowFunctionParametersContext arrowFunctionParameters() { + return getRuleContext(ArrowFunctionParametersContext.class,0); + } + public ArrowFunctionBodyContext arrowFunctionBody() { + return getRuleContext(ArrowFunctionBodyContext.class,0); + } + public TerminalNode Async() { return getToken(JavaScriptParser.Async, 0); } + public ArrowFunctionContext(AnoymousFunctionContext ctx) { copyFrom(ctx); } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).enterArrowFunction(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).exitArrowFunction(this); + } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof JavaScriptParserVisitor ) return ((JavaScriptParserVisitor)visitor).visitArrowFunction(this); + else return visitor.visitChildren(this); + } + } + public static class FunctionDeclContext extends AnoymousFunctionContext { + public FunctionDeclarationContext functionDeclaration() { + return getRuleContext(FunctionDeclarationContext.class,0); + } + public FunctionDeclContext(AnoymousFunctionContext ctx) { copyFrom(ctx); } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).enterFunctionDecl(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).exitFunctionDecl(this); + } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof JavaScriptParserVisitor ) return ((JavaScriptParserVisitor)visitor).visitFunctionDecl(this); + else return visitor.visitChildren(this); + } + } + + public final AnoymousFunctionContext anoymousFunction() throws RecognitionException { + AnoymousFunctionContext _localctx = new AnoymousFunctionContext(_ctx, getState()); + enterRule(_localctx, 120, RULE_anoymousFunction); + int _la; + try { + setState(917); + switch ( getInterpreter().adaptivePredict(_input,102,_ctx) ) { + case 1: + _localctx = new FunctionDeclContext(_localctx); + enterOuterAlt(_localctx, 1); + { + setState(893); + functionDeclaration(); + } + break; + case 2: + _localctx = new AnoymousFunctionDeclContext(_localctx); + enterOuterAlt(_localctx, 2); + { + setState(895); + _la = _input.LA(1); + if (_la==Async) { + { + setState(894); + match(Async); + } + } + + setState(897); + match(Function); + setState(899); + _la = _input.LA(1); + if (_la==Multiply) { + { + setState(898); + match(Multiply); + } + } + + setState(901); + match(OpenParen); + setState(903); + _la = _input.LA(1); + if ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << OpenBracket) | (1L << OpenBrace) | (1L << Ellipsis))) != 0) || ((((_la - 105)) & ~0x3f) == 0 && ((1L << (_la - 105)) & ((1L << (Async - 105)) | (1L << (NonStrictLet - 105)) | (1L << (Identifier - 105)))) != 0)) { + { + setState(902); + formalParameterList(); + } + } + + setState(905); + match(CloseParen); + setState(906); + match(OpenBrace); + setState(907); + functionBody(); + setState(908); + match(CloseBrace); + } + break; + case 3: + _localctx = new ArrowFunctionContext(_localctx); + enterOuterAlt(_localctx, 3); + { + setState(911); + switch ( getInterpreter().adaptivePredict(_input,101,_ctx) ) { + case 1: + { + setState(910); + match(Async); + } + break; + } + setState(913); + arrowFunctionParameters(); + setState(914); + match(ARROW); + setState(915); + arrowFunctionBody(); + } + break; + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class ArrowFunctionParametersContext extends ParserRuleContext { + public IdentifierContext identifier() { + return getRuleContext(IdentifierContext.class,0); + } + public FormalParameterListContext formalParameterList() { + return getRuleContext(FormalParameterListContext.class,0); + } + public ArrowFunctionParametersContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_arrowFunctionParameters; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).enterArrowFunctionParameters(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).exitArrowFunctionParameters(this); + } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof JavaScriptParserVisitor ) return ((JavaScriptParserVisitor)visitor).visitArrowFunctionParameters(this); + else return visitor.visitChildren(this); + } + } + + public final ArrowFunctionParametersContext arrowFunctionParameters() throws RecognitionException { + ArrowFunctionParametersContext _localctx = new ArrowFunctionParametersContext(_ctx, getState()); + enterRule(_localctx, 122, RULE_arrowFunctionParameters); + int _la; + try { + setState(925); + switch (_input.LA(1)) { + case Async: + case NonStrictLet: + case Identifier: + enterOuterAlt(_localctx, 1); + { + setState(919); + identifier(); + } + break; + case OpenParen: + enterOuterAlt(_localctx, 2); + { + setState(920); + match(OpenParen); + setState(922); + _la = _input.LA(1); + if ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << OpenBracket) | (1L << OpenBrace) | (1L << Ellipsis))) != 0) || ((((_la - 105)) & ~0x3f) == 0 && ((1L << (_la - 105)) & ((1L << (Async - 105)) | (1L << (NonStrictLet - 105)) | (1L << (Identifier - 105)))) != 0)) { + { + setState(921); + formalParameterList(); + } + } + + setState(924); + match(CloseParen); + } + break; + default: + throw new NoViableAltException(this); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class ArrowFunctionBodyContext extends ParserRuleContext { + public SingleExpressionContext singleExpression() { + return getRuleContext(SingleExpressionContext.class,0); + } + public FunctionBodyContext functionBody() { + return getRuleContext(FunctionBodyContext.class,0); + } + public ArrowFunctionBodyContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_arrowFunctionBody; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).enterArrowFunctionBody(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).exitArrowFunctionBody(this); + } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof JavaScriptParserVisitor ) return ((JavaScriptParserVisitor)visitor).visitArrowFunctionBody(this); + else return visitor.visitChildren(this); + } + } + + public final ArrowFunctionBodyContext arrowFunctionBody() throws RecognitionException { + ArrowFunctionBodyContext _localctx = new ArrowFunctionBodyContext(_ctx, getState()); + enterRule(_localctx, 124, RULE_arrowFunctionBody); + try { + setState(932); + switch ( getInterpreter().adaptivePredict(_input,105,_ctx) ) { + case 1: + enterOuterAlt(_localctx, 1); + { + setState(927); + singleExpression(0); + } + break; + case 2: + enterOuterAlt(_localctx, 2); + { + setState(928); + match(OpenBrace); + setState(929); + functionBody(); + setState(930); + match(CloseBrace); + } + break; + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class AssignmentOperatorContext extends ParserRuleContext { + public AssignmentOperatorContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_assignmentOperator; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).enterAssignmentOperator(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).exitAssignmentOperator(this); + } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof JavaScriptParserVisitor ) return ((JavaScriptParserVisitor)visitor).visitAssignmentOperator(this); + else return visitor.visitChildren(this); + } + } + + public final AssignmentOperatorContext assignmentOperator() throws RecognitionException { + AssignmentOperatorContext _localctx = new AssignmentOperatorContext(_ctx, getState()); + enterRule(_localctx, 126, RULE_assignmentOperator); + int _la; + try { + enterOuterAlt(_localctx, 1); + { + setState(934); + _la = _input.LA(1); + if ( !((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << MultiplyAssign) | (1L << DivideAssign) | (1L << ModulusAssign) | (1L << PlusAssign) | (1L << MinusAssign) | (1L << LeftShiftArithmeticAssign) | (1L << RightShiftArithmeticAssign) | (1L << RightShiftLogicalAssign) | (1L << BitAndAssign) | (1L << BitXorAssign) | (1L << BitOrAssign) | (1L << PowerAssign))) != 0)) ) { + _errHandler.recoverInline(this); + } else { + consume(); + } + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class LiteralContext extends ParserRuleContext { + public TerminalNode NullLiteral() { return getToken(JavaScriptParser.NullLiteral, 0); } + public TerminalNode BooleanLiteral() { return getToken(JavaScriptParser.BooleanLiteral, 0); } + public TerminalNode StringLiteral() { return getToken(JavaScriptParser.StringLiteral, 0); } + public TerminalNode TemplateStringLiteral() { return getToken(JavaScriptParser.TemplateStringLiteral, 0); } + public TerminalNode RegularExpressionLiteral() { return getToken(JavaScriptParser.RegularExpressionLiteral, 0); } + public NumericLiteralContext numericLiteral() { + return getRuleContext(NumericLiteralContext.class,0); + } + public BigintLiteralContext bigintLiteral() { + return getRuleContext(BigintLiteralContext.class,0); + } + public LiteralContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_literal; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).enterLiteral(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).exitLiteral(this); + } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof JavaScriptParserVisitor ) return ((JavaScriptParserVisitor)visitor).visitLiteral(this); + else return visitor.visitChildren(this); + } + } + + public final LiteralContext literal() throws RecognitionException { + LiteralContext _localctx = new LiteralContext(_ctx, getState()); + enterRule(_localctx, 128, RULE_literal); + try { + setState(943); + switch (_input.LA(1)) { + case NullLiteral: + enterOuterAlt(_localctx, 1); + { + setState(936); + match(NullLiteral); + } + break; + case BooleanLiteral: + enterOuterAlt(_localctx, 2); + { + setState(937); + match(BooleanLiteral); + } + break; + case StringLiteral: + enterOuterAlt(_localctx, 3); + { + setState(938); + match(StringLiteral); + } + break; + case TemplateStringLiteral: + enterOuterAlt(_localctx, 4); + { + setState(939); + match(TemplateStringLiteral); + } + break; + case RegularExpressionLiteral: + enterOuterAlt(_localctx, 5); + { + setState(940); + match(RegularExpressionLiteral); + } + break; + case DecimalLiteral: + case HexIntegerLiteral: + case OctalIntegerLiteral: + case OctalIntegerLiteral2: + case BinaryIntegerLiteral: + enterOuterAlt(_localctx, 6); + { + setState(941); + numericLiteral(); + } + break; + case BigHexIntegerLiteral: + case BigOctalIntegerLiteral: + case BigBinaryIntegerLiteral: + case BigDecimalIntegerLiteral: + enterOuterAlt(_localctx, 7); + { + setState(942); + bigintLiteral(); + } + break; + default: + throw new NoViableAltException(this); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class NumericLiteralContext extends ParserRuleContext { + public TerminalNode DecimalLiteral() { return getToken(JavaScriptParser.DecimalLiteral, 0); } + public TerminalNode HexIntegerLiteral() { return getToken(JavaScriptParser.HexIntegerLiteral, 0); } + public TerminalNode OctalIntegerLiteral() { return getToken(JavaScriptParser.OctalIntegerLiteral, 0); } + public TerminalNode OctalIntegerLiteral2() { return getToken(JavaScriptParser.OctalIntegerLiteral2, 0); } + public TerminalNode BinaryIntegerLiteral() { return getToken(JavaScriptParser.BinaryIntegerLiteral, 0); } + public NumericLiteralContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_numericLiteral; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).enterNumericLiteral(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).exitNumericLiteral(this); + } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof JavaScriptParserVisitor ) return ((JavaScriptParserVisitor)visitor).visitNumericLiteral(this); + else return visitor.visitChildren(this); + } + } + + public final NumericLiteralContext numericLiteral() throws RecognitionException { + NumericLiteralContext _localctx = new NumericLiteralContext(_ctx, getState()); + enterRule(_localctx, 130, RULE_numericLiteral); + int _la; + try { + enterOuterAlt(_localctx, 1); + { + setState(945); + _la = _input.LA(1); + if ( !(((((_la - 61)) & ~0x3f) == 0 && ((1L << (_la - 61)) & ((1L << (DecimalLiteral - 61)) | (1L << (HexIntegerLiteral - 61)) | (1L << (OctalIntegerLiteral - 61)) | (1L << (OctalIntegerLiteral2 - 61)) | (1L << (BinaryIntegerLiteral - 61)))) != 0)) ) { + _errHandler.recoverInline(this); + } else { + consume(); + } + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class BigintLiteralContext extends ParserRuleContext { + public TerminalNode BigDecimalIntegerLiteral() { return getToken(JavaScriptParser.BigDecimalIntegerLiteral, 0); } + public TerminalNode BigHexIntegerLiteral() { return getToken(JavaScriptParser.BigHexIntegerLiteral, 0); } + public TerminalNode BigOctalIntegerLiteral() { return getToken(JavaScriptParser.BigOctalIntegerLiteral, 0); } + public TerminalNode BigBinaryIntegerLiteral() { return getToken(JavaScriptParser.BigBinaryIntegerLiteral, 0); } + public BigintLiteralContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_bigintLiteral; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).enterBigintLiteral(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).exitBigintLiteral(this); + } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof JavaScriptParserVisitor ) return ((JavaScriptParserVisitor)visitor).visitBigintLiteral(this); + else return visitor.visitChildren(this); + } + } + + public final BigintLiteralContext bigintLiteral() throws RecognitionException { + BigintLiteralContext _localctx = new BigintLiteralContext(_ctx, getState()); + enterRule(_localctx, 132, RULE_bigintLiteral); + int _la; + try { + enterOuterAlt(_localctx, 1); + { + setState(947); + _la = _input.LA(1); + if ( !(((((_la - 66)) & ~0x3f) == 0 && ((1L << (_la - 66)) & ((1L << (BigHexIntegerLiteral - 66)) | (1L << (BigOctalIntegerLiteral - 66)) | (1L << (BigBinaryIntegerLiteral - 66)) | (1L << (BigDecimalIntegerLiteral - 66)))) != 0)) ) { + _errHandler.recoverInline(this); + } else { + consume(); + } + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class GetterContext extends ParserRuleContext { + public IdentifierContext identifier() { + return getRuleContext(IdentifierContext.class,0); + } + public PropertyNameContext propertyName() { + return getRuleContext(PropertyNameContext.class,0); + } + public GetterContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_getter; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).enterGetter(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).exitGetter(this); + } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof JavaScriptParserVisitor ) return ((JavaScriptParserVisitor)visitor).visitGetter(this); + else return visitor.visitChildren(this); + } + } + + public final GetterContext getter() throws RecognitionException { + GetterContext _localctx = new GetterContext(_ctx, getState()); + enterRule(_localctx, 134, RULE_getter); + try { + enterOuterAlt(_localctx, 1); + { + setState(949); + if (!(this.n("get"))) throw new FailedPredicateException(this, "this.n(\"get\")"); + setState(950); + identifier(); + setState(951); + propertyName(); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class SetterContext extends ParserRuleContext { + public IdentifierContext identifier() { + return getRuleContext(IdentifierContext.class,0); + } + public PropertyNameContext propertyName() { + return getRuleContext(PropertyNameContext.class,0); + } + public SetterContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_setter; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).enterSetter(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).exitSetter(this); + } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof JavaScriptParserVisitor ) return ((JavaScriptParserVisitor)visitor).visitSetter(this); + else return visitor.visitChildren(this); + } + } + + public final SetterContext setter() throws RecognitionException { + SetterContext _localctx = new SetterContext(_ctx, getState()); + enterRule(_localctx, 136, RULE_setter); + try { + enterOuterAlt(_localctx, 1); + { + setState(953); + if (!(this.n("set"))) throw new FailedPredicateException(this, "this.n(\"set\")"); + setState(954); + identifier(); + setState(955); + propertyName(); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class IdentifierNameContext extends ParserRuleContext { + public IdentifierContext identifier() { + return getRuleContext(IdentifierContext.class,0); + } + public ReservedWordContext reservedWord() { + return getRuleContext(ReservedWordContext.class,0); + } + public IdentifierNameContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_identifierName; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).enterIdentifierName(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).exitIdentifierName(this); + } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof JavaScriptParserVisitor ) return ((JavaScriptParserVisitor)visitor).visitIdentifierName(this); + else return visitor.visitChildren(this); + } + } + + public final IdentifierNameContext identifierName() throws RecognitionException { + IdentifierNameContext _localctx = new IdentifierNameContext(_ctx, getState()); + enterRule(_localctx, 138, RULE_identifierName); + try { + setState(959); + switch ( getInterpreter().adaptivePredict(_input,107,_ctx) ) { + case 1: + enterOuterAlt(_localctx, 1); + { + setState(957); + identifier(); + } + break; + case 2: + enterOuterAlt(_localctx, 2); + { + setState(958); + reservedWord(); + } + break; + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class IdentifierContext extends ParserRuleContext { + public TerminalNode Identifier() { return getToken(JavaScriptParser.Identifier, 0); } + public TerminalNode NonStrictLet() { return getToken(JavaScriptParser.NonStrictLet, 0); } + public TerminalNode Async() { return getToken(JavaScriptParser.Async, 0); } + public IdentifierContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_identifier; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).enterIdentifier(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).exitIdentifier(this); + } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof JavaScriptParserVisitor ) return ((JavaScriptParserVisitor)visitor).visitIdentifier(this); + else return visitor.visitChildren(this); + } + } + + public final IdentifierContext identifier() throws RecognitionException { + IdentifierContext _localctx = new IdentifierContext(_ctx, getState()); + enterRule(_localctx, 140, RULE_identifier); + int _la; + try { + enterOuterAlt(_localctx, 1); + { + setState(961); + _la = _input.LA(1); + if ( !(((((_la - 105)) & ~0x3f) == 0 && ((1L << (_la - 105)) & ((1L << (Async - 105)) | (1L << (NonStrictLet - 105)) | (1L << (Identifier - 105)))) != 0)) ) { + _errHandler.recoverInline(this); + } else { + consume(); + } + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class ReservedWordContext extends ParserRuleContext { + public KeywordContext keyword() { + return getRuleContext(KeywordContext.class,0); + } + public TerminalNode NullLiteral() { return getToken(JavaScriptParser.NullLiteral, 0); } + public TerminalNode BooleanLiteral() { return getToken(JavaScriptParser.BooleanLiteral, 0); } + public ReservedWordContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_reservedWord; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).enterReservedWord(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).exitReservedWord(this); + } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof JavaScriptParserVisitor ) return ((JavaScriptParserVisitor)visitor).visitReservedWord(this); + else return visitor.visitChildren(this); + } + } + + public final ReservedWordContext reservedWord() throws RecognitionException { + ReservedWordContext _localctx = new ReservedWordContext(_ctx, getState()); + enterRule(_localctx, 142, RULE_reservedWord); + try { + setState(966); + switch (_input.LA(1)) { + case Break: + case Do: + case Instanceof: + case Typeof: + case Case: + case Else: + case New: + case Var: + case Catch: + case Finally: + case Return: + case Void: + case Continue: + case For: + case Switch: + case While: + case Debugger: + case Function: + case This: + case With: + case Default: + case If: + case Throw: + case Delete: + case In: + case Try: + case As: + case From: + case Class: + case Enum: + case Extends: + case Super: + case Const: + case Export: + case Import: + case Async: + case Await: + case Implements: + case StrictLet: + case NonStrictLet: + case Private: + case Public: + case Interface: + case Package: + case Protected: + case Static: + case Yield: + enterOuterAlt(_localctx, 1); + { + setState(963); + keyword(); + } + break; + case NullLiteral: + enterOuterAlt(_localctx, 2); + { + setState(964); + match(NullLiteral); + } + break; + case BooleanLiteral: + enterOuterAlt(_localctx, 3); + { + setState(965); + match(BooleanLiteral); + } + break; + default: + throw new NoViableAltException(this); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class KeywordContext extends ParserRuleContext { + public TerminalNode Break() { return getToken(JavaScriptParser.Break, 0); } + public TerminalNode Do() { return getToken(JavaScriptParser.Do, 0); } + public TerminalNode Instanceof() { return getToken(JavaScriptParser.Instanceof, 0); } + public TerminalNode Typeof() { return getToken(JavaScriptParser.Typeof, 0); } + public TerminalNode Case() { return getToken(JavaScriptParser.Case, 0); } + public TerminalNode Else() { return getToken(JavaScriptParser.Else, 0); } + public TerminalNode New() { return getToken(JavaScriptParser.New, 0); } + public TerminalNode Var() { return getToken(JavaScriptParser.Var, 0); } + public TerminalNode Catch() { return getToken(JavaScriptParser.Catch, 0); } + public TerminalNode Finally() { return getToken(JavaScriptParser.Finally, 0); } + public TerminalNode Return() { return getToken(JavaScriptParser.Return, 0); } + public TerminalNode Void() { return getToken(JavaScriptParser.Void, 0); } + public TerminalNode Continue() { return getToken(JavaScriptParser.Continue, 0); } + public TerminalNode For() { return getToken(JavaScriptParser.For, 0); } + public TerminalNode Switch() { return getToken(JavaScriptParser.Switch, 0); } + public TerminalNode While() { return getToken(JavaScriptParser.While, 0); } + public TerminalNode Debugger() { return getToken(JavaScriptParser.Debugger, 0); } + public TerminalNode Function() { return getToken(JavaScriptParser.Function, 0); } + public TerminalNode This() { return getToken(JavaScriptParser.This, 0); } + public TerminalNode With() { return getToken(JavaScriptParser.With, 0); } + public TerminalNode Default() { return getToken(JavaScriptParser.Default, 0); } + public TerminalNode If() { return getToken(JavaScriptParser.If, 0); } + public TerminalNode Throw() { return getToken(JavaScriptParser.Throw, 0); } + public TerminalNode Delete() { return getToken(JavaScriptParser.Delete, 0); } + public TerminalNode In() { return getToken(JavaScriptParser.In, 0); } + public TerminalNode Try() { return getToken(JavaScriptParser.Try, 0); } + public TerminalNode Class() { return getToken(JavaScriptParser.Class, 0); } + public TerminalNode Enum() { return getToken(JavaScriptParser.Enum, 0); } + public TerminalNode Extends() { return getToken(JavaScriptParser.Extends, 0); } + public TerminalNode Super() { return getToken(JavaScriptParser.Super, 0); } + public TerminalNode Const() { return getToken(JavaScriptParser.Const, 0); } + public TerminalNode Export() { return getToken(JavaScriptParser.Export, 0); } + public TerminalNode Import() { return getToken(JavaScriptParser.Import, 0); } + public TerminalNode Implements() { return getToken(JavaScriptParser.Implements, 0); } + public LetContext let() { + return getRuleContext(LetContext.class,0); + } + public TerminalNode Private() { return getToken(JavaScriptParser.Private, 0); } + public TerminalNode Public() { return getToken(JavaScriptParser.Public, 0); } + public TerminalNode Interface() { return getToken(JavaScriptParser.Interface, 0); } + public TerminalNode Package() { return getToken(JavaScriptParser.Package, 0); } + public TerminalNode Protected() { return getToken(JavaScriptParser.Protected, 0); } + public TerminalNode Static() { return getToken(JavaScriptParser.Static, 0); } + public TerminalNode Yield() { return getToken(JavaScriptParser.Yield, 0); } + public TerminalNode Async() { return getToken(JavaScriptParser.Async, 0); } + public TerminalNode Await() { return getToken(JavaScriptParser.Await, 0); } + public TerminalNode From() { return getToken(JavaScriptParser.From, 0); } + public TerminalNode As() { return getToken(JavaScriptParser.As, 0); } + public KeywordContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_keyword; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).enterKeyword(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).exitKeyword(this); + } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof JavaScriptParserVisitor ) return ((JavaScriptParserVisitor)visitor).visitKeyword(this); + else return visitor.visitChildren(this); + } + } + + public final KeywordContext keyword() throws RecognitionException { + KeywordContext _localctx = new KeywordContext(_ctx, getState()); + enterRule(_localctx, 144, RULE_keyword); + try { + setState(1014); + switch (_input.LA(1)) { + case Break: + enterOuterAlt(_localctx, 1); + { + setState(968); + match(Break); + } + break; + case Do: + enterOuterAlt(_localctx, 2); + { + setState(969); + match(Do); + } + break; + case Instanceof: + enterOuterAlt(_localctx, 3); + { + setState(970); + match(Instanceof); + } + break; + case Typeof: + enterOuterAlt(_localctx, 4); + { + setState(971); + match(Typeof); + } + break; + case Case: + enterOuterAlt(_localctx, 5); + { + setState(972); + match(Case); + } + break; + case Else: + enterOuterAlt(_localctx, 6); + { + setState(973); + match(Else); + } + break; + case New: + enterOuterAlt(_localctx, 7); + { + setState(974); + match(New); + } + break; + case Var: + enterOuterAlt(_localctx, 8); + { + setState(975); + match(Var); + } + break; + case Catch: + enterOuterAlt(_localctx, 9); + { + setState(976); + match(Catch); + } + break; + case Finally: + enterOuterAlt(_localctx, 10); + { + setState(977); + match(Finally); + } + break; + case Return: + enterOuterAlt(_localctx, 11); + { + setState(978); + match(Return); + } + break; + case Void: + enterOuterAlt(_localctx, 12); + { + setState(979); + match(Void); + } + break; + case Continue: + enterOuterAlt(_localctx, 13); + { + setState(980); + match(Continue); + } + break; + case For: + enterOuterAlt(_localctx, 14); + { + setState(981); + match(For); + } + break; + case Switch: + enterOuterAlt(_localctx, 15); + { + setState(982); + match(Switch); + } + break; + case While: + enterOuterAlt(_localctx, 16); + { + setState(983); + match(While); + } + break; + case Debugger: + enterOuterAlt(_localctx, 17); + { + setState(984); + match(Debugger); + } + break; + case Function: + enterOuterAlt(_localctx, 18); + { + setState(985); + match(Function); + } + break; + case This: + enterOuterAlt(_localctx, 19); + { + setState(986); + match(This); + } + break; + case With: + enterOuterAlt(_localctx, 20); + { + setState(987); + match(With); + } + break; + case Default: + enterOuterAlt(_localctx, 21); + { + setState(988); + match(Default); + } + break; + case If: + enterOuterAlt(_localctx, 22); + { + setState(989); + match(If); + } + break; + case Throw: + enterOuterAlt(_localctx, 23); + { + setState(990); + match(Throw); + } + break; + case Delete: + enterOuterAlt(_localctx, 24); + { + setState(991); + match(Delete); + } + break; + case In: + enterOuterAlt(_localctx, 25); + { + setState(992); + match(In); + } + break; + case Try: + enterOuterAlt(_localctx, 26); + { + setState(993); + match(Try); + } + break; + case Class: + enterOuterAlt(_localctx, 27); + { + setState(994); + match(Class); + } + break; + case Enum: + enterOuterAlt(_localctx, 28); + { + setState(995); + match(Enum); + } + break; + case Extends: + enterOuterAlt(_localctx, 29); + { + setState(996); + match(Extends); + } + break; + case Super: + enterOuterAlt(_localctx, 30); + { + setState(997); + match(Super); + } + break; + case Const: + enterOuterAlt(_localctx, 31); + { + setState(998); + match(Const); + } + break; + case Export: + enterOuterAlt(_localctx, 32); + { + setState(999); + match(Export); + } + break; + case Import: + enterOuterAlt(_localctx, 33); + { + setState(1000); + match(Import); + } + break; + case Implements: + enterOuterAlt(_localctx, 34); + { + setState(1001); + match(Implements); + } + break; + case StrictLet: + case NonStrictLet: + enterOuterAlt(_localctx, 35); + { + setState(1002); + let(); + } + break; + case Private: + enterOuterAlt(_localctx, 36); + { + setState(1003); + match(Private); + } + break; + case Public: + enterOuterAlt(_localctx, 37); + { + setState(1004); + match(Public); + } + break; + case Interface: + enterOuterAlt(_localctx, 38); + { + setState(1005); + match(Interface); + } + break; + case Package: + enterOuterAlt(_localctx, 39); + { + setState(1006); + match(Package); + } + break; + case Protected: + enterOuterAlt(_localctx, 40); + { + setState(1007); + match(Protected); + } + break; + case Static: + enterOuterAlt(_localctx, 41); + { + setState(1008); + match(Static); + } + break; + case Yield: + enterOuterAlt(_localctx, 42); + { + setState(1009); + match(Yield); + } + break; + case Async: + enterOuterAlt(_localctx, 43); + { + setState(1010); + match(Async); + } + break; + case Await: + enterOuterAlt(_localctx, 44); + { + setState(1011); + match(Await); + } + break; + case From: + enterOuterAlt(_localctx, 45); + { + setState(1012); + match(From); + } + break; + case As: + enterOuterAlt(_localctx, 46); + { + setState(1013); + match(As); + } + break; + default: + throw new NoViableAltException(this); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class LetContext extends ParserRuleContext { + public TerminalNode NonStrictLet() { return getToken(JavaScriptParser.NonStrictLet, 0); } + public TerminalNode StrictLet() { return getToken(JavaScriptParser.StrictLet, 0); } + public LetContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_let; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).enterLet(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).exitLet(this); + } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof JavaScriptParserVisitor ) return ((JavaScriptParserVisitor)visitor).visitLet(this); + else return visitor.visitChildren(this); + } + } + + public final LetContext let() throws RecognitionException { + LetContext _localctx = new LetContext(_ctx, getState()); + enterRule(_localctx, 146, RULE_let); + int _la; + try { + enterOuterAlt(_localctx, 1); + { + setState(1016); + _la = _input.LA(1); + if ( !(_la==StrictLet || _la==NonStrictLet) ) { + _errHandler.recoverInline(this); + } else { + consume(); + } + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class EosContext extends ParserRuleContext { + public TerminalNode SemiColon() { return getToken(JavaScriptParser.SemiColon, 0); } + public TerminalNode EOF() { return getToken(JavaScriptParser.EOF, 0); } + public EosContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_eos; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).enterEos(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof JavaScriptParserListener ) ((JavaScriptParserListener)listener).exitEos(this); + } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof JavaScriptParserVisitor ) return ((JavaScriptParserVisitor)visitor).visitEos(this); + else return visitor.visitChildren(this); + } + } + + public final EosContext eos() throws RecognitionException { + EosContext _localctx = new EosContext(_ctx, getState()); + enterRule(_localctx, 148, RULE_eos); + try { + setState(1022); + switch ( getInterpreter().adaptivePredict(_input,110,_ctx) ) { + case 1: + enterOuterAlt(_localctx, 1); + { + setState(1018); + match(SemiColon); + } + break; + case 2: + enterOuterAlt(_localctx, 2); + { + setState(1019); + match(EOF); + } + break; + case 3: + enterOuterAlt(_localctx, 3); + { + setState(1020); + if (!(this.lineTerminatorAhead())) throw new FailedPredicateException(this, "this.lineTerminatorAhead()"); + } + break; + case 4: + enterOuterAlt(_localctx, 4); + { + setState(1021); + if (!(this.closeBrace())) throw new FailedPredicateException(this, "this.closeBrace()"); + } + break; + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public boolean sempred(RuleContext _localctx, int ruleIndex, int predIndex) { + switch (ruleIndex) { + case 19: + return expressionStatement_sempred((ExpressionStatementContext)_localctx, predIndex); + case 21: + return iterationStatement_sempred((IterationStatementContext)_localctx, predIndex); + case 23: + return continueStatement_sempred((ContinueStatementContext)_localctx, predIndex); + case 24: + return breakStatement_sempred((BreakStatementContext)_localctx, predIndex); + case 25: + return returnStatement_sempred((ReturnStatementContext)_localctx, predIndex); + case 26: + return yieldStatement_sempred((YieldStatementContext)_localctx, predIndex); + case 34: + return throwStatement_sempred((ThrowStatementContext)_localctx, predIndex); + case 42: + return classElement_sempred((ClassElementContext)_localctx, predIndex); + case 57: + return singleExpression_sempred((SingleExpressionContext)_localctx, predIndex); + case 67: + return getter_sempred((GetterContext)_localctx, predIndex); + case 68: + return setter_sempred((SetterContext)_localctx, predIndex); + case 74: + return eos_sempred((EosContext)_localctx, predIndex); + } + return true; + } + private boolean expressionStatement_sempred(ExpressionStatementContext _localctx, int predIndex) { + switch (predIndex) { + case 0: + return this.notOpenBraceAndNotFunction(); + } + return true; + } + private boolean iterationStatement_sempred(IterationStatementContext _localctx, int predIndex) { + switch (predIndex) { + case 1: + return this.p("of"); + } + return true; + } + private boolean continueStatement_sempred(ContinueStatementContext _localctx, int predIndex) { + switch (predIndex) { + case 2: + return this.notLineTerminator(); + } + return true; + } + private boolean breakStatement_sempred(BreakStatementContext _localctx, int predIndex) { + switch (predIndex) { + case 3: + return this.notLineTerminator(); + } + return true; + } + private boolean returnStatement_sempred(ReturnStatementContext _localctx, int predIndex) { + switch (predIndex) { + case 4: + return this.notLineTerminator(); + } + return true; + } + private boolean yieldStatement_sempred(YieldStatementContext _localctx, int predIndex) { + switch (predIndex) { + case 5: + return this.notLineTerminator(); + } + return true; + } + private boolean throwStatement_sempred(ThrowStatementContext _localctx, int predIndex) { + switch (predIndex) { + case 6: + return this.notLineTerminator(); + } + return true; + } + private boolean classElement_sempred(ClassElementContext _localctx, int predIndex) { + switch (predIndex) { + case 7: + return this.n("static"); + } + return true; + } + private boolean singleExpression_sempred(SingleExpressionContext _localctx, int predIndex) { + switch (predIndex) { + case 8: + return precpred(_ctx, 27); + case 9: + return precpred(_ctx, 26); + case 10: + return precpred(_ctx, 25); + case 11: + return precpred(_ctx, 24); + case 12: + return precpred(_ctx, 23); + case 13: + return precpred(_ctx, 22); + case 14: + return precpred(_ctx, 21); + case 15: + return precpred(_ctx, 20); + case 16: + return precpred(_ctx, 19); + case 17: + return precpred(_ctx, 18); + case 18: + return precpred(_ctx, 17); + case 19: + return precpred(_ctx, 16); + case 20: + return precpred(_ctx, 15); + case 21: + return precpred(_ctx, 14); + case 22: + return precpred(_ctx, 13); + case 23: + return precpred(_ctx, 12); + case 24: + return precpred(_ctx, 11); + case 25: + return precpred(_ctx, 44); + case 26: + return precpred(_ctx, 43); + case 27: + return precpred(_ctx, 42); + case 28: + return precpred(_ctx, 39); + case 29: + return this.notLineTerminator(); + case 30: + return precpred(_ctx, 38); + case 31: + return this.notLineTerminator(); + case 32: + return precpred(_ctx, 9); + } + return true; + } + private boolean getter_sempred(GetterContext _localctx, int predIndex) { + switch (predIndex) { + case 33: + return this.n("get"); + } + return true; + } + private boolean setter_sempred(SetterContext _localctx, int predIndex) { + switch (predIndex) { + case 34: + return this.n("set"); + } + return true; + } + private boolean eos_sempred(EosContext _localctx, int predIndex) { + switch (predIndex) { + case 35: + return this.lineTerminatorAhead(); + case 36: + return this.closeBrace(); + } + return true; + } + + public static final String _serializedATN = + "\3\u0430\ud6d1\u8206\uad2d\u4417\uaef1\u8d80\uaadd\3~\u0403\4\2\t\2\4"+ + "\3\t\3\4\4\t\4\4\5\t\5\4\6\t\6\4\7\t\7\4\b\t\b\4\t\t\t\4\n\t\n\4\13\t"+ + "\13\4\f\t\f\4\r\t\r\4\16\t\16\4\17\t\17\4\20\t\20\4\21\t\21\4\22\t\22"+ + "\4\23\t\23\4\24\t\24\4\25\t\25\4\26\t\26\4\27\t\27\4\30\t\30\4\31\t\31"+ + "\4\32\t\32\4\33\t\33\4\34\t\34\4\35\t\35\4\36\t\36\4\37\t\37\4 \t \4!"+ + "\t!\4\"\t\"\4#\t#\4$\t$\4%\t%\4&\t&\4\'\t\'\4(\t(\4)\t)\4*\t*\4+\t+\4"+ + ",\t,\4-\t-\4.\t.\4/\t/\4\60\t\60\4\61\t\61\4\62\t\62\4\63\t\63\4\64\t"+ + "\64\4\65\t\65\4\66\t\66\4\67\t\67\48\t8\49\t9\4:\t:\4;\t;\4<\t<\4=\t="+ + "\4>\t>\4?\t?\4@\t@\4A\tA\4B\tB\4C\tC\4D\tD\4E\tE\4F\tF\4G\tG\4H\tH\4I"+ + "\tI\4J\tJ\4K\tK\4L\tL\3\2\5\2\u009a\n\2\3\2\5\2\u009d\n\2\3\2\3\2\3\3"+ + "\3\3\3\4\3\4\3\4\3\4\3\4\3\4\3\4\3\4\3\4\3\4\3\4\3\4\3\4\3\4\3\4\3\4\3"+ + "\4\3\4\3\4\3\4\5\4\u00b7\n\4\3\5\3\5\5\5\u00bb\n\5\3\5\3\5\3\6\6\6\u00c0"+ + "\n\6\r\6\16\6\u00c1\3\7\3\7\3\7\3\b\5\b\u00c8\n\b\3\b\3\b\5\b\u00cc\n"+ + "\b\3\b\3\b\3\b\3\b\3\b\5\b\u00d3\n\b\3\t\3\t\3\t\3\t\7\t\u00d9\n\t\f\t"+ + "\16\t\u00dc\13\t\3\t\3\t\5\t\u00e0\n\t\5\t\u00e2\n\t\3\t\3\t\3\n\3\n\3"+ + "\n\3\13\3\13\5\13\u00eb\n\13\3\13\3\13\5\13\u00ef\n\13\3\f\3\f\3\f\3\r"+ + "\3\r\3\r\5\r\u00f7\n\r\3\16\3\16\3\16\5\16\u00fc\n\16\3\16\3\16\3\16\3"+ + "\16\3\16\3\16\3\16\5\16\u0105\n\16\3\17\3\17\3\17\3\17\3\17\3\17\5\17"+ + "\u010d\n\17\3\17\3\17\5\17\u0111\n\17\3\20\3\20\3\20\5\20\u0116\n\20\3"+ + "\21\3\21\3\21\3\22\3\22\3\22\3\22\7\22\u011f\n\22\f\22\16\22\u0122\13"+ + "\22\3\23\3\23\3\23\5\23\u0127\n\23\3\24\3\24\3\25\3\25\3\25\3\25\3\26"+ + "\3\26\3\26\3\26\3\26\3\26\3\26\5\26\u0136\n\26\3\27\3\27\3\27\3\27\3\27"+ + "\3\27\3\27\3\27\3\27\3\27\3\27\3\27\3\27\3\27\3\27\3\27\3\27\3\27\5\27"+ + "\u014a\n\27\3\27\3\27\5\27\u014e\n\27\3\27\3\27\5\27\u0152\n\27\3\27\3"+ + "\27\3\27\3\27\3\27\3\27\5\27\u015a\n\27\3\27\3\27\3\27\3\27\3\27\3\27"+ + "\3\27\5\27\u0163\n\27\3\27\3\27\3\27\5\27\u0168\n\27\3\27\3\27\3\27\3"+ + "\27\3\27\3\27\5\27\u0170\n\27\3\30\3\30\3\30\5\30\u0175\n\30\3\31\3\31"+ + "\3\31\5\31\u017a\n\31\3\31\3\31\3\32\3\32\3\32\5\32\u0181\n\32\3\32\3"+ + "\32\3\33\3\33\3\33\5\33\u0188\n\33\3\33\3\33\3\34\3\34\3\34\5\34\u018f"+ + "\n\34\3\34\3\34\3\35\3\35\3\35\3\35\3\35\3\35\3\36\3\36\3\36\3\36\3\36"+ + "\3\36\3\37\3\37\5\37\u01a1\n\37\3\37\3\37\5\37\u01a5\n\37\5\37\u01a7\n"+ + "\37\3\37\3\37\3 \6 \u01ac\n \r \16 \u01ad\3!\3!\3!\3!\5!\u01b4\n!\3\""+ + "\3\"\3\"\5\"\u01b9\n\"\3#\3#\3#\3#\3$\3$\3$\3$\3$\3%\3%\3%\3%\5%\u01c8"+ + "\n%\3%\5%\u01cb\n%\3&\3&\3&\5&\u01d0\n&\3&\5&\u01d3\n&\3&\3&\3\'\3\'\3"+ + "\'\3(\3(\3(\3)\5)\u01de\n)\3)\3)\5)\u01e2\n)\3)\3)\3)\5)\u01e7\n)\3)\3"+ + ")\3)\3)\3)\3*\3*\3*\3*\3+\3+\5+\u01f4\n+\3+\3+\7+\u01f8\n+\f+\16+\u01fb"+ + "\13+\3+\3+\3,\3,\3,\3,\7,\u0203\n,\f,\16,\u0206\13,\3,\3,\3,\3,\3,\3,"+ + "\5,\u020e\n,\3,\3,\5,\u0212\n,\3,\3,\3,\3,\5,\u0218\n,\3-\5-\u021b\n-"+ + "\3-\5-\u021e\n-\3-\3-\3-\5-\u0223\n-\3-\3-\3-\3-\3-\3-\5-\u022b\n-\3-"+ + "\5-\u022e\n-\3-\3-\3-\3-\3-\3-\3-\3-\5-\u0238\n-\3-\5-\u023b\n-\3-\3-"+ + "\3-\5-\u0240\n-\3-\3-\3-\3-\3-\5-\u0247\n-\3.\3.\3.\7.\u024c\n.\f.\16"+ + ".\u024f\13.\3.\3.\5.\u0253\n.\3.\5.\u0256\n.\3/\3/\3/\5/\u025b\n/\3\60"+ + "\3\60\3\60\3\61\5\61\u0261\n\61\3\62\6\62\u0264\n\62\r\62\16\62\u0265"+ + "\3\63\3\63\3\63\3\63\3\64\7\64\u026d\n\64\f\64\16\64\u0270\13\64\3\64"+ + "\5\64\u0273\n\64\3\64\6\64\u0276\n\64\r\64\16\64\u0277\3\64\7\64\u027b"+ + "\n\64\f\64\16\64\u027e\13\64\3\64\7\64\u0281\n\64\f\64\16\64\u0284\13"+ + "\64\3\65\5\65\u0287\n\65\3\65\3\65\3\66\3\66\3\66\3\66\3\66\3\66\3\66"+ + "\3\66\3\66\3\66\3\66\5\66\u0296\n\66\3\66\5\66\u0299\n\66\3\66\3\66\3"+ + "\66\5\66\u029e\n\66\3\66\3\66\3\66\3\66\3\66\3\66\3\66\3\66\3\66\3\66"+ + "\3\66\3\66\3\66\3\66\3\66\3\66\3\66\3\66\3\66\3\66\3\66\5\66\u02b5\n\66"+ + "\3\66\5\66\u02b8\n\66\3\67\3\67\3\67\3\67\3\67\3\67\3\67\5\67\u02c1\n"+ + "\67\38\38\38\38\78\u02c7\n8\f8\168\u02ca\138\38\58\u02cd\n8\58\u02cf\n"+ + "8\38\38\39\59\u02d4\n9\39\39\59\u02d8\n9\3:\3:\3:\7:\u02dd\n:\f:\16:\u02e0"+ + "\13:\3;\3;\3;\3;\3;\3;\3;\3;\3;\3;\3;\3;\3;\3;\3;\3;\3;\3;\3;\3;\3;\3"+ + ";\3;\3;\5;\u02fa\n;\3;\3;\3;\3;\5;\u0300\n;\3;\3;\3;\3;\3;\3;\3;\3;\3"+ + ";\3;\3;\3;\3;\3;\3;\3;\3;\3;\3;\5;\u0315\n;\3;\3;\3;\3;\3;\3;\3;\3;\3"+ + ";\3;\3;\3;\3;\3;\3;\3;\3;\3;\3;\3;\3;\3;\3;\3;\3;\3;\3;\3;\3;\3;\3;\3"+ + ";\3;\3;\3;\3;\3;\3;\3;\3;\3;\3;\3;\3;\3;\3;\3;\3;\3;\3;\3;\3;\3;\3;\3"+ + ";\3;\3;\3;\3;\3;\3;\3;\5;\u0355\n;\3;\3;\5;\u0359\n;\3;\3;\3;\3;\3;\3"+ + ";\3;\3;\3;\3;\3;\7;\u0366\n;\f;\16;\u0369\13;\3<\3<\3<\5<\u036e\n<\3="+ + "\3=\3=\3=\7=\u0374\n=\f=\16=\u0377\13=\5=\u0379\n=\3=\5=\u037c\n=\3=\3"+ + "=\3>\3>\5>\u0382\n>\3>\3>\5>\u0386\n>\3>\3>\5>\u038a\n>\3>\3>\3>\3>\3"+ + ">\3>\5>\u0392\n>\3>\3>\3>\3>\5>\u0398\n>\3?\3?\3?\5?\u039d\n?\3?\5?\u03a0"+ + "\n?\3@\3@\3@\3@\3@\5@\u03a7\n@\3A\3A\3B\3B\3B\3B\3B\3B\3B\5B\u03b2\nB"+ + "\3C\3C\3D\3D\3E\3E\3E\3E\3F\3F\3F\3F\3G\3G\5G\u03c2\nG\3H\3H\3I\3I\3I"+ + "\5I\u03c9\nI\3J\3J\3J\3J\3J\3J\3J\3J\3J\3J\3J\3J\3J\3J\3J\3J\3J\3J\3J"+ + "\3J\3J\3J\3J\3J\3J\3J\3J\3J\3J\3J\3J\3J\3J\3J\3J\3J\3J\3J\3J\3J\3J\3J"+ + "\3J\3J\3J\3J\5J\u03f9\nJ\3K\3K\3L\3L\3L\3L\5L\u0401\nL\3L\2\3tM\2\4\6"+ + "\b\n\f\16\20\22\24\26\30\32\34\36 \"$&(*,.\60\62\64\668:<>@BDFHJLNPRT"+ + "VXZ\\^`bdfhjlnprtvxz|~\u0080\u0082\u0084\u0086\u0088\u008a\u008c\u008e"+ + "\u0090\u0092\u0094\u0096\2\f\3\2\32\34\3\2\26\27\3\2 \"\3\2#&\3\2\'*\3"+ + "\2\60;\3\2?C\3\2DG\5\2kkooww\3\2no\u04a7\2\u0099\3\2\2\2\4\u00a0\3\2\2"+ + "\2\6\u00b6\3\2\2\2\b\u00b8\3\2\2\2\n\u00bf\3\2\2\2\f\u00c3\3\2\2\2\16"+ + "\u00d2\3\2\2\2\20\u00d4\3\2\2\2\22\u00e5\3\2\2\2\24\u00ea\3\2\2\2\26\u00f0"+ + "\3\2\2\2\30\u00f3\3\2\2\2\32\u0104\3\2\2\2\34\u0110\3\2\2\2\36\u0115\3"+ + "\2\2\2 \u0117\3\2\2\2\"\u011a\3\2\2\2$\u0123\3\2\2\2&\u0128\3\2\2\2(\u012a"+ + "\3\2\2\2*\u012e\3\2\2\2,\u016f\3\2\2\2.\u0174\3\2\2\2\60\u0176\3\2\2\2"+ + "\62\u017d\3\2\2\2\64\u0184\3\2\2\2\66\u018b\3\2\2\28\u0192\3\2\2\2:\u0198"+ + "\3\2\2\2<\u019e\3\2\2\2>\u01ab\3\2\2\2@\u01af\3\2\2\2B\u01b5\3\2\2\2D"+ + "\u01ba\3\2\2\2F\u01be\3\2\2\2H\u01c3\3\2\2\2J\u01cc\3\2\2\2L\u01d6\3\2"+ + "\2\2N\u01d9\3\2\2\2P\u01dd\3\2\2\2R\u01ed\3\2\2\2T\u01f3\3\2\2\2V\u0217"+ + "\3\2\2\2X\u0246\3\2\2\2Z\u0255\3\2\2\2\\\u0257\3\2\2\2^\u025c\3\2\2\2"+ + "`\u0260\3\2\2\2b\u0263\3\2\2\2d\u0267\3\2\2\2f\u026e\3\2\2\2h\u0286\3"+ + "\2\2\2j\u02b7\3\2\2\2l\u02c0\3\2\2\2n\u02c2\3\2\2\2p\u02d3\3\2\2\2r\u02d9"+ + "\3\2\2\2t\u0314\3\2\2\2v\u036d\3\2\2\2x\u036f\3\2\2\2z\u0397\3\2\2\2|"+ + "\u039f\3\2\2\2~\u03a6\3\2\2\2\u0080\u03a8\3\2\2\2\u0082\u03b1\3\2\2\2"+ + "\u0084\u03b3\3\2\2\2\u0086\u03b5\3\2\2\2\u0088\u03b7\3\2\2\2\u008a\u03bb"+ + "\3\2\2\2\u008c\u03c1\3\2\2\2\u008e\u03c3\3\2\2\2\u0090\u03c8\3\2\2\2\u0092"+ + "\u03f8\3\2\2\2\u0094\u03fa\3\2\2\2\u0096\u0400\3\2\2\2\u0098\u009a\7\3"+ + "\2\2\u0099\u0098\3\2\2\2\u0099\u009a\3\2\2\2\u009a\u009c\3\2\2\2\u009b"+ + "\u009d\5b\62\2\u009c\u009b\3\2\2\2\u009c\u009d\3\2\2\2\u009d\u009e\3\2"+ + "\2\2\u009e\u009f\7\2\2\3\u009f\3\3\2\2\2\u00a0\u00a1\5\6\4\2\u00a1\5\3"+ + "\2\2\2\u00a2\u00b7\5\b\5\2\u00a3\u00b7\5 \21\2\u00a4\u00b7\5\f\7\2\u00a5"+ + "\u00b7\5\32\16\2\u00a6\u00b7\5&\24\2\u00a7\u00b7\5R*\2\u00a8\u00b7\5("+ + "\25\2\u00a9\u00b7\5*\26\2\u00aa\u00b7\5,\27\2\u00ab\u00b7\5\60\31\2\u00ac"+ + "\u00b7\5\62\32\2\u00ad\u00b7\5\64\33\2\u00ae\u00b7\5\66\34\2\u00af\u00b7"+ + "\58\35\2\u00b0\u00b7\5D#\2\u00b1\u00b7\5:\36\2\u00b2\u00b7\5F$\2\u00b3"+ + "\u00b7\5H%\2\u00b4\u00b7\5N(\2\u00b5\u00b7\5P)\2\u00b6\u00a2\3\2\2\2\u00b6"+ + "\u00a3\3\2\2\2\u00b6\u00a4\3\2\2\2\u00b6\u00a5\3\2\2\2\u00b6\u00a6\3\2"+ + "\2\2\u00b6\u00a7\3\2\2\2\u00b6\u00a8\3\2\2\2\u00b6\u00a9\3\2\2\2\u00b6"+ + "\u00aa\3\2\2\2\u00b6\u00ab\3\2\2\2\u00b6\u00ac\3\2\2\2\u00b6\u00ad\3\2"+ + "\2\2\u00b6\u00ae\3\2\2\2\u00b6\u00af\3\2\2\2\u00b6\u00b0\3\2\2\2\u00b6"+ + "\u00b1\3\2\2\2\u00b6\u00b2\3\2\2\2\u00b6\u00b3\3\2\2\2\u00b6\u00b4\3\2"+ + "\2\2\u00b6\u00b5\3\2\2\2\u00b7\7\3\2\2\2\u00b8\u00ba\7\13\2\2\u00b9\u00bb"+ + "\5\n\6\2\u00ba\u00b9\3\2\2\2\u00ba\u00bb\3\2\2\2\u00bb\u00bc\3\2\2\2\u00bc"+ + "\u00bd\7\f\2\2\u00bd\t\3\2\2\2\u00be\u00c0\5\6\4\2\u00bf\u00be\3\2\2\2"+ + "\u00c0\u00c1\3\2\2\2\u00c1\u00bf\3\2\2\2\u00c1\u00c2\3\2\2\2\u00c2\13"+ + "\3\2\2\2\u00c3\u00c4\7j\2\2\u00c4\u00c5\5\16\b\2\u00c5\r\3\2\2\2\u00c6"+ + "\u00c8\5\22\n\2\u00c7\u00c6\3\2\2\2\u00c7\u00c8\3\2\2\2\u00c8\u00cb\3"+ + "\2\2\2\u00c9\u00cc\5\24\13\2\u00ca\u00cc\5\20\t\2\u00cb\u00c9\3\2\2\2"+ + "\u00cb\u00ca\3\2\2\2\u00cc\u00cd\3\2\2\2\u00cd\u00ce\5\26\f\2\u00ce\u00cf"+ + "\5\u0096L\2\u00cf\u00d3\3\2\2\2\u00d0\u00d1\7x\2\2\u00d1\u00d3\5\u0096"+ + "L\2\u00d2\u00c7\3\2\2\2\u00d2\u00d0\3\2\2\2\u00d3\17\3\2\2\2\u00d4\u00da"+ + "\7\13\2\2\u00d5\u00d6\5\30\r\2\u00d6\u00d7\7\16\2\2\u00d7\u00d9\3\2\2"+ + "\2\u00d8\u00d5\3\2\2\2\u00d9\u00dc\3\2\2\2\u00da\u00d8\3\2\2\2\u00da\u00db"+ + "\3\2\2\2\u00db\u00e1\3\2\2\2\u00dc\u00da\3\2\2\2\u00dd\u00df\5\30\r\2"+ + "\u00de\u00e0\7\16\2\2\u00df\u00de\3\2\2\2\u00df\u00e0\3\2\2\2\u00e0\u00e2"+ + "\3\2\2\2\u00e1\u00dd\3\2\2\2\u00e1\u00e2\3\2\2\2\u00e2\u00e3\3\2\2\2\u00e3"+ + "\u00e4\7\f\2\2\u00e4\21\3\2\2\2\u00e5\u00e6\5\30\r\2\u00e6\u00e7\7\16"+ + "\2\2\u00e7\23\3\2\2\2\u00e8\u00eb\7\32\2\2\u00e9\u00eb\5\u008cG\2\u00ea"+ + "\u00e8\3\2\2\2\u00ea\u00e9\3\2\2\2\u00eb\u00ee\3\2\2\2\u00ec\u00ed\7b"+ + "\2\2\u00ed\u00ef\5\u008cG\2\u00ee\u00ec\3\2\2\2\u00ee\u00ef\3\2\2\2\u00ef"+ + "\25\3\2\2\2\u00f0\u00f1\7c\2\2\u00f1\u00f2\7x\2\2\u00f2\27\3\2\2\2\u00f3"+ + "\u00f6\5\u008cG\2\u00f4\u00f5\7b\2\2\u00f5\u00f7\5\u008cG\2\u00f6\u00f4"+ + "\3\2\2\2\u00f6\u00f7\3\2\2\2\u00f7\31\3\2\2\2\u00f8\u00fb\7i\2\2\u00f9"+ + "\u00fc\5\34\17\2\u00fa\u00fc\5\36\20\2\u00fb\u00f9\3\2\2\2\u00fb\u00fa"+ + "\3\2\2\2\u00fc\u00fd\3\2\2\2\u00fd\u00fe\5\u0096L\2\u00fe\u0105\3\2\2"+ + "\2\u00ff\u0100\7i\2\2\u0100\u0101\7\\\2\2\u0101\u0102\5t;\2\u0102\u0103"+ + "\5\u0096L\2\u0103\u0105\3\2\2\2\u0104\u00f8\3\2\2\2\u0104\u00ff\3\2\2"+ + "\2\u0105\33\3\2\2\2\u0106\u0107\5\24\13\2\u0107\u0108\5\26\f\2\u0108\u0109"+ + "\5\u0096L\2\u0109\u0111\3\2\2\2\u010a\u010c\5\20\t\2\u010b\u010d\5\26"+ + "\f\2\u010c\u010b\3\2\2\2\u010c\u010d\3\2\2\2\u010d\u010e\3\2\2\2\u010e"+ + "\u010f\5\u0096L\2\u010f\u0111\3\2\2\2\u0110\u0106\3\2\2\2\u0110\u010a"+ + "\3\2\2\2\u0111\35\3\2\2\2\u0112\u0116\5 \21\2\u0113\u0116\5R*\2\u0114"+ + "\u0116\5P)\2\u0115\u0112\3\2\2\2\u0115\u0113\3\2\2\2\u0115\u0114\3\2\2"+ + "\2\u0116\37\3\2\2\2\u0117\u0118\5\"\22\2\u0118\u0119\5\u0096L\2\u0119"+ + "!\3\2\2\2\u011a\u011b\5.\30\2\u011b\u0120\5$\23\2\u011c\u011d\7\16\2\2"+ + "\u011d\u011f\5$\23\2\u011e\u011c\3\2\2\2\u011f\u0122\3\2\2\2\u0120\u011e"+ + "\3\2\2\2\u0120\u0121\3\2\2\2\u0121#\3\2\2\2\u0122\u0120\3\2\2\2\u0123"+ + "\u0126\5v<\2\u0124\u0125\7\17\2\2\u0125\u0127\5t;\2\u0126\u0124\3\2\2"+ + "\2\u0126\u0127\3\2\2\2\u0127%\3\2\2\2\u0128\u0129\7\r\2\2\u0129\'\3\2"+ + "\2\2\u012a\u012b\6\25\2\2\u012b\u012c\5r:\2\u012c\u012d\5\u0096L\2\u012d"+ + ")\3\2\2\2\u012e\u012f\7]\2\2\u012f\u0130\7\t\2\2\u0130\u0131\5r:\2\u0131"+ + "\u0132\7\n\2\2\u0132\u0135\5\6\4\2\u0133\u0134\7M\2\2\u0134\u0136\5\6"+ + "\4\2\u0135\u0133\3\2\2\2\u0135\u0136\3\2\2\2\u0136+\3\2\2\2\u0137\u0138"+ + "\7I\2\2\u0138\u0139\5\6\4\2\u0139\u013a\7W\2\2\u013a\u013b\7\t\2\2\u013b"+ + "\u013c\5r:\2\u013c\u013d\7\n\2\2\u013d\u013e\5\u0096L\2\u013e\u0170\3"+ + "\2\2\2\u013f\u0140\7W\2\2\u0140\u0141\7\t\2\2\u0141\u0142\5r:\2\u0142"+ + "\u0143\7\n\2\2\u0143\u0144\5\6\4\2\u0144\u0170\3\2\2\2\u0145\u0146\7U"+ + "\2\2\u0146\u0149\7\t\2\2\u0147\u014a\5r:\2\u0148\u014a\5\"\22\2\u0149"+ + "\u0147\3\2\2\2\u0149\u0148\3\2\2\2\u0149\u014a\3\2\2\2\u014a\u014b\3\2"+ + "\2\2\u014b\u014d\7\r\2\2\u014c\u014e\5r:\2\u014d\u014c\3\2\2\2\u014d\u014e"+ + "\3\2\2\2\u014e\u014f\3\2\2\2\u014f\u0151\7\r\2\2\u0150\u0152\5r:\2\u0151"+ + "\u0150\3\2\2\2\u0151\u0152\3\2\2\2\u0152\u0153\3\2\2\2\u0153\u0154\7\n"+ + "\2\2\u0154\u0170\5\6\4\2\u0155\u0156\7U\2\2\u0156\u0159\7\t\2\2\u0157"+ + "\u015a\5t;\2\u0158\u015a\5\"\22\2\u0159\u0157\3\2\2\2\u0159\u0158\3\2"+ + "\2\2\u015a\u015b\3\2\2\2\u015b\u015c\7`\2\2\u015c\u015d\5r:\2\u015d\u015e"+ + "\7\n\2\2\u015e\u015f\5\6\4\2\u015f\u0170\3\2\2\2\u0160\u0162\7U\2\2\u0161"+ + "\u0163\7l\2\2\u0162\u0161\3\2\2\2\u0162\u0163\3\2\2\2\u0163\u0164\3\2"+ + "\2\2\u0164\u0167\7\t\2\2\u0165\u0168\5t;\2\u0166\u0168\5\"\22\2\u0167"+ + "\u0165\3\2\2\2\u0167\u0166\3\2\2\2\u0168\u0169\3\2\2\2\u0169\u016a\5\u008e"+ + "H\2\u016a\u016b\6\27\3\2\u016b\u016c\5r:\2\u016c\u016d\7\n\2\2\u016d\u016e"+ + "\5\6\4\2\u016e\u0170\3\2\2\2\u016f\u0137\3\2\2\2\u016f\u013f\3\2\2\2\u016f"+ + "\u0145\3\2\2\2\u016f\u0155\3\2\2\2\u016f\u0160\3\2\2\2\u0170-\3\2\2\2"+ + "\u0171\u0175\7O\2\2\u0172\u0175\5\u0094K\2\u0173\u0175\7h\2\2\u0174\u0171"+ + "\3\2\2\2\u0174\u0172\3\2\2\2\u0174\u0173\3\2\2\2\u0175/\3\2\2\2\u0176"+ + "\u0179\7T\2\2\u0177\u0178\6\31\4\2\u0178\u017a\5\u008eH\2\u0179\u0177"+ + "\3\2\2\2\u0179\u017a\3\2\2\2\u017a\u017b\3\2\2\2\u017b\u017c\5\u0096L"+ + "\2\u017c\61\3\2\2\2\u017d\u0180\7H\2\2\u017e\u017f\6\32\5\2\u017f\u0181"+ + "\5\u008eH\2\u0180\u017e\3\2\2\2\u0180\u0181\3\2\2\2\u0181\u0182\3\2\2"+ + "\2\u0182\u0183\5\u0096L\2\u0183\63\3\2\2\2\u0184\u0187\7R\2\2\u0185\u0186"+ + "\6\33\6\2\u0186\u0188\5r:\2\u0187\u0185\3\2\2\2\u0187\u0188\3\2\2\2\u0188"+ + "\u0189\3\2\2\2\u0189\u018a\5\u0096L\2\u018a\65\3\2\2\2\u018b\u018e\7v"+ + "\2\2\u018c\u018d\6\34\7\2\u018d\u018f\5r:\2\u018e\u018c\3\2\2\2\u018e"+ + "\u018f\3\2\2\2\u018f\u0190\3\2\2\2\u0190\u0191\5\u0096L\2\u0191\67\3\2"+ + "\2\2\u0192\u0193\7[\2\2\u0193\u0194\7\t\2\2\u0194\u0195\5r:\2\u0195\u0196"+ + "\7\n\2\2\u0196\u0197\5\6\4\2\u01979\3\2\2\2\u0198\u0199\7V\2\2\u0199\u019a"+ + "\7\t\2\2\u019a\u019b\5r:\2\u019b\u019c\7\n\2\2\u019c\u019d\5<\37\2\u019d"+ + ";\3\2\2\2\u019e\u01a0\7\13\2\2\u019f\u01a1\5> \2\u01a0\u019f\3\2\2\2\u01a0"+ + "\u01a1\3\2\2\2\u01a1\u01a6\3\2\2\2\u01a2\u01a4\5B\"\2\u01a3\u01a5\5> "+ + "\2\u01a4\u01a3\3\2\2\2\u01a4\u01a5\3\2\2\2\u01a5\u01a7\3\2\2\2\u01a6\u01a2"+ + "\3\2\2\2\u01a6\u01a7\3\2\2\2\u01a7\u01a8\3\2\2\2\u01a8\u01a9\7\f\2\2\u01a9"+ + "=\3\2\2\2\u01aa\u01ac\5@!\2\u01ab\u01aa\3\2\2\2\u01ac\u01ad\3\2\2\2\u01ad"+ + "\u01ab\3\2\2\2\u01ad\u01ae\3\2\2\2\u01ae?\3\2\2\2\u01af\u01b0\7L\2\2\u01b0"+ + "\u01b1\5r:\2\u01b1\u01b3\7\21\2\2\u01b2\u01b4\5\n\6\2\u01b3\u01b2\3\2"+ + "\2\2\u01b3\u01b4\3\2\2\2\u01b4A\3\2\2\2\u01b5\u01b6\7\\\2\2\u01b6\u01b8"+ + "\7\21\2\2\u01b7\u01b9\5\n\6\2\u01b8\u01b7\3\2\2\2\u01b8\u01b9\3\2\2\2"+ + "\u01b9C\3\2\2\2\u01ba\u01bb\5\u008eH\2\u01bb\u01bc\7\21\2\2\u01bc\u01bd"+ + "\5\6\4\2\u01bdE\3\2\2\2\u01be\u01bf\7^\2\2\u01bf\u01c0\6$\b\2\u01c0\u01c1"+ + "\5r:\2\u01c1\u01c2\5\u0096L\2\u01c2G\3\2\2\2\u01c3\u01c4\7a\2\2\u01c4"+ + "\u01ca\5\b\5\2\u01c5\u01c7\5J&\2\u01c6\u01c8\5L\'\2\u01c7\u01c6\3\2\2"+ + "\2\u01c7\u01c8\3\2\2\2\u01c8\u01cb\3\2\2\2\u01c9\u01cb\5L\'\2\u01ca\u01c5"+ + "\3\2\2\2\u01ca\u01c9\3\2\2\2\u01cbI\3\2\2\2\u01cc\u01d2\7P\2\2\u01cd\u01cf"+ + "\7\t\2\2\u01ce\u01d0\5v<\2\u01cf\u01ce\3\2\2\2\u01cf\u01d0\3\2\2\2\u01d0"+ + "\u01d1\3\2\2\2\u01d1\u01d3\7\n\2\2\u01d2\u01cd\3\2\2\2\u01d2\u01d3\3\2"+ + "\2\2\u01d3\u01d4\3\2\2\2\u01d4\u01d5\5\b\5\2\u01d5K\3\2\2\2\u01d6\u01d7"+ + "\7Q\2\2\u01d7\u01d8\5\b\5\2\u01d8M\3\2\2\2\u01d9\u01da\7X\2\2\u01da\u01db"+ + "\5\u0096L\2\u01dbO\3\2\2\2\u01dc\u01de\7k\2\2\u01dd\u01dc\3\2\2\2\u01dd"+ + "\u01de\3\2\2\2\u01de\u01df\3\2\2\2\u01df\u01e1\7Y\2\2\u01e0\u01e2\7\32"+ + "\2\2\u01e1\u01e0\3\2\2\2\u01e1\u01e2\3\2\2\2\u01e2\u01e3\3\2\2\2\u01e3"+ + "\u01e4\5\u008eH\2\u01e4\u01e6\7\t\2\2\u01e5\u01e7\5Z.\2\u01e6\u01e5\3"+ + "\2\2\2\u01e6\u01e7\3\2\2\2\u01e7\u01e8\3\2\2\2\u01e8\u01e9\7\n\2\2\u01e9"+ + "\u01ea\7\13\2\2\u01ea\u01eb\5`\61\2\u01eb\u01ec\7\f\2\2\u01ecQ\3\2\2\2"+ + "\u01ed\u01ee\7d\2\2\u01ee\u01ef\5\u008eH\2\u01ef\u01f0\5T+\2\u01f0S\3"+ + "\2\2\2\u01f1\u01f2\7f\2\2\u01f2\u01f4\5t;\2\u01f3\u01f1\3\2\2\2\u01f3"+ + "\u01f4\3\2\2\2\u01f4\u01f5\3\2\2\2\u01f5\u01f9\7\13\2\2\u01f6\u01f8\5"+ + "V,\2\u01f7\u01f6\3\2\2\2\u01f8\u01fb\3\2\2\2\u01f9\u01f7\3\2\2\2\u01f9"+ + "\u01fa\3\2\2\2\u01fa\u01fc\3\2\2\2\u01fb\u01f9\3\2\2\2\u01fc\u01fd\7\f"+ + "\2\2\u01fdU\3\2\2\2\u01fe\u0203\7u\2\2\u01ff\u0200\6,\t\2\u0200\u0203"+ + "\5\u008eH\2\u0201\u0203\7k\2\2\u0202\u01fe\3\2\2\2\u0202\u01ff\3\2\2\2"+ + "\u0202\u0201\3\2\2\2\u0203\u0206\3\2\2\2\u0204\u0202\3\2\2\2\u0204\u0205"+ + "\3\2\2\2\u0205\u020d\3\2\2\2\u0206\u0204\3\2\2\2\u0207\u020e\5X-\2\u0208"+ + "\u0209\5v<\2\u0209\u020a\7\17\2\2\u020a\u020b\5x=\2\u020b\u020c\7\r\2"+ + "\2\u020c\u020e\3\2\2\2\u020d\u0207\3\2\2\2\u020d\u0208\3\2\2\2\u020e\u0218"+ + "\3\2\2\2\u020f\u0218\5&\24\2\u0210\u0212\7\37\2\2\u0211\u0210\3\2\2\2"+ + "\u0211\u0212\3\2\2\2\u0212\u0213\3\2\2\2\u0213\u0214\5l\67\2\u0214\u0215"+ + "\7\17\2\2\u0215\u0216\5t;\2\u0216\u0218\3\2\2\2\u0217\u0204\3\2\2\2\u0217"+ + "\u020f\3\2\2\2\u0217\u0211\3\2\2\2\u0218W\3\2\2\2\u0219\u021b\7\32\2\2"+ + "\u021a\u0219\3\2\2\2\u021a\u021b\3\2\2\2\u021b\u021d\3\2\2\2\u021c\u021e"+ + "\7\37\2\2\u021d\u021c\3\2\2\2\u021d\u021e\3\2\2\2\u021e\u021f\3\2\2\2"+ + "\u021f\u0220\5l\67\2\u0220\u0222\7\t\2\2\u0221\u0223\5Z.\2\u0222\u0221"+ + "\3\2\2\2\u0222\u0223\3\2\2\2\u0223\u0224\3\2\2\2\u0224\u0225\7\n\2\2\u0225"+ + "\u0226\7\13\2\2\u0226\u0227\5`\61\2\u0227\u0228\7\f\2\2\u0228\u0247\3"+ + "\2\2\2\u0229\u022b\7\32\2\2\u022a\u0229\3\2\2\2\u022a\u022b\3\2\2\2\u022b"+ + "\u022d\3\2\2\2\u022c\u022e\7\37\2\2\u022d\u022c\3\2\2\2\u022d\u022e\3"+ + "\2\2\2\u022e\u022f\3\2\2\2\u022f\u0230\5\u0088E\2\u0230\u0231\7\t\2\2"+ + "\u0231\u0232\7\n\2\2\u0232\u0233\7\13\2\2\u0233\u0234\5`\61\2\u0234\u0235"+ + "\7\f\2\2\u0235\u0247\3\2\2\2\u0236\u0238\7\32\2\2\u0237\u0236\3\2\2\2"+ + "\u0237\u0238\3\2\2\2\u0238\u023a\3\2\2\2\u0239\u023b\7\37\2\2\u023a\u0239"+ + "\3\2\2\2\u023a\u023b\3\2\2\2\u023b\u023c\3\2\2\2\u023c\u023d\5\u008aF"+ + "\2\u023d\u023f\7\t\2\2\u023e\u0240\5Z.\2\u023f\u023e\3\2\2\2\u023f\u0240"+ + "\3\2\2\2\u0240\u0241\3\2\2\2\u0241\u0242\7\n\2\2\u0242\u0243\7\13\2\2"+ + "\u0243\u0244\5`\61\2\u0244\u0245\7\f\2\2\u0245\u0247\3\2\2\2\u0246\u021a"+ + "\3\2\2\2\u0246\u022a\3\2\2\2\u0246\u0237\3\2\2\2\u0247Y\3\2\2\2\u0248"+ + "\u024d\5\\/\2\u0249\u024a\7\16\2\2\u024a\u024c\5\\/\2\u024b\u0249\3\2"+ + "\2\2\u024c\u024f\3\2\2\2\u024d\u024b\3\2\2\2\u024d\u024e\3\2\2\2\u024e"+ + "\u0252\3\2\2\2\u024f\u024d\3\2\2\2\u0250\u0251\7\16\2\2\u0251\u0253\5"+ + "^\60\2\u0252\u0250\3\2\2\2\u0252\u0253\3\2\2\2\u0253\u0256\3\2\2\2\u0254"+ + "\u0256\5^\60\2\u0255\u0248\3\2\2\2\u0255\u0254\3\2\2\2\u0256[\3\2\2\2"+ + "\u0257\u025a\5v<\2\u0258\u0259\7\17\2\2\u0259\u025b\5t;\2\u025a\u0258"+ + "\3\2\2\2\u025a\u025b\3\2\2\2\u025b]\3\2\2\2\u025c\u025d\7\22\2\2\u025d"+ + "\u025e\5t;\2\u025e_\3\2\2\2\u025f\u0261\5b\62\2\u0260\u025f\3\2\2\2\u0260"+ + "\u0261\3\2\2\2\u0261a\3\2\2\2\u0262\u0264\5\4\3\2\u0263\u0262\3\2\2\2"+ + "\u0264\u0265\3\2\2\2\u0265\u0263\3\2\2\2\u0265\u0266\3\2\2\2\u0266c\3"+ + "\2\2\2\u0267\u0268\7\7\2\2\u0268\u0269\5f\64\2\u0269\u026a\7\b\2\2\u026a"+ + "e\3\2\2\2\u026b\u026d\7\16\2\2\u026c\u026b\3\2\2\2\u026d\u0270\3\2\2\2"+ + "\u026e\u026c\3\2\2\2\u026e\u026f\3\2\2\2\u026f\u0272\3\2\2\2\u0270\u026e"+ + "\3\2\2\2\u0271\u0273\5h\65\2\u0272\u0271\3\2\2\2\u0272\u0273\3\2\2\2\u0273"+ + "\u027c\3\2\2\2\u0274\u0276\7\16\2\2\u0275\u0274\3\2\2\2\u0276\u0277\3"+ + "\2\2\2\u0277\u0275\3\2\2\2\u0277\u0278\3\2\2\2\u0278\u0279\3\2\2\2\u0279"+ + "\u027b\5h\65\2\u027a\u0275\3\2\2\2\u027b\u027e\3\2\2\2\u027c\u027a\3\2"+ + "\2\2\u027c\u027d\3\2\2\2\u027d\u0282\3\2\2\2\u027e\u027c\3\2\2\2\u027f"+ + "\u0281\7\16\2\2\u0280\u027f\3\2\2\2\u0281\u0284\3\2\2\2\u0282\u0280\3"+ + "\2\2\2\u0282\u0283\3\2\2\2\u0283g\3\2\2\2\u0284\u0282\3\2\2\2\u0285\u0287"+ + "\7\22\2\2\u0286\u0285\3\2\2\2\u0286\u0287\3\2\2\2\u0287\u0288\3\2\2\2"+ + "\u0288\u0289\5t;\2\u0289i\3\2\2\2\u028a\u028b\5l\67\2\u028b\u028c\7\21"+ + "\2\2\u028c\u028d\5t;\2\u028d\u02b8\3\2\2\2\u028e\u028f\7\7\2\2\u028f\u0290"+ + "\5t;\2\u0290\u0291\7\b\2\2\u0291\u0292\7\21\2\2\u0292\u0293\5t;\2\u0293"+ + "\u02b8\3\2\2\2\u0294\u0296\7k\2\2\u0295\u0294\3\2\2\2\u0295\u0296\3\2"+ + "\2\2\u0296\u0298\3\2\2\2\u0297\u0299\7\32\2\2\u0298\u0297\3\2\2\2\u0298"+ + "\u0299\3\2\2\2\u0299\u029a\3\2\2\2\u029a\u029b\5l\67\2\u029b\u029d\7\t"+ + "\2\2\u029c\u029e\5Z.\2\u029d\u029c\3\2\2\2\u029d\u029e\3\2\2\2\u029e\u029f"+ + "\3\2\2\2\u029f\u02a0\7\n\2\2\u02a0\u02a1\7\13\2\2\u02a1\u02a2\5`\61\2"+ + "\u02a2\u02a3\7\f\2\2\u02a3\u02b8\3\2\2\2\u02a4\u02a5\5\u0088E\2\u02a5"+ + "\u02a6\7\t\2\2\u02a6\u02a7\7\n\2\2\u02a7\u02a8\7\13\2\2\u02a8\u02a9\5"+ + "`\61\2\u02a9\u02aa\7\f\2\2\u02aa\u02b8\3\2\2\2\u02ab\u02ac\5\u008aF\2"+ + "\u02ac\u02ad\7\t\2\2\u02ad\u02ae\5\\/\2\u02ae\u02af\7\n\2\2\u02af\u02b0"+ + "\7\13\2\2\u02b0\u02b1\5`\61\2\u02b1\u02b2\7\f\2\2\u02b2\u02b8\3\2\2\2"+ + "\u02b3\u02b5\7\22\2\2\u02b4\u02b3\3\2\2\2\u02b4\u02b5\3\2\2\2\u02b5\u02b6"+ + "\3\2\2\2\u02b6\u02b8\5t;\2\u02b7\u028a\3\2\2\2\u02b7\u028e\3\2\2\2\u02b7"+ + "\u0295\3\2\2\2\u02b7\u02a4\3\2\2\2\u02b7\u02ab\3\2\2\2\u02b7\u02b4\3\2"+ + "\2\2\u02b8k\3\2\2\2\u02b9\u02c1\5\u008cG\2\u02ba\u02c1\7x\2\2\u02bb\u02c1"+ + "\5\u0084C\2\u02bc\u02bd\7\7\2\2\u02bd\u02be\5t;\2\u02be\u02bf\7\b\2\2"+ + "\u02bf\u02c1\3\2\2\2\u02c0\u02b9\3\2\2\2\u02c0\u02ba\3\2\2\2\u02c0\u02bb"+ + "\3\2\2\2\u02c0\u02bc\3\2\2\2\u02c1m\3\2\2\2\u02c2\u02ce\7\t\2\2\u02c3"+ + "\u02c8\5p9\2\u02c4\u02c5\7\16\2\2\u02c5\u02c7\5p9\2\u02c6\u02c4\3\2\2"+ + "\2\u02c7\u02ca\3\2\2\2\u02c8\u02c6\3\2\2\2\u02c8\u02c9\3\2\2\2\u02c9\u02cc"+ + "\3\2\2\2\u02ca\u02c8\3\2\2\2\u02cb\u02cd\7\16\2\2\u02cc\u02cb\3\2\2\2"+ + "\u02cc\u02cd\3\2\2\2\u02cd\u02cf\3\2\2\2\u02ce\u02c3\3\2\2\2\u02ce\u02cf"+ + "\3\2\2\2\u02cf\u02d0\3\2\2\2\u02d0\u02d1\7\n\2\2\u02d1o\3\2\2\2\u02d2"+ + "\u02d4\7\22\2\2\u02d3\u02d2\3\2\2\2\u02d3\u02d4\3\2\2\2\u02d4\u02d7\3"+ + "\2\2\2\u02d5\u02d8\5t;\2\u02d6\u02d8\5\u008eH\2\u02d7\u02d5\3\2\2\2\u02d7"+ + "\u02d6\3\2\2\2\u02d8q\3\2\2\2\u02d9\u02de\5t;\2\u02da\u02db\7\16\2\2\u02db"+ + "\u02dd\5t;\2\u02dc\u02da\3\2\2\2\u02dd\u02e0\3\2\2\2\u02de\u02dc\3\2\2"+ + "\2\u02de\u02df\3\2\2\2\u02dfs\3\2\2\2\u02e0\u02de\3\2\2\2\u02e1\u02e2"+ + "\b;\1\2\u02e2\u02e3\7_\2\2\u02e3\u0315\5t;\'\u02e4\u02e5\7S\2\2\u02e5"+ + "\u0315\5t;&\u02e6\u02e7\7K\2\2\u02e7\u0315\5t;%\u02e8\u02e9\7\24\2\2\u02e9"+ + "\u0315\5t;$\u02ea\u02eb\7\25\2\2\u02eb\u0315\5t;#\u02ec\u02ed\7\26\2\2"+ + "\u02ed\u0315\5t;\"\u02ee\u02ef\7\27\2\2\u02ef\u0315\5t;!\u02f0\u02f1\7"+ + "\30\2\2\u02f1\u0315\5t; \u02f2\u02f3\7\31\2\2\u02f3\u0315\5t;\37\u02f4"+ + "\u02f5\7l\2\2\u02f5\u0315\5t;\36\u02f6\u0315\5z>\2\u02f7\u02f9\7d\2\2"+ + "\u02f8\u02fa\5\u008eH\2\u02f9\u02f8\3\2\2\2\u02f9\u02fa\3\2\2\2\u02fa"+ + "\u02fb\3\2\2\2\u02fb\u0315\5T+\2\u02fc\u02fd\7N\2\2\u02fd\u02ff\5t;\2"+ + "\u02fe\u0300\5n8\2\u02ff\u02fe\3\2\2\2\u02ff\u0300\3\2\2\2\u0300\u0315"+ + "\3\2\2\2\u0301\u0302\7N\2\2\u0302\u0303\7\23\2\2\u0303\u0315\5\u008eH"+ + "\2\u0304\u0305\7j\2\2\u0305\u0306\7\t\2\2\u0306\u0307\5t;\2\u0307\u0308"+ + "\7\n\2\2\u0308\u0315\3\2\2\2\u0309\u0315\5\66\34\2\u030a\u0315\7Z\2\2"+ + "\u030b\u0315\5\u008eH\2\u030c\u0315\7g\2\2\u030d\u0315\5\u0082B\2\u030e"+ + "\u0315\5d\63\2\u030f\u0315\5x=\2\u0310\u0311\7\t\2\2\u0311\u0312\5r:\2"+ + "\u0312\u0313\7\n\2\2\u0313\u0315\3\2\2\2\u0314\u02e1\3\2\2\2\u0314\u02e4"+ + "\3\2\2\2\u0314\u02e6\3\2\2\2\u0314\u02e8\3\2\2\2\u0314\u02ea\3\2\2\2\u0314"+ + "\u02ec\3\2\2\2\u0314\u02ee\3\2\2\2\u0314\u02f0\3\2\2\2\u0314\u02f2\3\2"+ + "\2\2\u0314\u02f4\3\2\2\2\u0314\u02f6\3\2\2\2\u0314\u02f7\3\2\2\2\u0314"+ + "\u02fc\3\2\2\2\u0314\u0301\3\2\2\2\u0314\u0304\3\2\2\2\u0314\u0309\3\2"+ + "\2\2\u0314\u030a\3\2\2\2\u0314\u030b\3\2\2\2\u0314\u030c\3\2\2\2\u0314"+ + "\u030d\3\2\2\2\u0314\u030e\3\2\2\2\u0314\u030f\3\2\2\2\u0314\u0310\3\2"+ + "\2\2\u0315\u0367\3\2\2\2\u0316\u0317\f\35\2\2\u0317\u0318\7\35\2\2\u0318"+ + "\u0366\5t;\35\u0319\u031a\f\34\2\2\u031a\u031b\t\2\2\2\u031b\u0366\5t"+ + ";\35\u031c\u031d\f\33\2\2\u031d\u031e\t\3\2\2\u031e\u0366\5t;\34\u031f"+ + "\u0320\f\32\2\2\u0320\u0321\7\36\2\2\u0321\u0366\5t;\33\u0322\u0323\f"+ + "\31\2\2\u0323\u0324\t\4\2\2\u0324\u0366\5t;\32\u0325\u0326\f\30\2\2\u0326"+ + "\u0327\t\5\2\2\u0327\u0366\5t;\31\u0328\u0329\f\27\2\2\u0329\u032a\7J"+ + "\2\2\u032a\u0366\5t;\30\u032b\u032c\f\26\2\2\u032c\u032d\7`\2\2\u032d"+ + "\u0366\5t;\27\u032e\u032f\f\25\2\2\u032f\u0330\t\6\2\2\u0330\u0366\5t"+ + ";\26\u0331\u0332\f\24\2\2\u0332\u0333\7+\2\2\u0333\u0366\5t;\25\u0334"+ + "\u0335\f\23\2\2\u0335\u0336\7,\2\2\u0336\u0366\5t;\24\u0337\u0338\f\22"+ + "\2\2\u0338\u0339\7-\2\2\u0339\u0366\5t;\23\u033a\u033b\f\21\2\2\u033b"+ + "\u033c\7.\2\2\u033c\u0366\5t;\22\u033d\u033e\f\20\2\2\u033e\u033f\7/\2"+ + "\2\u033f\u0366\5t;\21\u0340\u0341\f\17\2\2\u0341\u0342\7\20\2\2\u0342"+ + "\u0343\5t;\2\u0343\u0344\7\21\2\2\u0344\u0345\5t;\20\u0345\u0366\3\2\2"+ + "\2\u0346\u0347\f\16\2\2\u0347\u0348\7\17\2\2\u0348\u0366\5t;\16\u0349"+ + "\u034a\f\r\2\2\u034a\u034b\5\u0080A\2\u034b\u034c\5t;\r\u034c\u0366\3"+ + "\2\2\2\u034d\u034e\f.\2\2\u034e\u034f\7\7\2\2\u034f\u0350\5r:\2\u0350"+ + "\u0351\7\b\2\2\u0351\u0366\3\2\2\2\u0352\u0354\f-\2\2\u0353\u0355\7\20"+ + "\2\2\u0354\u0353\3\2\2\2\u0354\u0355\3\2\2\2\u0355\u0356\3\2\2\2\u0356"+ + "\u0358\7\23\2\2\u0357\u0359\7\37\2\2\u0358\u0357\3\2\2\2\u0358\u0359\3"+ + "\2\2\2\u0359\u035a\3\2\2\2\u035a\u0366\5\u008cG\2\u035b\u035c\f,\2\2\u035c"+ + "\u0366\5n8\2\u035d\u035e\f)\2\2\u035e\u035f\6;\37\2\u035f\u0366\7\24\2"+ + "\2\u0360\u0361\f(\2\2\u0361\u0362\6;!\2\u0362\u0366\7\25\2\2\u0363\u0364"+ + "\f\13\2\2\u0364\u0366\7y\2\2\u0365\u0316\3\2\2\2\u0365\u0319\3\2\2\2\u0365"+ + "\u031c\3\2\2\2\u0365\u031f\3\2\2\2\u0365\u0322\3\2\2\2\u0365\u0325\3\2"+ + "\2\2\u0365\u0328\3\2\2\2\u0365\u032b\3\2\2\2\u0365\u032e\3\2\2\2\u0365"+ + "\u0331\3\2\2\2\u0365\u0334\3\2\2\2\u0365\u0337\3\2\2\2\u0365\u033a\3\2"+ + "\2\2\u0365\u033d\3\2\2\2\u0365\u0340\3\2\2\2\u0365\u0346\3\2\2\2\u0365"+ + "\u0349\3\2\2\2\u0365\u034d\3\2\2\2\u0365\u0352\3\2\2\2\u0365\u035b\3\2"+ + "\2\2\u0365\u035d\3\2\2\2\u0365\u0360\3\2\2\2\u0365\u0363\3\2\2\2\u0366"+ + "\u0369\3\2\2\2\u0367\u0365\3\2\2\2\u0367\u0368\3\2\2\2\u0368u\3\2\2\2"+ + "\u0369\u0367\3\2\2\2\u036a\u036e\5\u008eH\2\u036b\u036e\5d\63\2\u036c"+ + "\u036e\5x=\2\u036d\u036a\3\2\2\2\u036d\u036b\3\2\2\2\u036d\u036c\3\2\2"+ + "\2\u036ew\3\2\2\2\u036f\u0378\7\13\2\2\u0370\u0375\5j\66\2\u0371\u0372"+ + "\7\16\2\2\u0372\u0374\5j\66\2\u0373\u0371\3\2\2\2\u0374\u0377\3\2\2\2"+ + "\u0375\u0373\3\2\2\2\u0375\u0376\3\2\2\2\u0376\u0379\3\2\2\2\u0377\u0375"+ + "\3\2\2\2\u0378\u0370\3\2\2\2\u0378\u0379\3\2\2\2\u0379\u037b\3\2\2\2\u037a"+ + "\u037c\7\16\2\2\u037b\u037a\3\2\2\2\u037b\u037c\3\2\2\2\u037c\u037d\3"+ + "\2\2\2\u037d\u037e\7\f\2\2\u037ey\3\2\2\2\u037f\u0398\5P)\2\u0380\u0382"+ + "\7k\2\2\u0381\u0380\3\2\2\2\u0381\u0382\3\2\2\2\u0382\u0383\3\2\2\2\u0383"+ + "\u0385\7Y\2\2\u0384\u0386\7\32\2\2\u0385\u0384\3\2\2\2\u0385\u0386\3\2"+ + "\2\2\u0386\u0387\3\2\2\2\u0387\u0389\7\t\2\2\u0388\u038a\5Z.\2\u0389\u0388"+ + "\3\2\2\2\u0389\u038a\3\2\2\2\u038a\u038b\3\2\2\2\u038b\u038c\7\n\2\2\u038c"+ + "\u038d\7\13\2\2\u038d\u038e\5`\61\2\u038e\u038f\7\f\2\2\u038f\u0398\3"+ + "\2\2\2\u0390\u0392\7k\2\2\u0391\u0390\3\2\2\2\u0391\u0392\3\2\2\2\u0392"+ + "\u0393\3\2\2\2\u0393\u0394\5|?\2\u0394\u0395\7<\2\2\u0395\u0396\5~@\2"+ + "\u0396\u0398\3\2\2\2\u0397\u037f\3\2\2\2\u0397\u0381\3\2\2\2\u0397\u0391"+ + "\3\2\2\2\u0398{\3\2\2\2\u0399\u03a0\5\u008eH\2\u039a\u039c\7\t\2\2\u039b"+ + "\u039d\5Z.\2\u039c\u039b\3\2\2\2\u039c\u039d\3\2\2\2\u039d\u039e\3\2\2"+ + "\2\u039e\u03a0\7\n\2\2\u039f\u0399\3\2\2\2\u039f\u039a\3\2\2\2\u03a0}"+ + "\3\2\2\2\u03a1\u03a7\5t;\2\u03a2\u03a3\7\13\2\2\u03a3\u03a4\5`\61\2\u03a4"+ + "\u03a5\7\f\2\2\u03a5\u03a7\3\2\2\2\u03a6\u03a1\3\2\2\2\u03a6\u03a2\3\2"+ + "\2\2\u03a7\177\3\2\2\2\u03a8\u03a9\t\7\2\2\u03a9\u0081\3\2\2\2\u03aa\u03b2"+ + "\7=\2\2\u03ab\u03b2\7>\2\2\u03ac\u03b2\7x\2\2\u03ad\u03b2\7y\2\2\u03ae"+ + "\u03b2\7\6\2\2\u03af\u03b2\5\u0084C\2\u03b0\u03b2\5\u0086D\2\u03b1\u03aa"+ + "\3\2\2\2\u03b1\u03ab\3\2\2\2\u03b1\u03ac\3\2\2\2\u03b1\u03ad\3\2\2\2\u03b1"+ + "\u03ae\3\2\2\2\u03b1\u03af\3\2\2\2\u03b1\u03b0\3\2\2\2\u03b2\u0083\3\2"+ + "\2\2\u03b3\u03b4\t\b\2\2\u03b4\u0085\3\2\2\2\u03b5\u03b6\t\t\2\2\u03b6"+ + "\u0087\3\2\2\2\u03b7\u03b8\6E#\2\u03b8\u03b9\5\u008eH\2\u03b9\u03ba\5"+ + "l\67\2\u03ba\u0089\3\2\2\2\u03bb\u03bc\6F$\2\u03bc\u03bd\5\u008eH\2\u03bd"+ + "\u03be\5l\67\2\u03be\u008b\3\2\2\2\u03bf\u03c2\5\u008eH\2\u03c0\u03c2"+ + "\5\u0090I\2\u03c1\u03bf\3\2\2\2\u03c1\u03c0\3\2\2\2\u03c2\u008d\3\2\2"+ + "\2\u03c3\u03c4\t\n\2\2\u03c4\u008f\3\2\2\2\u03c5\u03c9\5\u0092J\2\u03c6"+ + "\u03c9\7=\2\2\u03c7\u03c9\7>\2\2\u03c8\u03c5\3\2\2\2\u03c8\u03c6\3\2\2"+ + "\2\u03c8\u03c7\3\2\2\2\u03c9\u0091\3\2\2\2\u03ca\u03f9\7H\2\2\u03cb\u03f9"+ + "\7I\2\2\u03cc\u03f9\7J\2\2\u03cd\u03f9\7K\2\2\u03ce\u03f9\7L\2\2\u03cf"+ + "\u03f9\7M\2\2\u03d0\u03f9\7N\2\2\u03d1\u03f9\7O\2\2\u03d2\u03f9\7P\2\2"+ + "\u03d3\u03f9\7Q\2\2\u03d4\u03f9\7R\2\2\u03d5\u03f9\7S\2\2\u03d6\u03f9"+ + "\7T\2\2\u03d7\u03f9\7U\2\2\u03d8\u03f9\7V\2\2\u03d9\u03f9\7W\2\2\u03da"+ + "\u03f9\7X\2\2\u03db\u03f9\7Y\2\2\u03dc\u03f9\7Z\2\2\u03dd\u03f9\7[\2\2"+ + "\u03de\u03f9\7\\\2\2\u03df\u03f9\7]\2\2\u03e0\u03f9\7^\2\2\u03e1\u03f9"+ + "\7_\2\2\u03e2\u03f9\7`\2\2\u03e3\u03f9\7a\2\2\u03e4\u03f9\7d\2\2\u03e5"+ + "\u03f9\7e\2\2\u03e6\u03f9\7f\2\2\u03e7\u03f9\7g\2\2\u03e8\u03f9\7h\2\2"+ + "\u03e9\u03f9\7i\2\2\u03ea\u03f9\7j\2\2\u03eb\u03f9\7m\2\2\u03ec\u03f9"+ + "\5\u0094K\2\u03ed\u03f9\7p\2\2\u03ee\u03f9\7q\2\2\u03ef\u03f9\7r\2\2\u03f0"+ + "\u03f9\7s\2\2\u03f1\u03f9\7t\2\2\u03f2\u03f9\7u\2\2\u03f3\u03f9\7v\2\2"+ + "\u03f4\u03f9\7k\2\2\u03f5\u03f9\7l\2\2\u03f6\u03f9\7c\2\2\u03f7\u03f9"+ + "\7b\2\2\u03f8\u03ca\3\2\2\2\u03f8\u03cb\3\2\2\2\u03f8\u03cc\3\2\2\2\u03f8"+ + "\u03cd\3\2\2\2\u03f8\u03ce\3\2\2\2\u03f8\u03cf\3\2\2\2\u03f8\u03d0\3\2"+ + "\2\2\u03f8\u03d1\3\2\2\2\u03f8\u03d2\3\2\2\2\u03f8\u03d3\3\2\2\2\u03f8"+ + "\u03d4\3\2\2\2\u03f8\u03d5\3\2\2\2\u03f8\u03d6\3\2\2\2\u03f8\u03d7\3\2"+ + "\2\2\u03f8\u03d8\3\2\2\2\u03f8\u03d9\3\2\2\2\u03f8\u03da\3\2\2\2\u03f8"+ + "\u03db\3\2\2\2\u03f8\u03dc\3\2\2\2\u03f8\u03dd\3\2\2\2\u03f8\u03de\3\2"+ + "\2\2\u03f8\u03df\3\2\2\2\u03f8\u03e0\3\2\2\2\u03f8\u03e1\3\2\2\2\u03f8"+ + "\u03e2\3\2\2\2\u03f8\u03e3\3\2\2\2\u03f8\u03e4\3\2\2\2\u03f8\u03e5\3\2"+ + "\2\2\u03f8\u03e6\3\2\2\2\u03f8\u03e7\3\2\2\2\u03f8\u03e8\3\2\2\2\u03f8"+ + "\u03e9\3\2\2\2\u03f8\u03ea\3\2\2\2\u03f8\u03eb\3\2\2\2\u03f8\u03ec\3\2"+ + "\2\2\u03f8\u03ed\3\2\2\2\u03f8\u03ee\3\2\2\2\u03f8\u03ef\3\2\2\2\u03f8"+ + "\u03f0\3\2\2\2\u03f8\u03f1\3\2\2\2\u03f8\u03f2\3\2\2\2\u03f8\u03f3\3\2"+ + "\2\2\u03f8\u03f4\3\2\2\2\u03f8\u03f5\3\2\2\2\u03f8\u03f6\3\2\2\2\u03f8"+ + "\u03f7\3\2\2\2\u03f9\u0093\3\2\2\2\u03fa\u03fb\t\13\2\2\u03fb\u0095\3"+ + "\2\2\2\u03fc\u0401\7\r\2\2\u03fd\u0401\7\2\2\3\u03fe\u0401\6L%\2\u03ff"+ + "\u0401\6L&\2\u0400\u03fc\3\2\2\2\u0400\u03fd\3\2\2\2\u0400\u03fe\3\2\2"+ + "\2\u0400\u03ff\3\2\2\2\u0401\u0097\3\2\2\2q\u0099\u009c\u00b6\u00ba\u00c1"+ + "\u00c7\u00cb\u00d2\u00da\u00df\u00e1\u00ea\u00ee\u00f6\u00fb\u0104\u010c"+ + "\u0110\u0115\u0120\u0126\u0135\u0149\u014d\u0151\u0159\u0162\u0167\u016f"+ + "\u0174\u0179\u0180\u0187\u018e\u01a0\u01a4\u01a6\u01ad\u01b3\u01b8\u01c7"+ + "\u01ca\u01cf\u01d2\u01dd\u01e1\u01e6\u01f3\u01f9\u0202\u0204\u020d\u0211"+ + "\u0217\u021a\u021d\u0222\u022a\u022d\u0237\u023a\u023f\u0246\u024d\u0252"+ + "\u0255\u025a\u0260\u0265\u026e\u0272\u0277\u027c\u0282\u0286\u0295\u0298"+ + "\u029d\u02b4\u02b7\u02c0\u02c8\u02cc\u02ce\u02d3\u02d7\u02de\u02f9\u02ff"+ + "\u0314\u0354\u0358\u0365\u0367\u036d\u0375\u0378\u037b\u0381\u0385\u0389"+ + "\u0391\u0397\u039c\u039f\u03a6\u03b1\u03c1\u03c8\u03f8\u0400"; + public static final ATN _ATN = + new ATNDeserializer().deserialize(_serializedATN.toCharArray()); + static { + _decisionToDFA = new DFA[_ATN.getNumberOfDecisions()]; + for (int i = 0; i < _ATN.getNumberOfDecisions(); i++) { + _decisionToDFA[i] = new DFA(_ATN.getDecisionState(i), i); + } + } +} \ No newline at end of file diff --git a/src/main/java/antlr/autogenerated/JavaScriptParser.tokens b/src/main/java/antlr/autogenerated/JavaScriptParser.tokens new file mode 100644 index 0000000..4d87a03 --- /dev/null +++ b/src/main/java/antlr/autogenerated/JavaScriptParser.tokens @@ -0,0 +1,224 @@ +HashBangLine=1 +MultiLineComment=2 +SingleLineComment=3 +RegularExpressionLiteral=4 +OpenBracket=5 +CloseBracket=6 +OpenParen=7 +CloseParen=8 +OpenBrace=9 +CloseBrace=10 +SemiColon=11 +Comma=12 +Assign=13 +QuestionMark=14 +Colon=15 +Ellipsis=16 +Dot=17 +PlusPlus=18 +MinusMinus=19 +Plus=20 +Minus=21 +BitNot=22 +Not=23 +Multiply=24 +Divide=25 +Modulus=26 +Power=27 +NullCoalesce=28 +Hashtag=29 +RightShiftArithmetic=30 +LeftShiftArithmetic=31 +RightShiftLogical=32 +LessThan=33 +MoreThan=34 +LessThanEquals=35 +GreaterThanEquals=36 +Equals_=37 +NotEquals=38 +IdentityEquals=39 +IdentityNotEquals=40 +BitAnd=41 +BitXOr=42 +BitOr=43 +And=44 +Or=45 +MultiplyAssign=46 +DivideAssign=47 +ModulusAssign=48 +PlusAssign=49 +MinusAssign=50 +LeftShiftArithmeticAssign=51 +RightShiftArithmeticAssign=52 +RightShiftLogicalAssign=53 +BitAndAssign=54 +BitXorAssign=55 +BitOrAssign=56 +PowerAssign=57 +ARROW=58 +NullLiteral=59 +BooleanLiteral=60 +DecimalLiteral=61 +HexIntegerLiteral=62 +OctalIntegerLiteral=63 +OctalIntegerLiteral2=64 +BinaryIntegerLiteral=65 +BigHexIntegerLiteral=66 +BigOctalIntegerLiteral=67 +BigBinaryIntegerLiteral=68 +BigDecimalIntegerLiteral=69 +Break=70 +Do=71 +Instanceof=72 +Typeof=73 +Case=74 +Else=75 +New=76 +Var=77 +Catch=78 +Finally=79 +Return=80 +Void=81 +Continue=82 +For=83 +Switch=84 +While=85 +Debugger=86 +Function=87 +This=88 +With=89 +Default=90 +If=91 +Throw=92 +Delete=93 +In=94 +Try=95 +As=96 +From=97 +Class=98 +Enum=99 +Extends=100 +Super=101 +Const=102 +Export=103 +Import=104 +Async=105 +Await=106 +Implements=107 +StrictLet=108 +NonStrictLet=109 +Private=110 +Public=111 +Interface=112 +Package=113 +Protected=114 +Static=115 +Yield=116 +Identifier=117 +StringLiteral=118 +TemplateStringLiteral=119 +WhiteSpaces=120 +LineTerminator=121 +HtmlComment=122 +CDataComment=123 +UnexpectedCharacter=124 +'['=5 +']'=6 +'('=7 +')'=8 +'{'=9 +'}'=10 +';'=11 +','=12 +'='=13 +'?'=14 +':'=15 +'...'=16 +'.'=17 +'++'=18 +'--'=19 +'+'=20 +'-'=21 +'~'=22 +'!'=23 +'*'=24 +'/'=25 +'%'=26 +'**'=27 +'??'=28 +'#'=29 +'>>'=30 +'<<'=31 +'>>>'=32 +'<'=33 +'>'=34 +'<='=35 +'>='=36 +'=='=37 +'!='=38 +'==='=39 +'!=='=40 +'&'=41 +'^'=42 +'|'=43 +'&&'=44 +'||'=45 +'*='=46 +'/='=47 +'%='=48 +'+='=49 +'-='=50 +'<<='=51 +'>>='=52 +'>>>='=53 +'&='=54 +'^='=55 +'|='=56 +'**='=57 +'=>'=58 +'null'=59 +'break'=70 +'do'=71 +'instanceof'=72 +'typeof'=73 +'case'=74 +'else'=75 +'new'=76 +'var'=77 +'catch'=78 +'finally'=79 +'return'=80 +'void'=81 +'continue'=82 +'for'=83 +'switch'=84 +'while'=85 +'debugger'=86 +'function'=87 +'this'=88 +'with'=89 +'default'=90 +'if'=91 +'throw'=92 +'delete'=93 +'in'=94 +'try'=95 +'as'=96 +'from'=97 +'class'=98 +'enum'=99 +'extends'=100 +'super'=101 +'const'=102 +'export'=103 +'import'=104 +'async'=105 +'await'=106 +'implements'=107 +'private'=110 +'public'=111 +'interface'=112 +'package'=113 +'protected'=114 +'static'=115 +'yield'=116 diff --git a/src/main/java/antlr/autogenerated/JavaScriptParserBase.java b/src/main/java/antlr/autogenerated/JavaScriptParserBase.java new file mode 100644 index 0000000..86586bc --- /dev/null +++ b/src/main/java/antlr/autogenerated/JavaScriptParserBase.java @@ -0,0 +1,124 @@ +package antlr.autogenerated; + +import org.antlr.v4.runtime.Lexer; +import org.antlr.v4.runtime.Parser; +import org.antlr.v4.runtime.Token; +import org.antlr.v4.runtime.TokenStream; + +/** + * All parser methods that used in grammar (p, prev, notLineTerminator, etc.) + * should start with lower case char similar to parser rules. + */ +public abstract class JavaScriptParserBase extends Parser +{ + public JavaScriptParserBase(TokenStream input) { + super(input); + } + + /** + * Short form for prev(String str) + */ + protected boolean p(String str) { + return prev(str); + } + + /** + * Whether the previous token value equals to @param str + */ + protected boolean prev(String str) { + return _input.LT(-1).getText().equals(str); + } + + /** + * Short form for next(String str) + */ + protected boolean n(String str) { + return next(str); + } + + /** + * Whether the next token value equals to @param str + */ + protected boolean next(String str) { + return _input.LT(1).getText().equals(str); + } + + protected boolean notLineTerminator() { + return !here(JavaScriptParser.LineTerminator); + } + + protected boolean notOpenBraceAndNotFunction() { + int nextTokenType = _input.LT(1).getType(); + return nextTokenType != JavaScriptParser.OpenBrace && nextTokenType != JavaScriptParser.Function; + } + + protected boolean closeBrace() { + return _input.LT(1).getType() == JavaScriptParser.CloseBrace; + } + + /** + * Returns {@code true} iff on the current index of the parser's + * token stream a token of the given {@code type} exists on the + * {@code HIDDEN} channel. + * + * @param type + * the type of the token on the {@code HIDDEN} channel + * to check. + * + * @return {@code true} iff on the current index of the parser's + * token stream a token of the given {@code type} exists on the + * {@code HIDDEN} channel. + */ + private boolean here(final int type) { + + // Get the token ahead of the current index. + int possibleIndexEosToken = this.getCurrentToken().getTokenIndex() - 1; + Token ahead = _input.get(possibleIndexEosToken); + + // Check if the token resides on the HIDDEN channel and if it's of the + // provided type. + return (ahead.getChannel() == Lexer.HIDDEN) && (ahead.getType() == type); + } + + /** + * Returns {@code true} iff on the current index of the parser's + * token stream a token exists on the {@code HIDDEN} channel which + * either is a line terminator, or is a multi line comment that + * contains a line terminator. + * + * @return {@code true} iff on the current index of the parser's + * token stream a token exists on the {@code HIDDEN} channel which + * either is a line terminator, or is a multi line comment that + * contains a line terminator. + */ + protected boolean lineTerminatorAhead() { + + // Get the token ahead of the current index. + int possibleIndexEosToken = this.getCurrentToken().getTokenIndex() - 1; + Token ahead = _input.get(possibleIndexEosToken); + + if (ahead.getChannel() != Lexer.HIDDEN) { + // We're only interested in tokens on the HIDDEN channel. + return false; + } + + if (ahead.getType() == JavaScriptParser.LineTerminator) { + // There is definitely a line terminator ahead. + return true; + } + + if (ahead.getType() == JavaScriptParser.WhiteSpaces) { + // Get the token ahead of the current whitespaces. + possibleIndexEosToken = this.getCurrentToken().getTokenIndex() - 2; + ahead = _input.get(possibleIndexEosToken); + } + + // Get the token's text and type. + String text = ahead.getText(); + int type = ahead.getType(); + + // Check if the token is, or contains a line terminator. + return (type == JavaScriptParser.MultiLineComment && (text.contains("\r") || text.contains("\n"))) || + (type == JavaScriptParser.LineTerminator); + } +} \ No newline at end of file diff --git a/src/main/java/antlr/autogenerated/JavaScriptParserBaseListener.java b/src/main/java/antlr/autogenerated/JavaScriptParserBaseListener.java new file mode 100644 index 0000000..193f6aa --- /dev/null +++ b/src/main/java/antlr/autogenerated/JavaScriptParserBaseListener.java @@ -0,0 +1,1624 @@ +package antlr.autogenerated; + +// Generated from JavaScriptParserUsedForParserCreation by ANTLR 4.5 + +import org.antlr.v4.runtime.ParserRuleContext; +import org.antlr.v4.runtime.tree.ErrorNode; +import org.antlr.v4.runtime.tree.TerminalNode; + +/** + * This class provides an empty implementation of {@link JavaScriptParserListener}, + * which can be extended to create a listener which only needs to handle a subset + * of the available methods. + */ +public class JavaScriptParserBaseListener implements JavaScriptParserListener { + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterProgram(JavaScriptParser.ProgramContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitProgram(JavaScriptParser.ProgramContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterSourceElement(JavaScriptParser.SourceElementContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitSourceElement(JavaScriptParser.SourceElementContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterStatement(JavaScriptParser.StatementContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitStatement(JavaScriptParser.StatementContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterBlock(JavaScriptParser.BlockContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitBlock(JavaScriptParser.BlockContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterStatementList(JavaScriptParser.StatementListContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitStatementList(JavaScriptParser.StatementListContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterImportStatement(JavaScriptParser.ImportStatementContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitImportStatement(JavaScriptParser.ImportStatementContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterImportFromBlock(JavaScriptParser.ImportFromBlockContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitImportFromBlock(JavaScriptParser.ImportFromBlockContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterModuleItems(JavaScriptParser.ModuleItemsContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitModuleItems(JavaScriptParser.ModuleItemsContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterImportDefault(JavaScriptParser.ImportDefaultContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitImportDefault(JavaScriptParser.ImportDefaultContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterImportNamespace(JavaScriptParser.ImportNamespaceContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitImportNamespace(JavaScriptParser.ImportNamespaceContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterImportFrom(JavaScriptParser.ImportFromContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitImportFrom(JavaScriptParser.ImportFromContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterAliasName(JavaScriptParser.AliasNameContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitAliasName(JavaScriptParser.AliasNameContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterExportDeclaration(JavaScriptParser.ExportDeclarationContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitExportDeclaration(JavaScriptParser.ExportDeclarationContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterExportDefaultDeclaration(JavaScriptParser.ExportDefaultDeclarationContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitExportDefaultDeclaration(JavaScriptParser.ExportDefaultDeclarationContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterExportFromBlock(JavaScriptParser.ExportFromBlockContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitExportFromBlock(JavaScriptParser.ExportFromBlockContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterDeclaration(JavaScriptParser.DeclarationContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitDeclaration(JavaScriptParser.DeclarationContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterVariableStatement(JavaScriptParser.VariableStatementContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitVariableStatement(JavaScriptParser.VariableStatementContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterVariableDeclarationList(JavaScriptParser.VariableDeclarationListContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitVariableDeclarationList(JavaScriptParser.VariableDeclarationListContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterVariableDeclaration(JavaScriptParser.VariableDeclarationContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitVariableDeclaration(JavaScriptParser.VariableDeclarationContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterEmptyStatement(JavaScriptParser.EmptyStatementContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitEmptyStatement(JavaScriptParser.EmptyStatementContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterExpressionStatement(JavaScriptParser.ExpressionStatementContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitExpressionStatement(JavaScriptParser.ExpressionStatementContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterIfStatement(JavaScriptParser.IfStatementContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitIfStatement(JavaScriptParser.IfStatementContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterDoStatement(JavaScriptParser.DoStatementContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitDoStatement(JavaScriptParser.DoStatementContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterWhileStatement(JavaScriptParser.WhileStatementContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitWhileStatement(JavaScriptParser.WhileStatementContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterForStatement(JavaScriptParser.ForStatementContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitForStatement(JavaScriptParser.ForStatementContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterForInStatement(JavaScriptParser.ForInStatementContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitForInStatement(JavaScriptParser.ForInStatementContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterForOfStatement(JavaScriptParser.ForOfStatementContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitForOfStatement(JavaScriptParser.ForOfStatementContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterVarModifier(JavaScriptParser.VarModifierContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitVarModifier(JavaScriptParser.VarModifierContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterContinueStatement(JavaScriptParser.ContinueStatementContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitContinueStatement(JavaScriptParser.ContinueStatementContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterBreakStatement(JavaScriptParser.BreakStatementContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitBreakStatement(JavaScriptParser.BreakStatementContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterReturnStatement(JavaScriptParser.ReturnStatementContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitReturnStatement(JavaScriptParser.ReturnStatementContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterYieldStatement(JavaScriptParser.YieldStatementContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitYieldStatement(JavaScriptParser.YieldStatementContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterWithStatement(JavaScriptParser.WithStatementContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitWithStatement(JavaScriptParser.WithStatementContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterSwitchStatement(JavaScriptParser.SwitchStatementContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitSwitchStatement(JavaScriptParser.SwitchStatementContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterCaseBlock(JavaScriptParser.CaseBlockContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitCaseBlock(JavaScriptParser.CaseBlockContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterCaseClauses(JavaScriptParser.CaseClausesContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitCaseClauses(JavaScriptParser.CaseClausesContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterCaseClause(JavaScriptParser.CaseClauseContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitCaseClause(JavaScriptParser.CaseClauseContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterDefaultClause(JavaScriptParser.DefaultClauseContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitDefaultClause(JavaScriptParser.DefaultClauseContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterLabelledStatement(JavaScriptParser.LabelledStatementContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitLabelledStatement(JavaScriptParser.LabelledStatementContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterThrowStatement(JavaScriptParser.ThrowStatementContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitThrowStatement(JavaScriptParser.ThrowStatementContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterTryStatement(JavaScriptParser.TryStatementContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitTryStatement(JavaScriptParser.TryStatementContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterCatchProduction(JavaScriptParser.CatchProductionContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitCatchProduction(JavaScriptParser.CatchProductionContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterFinallyProduction(JavaScriptParser.FinallyProductionContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitFinallyProduction(JavaScriptParser.FinallyProductionContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterDebuggerStatement(JavaScriptParser.DebuggerStatementContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitDebuggerStatement(JavaScriptParser.DebuggerStatementContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterFunctionDeclaration(JavaScriptParser.FunctionDeclarationContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitFunctionDeclaration(JavaScriptParser.FunctionDeclarationContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterClassDeclaration(JavaScriptParser.ClassDeclarationContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitClassDeclaration(JavaScriptParser.ClassDeclarationContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterClassTail(JavaScriptParser.ClassTailContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitClassTail(JavaScriptParser.ClassTailContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterClassElement(JavaScriptParser.ClassElementContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitClassElement(JavaScriptParser.ClassElementContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterMethodDefinition(JavaScriptParser.MethodDefinitionContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitMethodDefinition(JavaScriptParser.MethodDefinitionContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterFormalParameterList(JavaScriptParser.FormalParameterListContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitFormalParameterList(JavaScriptParser.FormalParameterListContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterFormalParameterArg(JavaScriptParser.FormalParameterArgContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitFormalParameterArg(JavaScriptParser.FormalParameterArgContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterLastFormalParameterArg(JavaScriptParser.LastFormalParameterArgContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitLastFormalParameterArg(JavaScriptParser.LastFormalParameterArgContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterFunctionBody(JavaScriptParser.FunctionBodyContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitFunctionBody(JavaScriptParser.FunctionBodyContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterSourceElements(JavaScriptParser.SourceElementsContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitSourceElements(JavaScriptParser.SourceElementsContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterArrayLiteral(JavaScriptParser.ArrayLiteralContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitArrayLiteral(JavaScriptParser.ArrayLiteralContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterElementList(JavaScriptParser.ElementListContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitElementList(JavaScriptParser.ElementListContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterArrayElement(JavaScriptParser.ArrayElementContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitArrayElement(JavaScriptParser.ArrayElementContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterPropertyExpressionAssignment(JavaScriptParser.PropertyExpressionAssignmentContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitPropertyExpressionAssignment(JavaScriptParser.PropertyExpressionAssignmentContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterComputedPropertyExpressionAssignment(JavaScriptParser.ComputedPropertyExpressionAssignmentContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitComputedPropertyExpressionAssignment(JavaScriptParser.ComputedPropertyExpressionAssignmentContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterFunctionProperty(JavaScriptParser.FunctionPropertyContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitFunctionProperty(JavaScriptParser.FunctionPropertyContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterPropertyGetter(JavaScriptParser.PropertyGetterContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitPropertyGetter(JavaScriptParser.PropertyGetterContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterPropertySetter(JavaScriptParser.PropertySetterContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitPropertySetter(JavaScriptParser.PropertySetterContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterPropertyShorthand(JavaScriptParser.PropertyShorthandContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitPropertyShorthand(JavaScriptParser.PropertyShorthandContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterPropertyName(JavaScriptParser.PropertyNameContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitPropertyName(JavaScriptParser.PropertyNameContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterArguments(JavaScriptParser.ArgumentsContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitArguments(JavaScriptParser.ArgumentsContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterArgument(JavaScriptParser.ArgumentContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitArgument(JavaScriptParser.ArgumentContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterExpressionSequence(JavaScriptParser.ExpressionSequenceContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitExpressionSequence(JavaScriptParser.ExpressionSequenceContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterTemplateStringExpression(JavaScriptParser.TemplateStringExpressionContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitTemplateStringExpression(JavaScriptParser.TemplateStringExpressionContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterTernaryExpression(JavaScriptParser.TernaryExpressionContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitTernaryExpression(JavaScriptParser.TernaryExpressionContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterLogicalAndExpression(JavaScriptParser.LogicalAndExpressionContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitLogicalAndExpression(JavaScriptParser.LogicalAndExpressionContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterPowerExpression(JavaScriptParser.PowerExpressionContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitPowerExpression(JavaScriptParser.PowerExpressionContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterPreIncrementExpression(JavaScriptParser.PreIncrementExpressionContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitPreIncrementExpression(JavaScriptParser.PreIncrementExpressionContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterObjectLiteralExpression(JavaScriptParser.ObjectLiteralExpressionContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitObjectLiteralExpression(JavaScriptParser.ObjectLiteralExpressionContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterMetaExpression(JavaScriptParser.MetaExpressionContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitMetaExpression(JavaScriptParser.MetaExpressionContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterInExpression(JavaScriptParser.InExpressionContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitInExpression(JavaScriptParser.InExpressionContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterLogicalOrExpression(JavaScriptParser.LogicalOrExpressionContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitLogicalOrExpression(JavaScriptParser.LogicalOrExpressionContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterNotExpression(JavaScriptParser.NotExpressionContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitNotExpression(JavaScriptParser.NotExpressionContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterPreDecreaseExpression(JavaScriptParser.PreDecreaseExpressionContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitPreDecreaseExpression(JavaScriptParser.PreDecreaseExpressionContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterArgumentsExpression(JavaScriptParser.ArgumentsExpressionContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitArgumentsExpression(JavaScriptParser.ArgumentsExpressionContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterAwaitExpression(JavaScriptParser.AwaitExpressionContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitAwaitExpression(JavaScriptParser.AwaitExpressionContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterThisExpression(JavaScriptParser.ThisExpressionContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitThisExpression(JavaScriptParser.ThisExpressionContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterFunctionExpression(JavaScriptParser.FunctionExpressionContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitFunctionExpression(JavaScriptParser.FunctionExpressionContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterUnaryMinusExpression(JavaScriptParser.UnaryMinusExpressionContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitUnaryMinusExpression(JavaScriptParser.UnaryMinusExpressionContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterAssignmentExpression(JavaScriptParser.AssignmentExpressionContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitAssignmentExpression(JavaScriptParser.AssignmentExpressionContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterPostDecreaseExpression(JavaScriptParser.PostDecreaseExpressionContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitPostDecreaseExpression(JavaScriptParser.PostDecreaseExpressionContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterTypeofExpression(JavaScriptParser.TypeofExpressionContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitTypeofExpression(JavaScriptParser.TypeofExpressionContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterInstanceofExpression(JavaScriptParser.InstanceofExpressionContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitInstanceofExpression(JavaScriptParser.InstanceofExpressionContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterUnaryPlusExpression(JavaScriptParser.UnaryPlusExpressionContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitUnaryPlusExpression(JavaScriptParser.UnaryPlusExpressionContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterDeleteExpression(JavaScriptParser.DeleteExpressionContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitDeleteExpression(JavaScriptParser.DeleteExpressionContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterImportExpression(JavaScriptParser.ImportExpressionContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitImportExpression(JavaScriptParser.ImportExpressionContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterEqualityExpression(JavaScriptParser.EqualityExpressionContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitEqualityExpression(JavaScriptParser.EqualityExpressionContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterBitXOrExpression(JavaScriptParser.BitXOrExpressionContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitBitXOrExpression(JavaScriptParser.BitXOrExpressionContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterSuperExpression(JavaScriptParser.SuperExpressionContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitSuperExpression(JavaScriptParser.SuperExpressionContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterMultiplicativeExpression(JavaScriptParser.MultiplicativeExpressionContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitMultiplicativeExpression(JavaScriptParser.MultiplicativeExpressionContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterBitShiftExpression(JavaScriptParser.BitShiftExpressionContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitBitShiftExpression(JavaScriptParser.BitShiftExpressionContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterParenthesizedExpression(JavaScriptParser.ParenthesizedExpressionContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitParenthesizedExpression(JavaScriptParser.ParenthesizedExpressionContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterAdditiveExpression(JavaScriptParser.AdditiveExpressionContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitAdditiveExpression(JavaScriptParser.AdditiveExpressionContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterRelationalExpression(JavaScriptParser.RelationalExpressionContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitRelationalExpression(JavaScriptParser.RelationalExpressionContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterPostIncrementExpression(JavaScriptParser.PostIncrementExpressionContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitPostIncrementExpression(JavaScriptParser.PostIncrementExpressionContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterYieldExpression(JavaScriptParser.YieldExpressionContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitYieldExpression(JavaScriptParser.YieldExpressionContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterBitNotExpression(JavaScriptParser.BitNotExpressionContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitBitNotExpression(JavaScriptParser.BitNotExpressionContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterNewExpression(JavaScriptParser.NewExpressionContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitNewExpression(JavaScriptParser.NewExpressionContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterLiteralExpression(JavaScriptParser.LiteralExpressionContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitLiteralExpression(JavaScriptParser.LiteralExpressionContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterArrayLiteralExpression(JavaScriptParser.ArrayLiteralExpressionContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitArrayLiteralExpression(JavaScriptParser.ArrayLiteralExpressionContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterMemberDotExpression(JavaScriptParser.MemberDotExpressionContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitMemberDotExpression(JavaScriptParser.MemberDotExpressionContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterClassExpression(JavaScriptParser.ClassExpressionContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitClassExpression(JavaScriptParser.ClassExpressionContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterMemberIndexExpression(JavaScriptParser.MemberIndexExpressionContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitMemberIndexExpression(JavaScriptParser.MemberIndexExpressionContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterIdentifierExpression(JavaScriptParser.IdentifierExpressionContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitIdentifierExpression(JavaScriptParser.IdentifierExpressionContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterBitAndExpression(JavaScriptParser.BitAndExpressionContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitBitAndExpression(JavaScriptParser.BitAndExpressionContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterBitOrExpression(JavaScriptParser.BitOrExpressionContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitBitOrExpression(JavaScriptParser.BitOrExpressionContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterAssignmentOperatorExpression(JavaScriptParser.AssignmentOperatorExpressionContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitAssignmentOperatorExpression(JavaScriptParser.AssignmentOperatorExpressionContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterVoidExpression(JavaScriptParser.VoidExpressionContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitVoidExpression(JavaScriptParser.VoidExpressionContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterCoalesceExpression(JavaScriptParser.CoalesceExpressionContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitCoalesceExpression(JavaScriptParser.CoalesceExpressionContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterAssignable(JavaScriptParser.AssignableContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitAssignable(JavaScriptParser.AssignableContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterObjectLiteral(JavaScriptParser.ObjectLiteralContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitObjectLiteral(JavaScriptParser.ObjectLiteralContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterFunctionDecl(JavaScriptParser.FunctionDeclContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitFunctionDecl(JavaScriptParser.FunctionDeclContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterAnoymousFunctionDecl(JavaScriptParser.AnoymousFunctionDeclContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitAnoymousFunctionDecl(JavaScriptParser.AnoymousFunctionDeclContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterArrowFunction(JavaScriptParser.ArrowFunctionContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitArrowFunction(JavaScriptParser.ArrowFunctionContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterArrowFunctionParameters(JavaScriptParser.ArrowFunctionParametersContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitArrowFunctionParameters(JavaScriptParser.ArrowFunctionParametersContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterArrowFunctionBody(JavaScriptParser.ArrowFunctionBodyContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitArrowFunctionBody(JavaScriptParser.ArrowFunctionBodyContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterAssignmentOperator(JavaScriptParser.AssignmentOperatorContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitAssignmentOperator(JavaScriptParser.AssignmentOperatorContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterLiteral(JavaScriptParser.LiteralContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitLiteral(JavaScriptParser.LiteralContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterNumericLiteral(JavaScriptParser.NumericLiteralContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitNumericLiteral(JavaScriptParser.NumericLiteralContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterBigintLiteral(JavaScriptParser.BigintLiteralContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitBigintLiteral(JavaScriptParser.BigintLiteralContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterGetter(JavaScriptParser.GetterContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitGetter(JavaScriptParser.GetterContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterSetter(JavaScriptParser.SetterContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitSetter(JavaScriptParser.SetterContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterIdentifierName(JavaScriptParser.IdentifierNameContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitIdentifierName(JavaScriptParser.IdentifierNameContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterIdentifier(JavaScriptParser.IdentifierContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitIdentifier(JavaScriptParser.IdentifierContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterReservedWord(JavaScriptParser.ReservedWordContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitReservedWord(JavaScriptParser.ReservedWordContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterKeyword(JavaScriptParser.KeywordContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitKeyword(JavaScriptParser.KeywordContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterLet(JavaScriptParser.LetContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitLet(JavaScriptParser.LetContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterEos(JavaScriptParser.EosContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitEos(JavaScriptParser.EosContext ctx) { } + + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterEveryRule(ParserRuleContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitEveryRule(ParserRuleContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void visitTerminal(TerminalNode node) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void visitErrorNode(ErrorNode node) { } +} \ No newline at end of file diff --git a/src/main/java/antlr/autogenerated/JavaScriptParserBaseVisitor.java b/src/main/java/antlr/autogenerated/JavaScriptParserBaseVisitor.java new file mode 100644 index 0000000..994a171 --- /dev/null +++ b/src/main/java/antlr/autogenerated/JavaScriptParserBaseVisitor.java @@ -0,0 +1,940 @@ +package antlr.autogenerated; + +// Generated from JavaScriptParserUsedForParserCreation by ANTLR 4.5 + +import org.antlr.v4.runtime.tree.AbstractParseTreeVisitor; + +/** + * This class provides an empty implementation of {@link JavaScriptParserVisitor}, + * which can be extended to create a visitor which only needs to handle a subset + * of the available methods. + * + * @param The return type of the visit operation. Use {@link Void} for + * operations with no return type. + */ +public class JavaScriptParserBaseVisitor extends AbstractParseTreeVisitor implements JavaScriptParserVisitor { + /** + * {@inheritDoc} + * + *

The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.

+ */ + @Override public T visitProgram(JavaScriptParser.ProgramContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.

+ */ + @Override public T visitSourceElement(JavaScriptParser.SourceElementContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.

+ */ + @Override public T visitStatement(JavaScriptParser.StatementContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.

+ */ + @Override public T visitBlock(JavaScriptParser.BlockContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.

+ */ + @Override public T visitStatementList(JavaScriptParser.StatementListContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.

+ */ + @Override public T visitImportStatement(JavaScriptParser.ImportStatementContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.

+ */ + @Override public T visitImportFromBlock(JavaScriptParser.ImportFromBlockContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.

+ */ + @Override public T visitModuleItems(JavaScriptParser.ModuleItemsContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.

+ */ + @Override public T visitImportDefault(JavaScriptParser.ImportDefaultContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.

+ */ + @Override public T visitImportNamespace(JavaScriptParser.ImportNamespaceContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.

+ */ + @Override public T visitImportFrom(JavaScriptParser.ImportFromContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.

+ */ + @Override public T visitAliasName(JavaScriptParser.AliasNameContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.

+ */ + @Override public T visitExportDeclaration(JavaScriptParser.ExportDeclarationContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.

+ */ + @Override public T visitExportDefaultDeclaration(JavaScriptParser.ExportDefaultDeclarationContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.

+ */ + @Override public T visitExportFromBlock(JavaScriptParser.ExportFromBlockContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.

+ */ + @Override public T visitDeclaration(JavaScriptParser.DeclarationContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.

+ */ + @Override public T visitVariableStatement(JavaScriptParser.VariableStatementContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.

+ */ + @Override public T visitVariableDeclarationList(JavaScriptParser.VariableDeclarationListContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.

+ */ + @Override public T visitVariableDeclaration(JavaScriptParser.VariableDeclarationContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.

+ */ + @Override public T visitEmptyStatement(JavaScriptParser.EmptyStatementContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.

+ */ + @Override public T visitExpressionStatement(JavaScriptParser.ExpressionStatementContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.

+ */ + @Override public T visitIfStatement(JavaScriptParser.IfStatementContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.

+ */ + @Override public T visitDoStatement(JavaScriptParser.DoStatementContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.

+ */ + @Override public T visitWhileStatement(JavaScriptParser.WhileStatementContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.

+ */ + @Override public T visitForStatement(JavaScriptParser.ForStatementContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.

+ */ + @Override public T visitForInStatement(JavaScriptParser.ForInStatementContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.

+ */ + @Override public T visitForOfStatement(JavaScriptParser.ForOfStatementContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.

+ */ + @Override public T visitVarModifier(JavaScriptParser.VarModifierContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.

+ */ + @Override public T visitContinueStatement(JavaScriptParser.ContinueStatementContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.

+ */ + @Override public T visitBreakStatement(JavaScriptParser.BreakStatementContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.

+ */ + @Override public T visitReturnStatement(JavaScriptParser.ReturnStatementContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.

+ */ + @Override public T visitYieldStatement(JavaScriptParser.YieldStatementContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.

+ */ + @Override public T visitWithStatement(JavaScriptParser.WithStatementContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.

+ */ + @Override public T visitSwitchStatement(JavaScriptParser.SwitchStatementContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.

+ */ + @Override public T visitCaseBlock(JavaScriptParser.CaseBlockContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.

+ */ + @Override public T visitCaseClauses(JavaScriptParser.CaseClausesContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.

+ */ + @Override public T visitCaseClause(JavaScriptParser.CaseClauseContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.

+ */ + @Override public T visitDefaultClause(JavaScriptParser.DefaultClauseContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.

+ */ + @Override public T visitLabelledStatement(JavaScriptParser.LabelledStatementContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.

+ */ + @Override public T visitThrowStatement(JavaScriptParser.ThrowStatementContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.

+ */ + @Override public T visitTryStatement(JavaScriptParser.TryStatementContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.

+ */ + @Override public T visitCatchProduction(JavaScriptParser.CatchProductionContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.

+ */ + @Override public T visitFinallyProduction(JavaScriptParser.FinallyProductionContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.

+ */ + @Override public T visitDebuggerStatement(JavaScriptParser.DebuggerStatementContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.

+ */ + @Override public T visitFunctionDeclaration(JavaScriptParser.FunctionDeclarationContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.

+ */ + @Override public T visitClassDeclaration(JavaScriptParser.ClassDeclarationContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.

+ */ + @Override public T visitClassTail(JavaScriptParser.ClassTailContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.

+ */ + @Override public T visitClassElement(JavaScriptParser.ClassElementContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.

+ */ + @Override public T visitMethodDefinition(JavaScriptParser.MethodDefinitionContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.

+ */ + @Override public T visitFormalParameterList(JavaScriptParser.FormalParameterListContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.

+ */ + @Override public T visitFormalParameterArg(JavaScriptParser.FormalParameterArgContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.

+ */ + @Override public T visitLastFormalParameterArg(JavaScriptParser.LastFormalParameterArgContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.

+ */ + @Override public T visitFunctionBody(JavaScriptParser.FunctionBodyContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.

+ */ + @Override public T visitSourceElements(JavaScriptParser.SourceElementsContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.

+ */ + @Override public T visitArrayLiteral(JavaScriptParser.ArrayLiteralContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.

+ */ + @Override public T visitElementList(JavaScriptParser.ElementListContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.

+ */ + @Override public T visitArrayElement(JavaScriptParser.ArrayElementContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.

+ */ + @Override public T visitPropertyExpressionAssignment(JavaScriptParser.PropertyExpressionAssignmentContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.

+ */ + @Override public T visitComputedPropertyExpressionAssignment(JavaScriptParser.ComputedPropertyExpressionAssignmentContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.

+ */ + @Override public T visitFunctionProperty(JavaScriptParser.FunctionPropertyContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.

+ */ + @Override public T visitPropertyGetter(JavaScriptParser.PropertyGetterContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.

+ */ + @Override public T visitPropertySetter(JavaScriptParser.PropertySetterContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.

+ */ + @Override public T visitPropertyShorthand(JavaScriptParser.PropertyShorthandContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.

+ */ + @Override public T visitPropertyName(JavaScriptParser.PropertyNameContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.

+ */ + @Override public T visitArguments(JavaScriptParser.ArgumentsContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.

+ */ + @Override public T visitArgument(JavaScriptParser.ArgumentContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.

+ */ + @Override public T visitExpressionSequence(JavaScriptParser.ExpressionSequenceContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.

+ */ + @Override public T visitTemplateStringExpression(JavaScriptParser.TemplateStringExpressionContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.

+ */ + @Override public T visitTernaryExpression(JavaScriptParser.TernaryExpressionContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.

+ */ + @Override public T visitLogicalAndExpression(JavaScriptParser.LogicalAndExpressionContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.

+ */ + @Override public T visitPowerExpression(JavaScriptParser.PowerExpressionContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.

+ */ + @Override public T visitPreIncrementExpression(JavaScriptParser.PreIncrementExpressionContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.

+ */ + @Override public T visitObjectLiteralExpression(JavaScriptParser.ObjectLiteralExpressionContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.

+ */ + @Override public T visitMetaExpression(JavaScriptParser.MetaExpressionContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.

+ */ + @Override public T visitInExpression(JavaScriptParser.InExpressionContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.

+ */ + @Override public T visitLogicalOrExpression(JavaScriptParser.LogicalOrExpressionContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.

+ */ + @Override public T visitNotExpression(JavaScriptParser.NotExpressionContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.

+ */ + @Override public T visitPreDecreaseExpression(JavaScriptParser.PreDecreaseExpressionContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.

+ */ + @Override public T visitArgumentsExpression(JavaScriptParser.ArgumentsExpressionContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.

+ */ + @Override public T visitAwaitExpression(JavaScriptParser.AwaitExpressionContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.

+ */ + @Override public T visitThisExpression(JavaScriptParser.ThisExpressionContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.

+ */ + @Override public T visitFunctionExpression(JavaScriptParser.FunctionExpressionContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.

+ */ + @Override public T visitUnaryMinusExpression(JavaScriptParser.UnaryMinusExpressionContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.

+ */ + @Override public T visitAssignmentExpression(JavaScriptParser.AssignmentExpressionContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.

+ */ + @Override public T visitPostDecreaseExpression(JavaScriptParser.PostDecreaseExpressionContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.

+ */ + @Override public T visitTypeofExpression(JavaScriptParser.TypeofExpressionContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.

+ */ + @Override public T visitInstanceofExpression(JavaScriptParser.InstanceofExpressionContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.

+ */ + @Override public T visitUnaryPlusExpression(JavaScriptParser.UnaryPlusExpressionContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.

+ */ + @Override public T visitDeleteExpression(JavaScriptParser.DeleteExpressionContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.

+ */ + @Override public T visitImportExpression(JavaScriptParser.ImportExpressionContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.

+ */ + @Override public T visitEqualityExpression(JavaScriptParser.EqualityExpressionContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.

+ */ + @Override public T visitBitXOrExpression(JavaScriptParser.BitXOrExpressionContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.

+ */ + @Override public T visitSuperExpression(JavaScriptParser.SuperExpressionContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.

+ */ + @Override public T visitMultiplicativeExpression(JavaScriptParser.MultiplicativeExpressionContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.

+ */ + @Override public T visitBitShiftExpression(JavaScriptParser.BitShiftExpressionContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.

+ */ + @Override public T visitParenthesizedExpression(JavaScriptParser.ParenthesizedExpressionContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.

+ */ + @Override public T visitAdditiveExpression(JavaScriptParser.AdditiveExpressionContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.

+ */ + @Override public T visitRelationalExpression(JavaScriptParser.RelationalExpressionContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.

+ */ + @Override public T visitPostIncrementExpression(JavaScriptParser.PostIncrementExpressionContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.

+ */ + @Override public T visitYieldExpression(JavaScriptParser.YieldExpressionContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.

+ */ + @Override public T visitBitNotExpression(JavaScriptParser.BitNotExpressionContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.

+ */ + @Override public T visitNewExpression(JavaScriptParser.NewExpressionContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.

+ */ + @Override public T visitLiteralExpression(JavaScriptParser.LiteralExpressionContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.

+ */ + @Override public T visitArrayLiteralExpression(JavaScriptParser.ArrayLiteralExpressionContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.

+ */ + @Override public T visitMemberDotExpression(JavaScriptParser.MemberDotExpressionContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.

+ */ + @Override public T visitClassExpression(JavaScriptParser.ClassExpressionContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.

+ */ + @Override public T visitMemberIndexExpression(JavaScriptParser.MemberIndexExpressionContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.

+ */ + @Override public T visitIdentifierExpression(JavaScriptParser.IdentifierExpressionContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.

+ */ + @Override public T visitBitAndExpression(JavaScriptParser.BitAndExpressionContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.

+ */ + @Override public T visitBitOrExpression(JavaScriptParser.BitOrExpressionContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.

+ */ + @Override public T visitAssignmentOperatorExpression(JavaScriptParser.AssignmentOperatorExpressionContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.

+ */ + @Override public T visitVoidExpression(JavaScriptParser.VoidExpressionContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.

+ */ + @Override public T visitCoalesceExpression(JavaScriptParser.CoalesceExpressionContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.

+ */ + @Override public T visitAssignable(JavaScriptParser.AssignableContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.

+ */ + @Override public T visitObjectLiteral(JavaScriptParser.ObjectLiteralContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.

+ */ + @Override public T visitFunctionDecl(JavaScriptParser.FunctionDeclContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.

+ */ + @Override public T visitAnoymousFunctionDecl(JavaScriptParser.AnoymousFunctionDeclContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.

+ */ + @Override public T visitArrowFunction(JavaScriptParser.ArrowFunctionContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.

+ */ + @Override public T visitArrowFunctionParameters(JavaScriptParser.ArrowFunctionParametersContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.

+ */ + @Override public T visitArrowFunctionBody(JavaScriptParser.ArrowFunctionBodyContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.

+ */ + @Override public T visitAssignmentOperator(JavaScriptParser.AssignmentOperatorContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.

+ */ + @Override public T visitLiteral(JavaScriptParser.LiteralContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.

+ */ + @Override public T visitNumericLiteral(JavaScriptParser.NumericLiteralContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.

+ */ + @Override public T visitBigintLiteral(JavaScriptParser.BigintLiteralContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.

+ */ + @Override public T visitGetter(JavaScriptParser.GetterContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.

+ */ + @Override public T visitSetter(JavaScriptParser.SetterContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.

+ */ + @Override public T visitIdentifierName(JavaScriptParser.IdentifierNameContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.

+ */ + @Override public T visitIdentifier(JavaScriptParser.IdentifierContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.

+ */ + @Override public T visitReservedWord(JavaScriptParser.ReservedWordContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.

+ */ + @Override public T visitKeyword(JavaScriptParser.KeywordContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.

+ */ + @Override public T visitLet(JavaScriptParser.LetContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.

+ */ + @Override public T visitEos(JavaScriptParser.EosContext ctx) { return visitChildren(ctx); } +} \ No newline at end of file diff --git a/src/main/java/antlr/autogenerated/JavaScriptParserListener.java b/src/main/java/antlr/autogenerated/JavaScriptParserListener.java new file mode 100644 index 0000000..5ee76c0 --- /dev/null +++ b/src/main/java/antlr/autogenerated/JavaScriptParserListener.java @@ -0,0 +1,1455 @@ +package antlr.autogenerated; + +// Generated from JavaScriptParserUsedForParserCreation by ANTLR 4.5 +import org.antlr.v4.runtime.tree.ParseTreeListener; + +/** + * This interface defines a complete listener for a parse tree produced by + * {@link JavaScriptParser}. + */ +public interface JavaScriptParserListener extends ParseTreeListener { + /** + * Enter a parse tree produced by {@link JavaScriptParser#program}. + * @param ctx the parse tree + */ + void enterProgram(JavaScriptParser.ProgramContext ctx); + /** + * Exit a parse tree produced by {@link JavaScriptParser#program}. + * @param ctx the parse tree + */ + void exitProgram(JavaScriptParser.ProgramContext ctx); + /** + * Enter a parse tree produced by {@link JavaScriptParser#sourceElement}. + * @param ctx the parse tree + */ + void enterSourceElement(JavaScriptParser.SourceElementContext ctx); + /** + * Exit a parse tree produced by {@link JavaScriptParser#sourceElement}. + * @param ctx the parse tree + */ + void exitSourceElement(JavaScriptParser.SourceElementContext ctx); + /** + * Enter a parse tree produced by {@link JavaScriptParser#statement}. + * @param ctx the parse tree + */ + void enterStatement(JavaScriptParser.StatementContext ctx); + /** + * Exit a parse tree produced by {@link JavaScriptParser#statement}. + * @param ctx the parse tree + */ + void exitStatement(JavaScriptParser.StatementContext ctx); + /** + * Enter a parse tree produced by {@link JavaScriptParser#block}. + * @param ctx the parse tree + */ + void enterBlock(JavaScriptParser.BlockContext ctx); + /** + * Exit a parse tree produced by {@link JavaScriptParser#block}. + * @param ctx the parse tree + */ + void exitBlock(JavaScriptParser.BlockContext ctx); + /** + * Enter a parse tree produced by {@link JavaScriptParser#statementList}. + * @param ctx the parse tree + */ + void enterStatementList(JavaScriptParser.StatementListContext ctx); + /** + * Exit a parse tree produced by {@link JavaScriptParser#statementList}. + * @param ctx the parse tree + */ + void exitStatementList(JavaScriptParser.StatementListContext ctx); + /** + * Enter a parse tree produced by {@link JavaScriptParser#importStatement}. + * @param ctx the parse tree + */ + void enterImportStatement(JavaScriptParser.ImportStatementContext ctx); + /** + * Exit a parse tree produced by {@link JavaScriptParser#importStatement}. + * @param ctx the parse tree + */ + void exitImportStatement(JavaScriptParser.ImportStatementContext ctx); + /** + * Enter a parse tree produced by {@link JavaScriptParser#importFromBlock}. + * @param ctx the parse tree + */ + void enterImportFromBlock(JavaScriptParser.ImportFromBlockContext ctx); + /** + * Exit a parse tree produced by {@link JavaScriptParser#importFromBlock}. + * @param ctx the parse tree + */ + void exitImportFromBlock(JavaScriptParser.ImportFromBlockContext ctx); + /** + * Enter a parse tree produced by {@link JavaScriptParser#moduleItems}. + * @param ctx the parse tree + */ + void enterModuleItems(JavaScriptParser.ModuleItemsContext ctx); + /** + * Exit a parse tree produced by {@link JavaScriptParser#moduleItems}. + * @param ctx the parse tree + */ + void exitModuleItems(JavaScriptParser.ModuleItemsContext ctx); + /** + * Enter a parse tree produced by {@link JavaScriptParser#importDefault}. + * @param ctx the parse tree + */ + void enterImportDefault(JavaScriptParser.ImportDefaultContext ctx); + /** + * Exit a parse tree produced by {@link JavaScriptParser#importDefault}. + * @param ctx the parse tree + */ + void exitImportDefault(JavaScriptParser.ImportDefaultContext ctx); + /** + * Enter a parse tree produced by {@link JavaScriptParser#importNamespace}. + * @param ctx the parse tree + */ + void enterImportNamespace(JavaScriptParser.ImportNamespaceContext ctx); + /** + * Exit a parse tree produced by {@link JavaScriptParser#importNamespace}. + * @param ctx the parse tree + */ + void exitImportNamespace(JavaScriptParser.ImportNamespaceContext ctx); + /** + * Enter a parse tree produced by {@link JavaScriptParser#importFrom}. + * @param ctx the parse tree + */ + void enterImportFrom(JavaScriptParser.ImportFromContext ctx); + /** + * Exit a parse tree produced by {@link JavaScriptParser#importFrom}. + * @param ctx the parse tree + */ + void exitImportFrom(JavaScriptParser.ImportFromContext ctx); + /** + * Enter a parse tree produced by {@link JavaScriptParser#aliasName}. + * @param ctx the parse tree + */ + void enterAliasName(JavaScriptParser.AliasNameContext ctx); + /** + * Exit a parse tree produced by {@link JavaScriptParser#aliasName}. + * @param ctx the parse tree + */ + void exitAliasName(JavaScriptParser.AliasNameContext ctx); + /** + * Enter a parse tree produced by the {@code ExportDeclaration} + * labeled alternative in {@link JavaScriptParser#exportStatement}. + * @param ctx the parse tree + */ + void enterExportDeclaration(JavaScriptParser.ExportDeclarationContext ctx); + /** + * Exit a parse tree produced by the {@code ExportDeclaration} + * labeled alternative in {@link JavaScriptParser#exportStatement}. + * @param ctx the parse tree + */ + void exitExportDeclaration(JavaScriptParser.ExportDeclarationContext ctx); + /** + * Enter a parse tree produced by the {@code ExportDefaultDeclaration} + * labeled alternative in {@link JavaScriptParser#exportStatement}. + * @param ctx the parse tree + */ + void enterExportDefaultDeclaration(JavaScriptParser.ExportDefaultDeclarationContext ctx); + /** + * Exit a parse tree produced by the {@code ExportDefaultDeclaration} + * labeled alternative in {@link JavaScriptParser#exportStatement}. + * @param ctx the parse tree + */ + void exitExportDefaultDeclaration(JavaScriptParser.ExportDefaultDeclarationContext ctx); + /** + * Enter a parse tree produced by {@link JavaScriptParser#exportFromBlock}. + * @param ctx the parse tree + */ + void enterExportFromBlock(JavaScriptParser.ExportFromBlockContext ctx); + /** + * Exit a parse tree produced by {@link JavaScriptParser#exportFromBlock}. + * @param ctx the parse tree + */ + void exitExportFromBlock(JavaScriptParser.ExportFromBlockContext ctx); + /** + * Enter a parse tree produced by {@link JavaScriptParser#declaration}. + * @param ctx the parse tree + */ + void enterDeclaration(JavaScriptParser.DeclarationContext ctx); + /** + * Exit a parse tree produced by {@link JavaScriptParser#declaration}. + * @param ctx the parse tree + */ + void exitDeclaration(JavaScriptParser.DeclarationContext ctx); + /** + * Enter a parse tree produced by {@link JavaScriptParser#variableStatement}. + * @param ctx the parse tree + */ + void enterVariableStatement(JavaScriptParser.VariableStatementContext ctx); + /** + * Exit a parse tree produced by {@link JavaScriptParser#variableStatement}. + * @param ctx the parse tree + */ + void exitVariableStatement(JavaScriptParser.VariableStatementContext ctx); + /** + * Enter a parse tree produced by {@link JavaScriptParser#variableDeclarationList}. + * @param ctx the parse tree + */ + void enterVariableDeclarationList(JavaScriptParser.VariableDeclarationListContext ctx); + /** + * Exit a parse tree produced by {@link JavaScriptParser#variableDeclarationList}. + * @param ctx the parse tree + */ + void exitVariableDeclarationList(JavaScriptParser.VariableDeclarationListContext ctx); + /** + * Enter a parse tree produced by {@link JavaScriptParser#variableDeclaration}. + * @param ctx the parse tree + */ + void enterVariableDeclaration(JavaScriptParser.VariableDeclarationContext ctx); + /** + * Exit a parse tree produced by {@link JavaScriptParser#variableDeclaration}. + * @param ctx the parse tree + */ + void exitVariableDeclaration(JavaScriptParser.VariableDeclarationContext ctx); + /** + * Enter a parse tree produced by {@link JavaScriptParser#emptyStatement}. + * @param ctx the parse tree + */ + void enterEmptyStatement(JavaScriptParser.EmptyStatementContext ctx); + /** + * Exit a parse tree produced by {@link JavaScriptParser#emptyStatement}. + * @param ctx the parse tree + */ + void exitEmptyStatement(JavaScriptParser.EmptyStatementContext ctx); + /** + * Enter a parse tree produced by {@link JavaScriptParser#expressionStatement}. + * @param ctx the parse tree + */ + void enterExpressionStatement(JavaScriptParser.ExpressionStatementContext ctx); + /** + * Exit a parse tree produced by {@link JavaScriptParser#expressionStatement}. + * @param ctx the parse tree + */ + void exitExpressionStatement(JavaScriptParser.ExpressionStatementContext ctx); + /** + * Enter a parse tree produced by {@link JavaScriptParser#ifStatement}. + * @param ctx the parse tree + */ + void enterIfStatement(JavaScriptParser.IfStatementContext ctx); + /** + * Exit a parse tree produced by {@link JavaScriptParser#ifStatement}. + * @param ctx the parse tree + */ + void exitIfStatement(JavaScriptParser.IfStatementContext ctx); + /** + * Enter a parse tree produced by the {@code DoStatement} + * labeled alternative in {@link JavaScriptParser#iterationStatement}. + * @param ctx the parse tree + */ + void enterDoStatement(JavaScriptParser.DoStatementContext ctx); + /** + * Exit a parse tree produced by the {@code DoStatement} + * labeled alternative in {@link JavaScriptParser#iterationStatement}. + * @param ctx the parse tree + */ + void exitDoStatement(JavaScriptParser.DoStatementContext ctx); + /** + * Enter a parse tree produced by the {@code WhileStatement} + * labeled alternative in {@link JavaScriptParser#iterationStatement}. + * @param ctx the parse tree + */ + void enterWhileStatement(JavaScriptParser.WhileStatementContext ctx); + /** + * Exit a parse tree produced by the {@code WhileStatement} + * labeled alternative in {@link JavaScriptParser#iterationStatement}. + * @param ctx the parse tree + */ + void exitWhileStatement(JavaScriptParser.WhileStatementContext ctx); + /** + * Enter a parse tree produced by the {@code ForStatement} + * labeled alternative in {@link JavaScriptParser#iterationStatement}. + * @param ctx the parse tree + */ + void enterForStatement(JavaScriptParser.ForStatementContext ctx); + /** + * Exit a parse tree produced by the {@code ForStatement} + * labeled alternative in {@link JavaScriptParser#iterationStatement}. + * @param ctx the parse tree + */ + void exitForStatement(JavaScriptParser.ForStatementContext ctx); + /** + * Enter a parse tree produced by the {@code ForInStatement} + * labeled alternative in {@link JavaScriptParser#iterationStatement}. + * @param ctx the parse tree + */ + void enterForInStatement(JavaScriptParser.ForInStatementContext ctx); + /** + * Exit a parse tree produced by the {@code ForInStatement} + * labeled alternative in {@link JavaScriptParser#iterationStatement}. + * @param ctx the parse tree + */ + void exitForInStatement(JavaScriptParser.ForInStatementContext ctx); + /** + * Enter a parse tree produced by the {@code ForOfStatement} + * labeled alternative in {@link JavaScriptParser#iterationStatement}. + * @param ctx the parse tree + */ + void enterForOfStatement(JavaScriptParser.ForOfStatementContext ctx); + /** + * Exit a parse tree produced by the {@code ForOfStatement} + * labeled alternative in {@link JavaScriptParser#iterationStatement}. + * @param ctx the parse tree + */ + void exitForOfStatement(JavaScriptParser.ForOfStatementContext ctx); + /** + * Enter a parse tree produced by {@link JavaScriptParser#varModifier}. + * @param ctx the parse tree + */ + void enterVarModifier(JavaScriptParser.VarModifierContext ctx); + /** + * Exit a parse tree produced by {@link JavaScriptParser#varModifier}. + * @param ctx the parse tree + */ + void exitVarModifier(JavaScriptParser.VarModifierContext ctx); + /** + * Enter a parse tree produced by {@link JavaScriptParser#continueStatement}. + * @param ctx the parse tree + */ + void enterContinueStatement(JavaScriptParser.ContinueStatementContext ctx); + /** + * Exit a parse tree produced by {@link JavaScriptParser#continueStatement}. + * @param ctx the parse tree + */ + void exitContinueStatement(JavaScriptParser.ContinueStatementContext ctx); + /** + * Enter a parse tree produced by {@link JavaScriptParser#breakStatement}. + * @param ctx the parse tree + */ + void enterBreakStatement(JavaScriptParser.BreakStatementContext ctx); + /** + * Exit a parse tree produced by {@link JavaScriptParser#breakStatement}. + * @param ctx the parse tree + */ + void exitBreakStatement(JavaScriptParser.BreakStatementContext ctx); + /** + * Enter a parse tree produced by {@link JavaScriptParser#returnStatement}. + * @param ctx the parse tree + */ + void enterReturnStatement(JavaScriptParser.ReturnStatementContext ctx); + /** + * Exit a parse tree produced by {@link JavaScriptParser#returnStatement}. + * @param ctx the parse tree + */ + void exitReturnStatement(JavaScriptParser.ReturnStatementContext ctx); + /** + * Enter a parse tree produced by {@link JavaScriptParser#yieldStatement}. + * @param ctx the parse tree + */ + void enterYieldStatement(JavaScriptParser.YieldStatementContext ctx); + /** + * Exit a parse tree produced by {@link JavaScriptParser#yieldStatement}. + * @param ctx the parse tree + */ + void exitYieldStatement(JavaScriptParser.YieldStatementContext ctx); + /** + * Enter a parse tree produced by {@link JavaScriptParser#withStatement}. + * @param ctx the parse tree + */ + void enterWithStatement(JavaScriptParser.WithStatementContext ctx); + /** + * Exit a parse tree produced by {@link JavaScriptParser#withStatement}. + * @param ctx the parse tree + */ + void exitWithStatement(JavaScriptParser.WithStatementContext ctx); + /** + * Enter a parse tree produced by {@link JavaScriptParser#switchStatement}. + * @param ctx the parse tree + */ + void enterSwitchStatement(JavaScriptParser.SwitchStatementContext ctx); + /** + * Exit a parse tree produced by {@link JavaScriptParser#switchStatement}. + * @param ctx the parse tree + */ + void exitSwitchStatement(JavaScriptParser.SwitchStatementContext ctx); + /** + * Enter a parse tree produced by {@link JavaScriptParser#caseBlock}. + * @param ctx the parse tree + */ + void enterCaseBlock(JavaScriptParser.CaseBlockContext ctx); + /** + * Exit a parse tree produced by {@link JavaScriptParser#caseBlock}. + * @param ctx the parse tree + */ + void exitCaseBlock(JavaScriptParser.CaseBlockContext ctx); + /** + * Enter a parse tree produced by {@link JavaScriptParser#caseClauses}. + * @param ctx the parse tree + */ + void enterCaseClauses(JavaScriptParser.CaseClausesContext ctx); + /** + * Exit a parse tree produced by {@link JavaScriptParser#caseClauses}. + * @param ctx the parse tree + */ + void exitCaseClauses(JavaScriptParser.CaseClausesContext ctx); + /** + * Enter a parse tree produced by {@link JavaScriptParser#caseClause}. + * @param ctx the parse tree + */ + void enterCaseClause(JavaScriptParser.CaseClauseContext ctx); + /** + * Exit a parse tree produced by {@link JavaScriptParser#caseClause}. + * @param ctx the parse tree + */ + void exitCaseClause(JavaScriptParser.CaseClauseContext ctx); + /** + * Enter a parse tree produced by {@link JavaScriptParser#defaultClause}. + * @param ctx the parse tree + */ + void enterDefaultClause(JavaScriptParser.DefaultClauseContext ctx); + /** + * Exit a parse tree produced by {@link JavaScriptParser#defaultClause}. + * @param ctx the parse tree + */ + void exitDefaultClause(JavaScriptParser.DefaultClauseContext ctx); + /** + * Enter a parse tree produced by {@link JavaScriptParser#labelledStatement}. + * @param ctx the parse tree + */ + void enterLabelledStatement(JavaScriptParser.LabelledStatementContext ctx); + /** + * Exit a parse tree produced by {@link JavaScriptParser#labelledStatement}. + * @param ctx the parse tree + */ + void exitLabelledStatement(JavaScriptParser.LabelledStatementContext ctx); + /** + * Enter a parse tree produced by {@link JavaScriptParser#throwStatement}. + * @param ctx the parse tree + */ + void enterThrowStatement(JavaScriptParser.ThrowStatementContext ctx); + /** + * Exit a parse tree produced by {@link JavaScriptParser#throwStatement}. + * @param ctx the parse tree + */ + void exitThrowStatement(JavaScriptParser.ThrowStatementContext ctx); + /** + * Enter a parse tree produced by {@link JavaScriptParser#tryStatement}. + * @param ctx the parse tree + */ + void enterTryStatement(JavaScriptParser.TryStatementContext ctx); + /** + * Exit a parse tree produced by {@link JavaScriptParser#tryStatement}. + * @param ctx the parse tree + */ + void exitTryStatement(JavaScriptParser.TryStatementContext ctx); + /** + * Enter a parse tree produced by {@link JavaScriptParser#catchProduction}. + * @param ctx the parse tree + */ + void enterCatchProduction(JavaScriptParser.CatchProductionContext ctx); + /** + * Exit a parse tree produced by {@link JavaScriptParser#catchProduction}. + * @param ctx the parse tree + */ + void exitCatchProduction(JavaScriptParser.CatchProductionContext ctx); + /** + * Enter a parse tree produced by {@link JavaScriptParser#finallyProduction}. + * @param ctx the parse tree + */ + void enterFinallyProduction(JavaScriptParser.FinallyProductionContext ctx); + /** + * Exit a parse tree produced by {@link JavaScriptParser#finallyProduction}. + * @param ctx the parse tree + */ + void exitFinallyProduction(JavaScriptParser.FinallyProductionContext ctx); + /** + * Enter a parse tree produced by {@link JavaScriptParser#debuggerStatement}. + * @param ctx the parse tree + */ + void enterDebuggerStatement(JavaScriptParser.DebuggerStatementContext ctx); + /** + * Exit a parse tree produced by {@link JavaScriptParser#debuggerStatement}. + * @param ctx the parse tree + */ + void exitDebuggerStatement(JavaScriptParser.DebuggerStatementContext ctx); + /** + * Enter a parse tree produced by {@link JavaScriptParser#functionDeclaration}. + * @param ctx the parse tree + */ + void enterFunctionDeclaration(JavaScriptParser.FunctionDeclarationContext ctx); + /** + * Exit a parse tree produced by {@link JavaScriptParser#functionDeclaration}. + * @param ctx the parse tree + */ + void exitFunctionDeclaration(JavaScriptParser.FunctionDeclarationContext ctx); + /** + * Enter a parse tree produced by {@link JavaScriptParser#classDeclaration}. + * @param ctx the parse tree + */ + void enterClassDeclaration(JavaScriptParser.ClassDeclarationContext ctx); + /** + * Exit a parse tree produced by {@link JavaScriptParser#classDeclaration}. + * @param ctx the parse tree + */ + void exitClassDeclaration(JavaScriptParser.ClassDeclarationContext ctx); + /** + * Enter a parse tree produced by {@link JavaScriptParser#classTail}. + * @param ctx the parse tree + */ + void enterClassTail(JavaScriptParser.ClassTailContext ctx); + /** + * Exit a parse tree produced by {@link JavaScriptParser#classTail}. + * @param ctx the parse tree + */ + void exitClassTail(JavaScriptParser.ClassTailContext ctx); + /** + * Enter a parse tree produced by {@link JavaScriptParser#classElement}. + * @param ctx the parse tree + */ + void enterClassElement(JavaScriptParser.ClassElementContext ctx); + /** + * Exit a parse tree produced by {@link JavaScriptParser#classElement}. + * @param ctx the parse tree + */ + void exitClassElement(JavaScriptParser.ClassElementContext ctx); + /** + * Enter a parse tree produced by {@link JavaScriptParser#methodDefinition}. + * @param ctx the parse tree + */ + void enterMethodDefinition(JavaScriptParser.MethodDefinitionContext ctx); + /** + * Exit a parse tree produced by {@link JavaScriptParser#methodDefinition}. + * @param ctx the parse tree + */ + void exitMethodDefinition(JavaScriptParser.MethodDefinitionContext ctx); + /** + * Enter a parse tree produced by {@link JavaScriptParser#formalParameterList}. + * @param ctx the parse tree + */ + void enterFormalParameterList(JavaScriptParser.FormalParameterListContext ctx); + /** + * Exit a parse tree produced by {@link JavaScriptParser#formalParameterList}. + * @param ctx the parse tree + */ + void exitFormalParameterList(JavaScriptParser.FormalParameterListContext ctx); + /** + * Enter a parse tree produced by {@link JavaScriptParser#formalParameterArg}. + * @param ctx the parse tree + */ + void enterFormalParameterArg(JavaScriptParser.FormalParameterArgContext ctx); + /** + * Exit a parse tree produced by {@link JavaScriptParser#formalParameterArg}. + * @param ctx the parse tree + */ + void exitFormalParameterArg(JavaScriptParser.FormalParameterArgContext ctx); + /** + * Enter a parse tree produced by {@link JavaScriptParser#lastFormalParameterArg}. + * @param ctx the parse tree + */ + void enterLastFormalParameterArg(JavaScriptParser.LastFormalParameterArgContext ctx); + /** + * Exit a parse tree produced by {@link JavaScriptParser#lastFormalParameterArg}. + * @param ctx the parse tree + */ + void exitLastFormalParameterArg(JavaScriptParser.LastFormalParameterArgContext ctx); + /** + * Enter a parse tree produced by {@link JavaScriptParser#functionBody}. + * @param ctx the parse tree + */ + void enterFunctionBody(JavaScriptParser.FunctionBodyContext ctx); + /** + * Exit a parse tree produced by {@link JavaScriptParser#functionBody}. + * @param ctx the parse tree + */ + void exitFunctionBody(JavaScriptParser.FunctionBodyContext ctx); + /** + * Enter a parse tree produced by {@link JavaScriptParser#sourceElements}. + * @param ctx the parse tree + */ + void enterSourceElements(JavaScriptParser.SourceElementsContext ctx); + /** + * Exit a parse tree produced by {@link JavaScriptParser#sourceElements}. + * @param ctx the parse tree + */ + void exitSourceElements(JavaScriptParser.SourceElementsContext ctx); + /** + * Enter a parse tree produced by {@link JavaScriptParser#arrayLiteral}. + * @param ctx the parse tree + */ + void enterArrayLiteral(JavaScriptParser.ArrayLiteralContext ctx); + /** + * Exit a parse tree produced by {@link JavaScriptParser#arrayLiteral}. + * @param ctx the parse tree + */ + void exitArrayLiteral(JavaScriptParser.ArrayLiteralContext ctx); + /** + * Enter a parse tree produced by {@link JavaScriptParser#elementList}. + * @param ctx the parse tree + */ + void enterElementList(JavaScriptParser.ElementListContext ctx); + /** + * Exit a parse tree produced by {@link JavaScriptParser#elementList}. + * @param ctx the parse tree + */ + void exitElementList(JavaScriptParser.ElementListContext ctx); + /** + * Enter a parse tree produced by {@link JavaScriptParser#arrayElement}. + * @param ctx the parse tree + */ + void enterArrayElement(JavaScriptParser.ArrayElementContext ctx); + /** + * Exit a parse tree produced by {@link JavaScriptParser#arrayElement}. + * @param ctx the parse tree + */ + void exitArrayElement(JavaScriptParser.ArrayElementContext ctx); + /** + * Enter a parse tree produced by the {@code PropertyExpressionAssignment} + * labeled alternative in {@link JavaScriptParser#propertyAssignment}. + * @param ctx the parse tree + */ + void enterPropertyExpressionAssignment(JavaScriptParser.PropertyExpressionAssignmentContext ctx); + /** + * Exit a parse tree produced by the {@code PropertyExpressionAssignment} + * labeled alternative in {@link JavaScriptParser#propertyAssignment}. + * @param ctx the parse tree + */ + void exitPropertyExpressionAssignment(JavaScriptParser.PropertyExpressionAssignmentContext ctx); + /** + * Enter a parse tree produced by the {@code ComputedPropertyExpressionAssignment} + * labeled alternative in {@link JavaScriptParser#propertyAssignment}. + * @param ctx the parse tree + */ + void enterComputedPropertyExpressionAssignment(JavaScriptParser.ComputedPropertyExpressionAssignmentContext ctx); + /** + * Exit a parse tree produced by the {@code ComputedPropertyExpressionAssignment} + * labeled alternative in {@link JavaScriptParser#propertyAssignment}. + * @param ctx the parse tree + */ + void exitComputedPropertyExpressionAssignment(JavaScriptParser.ComputedPropertyExpressionAssignmentContext ctx); + /** + * Enter a parse tree produced by the {@code FunctionProperty} + * labeled alternative in {@link JavaScriptParser#propertyAssignment}. + * @param ctx the parse tree + */ + void enterFunctionProperty(JavaScriptParser.FunctionPropertyContext ctx); + /** + * Exit a parse tree produced by the {@code FunctionProperty} + * labeled alternative in {@link JavaScriptParser#propertyAssignment}. + * @param ctx the parse tree + */ + void exitFunctionProperty(JavaScriptParser.FunctionPropertyContext ctx); + /** + * Enter a parse tree produced by the {@code PropertyGetter} + * labeled alternative in {@link JavaScriptParser#propertyAssignment}. + * @param ctx the parse tree + */ + void enterPropertyGetter(JavaScriptParser.PropertyGetterContext ctx); + /** + * Exit a parse tree produced by the {@code PropertyGetter} + * labeled alternative in {@link JavaScriptParser#propertyAssignment}. + * @param ctx the parse tree + */ + void exitPropertyGetter(JavaScriptParser.PropertyGetterContext ctx); + /** + * Enter a parse tree produced by the {@code PropertySetter} + * labeled alternative in {@link JavaScriptParser#propertyAssignment}. + * @param ctx the parse tree + */ + void enterPropertySetter(JavaScriptParser.PropertySetterContext ctx); + /** + * Exit a parse tree produced by the {@code PropertySetter} + * labeled alternative in {@link JavaScriptParser#propertyAssignment}. + * @param ctx the parse tree + */ + void exitPropertySetter(JavaScriptParser.PropertySetterContext ctx); + /** + * Enter a parse tree produced by the {@code PropertyShorthand} + * labeled alternative in {@link JavaScriptParser#propertyAssignment}. + * @param ctx the parse tree + */ + void enterPropertyShorthand(JavaScriptParser.PropertyShorthandContext ctx); + /** + * Exit a parse tree produced by the {@code PropertyShorthand} + * labeled alternative in {@link JavaScriptParser#propertyAssignment}. + * @param ctx the parse tree + */ + void exitPropertyShorthand(JavaScriptParser.PropertyShorthandContext ctx); + /** + * Enter a parse tree produced by {@link JavaScriptParser#propertyName}. + * @param ctx the parse tree + */ + void enterPropertyName(JavaScriptParser.PropertyNameContext ctx); + /** + * Exit a parse tree produced by {@link JavaScriptParser#propertyName}. + * @param ctx the parse tree + */ + void exitPropertyName(JavaScriptParser.PropertyNameContext ctx); + /** + * Enter a parse tree produced by {@link JavaScriptParser#arguments}. + * @param ctx the parse tree + */ + void enterArguments(JavaScriptParser.ArgumentsContext ctx); + /** + * Exit a parse tree produced by {@link JavaScriptParser#arguments}. + * @param ctx the parse tree + */ + void exitArguments(JavaScriptParser.ArgumentsContext ctx); + /** + * Enter a parse tree produced by {@link JavaScriptParser#argument}. + * @param ctx the parse tree + */ + void enterArgument(JavaScriptParser.ArgumentContext ctx); + /** + * Exit a parse tree produced by {@link JavaScriptParser#argument}. + * @param ctx the parse tree + */ + void exitArgument(JavaScriptParser.ArgumentContext ctx); + /** + * Enter a parse tree produced by {@link JavaScriptParser#expressionSequence}. + * @param ctx the parse tree + */ + void enterExpressionSequence(JavaScriptParser.ExpressionSequenceContext ctx); + /** + * Exit a parse tree produced by {@link JavaScriptParser#expressionSequence}. + * @param ctx the parse tree + */ + void exitExpressionSequence(JavaScriptParser.ExpressionSequenceContext ctx); + /** + * Enter a parse tree produced by the {@code TemplateStringExpression} + * labeled alternative in . + * @param ctx the parse tree + */ + void enterTemplateStringExpression(JavaScriptParser.TemplateStringExpressionContext ctx); + /** + * Exit a parse tree produced by the {@code TemplateStringExpression} + * labeled alternative in . + * @param ctx the parse tree + */ + void exitTemplateStringExpression(JavaScriptParser.TemplateStringExpressionContext ctx); + /** + * Enter a parse tree produced by the {@code TernaryExpression} + * labeled alternative in . + * @param ctx the parse tree + */ + void enterTernaryExpression(JavaScriptParser.TernaryExpressionContext ctx); + /** + * Exit a parse tree produced by the {@code TernaryExpression} + * labeled alternative in . + * @param ctx the parse tree + */ + void exitTernaryExpression(JavaScriptParser.TernaryExpressionContext ctx); + /** + * Enter a parse tree produced by the {@code LogicalAndExpression} + * labeled alternative in . + * @param ctx the parse tree + */ + void enterLogicalAndExpression(JavaScriptParser.LogicalAndExpressionContext ctx); + /** + * Exit a parse tree produced by the {@code LogicalAndExpression} + * labeled alternative in . + * @param ctx the parse tree + */ + void exitLogicalAndExpression(JavaScriptParser.LogicalAndExpressionContext ctx); + /** + * Enter a parse tree produced by the {@code PowerExpression} + * labeled alternative in . + * @param ctx the parse tree + */ + void enterPowerExpression(JavaScriptParser.PowerExpressionContext ctx); + /** + * Exit a parse tree produced by the {@code PowerExpression} + * labeled alternative in . + * @param ctx the parse tree + */ + void exitPowerExpression(JavaScriptParser.PowerExpressionContext ctx); + /** + * Enter a parse tree produced by the {@code PreIncrementExpression} + * labeled alternative in . + * @param ctx the parse tree + */ + void enterPreIncrementExpression(JavaScriptParser.PreIncrementExpressionContext ctx); + /** + * Exit a parse tree produced by the {@code PreIncrementExpression} + * labeled alternative in . + * @param ctx the parse tree + */ + void exitPreIncrementExpression(JavaScriptParser.PreIncrementExpressionContext ctx); + /** + * Enter a parse tree produced by the {@code ObjectLiteralExpression} + * labeled alternative in . + * @param ctx the parse tree + */ + void enterObjectLiteralExpression(JavaScriptParser.ObjectLiteralExpressionContext ctx); + /** + * Exit a parse tree produced by the {@code ObjectLiteralExpression} + * labeled alternative in . + * @param ctx the parse tree + */ + void exitObjectLiteralExpression(JavaScriptParser.ObjectLiteralExpressionContext ctx); + /** + * Enter a parse tree produced by the {@code MetaExpression} + * labeled alternative in . + * @param ctx the parse tree + */ + void enterMetaExpression(JavaScriptParser.MetaExpressionContext ctx); + /** + * Exit a parse tree produced by the {@code MetaExpression} + * labeled alternative in . + * @param ctx the parse tree + */ + void exitMetaExpression(JavaScriptParser.MetaExpressionContext ctx); + /** + * Enter a parse tree produced by the {@code InExpression} + * labeled alternative in . + * @param ctx the parse tree + */ + void enterInExpression(JavaScriptParser.InExpressionContext ctx); + /** + * Exit a parse tree produced by the {@code InExpression} + * labeled alternative in . + * @param ctx the parse tree + */ + void exitInExpression(JavaScriptParser.InExpressionContext ctx); + /** + * Enter a parse tree produced by the {@code LogicalOrExpression} + * labeled alternative in . + * @param ctx the parse tree + */ + void enterLogicalOrExpression(JavaScriptParser.LogicalOrExpressionContext ctx); + /** + * Exit a parse tree produced by the {@code LogicalOrExpression} + * labeled alternative in . + * @param ctx the parse tree + */ + void exitLogicalOrExpression(JavaScriptParser.LogicalOrExpressionContext ctx); + /** + * Enter a parse tree produced by the {@code NotExpression} + * labeled alternative in . + * @param ctx the parse tree + */ + void enterNotExpression(JavaScriptParser.NotExpressionContext ctx); + /** + * Exit a parse tree produced by the {@code NotExpression} + * labeled alternative in . + * @param ctx the parse tree + */ + void exitNotExpression(JavaScriptParser.NotExpressionContext ctx); + /** + * Enter a parse tree produced by the {@code PreDecreaseExpression} + * labeled alternative in . + * @param ctx the parse tree + */ + void enterPreDecreaseExpression(JavaScriptParser.PreDecreaseExpressionContext ctx); + /** + * Exit a parse tree produced by the {@code PreDecreaseExpression} + * labeled alternative in . + * @param ctx the parse tree + */ + void exitPreDecreaseExpression(JavaScriptParser.PreDecreaseExpressionContext ctx); + /** + * Enter a parse tree produced by the {@code ArgumentsExpression} + * labeled alternative in . + * @param ctx the parse tree + */ + void enterArgumentsExpression(JavaScriptParser.ArgumentsExpressionContext ctx); + /** + * Exit a parse tree produced by the {@code ArgumentsExpression} + * labeled alternative in . + * @param ctx the parse tree + */ + void exitArgumentsExpression(JavaScriptParser.ArgumentsExpressionContext ctx); + /** + * Enter a parse tree produced by the {@code AwaitExpression} + * labeled alternative in . + * @param ctx the parse tree + */ + void enterAwaitExpression(JavaScriptParser.AwaitExpressionContext ctx); + /** + * Exit a parse tree produced by the {@code AwaitExpression} + * labeled alternative in . + * @param ctx the parse tree + */ + void exitAwaitExpression(JavaScriptParser.AwaitExpressionContext ctx); + /** + * Enter a parse tree produced by the {@code ThisExpression} + * labeled alternative in . + * @param ctx the parse tree + */ + void enterThisExpression(JavaScriptParser.ThisExpressionContext ctx); + /** + * Exit a parse tree produced by the {@code ThisExpression} + * labeled alternative in . + * @param ctx the parse tree + */ + void exitThisExpression(JavaScriptParser.ThisExpressionContext ctx); + /** + * Enter a parse tree produced by the {@code FunctionExpression} + * labeled alternative in . + * @param ctx the parse tree + */ + void enterFunctionExpression(JavaScriptParser.FunctionExpressionContext ctx); + /** + * Exit a parse tree produced by the {@code FunctionExpression} + * labeled alternative in . + * @param ctx the parse tree + */ + void exitFunctionExpression(JavaScriptParser.FunctionExpressionContext ctx); + /** + * Enter a parse tree produced by the {@code UnaryMinusExpression} + * labeled alternative in . + * @param ctx the parse tree + */ + void enterUnaryMinusExpression(JavaScriptParser.UnaryMinusExpressionContext ctx); + /** + * Exit a parse tree produced by the {@code UnaryMinusExpression} + * labeled alternative in . + * @param ctx the parse tree + */ + void exitUnaryMinusExpression(JavaScriptParser.UnaryMinusExpressionContext ctx); + /** + * Enter a parse tree produced by the {@code AssignmentExpression} + * labeled alternative in . + * @param ctx the parse tree + */ + void enterAssignmentExpression(JavaScriptParser.AssignmentExpressionContext ctx); + /** + * Exit a parse tree produced by the {@code AssignmentExpression} + * labeled alternative in . + * @param ctx the parse tree + */ + void exitAssignmentExpression(JavaScriptParser.AssignmentExpressionContext ctx); + /** + * Enter a parse tree produced by the {@code PostDecreaseExpression} + * labeled alternative in . + * @param ctx the parse tree + */ + void enterPostDecreaseExpression(JavaScriptParser.PostDecreaseExpressionContext ctx); + /** + * Exit a parse tree produced by the {@code PostDecreaseExpression} + * labeled alternative in . + * @param ctx the parse tree + */ + void exitPostDecreaseExpression(JavaScriptParser.PostDecreaseExpressionContext ctx); + /** + * Enter a parse tree produced by the {@code TypeofExpression} + * labeled alternative in . + * @param ctx the parse tree + */ + void enterTypeofExpression(JavaScriptParser.TypeofExpressionContext ctx); + /** + * Exit a parse tree produced by the {@code TypeofExpression} + * labeled alternative in . + * @param ctx the parse tree + */ + void exitTypeofExpression(JavaScriptParser.TypeofExpressionContext ctx); + /** + * Enter a parse tree produced by the {@code InstanceofExpression} + * labeled alternative in . + * @param ctx the parse tree + */ + void enterInstanceofExpression(JavaScriptParser.InstanceofExpressionContext ctx); + /** + * Exit a parse tree produced by the {@code InstanceofExpression} + * labeled alternative in . + * @param ctx the parse tree + */ + void exitInstanceofExpression(JavaScriptParser.InstanceofExpressionContext ctx); + /** + * Enter a parse tree produced by the {@code UnaryPlusExpression} + * labeled alternative in . + * @param ctx the parse tree + */ + void enterUnaryPlusExpression(JavaScriptParser.UnaryPlusExpressionContext ctx); + /** + * Exit a parse tree produced by the {@code UnaryPlusExpression} + * labeled alternative in . + * @param ctx the parse tree + */ + void exitUnaryPlusExpression(JavaScriptParser.UnaryPlusExpressionContext ctx); + /** + * Enter a parse tree produced by the {@code DeleteExpression} + * labeled alternative in . + * @param ctx the parse tree + */ + void enterDeleteExpression(JavaScriptParser.DeleteExpressionContext ctx); + /** + * Exit a parse tree produced by the {@code DeleteExpression} + * labeled alternative in . + * @param ctx the parse tree + */ + void exitDeleteExpression(JavaScriptParser.DeleteExpressionContext ctx); + /** + * Enter a parse tree produced by the {@code ImportExpression} + * labeled alternative in . + * @param ctx the parse tree + */ + void enterImportExpression(JavaScriptParser.ImportExpressionContext ctx); + /** + * Exit a parse tree produced by the {@code ImportExpression} + * labeled alternative in . + * @param ctx the parse tree + */ + void exitImportExpression(JavaScriptParser.ImportExpressionContext ctx); + /** + * Enter a parse tree produced by the {@code EqualityExpression} + * labeled alternative in . + * @param ctx the parse tree + */ + void enterEqualityExpression(JavaScriptParser.EqualityExpressionContext ctx); + /** + * Exit a parse tree produced by the {@code EqualityExpression} + * labeled alternative in . + * @param ctx the parse tree + */ + void exitEqualityExpression(JavaScriptParser.EqualityExpressionContext ctx); + /** + * Enter a parse tree produced by the {@code BitXOrExpression} + * labeled alternative in . + * @param ctx the parse tree + */ + void enterBitXOrExpression(JavaScriptParser.BitXOrExpressionContext ctx); + /** + * Exit a parse tree produced by the {@code BitXOrExpression} + * labeled alternative in . + * @param ctx the parse tree + */ + void exitBitXOrExpression(JavaScriptParser.BitXOrExpressionContext ctx); + /** + * Enter a parse tree produced by the {@code SuperExpression} + * labeled alternative in . + * @param ctx the parse tree + */ + void enterSuperExpression(JavaScriptParser.SuperExpressionContext ctx); + /** + * Exit a parse tree produced by the {@code SuperExpression} + * labeled alternative in . + * @param ctx the parse tree + */ + void exitSuperExpression(JavaScriptParser.SuperExpressionContext ctx); + /** + * Enter a parse tree produced by the {@code MultiplicativeExpression} + * labeled alternative in . + * @param ctx the parse tree + */ + void enterMultiplicativeExpression(JavaScriptParser.MultiplicativeExpressionContext ctx); + /** + * Exit a parse tree produced by the {@code MultiplicativeExpression} + * labeled alternative in . + * @param ctx the parse tree + */ + void exitMultiplicativeExpression(JavaScriptParser.MultiplicativeExpressionContext ctx); + /** + * Enter a parse tree produced by the {@code BitShiftExpression} + * labeled alternative in . + * @param ctx the parse tree + */ + void enterBitShiftExpression(JavaScriptParser.BitShiftExpressionContext ctx); + /** + * Exit a parse tree produced by the {@code BitShiftExpression} + * labeled alternative in . + * @param ctx the parse tree + */ + void exitBitShiftExpression(JavaScriptParser.BitShiftExpressionContext ctx); + /** + * Enter a parse tree produced by the {@code ParenthesizedExpression} + * labeled alternative in . + * @param ctx the parse tree + */ + void enterParenthesizedExpression(JavaScriptParser.ParenthesizedExpressionContext ctx); + /** + * Exit a parse tree produced by the {@code ParenthesizedExpression} + * labeled alternative in . + * @param ctx the parse tree + */ + void exitParenthesizedExpression(JavaScriptParser.ParenthesizedExpressionContext ctx); + /** + * Enter a parse tree produced by the {@code AdditiveExpression} + * labeled alternative in . + * @param ctx the parse tree + */ + void enterAdditiveExpression(JavaScriptParser.AdditiveExpressionContext ctx); + /** + * Exit a parse tree produced by the {@code AdditiveExpression} + * labeled alternative in . + * @param ctx the parse tree + */ + void exitAdditiveExpression(JavaScriptParser.AdditiveExpressionContext ctx); + /** + * Enter a parse tree produced by the {@code RelationalExpression} + * labeled alternative in . + * @param ctx the parse tree + */ + void enterRelationalExpression(JavaScriptParser.RelationalExpressionContext ctx); + /** + * Exit a parse tree produced by the {@code RelationalExpression} + * labeled alternative in . + * @param ctx the parse tree + */ + void exitRelationalExpression(JavaScriptParser.RelationalExpressionContext ctx); + /** + * Enter a parse tree produced by the {@code PostIncrementExpression} + * labeled alternative in . + * @param ctx the parse tree + */ + void enterPostIncrementExpression(JavaScriptParser.PostIncrementExpressionContext ctx); + /** + * Exit a parse tree produced by the {@code PostIncrementExpression} + * labeled alternative in . + * @param ctx the parse tree + */ + void exitPostIncrementExpression(JavaScriptParser.PostIncrementExpressionContext ctx); + /** + * Enter a parse tree produced by the {@code YieldExpression} + * labeled alternative in . + * @param ctx the parse tree + */ + void enterYieldExpression(JavaScriptParser.YieldExpressionContext ctx); + /** + * Exit a parse tree produced by the {@code YieldExpression} + * labeled alternative in . + * @param ctx the parse tree + */ + void exitYieldExpression(JavaScriptParser.YieldExpressionContext ctx); + /** + * Enter a parse tree produced by the {@code BitNotExpression} + * labeled alternative in . + * @param ctx the parse tree + */ + void enterBitNotExpression(JavaScriptParser.BitNotExpressionContext ctx); + /** + * Exit a parse tree produced by the {@code BitNotExpression} + * labeled alternative in . + * @param ctx the parse tree + */ + void exitBitNotExpression(JavaScriptParser.BitNotExpressionContext ctx); + /** + * Enter a parse tree produced by the {@code NewExpression} + * labeled alternative in . + * @param ctx the parse tree + */ + void enterNewExpression(JavaScriptParser.NewExpressionContext ctx); + /** + * Exit a parse tree produced by the {@code NewExpression} + * labeled alternative in . + * @param ctx the parse tree + */ + void exitNewExpression(JavaScriptParser.NewExpressionContext ctx); + /** + * Enter a parse tree produced by the {@code LiteralExpression} + * labeled alternative in . + * @param ctx the parse tree + */ + void enterLiteralExpression(JavaScriptParser.LiteralExpressionContext ctx); + /** + * Exit a parse tree produced by the {@code LiteralExpression} + * labeled alternative in . + * @param ctx the parse tree + */ + void exitLiteralExpression(JavaScriptParser.LiteralExpressionContext ctx); + /** + * Enter a parse tree produced by the {@code ArrayLiteralExpression} + * labeled alternative in . + * @param ctx the parse tree + */ + void enterArrayLiteralExpression(JavaScriptParser.ArrayLiteralExpressionContext ctx); + /** + * Exit a parse tree produced by the {@code ArrayLiteralExpression} + * labeled alternative in . + * @param ctx the parse tree + */ + void exitArrayLiteralExpression(JavaScriptParser.ArrayLiteralExpressionContext ctx); + /** + * Enter a parse tree produced by the {@code MemberDotExpression} + * labeled alternative in . + * @param ctx the parse tree + */ + void enterMemberDotExpression(JavaScriptParser.MemberDotExpressionContext ctx); + /** + * Exit a parse tree produced by the {@code MemberDotExpression} + * labeled alternative in . + * @param ctx the parse tree + */ + void exitMemberDotExpression(JavaScriptParser.MemberDotExpressionContext ctx); + /** + * Enter a parse tree produced by the {@code ClassExpression} + * labeled alternative in . + * @param ctx the parse tree + */ + void enterClassExpression(JavaScriptParser.ClassExpressionContext ctx); + /** + * Exit a parse tree produced by the {@code ClassExpression} + * labeled alternative in . + * @param ctx the parse tree + */ + void exitClassExpression(JavaScriptParser.ClassExpressionContext ctx); + /** + * Enter a parse tree produced by the {@code MemberIndexExpression} + * labeled alternative in . + * @param ctx the parse tree + */ + void enterMemberIndexExpression(JavaScriptParser.MemberIndexExpressionContext ctx); + /** + * Exit a parse tree produced by the {@code MemberIndexExpression} + * labeled alternative in . + * @param ctx the parse tree + */ + void exitMemberIndexExpression(JavaScriptParser.MemberIndexExpressionContext ctx); + /** + * Enter a parse tree produced by the {@code IdentifierExpression} + * labeled alternative in . + * @param ctx the parse tree + */ + void enterIdentifierExpression(JavaScriptParser.IdentifierExpressionContext ctx); + /** + * Exit a parse tree produced by the {@code IdentifierExpression} + * labeled alternative in . + * @param ctx the parse tree + */ + void exitIdentifierExpression(JavaScriptParser.IdentifierExpressionContext ctx); + /** + * Enter a parse tree produced by the {@code BitAndExpression} + * labeled alternative in . + * @param ctx the parse tree + */ + void enterBitAndExpression(JavaScriptParser.BitAndExpressionContext ctx); + /** + * Exit a parse tree produced by the {@code BitAndExpression} + * labeled alternative in . + * @param ctx the parse tree + */ + void exitBitAndExpression(JavaScriptParser.BitAndExpressionContext ctx); + /** + * Enter a parse tree produced by the {@code BitOrExpression} + * labeled alternative in . + * @param ctx the parse tree + */ + void enterBitOrExpression(JavaScriptParser.BitOrExpressionContext ctx); + /** + * Exit a parse tree produced by the {@code BitOrExpression} + * labeled alternative in . + * @param ctx the parse tree + */ + void exitBitOrExpression(JavaScriptParser.BitOrExpressionContext ctx); + /** + * Enter a parse tree produced by the {@code AssignmentOperatorExpression} + * labeled alternative in . + * @param ctx the parse tree + */ + void enterAssignmentOperatorExpression(JavaScriptParser.AssignmentOperatorExpressionContext ctx); + /** + * Exit a parse tree produced by the {@code AssignmentOperatorExpression} + * labeled alternative in . + * @param ctx the parse tree + */ + void exitAssignmentOperatorExpression(JavaScriptParser.AssignmentOperatorExpressionContext ctx); + /** + * Enter a parse tree produced by the {@code VoidExpression} + * labeled alternative in . + * @param ctx the parse tree + */ + void enterVoidExpression(JavaScriptParser.VoidExpressionContext ctx); + /** + * Exit a parse tree produced by the {@code VoidExpression} + * labeled alternative in . + * @param ctx the parse tree + */ + void exitVoidExpression(JavaScriptParser.VoidExpressionContext ctx); + /** + * Enter a parse tree produced by the {@code CoalesceExpression} + * labeled alternative in . + * @param ctx the parse tree + */ + void enterCoalesceExpression(JavaScriptParser.CoalesceExpressionContext ctx); + /** + * Exit a parse tree produced by the {@code CoalesceExpression} + * labeled alternative in . + * @param ctx the parse tree + */ + void exitCoalesceExpression(JavaScriptParser.CoalesceExpressionContext ctx); + /** + * Enter a parse tree produced by {@link JavaScriptParser#assignable}. + * @param ctx the parse tree + */ + void enterAssignable(JavaScriptParser.AssignableContext ctx); + /** + * Exit a parse tree produced by {@link JavaScriptParser#assignable}. + * @param ctx the parse tree + */ + void exitAssignable(JavaScriptParser.AssignableContext ctx); + /** + * Enter a parse tree produced by {@link JavaScriptParser#objectLiteral}. + * @param ctx the parse tree + */ + void enterObjectLiteral(JavaScriptParser.ObjectLiteralContext ctx); + /** + * Exit a parse tree produced by {@link JavaScriptParser#objectLiteral}. + * @param ctx the parse tree + */ + void exitObjectLiteral(JavaScriptParser.ObjectLiteralContext ctx); + /** + * Enter a parse tree produced by the {@code FunctionDecl} + * labeled alternative in {@link JavaScriptParser#anoymousFunction}. + * @param ctx the parse tree + */ + void enterFunctionDecl(JavaScriptParser.FunctionDeclContext ctx); + /** + * Exit a parse tree produced by the {@code FunctionDecl} + * labeled alternative in {@link JavaScriptParser#anoymousFunction}. + * @param ctx the parse tree + */ + void exitFunctionDecl(JavaScriptParser.FunctionDeclContext ctx); + /** + * Enter a parse tree produced by the {@code AnoymousFunctionDecl} + * labeled alternative in {@link JavaScriptParser#anoymousFunction}. + * @param ctx the parse tree + */ + void enterAnoymousFunctionDecl(JavaScriptParser.AnoymousFunctionDeclContext ctx); + /** + * Exit a parse tree produced by the {@code AnoymousFunctionDecl} + * labeled alternative in {@link JavaScriptParser#anoymousFunction}. + * @param ctx the parse tree + */ + void exitAnoymousFunctionDecl(JavaScriptParser.AnoymousFunctionDeclContext ctx); + /** + * Enter a parse tree produced by the {@code ArrowFunction} + * labeled alternative in {@link JavaScriptParser#anoymousFunction}. + * @param ctx the parse tree + */ + void enterArrowFunction(JavaScriptParser.ArrowFunctionContext ctx); + /** + * Exit a parse tree produced by the {@code ArrowFunction} + * labeled alternative in {@link JavaScriptParser#anoymousFunction}. + * @param ctx the parse tree + */ + void exitArrowFunction(JavaScriptParser.ArrowFunctionContext ctx); + /** + * Enter a parse tree produced by {@link JavaScriptParser#arrowFunctionParameters}. + * @param ctx the parse tree + */ + void enterArrowFunctionParameters(JavaScriptParser.ArrowFunctionParametersContext ctx); + /** + * Exit a parse tree produced by {@link JavaScriptParser#arrowFunctionParameters}. + * @param ctx the parse tree + */ + void exitArrowFunctionParameters(JavaScriptParser.ArrowFunctionParametersContext ctx); + /** + * Enter a parse tree produced by {@link JavaScriptParser#arrowFunctionBody}. + * @param ctx the parse tree + */ + void enterArrowFunctionBody(JavaScriptParser.ArrowFunctionBodyContext ctx); + /** + * Exit a parse tree produced by {@link JavaScriptParser#arrowFunctionBody}. + * @param ctx the parse tree + */ + void exitArrowFunctionBody(JavaScriptParser.ArrowFunctionBodyContext ctx); + /** + * Enter a parse tree produced by {@link JavaScriptParser#assignmentOperator}. + * @param ctx the parse tree + */ + void enterAssignmentOperator(JavaScriptParser.AssignmentOperatorContext ctx); + /** + * Exit a parse tree produced by {@link JavaScriptParser#assignmentOperator}. + * @param ctx the parse tree + */ + void exitAssignmentOperator(JavaScriptParser.AssignmentOperatorContext ctx); + /** + * Enter a parse tree produced by {@link JavaScriptParser#literal}. + * @param ctx the parse tree + */ + void enterLiteral(JavaScriptParser.LiteralContext ctx); + /** + * Exit a parse tree produced by {@link JavaScriptParser#literal}. + * @param ctx the parse tree + */ + void exitLiteral(JavaScriptParser.LiteralContext ctx); + /** + * Enter a parse tree produced by {@link JavaScriptParser#numericLiteral}. + * @param ctx the parse tree + */ + void enterNumericLiteral(JavaScriptParser.NumericLiteralContext ctx); + /** + * Exit a parse tree produced by {@link JavaScriptParser#numericLiteral}. + * @param ctx the parse tree + */ + void exitNumericLiteral(JavaScriptParser.NumericLiteralContext ctx); + /** + * Enter a parse tree produced by {@link JavaScriptParser#bigintLiteral}. + * @param ctx the parse tree + */ + void enterBigintLiteral(JavaScriptParser.BigintLiteralContext ctx); + /** + * Exit a parse tree produced by {@link JavaScriptParser#bigintLiteral}. + * @param ctx the parse tree + */ + void exitBigintLiteral(JavaScriptParser.BigintLiteralContext ctx); + /** + * Enter a parse tree produced by {@link JavaScriptParser#getter}. + * @param ctx the parse tree + */ + void enterGetter(JavaScriptParser.GetterContext ctx); + /** + * Exit a parse tree produced by {@link JavaScriptParser#getter}. + * @param ctx the parse tree + */ + void exitGetter(JavaScriptParser.GetterContext ctx); + /** + * Enter a parse tree produced by {@link JavaScriptParser#setter}. + * @param ctx the parse tree + */ + void enterSetter(JavaScriptParser.SetterContext ctx); + /** + * Exit a parse tree produced by {@link JavaScriptParser#setter}. + * @param ctx the parse tree + */ + void exitSetter(JavaScriptParser.SetterContext ctx); + /** + * Enter a parse tree produced by {@link JavaScriptParser#identifierName}. + * @param ctx the parse tree + */ + void enterIdentifierName(JavaScriptParser.IdentifierNameContext ctx); + /** + * Exit a parse tree produced by {@link JavaScriptParser#identifierName}. + * @param ctx the parse tree + */ + void exitIdentifierName(JavaScriptParser.IdentifierNameContext ctx); + /** + * Enter a parse tree produced by {@link JavaScriptParser#identifier}. + * @param ctx the parse tree + */ + void enterIdentifier(JavaScriptParser.IdentifierContext ctx); + /** + * Exit a parse tree produced by {@link JavaScriptParser#identifier}. + * @param ctx the parse tree + */ + void exitIdentifier(JavaScriptParser.IdentifierContext ctx); + /** + * Enter a parse tree produced by {@link JavaScriptParser#reservedWord}. + * @param ctx the parse tree + */ + void enterReservedWord(JavaScriptParser.ReservedWordContext ctx); + /** + * Exit a parse tree produced by {@link JavaScriptParser#reservedWord}. + * @param ctx the parse tree + */ + void exitReservedWord(JavaScriptParser.ReservedWordContext ctx); + /** + * Enter a parse tree produced by {@link JavaScriptParser#keyword}. + * @param ctx the parse tree + */ + void enterKeyword(JavaScriptParser.KeywordContext ctx); + /** + * Exit a parse tree produced by {@link JavaScriptParser#keyword}. + * @param ctx the parse tree + */ + void exitKeyword(JavaScriptParser.KeywordContext ctx); + /** + * Enter a parse tree produced by {@link JavaScriptParser#let}. + * @param ctx the parse tree + */ + void enterLet(JavaScriptParser.LetContext ctx); + /** + * Exit a parse tree produced by {@link JavaScriptParser#let}. + * @param ctx the parse tree + */ + void exitLet(JavaScriptParser.LetContext ctx); + /** + * Enter a parse tree produced by {@link JavaScriptParser#eos}. + * @param ctx the parse tree + */ + void enterEos(JavaScriptParser.EosContext ctx); + /** + * Exit a parse tree produced by {@link JavaScriptParser#eos}. + * @param ctx the parse tree + */ + void exitEos(JavaScriptParser.EosContext ctx); +} \ No newline at end of file diff --git a/src/main/java/antlr/autogenerated/JavaScriptParserVisitor.java b/src/main/java/antlr/autogenerated/JavaScriptParserVisitor.java new file mode 100644 index 0000000..921bb2f --- /dev/null +++ b/src/main/java/antlr/autogenerated/JavaScriptParserVisitor.java @@ -0,0 +1,869 @@ +package antlr.autogenerated; + +// Generated from JavaScriptParserUsedForParserCreation by ANTLR 4.5 + +import org.antlr.v4.runtime.tree.ParseTreeVisitor; + +/** + * This interface defines a complete generic visitor for a parse tree produced + * by {@link JavaScriptParser}. + * + * @param The return type of the visit operation. Use {@link Void} for + * operations with no return type. + */ +public interface JavaScriptParserVisitor extends ParseTreeVisitor { + /** + * Visit a parse tree produced by {@link JavaScriptParser#program}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitProgram(JavaScriptParser.ProgramContext ctx); + /** + * Visit a parse tree produced by {@link JavaScriptParser#sourceElement}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitSourceElement(JavaScriptParser.SourceElementContext ctx); + /** + * Visit a parse tree produced by {@link JavaScriptParser#statement}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitStatement(JavaScriptParser.StatementContext ctx); + /** + * Visit a parse tree produced by {@link JavaScriptParser#block}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitBlock(JavaScriptParser.BlockContext ctx); + /** + * Visit a parse tree produced by {@link JavaScriptParser#statementList}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitStatementList(JavaScriptParser.StatementListContext ctx); + /** + * Visit a parse tree produced by {@link JavaScriptParser#importStatement}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitImportStatement(JavaScriptParser.ImportStatementContext ctx); + /** + * Visit a parse tree produced by {@link JavaScriptParser#importFromBlock}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitImportFromBlock(JavaScriptParser.ImportFromBlockContext ctx); + /** + * Visit a parse tree produced by {@link JavaScriptParser#moduleItems}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitModuleItems(JavaScriptParser.ModuleItemsContext ctx); + /** + * Visit a parse tree produced by {@link JavaScriptParser#importDefault}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitImportDefault(JavaScriptParser.ImportDefaultContext ctx); + /** + * Visit a parse tree produced by {@link JavaScriptParser#importNamespace}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitImportNamespace(JavaScriptParser.ImportNamespaceContext ctx); + /** + * Visit a parse tree produced by {@link JavaScriptParser#importFrom}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitImportFrom(JavaScriptParser.ImportFromContext ctx); + /** + * Visit a parse tree produced by {@link JavaScriptParser#aliasName}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitAliasName(JavaScriptParser.AliasNameContext ctx); + /** + * Visit a parse tree produced by the {@code ExportDeclaration} + * labeled alternative in {@link JavaScriptParser#exportStatement}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitExportDeclaration(JavaScriptParser.ExportDeclarationContext ctx); + /** + * Visit a parse tree produced by the {@code ExportDefaultDeclaration} + * labeled alternative in {@link JavaScriptParser#exportStatement}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitExportDefaultDeclaration(JavaScriptParser.ExportDefaultDeclarationContext ctx); + /** + * Visit a parse tree produced by {@link JavaScriptParser#exportFromBlock}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitExportFromBlock(JavaScriptParser.ExportFromBlockContext ctx); + /** + * Visit a parse tree produced by {@link JavaScriptParser#declaration}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitDeclaration(JavaScriptParser.DeclarationContext ctx); + /** + * Visit a parse tree produced by {@link JavaScriptParser#variableStatement}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitVariableStatement(JavaScriptParser.VariableStatementContext ctx); + /** + * Visit a parse tree produced by {@link JavaScriptParser#variableDeclarationList}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitVariableDeclarationList(JavaScriptParser.VariableDeclarationListContext ctx); + /** + * Visit a parse tree produced by {@link JavaScriptParser#variableDeclaration}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitVariableDeclaration(JavaScriptParser.VariableDeclarationContext ctx); + /** + * Visit a parse tree produced by {@link JavaScriptParser#emptyStatement}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitEmptyStatement(JavaScriptParser.EmptyStatementContext ctx); + /** + * Visit a parse tree produced by {@link JavaScriptParser#expressionStatement}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitExpressionStatement(JavaScriptParser.ExpressionStatementContext ctx); + /** + * Visit a parse tree produced by {@link JavaScriptParser#ifStatement}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitIfStatement(JavaScriptParser.IfStatementContext ctx); + /** + * Visit a parse tree produced by the {@code DoStatement} + * labeled alternative in {@link JavaScriptParser#iterationStatement}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitDoStatement(JavaScriptParser.DoStatementContext ctx); + /** + * Visit a parse tree produced by the {@code WhileStatement} + * labeled alternative in {@link JavaScriptParser#iterationStatement}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitWhileStatement(JavaScriptParser.WhileStatementContext ctx); + /** + * Visit a parse tree produced by the {@code ForStatement} + * labeled alternative in {@link JavaScriptParser#iterationStatement}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitForStatement(JavaScriptParser.ForStatementContext ctx); + /** + * Visit a parse tree produced by the {@code ForInStatement} + * labeled alternative in {@link JavaScriptParser#iterationStatement}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitForInStatement(JavaScriptParser.ForInStatementContext ctx); + /** + * Visit a parse tree produced by the {@code ForOfStatement} + * labeled alternative in {@link JavaScriptParser#iterationStatement}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitForOfStatement(JavaScriptParser.ForOfStatementContext ctx); + /** + * Visit a parse tree produced by {@link JavaScriptParser#varModifier}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitVarModifier(JavaScriptParser.VarModifierContext ctx); + /** + * Visit a parse tree produced by {@link JavaScriptParser#continueStatement}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitContinueStatement(JavaScriptParser.ContinueStatementContext ctx); + /** + * Visit a parse tree produced by {@link JavaScriptParser#breakStatement}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitBreakStatement(JavaScriptParser.BreakStatementContext ctx); + /** + * Visit a parse tree produced by {@link JavaScriptParser#returnStatement}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitReturnStatement(JavaScriptParser.ReturnStatementContext ctx); + /** + * Visit a parse tree produced by {@link JavaScriptParser#yieldStatement}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitYieldStatement(JavaScriptParser.YieldStatementContext ctx); + /** + * Visit a parse tree produced by {@link JavaScriptParser#withStatement}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitWithStatement(JavaScriptParser.WithStatementContext ctx); + /** + * Visit a parse tree produced by {@link JavaScriptParser#switchStatement}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitSwitchStatement(JavaScriptParser.SwitchStatementContext ctx); + /** + * Visit a parse tree produced by {@link JavaScriptParser#caseBlock}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitCaseBlock(JavaScriptParser.CaseBlockContext ctx); + /** + * Visit a parse tree produced by {@link JavaScriptParser#caseClauses}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitCaseClauses(JavaScriptParser.CaseClausesContext ctx); + /** + * Visit a parse tree produced by {@link JavaScriptParser#caseClause}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitCaseClause(JavaScriptParser.CaseClauseContext ctx); + /** + * Visit a parse tree produced by {@link JavaScriptParser#defaultClause}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitDefaultClause(JavaScriptParser.DefaultClauseContext ctx); + /** + * Visit a parse tree produced by {@link JavaScriptParser#labelledStatement}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitLabelledStatement(JavaScriptParser.LabelledStatementContext ctx); + /** + * Visit a parse tree produced by {@link JavaScriptParser#throwStatement}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitThrowStatement(JavaScriptParser.ThrowStatementContext ctx); + /** + * Visit a parse tree produced by {@link JavaScriptParser#tryStatement}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitTryStatement(JavaScriptParser.TryStatementContext ctx); + /** + * Visit a parse tree produced by {@link JavaScriptParser#catchProduction}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitCatchProduction(JavaScriptParser.CatchProductionContext ctx); + /** + * Visit a parse tree produced by {@link JavaScriptParser#finallyProduction}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitFinallyProduction(JavaScriptParser.FinallyProductionContext ctx); + /** + * Visit a parse tree produced by {@link JavaScriptParser#debuggerStatement}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitDebuggerStatement(JavaScriptParser.DebuggerStatementContext ctx); + /** + * Visit a parse tree produced by {@link JavaScriptParser#functionDeclaration}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitFunctionDeclaration(JavaScriptParser.FunctionDeclarationContext ctx); + /** + * Visit a parse tree produced by {@link JavaScriptParser#classDeclaration}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitClassDeclaration(JavaScriptParser.ClassDeclarationContext ctx); + /** + * Visit a parse tree produced by {@link JavaScriptParser#classTail}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitClassTail(JavaScriptParser.ClassTailContext ctx); + /** + * Visit a parse tree produced by {@link JavaScriptParser#classElement}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitClassElement(JavaScriptParser.ClassElementContext ctx); + /** + * Visit a parse tree produced by {@link JavaScriptParser#methodDefinition}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitMethodDefinition(JavaScriptParser.MethodDefinitionContext ctx); + /** + * Visit a parse tree produced by {@link JavaScriptParser#formalParameterList}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitFormalParameterList(JavaScriptParser.FormalParameterListContext ctx); + /** + * Visit a parse tree produced by {@link JavaScriptParser#formalParameterArg}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitFormalParameterArg(JavaScriptParser.FormalParameterArgContext ctx); + /** + * Visit a parse tree produced by {@link JavaScriptParser#lastFormalParameterArg}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitLastFormalParameterArg(JavaScriptParser.LastFormalParameterArgContext ctx); + /** + * Visit a parse tree produced by {@link JavaScriptParser#functionBody}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitFunctionBody(JavaScriptParser.FunctionBodyContext ctx); + /** + * Visit a parse tree produced by {@link JavaScriptParser#sourceElements}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitSourceElements(JavaScriptParser.SourceElementsContext ctx); + /** + * Visit a parse tree produced by {@link JavaScriptParser#arrayLiteral}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitArrayLiteral(JavaScriptParser.ArrayLiteralContext ctx); + /** + * Visit a parse tree produced by {@link JavaScriptParser#elementList}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitElementList(JavaScriptParser.ElementListContext ctx); + /** + * Visit a parse tree produced by {@link JavaScriptParser#arrayElement}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitArrayElement(JavaScriptParser.ArrayElementContext ctx); + /** + * Visit a parse tree produced by the {@code PropertyExpressionAssignment} + * labeled alternative in {@link JavaScriptParser#propertyAssignment}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitPropertyExpressionAssignment(JavaScriptParser.PropertyExpressionAssignmentContext ctx); + /** + * Visit a parse tree produced by the {@code ComputedPropertyExpressionAssignment} + * labeled alternative in {@link JavaScriptParser#propertyAssignment}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitComputedPropertyExpressionAssignment(JavaScriptParser.ComputedPropertyExpressionAssignmentContext ctx); + /** + * Visit a parse tree produced by the {@code FunctionProperty} + * labeled alternative in {@link JavaScriptParser#propertyAssignment}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitFunctionProperty(JavaScriptParser.FunctionPropertyContext ctx); + /** + * Visit a parse tree produced by the {@code PropertyGetter} + * labeled alternative in {@link JavaScriptParser#propertyAssignment}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitPropertyGetter(JavaScriptParser.PropertyGetterContext ctx); + /** + * Visit a parse tree produced by the {@code PropertySetter} + * labeled alternative in {@link JavaScriptParser#propertyAssignment}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitPropertySetter(JavaScriptParser.PropertySetterContext ctx); + /** + * Visit a parse tree produced by the {@code PropertyShorthand} + * labeled alternative in {@link JavaScriptParser#propertyAssignment}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitPropertyShorthand(JavaScriptParser.PropertyShorthandContext ctx); + /** + * Visit a parse tree produced by {@link JavaScriptParser#propertyName}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitPropertyName(JavaScriptParser.PropertyNameContext ctx); + /** + * Visit a parse tree produced by {@link JavaScriptParser#arguments}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitArguments(JavaScriptParser.ArgumentsContext ctx); + /** + * Visit a parse tree produced by {@link JavaScriptParser#argument}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitArgument(JavaScriptParser.ArgumentContext ctx); + /** + * Visit a parse tree produced by {@link JavaScriptParser#expressionSequence}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitExpressionSequence(JavaScriptParser.ExpressionSequenceContext ctx); + /** + * Visit a parse tree produced by the {@code TemplateStringExpression} + * labeled alternative in JavaScriptParser#singleExpression. + * @param ctx the parse tree + * @return the visitor result + */ + T visitTemplateStringExpression(JavaScriptParser.TemplateStringExpressionContext ctx); + /** + * Visit a parse tree produced by the {@code TernaryExpression} + * labeled alternative in JavaScriptParser#singleExpression. + * @param ctx the parse tree + * @return the visitor result + */ + T visitTernaryExpression(JavaScriptParser.TernaryExpressionContext ctx); + /** + * Visit a parse tree produced by the {@code LogicalAndExpression} + * labeled alternative in . + * @param ctx the parse tree + * @return the visitor result + */ + T visitLogicalAndExpression(JavaScriptParser.LogicalAndExpressionContext ctx); + /** + * Visit a parse tree produced by the {@code PowerExpression} + * labeled alternative in . + * @param ctx the parse tree + * @return the visitor result + */ + T visitPowerExpression(JavaScriptParser.PowerExpressionContext ctx); + /** + * Visit a parse tree produced by the {@code PreIncrementExpression} + * labeled alternative in JavaScriptParser#singleExpression. + * @param ctx the parse tree + * @return the visitor result + */ + T visitPreIncrementExpression(JavaScriptParser.PreIncrementExpressionContext ctx); + /** + * Visit a parse tree produced by the {@code ObjectLiteralExpression} + * labeled alternative in JavaScriptParser#singleExpression. + * @param ctx the parse tree + * @return the visitor result + */ + T visitObjectLiteralExpression(JavaScriptParser.ObjectLiteralExpressionContext ctx); + /** + * Visit a parse tree produced by the {@code MetaExpression} + * labeled alternative in JavaScriptParser#singleExpression. + * @param ctx the parse tree + * @return the visitor result + */ + T visitMetaExpression(JavaScriptParser.MetaExpressionContext ctx); + /** + * Visit a parse tree produced by the {@code InExpression} + * labeled alternative in . + * @param ctx the parse tree + * @return the visitor result + */ + T visitInExpression(JavaScriptParser.InExpressionContext ctx); + /** + * Visit a parse tree produced by the {@code LogicalOrExpression} + * labeled alternative in JavaScriptParser#singleExpression. + * @param ctx the parse tree + * @return the visitor result + */ + T visitLogicalOrExpression(JavaScriptParser.LogicalOrExpressionContext ctx); + /** + * Visit a parse tree produced by the {@code NotExpression} + * labeled alternative in JavaScriptParser#singleExpression. + * @param ctx the parse tree + * @return the visitor result + */ + T visitNotExpression(JavaScriptParser.NotExpressionContext ctx); + /** + * Visit a parse tree produced by the {@code PreDecreaseExpression} + * labeled alternative in JavaScriptParser#singleExpression. + * @param ctx the parse tree + * @return the visitor result + */ + T visitPreDecreaseExpression(JavaScriptParser.PreDecreaseExpressionContext ctx); + /** + * Visit a parse tree produced by the {@code ArgumentsExpression} + * labeled alternative in JavaScriptParser#singleExpression. + * @param ctx the parse tree + * @return the visitor result + */ + T visitArgumentsExpression(JavaScriptParser.ArgumentsExpressionContext ctx); + /** + * Visit a parse tree produced by the {@code AwaitExpression} + * labeled alternative in JavaScriptParser#singleExpression. + * @param ctx the parse tree + * @return the visitor result + */ + T visitAwaitExpression(JavaScriptParser.AwaitExpressionContext ctx); + /** + * Visit a parse tree produced by the {@code ThisExpression} + * labeled alternative in JavaScriptParser#singleExpression. + * @param ctx the parse tree + * @return the visitor result + */ + T visitThisExpression(JavaScriptParser.ThisExpressionContext ctx); + /** + * Visit a parse tree produced by the {@code FunctionExpression} + * labeled alternative in JavaScriptParser#singleExpression. + * @param ctx the parse tree + * @return the visitor result + */ + T visitFunctionExpression(JavaScriptParser.FunctionExpressionContext ctx); + /** + * Visit a parse tree produced by the {@code UnaryMinusExpression} + * labeled alternative in JavaScriptParser#singleExpression. + * @param ctx the parse tree + * @return the visitor result + */ + T visitUnaryMinusExpression(JavaScriptParser.UnaryMinusExpressionContext ctx); + /** + * Visit a parse tree produced by the {@code AssignmentExpression} + * labeled alternative in JavaScriptParser#singleExpression. + * @param ctx the parse tree + * @return the visitor result + */ + T visitAssignmentExpression(JavaScriptParser.AssignmentExpressionContext ctx); + /** + * Visit a parse tree produced by the {@code PostDecreaseExpression} + * labeled alternative in JavaScriptParser#singleExpression. + * @param ctx the parse tree + * @return the visitor result + */ + T visitPostDecreaseExpression(JavaScriptParser.PostDecreaseExpressionContext ctx); + /** + * Visit a parse tree produced by the {@code TypeofExpression} + * labeled alternative in JavaScriptParser#singleExpression. + * @param ctx the parse tree + * @return the visitor result + */ + T visitTypeofExpression(JavaScriptParser.TypeofExpressionContext ctx); + /** + * Visit a parse tree produced by the {@code InstanceofExpression} + * labeled alternative in JavaScriptParser#singleExpression. + * @param ctx the parse tree + * @return the visitor result + */ + T visitInstanceofExpression(JavaScriptParser.InstanceofExpressionContext ctx); + /** + * Visit a parse tree produced by the {@code UnaryPlusExpression} + * labeled alternative in JavaScriptParser#singleExpression. + * @param ctx the parse tree + * @return the visitor result + */ + T visitUnaryPlusExpression(JavaScriptParser.UnaryPlusExpressionContext ctx); + /** + * Visit a parse tree produced by the {@code DeleteExpression} + * labeled alternative in JavaScriptParser#singleExpression. + * @param ctx the parse tree + * @return the visitor result + */ + T visitDeleteExpression(JavaScriptParser.DeleteExpressionContext ctx); + /** + * Visit a parse tree produced by the {@code ImportExpression} + * labeled alternative in JavaScriptParser#singleExpression. + * @param ctx the parse tree + * @return the visitor result + */ + T visitImportExpression(JavaScriptParser.ImportExpressionContext ctx); + /** + * Visit a parse tree produced by the {@code EqualityExpression} + * labeled alternative in JavaScriptParser#singleExpression. + * @param ctx the parse tree + * @return the visitor result + */ + T visitEqualityExpression(JavaScriptParser.EqualityExpressionContext ctx); + /** + * Visit a parse tree produced by the {@code BitXOrExpression} + * labeled alternative in JavaScriptParser#singleExpression. + * @param ctx the parse tree + * @return the visitor result + */ + T visitBitXOrExpression(JavaScriptParser.BitXOrExpressionContext ctx); + /** + * Visit a parse tree produced by the {@code SuperExpression} + * labeled alternative in JavaScriptParser#singleExpression. + * @param ctx the parse tree + * @return the visitor result + */ + T visitSuperExpression(JavaScriptParser.SuperExpressionContext ctx); + /** + * Visit a parse tree produced by the {@code MultiplicativeExpression} + * labeled alternative in JavaScriptParser#singleExpression. + * @param ctx the parse tree + * @return the visitor result + */ + T visitMultiplicativeExpression(JavaScriptParser.MultiplicativeExpressionContext ctx); + /** + * Visit a parse tree produced by the {@code BitShiftExpression} + * labeled alternative in JavaScriptParser#singleExpression. + * @param ctx the parse tree + * @return the visitor result + */ + T visitBitShiftExpression(JavaScriptParser.BitShiftExpressionContext ctx); + /** + * Visit a parse tree produced by the {@code ParenthesizedExpression} + * labeled alternative in JavaScriptParser#singleExpression. + * @param ctx the parse tree + * @return the visitor result + */ + T visitParenthesizedExpression(JavaScriptParser.ParenthesizedExpressionContext ctx); + /** + * Visit a parse tree produced by the {@code AdditiveExpression} + * labeled alternative in JavaScriptParser#singleExpression. + * @param ctx the parse tree + * @return the visitor result + */ + T visitAdditiveExpression(JavaScriptParser.AdditiveExpressionContext ctx); + /** + * Visit a parse tree produced by the {@code RelationalExpression} + * labeled alternative in JavaScriptParser#singleExpression. + * @param ctx the parse tree + * @return the visitor result + */ + T visitRelationalExpression(JavaScriptParser.RelationalExpressionContext ctx); + /** + * Visit a parse tree produced by the {@code PostIncrementExpression} + * labeled alternative in . + * @param ctx the parse tree + * @return the visitor result + */ + T visitPostIncrementExpression(JavaScriptParser.PostIncrementExpressionContext ctx); + /** + * Visit a parse tree produced by the {@code YieldExpression} + * labeled alternative in JavaScriptParser#singleExpression. + * @param ctx the parse tree + * @return the visitor result + */ + T visitYieldExpression(JavaScriptParser.YieldExpressionContext ctx); + /** + * Visit a parse tree produced by the {@code BitNotExpression} + * labeled alternative in JavaScriptParser#singleExpression. + * @param ctx the parse tree + * @return the visitor result + */ + T visitBitNotExpression(JavaScriptParser.BitNotExpressionContext ctx); + /** + * Visit a parse tree produced by the {@code NewExpression} + * labeled alternative in JavaScriptParser#singleExpression. + * @param ctx the parse tree + * @return the visitor result + */ + T visitNewExpression(JavaScriptParser.NewExpressionContext ctx); + /** + * Visit a parse tree produced by the {@code LiteralExpression} + * labeled alternative in JavaScriptParser#singleExpression. + * @param ctx the parse tree + * @return the visitor result + */ + T visitLiteralExpression(JavaScriptParser.LiteralExpressionContext ctx); + /** + * Visit a parse tree produced by the {@code ArrayLiteralExpression} + * labeled alternative in . + * @param ctx the parse tree + * @return the visitor result + */ + T visitArrayLiteralExpression(JavaScriptParser.ArrayLiteralExpressionContext ctx); + /** + * Visit a parse tree produced by the {@code MemberDotExpression} + * labeled alternative in JavaScriptParser#singleExpression. + * @param ctx the parse tree + * @return the visitor result + */ + T visitMemberDotExpression(JavaScriptParser.MemberDotExpressionContext ctx); + /** + * Visit a parse tree produced by the {@code ClassExpression} + * labeled alternative in JavaScriptParser#singleExpression. + * @param ctx the parse tree + * @return the visitor result + */ + T visitClassExpression(JavaScriptParser.ClassExpressionContext ctx); + /** + * Visit a parse tree produced by the {@code MemberIndexExpression} + * labeled alternative in JavaScriptParser#singleExpression. + * @param ctx the parse tree + * @return the visitor result + */ + T visitMemberIndexExpression(JavaScriptParser.MemberIndexExpressionContext ctx); + /** + * Visit a parse tree produced by the {@code IdentifierExpression} + * labeled alternative in JavaScriptParser#singleExpression. + * @param ctx the parse tree + * @return the visitor result + */ + T visitIdentifierExpression(JavaScriptParser.IdentifierExpressionContext ctx); + /** + * Visit a parse tree produced by the {@code BitAndExpression} + * labeled alternative in JavaScriptParser#singleExpression. + * @param ctx the parse tree + * @return the visitor result + */ + T visitBitAndExpression(JavaScriptParser.BitAndExpressionContext ctx); + /** + * Visit a parse tree produced by the {@code BitOrExpression} + * labeled alternative in JavaScriptParser#singleExpression. + * @param ctx the parse tree + * @return the visitor result + */ + T visitBitOrExpression(JavaScriptParser.BitOrExpressionContext ctx); + /** + * Visit a parse tree produced by the {@code AssignmentOperatorExpression} + * labeled alternative in JavaScriptParser#singleExpression. + * @param ctx the parse tree + * @return the visitor result + */ + T visitAssignmentOperatorExpression(JavaScriptParser.AssignmentOperatorExpressionContext ctx); + /** + * Visit a parse tree produced by the {@code VoidExpression} + * labeled alternative in JavaScriptParser#singleExpression. + * @param ctx the parse tree + * @return the visitor result + */ + T visitVoidExpression(JavaScriptParser.VoidExpressionContext ctx); + /** + * Visit a parse tree produced by the {@code CoalesceExpression} + * labeled alternative in JavaScriptParser#singleExpression. + * @param ctx the parse tree + * @return the visitor result + */ + T visitCoalesceExpression(JavaScriptParser.CoalesceExpressionContext ctx); + /** + * Visit a parse tree produced by {@link JavaScriptParser#assignable}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitAssignable(JavaScriptParser.AssignableContext ctx); + /** + * Visit a parse tree produced by {@link JavaScriptParser#objectLiteral}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitObjectLiteral(JavaScriptParser.ObjectLiteralContext ctx); + /** + * Visit a parse tree produced by the {@code FunctionDecl} + * labeled alternative in {@link JavaScriptParser#anoymousFunction}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitFunctionDecl(JavaScriptParser.FunctionDeclContext ctx); + /** + * Visit a parse tree produced by the {@code AnoymousFunctionDecl} + * labeled alternative in {@link JavaScriptParser#anoymousFunction}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitAnoymousFunctionDecl(JavaScriptParser.AnoymousFunctionDeclContext ctx); + /** + * Visit a parse tree produced by the {@code ArrowFunction} + * labeled alternative in {@link JavaScriptParser#anoymousFunction}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitArrowFunction(JavaScriptParser.ArrowFunctionContext ctx); + /** + * Visit a parse tree produced by {@link JavaScriptParser#arrowFunctionParameters}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitArrowFunctionParameters(JavaScriptParser.ArrowFunctionParametersContext ctx); + /** + * Visit a parse tree produced by {@link JavaScriptParser#arrowFunctionBody}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitArrowFunctionBody(JavaScriptParser.ArrowFunctionBodyContext ctx); + /** + * Visit a parse tree produced by {@link JavaScriptParser#assignmentOperator}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitAssignmentOperator(JavaScriptParser.AssignmentOperatorContext ctx); + /** + * Visit a parse tree produced by {@link JavaScriptParser#literal}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitLiteral(JavaScriptParser.LiteralContext ctx); + /** + * Visit a parse tree produced by {@link JavaScriptParser#numericLiteral}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitNumericLiteral(JavaScriptParser.NumericLiteralContext ctx); + /** + * Visit a parse tree produced by {@link JavaScriptParser#bigintLiteral}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitBigintLiteral(JavaScriptParser.BigintLiteralContext ctx); + /** + * Visit a parse tree produced by {@link JavaScriptParser#getter}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitGetter(JavaScriptParser.GetterContext ctx); + /** + * Visit a parse tree produced by {@link JavaScriptParser#setter}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitSetter(JavaScriptParser.SetterContext ctx); + /** + * Visit a parse tree produced by {@link JavaScriptParser#identifierName}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitIdentifierName(JavaScriptParser.IdentifierNameContext ctx); + /** + * Visit a parse tree produced by {@link JavaScriptParser#identifier}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitIdentifier(JavaScriptParser.IdentifierContext ctx); + /** + * Visit a parse tree produced by {@link JavaScriptParser#reservedWord}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitReservedWord(JavaScriptParser.ReservedWordContext ctx); + /** + * Visit a parse tree produced by {@link JavaScriptParser#keyword}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitKeyword(JavaScriptParser.KeywordContext ctx); + /** + * Visit a parse tree produced by {@link JavaScriptParser#let}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitLet(JavaScriptParser.LetContext ctx); + /** + * Visit a parse tree produced by {@link JavaScriptParser#eos}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitEos(JavaScriptParser.EosContext ctx); +} \ No newline at end of file diff --git a/src/main/java/gui/controller/ArrowCreatorController.java b/src/main/java/gui/controller/ArrowCreatorController.java new file mode 100644 index 0000000..1e51d65 --- /dev/null +++ b/src/main/java/gui/controller/ArrowCreatorController.java @@ -0,0 +1,34 @@ +package gui.controller; + +import gui.controller.dto.ArrowInputData; +import gui.model.Graph; +import gui.view.ArrowCreatorView; + +public class ArrowCreatorController { + + private final Graph model; + private ArrowCreatorView view; + + public ArrowCreatorController(Graph model) { + this.model = model; + } + + public void setup() { + this.view = new ArrowCreatorView(this, model); + view.showAndWait(); + } + + + public void addArrowToGraph(ArrowInputData arrowInfos) { + model.addArrow(arrowInfos); + if (view != null) { + view.close(); + } + } + + + + public void closeWindow() { + view.close(); + } +} diff --git a/src/main/java/gui/controller/ArrowEditorController.java b/src/main/java/gui/controller/ArrowEditorController.java new file mode 100644 index 0000000..8da5fcb --- /dev/null +++ b/src/main/java/gui/controller/ArrowEditorController.java @@ -0,0 +1,31 @@ +package gui.controller; + +import gui.controller.dto.ArrowInputData; +import gui.model.Graph; +import gui.view.ArrowEditorView; +import gui.view.graphcomponents.DraggableArrow; + +public class ArrowEditorController { + private final Graph model; + private ArrowEditorView view; + + public ArrowEditorController(Graph model) { + this.model = model; + } + + public void setup(DraggableArrow draggableArrow) { + this.view = new ArrowEditorView(this, draggableArrow, model); + view.showAndWait(); + } + + public void updateArrowToGraph(ArrowInputData infos) { + model.updateArrow(infos); + if (view != null) { + view.close(); + } + } + + public void closeWindow() { + view.close(); + } +} diff --git a/src/main/java/gui/controller/GraphVisualisationController.java b/src/main/java/gui/controller/GraphVisualisationController.java new file mode 100644 index 0000000..f46d8c8 --- /dev/null +++ b/src/main/java/gui/controller/GraphVisualisationController.java @@ -0,0 +1,140 @@ +package gui.controller; + +import gui.controller.criteriaSelection.CriteriaSelectionTestCaseTemplateController; +import gui.model.Graph; +import gui.view.GraphVisualisationView; +import gui.view.StandardPresentationView; +import gui.view.graphcomponents.DraggableArrow; +import gui.view.graphcomponents.DraggableNode; +import javafx.stage.FileChooser; +import logic.logevaluation.CoverageCalculation; + +import java.io.File; +import java.util.List; + +public class GraphVisualisationController { + private final GraphVisualisationView view; + + private final Graph model; + + public GraphVisualisationController(Graph model) { + this.view = new GraphVisualisationView(model); + this.model = model; + } + + + public void saveGraph(List nodes, List arrows) { + + updatePositionsInModel(nodes, arrows); + var fileChooser = new FileChooser(); + var extFilter = new FileChooser.ExtensionFilter("JSON files (*.json)", "*.json"); + fileChooser.getExtensionFilters().add(extFilter); + fileChooser.setInitialDirectory(new File(System.getProperty("user.home"))); + var file = fileChooser.showSaveDialog(view); + if (file != null) { + PersistenceUtilities.saveGraph(model, file.getAbsolutePath()); + } + } + + private void updatePositionsInModel(List nodes, List arrows) { + for (DraggableNode node : nodes) { + node.updatePosition(); + model.updateNodePosition(node.getIdentifier(), node.getX(), node.getY()); + } + for (DraggableArrow arrow : arrows) { + arrow.updateOffset(); + model.updateArrowPosition(arrow.getIdentifier(), arrow.getOriginalStartOffsetPositionX(), + arrow.getOriginalStartOffsetPositionY(), arrow.getOriginalEndOffsetPositionX(), arrow.getOriginalEndOffsetPositionY()); + } + model.informObservers(); + } + + + public void openGraph() { + var fileChooser = new FileChooser(); + fileChooser.setInitialDirectory(new File(System.getProperty("user.home"))); + var file = fileChooser.showOpenDialog(view); + if (file != null) { + model.clearGraph(); + var result = PersistenceUtilities.loadGraph(file.getAbsolutePath(), model); + result.ifPresent(view::setModel); + } + } + + public void remove(DraggableArrow draggableArrow) { + model.removeNodeArrow(draggableArrow.getIdentifier()); + } + + public void remove(DraggableNode draggableNode) { + model.removeNode(draggableNode.getIdentifier()); + } + + + public void showArrowInfoBox(String info) { + StandardPresentationView view = new StandardPresentationView("Arrow", info); + view.show(); + } + + public void showNodeInfoBox(String info) { + StandardPresentationView view = new StandardPresentationView("Node", info); + view.show(); + } + + + public void createArrow() { + var controller = new ArrowCreatorController(model); + controller.setup(); + } + + public void createNode(double x, double y) { + var controller = new NodeCreatorController(model); + controller.setup(x, y); + } + + public void closeWindow() { + view.closeWindow(); + + } + + public void editNode(DraggableNode draggableNode) { + var controller = new NodeEditorController(model); + controller.setup(draggableNode); + } + + public void editArrow(DraggableArrow draggableArrow) { + var controller = new ArrowEditorController(model); + controller.setup(draggableArrow); + } + + public void updateNodePosition(DraggableNode draggableNode) { + model.updateNodePosition(draggableNode.getIdentifier(), draggableNode.getX(), draggableNode.getY()); + } + + public void updateArrowPosition(DraggableArrow arrow) { + model.updateArrowPosition(arrow.getIdentifier(), arrow.getOriginalStartOffsetPositionX(), + arrow.getOriginalStartOffsetPositionY(), arrow.getOriginalEndOffsetPositionX(), arrow.getOriginalEndOffsetPositionY()); + } + + + public void setup() { + view.setup(this); + } + + public void show() { + view.updateAndshow(); + } + + public void createStaticTestCases() { + + CriteriaSelectionTestCaseTemplateController controller = new CriteriaSelectionTestCaseTemplateController(model); + controller.setup(); + } + + public void analyzeLogFile(File file) { + CoverageCalculation coverageCalculation = new CoverageCalculation(); + String result = coverageCalculation.calculateCoverage(file); + StandardPresentationView view = new StandardPresentationView("Coverage"); + view.setText(result); + view.show(); + } +} diff --git a/src/main/java/gui/controller/NodeCreatorController.java b/src/main/java/gui/controller/NodeCreatorController.java new file mode 100644 index 0000000..201106e --- /dev/null +++ b/src/main/java/gui/controller/NodeCreatorController.java @@ -0,0 +1,41 @@ +package gui.controller; + +import gui.controller.dto.NodeInputData; +import gui.model.Graph; +import gui.view.NodeCreatorView; +import gui.view.UtilityConverter; + +import java.io.File; + +public class NodeCreatorController { + + private final Graph model; + private NodeCreatorView view = null; + + public NodeCreatorController(Graph model) { + this.model = model; + } + + + public void setup(double x, double y) { + view = new NodeCreatorView(this, x, y); + view.setup(); + } + + public void addNodeToGraph(NodeInputData nodeInfos) { + model.addNode(nodeInfos); + if (view != null) { + view.close(); + } + } + + + public void close() { + view.close(); + } + + public void setSourceFile(File file) { + var tableItems = UtilityConverter.getTableItems(file); + view.setDataForTable(tableItems); + } +} diff --git a/src/main/java/gui/controller/NodeEditorController.java b/src/main/java/gui/controller/NodeEditorController.java new file mode 100644 index 0000000..c940958 --- /dev/null +++ b/src/main/java/gui/controller/NodeEditorController.java @@ -0,0 +1,57 @@ +package gui.controller; + +import gui.controller.criteriaSelection.CriteriaSelectionStrategyController; +import gui.controller.criteriaSelection.CriteriaSelectionTestCaseInstrumentationController; +import gui.controller.dto.NodeInputData; +import gui.model.Graph; +import gui.model.SourceCode; +import gui.model.SourceCodeLine; +import gui.view.NodeEditorView; +import gui.view.UtilityConverter; +import gui.view.graphcomponents.DraggableNode; +import logic.sourcecodeanalyzer.Analyzer; + +import java.io.File; +import java.util.List; + +public class NodeEditorController { + private final Graph model; + private NodeEditorView view = null; + + public NodeEditorController(Graph model) { + this.model = model; + } + + public void updateNodeToGraph(NodeInputData infos) { + model.updateNode(infos); + if (view != null) { + view.close(); + } + } + + public void setup(DraggableNode draggableNode) { + view = new NodeEditorView(this, draggableNode, model); + view.setup(); + } + + public void setSourceFile(File file) { + var tableItems = UtilityConverter.getTableItems(file); + view.setDataForTable(tableItems); + } + + public void instrumentSourceCode(List sourceListUnwrapped, Long idOfNode) { + + CriteriaSelectionStrategyController controller = new CriteriaSelectionTestCaseInstrumentationController(new SourceCode(sourceListUnwrapped, idOfNode)); + controller.setup(); + } + + public void analyzeSource(List sourceListUnwrapped, Long idOfNode, NodeEditorView nodeEditorView, boolean adaptForDeletes) { + var sourceCode = new SourceCode(sourceListUnwrapped, idOfNode); + String sourceAsJSON = sourceCode.getJSON(); + + Analyzer analyzer = new Analyzer(adaptForDeletes); + String sourceAnalyzedAsJson = analyzer.getSuggestionForInstrumentation(sourceAsJSON, model.getJSON()); + SourceCode resultSourceCode = SourceCode.getSourceCodeObject(sourceAnalyzedAsJson); + nodeEditorView.setDataForTable(resultSourceCode.getSourceCode()); + } +} diff --git a/src/main/java/gui/controller/PersistenceUtilities.java b/src/main/java/gui/controller/PersistenceUtilities.java new file mode 100644 index 0000000..69b35c3 --- /dev/null +++ b/src/main/java/gui/controller/PersistenceUtilities.java @@ -0,0 +1,76 @@ +package gui.controller; + +import com.google.gson.GsonBuilder; +import gui.controller.dto.ArrowInputData; +import gui.controller.dto.NodeInputData; +import gui.model.Graph; + +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.StandardOpenOption; +import java.util.Optional; + +public class PersistenceUtilities { + public static void saveGraph(Graph model, String absolutePath) { + var gson = new GsonBuilder() + .excludeFieldsWithoutExposeAnnotation().setPrettyPrinting() + .create(); + + String json = gson.toJson(model); + var destination = Path.of(absolutePath); + try { + Files.writeString(destination, json, StandardOpenOption.CREATE, StandardOpenOption.TRUNCATE_EXISTING); + } catch (IOException e) { + System.err.printf("Could not write the following to %s:%n%s ", absolutePath, json); + } + } + + public static Optional loadGraph(String absolutePath, Graph model) { + var gson = new GsonBuilder().excludeFieldsWithoutExposeAnnotation().create(); + var source = Path.of(absolutePath); + try { + var json = Files.readString(source); + Graph modelLoaded = gson.fromJson(json, Graph.class); + var arrows = modelLoaded.getArrows(); + var nodes = modelLoaded.getNodes(); + for (var node : nodes) { + var inputNode = new NodeInputData(); + inputNode.setNodeType(node.getType()); + inputNode.setName(node.getNameOfNode()); + inputNode.setSourceData(node.getSourceList()); + inputNode.setX(node.getX()); + inputNode.setY(node.getY()); + inputNode.setId(node.getIdentifier()); + inputNode.setInputFormats(node.getInputFormats()); + model.addNode(inputNode); + } + for (var arrow : arrows) { + var inputArrow = new ArrowInputData(); + + inputArrow.setOriginalEndOffsetPositionX(arrow.getOriginalEndOffsetPositionX()); + inputArrow.setOriginalEndOffsetPositionY(arrow.getOriginalEndOffsetPositionY()); + inputArrow.setOriginalStartOffsetPositionX(arrow.getOriginalStartOffsetPositionX()); + inputArrow.setOriginalStartOffsetPositionY(arrow.getOriginalStartOffsetPositionY()); + inputArrow.setAccessMode(arrow.getAccessMode()); + inputArrow.setId(arrow.getIdentifier()); + var pred = model.getNode(arrow.getPredecessor()); + var suc = model.getNode(arrow.getSuccessor()); + inputArrow.setPredecessor(pred.orElseThrow(() -> { + throw new IllegalStateException("pred not available"); + }).getIdentifier()); + inputArrow.setSuccessor(suc.orElseThrow(() -> { + throw new IllegalStateException("suc not available"); + }).getIdentifier()); + model.addArrow(inputArrow); + } + + + } catch (IOException e) { + System.err.printf("Could not read file '%s'", absolutePath); + } + return Optional.ofNullable(model); + } + + +} diff --git a/src/main/java/gui/controller/criteriaSelection/CriteriaSelectionStrategyController.java b/src/main/java/gui/controller/criteriaSelection/CriteriaSelectionStrategyController.java new file mode 100644 index 0000000..5a8b628 --- /dev/null +++ b/src/main/java/gui/controller/criteriaSelection/CriteriaSelectionStrategyController.java @@ -0,0 +1,7 @@ +package gui.controller.criteriaSelection; + +public interface CriteriaSelectionStrategyController { + void handleInput(boolean isAllResources, boolean isAllRelations, boolean isAllDefs, boolean isAllDefUse, boolean isAllUses); + void cancel(); + void setup(); +} diff --git a/src/main/java/gui/controller/criteriaSelection/CriteriaSelectionTestCaseInstrumentationController.java b/src/main/java/gui/controller/criteriaSelection/CriteriaSelectionTestCaseInstrumentationController.java new file mode 100644 index 0000000..3227ff0 --- /dev/null +++ b/src/main/java/gui/controller/criteriaSelection/CriteriaSelectionTestCaseInstrumentationController.java @@ -0,0 +1,42 @@ +package gui.controller.criteriaSelection; + +import gui.model.SourceCode; +import gui.view.StandardPresentationView; +import gui.view.criteriaSelection.CriteriaSelectionView; +import logic.instrumentation.SourceInstrumentator; +import logic.instrumentation.SourceInstrumentatorImpl; + +public class CriteriaSelectionTestCaseInstrumentationController implements CriteriaSelectionStrategyController { + + private final SourceCode model; + private CriteriaSelectionView view; + + public CriteriaSelectionTestCaseInstrumentationController(SourceCode model) { + this.model = model; + } + + + @Override + public void setup() { + this.view = new CriteriaSelectionView("Criteria selection", this); + view.showAndWait(); + } + + @Override + public void cancel() { + view.close(); + } + + @Override + public void handleInput(boolean isAllResources, boolean isAllRelations, boolean isAllDefs, boolean isAllDefUse, boolean isAllUses) { + + SourceInstrumentator instrumentator = new SourceInstrumentatorImpl(); + + String sourceAsJSON = model.getJSON(); + boolean defUse = isAllDefs || isAllDefUse || isAllUses; + String instrumentedSourceCode = instrumentator.instrumentSourceCode(sourceAsJSON, isAllResources, isAllRelations, defUse); + StandardPresentationView tcView = new StandardPresentationView("Instrumentation", instrumentedSourceCode); + tcView.show(); + view.close(); + } +} \ No newline at end of file diff --git a/src/main/java/gui/controller/criteriaSelection/CriteriaSelectionTestCaseTemplateController.java b/src/main/java/gui/controller/criteriaSelection/CriteriaSelectionTestCaseTemplateController.java new file mode 100644 index 0000000..613a156 --- /dev/null +++ b/src/main/java/gui/controller/criteriaSelection/CriteriaSelectionTestCaseTemplateController.java @@ -0,0 +1,66 @@ +package gui.controller.criteriaSelection; + +import gui.model.Graph; +import gui.view.StandardPresentationView; +import gui.view.criteriaSelection.CriteriaSelectionView; +import logic.model.TestSuite; +import logic.testcasegenerator.TestCaseGenerator; +import logic.testcasegenerator.TestCaseGeneratorImpl; + +public class CriteriaSelectionTestCaseTemplateController implements CriteriaSelectionStrategyController { + + private final Graph model; + private CriteriaSelectionView view; + + public CriteriaSelectionTestCaseTemplateController(Graph model) { + this.model = model; + } + + @Override + public void setup() { + this.view = new CriteriaSelectionView("Criteria selection", this); + view.showAndWait(); + } + + @Override + public void cancel() { + view.close(); + } + + @Override + public void handleInput(boolean isAllResources, boolean isAllRelations, boolean isAllDefs, boolean isAllDefUse, boolean isAllUses) { + TestCaseGenerator tcGenerator = new TestCaseGeneratorImpl(); + String modelAsJson = model.getJSON(); + if (isAllResources) { + + TestSuite testSuite = tcGenerator.getResourceCoverage(modelAsJson); + StandardPresentationView tcView = new StandardPresentationView("All resources", testSuite.toString()); + tcView.show(); + } + + if (isAllRelations) { + TestSuite testSuite = tcGenerator.getRelationCoverage(modelAsJson); + StandardPresentationView tcView = new StandardPresentationView("All relations", testSuite.toString()); + tcView.show(); + } + + if (isAllDefs) { + TestSuite testSuite = tcGenerator.getAllDefsCoverage(modelAsJson); + StandardPresentationView tcView = new StandardPresentationView("All defs", testSuite.toString()); + tcView.show(); + } + + if (isAllDefUse) { + TestSuite testSuite = tcGenerator.getDefUseCoverage(modelAsJson); + StandardPresentationView tcView = new StandardPresentationView("All defuse", testSuite.toString()); + tcView.show(); + } + + if (isAllUses) { + TestSuite testSuite = tcGenerator.getAllUsesCoverage(modelAsJson); + StandardPresentationView tcView = new StandardPresentationView("All uses", testSuite.toString()); + tcView.show(); + } + view.close(); + } +} \ No newline at end of file diff --git a/src/main/java/gui/controller/dto/ArrowInputData.java b/src/main/java/gui/controller/dto/ArrowInputData.java new file mode 100644 index 0000000..b5ade57 --- /dev/null +++ b/src/main/java/gui/controller/dto/ArrowInputData.java @@ -0,0 +1,82 @@ +package gui.controller.dto; + +import gui.model.AccessMode; + +public class ArrowInputData { + private long successor; + private long predecessor; + + private long id = -1; + private double originalStartOffsetPositionX = 0; + private double originalStartOffsetPositionY = 0; + private double originalEndOffsetPositionX = 0; + private double originalEndOffsetPositionY = 0; + private AccessMode accessMode; + + + public long getId() { + return id; + } + + public void setId(long id) { + this.id = id; + } + + public long getSuccessor() { + return successor; + } + + public long getPredecessor() { + return predecessor; + } + + public void setPredecessor(long predecessor) { + this.predecessor = predecessor; + } + public ArrowInputData() { + } + + public double getOriginalStartOffsetPositionX() { + return originalStartOffsetPositionX; + } + + public void setOriginalStartOffsetPositionX(double originalStartOffsetPositionX) { + this.originalStartOffsetPositionX = originalStartOffsetPositionX; + } + + public double getOriginalStartOffsetPositionY() { + return originalStartOffsetPositionY; + } + + public void setOriginalStartOffsetPositionY(double originalStartOffsetPositionY) { + this.originalStartOffsetPositionY = originalStartOffsetPositionY; + } + + public double getOriginalEndOffsetPositionX() { + return originalEndOffsetPositionX; + } + + public void setOriginalEndOffsetPositionX(double originalEndOffsetPositionX) { + this.originalEndOffsetPositionX = originalEndOffsetPositionX; + } + + public double getOriginalEndOffsetPositionY() { + return originalEndOffsetPositionY; + } + + public void setOriginalEndOffsetPositionY(double originalEndOffsetPositionY) { + this.originalEndOffsetPositionY = originalEndOffsetPositionY; + } + + public void setSuccessor(long successor) { + this.successor = successor; + } + + public AccessMode getAccessMode() { + return accessMode; + } + + public void setAccessMode(AccessMode accessMode) { + this.accessMode = accessMode; + } +} diff --git a/src/main/java/gui/controller/dto/NodeInputData.java b/src/main/java/gui/controller/dto/NodeInputData.java new file mode 100644 index 0000000..571a2ee --- /dev/null +++ b/src/main/java/gui/controller/dto/NodeInputData.java @@ -0,0 +1,79 @@ +package gui.controller.dto; + +import gui.model.FunctionInputFormat; +import gui.model.NodeType; +import gui.model.SourceCodeLine; + +import java.util.List; + +public class NodeInputData { + private double x; + private double y; + private String name; + private long id = -1; + + private NodeType type; + + private List sourceList; + private FunctionInputFormat inputFormats; + + public NodeInputData() { + } + + public double getX() { + return x; + } + + public void setX(double x) { + this.x = x; + } + + public double getY() { + return y; + } + + public void setY(double y) { + this.y = y; + } + + public String getName() { + return name; + } + + public void setName(String generalText) { + this.name = generalText; + } + + public void setNodeType(NodeType type) { + this.type = type; + } + + public NodeType getNodeType() { + return type; + } + + public long getId() { + return id; + } + + public void setId(long id) { + this.id = id; + } + + public void setSourceData(List sourceList) { + this.sourceList = sourceList; + } + + public List getSourceList() { + return sourceList; + } + + public void setInputFormats(FunctionInputFormat inputFormats) { + this.inputFormats = inputFormats; + } + + public FunctionInputFormat getInputFormats() { + return inputFormats; + } +} + diff --git a/src/main/java/gui/model/AccessMode.java b/src/main/java/gui/model/AccessMode.java new file mode 100644 index 0000000..0f11229 --- /dev/null +++ b/src/main/java/gui/model/AccessMode.java @@ -0,0 +1,16 @@ +package gui.model; + +public enum AccessMode { + READ("read"), WRITE("write"), DELETE("delete"), RETURN("return"), FUNCTIONCALL("function call"); + + private final String mode; + + AccessMode(final String mode) { + this.mode = mode; + } + + @Override + public String toString() { + return mode; + } +} diff --git a/src/main/java/gui/model/Arrow.java b/src/main/java/gui/model/Arrow.java new file mode 100644 index 0000000..a7a736b --- /dev/null +++ b/src/main/java/gui/model/Arrow.java @@ -0,0 +1,108 @@ +package gui.model; + +import com.google.gson.annotations.Expose; + +public class Arrow { + + @Expose + private long identifier; + @Expose + private double originalStartOffsetPositionX = 0; + @Expose + private double originalStartOffsetPositionY = 0; + @Expose + private double originalEndOffsetPositionX = 0; + @Expose + private double originalEndOffsetPositionY = 0; + + @Expose + private long successor; + @Expose + private long predecessor; + + private static long idCounter = 0; + + @Expose + private AccessMode accessMode; + + public Arrow() { + identifier = idCounter; + idCounter++; + } + + + public double getOriginalStartOffsetPositionX() { + return originalStartOffsetPositionX; + } + + public void setOriginalStartOffsetPositionX(double originalStartOffsetPositionX) { + this.originalStartOffsetPositionX = originalStartOffsetPositionX; + } + + public double getOriginalStartOffsetPositionY() { + return originalStartOffsetPositionY; + } + + public void setOriginalStartOffsetPositionY(double originalStartOffsetPositionY) { + this.originalStartOffsetPositionY = originalStartOffsetPositionY; + } + + public double getOriginalEndOffsetPositionX() { + return originalEndOffsetPositionX; + } + + public void setOriginalEndOffsetPositionX(double originalEndOffsetPositionX) { + this.originalEndOffsetPositionX = originalEndOffsetPositionX; + } + + public double getOriginalEndOffsetPositionY() { + return originalEndOffsetPositionY; + } + + public void setOriginalEndOffsetPositionY(double originalEndOffsetPositionY) { + this.originalEndOffsetPositionY = originalEndOffsetPositionY; + } + + public long getSuccessor() { + return successor; + } + + public void setSuccessor(long successor) { + this.successor = successor; + } + + public long getPredecessor() { + return predecessor; + } + + public void setPredecessor(long predecessor) { + this.predecessor = predecessor; + } + + public long getIdentifier() { + return identifier; + } + + public void setIdentifier(long identifier) { + if (identifier + 1 >= idCounter) { + idCounter = identifier + 1; + } else { + idCounter--; + } + this.identifier = identifier; + } + + public static void resetCounter() { + idCounter = 0; + } + + public void setAccessMode(AccessMode accessMode) { + this.accessMode = accessMode; + } + + public AccessMode getAccessMode() { + return accessMode; + } + + +} diff --git a/src/main/java/gui/model/FunctionInputFormat.java b/src/main/java/gui/model/FunctionInputFormat.java new file mode 100644 index 0000000..6048bd0 --- /dev/null +++ b/src/main/java/gui/model/FunctionInputFormat.java @@ -0,0 +1,127 @@ +package gui.model; + +import com.google.gson.annotations.Expose; +import javafx.beans.property.SimpleStringProperty; +import javafx.beans.property.StringProperty; +import javafx.beans.value.ObservableValue; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + +public class FunctionInputFormat { + @Expose + private List stringInput; + @Expose + private List integerInput; + @Expose + private String JSONInput; + + final StringProperty text = new SimpleStringProperty(); + + public FunctionInputFormat(List stringInput, List integerInput, String JSONInput) { + Objects.requireNonNull(stringInput, "string input list must not null"); + Objects.requireNonNull(integerInput, "string input list must not null"); + Objects.requireNonNull(JSONInput, "string input list must not null"); + + this.stringInput = stringInput; + this.integerInput = integerInput; + this.JSONInput = JSONInput; + text.set(this.toString()); + } + + public FunctionInputFormat() { + stringInput = new ArrayList<>(); + integerInput = new ArrayList<>(); + JSONInput = ""; + } + + public List getStringInput() { + return stringInput; + } + + public List getIntegerInput() { + return integerInput; + } + + public String getJSONInput() { + return JSONInput; + } + + @Override + public String toString() { + StringBuilder result = new StringBuilder(); + for (var stringInputEntry : stringInput) { + result.append(stringInputEntry); + result.append("\n"); + } + + for (var integerInputEntry : integerInput) { + result.append(integerInputEntry); + result.append("\n"); + } + + result.append(this.JSONInput); + + return result.toString(); + } + + public FunctionInputFormat getCopy() { + + + List integerInputCopy = new ArrayList<>(); + for (var integerInputEntry : integerInput) { + var entry = new IntegerInput(integerInputEntry.getKey(), integerInputEntry.getMinValue(), integerInputEntry.getMaxValue()); + integerInputCopy.add(entry); + } + List stringInputCopy = new ArrayList<>(); + for (var stringInputEntry : stringInput) { + var entry = new StringInput(stringInputEntry.getKey(), stringInputEntry.getJsonValue()); + stringInputCopy.add(entry); + } + return new FunctionInputFormat(stringInputCopy, integerInputCopy, this.JSONInput); + } + + public void setStringInput(List stringInput) { + this.stringInput = stringInput; + text.set(this.toString()); + } + + public void setIntegerInput(List integerInput) { + this.integerInput = integerInput; + text.set(this.toString()); + } + + public void setJSONInput(String JSONInput) { + this.JSONInput = JSONInput; + text.set(this.toString()); + } + + public ObservableValue textProperty() { + return text; + } + + public void addStringInputValue(StringInput stringInputValue) { + if (stringInput != null) { + stringInput.add(stringInputValue); + } + } + + public void delete(StringInput item) { + if (stringInput != null) { + stringInput.remove(item); + } + } + public void delete(IntegerInput item) { + if (integerInput != null) { + integerInput.remove(item); + } + } + + public void addIntegerInputValue(IntegerInput item) { + if (integerInput != null) { + integerInput.add(item); + } + } +} + diff --git a/src/main/java/gui/model/Graph.java b/src/main/java/gui/model/Graph.java new file mode 100644 index 0000000..68a588c --- /dev/null +++ b/src/main/java/gui/model/Graph.java @@ -0,0 +1,215 @@ +package gui.model; + +import com.google.gson.GsonBuilder; +import com.google.gson.annotations.Expose; +import gui.controller.dto.ArrowInputData; +import gui.controller.dto.NodeInputData; + +import java.beans.PropertyChangeListener; +import java.beans.PropertyChangeSupport; +import java.util.*; +import java.util.stream.Collectors; + +public class Graph { + + @Expose + private final List arrows; + @Expose + private final List nodes; + + + private final PropertyChangeSupport pcs = new PropertyChangeSupport(this); + + + public Graph() { + this.arrows = new ArrayList<>(); + this.nodes = new ArrayList<>(); + + } + + public Graph(List arrows, List nodes) { + this.arrows = arrows; + this.nodes = nodes; + } + + public void addArrow(ArrowInputData arrowInfos) { + var predecessor = findNodeByID(arrowInfos.getPredecessor()); + var successor = findNodeByID(arrowInfos.getSuccessor()); + + if (predecessor.isPresent() && successor.isPresent()) { + var arrow = new Arrow(); + arrow.setOriginalEndOffsetPositionX(arrowInfos.getOriginalEndOffsetPositionX()); + arrow.setOriginalEndOffsetPositionY(arrowInfos.getOriginalEndOffsetPositionY()); + arrow.setOriginalStartOffsetPositionX(arrowInfos.getOriginalStartOffsetPositionX()); + arrow.setOriginalStartOffsetPositionY(arrowInfos.getOriginalStartOffsetPositionY()); + arrow.setPredecessor(predecessor.get().getIdentifier()); + arrow.setSuccessor(successor.get().getIdentifier()); + arrow.setAccessMode(arrowInfos.getAccessMode()); + if (arrowInfos.getId() != -1) { + arrow.setIdentifier(arrowInfos.getId()); + } + arrows.add(arrow); + this.pcs.firePropertyChange("graphUpdated", null, this); + } else { + System.err.println("Nodes for arrow are not available"); + } + } + + public void updateArrow(ArrowInputData infos) { + Optional arrow = findArrowByID(infos.getId()); + arrow.ifPresent(a -> { + arrows.remove(a); + addArrow(infos); + }); + this.pcs.firePropertyChange("graphUpdated", null, this); + } + + public void addNode(NodeInputData nodeInfos) { + NodeModel node = copyNode(nodeInfos); + boolean isNodeAlreadyAdded = nodes.stream().anyMatch(n -> n.getIdentifier() == nodeInfos.getId()); + if (!isNodeAlreadyAdded) { + nodes.add(node); + } + this.pcs.firePropertyChange("graphUpdated", null, this); + } + + public void updateNode(NodeInputData nodeInfos) { + var node = nodes.stream().filter(n -> n.getIdentifier() == nodeInfos.getId()).findFirst(); + node.ifPresent( + n -> { + n.setX(nodeInfos.getX()); + n.setY(nodeInfos.getY()); + n.setType(nodeInfos.getNodeType()); + n.setSourceList(nodeInfos.getSourceList()); + n.setNameOfNode(nodeInfos.getName()); + n.setInputFormats(nodeInfos.getInputFormats()); + pcs.firePropertyChange("nodeUpdated", null, this); + } + ); + + } + + private NodeModel copyNode(NodeInputData nodeInfos) { + NodeModel node = new NodeModel(); + if (nodeInfos.getId() != -1) { + node.setIdentifier(nodeInfos.getId()); + } + node.setNameOfNode(nodeInfos.getName()); + node.setType(nodeInfos.getNodeType()); + node.setSourceList(nodeInfos.getSourceList()); + node.setX(nodeInfos.getX()); + node.setY(nodeInfos.getY()); + node.setInputFormats(nodeInfos.getInputFormats()); + return node; + } + + public Optional getNode(long id) { + return nodes.stream().filter(node -> node.getIdentifier() == id).findAny(); + } + + public void addPropertyChangeListener(PropertyChangeListener l) { + pcs.addPropertyChangeListener(l); + } + + public void removeNode(long id) { + var node = findNodeByID(id); + if (node.isPresent()) { + var toBeRemoved = arrows.stream(). + filter(arrow -> Objects.equals(node.get().getIdentifier(), arrow.getPredecessor()) || Objects.equals(node.get().getIdentifier(), arrow.getSuccessor())).collect(Collectors.toList()); + arrows.removeAll(toBeRemoved); + nodes.remove(node.get()); + } + this.pcs.firePropertyChange("nodeRemoved", null, this); + } + + private Optional findNodeByID(long id) { + return nodes.stream().filter(n -> n.getIdentifier() == id).findAny(); + } + + private Optional findArrowByID(long id) { + return arrows.stream().filter(a -> a.getIdentifier() == id).findAny(); + } + + + public void removeNodeArrow(long id) { + var arrow = arrows.stream().filter(a -> a.getIdentifier() == id).findAny(); + if (arrow.isPresent()) { + arrows.remove(arrow.get()); + + for(var node : nodes){ + node.removeRelations(id); + } + + this.pcs.firePropertyChange("arrowRemoved", null, this); + } else { + System.err.printf("Arrow with id %s could not be removed%n", id); + } + } + + public void updateNodePosition(long identifier, double x, double y) { + var node = findNodeByID(identifier); + node.ifPresent(n -> { + n.setX(x); + n.setY(y); + }); + this.pcs.firePropertyChange("nodeUpdated", null, this); + } + + public void updateArrowPosition(long identifier, double originalStartOffsetPositionX, double originalStartOffsetPositionY, double originalEndOffsetPositionX, double originalEndOffsetPositionY) { + var arrow = findArrowByID(identifier); + arrow.ifPresent(a -> { + a.setOriginalStartOffsetPositionX(originalStartOffsetPositionX); + a.setOriginalStartOffsetPositionY(originalStartOffsetPositionY); + a.setOriginalEndOffsetPositionX(originalEndOffsetPositionX); + a.setOriginalEndOffsetPositionY(originalEndOffsetPositionY); + }); + this.pcs.firePropertyChange("arrowUpdated", null, this); + + } + + public void informObservers() { + this.pcs.firePropertyChange("modelUpdated", null, this); + } + + public List getArrows() { + return arrows; + } + + public List getNodes() { + return nodes; + } + + public void clearGraph() { + arrows.clear(); + nodes.clear(); + NodeModel.resetCounter(); + Arrow.resetCounter(); + } + + public String getJSON() { + var gson = new GsonBuilder() + .excludeFieldsWithoutExposeAnnotation().setPrettyPrinting() + .create(); + + return gson.toJson(this); + } + + public List getNeighboursArrowsOfNode(long identifier) { + return arrows.parallelStream().filter(n -> n.getPredecessor() == identifier || n.getSuccessor() == identifier). + map(Arrow::getIdentifier).collect(Collectors.toCollection(LinkedList::new)); + } + + public List getNeighbourNodesOfNode(long identifier) { + return arrows.parallelStream(). + filter(n -> n.getPredecessor() == identifier).map(Arrow::getSuccessor).collect(Collectors.toCollection(ArrayList::new)); + } + + public List getNodeIDs() { + return nodes.parallelStream().map(NodeModel::getIdentifier).collect(Collectors.toCollection(ArrayList::new)); + } + + + public List getArrowIDs() { + return arrows.stream().map(Arrow::getIdentifier).collect(Collectors.toCollection(ArrayList::new)); + } +} diff --git a/src/main/java/gui/model/IntegerInput.java b/src/main/java/gui/model/IntegerInput.java new file mode 100644 index 0000000..0750da3 --- /dev/null +++ b/src/main/java/gui/model/IntegerInput.java @@ -0,0 +1,38 @@ +package gui.model; + +import com.google.gson.annotations.Expose; + +public class IntegerInput { + @Expose + private final String key; + @Expose + private final String minValue; + @Expose + private final String maxValue; + + public IntegerInput(String key, String minValue, String maxValue) { + this.key = key; + this.minValue = minValue; + this.maxValue = maxValue; + } + + public String getKey() { + return key; + } + + public String getMinValue() { + return minValue; + } + + public String getMaxValue() { + return maxValue; + } + + @Override + public String toString() { + return + "key=" + key + + ", minValue=" + minValue + + ", maxValue=" + maxValue; + } +} diff --git a/src/main/java/gui/model/NodeModel.java b/src/main/java/gui/model/NodeModel.java new file mode 100644 index 0000000..f29ecc2 --- /dev/null +++ b/src/main/java/gui/model/NodeModel.java @@ -0,0 +1,126 @@ +package gui.model; + +import com.google.gson.annotations.Expose; + +import java.util.List; + +public class NodeModel { + + @Expose + private long identifier; + @Expose + private List sourceList; + @Expose + private String nameOfNode = ""; + @Expose + private NodeType type = NodeType.STANDARD_NODE; + @Expose + private double x; + @Expose + private double y; + @Expose + private FunctionInputFormat inputFormats; + private static long idCounter = 0; + + public NodeModel() { + identifier = idCounter; + idCounter++; + } + + + public List getSourceList() { + return sourceList; + } + + public void setSourceList(List sourceList) { + for (var entry : sourceList) { + boolean defNotSet = (entry.getDefContainer() == null || entry.getDefContainer().isBlank()); + boolean defRelationsNotSet = entry.getRelationsInfluencedByDef() == null || entry.getRelationsInfluencedByDef().isEmpty(); + + boolean useNotSet = entry.getUse() == null || entry.getUse().isBlank(); + boolean useRelationsNotSet = entry.getRelationsInfluencingUse() == null || entry.getRelationsInfluencingUse().isEmpty(); + + if (defNotSet || defRelationsNotSet) { + entry.setDefContainer(null); + entry.setRelationsInfluencedByDef(null); + } + if (useNotSet || useRelationsNotSet) { + entry.setUse(null); + entry.setRelationsInfluencingUse(null); + } + boolean nodesNotSet = entry.getNodesCoveredByStatement() == null || entry.getNodesCoveredByStatement().isEmpty(); + if (nodesNotSet) { + entry.setNodesCoveredByStatement(null); + } + boolean relationsNotSet = entry.getRelationsCoveredByStatement() == null || entry.getRelationsCoveredByStatement().isEmpty(); + if (relationsNotSet) { + entry.setRelationsCoveredByStatement(null); + } + } + this.sourceList = sourceList; + } + + public String getNameOfNode() { + return nameOfNode; + } + + public void setNameOfNode(String nameOfNode) { + this.nameOfNode = nameOfNode; + } + + public NodeType getType() { + return type; + } + + public void setType(NodeType type) { + this.type = type; + } + + public double getX() { + return x; + } + + public void setX(double x) { + this.x = x; + } + + public double getY() { + return y; + } + + public void setY(double y) { + this.y = y; + } + + public long getIdentifier() { + return identifier; + } + + + public void setIdentifier(long identifier) { + if (identifier + 1 >= idCounter) { + idCounter = identifier + 1; + } else { + idCounter--; + } + this.identifier = identifier; + } + + public static void resetCounter() { + idCounter = 0; + } + + public void setInputFormats(FunctionInputFormat inputFormats) { + this.inputFormats = inputFormats; + } + + public FunctionInputFormat getInputFormats() { + return inputFormats; + } + + public void removeRelations(long arrowID) { + if (sourceList != null) { + sourceList.forEach(n -> n.removeRelationsInContextWithDefOrUseOrStatement(arrowID)); + } + } +} diff --git a/src/main/java/gui/model/NodeType.java b/src/main/java/gui/model/NodeType.java new file mode 100644 index 0000000..e6f4393 --- /dev/null +++ b/src/main/java/gui/model/NodeType.java @@ -0,0 +1,15 @@ +package gui.model; + +public enum NodeType { + STANDARD_NODE("Standard Node"), FUNCTION("Function"), DATA_STORAGE("Data Storage"); + private final String label; + + NodeType(String label) { + this.label = label; + } + + @Override + public String toString() { + return label; + } +} diff --git a/src/main/java/gui/model/SourceCode.java b/src/main/java/gui/model/SourceCode.java new file mode 100644 index 0000000..a3bebbd --- /dev/null +++ b/src/main/java/gui/model/SourceCode.java @@ -0,0 +1,47 @@ +package gui.model; + +import com.google.gson.GsonBuilder; +import com.google.gson.annotations.Expose; + +import java.util.List; + +public class SourceCode { + @Expose + private List sourceCode; + + @Expose + private Long idOfNode; + + public SourceCode(List sourceCode, Long idOfNode) { + this.sourceCode = sourceCode; + this.idOfNode = idOfNode; + } + + public List getSourceCode() { + return sourceCode; + } + + public String getJSON() { + var gson = new GsonBuilder() + .excludeFieldsWithoutExposeAnnotation().setPrettyPrinting() + .create(); + return gson.toJson(this, SourceCode.class); + } + public static SourceCode getSourceCodeObject(String sourceJSON) { + var gson = new GsonBuilder().excludeFieldsWithoutExposeAnnotation().create(); + return gson.fromJson(sourceJSON, SourceCode.class); + } + + + public void setSourceCode(List sourceCode) { + this.sourceCode = sourceCode; + } + + public Long getIdOfNode() { + return idOfNode; + } + + public void setIdOfNode(Long idOfNode) { + this.idOfNode = idOfNode; + } +} diff --git a/src/main/java/gui/model/SourceCodeLine.java b/src/main/java/gui/model/SourceCodeLine.java new file mode 100644 index 0000000..d3b7807 --- /dev/null +++ b/src/main/java/gui/model/SourceCodeLine.java @@ -0,0 +1,128 @@ +package gui.model; + +import com.google.gson.annotations.Expose; + +import java.util.List; + +public class SourceCodeLine { + @Expose + private String sourceLine; + @Expose + private String defContainer; + @Expose + private List relationsInfluencedByDef; + @Expose + private String use; + @Expose + private List relationsInfluencingUse; + @Expose + private List nodesCoveredByStatement; + @Expose + private List relationsCoveredByStatement; + @Expose + Long lineNumber; + @Expose + private String replaceLine; + + public String getSourceLine() { + return sourceLine; + } + + public void setSourceLine(String sourceLine) { + this.sourceLine = sourceLine; + } + + + public String getUse() { + return use; + } + + public void setUse(String use) { + this.use = use; + } + + + @Override + public String toString() { + return + "''" + sourceLine + "''" + + ", def tracker='" + defContainer + '\'' + + ", relations Influenced by" + "Def=" + relationsInfluencedByDef + + ", use='" + use + '\'' + + ", relations Influencing Use=" + relationsInfluencingUse + + ", nodes Called by Statement=" + nodesCoveredByStatement + + ", relations Called by Statement=" + relationsCoveredByStatement + + ", lineNumber=" + lineNumber; + } + + + public void setRelationsInfluencedByDef(List relationsInfluencedByDef) { + this.relationsInfluencedByDef = relationsInfluencedByDef; + } + + + public void setRelationsInfluencingUse(List relationsInfluencingUse) { + this.relationsInfluencingUse = relationsInfluencingUse; + } + + public void setNodesCoveredByStatement(List nodesCoveredByStatement) { + this.nodesCoveredByStatement = nodesCoveredByStatement; + } + + public void setRelationsCoveredByStatement(List relationsCoveredByStatement) { + this.relationsCoveredByStatement = relationsCoveredByStatement; + } + + public void removeRelationsInContextWithDefOrUseOrStatement(Long id) { + if (relationsInfluencedByDef != null) { + this.relationsInfluencedByDef.remove(id); + } + if (relationsInfluencingUse != null) { + this.relationsInfluencingUse.remove(id); + } + if (relationsCoveredByStatement != null) { + this.relationsCoveredByStatement.remove(id); + } + } + + public List getRelationsInfluencedByDef() { + return relationsInfluencedByDef; + } + + public List getRelationsInfluencingUse() { + return relationsInfluencingUse; + } + + public Long getLineNumber() { + return lineNumber; + } + + public void setLineNumber(Long lineNumber) { + this.lineNumber = lineNumber; + } + + public List getNodesCoveredByStatement() { + return nodesCoveredByStatement; + } + + public List getRelationsCoveredByStatement() { + return relationsCoveredByStatement; + } + + + public void setDefContainer(String jsonKey) { + this.defContainer = jsonKey; + } + + public String getDefContainer() { + return defContainer; + } + + public String getReplaceLine() { + return replaceLine; + } + + public void setReplaceLine(String replaceLine) { + this.replaceLine = replaceLine; + } +} diff --git a/src/main/java/gui/model/StringInput.java b/src/main/java/gui/model/StringInput.java new file mode 100644 index 0000000..f557cd2 --- /dev/null +++ b/src/main/java/gui/model/StringInput.java @@ -0,0 +1,30 @@ +package gui.model; + +import com.google.gson.annotations.Expose; + +public class StringInput { + @Expose + private final String key; + @Expose + private final String jsonValue; + + public StringInput(String key, String jsonValue) { + this.key = key; + this.jsonValue = jsonValue; + } + + public String getKey() { + return key; + } + + public String getJsonValue() { + return jsonValue; + } + + @Override + public String toString() { + return + "key=" + key + ", regex=" + jsonValue; + } + +} diff --git a/src/main/java/gui/view/ArrowCreatorView.java b/src/main/java/gui/view/ArrowCreatorView.java new file mode 100644 index 0000000..7f7071a --- /dev/null +++ b/src/main/java/gui/view/ArrowCreatorView.java @@ -0,0 +1,142 @@ +package gui.view; + +import gui.controller.ArrowCreatorController; +import gui.controller.dto.ArrowInputData; +import gui.model.AccessMode; +import gui.model.Graph; +import gui.model.NodeModel; +import gui.model.NodeType; +import javafx.beans.value.ChangeListener; +import javafx.event.ActionEvent; +import javafx.event.EventHandler; +import javafx.scene.Scene; +import javafx.scene.control.Button; +import javafx.scene.control.ComboBox; +import javafx.scene.control.Label; +import javafx.scene.layout.GridPane; +import javafx.stage.Stage; + +public class ArrowCreatorView extends Stage{ + + private final ArrowCreatorController controller; + private final ComboBox comboBoxSuccessor = new ComboBox<>(); + private final ComboBox comboBoxPredecessor = new ComboBox<>(); + private final ComboBox comboboxAccess = new ComboBox<>(); + + public ArrowCreatorView(ArrowCreatorController controller, Graph model) { + this.controller = controller; + this.setTitle("Edit Arrow"); + var grid = getGridPane(model); + + var scene = new Scene(grid); + this.setScene(scene); + } + + private GridPane getGridPane(Graph model) { + var accessText = new Label("Access mode: "); + accessText.setVisible(false); + setupComboboxes(model, accessText); + var grid = new GridPane(); + var createButton = new Button("Add arrow"); + createButton.setOnAction(getCreateButtonHandler()); + var cancelButton = new Button("Cancel"); + cancelButton.setOnAction(getCancelButtonHandler()); + var predecessorText = new Label("Name of predecessor node: "); + var successorText = new Label("Name of successor node: "); + grid.add(predecessorText, 1, 1); + grid.add(comboBoxPredecessor, 2, 1); + grid.add(successorText, 1, 2); + grid.add(comboBoxSuccessor, 2, 2); + grid.add(accessText, 1, 3); + grid.add(comboboxAccess, 2, 3); + grid.add(createButton, 1, 5); + grid.add(cancelButton, 2, 5); + return grid; + } + + private void setupComboboxes(Graph model, Label accessText) { + for (var node : model.getNodes()) { + comboBoxSuccessor.getItems().add(new NodeWrapper(node, node.getNameOfNode())); + comboBoxPredecessor.getItems().add(new NodeWrapper(node, node.getNameOfNode())); + } + + ChangeListener showAndHideAccessMode = (observable, oldValue, newValue) -> { + + if (comboBoxPredecessor.getValue() == null || comboBoxSuccessor.getValue() == null) { + return; + } + NodeWrapper pre = comboBoxPredecessor.getValue(); + NodeWrapper suc = comboBoxSuccessor.getValue(); + + if (isDBCall(pre.node, suc.node)) { + accessText.setVisible(true); + comboboxAccess.getItems().setAll(AccessMode.READ, AccessMode.WRITE, AccessMode.DELETE); + comboboxAccess.setVisible(true); + } else if (isFunctionCall(pre.node, suc.node)) { + accessText.setVisible(true); + comboboxAccess.getItems().setAll(AccessMode.FUNCTIONCALL, AccessMode.RETURN); + comboboxAccess.setVisible(true); + } else { + accessText.setVisible(false); + comboboxAccess.getItems().clear(); + comboboxAccess.setVisible(false); + } + }; + + + comboBoxSuccessor.valueProperty().addListener(showAndHideAccessMode); + comboBoxPredecessor.valueProperty().addListener(showAndHideAccessMode); + + comboboxAccess.setVisible(false); + } + + private boolean isDBCall(NodeModel pre, NodeModel suc) { + return pre.getType().equals(NodeType.FUNCTION) && suc.getType().equals(NodeType.DATA_STORAGE); + } + + private boolean isFunctionCall(NodeModel pre, NodeModel suc) { + return pre.getType().equals(NodeType.FUNCTION) && suc.getType().equals(NodeType.FUNCTION); + } + + private EventHandler getCancelButtonHandler() { + return event -> controller.closeWindow(); + } + + private EventHandler getCreateButtonHandler() { + return event -> { + if (comboBoxPredecessor.getSelectionModel().isEmpty() || comboBoxSuccessor.getSelectionModel().isEmpty()) { + System.err.println("No value in combobox selected"); + } else { + var successorNode = comboBoxSuccessor.getValue().node; + var predecessorNode = comboBoxPredecessor.getValue().node; + var infos = new ArrowInputData(); + infos.setSuccessor(successorNode.getIdentifier()); + infos.setPredecessor(predecessorNode.getIdentifier()); + if (isDBCall(predecessorNode, successorNode) || isFunctionCall(predecessorNode, successorNode)) { + infos.setAccessMode(comboboxAccess.getValue()); + } + controller.addArrowToGraph(infos); + this.close(); + } + + }; + } + + static class NodeWrapper { + public NodeWrapper(NodeModel node, String name) { + this.node = node; + this.name = name; + } + + @Override + public String toString() { + return String.format("%s (id: %d)", name, node.getIdentifier()); + } + + final NodeModel node; + final String name; + } + + +} + diff --git a/src/main/java/gui/view/ArrowEditorView.java b/src/main/java/gui/view/ArrowEditorView.java new file mode 100644 index 0000000..cd1a410 --- /dev/null +++ b/src/main/java/gui/view/ArrowEditorView.java @@ -0,0 +1,170 @@ +package gui.view; + +import gui.controller.ArrowEditorController; +import gui.controller.dto.ArrowInputData; +import gui.model.AccessMode; +import gui.model.Graph; +import gui.model.NodeModel; +import gui.model.NodeType; +import gui.view.graphcomponents.DraggableArrow; +import javafx.beans.value.ChangeListener; +import javafx.event.ActionEvent; +import javafx.event.EventHandler; +import javafx.scene.Scene; +import javafx.scene.control.Button; +import javafx.scene.control.ComboBox; +import javafx.scene.control.Label; +import javafx.scene.layout.GridPane; +import javafx.stage.Stage; + +public class ArrowEditorView extends Stage { + + private final ArrowEditorController controller; + private final DraggableArrow arrow; + + private final ComboBox comboBoxSuccessor = new ComboBox<>(); + private final ComboBox comboBoxPredecessor = new ComboBox<>(); + private final ComboBox comboboxAccess = new ComboBox<>(); + + + public ArrowEditorView(ArrowEditorController arrowEditorController, DraggableArrow draggableArrow, Graph model) { + this.controller = arrowEditorController; + this.arrow = draggableArrow; + + this.setTitle("Create Arrow"); + var grid = getGridPane(model); + var scene = new Scene(grid); + this.setScene(scene); + } + + private GridPane getGridPane(Graph model) { + var accessText = new Label("Access mode: "); + setupComboboxes(model, accessText); + + + var grid = new GridPane(); + + var predecessorText = new Label("Name of predecessor node: "); + var successorText = new Label("Name of successor node: "); + + + grid.add(predecessorText, 1, 1); + grid.add(comboBoxPredecessor, 2, 1); + grid.add(successorText, 1, 2); + grid.add(comboBoxSuccessor, 2, 2); + grid.add(accessText, 1, 3); + grid.add(comboboxAccess, 2, 3); + + var updateButton = new Button("Update arrow"); + updateButton.setOnAction(getUpdateButtonHandler()); + var cancelButton = new Button("Cancel"); + cancelButton.setOnAction(getCancelButtonHandler()); + grid.add(updateButton, 1, 5); + grid.add(cancelButton, 2, 5); + return grid; + } + + private EventHandler getUpdateButtonHandler() { + return event -> { + var successorNode = comboBoxSuccessor.getValue().node; + var predecessorNode = comboBoxPredecessor.getValue().node; + var infos = + new ArrowInputData(); + infos.setSuccessor(successorNode.getIdentifier()); + infos.setPredecessor(predecessorNode.getIdentifier()); + infos.setId(arrow.getIdentifier()); + infos.setAccessMode(comboboxAccess.getValue()); + controller.updateArrowToGraph(infos); + }; + } + + private EventHandler getCancelButtonHandler() { + return event -> controller.closeWindow(); + } + + + private void setupComboboxes(Graph model, Label accessText) { + for (var node : model.getNodes()) { + var pre = new NodeWrapper(node, node.getNameOfNode()); + comboBoxSuccessor.getItems().add(pre); + var suc = new NodeWrapper(node, node.getNameOfNode()); + comboBoxPredecessor.getItems().add(suc); + if (arrow.getPredecessor().getIdentifier() == node.getIdentifier()) { + comboBoxPredecessor.getSelectionModel().select(pre); + } + if (arrow.getSuccessor().getIdentifier() == node.getIdentifier()) { + comboBoxSuccessor.getSelectionModel().select(suc); + } + } + + ChangeListener showAndHideAccessMode = (observable, oldValue, newValue) -> { + if (comboBoxPredecessor.getValue() == null || comboBoxSuccessor.getValue() == null) { + comboboxAccess.getItems().clear(); + accessText.setVisible(false); + comboboxAccess.setVisible(false); + return; + } + NodeWrapper pre = comboBoxPredecessor.getValue(); + NodeWrapper suc = comboBoxSuccessor.getValue(); + + if (isDBCall(pre.node, suc.node)) { + accessText.setVisible(true); + comboboxAccess.getItems().setAll(AccessMode.READ, AccessMode.WRITE, AccessMode.DELETE); + comboboxAccess.setVisible(true); + } else if (isFunctionCall(pre.node, suc.node)) { + accessText.setVisible(true); + comboboxAccess.getItems().setAll(AccessMode.FUNCTIONCALL, AccessMode.RETURN); + comboboxAccess.setVisible(true); + } else { + accessText.setVisible(false); + comboboxAccess.getItems().clear(); + comboboxAccess.setVisible(false); + } + }; + + + comboBoxSuccessor.valueProperty().addListener(showAndHideAccessMode); + comboBoxPredecessor.valueProperty().addListener(showAndHideAccessMode); + + if (isDBCall(comboBoxPredecessor.getValue().node, comboBoxSuccessor.getValue().node)) { + accessText.setVisible(true); + comboboxAccess.getItems().setAll(AccessMode.READ, AccessMode.WRITE, AccessMode.DELETE); + comboboxAccess.setValue(arrow.getAccessMode()); + comboboxAccess.setVisible(true); + } else if (isFunctionCall(comboBoxPredecessor.getValue().node, comboBoxSuccessor.getValue().node)) { + accessText.setVisible(true); + comboboxAccess.getItems().setAll(AccessMode.FUNCTIONCALL, AccessMode.RETURN); + comboboxAccess.setValue(arrow.getAccessMode()); + comboboxAccess.setVisible(true); + } else { + comboboxAccess.getItems().clear(); + accessText.setVisible(false); + comboboxAccess.setVisible(false); + } + } + + private boolean isDBCall(NodeModel pre, NodeModel suc) { + return pre.getType().equals(NodeType.FUNCTION) && suc.getType().equals(NodeType.DATA_STORAGE); + } + + + + private boolean isFunctionCall(NodeModel pre, NodeModel suc) { + return pre.getType().equals(NodeType.FUNCTION) && suc.getType().equals(NodeType.FUNCTION); + } + + static class NodeWrapper { + public NodeWrapper(NodeModel node, String name) { + this.node = node; + this.name = name; + } + + @Override + public String toString() { + return name; + } + + final NodeModel node; + final String name; + } +} diff --git a/src/main/java/gui/view/CoverageView.java b/src/main/java/gui/view/CoverageView.java new file mode 100644 index 0000000..617b9a0 --- /dev/null +++ b/src/main/java/gui/view/CoverageView.java @@ -0,0 +1,29 @@ +package gui.view; + +import javafx.scene.Scene; +import javafx.scene.control.TextArea; +import javafx.stage.Stage; + +public class CoverageView extends Stage { + private final TextArea textArea; + + public CoverageView(String title) { + this.setTitle(title); + textArea = new TextArea(); + Scene scene = new Scene(textArea); + this.setScene(scene); + } + + public CoverageView(String title, String text) { + this.setTitle(title); + textArea = new TextArea(); + Scene scene = new Scene(textArea); + this.setScene(scene); + textArea.setText(text); + } + + public void setText(String text) { + textArea.setText(text); + } + +} diff --git a/src/main/java/gui/view/FunctionInputFormatView.java b/src/main/java/gui/view/FunctionInputFormatView.java new file mode 100644 index 0000000..f7e0061 --- /dev/null +++ b/src/main/java/gui/view/FunctionInputFormatView.java @@ -0,0 +1,232 @@ +package gui.view; + +import gui.model.FunctionInputFormat; +import gui.model.IntegerInput; +import gui.model.StringInput; +import javafx.collections.FXCollections; +import javafx.collections.ObservableList; +import javafx.geometry.Insets; +import javafx.scene.Node; +import javafx.scene.Scene; +import javafx.scene.control.*; +import javafx.scene.control.cell.PropertyValueFactory; +import javafx.scene.layout.GridPane; +import javafx.scene.layout.HBox; +import javafx.scene.layout.VBox; +import javafx.stage.Modality; +import javafx.stage.Stage; + +import java.util.Arrays; + +public class FunctionInputFormatView extends Stage { + + private final FunctionInputFormat functionInputFormat; + private TableView tableViewInteger = new TableView<>(); + private TableView tableViewString = new TableView<>(); + private final TextArea textAreaJson = new TextArea(); + + public FunctionInputFormatView(FunctionInputFormat inputFormats) { + this.functionInputFormat = inputFormats; + this.initModality(Modality.APPLICATION_MODAL); + this.setTitle("Edit input format of node"); + refreshView(); + } + + private GridPane getGrid() { + + var grid = new GridPane(); + final VBox stringInputTable = getStringInputTable(); + grid.add(stringInputTable, 1, 1); + final VBox integerInputTable = getIntegerInputTable(); + grid.add(integerInputTable, 2, 1); + final VBox jsonInputTable = getTextArea(); + + grid.add(jsonInputTable, 3, 1); + + final Node controlButton = getControlButton(); + grid.add(controlButton, 2, 2); + + return grid; + } + + private HBox getControlButton() { + Button updateButton = new Button("Update input format"); + updateButton.setOnAction(e -> { + updateFunctionInputFormat(); + this.close(); + }); + + final HBox hbox = new HBox(); + hbox.getChildren().addAll(updateButton); + return hbox; + } + + private void updateFunctionInputFormat() { + this.functionInputFormat.setJSONInput(textAreaJson.getText()); + this.functionInputFormat.setStringInput(tableViewString.getItems()); + this.functionInputFormat.setIntegerInput(tableViewInteger.getItems()); + } + + private VBox getTextArea() { + textAreaJson.setText(functionInputFormat.getJSONInput()); + Label heading = new Label("Constant Json used"); + final VBox vbox = new VBox(); + vbox.setSpacing(5); + vbox.setPadding(new + Insets(10, 0, 0, 10)); + vbox.getChildren(). + addAll(heading, textAreaJson); + return vbox; + } + + private VBox getStringInputTable() { + tableViewString = new TableView<>(); + tableViewString.setEditable(true); + tableViewString.getSelectionModel(). + setSelectionMode(SelectionMode.MULTIPLE); + + TableColumn keyCol = new TableColumn<>("Key"); + TableColumn regexCol = new TableColumn<>("Regex of value"); + tableViewString.getColumns().addAll(Arrays.asList(keyCol, regexCol)); + final ObservableList dataStringInput = FXCollections.observableArrayList( + functionInputFormat.getStringInput() + ); + + keyCol.setCellValueFactory( + new PropertyValueFactory<>("key") + ); + regexCol.setCellValueFactory( + new PropertyValueFactory<>("jsonValue") + ); + tableViewString.setItems(dataStringInput); + + + final TextField addStringInputKey = new TextField(); + addStringInputKey.setPromptText("Key"); + addStringInputKey.setMaxWidth(keyCol.getPrefWidth()); + final TextField addStringInputJSON = new TextField(); + addStringInputJSON.setMaxWidth(regexCol.getPrefWidth()); + addStringInputJSON.setPromptText("regex, e.g. \".*\" for any String"); + final Button addButton = new Button("Add"); + + addButton.setOnAction(e -> { + var newStringInputValue = new StringInput( + addStringInputKey.getText(), + addStringInputJSON.getText()); + functionInputFormat.addStringInputValue(newStringInputValue); + refreshView(); + }); + final Button deleteButton = new Button("Delete"); + deleteButton.setOnAction(e -> + deleteStringInputEntries()); + final HBox hb = new HBox(); + hb.getChildren(). + addAll(addStringInputKey, addStringInputJSON, addButton, deleteButton); + hb.setSpacing(3); + Label heading = new Label("String input values as regex"); + final VBox vbox = new VBox(); + vbox.setSpacing(5); + vbox.setPadding(new + Insets(10, 0, 0, 10)); + vbox.getChildren(). + addAll(heading, tableViewString, hb); + return vbox; + } + + private VBox getIntegerInputTable() { + tableViewInteger = new TableView<>(); + tableViewInteger.setEditable(true); + tableViewInteger.getSelectionModel(). + setSelectionMode(SelectionMode.MULTIPLE); + + TableColumn keyCol = new TableColumn<>("Key"); + TableColumn minValueCol = new TableColumn<>("Min Value of Integer"); + TableColumn maxValueCol = new TableColumn<>("Max Value of Integer"); + tableViewInteger.getColumns().addAll(Arrays.asList(keyCol, minValueCol, maxValueCol)); + + final ObservableList dataIntegerInput = FXCollections.observableArrayList( + functionInputFormat.getIntegerInput() + ); + + keyCol.setCellValueFactory( + new PropertyValueFactory<>("key") + ); + minValueCol.setCellValueFactory( + new PropertyValueFactory<>("minValue") + ); + maxValueCol.setCellValueFactory( + new PropertyValueFactory<>("maxValue") + ); + tableViewInteger.setItems(dataIntegerInput); + + + final TextField inputKeyField = new TextField(); + inputKeyField.setPromptText("Key"); + inputKeyField.setMaxWidth(keyCol.getPrefWidth()); + + final TextField addMinValueField = new TextField(); + addMinValueField.setMaxWidth(minValueCol.getPrefWidth()); + addMinValueField.setPromptText("min value"); + + final TextField addMaxValueField = new TextField(); + addMaxValueField.setMaxWidth(maxValueCol.getPrefWidth()); + addMaxValueField.setPromptText("max value"); + + final Button addButton = new Button("Add"); + addButton.setOnAction(e -> { + IntegerInput integerInputValue = new IntegerInput(inputKeyField.getText(), addMinValueField.getText(), addMaxValueField.getText()); + functionInputFormat.addIntegerInputValue(integerInputValue); + refreshView(); + }); + + + final Button deleteButton = new Button("Delete"); + deleteButton.setOnAction(e -> + deleteInputInputEntries()); + final HBox hb = new HBox(); + hb.getChildren(). + addAll(inputKeyField, addMinValueField, addMaxValueField, addButton, deleteButton); + hb.setSpacing(3); + Label heading = new Label("Integer input"); + final VBox vbox = new VBox(); + vbox.setSpacing(5); + vbox.setPadding(new + Insets(10, 0, 0, 10)); + vbox.getChildren(). + addAll(heading, tableViewInteger, hb); + return vbox; + } + + + private void deleteStringInputEntries() { + var items = tableViewString.getSelectionModel().getSelectedItems(); + for (var item : items) { + functionInputFormat.delete(item); + } + refreshView(); + } + + private void deleteInputInputEntries() { + var items = tableViewInteger.getSelectionModel().getSelectedItems(); + for (var item : items) { + functionInputFormat.delete(item); + } + refreshView(); + } + + + private void refreshView() { + var grid = getGrid(); + var scene = new Scene(grid); + this.setScene(scene); + } + + + +} + + + + + + diff --git a/src/main/java/gui/view/GraphVisualisationView.java b/src/main/java/gui/view/GraphVisualisationView.java new file mode 100644 index 0000000..78b5950 --- /dev/null +++ b/src/main/java/gui/view/GraphVisualisationView.java @@ -0,0 +1,253 @@ +package gui.view; + +import gui.controller.GraphVisualisationController; +import gui.model.Arrow; +import gui.model.Graph; +import gui.model.NodeModel; +import gui.view.graphcomponents.DraggableArrow; +import gui.view.graphcomponents.DraggableNode; +import javafx.event.ActionEvent; +import javafx.event.EventHandler; +import javafx.scene.Group; +import javafx.scene.Scene; +import javafx.scene.control.*; +import javafx.scene.input.ContextMenuEvent; +import javafx.scene.layout.BorderPane; +import javafx.scene.paint.Color; +import javafx.scene.shape.Line; +import javafx.scene.text.Text; +import javafx.stage.FileChooser; +import javafx.stage.Stage; + +import java.beans.PropertyChangeEvent; +import java.beans.PropertyChangeListener; +import java.io.File; +import java.util.ArrayList; +import java.util.List; +import java.util.Optional; + +public class GraphVisualisationView extends Stage implements PropertyChangeListener { + + private static final int HEIGHT = 900; + private static final int WIDTH = 1400; + private GraphVisualisationController controller; + + + private Graph model; + + + private List nodes = new ArrayList<>(); + private List arrows = new ArrayList<>(); + + + public GraphVisualisationView(Graph model) { + this.setTitle("Graph model"); + this.model = model; + model.addPropertyChangeListener(this); + } + + + public void setup(GraphVisualisationController controller) { + this.controller = controller; + } + + + public void updateAndshow() { + ScrollPane visualizedGraph = createGraphDisplay(); + var borderPane = createBorderPane(visualizedGraph); + + var scene = new Scene(borderPane, WIDTH, HEIGHT); + scene.setFill(Color.GHOSTWHITE); + + this.setScene(scene); + this.show(); + } + + private EventHandler createEventHandlerCreateNode(double x, double y) { + return event -> controller.createNode(x, y); + } + + private EventHandler createEventHandlerCreateArrow() { + return event -> controller.createArrow(); + } + + private EventHandler createEventHandlerCreateStaticTestCases() { + return event -> controller.createStaticTestCases(); + } + + private BorderPane createBorderPane(ScrollPane visualizedGraph) { + var borderPane = new BorderPane(); + var menuBar = createMenuBar(); + borderPane.setTop(menuBar); + borderPane.setCenter(visualizedGraph); + return borderPane; + } + + + private MenuBar createMenuBar() { + var menuBar = new MenuBar(); + var file = new Menu("File"); + + var saveGraphItem = new MenuItem("Save Graph"); + var closeItem = new MenuItem("Close"); + var analyzeLogFile = new MenuItem("Analyze Log File"); + var openNewGraphItem = new MenuItem("Open Graph"); + closeItem.setOnAction(event -> controller.closeWindow()); + + saveGraphItem.setOnAction(event -> controller.saveGraph(nodes, arrows)); + analyzeLogFile.setOnAction(getActionEventEventHandlerForLogEvaluation()); + openNewGraphItem.setOnAction(event -> controller.openGraph()); + file.getItems().addAll(saveGraphItem, openNewGraphItem, analyzeLogFile, closeItem); + menuBar.getMenus().addAll(file); + return menuBar; + } + + private EventHandler getActionEventEventHandlerForLogEvaluation() { + return event -> { + var logFile = getLogFile(); + if (logFile.isPresent()) { + controller.analyzeLogFile(logFile.get()); + } + }; + } + + + private Optional getLogFile() { + var fileChooser = new FileChooser(); + var extFilter = new FileChooser.ExtensionFilter("Text files (*.txt)", "*.txt"); + fileChooser.getExtensionFilters().add(extFilter); + fileChooser.setInitialDirectory(new File(System.getProperty("user.home"))); + var file = fileChooser.showOpenDialog(this); + return Optional.ofNullable(file); + } + + private ScrollPane createGraphDisplay() { + var group = new Group(); + createTitle(group); + List nodesModels = model.getNodes(); + List arrows = model.getArrows(); + + List nodeViews = createNodeViews(nodesModels); + List arrowViews = createArrowViews(arrows); + + group.getChildren().addAll(nodeViews); + group.getChildren().addAll(arrowViews); + + var visualizedGraph = new ScrollPane(group); + visualizedGraph.setOnContextMenuRequested(contextMenuClicked()); + return visualizedGraph; + } + + private List createArrowViews(List arrowModels) { + List arrows = new ArrayList<>(); + for (var arrowModel : arrowModels) { + Optional predecessor = getNodeByID(arrowModel.getPredecessor()); + Optional successor = getNodeByID(arrowModel.getSuccessor()); + if (successor.isPresent() && predecessor.isPresent()) { + var line = new Line(); + var arrow1 = new Line(); + var arrow2 = new Line(); + var arrow = new DraggableArrow(predecessor.get(), successor.get(), line, arrow1, arrow2); + arrow.setupArrow(controller); + arrow.setOriginalEndOffsetPositionX(arrowModel.getOriginalEndOffsetPositionX()); + arrow.setOriginalEndOffsetPositionY(arrowModel.getOriginalEndOffsetPositionY()); + arrow.setOriginalStartOffsetPositionX(arrowModel.getOriginalStartOffsetPositionX()); + arrow.setOriginalStartOffsetPositionY(arrowModel.getOriginalStartOffsetPositionY()); + arrow.setAccessMode(arrowModel.getAccessMode()); + arrow.setIdentifier(arrowModel.getIdentifier()); + arrow.updatePosition(); + arrows.add(arrow); + } + } + this.arrows = arrows; + return arrows; + } + + private Optional getNodeByID(long identifier) { + DraggableNode resultNode = null; + for (var node : nodes) { + if (node.getIdentifier() == identifier) { + resultNode = node; + break; + } + } + return Optional.ofNullable(resultNode); + } + + private List createNodeViews(List nodesModels) { + List nodes = new ArrayList<>(); + for (var nodeModel : nodesModels) { + String name = nodeModel.getNameOfNode(); + double x = nodeModel.getX(); + double y = nodeModel.getY(); + var node = new DraggableNode(name); + node.setupDraggableNode(controller, x, y); + node.setType(nodeModel.getType()); + node.setIdentifier(nodeModel.getIdentifier()); + node.setSourceList(nodeModel.getSourceList()); + node.setInputFormats(nodeModel.getInputFormats()); + nodes.add(node); + } + this.nodes = nodes; + return nodes; + } + + + private EventHandler contextMenuClicked() { + return event -> { + var contextMenu = new ContextMenu(); + var createNodeItem = new MenuItem("Create Node"); + createNodeItem.setOnAction(createEventHandlerCreateNode(event.getX(), event.getY())); + + var createArrowItem = new MenuItem("Create DraggableArrow"); + createArrowItem.setOnAction(createEventHandlerCreateArrow()); + + + var createStaticTestCasesItem = new MenuItem("Create static template for test cases"); + createStaticTestCasesItem.setOnAction(createEventHandlerCreateStaticTestCases()); + + contextMenu.getItems().addAll(createNodeItem, createArrowItem, createStaticTestCasesItem); + contextMenu.show(this, event.getScreenX(), event.getScreenY()); + }; + } + + private void createTitle(Group group) { + var title = new Text(""); + var titleGroup = new Group(); + titleGroup.setLayoutX(0); + titleGroup.setLayoutY(0); + group.getChildren().add(title); + } + + public void closeWindow() { + this.close(); + } + + + public void updateAndShow() { + var visualizedGraph = createGraphDisplay(); + var menuBar = createMenuBar(); + var borderPane = new BorderPane(); + borderPane.setTop(menuBar); + borderPane.setCenter(visualizedGraph); + + var scene = new Scene(borderPane, WIDTH, HEIGHT); + scene.setFill(Color.GHOSTWHITE); + + this.setScene(scene); + this.show(); + } + + public void setModel(Graph model) { + this.model = model; + this.updateAndShow(); + } + + + @Override + public void propertyChange(PropertyChangeEvent evt) { + updateAndShow(); + } + + +} diff --git a/src/main/java/gui/view/MainApp.java b/src/main/java/gui/view/MainApp.java new file mode 100644 index 0000000..be82f9d --- /dev/null +++ b/src/main/java/gui/view/MainApp.java @@ -0,0 +1,46 @@ +package gui.view; + +import gui.controller.GraphVisualisationController; +import gui.model.Graph; +import javafx.application.Application; +import javafx.stage.Stage; +import logic.util.logger.MyLogger; + +import java.io.IOException; + +public class MainApp extends Application { + + + /** + * The main() method is ignored in correctly deployed JavaFX application. main() + * serves only as fallback in case the application can not be launched through + * deployment artifacts, e.g., in IDEs with limited FX support. NetBeans ignores + * main(). + * + * @param args the command line arguments + */ + public static void main(String[] args) { + try { + MyLogger.setup(); + } catch (IOException e) { + e.printStackTrace(); + throw new RuntimeException("Problems with creating the log files"); + } + launch(args); + } + + @Override + public void start(Stage primaryStage) { + createMainWindow(); + + } + + private void createMainWindow() { + + var model = new Graph(); + var controller = new GraphVisualisationController(model); + controller.setup(); + controller.show(); + + } +} diff --git a/src/main/java/gui/view/NodeCreatorView.java b/src/main/java/gui/view/NodeCreatorView.java new file mode 100644 index 0000000..69377b0 --- /dev/null +++ b/src/main/java/gui/view/NodeCreatorView.java @@ -0,0 +1,279 @@ +package gui.view; + +import gui.controller.NodeCreatorController; +import gui.controller.dto.NodeInputData; +import gui.model.FunctionInputFormat; +import gui.model.NodeType; +import gui.model.SourceCodeLine; +import gui.view.wrapper.SourceEntryWrapper; +import javafx.collections.FXCollections; +import javafx.collections.ObservableList; +import javafx.event.ActionEvent; +import javafx.event.EventHandler; +import javafx.scene.Scene; +import javafx.scene.control.*; +import javafx.scene.control.cell.PropertyValueFactory; +import javafx.scene.control.cell.TextFieldTableCell; +import javafx.scene.layout.GridPane; +import javafx.stage.FileChooser; +import javafx.stage.Stage; + +import java.io.File; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.LinkedList; +import java.util.List; +import java.util.stream.Collectors; + +public class NodeCreatorView extends Stage { + + private final NodeCreatorController controller; + + private final TextArea nodeNameArea = new TextArea(); + private final TextArea xArea = new TextArea(); + private final TextArea yArea = new TextArea(); + private final ComboBox nodeTypeCombobox; + private final TableView tableView = new TableView<>(); + private final TextArea inputVariablesField = new TextArea(); + private FunctionInputFormat functionInputFormat; + + public NodeCreatorView(NodeCreatorController controller, double x, double y) { + this.controller = controller; + inputVariablesField.setEditable(false); + + tableView.setMinWidth(1000); + this.setTitle("Create Node"); + + ObservableList options = + FXCollections.observableArrayList( + NodeType.values() + ); + nodeTypeCombobox = new ComboBox<>(options); + nodeTypeCombobox.getSelectionModel().selectFirst(); + linkViewsForCombobox(x, y); + + + var grid = getStandardNode(x, y); + var scene = new Scene(grid); + this.setScene(scene); + } + + private void linkViewsForCombobox(double x, double y) { + nodeTypeCombobox.valueProperty().addListener((ov, t, typeOfEnum) -> { + switch (typeOfEnum) { + case FUNCTION: { + var grid = getFunctionGrid(x, y); + var scene = new Scene(grid); + this.setScene(scene); + break; + } + case DATA_STORAGE: { + var grid = getDataStorageGrid(x, y); + var scene = new Scene(grid); + this.setScene(scene); + break; + } + case STANDARD_NODE: { + var grid = getStandardNode(x, y); + var scene = new Scene(grid); + this.setScene(scene); + break; + } + default: + + + } + }); + } + + private GridPane getStandardNode(double x, double y) { + var typeOfNode = new Label("Type of node: "); + var nameOfNode = new Label("Name of Node"); + var xCoordinates = new Label("X coordinates:"); + var yCoordinates = new Label("Y coordinates:"); + xArea.setText(String.valueOf(x)); + xArea.setPrefRowCount(1); + yArea.setText(String.valueOf(y)); + yArea.setPrefRowCount(1); + nodeNameArea.setPrefRowCount(1); + var grid = new GridPane(); + grid.add(typeOfNode, 1, 1); + grid.add(nodeTypeCombobox, 2, 1); + grid.add(nameOfNode, 1, 2); + grid.add(nodeNameArea, 2, 2); + grid.add(xCoordinates, 1, 3); + grid.add(yCoordinates, 1, 4); + grid.add(xArea, 2, 3); + grid.add(yArea, 2, 4); + var createButton = new Button("Add node"); + createButton.setOnAction(getCreateButtonHandler()); + var cancelButton = new Button("Cancel"); + cancelButton.setOnAction(getCancelButtonHandler()); + + grid.add(createButton, 1, 6); + grid.add(cancelButton, 2, 6); + + return grid; + } + + private GridPane getDataStorageGrid(double x, double y) { + return getStandardNode(x, y); + } + + + private GridPane getFunctionGrid(double x, double y) { + functionInputFormat = new FunctionInputFormat(); + inputVariablesField.textProperty().bind(functionInputFormat.textProperty()); + var typeOfNode = new Label("Type of node: "); + var nameOfNode = new Label("Name of Node"); + var xCoordinates = new Label("X coordinates:"); + var yCoordinates = new Label("Y coordinates:"); + var sourceLabel = new Label("Source code:"); + var inputLabel = new Label("Input values:"); + var inputTooltip = new Tooltip(); + inputTooltip.setText("format of the values being processed by the function:\n" + + "event.body.myValue: string\n" + + "event.myValue: [1-9]\n" + + "event.myValue: [A-Z][0-9]*\n" + ); + inputLabel.setTooltip(inputTooltip); + xArea.setText(String.valueOf(x)); + xArea.setPrefRowCount(1); + yArea.setText(String.valueOf(y)); + yArea.setPrefRowCount(1); + nodeNameArea.setPrefRowCount(1); + var grid = new GridPane(); + grid.setMinSize(1000, 200); + grid.add(typeOfNode, 1, 1); + grid.add(nodeTypeCombobox, 2, 1); + grid.add(nameOfNode, 1, 2); + grid.add(nodeNameArea, 2, 2); + grid.add(xCoordinates, 1, 3); + grid.add(yCoordinates, 1, 4); + grid.add(xArea, 2, 3); + grid.add(yArea, 2, 4); + var createButton = new Button("Add node"); + createButton.setOnAction(getCreateButtonHandler()); + var cancelButton = new Button("Cancel"); + cancelButton.setOnAction(getCancelButtonHandler()); + var loadSourceButton = new Button("Use source file"); + loadSourceButton.setOnAction(e -> loadSourceCode()); + var editInputFormatButton = new Button("Edit input format"); + editInputFormatButton.setOnAction(e -> editFunctionInputFormat()); + + grid.add(sourceLabel, 1, 5); + grid.add(tableView, 2, 5); + + grid.add(loadSourceButton, 3, 5); + grid.add(inputLabel, 1, 6); + grid.add(inputVariablesField, 2, 6); + grid.add(editInputFormatButton, 3, 6); + grid.add(createButton, 1, 7); + grid.add(cancelButton, 2, 7); + return grid; + } + + private void loadSourceCode() { + + var fileChooser = new FileChooser(); + fileChooser.setInitialDirectory(new File(System.getProperty("user.home"))); + + var file = fileChooser.showOpenDialog(this); + controller.setSourceFile(file); + + } + + private void editFunctionInputFormat() { + FunctionInputFormatView view = new FunctionInputFormatView(functionInputFormat); + view.show(); + } + + + private EventHandler getCancelButtonHandler() { + return event -> controller.close(); + } + + private EventHandler getCreateButtonHandler() { + return event -> { + var infos = new NodeInputData(); + infos.setNodeType(nodeTypeCombobox.getValue()); + infos.setName(nodeNameArea.getText()); + List sourceList = new ArrayList<>(tableView.getItems()); + var sourceListUnwrapped = sourceList.stream().map(SourceEntryWrapper::getSourceEntry).collect(Collectors.toList()); + + infos.setSourceData(sourceListUnwrapped); + infos.setInputFormats(functionInputFormat); + try { + var x = Double.parseDouble(xArea.getText()); + var y = Double.parseDouble(yArea.getText()); + infos.setX(x); + infos.setY(y); + } catch + (NumberFormatException e) { + System.err.printf("Values x: %s and y: %s could not be parsed. Default value 100 for each is used.", xArea.getText(), yArea.getText()); + infos.setX(100); + infos.setY(100); + } + controller.addNodeToGraph(infos); + }; + } + + + public void setup() { + this.showAndWait(); + } + + public void setDataForTable(List tableItems) { + List tableItemsWrapped = new LinkedList<>(); + for (var item : tableItems) { + tableItemsWrapped.add(new SourceEntryWrapper(item)); + } + + TableColumn sourceCodeColumn = new TableColumn<>("Source code"); + PropertyValueFactory sourceCodeFactory = new PropertyValueFactory<>("sourceLine"); + sourceCodeColumn.setCellValueFactory(sourceCodeFactory); + + TableColumn defContainerColumn = new TableColumn<>("def tracking statement"); + PropertyValueFactory defContainerFactory = new PropertyValueFactory<>("defContainer"); + defContainerColumn.setCellValueFactory(defContainerFactory); + + TableColumn defInfluenceColumn = new TableColumn<>("relation influenced by def"); + PropertyValueFactory defInfluenceFactory = new PropertyValueFactory<>("relationsDefs"); + defInfluenceColumn.setCellValueFactory(defInfluenceFactory); + + TableColumn useColumn = new TableColumn<>("use"); + PropertyValueFactory useFactory = new PropertyValueFactory<>("use statement"); + useColumn.setCellValueFactory(useFactory); + + TableColumn useInfluenceColumn = new TableColumn<>("relation influencing use"); + PropertyValueFactory useInfluenceFactory = new PropertyValueFactory<>("relationsUses"); + useInfluenceColumn.setCellValueFactory(useInfluenceFactory); + + tableView.getColumns().clear(); + tableView.getColumns().addAll(Arrays.asList(sourceCodeColumn, defContainerColumn, defInfluenceColumn, useColumn, useInfluenceColumn)); + tableView.getColumns().forEach(column -> column.setSortable(false)); + + ObservableList tableData = FXCollections.observableList(tableItemsWrapped); + + tableView.setItems(tableData); + tableView.setEditable(true); + + defContainerColumn.setCellFactory(TextFieldTableCell.forTableColumn()); + defContainerColumn.setOnEditCommit(event -> { + event.getRowValue().setDefContainer(event.getNewValue()); + event.getRowValue().getDefWrapper().activateAllOnly(); + event.getRowValue().getDefWrapper().refreshText(); + }); + + + useColumn.setCellFactory(TextFieldTableCell.forTableColumn()); + useColumn.setOnEditCommit(event -> { + event.getRowValue().setUse(event.getNewValue()); + event.getRowValue().getUseWrapper().activateAllOnly(); + event.getRowValue().getUseWrapper().refreshText(); + }); + + } + + +} diff --git a/src/main/java/gui/view/NodeEditorView.java b/src/main/java/gui/view/NodeEditorView.java new file mode 100644 index 0000000..afd7f04 --- /dev/null +++ b/src/main/java/gui/view/NodeEditorView.java @@ -0,0 +1,323 @@ +package gui.view; + +import gui.controller.NodeEditorController; +import gui.controller.dto.NodeInputData; +import gui.model.FunctionInputFormat; +import gui.model.Graph; +import gui.model.NodeType; +import gui.model.SourceCodeLine; +import gui.view.graphcomponents.DraggableNode; +import gui.view.wrapper.SourceEntryWrapper; +import javafx.collections.FXCollections; +import javafx.collections.ObservableList; +import javafx.event.ActionEvent; +import javafx.event.EventHandler; +import javafx.scene.Scene; +import javafx.scene.control.*; +import javafx.scene.control.cell.PropertyValueFactory; +import javafx.scene.control.cell.TextFieldTableCell; +import javafx.scene.layout.GridPane; +import javafx.scene.layout.HBox; +import javafx.scene.layout.VBox; +import javafx.stage.FileChooser; +import javafx.stage.Stage; + +import java.io.File; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.LinkedList; +import java.util.List; +import java.util.stream.Collectors; + +public class NodeEditorView extends Stage { + + private final NodeEditorController controller; + + private final TextArea nodeNameArea = new TextArea(); + private final TextArea xArea = new TextArea(); + private final TextArea yArea = new TextArea(); + private final DraggableNode node; + private final TableView tableView = new TableView<>(); + private final TextArea inputVariablesField = new TextArea(); + private final Graph model; + private final FunctionInputFormat functionInputFormat; + private final CheckBox considerDeletesCheckbox = new CheckBox("consider deletes"); + + public NodeEditorView(NodeEditorController controller, DraggableNode draggableNode, Graph model) { + this.node = draggableNode; + this.controller = controller; + inputVariablesField.setEditable(false); + considerDeletesCheckbox.setSelected(false); + if (draggableNode.getInputFormats() != null) { + functionInputFormat = draggableNode.getInputFormats().getCopy(); + } else { + functionInputFormat = new FunctionInputFormat(); + } + + tableView.setMinWidth(1000); + this.model = model; + this.setTitle("Edit Node " + draggableNode.getIdentifier()); + GridPane grid = getGrid(); + var scene = new Scene(grid); + this.setScene(scene); + } + + private GridPane getGrid() { + NodeType typeOfEnum = node.getType(); + GridPane grid; + switch (typeOfEnum) { + case FUNCTION: { + grid = getFunctionGrid(node); + break; + } + case DATA_STORAGE: + grid = getDataStorageGrid(node); + break; + case STANDARD_NODE: + default: + grid = getStandardNodeGrid(node); + break; + + } + return grid; + + } + + private GridPane getStandardNodeGrid(DraggableNode node) { + var grid = new GridPane(); + var typeOfNode = new Label("Type of node: "); + var nodeTypeText = new Label(node.getType().toString()); + var nameOfNode = new Label("Name of Node"); + var xCoordinates = new Label("X coordinates:"); + var yCoordinates = new Label("Y coordinates:"); + inputVariablesField.textProperty().bind(functionInputFormat.textProperty()); + xArea.setText(String.valueOf(node.layoutXProperty().doubleValue())); + xArea.setPrefRowCount(1); + yArea.setText(String.valueOf(node.layoutYProperty().doubleValue())); + yArea.setPrefRowCount(1); + nodeNameArea.setPrefRowCount(1); + nodeNameArea.setText(node.getName()); + grid.add(typeOfNode, 1, 1); + grid.add(nodeTypeText, 2, 1); + grid.add(nameOfNode, 1, 2); + grid.add(nodeNameArea, 2, 2); + grid.add(xCoordinates, 1, 3); + grid.add(yCoordinates, 1, 4); + grid.add(xArea, 2, 3); + grid.add(yArea, 2, 4); + var updateButton = new Button("Update node"); + updateButton.setOnAction(getUpdateButtonHandler()); + var cancelButton = new Button("Cancel"); + cancelButton.setOnAction(getCancelButtonHandler()); + grid.add(updateButton, 1, 6); + grid.add(cancelButton, 2, 6); + return grid; + } + + private GridPane getDataStorageGrid(DraggableNode node) { + return getStandardNodeGrid(node); + } + + private GridPane getFunctionGrid(DraggableNode node) { + inputVariablesField.textProperty().bind(functionInputFormat.textProperty()); + var typeOfNode = new Label("Type of node: "); + var nodeTypeText = new Label(node.getType().toString()); + var nameOfNode = new Label("Name of Node"); + var xCoordinates = new Label("X coordinates:"); + var yCoordinates = new Label("Y coordinates:"); + var sourceLabel = new Label("Source code:"); + var inputLabel = new Label("Input values:"); + + xArea.setText(String.valueOf(node.layoutXProperty().doubleValue())); + xArea.setPrefRowCount(1); + yArea.setText(String.valueOf(node.layoutYProperty().doubleValue())); + yArea.setPrefRowCount(1); + nodeNameArea.setPrefRowCount(1); + nodeNameArea.setText(node.getName()); + var grid = new GridPane(); + grid.add(typeOfNode, 1, 1); + grid.add(nodeTypeText, 2, 1); + grid.add(nameOfNode, 1, 2); + grid.add(nodeNameArea, 2, 2); + grid.add(xCoordinates, 1, 3); + grid.add(yCoordinates, 1, 4); + grid.add(xArea, 2, 3); + grid.add(yArea, 2, 4); + var updateButton = new Button("Update node"); + updateButton.setOnAction(getUpdateButtonHandler()); + var cancelButton = new Button("Cancel"); + cancelButton.setOnAction(getCancelButtonHandler()); + var loadSourceButton = new Button("Use source file"); + loadSourceButton.setOnAction(e -> loadSourceCode()); + var editInputFormatButton = new Button("Edit input format"); + editInputFormatButton.setOnAction(e -> editFunctionInputFormat()); + var instrumentSourceButton = new Button("Instrument source code"); + var analyzeSourceButton = new Button("Analyze source code"); + + var analyzeBox = new HBox(analyzeSourceButton,considerDeletesCheckbox); + var containerForSourceButtons = new VBox(loadSourceButton, instrumentSourceButton, analyzeBox); + instrumentSourceButton.setOnAction(getSourceInstrumentationHandler()); + analyzeSourceButton.setOnAction(getAnalyzeHandler() + ); + grid.add(sourceLabel, 1, + 5); + setDataForTable(node.getSourceList()); + + grid.add(tableView, 2, 5); + grid.add(containerForSourceButtons, 3, 5); + + + grid.add(inputLabel, 1, 6); + grid.add(inputVariablesField, 2, 6); + grid.add(editInputFormatButton, 3, 6); + + grid.add(updateButton, 1, 7); + grid.add(cancelButton, 2, 7); + return grid; + } + + private void loadSourceCode() { + + var fileChooser = new FileChooser(); + fileChooser.setInitialDirectory(new File(System.getProperty("user.home"))); + + var file = fileChooser.showOpenDialog(this); + controller.setSourceFile(file); + + } + + private void editFunctionInputFormat() { + FunctionInputFormatView view = new FunctionInputFormatView(functionInputFormat); + view.show(); + } + + + private EventHandler getCancelButtonHandler() { + return event -> this.close(); + } + + private EventHandler getUpdateButtonHandler() { + return event -> { + var infos = new NodeInputData(); + infos.setNodeType(node.getType()); + infos.setName(nodeNameArea.getText()); + List sourceList = new ArrayList<>(tableView.getItems()); + var sourceListUnwrapped = sourceList.stream().map(SourceEntryWrapper::getSourceEntry).collect(Collectors.toList()); + infos.setSourceData(sourceListUnwrapped); + infos.setInputFormats(functionInputFormat); + + infos.setId(node.getIdentifier()); + try { + var x = Double.parseDouble(xArea.getText()); + var y = Double.parseDouble(yArea.getText()); + infos.setX(x); + infos.setY(y); + } catch + (NumberFormatException e) { + System.err.printf("Values x: %s and y: %s could not be parsed. Default value 100 for each is used.", xArea.getText(), yArea.getText()); + infos.setX(100); + infos.setY(100); + } + controller.updateNodeToGraph(infos); + this.close(); + }; + } + + private EventHandler getSourceInstrumentationHandler() { + return event -> { + List sourceList = new ArrayList<>(tableView.getItems()); + var sourceListUnwrapped = sourceList.stream().map(SourceEntryWrapper::getSourceEntry).collect(Collectors.toList()); + controller.instrumentSourceCode(sourceListUnwrapped, node.getIdentifier()); + }; + } + + private EventHandler getAnalyzeHandler() { + return event -> { + List sourceList = new ArrayList<>(tableView.getItems()); + var sourceListUnwrapped = sourceList.stream().map(SourceEntryWrapper::getSourceEntry).collect(Collectors.toList()); + controller.analyzeSource(sourceListUnwrapped, node.getIdentifier(), this, considerDeletesCheckbox.isSelected()); + }; + } + + public void setup() { + this.showAndWait(); + } + + public void setDataForTable(List tableItems) { + List tableItemsWrapped = new LinkedList<>(); + for (var item : tableItems) { + List neighbours = model.getNeighboursArrowsOfNode(node.getIdentifier()); + List nodes = model.getNeighbourNodesOfNode(node.getIdentifier()); + nodes.add(0, node.getIdentifier()); + for (var idEntry : model.getNodeIDs()) { + if (!nodes.contains(idEntry)) { + nodes.add(idEntry); + } + } + List arrows = model.getArrowIDs(); + tableItemsWrapped.add(new SourceEntryWrapper(item, neighbours, nodes, arrows)); + } + ObservableList tableData = FXCollections.observableList(tableItemsWrapped); + + TableColumn sourceCodeColumn = new TableColumn<>("Source code"); + PropertyValueFactory sourceCodeFactory = new PropertyValueFactory<>("sourceLine"); + sourceCodeColumn.setCellValueFactory(sourceCodeFactory); + + TableColumn defContainerColumn = new TableColumn<>("def tracking statement"); + PropertyValueFactory defContainerFactory = new PropertyValueFactory<>("defContainer"); + defContainerColumn.setCellValueFactory(defContainerFactory); + + TableColumn defInfluenceColumn = new TableColumn<>("relation influenced by def"); + PropertyValueFactory defInfluenceFactory = new PropertyValueFactory<>("relationsDefs"); + defInfluenceColumn.setCellValueFactory(defInfluenceFactory); + + TableColumn useColumn = new TableColumn<>("use statement"); + PropertyValueFactory useFactory = new PropertyValueFactory<>("use"); + useColumn.setCellValueFactory(useFactory); + + TableColumn useInfluenceColumn = new TableColumn<>("relation influencing use"); + PropertyValueFactory useInfluenceFactory = new PropertyValueFactory<>("relationsUses"); + useInfluenceColumn.setCellValueFactory(useInfluenceFactory); + + TableColumn nodeCalledByExecutionColumn = new TableColumn<>("node called by statement"); + PropertyValueFactory nodeCallFactory = new PropertyValueFactory<>("nodesCallableForAllNodes"); + nodeCalledByExecutionColumn.setCellValueFactory(nodeCallFactory); + + TableColumn relationCalledByExecutionColumn = new TableColumn<>("relation called by statement"); + PropertyValueFactory relationCallFactory = new PropertyValueFactory<>("relationsCallableForAllRelations"); + relationCalledByExecutionColumn.setCellValueFactory(relationCallFactory); + + TableColumn replaceLineColumn = new TableColumn<>("replace line"); + PropertyValueFactory replaceLineFactory = new PropertyValueFactory<>("replaceLine"); + replaceLineColumn.setCellValueFactory(replaceLineFactory); + + tableView.getColumns().clear(); + tableView.getColumns().addAll(Arrays.asList(sourceCodeColumn, defContainerColumn, defInfluenceColumn, useColumn, + useInfluenceColumn, nodeCalledByExecutionColumn, relationCalledByExecutionColumn,replaceLineColumn)); + tableView.getColumns().forEach(column -> column.setSortable(false)); + + tableView.setItems(tableData); + tableView.setEditable(true); + + defContainerColumn.setCellFactory(TextFieldTableCell.forTableColumn()); + defContainerColumn.setOnEditCommit(event -> { + event.getRowValue().setDefContainer(event.getNewValue()); + event.getRowValue().getDefWrapper().activateAllOnly(); + event.getRowValue().getDefWrapper().refreshText(); + }); + useColumn.setCellFactory(TextFieldTableCell.forTableColumn()); + useColumn.setOnEditCommit(event -> { + event.getRowValue().setUse(event.getNewValue()); + event.getRowValue().getUseWrapper().activateAllOnly(); + event.getRowValue().getUseWrapper().refreshText(); + }); + replaceLineColumn.setCellFactory(TextFieldTableCell.forTableColumn()); + replaceLineColumn.setOnEditCommit(event -> { + event.getRowValue().setReplaceLine(event.getNewValue()); + }); + + + } + + +} diff --git a/src/main/java/gui/view/StandardPresentationView.java b/src/main/java/gui/view/StandardPresentationView.java new file mode 100644 index 0000000..543cb24 --- /dev/null +++ b/src/main/java/gui/view/StandardPresentationView.java @@ -0,0 +1,29 @@ +package gui.view; + +import javafx.scene.Scene; +import javafx.scene.control.TextArea; +import javafx.stage.Stage; + +public class StandardPresentationView extends Stage{ + private final TextArea textArea; + + public StandardPresentationView(String title) { + this.setTitle(title); + textArea = new TextArea(); + Scene scene = new Scene(textArea); + this.setScene(scene); + } + + public StandardPresentationView(String title, String text) { + this.setTitle(title); + textArea = new TextArea(); + Scene scene = new Scene(textArea); + this.setScene(scene); + textArea.setText(text); + } + + public void setText(String text) { + textArea.setText(text); + } + +} diff --git a/src/main/java/gui/view/UtilityConverter.java b/src/main/java/gui/view/UtilityConverter.java new file mode 100644 index 0000000..beecb7f --- /dev/null +++ b/src/main/java/gui/view/UtilityConverter.java @@ -0,0 +1,32 @@ +package gui.view; + +import gui.model.SourceCodeLine; + +import java.io.File; +import java.io.IOException; +import java.nio.file.Files; +import java.util.LinkedList; +import java.util.List; + +public class UtilityConverter { + public static List getTableItems(File file) { + List tableItems = new LinkedList<>(); + if (file != null) { + try { + var reader = Files.newBufferedReader(file.toPath()); + String line = reader.readLine(); + long lineNumber = 0; + while (line != null) { + SourceCodeLine sourceEntry = new SourceCodeLine(); + sourceEntry.setSourceLine(line); + sourceEntry.setLineNumber(lineNumber++); + tableItems.add(sourceEntry); + line = reader.readLine(); + } + } catch (IOException e) { + System.err.println("Could not read file: " + e.getMessage()); + } + } + return tableItems; + } +} diff --git a/src/main/java/gui/view/criteriaSelection/CriteriaSelectionView.java b/src/main/java/gui/view/criteriaSelection/CriteriaSelectionView.java new file mode 100644 index 0000000..e6c1894 --- /dev/null +++ b/src/main/java/gui/view/criteriaSelection/CriteriaSelectionView.java @@ -0,0 +1,73 @@ +package gui.view.criteriaSelection; + + +import gui.controller.criteriaSelection.CriteriaSelectionStrategyController; +import javafx.event.ActionEvent; +import javafx.event.EventHandler; +import javafx.scene.Scene; +import javafx.scene.control.Button; +import javafx.scene.control.CheckBox; +import javafx.scene.control.Label; +import javafx.scene.layout.GridPane; +import javafx.stage.Stage; + +public class CriteriaSelectionView extends Stage { + + + protected final CheckBox allResourceCB = new CheckBox(); + protected final CheckBox allRelationsCB = new CheckBox(); + protected final CheckBox allDefsCB = new CheckBox(); + protected final CheckBox allDefUseCB = new CheckBox(); + protected final CheckBox allUsesCB = new CheckBox(); + private final CriteriaSelectionStrategyController controller; + + + public CriteriaSelectionView(String title, CriteriaSelectionStrategyController controller) { + this.controller = controller; + this.setTitle(title); + var grid = getGridPane(); + var scene = new Scene(grid); + this.setScene(scene); + } + + private GridPane getGridPane() { + GridPane gridPane = new GridPane(); + var allResourcesText = new Label("All resources: "); + var allRelationsText = new Label("All relations: "); + var allDefsText = new Label("All defs: "); + var allDefUseText = new Label("All defuse: "); + var allUsesText = new Label("All uses: "); + + gridPane.add(allResourcesText, 0, 0); + gridPane.add(allResourceCB, 1, 0); + gridPane.add(allRelationsText, 0, 1); + gridPane.add(allRelationsCB, 1, 1); + gridPane.add(allDefsText, 0, 2); + gridPane.add(allDefsCB, 1, 2); + gridPane.add(allDefUseText, 0, 3); + gridPane.add(allDefUseCB, 1, 3); + gridPane.add(allUsesText, 0, 4); + gridPane.add(allUsesCB, 1, 4); + + Button createButton = new Button("Create"); + createButton.setDefaultButton(true); + createButton.setOnAction(getCreateButtonEvent()); + Button cancelButton = new Button("Cancel"); + cancelButton.setCancelButton(true); + cancelButton.setOnAction(getCancelButtonEvent()); + gridPane.add(createButton, 0, 6); + gridPane.add(cancelButton, 1, 6); + return gridPane; + } + + private EventHandler getCreateButtonEvent() { + return event -> + controller.handleInput(allResourceCB.isSelected(), allRelationsCB.isSelected(), + allDefsCB.isSelected(), allDefUseCB.isSelected(), allUsesCB.isSelected()); + } + + private EventHandler getCancelButtonEvent() { + return event -> controller.cancel(); + } + +} diff --git a/src/main/java/gui/view/graphcomponents/DraggableArrow.java b/src/main/java/gui/view/graphcomponents/DraggableArrow.java new file mode 100644 index 0000000..3d2ef1a --- /dev/null +++ b/src/main/java/gui/view/graphcomponents/DraggableArrow.java @@ -0,0 +1,423 @@ +package gui.view.graphcomponents; + +import gui.controller.GraphVisualisationController; +import gui.model.AccessMode; +import javafx.beans.InvalidationListener; +import javafx.beans.binding.DoubleBinding; +import javafx.beans.property.DoubleProperty; +import javafx.beans.property.SimpleDoubleProperty; +import javafx.event.EventHandler; +import javafx.scene.Group; +import javafx.scene.control.Alert; +import javafx.scene.control.ContextMenu; +import javafx.scene.control.MenuItem; +import javafx.scene.control.TextInputDialog; +import javafx.scene.input.ContextMenuEvent; +import javafx.scene.input.MouseButton; +import javafx.scene.input.MouseEvent; +import javafx.scene.shape.Line; +import javafx.scene.text.Text; + +import java.util.Arrays; +import java.util.Optional; + +public class DraggableArrow extends Group { + private static final double ARROW_LENGTH = 20; + private final Line line; + + + private GraphVisualisationController controller; + + private final DoubleProperty startXOffset = new SimpleDoubleProperty(0); + private final DoubleProperty startYOffset = new SimpleDoubleProperty(0); + private final DoubleProperty endXOffset = new SimpleDoubleProperty(0); + private final DoubleProperty endYOffset = new SimpleDoubleProperty(0); + + private double originalStartOffsetPositionX = 0; + private double originalStartOffsetPositionY = 0; + private double originalEndOffsetPositionX = 0; + private double originalEndOffsetPositionY = 0; + + private double originalClickPositionX = 0; + + private double originalClickPositionY = 0; + private boolean wasClickNearerToStartNode = true; + + private final DraggableNode successor; + private AccessMode accessMode; + + private long identifier; + + private final DraggableNode predecessor; + + public DraggableArrow(DraggableNode predecessor, DraggableNode successor, + Line line, Line arrow1, Line arrow2) { + super(line, arrow1, arrow2); + this.successor = successor; + this.predecessor = predecessor; + DoubleProperty startX = predecessor.layoutXProperty(); + DoubleProperty startY = predecessor.layoutYProperty(); + DoubleProperty endX = successor.layoutXProperty(); + DoubleProperty endY = successor.layoutYProperty(); + + line.strokeWidthProperty().set(3); + arrow1.strokeWidthProperty().set(3); + arrow2.strokeWidthProperty().set(3); + this.line = line; + InvalidationListener updater = o -> { + double ex = getEndX(); + double ey = getEndY(); + double sx = getStartX(); + double sy = getStartY(); + + arrow1.setEndX(ex); + arrow1.setEndY(ey); + arrow2.setEndX(ex); + arrow2.setEndY(ey); + + if (ex == sx && ey == sy) { + // arrow parts of length 0 + arrow1.setStartX(ex); + arrow1.setStartY(ey); + arrow2.setStartX(ex); + arrow2.setStartY(ey); + } else { + double factor = ARROW_LENGTH / Math.hypot(sx - ex, sy - ey); + + double dx = (sx - ex) * factor; + double dy = (sy - ey) * factor; + + double ox = (sx - ex) * factor; + double oy = (sy - ey) * factor; + + arrow1.setStartX(ex + dx - oy); + arrow1.setStartY(ey + dy + ox); + arrow2.setStartX(ex + dx + oy); + arrow2.setStartY(ey + dy - ox); + } + }; + + startXProperty().addListener(updater); + startYProperty().addListener(updater); + endXProperty().addListener(updater); + endYProperty().addListener(updater); + updater.invalidated(null); + + DoubleBinding startXBinding = getPositiveSummedBinding(startX, startXOffset); + DoubleBinding startYBinding = getPositiveSummedBinding(startY, startYOffset); + DoubleBinding endXBinding = getPositiveSummedBinding(endX, endXOffset); + DoubleBinding endYBinding = getPositiveSummedBinding(endY, endYOffset); + + + startXProperty().bind(startXBinding); + startYProperty().bind(startYBinding); + endXProperty().bind(endXBinding); + endYProperty().bind(endYBinding); + + var text = new Text("."); + + getChildren().add(text); + + DoubleBinding xPositionText = getMiddle(startXBinding, endXBinding); + DoubleBinding yPositionText = getMiddle(startYBinding, endYBinding); + + + text.xProperty().bind(xPositionText); + text.yProperty().bind(yPositionText); + + this.setOnMousePressed(mouseClicked()); + this.setOnMouseDragged(dragMouse()); + this.setOnMouseReleased(releaseMouse()); + + + } + + private EventHandler releaseMouse() { + return event -> { + + updateOffset(); + + controller.updateArrowPosition(this); + }; + } + + private DoubleBinding getMiddle(DoubleBinding start, DoubleBinding end) { + return new DoubleBinding() { + { + super.bind(start, end); + } + + @Override + protected double computeValue() { + var startValue = start.doubleValue(); + var endValue = end.doubleValue(); + var diff = Math.abs(startValue - endValue); + return startValue > endValue ? endValue + diff / 2 : startValue + diff / 2; + + } + }; + } + + private DoubleBinding getPositiveSummedBinding(DoubleProperty summand1, DoubleProperty summand2) { + return new DoubleBinding() { + { + super.bind(summand1, summand2); + } + + @Override + protected double computeValue() { + double result = summand1.getValue() + summand2.getValue(); + return (result > 0) ? result : 0; + } + }; + } + + private static double getShift(Double currentOffset, String textOfAffectedCoordinate) { + + var dialog = new TextInputDialog(currentOffset.toString()); + dialog.setTitle("Dialog to change " + textOfAffectedCoordinate); + dialog.setHeaderText("Change" + textOfAffectedCoordinate + "!"); + dialog.setContentText("Enter a number:"); + Optional result = dialog.showAndWait(); + if (result.isPresent()) { + try { + return Double.parseDouble(result.get()); + } catch (NumberFormatException e) { + System.err.println("Input could not be parsed to an integer"); + System.err.println(Arrays.toString(e.getStackTrace())); + var alert = new Alert(Alert.AlertType.ERROR); + alert.setTitle("Error Dialog"); + alert.setHeaderText("Input could not be parsed to an integer"); + alert.setContentText("Please try it again!"); + alert.showAndWait(); + return currentOffset; + } + } + return currentOffset; + } + + + public void setupArrow(GraphVisualisationController controller) { + this.controller = controller; + this.setOnContextMenuRequested(contextMenuClicked()); + } + + private double getStartX() { + return line.getStartX(); + } + + + private DoubleProperty startXProperty() { + return line.startXProperty(); + } + + private double getStartY() { + return line.getStartY(); + } + + private DoubleProperty startYProperty() { + return line.startYProperty(); + } + + private double getEndX() { + return line.getEndX(); + } + + private DoubleProperty endXProperty() { + return line.endXProperty(); + } + + private double getEndY() { + return line.getEndY(); + } + + private DoubleProperty endYProperty() { + return line.endYProperty(); + } + + private EventHandler dragMouse() { + return event -> { + if (event.getButton() == MouseButton.PRIMARY) { + double deltaX = event.getX() - originalClickPositionX; + double deltaY = event.getY() - originalClickPositionY; + + if (wasClickNearerToStartNode) { + + startXOffset.set(deltaX + originalStartOffsetPositionX); + startYOffset.set(deltaY + originalStartOffsetPositionY); + } else { + endXOffset.set(deltaX + originalEndOffsetPositionX); + endYOffset.set(deltaY + originalEndOffsetPositionY); + } + } + }; + } + + public DraggableNode getSuccessor() { + return successor; + } + + public DraggableNode getPredecessor() { + return predecessor; + } + + private EventHandler mouseClicked() { + return event -> { + if (event.getButton() == MouseButton.PRIMARY) { + + + originalClickPositionX = event.getX(); + originalClickPositionY = event.getY(); + updateOffset(); + + double deltaXTolerance = Math.abs((endXProperty().getValue() - startXProperty().getValue()) / 2); + wasClickNearerToStartNode = Math.abs(event.getX() - startXProperty().getValue()) < Math.abs(deltaXTolerance); + + + } + if (event.getButton().equals(MouseButton.PRIMARY) && event.getClickCount() == 2) { + var contentOfArrow = this.toString(); + controller.showArrowInfoBox(contentOfArrow); + } + }; + } + + private EventHandler contextMenuClicked() { + + var contextMenu = new ContextMenu(); + + var itemRemoveArrow = new MenuItem("Remove Arrow"); + var itemStartX = new MenuItem("Move starting point of X coordinates"); + var itemStartY = new MenuItem("Move starting point of Y coordinates"); + var itemEndX = new MenuItem("Move end point of X coordinates"); + var itemEndY = new MenuItem("Move end point of Y coordinates"); + var itemShowInfo = new MenuItem("Show information of arrow"); + var editItem = new MenuItem("Edit arrow"); + + itemRemoveArrow.setOnAction(event -> controller.remove(DraggableArrow.this)); + + itemStartX.setOnAction(event -> { + double shift = + getShift(startXOffset.getValue(), "starting point x"); + startXOffset.set(shift); + }); + + itemStartY.setOnAction(event -> { + double shift = + getShift(startYOffset.getValue(), "starting point y"); + startYOffset.set(shift); + }); + itemEndX.setOnAction(event -> { + double shift = + getShift(endXOffset.getValue(), "ending point x"); + endXOffset.set(shift); + }); + + itemEndY.setOnAction(event -> { + double shift = + getShift(endYOffset.getValue(), "ending point y"); + endYOffset.set(shift); + }); + + + itemShowInfo.setOnAction(event -> { + var contentOfArrow = this.toString(); + controller.showArrowInfoBox(contentOfArrow); + }); + + editItem.setOnAction(event -> controller.editArrow(this)); + + contextMenu.getItems().addAll(itemRemoveArrow, itemStartX, itemStartY, itemEndX, itemEndY, itemShowInfo, editItem); + + return event -> { + event.consume(); + contextMenu.show(this, event.getScreenX(), event.getScreenY()); + + }; + } + + public void updatePosition() { + startXOffset.set(originalStartOffsetPositionX); + startYOffset.set(originalStartOffsetPositionY); + endXOffset.set(originalEndOffsetPositionX); + endYOffset.set(originalEndOffsetPositionY); + } + + public void updateOffset() { + originalStartOffsetPositionX = startXOffset.getValue(); + originalStartOffsetPositionY = startYOffset.getValue(); + + originalEndOffsetPositionX = endXOffset.getValue(); + originalEndOffsetPositionY = endYOffset.getValue(); + } + + public void setOriginalStartOffsetPositionX(double originalStartOffsetPositionX) { + this.originalStartOffsetPositionX = originalStartOffsetPositionX; + } + + public void setOriginalStartOffsetPositionY(double originalStartOffsetPositionY) { + this.originalStartOffsetPositionY = originalStartOffsetPositionY; + } + + public void setOriginalEndOffsetPositionX(double originalEndOffsetPositionX) { + this.originalEndOffsetPositionX = originalEndOffsetPositionX; + } + + public void setOriginalEndOffsetPositionY(double originalEndOffsetPositionY) { + this.originalEndOffsetPositionY = originalEndOffsetPositionY; + } + + @Override + public String toString() { + return "DraggableArrow{" + + "line=" + line + + ", controller=" + controller + + ", startXOffset=" + startXOffset + + ", startYOffset=" + startYOffset + + ", endXOffset=" + endXOffset + + ", endYOffset=" + endYOffset + + ", originalClickPositionX=" + originalClickPositionX + + ", originalClickPositionY=" + originalClickPositionY + + ", originalStartOffsetPositionX=" + originalStartOffsetPositionX + + ", originalStartOffsetPositionY=" + originalStartOffsetPositionY + + ", originalEndOffsetPositionX=" + originalEndOffsetPositionX + + ", originalEndOffsetPositionY=" + originalEndOffsetPositionY + + ", successor=" + successor + + ", predecessor=" + predecessor + + ", accessMode =" + accessMode + + ", identifier=" + identifier + + '}'; + } + + public void setAccessMode(AccessMode accessMode) { + this.accessMode = accessMode; + } + + public AccessMode getAccessMode() { + return accessMode; + } + + public double getOriginalStartOffsetPositionX() { + return originalStartOffsetPositionX; + } + + public double getOriginalStartOffsetPositionY() { + return originalStartOffsetPositionY; + } + + public double getOriginalEndOffsetPositionX() { + return originalEndOffsetPositionX; + } + + public double getOriginalEndOffsetPositionY() { + return originalEndOffsetPositionY; + } + + public long getIdentifier() { + return identifier; + } + + public void setIdentifier(long identifier) { + this.identifier = identifier; + } +} \ No newline at end of file diff --git a/src/main/java/gui/view/graphcomponents/DraggableNode.java b/src/main/java/gui/view/graphcomponents/DraggableNode.java new file mode 100644 index 0000000..8703a4f --- /dev/null +++ b/src/main/java/gui/view/graphcomponents/DraggableNode.java @@ -0,0 +1,230 @@ +package gui.view.graphcomponents; + +import gui.controller.GraphVisualisationController; +import gui.model.FunctionInputFormat; +import gui.model.NodeType; +import gui.model.SourceCodeLine; +import javafx.event.EventHandler; +import javafx.scene.Group; +import javafx.scene.Node; +import javafx.scene.control.ContextMenu; +import javafx.scene.control.MenuItem; +import javafx.scene.image.Image; +import javafx.scene.image.ImageView; +import javafx.scene.input.ContextMenuEvent; +import javafx.scene.input.MouseButton; +import javafx.scene.input.MouseEvent; +import javafx.scene.shape.Sphere; +import javafx.scene.text.Text; + +import java.io.File; +import java.net.MalformedURLException; +import java.nio.file.Files; +import java.nio.file.Paths; +import java.util.List; + +public class DraggableNode extends Group { + + private double mouseClickPositionX = 0; + private double mouseClickPositionY = 0; + private List sourceList; + private final String nameOfNode; + + + private double x; + private double y; + + + private GraphVisualisationController controller; + private long identifier; + private NodeType type; + private FunctionInputFormat inputFormats; + + + public DraggableNode(String name) { + this.nameOfNode = name; + var text = new Text(name); + getChildren().add(text); + } + + + public void setupDraggableNode(GraphVisualisationController controller, double xPosition, double yPosition) { + this.controller = controller; + setOnMousePressed(clickMouse()); + setOnMouseDragged(dragMouse()); + setOnMouseReleased(releaseMouse()); + layoutXProperty().set(xPosition); + layoutYProperty().set(yPosition); + updatePosition(); + setOnContextMenuRequested(contextMenuClicked()); + } + + + private void createSymbol(NodeType type) { + + Node symbol; + switch (type) { + case DATA_STORAGE: + symbol = getSymbol("images/database.png"); + break; + case FUNCTION: + symbol = getSymbol("images/lambda.png"); + break; + case STANDARD_NODE: + default: + symbol = new Sphere(50); + } + getChildren().add(symbol); + } + + private Node getSymbol(String pathToImage) { + var myImagePath = Paths.get(pathToImage); + Node symbol = new Sphere(10); + if (!Files.exists(myImagePath)) { + System.err.println("Path to \"" + pathToImage + "\" is not valid. default symbol is used"); + return symbol; + } + try { + String path = new File(myImagePath.toAbsolutePath().toString()).toURI().toURL().toExternalForm(); + var image = new Image(path); + var imageView = new ImageView(); + imageView.setImage(image); + symbol = imageView; + } catch (MalformedURLException e) { + e.printStackTrace(); + } + return symbol; + } + + private EventHandler clickMouse() { + + return event -> { + if (event.getButton().equals(MouseButton.PRIMARY)) { + mouseClickPositionX = event.getSceneX(); + mouseClickPositionY = event.getSceneY(); + if (event.getClickCount() == 2) { + showNodeInfo(); + } + } + + }; + } + + private EventHandler releaseMouse() { + return event -> { + updatePosition(); + controller.updateNodePosition(this); + }; + } + + + private EventHandler dragMouse() { + return event -> { + if (event.getButton() == MouseButton.PRIMARY) { + double deltaX = event.getSceneX() - mouseClickPositionX; + double deltaY = event.getSceneY() - mouseClickPositionY; + double updatedPositionX = getLayoutX() + deltaX; + double updatedPositionY = getLayoutY() + deltaY; + if (updatedPositionX >= 0 && updatedPositionY >= 0) { + layoutXProperty().set(getLayoutX() + deltaX); + layoutYProperty().set(getLayoutY() + deltaY); + mouseClickPositionX = event.getSceneX(); + mouseClickPositionY = event.getSceneY(); + } + } + }; + } + + private EventHandler contextMenuClicked() { + + var contextMenu = new ContextMenu(); + + var removeNodeItem = new MenuItem("Remove Node"); + var infoOfNodeItem = new MenuItem("Show information of node"); + var editNodeItem = new MenuItem("Edit node"); + + + removeNodeItem.setOnAction(event -> controller.remove(this)); + infoOfNodeItem.setOnAction(event -> showNodeInfo()); + + editNodeItem.setOnAction(event -> controller.editNode(this)); + + contextMenu.getItems().addAll(removeNodeItem, infoOfNodeItem, editNodeItem); + + return event -> { + event.consume(); + contextMenu.show(this, event.getScreenX(), event.getScreenY()); + + }; + } + + private void showNodeInfo() { + controller.showNodeInfoBox(this.toString()); + } + + public NodeType getType() { + return type; + } + + public void setType(NodeType type) { + this.type = type; + createSymbol(type); + } + + public String getName() { + return this.nameOfNode; + } + + public long getIdentifier() { + return identifier; + } + + public void setIdentifier(long identifier) { + this.identifier = identifier; + } + + public void updatePosition() { + x = layoutXProperty().get(); + y = layoutYProperty().get(); + } + + public List getSourceList() { + return sourceList; + } + + public void setSourceList(List sourceList) { + this.sourceList = sourceList; + } + + public double getX() { + return x; + } + + public double getY() { + return y; + } + + public void setInputFormats(FunctionInputFormat inputFormats) { + this.inputFormats = inputFormats; + } + + public FunctionInputFormat getInputFormats() { + return inputFormats; + } + + @Override + public String toString() { + return "DraggableNode{" + + "x=" + layoutXProperty().get() + + ", y=" + layoutYProperty().get() + + ", nameOfNode='" + nameOfNode + "\n" + + ", type=" + type + + ", source=" + sourceList.stream().map(SourceCodeLine::toString).reduce("", (a, b) -> + a + "\n" + b) + + ", input formats=" + inputFormats + "\n" + + ", identifier=" + identifier + + '}'; + } + + +} \ No newline at end of file diff --git a/src/main/java/gui/view/wrapper/CheckboxWrapper.java b/src/main/java/gui/view/wrapper/CheckboxWrapper.java new file mode 100644 index 0000000..5072384 --- /dev/null +++ b/src/main/java/gui/view/wrapper/CheckboxWrapper.java @@ -0,0 +1,29 @@ +package gui.view.wrapper; + +import javafx.scene.control.CheckBox; +import logic.model.Testcase; +import logic.testcasegenerator.coveragetargets.CoverageTarget; + +public class CheckboxWrapper extends CheckBox { + private final Testcase testcase; + private final CoverageTarget aspect; + + public CheckboxWrapper(String text, Testcase testcase, CoverageTarget aspect) { + super(text); + this.testcase = testcase; + this.aspect = aspect; + } + + public CheckboxWrapper(Testcase testcase, CoverageTarget aspect) { + this.testcase = testcase; + this.aspect = aspect; + } + + public Testcase getTestcase() { + return testcase; + } + + public CoverageTarget getAspect() { + return aspect; + } +} diff --git a/src/main/java/gui/view/wrapper/ComboBoxItemWrap.java b/src/main/java/gui/view/wrapper/ComboBoxItemWrap.java new file mode 100644 index 0000000..6ae4e1d --- /dev/null +++ b/src/main/java/gui/view/wrapper/ComboBoxItemWrap.java @@ -0,0 +1,44 @@ +package gui.view.wrapper; + +import javafx.beans.property.BooleanProperty; +import javafx.beans.property.ObjectProperty; +import javafx.beans.property.SimpleBooleanProperty; +import javafx.beans.property.SimpleObjectProperty; + +public class ComboBoxItemWrap { + private final BooleanProperty check = new SimpleBooleanProperty(false); + private final ObjectProperty item = new SimpleObjectProperty<>(); + + ComboBoxItemWrap(T item) { + this.item.set(item); + } + + public BooleanProperty checkProperty() { + return check; + } + + public Boolean getCheck() { + return check.getValue(); + } + + public void setCheck(Boolean value) { + check.set(value); + } + + public ObjectProperty itemProperty() { + return item; + } + + public T getItem() { + return item.getValue(); + } + + public void setItem(T value) { + item.setValue(value); + } + + @Override + public String toString() { + return item.getValue().toString(); + } +} diff --git a/src/main/java/gui/view/wrapper/Commands.java b/src/main/java/gui/view/wrapper/Commands.java new file mode 100644 index 0000000..2430c3c --- /dev/null +++ b/src/main/java/gui/view/wrapper/Commands.java @@ -0,0 +1,51 @@ +package gui.view.wrapper; + +public class Commands { + + + private String functionInvocation = ""; + private String logRetrieval =""; + private String dataStorageClearing =""; + private String projectDirectory =""; + private boolean localExecution; + + public String getFunctionInvocation() { + return functionInvocation; + } + + public void setFunctionInvocation(String functionInvocation) { + this.functionInvocation = functionInvocation; + } + + public String getLogRetrieval() { + return logRetrieval; + } + + public void setLogRetrieval(String logRetrieval) { + this.logRetrieval = logRetrieval; + } + + public String getDataStorageClearing() { + return dataStorageClearing; + } + + public void setDataStorageClearing(String dataStorageClearing) { + this.dataStorageClearing = dataStorageClearing; + } + + public String getProjectDirectory() { + return this.projectDirectory; + } + + public void setProjectDirectory(String projectDirectory) { + this.projectDirectory = projectDirectory; + } + + public void setLocalExeuction(boolean selected) { + this.localExecution = true; + } + + public boolean isLocalExecution() { + return localExecution; + } +} diff --git a/src/main/java/gui/view/wrapper/NodeWrapper.java b/src/main/java/gui/view/wrapper/NodeWrapper.java new file mode 100644 index 0000000..75a0ee2 --- /dev/null +++ b/src/main/java/gui/view/wrapper/NodeWrapper.java @@ -0,0 +1,102 @@ +package gui.view.wrapper; + +import javafx.collections.ObservableList; +import javafx.scene.control.CheckBox; +import javafx.scene.control.ComboBox; +import javafx.scene.control.ListCell; +import javafx.scene.input.MouseEvent; + +import java.util.ArrayList; +import java.util.LinkedList; +import java.util.List; +import java.util.stream.Collectors; + +public class NodeWrapper { + private final ComboBox> combobox = new ComboBox<>(); + private final List nodes; + + public NodeWrapper(List nodes) { + this.nodes = new ArrayList<>(nodes); + } + + + public ComboBox> getCombobox() { + return combobox; + } + + public void setupCombobox() { + { + fillCombobox(); + combobox.setCellFactory(c -> { + ListCell> cell = new ListCell<>() { + @Override + protected void updateItem(ComboBoxItemWrap item, boolean empty) { + super.updateItem(item, empty); + if (!empty) { + final CheckBox cb = new CheckBox(item.toString()); + cb.selectedProperty().bind(item.checkProperty()); + setGraphic(cb); + } + } + }; + cell.addEventFilter(MouseEvent.MOUSE_RELEASED, event -> { + cell.getItem().checkProperty().set(!cell.getItem().checkProperty().get()); + refreshText(); + }); + return cell; + }); + } + } + + private void fillCombobox() { + var entries = nodes.stream().map(n -> + new ComboBoxItemWrap<>(n.toString())).collect(Collectors.toCollection(LinkedList::new)); + combobox.getItems().addAll(entries); + } + + public void refreshText() { + String combination = combobox.getItems().stream().filter(f -> f != null && f.getCheck()).map(ComboBoxItemWrap::getItem). + collect(Collectors.joining(";")); + + combobox.setPromptText(combination); + } + + public void activateNodes(List nodesInfluenced) { + if (nodesInfluenced != null && nodesInfluenced.size() > 0) { + activateNeighboursOfCombobox(nodesInfluenced); + refreshText(); + } + } + + private void activateNeighboursOfCombobox(List relationsInfluenced) { + var items = combobox.getItems(); + for (var item : items) { + String entry = item.getItem(); + try { + Long entrySaved = Long.valueOf(entry); + if (relationsInfluenced.contains(entrySaved)) { + item.checkProperty().set(true); + } + } catch (NumberFormatException e) { + System.err.printf("String %s could not be parsed to a Long%n", item.getItem()); + } + } + } + + + public List getSelectedNodes() { + ObservableList> items = combobox.getItems(); + List nodesInfluenced = new LinkedList<>(); + for (var item : items) { + if (item.getCheck()) { + try { + Long relation = Long.valueOf(item.getItem()); + nodesInfluenced.add(relation); + } catch (NumberFormatException e) { + System.err.printf("String %s could not be parsed to a Long%n", item.getItem()); + } + } + } + return nodesInfluenced; + } +} diff --git a/src/main/java/gui/view/wrapper/RelationsWrapper.java b/src/main/java/gui/view/wrapper/RelationsWrapper.java new file mode 100644 index 0000000..2fea07b --- /dev/null +++ b/src/main/java/gui/view/wrapper/RelationsWrapper.java @@ -0,0 +1,129 @@ +package gui.view.wrapper; + +import javafx.collections.ObservableList; +import javafx.scene.control.CheckBox; +import javafx.scene.control.ComboBox; +import javafx.scene.control.ListCell; +import javafx.scene.input.MouseEvent; +import logic.model.SourceCodeLine; + +import java.util.ArrayList; +import java.util.LinkedList; +import java.util.List; +import java.util.stream.Collectors; + +public class RelationsWrapper { + private final ComboBox> combobox = new ComboBox<>(); + private final List neighbours; + + public RelationsWrapper(List neighbours) { + this.neighbours = new ArrayList<>(neighbours); + } + + + public ComboBox> getCombobox() { + return combobox; + } + + public void setupCombobox() { + { + fillCombobox(); + combobox.setCellFactory(c -> { + ListCell> cell = new ListCell<>() { + @Override + protected void updateItem(ComboBoxItemWrap item, boolean empty) { + super.updateItem(item, empty); + if (!empty) { + final CheckBox cb = new CheckBox(item.toString()); + cb.selectedProperty().bind(item.checkProperty()); + setGraphic(cb); + } + } + }; + cell.addEventFilter(MouseEvent.MOUSE_RELEASED, event -> { + cell.getItem().checkProperty().set(!cell.getItem().checkProperty().get()); + refreshText(); + }); + return cell; + }); + } + } + + private void fillCombobox() { + if (neighbours.contains(SourceCodeLine.INFLUENCING_ALL_RELATIONS_CONSTANT)) { + var allEntry = new ComboBoxItemWrap<>("all neighbours"); + allEntry.checkProperty().set(false); + var items = combobox.getItems(); + items.add(allEntry); + } + var entries = neighbours.stream(). + filter(r -> r != SourceCodeLine.INFLUENCING_ALL_RELATIONS_CONSTANT). + map(n -> + new ComboBoxItemWrap<>(n.toString())).collect(Collectors.toCollection(LinkedList::new)); + combobox.getItems().addAll(entries); + } + + public void refreshText() { + String combination = combobox.getItems().stream().filter(f -> f != null && f.getCheck()).map(ComboBoxItemWrap::getItem).collect(Collectors.joining(";")); + combobox.setPromptText(combination); + } + + public void activateNeighbours(List relationsInfluenced) { + if (relationsInfluenced != null && relationsInfluenced.size() > 0) { + activateNeighboursOfCombobox(relationsInfluenced); + refreshText(); + } + } + + private void activateNeighboursOfCombobox(List relationsInfluenced) { + var items = combobox.getItems(); + for (var item : items) { + String entry = item.getItem(); + if ("all neighbours".equals(entry)) { + if (relationsInfluenced.contains(SourceCodeLine.INFLUENCING_ALL_RELATIONS_CONSTANT)) { + item.checkProperty().set(true); + } + } else { + try { + Long entrySaved = Long.valueOf(entry); + if (relationsInfluenced.contains(entrySaved)) { + item.checkProperty().set(true); + } + + } catch (NumberFormatException e) { + System.err.printf("String %s could not be parsed to a Long%n", item.getItem()); + } + } + } + } + + + public List getSelectedRelations() { + ObservableList> items = combobox.getItems(); + List influencedRelations = new LinkedList<>(); + for (var item : items) { + if (item.getCheck()) { + if ("all neighbours".equals(item.getItem())) { + influencedRelations.clear(); + influencedRelations.add(SourceCodeLine.INFLUENCING_ALL_RELATIONS_CONSTANT); + break; + } + + try { + Long relation = Long.valueOf(item.getItem()); + influencedRelations.add(relation); + } catch (NumberFormatException e) { + System.err.printf("String %s could not be parsed to a Long%n", item.getItem()); + } + } + } + return influencedRelations; + } + + public void activateAllOnly() { + combobox.getItems().clear(); + fillCombobox(); + combobox.getItems().stream().filter(n -> "all neighbours".equals(n.getItem())).forEach(n -> n.checkProperty().set(true)); + } + +} diff --git a/src/main/java/gui/view/wrapper/SourceEntryWrapper.java b/src/main/java/gui/view/wrapper/SourceEntryWrapper.java new file mode 100644 index 0000000..19dc62b --- /dev/null +++ b/src/main/java/gui/view/wrapper/SourceEntryWrapper.java @@ -0,0 +1,115 @@ +package gui.view.wrapper; + +import gui.model.SourceCodeLine; +import javafx.scene.control.ComboBox; + +import java.util.ArrayList; +import java.util.List; + +public class SourceEntryWrapper { + private final SourceCodeLine sourceEntry; + private final RelationsWrapper relationsDefs; + private final RelationsWrapper relationsUses; + private final NodeWrapper nodesCallableForAllNodes; + private final RelationsWrapper relationsCallableForAllRelations; + + + public SourceEntryWrapper(SourceCodeLine sourceEntry, List neighbours, List nodes, List arrows) { + List neighboursWithAllIncluded = new ArrayList<>(neighbours); + neighboursWithAllIncluded.add(0, logic.model.SourceCodeLine.INFLUENCING_ALL_RELATIONS_CONSTANT); + this.relationsDefs = new RelationsWrapper(neighboursWithAllIncluded); + this.relationsUses = new RelationsWrapper(neighboursWithAllIncluded); + this.relationsCallableForAllRelations = new RelationsWrapper(arrows); + this.nodesCallableForAllNodes = new NodeWrapper(nodes); + this.sourceEntry = sourceEntry; + setupComboboxes(); + activateCheckboxesForData(sourceEntry); + + } + + private void setupComboboxes() { + relationsDefs.setupCombobox(); + relationsUses.setupCombobox(); + relationsCallableForAllRelations.setupCombobox(); + nodesCallableForAllNodes.setupCombobox(); + } + + private void activateCheckboxesForData(SourceCodeLine sourceEntry) { + relationsDefs.activateNeighbours(sourceEntry.getRelationsInfluencedByDef()); + relationsUses.activateNeighbours(sourceEntry.getRelationsInfluencingUse()); + relationsCallableForAllRelations.activateNeighbours(sourceEntry.getRelationsCoveredByStatement()); + nodesCallableForAllNodes.activateNodes(sourceEntry.getNodesCoveredByStatement()); + } + + public SourceEntryWrapper(SourceCodeLine sourceEntry) { + this(sourceEntry, new ArrayList<>(), new ArrayList(), new ArrayList()); + } + + public String getSourceLine() { + return sourceEntry.getSourceLine(); + } + + + public String getDefContainer() { + return sourceEntry.getDefContainer(); + } + + public String getUse() { + return sourceEntry.getUse(); + } + + public void setDefContainer(String jsonKey) { + sourceEntry.setDefContainer(jsonKey); + } + + public String getReplaceLine() { + return sourceEntry.getReplaceLine(); + } + + public void setReplaceLine(String replaceLine){ + sourceEntry.setReplaceLine(replaceLine); + } + + public void setUse(String use) { + sourceEntry.setUse(use); + } + + + public SourceCodeLine getSourceEntry() { + List relationsInfluencedByDef = relationsDefs.getSelectedRelations(); + List relationsInfluencedByUse = relationsUses.getSelectedRelations(); + List nodesInfluencedByStatement = nodesCallableForAllNodes.getSelectedNodes(); + List relationsCalledByStatement = relationsCallableForAllRelations.getSelectedRelations(); + sourceEntry.setRelationsInfluencedByDef(relationsInfluencedByDef); + sourceEntry.setRelationsInfluencingUse(relationsInfluencedByUse); + sourceEntry.setNodesCoveredByStatement(nodesInfluencedByStatement); + sourceEntry.setRelationsCoveredByStatement(relationsCalledByStatement); + return sourceEntry; + } + + public ComboBox> getRelationsDefs() { + return relationsDefs.getCombobox(); + } + + public ComboBox> getRelationsUses() { + return relationsUses.getCombobox(); + } + + public ComboBox> getNodesCallableForAllNodes() { + return nodesCallableForAllNodes.getCombobox(); + } + + public ComboBox> getRelationsCallableForAllRelations() { + return relationsCallableForAllRelations.getCombobox(); + } + + public RelationsWrapper getDefWrapper() { + return relationsDefs; + } + + public RelationsWrapper getUseWrapper() { + return relationsUses; + } + + +} diff --git a/src/main/java/logic/instrumentation/SourceInstrumentator.java b/src/main/java/logic/instrumentation/SourceInstrumentator.java new file mode 100644 index 0000000..ddc8db0 --- /dev/null +++ b/src/main/java/logic/instrumentation/SourceInstrumentator.java @@ -0,0 +1,8 @@ +package logic.instrumentation; + +public interface SourceInstrumentator { + + + String instrumentSourceCode(String sourceAsJSON, boolean resources, boolean relations, boolean defusepairs); + +} diff --git a/src/main/java/logic/instrumentation/SourceInstrumentatorImpl.java b/src/main/java/logic/instrumentation/SourceInstrumentatorImpl.java new file mode 100644 index 0000000..bd7bf14 --- /dev/null +++ b/src/main/java/logic/instrumentation/SourceInstrumentatorImpl.java @@ -0,0 +1,37 @@ +package logic.instrumentation; + +import logic.instrumentation.intrumenators.DefUsePairCoverageInstrumentator; +import logic.instrumentation.intrumenators.LineInstrumentator; +import logic.instrumentation.intrumenators.RelationCoverageInstrumentator; +import logic.instrumentation.intrumenators.ResourceCoverageInstrumentator; +import logic.model.SourceCode; +import logic.model.SourceCodeLine; + +import java.util.ArrayList; +import java.util.List; +import java.util.stream.Collectors; + +public class SourceInstrumentatorImpl implements SourceInstrumentator { + + + @Override + public String instrumentSourceCode(String sourceAsJSON, boolean resources, boolean relations, boolean defusepairs) { + List instrumentators = new ArrayList<>(); + if (resources) { + instrumentators.add(new ResourceCoverageInstrumentator()); + } + if (relations) { + instrumentators.add(new RelationCoverageInstrumentator()); + } + if (defusepairs) { + instrumentators.add(new DefUsePairCoverageInstrumentator()); + } + SourceCode sourceCode = SourceCode.getSourceCodeObject(sourceAsJSON); + + for (var instrumentator : instrumentators) { + instrumentator.addLogToLine(sourceCode); + } + + return sourceCode.getSourceCode().stream().map(SourceCodeLine::getSourceLineWithLogLine).collect(Collectors.joining("\n")); + } +} diff --git a/src/main/java/logic/instrumentation/intrumenators/DefUsePairCoverageInstrumentator.java b/src/main/java/logic/instrumentation/intrumenators/DefUsePairCoverageInstrumentator.java new file mode 100644 index 0000000..953a003 --- /dev/null +++ b/src/main/java/logic/instrumentation/intrumenators/DefUsePairCoverageInstrumentator.java @@ -0,0 +1,41 @@ +package logic.instrumentation.intrumenators; + +import logic.model.LogLine; +import logic.model.SourceCode; + +public class DefUsePairCoverageInstrumentator implements LineInstrumentator { + + + @Override + public void addLogToLine(SourceCode sourceCode) { + var allLines = sourceCode.getSourceCode(); + for (var sourceCodeLine : allLines) { + if (sourceCodeLine.getDefContainer() != null) { + + String commentForTarget = String.format( + "The definition variable should contain the following identifier in order to " + + "track the source when used: %s", sourceCodeLine.getDefTracker("", sourceCode.getIdOfNode())); + + var logLine = new LogLine(commentForTarget); + logLine.setBeforeLogStatement(sourceCodeLine.getDefContainer()); + sourceCodeLine.addAfterLine(logLine); + } + if (sourceCodeLine.getUse() != null) { + String commentForTarget = String.format("Coverage of a definition with a use. " + + "The following line should log that the definition of the variable was used by " + + "logging the definition in combination with the following use: %s", + sourceCodeLine.getUseTracker("", sourceCode.getIdOfNode())); + var logLine = new LogLine(commentForTarget); + logLine.setBeforeLogStatement(sourceCodeLine.getUse()); + sourceCodeLine.addBeforeLine(logLine); + } + if (sourceCodeLine.getReplaceLine() != null) { + String commentForTarget = String.format("Old line '%s' is replaced by '%s'", + sourceCodeLine.getSourceLine(), sourceCodeLine.getReplaceLine()); + var logLine = new LogLine(commentForTarget); + sourceCodeLine.addBeforeLine(logLine); + sourceCodeLine.setSourceLine(sourceCodeLine.getReplaceLine()); + } + } + } +} diff --git a/src/main/java/logic/instrumentation/intrumenators/LineInstrumentator.java b/src/main/java/logic/instrumentation/intrumenators/LineInstrumentator.java new file mode 100644 index 0000000..558d2dd --- /dev/null +++ b/src/main/java/logic/instrumentation/intrumenators/LineInstrumentator.java @@ -0,0 +1,8 @@ +package logic.instrumentation.intrumenators; + +import logic.model.SourceCode; + +public interface LineInstrumentator { + + void addLogToLine(SourceCode sourceCode); +} diff --git a/src/main/java/logic/instrumentation/intrumenators/RelationCoverageInstrumentator.java b/src/main/java/logic/instrumentation/intrumenators/RelationCoverageInstrumentator.java new file mode 100644 index 0000000..430131e --- /dev/null +++ b/src/main/java/logic/instrumentation/intrumenators/RelationCoverageInstrumentator.java @@ -0,0 +1,31 @@ +package logic.instrumentation.intrumenators; + +import logic.model.LogLine; +import logic.model.SourceCode; +import logic.model.SourceCodeLine; + +import java.util.ArrayList; +import java.util.List; + +import static logic.testcasegenerator.coveragetargets.LogNameConfiguration.LOGDELIMITER; +import static logic.testcasegenerator.coveragetargets.LogNameConfiguration.RELATION_MARKER; + +public class RelationCoverageInstrumentator implements LineInstrumentator { + + @Override + public void addLogToLine(SourceCode sourceCode) { + var allLines = sourceCode.getSourceCode(); + for (var sourceCodeLine : allLines) { + List relationsCoveredByStatement = sourceCodeLine.getRelationsCoveredByStatement(); + if (relationsCoveredByStatement != null && !relationsCoveredByStatement.isEmpty()) { + for (Long relationCovered : relationsCoveredByStatement) { + String logMessage = String.format("%s%s%s", RELATION_MARKER, relationCovered, LOGDELIMITER); + String commentForTarget = String.format("Coverage of Relation %s; The following line should be logged: %s", relationCovered, logMessage); + var logLine = new LogLine(commentForTarget); + logLine.setLogMessage(logMessage); + sourceCodeLine.addBeforeLine(logLine); + } + } + } + } +} diff --git a/src/main/java/logic/instrumentation/intrumenators/ResourceCoverageInstrumentator.java b/src/main/java/logic/instrumentation/intrumenators/ResourceCoverageInstrumentator.java new file mode 100644 index 0000000..1345fdb --- /dev/null +++ b/src/main/java/logic/instrumentation/intrumenators/ResourceCoverageInstrumentator.java @@ -0,0 +1,31 @@ +package logic.instrumentation.intrumenators; + +import logic.model.LogLine; +import logic.model.SourceCode; +import logic.model.SourceCodeLine; + +import java.util.ArrayList; +import java.util.List; + +import static logic.testcasegenerator.coveragetargets.LogNameConfiguration.LOGDELIMITER; +import static logic.testcasegenerator.coveragetargets.LogNameConfiguration.RESOURCE_MARKER; + +public class ResourceCoverageInstrumentator implements LineInstrumentator { + + @Override + public void addLogToLine(SourceCode sourceCode) { + var allLines = sourceCode.getSourceCode(); + for (var sourceCodeLine : allLines) { + List nodesCalledByStatement = sourceCodeLine.getNodesCoveredByStatement(); + if (nodesCalledByStatement != null && !nodesCalledByStatement.isEmpty()) { + for (Long nodeCovered : nodesCalledByStatement) { + String logMessage = RESOURCE_MARKER + nodeCovered + LOGDELIMITER; + String commentForTarget = String.format("Coverage of Node %s; The following line should be logged: %s", nodeCovered, logMessage); + var logLine = new LogLine(commentForTarget); + logLine.setLogMessage(logMessage); + sourceCodeLine.addBeforeLine(logLine); + } + } + } + } +} diff --git a/src/main/java/logic/logevaluation/CoverageCalculation.java b/src/main/java/logic/logevaluation/CoverageCalculation.java new file mode 100644 index 0000000..499ce14 --- /dev/null +++ b/src/main/java/logic/logevaluation/CoverageCalculation.java @@ -0,0 +1,73 @@ +package logic.logevaluation; + +import java.io.File; +import java.io.IOException; +import java.nio.file.Files; +import java.util.*; +import java.util.stream.Collectors; + +import static java.util.Map.Entry.comparingByValue; + +public class CoverageCalculation { + + + public String calculateCoverage(File file) { + StringBuilder result + = new StringBuilder(); + try { + var path = file.toPath(); + List lines = Files.readAllLines(path); + List logStatements = getLogStatements(lines); + + LinkedList evaluators = new LinkedList<>(); + + evaluators.add(new LogEvaluatorAllResources(logStatements)); + evaluators.add(new LogEvaluatorAllRelations(logStatements)); + evaluators.add(new LogEvaluatorDefs(logStatements)); + evaluators.add(new LogEvaluatorDefUse(logStatements)); + evaluators.add(new LogEvaluatorUses(logStatements)); + + + for (LogEvaluator evaluator : evaluators) { + + result.append(evaluator.getCriteriaName()).append(System.lineSeparator()); + Map unitsCovered = evaluator.getCoveredResources(); + + var unitsCoveredSortedByOccurrence = unitsCovered.entrySet().stream().sorted(Collections.reverseOrder(comparingByValue())) + .collect(Collectors.toList()); + for (var entry : unitsCoveredSortedByOccurrence) { + result.append(String.format("%s\t%sx%n", entry.getKey(), entry.getValue())); + } + result.append(String.format("%n%n")); + } + + + } catch (IOException e) { + System.err.println("File could not be read."); + } + + + return result.toString(); + + } + + private List getLogStatements(List lines) { + + List statements = new ArrayList<>(); + for (String line : lines) { + if (line.contains("INFO")) { + line = line.substring(line.indexOf("INFO")); + String[] infos = line.split("INFO"); + for (String info : infos) { + String statement = info.split(" ")[0].trim(); + if (statement.startsWith("#")) { + statements.add(statement); + } + } + } + } + return statements; + } +} + + diff --git a/src/main/java/logic/logevaluation/LogEvaluator.java b/src/main/java/logic/logevaluation/LogEvaluator.java new file mode 100644 index 0000000..7c37d47 --- /dev/null +++ b/src/main/java/logic/logevaluation/LogEvaluator.java @@ -0,0 +1,20 @@ +package logic.logevaluation; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public abstract class LogEvaluator { + + abstract public Map getCoveredResources(); + + + public Map countNumberOfOccurrences(List inputList) { + Map resultMap = new HashMap<>(); + inputList.forEach(e -> resultMap.put(e, resultMap.getOrDefault(e, 0) + 1)); + return resultMap; + } + + abstract public String getCriteriaName(); + +} diff --git a/src/main/java/logic/logevaluation/LogEvaluatorAllRelations.java b/src/main/java/logic/logevaluation/LogEvaluatorAllRelations.java new file mode 100644 index 0000000..282306e --- /dev/null +++ b/src/main/java/logic/logevaluation/LogEvaluatorAllRelations.java @@ -0,0 +1,38 @@ +package logic.logevaluation; + +import logic.testcasegenerator.coveragetargets.LogNameConfiguration; + +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +public class LogEvaluatorAllRelations extends LogEvaluator { + List logs = new ArrayList<>(); + + public LogEvaluatorAllRelations(List logStatements) { + for (String statement : logStatements) { + if (isStatement(statement)) { + logs.add(statement); + } + } + } + + private boolean isStatement(String statement) { + return statement.startsWith(LogNameConfiguration.RELATION_MARKER); + } + + @Override + public Map getCoveredResources() { + List coveredResources = + logs.stream().filter(s -> s.startsWith(LogNameConfiguration.RELATION_MARKER)).map(a -> a.replaceAll(LogNameConfiguration.RELATION_MARKER, "")).collect(Collectors.toList()); + + Map unitsCovered = countNumberOfOccurrences(coveredResources); + + return unitsCovered; + } + @Override + public String getCriteriaName() { + return "All Resources Relations"; + } +} diff --git a/src/main/java/logic/logevaluation/LogEvaluatorAllResources.java b/src/main/java/logic/logevaluation/LogEvaluatorAllResources.java new file mode 100644 index 0000000..030c0fa --- /dev/null +++ b/src/main/java/logic/logevaluation/LogEvaluatorAllResources.java @@ -0,0 +1,42 @@ +package logic.logevaluation; + + +import logic.testcasegenerator.coveragetargets.LogNameConfiguration; + +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +public class LogEvaluatorAllResources extends LogEvaluator { + + List logs = new ArrayList<>(); + + public LogEvaluatorAllResources(List logStatements) { + for (String statement : logStatements) { + if (isStatement(statement)) { + logs.add(statement); + } + } + } + + private boolean isStatement(String statement) { + return statement.startsWith(LogNameConfiguration.RESOURCE_MARKER); + } + + @Override + public Map getCoveredResources() { + List coveredResources = + logs.stream().filter(s -> s.startsWith(LogNameConfiguration.RESOURCE_MARKER)).map(a -> a.replaceAll(LogNameConfiguration.RELATION_MARKER, "")).collect(Collectors.toList()); + + Map unitsCovered = countNumberOfOccurrences(coveredResources); + + return unitsCovered; + } + + @Override + public String getCriteriaName() { + return "All Resources"; + } + +} diff --git a/src/main/java/logic/logevaluation/LogEvaluatorDefUse.java b/src/main/java/logic/logevaluation/LogEvaluatorDefUse.java new file mode 100644 index 0000000..6e39bea --- /dev/null +++ b/src/main/java/logic/logevaluation/LogEvaluatorDefUse.java @@ -0,0 +1,46 @@ +package logic.logevaluation; + +import logic.testcasegenerator.coveragetargets.LogNameConfiguration; + +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +public class LogEvaluatorDefUse extends LogEvaluator { + + List logs = new ArrayList<>(); + + public LogEvaluatorDefUse(List logStatements) { + for (String statement : logStatements) { + if (isStatement(statement)) { + logs.add(statement); + } + } + } + + private boolean isStatement(String statement) { + return statement.startsWith(LogNameConfiguration.DEFLOG_MARKER); + } + + public Map getCoveredResources() { + List coveredDefs = + logs.stream().filter(s -> s.startsWith(LogNameConfiguration.DEFLOG_MARKER)). + map(entry -> entry.split(LogNameConfiguration.USELOG_MARKER)[0]).collect(Collectors.toList()); + List coveredUses = + logs.stream().filter(s -> s.startsWith(LogNameConfiguration.DEFLOG_MARKER)).filter(entry -> entry.contains(LogNameConfiguration.USELOG_MARKER)). + map(entry -> entry.split(LogNameConfiguration.USELOG_MARKER)[1]).map(entry -> LogNameConfiguration.USELOG_MARKER + entry).collect(Collectors.toList()); + + + Map unitsCovered = countNumberOfOccurrences(coveredDefs); + Map unitsCoveredUses = countNumberOfOccurrences(coveredUses); + unitsCovered.putAll(unitsCoveredUses); + return unitsCovered; + } + + @Override + public String getCriteriaName() { + return "All DefUse"; + } + +} diff --git a/src/main/java/logic/logevaluation/LogEvaluatorDefs.java b/src/main/java/logic/logevaluation/LogEvaluatorDefs.java new file mode 100644 index 0000000..e6fb4b7 --- /dev/null +++ b/src/main/java/logic/logevaluation/LogEvaluatorDefs.java @@ -0,0 +1,37 @@ +package logic.logevaluation; + +import logic.testcasegenerator.coveragetargets.LogNameConfiguration; + +import java.util.*; +import java.util.stream.Collectors; + + +public class LogEvaluatorDefs extends LogEvaluator { + + List logs = new ArrayList<>(); + + public LogEvaluatorDefs(List logStatements) { + for (String statement : logStatements) { + if (isStatement(statement)) { + logs.add(statement); + } + } + } + + private boolean isStatement(String statement) { + return statement.startsWith(LogNameConfiguration.DEFLOG_MARKER); + } + + public Map getCoveredResources() { + List coveredResources = + logs.stream().filter(s -> s.startsWith(LogNameConfiguration.DEFLOG_MARKER)).map(entry-> entry.split(LogNameConfiguration.USELOG_MARKER)[0]).collect(Collectors.toList()); + Map unitsCovered = countNumberOfOccurrences(coveredResources); + return unitsCovered; + } + + @Override + public String getCriteriaName() { + return "All Defs"; + } + +} diff --git a/src/main/java/logic/logevaluation/LogEvaluatorUses.java b/src/main/java/logic/logevaluation/LogEvaluatorUses.java new file mode 100644 index 0000000..d59c48f --- /dev/null +++ b/src/main/java/logic/logevaluation/LogEvaluatorUses.java @@ -0,0 +1,39 @@ +package logic.logevaluation; + +import logic.testcasegenerator.coveragetargets.LogNameConfiguration; + +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +public class LogEvaluatorUses extends LogEvaluator { + + List logs = new ArrayList<>(); + + public LogEvaluatorUses(List logStatements) { + for (String statement : logStatements) { + if (isStatement(statement)) { + logs.add(statement); + } + } + } + + private boolean isStatement(String statement) { + return statement.startsWith(LogNameConfiguration.DEFLOG_MARKER); + } + + public Map getCoveredResources() { + List coveredUnits = + logs.stream().filter(s -> s.startsWith(LogNameConfiguration.DEFLOG_MARKER)).collect(Collectors.toList()); + + Map unitsCovered = countNumberOfOccurrences(coveredUnits); + return unitsCovered; + } + + @Override + public String getCriteriaName() { + return "All Uses"; + } + +} diff --git a/src/main/java/logic/model/AccessMode.java b/src/main/java/logic/model/AccessMode.java new file mode 100644 index 0000000..f23a18f --- /dev/null +++ b/src/main/java/logic/model/AccessMode.java @@ -0,0 +1,16 @@ +package logic.model; + +public enum AccessMode { + READ("read"), WRITE("write"), DELETE("delete"), RETURN("return"), FUNCTIONCALL("function call"); + + private final String mode; + + AccessMode(final String mode) { + this.mode = mode; + } + + @Override + public String toString() { + return mode; + } +} diff --git a/src/main/java/logic/model/ArrowModel.java b/src/main/java/logic/model/ArrowModel.java new file mode 100644 index 0000000..f86db03 --- /dev/null +++ b/src/main/java/logic/model/ArrowModel.java @@ -0,0 +1,73 @@ +package logic.model; + +import com.google.gson.annotations.Expose; + +public class ArrowModel { + @Expose + private long identifier; + + @Expose + private long successor; + @Expose + private long predecessor; + @Expose + private AccessMode accessMode; + + private NodeModel successorNode; + private NodeModel predecessorNode; + + public long getIdentifier() { + return identifier; + } + + public void setIdentifier(long identifier) { + this.identifier = identifier; + } + + public long getSuccessor() { + return successor; + } + + public void setSuccessor(long successor) { + this.successor = successor; + } + + public long getPredecessor() { + return predecessor; + } + + public void setPredecessor(long predecessor) { + this.predecessor = predecessor; + } + + public AccessMode getAccessMode() { + return accessMode; + } + + public void setAccessMode(AccessMode accessMode) { + this.accessMode = accessMode; + } + + public NodeModel getSuccessorNode() { + return successorNode; + } + + public void setSuccessorNode(NodeModel successorNode) { + this.successorNode = successorNode; + } + + public NodeModel getPredecessorNode() { + return predecessorNode; + } + + public void setPredecessorNode(NodeModel predecessorNode) { + this.predecessorNode = predecessorNode; + } + + @Override + public String toString() { + return "Arrow{" + + "identifier=" + identifier + + '}'; + } +} diff --git a/src/main/java/logic/model/FunctionInputFormat.java b/src/main/java/logic/model/FunctionInputFormat.java new file mode 100644 index 0000000..5b9e35e --- /dev/null +++ b/src/main/java/logic/model/FunctionInputFormat.java @@ -0,0 +1,62 @@ +package logic.model; + +import com.google.gson.annotations.Expose; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + +public class FunctionInputFormat { + @Expose + private final List stringInput; + @Expose + private final List integerInput; + @Expose + private final String JSONInput; + + public FunctionInputFormat(List stringInput, List integerInput, String JSONInput) { + Objects.requireNonNull(stringInput, "string input list must not null"); + Objects.requireNonNull(integerInput, "string input list must not null"); + Objects.requireNonNull(JSONInput, "string input list must not null"); + + this.stringInput = stringInput; + this.integerInput = integerInput; + this.JSONInput = JSONInput; + } + + public FunctionInputFormat() { + stringInput = new ArrayList<>(); + integerInput = new ArrayList<>(); + JSONInput =""; + } + + public List getStringInput() { + return stringInput; + } + + public List getIntegerInput() { + return integerInput; + } + + public String getJSONInput() { + return JSONInput; + } + + @Override + public String toString() { + StringBuilder result = new StringBuilder(); + for (var stringInputEntry : stringInput) { + result.append(stringInputEntry); + result.append("\n"); + } + + for (var integerInputEntry : integerInput) { + result.append(integerInputEntry); + result.append("\n"); + } + + result.append(this.JSONInput); + + return result.toString(); + } +} diff --git a/src/main/java/logic/model/Graph.java b/src/main/java/logic/model/Graph.java new file mode 100644 index 0000000..c3e2c16 --- /dev/null +++ b/src/main/java/logic/model/Graph.java @@ -0,0 +1,62 @@ +package logic.model; + +import com.google.gson.GsonBuilder; +import com.google.gson.annotations.Expose; + +import java.util.ArrayList; +import java.util.List; +import java.util.Optional; + +public class Graph { + + @Expose + private final List arrows; + @Expose + private final List nodes; + + + public Graph(String graphJSON) { + var gson = new GsonBuilder().excludeFieldsWithoutExposeAnnotation().create(); + Graph modelLoaded = gson.fromJson(graphJSON, Graph.class); + this.arrows = modelLoaded.getArrows(); + this.nodes = modelLoaded.getNodes(); + } + + + public List getArrows() { + return new ArrayList<>(arrows); + } + + public List getNodes() { + return nodes; + } + + + public void addRelationsToElements() { + for (var arrow : arrows) { + Optional predecessorNode = findNodeByID(arrow.getPredecessor()); + if (predecessorNode.isEmpty()) { + String errorMessage = String.format("Predecessor with id %d of arrow %d cannot be found", arrow.getPredecessor(), arrow.getIdentifier()); + throw new IllegalArgumentException(errorMessage); + } + Optional successorNode = findNodeByID(arrow.getSuccessor()); + if (successorNode.isEmpty()) { + String errorMessage = String.format("Successor with id %d of arrow %d cannot be found", arrow.getSuccessor(), arrow.getIdentifier()); + throw new IllegalArgumentException(errorMessage); + } + predecessorNode.ifPresent(node -> { + arrow.setPredecessorNode(node); + node.addOutgoingArrow(arrow); + }); + successorNode.ifPresent(node -> { + arrow.setSuccessorNode(node); + node.addIncomingArrow(arrow); + }); + } + } + + public Optional findNodeByID(long id) { + return nodes.stream().filter(n -> n.getIdentifier() == id).findFirst(); + } + +} \ No newline at end of file diff --git a/src/main/java/logic/model/IntegerInput.java b/src/main/java/logic/model/IntegerInput.java new file mode 100644 index 0000000..82de55a --- /dev/null +++ b/src/main/java/logic/model/IntegerInput.java @@ -0,0 +1,50 @@ +package logic.model; + +import com.google.gson.annotations.Expose; + +public class IntegerInput { + @Expose + private String key; + @Expose + private String minValue; + @Expose + private String maxValue; + + public IntegerInput(String key, String minValue, String maxValue) { + this.key = key; + this.minValue = minValue; + this.maxValue = maxValue; + } + + public String getKey() { + return key; + } + + public String getMinValue() { + return minValue; + } + + public String getMaxValue() { + return maxValue; + } + + public void setKey(String key) { + this.key = key; + } + + public void setMinValue(String minValue) { + this.minValue = minValue; + } + + public void setMaxValue(String maxValue) { + this.maxValue = maxValue; + } + + @Override + public String toString() { + return + "key=" + key + + ", minValue=" + minValue + + ", maxValue=" + maxValue; + } +} diff --git a/src/main/java/logic/model/LogLine.java b/src/main/java/logic/model/LogLine.java new file mode 100644 index 0000000..68ff4a5 --- /dev/null +++ b/src/main/java/logic/model/LogLine.java @@ -0,0 +1,39 @@ +package logic.model; + +public class LogLine { + private final String commentForTarget; + private String logMessage; + private String beforeLogStatement; + private String afterLogStatement; + + public LogLine(String commentForTarget) { + this.commentForTarget = commentForTarget; + } + + + @Override + public String toString() { + String executionCodeBeforeLog = beforeLogStatement == null ? "" : "\n" + beforeLogStatement; + String executionCodeAfterLog = afterLogStatement == null ? "" : "\n" + afterLogStatement; + String logMessageToBePrinted = logMessage == null ? "" : "\n" + String.format("console.log('%s');", logMessage); + + return "/*#" + commentForTarget + "*/" + + executionCodeBeforeLog + + logMessageToBePrinted + + executionCodeAfterLog + + "\n//End of instrumentation insertion"; + } + + public void setBeforeLogStatement(String beforeLogStatement) { + this.beforeLogStatement = beforeLogStatement; + + } + + public void setAfterLogStatement(String afterLogStatement) { + this.afterLogStatement = afterLogStatement; + } + + public void setLogMessage(String logMessage) { + this.logMessage = logMessage; + } +} diff --git a/src/main/java/logic/model/NodeModel.java b/src/main/java/logic/model/NodeModel.java new file mode 100644 index 0000000..d1405c9 --- /dev/null +++ b/src/main/java/logic/model/NodeModel.java @@ -0,0 +1,106 @@ +package logic.model; + +import com.google.gson.annotations.Expose; + +import java.util.ArrayList; +import java.util.List; + +public class NodeModel { + + @Expose + private long identifier; + @Expose + private List sourceList; + @Expose + private String nameOfNode = ""; + @Expose + private NodeType type = NodeType.STANDARD_NODE; + @Expose + private double x; + @Expose + private double y; + @Expose + private FunctionInputFormat inputFormats; + + + private final List incomingArrows = new ArrayList<>(); + private final List outgoingArrows = new ArrayList<>(); + + public long getIdentifier() { + return identifier; + } + + public void setIdentifier(long identifier) { + this.identifier = identifier; + } + + public List getSourceList() { + return sourceList; + } + + public void setSourceList(List sourceList) { + this.sourceList = sourceList; + } + + public String getNameOfNode() { + return nameOfNode; + } + + public void setNameOfNode(String nameOfNode) { + this.nameOfNode = nameOfNode; + } + + public NodeType getType() { + return type; + } + + public void setType(NodeType type) { + this.type = type; + } + + public double getX() { + return x; + } + + public void setX(double x) { + this.x = x; + } + + public double getY() { + return y; + } + + public void setY(double y) { + this.y = y; + } + + public FunctionInputFormat getInputFormats() { + return inputFormats; + } + + public void setInputFormats(FunctionInputFormat inputFormats) { + this.inputFormats = inputFormats; + } + + public List getIncomingArrows() { + return incomingArrows; + } + + public void addIncomingArrow(ArrowModel incomingArrow) { + incomingArrows.add(incomingArrow); + } + + public List getOutgoingArrows() { + return outgoingArrows; + } + + public void addOutgoingArrow(ArrowModel outgoingArrow) { + outgoingArrows.add(outgoingArrow); + } + + @Override + public String toString() { + return String.format(" %s %s (id %d)", + this.getType(), this.getNameOfNode(), this.getIdentifier()); + } +} diff --git a/src/main/java/logic/model/NodeType.java b/src/main/java/logic/model/NodeType.java new file mode 100644 index 0000000..993aa58 --- /dev/null +++ b/src/main/java/logic/model/NodeType.java @@ -0,0 +1,15 @@ +package logic.model; + +public enum NodeType { + STANDARD_NODE("Standard Node"), FUNCTION("Function"), DATA_STORAGE("Data Storage"); + private final String label; + + NodeType(String label) { + this.label = label; + } + + @Override + public String toString() { + return label; + } +} diff --git a/src/main/java/logic/model/ServerlessFunction.java b/src/main/java/logic/model/ServerlessFunction.java new file mode 100644 index 0000000..3dbf15c --- /dev/null +++ b/src/main/java/logic/model/ServerlessFunction.java @@ -0,0 +1,36 @@ +package logic.model; + +public class ServerlessFunction { + private final NodeModel nodeModel; + private final String name; + private final long id; + + + public ServerlessFunction(NodeModel nodeModel) { + this.name = nodeModel.getNameOfNode(); + this.id = nodeModel.getIdentifier(); + this.nodeModel = nodeModel; + } + + public FunctionInputFormat getFunctionInputFormat(){ + return nodeModel.getInputFormats(); + } + + public String getName() { + return name; + } + + public long getId() { + return id; + } + + public String getInputFormatString(){ + if(nodeModel==null){ + return ""; + } + return nodeModel.getInputFormats().toString(); + } + + + +} diff --git a/src/main/java/logic/model/SourceCode.java b/src/main/java/logic/model/SourceCode.java new file mode 100644 index 0000000..16e6a8b --- /dev/null +++ b/src/main/java/logic/model/SourceCode.java @@ -0,0 +1,42 @@ +package logic.model; + +import com.google.gson.GsonBuilder; +import com.google.gson.annotations.Expose; + +import java.util.List; + +public class SourceCode { + @Expose + private final List sourceCode; + + @Expose + private Long idOfNode; + + public SourceCode(List sourceCode) { + this.sourceCode = sourceCode; + } + + public List getSourceCode() { + return sourceCode; + } + + public Long getIdOfNode() { + return idOfNode; + } + + public void setIdOfNode(Long idOfNode) { + this.idOfNode = idOfNode; + } + + public static SourceCode getSourceCodeObject(String sourceJSON) { + var gson = new GsonBuilder().excludeFieldsWithoutExposeAnnotation().create(); + return gson.fromJson(sourceJSON, SourceCode.class); + } + public String getJSON() { + var gson = new GsonBuilder() + .excludeFieldsWithoutExposeAnnotation().setPrettyPrinting() + .create(); + return gson.toJson(this, SourceCode.class); + } + +} diff --git a/src/main/java/logic/model/SourceCodeLine.java b/src/main/java/logic/model/SourceCodeLine.java new file mode 100644 index 0000000..b37c72c --- /dev/null +++ b/src/main/java/logic/model/SourceCodeLine.java @@ -0,0 +1,168 @@ +package logic.model; + +import com.google.gson.annotations.Expose; + +import java.util.ArrayList; +import java.util.List; + +import static logic.testcasegenerator.coveragetargets.LogNameConfiguration.*; + +public class SourceCodeLine { + + public static final long INFLUENCING_ALL_RELATIONS_CONSTANT = Long.MIN_VALUE; + + @Expose + private String sourceLine; + @Expose + private String defContainer; + @Expose + private List relationsInfluencedByDef; + @Expose + private String use; + @Expose + private List relationsInfluencingUse; + @Expose + private List nodesCoveredByStatement; + @Expose + private List relationsCoveredByStatement; + @Expose + Long lineNumber; + @Expose + private String replaceLine; + + private final List afterLines = new ArrayList<>(); + private final List beforeLines = new ArrayList<>(); + + public String getSourceLine() { + return sourceLine; + } + + public String getSourceLineWithLogLine() { + StringBuilder result = new StringBuilder(); + for (var beforeLine : beforeLines) { + if (beforeLine != null) { + result.append(beforeLine); + result.append("\n"); + } + } + result.append(sourceLine); + for (var afterLine : afterLines) { + if (afterLine != null) { + result.append("\n"); + result.append(afterLine); + } + } + return result.toString(); + } + + public void setSourceLine(String sourceLine) { + this.sourceLine = sourceLine; + } + + public String getUse() { + return use; + } + + public void setUse(String use) { + this.use = use; + } + + + public List getNodesCoveredByStatement() { + return nodesCoveredByStatement; + } + + public void setNodesCoveredByStatement(List nodesCoveredByStatement) { + this.nodesCoveredByStatement = nodesCoveredByStatement; + } + + public void addNodeCoveredByStatement(Long nodeID) { + if (nodesCoveredByStatement == null) { + nodesCoveredByStatement = new ArrayList<>(); + } + nodesCoveredByStatement.add(nodeID); + } + + + public void setRelationsCoveredByStatement(List relationsCoveredByStatement) { + this.relationsCoveredByStatement = relationsCoveredByStatement; + } + + public List getRelationsInfluencedByDef() { + return relationsInfluencedByDef; + } + + public void setRelationsInfluencedByDef(List relationsInfluencedByDef) { + this.relationsInfluencedByDef = relationsInfluencedByDef; + } + + public List getRelationsInfluencingUse() { + return relationsInfluencingUse; + } + + public void setRelationsInfluencingUse(List relationsInfluencingUse) { + this.relationsInfluencingUse = relationsInfluencingUse; + } + + @Override + public String toString() { + return "SourceEntry{" + + "sourceLine='" + sourceLine + '\'' + + ", def tracker='" + defContainer + '\'' + + ", use='" + use + '\'' + + '}'; + } + + public List getRelationsCoveredByStatement() { + return relationsCoveredByStatement; + } + + public void addRelationCoveredByStatement(Long relationID) { + if (relationsCoveredByStatement == null) { + relationsCoveredByStatement = new ArrayList<>(); + } + relationsCoveredByStatement.add(relationID); + } + + public Long getLineNumber() { + return this.lineNumber; + } + + public void setLineNumber(Long lineNumber) { + this.lineNumber = lineNumber; + } + + + public void addBeforeLine(LogLine beforeLine) { + beforeLines.add(beforeLine); + } + + public void addAfterLine(LogLine afterLine) { + afterLines.add(afterLine); + } + + public void setDefKey(String defContainerVariable) { + this.defContainer = defContainerVariable; + } + + public String getDefContainer() { + return defContainer; + } + + + public String getUseTracker(String variableName, Long idOfNode) { + return String.format("%s%d_line%d_%s%s", USELOG_MARKER, idOfNode, this.getLineNumber(), variableName, LOGDELIMITER); + } + + public String getDefTracker(String variableName, Long idOfNode) { + return String.format("%s%d_line%d_%s%s", DEFLOG_MARKER, idOfNode, this.getLineNumber(), variableName, LOGDELIMITER); + } + + public void setReplaceLine(String replaceLine) { + this.replaceLine = replaceLine; + } + + public String getReplaceLine() { + return replaceLine; + } +} diff --git a/src/main/java/logic/model/StringInput.java b/src/main/java/logic/model/StringInput.java new file mode 100644 index 0000000..e4d638c --- /dev/null +++ b/src/main/java/logic/model/StringInput.java @@ -0,0 +1,38 @@ +package logic.model; + +import com.google.gson.annotations.Expose; + +public class StringInput { + @Expose + private String key; + @Expose + private String jsonValue; + + public StringInput(String key, String jsonValue) { + this.key = key; + this.jsonValue = jsonValue; + } + + public String getKey() { + return key; + } + + public String getJsonValue() { + return jsonValue; + } + + public void setKey(String key) { + this.key = key; + } + + public void setJsonValue(String jsonValue) { + this.jsonValue = jsonValue; + } + + @Override + public String toString() { + return + "key='" + key + '\'' + + "jsonRegex='" + jsonValue + '\''; + } +} diff --git a/src/main/java/logic/model/TestSuite.java b/src/main/java/logic/model/TestSuite.java new file mode 100644 index 0000000..2f13fd7 --- /dev/null +++ b/src/main/java/logic/model/TestSuite.java @@ -0,0 +1,47 @@ +package logic.model; + +import logic.testcasegenerator.coveragetargets.CoverageTarget; + +import java.util.ArrayList; +import java.util.List; + +public class TestSuite { + + final List testTargets = new ArrayList<>(); + + @Override + public String toString() { + StringBuilder result = new StringBuilder(); + + + int numberOfTestAspects = 0; + for (var testAspect : testTargets) { + var testcases = testAspect.getTestcases(); + if (testcases == null ||testcases.isEmpty()) { + result.append(String.format("No testcases were created for %s", testAspect)); + continue; + } + result.append(String.format("#Testcase #%d:%n", ++numberOfTestAspects)); + result.append(String.format("#The following aspect should be covered: %s%n",testAspect.getAspectTarget())); + result.append(String.format("#target of tc: %s%n", testcases.get(0).getTarget())); + result.append(String.format("%s%n", testcases.get(0).getCommandsForTestcase())); + if (testcases.size() > 1) { + for (int j = 1; j < testcases.size(); j++) { + result.append(String.format("#Alternative test case:%n")); + result.append(String.format("#target of tc: %s%n", testcases.get(j).getTarget())); + result.append(String.format("%s%n", testcases.get(j).getCommandsForTestcase())); + } + } + result.append("\n\n"); + } + return result.toString(); + } + + public List getTestTargets() { + return testTargets; + } + + public void add(List coverageTarget) { + testTargets.addAll(coverageTarget); + } +} diff --git a/src/main/java/logic/model/Testcase.java b/src/main/java/logic/model/Testcase.java new file mode 100644 index 0000000..ba95e29 --- /dev/null +++ b/src/main/java/logic/model/Testcase.java @@ -0,0 +1,69 @@ +package logic.model; + +import javafx.beans.property.BooleanProperty; +import javafx.beans.property.StringProperty; + +import java.util.ArrayList; +import java.util.List; + +public class Testcase { + private final List functionNames; + private final String target; + private StringProperty testCaseOutput; + private BooleanProperty testCovered; + + private static final String INVOCATION_COMMAND = "serverless invoke -f "; + + private final List logAspects; + + + public Testcase(List functionNames, String target, List logAspects) { + this.functionNames = new ArrayList<>(functionNames); + this.target = target; + this.logAspects = logAspects; + } + + public String getCommandsForTestcase() { + StringBuilder result = new StringBuilder(); + for (ServerlessFunction functionName : functionNames) { + result.append(INVOCATION_COMMAND).append(functionName.getName()).append("\n"); + } + return result.toString(); + } + + public void setCovered(){ + testCovered.set(true); + } + + + public void setFailed(){ + testCovered.set(false); + } + public List getFunctions() { + return functionNames; + } + + + public String getTarget() { + return target; + } + + public List getLogAspects() { + + return logAspects; + } + + public void setTestCaseOutput(StringProperty testCaseOutput) { + this.testCaseOutput = testCaseOutput; + } + + public void writeToOutput(String text) { + if (testCaseOutput != null) { + testCaseOutput.set(text); + } + } + + public void setTeststatus(BooleanProperty testStatus) { + this.testCovered =testStatus; + } +} \ No newline at end of file diff --git a/src/main/java/logic/sourcecodeanalyzer/Analyzer.java b/src/main/java/logic/sourcecodeanalyzer/Analyzer.java new file mode 100644 index 0000000..ac67664 --- /dev/null +++ b/src/main/java/logic/sourcecodeanalyzer/Analyzer.java @@ -0,0 +1,63 @@ +package logic.sourcecodeanalyzer; + +import antlr.autogenerated.JavaScriptLexer; +import antlr.autogenerated.JavaScriptParser; +import logic.model.Graph; +import logic.model.SourceCode; +import logic.model.SourceCodeLine; +import org.antlr.v4.runtime.ANTLRInputStream; +import org.antlr.v4.runtime.CommonTokenStream; +import org.antlr.v4.runtime.ParserRuleContext; +import org.antlr.v4.runtime.tree.gui.TreeViewer; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.stream.Collectors; + +public class Analyzer { + private final boolean adaptForDeletes; + + public Analyzer(boolean adaptForDeletes) { + this.adaptForDeletes = adaptForDeletes; + } + + public String getSuggestionForInstrumentation(String sourceAsJSON, String graphAsJSON) { + SourceCode sourceCode = SourceCode.getSourceCodeObject(sourceAsJSON); + Graph graph = new Graph(graphAsJSON); + graph.addRelationsToElements(); + List lines = sourceCode.getSourceCode(); + + List copyWithLinesOnly = lines.stream(). + map(line -> { + var sourceLine = new SourceCodeLine(); + sourceLine.setSourceLine(line.getSourceLine()); + sourceLine.setLineNumber(line.getLineNumber()); + return sourceLine; + }) + .collect(Collectors.toCollection(ArrayList::new)); + + + String textOfSourceFile = copyWithLinesOnly.stream().map(SourceCodeLine::getSourceLine).collect(Collectors.joining("\n")); + + + JavaScriptLexer lexer = new JavaScriptLexer(new ANTLRInputStream(textOfSourceFile)); + CommonTokenStream tokens = new CommonTokenStream(lexer); + JavaScriptParser parser = new JavaScriptParser(tokens); + ParserRuleContext program = parser.program(); + + + InstrumentationIdentifier visitor = new InstrumentationIdentifier<>(copyWithLinesOnly, graph, sourceCode.getIdOfNode(),adaptForDeletes); + visitor.visit(program); + SourceCode analyzedSourceCode = new SourceCode(copyWithLinesOnly); + analyzedSourceCode.setIdOfNode(sourceCode.getIdOfNode()); + + + TreeViewer viewer = new TreeViewer(Arrays.asList( + parser.getRuleNames()),program); + viewer.open(); + + + return analyzedSourceCode.getJSON(); + } +} diff --git a/src/main/java/logic/sourcecodeanalyzer/GraphHelper.java b/src/main/java/logic/sourcecodeanalyzer/GraphHelper.java new file mode 100644 index 0000000..e54e925 --- /dev/null +++ b/src/main/java/logic/sourcecodeanalyzer/GraphHelper.java @@ -0,0 +1,297 @@ +package logic.sourcecodeanalyzer; + +import antlr.autogenerated.JavaScriptParser; +import antlr.autogenerated.JavaScriptParser.*; +import org.antlr.v4.runtime.tree.ParseTree; + +import java.util.Optional; + +public class GraphHelper { + public static boolean isIdentifierUsage(ParseTree ctx) { + ParseTree anchor; + while (ctx.getParent() != null) { + anchor = ctx; + ctx = ctx.getParent(); + if (ctx instanceof ArgumentContext) { + return true; + } + if (ctx instanceof PropertyNameContext) { + return true; + } + if (ctx instanceof IdentifierNameContext) { + return false; + } + if (ctx instanceof ExpressionSequenceContext) { + return true; + } + if (ctx instanceof PropertyAssignmentContext) { + return false; + } + if (ctx instanceof AssignableContext) { + return false; + } + if ("=".equals(ctx.getText())) { + if (anchor == ctx.getChild(0)) { + return false; + } + } + } + return true; + } + + public static boolean isIdentifierDefinition(ParseTree ctx) { + ParseTree anchor; + while (ctx.getParent() != null) { + anchor = ctx; + ctx = ctx.getParent(); + if (ctx instanceof SingleExpressionContext) { + if ("=".equals(ctx.getText())) { + return ctx.getChild(0) == anchor; + } + } + if (ctx instanceof ArgumentContext) { + return false; + } + } + return true; + } + + public static String getVariableNameOfDefinition(VariableDeclarationContext ctx) { + ParseTree variable = ctx.getChild(0); + if (variable != null) { + return variable.getText(); + } + return null; + } + + public static StatementContext getStatementOfContext(ParseTree ctx) { + while (ctx.getParent() != null) { + ctx = ctx.getParent(); + if (ctx instanceof StatementContext) { + return (StatementContext) ctx; + } + } + return null; + } + + public static Optional getStatementOfContext2(ParseTree ctx) { + while (ctx.getParent() != null) { + ctx = ctx.getParent(); + if (ctx instanceof StatementContext) { + return Optional.of((StatementContext) ctx); + } + } + return Optional.empty(); + } + + + public static StatementContext getNextStatement(ParseTree ctx) { + for (int i = 0; i < ctx.getChildCount(); i++) { + ParseTree child = ctx.getChild(i); + if (child instanceof StatementContext) { + return (StatementContext) child; + } + StatementContext resultOfChild = getNextStatement(child); + if (resultOfChild != null) { + return resultOfChild; + } + } + + return null; + } + + + public static FormalParameterArgContext getNextFormalParameterArg(ParseTree ctx) { + for (int i = 0; i < ctx.getChildCount(); i++) { + ParseTree child = ctx.getChild(i); + if (child instanceof FormalParameterArgContext) { + return (FormalParameterArgContext) child; + } + FormalParameterArgContext resultOfChild = getNextFormalParameterArg(child); + if (resultOfChild != null) { + return resultOfChild; + } + } + + return null; + } + + public static boolean isStatementCallback(ParseTree ctx) { + for (int i = 0; i < ctx.getChildCount(); i++) { + ParseTree child = ctx.getChild(i); + if (child instanceof IdentifierContext) { + return "callback".equals(child.getText()); + } + if (isStatementCallback(child)) { + return true; + } + } + return false; + } + + + public static ArgumentContext getFirstArgument(ParseTree ctx) { + for (int i = 0; i < ctx.getChildCount(); i++) { + ParseTree child = ctx.getChild(i); + if (child instanceof ArgumentContext) { + return (ArgumentContext) child; + } + ArgumentContext resultOfChild = getFirstArgument(child); + if (resultOfChild != null) { + return resultOfChild; + } + } + return null; + } + + public static ArgumentContext getSecondArgument(ParseTree ctx, Boolean firstFound) { + for (int i = 0; i < ctx.getChildCount(); i++) { + ParseTree child = ctx.getChild(i); + if (child instanceof ArgumentContext) { + if (firstFound) { + return (ArgumentContext) child; + } else { + firstFound = true; + } + } + ArgumentContext resultOfChild = getSecondArgument(child, firstFound); + if (resultOfChild != null) { + return resultOfChild; + } + } + return null; + } + + public static boolean checkIfFunctionIsInvoked(StatementContext ctx, String functionName) { + ParseTree expressionStatement = ctx.getChild(0); + if (expressionStatement == null) { + return false; + } + ParseTree expressionSequence = expressionStatement.getChild(0); + if (expressionSequence == null) { + return false; + } + ParseTree singleExpression = expressionSequence.getChild(0); + if (singleExpression == null) { + return false; + } + ParseTree singleExpressionSub = singleExpression.getChild(0); + if (singleExpressionSub == null) { + return false; + } + ParseTree singeExpressionPoint = singleExpressionSub.getChild(1); + if (singeExpressionPoint == null) { + return false; + } + ParseTree singeExpressionInvoke = singleExpressionSub.getChild(2); + if (singeExpressionInvoke == null) { + return false; + } + return (".").equals(singeExpressionPoint.getText()) && functionName.equals(singeExpressionInvoke.getText()); + } + + + public static String getReturnVariableOfFunctionInvocation(StatementContext ctx) { + ParseTree expressionStatement = ctx.getChild(0); + if (expressionStatement == null) { + return null; + } + ParseTree expressionSequence = expressionStatement.getChild(0); + if (expressionSequence == null) { + return null; + } + ParseTree singleExpression = expressionSequence.getChild(0); + if (singleExpression == null) { + return null; + } + ParseTree arguments = singleExpression.getChild(1); + if (arguments == null) { + return null; + } + ParseTree argument = arguments.getChild(3); + if (argument == null) { + return null; + } + ParseTree singleExpression2 = argument.getChild(0); + if (singleExpression2 == null) { + return null; + } + ParseTree anonymousFunction = singleExpression2.getChild(0); + if (anonymousFunction == null) { + return null; + } + + for (int i = 0; i < anonymousFunction.getChildCount(); i++) { + ParseTree tmpChild = anonymousFunction.getChild(i); + if (tmpChild instanceof JavaScriptParser.FormalParameterListContext) { + ParseTree parameter = tmpChild.getChild(2); + if (parameter != null) { + return parameter.getText(); + } + } + } + return null; + } + + public static Optional hasStatementPayload(ParseTree ctx) { + for (int i = 0; i < ctx.getChildCount(); i++) { + ParseTree child = ctx.getChild(i); + if (child instanceof PropertyNameContext) { + if ("Payload".equals(child.getText())) { + return Optional.of((PropertyNameContext) child); + } + } + var optionalOfChildren = hasStatementPayload(child); + if (optionalOfChildren.isPresent()) { + return optionalOfChildren; + } + } + return Optional.empty(); + } + + public static Optional hasStatementItem(ParseTree ctx) { + for (int i = 0; i < ctx.getChildCount(); i++) { + ParseTree child = ctx.getChild(i); + if (child instanceof PropertyNameContext) { + if ("Item".equals(child.getText())) { + return Optional.of((PropertyNameContext) child); + } + } + var optionalOfChildren = hasStatementItem(child); + if (optionalOfChildren.isPresent()) { + return optionalOfChildren; + } + } + return Optional.empty(); + } + + public static String getJSONForPayload(PropertyNameContext payload) { + + var parent = payload.getParent(); + for (int i = 0; i < parent.getChildCount(); i++) { + ParseTree child = parent.getChild(i); + if (child instanceof SingleExpressionContext) { + String content = child.getText(); + int start = content.indexOf("{"); + int end = content.lastIndexOf("}"); + content = content.substring(start, end + 1); + return content; + } + } + return ""; + } + + public static Optional getStartOfBody(ParseTree ctx) { + for (int i = 0; i < ctx.getChildCount(); i++) { + ParseTree child = ctx.getChild(i); + if (child instanceof FunctionBodyContext) { + return Optional.of((FunctionBodyContext) child); + } + var childResult = getStartOfBody(child); + if (childResult.isPresent()) { + return childResult; + } + } + return Optional.empty(); + } +} diff --git a/src/main/java/logic/sourcecodeanalyzer/InstrumentationIdentifier.java b/src/main/java/logic/sourcecodeanalyzer/InstrumentationIdentifier.java new file mode 100644 index 0000000..f35f970 --- /dev/null +++ b/src/main/java/logic/sourcecodeanalyzer/InstrumentationIdentifier.java @@ -0,0 +1,479 @@ +package logic.sourcecodeanalyzer; + +import antlr.autogenerated.JavaScriptParser; +import antlr.autogenerated.JavaScriptParser.ArgumentContext; +import antlr.autogenerated.JavaScriptParser.FunctionBodyContext; +import antlr.autogenerated.JavaScriptParser.IdentifierContext; +import antlr.autogenerated.JavaScriptParser.StatementContext; +import antlr.autogenerated.JavaScriptParserBaseVisitor; +import logic.model.AccessMode; +import logic.model.Graph; +import logic.model.NodeType; +import logic.model.SourceCodeLine; +import org.antlr.v4.runtime.tree.ParseTree; + +import java.util.*; + +public class InstrumentationIdentifier extends JavaScriptParserBaseVisitor { + + private final List lines; + private final Graph graph; + private final Long idOfNode; + private final Map useVariablesOfEvents = new HashMap<>(); + private final Map useVariablesOfReads = new HashMap<>(); + private final Map useVariablesOfReturns = new HashMap<>(); + public final Map> potentialDefs = new HashMap<>(); + private final boolean adaptForDeletes; + + public InstrumentationIdentifier(List lines, Graph graph, Long idOfNode, boolean adaptForDeletes) { + super(); + this.lines = lines; + this.graph = graph; + this.idOfNode = idOfNode; + this.adaptForDeletes = adaptForDeletes; + } + + @Override + public T visitStatement(StatementContext ctx) { + if (ctx.getText().startsWith("exports")) { + StatementContext firstLineOfLambda = GraphHelper.getNextStatement(ctx); + ParseTree event = GraphHelper.getNextFormalParameterArg(ctx); + if (event != null && firstLineOfLambda != null) { + useVariablesOfEvents.put(event.getText(), ctx); + SourceCodeLine sourceCodeLine = getStartSourceCodeLineForContext(firstLineOfLambda); + sourceCodeLine.addNodeCoveredByStatement(idOfNode); + } + } + + String invocationFunctionName = "invoke"; + if (ctx.getText().contains(invocationFunctionName)) { + if (GraphHelper.checkIfFunctionIsInvoked(ctx, invocationFunctionName)) { + ArgumentContext lambdaParameter = GraphHelper.getFirstArgument(ctx); + String returnParameter = GraphHelper.getReturnVariableOfFunctionInvocation(ctx); + useVariablesOfReturns.put(returnParameter, ctx); + if (lambdaParameter != null) { + addDefinitionForFunctionCall(lambdaParameter.getText()); + addRelationsCoveredFunctionCall(ctx); + } + } + } + + String dbReadFunctionName = "getItem"; + if (ctx.getText().contains(dbReadFunctionName)) { + if (GraphHelper.checkIfFunctionIsInvoked(ctx, dbReadFunctionName)) { + ArgumentContext accessParameter = GraphHelper.getFirstArgument(ctx); + String returnParameter = GraphHelper.getReturnVariableOfFunctionInvocation(ctx); + useVariablesOfReads.put(returnParameter, ctx); + if (accessParameter != null) { + addDependenciesForNodeType(ctx); + } + } + } + String dbWriteFunctionName = "putItem"; + if (ctx.getText().contains(dbWriteFunctionName)) { + if (GraphHelper.checkIfFunctionIsInvoked(ctx, dbWriteFunctionName)) { + ArgumentContext writeParameter = GraphHelper.getFirstArgument(ctx); + if (writeParameter != null) { + addDefsForWrite(writeParameter.getText()); + addDependenciesForNodeType(ctx); + } + } + } + + if (ctx.getText().startsWith("callback")) { + if (GraphHelper.isStatementCallback(ctx)) { + ArgumentContext returnVariable = GraphHelper.getSecondArgument(ctx, false); + if (returnVariable != null) { + addDefsForCallbacks(returnVariable.getText()); + addNodesAndRelationsCoveredByCallback(ctx); + } + } + } + if (adaptForDeletes) { + String dbDeleteFunctionName = "deleteItem"; + if (ctx.getText().contains(dbDeleteFunctionName)) { + if (GraphHelper.checkIfFunctionIsInvoked(ctx, dbDeleteFunctionName)) { + ArgumentContext deleteParameter = GraphHelper.getFirstArgument(ctx); + if (deleteParameter != null) { + addDefsForDelete(deleteParameter.getText()); + changeParameterPassedToDelete(ctx, deleteParameter.getText()); + replaceDeleteOperation(ctx, dbDeleteFunctionName, dbWriteFunctionName); + addDependenciesForNodeType(ctx); + } + } + } + } + + return super.visitStatement(ctx); + } + + private void changeParameterPassedToDelete(StatementContext ctx, String deleteParameter) { + var sourcecodeLine = getStartSourceCodeLineForContext(ctx); + String enrichedLine = + String.format("%s.Item=%s.Key;\n" + + "delete %s ['Key'];\n", deleteParameter, deleteParameter, deleteParameter); + sourcecodeLine.setReplaceLine(enrichedLine); + } + + + private void replaceDeleteOperation(StatementContext ctx, String oldValue, String newValue) { + var sourcecodeLine = getStartSourceCodeLineForContext(ctx); + String alternativeLine = sourcecodeLine.getSourceLine().replace(oldValue, newValue); + SourceCodeLine sourceCodeLine = getStartSourceCodeLineForContext(ctx); + String oldReplaceLine = sourcecodeLine.getReplaceLine(); + sourceCodeLine.setReplaceLine(oldReplaceLine + alternativeLine); + } + + private void addRelationsCoveredFunctionCall(StatementContext ctx) { + var nodeOptional = graph.findNodeByID(idOfNode); + if (nodeOptional.isPresent()) { + var node = nodeOptional.get(); + var arrows = node.getOutgoingArrows(); + for (var arrow : arrows) { + var successor = arrow.getSuccessorNode(); + if (NodeType.FUNCTION.equals(successor.getType())) { + SourceCodeLine sourceCodeLine = getStartSourceCodeLineForContext(ctx); + if (!AccessMode.RETURN.equals(arrow.getAccessMode())) { + sourceCodeLine.addRelationCoveredByStatement(arrow.getIdentifier()); + } + } + } + } + } + + private void addNodesAndRelationsCoveredByCallback(StatementContext ctx) { + var nodeOptional = graph.findNodeByID(idOfNode); + if (nodeOptional.isPresent()) { + var node = nodeOptional.get(); + var arrows = node.getOutgoingArrows(); + for (var arrow : arrows) { + var successor = arrow.getSuccessorNode(); + if (NodeType.FUNCTION.equals(successor.getType())) { + SourceCodeLine sourceCodeLine = getStartSourceCodeLineForContext(ctx); + if (AccessMode.RETURN.equals(arrow.getAccessMode())) { + sourceCodeLine.addRelationCoveredByStatement(arrow.getIdentifier()); + } + } + } + } + } + + private void addDependenciesForNodeType(StatementContext ctx) { + var nodeOptional = graph.findNodeByID(idOfNode); + if (nodeOptional.isPresent()) { + var node = nodeOptional.get(); + var arrows = node.getOutgoingArrows(); + for (var arrow : arrows) { + var successor = arrow.getSuccessorNode(); + if (NodeType.DATA_STORAGE.equals(successor.getType())) { + SourceCodeLine sourceCodeLine = getStartSourceCodeLineForContext(ctx); + if (!NodeType.FUNCTION.equals(successor.getType())) { + sourceCodeLine.addNodeCoveredByStatement(successor.getIdentifier()); + } + sourceCodeLine.addRelationCoveredByStatement(arrow.getIdentifier()); + } + } + } + } + + private SourceCodeLine getStartSourceCodeLineForContext(StatementContext context) { + return lines.get(context.start.getLine() - 1); + } + + private SourceCodeLine getStartSourceCodeLine(FunctionBodyContext context) { + return lines.get(context.start.getLine() - 1); + } + + private SourceCodeLine getEndSourceCodeLineForContext(StatementContext context) { + return lines.get(context.stop.getLine() - 1); + } + + @Override + public T visitIdentifier(IdentifierContext ctx) { + if (potentialDefs.containsKey(ctx.getText())) { + if (GraphHelper.isIdentifierDefinition(ctx)) { + Set listOfDefs = potentialDefs.get(ctx.getText()); + StatementContext statement = GraphHelper.getStatementOfContext(ctx); + if (statement != null) { + listOfDefs.add(statement); + } + } + + } + if (useVariablesOfReads.containsKey(ctx.getText())) { + if (GraphHelper.isIdentifierUsage(ctx)) { + if (adaptForDeletes) { + addUsesForReadsIfDeleteActive(ctx, ctx.getText()); + } else { + addUsesForRead(ctx, ctx.getText()); + } + } + } + if (useVariablesOfEvents.containsKey(ctx.getText())) { + if (GraphHelper.isIdentifierUsage(ctx)) { + addUsesForEvents(ctx, ctx.getText()); + } + } + if (useVariablesOfReturns.containsKey(ctx.getText())) { + if (GraphHelper.isIdentifierUsage(ctx)) { + addUsesForReturns(ctx, ctx.getText()); + } + } + return super.visitIdentifier(ctx); + } + + @Override + public T visitVariableDeclaration(JavaScriptParser.VariableDeclarationContext ctx) { + + String varName = GraphHelper.getVariableNameOfDefinition(ctx); + StatementContext statement = GraphHelper.getStatementOfContext(ctx); + if (statement != null && varName != null) { + Set statementsOfDefs = new HashSet<>(); + statementsOfDefs.add(statement); + potentialDefs.put(varName, statementsOfDefs); + } + return super.visitVariableDeclaration(ctx); + } + + private void addUsesForEvents(IdentifierContext ctx, String useVar) { + var statementOptional = GraphHelper.getStatementOfContext2(ctx); + if (statementOptional.isPresent()) { + var statement = statementOptional.get(); + var sourcecodeLine = getStartSourceCodeLineForContext(statement); + String tracker = sourcecodeLine.getUseTracker("", idOfNode); + String useTracker = String.format("console.log(%s.DefTracker + \"%s\");", useVar, tracker); + sourcecodeLine.setUse(useTracker); + var relations = getRelationsInfluencingUseOfEvent(); + sourcecodeLine.setRelationsInfluencingUse(relations); + } + } + + private void addUsesForRead(IdentifierContext ctx, String useVar) { + var statementOptional = GraphHelper.getStatementOfContext2(ctx); + if (statementOptional.isPresent()) { + var statement = statementOptional.get(); + var sourcecodeLine = getStartSourceCodeLineForContext(statement); + String tracker = sourcecodeLine.getUseTracker("", idOfNode); + + String useTracker = String.format("console.log(%s?.Item?.DefTracker?.S + \"%s\");" + , useVar, tracker); + sourcecodeLine.setUse(useTracker); + var relations = getRelationsInfluencingUseOfRead(); + sourcecodeLine.setRelationsInfluencingUse(relations); + } + } + + private void addUsesForReadsIfDeleteActive(IdentifierContext ctx, String useVar) { + var statementOptional = GraphHelper.getStatementOfContext2(ctx); + if (statementOptional.isPresent()) { + var statement = statementOptional.get(); + var sourcecodeLine = getStartSourceCodeLineForContext(statement); + String tracker = sourcecodeLine.getUseTracker("", idOfNode); + String useTracker = String.format( + "{%s = (dataBackup == undefined) ? %s : dataBackup;\n" + + "let deleteTracker = %s?.Item?.DeleteTracker?.S;\n" + + "if(deleteTracker != undefined){\n" + + "\tconsole.log(deleteTracker + \"%s\");\n" + + "var dataBackup = data;\n" + + "\t%s = {};\n" + + "}else{\n" + + "\tconsole.log(%s?.Item?.DefTracker?.S + \"%s\");\n" + + "}}" + , useVar, useVar, useVar, tracker, useVar, useVar, tracker); + sourcecodeLine.setUse(useTracker); + var relations = getRelationsInfluencingUseOfRead(); + sourcecodeLine.setRelationsInfluencingUse(relations); + } + } + + + private void addUsesForReturns(IdentifierContext ctx, String useVar) { + var statementOptional = GraphHelper.getStatementOfContext2(ctx); + if (statementOptional.isPresent()) { + var statement = statementOptional.get(); + var sourcecodeLine = getStartSourceCodeLineForContext(statement); + String tracker = sourcecodeLine.getUseTracker("", idOfNode); + String useTracker = String.format("console.log(JSON.parse(%s.Payload)[\"DefTracker\"] + \"%s\");", useVar, tracker); + sourcecodeLine.setUse(useTracker); + var relations = getRelationsInfluencingUseOfCallback(); + sourcecodeLine.setRelationsInfluencingUse(relations); + } + } + + private List getRelationsInfluencingUseOfCallback() { + var nodeOptional = graph.findNodeByID(idOfNode); + var neighboursArrows = new ArrayList(); + if (nodeOptional.isPresent()) { + var node = nodeOptional.get(); + var arrows = node.getIncomingArrows(); + for (var arrow : arrows) { + var predecessorNode = arrow.getPredecessorNode(); + if (NodeType.FUNCTION.equals(predecessorNode.getType()) && AccessMode.RETURN.equals(arrow.getAccessMode())) { + neighboursArrows.add(arrow.getIdentifier()); + } + } + } + return neighboursArrows; + } + + private List getRelationsInfluencingUseOfEvent() { + var nodeOptional = graph.findNodeByID(idOfNode); + var neighboursArrows = new ArrayList(); + if (nodeOptional.isPresent()) { + var node = nodeOptional.get(); + var arrows = node.getIncomingArrows(); + for (var arrow : arrows) { + var predecessorNode = arrow.getPredecessorNode(); + if (!AccessMode.RETURN.equals(arrow.getAccessMode())) { + neighboursArrows.add(arrow.getIdentifier()); + } + } + } + return neighboursArrows; + } + + private List getRelationsInfluencingUseOfRead() { + var nodeOptional = graph.findNodeByID(idOfNode); + var neighboursArrows = new ArrayList(); + if (nodeOptional.isPresent()) { + var node = nodeOptional.get(); + var arrows = node.getOutgoingArrows(); + for (var arrow : arrows) { + var successor = arrow.getSuccessorNode(); + if (NodeType.DATA_STORAGE.equals(successor.getType()) && AccessMode.READ.equals(arrow.getAccessMode())) { + neighboursArrows.add(arrow.getIdentifier()); + } + } + } + return neighboursArrows; + } + + private void addDefsForCallbacks(String parameterOfReturn) { + if (potentialDefs.containsKey(parameterOfReturn)) { + Set defsToBeInstrumented = potentialDefs.get(parameterOfReturn); + for (StatementContext statement : defsToBeInstrumented) { + var sourcecodeLine = getEndSourceCodeLineForContext(statement); + String tracker = sourcecodeLine.getDefTracker("", idOfNode); + String defTracker = String.format("%s.DefTracker=\"%s\";", parameterOfReturn, tracker); + sourcecodeLine.setDefKey(defTracker); + addDRelationDependencyEntryToSuccessorCallbacks(sourcecodeLine); + } + } + } + + private void addRelationDependencyEntryToSuccessorFunctions(SourceCodeLine sourcecodeLine) { + var nodeOptional = graph.findNodeByID(idOfNode); + if (nodeOptional.isPresent()) { + var neighboursArrows = new ArrayList(); + var node = nodeOptional.get(); + var arrows = node.getOutgoingArrows(); + for (var arrow : arrows) { + var successorNode = arrow.getSuccessorNode(); + if (NodeType.FUNCTION.equals(successorNode.getType()) && !AccessMode.RETURN.equals(arrow.getAccessMode())) { + neighboursArrows.add(arrow.getIdentifier()); + } + } + sourcecodeLine.setRelationsInfluencedByDef(neighboursArrows); + } + } + + private void addDRelationDependencyEntryToSuccessorCallbacks(SourceCodeLine sourcecodeLine) { + var nodeOptional = graph.findNodeByID(idOfNode); + if (nodeOptional.isPresent()) { + var neighboursArrows = new ArrayList(); + var node = nodeOptional.get(); + var arrows = node.getOutgoingArrows(); + for (var arrow : arrows) { + var successorNode = arrow.getSuccessorNode(); + if (NodeType.FUNCTION.equals(successorNode.getType()) && AccessMode.RETURN.equals(arrow.getAccessMode())) { + neighboursArrows.add(arrow.getIdentifier()); + } + } + sourcecodeLine.setRelationsInfluencedByDef(neighboursArrows); + } + } + + private void addDefsForWrite(String writeParameter) { + if (potentialDefs.containsKey(writeParameter)) { + Set defsToBeInstrumented = potentialDefs.get(writeParameter); + for (StatementContext statement : defsToBeInstrumented) { + var itemOptional = GraphHelper.hasStatementItem(statement); + if (itemOptional.isPresent()) { + var sourcecodeLine = getEndSourceCodeLineForContext(statement); + String tracker = sourcecodeLine.getDefTracker("", idOfNode); + String defTracker = String.format("%s.Item.DefTracker={S : \"%s\"};", writeParameter, tracker); + sourcecodeLine.setDefKey(defTracker); + + var nodeOptional = graph.findNodeByID(idOfNode); + if (nodeOptional.isPresent()) { + var neighboursArrows = new ArrayList(); + var node = nodeOptional.get(); + var arrows = node.getOutgoingArrows(); + for (var arrow : arrows) { + var successorNode = arrow.getSuccessorNode(); + if (NodeType.DATA_STORAGE.equals(successorNode.getType())) { + neighboursArrows.add(arrow.getIdentifier()); + } + } + sourcecodeLine.setRelationsInfluencedByDef(neighboursArrows); + } + } + } + } + } + + + private void addDefsForDelete(String deleteParameter) { + if (potentialDefs.containsKey(deleteParameter)) { + Set defsToBeInstrumented = potentialDefs.get(deleteParameter); + for (StatementContext statement : defsToBeInstrumented) { + var sourcecodeLine = getEndSourceCodeLineForContext(statement); + String tracker = sourcecodeLine.getDefTracker("", idOfNode); + String defTracker = String.format("%s.Key.DeleteTracker={S : \"%s\"};", deleteParameter, tracker); + sourcecodeLine.setDefKey(defTracker); + var nodeOptional = graph.findNodeByID(idOfNode); + if (nodeOptional.isPresent()) { + var neighboursArrows = new ArrayList(); + var node = nodeOptional.get(); + var arrows = node.getOutgoingArrows(); + for (var arrow : arrows) { + var successorNode = arrow.getSuccessorNode(); + if (NodeType.DATA_STORAGE.equals(successorNode.getType())) { + neighboursArrows.add(arrow.getIdentifier()); + } + } + sourcecodeLine.setRelationsInfluencedByDef(neighboursArrows); + } + } + } + } + + + private void addDefinitionForFunctionCall(String lambdaParameter) { + if (potentialDefs.containsKey(lambdaParameter)) { + Set defsToBeInstrumented = potentialDefs.get(lambdaParameter); + for (StatementContext statement : defsToBeInstrumented) { + System.out.println(statement.getText()); + var payloadOptional = GraphHelper.hasStatementPayload(statement); + if (payloadOptional.isPresent()) { + var payload = payloadOptional.get(); + String jsonContent = GraphHelper.getJSONForPayload(payload); + if (!jsonContent.isBlank()) { + // Map jsonKeys = new Gson().fromJson(jsonContent, Map.class); + var sourcecodeLine = getEndSourceCodeLineForContext(statement); + StringBuilder builder = new StringBuilder(); + // for (var key : jsonKeys.keySet()) { + String tracker = sourcecodeLine.getDefTracker("", idOfNode); + builder.append(String.format( + "var content = JSON.parse(%s.Payload); content.DefTracker=\"%s\";%s.Payload=JSON.stringify(content);", + lambdaParameter, tracker, lambdaParameter)); + //} + sourcecodeLine.setDefKey(builder.toString()); + addRelationDependencyEntryToSuccessorFunctions(sourcecodeLine); + } + } + } + } + } + +} \ No newline at end of file diff --git a/src/main/java/logic/sourcecodeanalyzer/antlr/JavaScriptLexerUsedForParserCreation b/src/main/java/logic/sourcecodeanalyzer/antlr/JavaScriptLexerUsedForParserCreation new file mode 100644 index 0000000..c2ad2ff --- /dev/null +++ b/src/main/java/logic/sourcecodeanalyzer/antlr/JavaScriptLexerUsedForParserCreation @@ -0,0 +1,708 @@ +/* + * The MIT License (MIT) + * + * Copyright (c) 2014 by Bart Kiers (original author) and Alexandre Vitorelli (contributor -> ported to CSharp) + * Copyright (c) 2017-2020 by Ivan Kochurkin (Positive Technologies): + added ECMAScript 6 support, cleared and transformed to the universal grammar. + * Copyright (c) 2018 by Juan Alvarez (contributor -> ported to Go) + * Copyright (c) 2019 by Student Main (contributor -> ES2020) + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ +lexer grammar JavaScriptLexer; + +channels { ERROR } + +options { superClass=JavaScriptLexerBase; } + +HashBangLine: { this.IsStartOfFile()}? '#!' ~[\r\n\u2028\u2029]*; // only allowed at start +MultiLineComment: '/*' .*? '*/' -> channel(HIDDEN); +SingleLineComment: '//' ~[\r\n\u2028\u2029]* -> channel(HIDDEN); +RegularExpressionLiteral: '/' RegularExpressionFirstChar RegularExpressionChar* {this.IsRegexPossible()}? '/' IdentifierPart*; + +OpenBracket: '['; +CloseBracket: ']'; +OpenParen: '('; +CloseParen: ')'; +OpenBrace: '{' {this.ProcessOpenBrace();}; +CloseBrace: '}' {this.ProcessCloseBrace();}; +SemiColon: ';'; +Comma: ','; +Assign: '='; +QuestionMark: '?'; +Colon: ':'; +Ellipsis: '...'; +Dot: '.'; +PlusPlus: '++'; +MinusMinus: '--'; +Plus: '+'; +Minus: '-'; +BitNot: '~'; +Not: '!'; +Multiply: '*'; +Divide: '/'; +Modulus: '%'; +Power: '**'; +NullCoalesce: '??'; +Hashtag: '#'; +RightShiftArithmetic: '>>'; +LeftShiftArithmetic: '<<'; +RightShiftLogical: '>>>'; +LessThan: '<'; +MoreThan: '>'; +LessThanEquals: '<='; +GreaterThanEquals: '>='; +Equals_: '=='; +NotEquals: '!='; +IdentityEquals: '==='; +IdentityNotEquals: '!=='; +BitAnd: '&'; +BitXOr: '^'; +BitOr: '|'; +And: '&&'; +Or: '||'; +MultiplyAssign: '*='; +DivideAssign: '/='; +ModulusAssign: '%='; +PlusAssign: '+='; +MinusAssign: '-='; +LeftShiftArithmeticAssign: '<<='; +RightShiftArithmeticAssign: '>>='; +RightShiftLogicalAssign: '>>>='; +BitAndAssign: '&='; +BitXorAssign: '^='; +BitOrAssign: '|='; +PowerAssign: '**='; +ARROW: '=>'; + +/// Null Literals + +NullLiteral: 'null'; + +/// Boolean Literals + +BooleanLiteral: 'true' + | 'false'; + +/// Numeric Literals + +DecimalLiteral: DecimalIntegerLiteral '.' [0-9] [0-9_]* ExponentPart? + | '.' [0-9] [0-9_]* ExponentPart? + | DecimalIntegerLiteral ExponentPart? + ; + +/// Numeric Literals + +HexIntegerLiteral: '0' [xX] [0-9a-fA-F] HexDigit*; +OctalIntegerLiteral: '0' [0-7]+ {!this.IsStrictMode()}?; +OctalIntegerLiteral2: '0' [oO] [0-7] [_0-7]*; +BinaryIntegerLiteral: '0' [bB] [01] [_01]*; + +BigHexIntegerLiteral: '0' [xX] [0-9a-fA-F] HexDigit* 'n'; +BigOctalIntegerLiteral: '0' [oO] [0-7] [_0-7]* 'n'; +BigBinaryIntegerLiteral: '0' [bB] [01] [_01]* 'n'; +BigDecimalIntegerLiteral: DecimalIntegerLiteral 'n'; + +/// Keywords + +Break: 'break'; +Do: 'do'; +Instanceof: 'instanceof'; +Typeof: 'typeof'; +Case: 'case'; +Else: 'else'; +New: 'new'; +Var: 'var'; +Catch: 'catch'; +Finally: 'finally'; +Return: 'return'; +Void: 'void'; +Continue: 'continue'; +For: 'for'; +Switch: 'switch'; +While: 'while'; +Debugger: 'debugger'; +Function: 'function'; +This: 'this'; +With: 'with'; +Default: 'default'; +If: 'if'; +Throw: 'throw'; +Delete: 'delete'; +In: 'in'; +Try: 'try'; +As: 'as'; +From: 'from'; + +/// Future Reserved Words + +Class: 'class'; +Enum: 'enum'; +Extends: 'extends'; +Super: 'super'; +Const: 'const'; +Export: 'export'; +Import: 'import'; + +Async: 'async'; +Await: 'await'; + +/// The following tokens are also considered to be FutureReservedWords +/// when parsing strict mode + +Implements: 'implements' {this.IsStrictMode()}?; +StrictLet: 'let' {this.IsStrictMode()}?; +NonStrictLet: 'let' {!this.IsStrictMode()}?; +Private: 'private' {this.IsStrictMode()}?; +Public: 'public' {this.IsStrictMode()}?; +Interface: 'interface' {this.IsStrictMode()}?; +Package: 'package' {this.IsStrictMode()}?; +Protected: 'protected' {this.IsStrictMode()}?; +Static: 'static' {this.IsStrictMode()}?; +Yield: 'yield' {this.IsStrictMode()}?; + +/// Identifier Names and Identifiers + +Identifier: IdentifierStart IdentifierPart*; +/// String Literals +StringLiteral: ('"' DoubleStringCharacter* '"' + | '\'' SingleStringCharacter* '\'') {this.ProcessStringLiteral();} + ; + +// TODO: `${`tmp`}` +TemplateStringLiteral: '`' ('\\`' | ~'`')* '`'; + +WhiteSpaces: [\t\u000B\u000C\u0020\u00A0]+ -> channel(HIDDEN); + +LineTerminator: [\r\n\u2028\u2029] -> channel(HIDDEN); + +/// Comments + + +HtmlComment: '' -> channel(HIDDEN); +CDataComment: '' -> channel(HIDDEN); +UnexpectedCharacter: . -> channel(ERROR); + +// Fragment rules + +fragment DoubleStringCharacter + : ~["\\\r\n] + | '\\' EscapeSequence + | LineContinuation + ; + +fragment SingleStringCharacter + : ~['\\\r\n] + | '\\' EscapeSequence + | LineContinuation + ; + +fragment EscapeSequence + : CharacterEscapeSequence + | '0' // no digit ahead! TODO + | HexEscapeSequence + | UnicodeEscapeSequence + | ExtendedUnicodeEscapeSequence + ; + +fragment CharacterEscapeSequence + : SingleEscapeCharacter + | NonEscapeCharacter + ; + +fragment HexEscapeSequence + : 'x' HexDigit HexDigit + ; + +fragment UnicodeEscapeSequence + : 'u' HexDigit HexDigit HexDigit HexDigit + | 'u' '{' HexDigit HexDigit+ '}' + ; + +fragment ExtendedUnicodeEscapeSequence + : 'u' '{' HexDigit+ '}' + ; + +fragment SingleEscapeCharacter + : ['"\\bfnrtv] + ; + +fragment NonEscapeCharacter + : ~['"\\bfnrtv0-9xu\r\n] + ; + +fragment EscapeCharacter + : SingleEscapeCharacter + | [0-9] + | [xu] + ; + +fragment LineContinuation + : '\\' [\r\n\u2028\u2029] + ; + +fragment HexDigit + : [_0-9a-fA-F] + ; + +fragment DecimalIntegerLiteral + : '0' + | [1-9] [0-9_]* + ; + +fragment ExponentPart + : [eE] [+-]? [0-9_]+ + ; + +fragment IdentifierPart + : IdentifierStart + | UnicodeCombiningMark + | UnicodeDigit + | UnicodeConnectorPunctuation + | '\u200C' + | '\u200D' + ; + +fragment IdentifierStart + : UnicodeLetter + | [$_] + | '\\' UnicodeEscapeSequence + ; + +fragment UnicodeLetter + : [\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-\u4DBF] + | [\u4E00-\u9FFF] + | [\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] + ; + +fragment UnicodeCombiningMark + : [\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] + ; + +fragment UnicodeDigit + : [\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] + ; + +fragment UnicodeConnectorPunctuation + : [\u005F] + | [\u203F-\u2040] + | [\u30FB] + | [\uFE33-\uFE34] + | [\uFE4D-\uFE4F] + | [\uFF3F] + | [\uFF65] + ; + +fragment RegularExpressionFirstChar + : ~[*\r\n\u2028\u2029\\/[] + | RegularExpressionBackslashSequence + | '[' RegularExpressionClassChar* ']' + ; + +fragment RegularExpressionChar + : ~[\r\n\u2028\u2029\\/[] + | RegularExpressionBackslashSequence + | '[' RegularExpressionClassChar* ']' + ; + +fragment RegularExpressionClassChar + : ~[\r\n\u2028\u2029\]\\] + | RegularExpressionBackslashSequence + ; + +fragment RegularExpressionBackslashSequence + : '\\' ~[\r\n\u2028\u2029] + ; \ No newline at end of file diff --git a/src/main/java/logic/sourcecodeanalyzer/antlr/JavaScriptParserUsedForParserCreation b/src/main/java/logic/sourcecodeanalyzer/antlr/JavaScriptParserUsedForParserCreation new file mode 100644 index 0000000..c3a0d86 --- /dev/null +++ b/src/main/java/logic/sourcecodeanalyzer/antlr/JavaScriptParserUsedForParserCreation @@ -0,0 +1,511 @@ +/* + * The MIT License (MIT) + * + * Copyright (c) 2014 by Bart Kiers (original author) and Alexandre Vitorelli (contributor -> ported to CSharp) + * Copyright (c) 2017-2020 by Ivan Kochurkin (Positive Technologies): + added ECMAScript 6 support, cleared and transformed to the universal grammar. + * Copyright (c) 2018 by Juan Alvarez (contributor -> ported to Go) + * Copyright (c) 2019 by Student Main (contributor -> ES2020) + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ +parser grammar JavaScriptParser; + +options { + tokenVocab=JavaScriptLexer; + superClass=JavaScriptParserBase; +} + +program + : HashBangLine? sourceElements? EOF + ; + +sourceElement + : statement + ; + +statement + : block + | variableStatement + | importStatement + | exportStatement + | emptyStatement + | classDeclaration + | expressionStatement + | ifStatement + | iterationStatement + | continueStatement + | breakStatement + | returnStatement + | yieldStatement + | withStatement + | labelledStatement + | switchStatement + | throwStatement + | tryStatement + | debuggerStatement + | functionDeclaration + ; + +block + : '{' statementList? '}' + ; + +statementList + : statement+ + ; + +importStatement + : Import importFromBlock + ; + +importFromBlock + : importDefault? (importNamespace | moduleItems) importFrom eos + | StringLiteral eos + ; + +moduleItems + : '{' (aliasName ',')* (aliasName ','?)? '}' + ; + +importDefault + : aliasName ',' + ; + +importNamespace + : ('*' | identifierName) (As identifierName)? + ; + +importFrom + : From StringLiteral + ; + +aliasName + : identifierName (As identifierName)? + ; + +exportStatement + : Export (exportFromBlock | declaration) eos # ExportDeclaration + | Export Default singleExpression eos # ExportDefaultDeclaration + ; + +exportFromBlock + : importNamespace importFrom eos + | moduleItems importFrom? eos + ; + +declaration + : variableStatement + | classDeclaration + | functionDeclaration + ; + +variableStatement + : variableDeclarationList eos + ; + +variableDeclarationList + : varModifier variableDeclaration (',' variableDeclaration)* + ; + +variableDeclaration + : assignable ('=' singleExpression)? // ECMAScript 6: Array & Object Matching + ; + +emptyStatement + : SemiColon + ; + +expressionStatement + : {this.notOpenBraceAndNotFunction()}? expressionSequence eos + ; + +ifStatement + : If '(' expressionSequence ')' statement (Else statement)? + ; + + +iterationStatement + : Do statement While '(' expressionSequence ')' eos # DoStatement + | While '(' expressionSequence ')' statement # WhileStatement + | For '(' (expressionSequence | variableDeclarationList)? ';' expressionSequence? ';' expressionSequence? ')' statement # ForStatement + | For '(' (singleExpression | variableDeclarationList) In expressionSequence ')' statement # ForInStatement + // strange, 'of' is an identifier. and this.p("of") not work in sometime. + | For Await? '(' (singleExpression | variableDeclarationList) identifier{this.p("of")}? expressionSequence ')' statement # ForOfStatement + ; + +varModifier // let, const - ECMAScript 6 + : Var + | let + | Const + ; + +continueStatement + : Continue ({this.notLineTerminator()}? identifier)? eos + ; + +breakStatement + : Break ({this.notLineTerminator()}? identifier)? eos + ; + +returnStatement + : Return ({this.notLineTerminator()}? expressionSequence)? eos + ; + +yieldStatement + : Yield ({this.notLineTerminator()}? expressionSequence)? eos + ; + +withStatement + : With '(' expressionSequence ')' statement + ; + +switchStatement + : Switch '(' expressionSequence ')' caseBlock + ; + +caseBlock + : '{' caseClauses? (defaultClause caseClauses?)? '}' + ; + +caseClauses + : caseClause+ + ; + +caseClause + : Case expressionSequence ':' statementList? + ; + +defaultClause + : Default ':' statementList? + ; + +labelledStatement + : identifier ':' statement + ; + +throwStatement + : Throw {this.notLineTerminator()}? expressionSequence eos + ; + +tryStatement + : Try block (catchProduction finallyProduction? | finallyProduction) + ; + +catchProduction + : Catch ('(' assignable? ')')? block + ; + +finallyProduction + : Finally block + ; + +debuggerStatement + : Debugger eos + ; + +functionDeclaration + : Async? Function '*'? identifier '(' formalParameterList? ')' '{' functionBody '}' + ; + +classDeclaration + : Class identifier classTail + ; + +classTail + : (Extends singleExpression)? '{' classElement* '}' + ; + +classElement + : (Static | {this.n("static")}? identifier | Async)* (methodDefinition | assignable '=' objectLiteral ';') + | emptyStatement + | '#'? propertyName '=' singleExpression + ; + +methodDefinition + : '*'? '#'? propertyName '(' formalParameterList? ')' '{' functionBody '}' + | '*'? '#'? getter '(' ')' '{' functionBody '}' + | '*'? '#'? setter '(' formalParameterList? ')' '{' functionBody '}' + ; + +formalParameterList + : formalParameterArg (',' formalParameterArg)* (',' lastFormalParameterArg)? + | lastFormalParameterArg + ; + +formalParameterArg + : assignable ('=' singleExpression)? // ECMAScript 6: Initialization + ; + +lastFormalParameterArg // ECMAScript 6: Rest Parameter + : Ellipsis singleExpression + ; + +functionBody + : sourceElements? + ; + +sourceElements + : sourceElement+ + ; + +arrayLiteral + : ('[' elementList ']') + ; + +elementList + : ','* arrayElement? (','+ arrayElement)* ','* // Yes, everything is optional + ; + +arrayElement + : Ellipsis? singleExpression + ; + +propertyAssignment + : propertyName ':' singleExpression # PropertyExpressionAssignment + | '[' singleExpression ']' ':' singleExpression # ComputedPropertyExpressionAssignment + | Async? '*'? propertyName '(' formalParameterList? ')' '{' functionBody '}' # FunctionProperty + | getter '(' ')' '{' functionBody '}' # PropertyGetter + | setter '(' formalParameterArg ')' '{' functionBody '}' # PropertySetter + | Ellipsis? singleExpression # PropertyShorthand + ; + +propertyName + : identifierName + | StringLiteral + | numericLiteral + | '[' singleExpression ']' + ; + +arguments + : '('(argument (',' argument)* ','?)?')' + ; + +argument + : Ellipsis? (singleExpression | identifier) + ; + +expressionSequence + : singleExpression (',' singleExpression)* + ; + +singleExpression + : anoymousFunction # FunctionExpression + | Class identifier? classTail # ClassExpression + | singleExpression '[' expressionSequence ']' # MemberIndexExpression + | singleExpression '?'? '.' '#'? identifierName # MemberDotExpression + | singleExpression arguments # ArgumentsExpression + | New singleExpression arguments? # NewExpression + | New '.' identifier # MetaExpression // new.target + | singleExpression {this.notLineTerminator()}? '++' # PostIncrementExpression + | singleExpression {this.notLineTerminator()}? '--' # PostDecreaseExpression + | Delete singleExpression # DeleteExpression + | Void singleExpression # VoidExpression + | Typeof singleExpression # TypeofExpression + | '++' singleExpression # PreIncrementExpression + | '--' singleExpression # PreDecreaseExpression + | '+' singleExpression # UnaryPlusExpression + | '-' singleExpression # UnaryMinusExpression + | '~' singleExpression # BitNotExpression + | '!' singleExpression # NotExpression + | Await singleExpression # AwaitExpression + | singleExpression '**' singleExpression # PowerExpression + | singleExpression ('*' | '/' | '%') singleExpression # MultiplicativeExpression + | singleExpression ('+' | '-') singleExpression # AdditiveExpression + | singleExpression '??' singleExpression # CoalesceExpression + | singleExpression ('<<' | '>>' | '>>>') singleExpression # BitShiftExpression + | singleExpression ('<' | '>' | '<=' | '>=') singleExpression # RelationalExpression + | singleExpression Instanceof singleExpression # InstanceofExpression + | singleExpression In singleExpression # InExpression + | singleExpression ('==' | '!=' | '===' | '!==') singleExpression # EqualityExpression + | singleExpression '&' singleExpression # BitAndExpression + | singleExpression '^' singleExpression # BitXOrExpression + | singleExpression '|' singleExpression # BitOrExpression + | singleExpression '&&' singleExpression # LogicalAndExpression + | singleExpression '||' singleExpression # LogicalOrExpression + | singleExpression '?' singleExpression ':' singleExpression # TernaryExpression + | singleExpression '=' singleExpression # AssignmentExpression + | singleExpression assignmentOperator singleExpression # AssignmentOperatorExpression + | Import '(' singleExpression ')' # ImportExpression + | singleExpression TemplateStringLiteral # TemplateStringExpression // ECMAScript 6 + | yieldStatement # YieldExpression // ECMAScript 6 + | This # ThisExpression + | identifier # IdentifierExpression + | Super # SuperExpression + | literal # LiteralExpression + | arrayLiteral # ArrayLiteralExpression + | objectLiteral # ObjectLiteralExpression + | '(' expressionSequence ')' # ParenthesizedExpression + ; + +assignable + : identifier + | arrayLiteral + | objectLiteral + ; + +objectLiteral + : '{' (propertyAssignment (',' propertyAssignment)*)? ','? '}' + ; + +anoymousFunction + : functionDeclaration # FunctionDecl + | Async? Function '*'? '(' formalParameterList? ')' '{' functionBody '}' # AnoymousFunctionDecl + | Async? arrowFunctionParameters '=>' arrowFunctionBody # ArrowFunction + ; + +arrowFunctionParameters + : identifier + | '(' formalParameterList? ')' + ; + +arrowFunctionBody + : singleExpression + | '{' functionBody '}' + ; + +assignmentOperator + : '*=' + | '/=' + | '%=' + | '+=' + | '-=' + | '<<=' + | '>>=' + | '>>>=' + | '&=' + | '^=' + | '|=' + | '**=' + ; + +literal + : NullLiteral + | BooleanLiteral + | StringLiteral + | TemplateStringLiteral + | RegularExpressionLiteral + | numericLiteral + | bigintLiteral + ; + +numericLiteral + : DecimalLiteral + | HexIntegerLiteral + | OctalIntegerLiteral + | OctalIntegerLiteral2 + | BinaryIntegerLiteral + ; + +bigintLiteral + : BigDecimalIntegerLiteral + | BigHexIntegerLiteral + | BigOctalIntegerLiteral + | BigBinaryIntegerLiteral + ; + +getter + : {this.n("get")}? identifier propertyName + ; + +setter + : {this.n("set")}? identifier propertyName + ; + +identifierName + : identifier + | reservedWord + ; + +identifier + : Identifier + | NonStrictLet + | Async + ; + +reservedWord + : keyword + | NullLiteral + | BooleanLiteral + ; + +keyword + : Break + | Do + | Instanceof + | Typeof + | Case + | Else + | New + | Var + | Catch + | Finally + | Return + | Void + | Continue + | For + | Switch + | While + | Debugger + | Function + | This + | With + | Default + | If + | Throw + | Delete + | In + | Try + + | Class + | Enum + | Extends + | Super + | Const + | Export + | Import + | Implements + | let + | Private + | Public + | Interface + | Package + | Protected + | Static + | Yield + | Async + | Await + | From + | As + ; + +let + : NonStrictLet + | StrictLet + ; + +eos + : SemiColon + | EOF + | {this.lineTerminatorAhead()}? + | {this.closeBrace()}? + ; diff --git a/src/main/java/logic/testcasegenerator/TestCaseGenerator.java b/src/main/java/logic/testcasegenerator/TestCaseGenerator.java new file mode 100644 index 0000000..944e72b --- /dev/null +++ b/src/main/java/logic/testcasegenerator/TestCaseGenerator.java @@ -0,0 +1,19 @@ +package logic.testcasegenerator; + + +import logic.model.TestSuite; + +/** + * Interface expects graph as JSON since a separate web gui is planned + */ +public interface TestCaseGenerator { + TestSuite getResourceCoverage(String graphJSON); + + TestSuite getRelationCoverage(String graphJSON); + + TestSuite getAllDefsCoverage(String graphJSON); + + TestSuite getDefUseCoverage(String graphJSON); + + TestSuite getAllUsesCoverage(String graphJSON); +} diff --git a/src/main/java/logic/testcasegenerator/TestCaseGeneratorImpl.java b/src/main/java/logic/testcasegenerator/TestCaseGeneratorImpl.java new file mode 100644 index 0000000..4f86a6b --- /dev/null +++ b/src/main/java/logic/testcasegenerator/TestCaseGeneratorImpl.java @@ -0,0 +1,673 @@ +package logic.testcasegenerator; + +import logic.model.*; +import logic.testcasegenerator.coveragetargets.*; +import logic.testcasegenerator.coveragetargets.aspect.DefUsePair; +import logic.testcasegenerator.coveragetargets.aspect.FunctionWithDefSourceLine; +import logic.testcasegenerator.coveragetargets.aspect.FunctionWithSourceLine; +import logic.testcasegenerator.coveragetargets.aspect.FunctionWithUseSourceLine; + +import java.util.*; +import java.util.stream.Collectors; + +import static logic.testcasegenerator.coveragetargets.LogNameConfiguration.*; + +public class TestCaseGeneratorImpl implements TestCaseGenerator { + @Override + public TestSuite getResourceCoverage(String graphJSON) { + Graph graph = new Graph(graphJSON); + graph.addRelationsToElements(); + + List coverageTargets = getAllTargetsToBeCoveredByAllResources(graph); + + for (var target : coverageTargets) { + var node = target.getAspect(); + List testcases = getTestcasesCoveringNode(node, graph); + target.addTestcases(testcases); + } + + TestSuite testsuite = new TestSuite(); + testsuite.add(coverageTargets); + return testsuite; + } + + private List getTestcasesCoveringNode(NodeModel node, Graph graph) { + List testcases = new ArrayList<>(); + var logStatements = List.of(String.format("%s%d%s", RESOURCE_MARKER, node.getIdentifier(), LOGDELIMITER)); + + if (NodeType.FUNCTION.equals(node.getType())) { + String target = String.format("Coverage of %s", node); + var serverlessFunction = new ServerlessFunction(node); + Testcase testcase = new Testcase(List.of(serverlessFunction), target, logStatements); + testcases.add(testcase); + } else { + var allArrows = graph.getArrows(); + List functionsToBeCalled = getFunctionCallingResource(node, allArrows); + for (var function : functionsToBeCalled) { + String target = String.format("Coverage of %s by calling %s", + node, function); + var serverlessFunction = new ServerlessFunction(function); + Testcase testcase = new Testcase(List.of(serverlessFunction), target, logStatements); + testcases.add(testcase); + } + if (functionsToBeCalled.isEmpty()) { + String target = String.format("Coverage of resource %s is not possible", node); + Testcase testcase = new Testcase(List.of(), target, logStatements); + testcases.add(testcase); + } + } + return testcases; + } + + private List getAllTargetsToBeCoveredByAllResources(Graph graph) { + List result = new ArrayList<>(); + graph.getNodes().forEach(node -> result.add(new CoverageTargetAllResources(node))); + return result; + } + + private List getFunctionCallingResource(NodeModel resource, List arrows) { + List arrowsNotConsidered = new ArrayList<>(arrows); + Queue relationsToBeInvestigated = new LinkedList<>(resource.getIncomingArrows()); + arrowsNotConsidered.removeAll(relationsToBeInvestigated); + List result = new ArrayList<>(); + + while (!relationsToBeInvestigated.isEmpty()) { + var incomingArrow = relationsToBeInvestigated.remove(); + var predecessorNode = incomingArrow.getPredecessorNode(); + if (NodeType.FUNCTION.equals(predecessorNode.getType())) { + result.add(predecessorNode); + } else { + for (var arrow : predecessorNode.getIncomingArrows()) { + if (arrowsNotConsidered.remove(arrow)) { + if (!AccessMode.READ.equals(arrow.getAccessMode())) { + relationsToBeInvestigated.add(arrow); + } + } + } + } + } + return result; + } + + @Override + public TestSuite getRelationCoverage(String graphJSON) { + Graph graph = new Graph(graphJSON); + graph.addRelationsToElements(); + + List coverageTargets = getAllTargetsToBeCoveredByAllRelations(graph); + + for (var target : coverageTargets) { + var arrow = target.getAspect(); + List testcases = getTestCasesCoveringArrow(arrow, graph); + target.addTestcases(testcases); + } + + TestSuite testsuite = new TestSuite(); + testsuite.add(coverageTargets); + return testsuite; + + } + + private List getTestCasesCoveringArrow(ArrowModel arrow, Graph graph) { + List testcases = new ArrayList<>(); + List functions = getFunctionsCallingBinding(arrow, graph); + var predecessorNode = arrow.getPredecessorNode(); + var successorNode = arrow.getSuccessorNode(); + var logStatements = List.of(String.format("%s%d%s", RELATION_MARKER, arrow.getIdentifier(), LOGDELIMITER)); + if (!functions.isEmpty()) { + for (var functionNode : functions) { + String target = String.format("Coverage of relation from %s " + + "to %s by calling %s", + predecessorNode, successorNode, functionNode); + var function = new ServerlessFunction(functionNode); + List functionsToBeCalled = List.of(function); + Testcase testcase = new Testcase(functionsToBeCalled, target, logStatements); + testcases.add(testcase); + } + } else { + String target = String.format("Coverage of relation from %s " + + "to %s is not possible", + predecessorNode, successorNode); + List functionsToBeCalled = List.of(); + Testcase testcase = new Testcase(functionsToBeCalled, target, logStatements); + testcases.add(testcase); + } + return testcases; + } + + private List getAllTargetsToBeCoveredByAllRelations(Graph graph) { + List result = new ArrayList<>(); + graph.getArrows().forEach(arrow -> result.add(new CoverageTargetAllRelations(arrow))); + return result; + } + + private List getFunctionsCallingBinding(ArrowModel arrow, Graph graph) { + List resultFunctions = new ArrayList<>(); + Queue relationsToIterate = new LinkedList<>(); + List relationsNotInvestigatedYet = new ArrayList<>(graph.getArrows()); + relationsToIterate.add(arrow); + relationsNotInvestigatedYet.remove(arrow); + while (!relationsToIterate.isEmpty()) { + ArrowModel currentArrow = relationsToIterate.remove(); + NodeModel predecessor = currentArrow.getPredecessorNode(); + if (NodeType.FUNCTION.equals(predecessor.getType()) && !AccessMode.RETURN.equals(currentArrow.getAccessMode())) { + resultFunctions.add(predecessor); + } else { + var predecessorArrows = predecessor.getIncomingArrows(); + for (var preArrow : predecessorArrows) { + if (relationsNotInvestigatedYet.remove(preArrow)) { + if (!AccessMode.READ.equals(preArrow.getAccessMode())) { + relationsToIterate.add(preArrow); + } + } + } + } + + } + return resultFunctions; + } + + @Override + public TestSuite getAllDefsCoverage(String graphJSON) { + Graph graph = new Graph(graphJSON); + graph.addRelationsToElements(); + + List coverageTargets = getAllTargetsToBeCoveredByAllDefs(graph); + + for (var target : coverageTargets) { + var def = target.getAspect(); + List testcases = getTestcasesCoveringUseOfDefinition(def); + target.addTestcases(testcases); + } + + TestSuite testsuite = new TestSuite(); + testsuite.add(coverageTargets); + return testsuite; + } + + + private List getAllTargetsToBeCoveredByAllDefs(Graph graph) { + List allDefsOfGraph = getAllDefsOfGraph(graph); + List lambdaDefs = new ArrayList<>(); + allDefsOfGraph.forEach(def -> lambdaDefs.add(new CoverageTargetAllDefs(def))); + return lambdaDefs; + } + + private List getAllDefsOfGraph(Graph graph) { + List functionsWithDefSourceLine = new ArrayList<>(); + for (var node : graph.getNodes()) { + if (NodeType.FUNCTION.equals(node.getType())) { + List entries = node.getSourceList(); + for (var entry : entries) { + if ((entry.getDefContainer() != null && !entry.getDefContainer().isBlank())) { + FunctionWithDefSourceLine functionWithDef = new FunctionWithDefSourceLine(node, entry); + functionsWithDefSourceLine.add(functionWithDef); + } + } + } + } + return functionsWithDefSourceLine; + } + + + private List findAllUsesOfADefOnItsSuccessors(FunctionWithSourceLine def) { + List arrows = getSuccessorArrowsToBeConsidered(def.getFunction(), def.getSourceCodeLine().getRelationsInfluencedByDef()); + List result = new ArrayList<>(); + for (var arrow : arrows) { + var successor = arrow.getSuccessorNode(); + if (NodeType.FUNCTION.equals(successor.getType())) { + List usagesForArrow = getUsesInAFunction(successor, arrow.getIdentifier()); + result.addAll(usagesForArrow); + } else if (NodeType.DATA_STORAGE.equals(successor.getType())) { + result.addAll(getUsagesAfterNode(successor)); + + } else { + result.addAll(getUsagesAfterNode(successor)); + } + } + return result; + } + + + private List findAllUsesOfADefCoupledByADataStorage(FunctionWithSourceLine def) { + List arrows = getSuccessorArrowsToBeConsidered(def.getFunction(), def.getSourceCodeLine().getRelationsInfluencedByDef()); + List result = new ArrayList<>(); + for (var arrow : arrows) { + if (!AccessMode.READ.equals(arrow.getAccessMode())) { + var successor = arrow.getSuccessorNode(); + if (NodeType.DATA_STORAGE.equals(successor.getType())) { + result.addAll(getReadUsageOfDB(successor)); + } + } + } + return result; + } + + + private List getUsagesAfterNode(NodeModel node) { + List result = new ArrayList<>(); + var arrows = node.getOutgoingArrows(); + Set visitedNodes = new HashSet<>(); + Queue arrowsToBeVisited = new LinkedList<>(arrows); + while (!arrowsToBeVisited.isEmpty()) { + var arrow = arrowsToBeVisited.remove(); + var successorNode = arrow.getSuccessorNode(); + if (visitedNodes.add(successorNode.getIdentifier())) { + if (NodeType.FUNCTION.equals(successorNode.getType())) { + result.addAll(getUsesInAFunction(successorNode, arrow.getIdentifier())); + } else { + arrowsToBeVisited.addAll(successorNode.getOutgoingArrows()); + } + + } + } + return result; + } + + private List getReadUsageOfDB(NodeModel dbNode) { + List result = new ArrayList<>(); + var arrows = dbNode.getIncomingArrows(); + for (var arrow : arrows) { + var predecessor = arrow.getPredecessorNode(); + if (AccessMode.READ.equals(arrow.getAccessMode()) && NodeType.FUNCTION.equals(predecessor.getType())) { + result.addAll(getUsesInAFunction(predecessor, arrow.getIdentifier())); + } + } + return result; + } + + private List getUsesInAFunction(NodeModel node, long idOfArrow) { + List result = new ArrayList<>(); + var uses = node.getSourceList().stream(). + filter(sourceCodeLine -> sourceCodeLine.getUse() != null + && !sourceCodeLine.getUse().isBlank()).filter(sourceCodeLine -> sourceCodeLine.getRelationsInfluencingUse() != null). + filter(sourceCodeLine -> sourceCodeLine.getRelationsInfluencingUse().contains(idOfArrow) || + sourceCodeLine.getRelationsInfluencingUse().contains(SourceCodeLine.INFLUENCING_ALL_RELATIONS_CONSTANT)). + collect(Collectors.toList()); + uses.forEach(use -> result.add(new FunctionWithUseSourceLine(node, use))); + return result; + } + + + private List getSuccessorArrowsToBeConsidered(NodeModel node, List relationsInfluenced) { + List result; + if (relationsInfluenced.contains(SourceCodeLine.INFLUENCING_ALL_RELATIONS_CONSTANT)) { + result = node.getOutgoingArrows(); + } else { + result = new ArrayList<>(); + for (var relation : node.getOutgoingArrows()) { + if (relationsInfluenced.contains(relation.getIdentifier())) { + result.add(relation); + } + } + } + return result; + } + + @Override + public TestSuite getDefUseCoverage(String graphJSON) { + Graph graph = new Graph(graphJSON); + graph.addRelationsToElements(); + + List coverageTargets = getAllTargetsToBeCoveredByAllDefUse(graph); + for (var target : coverageTargets) { + List testcases = getTestcaseForTarget(target); + target.addTestcases(testcases); + } + TestSuite testsuite = new TestSuite(); + testsuite.add(coverageTargets); + return testsuite; + } + + private List getTestcaseForTarget(CoverageTargetAllDefUse targetAllDefUse) { + List potentialTestcases = new ArrayList<>(); + + var coverageAspect = targetAllDefUse.getAspect(); + if (coverageAspect instanceof FunctionWithDefSourceLine) { + var testcases = getTestcasesCoveringUseOfDefinition((FunctionWithDefSourceLine) coverageAspect); + potentialTestcases.addAll(testcases); + + } + if (coverageAspect instanceof FunctionWithUseSourceLine) { + var testcases = getTestcasesCoveringDefinitionOfUse((FunctionWithUseSourceLine) coverageAspect); + potentialTestcases.addAll(testcases); + } + return potentialTestcases; + + } + + private List getAllTargetsToBeCoveredByAllDefUse(Graph graph) { + List allDefsOfGraph = getAllDefsOfGraph(graph); + List result = new ArrayList<>(); + for (var def : allDefsOfGraph) { + CoverageTargetAllDefUse target = new CoverageTargetAllDefUse(def); + result.add(target); + } + List allUsesOfGraph = getAllUsesOfGraph(graph); + for (var use : allUsesOfGraph) { + CoverageTargetAllDefUse target = new CoverageTargetAllDefUse(use); + result.add(target); + } + return result; + } + + + private List getTestcasesCoveringDefinitionOfUse(FunctionWithUseSourceLine use) { + List defsForUseOnPath = findAllDefsOfAUseOnItsPredecessors(use); + boolean isDefFoundForUseOnPath = defsForUseOnPath.size() > 0; + List defsForUseViaDB = findAllDefsOfAUseCoupledByADataStorage(use); + boolean isDefFoundForCoupled = defsForUseViaDB.size() > 0; + var potentialTestcasesForUse = new ArrayList(); + if (isDefFoundForUseOnPath) { + for (var defOnPath : defsForUseOnPath) { + var logStatements = List.of(defOnPath.getLogMessage() + use.getLogMessage()); + String defDescription = String.format("def %s", defOnPath); + String target = String.format("use %s should be covered by %s", use, defDescription); + ServerlessFunction function = getServerlessFunctionForCoverageOfDef(defOnPath, use); + Testcase testcase = new Testcase(List.of(function), target, logStatements); + potentialTestcasesForUse.add(testcase); + } + } + if (isDefFoundForCoupled) { + for (var defCoupledViaDB : defsForUseViaDB) { + var logStatements = List.of(defCoupledViaDB.getLogMessage() + use.getLogMessage()); + String defDescription = String.format("def %s", defCoupledViaDB); + String target = String.format("use %s should be covered by %s", use, defDescription); + var function = new ServerlessFunction(use.getFunction()); + Testcase testcase = new Testcase(List.of(function), target, logStatements); + potentialTestcasesForUse.add(testcase); + } + } + if (!isDefFoundForUseOnPath && !isDefFoundForCoupled) { + var logStatements = List.of(use.getLogMessage()); + String target = String.format("use %s should be covered but no def could be found ", use); + var function = new ServerlessFunction(use.getFunction()); + Testcase testcase = new Testcase(List.of(function), target, logStatements); + + potentialTestcasesForUse.add(testcase); + } + return potentialTestcasesForUse; + } + + private List getTestcasesCoveringUseOfDefinition(FunctionWithDefSourceLine def) { + + List usesForDefOnPath = findAllUsesOfADefOnItsSuccessors(def); + boolean isUseFoundForDef = usesForDefOnPath.size() > 0; + List usesForDefViaDB = findAllUsesOfADefCoupledByADataStorage(def); + boolean isUseFoundForCoupled = usesForDefViaDB.size() > 0; + var potentialTestcasesForDefinition = new ArrayList(); + if (isUseFoundForDef) { + for (var useOnPath : usesForDefOnPath) { + var logStatements = List.of(def.getLogMessage() + useOnPath.getLogMessage()); + String useDescription = String.format("use %s ", useOnPath); + String target = String.format("def %s should be covered by %s", def, useDescription); + + + ServerlessFunction function = getServerlessFunctionForCoverageOfDef(def, useOnPath); + + Testcase testcase = new Testcase(List.of(function), target, logStatements); + + potentialTestcasesForDefinition.add(testcase); + } + } + if (isUseFoundForCoupled) { + for (var useCoupledViaDb : usesForDefViaDB) { + var logStatements = List.of(def.getLogMessage() + useCoupledViaDb.getLogMessage()); + String useDescription = String.format("use %s ", useCoupledViaDb); + String target = String.format("def %s should be covered by %s", def, useDescription); + + var function1 = new ServerlessFunction(def.getFunction()); + var function2 = new ServerlessFunction(useCoupledViaDb.getFunction()); + + Testcase testcase = new Testcase(List.of(function1, function2), target, logStatements); + + potentialTestcasesForDefinition.add(testcase); + } + } + if (!isUseFoundForDef && !isUseFoundForCoupled) { + String target = String.format("def %s should be covered but no use could be found ", def); + var logStatements = List.of(def.getLogMessage()); + var function = new ServerlessFunction(def.getFunction()); + Testcase testcase = new Testcase(List.of(function), target, logStatements); + potentialTestcasesForDefinition.add(testcase); + } + return potentialTestcasesForDefinition; + } + + private ServerlessFunction getServerlessFunctionForCoverageOfDef(FunctionWithDefSourceLine def, FunctionWithUseSourceLine useOnPath) { + boolean isSuccessorAlsoPredecessor = false; + var sourceCodeLinesOfUseNode = useOnPath.getFunction().getSourceList(); + boolean callToDefNodeFromUse = false; + var outgoingArrows = useOnPath.getFunction().getOutgoingArrows(); + for (var line : sourceCodeLinesOfUseNode) { + if (!callToDefNodeFromUse && !(line.getRelationsInfluencedByDef() == null)) { + var idsOfInfluencedArrows = line.getRelationsInfluencedByDef(); + if (idsOfInfluencedArrows == null) { + continue; + } + var nodesInfluencedByDefOfTheUseNode = outgoingArrows.stream() + .filter(arrow -> idsOfInfluencedArrows.contains(arrow.getIdentifier())) + .map(arrow -> arrow.getSuccessorNode()). + filter(successorNode -> successorNode != null).collect(Collectors.toList()); + if (nodesInfluencedByDefOfTheUseNode.contains(def.getFunction())) { + callToDefNodeFromUse = true; + } + } + if (callToDefNodeFromUse) { + if (line.getRelationsInfluencingUse() != null) { + var idsOfInfluencingArrows = line.getRelationsInfluencingUse(); + if (idsOfInfluencingArrows == null) { + continue; + } + var influencingNodes = useOnPath.getFunction().getIncomingArrows() + .stream().filter(arrow -> idsOfInfluencingArrows.contains(arrow.getIdentifier())) + .map(arrow -> arrow.getPredecessorNode()) + .filter(predecessorNode -> predecessorNode != null).collect(Collectors.toList()); + if (influencingNodes.contains(def.getFunction())) { + isSuccessorAlsoPredecessor = true; + break; + } + + } + } + } + + + var function = isSuccessorAlsoPredecessor ? + new ServerlessFunction(useOnPath.getFunction()) : new ServerlessFunction(def.getFunction()); + return function; + } + + + private List findAllDefsOfAUseCoupledByADataStorage(FunctionWithSourceLine use) { + List arrows = getSuccessorArrowsToBeConsidered(use.getFunction(), use.getSourceCodeLine().getRelationsInfluencingUse()); + List result = new ArrayList<>(); + for (var arrow : arrows) { + var successor = arrow.getSuccessorNode(); + if (NodeType.DATA_STORAGE.equals(successor.getType())) { + var defsBeforeNode = getDefsBeforeNode(successor); + result.addAll(defsBeforeNode); + } + } + return result; + } + + + private List findAllDefsOfAUseOnItsPredecessors(FunctionWithSourceLine use) { + List arrows = getPreArrowsToBeConsidered(use.getFunction(), use.getSourceCodeLine().getRelationsInfluencingUse()); + List result = new ArrayList<>(); + for (var arrow : arrows) { + var predecessor = arrow.getPredecessorNode(); + if (NodeType.FUNCTION.equals(predecessor.getType())) { + List usagesForArrow = getDefsInAFunction(predecessor, arrow.getIdentifier()); + result.addAll(usagesForArrow); + } else if (NodeType.DATA_STORAGE.equals(predecessor.getType())) { + result.addAll(getDefsBeforeNode(predecessor)); + + } else { + result.addAll(getDefsBeforeNode(predecessor)); + } + } + return result; + } + + + private List getDefsBeforeNode(NodeModel node) { + List result = new ArrayList<>(); + var arrows = node.getIncomingArrows(); + Set visitedNodes = new HashSet<>(); + Queue arrowsToBeVisited = new LinkedList<>(arrows); + while (!arrowsToBeVisited.isEmpty()) { + var arrow = arrowsToBeVisited.remove(); + if (!AccessMode.READ.equals(arrow.getAccessMode())) { + var predecessorNode = arrow.getPredecessorNode(); + if (visitedNodes.add(predecessorNode.getIdentifier())) { + if (NodeType.FUNCTION.equals(predecessorNode.getType())) { + result.addAll(getDefsInAFunction(predecessorNode, arrow.getIdentifier())); + } else { + arrowsToBeVisited.addAll(predecessorNode.getIncomingArrows()); + } + + } + } + } + return result; + } + + private List getDefsInAFunction(NodeModel node, long idOfArrow) { + List result = new ArrayList<>(); + var defs = node.getSourceList().stream(). + filter(sourceCodeLine -> (sourceCodeLine.getDefContainer() != null + && !sourceCodeLine.getDefContainer().isBlank())).filter(sourceCodeLine -> sourceCodeLine.getRelationsInfluencedByDef() != null). + filter(sourceCodeLine -> sourceCodeLine.getRelationsInfluencedByDef().contains(idOfArrow) || + sourceCodeLine.getRelationsInfluencedByDef().contains(SourceCodeLine.INFLUENCING_ALL_RELATIONS_CONSTANT)). + collect(Collectors.toList()); + defs.forEach(def -> result.add(new FunctionWithDefSourceLine(node, def))); + return result; + } + + private List getPreArrowsToBeConsidered(NodeModel node, List relationsInfluencingUse) { + List result; + if (relationsInfluencingUse.contains(SourceCodeLine.INFLUENCING_ALL_RELATIONS_CONSTANT)) { + result = node.getIncomingArrows(); + } else { + result = new ArrayList<>(); + for (var relation : node.getIncomingArrows()) { + if (relationsInfluencingUse.contains(relation.getIdentifier())) { + result.add(relation); + } + } + } + return result; + } + + + @Override + public TestSuite getAllUsesCoverage(String graphJSON) { + Graph graph = new Graph(graphJSON); + graph.addRelationsToElements(); + + List coverageTargets = getAllTargetsToBeCoveredByAllUses(graph); + for (var target : coverageTargets) { + List testcases = getTestcaseForTarget(target); + target.addTestcases(testcases); + } + TestSuite testsuite = new TestSuite(); + testsuite.add(coverageTargets); + return testsuite; + } + + private List getTestcaseForTarget(CoverageTargetAllUses coverageTargetAllUses) { + List potentialTestcases = new ArrayList<>(); + var defuse = coverageTargetAllUses.getAspect(); + var defOfAspect = defuse.getDef(); + var useOfAspect = defuse.getUse(); + if (useOfAspect == null) { + var logStatements = List.of(defOfAspect.getLogMessage()); + String target = String.format("def %s should be covered but no use was found", defOfAspect); + var function = new ServerlessFunction(defOfAspect.getFunction()); + Testcase testcase = new Testcase(List.of(function), target, logStatements); + potentialTestcases.add(testcase); + } else if (defOfAspect == null) { + var logStatements = List.of(useOfAspect.getLogMessage()); + String target = String.format("use %s should be covered but no def was found", useOfAspect); + var function = new ServerlessFunction(useOfAspect.getFunction()); + Testcase testcase = new Testcase(List.of(function), target, logStatements); + potentialTestcases.add(testcase); + } else { + String target = String.format("def %s should be covered by %s ", defOfAspect, useOfAspect); + List usesForDefOnPath = findAllUsesOfADefOnItsSuccessors(defOfAspect); + for (var use : usesForDefOnPath) { + if (useOfAspect.equals(use)) { + var logStatements = List.of(defOfAspect.getLogMessage() + useOfAspect.getLogMessage()); + var function = getServerlessFunctionForCoverageOfDef(defOfAspect,useOfAspect); + Testcase testcase = + new Testcase(List.of(function), target, logStatements); + potentialTestcases.add(testcase); + } + } + List usesForDefViaDB = findAllUsesOfADefCoupledByADataStorage(defOfAspect); + for (var use : usesForDefViaDB) { + if (useOfAspect.equals(use)) { + var logStatements = List.of(defOfAspect.getLogMessage() + useOfAspect.getLogMessage()); + var function1 = new ServerlessFunction(defOfAspect.getFunction()); + var function2 = new ServerlessFunction(use.getFunction()); + Testcase testcase = + new Testcase(List.of(function1, function2), target, logStatements); + potentialTestcases.add(testcase); + } + } + } + return potentialTestcases; + } + + private List getAllTargetsToBeCoveredByAllUses(Graph graph) { + List allDefsOfGraph = getAllDefsOfGraph(graph); + List result = new ArrayList<>(); + for (var def : allDefsOfGraph) { + List usesOnPath = findAllUsesOfADefOnItsSuccessors(def); + for (var use : usesOnPath) { + var defUsePair = new DefUsePair(def, use); + var coverageTarget = new CoverageTargetAllUses(defUsePair); + result.add(coverageTarget); + } + List usesViaDB = findAllUsesOfADefCoupledByADataStorage(def); + for (var use : usesViaDB) { + var defUsePair = new DefUsePair(def, use); + var coverageTarget = new CoverageTargetAllUses(defUsePair); + result.add(coverageTarget); + } + if (usesOnPath.isEmpty() && usesViaDB.isEmpty()) { + var defUsePair = new DefUsePair(def, null); + var coverageTarget = new CoverageTargetAllUses(defUsePair); + result.add(coverageTarget); + } + } + List allUsesOfGraph = getAllUsesOfGraph(graph); + for (var use : allUsesOfGraph) { + var isAlreadyUsed = result.stream().filter(target -> use.equals(target.getAspect().getUse())).findAny(); + if (isAlreadyUsed.isEmpty()) { + var defUsePair = new DefUsePair(null, use); + var coverageTarget = new CoverageTargetAllUses(defUsePair); + result.add(coverageTarget); + } + } + return result; + } + + private List getAllUsesOfGraph(Graph graph) { + List functionsWithUseSourceLine = new ArrayList<>(); + for (var node : graph.getNodes()) { + if (NodeType.FUNCTION.equals(node.getType())) { + List entries = node.getSourceList(); + for (var entry : entries) { + if (entry.getUse() != null && !entry.getUse().isBlank()) { + FunctionWithUseSourceLine functionWithUse = new FunctionWithUseSourceLine(node, entry); + functionsWithUseSourceLine.add(functionWithUse); + } + } + } + } + return functionsWithUseSourceLine; + } +} diff --git a/src/main/java/logic/testcasegenerator/coveragetargets/CoverageTarget.java b/src/main/java/logic/testcasegenerator/coveragetargets/CoverageTarget.java new file mode 100644 index 0000000..3d0ce24 --- /dev/null +++ b/src/main/java/logic/testcasegenerator/coveragetargets/CoverageTarget.java @@ -0,0 +1,14 @@ +package logic.testcasegenerator.coveragetargets; + +import logic.model.Testcase; + +import java.util.List; + +public interface CoverageTarget { + List getTestcases(); + + + String getAspectLogMessage(); + + String getAspectTarget(); +} diff --git a/src/main/java/logic/testcasegenerator/coveragetargets/CoverageTargetAllDefUse.java b/src/main/java/logic/testcasegenerator/coveragetargets/CoverageTargetAllDefUse.java new file mode 100644 index 0000000..bb63201 --- /dev/null +++ b/src/main/java/logic/testcasegenerator/coveragetargets/CoverageTargetAllDefUse.java @@ -0,0 +1,49 @@ +package logic.testcasegenerator.coveragetargets; + +import logic.model.Testcase; +import logic.testcasegenerator.coveragetargets.aspect.FunctionWithSourceLine; + +import java.util.ArrayList; +import java.util.List; + +public class CoverageTargetAllDefUse implements CoverageTarget { + + private final FunctionWithSourceLine aspect; + + private final List testcases; + + public CoverageTargetAllDefUse(FunctionWithSourceLine aspect) { + this.aspect = aspect; + testcases = new ArrayList<>(); + } + + + public FunctionWithSourceLine getAspect() { + return this.aspect; + } + + public List getTestcases() { + return testcases; + } + + + @Override + public String getAspectLogMessage() { + return aspect.getLogMessage(); + } + + @Override + public String getAspectTarget() { + return aspect.getAspectTarget(); + } + public void addTestcases(List testcases) { + this.testcases.addAll(testcases); + } + + @Override + public String toString() { + return "CoverageAspectAllDefs{" + + "aspect=" + aspect + + '}'; + } +} diff --git a/src/main/java/logic/testcasegenerator/coveragetargets/CoverageTargetAllDefs.java b/src/main/java/logic/testcasegenerator/coveragetargets/CoverageTargetAllDefs.java new file mode 100644 index 0000000..3e04ca1 --- /dev/null +++ b/src/main/java/logic/testcasegenerator/coveragetargets/CoverageTargetAllDefs.java @@ -0,0 +1,49 @@ +package logic.testcasegenerator.coveragetargets; + +import logic.model.Testcase; +import logic.testcasegenerator.coveragetargets.aspect.FunctionWithDefSourceLine; + +import java.util.ArrayList; +import java.util.List; + +public class CoverageTargetAllDefs implements CoverageTarget { + + private final FunctionWithDefSourceLine aspect; + + private final List testcases; + + public CoverageTargetAllDefs(FunctionWithDefSourceLine aspect) { + this.aspect = aspect; + testcases = new ArrayList<>(); + } + + + public FunctionWithDefSourceLine getAspect() { + return aspect; + } + + public List getTestcases() { + return testcases; + } + + @Override + public String getAspectLogMessage() { + return aspect.getLogMessage(); + } + + @Override + public String getAspectTarget() { + return aspect.getAspectTarget(); + } + + public void addTestcases(List testcases) { + this.testcases.addAll(testcases); + } + + @Override + public String toString() { + return "CoverageAspectAllDefs{" + + "aspect=" + aspect + + '}'; + } +} diff --git a/src/main/java/logic/testcasegenerator/coveragetargets/CoverageTargetAllRelations.java b/src/main/java/logic/testcasegenerator/coveragetargets/CoverageTargetAllRelations.java new file mode 100644 index 0000000..8bcd04d --- /dev/null +++ b/src/main/java/logic/testcasegenerator/coveragetargets/CoverageTargetAllRelations.java @@ -0,0 +1,53 @@ +package logic.testcasegenerator.coveragetargets; + +import logic.model.ArrowModel; +import logic.model.Testcase; + +import java.util.ArrayList; +import java.util.List; + +import static logic.testcasegenerator.coveragetargets.LogNameConfiguration.LOGDELIMITER; +import static logic.testcasegenerator.coveragetargets.LogNameConfiguration.RELATION_MARKER; + +public class CoverageTargetAllRelations implements CoverageTarget { + + private final ArrowModel aspect; + + private final List testcases; + + public CoverageTargetAllRelations(ArrowModel aspect) { + this.aspect = aspect; + testcases = new ArrayList<>(); + } + + + public ArrowModel getAspect() { + return aspect; + } + + public List getTestcases() { + return testcases; + } + + public void addTestcases(List testcases) { + this.testcases.addAll(testcases); + } + + @Override + public String getAspectLogMessage() { + return String.format("#%s%s%s", RELATION_MARKER,aspect.getIdentifier(),LOGDELIMITER); + } + + @Override + public String getAspectTarget() { + return String.format("Coverage of relation from %s to %s by calling relation %s", + aspect.getPredecessorNode(), aspect.getSuccessorNode(), aspect.getIdentifier()); + } + + @Override + public String toString() { + return "CoverageAspectAllRelations{" + + "aspect=" + aspect + + '}'; + } +} diff --git a/src/main/java/logic/testcasegenerator/coveragetargets/CoverageTargetAllResources.java b/src/main/java/logic/testcasegenerator/coveragetargets/CoverageTargetAllResources.java new file mode 100644 index 0000000..41745d7 --- /dev/null +++ b/src/main/java/logic/testcasegenerator/coveragetargets/CoverageTargetAllResources.java @@ -0,0 +1,55 @@ +package logic.testcasegenerator.coveragetargets; + +import logic.model.NodeModel; +import logic.model.Testcase; + +import java.util.ArrayList; +import java.util.List; + +import static logic.testcasegenerator.coveragetargets.LogNameConfiguration.LOGDELIMITER; +import static logic.testcasegenerator.coveragetargets.LogNameConfiguration.RESOURCE_MARKER; + +public class CoverageTargetAllResources implements CoverageTarget { + + private final NodeModel aspect; + + private final List testcases; + + public CoverageTargetAllResources(NodeModel aspect) { + this.aspect = aspect; + testcases = new ArrayList<>(); + } + + + public NodeModel getAspect() { + return aspect; + } + + public List getTestcases() { + return testcases; + } + + public void addTestcases(List testcases) { + this.testcases.addAll(testcases); + } + + + @Override + public String getAspectLogMessage() { + return String.format("%s%d%s",RESOURCE_MARKER, aspect.getIdentifier(),LOGDELIMITER); + } + + @Override + public String getAspectTarget() { + return String.format("Coverage of %s %s (id %d)", + aspect.getType(), aspect.getNameOfNode(), aspect.getIdentifier()); + } + + + @Override + public String toString() { + return "CoverageAspectAllResources{" + + "aspect=" + aspect + + '}'; + } +} diff --git a/src/main/java/logic/testcasegenerator/coveragetargets/CoverageTargetAllUses.java b/src/main/java/logic/testcasegenerator/coveragetargets/CoverageTargetAllUses.java new file mode 100644 index 0000000..975c019 --- /dev/null +++ b/src/main/java/logic/testcasegenerator/coveragetargets/CoverageTargetAllUses.java @@ -0,0 +1,51 @@ +package logic.testcasegenerator.coveragetargets; + +import logic.testcasegenerator.coveragetargets.aspect.DefUsePair; +import logic.model.Testcase; + +import java.util.ArrayList; +import java.util.List; + +public class CoverageTargetAllUses implements CoverageTarget { + + private final DefUsePair aspect; + + private final List testcases; + + public CoverageTargetAllUses(DefUsePair aspect) { + this.aspect = aspect; + testcases = new ArrayList<>(); + } + + + public DefUsePair getAspect() { + return aspect; + } + + public List getTestcases() { + return testcases; + } + + public void addTestcases(List testcases) { + this.testcases.addAll(testcases); + } + + + @Override + public String getAspectLogMessage() { + return aspect.getLogMessage(); + } + + @Override + public String getAspectTarget() { + return aspect.getAspectTarget(); + } + + + @Override + public String toString() { + return "CoverageAspectAllDefs{" + + "aspect=" + aspect + + '}'; + } +} diff --git a/src/main/java/logic/testcasegenerator/coveragetargets/LogNameConfiguration.java b/src/main/java/logic/testcasegenerator/coveragetargets/LogNameConfiguration.java new file mode 100644 index 0000000..7a8b472 --- /dev/null +++ b/src/main/java/logic/testcasegenerator/coveragetargets/LogNameConfiguration.java @@ -0,0 +1,10 @@ +package logic.testcasegenerator.coveragetargets; + +public class LogNameConfiguration { + + public static final String DEFLOG_MARKER = "#Def_Node_"; + public static final String USELOG_MARKER ="#Use_Node_"; + public static final String RESOURCE_MARKER ="#Resource_Covered_"; + public static final String RELATION_MARKER ="#Relation_Covered_"; + public static final String LOGDELIMITER = "#"; +} diff --git a/src/main/java/logic/testcasegenerator/coveragetargets/aspect/DefUsePair.java b/src/main/java/logic/testcasegenerator/coveragetargets/aspect/DefUsePair.java new file mode 100644 index 0000000..8c7aa23 --- /dev/null +++ b/src/main/java/logic/testcasegenerator/coveragetargets/aspect/DefUsePair.java @@ -0,0 +1,44 @@ +package logic.testcasegenerator.coveragetargets.aspect; + +public class DefUsePair { + private final FunctionWithDefSourceLine def; + private final FunctionWithUseSourceLine use; + + public DefUsePair(FunctionWithDefSourceLine def, FunctionWithUseSourceLine use) { + this.def = def; + this.use = use; + } + + public FunctionWithDefSourceLine getDef() { + return def; + } + + public FunctionWithUseSourceLine getUse() { + return use; + } + + + @Override + public String toString() { + String definition = def == null ? "def could not be found for the use" : def.toString(); + String usage = use == null ? "a use could not be found for the definition" : use.toString(); + + return "DefUsePair{" + + "def=" + definition + + ", use=" + usage + + '}'; + } + + public String getLogMessage() { + return String.format("#%s%s", + def.getSourceCodeLine().getDefTracker("", def.getFunction().getIdentifier()), + use.getSourceCodeLine().getUseTracker("", use.getFunction().getIdentifier() + )); + } + + public String getAspectTarget() { + return String.format("Coverage of definition %s by use %s", + def.getSourceCodeLine().getDefTracker("", def.getFunction().getIdentifier()), + use.getSourceCodeLine().getUseTracker("", use.getFunction().getIdentifier())); + } +} diff --git a/src/main/java/logic/testcasegenerator/coveragetargets/aspect/FunctionWithDefSourceLine.java b/src/main/java/logic/testcasegenerator/coveragetargets/aspect/FunctionWithDefSourceLine.java new file mode 100644 index 0000000..8c61625 --- /dev/null +++ b/src/main/java/logic/testcasegenerator/coveragetargets/aspect/FunctionWithDefSourceLine.java @@ -0,0 +1,39 @@ +package logic.testcasegenerator.coveragetargets.aspect; + +import logic.model.NodeModel; +import logic.model.SourceCodeLine; + +import java.util.Objects; + +public class FunctionWithDefSourceLine extends FunctionWithSourceLine { + public FunctionWithDefSourceLine(NodeModel function, SourceCodeLine sourceCodeLine) { + super(function, sourceCodeLine); + Objects.requireNonNull(sourceCodeLine.getRelationsInfluencedByDef()); + } + + @Override + public String toString() { + return String.format("%s with name %s (id %d) and definition coverage of the corresponding variable '%s'", + function.getType(), function.getNameOfNode(), function.getIdentifier(), sourceCodeLine.getDefTracker("", function.getIdentifier())); + } + + @Override + public String getAspectMessage() { + return String.format("%s", + this.getSourceCodeLine().getDefTracker("", this.getFunction().getIdentifier())); + } + + @Override + public String getLogMessage() { + return String.format("%s", + this.getSourceCodeLine().getDefTracker("", this.getFunction().getIdentifier())); + } + + + @Override + public String getAspectTarget() { + return String.format("Coverage of Definition %s with any use", this.getSourceCodeLine().getDefTracker("", this.getFunction().getIdentifier())); + } + + +} diff --git a/src/main/java/logic/testcasegenerator/coveragetargets/aspect/FunctionWithSourceLine.java b/src/main/java/logic/testcasegenerator/coveragetargets/aspect/FunctionWithSourceLine.java new file mode 100644 index 0000000..b940b8b --- /dev/null +++ b/src/main/java/logic/testcasegenerator/coveragetargets/aspect/FunctionWithSourceLine.java @@ -0,0 +1,51 @@ +package logic.testcasegenerator.coveragetargets.aspect; + +import logic.model.NodeType; +import logic.model.NodeModel; +import logic.model.SourceCodeLine; + +import java.util.Objects; + +public class FunctionWithSourceLine { + NodeModel function; + SourceCodeLine sourceCodeLine; + + public FunctionWithSourceLine(NodeModel function, + SourceCodeLine sourceCodeLine) { + Objects.requireNonNull(function); + Objects.requireNonNull(sourceCodeLine); + + if (!NodeType.FUNCTION.equals(function.getType())) { + throw new IllegalArgumentException(String.format("node %s with id %d is not a function", + function.getNameOfNode(), function.getIdentifier())); + } + this.function = function; + this.sourceCodeLine = sourceCodeLine; + } + + public NodeModel getFunction() { + return function; + } + + public SourceCodeLine getSourceCodeLine() { + return sourceCodeLine; + } + + @Override + public String toString() { + return String.format("%s with name %s (id %d) with sourcecode %s", + function.getType(), function.getNameOfNode(), function.getIdentifier(), sourceCodeLine.getSourceLine()); + } + + public String getAspectMessage() { + return ""; + } + + public String getLogMessage() { + return ""; + } + + public String getAspectTarget() { + return ""; + } +} diff --git a/src/main/java/logic/testcasegenerator/coveragetargets/aspect/FunctionWithUseSourceLine.java b/src/main/java/logic/testcasegenerator/coveragetargets/aspect/FunctionWithUseSourceLine.java new file mode 100644 index 0000000..c5b4b6b --- /dev/null +++ b/src/main/java/logic/testcasegenerator/coveragetargets/aspect/FunctionWithUseSourceLine.java @@ -0,0 +1,52 @@ +package logic.testcasegenerator.coveragetargets.aspect; + +import logic.model.NodeModel; +import logic.model.SourceCodeLine; + +import java.util.Objects; + +import static logic.testcasegenerator.coveragetargets.LogNameConfiguration.*; + +public class FunctionWithUseSourceLine extends FunctionWithSourceLine { + public FunctionWithUseSourceLine(NodeModel function, SourceCodeLine sourceCodeLine) { + super(function, sourceCodeLine); + Objects.requireNonNull(sourceCodeLine.getUse()); + Objects.requireNonNull(sourceCodeLine.getRelationsInfluencingUse()); + } + + @Override + public String toString() { + return String.format("%s with name %s (id %d) and use coverage of the corresponding variable: %s", + function.getType(), function.getNameOfNode(), function.getIdentifier(), sourceCodeLine.getUseTracker("", function.getIdentifier())); + } + + + @Override + public String getAspectMessage() { + return String.format("#%s%s%s%s", DEFLOG_MARKER,USELOG_MARKER, this.getSourceCodeLine().getUseTracker("",this.getFunction().getIdentifier()),LOGDELIMITER); + } + @Override + public String getAspectTarget(){ + return String.format("Coverage of Usage %s with any definition", this.getSourceCodeLine().getUseTracker("",this.getFunction().getIdentifier())); + } + @Override + public String getLogMessage() { + return String.format("%s", this.getSourceCodeLine().getUseTracker("",this.getFunction().getIdentifier())); + } + + + @Override + public boolean equals(Object o) { + if (o == null) { + return false; + } + if (o == this) { + return true; + } + if (!(o instanceof FunctionWithUseSourceLine)) { + return false; + } + FunctionWithUseSourceLine functionWithUseSourceLine = (FunctionWithUseSourceLine) o; + return functionWithUseSourceLine.function.equals(this.function) && functionWithUseSourceLine.sourceCodeLine.equals(this.sourceCodeLine); + } +} diff --git a/src/main/java/logic/util/logger/MyHtmlFormatter.java b/src/main/java/logic/util/logger/MyHtmlFormatter.java new file mode 100644 index 0000000..4db3fc3 --- /dev/null +++ b/src/main/java/logic/util/logger/MyHtmlFormatter.java @@ -0,0 +1,65 @@ +package logic.util.logger; + + +import java.text.SimpleDateFormat; + import java.util.Date; + import java.util.logging.Formatter; + import java.util.logging.Handler; + import java.util.logging.Level; + import java.util.logging.LogRecord; + +class MyHtmlFormatter extends Formatter { + public String format(LogRecord rec) { + StringBuffer buf = new StringBuffer(1000); + buf.append("\n"); + + if (rec.getLevel().intValue() >= Level.WARNING.intValue()) { + buf.append("\t"); + buf.append(""); + buf.append(rec.getLevel()); + buf.append(""); + } else { + buf.append("\t"); + buf.append(rec.getLevel()); + } + + buf.append("\n"); + buf.append("\t"); + buf.append(calcDate(rec.getMillis())); + buf.append("\n"); + buf.append("\t"); + buf.append(formatMessage(rec)); + buf.append("\n"); + buf.append("\n"); + + return buf.toString(); + } + + private String calcDate(long millisecs) { + SimpleDateFormat date_format = new SimpleDateFormat("MMM dd,yyyy HH:mm"); + Date resultdate = new Date(millisecs); + return date_format.format(resultdate); + } + + public String getHead(Handler h) { + return "\n\n\n" + + "\n" + + "\n" + + "

" + (new Date()) + "

\n" + + "\n" + + "\n" + + "\t\n" + + "\t\n" + + "\t\n" + + "\n"; + } + + public String getTail(Handler h) { + return "
LoglevelTimeLog Message
\n\n"; + } +} \ No newline at end of file diff --git a/src/main/java/logic/util/logger/MyLogger.java b/src/main/java/logic/util/logger/MyLogger.java new file mode 100644 index 0000000..54d3ea0 --- /dev/null +++ b/src/main/java/logic/util/logger/MyLogger.java @@ -0,0 +1,35 @@ +package logic.util.logger; + +import java.io.IOException; +import java.util.logging.*; + +public class MyLogger { + static private FileHandler fileTxt; + static private SimpleFormatter formatterTxt; + + static private FileHandler fileHTML; + static private Formatter formatterHTML; + + static public void setup() throws IOException { + + Logger logger = Logger.getLogger(Logger.GLOBAL_LOGGER_NAME); + + Logger rootLogger = Logger.getLogger(""); + Handler[] handlers = rootLogger.getHandlers(); + if (handlers[0] instanceof ConsoleHandler) { + rootLogger.removeHandler(handlers[0]); + } + logger.setLevel(Level.INFO); + fileTxt = new FileHandler("Logging.txt"); + fileHTML = new FileHandler("Logging.html"); + + formatterTxt = new SimpleFormatter(); + fileTxt.setFormatter(formatterTxt); + logger.addHandler(fileTxt); + + // create an HTML formatter + formatterHTML = new MyHtmlFormatter(); + fileHTML.setFormatter(formatterHTML); + logger.addHandler(fileHTML); + } +} \ No newline at end of file