id
int32
0
12.9k
code
sequencelengths
2
264k
6,600
[ "<s>", "package", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "refactoring", ".", "formatter", ".", "lineWrap", ";", "import", "antlr", ".", "Token", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "refactoring", ".", "formatter", ".", "GroovyBeautifier", ";", "import", "org", ".", "eclipse", ".", "jface", ".", "text", ".", "BadLocationException", ";", "import", "org", ".", "eclipse", ".", "text", ".", "edits", ".", "ReplaceEdit", ";", "public", "abstract", "class", "CorrectLineWrap", "{", "protected", "GroovyBeautifier", "beautifier", ";", "public", "CorrectLineWrap", "(", "GroovyBeautifier", "beautifier", ")", "{", "this", ".", "beautifier", "=", "beautifier", ";", "}", "public", "abstract", "ReplaceEdit", "correctLineWrap", "(", "int", "pos", ",", "Token", "token", ")", "throws", "BadLocationException", ";", "}", "</s>" ]
6,601
[ "<s>", "package", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "refactoring", ".", "formatter", ";", "import", "java", ".", "io", ".", "Reader", ";", "import", "java", ".", "io", ".", "StringReader", ";", "import", "java", ".", "util", ".", "ArrayList", ";", "import", "java", ".", "util", ".", "Vector", ";", "import", "org", ".", "codehaus", ".", "greclipse", ".", "GroovyTokenTypeBridge", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "antlr", ".", "parser", ".", "GroovyLexer", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "core", ".", "GroovyCore", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "Assert", ";", "import", "org", ".", "eclipse", ".", "jface", ".", "text", ".", "BadLocationException", ";", "import", "org", ".", "eclipse", ".", "jface", ".", "text", ".", "IDocument", ";", "import", "antlr", ".", "Token", ";", "import", "antlr", ".", "TokenStream", ";", "import", "antlr", ".", "TokenStreamException", ";", "public", "class", "KlenkDocumentScanner", "extends", "GroovyDocumentScanner", "{", "private", "Vector", "<", "Vector", "<", "Token", ">", ">", "tokenLines", ";", "public", "KlenkDocumentScanner", "(", "IDocument", "doc", ")", "{", "super", "(", "doc", ")", ";", "}", "@", "Override", "protected", "void", "ensureScanned", "(", "int", "end", ")", "{", "if", "(", "tokens", "!=", "null", ")", "return", ";", "Reader", "input", "=", "new", "StringReader", "(", "getDocument", "(", ")", ".", "get", "(", ")", ")", ";", "GroovyLexer", "lexer", "=", "new", "GroovyLexer", "(", "input", ")", ";", "lexer", ".", "setWhitespaceIncluded", "(", "true", ")", ";", "TokenStream", "stream", "=", "(", "TokenStream", ")", "lexer", ".", "plumb", "(", ")", ";", "Token", "token", "=", "null", ";", "tokens", "=", "new", "ArrayList", "<", "Token", ">", "(", ")", ";", "tokenLines", "=", "new", "Vector", "<", "Vector", "<", "Token", ">", ">", "(", ")", ";", "Vector", "<", "Token", ">", "line", "=", "new", "Vector", "<", "Token", ">", "(", ")", ";", "try", "{", "while", "(", "(", "token", "=", "stream", ".", "nextToken", "(", ")", ")", ".", "getType", "(", ")", "!=", "GroovyTokenTypeBridge", ".", "EOF", ")", "{", "if", "(", "token", ".", "getType", "(", ")", "!=", "GroovyTokenTypeBridge", ".", "WS", ")", "{", "if", "(", "token", ".", "getType", "(", ")", "==", "GroovyTokenTypeBridge", ".", "STRING_CTOR_START", ")", "{", "tokens", ".", "add", "(", "token", ")", ";", "Token", "prevToken", "=", "token", ";", "inner", ":", "while", "(", "(", "token", "=", "stream", ".", "nextToken", "(", ")", ")", ".", "getType", "(", ")", "!=", "GroovyTokenTypeBridge", ".", "STRING_CTOR_END", ")", "{", "if", "(", "equalTokens", "(", "prevToken", ",", "token", ")", ")", "{", "break", "inner", ";", "}", "prevToken", "=", "token", ";", "}", "}", "tokens", ".", "add", "(", "token", ")", ";", "line", ".", "add", "(", "token", ")", ";", "if", "(", "token", ".", "getType", "(", ")", "==", "GroovyTokenTypeBridge", ".", "NLS", ")", "{", "tokenLines", ".", "add", "(", "line", ")", ";", "line", "=", "new", "Vector", "<", "Token", ">", "(", ")", ";", "}", "}", "}", "}", "catch", "(", "TokenStreamException", "e", ")", "{", "GroovyCore", ".", "logException", "(", "\"\"", ",", "e", ")", ";", "}", "tokens", ".", "add", "(", "token", ")", ";", "line", ".", "add", "(", "token", ")", ";", "tokenLines", ".", "add", "(", "line", ")", ";", "}", "private", "boolean", "equalTokens", "(", "Token", "t1", ",", "Token", "t2", ")", "{", "return", "t1", ".", "getType", "(", ")", "==", "t2", ".", "getType", "(", ")", "&&", "t1", ".", "getColumn", "(", ")", "==", "t2", ".", "getColumn", "(", ")", "&&", "t1", ".", "getLine", "(", ")", "==", "t2", ".", "getLine", "(", ")", "&&", "nullEquals", "(", "t1", ".", "getFilename", "(", ")", ",", "t2", ".", "getFilename", "(", ")", ")", "&&", "nullEquals", "(", "t1", ".", "getText", "(", ")", ",", "t2", ".", "getText", "(", ")", ")", ";", "}", "private", "boolean", "nullEquals", "(", "String", "s1", ",", "String", "s2", ")", "{", "if", "(", "s1", "==", "null", "&&", "s2", "==", "null", ")", "{", "return", "true", ";", "}", "else", "if", "(", "s1", "==", "null", "||", "s2", "==", "null", ")", "{", "return", "false", ";", "}", "return", "s1", ".", "equals", "(", "s2", ")", ";", "}", "@", "Deprecated", "public", "Vector", "<", "Vector", "<", "Token", ">", ">", "getLineTokensVector", "(", ")", "{", "ensureScanned", "(", "Integer", ".", "MAX_VALUE", ")", ";", "return", "tokenLines", ";", "}", "@", "Deprecated", "(", ")", "public", "Token", "get", "(", "int", "i", ")", "{", "ensureScanned", "(", "Integer", ".", "MAX_VALUE", ")", ";", "if", "(", "i", "<", "tokens", ".", "size", "(", ")", ")", "{", "return", "tokens", ".", "get", "(", "i", ")", ";", "}", "else", "{", "return", "null", ";", "}", "}", "@", "Deprecated", "public", "int", "size", "(", ")", "{", "ensureScanned", "(", "Integer", ".", "MAX_VALUE", ")", ";", "return", "tokens", ".", "size", "(", ")", ";", "}", "@", "Deprecated", "public", "int", "indexOf", "(", "Token", "token", ")", "throws", "BadLocationException", "{", "int", "pos", "=", "findTokenFrom", "(", "getOffset", "(", "token", ")", ")", ";", "Assert", ".", "isTrue", "(", "token", "==", "tokens", ".", "get", "(", "pos", ")", ")", ";", "return", "pos", ";", "}", "}", "</s>" ]
6,602
[ "<s>", "package", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "refactoring", ".", "formatter", ";", "import", "java", ".", "util", ".", "List", ";", "import", "org", ".", "codehaus", ".", "greclipse", ".", "GroovyTokenTypeBridge", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "core", ".", "GroovyCore", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "core", ".", "util", ".", "ListUtil", ";", "import", "org", ".", "eclipse", ".", "jface", ".", "text", ".", "BadLocationException", ";", "import", "org", ".", "eclipse", ".", "jface", ".", "text", ".", "IDocument", ";", "import", "org", ".", "eclipse", ".", "jface", ".", "text", ".", "ITextSelection", ";", "import", "org", ".", "eclipse", ".", "text", ".", "edits", ".", "DeleteEdit", ";", "import", "org", ".", "eclipse", ".", "text", ".", "edits", ".", "MalformedTreeException", ";", "import", "org", ".", "eclipse", ".", "text", ".", "edits", ".", "MultiTextEdit", ";", "import", "org", ".", "eclipse", ".", "text", ".", "edits", ".", "TextEdit", ";", "import", "antlr", ".", "Token", ";", "public", "class", "SemicolonRemover", "extends", "GroovyFormatter", "{", "private", "final", "GroovyDocumentScanner", "scanner", ";", "private", "final", "MultiTextEdit", "edits", ";", "public", "SemicolonRemover", "(", "ITextSelection", "sel", ",", "IDocument", "doc", ")", "{", "this", "(", "sel", ",", "doc", ",", "new", "MultiTextEdit", "(", ")", ")", ";", "}", "public", "SemicolonRemover", "(", "ITextSelection", "sel", ",", "IDocument", "doc", ",", "MultiTextEdit", "edits", ")", "{", "super", "(", "sel", ",", "doc", ")", ";", "this", ".", "edits", "=", "edits", ";", "this", ".", "scanner", "=", "new", "GroovyDocumentScanner", "(", "doc", ")", ";", "}", "@", "Override", "public", "TextEdit", "format", "(", ")", "{", "try", "{", "List", "<", "Token", ">", "tokens", "=", "scanner", ".", "getTokens", "(", "selection", ")", ";", "for", "(", "Token", "token", ":", "tokens", ")", "{", "Token", "nextToken", "=", "scanner", ".", "getNextToken", "(", "token", ")", ";", "if", "(", "isSemicolon", "(", "token", ")", "&&", "(", "nextToken", "==", "null", "||", "isDelimiter", "(", "nextToken", ")", ")", ")", "addSemicolonRemoval", "(", "token", ")", ";", "}", "}", "catch", "(", "BadLocationException", "e", ")", "{", "GroovyCore", ".", "logException", "(", "\"\"", ",", "e", ")", ";", "}", "finally", "{", "scanner", ".", "dispose", "(", ")", ";", "}", "return", "edits", ";", "}", "private", "boolean", "isSemicolon", "(", "Token", "token", ")", "{", "return", "token", "!=", "null", "&&", "token", ".", "getType", "(", ")", "==", "GroovyTokenTypeBridge", ".", "SEMI", ";", "}", "private", "boolean", "isDelimiter", "(", "Token", "token", ")", "{", "List", "<", "Integer", ">", "delimiterTypes", "=", "ListUtil", ".", "list", "(", "GroovyTokenTypeBridge", ".", "RCURLY", ",", "GroovyTokenTypeBridge", ".", "NLS", ",", "GroovyTokenTypeBridge", ".", "EOF", ")", ";", "return", "token", "!=", "null", "&&", "delimiterTypes", ".", "contains", "(", "token", ".", "getType", "(", ")", ")", ";", "}", "private", "void", "addSemicolonRemoval", "(", "Token", "semicolonToken", ")", "throws", "BadLocationException", "{", "int", "semicolonOffset", "=", "scanner", ".", "getOffset", "(", "semicolonToken", ")", ";", "TextEdit", "deleteSemicolon", "=", "new", "DeleteEdit", "(", "semicolonOffset", ",", "1", ")", ";", "try", "{", "edits", ".", "addChild", "(", "deleteSemicolon", ")", ";", "}", "catch", "(", "MalformedTreeException", "e", ")", "{", "GroovyCore", ".", "logWarning", "(", "\"\"", "+", "deleteSemicolon", ",", "e", ")", ";", "}", "}", "}", "</s>" ]
6,603
[ "<s>", "package", "org", ".", "codehaus", ".", "groovy", ".", "frameworkadapter", ".", "util", ";", "import", "org", ".", "osgi", ".", "framework", ".", "Version", ";", "public", "enum", "SpecifiedVersion", "{", "_16", "(", "1", ",", "6", ",", "\"16\"", ")", ",", "_17", "(", "1", ",", "7", ",", "\"17\"", ")", ",", "_18", "(", "1", ",", "8", ",", "\"18\"", ")", ",", "_19", "(", "1", ",", "9", ",", "\"19\"", ")", ",", "_20", "(", "2", ",", "0", ",", "\"20\"", ")", ",", "UNSPECIFIED", "(", "-", "1", ",", "-", "1", ",", "\"0\"", ")", ";", "public", "final", "int", "majorVersion", ";", "public", "final", "int", "minorVersion", ";", "public", "final", "String", "versionName", ";", "SpecifiedVersion", "(", "int", "majorVersion", ",", "int", "minorVersion", ",", "String", "versionName", ")", "{", "this", ".", "majorVersion", "=", "majorVersion", ";", "this", ".", "minorVersion", "=", "minorVersion", ";", "this", ".", "versionName", "=", "versionName", ";", "}", "public", "String", "toVersionString", "(", ")", "{", "return", "\"[\"", "+", "majorVersion", "+", "\".\"", "+", "minorVersion", "+", "\".\"", "+", "0", "+", "\",\"", "+", "majorVersion", "+", "\".\"", "+", "minorVersion", "+", "\".\"", "+", "99", "+", "\")\"", ";", "}", "public", "String", "toReadableVersionString", "(", ")", "{", "return", "majorVersion", "+", "\".\"", "+", "minorVersion", "+", "\".X\"", ";", "}", "public", "static", "SpecifiedVersion", "findVersionFromString", "(", "String", "compilerLevel", ")", "{", "if", "(", "compilerLevel", "==", "null", ")", "{", "return", "UNSPECIFIED", ";", "}", "if", "(", "\"16\"", ".", "equals", "(", "compilerLevel", ")", "||", "\"1.6\"", ".", "equals", "(", "compilerLevel", ")", ")", "{", "return", "_16", ";", "}", "if", "(", "\"17\"", ".", "equals", "(", "compilerLevel", ")", "||", "\"1.7\"", ".", "equals", "(", "compilerLevel", ")", ")", "{", "return", "_17", ";", "}", "if", "(", "\"18\"", ".", "equals", "(", "compilerLevel", ")", "||", "\"1.8\"", ".", "equals", "(", "compilerLevel", ")", ")", "{", "return", "_18", ";", "}", "if", "(", "\"19\"", ".", "equals", "(", "compilerLevel", ")", "||", "\"1.9\"", ".", "equals", "(", "compilerLevel", ")", ")", "{", "return", "_19", ";", "}", "if", "(", "\"20\"", ".", "equals", "(", "compilerLevel", ")", "||", "\"2.0\"", ".", "equals", "(", "compilerLevel", ")", ")", "{", "return", "_20", ";", "}", "if", "(", "\"0\"", ".", "equals", "(", "compilerLevel", ")", ")", "{", "return", "UNSPECIFIED", ";", "}", "throw", "new", "IllegalArgumentException", "(", "\"\"", "+", "compilerLevel", "+", "\"\"", ")", ";", "}", "public", "static", "SpecifiedVersion", "findVersion", "(", "Version", "ver", ")", "{", "if", "(", "ver", ".", "getMajor", "(", ")", "==", "2", ")", "{", "if", "(", "ver", ".", "getMinor", "(", ")", "==", "0", ")", "{", "return", "_20", ";", "}", "}", "if", "(", "ver", ".", "getMajor", "(", ")", "==", "1", ")", "{", "if", "(", "ver", ".", "getMinor", "(", ")", "==", "6", ")", "{", "return", "_16", ";", "}", "if", "(", "ver", ".", "getMinor", "(", ")", "==", "7", ")", "{", "return", "_17", ";", "}", "if", "(", "ver", ".", "getMinor", "(", ")", "==", "8", ")", "{", "return", "_18", ";", "}", "if", "(", "ver", ".", "getMinor", "(", ")", "==", "9", ")", "{", "return", "_19", ";", "}", "}", "return", "UNSPECIFIED", ";", "}", "}", "</s>" ]
6,604
[ "<s>", "package", "org", ".", "codehaus", ".", "groovy", ".", "frameworkadapter", ".", "util", ";", "import", "static", "org", ".", "codehaus", ".", "groovy", ".", "frameworkadapter", ".", "util", ".", "SpecifiedVersion", ".", "UNSPECIFIED", ";", "import", "java", ".", "io", ".", "File", ";", "import", "java", ".", "io", ".", "FileInputStream", ";", "import", "java", ".", "io", ".", "FileNotFoundException", ";", "import", "java", ".", "io", ".", "FileOutputStream", ";", "import", "java", ".", "io", ".", "IOException", ";", "import", "java", ".", "util", ".", "Properties", ";", "import", "org", ".", "eclipse", ".", "osgi", ".", "framework", ".", "internal", ".", "core", ".", "FrameworkProperties", ";", "import", "org", ".", "osgi", ".", "framework", ".", "BundleContext", ";", "public", "class", "CompilerLevelUtils", "{", "private", "static", "final", "String", "GROOVY_COMPILER_LEVEL", "=", "\"\"", ";", "private", "static", "final", "String", "DASH_GROOVY_COMPILER_LEVEL", "=", "\"\"", ";", "private", "static", "final", "String", "ECLIPSE_COMMANDS", "=", "\"\"", ";", "private", "CompilerLevelUtils", "(", ")", "{", "}", "public", "static", "SpecifiedVersion", "findSysPropVersion", "(", ")", "{", "SpecifiedVersion", "version", "=", "SpecifiedVersion", ".", "findVersionFromString", "(", "FrameworkProperties", ".", "getProperty", "(", "GROOVY_COMPILER_LEVEL", ")", ")", ";", "if", "(", "version", "==", "UNSPECIFIED", ")", "{", "version", "=", "internalFindCommandLineVersion", "(", "FrameworkProperties", ".", "getProperty", "(", "ECLIPSE_COMMANDS", ")", ")", ";", "}", "return", "version", ";", "}", "private", "static", "SpecifiedVersion", "internalFindCommandLineVersion", "(", "String", "property", ")", "{", "if", "(", "property", "==", "null", ")", "{", "return", "UNSPECIFIED", ";", "}", "String", "[", "]", "split", "=", "property", ".", "split", "(", "\"\\\\n\"", ")", ";", "String", "versionText", "=", "null", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "split", ".", "length", ";", "i", "++", ")", "{", "if", "(", "DASH_GROOVY_COMPILER_LEVEL", ".", "equals", "(", "split", "[", "i", "]", ")", "&&", "i", "<", "split", ".", "length", "-", "1", ")", "{", "versionText", "=", "split", "[", "i", "+", "1", "]", ";", "break", ";", "}", "}", "return", "SpecifiedVersion", ".", "findVersionFromString", "(", "versionText", ")", ";", "}", "public", "static", "SpecifiedVersion", "findConfigurationVersion", "(", "BundleContext", "context", ")", "throws", "IOException", "{", "File", "properties", "=", "context", ".", "getDataFile", "(", "\"\"", ")", ";", "if", "(", "properties", "==", "null", "||", "!", "properties", ".", "exists", "(", ")", ")", "{", "return", "UNSPECIFIED", ";", "}", "Properties", "props", "=", "new", "Properties", "(", ")", ";", "try", "{", "props", ".", "load", "(", "new", "FileInputStream", "(", "properties", ")", ")", ";", "}", "catch", "(", "FileNotFoundException", "e", ")", "{", "return", "UNSPECIFIED", ";", "}", "return", "SpecifiedVersion", ".", "findVersionFromString", "(", "(", "String", ")", "props", ".", "get", "(", "GROOVY_COMPILER_LEVEL", ")", ")", ";", "}", "public", "static", "void", "writeConfigurationVersion", "(", "SpecifiedVersion", "version", ",", "BundleContext", "context", ")", "throws", "IOException", "{", "if", "(", "context", "==", "null", ")", "{", "return", ";", "}", "File", "properties", "=", "context", ".", "getDataFile", "(", "\"\"", ")", ";", "if", "(", "properties", "==", "null", ")", "{", "throw", "new", "IOException", "(", "\"\"", ")", ";", "}", "if", "(", "!", "properties", ".", "exists", "(", ")", "&&", "!", "properties", ".", "createNewFile", "(", ")", ")", "{", "throw", "new", "IOException", "(", "\"\"", "+", "properties", ".", "getPath", "(", ")", ")", ";", "}", "Properties", "props", "=", "new", "Properties", "(", ")", ";", "try", "{", "props", ".", "load", "(", "new", "FileInputStream", "(", "properties", ")", ")", ";", "}", "catch", "(", "FileNotFoundException", "e", ")", "{", "}", "props", ".", "setProperty", "(", "GROOVY_COMPILER_LEVEL", ",", "version", ".", "versionName", ")", ";", "props", ".", "store", "(", "new", "FileOutputStream", "(", "properties", ")", ",", "\"\"", ")", ";", "}", "}", "</s>" ]
6,605
[ "<s>", "package", "org", ".", "codehaus", ".", "groovy", ".", "frameworkadapter", ";", "import", "java", ".", "io", ".", "IOException", ";", "import", "java", ".", "net", ".", "URLConnection", ";", "import", "java", ".", "util", ".", "ArrayList", ";", "import", "java", ".", "util", ".", "List", ";", "import", "java", ".", "util", ".", "Properties", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "frameworkadapter", ".", "util", ".", "CompilerLevelUtils", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "frameworkadapter", ".", "util", ".", "SpecifiedVersion", ";", "import", "org", ".", "eclipse", ".", "osgi", ".", "baseadaptor", ".", "BaseAdaptor", ";", "import", "org", ".", "eclipse", ".", "osgi", ".", "baseadaptor", ".", "HookConfigurator", ";", "import", "org", ".", "eclipse", ".", "osgi", ".", "baseadaptor", ".", "HookRegistry", ";", "import", "org", ".", "eclipse", ".", "osgi", ".", "baseadaptor", ".", "hooks", ".", "AdaptorHook", ";", "import", "org", ".", "eclipse", ".", "osgi", ".", "framework", ".", "log", ".", "FrameworkLog", ";", "import", "org", ".", "eclipse", ".", "osgi", ".", "internal", ".", "baseadaptor", ".", "StateManager", ";", "import", "org", ".", "eclipse", ".", "osgi", ".", "service", ".", "resolver", ".", "BundleDescription", ";", "import", "org", ".", "eclipse", ".", "osgi", ".", "service", ".", "resolver", ".", "DisabledInfo", ";", "import", "org", ".", "eclipse", ".", "osgi", ".", "service", ".", "resolver", ".", "State", ";", "import", "org", ".", "osgi", ".", "framework", ".", "Bundle", ";", "import", "org", ".", "osgi", ".", "framework", ".", "BundleContext", ";", "import", "org", ".", "osgi", ".", "framework", ".", "BundleException", ";", "import", "org", ".", "osgi", ".", "framework", ".", "ServiceReference", ";", "import", "org", ".", "osgi", ".", "service", ".", "packageadmin", ".", "PackageAdmin", ";", "@", "SuppressWarnings", "(", "\"deprecation\"", ")", "public", "class", "CompilerHook", "implements", "HookConfigurator", ",", "AdaptorHook", "{", "private", "static", "final", "String", "GROOVY_PLUGIN_ID", "=", "\"\"", ";", "private", "SpecifiedVersion", "version", ";", "private", "BaseAdaptor", "adapter", ";", "private", "boolean", "versionFound", "=", "false", ";", "public", "void", "initialize", "(", "BaseAdaptor", "adaptor", ")", "{", "this", ".", "adapter", "=", "adaptor", ";", "}", "public", "void", "frameworkStart", "(", "BundleContext", "context", ")", "throws", "BundleException", "{", "version", "=", "CompilerLevelUtils", ".", "findSysPropVersion", "(", ")", ";", "if", "(", "version", "==", "SpecifiedVersion", ".", "UNSPECIFIED", ")", "{", "try", "{", "version", "=", "CompilerLevelUtils", ".", "findConfigurationVersion", "(", "context", ")", ";", "}", "catch", "(", "IOException", "e", ")", "{", "throw", "new", "BundleException", "(", "\"\"", ",", "e", ")", ";", "}", "}", "if", "(", "version", "==", "SpecifiedVersion", ".", "UNSPECIFIED", ")", "{", "return", ";", "}", "System", ".", "out", ".", "println", "(", "\"\"", "+", "version", ")", ";", "@", "SuppressWarnings", "(", "\"rawtypes\"", ")", "final", "ServiceReference", "serviceReference", "=", "context", ".", "getServiceReference", "(", "PackageAdmin", ".", "class", ".", "getName", "(", ")", ")", ";", "final", "PackageAdmin", "packageAdmin", "=", "(", "PackageAdmin", ")", "context", ".", "getService", "(", "serviceReference", ")", ";", "State", "state", "=", "(", "(", "StateManager", ")", "adapter", ".", "getPlatformAdmin", "(", ")", ")", ".", "getSystemState", "(", ")", ";", "BundleDescription", "[", "]", "disabledBundles", "=", "state", ".", "getDisabledBundles", "(", ")", ";", "List", "<", "Bundle", ">", "bundlesToRefresh", "=", "new", "ArrayList", "<", "Bundle", ">", "(", ")", ";", "boolean", "atLeastOneBundleFound", "=", "false", ";", "for", "(", "BundleDescription", "bundle", ":", "disabledBundles", ")", "{", "atLeastOneBundleFound", "=", "true", ";", "if", "(", "bundle", ".", "getSymbolicName", "(", ")", ".", "equals", "(", "GROOVY_PLUGIN_ID", ")", ")", "{", "handleBundle", "(", "bundle", ",", "state", ",", "context", ")", ";", "bundlesToRefresh", ".", "add", "(", "getBundle", "(", "bundle", ",", "context", ")", ")", ";", "}", "}", "BundleDescription", "[", "]", "bundles", "=", "state", ".", "getBundles", "(", "GROOVY_PLUGIN_ID", ")", ";", "for", "(", "BundleDescription", "bundle", ":", "bundles", ")", "{", "atLeastOneBundleFound", "=", "true", ";", "handleBundle", "(", "bundle", ",", "state", ",", "context", ")", ";", "bundlesToRefresh", ".", "add", "(", "getBundle", "(", "bundle", ",", "context", ")", ")", ";", "}", "if", "(", "atLeastOneBundleFound", ")", "{", "checkVersionFound", "(", "bundlesToRefresh", ")", ";", "Bundle", "[", "]", "allBundles", "=", "bundlesToRefresh", ".", "toArray", "(", "new", "Bundle", "[", "0", "]", ")", ";", "state", ".", "resolve", "(", "bundles", ")", ";", "state", ".", "resolve", "(", "disabledBundles", ")", ";", "packageAdmin", ".", "refreshPackages", "(", "allBundles", ")", ";", "}", "}", "private", "Bundle", "getBundle", "(", "BundleDescription", "bundle", ",", "BundleContext", "context", ")", "{", "return", "context", ".", "getBundle", "(", "bundle", ".", "getBundleId", "(", ")", ")", ";", "}", "private", "void", "checkVersionFound", "(", "List", "<", "Bundle", ">", "bundlesToRefresh", ")", "{", "if", "(", "!", "versionFound", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\"\"", "+", "toVersionNumbers", "(", "bundlesToRefresh", ")", ")", ";", "}", "}", "private", "String", "toVersionNumbers", "(", "List", "<", "Bundle", ">", "bundlesToRefresh", ")", "{", "StringBuilder", "sb", "=", "new", "StringBuilder", "(", ")", ";", "for", "(", "Bundle", "bundle", ":", "bundlesToRefresh", ")", "{", "sb", ".", "append", "(", "bundle", ".", "getVersion", "(", ")", "+", "\"n\"", ")", ";", "}", "return", "sb", ".", "toString", "(", ")", ";", "}", "private", "void", "handleBundle", "(", "BundleDescription", "bundle", ",", "State", "state", ",", "BundleContext", "context", ")", "throws", "BundleException", "{", "if", "(", "bundle", ".", "getVersion", "(", ")", ".", "getMinor", "(", ")", "==", "version", ".", "minorVersion", ")", "{", "getBundle", "(", "bundle", ",", "context", ")", ".", "start", "(", ")", ";", "adapter", ".", "getPlatformAdmin", "(", ")", ".", "removeDisabledInfo", "(", "createDisabledInfo", "(", "state", ",", "bundle", ")", ")", ";", "versionFound", "=", "true", ";", "}", "else", "{", "getBundle", "(", "bundle", ",", "context", ")", ".", "stop", "(", ")", ";", "adapter", ".", "getPlatformAdmin", "(", ")", ".", "addDisabledInfo", "(", "createDisabledInfo", "(", "state", ",", "bundle", ")", ")", ";", "}", "}", "private", "static", "DisabledInfo", "createDisabledInfo", "(", "State", "state", ",", "BundleDescription", "bundle", ")", "{", "DisabledInfo", "info", "=", "new", "DisabledInfo", "(", "\"\"", ",", "\"\"", ",", "bundle", ")", ";", "return", "info", ";", "}", "public", "void", "addHooks", "(", "HookRegistry", "hookRegistry", ")", "{", "hookRegistry", ".", "addAdaptorHook", "(", "this", ")", ";", "}", "public", "void", "frameworkStop", "(", "BundleContext", "context", ")", "throws", "BundleException", "{", "}", "public", "void", "frameworkStopping", "(", "BundleContext", "context", ")", "{", "}", "public", "void", "addProperties", "(", "Properties", "properties", ")", "{", "}", "public", "URLConnection", "mapLocationToURLConnection", "(", "String", "location", ")", "throws", "IOException", "{", "return", "null", ";", "}", "public", "void", "handleRuntimeError", "(", "Throwable", "error", ")", "{", "}", "public", "FrameworkLog", "createFrameworkLog", "(", ")", "{", "return", "null", ";", "}", "}", "</s>" ]
6,606
[ "<s>", "package", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ";", "import", "java", ".", "util", ".", "Date", ";", "@", "SuppressWarnings", "(", "\"nls\"", ")", "public", "class", "DefaultGroovyLogger", "implements", "IGroovyLogger", "{", "public", "void", "log", "(", "TraceCategory", "category", ",", "String", "message", ")", "{", "System", ".", "out", ".", "println", "(", "category", ".", "label", "+", "\"", ":", "\"", "+", "new", "Date", "(", ")", "+", "\"", ":", "\"", "+", "message", ")", ";", "}", "public", "boolean", "isCategoryEnabled", "(", "TraceCategory", "category", ")", "{", "return", "true", ";", "}", "}", "</s>" ]
6,607
[ "<s>", "package", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ";", "import", "junit", ".", "framework", ".", "TestCase", ";", "public", "class", "LoggerTest", "extends", "TestCase", "{", "public", "void", "testLoggers", "(", ")", "throws", "Exception", "{", "DefaultGroovyLogger", "l1", "=", "new", "DefaultGroovyLogger", "(", ")", ";", "DefaultGroovyLogger", "l2", "=", "new", "DefaultGroovyLogger", "(", ")", ";", "DefaultGroovyLogger", "l3", "=", "new", "DefaultGroovyLogger", "(", ")", ";", "DefaultGroovyLogger", "l4", "=", "new", "DefaultGroovyLogger", "(", ")", ";", "DefaultGroovyLogger", "l5", "=", "new", "DefaultGroovyLogger", "(", ")", ";", "assertTrue", "(", "GroovyLogManager", ".", "manager", ".", "addLogger", "(", "l1", ")", ")", ";", "assertFalse", "(", "GroovyLogManager", ".", "manager", ".", "addLogger", "(", "l1", ")", ")", ";", "assertTrue", "(", "GroovyLogManager", ".", "manager", ".", "addLogger", "(", "l2", ")", ")", ";", "assertFalse", "(", "GroovyLogManager", ".", "manager", ".", "addLogger", "(", "l2", ")", ")", ";", "assertTrue", "(", "GroovyLogManager", ".", "manager", ".", "addLogger", "(", "l3", ")", ")", ";", "assertFalse", "(", "GroovyLogManager", ".", "manager", ".", "addLogger", "(", "l3", ")", ")", ";", "assertTrue", "(", "GroovyLogManager", ".", "manager", ".", "addLogger", "(", "l4", ")", ")", ";", "assertFalse", "(", "GroovyLogManager", ".", "manager", ".", "addLogger", "(", "l4", ")", ")", ";", "assertTrue", "(", "GroovyLogManager", ".", "manager", ".", "addLogger", "(", "l5", ")", ")", ";", "assertFalse", "(", "GroovyLogManager", ".", "manager", ".", "addLogger", "(", "l5", ")", ")", ";", "assertTrue", "(", "GroovyLogManager", ".", "manager", ".", "removeLogger", "(", "l1", ")", ")", ";", "assertFalse", "(", "GroovyLogManager", ".", "manager", ".", "removeLogger", "(", "l1", ")", ")", ";", "assertTrue", "(", "GroovyLogManager", ".", "manager", ".", "removeLogger", "(", "l2", ")", ")", ";", "assertFalse", "(", "GroovyLogManager", ".", "manager", ".", "removeLogger", "(", "l2", ")", ")", ";", "assertTrue", "(", "GroovyLogManager", ".", "manager", ".", "removeLogger", "(", "l3", ")", ")", ";", "assertFalse", "(", "GroovyLogManager", ".", "manager", ".", "removeLogger", "(", "l3", ")", ")", ";", "assertTrue", "(", "GroovyLogManager", ".", "manager", ".", "removeLogger", "(", "l4", ")", ")", ";", "assertFalse", "(", "GroovyLogManager", ".", "manager", ".", "removeLogger", "(", "l4", ")", ")", ";", "assertTrue", "(", "GroovyLogManager", ".", "manager", ".", "removeLogger", "(", "l5", ")", ")", ";", "assertFalse", "(", "GroovyLogManager", ".", "manager", ".", "removeLogger", "(", "l5", ")", ")", ";", "assertTrue", "(", "GroovyLogManager", ".", "manager", ".", "addLogger", "(", "l1", ")", ")", ";", "assertFalse", "(", "GroovyLogManager", ".", "manager", ".", "addLogger", "(", "l1", ")", ")", ";", "assertTrue", "(", "GroovyLogManager", ".", "manager", ".", "addLogger", "(", "l2", ")", ")", ";", "assertFalse", "(", "GroovyLogManager", ".", "manager", ".", "addLogger", "(", "l2", ")", ")", ";", "assertTrue", "(", "GroovyLogManager", ".", "manager", ".", "addLogger", "(", "l3", ")", ")", ";", "assertFalse", "(", "GroovyLogManager", ".", "manager", ".", "addLogger", "(", "l3", ")", ")", ";", "assertTrue", "(", "GroovyLogManager", ".", "manager", ".", "addLogger", "(", "l4", ")", ")", ";", "assertFalse", "(", "GroovyLogManager", ".", "manager", ".", "addLogger", "(", "l4", ")", ")", ";", "assertTrue", "(", "GroovyLogManager", ".", "manager", ".", "addLogger", "(", "l5", ")", ")", ";", "assertFalse", "(", "GroovyLogManager", ".", "manager", ".", "addLogger", "(", "l5", ")", ")", ";", "assertTrue", "(", "GroovyLogManager", ".", "manager", ".", "removeLogger", "(", "l5", ")", ")", ";", "assertFalse", "(", "GroovyLogManager", ".", "manager", ".", "removeLogger", "(", "l5", ")", ")", ";", "assertTrue", "(", "GroovyLogManager", ".", "manager", ".", "removeLogger", "(", "l4", ")", ")", ";", "assertFalse", "(", "GroovyLogManager", ".", "manager", ".", "removeLogger", "(", "l4", ")", ")", ";", "assertTrue", "(", "GroovyLogManager", ".", "manager", ".", "removeLogger", "(", "l3", ")", ")", ";", "assertFalse", "(", "GroovyLogManager", ".", "manager", ".", "removeLogger", "(", "l3", ")", ")", ";", "assertTrue", "(", "GroovyLogManager", ".", "manager", ".", "removeLogger", "(", "l2", ")", ")", ";", "assertFalse", "(", "GroovyLogManager", ".", "manager", ".", "removeLogger", "(", "l2", ")", ")", ";", "assertTrue", "(", "GroovyLogManager", ".", "manager", ".", "removeLogger", "(", "l1", ")", ")", ";", "assertFalse", "(", "GroovyLogManager", ".", "manager", ".", "removeLogger", "(", "l1", ")", ")", ";", "assertTrue", "(", "GroovyLogManager", ".", "manager", ".", "addLogger", "(", "l1", ")", ")", ";", "assertFalse", "(", "GroovyLogManager", ".", "manager", ".", "addLogger", "(", "l1", ")", ")", ";", "assertTrue", "(", "GroovyLogManager", ".", "manager", ".", "addLogger", "(", "l2", ")", ")", ";", "assertFalse", "(", "GroovyLogManager", ".", "manager", ".", "addLogger", "(", "l2", ")", ")", ";", "assertTrue", "(", "GroovyLogManager", ".", "manager", ".", "addLogger", "(", "l3", ")", ")", ";", "assertFalse", "(", "GroovyLogManager", ".", "manager", ".", "addLogger", "(", "l3", ")", ")", ";", "assertTrue", "(", "GroovyLogManager", ".", "manager", ".", "addLogger", "(", "l4", ")", ")", ";", "assertFalse", "(", "GroovyLogManager", ".", "manager", ".", "addLogger", "(", "l4", ")", ")", ";", "assertTrue", "(", "GroovyLogManager", ".", "manager", ".", "addLogger", "(", "l5", ")", ")", ";", "assertFalse", "(", "GroovyLogManager", ".", "manager", ".", "addLogger", "(", "l5", ")", ")", ";", "assertTrue", "(", "GroovyLogManager", ".", "manager", ".", "removeLogger", "(", "l3", ")", ")", ";", "assertFalse", "(", "GroovyLogManager", ".", "manager", ".", "removeLogger", "(", "l3", ")", ")", ";", "assertTrue", "(", "GroovyLogManager", ".", "manager", ".", "removeLogger", "(", "l2", ")", ")", ";", "assertFalse", "(", "GroovyLogManager", ".", "manager", ".", "removeLogger", "(", "l2", ")", ")", ";", "assertTrue", "(", "GroovyLogManager", ".", "manager", ".", "removeLogger", "(", "l4", ")", ")", ";", "assertFalse", "(", "GroovyLogManager", ".", "manager", ".", "removeLogger", "(", "l4", ")", ")", ";", "assertTrue", "(", "GroovyLogManager", ".", "manager", ".", "removeLogger", "(", "l5", ")", ")", ";", "assertFalse", "(", "GroovyLogManager", ".", "manager", ".", "removeLogger", "(", "l5", ")", ")", ";", "assertTrue", "(", "GroovyLogManager", ".", "manager", ".", "removeLogger", "(", "l1", ")", ")", ";", "assertFalse", "(", "GroovyLogManager", ".", "manager", ".", "removeLogger", "(", "l1", ")", ")", ";", "}", "}", "</s>" ]
6,608
[ "<s>", "package", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ";", "import", "java", ".", "io", ".", "PrintWriter", ";", "import", "java", ".", "io", ".", "StringWriter", ";", "import", "java", ".", "util", ".", "HashMap", ";", "import", "java", ".", "util", ".", "Map", ";", "public", "class", "GroovyLogManager", "{", "public", "static", "final", "GroovyLogManager", "manager", "=", "new", "GroovyLogManager", "(", ")", ";", "private", "GroovyLogManager", "(", ")", "{", "defaultLogger", "=", "new", "DefaultGroovyLogger", "(", ")", ";", "timers", "=", "new", "HashMap", "<", "String", ",", "Long", ">", "(", ")", ";", "}", "private", "IGroovyLogger", "[", "]", "loggers", "=", "null", ";", "private", "IGroovyLogger", "defaultLogger", ";", "private", "Map", "<", "String", ",", "Long", ">", "timers", ";", "private", "boolean", "useDefaultLogger", ";", "public", "boolean", "addLogger", "(", "IGroovyLogger", "logger", ")", "{", "int", "newIndex", ";", "if", "(", "loggers", "==", "null", ")", "{", "loggers", "=", "new", "IGroovyLogger", "[", "1", "]", ";", "newIndex", "=", "0", ";", "}", "else", "{", "for", "(", "IGroovyLogger", "l", ":", "loggers", ")", "{", "if", "(", "l", "==", "logger", ")", "{", "return", "false", ";", "}", "}", "newIndex", "=", "loggers", ".", "length", ";", "IGroovyLogger", "[", "]", "newLoggers", "=", "new", "IGroovyLogger", "[", "newIndex", "+", "1", "]", ";", "System", ".", "arraycopy", "(", "loggers", ",", "0", ",", "newLoggers", ",", "0", ",", "newIndex", ")", ";", "loggers", "=", "newLoggers", ";", "}", "loggers", "[", "newIndex", "]", "=", "logger", ";", "return", "true", ";", "}", "public", "boolean", "removeLogger", "(", "IGroovyLogger", "logger", ")", "{", "if", "(", "logger", "!=", "null", ")", "{", "int", "foundIndex", "=", "-", "1", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "loggers", ".", "length", ";", "i", "++", ")", "{", "if", "(", "loggers", "[", "i", "]", "==", "logger", ")", "{", "foundIndex", "=", "i", ";", "}", "}", "if", "(", "foundIndex", ">=", "0", ")", "{", "if", "(", "loggers", ".", "length", ">", "1", ")", "{", "IGroovyLogger", "[", "]", "newLoggers", "=", "new", "IGroovyLogger", "[", "loggers", ".", "length", "-", "1", "]", ";", "if", "(", "foundIndex", ">", "0", ")", "{", "System", ".", "arraycopy", "(", "loggers", ",", "0", ",", "newLoggers", ",", "0", ",", "foundIndex", ")", ";", "}", "System", ".", "arraycopy", "(", "loggers", ",", "foundIndex", "+", "1", ",", "newLoggers", ",", "foundIndex", ",", "loggers", ".", "length", "-", "foundIndex", "-", "1", ")", ";", "loggers", "=", "newLoggers", ";", "}", "else", "{", "loggers", "=", "null", ";", "}", "return", "true", ";", "}", "}", "return", "false", ";", "}", "public", "void", "logStart", "(", "String", "event", ")", "{", "timers", ".", "put", "(", "event", ",", "System", ".", "currentTimeMillis", "(", ")", ")", ";", "}", "public", "void", "logEnd", "(", "String", "event", ",", "TraceCategory", "category", ")", "{", "logEnd", "(", "event", ",", "category", ",", "null", ")", ";", "}", "public", "void", "logEnd", "(", "String", "event", ",", "TraceCategory", "category", ",", "String", "message", ")", "{", "Long", "then", "=", "timers", ".", "get", "(", "event", ")", ";", "if", "(", "then", "!=", "null", ")", "{", "if", "(", "hasLoggers", "(", ")", ")", "{", "long", "now", "=", "System", ".", "currentTimeMillis", "(", ")", ";", "long", "elapsed", "=", "now", "-", "then", ".", "longValue", "(", ")", ";", "if", "(", "(", "message", "!=", "null", ")", "&&", "(", "message", ".", "length", "(", ")", ">", "0", ")", ")", "{", "log", "(", "category", ",", "\"\"", "+", "elapsed", "+", "\"ms:", "\"", "+", "event", "+", "\"", "(\"", "+", "message", "+", "\")\"", ")", ";", "}", "else", "{", "log", "(", "category", ",", "\"\"", "+", "elapsed", "+", "\"ms:", "\"", "+", "event", ")", ";", "}", "}", "timers", ".", "remove", "(", "event", ")", ";", "}", "}", "public", "void", "log", "(", "String", "message", ")", "{", "log", "(", "TraceCategory", ".", "DEFAULT", ",", "message", ")", ";", "}", "public", "void", "log", "(", "TraceCategory", "category", ",", "String", "message", ")", "{", "if", "(", "!", "hasLoggers", "(", ")", ")", "{", "return", ";", "}", "if", "(", "loggers", "!=", "null", ")", "{", "for", "(", "IGroovyLogger", "logger", ":", "loggers", ")", "{", "if", "(", "logger", ".", "isCategoryEnabled", "(", "category", ")", ")", "{", "logger", ".", "log", "(", "category", ",", "message", ")", ";", "}", "}", "}", "if", "(", "useDefaultLogger", ")", "{", "defaultLogger", ".", "log", "(", "category", ",", "message", ")", ";", "}", "}", "public", "boolean", "hasLoggers", "(", ")", "{", "return", "loggers", "!=", "null", "||", "useDefaultLogger", ";", "}", "public", "void", "setUseDefaultLogger", "(", "boolean", "useDefaultLogger", ")", "{", "this", ".", "useDefaultLogger", "=", "useDefaultLogger", ";", "}", "public", "void", "logException", "(", "TraceCategory", "cat", ",", "Throwable", "t", ")", "{", "if", "(", "hasLoggers", "(", ")", ")", "{", "StringWriter", "writer", "=", "new", "StringWriter", "(", ")", ";", "t", ".", "printStackTrace", "(", "new", "PrintWriter", "(", "writer", ")", ")", ";", "log", "(", "cat", ",", "\"\"", "+", "writer", ".", "getBuffer", "(", ")", ")", ";", "}", "}", "}", "</s>" ]
6,609
[ "<s>", "package", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ";", "import", "java", ".", "util", ".", "Arrays", ";", "@", "SuppressWarnings", "(", "\"nls\"", ")", "public", "enum", "TraceCategory", "{", "DEFAULT", "(", "\"_\"", ")", ",", "CLASSPATH", "(", "\"Classpath\"", ")", ",", "REFACTORING", "(", "\"Refactoring\"", ")", ",", "COMPILER", "(", "\"Compiler\"", ")", ",", "DSL", "(", "\"DSL\"", ")", ",", "CODESELECT", "(", "\"Code", "select\"", ")", ",", "CONTENT_ASSIST", "(", "\"\"", ")", ",", "AST_TRANSFORM", "(", "\"\"", ")", ";", "TraceCategory", "(", "String", "label", ")", "{", "this", ".", "label", "=", "label", ";", "}", "public", "final", "String", "label", ";", "private", "String", "paddedLabel", ";", "public", "String", "getPaddedLabel", "(", ")", "{", "if", "(", "paddedLabel", "==", "null", ")", "{", "synchronized", "(", "TraceCategory", ".", "class", ")", "{", "if", "(", "longestLabel", "==", "-", "1", ")", "{", "calculateLongest", "(", ")", ";", "}", "}", "int", "extraSpace", "=", "longestLabel", "-", "label", ".", "length", "(", ")", ";", "paddedLabel", "=", "spaces", "(", "extraSpace", ")", "+", "label", ";", "}", "return", "paddedLabel", ";", "}", "private", "String", "spaces", "(", "int", "extraSpace", ")", "{", "char", "[", "]", "a", "=", "new", "char", "[", "extraSpace", "]", ";", "Arrays", ".", "fill", "(", "a", ",", "'", "'", ")", ";", "return", "new", "String", "(", "a", ")", ";", "}", "private", "static", "void", "calculateLongest", "(", ")", "{", "int", "maybeLongest", "=", "longestLabel", ";", "for", "(", "TraceCategory", "category", ":", "values", "(", ")", ")", "{", "maybeLongest", "=", "Math", ".", "max", "(", "category", ".", "label", ".", "length", "(", ")", ",", "maybeLongest", ")", ";", "}", "longestLabel", "=", "maybeLongest", ";", "}", "private", "static", "String", "[", "]", "stringValues", ";", "public", "static", "String", "[", "]", "stringValues", "(", ")", "{", "if", "(", "stringValues", "==", "null", ")", "{", "TraceCategory", "[", "]", "values", "=", "values", "(", ")", ";", "stringValues", "=", "new", "String", "[", "values", ".", "length", "]", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "values", ".", "length", ";", "i", "++", ")", "{", "stringValues", "[", "i", "]", "=", "values", "[", "i", "]", ".", "label", ";", "}", "}", "return", "stringValues", ";", "}", "private", "static", "int", "longestLabel", "=", "-", "1", ";", "}", "</s>" ]
6,610
[ "<s>", "package", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ";", "public", "interface", "IGroovyLogger", "{", "void", "log", "(", "TraceCategory", "category", ",", "String", "message", ")", ";", "boolean", "isCategoryEnabled", "(", "TraceCategory", "category", ")", ";", "}", "</s>" ]
6,611
[ "<s>", "package", "org", ".", "codehaus", ".", "greclipse", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "antlr", ".", "parser", ".", "GroovyTokenTypes", ";", "public", "class", "GroovyTokenTypeBridge", "{", "public", "static", "int", "IDENT", "=", "GroovyTokenTypes", ".", "IDENT", ";", "public", "static", "int", "LBRACK", "=", "GroovyTokenTypes", ".", "LBRACK", ";", "public", "static", "int", "LCURLY", "=", "GroovyTokenTypes", ".", "LCURLY", ";", "public", "static", "int", "LPAREN", "=", "GroovyTokenTypes", ".", "LPAREN", ";", "public", "static", "int", "NLS", "=", "GroovyTokenTypes", ".", "NLS", ";", "public", "static", "int", "RPAREN", "=", "GroovyTokenTypes", ".", "RPAREN", ";", "public", "static", "int", "STRING_CTOR_START", "=", "GroovyTokenTypes", ".", "STRING_CTOR_START", ";", "public", "static", "int", "WS", "=", "GroovyTokenTypes", ".", "WS", ";", "public", "static", "int", "COMMA", "=", "GroovyTokenTypes", ".", "COMMA", ";", "public", "static", "int", "SEMI", "=", "GroovyTokenTypes", ".", "SEMI", ";", "public", "static", "int", "RCURLY", "=", "GroovyTokenTypes", ".", "RCURLY", ";", "public", "static", "int", "SL_COMMENT", "=", "GroovyTokenTypes", ".", "SL_COMMENT", ";", "public", "static", "int", "CLOSABLE_BLOCK_OP", "=", "GroovyTokenTypes", ".", "CLOSABLE_BLOCK_OP", ";", "public", "static", "int", "EOF", "=", "GroovyTokenTypes", ".", "EOF", ";", "public", "static", "int", "LITERAL_if", "=", "GroovyTokenTypes", ".", "LITERAL_if", ";", "public", "static", "int", "LITERAL_else", "=", "GroovyTokenTypes", ".", "LITERAL_else", ";", "public", "static", "int", "LITERAL_for", "=", "GroovyTokenTypes", ".", "LITERAL_for", ";", "public", "static", "int", "LITERAL_switch", "=", "GroovyTokenTypes", ".", "LITERAL_switch", ";", "public", "static", "int", "LITERAL_while", "=", "GroovyTokenTypes", ".", "LITERAL_while", ";", "public", "static", "int", "RBRACK", "=", "GroovyTokenTypes", ".", "RBRACK", ";", "public", "static", "int", "ML_COMMENT", "=", "GroovyTokenTypes", ".", "ML_COMMENT", ";", "public", "static", "int", "STRING_CTOR_END", "=", "GroovyTokenTypes", ".", "STRING_CTOR_END", ";", "public", "static", "int", "LITERAL_as", "=", "GroovyTokenTypes", ".", "LITERAL_as", ";", "}", "</s>" ]
6,612
[ "<s>", "package", "org", ".", "codehaus", ".", "groovy", ".", "antlr", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "control", ".", "ParserPlugin", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "control", ".", "ParserPluginFactory", ";", "public", "class", "ErrorRecoveredCSTParserPluginFactory", "extends", "ParserPluginFactory", "{", "private", "ICSTReporter", "cstReporter", ";", "public", "ErrorRecoveredCSTParserPluginFactory", "(", "ICSTReporter", "cstReporter", ")", "{", "this", ".", "cstReporter", "=", "cstReporter", ";", "}", "public", "ErrorRecoveredCSTParserPluginFactory", "(", ")", "{", "this", ".", "cstReporter", "=", "null", ";", "}", "public", "ParserPlugin", "createParserPlugin", "(", ")", "{", "return", "new", "ErrorRecoveredCSTParserPlugin", "(", "cstReporter", ")", ";", "}", "}", "</s>" ]
6,613
[ "<s>", "package", "org", ".", "codehaus", ".", "groovy", ".", "antlr", ";", "import", "antlr", ".", "RecognitionException", ";", "import", "antlr", ".", "TokenStreamException", ";", "import", "antlr", ".", "TokenStreamRecognitionException", ";", "import", "antlr", ".", "collections", ".", "AST", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "GroovyBugError", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "antlr", ".", "parser", ".", "GroovyLexer", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "antlr", ".", "parser", ".", "GroovyRecognizer", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "antlr", ".", "parser", ".", "GroovyTokenTypes", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "antlr", ".", "treewalker", ".", "*", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "*", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "expr", ".", "*", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "stmt", ".", "*", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "control", ".", "CompilationFailedException", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "control", ".", "ParserPlugin", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "control", ".", "SourceUnit", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "control", ".", "messages", ".", "SyntaxErrorMessage", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "syntax", ".", "*", ";", "import", "org", ".", "objectweb", ".", "asm", ".", "Opcodes", ";", "import", "java", ".", "io", ".", "FileNotFoundException", ";", "import", "java", ".", "io", ".", "FileOutputStream", ";", "import", "java", ".", "io", ".", "FileWriter", ";", "import", "java", ".", "io", ".", "PrintStream", ";", "import", "java", ".", "io", ".", "Reader", ";", "import", "java", ".", "security", ".", "AccessController", ";", "import", "java", ".", "security", ".", "PrivilegedAction", ";", "import", "java", ".", "util", ".", "ArrayList", ";", "import", "java", ".", "util", ".", "HashSet", ";", "import", "java", ".", "util", ".", "Iterator", ";", "import", "java", ".", "util", ".", "LinkedList", ";", "import", "java", ".", "util", ".", "List", ";", "import", "java", ".", "util", ".", "Set", ";", "public", "class", "AntlrParserPlugin", "extends", "ASTHelper", "implements", "ParserPlugin", ",", "GroovyTokenTypes", "{", "private", "static", "class", "AnonymousInnerClassCarrier", "extends", "Expression", "{", "ClassNode", "innerClass", ";", "public", "Expression", "transformExpression", "(", "ExpressionTransformer", "transformer", ")", "{", "return", "null", ";", "}", "@", "Override", "public", "void", "setSourcePosition", "(", "final", "ASTNode", "node", ")", "{", "super", ".", "setSourcePosition", "(", "node", ")", ";", "innerClass", ".", "setSourcePosition", "(", "node", ")", ";", "}", "@", "Override", "public", "void", "setColumnNumber", "(", "final", "int", "columnNumber", ")", "{", "super", ".", "setColumnNumber", "(", "columnNumber", ")", ";", "innerClass", ".", "setColumnNumber", "(", "columnNumber", ")", ";", "}", "@", "Override", "public", "void", "setLineNumber", "(", "final", "int", "lineNumber", ")", "{", "super", ".", "setLineNumber", "(", "lineNumber", ")", ";", "innerClass", ".", "setLineNumber", "(", "lineNumber", ")", ";", "}", "@", "Override", "public", "void", "setLastColumnNumber", "(", "final", "int", "columnNumber", ")", "{", "super", ".", "setLastColumnNumber", "(", "columnNumber", ")", ";", "innerClass", ".", "setLastColumnNumber", "(", "columnNumber", ")", ";", "}", "@", "Override", "public", "void", "setLastLineNumber", "(", "final", "int", "lineNumber", ")", "{", "super", ".", "setLastLineNumber", "(", "lineNumber", ")", ";", "innerClass", ".", "setLastLineNumber", "(", "lineNumber", ")", ";", "}", "}", "protected", "AST", "ast", ";", "private", "ClassNode", "classNode", ";", "protected", "String", "[", "]", "tokenNames", ";", "private", "int", "innerClassCounter", "=", "1", ";", "private", "boolean", "enumConstantBeingDef", "=", "false", ";", "private", "boolean", "forStatementBeingDef", "=", "false", ";", "private", "boolean", "firstParamIsVarArg", "=", "false", ";", "private", "boolean", "firstParam", "=", "false", ";", "protected", "LocationSupport", "locations", "=", "LocationSupport", ".", "NO_LOCATIONS", ";", "public", "Reduction", "parseCST", "(", "final", "SourceUnit", "sourceUnit", ",", "Reader", "reader", ")", "throws", "CompilationFailedException", "{", "final", "SourceBuffer", "sourceBuffer", "=", "new", "SourceBuffer", "(", ")", ";", "transformCSTIntoAST", "(", "sourceUnit", ",", "reader", ",", "sourceBuffer", ")", ";", "processAST", "(", ")", ";", "return", "outputAST", "(", "sourceUnit", ",", "sourceBuffer", ")", ";", "}", "protected", "void", "transformCSTIntoAST", "(", "SourceUnit", "sourceUnit", ",", "Reader", "reader", ",", "SourceBuffer", "sourceBuffer", ")", "throws", "CompilationFailedException", "{", "ast", "=", "null", ";", "setController", "(", "sourceUnit", ")", ";", "UnicodeEscapingReader", "unicodeReader", "=", "new", "UnicodeEscapingReader", "(", "reader", ",", "sourceBuffer", ")", ";", "UnicodeLexerSharedInputState", "inputState", "=", "new", "UnicodeLexerSharedInputState", "(", "unicodeReader", ")", ";", "GroovyLexer", "lexer", "=", "new", "GroovyLexer", "(", "inputState", ")", ";", "unicodeReader", ".", "setLexer", "(", "lexer", ")", ";", "GroovyRecognizer", "parser", "=", "GroovyRecognizer", ".", "make", "(", "lexer", ")", ";", "parser", ".", "setSourceBuffer", "(", "sourceBuffer", ")", ";", "tokenNames", "=", "parser", ".", "getTokenNames", "(", ")", ";", "parser", ".", "setFilename", "(", "sourceUnit", ".", "getName", "(", ")", ")", ";", "try", "{", "parser", ".", "compilationUnit", "(", ")", ";", "}", "catch", "(", "TokenStreamRecognitionException", "tsre", ")", "{", "RecognitionException", "e", "=", "tsre", ".", "recog", ";", "SyntaxException", "se", "=", "new", "SyntaxException", "(", "e", ".", "getMessage", "(", ")", ",", "e", ",", "e", ".", "getLine", "(", ")", ",", "e", ".", "getColumn", "(", ")", ")", ";", "se", ".", "setFatal", "(", "true", ")", ";", "sourceUnit", ".", "addError", "(", "se", ")", ";", "}", "catch", "(", "RecognitionException", "e", ")", "{", "SyntaxException", "se", "=", "new", "SyntaxException", "(", "e", ".", "getMessage", "(", ")", ",", "e", ",", "e", ".", "getLine", "(", ")", ",", "e", ".", "getColumn", "(", ")", ")", ";", "se", ".", "setFatal", "(", "true", ")", ";", "sourceUnit", ".", "addError", "(", "se", ")", ";", "}", "catch", "(", "TokenStreamException", "e", ")", "{", "sourceUnit", ".", "addException", "(", "e", ")", ";", "}", "configureLocationSupport", "(", "sourceBuffer", ")", ";", "ast", "=", "parser", ".", "getAST", "(", ")", ";", "}", "protected", "void", "configureLocationSupport", "(", "SourceBuffer", "sourceBuffer", ")", "{", "locations", "=", "sourceBuffer", ".", "getLocationSupport", "(", ")", ";", "}", "protected", "void", "processAST", "(", ")", "{", "AntlrASTProcessor", "snippets", "=", "new", "AntlrASTProcessSnippets", "(", ")", ";", "ast", "=", "snippets", ".", "process", "(", "ast", ")", ";", "}", "public", "Reduction", "outputAST", "(", "final", "SourceUnit", "sourceUnit", ",", "final", "SourceBuffer", "sourceBuffer", ")", "{", "AccessController", ".", "doPrivileged", "(", "new", "PrivilegedAction", "(", ")", "{", "public", "Object", "run", "(", ")", "{", "outputASTInVariousFormsIfNeeded", "(", "sourceUnit", ",", "sourceBuffer", ")", ";", "return", "null", ";", "}", "}", ")", ";", "return", "null", ";", "}", "protected", "void", "outputASTInVariousFormsIfNeeded", "(", "SourceUnit", "sourceUnit", ",", "SourceBuffer", "sourceBuffer", ")", "{", "if", "(", "\"groovy\"", ".", "equals", "(", "System", ".", "getProperty", "(", "\"antlr.ast\"", ")", ")", ")", "{", "try", "{", "PrintStream", "out", "=", "new", "PrintStream", "(", "new", "FileOutputStream", "(", "sourceUnit", ".", "getName", "(", ")", "+", "\"\"", ")", ")", ";", "Visitor", "visitor", "=", "new", "SourcePrinter", "(", "out", ",", "tokenNames", ")", ";", "AntlrASTProcessor", "treewalker", "=", "new", "SourceCodeTraversal", "(", "visitor", ")", ";", "treewalker", ".", "process", "(", "ast", ")", ";", "}", "catch", "(", "FileNotFoundException", "e", ")", "{", "System", ".", "out", ".", "println", "(", "\"\"", "+", "sourceUnit", ".", "getName", "(", ")", "+", "\"\"", ")", ";", "}", "}", "if", "(", "\"mindmap\"", ".", "equals", "(", "System", ".", "getProperty", "(", "\"antlr.ast\"", ")", ")", ")", "{", "try", "{", "PrintStream", "out", "=", "new", "PrintStream", "(", "new", "FileOutputStream", "(", "sourceUnit", ".", "getName", "(", ")", "+", "\".mm\"", ")", ")", ";", "Visitor", "visitor", "=", "new", "MindMapPrinter", "(", "out", ",", "tokenNames", ")", ";", "AntlrASTProcessor", "treewalker", "=", "new", "PreOrderTraversal", "(", "visitor", ")", ";", "treewalker", ".", "process", "(", "ast", ")", ";", "}", "catch", "(", "FileNotFoundException", "e", ")", "{", "System", ".", "out", ".", "println", "(", "\"\"", "+", "sourceUnit", ".", "getName", "(", ")", "+", "\".mm\"", ")", ";", "}", "}", "if", "(", "\"\"", ".", "equals", "(", "System", ".", "getProperty", "(", "\"antlr.ast\"", ")", ")", ")", "{", "try", "{", "PrintStream", "out", "=", "new", "PrintStream", "(", "new", "FileOutputStream", "(", "sourceUnit", ".", "getName", "(", ")", "+", "\".mm\"", ")", ")", ";", "Visitor", "visitor", "=", "new", "MindMapPrinter", "(", "out", ",", "tokenNames", ",", "sourceBuffer", ")", ";", "AntlrASTProcessor", "treewalker", "=", "new", "PreOrderTraversal", "(", "visitor", ")", ";", "treewalker", ".", "process", "(", "ast", ")", ";", "}", "catch", "(", "FileNotFoundException", "e", ")", "{", "System", ".", "out", ".", "println", "(", "\"\"", "+", "sourceUnit", ".", "getName", "(", ")", "+", "\".mm\"", ")", ";", "}", "}", "if", "(", "\"html\"", ".", "equals", "(", "System", ".", "getProperty", "(", "\"antlr.ast\"", ")", ")", ")", "{", "try", "{", "PrintStream", "out", "=", "new", "PrintStream", "(", "new", "FileOutputStream", "(", "sourceUnit", ".", "getName", "(", ")", "+", "\".html\"", ")", ")", ";", "List", "<", "VisitorAdapter", ">", "v", "=", "new", "ArrayList", "<", "VisitorAdapter", ">", "(", ")", ";", "v", ".", "add", "(", "new", "NodeAsHTMLPrinter", "(", "out", ",", "tokenNames", ")", ")", ";", "v", ".", "add", "(", "new", "SourcePrinter", "(", "out", ",", "tokenNames", ")", ")", ";", "Visitor", "visitors", "=", "new", "CompositeVisitor", "(", "v", ")", ";", "AntlrASTProcessor", "treewalker", "=", "new", "SourceCodeTraversal", "(", "visitors", ")", ";", "treewalker", ".", "process", "(", "ast", ")", ";", "}", "catch", "(", "FileNotFoundException", "e", ")", "{", "System", ".", "out", ".", "println", "(", "\"\"", "+", "sourceUnit", ".", "getName", "(", ")", "+", "\".html\"", ")", ";", "}", "}", "}", "public", "ModuleNode", "buildAST", "(", "SourceUnit", "sourceUnit", ",", "ClassLoader", "classLoader", ",", "Reduction", "cst", ")", "throws", "ParserException", "{", "setClassLoader", "(", "classLoader", ")", ";", "makeModule", "(", ")", ";", "try", "{", "innerClassCounter", "=", "1", ";", "convertGroovy", "(", "ast", ")", ";", "boolean", "hasNoMethods", "=", "output", ".", "getMethods", "(", ")", ".", "isEmpty", "(", ")", ";", "if", "(", "hasNoMethods", "&&", "sourceUnit", ".", "getErrorCollector", "(", ")", ".", "hasErrors", "(", ")", "&&", "looksBroken", "(", "output", ")", ")", "{", "output", ".", "setEncounteredUnrecoverableError", "(", "true", ")", ";", "}", "if", "(", "output", ".", "getStatementBlock", "(", ")", ".", "isEmpty", "(", ")", "&&", "hasNoMethods", "&&", "output", ".", "getClasses", "(", ")", ".", "isEmpty", "(", ")", ")", "{", "if", "(", "ast", "==", "null", "&&", "sourceUnit", ".", "getErrorCollector", "(", ")", ".", "hasErrors", "(", ")", ")", "{", "output", ".", "setEncounteredUnrecoverableError", "(", "true", ")", ";", "}", "output", ".", "addStatement", "(", "ReturnStatement", ".", "RETURN_NULL_OR_VOID", ")", ";", "}", "ClassNode", "scriptClassNode", "=", "output", ".", "getScriptClassDummy", "(", ")", ";", "if", "(", "scriptClassNode", "!=", "null", ")", "{", "List", "<", "Statement", ">", "statements", "=", "output", ".", "getStatementBlock", "(", ")", ".", "getStatements", "(", ")", ";", "if", "(", "statements", ".", "size", "(", ")", ">", "0", ")", "{", "Statement", "firstStatement", "=", "statements", ".", "get", "(", "0", ")", ";", "Statement", "lastStatement", "=", "statements", ".", "get", "(", "statements", ".", "size", "(", ")", "-", "1", ")", ";", "scriptClassNode", ".", "setSourcePosition", "(", "firstStatement", ")", ";", "scriptClassNode", ".", "setLastColumnNumber", "(", "lastStatement", ".", "getLastColumnNumber", "(", ")", ")", ";", "scriptClassNode", ".", "setLastLineNumber", "(", "lastStatement", ".", "getLastLineNumber", "(", ")", ")", ";", "}", "}", "fixModuleNodeLocations", "(", ")", ";", "}", "catch", "(", "ASTRuntimeException", "e", ")", "{", "throw", "new", "ASTParserException", "(", "e", ".", "getMessage", "(", ")", "+", "\".", "File:", "\"", "+", "sourceUnit", ".", "getName", "(", ")", ",", "e", ")", ";", "}", "return", "output", ";", "}", "private", "boolean", "looksBroken", "(", "ModuleNode", "moduleNode", ")", "{", "List", "<", "ClassNode", ">", "classes", "=", "moduleNode", ".", "getClasses", "(", ")", ";", "if", "(", "classes", ".", "size", "(", ")", "!=", "1", "||", "!", "classes", ".", "get", "(", "0", ")", ".", "isScript", "(", ")", ")", "{", "return", "false", ";", "}", "BlockStatement", "statementBlock", "=", "moduleNode", ".", "getStatementBlock", "(", ")", ";", "if", "(", "statementBlock", ".", "isEmpty", "(", ")", ")", "{", "return", "true", ";", "}", "List", "<", "Statement", ">", "statements", "=", "statementBlock", ".", "getStatements", "(", ")", ";", "if", "(", "statements", "!=", "null", "&&", "statements", ".", "size", "(", ")", "==", "1", ")", "{", "Statement", "statement", "=", "statements", ".", "get", "(", "0", ")", ";", "if", "(", "statement", "instanceof", "ExpressionStatement", ")", "{", "Expression", "expression", "=", "(", "(", "ExpressionStatement", ")", "statement", ")", ".", "getExpression", "(", ")", ";", "if", "(", "expression", "instanceof", "ConstantExpression", ")", "{", "if", "(", "expression", ".", "toString", "(", ")", ".", "equals", "(", "\"\"", ")", ")", "{", "return", "true", ";", "}", "}", "}", "}", "return", "false", ";", "}", "protected", "void", "convertGroovy", "(", "AST", "node", ")", "{", "while", "(", "node", "!=", "null", ")", "{", "int", "type", "=", "node", ".", "getType", "(", ")", ";", "switch", "(", "type", ")", "{", "case", "PACKAGE_DEF", ":", "packageDef", "(", "node", ")", ";", "break", ";", "case", "STATIC_IMPORT", ":", "case", "IMPORT", ":", "importDef", "(", "node", ")", ";", "break", ";", "case", "CLASS_DEF", ":", "classDef", "(", "node", ")", ";", "break", ";", "case", "INTERFACE_DEF", ":", "interfaceDef", "(", "node", ")", ";", "break", ";", "case", "METHOD_DEF", ":", "methodDef", "(", "node", ")", ";", "break", ";", "case", "ENUM_DEF", ":", "enumDef", "(", "node", ")", ";", "break", ";", "case", "ANNOTATION_DEF", ":", "annotationDef", "(", "node", ")", ";", "break", ";", "default", ":", "{", "Statement", "statement", "=", "statement", "(", "node", ")", ";", "output", ".", "addStatement", "(", "statement", ")", ";", "}", "}", "node", "=", "node", ".", "getNextSibling", "(", ")", ";", "}", "}", "protected", "void", "packageDef", "(", "AST", "packageDef", ")", "{", "List", "<", "AnnotationNode", ">", "annotations", "=", "new", "ArrayList", "<", "AnnotationNode", ">", "(", ")", ";", "AST", "node", "=", "packageDef", ".", "getFirstChild", "(", ")", ";", "if", "(", "isType", "(", "ANNOTATIONS", ",", "node", ")", ")", "{", "processAnnotations", "(", "annotations", ",", "node", ")", ";", "node", "=", "node", ".", "getNextSibling", "(", ")", ";", "}", "if", "(", "node", "==", "null", ")", "{", "return", ";", "}", "String", "name", "=", "qualifiedName", "(", "node", ")", ";", "setPackageName", "(", "name", ")", ";", "if", "(", "name", "!=", "null", "&&", "name", ".", "length", "(", ")", ">", "0", ")", "{", "name", "+=", "'.'", ";", "}", "PackageNode", "packageNode", "=", "new", "PackageNode", "(", "name", ")", ";", "packageNode", ".", "addAnnotations", "(", "annotations", ")", ";", "output", ".", "setPackage", "(", "packageNode", ")", ";", "configureAST", "(", "packageNode", ",", "node", ")", ";", "}", "protected", "void", "importDef", "(", "AST", "importNode", ")", "{", "boolean", "isStatic", "=", "importNode", ".", "getType", "(", ")", "==", "STATIC_IMPORT", ";", "List", "<", "AnnotationNode", ">", "annotations", "=", "new", "ArrayList", "<", "AnnotationNode", ">", "(", ")", ";", "AST", "node", "=", "importNode", ".", "getFirstChild", "(", ")", ";", "if", "(", "isType", "(", "ANNOTATIONS", ",", "node", ")", ")", "{", "processAnnotations", "(", "annotations", ",", "node", ")", ";", "node", "=", "node", ".", "getNextSibling", "(", ")", ";", "}", "String", "alias", "=", "null", ";", "AST", "aliasNode", "=", "null", ";", "if", "(", "isType", "(", "LITERAL_as", ",", "node", ")", ")", "{", "node", "=", "node", ".", "getFirstChild", "(", ")", ";", "aliasNode", "=", "node", ".", "getNextSibling", "(", ")", ";", "alias", "=", "identifier", "(", "aliasNode", ")", ";", "}", "if", "(", "node", "==", "null", ")", "{", "if", "(", "isStatic", ")", "{", "addStaticImport", "(", "ClassHelper", ".", "OBJECT_TYPE", ",", "\"\"", ",", "null", ",", "annotations", ")", ";", "}", "else", "{", "addImport", "(", "ClassHelper", ".", "OBJECT_TYPE", ",", "\"\"", ",", "null", ",", "annotations", ")", ";", "}", "return", ";", "}", "if", "(", "node", ".", "getNumberOfChildren", "(", ")", "==", "0", ")", "{", "String", "name", "=", "identifier", "(", "node", ")", ";", "ClassNode", "type", "=", "ClassHelper", ".", "make", "(", "name", ")", ";", "configureAST", "(", "type", ",", "importNode", ")", ";", "addImport", "(", "type", ",", "name", ",", "alias", ",", "annotations", ")", ";", "return", ";", "}", "AST", "packageNode", "=", "node", ".", "getFirstChild", "(", ")", ";", "String", "packageName", "=", "qualifiedName", "(", "packageNode", ")", ";", "AST", "nameNode", "=", "packageNode", ".", "getNextSibling", "(", ")", ";", "if", "(", "isType", "(", "STAR", ",", "nameNode", ")", ")", "{", "if", "(", "isStatic", ")", "{", "ClassNode", "type", "=", "ClassHelper", ".", "make", "(", "packageName", ")", ";", "configureAST", "(", "type", ",", "packageNode", ")", ";", "addStaticStarImport", "(", "type", ",", "packageName", ",", "annotations", ")", ";", "ASTNode", "imp", "=", "(", "ASTNode", ")", "output", ".", "getStaticStarImports", "(", ")", ".", "get", "(", "packageName", ")", ";", "configureAST", "(", "imp", ",", "importNode", ")", ";", "}", "else", "{", "addStarImport", "(", "packageName", ",", "annotations", ")", ";", "ASTNode", "imp", "=", "(", "ASTNode", ")", "output", ".", "getStarImports", "(", ")", ".", "get", "(", "output", ".", "getStarImports", "(", ")", ".", "size", "(", ")", "-", "1", ")", ";", "configureAST", "(", "imp", ",", "importNode", ")", ";", "}", "if", "(", "alias", "!=", "null", ")", "throw", "new", "GroovyBugError", "(", "\"\"", "+", "\"\"", ")", ";", "}", "else", "{", "ImportNode", "imp", ";", "String", "name", "=", "identifier", "(", "nameNode", ")", ";", "if", "(", "isStatic", ")", "{", "ClassNode", "type", "=", "ClassHelper", ".", "make", "(", "packageName", ")", ";", "configureAST", "(", "type", ",", "packageNode", ")", ";", "addStaticImport", "(", "type", ",", "name", ",", "alias", ",", "annotations", ")", ";", "imp", "=", "output", ".", "getStaticImports", "(", ")", ".", "get", "(", "alias", "==", "null", "?", "name", ":", "alias", ")", ";", "configureAST", "(", "imp", ",", "importNode", ")", ";", "ConstantExpression", "nameExpr", "=", "new", "ConstantExpression", "(", "name", ")", ";", "configureAST", "(", "nameExpr", ",", "nameNode", ")", ";", "imp", ".", "setFieldNameExpr", "(", "nameExpr", ")", ";", "}", "else", "{", "ClassNode", "type", "=", "ClassHelper", ".", "make", "(", "packageName", "+", "\".\"", "+", "name", ")", ";", "configureAST", "(", "type", ",", "nameNode", ")", ";", "addImport", "(", "type", ",", "name", ",", "alias", ",", "annotations", ")", ";", "imp", "=", "output", ".", "getImport", "(", "alias", "==", "null", "?", "name", ":", "alias", ")", ";", "configureAST", "(", "imp", ",", "importNode", ")", ";", "}", "if", "(", "alias", "!=", "null", ")", "{", "ConstantExpression", "aliasExpr", "=", "new", "ConstantExpression", "(", "alias", ")", ";", "configureAST", "(", "aliasExpr", ",", "aliasNode", ")", ";", "imp", ".", "setAliasExpr", "(", "aliasExpr", ")", ";", "}", "}", "}", "private", "void", "processAnnotations", "(", "List", "<", "AnnotationNode", ">", "annotations", ",", "AST", "node", ")", "{", "AST", "child", "=", "node", ".", "getFirstChild", "(", ")", ";", "while", "(", "child", "!=", "null", ")", "{", "if", "(", "isType", "(", "ANNOTATION", ",", "child", ")", ")", "annotations", ".", "add", "(", "annotation", "(", "child", ")", ")", ";", "child", "=", "child", ".", "getNextSibling", "(", ")", ";", "}", "}", "protected", "void", "annotationDef", "(", "AST", "classDef", ")", "{", "List", "<", "AnnotationNode", ">", "annotations", "=", "new", "ArrayList", "<", "AnnotationNode", ">", "(", ")", ";", "AST", "node", "=", "classDef", ".", "getFirstChild", "(", ")", ";", "int", "modifiers", "=", "Opcodes", ".", "ACC_PUBLIC", ";", "if", "(", "isType", "(", "MODIFIERS", ",", "node", ")", ")", "{", "modifiers", "=", "modifiers", "(", "node", ",", "annotations", ",", "modifiers", ")", ";", "checkNoInvalidModifier", "(", "classDef", ",", "\"\"", ",", "modifiers", ",", "Opcodes", ".", "ACC_SYNCHRONIZED", ",", "\"synchronized\"", ")", ";", "node", "=", "node", ".", "getNextSibling", "(", ")", ";", "}", "modifiers", "|=", "Opcodes", ".", "ACC_ABSTRACT", "|", "Opcodes", ".", "ACC_INTERFACE", "|", "Opcodes", ".", "ACC_ANNOTATION", ";", "String", "name", "=", "identifier", "(", "node", ")", ";", "GroovySourceAST", "groovySourceAST", "=", "(", "GroovySourceAST", ")", "node", ";", "int", "nameStart", "=", "locations", ".", "findOffset", "(", "groovySourceAST", ".", "getLine", "(", ")", ",", "groovySourceAST", ".", "getColumn", "(", ")", ")", ";", "int", "nameEnd", "=", "locations", ".", "findOffset", "(", "groovySourceAST", ".", "getLineLast", "(", ")", ",", "groovySourceAST", ".", "getColumnLast", "(", ")", ")", "-", "1", ";", "node", "=", "node", ".", "getNextSibling", "(", ")", ";", "ClassNode", "superClass", "=", "ClassHelper", ".", "OBJECT_TYPE", ";", "GenericsType", "[", "]", "genericsType", "=", "null", ";", "if", "(", "isType", "(", "TYPE_PARAMETERS", ",", "node", ")", ")", "{", "genericsType", "=", "makeGenericsType", "(", "node", ")", ";", "node", "=", "node", ".", "getNextSibling", "(", ")", ";", "}", "ClassNode", "[", "]", "interfaces", "=", "ClassNode", ".", "EMPTY_ARRAY", ";", "if", "(", "isType", "(", "EXTENDS_CLAUSE", ",", "node", ")", ")", "{", "interfaces", "=", "interfaces", "(", "node", ")", ";", "node", "=", "node", ".", "getNextSibling", "(", ")", ";", "}", "boolean", "syntheticPublic", "=", "(", "(", "modifiers", "&", "Opcodes", ".", "ACC_SYNTHETIC", ")", "!=", "0", ")", ";", "modifiers", "&=", "~", "Opcodes", ".", "ACC_SYNTHETIC", ";", "classNode", "=", "new", "ClassNode", "(", "dot", "(", "getPackageName", "(", ")", ",", "name", ")", ",", "modifiers", ",", "superClass", ",", "interfaces", ",", "null", ")", ";", "classNode", ".", "setSyntheticPublic", "(", "syntheticPublic", ")", ";", "classNode", ".", "addAnnotations", "(", "annotations", ")", ";", "classNode", ".", "setGenericsTypes", "(", "genericsType", ")", ";", "classNode", ".", "addInterface", "(", "ClassHelper", ".", "Annotation_TYPE", ")", ";", "classNode", ".", "setNameStart", "(", "nameStart", ")", ";", "classNode", ".", "setNameEnd", "(", "nameEnd", ")", ";", "configureAST", "(", "classNode", ",", "classDef", ")", ";", "assertNodeType", "(", "OBJBLOCK", ",", "node", ")", ";", "objectBlock", "(", "node", ")", ";", "output", ".", "addClass", "(", "classNode", ")", ";", "classNode", "=", "null", ";", "}", "protected", "void", "interfaceDef", "(", "AST", "classDef", ")", "{", "int", "oldInnerClassCounter", "=", "innerClassCounter", ";", "innerInterfaceDef", "(", "classDef", ")", ";", "classNode", "=", "null", ";", "innerClassCounter", "=", "oldInnerClassCounter", ";", "}", "protected", "void", "innerInterfaceDef", "(", "AST", "classDef", ")", "{", "List", "<", "AnnotationNode", ">", "annotations", "=", "new", "ArrayList", "<", "AnnotationNode", ">", "(", ")", ";", "AST", "node", "=", "classDef", ".", "getFirstChild", "(", ")", ";", "int", "modifiers", "=", "Opcodes", ".", "ACC_PUBLIC", ";", "if", "(", "isType", "(", "MODIFIERS", ",", "node", ")", ")", "{", "modifiers", "=", "modifiers", "(", "node", ",", "annotations", ",", "modifiers", ")", ";", "checkNoInvalidModifier", "(", "classDef", ",", "\"Interface\"", ",", "modifiers", ",", "Opcodes", ".", "ACC_SYNCHRONIZED", ",", "\"synchronized\"", ")", ";", "node", "=", "node", ".", "getNextSibling", "(", ")", ";", "}", "modifiers", "|=", "Opcodes", ".", "ACC_ABSTRACT", "|", "Opcodes", ".", "ACC_INTERFACE", ";", "String", "name", "=", "identifier", "(", "node", ")", ";", "GroovySourceAST", "groovySourceAST", "=", "(", "GroovySourceAST", ")", "node", ";", "int", "nameStart", "=", "locations", ".", "findOffset", "(", "groovySourceAST", ".", "getLine", "(", ")", ",", "groovySourceAST", ".", "getColumn", "(", ")", ")", ";", "int", "nameEnd", "=", "locations", ".", "findOffset", "(", "groovySourceAST", ".", "getLineLast", "(", ")", ",", "groovySourceAST", ".", "getColumnLast", "(", ")", ")", "-", "1", ";", "node", "=", "node", ".", "getNextSibling", "(", ")", ";", "ClassNode", "superClass", "=", "ClassHelper", ".", "OBJECT_TYPE", ";", "GenericsType", "[", "]", "genericsType", "=", "null", ";", "if", "(", "isType", "(", "TYPE_PARAMETERS", ",", "node", ")", ")", "{", "genericsType", "=", "makeGenericsType", "(", "node", ")", ";", "node", "=", "node", ".", "getNextSibling", "(", ")", ";", "}", "ClassNode", "[", "]", "interfaces", "=", "ClassNode", ".", "EMPTY_ARRAY", ";", "if", "(", "isType", "(", "EXTENDS_CLAUSE", ",", "node", ")", ")", "{", "interfaces", "=", "interfaces", "(", "node", ")", ";", "node", "=", "node", ".", "getNextSibling", "(", ")", ";", "}", "ClassNode", "outerClass", "=", "classNode", ";", "boolean", "syntheticPublic", "=", "(", "(", "modifiers", "&", "Opcodes", ".", "ACC_SYNTHETIC", ")", "!=", "0", ")", ";", "modifiers", "&=", "~", "Opcodes", ".", "ACC_SYNTHETIC", ";", "if", "(", "classNode", "!=", "null", ")", "{", "name", "=", "classNode", ".", "getNameWithoutPackage", "(", ")", "+", "\"$\"", "+", "name", ";", "String", "fullName", "=", "dot", "(", "classNode", ".", "getPackageName", "(", ")", ",", "name", ")", ";", "classNode", "=", "new", "InnerClassNode", "(", "classNode", ",", "fullName", ",", "modifiers", ",", "superClass", ",", "interfaces", ",", "null", ")", ";", "}", "else", "{", "classNode", "=", "new", "ClassNode", "(", "dot", "(", "getPackageName", "(", ")", ",", "name", ")", ",", "modifiers", ",", "superClass", ",", "interfaces", ",", "null", ")", ";", "}", "classNode", ".", "setSyntheticPublic", "(", "syntheticPublic", ")", ";", "classNode", ".", "addAnnotations", "(", "annotations", ")", ";", "classNode", ".", "setGenericsTypes", "(", "genericsType", ")", ";", "configureAST", "(", "classNode", ",", "classDef", ")", ";", "classNode", ".", "setNameStart", "(", "nameStart", ")", ";", "classNode", ".", "setNameEnd", "(", "nameEnd", ")", ";", "int", "oldClassCount", "=", "innerClassCounter", ";", "assertNodeType", "(", "OBJBLOCK", ",", "node", ")", ";", "objectBlock", "(", "node", ")", ";", "output", ".", "addClass", "(", "classNode", ")", ";", "classNode", "=", "outerClass", ";", "innerClassCounter", "=", "oldClassCount", ";", "}", "protected", "void", "classDef", "(", "AST", "classDef", ")", "{", "int", "oldInnerClassCounter", "=", "innerClassCounter", ";", "innerClassDef", "(", "classDef", ")", ";", "classNode", "=", "null", ";", "innerClassCounter", "=", "oldInnerClassCounter", ";", "}", "private", "ClassNode", "getClassOrScript", "(", "ClassNode", "node", ")", "{", "if", "(", "node", "!=", "null", ")", "return", "node", ";", "return", "output", ".", "getScriptClassDummy", "(", ")", ";", "}", "protected", "Expression", "anonymousInnerClassDef", "(", "AST", "node", ")", "{", "ClassNode", "oldNode", "=", "classNode", ";", "ClassNode", "outerClass", "=", "getClassOrScript", "(", "oldNode", ")", ";", "String", "fullName", "=", "outerClass", ".", "getName", "(", ")", "+", "'$'", "+", "innerClassCounter", ";", "innerClassCounter", "++", ";", "if", "(", "enumConstantBeingDef", ")", "{", "classNode", "=", "new", "EnumConstantClassNode", "(", "outerClass", ",", "fullName", ",", "Opcodes", ".", "ACC_PUBLIC", ",", "ClassHelper", ".", "OBJECT_TYPE", ")", ";", "}", "else", "{", "classNode", "=", "new", "InnerClassNode", "(", "outerClass", ",", "fullName", ",", "Opcodes", ".", "ACC_PUBLIC", ",", "ClassHelper", ".", "OBJECT_TYPE", ")", ";", "}", "(", "(", "InnerClassNode", ")", "classNode", ")", ".", "setAnonymous", "(", "true", ")", ";", "assertNodeType", "(", "OBJBLOCK", ",", "node", ")", ";", "objectBlock", "(", "node", ")", ";", "output", ".", "addClass", "(", "classNode", ")", ";", "AnonymousInnerClassCarrier", "ret", "=", "new", "AnonymousInnerClassCarrier", "(", ")", ";", "ret", ".", "innerClass", "=", "classNode", ";", "configureAST", "(", "classNode", ",", "node", ")", ";", "classNode", "=", "oldNode", ";", "return", "ret", ";", "}", "protected", "void", "innerClassDef", "(", "AST", "classDef", ")", "{", "List", "<", "AnnotationNode", ">", "annotations", "=", "new", "ArrayList", "<", "AnnotationNode", ">", "(", ")", ";", "AST", "node", "=", "classDef", ".", "getFirstChild", "(", ")", ";", "int", "modifiers", "=", "Opcodes", ".", "ACC_PUBLIC", ";", "if", "(", "isType", "(", "MODIFIERS", ",", "node", ")", ")", "{", "modifiers", "=", "modifiers", "(", "node", ",", "annotations", ",", "modifiers", ")", ";", "checkNoInvalidModifier", "(", "classDef", ",", "\"Class\"", ",", "modifiers", ",", "Opcodes", ".", "ACC_SYNCHRONIZED", ",", "\"synchronized\"", ")", ";", "node", "=", "node", ".", "getNextSibling", "(", ")", ";", "}", "String", "name", "=", "identifier", "(", "node", ")", ";", "GroovySourceAST", "groovySourceAST", "=", "(", "GroovySourceAST", ")", "node", ";", "int", "nameStart", "=", "locations", ".", "findOffset", "(", "groovySourceAST", ".", "getLine", "(", ")", ",", "groovySourceAST", ".", "getColumn", "(", ")", ")", ";", "int", "nameEnd", "=", "nameStart", "+", "name", ".", "length", "(", ")", "-", "1", ";", "node", "=", "node", ".", "getNextSibling", "(", ")", ";", "GenericsType", "[", "]", "genericsType", "=", "null", ";", "if", "(", "isType", "(", "TYPE_PARAMETERS", ",", "node", ")", ")", "{", "genericsType", "=", "makeGenericsType", "(", "node", ")", ";", "node", "=", "node", ".", "getNextSibling", "(", ")", ";", "}", "ClassNode", "superClass", "=", "null", ";", "if", "(", "isType", "(", "EXTENDS_CLAUSE", ",", "node", ")", ")", "{", "superClass", "=", "makeTypeWithArguments", "(", "node", ")", ";", "node", "=", "node", ".", "getNextSibling", "(", ")", ";", "}", "ClassNode", "[", "]", "interfaces", "=", "ClassNode", ".", "EMPTY_ARRAY", ";", "if", "(", "isType", "(", "IMPLEMENTS_CLAUSE", ",", "node", ")", ")", "{", "interfaces", "=", "interfaces", "(", "node", ")", ";", "node", "=", "node", ".", "getNextSibling", "(", ")", ";", "}", "MixinNode", "[", "]", "mixins", "=", "{", "}", ";", "ClassNode", "outerClass", "=", "classNode", ";", "boolean", "syntheticPublic", "=", "(", "(", "modifiers", "&", "Opcodes", ".", "ACC_SYNTHETIC", ")", "!=", "0", ")", ";", "modifiers", "&=", "~", "Opcodes", ".", "ACC_SYNTHETIC", ";", "if", "(", "classNode", "!=", "null", ")", "{", "name", "=", "classNode", ".", "getNameWithoutPackage", "(", ")", "+", "\"$\"", "+", "name", ";", "String", "fullName", "=", "dot", "(", "classNode", ".", "getPackageName", "(", ")", ",", "name", ")", ";", "classNode", "=", "new", "InnerClassNode", "(", "classNode", ",", "fullName", ",", "modifiers", ",", "superClass", ",", "interfaces", ",", "mixins", ")", ";", "}", "else", "{", "classNode", "=", "new", "ClassNode", "(", "dot", "(", "getPackageName", "(", ")", ",", "name", ")", ",", "modifiers", ",", "superClass", ",", "interfaces", ",", "mixins", ")", ";", "}", "classNode", ".", "addAnnotations", "(", "annotations", ")", ";", "classNode", ".", "setGenericsTypes", "(", "genericsType", ")", ";", "classNode", ".", "setSyntheticPublic", "(", "syntheticPublic", ")", ";", "configureAST", "(", "classNode", ",", "classDef", ")", ";", "classNode", ".", "setNameStart", "(", "nameStart", ")", ";", "classNode", ".", "setNameEnd", "(", "nameEnd", ")", ";", "output", ".", "addClass", "(", "classNode", ")", ";", "int", "oldClassCount", "=", "innerClassCounter", ";", "if", "(", "node", "!=", "null", ")", "{", "assertNodeType", "(", "OBJBLOCK", ",", "node", ")", ";", "objectBlock", "(", "node", ")", ";", "}", "classNode", "=", "outerClass", ";", "innerClassCounter", "=", "oldClassCount", ";", "}", "protected", "void", "objectBlock", "(", "AST", "objectBlock", ")", "{", "for", "(", "AST", "node", "=", "objectBlock", ".", "getFirstChild", "(", ")", ";", "node", "!=", "null", ";", "node", "=", "node", ".", "getNextSibling", "(", ")", ")", "{", "int", "type", "=", "node", ".", "getType", "(", ")", ";", "switch", "(", "type", ")", "{", "case", "OBJBLOCK", ":", "objectBlock", "(", "node", ")", ";", "break", ";", "case", "ANNOTATION_FIELD_DEF", ":", "case", "METHOD_DEF", ":", "methodDef", "(", "node", ")", ";", "break", ";", "case", "CTOR_IDENT", ":", "constructorDef", "(", "node", ")", ";", "break", ";", "case", "VARIABLE_DEF", ":", "fieldDef", "(", "node", ")", ";", "break", ";", "case", "STATIC_INIT", ":", "staticInit", "(", "node", ")", ";", "break", ";", "case", "INSTANCE_INIT", ":", "objectInit", "(", "node", ")", ";", "break", ";", "case", "ENUM_DEF", ":", "enumDef", "(", "node", ")", ";", "break", ";", "case", "ENUM_CONSTANT_DEF", ":", "enumConstantDef", "(", "node", ")", ";", "break", ";", "case", "CLASS_DEF", ":", "innerClassDef", "(", "node", ")", ";", "break", ";", "case", "INTERFACE_DEF", ":", "innerInterfaceDef", "(", "node", ")", ";", "break", ";", "default", ":", "unknownAST", "(", "node", ")", ";", "}", "}", "}", "protected", "void", "enumDef", "(", "AST", "enumNode", ")", "{", "assertNodeType", "(", "ENUM_DEF", ",", "enumNode", ")", ";", "List", "<", "AnnotationNode", ">", "annotations", "=", "new", "ArrayList", "<", "AnnotationNode", ">", "(", ")", ";", "AST", "node", "=", "enumNode", ".", "getFirstChild", "(", ")", ";", "int", "modifiers", "=", "Opcodes", ".", "ACC_PUBLIC", ";", "if", "(", "isType", "(", "MODIFIERS", ",", "node", ")", ")", "{", "modifiers", "=", "modifiers", "(", "node", ",", "annotations", ",", "modifiers", ")", ";", "node", "=", "node", ".", "getNextSibling", "(", ")", ";", "}", "GroovySourceAST", "groovySourceAST", "=", "(", "GroovySourceAST", ")", "node", ";", "int", "nameStart", "=", "locations", ".", "findOffset", "(", "groovySourceAST", ".", "getLine", "(", ")", ",", "groovySourceAST", ".", "getColumn", "(", ")", ")", ";", "int", "nameEnd", "=", "locations", ".", "findOffset", "(", "groovySourceAST", ".", "getLineLast", "(", ")", ",", "groovySourceAST", ".", "getColumnLast", "(", ")", ")", "-", "1", ";", "String", "name", "=", "identifier", "(", "node", ")", ";", "node", "=", "node", ".", "getNextSibling", "(", ")", ";", "ClassNode", "[", "]", "interfaces", "=", "interfaces", "(", "node", ")", ";", "node", "=", "node", ".", "getNextSibling", "(", ")", ";", "boolean", "syntheticPublic", "=", "(", "(", "modifiers", "&", "Opcodes", ".", "ACC_SYNTHETIC", ")", "!=", "0", ")", ";", "modifiers", "&=", "~", "Opcodes", ".", "ACC_SYNTHETIC", ";", "String", "enumName", "=", "(", "classNode", "!=", "null", "?", "name", ":", "dot", "(", "getPackageName", "(", ")", ",", "name", ")", ")", ";", "ClassNode", "enumClass", "=", "EnumHelper", ".", "makeEnumNode", "(", "enumName", ",", "modifiers", ",", "interfaces", ",", "classNode", ")", ";", "enumClass", ".", "setSyntheticPublic", "(", "syntheticPublic", ")", ";", "ClassNode", "oldNode", "=", "classNode", ";", "enumClass", ".", "addAnnotations", "(", "annotations", ")", ";", "classNode", "=", "enumClass", ";", "assertNodeType", "(", "OBJBLOCK", ",", "node", ")", ";", "objectBlock", "(", "node", ")", ";", "classNode", ".", "setNameStart", "(", "nameStart", ")", ";", "classNode", ".", "setNameEnd", "(", "nameEnd", ")", ";", "configureAST", "(", "classNode", ",", "enumNode", ")", ";", "classNode", "=", "oldNode", ";", "output", ".", "addClass", "(", "enumClass", ")", ";", "}", "protected", "void", "enumConstantDef", "(", "AST", "node", ")", "{", "enumConstantBeingDef", "=", "true", ";", "assertNodeType", "(", "ENUM_CONSTANT_DEF", ",", "node", ")", ";", "AST", "element", "=", "node", ".", "getFirstChild", "(", ")", ";", "if", "(", "isType", "(", "ANNOTATIONS", ",", "element", ")", ")", "{", "element", "=", "element", ".", "getNextSibling", "(", ")", ";", "}", "String", "identifier", "=", "identifier", "(", "element", ")", ";", "Expression", "init", "=", "null", ";", "element", "=", "element", ".", "getNextSibling", "(", ")", ";", "if", "(", "element", "!=", "null", ")", "{", "init", "=", "expression", "(", "element", ")", ";", "ClassNode", "innerClass", "=", "getAnonymousInnerClassNode", "(", "init", ")", ";", "if", "(", "innerClass", "!=", "null", ")", "{", "innerClass", ".", "setSuperClass", "(", "classNode", ".", "getPlainNodeReference", "(", ")", ")", ";", "innerClass", ".", "setModifiers", "(", "classNode", ".", "getModifiers", "(", ")", "|", "Opcodes", ".", "ACC_FINAL", ")", ";", "init", "=", "new", "ClassExpression", "(", "innerClass", ")", ";", "classNode", ".", "setModifiers", "(", "classNode", ".", "getModifiers", "(", ")", "&", "~", "Opcodes", ".", "ACC_FINAL", ")", ";", "}", "else", "if", "(", "isType", "(", "ELIST", ",", "element", ")", ")", "{", "if", "(", "init", "instanceof", "ListExpression", "&&", "!", "(", "(", "ListExpression", ")", "init", ")", ".", "isWrapped", "(", ")", ")", "{", "ListExpression", "le", "=", "new", "ListExpression", "(", ")", ";", "le", ".", "addExpression", "(", "init", ")", ";", "init", "=", "le", ";", "}", "}", "}", "GroovySourceAST", "groovySourceAST", "=", "(", "GroovySourceAST", ")", "node", ";", "int", "nameStart", "=", "locations", ".", "findOffset", "(", "groovySourceAST", ".", "getLine", "(", ")", ",", "groovySourceAST", ".", "getColumn", "(", ")", ")", ";", "int", "nameEnd", "=", "nameStart", "+", "identifier", ".", "length", "(", ")", "-", "1", ";", "ClassNode", "fakeNodeToRepresentTheNonDeclaredTypeOfEnumValue", "=", "ClassHelper", ".", "make", "(", "classNode", ".", "getName", "(", ")", ")", ";", "fakeNodeToRepresentTheNonDeclaredTypeOfEnumValue", ".", "setRedirect", "(", "classNode", ")", ";", "FieldNode", "fn", "=", "EnumHelper", ".", "addEnumConstant", "(", "fakeNodeToRepresentTheNonDeclaredTypeOfEnumValue", ",", "classNode", ",", "identifier", ",", "init", ")", ";", "configureAST", "(", "fn", ",", "node", ")", ";", "fn", ".", "setNameStart", "(", "nameStart", ")", ";", "fn", ".", "setNameEnd", "(", "nameEnd", ")", ";", "fn", ".", "setStart", "(", "nameStart", ")", ";", "fn", ".", "setEnd", "(", "nameEnd", ")", ";", "enumConstantBeingDef", "=", "false", ";", "}", "protected", "void", "throwsList", "(", "AST", "node", ",", "List", "<", "ClassNode", ">", "list", ")", "{", "String", "name", ";", "if", "(", "isType", "(", "DOT", ",", "node", ")", ")", "{", "name", "=", "qualifiedName", "(", "node", ")", ";", "}", "else", "{", "name", "=", "identifier", "(", "node", ")", ";", "}", "ClassNode", "exception", "=", "ClassHelper", ".", "make", "(", "name", ")", ";", "configureAST", "(", "exception", ",", "node", ")", ";", "list", ".", "add", "(", "exception", ")", ";", "AST", "next", "=", "node", ".", "getNextSibling", "(", ")", ";", "if", "(", "next", "!=", "null", ")", "throwsList", "(", "next", ",", "list", ")", ";", "}", "protected", "void", "methodDef", "(", "AST", "methodDef", ")", "{", "List", "<", "AnnotationNode", ">", "annotations", "=", "new", "ArrayList", "<", "AnnotationNode", ">", "(", ")", ";", "AST", "node", "=", "methodDef", ".", "getFirstChild", "(", ")", ";", "GenericsType", "[", "]", "generics", "=", "null", ";", "if", "(", "isType", "(", "TYPE_PARAMETERS", ",", "node", ")", ")", "{", "generics", "=", "makeGenericsType", "(", "node", ")", ";", "node", "=", "node", ".", "getNextSibling", "(", ")", ";", "}", "int", "modifiers", "=", "Opcodes", ".", "ACC_PUBLIC", ";", "if", "(", "isType", "(", "MODIFIERS", ",", "node", ")", ")", "{", "modifiers", "=", "modifiers", "(", "node", ",", "annotations", ",", "modifiers", ")", ";", "checkNoInvalidModifier", "(", "methodDef", ",", "\"Method\"", ",", "modifiers", ",", "Opcodes", ".", "ACC_VOLATILE", ",", "\"volatile\"", ")", ";", "node", "=", "node", ".", "getNextSibling", "(", ")", ";", "}", "if", "(", "isAnInterface", "(", ")", ")", "{", "modifiers", "|=", "Opcodes", ".", "ACC_ABSTRACT", ";", "}", "ClassNode", "returnType", "=", "null", ";", "if", "(", "isType", "(", "TYPE", ",", "node", ")", ")", "{", "returnType", "=", "makeTypeWithArguments", "(", "node", ")", ";", "node", "=", "node", ".", "getNextSibling", "(", ")", ";", "}", "String", "name", "=", "identifier", "(", "node", ")", ";", "if", "(", "classNode", "!=", "null", "&&", "!", "classNode", ".", "isAnnotationDefinition", "(", ")", ")", "{", "if", "(", "classNode", ".", "getNameWithoutPackage", "(", ")", ".", "equals", "(", "name", ")", ")", "{", "if", "(", "isAnInterface", "(", ")", ")", "{", "throw", "new", "ASTRuntimeException", "(", "methodDef", ",", "\"\"", ")", ";", "}", "throw", "new", "ASTRuntimeException", "(", "methodDef", ",", "\"\"", "+", "returnType", ".", "getName", "(", ")", "+", "\"\"", ")", ";", "}", "}", "GroovySourceAST", "groovySourceAST", "=", "(", "GroovySourceAST", ")", "node", ";", "int", "nameStart", "=", "locations", ".", "findOffset", "(", "groovySourceAST", ".", "getLine", "(", ")", ",", "groovySourceAST", ".", "getColumn", "(", ")", ")", ";", "int", "nameEnd", "=", "locations", ".", "findOffset", "(", "groovySourceAST", ".", "getLine", "(", ")", ",", "groovySourceAST", ".", "getColumnLast", "(", ")", ")", "-", "1", ";", "node", "=", "node", ".", "getNextSibling", "(", ")", ";", "Parameter", "[", "]", "parameters", "=", "Parameter", ".", "EMPTY_ARRAY", ";", "ClassNode", "[", "]", "exceptions", "=", "ClassNode", ".", "EMPTY_ARRAY", ";", "if", "(", "classNode", "==", "null", "||", "!", "classNode", ".", "isAnnotationDefinition", "(", ")", ")", "{", "assertNodeType", "(", "PARAMETERS", ",", "node", ")", ";", "parameters", "=", "parameters", "(", "node", ")", ";", "if", "(", "parameters", "==", "null", ")", "parameters", "=", "Parameter", ".", "EMPTY_ARRAY", ";", "node", "=", "node", ".", "getNextSibling", "(", ")", ";", "if", "(", "isType", "(", "LITERAL_throws", ",", "node", ")", ")", "{", "AST", "throwsNode", "=", "node", ".", "getFirstChild", "(", ")", ";", "List", "<", "ClassNode", ">", "exceptionList", "=", "new", "ArrayList", "<", "ClassNode", ">", "(", ")", ";", "throwsList", "(", "throwsNode", ",", "exceptionList", ")", ";", "exceptions", "=", "exceptionList", ".", "toArray", "(", "exceptions", ")", ";", "node", "=", "node", ".", "getNextSibling", "(", ")", ";", "}", "}", "boolean", "hasAnnotationDefault", "=", "false", ";", "Statement", "code", "=", "null", ";", "if", "(", "(", "modifiers", "&", "Opcodes", ".", "ACC_ABSTRACT", ")", "==", "0", ")", "{", "if", "(", "node", "==", "null", ")", "{", "SyntaxException", "se", "=", "new", "SyntaxException", "(", "\"\"", ",", "methodDef", ".", "getLine", "(", ")", ",", "methodDef", ".", "getColumn", "(", ")", ")", ";", "getController", "(", ")", ".", "addError", "(", "se", ")", ";", "code", "=", "statementListNoChild", "(", "null", ",", "methodDef", ")", ";", "}", "else", "{", "assertNodeType", "(", "SLIST", ",", "node", ")", ";", "code", "=", "statementList", "(", "node", ")", ";", "}", "}", "else", "if", "(", "node", "!=", "null", "&&", "classNode", ".", "isAnnotationDefinition", "(", ")", ")", "{", "code", "=", "statement", "(", "node", ")", ";", "hasAnnotationDefault", "=", "true", ";", "}", "else", "if", "(", "(", "modifiers", "&", "Opcodes", ".", "ACC_ABSTRACT", ")", ">", "0", ")", "{", "if", "(", "node", "!=", "null", ")", "{", "throw", "new", "ASTRuntimeException", "(", "methodDef", ",", "\"\"", ")", ";", "}", "}", "boolean", "syntheticPublic", "=", "(", "(", "modifiers", "&", "Opcodes", ".", "ACC_SYNTHETIC", ")", "!=", "0", ")", ";", "modifiers", "&=", "~", "Opcodes", ".", "ACC_SYNTHETIC", ";", "MethodNode", "methodNode", "=", "new", "MethodNode", "(", "name", ",", "modifiers", ",", "returnType", ",", "parameters", ",", "exceptions", ",", "code", ")", ";", "methodNode", ".", "addAnnotations", "(", "annotations", ")", ";", "methodNode", ".", "setGenericsTypes", "(", "generics", ")", ";", "methodNode", ".", "setAnnotationDefault", "(", "hasAnnotationDefault", ")", ";", "methodNode", ".", "setSyntheticPublic", "(", "syntheticPublic", ")", ";", "configureAST", "(", "methodNode", ",", "methodDef", ")", ";", "methodNode", ".", "setNameStart", "(", "nameStart", ")", ";", "methodNode", ".", "setNameEnd", "(", "nameEnd", ")", ";", "if", "(", "classNode", "!=", "null", ")", "{", "classNode", ".", "addMethod", "(", "methodNode", ")", ";", "}", "else", "{", "output", ".", "addMethod", "(", "methodNode", ")", ";", "}", "}", "private", "void", "checkNoInvalidModifier", "(", "AST", "node", ",", "String", "nodeType", ",", "int", "modifiers", ",", "int", "modifier", ",", "String", "modifierText", ")", "{", "if", "(", "(", "modifiers", "&", "modifier", ")", "!=", "0", ")", "{", "throw", "new", "ASTRuntimeException", "(", "node", ",", "nodeType", "+", "\"\"", "+", "modifierText", "+", "\"'.\"", ")", ";", "}", "}", "private", "boolean", "isAnInterface", "(", ")", "{", "return", "classNode", "!=", "null", "&&", "(", "classNode", ".", "getModifiers", "(", ")", "&", "Opcodes", ".", "ACC_INTERFACE", ")", ">", "0", ";", "}", "protected", "void", "staticInit", "(", "AST", "staticInit", ")", "{", "BlockStatement", "code", "=", "(", "BlockStatement", ")", "statementList", "(", "staticInit", ")", ";", "classNode", ".", "addStaticInitializerStatements", "(", "code", ".", "getStatements", "(", ")", ",", "false", ")", ";", "}", "protected", "void", "objectInit", "(", "AST", "init", ")", "{", "BlockStatement", "code", "=", "(", "BlockStatement", ")", "statementList", "(", "init", ")", ";", "classNode", ".", "addObjectInitializerStatements", "(", "code", ")", ";", "}", "protected", "void", "constructorDef", "(", "AST", "constructorDef", ")", "{", "List", "<", "AnnotationNode", ">", "annotations", "=", "new", "ArrayList", "<", "AnnotationNode", ">", "(", ")", ";", "AST", "node", "=", "constructorDef", ".", "getFirstChild", "(", ")", ";", "int", "modifiers", "=", "Opcodes", ".", "ACC_PUBLIC", ";", "GroovySourceAST", "groovySourceAST", "=", "(", "GroovySourceAST", ")", "node", ";", "int", "nameStart", "=", "locations", ".", "findOffset", "(", "groovySourceAST", ".", "getLineLast", "(", ")", ",", "groovySourceAST", ".", "getColumnLast", "(", ")", ")", ";", "if", "(", "isType", "(", "MODIFIERS", ",", "node", ")", ")", "{", "modifiers", "=", "modifiers", "(", "node", ",", "annotations", ",", "modifiers", ")", ";", "checkNoInvalidModifier", "(", "constructorDef", ",", "\"Constructor\"", ",", "modifiers", ",", "Opcodes", ".", "ACC_STATIC", ",", "\"static\"", ")", ";", "checkNoInvalidModifier", "(", "constructorDef", ",", "\"Constructor\"", ",", "modifiers", ",", "Opcodes", ".", "ACC_FINAL", ",", "\"final\"", ")", ";", "checkNoInvalidModifier", "(", "constructorDef", ",", "\"Constructor\"", ",", "modifiers", ",", "Opcodes", ".", "ACC_ABSTRACT", ",", "\"abstract\"", ")", ";", "checkNoInvalidModifier", "(", "constructorDef", ",", "\"Constructor\"", ",", "modifiers", ",", "Opcodes", ".", "ACC_NATIVE", ",", "\"native\"", ")", ";", "node", "=", "node", ".", "getNextSibling", "(", ")", ";", "}", "assertNodeType", "(", "PARAMETERS", ",", "node", ")", ";", "Parameter", "[", "]", "parameters", "=", "parameters", "(", "node", ")", ";", "if", "(", "parameters", "==", "null", ")", "parameters", "=", "Parameter", ".", "EMPTY_ARRAY", ";", "int", "nameEnd", "=", "locations", ".", "findOffset", "(", "node", ".", "getLine", "(", ")", ",", "node", ".", "getColumn", "(", ")", ")", "-", "2", ";", "node", "=", "node", ".", "getNextSibling", "(", ")", ";", "ClassNode", "[", "]", "exceptions", "=", "ClassNode", ".", "EMPTY_ARRAY", ";", "if", "(", "isType", "(", "LITERAL_throws", ",", "node", ")", ")", "{", "AST", "throwsNode", "=", "node", ".", "getFirstChild", "(", ")", ";", "List", "<", "ClassNode", ">", "exceptionList", "=", "new", "ArrayList", "<", "ClassNode", ">", "(", ")", ";", "throwsList", "(", "throwsNode", ",", "exceptionList", ")", ";", "exceptions", "=", "exceptionList", ".", "toArray", "(", "exceptions", ")", ";", "node", "=", "node", ".", "getNextSibling", "(", ")", ";", "}", "assertNodeType", "(", "SLIST", ",", "node", ")", ";", "Statement", "code", "=", "statementList", "(", "node", ")", ";", "boolean", "syntheticPublic", "=", "(", "(", "modifiers", "&", "Opcodes", ".", "ACC_SYNTHETIC", ")", "!=", "0", ")", ";", "modifiers", "&=", "~", "Opcodes", ".", "ACC_SYNTHETIC", ";", "ConstructorNode", "constructorNode", "=", "classNode", ".", "addConstructor", "(", "modifiers", ",", "parameters", ",", "exceptions", ",", "code", ")", ";", "constructorNode", ".", "setSyntheticPublic", "(", "syntheticPublic", ")", ";", "constructorNode", ".", "addAnnotations", "(", "annotations", ")", ";", "configureAST", "(", "constructorNode", ",", "constructorDef", ")", ";", "constructorNode", ".", "setNameStart", "(", "nameStart", ")", ";", "constructorNode", ".", "setNameEnd", "(", "nameEnd", ")", ";", "}", "protected", "void", "fieldDef", "(", "AST", "fieldDef", ")", "{", "List", "<", "AnnotationNode", ">", "annotations", "=", "new", "ArrayList", "<", "AnnotationNode", ">", "(", ")", ";", "AST", "node", "=", "fieldDef", ".", "getFirstChild", "(", ")", ";", "int", "modifiers", "=", "0", ";", "if", "(", "isType", "(", "MODIFIERS", ",", "node", ")", ")", "{", "modifiers", "=", "modifiers", "(", "node", ",", "annotations", ",", "modifiers", ")", ";", "node", "=", "node", ".", "getNextSibling", "(", ")", ";", "}", "if", "(", "classNode", ".", "isInterface", "(", ")", ")", "{", "modifiers", "|=", "Opcodes", ".", "ACC_STATIC", "|", "Opcodes", ".", "ACC_FINAL", ";", "if", "(", "(", "modifiers", "&", "(", "Opcodes", ".", "ACC_PRIVATE", "|", "Opcodes", ".", "ACC_PROTECTED", ")", ")", "==", "0", ")", "{", "modifiers", "|=", "Opcodes", ".", "ACC_PUBLIC", ";", "}", "}", "ClassNode", "type", "=", "null", ";", "if", "(", "isType", "(", "TYPE", ",", "node", ")", ")", "{", "type", "=", "makeTypeWithArguments", "(", "node", ")", ";", "node", "=", "node", ".", "getNextSibling", "(", ")", ";", "}", "String", "name", "=", "identifier", "(", "node", ")", ";", "GroovySourceAST", "groovySourceAST", "=", "(", "GroovySourceAST", ")", "node", ";", "int", "nameStart", "=", "locations", ".", "findOffset", "(", "groovySourceAST", ".", "getLine", "(", ")", ",", "groovySourceAST", ".", "getColumn", "(", ")", ")", ";", "int", "nameEnd", "=", "nameStart", "+", "name", ".", "length", "(", ")", "-", "1", ";", "node", "=", "node", ".", "getNextSibling", "(", ")", ";", "Expression", "initialValue", "=", "null", ";", "if", "(", "node", "!=", "null", ")", "{", "assertNodeType", "(", "ASSIGN", ",", "node", ")", ";", "initialValue", "=", "expression", "(", "node", ".", "getFirstChild", "(", ")", ")", ";", "}", "if", "(", "classNode", ".", "isInterface", "(", ")", "&&", "initialValue", "==", "null", "&&", "type", "!=", "null", ")", "{", "if", "(", "type", "==", "ClassHelper", ".", "int_TYPE", ")", "{", "initialValue", "=", "new", "ConstantExpression", "(", "0", ")", ";", "}", "else", "if", "(", "type", "==", "ClassHelper", ".", "long_TYPE", ")", "{", "initialValue", "=", "new", "ConstantExpression", "(", "0L", ")", ";", "}", "else", "if", "(", "type", "==", "ClassHelper", ".", "double_TYPE", ")", "{", "initialValue", "=", "new", "ConstantExpression", "(", "0.0", ")", ";", "}", "else", "if", "(", "type", "==", "ClassHelper", ".", "float_TYPE", ")", "{", "initialValue", "=", "new", "ConstantExpression", "(", "0.0F", ")", ";", "}", "else", "if", "(", "type", "==", "ClassHelper", ".", "boolean_TYPE", ")", "{", "initialValue", "=", "ConstantExpression", ".", "FALSE", ";", "}", "else", "if", "(", "type", "==", "ClassHelper", ".", "short_TYPE", ")", "{", "initialValue", "=", "new", "ConstantExpression", "(", "(", "short", ")", "0", ")", ";", "}", "else", "if", "(", "type", "==", "ClassHelper", ".", "byte_TYPE", ")", "{", "initialValue", "=", "new", "ConstantExpression", "(", "(", "byte", ")", "0", ")", ";", "}", "else", "if", "(", "type", "==", "ClassHelper", ".", "char_TYPE", ")", "{", "initialValue", "=", "new", "ConstantExpression", "(", "(", "char", ")", "0", ")", ";", "}", "}", "FieldNode", "fieldNode", "=", "new", "FieldNode", "(", "name", ",", "modifiers", ",", "type", ",", "classNode", ",", "initialValue", ")", ";", "fieldNode", ".", "addAnnotations", "(", "annotations", ")", ";", "configureAST", "(", "fieldNode", ",", "fieldDef", ")", ";", "fieldNode", ".", "setNameStart", "(", "nameStart", ")", ";", "fieldNode", ".", "setNameEnd", "(", "nameEnd", ")", ";", "if", "(", "!", "hasVisibility", "(", "modifiers", ")", ")", "{", "int", "fieldModifiers", "=", "0", ";", "int", "flags", "=", "Opcodes", ".", "ACC_STATIC", "|", "Opcodes", ".", "ACC_TRANSIENT", "|", "Opcodes", ".", "ACC_VOLATILE", "|", "Opcodes", ".", "ACC_FINAL", ";", "if", "(", "!", "hasVisibility", "(", "modifiers", ")", ")", "{", "modifiers", "|=", "Opcodes", ".", "ACC_PUBLIC", ";", "fieldModifiers", "|=", "Opcodes", ".", "ACC_PRIVATE", ";", "}", "fieldModifiers", "|=", "(", "modifiers", "&", "flags", ")", ";", "fieldNode", ".", "setModifiers", "(", "fieldModifiers", ")", ";", "fieldNode", ".", "setSynthetic", "(", "true", ")", ";", "FieldNode", "storedNode", "=", "classNode", ".", "getDeclaredField", "(", "fieldNode", ".", "getName", "(", ")", ")", ";", "if", "(", "storedNode", "!=", "null", "&&", "!", "classNode", ".", "hasProperty", "(", "name", ")", ")", "{", "fieldNode", "=", "storedNode", ";", "classNode", ".", "getFields", "(", ")", ".", "remove", "(", "storedNode", ")", ";", "}", "PropertyNode", "propertyNode", "=", "new", "PropertyNode", "(", "fieldNode", ",", "modifiers", ",", "null", ",", "null", ")", ";", "configureAST", "(", "propertyNode", ",", "fieldDef", ")", ";", "classNode", ".", "addProperty", "(", "propertyNode", ")", ";", "}", "else", "{", "fieldNode", ".", "setModifiers", "(", "modifiers", ")", ";", "PropertyNode", "pn", "=", "classNode", ".", "getProperty", "(", "name", ")", ";", "if", "(", "pn", "!=", "null", "&&", "pn", ".", "getField", "(", ")", ".", "isSynthetic", "(", ")", ")", "{", "classNode", ".", "getFields", "(", ")", ".", "remove", "(", "pn", ".", "getField", "(", ")", ")", ";", "pn", ".", "setField", "(", "fieldNode", ")", ";", "}", "classNode", ".", "addField", "(", "fieldNode", ")", ";", "}", "}", "protected", "ClassNode", "[", "]", "interfaces", "(", "AST", "node", ")", "{", "List", "<", "ClassNode", ">", "interfaceList", "=", "new", "ArrayList", "<", "ClassNode", ">", "(", ")", ";", "for", "(", "AST", "implementNode", "=", "node", ".", "getFirstChild", "(", ")", ";", "implementNode", "!=", "null", ";", "implementNode", "=", "implementNode", ".", "getNextSibling", "(", ")", ")", "{", "ClassNode", "cn", "=", "makeTypeWithArguments", "(", "implementNode", ")", ";", "configureAST", "(", "cn", ",", "implementNode", ")", ";", "interfaceList", ".", "add", "(", "cn", ")", ";", "}", "ClassNode", "[", "]", "interfaces", "=", "ClassNode", ".", "EMPTY_ARRAY", ";", "if", "(", "!", "interfaceList", ".", "isEmpty", "(", ")", ")", "{", "interfaces", "=", "new", "ClassNode", "[", "interfaceList", ".", "size", "(", ")", "]", ";", "interfaceList", ".", "toArray", "(", "interfaces", ")", ";", "}", "return", "interfaces", ";", "}", "protected", "Parameter", "[", "]", "parameters", "(", "AST", "parametersNode", ")", "{", "AST", "node", "=", "parametersNode", ".", "getFirstChild", "(", ")", ";", "firstParam", "=", "false", ";", "firstParamIsVarArg", "=", "false", ";", "if", "(", "node", "==", "null", ")", "{", "if", "(", "isType", "(", "IMPLICIT_PARAMETERS", ",", "parametersNode", ")", ")", "return", "Parameter", ".", "EMPTY_ARRAY", ";", "return", "null", ";", "}", "else", "{", "List", "<", "Parameter", ">", "parameters", "=", "new", "ArrayList", "<", "Parameter", ">", "(", ")", ";", "AST", "firstParameterNode", "=", "null", ";", "do", "{", "firstParam", "=", "(", "firstParameterNode", "==", "null", ")", ";", "if", "(", "firstParameterNode", "==", "null", ")", "firstParameterNode", "=", "node", ";", "parameters", ".", "add", "(", "parameter", "(", "node", ")", ")", ";", "node", "=", "node", ".", "getNextSibling", "(", ")", ";", "}", "while", "(", "node", "!=", "null", ")", ";", "verifyParameters", "(", "parameters", ",", "firstParameterNode", ")", ";", "Parameter", "[", "]", "answer", "=", "new", "Parameter", "[", "parameters", ".", "size", "(", ")", "]", ";", "parameters", ".", "toArray", "(", "answer", ")", ";", "return", "answer", ";", "}", "}", "private", "void", "verifyParameters", "(", "List", "<", "Parameter", ">", "parameters", ",", "AST", "firstParameterNode", ")", "{", "if", "(", "parameters", ".", "size", "(", ")", "<=", "1", ")", "return", ";", "Parameter", "first", "=", "parameters", ".", "get", "(", "0", ")", ";", "if", "(", "firstParamIsVarArg", ")", "{", "throw", "new", "ASTRuntimeException", "(", "firstParameterNode", ",", "\"\"", "+", "first", ".", "getName", "(", ")", "+", "\"\"", ")", ";", "}", "}", "protected", "Parameter", "parameter", "(", "AST", "paramNode", ")", "{", "List", "<", "AnnotationNode", ">", "annotations", "=", "new", "ArrayList", "<", "AnnotationNode", ">", "(", ")", ";", "boolean", "variableParameterDef", "=", "isType", "(", "VARIABLE_PARAMETER_DEF", ",", "paramNode", ")", ";", "AST", "node", "=", "paramNode", ".", "getFirstChild", "(", ")", ";", "int", "modifiers", "=", "0", ";", "if", "(", "isType", "(", "MODIFIERS", ",", "node", ")", ")", "{", "modifiers", "=", "modifiers", "(", "node", ",", "annotations", ",", "modifiers", ")", ";", "node", "=", "node", ".", "getNextSibling", "(", ")", ";", "}", "ClassNode", "type", "=", "ClassHelper", ".", "DYNAMIC_TYPE", ";", "if", "(", "isType", "(", "TYPE", ",", "node", ")", ")", "{", "type", "=", "makeTypeWithArguments", "(", "node", ")", ";", "if", "(", "variableParameterDef", ")", "type", "=", "type", ".", "makeArray", "(", ")", ";", "node", "=", "node", ".", "getNextSibling", "(", ")", ";", "}", "String", "name", "=", "identifier", "(", "node", ")", ";", "GroovySourceAST", "groovySourceAST", "=", "(", "GroovySourceAST", ")", "node", ";", "int", "nameStart", "=", "locations", ".", "findOffset", "(", "groovySourceAST", ".", "getLine", "(", ")", ",", "groovySourceAST", ".", "getColumn", "(", ")", ")", ";", "int", "nameEnd", "=", "nameStart", "+", "name", ".", "length", "(", ")", ";", "node", "=", "node", ".", "getNextSibling", "(", ")", ";", "VariableExpression", "leftExpression", "=", "new", "VariableExpression", "(", "name", ",", "type", ")", ";", "leftExpression", ".", "setModifiers", "(", "modifiers", ")", ";", "configureAST", "(", "leftExpression", ",", "paramNode", ")", ";", "Parameter", "parameter", "=", "null", ";", "if", "(", "node", "!=", "null", ")", "{", "assertNodeType", "(", "ASSIGN", ",", "node", ")", ";", "Expression", "rightExpression", "=", "expression", "(", "node", ".", "getFirstChild", "(", ")", ")", ";", "if", "(", "isAnInterface", "(", ")", ")", "{", "throw", "new", "ASTRuntimeException", "(", "node", ",", "\"\"", "+", "name", "+", "\"", "=", "\"", "+", "rightExpression", ".", "getText", "(", ")", "+", "\"\"", ")", ";", "}", "parameter", "=", "new", "Parameter", "(", "type", ",", "name", ",", "rightExpression", ")", ";", "}", "else", "parameter", "=", "new", "Parameter", "(", "type", ",", "name", ")", ";", "if", "(", "firstParam", ")", "firstParamIsVarArg", "=", "variableParameterDef", ";", "configureAST", "(", "parameter", ",", "paramNode", ")", ";", "parameter", ".", "setNameStart", "(", "nameStart", ")", ";", "parameter", ".", "setNameEnd", "(", "nameEnd", ")", ";", "parameter", ".", "addAnnotations", "(", "annotations", ")", ";", "parameter", ".", "setModifiers", "(", "modifiers", ")", ";", "return", "parameter", ";", "}", "protected", "int", "modifiers", "(", "AST", "modifierNode", ",", "List", "<", "AnnotationNode", ">", "annotations", ",", "int", "defaultModifiers", ")", "{", "assertNodeType", "(", "MODIFIERS", ",", "modifierNode", ")", ";", "boolean", "access", "=", "false", ";", "int", "answer", "=", "0", ";", "for", "(", "AST", "node", "=", "modifierNode", ".", "getFirstChild", "(", ")", ";", "node", "!=", "null", ";", "node", "=", "node", ".", "getNextSibling", "(", ")", ")", "{", "int", "type", "=", "node", ".", "getType", "(", ")", ";", "switch", "(", "type", ")", "{", "case", "STATIC_IMPORT", ":", "break", ";", "case", "ANNOTATION", ":", "annotations", ".", "add", "(", "annotation", "(", "node", ")", ")", ";", "break", ";", "case", "LITERAL_private", ":", "answer", "=", "setModifierBit", "(", "node", ",", "answer", ",", "Opcodes", ".", "ACC_PRIVATE", ")", ";", "access", "=", "setAccessTrue", "(", "node", ",", "access", ")", ";", "break", ";", "case", "LITERAL_protected", ":", "answer", "=", "setModifierBit", "(", "node", ",", "answer", ",", "Opcodes", ".", "ACC_PROTECTED", ")", ";", "access", "=", "setAccessTrue", "(", "node", ",", "access", ")", ";", "break", ";", "case", "LITERAL_public", ":", "answer", "=", "setModifierBit", "(", "node", ",", "answer", ",", "Opcodes", ".", "ACC_PUBLIC", ")", ";", "access", "=", "setAccessTrue", "(", "node", ",", "access", ")", ";", "break", ";", "case", "ABSTRACT", ":", "answer", "=", "setModifierBit", "(", "node", ",", "answer", ",", "Opcodes", ".", "ACC_ABSTRACT", ")", ";", "break", ";", "case", "FINAL", ":", "answer", "=", "setModifierBit", "(", "node", ",", "answer", ",", "Opcodes", ".", "ACC_FINAL", ")", ";", "break", ";", "case", "LITERAL_native", ":", "answer", "=", "setModifierBit", "(", "node", ",", "answer", ",", "Opcodes", ".", "ACC_NATIVE", ")", ";", "break", ";", "case", "LITERAL_static", ":", "answer", "=", "setModifierBit", "(", "node", ",", "answer", ",", "Opcodes", ".", "ACC_STATIC", ")", ";", "break", ";", "case", "STRICTFP", ":", "answer", "=", "setModifierBit", "(", "node", ",", "answer", ",", "Opcodes", ".", "ACC_STRICT", ")", ";", "break", ";", "case", "LITERAL_synchronized", ":", "answer", "=", "setModifierBit", "(", "node", ",", "answer", ",", "Opcodes", ".", "ACC_SYNCHRONIZED", ")", ";", "break", ";", "case", "LITERAL_transient", ":", "answer", "=", "setModifierBit", "(", "node", ",", "answer", ",", "Opcodes", ".", "ACC_TRANSIENT", ")", ";", "break", ";", "case", "LITERAL_volatile", ":", "answer", "=", "setModifierBit", "(", "node", ",", "answer", ",", "Opcodes", ".", "ACC_VOLATILE", ")", ";", "break", ";", "default", ":", "unknownAST", "(", "node", ")", ";", "}", "}", "if", "(", "!", "access", ")", "{", "answer", "|=", "defaultModifiers", ";", "if", "(", "defaultModifiers", "==", "Opcodes", ".", "ACC_PUBLIC", ")", "answer", "|=", "Opcodes", ".", "ACC_SYNTHETIC", ";", "}", "return", "answer", ";", "}", "protected", "boolean", "setAccessTrue", "(", "AST", "node", ",", "boolean", "access", ")", "{", "if", "(", "!", "access", ")", "{", "return", "true", ";", "}", "else", "{", "throw", "new", "ASTRuntimeException", "(", "node", ",", "\"\"", "+", "node", ".", "getText", "(", ")", "+", "\"\"", ")", ";", "}", "}", "protected", "int", "setModifierBit", "(", "AST", "node", ",", "int", "answer", ",", "int", "bit", ")", "{", "if", "(", "(", "answer", "&", "bit", ")", "!=", "0", ")", "{", "throw", "new", "ASTRuntimeException", "(", "node", ",", "\"\"", "+", "node", ".", "getText", "(", ")", ")", ";", "}", "return", "answer", "|", "bit", ";", "}", "protected", "AnnotationNode", "annotation", "(", "AST", "annotationNode", ")", "{", "AST", "node", "=", "annotationNode", ".", "getFirstChild", "(", ")", ";", "String", "name", "=", "qualifiedName", "(", "node", ")", ";", "AnnotationNode", "annotatedNode", "=", "new", "AnnotationNode", "(", "ClassHelper", ".", "make", "(", "name", ")", ")", ";", "configureAnnotationAST", "(", "annotatedNode", ",", "annotationNode", ")", ";", "while", "(", "true", ")", "{", "node", "=", "node", ".", "getNextSibling", "(", ")", ";", "if", "(", "isType", "(", "ANNOTATION_MEMBER_VALUE_PAIR", ",", "node", ")", ")", "{", "AST", "memberNode", "=", "node", ".", "getFirstChild", "(", ")", ";", "String", "param", "=", "identifier", "(", "memberNode", ")", ";", "Expression", "expression", "=", "expression", "(", "memberNode", ".", "getNextSibling", "(", ")", ")", ";", "if", "(", "annotatedNode", ".", "getMember", "(", "param", ")", "!=", "null", ")", "{", "throw", "new", "ASTRuntimeException", "(", "memberNode", ",", "\"\"", "+", "param", "+", "\"\"", ")", ";", "}", "annotatedNode", ".", "setMember", "(", "param", ",", "expression", ")", ";", "}", "else", "{", "break", ";", "}", "}", "return", "annotatedNode", ";", "}", "protected", "Statement", "statement", "(", "AST", "node", ")", "{", "if", "(", "node", "==", "null", ")", "{", "return", "new", "EmptyStatement", "(", ")", ";", "}", "Statement", "statement", "=", "null", ";", "int", "type", "=", "node", ".", "getType", "(", ")", ";", "switch", "(", "type", ")", "{", "case", "SLIST", ":", "case", "LITERAL_finally", ":", "statement", "=", "statementList", "(", "node", ")", ";", "break", ";", "case", "METHOD_CALL", ":", "statement", "=", "methodCall", "(", "node", ")", ";", "break", ";", "case", "VARIABLE_DEF", ":", "statement", "=", "variableDef", "(", "node", ")", ";", "break", ";", "case", "LABELED_STAT", ":", "statement", "=", "labelledStatement", "(", "node", ")", ";", "break", ";", "case", "LITERAL_assert", ":", "statement", "=", "assertStatement", "(", "node", ")", ";", "break", ";", "case", "LITERAL_break", ":", "statement", "=", "breakStatement", "(", "node", ")", ";", "break", ";", "case", "LITERAL_continue", ":", "statement", "=", "continueStatement", "(", "node", ")", ";", "break", ";", "case", "LITERAL_if", ":", "statement", "=", "ifStatement", "(", "node", ")", ";", "break", ";", "case", "LITERAL_for", ":", "statement", "=", "forStatement", "(", "node", ")", ";", "break", ";", "case", "LITERAL_return", ":", "statement", "=", "returnStatement", "(", "node", ")", ";", "break", ";", "case", "LITERAL_synchronized", ":", "statement", "=", "synchronizedStatement", "(", "node", ")", ";", "break", ";", "case", "LITERAL_switch", ":", "statement", "=", "switchStatement", "(", "node", ")", ";", "break", ";", "case", "LITERAL_try", ":", "statement", "=", "tryStatement", "(", "node", ")", ";", "break", ";", "case", "LITERAL_throw", ":", "statement", "=", "throwStatement", "(", "node", ")", ";", "break", ";", "case", "LITERAL_while", ":", "statement", "=", "whileStatement", "(", "node", ")", ";", "break", ";", "default", ":", "statement", "=", "new", "ExpressionStatement", "(", "expression", "(", "node", ")", ")", ";", "}", "if", "(", "statement", "!=", "null", "&&", "type", "!=", "LABELED_STAT", ")", "{", "configureAST", "(", "statement", ",", "node", ")", ";", "}", "return", "statement", ";", "}", "protected", "Statement", "statementList", "(", "AST", "code", ")", "{", "return", "statementListNoChild", "(", "code", ".", "getFirstChild", "(", ")", ",", "code", ")", ";", "}", "protected", "Statement", "statementListNoChild", "(", "AST", "node", ",", "AST", "alternativeConfigureNode", ")", "{", "BlockStatement", "block", "=", "new", "BlockStatement", "(", ")", ";", "if", "(", "alternativeConfigureNode", "!=", "null", ")", "{", "configureAST", "(", "block", ",", "alternativeConfigureNode", ")", ";", "}", "else", "if", "(", "node", "!=", "null", ")", "{", "configureAST", "(", "block", ",", "node", ")", ";", "}", "for", "(", ";", "node", "!=", "null", ";", "node", "=", "node", ".", "getNextSibling", "(", ")", ")", "{", "block", ".", "addStatement", "(", "statement", "(", "node", ")", ")", ";", "}", "return", "block", ";", "}", "protected", "Statement", "assertStatement", "(", "AST", "assertNode", ")", "{", "AST", "node", "=", "assertNode", ".", "getFirstChild", "(", ")", ";", "BooleanExpression", "booleanExpression", "=", "booleanExpression", "(", "node", ")", ";", "Expression", "messageExpression", "=", "null", ";", "node", "=", "node", ".", "getNextSibling", "(", ")", ";", "if", "(", "node", "!=", "null", ")", "{", "messageExpression", "=", "expression", "(", "node", ")", ";", "}", "else", "{", "messageExpression", "=", "ConstantExpression", ".", "NULL", ";", "}", "AssertStatement", "assertStatement", "=", "new", "AssertStatement", "(", "booleanExpression", ",", "messageExpression", ")", ";", "configureAST", "(", "assertStatement", ",", "assertNode", ")", ";", "return", "assertStatement", ";", "}", "protected", "Statement", "breakStatement", "(", "AST", "node", ")", "{", "BreakStatement", "breakStatement", "=", "new", "BreakStatement", "(", "label", "(", "node", ")", ")", ";", "configureAST", "(", "breakStatement", ",", "node", ")", ";", "return", "breakStatement", ";", "}", "protected", "Statement", "continueStatement", "(", "AST", "node", ")", "{", "ContinueStatement", "continueStatement", "=", "new", "ContinueStatement", "(", "label", "(", "node", ")", ")", ";", "configureAST", "(", "continueStatement", ",", "node", ")", ";", "return", "continueStatement", ";", "}", "protected", "Statement", "forStatement", "(", "AST", "forNode", ")", "{", "AST", "inNode", "=", "forNode", ".", "getFirstChild", "(", ")", ";", "Expression", "collectionExpression", ";", "Parameter", "forParameter", ";", "if", "(", "isType", "(", "CLOSURE_LIST", ",", "inNode", ")", ")", "{", "forStatementBeingDef", "=", "true", ";", "ClosureListExpression", "clist", "=", "closureListExpression", "(", "inNode", ")", ";", "forStatementBeingDef", "=", "false", ";", "int", "size", "=", "clist", ".", "getExpressions", "(", ")", ".", "size", "(", ")", ";", "if", "(", "size", "!=", "3", ")", "{", "throw", "new", "ASTRuntimeException", "(", "inNode", ",", "\"\"", "+", "size", ")", ";", "}", "collectionExpression", "=", "clist", ";", "forParameter", "=", "ForStatement", ".", "FOR_LOOP_DUMMY", ";", "}", "else", "{", "AST", "variableNode", "=", "inNode", ".", "getFirstChild", "(", ")", ";", "AST", "collectionNode", "=", "variableNode", ".", "getNextSibling", "(", ")", ";", "ClassNode", "type", "=", "ClassHelper", ".", "OBJECT_TYPE", ";", "if", "(", "isType", "(", "VARIABLE_DEF", ",", "variableNode", ")", ")", "{", "AST", "node", "=", "variableNode", ".", "getFirstChild", "(", ")", ";", "if", "(", "isType", "(", "MODIFIERS", ",", "node", ")", ")", "{", "int", "modifiersMask", "=", "modifiers", "(", "node", ",", "new", "ArrayList", "<", "AnnotationNode", ">", "(", ")", ",", "0", ")", ";", "if", "(", "(", "modifiersMask", "&", "~", "Opcodes", ".", "ACC_FINAL", ")", "!=", "0", ")", "{", "throw", "new", "ASTRuntimeException", "(", "node", ",", "\"\"", ")", ";", "}", "node", "=", "node", ".", "getNextSibling", "(", ")", ";", "}", "type", "=", "makeTypeWithArguments", "(", "node", ")", ";", "variableNode", "=", "node", ".", "getNextSibling", "(", ")", ";", "}", "String", "variable", "=", "identifier", "(", "variableNode", ")", ";", "collectionExpression", "=", "expression", "(", "collectionNode", ")", ";", "forParameter", "=", "new", "Parameter", "(", "type", ",", "variable", ")", ";", "configureAST", "(", "forParameter", ",", "variableNode", ")", ";", "forParameter", ".", "setNameStart", "(", "forParameter", ".", "getStart", "(", ")", ")", ";", "forParameter", ".", "setNameEnd", "(", "forParameter", ".", "getEnd", "(", ")", ")", ";", "}", "final", "AST", "node", "=", "inNode", ".", "getNextSibling", "(", ")", ";", "Statement", "block", ";", "if", "(", "isType", "(", "SEMI", ",", "node", ")", ")", "{", "block", "=", "EmptyStatement", ".", "INSTANCE", ";", "}", "else", "{", "block", "=", "statement", "(", "node", ")", ";", "}", "ForStatement", "forStatement", "=", "new", "ForStatement", "(", "forParameter", ",", "collectionExpression", ",", "block", ")", ";", "configureAST", "(", "forStatement", ",", "forNode", ")", ";", "return", "forStatement", ";", "}", "protected", "Statement", "ifStatement", "(", "AST", "ifNode", ")", "{", "AST", "node", "=", "ifNode", ".", "getFirstChild", "(", ")", ";", "assertNodeType", "(", "EXPR", ",", "node", ")", ";", "BooleanExpression", "booleanExpression", "=", "booleanExpression", "(", "node", ")", ";", "node", "=", "node", ".", "getNextSibling", "(", ")", ";", "Statement", "ifBlock", "=", "statement", "(", "node", ")", ";", "Statement", "elseBlock", "=", "EmptyStatement", ".", "INSTANCE", ";", "if", "(", "node", "!=", "null", ")", "{", "node", "=", "node", ".", "getNextSibling", "(", ")", ";", "if", "(", "node", "!=", "null", ")", "{", "elseBlock", "=", "statement", "(", "node", ")", ";", "}", "}", "IfStatement", "ifStatement", "=", "new", "IfStatement", "(", "booleanExpression", ",", "ifBlock", ",", "elseBlock", ")", ";", "configureAST", "(", "ifStatement", ",", "ifNode", ")", ";", "return", "ifStatement", ";", "}", "protected", "Statement", "labelledStatement", "(", "AST", "labelNode", ")", "{", "AST", "node", "=", "labelNode", ".", "getFirstChild", "(", ")", ";", "String", "label", "=", "identifier", "(", "node", ")", ";", "Statement", "statement", "=", "statement", "(", "node", ".", "getNextSibling", "(", ")", ")", ";", "if", "(", "statement", ".", "getStatementLabel", "(", ")", "==", "null", ")", "statement", ".", "setStatementLabel", "(", "label", ")", ";", "return", "statement", ";", "}", "protected", "Statement", "methodCall", "(", "AST", "code", ")", "{", "Expression", "expression", "=", "methodCallExpression", "(", "code", ")", ";", "ExpressionStatement", "expressionStatement", "=", "new", "ExpressionStatement", "(", "expression", ")", ";", "configureAST", "(", "expressionStatement", ",", "code", ")", ";", "return", "expressionStatement", ";", "}", "protected", "Expression", "declarationExpression", "(", "AST", "variableDef", ")", "{", "AST", "node", "=", "variableDef", ".", "getFirstChild", "(", ")", ";", "ClassNode", "type", "=", "null", ";", "List", "<", "AnnotationNode", ">", "annotations", "=", "new", "ArrayList", "<", "AnnotationNode", ">", "(", ")", ";", "int", "modifiers", "=", "0", ";", "if", "(", "isType", "(", "MODIFIERS", ",", "node", ")", ")", "{", "modifiers", "=", "modifiers", "(", "node", ",", "annotations", ",", "0", ")", ";", "node", "=", "node", ".", "getNextSibling", "(", ")", ";", "}", "if", "(", "isType", "(", "TYPE", ",", "node", ")", ")", "{", "type", "=", "makeTypeWithArguments", "(", "node", ")", ";", "node", "=", "node", ".", "getNextSibling", "(", ")", ";", "}", "Expression", "leftExpression", ";", "Expression", "rightExpression", "=", "EmptyExpression", ".", "INSTANCE", ";", "AST", "right", ";", "if", "(", "isType", "(", "ASSIGN", ",", "node", ")", ")", "{", "node", "=", "node", ".", "getFirstChild", "(", ")", ";", "AST", "left", "=", "node", ".", "getFirstChild", "(", ")", ";", "ArgumentListExpression", "alist", "=", "new", "ArgumentListExpression", "(", ")", ";", "for", "(", "AST", "varDef", "=", "left", ";", "varDef", "!=", "null", ";", "varDef", "=", "varDef", ".", "getNextSibling", "(", ")", ")", "{", "assertNodeType", "(", "VARIABLE_DEF", ",", "varDef", ")", ";", "DeclarationExpression", "de", "=", "(", "DeclarationExpression", ")", "declarationExpression", "(", "varDef", ")", ";", "alist", ".", "addExpression", "(", "de", ".", "getVariableExpression", "(", ")", ")", ";", "}", "leftExpression", "=", "alist", ";", "right", "=", "node", ".", "getNextSibling", "(", ")", ";", "if", "(", "right", "!=", "null", ")", "rightExpression", "=", "expression", "(", "right", ")", ";", "}", "else", "{", "String", "name", "=", "identifier", "(", "node", ")", ";", "VariableExpression", "ve", "=", "new", "VariableExpression", "(", "name", ",", "type", ")", ";", "ve", ".", "setModifiers", "(", "modifiers", ")", ";", "leftExpression", "=", "ve", ";", "right", "=", "node", ".", "getNextSibling", "(", ")", ";", "if", "(", "right", "!=", "null", ")", "{", "assertNodeType", "(", "ASSIGN", ",", "right", ")", ";", "rightExpression", "=", "expression", "(", "right", ".", "getFirstChild", "(", ")", ")", ";", "}", "}", "configureAST", "(", "leftExpression", ",", "node", ")", ";", "Token", "token", "=", "makeToken", "(", "Types", ".", "ASSIGN", ",", "variableDef", ")", ";", "DeclarationExpression", "expression", "=", "new", "DeclarationExpression", "(", "leftExpression", ",", "token", ",", "rightExpression", ")", ";", "expression", ".", "addAnnotations", "(", "annotations", ")", ";", "configureAST", "(", "expression", ",", "variableDef", ")", ";", "ExpressionStatement", "expressionStatement", "=", "new", "ExpressionStatement", "(", "expression", ")", ";", "configureAST", "(", "expressionStatement", ",", "variableDef", ")", ";", "return", "expression", ";", "}", "protected", "Statement", "variableDef", "(", "AST", "variableDef", ")", "{", "ExpressionStatement", "expressionStatement", "=", "new", "ExpressionStatement", "(", "declarationExpression", "(", "variableDef", ")", ")", ";", "configureAST", "(", "expressionStatement", ",", "variableDef", ")", ";", "return", "expressionStatement", ";", "}", "protected", "Statement", "returnStatement", "(", "AST", "node", ")", "{", "AST", "exprNode", "=", "node", ".", "getFirstChild", "(", ")", ";", "Expression", "expression", "=", "exprNode", "==", "null", "?", "ConstantExpression", ".", "NULL", ":", "expression", "(", "exprNode", ")", ";", "ReturnStatement", "returnStatement", "=", "new", "ReturnStatement", "(", "expression", ")", ";", "configureAST", "(", "returnStatement", ",", "node", ")", ";", "return", "returnStatement", ";", "}", "protected", "Statement", "switchStatement", "(", "AST", "switchNode", ")", "{", "AST", "node", "=", "switchNode", ".", "getFirstChild", "(", ")", ";", "Expression", "expression", "=", "expression", "(", "node", ")", ";", "Statement", "defaultStatement", "=", "EmptyStatement", ".", "INSTANCE", ";", "List", "list", "=", "new", "ArrayList", "(", ")", ";", "for", "(", "node", "=", "node", ".", "getNextSibling", "(", ")", ";", "isType", "(", "CASE_GROUP", ",", "node", ")", ";", "node", "=", "node", ".", "getNextSibling", "(", ")", ")", "{", "Statement", "tmpDefaultStatement", ";", "AST", "child", "=", "node", ".", "getFirstChild", "(", ")", ";", "if", "(", "isType", "(", "LITERAL_case", ",", "child", ")", ")", "{", "List", "cases", "=", "new", "LinkedList", "(", ")", ";", "tmpDefaultStatement", "=", "caseStatements", "(", "child", ",", "cases", ")", ";", "list", ".", "addAll", "(", "cases", ")", ";", "}", "else", "{", "tmpDefaultStatement", "=", "statement", "(", "child", ".", "getNextSibling", "(", ")", ")", ";", "}", "if", "(", "tmpDefaultStatement", "!=", "EmptyStatement", ".", "INSTANCE", ")", "{", "if", "(", "defaultStatement", "==", "EmptyStatement", ".", "INSTANCE", ")", "{", "defaultStatement", "=", "tmpDefaultStatement", ";", "}", "else", "{", "throw", "new", "ASTRuntimeException", "(", "switchNode", ",", "\"\"", ")", ";", "}", "}", "}", "if", "(", "node", "!=", "null", ")", "{", "unknownAST", "(", "node", ")", ";", "}", "SwitchStatement", "switchStatement", "=", "new", "SwitchStatement", "(", "expression", ",", "list", ",", "defaultStatement", ")", ";", "configureAST", "(", "switchStatement", ",", "switchNode", ")", ";", "return", "switchStatement", ";", "}", "protected", "Statement", "caseStatements", "(", "AST", "node", ",", "List", "cases", ")", "{", "List", "<", "Expression", ">", "expressions", "=", "new", "LinkedList", "<", "Expression", ">", "(", ")", ";", "Statement", "statement", "=", "EmptyStatement", ".", "INSTANCE", ";", "Statement", "defaultStatement", "=", "EmptyStatement", ".", "INSTANCE", ";", "AST", "nextSibling", "=", "node", ";", "do", "{", "Expression", "expression", "=", "expression", "(", "nextSibling", ".", "getFirstChild", "(", ")", ")", ";", "expressions", ".", "add", "(", "expression", ")", ";", "nextSibling", "=", "nextSibling", ".", "getNextSibling", "(", ")", ";", "}", "while", "(", "isType", "(", "LITERAL_case", ",", "nextSibling", ")", ")", ";", "if", "(", "nextSibling", "!=", "null", ")", "{", "if", "(", "isType", "(", "LITERAL_default", ",", "nextSibling", ")", ")", "{", "defaultStatement", "=", "statement", "(", "nextSibling", ".", "getNextSibling", "(", ")", ")", ";", "statement", "=", "EmptyStatement", ".", "INSTANCE", ";", "}", "else", "{", "statement", "=", "statement", "(", "nextSibling", ")", ";", "}", "}", "Iterator", "iterator", "=", "expressions", ".", "iterator", "(", ")", ";", "while", "(", "iterator", ".", "hasNext", "(", ")", ")", "{", "Expression", "expr", "=", "(", "Expression", ")", "iterator", ".", "next", "(", ")", ";", "Statement", "stmt", ";", "if", "(", "iterator", ".", "hasNext", "(", ")", ")", "{", "stmt", "=", "new", "CaseStatement", "(", "expr", ",", "EmptyStatement", ".", "INSTANCE", ")", ";", "}", "else", "{", "stmt", "=", "new", "CaseStatement", "(", "expr", ",", "statement", ")", ";", "}", "configureAST", "(", "stmt", ",", "node", ")", ";", "cases", ".", "add", "(", "stmt", ")", ";", "}", "return", "defaultStatement", ";", "}", "protected", "Statement", "synchronizedStatement", "(", "AST", "syncNode", ")", "{", "AST", "node", "=", "syncNode", ".", "getFirstChild", "(", ")", ";", "Expression", "expression", "=", "expression", "(", "node", ")", ";", "Statement", "code", "=", "statement", "(", "node", ".", "getNextSibling", "(", ")", ")", ";", "SynchronizedStatement", "synchronizedStatement", "=", "new", "SynchronizedStatement", "(", "expression", ",", "code", ")", ";", "configureAST", "(", "synchronizedStatement", ",", "syncNode", ")", ";", "return", "synchronizedStatement", ";", "}", "protected", "Statement", "throwStatement", "(", "AST", "node", ")", "{", "AST", "expressionNode", "=", "node", ".", "getFirstChild", "(", ")", ";", "if", "(", "expressionNode", "==", "null", ")", "{", "expressionNode", "=", "node", ".", "getNextSibling", "(", ")", ";", "}", "if", "(", "expressionNode", "==", "null", ")", "{", "throw", "new", "ASTRuntimeException", "(", "node", ",", "\"\"", ")", ";", "}", "ThrowStatement", "throwStatement", "=", "new", "ThrowStatement", "(", "expression", "(", "expressionNode", ")", ")", ";", "configureAST", "(", "throwStatement", ",", "node", ")", ";", "return", "throwStatement", ";", "}", "protected", "Statement", "tryStatement", "(", "AST", "tryStatementNode", ")", "{", "AST", "tryNode", "=", "tryStatementNode", ".", "getFirstChild", "(", ")", ";", "Statement", "tryStatement", "=", "statement", "(", "tryNode", ")", ";", "Statement", "finallyStatement", "=", "EmptyStatement", ".", "INSTANCE", ";", "AST", "node", "=", "tryNode", ".", "getNextSibling", "(", ")", ";", "List", "<", "CatchStatement", ">", "catches", "=", "new", "ArrayList", "<", "CatchStatement", ">", "(", ")", ";", "for", "(", ";", "node", "!=", "null", "&&", "isType", "(", "LITERAL_catch", ",", "node", ")", ";", "node", "=", "node", ".", "getNextSibling", "(", ")", ")", "{", "catches", ".", "add", "(", "catchStatement", "(", "node", ")", ")", ";", "}", "if", "(", "isType", "(", "LITERAL_finally", ",", "node", ")", ")", "{", "finallyStatement", "=", "statement", "(", "node", ")", ";", "node", "=", "node", ".", "getNextSibling", "(", ")", ";", "}", "if", "(", "finallyStatement", "instanceof", "EmptyStatement", "&&", "catches", ".", "size", "(", ")", "==", "0", ")", "{", "throw", "new", "ASTRuntimeException", "(", "tryStatementNode", ",", "\"\"", ")", ";", "}", "TryCatchStatement", "tryCatchStatement", "=", "new", "TryCatchStatement", "(", "tryStatement", ",", "finallyStatement", ")", ";", "configureAST", "(", "tryCatchStatement", ",", "tryStatementNode", ")", ";", "for", "(", "CatchStatement", "statement", ":", "catches", ")", "{", "tryCatchStatement", ".", "addCatch", "(", "statement", ")", ";", "}", "return", "tryCatchStatement", ";", "}", "protected", "CatchStatement", "catchStatement", "(", "AST", "catchNode", ")", "{", "AST", "node", "=", "catchNode", ".", "getFirstChild", "(", ")", ";", "Parameter", "parameter", "=", "parameter", "(", "node", ")", ";", "ClassNode", "exceptionType", "=", "parameter", ".", "getType", "(", ")", ";", "String", "variable", "=", "parameter", ".", "getName", "(", ")", ";", "node", "=", "node", ".", "getNextSibling", "(", ")", ";", "Statement", "code", "=", "statement", "(", "node", ")", ";", "Parameter", "catchParameter", "=", "new", "Parameter", "(", "exceptionType", ",", "variable", ")", ";", "CatchStatement", "answer", "=", "new", "CatchStatement", "(", "catchParameter", ",", "code", ")", ";", "configureAST", "(", "answer", ",", "catchNode", ")", ";", "catchParameter", ".", "setSourcePosition", "(", "parameter", ")", ";", "return", "answer", ";", "}", "protected", "Statement", "whileStatement", "(", "AST", "whileNode", ")", "{", "AST", "node", "=", "whileNode", ".", "getFirstChild", "(", ")", ";", "assertNodeType", "(", "EXPR", ",", "node", ")", ";", "if", "(", "isType", "(", "VARIABLE_DEF", ",", "node", ".", "getFirstChild", "(", ")", ")", ")", "{", "throw", "new", "ASTRuntimeException", "(", "whileNode", ",", "\"\"", ")", ";", "}", "BooleanExpression", "booleanExpression", "=", "booleanExpression", "(", "node", ")", ";", "node", "=", "node", ".", "getNextSibling", "(", ")", ";", "Statement", "block", ";", "if", "(", "isType", "(", "SEMI", ",", "node", ")", ")", "{", "block", "=", "EmptyStatement", ".", "INSTANCE", ";", "}", "else", "{", "block", "=", "statement", "(", "node", ")", ";", "}", "WhileStatement", "whileStatement", "=", "new", "WhileStatement", "(", "booleanExpression", ",", "block", ")", ";", "configureAST", "(", "whileStatement", ",", "whileNode", ")", ";", "return", "whileStatement", ";", "}", "protected", "Expression", "expression", "(", "AST", "node", ")", "{", "return", "expression", "(", "node", ",", "false", ")", ";", "}", "protected", "Expression", "expression", "(", "AST", "node", ",", "boolean", "convertToConstant", ")", "{", "if", "(", "node", "==", "null", ")", "{", "return", "new", "ConstantExpression", "(", "\"ERROR\"", ")", ";", "}", "Expression", "expression", "=", "expressionSwitch", "(", "node", ")", ";", "if", "(", "convertToConstant", "&&", "expression", "instanceof", "VariableExpression", ")", "{", "VariableExpression", "ve", "=", "(", "VariableExpression", ")", "expression", ";", "if", "(", "!", "ve", ".", "isThisExpression", "(", ")", "&&", "!", "ve", ".", "isSuperExpression", "(", ")", ")", "{", "expression", "=", "new", "ConstantExpression", "(", "ve", ".", "getName", "(", ")", ")", ";", "}", "}", "configureAST", "(", "expression", ",", "node", ")", ";", "return", "expression", ";", "}", "protected", "Expression", "expressionSwitch", "(", "AST", "node", ")", "{", "int", "type", "=", "node", ".", "getType", "(", ")", ";", "switch", "(", "type", ")", "{", "case", "EXPR", ":", "Expression", "expression", "=", "expression", "(", "node", ".", "getFirstChild", "(", ")", ")", ";", "if", "(", "expression", "instanceof", "BinaryExpression", ")", "{", "configureAST", "(", "expression", ",", "node", ")", ";", "}", "return", "expression", ";", "case", "ELIST", ":", "return", "expressionList", "(", "node", ")", ";", "case", "SLIST", ":", "return", "blockExpression", "(", "node", ")", ";", "case", "CLOSABLE_BLOCK", ":", "return", "closureExpression", "(", "node", ")", ";", "case", "SUPER_CTOR_CALL", ":", "return", "specialConstructorCallExpression", "(", "node", ",", "ClassNode", ".", "SUPER", ")", ";", "case", "METHOD_CALL", ":", "return", "methodCallExpression", "(", "node", ")", ";", "case", "LITERAL_new", ":", "return", "constructorCallExpression", "(", "node", ")", ";", "case", "CTOR_CALL", ":", "return", "specialConstructorCallExpression", "(", "node", ",", "ClassNode", ".", "THIS", ")", ";", "case", "QUESTION", ":", "case", "ELVIS_OPERATOR", ":", "return", "ternaryExpression", "(", "node", ")", ";", "case", "OPTIONAL_DOT", ":", "case", "SPREAD_DOT", ":", "case", "DOT", ":", "return", "dotExpression", "(", "node", ")", ";", "case", "IDENT", ":", "case", "LITERAL_boolean", ":", "case", "LITERAL_byte", ":", "case", "LITERAL_char", ":", "case", "LITERAL_double", ":", "case", "LITERAL_float", ":", "case", "LITERAL_int", ":", "case", "LITERAL_long", ":", "case", "LITERAL_short", ":", "case", "LITERAL_void", ":", "case", "LITERAL_this", ":", "case", "LITERAL_super", ":", "return", "variableExpression", "(", "node", ")", ";", "case", "LIST_CONSTRUCTOR", ":", "return", "listExpression", "(", "node", ")", ";", "case", "MAP_CONSTRUCTOR", ":", "return", "mapExpression", "(", "node", ")", ";", "case", "LABELED_ARG", ":", "return", "mapEntryExpression", "(", "node", ")", ";", "case", "SPREAD_ARG", ":", "return", "spreadExpression", "(", "node", ")", ";", "case", "SPREAD_MAP_ARG", ":", "return", "spreadMapExpression", "(", "node", ")", ";", "case", "MEMBER_POINTER", ":", "return", "methodPointerExpression", "(", "node", ")", ";", "case", "INDEX_OP", ":", "return", "indexExpression", "(", "node", ")", ";", "case", "LITERAL_instanceof", ":", "return", "instanceofExpression", "(", "node", ")", ";", "case", "LITERAL_as", ":", "return", "asExpression", "(", "node", ")", ";", "case", "TYPECAST", ":", "return", "castExpression", "(", "node", ")", ";", "case", "LITERAL_true", ":", "return", "literalExpression", "(", "node", ",", "Boolean", ".", "TRUE", ")", ";", "case", "LITERAL_false", ":", "return", "literalExpression", "(", "node", ",", "Boolean", ".", "FALSE", ")", ";", "case", "LITERAL_null", ":", "return", "literalExpression", "(", "node", ",", "null", ")", ";", "case", "STRING_LITERAL", ":", "return", "literalExpression", "(", "node", ",", "node", ".", "getText", "(", ")", ")", ";", "case", "STRING_CONSTRUCTOR", ":", "return", "gstring", "(", "node", ")", ";", "case", "NUM_DOUBLE", ":", "case", "NUM_FLOAT", ":", "case", "NUM_BIG_DECIMAL", ":", "return", "decimalExpression", "(", "node", ")", ";", "case", "NUM_BIG_INT", ":", "case", "NUM_INT", ":", "case", "NUM_LONG", ":", "return", "integerExpression", "(", "node", ")", ";", "case", "LNOT", ":", "NotExpression", "notExpression", "=", "new", "NotExpression", "(", "expression", "(", "node", ".", "getFirstChild", "(", ")", ")", ")", ";", "configureAST", "(", "notExpression", ",", "node", ")", ";", "return", "notExpression", ";", "case", "UNARY_MINUS", ":", "return", "unaryMinusExpression", "(", "node", ")", ";", "case", "BNOT", ":", "BitwiseNegationExpression", "bitwiseNegationExpression", "=", "new", "BitwiseNegationExpression", "(", "expression", "(", "node", ".", "getFirstChild", "(", ")", ")", ")", ";", "configureAST", "(", "bitwiseNegationExpression", ",", "node", ")", ";", "return", "bitwiseNegationExpression", ";", "case", "UNARY_PLUS", ":", "return", "unaryPlusExpression", "(", "node", ")", ";", "case", "INC", ":", "return", "prefixExpression", "(", "node", ",", "Types", ".", "PLUS_PLUS", ")", ";", "case", "DEC", ":", "return", "prefixExpression", "(", "node", ",", "Types", ".", "MINUS_MINUS", ")", ";", "case", "POST_INC", ":", "return", "postfixExpression", "(", "node", ",", "Types", ".", "PLUS_PLUS", ")", ";", "case", "POST_DEC", ":", "return", "postfixExpression", "(", "node", ",", "Types", ".", "MINUS_MINUS", ")", ";", "case", "ASSIGN", ":", "return", "binaryExpression", "(", "Types", ".", "ASSIGN", ",", "node", ")", ";", "case", "EQUAL", ":", "return", "binaryExpression", "(", "Types", ".", "COMPARE_EQUAL", ",", "node", ")", ";", "case", "IDENTICAL", ":", "return", "binaryExpression", "(", "Types", ".", "COMPARE_IDENTICAL", ",", "node", ")", ";", "case", "NOT_EQUAL", ":", "return", "binaryExpression", "(", "Types", ".", "COMPARE_NOT_EQUAL", ",", "node", ")", ";", "case", "NOT_IDENTICAL", ":", "return", "binaryExpression", "(", "Types", ".", "COMPARE_NOT_IDENTICAL", ",", "node", ")", ";", "case", "COMPARE_TO", ":", "return", "binaryExpression", "(", "Types", ".", "COMPARE_TO", ",", "node", ")", ";", "case", "LE", ":", "return", "binaryExpression", "(", "Types", ".", "COMPARE_LESS_THAN_EQUAL", ",", "node", ")", ";", "case", "LT", ":", "return", "binaryExpression", "(", "Types", ".", "COMPARE_LESS_THAN", ",", "node", ")", ";", "case", "GT", ":", "return", "binaryExpression", "(", "Types", ".", "COMPARE_GREATER_THAN", ",", "node", ")", ";", "case", "GE", ":", "return", "binaryExpression", "(", "Types", ".", "COMPARE_GREATER_THAN_EQUAL", ",", "node", ")", ";", "case", "LAND", ":", "return", "binaryExpression", "(", "Types", ".", "LOGICAL_AND", ",", "node", ")", ";", "case", "LOR", ":", "return", "binaryExpression", "(", "Types", ".", "LOGICAL_OR", ",", "node", ")", ";", "case", "BAND", ":", "return", "binaryExpression", "(", "Types", ".", "BITWISE_AND", ",", "node", ")", ";", "case", "BAND_ASSIGN", ":", "return", "binaryExpression", "(", "Types", ".", "BITWISE_AND_EQUAL", ",", "node", ")", ";", "case", "BOR", ":", "return", "binaryExpression", "(", "Types", ".", "BITWISE_OR", ",", "node", ")", ";", "case", "BOR_ASSIGN", ":", "return", "binaryExpression", "(", "Types", ".", "BITWISE_OR_EQUAL", ",", "node", ")", ";", "case", "BXOR", ":", "return", "binaryExpression", "(", "Types", ".", "BITWISE_XOR", ",", "node", ")", ";", "case", "BXOR_ASSIGN", ":", "return", "binaryExpression", "(", "Types", ".", "BITWISE_XOR_EQUAL", ",", "node", ")", ";", "case", "PLUS", ":", "return", "binaryExpression", "(", "Types", ".", "PLUS", ",", "node", ")", ";", "case", "PLUS_ASSIGN", ":", "return", "binaryExpression", "(", "Types", ".", "PLUS_EQUAL", ",", "node", ")", ";", "case", "MINUS", ":", "return", "binaryExpression", "(", "Types", ".", "MINUS", ",", "node", ")", ";", "case", "MINUS_ASSIGN", ":", "return", "binaryExpression", "(", "Types", ".", "MINUS_EQUAL", ",", "node", ")", ";", "case", "STAR", ":", "return", "binaryExpression", "(", "Types", ".", "MULTIPLY", ",", "node", ")", ";", "case", "STAR_ASSIGN", ":", "return", "binaryExpression", "(", "Types", ".", "MULTIPLY_EQUAL", ",", "node", ")", ";", "case", "STAR_STAR", ":", "return", "binaryExpression", "(", "Types", ".", "POWER", ",", "node", ")", ";", "case", "STAR_STAR_ASSIGN", ":", "return", "binaryExpression", "(", "Types", ".", "POWER_EQUAL", ",", "node", ")", ";", "case", "DIV", ":", "return", "binaryExpression", "(", "Types", ".", "DIVIDE", ",", "node", ")", ";", "case", "DIV_ASSIGN", ":", "return", "binaryExpression", "(", "Types", ".", "DIVIDE_EQUAL", ",", "node", ")", ";", "case", "MOD", ":", "return", "binaryExpression", "(", "Types", ".", "MOD", ",", "node", ")", ";", "case", "MOD_ASSIGN", ":", "return", "binaryExpression", "(", "Types", ".", "MOD_EQUAL", ",", "node", ")", ";", "case", "SL", ":", "return", "binaryExpression", "(", "Types", ".", "LEFT_SHIFT", ",", "node", ")", ";", "case", "SL_ASSIGN", ":", "return", "binaryExpression", "(", "Types", ".", "LEFT_SHIFT_EQUAL", ",", "node", ")", ";", "case", "SR", ":", "return", "binaryExpression", "(", "Types", ".", "RIGHT_SHIFT", ",", "node", ")", ";", "case", "SR_ASSIGN", ":", "return", "binaryExpression", "(", "Types", ".", "RIGHT_SHIFT_EQUAL", ",", "node", ")", ";", "case", "BSR", ":", "return", "binaryExpression", "(", "Types", ".", "RIGHT_SHIFT_UNSIGNED", ",", "node", ")", ";", "case", "BSR_ASSIGN", ":", "return", "binaryExpression", "(", "Types", ".", "RIGHT_SHIFT_UNSIGNED_EQUAL", ",", "node", ")", ";", "case", "VARIABLE_DEF", ":", "return", "declarationExpression", "(", "node", ")", ";", "case", "REGEX_FIND", ":", "return", "binaryExpression", "(", "Types", ".", "FIND_REGEX", ",", "node", ")", ";", "case", "REGEX_MATCH", ":", "return", "binaryExpression", "(", "Types", ".", "MATCH_REGEX", ",", "node", ")", ";", "case", "RANGE_INCLUSIVE", ":", "return", "rangeExpression", "(", "node", ",", "true", ")", ";", "case", "RANGE_EXCLUSIVE", ":", "return", "rangeExpression", "(", "node", ",", "false", ")", ";", "case", "DYNAMIC_MEMBER", ":", "return", "dynamicMemberExpression", "(", "node", ")", ";", "case", "LITERAL_in", ":", "return", "binaryExpression", "(", "Types", ".", "KEYWORD_IN", ",", "node", ")", ";", "case", "ANNOTATION", ":", "return", "new", "AnnotationConstantExpression", "(", "annotation", "(", "node", ")", ")", ";", "case", "CLOSURE_LIST", ":", "return", "closureListExpression", "(", "node", ")", ";", "case", "LBRACK", ":", "case", "LPAREN", ":", "return", "tupleExpression", "(", "node", ")", ";", "case", "OBJBLOCK", ":", "return", "anonymousInnerClassDef", "(", "node", ")", ";", "default", ":", "return", "unknownAST", "(", "node", ")", ";", "}", "}", "private", "TupleExpression", "tupleExpression", "(", "AST", "node", ")", "{", "TupleExpression", "exp", "=", "new", "TupleExpression", "(", ")", ";", "configureAST", "(", "exp", ",", "node", ")", ";", "node", "=", "node", ".", "getFirstChild", "(", ")", ";", "while", "(", "node", "!=", "null", ")", "{", "assertNodeType", "(", "VARIABLE_DEF", ",", "node", ")", ";", "AST", "nameNode", "=", "node", ".", "getFirstChild", "(", ")", ".", "getNextSibling", "(", ")", ";", "VariableExpression", "varExp", "=", "new", "VariableExpression", "(", "nameNode", ".", "getText", "(", ")", ")", ";", "configureAST", "(", "varExp", ",", "nameNode", ")", ";", "exp", ".", "addExpression", "(", "varExp", ")", ";", "node", "=", "node", ".", "getNextSibling", "(", ")", ";", "}", "return", "exp", ";", "}", "private", "ClosureListExpression", "closureListExpression", "(", "AST", "node", ")", "{", "isClosureListExpressionAllowedHere", "(", "node", ")", ";", "AST", "exprNode", "=", "node", ".", "getFirstChild", "(", ")", ";", "List", "<", "Expression", ">", "list", "=", "new", "LinkedList", "<", "Expression", ">", "(", ")", ";", "while", "(", "exprNode", "!=", "null", ")", "{", "if", "(", "isType", "(", "EXPR", ",", "exprNode", ")", ")", "{", "Expression", "expr", "=", "expression", "(", "exprNode", ")", ";", "configureAST", "(", "expr", ",", "exprNode", ")", ";", "list", ".", "add", "(", "expr", ")", ";", "}", "else", "{", "assertNodeType", "(", "EMPTY_STAT", ",", "exprNode", ")", ";", "list", ".", "add", "(", "EmptyExpression", ".", "INSTANCE", ")", ";", "}", "exprNode", "=", "exprNode", ".", "getNextSibling", "(", ")", ";", "}", "ClosureListExpression", "cle", "=", "new", "ClosureListExpression", "(", "list", ")", ";", "configureAST", "(", "cle", ",", "node", ")", ";", "return", "cle", ";", "}", "private", "void", "isClosureListExpressionAllowedHere", "(", "AST", "node", ")", "{", "if", "(", "!", "forStatementBeingDef", ")", "{", "throw", "new", "ASTRuntimeException", "(", "node", ",", "\"\"", ")", ";", "}", "}", "protected", "Expression", "dynamicMemberExpression", "(", "AST", "dynamicMemberNode", ")", "{", "AST", "node", "=", "dynamicMemberNode", ".", "getFirstChild", "(", ")", ";", "return", "expression", "(", "node", ")", ";", "}", "protected", "Expression", "ternaryExpression", "(", "AST", "ternaryNode", ")", "{", "AST", "node", "=", "ternaryNode", ".", "getFirstChild", "(", ")", ";", "Expression", "base", "=", "expression", "(", "node", ")", ";", "node", "=", "node", ".", "getNextSibling", "(", ")", ";", "Expression", "left", "=", "expression", "(", "node", ")", ";", "node", "=", "node", ".", "getNextSibling", "(", ")", ";", "Expression", "ret", ";", "if", "(", "node", "==", "null", ")", "{", "ret", "=", "new", "ElvisOperatorExpression", "(", "base", ",", "left", ")", ";", "}", "else", "{", "Expression", "right", "=", "expression", "(", "node", ")", ";", "BooleanExpression", "booleanExpression", "=", "new", "BooleanExpression", "(", "base", ")", ";", "booleanExpression", ".", "setSourcePosition", "(", "base", ")", ";", "ret", "=", "new", "TernaryExpression", "(", "booleanExpression", ",", "left", ",", "right", ")", ";", "}", "configureAST", "(", "ret", ",", "ternaryNode", ")", ";", "return", "ret", ";", "}", "protected", "Expression", "variableExpression", "(", "AST", "node", ")", "{", "String", "text", "=", "node", ".", "getText", "(", ")", ";", "VariableExpression", "variableExpression", "=", "new", "VariableExpression", "(", "text", ")", ";", "configureAST", "(", "variableExpression", ",", "node", ")", ";", "return", "variableExpression", ";", "}", "protected", "Expression", "literalExpression", "(", "AST", "node", ",", "Object", "value", ")", "{", "ConstantExpression", "constantExpression", "=", "new", "ConstantExpression", "(", "value", ",", "value", "instanceof", "Boolean", ")", ";", "configureAST", "(", "constantExpression", ",", "node", ")", ";", "return", "constantExpression", ";", "}", "protected", "Expression", "rangeExpression", "(", "AST", "rangeNode", ",", "boolean", "inclusive", ")", "{", "AST", "node", "=", "rangeNode", ".", "getFirstChild", "(", ")", ";", "Expression", "left", "=", "expression", "(", "node", ")", ";", "Expression", "right", "=", "expression", "(", "node", ".", "getNextSibling", "(", ")", ")", ";", "RangeExpression", "rangeExpression", "=", "new", "RangeExpression", "(", "left", ",", "right", ",", "inclusive", ")", ";", "configureAST", "(", "rangeExpression", ",", "rangeNode", ")", ";", "return", "rangeExpression", ";", "}", "protected", "Expression", "spreadExpression", "(", "AST", "node", ")", "{", "AST", "exprNode", "=", "node", ".", "getFirstChild", "(", ")", ";", "AST", "listNode", "=", "exprNode", ".", "getFirstChild", "(", ")", ";", "Expression", "right", "=", "expression", "(", "listNode", ")", ";", "SpreadExpression", "spreadExpression", "=", "new", "SpreadExpression", "(", "right", ")", ";", "configureAST", "(", "spreadExpression", ",", "node", ")", ";", "return", "spreadExpression", ";", "}", "protected", "Expression", "spreadMapExpression", "(", "AST", "node", ")", "{", "AST", "exprNode", "=", "node", ".", "getFirstChild", "(", ")", ";", "Expression", "expr", "=", "expression", "(", "exprNode", ")", ";", "SpreadMapExpression", "spreadMapExpression", "=", "new", "SpreadMapExpression", "(", "expr", ")", ";", "configureAST", "(", "spreadMapExpression", ",", "node", ")", ";", "return", "spreadMapExpression", ";", "}", "protected", "Expression", "methodPointerExpression", "(", "AST", "node", ")", "{", "AST", "exprNode", "=", "node", ".", "getFirstChild", "(", ")", ";", "Expression", "objectExpression", "=", "expression", "(", "exprNode", ")", ";", "AST", "mNode", "=", "exprNode", ".", "getNextSibling", "(", ")", ";", "Expression", "methodName", ";", "if", "(", "isType", "(", "DYNAMIC_MEMBER", ",", "mNode", ")", ")", "{", "methodName", "=", "expression", "(", "mNode", ")", ";", "}", "else", "{", "methodName", "=", "new", "ConstantExpression", "(", "identifier", "(", "mNode", ")", ")", ";", "}", "configureAST", "(", "methodName", ",", "mNode", ")", ";", "MethodPointerExpression", "methodPointerExpression", "=", "new", "MethodPointerExpression", "(", "objectExpression", ",", "methodName", ")", ";", "configureAST", "(", "methodPointerExpression", ",", "node", ")", ";", "return", "methodPointerExpression", ";", "}", "protected", "Expression", "listExpression", "(", "AST", "listNode", ")", "{", "List", "<", "Expression", ">", "expressions", "=", "new", "ArrayList", "<", "Expression", ">", "(", ")", ";", "AST", "elist", "=", "listNode", ".", "getFirstChild", "(", ")", ";", "assertNodeType", "(", "ELIST", ",", "elist", ")", ";", "for", "(", "AST", "node", "=", "elist", ".", "getFirstChild", "(", ")", ";", "node", "!=", "null", ";", "node", "=", "node", ".", "getNextSibling", "(", ")", ")", "{", "switch", "(", "node", ".", "getType", "(", ")", ")", "{", "case", "LABELED_ARG", ":", "assertNodeType", "(", "COMMA", ",", "node", ")", ";", "break", ";", "case", "SPREAD_MAP_ARG", ":", "assertNodeType", "(", "SPREAD_ARG", ",", "node", ")", ";", "break", ";", "}", "expressions", ".", "add", "(", "expression", "(", "node", ")", ")", ";", "}", "ListExpression", "listExpression", "=", "new", "ListExpression", "(", "expressions", ")", ";", "configureAST", "(", "listExpression", ",", "listNode", ")", ";", "return", "listExpression", ";", "}", "protected", "Expression", "mapExpression", "(", "AST", "mapNode", ")", "{", "List", "expressions", "=", "new", "ArrayList", "(", ")", ";", "AST", "elist", "=", "mapNode", ".", "getFirstChild", "(", ")", ";", "if", "(", "elist", "!=", "null", ")", "{", "assertNodeType", "(", "ELIST", ",", "elist", ")", ";", "for", "(", "AST", "node", "=", "elist", ".", "getFirstChild", "(", ")", ";", "node", "!=", "null", ";", "node", "=", "node", ".", "getNextSibling", "(", ")", ")", "{", "switch", "(", "node", ".", "getType", "(", ")", ")", "{", "case", "LABELED_ARG", ":", "case", "SPREAD_MAP_ARG", ":", "break", ";", "case", "SPREAD_ARG", ":", "assertNodeType", "(", "SPREAD_MAP_ARG", ",", "node", ")", ";", "break", ";", "default", ":", "assertNodeType", "(", "LABELED_ARG", ",", "node", ")", ";", "break", ";", "}", "expressions", ".", "add", "(", "mapEntryExpression", "(", "node", ")", ")", ";", "}", "}", "MapExpression", "mapExpression", "=", "new", "MapExpression", "(", "expressions", ")", ";", "configureAST", "(", "mapExpression", ",", "mapNode", ")", ";", "if", "(", "expressions", ".", "size", "(", ")", "==", "0", "&&", "mapExpression", ".", "getLength", "(", ")", "<=", "1", ")", "{", "mapExpression", ".", "setEnd", "(", "mapExpression", ".", "getStart", "(", ")", "+", "3", ")", ";", "mapExpression", ".", "setLastColumnNumber", "(", "mapExpression", ".", "getColumnNumber", "(", ")", "+", "3", ")", ";", "}", "return", "mapExpression", ";", "}", "protected", "MapEntryExpression", "mapEntryExpression", "(", "AST", "node", ")", "{", "if", "(", "node", ".", "getType", "(", ")", "==", "SPREAD_MAP_ARG", ")", "{", "AST", "rightNode", "=", "node", ".", "getFirstChild", "(", ")", ";", "Expression", "keyExpression", "=", "spreadMapExpression", "(", "node", ")", ";", "Expression", "rightExpression", "=", "expression", "(", "rightNode", ")", ";", "MapEntryExpression", "mapEntryExpression", "=", "new", "MapEntryExpression", "(", "keyExpression", ",", "rightExpression", ")", ";", "configureAST", "(", "mapEntryExpression", ",", "node", ")", ";", "return", "mapEntryExpression", ";", "}", "else", "{", "AST", "keyNode", "=", "node", ".", "getFirstChild", "(", ")", ";", "Expression", "keyExpression", "=", "expression", "(", "keyNode", ")", ";", "AST", "valueNode", "=", "keyNode", ".", "getNextSibling", "(", ")", ";", "Expression", "valueExpression", "=", "expression", "(", "valueNode", ")", ";", "MapEntryExpression", "mapEntryExpression", "=", "new", "MapEntryExpression", "(", "keyExpression", ",", "valueExpression", ")", ";", "mapEntryExpression", ".", "setStart", "(", "keyExpression", ".", "getStart", "(", ")", ")", ";", "mapEntryExpression", ".", "setLineNumber", "(", "keyExpression", ".", "getLineNumber", "(", ")", ")", ";", "mapEntryExpression", ".", "setColumnNumber", "(", "keyExpression", ".", "getColumnNumber", "(", ")", ")", ";", "mapEntryExpression", ".", "setEnd", "(", "valueExpression", ".", "getEnd", "(", ")", ")", ";", "mapEntryExpression", ".", "setLastLineNumber", "(", "valueExpression", ".", "getLastLineNumber", "(", ")", ")", ";", "mapEntryExpression", ".", "setLastColumnNumber", "(", "valueExpression", ".", "getLastColumnNumber", "(", ")", ")", ";", "configureAST", "(", "mapEntryExpression", ",", "node", ")", ";", "return", "mapEntryExpression", ";", "}", "}", "protected", "Expression", "instanceofExpression", "(", "AST", "node", ")", "{", "AST", "leftNode", "=", "node", ".", "getFirstChild", "(", ")", ";", "Expression", "leftExpression", "=", "expression", "(", "leftNode", ")", ";", "AST", "rightNode", "=", "leftNode", ".", "getNextSibling", "(", ")", ";", "ClassNode", "type", "=", "buildName", "(", "rightNode", ")", ";", "assertTypeNotNull", "(", "type", ",", "rightNode", ")", ";", "Expression", "rightExpression", "=", "new", "ClassExpression", "(", "type", ")", ";", "configureAST", "(", "rightExpression", ",", "rightNode", ")", ";", "BinaryExpression", "binaryExpression", "=", "new", "BinaryExpression", "(", "leftExpression", ",", "makeToken", "(", "Types", ".", "KEYWORD_INSTANCEOF", ",", "node", ")", ",", "rightExpression", ")", ";", "configureAST", "(", "binaryExpression", ",", "node", ")", ";", "return", "binaryExpression", ";", "}", "protected", "void", "assertTypeNotNull", "(", "ClassNode", "type", ",", "AST", "rightNode", ")", "{", "if", "(", "type", "==", "null", ")", "{", "throw", "new", "ASTRuntimeException", "(", "rightNode", ",", "\"\"", "+", "qualifiedName", "(", "rightNode", ")", ")", ";", "}", "}", "protected", "Expression", "asExpression", "(", "AST", "node", ")", "{", "AST", "leftNode", "=", "node", ".", "getFirstChild", "(", ")", ";", "Expression", "leftExpression", "=", "expression", "(", "leftNode", ")", ";", "AST", "rightNode", "=", "leftNode", ".", "getNextSibling", "(", ")", ";", "ClassNode", "type", "=", "makeTypeWithArguments", "(", "rightNode", ")", ";", "CastExpression", "asExpr", "=", "CastExpression", ".", "asExpression", "(", "type", ",", "leftExpression", ")", ";", "asExpr", ".", "setStart", "(", "leftExpression", ".", "getStart", "(", ")", ")", ";", "asExpr", ".", "setLineNumber", "(", "leftExpression", ".", "getLineNumber", "(", ")", ")", ";", "asExpr", ".", "setColumnNumber", "(", "leftExpression", ".", "getColumnNumber", "(", ")", ")", ";", "asExpr", ".", "setEnd", "(", "type", ".", "getEnd", "(", ")", ")", ";", "asExpr", ".", "setLastLineNumber", "(", "type", ".", "getLastLineNumber", "(", ")", ")", ";", "asExpr", ".", "setLastColumnNumber", "(", "type", ".", "getLastColumnNumber", "(", ")", ")", ";", "return", "asExpr", ";", "}", "protected", "Expression", "castExpression", "(", "AST", "castNode", ")", "{", "AST", "node", "=", "castNode", ".", "getFirstChild", "(", ")", ";", "ClassNode", "type", "=", "makeTypeWithArguments", "(", "node", ")", ";", "assertTypeNotNull", "(", "type", ",", "node", ")", ";", "AST", "expressionNode", "=", "node", ".", "getNextSibling", "(", ")", ";", "Expression", "expression", "=", "expression", "(", "expressionNode", ")", ";", "CastExpression", "castExpression", "=", "new", "CastExpression", "(", "type", ",", "expression", ")", ";", "configureAST", "(", "castExpression", ",", "castNode", ")", ";", "return", "castExpression", ";", "}", "protected", "Expression", "indexExpression", "(", "AST", "indexNode", ")", "{", "AST", "bracket", "=", "indexNode", ".", "getFirstChild", "(", ")", ";", "AST", "leftNode", "=", "bracket", ".", "getNextSibling", "(", ")", ";", "Expression", "leftExpression", "=", "expression", "(", "leftNode", ")", ";", "AST", "rightNode", "=", "leftNode", ".", "getNextSibling", "(", ")", ";", "Expression", "rightExpression", "=", "expression", "(", "rightNode", ")", ";", "BinaryExpression", "binaryExpression", "=", "new", "BinaryExpression", "(", "leftExpression", ",", "makeToken", "(", "Types", ".", "LEFT_SQUARE_BRACKET", ",", "bracket", ")", ",", "rightExpression", ")", ";", "configureAST", "(", "binaryExpression", ",", "indexNode", ")", ";", "return", "binaryExpression", ";", "}", "protected", "Expression", "binaryExpression", "(", "int", "type", ",", "AST", "node", ")", "{", "Token", "token", "=", "makeToken", "(", "type", ",", "node", ")", ";", "AST", "leftNode", "=", "node", ".", "getFirstChild", "(", ")", ";", "Expression", "leftExpression", "=", "expression", "(", "leftNode", ")", ";", "AST", "rightNode", "=", "leftNode", ".", "getNextSibling", "(", ")", ";", "if", "(", "rightNode", "==", "null", ")", "{", "return", "leftExpression", ";", "}", "if", "(", "Types", ".", "ofType", "(", "type", ",", "Types", ".", "ASSIGNMENT_OPERATOR", ")", ")", "{", "if", "(", "leftExpression", "instanceof", "VariableExpression", "||", "leftExpression", ".", "getClass", "(", ")", "==", "PropertyExpression", ".", "class", "||", "leftExpression", "instanceof", "FieldExpression", "||", "leftExpression", "instanceof", "AttributeExpression", "||", "leftExpression", "instanceof", "DeclarationExpression", "||", "leftExpression", "instanceof", "TupleExpression", ")", "{", "}", "else", "if", "(", "leftExpression", "instanceof", "ConstantExpression", ")", "{", "throw", "new", "ASTRuntimeException", "(", "node", ",", "\"n[\"", "+", "(", "(", "ConstantExpression", ")", "leftExpression", ")", ".", "getValue", "(", ")", "+", "\"\"", ")", ";", "}", "else", "if", "(", "leftExpression", "instanceof", "BinaryExpression", ")", "{", "Expression", "leftexp", "=", "(", "(", "BinaryExpression", ")", "leftExpression", ")", ".", "getLeftExpression", "(", ")", ";", "int", "lefttype", "=", "(", "(", "BinaryExpression", ")", "leftExpression", ")", ".", "getOperation", "(", ")", ".", "getType", "(", ")", ";", "if", "(", "!", "Types", ".", "ofType", "(", "lefttype", ",", "Types", ".", "ASSIGNMENT_OPERATOR", ")", "&&", "lefttype", "!=", "Types", ".", "LEFT_SQUARE_BRACKET", ")", "{", "throw", "new", "ASTRuntimeException", "(", "node", ",", "\"n\"", "+", "(", "(", "BinaryExpression", ")", "leftExpression", ")", ".", "getText", "(", ")", "+", "\"\"", ")", ";", "}", "}", "else", "if", "(", "leftExpression", "instanceof", "GStringExpression", ")", "{", "throw", "new", "ASTRuntimeException", "(", "node", ",", "\"n\\\"\"", "+", "(", "(", "GStringExpression", ")", "leftExpression", ")", ".", "getText", "(", ")", "+", "\"\"", ")", ";", "}", "else", "if", "(", "leftExpression", "instanceof", "MethodCallExpression", ")", "{", "throw", "new", "ASTRuntimeException", "(", "node", ",", "\"n\\\"\"", "+", "(", "(", "MethodCallExpression", ")", "leftExpression", ")", ".", "getText", "(", ")", "+", "\"\"", ")", ";", "}", "else", "if", "(", "leftExpression", "instanceof", "MapExpression", ")", "{", "throw", "new", "ASTRuntimeException", "(", "node", ",", "\"n'\"", "+", "(", "(", "MapExpression", ")", "leftExpression", ")", ".", "getText", "(", ")", "+", "\"\"", ")", ";", "}", "else", "{", "throw", "new", "ASTRuntimeException", "(", "node", ",", "\"n\"", "+", "leftExpression", ".", "getClass", "(", ")", "+", "\"\"", "+", "leftExpression", ".", "getText", "(", ")", "+", "\"\"", ")", ";", "}", "}", "Expression", "rightExpression", "=", "expression", "(", "rightNode", ")", ";", "BinaryExpression", "binaryExpression", "=", "new", "BinaryExpression", "(", "leftExpression", ",", "token", ",", "rightExpression", ")", ";", "binaryExpression", ".", "setStart", "(", "leftExpression", ".", "getStart", "(", ")", ")", ";", "binaryExpression", ".", "setLineNumber", "(", "leftExpression", ".", "getLineNumber", "(", ")", ")", ";", "binaryExpression", ".", "setColumnNumber", "(", "leftExpression", ".", "getColumnNumber", "(", ")", ")", ";", "binaryExpression", ".", "setEnd", "(", "rightExpression", ".", "getEnd", "(", ")", ")", ";", "binaryExpression", ".", "setLastLineNumber", "(", "rightExpression", ".", "getLastLineNumber", "(", ")", ")", ";", "binaryExpression", ".", "setLastColumnNumber", "(", "rightExpression", ".", "getLastColumnNumber", "(", ")", ")", ";", "return", "binaryExpression", ";", "}", "protected", "Expression", "prefixExpression", "(", "AST", "node", ",", "int", "token", ")", "{", "Expression", "expression", "=", "expression", "(", "node", ".", "getFirstChild", "(", ")", ")", ";", "PrefixExpression", "prefixExpression", "=", "new", "PrefixExpression", "(", "makeToken", "(", "token", ",", "node", ")", ",", "expression", ")", ";", "configureAST", "(", "prefixExpression", ",", "node", ")", ";", "return", "prefixExpression", ";", "}", "protected", "Expression", "postfixExpression", "(", "AST", "node", ",", "int", "token", ")", "{", "Expression", "expression", "=", "expression", "(", "node", ".", "getFirstChild", "(", ")", ")", ";", "PostfixExpression", "postfixExpression", "=", "new", "PostfixExpression", "(", "expression", ",", "makeToken", "(", "token", ",", "node", ")", ")", ";", "configureAST", "(", "postfixExpression", ",", "node", ")", ";", "return", "postfixExpression", ";", "}", "protected", "BooleanExpression", "booleanExpression", "(", "AST", "node", ")", "{", "BooleanExpression", "booleanExpression", "=", "new", "BooleanExpression", "(", "expression", "(", "node", ")", ")", ";", "configureAST", "(", "booleanExpression", ",", "node", ")", ";", "return", "booleanExpression", ";", "}", "protected", "Expression", "dotExpression", "(", "AST", "node", ")", "{", "AST", "leftNode", "=", "node", ".", "getFirstChild", "(", ")", ";", "if", "(", "leftNode", "!=", "null", ")", "{", "AST", "identifierNode", "=", "leftNode", ".", "getNextSibling", "(", ")", ";", "if", "(", "identifierNode", "!=", "null", ")", "{", "Expression", "leftExpression", "=", "expression", "(", "leftNode", ")", ";", "if", "(", "isType", "(", "SELECT_SLOT", ",", "identifierNode", ")", ")", "{", "Expression", "field", "=", "expression", "(", "identifierNode", ".", "getFirstChild", "(", ")", ",", "true", ")", ";", "AttributeExpression", "attributeExpression", "=", "new", "AttributeExpression", "(", "leftExpression", ",", "field", ",", "node", ".", "getType", "(", ")", "!=", "DOT", ")", ";", "if", "(", "node", ".", "getType", "(", ")", "==", "SPREAD_DOT", ")", "{", "attributeExpression", ".", "setSpreadSafe", "(", "true", ")", ";", "}", "configureAST", "(", "attributeExpression", ",", "node", ")", ";", "return", "attributeExpression", ";", "}", "if", "(", "isType", "(", "SLIST", ",", "identifierNode", ")", ")", "{", "Statement", "code", "=", "statementList", "(", "identifierNode", ")", ";", "ClosureExpression", "closureExpression", "=", "new", "ClosureExpression", "(", "Parameter", ".", "EMPTY_ARRAY", ",", "code", ")", ";", "configureAST", "(", "closureExpression", ",", "identifierNode", ")", ";", "final", "PropertyExpression", "propertyExpression", "=", "new", "PropertyExpression", "(", "leftExpression", ",", "closureExpression", ")", ";", "if", "(", "node", ".", "getType", "(", ")", "==", "SPREAD_DOT", ")", "{", "propertyExpression", ".", "setSpreadSafe", "(", "true", ")", ";", "}", "configureAST", "(", "propertyExpression", ",", "node", ")", ";", "return", "propertyExpression", ";", "}", "Expression", "property", "=", "expression", "(", "identifierNode", ",", "true", ")", ";", "if", "(", "property", "instanceof", "VariableExpression", ")", "{", "VariableExpression", "ve", "=", "(", "VariableExpression", ")", "property", ";", "property", "=", "new", "ConstantExpression", "(", "ve", ".", "getName", "(", ")", ")", ";", "}", "PropertyExpression", "propertyExpression", "=", "new", "PropertyExpression", "(", "leftExpression", ",", "property", ",", "node", ".", "getType", "(", ")", "!=", "DOT", ")", ";", "if", "(", "node", ".", "getType", "(", ")", "==", "SPREAD_DOT", ")", "{", "propertyExpression", ".", "setSpreadSafe", "(", "true", ")", ";", "}", "configureAST", "(", "propertyExpression", ",", "node", ")", ";", "return", "propertyExpression", ";", "}", "}", "return", "methodCallExpression", "(", "node", ")", ";", "}", "protected", "Expression", "specialConstructorCallExpression", "(", "AST", "methodCallNode", ",", "ClassNode", "special", ")", "{", "AST", "node", "=", "methodCallNode", ".", "getFirstChild", "(", ")", ";", "Expression", "arguments", "=", "arguments", "(", "node", ")", ";", "ConstructorCallExpression", "expression", "=", "new", "ConstructorCallExpression", "(", "special", ",", "arguments", ")", ";", "configureAST", "(", "expression", ",", "methodCallNode", ")", ";", "return", "expression", ";", "}", "private", "int", "getTypeInParenthesis", "(", "AST", "node", ")", "{", "if", "(", "!", "isType", "(", "EXPR", ",", "node", ")", ")", "node", "=", "node", ".", "getFirstChild", "(", ")", ";", "while", "(", "node", "!=", "null", "&&", "isType", "(", "EXPR", ",", "node", ")", "&&", "node", ".", "getNextSibling", "(", ")", "==", "null", ")", "{", "node", "=", "node", ".", "getFirstChild", "(", ")", ";", "}", "if", "(", "node", "==", "null", ")", "return", "-", "1", ";", "return", "node", ".", "getType", "(", ")", ";", "}", "protected", "Expression", "methodCallExpression", "(", "AST", "methodCallNode", ")", "{", "AST", "node", "=", "methodCallNode", ".", "getFirstChild", "(", ")", ";", "Expression", "objectExpression", ";", "AST", "selector", ";", "AST", "elist", "=", "node", ".", "getNextSibling", "(", ")", ";", "List", "<", "GenericsType", ">", "typeArgumentList", "=", "null", ";", "boolean", "implicitThis", "=", "false", ";", "boolean", "safe", "=", "isType", "(", "OPTIONAL_DOT", ",", "node", ")", ";", "boolean", "spreadSafe", "=", "isType", "(", "SPREAD_DOT", ",", "node", ")", ";", "if", "(", "isType", "(", "DOT", ",", "node", ")", "||", "safe", "||", "spreadSafe", ")", "{", "AST", "objectNode", "=", "node", ".", "getFirstChild", "(", ")", ";", "objectExpression", "=", "expression", "(", "objectNode", ")", ";", "selector", "=", "objectNode", ".", "getNextSibling", "(", ")", ";", "}", "else", "{", "implicitThis", "=", "true", ";", "objectExpression", "=", "VariableExpression", ".", "THIS_EXPRESSION", ";", "selector", "=", "node", ";", "}", "if", "(", "isType", "(", "TYPE_ARGUMENTS", ",", "selector", ")", ")", "{", "typeArgumentList", "=", "getTypeArgumentsList", "(", "selector", ")", ";", "selector", "=", "selector", ".", "getNextSibling", "(", ")", ";", "}", "Expression", "name", "=", "null", ";", "if", "(", "isType", "(", "LITERAL_super", ",", "selector", ")", ")", "{", "implicitThis", "=", "true", ";", "name", "=", "new", "ConstantExpression", "(", "\"super\"", ")", ";", "if", "(", "objectExpression", "instanceof", "VariableExpression", "&&", "(", "(", "VariableExpression", ")", "objectExpression", ")", ".", "isThisExpression", "(", ")", ")", "{", "objectExpression", "=", "VariableExpression", ".", "SUPER_EXPRESSION", ";", "}", "}", "else", "if", "(", "isPrimitiveTypeLiteral", "(", "selector", ")", ")", "{", "throw", "new", "ASTRuntimeException", "(", "selector", ",", "\"\"", "+", "selector", ".", "getText", "(", ")", "+", "\"\"", ")", ";", "}", "else", "if", "(", "isType", "(", "SELECT_SLOT", ",", "selector", ")", ")", "{", "Expression", "field", "=", "expression", "(", "selector", ".", "getFirstChild", "(", ")", ",", "true", ")", ";", "AttributeExpression", "attributeExpression", "=", "new", "AttributeExpression", "(", "objectExpression", ",", "field", ",", "node", ".", "getType", "(", ")", "!=", "DOT", ")", ";", "configureAST", "(", "attributeExpression", ",", "node", ")", ";", "Expression", "arguments", "=", "arguments", "(", "elist", ")", ";", "MethodCallExpression", "expression", "=", "new", "MethodCallExpression", "(", "attributeExpression", ",", "\"call\"", ",", "arguments", ")", ";", "setTypeArgumentsOnMethodCallExpression", "(", "expression", ",", "typeArgumentList", ")", ";", "configureAST", "(", "expression", ",", "methodCallNode", ")", ";", "return", "expression", ";", "}", "else", "if", "(", "!", "implicitThis", "||", "isType", "(", "DYNAMIC_MEMBER", ",", "selector", ")", "||", "isType", "(", "IDENT", ",", "selector", ")", "||", "isType", "(", "STRING_CONSTRUCTOR", ",", "selector", ")", "||", "isType", "(", "STRING_LITERAL", ",", "selector", ")", ")", "{", "name", "=", "expression", "(", "selector", ",", "true", ")", ";", "}", "else", "{", "implicitThis", "=", "false", ";", "name", "=", "new", "ConstantExpression", "(", "\"call\"", ")", ";", "objectExpression", "=", "expression", "(", "selector", ",", "true", ")", ";", "}", "if", "(", "selector", ".", "getText", "(", ")", ".", "equals", "(", "\"this\"", ")", "||", "selector", ".", "getText", "(", ")", ".", "equals", "(", "\"super\"", ")", ")", "{", "throw", "new", "ASTRuntimeException", "(", "elist", ",", "\"\"", ")", ";", "}", "Expression", "arguments", "=", "arguments", "(", "elist", ")", ";", "MethodCallExpression", "expression", "=", "new", "MethodCallExpression", "(", "objectExpression", ",", "name", ",", "arguments", ")", ";", "expression", ".", "setSafe", "(", "safe", ")", ";", "expression", ".", "setSpreadSafe", "(", "spreadSafe", ")", ";", "expression", ".", "setImplicitThis", "(", "implicitThis", ")", ";", "setTypeArgumentsOnMethodCallExpression", "(", "expression", ",", "typeArgumentList", ")", ";", "Expression", "ret", "=", "expression", ";", "if", "(", "implicitThis", "&&", "\"this\"", ".", "equals", "(", "expression", ".", "getMethodAsString", "(", ")", ")", ")", "{", "ret", "=", "new", "ConstructorCallExpression", "(", "this", ".", "classNode", ",", "arguments", ")", ";", "}", "if", "(", "!", "implicitThis", "&&", "methodCallNode", ".", "getText", "(", ")", ".", "equals", "(", "\"<command>\"", ")", ")", "{", "ret", ".", "setStart", "(", "objectExpression", ".", "getStart", "(", ")", ")", ";", "ret", ".", "setLineNumber", "(", "objectExpression", ".", "getLineNumber", "(", ")", ")", ";", "ret", ".", "setColumnNumber", "(", "objectExpression", ".", "getColumnNumber", "(", ")", ")", ";", "ret", ".", "setEnd", "(", "arguments", ".", "getEnd", "(", ")", ")", ";", "ret", ".", "setLastLineNumber", "(", "arguments", ".", "getLastLineNumber", "(", ")", ")", ";", "ret", ".", "setLastColumnNumber", "(", "arguments", ".", "getLastColumnNumber", "(", ")", ")", ";", "}", "configureAST", "(", "ret", ",", "methodCallNode", ")", ";", "return", "ret", ";", "}", "private", "void", "setTypeArgumentsOnMethodCallExpression", "(", "MethodCallExpression", "expression", ",", "List", "<", "GenericsType", ">", "typeArgumentList", ")", "{", "if", "(", "typeArgumentList", "!=", "null", "&&", "typeArgumentList", ".", "size", "(", ")", ">", "0", ")", "{", "expression", ".", "setGenericsTypes", "(", "typeArgumentList", ".", "toArray", "(", "new", "GenericsType", "[", "typeArgumentList", ".", "size", "(", ")", "]", ")", ")", ";", "}", "}", "protected", "Expression", "constructorCallExpression", "(", "AST", "node", ")", "{", "AST", "constructorCallNode", "=", "node", ";", "ClassNode", "type", "=", "makeTypeWithArguments", "(", "constructorCallNode", ")", ";", "if", "(", "isType", "(", "CTOR_CALL", ",", "node", ")", "||", "isType", "(", "LITERAL_new", ",", "node", ")", ")", "{", "node", "=", "node", ".", "getFirstChild", "(", ")", ";", "}", "if", "(", "node", "==", "null", ")", "{", "return", "new", "ConstructorCallExpression", "(", "ClassHelper", ".", "OBJECT_TYPE", ",", "new", "ArgumentListExpression", "(", ")", ")", ";", "}", "AST", "elist", "=", "node", ".", "getNextSibling", "(", ")", ";", "if", "(", "elist", "==", "null", "&&", "isType", "(", "ELIST", ",", "node", ")", ")", "{", "elist", "=", "node", ";", "if", "(", "\"(\"", ".", "equals", "(", "type", ".", "getName", "(", ")", ")", ")", "{", "type", "=", "classNode", ";", "}", "}", "if", "(", "isType", "(", "ARRAY_DECLARATOR", ",", "elist", ")", ")", "{", "AST", "expressionNode", "=", "elist", ".", "getFirstChild", "(", ")", ";", "if", "(", "expressionNode", "==", "null", ")", "{", "throw", "new", "ASTRuntimeException", "(", "elist", ",", "\"\"", ")", ";", "}", "List", "size", "=", "arraySizeExpression", "(", "expressionNode", ")", ";", "ArrayExpression", "arrayExpression", "=", "new", "ArrayExpression", "(", "type", ",", "null", ",", "size", ")", ";", "configureAST", "(", "arrayExpression", ",", "constructorCallNode", ")", ";", "return", "arrayExpression", ";", "}", "Expression", "arguments", "=", "arguments", "(", "elist", ")", ";", "ClassNode", "innerClass", "=", "getAnonymousInnerClassNode", "(", "arguments", ")", ";", "ConstructorCallExpression", "ret", "=", "new", "ConstructorCallExpression", "(", "type", ",", "arguments", ")", ";", "if", "(", "innerClass", "!=", "null", ")", "{", "ret", ".", "setType", "(", "innerClass", ")", ";", "ret", ".", "setUsingAnonymousInnerClass", "(", "true", ")", ";", "innerClass", ".", "setUnresolvedSuperClass", "(", "type", ")", ";", "}", "configureAST", "(", "ret", ",", "constructorCallNode", ")", ";", "return", "ret", ";", "}", "private", "ClassNode", "getAnonymousInnerClassNode", "(", "Expression", "arguments", ")", "{", "if", "(", "arguments", "instanceof", "TupleExpression", ")", "{", "TupleExpression", "te", "=", "(", "TupleExpression", ")", "arguments", ";", "List", "<", "Expression", ">", "expressions", "=", "te", ".", "getExpressions", "(", ")", ";", "if", "(", "expressions", ".", "size", "(", ")", "==", "0", ")", "return", "null", ";", "Expression", "last", "=", "(", "Expression", ")", "expressions", ".", "remove", "(", "expressions", ".", "size", "(", ")", "-", "1", ")", ";", "if", "(", "last", "instanceof", "AnonymousInnerClassCarrier", ")", "{", "AnonymousInnerClassCarrier", "carrier", "=", "(", "AnonymousInnerClassCarrier", ")", "last", ";", "return", "carrier", ".", "innerClass", ";", "}", "else", "{", "expressions", ".", "add", "(", "last", ")", ";", "}", "}", "else", "if", "(", "arguments", "instanceof", "AnonymousInnerClassCarrier", ")", "{", "AnonymousInnerClassCarrier", "carrier", "=", "(", "AnonymousInnerClassCarrier", ")", "arguments", ";", "return", "carrier", ".", "innerClass", ";", "}", "return", "null", ";", "}", "protected", "List", "arraySizeExpression", "(", "AST", "node", ")", "{", "List", "list", ";", "Expression", "size", "=", "null", ";", "if", "(", "isType", "(", "ARRAY_DECLARATOR", ",", "node", ")", ")", "{", "AST", "right", "=", "node", ".", "getNextSibling", "(", ")", ";", "if", "(", "right", "!=", "null", ")", "{", "size", "=", "expression", "(", "right", ")", ";", "}", "else", "{", "size", "=", "ConstantExpression", ".", "EMPTY_EXPRESSION", ";", "}", "list", "=", "arraySizeExpression", "(", "node", ".", "getFirstChild", "(", ")", ")", ";", "}", "else", "{", "size", "=", "expression", "(", "node", ")", ";", "list", "=", "new", "ArrayList", "(", ")", ";", "}", "list", ".", "add", "(", "size", ")", ";", "return", "list", ";", "}", "protected", "Expression", "arguments", "(", "AST", "elist", ")", "{", "List", "expressionList", "=", "new", "ArrayList", "(", ")", ";", "boolean", "namedArguments", "=", "false", ";", "for", "(", "AST", "node", "=", "elist", ";", "node", "!=", "null", ";", "node", "=", "node", ".", "getNextSibling", "(", ")", ")", "{", "if", "(", "isType", "(", "ELIST", ",", "node", ")", ")", "{", "for", "(", "AST", "child", "=", "node", ".", "getFirstChild", "(", ")", ";", "child", "!=", "null", ";", "child", "=", "child", ".", "getNextSibling", "(", ")", ")", "{", "namedArguments", "|=", "addArgumentExpression", "(", "child", ",", "expressionList", ")", ";", "}", "}", "else", "{", "namedArguments", "|=", "addArgumentExpression", "(", "node", ",", "expressionList", ")", ";", "}", "}", "if", "(", "namedArguments", ")", "{", "if", "(", "!", "expressionList", ".", "isEmpty", "(", ")", ")", "{", "List", "<", "Expression", ">", "argumentList", "=", "new", "ArrayList", "<", "Expression", ">", "(", ")", ";", "for", "(", "Object", "next", ":", "expressionList", ")", "{", "Expression", "expression", "=", "(", "Expression", ")", "next", ";", "if", "(", "!", "(", "expression", "instanceof", "MapEntryExpression", ")", ")", "{", "argumentList", ".", "add", "(", "expression", ")", ";", "}", "}", "if", "(", "!", "argumentList", ".", "isEmpty", "(", ")", ")", "{", "expressionList", ".", "removeAll", "(", "argumentList", ")", ";", "checkDuplicateNamedParams", "(", "elist", ",", "expressionList", ")", ";", "MapExpression", "mapExpression", "=", "new", "MapExpression", "(", "expressionList", ")", ";", "configureAST", "(", "mapExpression", ",", "elist", ")", ";", "argumentList", ".", "add", "(", "0", ",", "mapExpression", ")", ";", "ArgumentListExpression", "argumentListExpression", "=", "new", "ArgumentListExpression", "(", "argumentList", ")", ";", "configureAST", "(", "argumentListExpression", ",", "elist", ")", ";", "return", "argumentListExpression", ";", "}", "}", "checkDuplicateNamedParams", "(", "elist", ",", "expressionList", ")", ";", "NamedArgumentListExpression", "namedArgumentListExpression", "=", "new", "NamedArgumentListExpression", "(", "expressionList", ")", ";", "configureAST", "(", "namedArgumentListExpression", ",", "elist", ")", ";", "return", "namedArgumentListExpression", ";", "}", "else", "{", "ArgumentListExpression", "argumentListExpression", "=", "new", "ArgumentListExpression", "(", "expressionList", ")", ";", "if", "(", "elist", "!=", "null", ")", "{", "configureAST", "(", "argumentListExpression", ",", "elist", ")", ";", "}", "return", "argumentListExpression", ";", "}", "}", "private", "void", "checkDuplicateNamedParams", "(", "AST", "elist", ",", "List", "expressionList", ")", "{", "if", "(", "expressionList", ".", "isEmpty", "(", ")", ")", "return", ";", "Set", "<", "String", ">", "namedArgumentNames", "=", "new", "HashSet", "<", "String", ">", "(", ")", ";", "for", "(", "Object", "expression", ":", "expressionList", ")", "{", "MapEntryExpression", "meExp", "=", "(", "MapEntryExpression", ")", "expression", ";", "if", "(", "meExp", ".", "getKeyExpression", "(", ")", "instanceof", "ConstantExpression", ")", "{", "String", "argName", "=", "meExp", ".", "getKeyExpression", "(", ")", ".", "getText", "(", ")", ";", "if", "(", "!", "namedArgumentNames", ".", "contains", "(", "argName", ")", ")", "{", "namedArgumentNames", ".", "add", "(", "argName", ")", ";", "}", "else", "{", "throw", "new", "ASTRuntimeException", "(", "elist", ",", "\"\"", "+", "argName", "+", "\"'", "found.\"", ")", ";", "}", "}", "}", "}", "protected", "boolean", "addArgumentExpression", "(", "AST", "node", ",", "List", "<", "Expression", ">", "expressionList", ")", "{", "if", "(", "node", ".", "getType", "(", ")", "==", "SPREAD_MAP_ARG", ")", "{", "AST", "rightNode", "=", "node", ".", "getFirstChild", "(", ")", ";", "Expression", "keyExpression", "=", "spreadMapExpression", "(", "node", ")", ";", "Expression", "rightExpression", "=", "expression", "(", "rightNode", ")", ";", "MapEntryExpression", "mapEntryExpression", "=", "new", "MapEntryExpression", "(", "keyExpression", ",", "rightExpression", ")", ";", "expressionList", ".", "add", "(", "mapEntryExpression", ")", ";", "return", "true", ";", "}", "else", "{", "Expression", "expression", "=", "expression", "(", "node", ")", ";", "expressionList", ".", "add", "(", "expression", ")", ";", "return", "expression", "instanceof", "MapEntryExpression", ";", "}", "}", "protected", "Expression", "expressionList", "(", "AST", "node", ")", "{", "List", "<", "Expression", ">", "expressionList", "=", "new", "ArrayList", "<", "Expression", ">", "(", ")", ";", "for", "(", "AST", "child", "=", "node", ".", "getFirstChild", "(", ")", ";", "child", "!=", "null", ";", "child", "=", "child", ".", "getNextSibling", "(", ")", ")", "{", "expressionList", ".", "add", "(", "expression", "(", "child", ")", ")", ";", "}", "if", "(", "expressionList", ".", "size", "(", ")", "==", "1", ")", "{", "return", "expressionList", ".", "get", "(", "0", ")", ";", "}", "else", "{", "ListExpression", "listExpression", "=", "new", "ListExpression", "(", "expressionList", ")", ";", "listExpression", ".", "setWrapped", "(", "true", ")", ";", "configureAST", "(", "listExpression", ",", "node", ")", ";", "return", "listExpression", ";", "}", "}", "protected", "ClosureExpression", "closureExpression", "(", "AST", "node", ")", "{", "AST", "paramNode", "=", "node", ".", "getFirstChild", "(", ")", ";", "Parameter", "[", "]", "parameters", "=", "null", ";", "AST", "codeNode", "=", "paramNode", ";", "if", "(", "isType", "(", "PARAMETERS", ",", "paramNode", ")", "||", "isType", "(", "IMPLICIT_PARAMETERS", ",", "paramNode", ")", ")", "{", "parameters", "=", "parameters", "(", "paramNode", ")", ";", "codeNode", "=", "paramNode", ".", "getNextSibling", "(", ")", ";", "}", "Statement", "code", "=", "statementListNoChild", "(", "codeNode", ",", "node", ")", ";", "ClosureExpression", "closureExpression", "=", "new", "ClosureExpression", "(", "parameters", ",", "code", ")", ";", "configureAST", "(", "closureExpression", ",", "node", ")", ";", "return", "closureExpression", ";", "}", "protected", "Expression", "blockExpression", "(", "AST", "node", ")", "{", "AST", "codeNode", "=", "node", ".", "getFirstChild", "(", ")", ";", "if", "(", "codeNode", "==", "null", ")", "return", "ConstantExpression", ".", "NULL", ";", "if", "(", "codeNode", ".", "getType", "(", ")", "==", "EXPR", "&&", "codeNode", ".", "getNextSibling", "(", ")", "==", "null", ")", "{", "return", "expression", "(", "codeNode", ")", ";", "}", "Parameter", "[", "]", "parameters", "=", "Parameter", ".", "EMPTY_ARRAY", ";", "Statement", "code", "=", "statementListNoChild", "(", "codeNode", ",", "node", ")", ";", "ClosureExpression", "closureExpression", "=", "new", "ClosureExpression", "(", "parameters", ",", "code", ")", ";", "configureAST", "(", "closureExpression", ",", "node", ")", ";", "String", "callName", "=", "\"call\"", ";", "Expression", "noArguments", "=", "new", "ArgumentListExpression", "(", ")", ";", "MethodCallExpression", "call", "=", "new", "MethodCallExpression", "(", "closureExpression", ",", "callName", ",", "noArguments", ")", ";", "configureAST", "(", "call", ",", "node", ")", ";", "return", "call", ";", "}", "protected", "Expression", "unaryMinusExpression", "(", "AST", "unaryMinusExpr", ")", "{", "AST", "node", "=", "unaryMinusExpr", ".", "getFirstChild", "(", ")", ";", "String", "text", "=", "node", ".", "getText", "(", ")", ";", "switch", "(", "node", ".", "getType", "(", ")", ")", "{", "case", "NUM_DOUBLE", ":", "case", "NUM_FLOAT", ":", "case", "NUM_BIG_DECIMAL", ":", "ConstantExpression", "constantExpression", "=", "new", "ConstantExpression", "(", "Numbers", ".", "parseDecimal", "(", "\"-\"", "+", "text", ")", ")", ";", "configureAST", "(", "constantExpression", ",", "unaryMinusExpr", ")", ";", "return", "constantExpression", ";", "case", "NUM_BIG_INT", ":", "case", "NUM_INT", ":", "case", "NUM_LONG", ":", "ConstantExpression", "constantLongExpression", "=", "new", "ConstantExpression", "(", "Numbers", ".", "parseInteger", "(", "\"-\"", "+", "text", ")", ")", ";", "configureAST", "(", "constantLongExpression", ",", "unaryMinusExpr", ")", ";", "return", "constantLongExpression", ";", "default", ":", "UnaryMinusExpression", "unaryMinusExpression", "=", "new", "UnaryMinusExpression", "(", "expression", "(", "node", ")", ")", ";", "configureAST", "(", "unaryMinusExpression", ",", "unaryMinusExpr", ")", ";", "return", "unaryMinusExpression", ";", "}", "}", "protected", "Expression", "unaryPlusExpression", "(", "AST", "unaryPlusExpr", ")", "{", "AST", "node", "=", "unaryPlusExpr", ".", "getFirstChild", "(", ")", ";", "switch", "(", "node", ".", "getType", "(", ")", ")", "{", "case", "NUM_DOUBLE", ":", "case", "NUM_FLOAT", ":", "case", "NUM_BIG_DECIMAL", ":", "case", "NUM_BIG_INT", ":", "case", "NUM_INT", ":", "case", "NUM_LONG", ":", "return", "expression", "(", "node", ")", ";", "default", ":", "UnaryPlusExpression", "unaryPlusExpression", "=", "new", "UnaryPlusExpression", "(", "expression", "(", "node", ")", ")", ";", "configureAST", "(", "unaryPlusExpression", ",", "unaryPlusExpr", ")", ";", "return", "unaryPlusExpression", ";", "}", "}", "protected", "ConstantExpression", "decimalExpression", "(", "AST", "node", ")", "{", "String", "text", "=", "node", ".", "getText", "(", ")", ";", "Object", "number", "=", "Numbers", ".", "parseDecimal", "(", "text", ")", ";", "ConstantExpression", "constantExpression", "=", "new", "ConstantExpression", "(", "number", ",", "number", "instanceof", "Double", ")", ";", "configureAST", "(", "constantExpression", ",", "node", ")", ";", "return", "constantExpression", ";", "}", "protected", "ConstantExpression", "integerExpression", "(", "AST", "node", ")", "{", "String", "text", "=", "node", ".", "getText", "(", ")", ";", "Object", "number", "=", "Numbers", ".", "parseInteger", "(", "text", ")", ";", "ConstantExpression", "constantExpression", "=", "new", "ConstantExpression", "(", "number", ",", "number", "instanceof", "Integer", ")", ";", "configureAST", "(", "constantExpression", ",", "node", ")", ";", "return", "constantExpression", ";", "}", "protected", "Expression", "gstring", "(", "AST", "gstringNode", ")", "{", "List", "strings", "=", "new", "ArrayList", "(", ")", ";", "List", "values", "=", "new", "ArrayList", "(", ")", ";", "StringBuffer", "buffer", "=", "new", "StringBuffer", "(", ")", ";", "boolean", "isPrevString", "=", "false", ";", "for", "(", "AST", "node", "=", "gstringNode", ".", "getFirstChild", "(", ")", ";", "node", "!=", "null", ";", "node", "=", "node", ".", "getNextSibling", "(", ")", ")", "{", "int", "type", "=", "node", ".", "getType", "(", ")", ";", "String", "text", "=", "null", ";", "switch", "(", "type", ")", "{", "case", "STRING_LITERAL", ":", "if", "(", "isPrevString", ")", "assertNodeType", "(", "IDENT", ",", "node", ")", ";", "isPrevString", "=", "true", ";", "text", "=", "node", ".", "getText", "(", ")", ";", "ConstantExpression", "constantExpression", "=", "new", "ConstantExpression", "(", "text", ")", ";", "configureAST", "(", "constantExpression", ",", "node", ")", ";", "strings", ".", "add", "(", "constantExpression", ")", ";", "buffer", ".", "append", "(", "text", ")", ";", "break", ";", "default", ":", "{", "if", "(", "!", "isPrevString", ")", "assertNodeType", "(", "IDENT", ",", "node", ")", ";", "isPrevString", "=", "false", ";", "Expression", "expression", "=", "expression", "(", "node", ")", ";", "values", ".", "add", "(", "expression", ")", ";", "buffer", ".", "append", "(", "\"$\"", ")", ";", "buffer", ".", "append", "(", "expression", ".", "getText", "(", ")", ")", ";", "}", "break", ";", "}", "}", "GStringExpression", "gStringExpression", "=", "new", "GStringExpression", "(", "buffer", ".", "toString", "(", ")", ",", "strings", ",", "values", ")", ";", "configureAST", "(", "gStringExpression", ",", "gstringNode", ")", ";", "return", "gStringExpression", ";", "}", "protected", "ClassNode", "type", "(", "AST", "typeNode", ")", "{", "return", "buildName", "(", "typeNode", ".", "getFirstChild", "(", ")", ")", ";", "}", "public", "static", "String", "qualifiedName", "(", "AST", "qualifiedNameNode", ")", "{", "if", "(", "isType", "(", "IDENT", ",", "qualifiedNameNode", ")", ")", "{", "return", "qualifiedNameNode", ".", "getText", "(", ")", ";", "}", "if", "(", "isType", "(", "DOT", ",", "qualifiedNameNode", ")", ")", "{", "AST", "node", "=", "qualifiedNameNode", ".", "getFirstChild", "(", ")", ";", "StringBuffer", "buffer", "=", "new", "StringBuffer", "(", ")", ";", "boolean", "first", "=", "true", ";", "for", "(", ";", "node", "!=", "null", "&&", "!", "isType", "(", "TYPE_ARGUMENTS", ",", "node", ")", ";", "node", "=", "node", ".", "getNextSibling", "(", ")", ")", "{", "if", "(", "first", ")", "{", "first", "=", "false", ";", "}", "else", "{", "buffer", ".", "append", "(", "\".\"", ")", ";", "}", "buffer", ".", "append", "(", "qualifiedName", "(", "node", ")", ")", ";", "}", "return", "buffer", ".", "toString", "(", ")", ";", "}", "else", "{", "return", "qualifiedNameNode", ".", "getText", "(", ")", ";", "}", "}", "private", "static", "AST", "getTypeArgumentsNode", "(", "AST", "root", ")", "{", "while", "(", "root", "!=", "null", "&&", "!", "isType", "(", "TYPE_ARGUMENTS", ",", "root", ")", ")", "{", "root", "=", "root", ".", "getNextSibling", "(", ")", ";", "}", "return", "root", ";", "}", "private", "int", "getBoundType", "(", "AST", "node", ")", "{", "if", "(", "node", "==", "null", ")", "return", "-", "1", ";", "if", "(", "isType", "(", "TYPE_UPPER_BOUNDS", ",", "node", ")", ")", "return", "TYPE_UPPER_BOUNDS", ";", "if", "(", "isType", "(", "TYPE_LOWER_BOUNDS", ",", "node", ")", ")", "return", "TYPE_LOWER_BOUNDS", ";", "throw", "new", "ASTRuntimeException", "(", "node", ",", "\"\"", "+", "getTokenName", "(", "node", ")", "+", "\"\"", "+", "getTokenName", "(", "TYPE_UPPER_BOUNDS", ")", "+", "\"", "or", "type:", "\"", "+", "getTokenName", "(", "TYPE_LOWER_BOUNDS", ")", ")", ";", "}", "private", "GenericsType", "makeGenericsArgumentType", "(", "AST", "typeArgument", ")", "{", "GenericsType", "gt", ";", "AST", "rootNode", "=", "typeArgument", ".", "getFirstChild", "(", ")", ";", "if", "(", "isType", "(", "WILDCARD_TYPE", ",", "rootNode", ")", ")", "{", "ClassNode", "base", "=", "ClassHelper", ".", "makeWithoutCaching", "(", "\"?\"", ")", ";", "if", "(", "rootNode", ".", "getNextSibling", "(", ")", "!=", "null", ")", "{", "int", "boundType", "=", "getBoundType", "(", "rootNode", ".", "getNextSibling", "(", ")", ")", ";", "ClassNode", "[", "]", "gts", "=", "makeGenericsBounds", "(", "rootNode", ",", "boundType", ")", ";", "if", "(", "boundType", "==", "TYPE_UPPER_BOUNDS", ")", "{", "gt", "=", "new", "GenericsType", "(", "base", ",", "gts", ",", "null", ")", ";", "}", "else", "{", "gt", "=", "new", "GenericsType", "(", "base", ",", "null", ",", "gts", "[", "0", "]", ")", ";", "}", "}", "else", "{", "gt", "=", "new", "GenericsType", "(", "base", ",", "null", ",", "null", ")", ";", "}", "gt", ".", "setName", "(", "\"?\"", ")", ";", "gt", ".", "setWildcard", "(", "true", ")", ";", "}", "else", "{", "ClassNode", "argument", "=", "makeTypeWithArguments", "(", "rootNode", ")", ";", "gt", "=", "new", "GenericsType", "(", "argument", ")", ";", "}", "configureAST", "(", "gt", ",", "typeArgument", ")", ";", "return", "gt", ";", "}", "protected", "ClassNode", "makeTypeWithArguments", "(", "AST", "rootNode", ")", "{", "ClassNode", "basicType", "=", "makeType", "(", "rootNode", ")", ";", "AST", "node", "=", "rootNode", ".", "getFirstChild", "(", ")", ";", "if", "(", "node", "==", "null", "||", "isType", "(", "INDEX_OP", ",", "node", ")", "||", "isType", "(", "ARRAY_DECLARATOR", ",", "node", ")", ")", "return", "basicType", ";", "if", "(", "!", "isType", "(", "DOT", ",", "node", ")", ")", "{", "node", "=", "node", ".", "getFirstChild", "(", ")", ";", "if", "(", "node", "==", "null", ")", "return", "basicType", ";", "return", "addTypeArguments", "(", "basicType", ",", "node", ")", ";", "}", "else", "{", "node", "=", "node", ".", "getFirstChild", "(", ")", ";", "while", "(", "node", "!=", "null", "&&", "!", "isType", "(", "TYPE_ARGUMENTS", ",", "node", ")", ")", "node", "=", "node", ".", "getNextSibling", "(", ")", ";", "return", "node", "==", "null", "?", "basicType", ":", "addTypeArguments", "(", "basicType", ",", "node", ")", ";", "}", "}", "private", "ClassNode", "addTypeArguments", "(", "ClassNode", "basicType", ",", "AST", "node", ")", "{", "List", "<", "GenericsType", ">", "typeArgumentList", "=", "getTypeArgumentsList", "(", "node", ")", ";", "if", "(", "typeArgumentList", ".", "size", "(", ")", ">", "0", ")", "{", "basicType", ".", "setGenericsTypes", "(", "typeArgumentList", ".", "toArray", "(", "new", "GenericsType", "[", "typeArgumentList", ".", "size", "(", ")", "]", ")", ")", ";", "}", "return", "basicType", ";", "}", "private", "List", "<", "GenericsType", ">", "getTypeArgumentsList", "(", "AST", "node", ")", "{", "assertNodeType", "(", "TYPE_ARGUMENTS", ",", "node", ")", ";", "List", "<", "GenericsType", ">", "typeArgumentList", "=", "new", "LinkedList", "<", "GenericsType", ">", "(", ")", ";", "AST", "typeArgument", "=", "node", ".", "getFirstChild", "(", ")", ";", "while", "(", "typeArgument", "!=", "null", ")", "{", "assertNodeType", "(", "TYPE_ARGUMENT", ",", "typeArgument", ")", ";", "GenericsType", "gt", "=", "makeGenericsArgumentType", "(", "typeArgument", ")", ";", "typeArgumentList", ".", "add", "(", "gt", ")", ";", "typeArgument", "=", "typeArgument", ".", "getNextSibling", "(", ")", ";", "}", "return", "typeArgumentList", ";", "}", "private", "ClassNode", "[", "]", "makeGenericsBounds", "(", "AST", "rn", ",", "int", "boundType", ")", "{", "AST", "boundsRoot", "=", "rn", ".", "getNextSibling", "(", ")", ";", "if", "(", "boundsRoot", "==", "null", ")", "return", "null", ";", "assertNodeType", "(", "boundType", ",", "boundsRoot", ")", ";", "LinkedList", "bounds", "=", "new", "LinkedList", "(", ")", ";", "for", "(", "AST", "boundsNode", "=", "boundsRoot", ".", "getFirstChild", "(", ")", ";", "boundsNode", "!=", "null", ";", "boundsNode", "=", "boundsNode", ".", "getNextSibling", "(", ")", ")", "{", "ClassNode", "bound", "=", "null", ";", "bound", "=", "makeTypeWithArguments", "(", "boundsNode", ")", ";", "configureAST", "(", "bound", ",", "boundsNode", ")", ";", "bounds", ".", "add", "(", "bound", ")", ";", "}", "if", "(", "bounds", ".", "size", "(", ")", "==", "0", ")", "return", "null", ";", "return", "(", "ClassNode", "[", "]", ")", "bounds", ".", "toArray", "(", "new", "ClassNode", "[", "bounds", ".", "size", "(", ")", "]", ")", ";", "}", "protected", "GenericsType", "[", "]", "makeGenericsType", "(", "AST", "rootNode", ")", "{", "AST", "typeParameter", "=", "rootNode", ".", "getFirstChild", "(", ")", ";", "LinkedList", "ret", "=", "new", "LinkedList", "(", ")", ";", "assertNodeType", "(", "TYPE_PARAMETER", ",", "typeParameter", ")", ";", "while", "(", "isType", "(", "TYPE_PARAMETER", ",", "typeParameter", ")", ")", "{", "AST", "typeNode", "=", "typeParameter", ".", "getFirstChild", "(", ")", ";", "ClassNode", "type", "=", "makeType", "(", "typeParameter", ")", ";", "GenericsType", "gt", "=", "new", "GenericsType", "(", "type", ",", "makeGenericsBounds", "(", "typeNode", ",", "TYPE_UPPER_BOUNDS", ")", ",", "null", ")", ";", "configureAST", "(", "gt", ",", "typeParameter", ")", ";", "ret", ".", "add", "(", "gt", ")", ";", "typeParameter", "=", "typeParameter", ".", "getNextSibling", "(", ")", ";", "}", "return", "(", "GenericsType", "[", "]", ")", "ret", ".", "toArray", "(", "new", "GenericsType", "[", "0", "]", ")", ";", "}", "protected", "ClassNode", "makeType", "(", "AST", "typeNode", ")", "{", "ClassNode", "answer", "=", "ClassHelper", ".", "DYNAMIC_TYPE", ";", "AST", "node", "=", "typeNode", ".", "getFirstChild", "(", ")", ";", "if", "(", "node", "!=", "null", ")", "{", "if", "(", "isType", "(", "INDEX_OP", ",", "node", ")", "||", "isType", "(", "ARRAY_DECLARATOR", ",", "node", ")", ")", "{", "answer", "=", "makeType", "(", "node", ")", ".", "makeArray", "(", ")", ";", "}", "else", "{", "answer", "=", "ClassHelper", ".", "make", "(", "qualifiedName", "(", "node", ")", ")", ";", "if", "(", "answer", ".", "isUsingGenerics", "(", ")", ")", "{", "ClassNode", "newAnswer", "=", "ClassHelper", ".", "makeWithoutCaching", "(", "answer", ".", "getName", "(", ")", ")", ";", "newAnswer", ".", "setRedirect", "(", "answer", ")", ";", "answer", "=", "newAnswer", ";", "}", "}", "configureAST", "(", "answer", ",", "node", ")", ";", "}", "return", "answer", ";", "}", "protected", "ClassNode", "buildName", "(", "AST", "node", ")", "{", "if", "(", "isType", "(", "TYPE", ",", "node", ")", ")", "{", "node", "=", "node", ".", "getFirstChild", "(", ")", ";", "}", "ClassNode", "answer", "=", "null", ";", "if", "(", "isType", "(", "DOT", ",", "node", ")", "||", "isType", "(", "OPTIONAL_DOT", ",", "node", ")", ")", "{", "answer", "=", "ClassHelper", ".", "make", "(", "qualifiedName", "(", "node", ")", ")", ";", "}", "else", "if", "(", "isPrimitiveTypeLiteral", "(", "node", ")", ")", "{", "answer", "=", "ClassHelper", ".", "make", "(", "node", ".", "getText", "(", ")", ")", ";", "}", "else", "if", "(", "isType", "(", "INDEX_OP", ",", "node", ")", "||", "isType", "(", "ARRAY_DECLARATOR", ",", "node", ")", ")", "{", "AST", "child", "=", "node", ".", "getFirstChild", "(", ")", ";", "answer", "=", "buildName", "(", "child", ")", ".", "makeArray", "(", ")", ";", "configureAST", "(", "answer", ",", "node", ")", ";", "return", "answer", ";", "}", "else", "{", "String", "identifier", "=", "node", ".", "getText", "(", ")", ";", "answer", "=", "ClassHelper", ".", "make", "(", "identifier", ")", ";", "}", "AST", "nextSibling", "=", "node", ".", "getNextSibling", "(", ")", ";", "if", "(", "isType", "(", "INDEX_OP", ",", "nextSibling", ")", "||", "isType", "(", "ARRAY_DECLARATOR", ",", "node", ")", ")", "{", "answer", "=", "answer", ".", "makeArray", "(", ")", ";", "configureAST", "(", "answer", ",", "node", ")", ";", "return", "answer", ";", "}", "else", "{", "configureAST", "(", "answer", ",", "node", ")", ";", "return", "answer", ";", "}", "}", "protected", "boolean", "isPrimitiveTypeLiteral", "(", "AST", "node", ")", "{", "int", "type", "=", "node", ".", "getType", "(", ")", ";", "switch", "(", "type", ")", "{", "case", "LITERAL_boolean", ":", "case", "LITERAL_byte", ":", "case", "LITERAL_char", ":", "case", "LITERAL_double", ":", "case", "LITERAL_float", ":", "case", "LITERAL_int", ":", "case", "LITERAL_long", ":", "case", "LITERAL_short", ":", "return", "true", ";", "default", ":", "return", "false", ";", "}", "}", "protected", "String", "identifier", "(", "AST", "node", ")", "{", "assertNodeType", "(", "IDENT", ",", "node", ")", ";", "return", "node", ".", "getText", "(", ")", ";", "}", "protected", "String", "label", "(", "AST", "labelNode", ")", "{", "AST", "node", "=", "labelNode", ".", "getFirstChild", "(", ")", ";", "if", "(", "node", "==", "null", ")", "{", "return", "null", ";", "}", "return", "identifier", "(", "node", ")", ";", "}", "protected", "boolean", "hasVisibility", "(", "int", "modifiers", ")", "{", "return", "(", "modifiers", "&", "(", "Opcodes", ".", "ACC_PRIVATE", "|", "Opcodes", ".", "ACC_PROTECTED", "|", "Opcodes", ".", "ACC_PUBLIC", ")", ")", "!=", "0", ";", "}", "protected", "void", "configureAST", "(", "ASTNode", "node", ",", "AST", "ast", ")", "{", "if", "(", "ast", "==", "null", ")", "throw", "new", "ASTRuntimeException", "(", "ast", ",", "\"\"", "+", "node", ".", "getClass", "(", ")", ".", "getName", "(", ")", "+", "\"\"", ")", ";", "int", "startcol", "=", "ast", ".", "getColumn", "(", ")", ";", "int", "startline", "=", "ast", ".", "getLine", "(", ")", ";", "int", "startoffset", "=", "locations", ".", "findOffset", "(", "startline", ",", "startcol", ")", ";", "int", "lastcol", ";", "int", "lastline", ";", "int", "endoffset", ";", "if", "(", "ast", "instanceof", "GroovySourceAST", ")", "{", "GroovySourceAST", "groovySourceAST", "=", "(", "GroovySourceAST", ")", "ast", ";", "lastcol", "=", "groovySourceAST", ".", "getColumnLast", "(", ")", ";", "lastline", "=", "groovySourceAST", ".", "getLineLast", "(", ")", ";", "endoffset", "=", "locations", ".", "findOffset", "(", "lastline", ",", "lastcol", ")", ";", "if", "(", "(", "node", "instanceof", "BinaryExpression", "||", "node", "instanceof", "MapEntryExpression", "||", "node", "instanceof", "MapExpression", "||", "node", "instanceof", "CastExpression", "||", "node", "instanceof", "MethodCallExpression", ")", "&&", "(", "node", ".", "getStart", "(", ")", "<=", "startoffset", "&&", "node", ".", "getEnd", "(", ")", ">=", "endoffset", ")", ")", "{", "return", ";", "}", "if", "(", "(", "node", "instanceof", "VariableExpression", "||", "node", "instanceof", "ConstantExpression", ")", "&&", "node", ".", "getEnd", "(", ")", ">", "0", "&&", "(", "startoffset", "<=", "node", ".", "getStart", "(", ")", "&&", "endoffset", ">=", "node", ".", "getEnd", "(", ")", ")", ")", "{", "return", ";", "}", "node", ".", "setLastColumnNumber", "(", "lastcol", ")", ";", "node", ".", "setLastLineNumber", "(", "lastline", ")", ";", "node", ".", "setEnd", "(", "endoffset", ")", ";", "}", "node", ".", "setColumnNumber", "(", "startcol", ")", ";", "node", ".", "setLineNumber", "(", "startline", ")", ";", "node", ".", "setStart", "(", "startoffset", ")", ";", "}", "protected", "static", "Token", "makeToken", "(", "int", "typeCode", ",", "AST", "node", ")", "{", "return", "Token", ".", "newSymbol", "(", "typeCode", ",", "node", ".", "getLine", "(", ")", ",", "node", ".", "getColumn", "(", ")", ")", ";", "}", "protected", "String", "getFirstChildText", "(", "AST", "node", ")", "{", "AST", "child", "=", "node", ".", "getFirstChild", "(", ")", ";", "return", "child", "!=", "null", "?", "child", ".", "getText", "(", ")", ":", "null", ";", "}", "public", "static", "boolean", "isType", "(", "int", "typeCode", ",", "AST", "node", ")", "{", "return", "node", "!=", "null", "&&", "node", ".", "getType", "(", ")", "==", "typeCode", ";", "}", "private", "String", "getTokenName", "(", "int", "token", ")", "{", "if", "(", "tokenNames", "==", "null", ")", "return", "\"\"", "+", "token", ";", "return", "tokenNames", "[", "token", "]", ";", "}", "private", "String", "getTokenName", "(", "AST", "node", ")", "{", "if", "(", "node", "==", "null", ")", "return", "\"null\"", ";", "return", "getTokenName", "(", "node", ".", "getType", "(", ")", ")", ";", "}", "protected", "void", "assertNodeType", "(", "int", "type", ",", "AST", "node", ")", "{", "if", "(", "node", "==", "null", ")", "{", "throw", "new", "ASTRuntimeException", "(", "node", ",", "\"\"", "+", "getTokenName", "(", "type", ")", ")", ";", "}", "if", "(", "node", ".", "getType", "(", ")", "!=", "type", ")", "{", "throw", "new", "ASTRuntimeException", "(", "node", ",", "\"\"", "+", "getTokenName", "(", "node", ")", "+", "\"\"", "+", "getTokenName", "(", "type", ")", ")", ";", "}", "}", "protected", "void", "notImplementedYet", "(", "AST", "node", ")", "{", "throw", "new", "ASTRuntimeException", "(", "node", ",", "\"\"", "+", "getTokenName", "(", "node", ")", ")", ";", "}", "protected", "Expression", "unknownAST", "(", "AST", "node", ")", "{", "if", "(", "node", ".", "getType", "(", ")", "==", "CLASS_DEF", ")", "{", "throw", "new", "ASTRuntimeException", "(", "node", ",", "\"\"", ")", ";", "}", "if", "(", "node", ".", "getType", "(", ")", "==", "METHOD_DEF", ")", "{", "throw", "new", "ASTRuntimeException", "(", "node", ",", "\"\"", ")", ";", "}", "return", "new", "ConstantExpression", "(", "\"ERROR\"", ")", ";", "}", "protected", "void", "dumpTree", "(", "AST", "ast", ")", "{", "for", "(", "AST", "node", "=", "ast", ".", "getFirstChild", "(", ")", ";", "node", "!=", "null", ";", "node", "=", "node", ".", "getNextSibling", "(", ")", ")", "{", "dump", "(", "node", ")", ";", "}", "}", "protected", "void", "dump", "(", "AST", "node", ")", "{", "System", ".", "out", ".", "println", "(", "\"Type:", "\"", "+", "getTokenName", "(", "node", ")", "+", "\"", "text:", "\"", "+", "node", ".", "getText", "(", ")", ")", ";", "}", "private", "void", "fixModuleNodeLocations", "(", ")", "{", "output", ".", "setStart", "(", "0", ")", ";", "output", ".", "setEnd", "(", "locations", ".", "getEnd", "(", ")", ")", ";", "output", ".", "setLineNumber", "(", "1", ")", ";", "output", ".", "setColumnNumber", "(", "1", ")", ";", "output", ".", "setLastColumnNumber", "(", "locations", ".", "getEndColumn", "(", ")", ")", ";", "output", ".", "setLastLineNumber", "(", "locations", ".", "getEndLine", "(", ")", ")", ";", "BlockStatement", "statements", "=", "output", ".", "getStatementBlock", "(", ")", ";", "List", "<", "MethodNode", ">", "methods", "=", "output", ".", "getMethods", "(", ")", ";", "if", "(", "hasScriptMethodsOrStatements", "(", "statements", ",", "methods", ")", ")", "{", "ASTNode", "first", "=", "getFirst", "(", "statements", ",", "methods", ")", ";", "ASTNode", "last", "=", "getLast", "(", "statements", ",", "methods", ")", ";", "if", "(", "hasScriptStatements", "(", "statements", ")", ")", "{", "statements", ".", "setStart", "(", "first", ".", "getStart", "(", ")", ")", ";", "statements", ".", "setLineNumber", "(", "first", ".", "getLineNumber", "(", ")", ")", ";", "statements", ".", "setColumnNumber", "(", "first", ".", "getColumnNumber", "(", ")", ")", ";", "statements", ".", "setEnd", "(", "last", ".", "getEnd", "(", ")", ")", ";", "statements", ".", "setLastLineNumber", "(", "last", ".", "getLastLineNumber", "(", ")", ")", ";", "statements", ".", "setLastColumnNumber", "(", "last", ".", "getLastColumnNumber", "(", ")", ")", ";", "}", "if", "(", "output", ".", "getClasses", "(", ")", ".", "size", "(", ")", ">", "0", ")", "{", "ClassNode", "scriptClass", "=", "output", ".", "getClasses", "(", ")", ".", "get", "(", "0", ")", ";", "scriptClass", ".", "setStart", "(", "first", ".", "getStart", "(", ")", ")", ";", "scriptClass", ".", "setLineNumber", "(", "first", ".", "getLineNumber", "(", ")", ")", ";", "scriptClass", ".", "setColumnNumber", "(", "first", ".", "getColumnNumber", "(", ")", ")", ";", "scriptClass", ".", "setEnd", "(", "last", ".", "getEnd", "(", ")", ")", ";", "scriptClass", ".", "setLastLineNumber", "(", "last", ".", "getLastLineNumber", "(", ")", ")", ";", "scriptClass", ".", "setLastColumnNumber", "(", "last", ".", "getLastColumnNumber", "(", ")", ")", ";", "MethodNode", "runMethod", "=", "scriptClass", ".", "getDeclaredMethod", "(", "\"run\"", ",", "new", "Parameter", "[", "0", "]", ")", ";", "runMethod", ".", "setStart", "(", "first", ".", "getStart", "(", ")", ")", ";", "runMethod", ".", "setLineNumber", "(", "first", ".", "getLineNumber", "(", ")", ")", ";", "runMethod", ".", "setColumnNumber", "(", "first", ".", "getColumnNumber", "(", ")", ")", ";", "runMethod", ".", "setEnd", "(", "last", ".", "getEnd", "(", ")", ")", ";", "runMethod", ".", "setLastLineNumber", "(", "last", ".", "getLastLineNumber", "(", ")", ")", ";", "runMethod", ".", "setLastColumnNumber", "(", "last", ".", "getLastColumnNumber", "(", ")", ")", ";", "}", "}", "}", "private", "ASTNode", "getFirst", "(", "BlockStatement", "statements", ",", "List", "<", "MethodNode", ">", "methods", ")", "{", "Statement", "firstStatement", "=", "hasScriptStatements", "(", "statements", ")", "?", "statements", ".", "getStatements", "(", ")", ".", "get", "(", "0", ")", ":", "null", ";", "MethodNode", "firstMethod", "=", "hasScriptMethods", "(", "methods", ")", "?", "methods", ".", "get", "(", "0", ")", ":", "null", ";", "if", "(", "firstMethod", "==", "null", "&&", "(", "firstStatement", "==", "null", "||", "(", "firstStatement", ".", "getStart", "(", ")", "==", "0", "&&", "firstStatement", ".", "getLength", "(", ")", "==", "0", ")", ")", ")", "{", "firstStatement", "=", "createSyntheticAfterImports", "(", ")", ";", "}", "int", "statementStart", "=", "firstStatement", "!=", "null", "?", "firstStatement", ".", "getStart", "(", ")", ":", "Integer", ".", "MAX_VALUE", ";", "int", "methodStart", "=", "firstMethod", "!=", "null", "?", "firstMethod", ".", "getStart", "(", ")", ":", "Integer", ".", "MAX_VALUE", ";", "return", "statementStart", "<=", "methodStart", "?", "firstStatement", ":", "firstMethod", ";", "}", "private", "ASTNode", "getLast", "(", "BlockStatement", "statements", ",", "List", "<", "MethodNode", ">", "methods", ")", "{", "Statement", "lastStatement", "=", "hasScriptStatements", "(", "statements", ")", "?", "statements", ".", "getStatements", "(", ")", ".", "get", "(", "statements", ".", "getStatements", "(", ")", ".", "size", "(", ")", "-", "1", ")", ":", "null", ";", "MethodNode", "lastMethod", "=", "hasScriptMethods", "(", "methods", ")", "?", "methods", ".", "get", "(", "methods", ".", "size", "(", ")", "-", "1", ")", ":", "null", ";", "if", "(", "lastMethod", "==", "null", "&&", "(", "lastStatement", "==", "null", "||", "(", "lastStatement", ".", "getStart", "(", ")", "==", "0", "&&", "lastStatement", ".", "getLength", "(", ")", "==", "0", ")", ")", ")", "{", "lastStatement", "=", "createSyntheticAfterImports", "(", ")", ";", "}", "int", "statementStart", "=", "lastStatement", "!=", "null", "?", "lastStatement", ".", "getEnd", "(", ")", ":", "Integer", ".", "MIN_VALUE", ";", "int", "methodStart", "=", "lastMethod", "!=", "null", "?", "lastMethod", ".", "getStart", "(", ")", ":", "Integer", ".", "MIN_VALUE", ";", "return", "statementStart", ">=", "methodStart", "?", "lastStatement", ":", "lastMethod", ";", "}", "private", "Statement", "createSyntheticAfterImports", "(", ")", "{", "ASTNode", "target", "=", "null", ";", "Statement", "synthetic", "=", "ReturnStatement", ".", "RETURN_NULL_OR_VOID", ";", "if", "(", "output", ".", "getImports", "(", ")", "!=", "null", "&&", "output", ".", "getImports", "(", ")", ".", "size", "(", ")", ">", "0", ")", "{", "target", "=", "output", ".", "getImports", "(", ")", ".", "get", "(", "output", ".", "getImports", "(", ")", ".", "size", "(", ")", "-", "1", ")", ";", "}", "else", "if", "(", "output", ".", "hasPackage", "(", ")", ")", "{", "target", "=", "output", ".", "getPackage", "(", ")", ";", "}", "if", "(", "target", "!=", "null", ")", "{", "synthetic", "=", "new", "ReturnStatement", "(", "ConstantExpression", ".", "NULL", ")", ";", "synthetic", ".", "setStart", "(", "target", ".", "getEnd", "(", ")", "+", "1", ")", ";", "synthetic", ".", "setEnd", "(", "target", ".", "getEnd", "(", ")", "+", "1", ")", ";", "synthetic", ".", "setLineNumber", "(", "target", ".", "getLastLineNumber", "(", ")", ")", ";", "synthetic", ".", "setLastLineNumber", "(", "target", ".", "getLineNumber", "(", ")", ")", ";", "synthetic", ".", "setColumnNumber", "(", "target", ".", "getLastColumnNumber", "(", ")", "+", "1", ")", ";", "synthetic", ".", "setLastColumnNumber", "(", "target", ".", "getColumnNumber", "(", ")", "+", "1", ")", ";", "}", "return", "synthetic", ";", "}", "private", "boolean", "hasScriptMethodsOrStatements", "(", "BlockStatement", "statements", ",", "List", "<", "MethodNode", ">", "methods", ")", "{", "return", "hasScriptStatements", "(", "statements", ")", "||", "hasScriptMethods", "(", "methods", ")", ";", "}", "private", "boolean", "hasScriptMethods", "(", "List", "<", "MethodNode", ">", "methods", ")", "{", "return", "methods", "!=", "null", "&&", "methods", ".", "size", "(", ")", ">", "0", ";", "}", "private", "boolean", "hasScriptStatements", "(", "BlockStatement", "statements", ")", "{", "return", "statements", "!=", "null", "&&", "statements", ".", "getStatements", "(", ")", "!=", "null", "&&", "statements", ".", "getStatements", "(", ")", ".", "size", "(", ")", ">", "0", ";", "}", "protected", "void", "configureAnnotationAST", "(", "ASTNode", "node", ",", "AST", "ast", ")", "{", "if", "(", "ast", "==", "null", ")", "{", "throw", "new", "ASTRuntimeException", "(", "ast", ",", "\"\"", "+", "node", ".", "getClass", "(", ")", ".", "getName", "(", ")", "+", "\"\"", ")", ";", "}", "if", "(", "ast", "instanceof", "GroovySourceAST", ")", "{", "GroovySourceAST", "correctAst", "=", "(", "GroovySourceAST", ")", "ast", ";", "correctAst", "=", "(", "GroovySourceAST", ")", "correctAst", ".", "getFirstChild", "(", ")", ";", "setPositions", "(", "node", ",", "correctAst", ".", "getColumn", "(", ")", ",", "correctAst", ".", "getLine", "(", ")", ",", "correctAst", ".", "getColumnLast", "(", ")", ",", "correctAst", ".", "getLineLast", "(", ")", ")", ";", "if", "(", "node", "instanceof", "AnnotationNode", ")", "{", "setPositions", "(", "(", "(", "AnnotationNode", ")", "node", ")", ".", "getClassNode", "(", ")", ",", "correctAst", ".", "getColumn", "(", ")", ",", "correctAst", ".", "getLine", "(", ")", ",", "correctAst", ".", "getColumnLast", "(", ")", "+", "1", ",", "correctAst", ".", "getLineLast", "(", ")", ")", ";", "}", "}", "else", "{", "int", "startcol", "=", "ast", ".", "getColumn", "(", ")", ";", "int", "startline", "=", "ast", ".", "getLine", "(", ")", ";", "node", ".", "setColumnNumber", "(", "startcol", ")", ";", "node", ".", "setLineNumber", "(", "startline", ")", ";", "int", "startoffset", "=", "locations", ".", "findOffset", "(", "startline", ",", "startcol", ")", ";", "node", ".", "setStart", "(", "startoffset", ")", ";", "}", "}", "private", "void", "configureClassNodeForClassDefAST", "(", "ASTNode", "node", ",", "AST", "ast", ")", "{", "if", "(", "ast", "==", "null", ")", "{", "throw", "new", "ASTRuntimeException", "(", "ast", ",", "\"\"", "+", "node", ".", "getClass", "(", ")", ".", "getName", "(", ")", "+", "\"\"", ")", ";", "}", "if", "(", "ast", "instanceof", "GroovySourceAST", ")", "{", "GroovySourceAST", "theAst", "=", "(", "GroovySourceAST", ")", "ast", ";", "theAst", "=", "(", "GroovySourceAST", ")", "theAst", ".", "getFirstChild", "(", ")", ".", "getNextSibling", "(", ")", ";", "setPositions", "(", "node", ",", "theAst", ".", "getColumn", "(", ")", ",", "theAst", ".", "getLine", "(", ")", ",", "theAst", ".", "getColumnLast", "(", ")", ",", "theAst", ".", "getLineLast", "(", ")", ")", ";", "}", "else", "{", "int", "startcol", "=", "ast", ".", "getColumn", "(", ")", ";", "int", "startline", "=", "ast", ".", "getLine", "(", ")", ";", "node", ".", "setColumnNumber", "(", "startcol", ")", ";", "node", ".", "setLineNumber", "(", "startline", ")", ";", "int", "startoffset", "=", "locations", ".", "findOffset", "(", "startline", ",", "startcol", ")", ";", "node", ".", "setStart", "(", "startoffset", ")", ";", "}", "}", "private", "void", "setPositions", "(", "ASTNode", "node", ",", "int", "scol", ",", "int", "sline", ",", "int", "ecol", ",", "int", "eline", ")", "{", "node", ".", "setColumnNumber", "(", "scol", ")", ";", "node", ".", "setLineNumber", "(", "sline", ")", ";", "node", ".", "setStart", "(", "locations", ".", "findOffset", "(", "sline", ",", "scol", ")", ")", ";", "node", ".", "setLastColumnNumber", "(", "ecol", ")", ";", "node", ".", "setLastLineNumber", "(", "eline", ")", ";", "node", ".", "setEnd", "(", "locations", ".", "findOffset", "(", "eline", ",", "ecol", ")", "-", "1", ")", ";", "}", "}", "</s>" ]
6,614
[ "<s>", "package", "org", ".", "codehaus", ".", "groovy", ".", "antlr", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "ClassHelper", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "ClassNode", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "FieldNode", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "GenericsType", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "InnerClassNode", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "MixinNode", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "expr", ".", "Expression", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "expr", ".", "ListExpression", ";", "import", "org", ".", "objectweb", ".", "asm", ".", "Opcodes", ";", "public", "class", "EnumHelper", "{", "private", "static", "final", "int", "FS", "=", "Opcodes", ".", "ACC_FINAL", "|", "Opcodes", ".", "ACC_STATIC", ";", "private", "static", "final", "int", "PUBLIC_FS", "=", "Opcodes", ".", "ACC_PUBLIC", "|", "FS", ";", "public", "static", "ClassNode", "makeEnumNode", "(", "String", "name", ",", "int", "modifiers", ",", "ClassNode", "[", "]", "interfaces", ",", "ClassNode", "outerClass", ")", "{", "modifiers", "=", "modifiers", "|", "Opcodes", ".", "ACC_FINAL", "|", "Opcodes", ".", "ACC_ENUM", ";", "ClassNode", "enumClass", ";", "if", "(", "outerClass", "==", "null", ")", "{", "enumClass", "=", "new", "ClassNode", "(", "name", ",", "modifiers", ",", "null", ",", "interfaces", ",", "MixinNode", ".", "EMPTY_ARRAY", ")", ";", "}", "else", "{", "name", "=", "outerClass", ".", "getName", "(", ")", "+", "\"$\"", "+", "name", ";", "enumClass", "=", "new", "InnerClassNode", "(", "outerClass", ",", "name", ",", "modifiers", ",", "null", ",", "interfaces", ",", "MixinNode", ".", "EMPTY_ARRAY", ")", ";", "}", "GenericsType", "gt", "=", "new", "GenericsType", "(", "enumClass", ")", ";", "ClassNode", "superClass", "=", "ClassHelper", ".", "makeWithoutCaching", "(", "\"\"", ")", ";", "superClass", ".", "setGenericsTypes", "(", "new", "GenericsType", "[", "]", "{", "gt", "}", ")", ";", "enumClass", ".", "setSuperClass", "(", "superClass", ")", ";", "superClass", ".", "setRedirect", "(", "ClassHelper", ".", "Enum_Type", ")", ";", "return", "enumClass", ";", "}", "public", "static", "FieldNode", "addEnumConstant", "(", "ClassNode", "enumClassType", ",", "ClassNode", "enumClassOwner", ",", "String", "name", ",", "Expression", "init", ")", "{", "int", "modifiers", "=", "PUBLIC_FS", "|", "Opcodes", ".", "ACC_ENUM", ";", "if", "(", "init", "!=", "null", "&&", "!", "(", "init", "instanceof", "ListExpression", ")", ")", "{", "ListExpression", "list", "=", "new", "ListExpression", "(", ")", ";", "list", ".", "addExpression", "(", "init", ")", ";", "init", "=", "list", ";", "}", "FieldNode", "fn", "=", "new", "FieldNode", "(", "name", ",", "modifiers", ",", "enumClassType", ".", "getPlainNodeReference", "(", ")", ",", "enumClassOwner", ",", "init", ")", ";", "enumClassOwner", ".", "addField", "(", "fn", ")", ";", "return", "fn", ";", "}", "}", "</s>" ]
6,615
[ "<s>", "package", "org", ".", "codehaus", ".", "groovy", ".", "antlr", ";", "import", "java", ".", "io", ".", "Reader", ";", "class", "NoEscaper", "extends", "UnicodeEscapingReader", "{", "public", "NoEscaper", "(", ")", "{", "super", "(", "null", ",", "null", ")", ";", "}", "public", "int", "getUnescapedUnicodeColumnCount", "(", ")", "{", "return", "0", ";", "}", "public", "int", "getUnescapedUnicodeOffsetCount", "(", ")", "{", "return", "0", ";", "}", "}", "</s>" ]
6,616
[ "<s>", "package", "org", ".", "codehaus", ".", "groovy", ".", "antlr", ";", "import", "java", ".", "util", ".", "ArrayList", ";", "import", "java", ".", "util", ".", "List", ";", "public", "class", "LocationSupport", "{", "private", "static", "final", "int", "[", "]", "NO_LINE_ENDINGS", "=", "new", "int", "[", "0", "]", ";", "public", "static", "final", "LocationSupport", "NO_LOCATIONS", "=", "new", "LocationSupport", "(", ")", ";", "private", "final", "int", "[", "]", "lineEndings", ";", "public", "LocationSupport", "(", "char", "[", "]", "contents", ")", "{", "if", "(", "contents", "!=", "null", ")", "{", "lineEndings", "=", "processLineEndings", "(", "contents", ")", ";", "}", "else", "{", "lineEndings", "=", "NO_LINE_ENDINGS", ";", "}", "}", "public", "LocationSupport", "(", "List", "<", "StringBuffer", ">", "lines", ")", "{", "if", "(", "lines", "!=", "null", ")", "{", "lineEndings", "=", "processLineEndings", "(", "lines", ")", ";", "}", "else", "{", "lineEndings", "=", "NO_LINE_ENDINGS", ";", "}", "}", "public", "LocationSupport", "(", "int", "[", "]", "lineEndings", ")", "{", "this", ".", "lineEndings", "=", "lineEndings", ";", "}", "public", "LocationSupport", "(", ")", "{", "lineEndings", "=", "NO_LINE_ENDINGS", ";", "}", "private", "int", "[", "]", "processLineEndings", "(", "List", "<", "StringBuffer", ">", "lines", ")", "{", "int", "[", "]", "newLineEndings", "=", "new", "int", "[", "lines", ".", "size", "(", ")", "+", "1", "]", ";", "int", "total", "=", "0", ";", "int", "current", "=", "1", ";", "for", "(", "StringBuffer", "line", ":", "lines", ")", "{", "newLineEndings", "[", "current", "++", "]", "=", "total", "+=", "(", "line", ".", "length", "(", ")", ")", ";", "}", "return", "newLineEndings", ";", "}", "private", "int", "[", "]", "processLineEndings", "(", "char", "[", "]", "contents", ")", "{", "List", "<", "Integer", ">", "l", "=", "new", "ArrayList", "<", "Integer", ">", "(", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "contents", ".", "length", ";", "i", "++", ")", "{", "if", "(", "contents", "[", "i", "]", "==", "'\\n'", ")", "{", "l", ".", "add", "(", "i", ")", ";", "}", "else", "if", "(", "contents", "[", "i", "]", "==", "'\\r'", ")", "{", "l", ".", "add", "(", "i", ")", ";", "if", "(", "i", "<", "contents", ".", "length", "&&", "contents", "[", "i", "]", "==", "'\\n'", ")", "{", "i", "++", ";", "}", "}", "}", "int", "[", "]", "newLineEndings", "=", "new", "int", "[", "l", ".", "size", "(", ")", "]", ";", "int", "i", "=", "0", ";", "for", "(", "Integer", "integer", ":", "l", ")", "{", "newLineEndings", "[", "i", "]", "=", "integer", ".", "intValue", "(", ")", ";", "}", "return", "newLineEndings", ";", "}", "public", "int", "findOffset", "(", "int", "row", ",", "int", "col", ")", "{", "return", "row", "<=", "lineEndings", ".", "length", "&&", "row", ">", "0", "?", "lineEndings", "[", "row", "-", "1", "]", "+", "col", "-", "1", ":", "0", ";", "}", "public", "int", "getEnd", "(", ")", "{", "return", "lineEndings", ".", "length", ">", "0", "?", "lineEndings", "[", "lineEndings", ".", "length", "-", "1", "]", ":", "0", ";", "}", "public", "int", "getEndColumn", "(", ")", "{", "if", "(", "lineEndings", ".", "length", ">", "1", ")", "{", "return", "lineEndings", "[", "lineEndings", ".", "length", "-", "1", "]", "-", "lineEndings", "[", "lineEndings", ".", "length", "-", "2", "]", ";", "}", "else", "if", "(", "lineEndings", ".", "length", ">", "0", ")", "{", "return", "lineEndings", "[", "0", "]", ";", "}", "else", "{", "return", "0", ";", "}", "}", "public", "int", "getEndLine", "(", ")", "{", "return", "lineEndings", ".", "length", ">", "0", "?", "lineEndings", ".", "length", "-", "1", ":", "0", ";", "}", "public", "int", "[", "]", "getRowCol", "(", "int", "offset", ")", "{", "for", "(", "int", "i", "=", "1", ";", "i", "<", "lineEndings", ".", "length", ";", "i", "++", ")", "{", "if", "(", "lineEndings", "[", "i", "]", ">", "offset", ")", "{", "return", "new", "int", "[", "]", "{", "i", ",", "offset", "-", "lineEndings", "[", "i", "-", "1", "]", "+", "1", "}", ";", "}", "}", "throw", "new", "RuntimeException", "(", "\"\"", "+", "offset", ")", ";", "}", "public", "boolean", "isPopulated", "(", ")", "{", "return", "lineEndings", ".", "length", ">", "0", ";", "}", "}", "</s>" ]
6,617
[ "<s>", "package", "org", ".", "codehaus", ".", "groovy", ".", "antlr", ";", "import", "java", ".", "io", ".", "IOException", ";", "import", "java", ".", "io", ".", "Reader", ";", "import", "antlr", ".", "CharScanner", ";", "import", "antlr", ".", "Token", ";", "import", "antlr", ".", "TokenStreamException", ";", "public", "class", "UnicodeEscapingReader", "extends", "Reader", "{", "private", "final", "Reader", "reader", ";", "private", "CharScanner", "lexer", ";", "private", "boolean", "hasNextChar", "=", "false", ";", "private", "int", "nextChar", ";", "private", "final", "SourceBuffer", "sourceBuffer", ";", "private", "int", "previousLine", ";", "private", "int", "numUnicodeEscapesFound", "=", "0", ";", "private", "int", "numUnicodeEscapesFoundOnCurrentLine", "=", "0", ";", "private", "static", "class", "DummyLexer", "extends", "CharScanner", "{", "final", "private", "Token", "t", "=", "new", "Token", "(", ")", ";", "public", "Token", "nextToken", "(", ")", "throws", "TokenStreamException", "{", "return", "t", ";", "}", "@", "Override", "public", "int", "getColumn", "(", ")", "{", "return", "0", ";", "}", "@", "Override", "public", "int", "getLine", "(", ")", "{", "return", "0", ";", "}", "}", "public", "UnicodeEscapingReader", "(", "Reader", "reader", ",", "SourceBuffer", "sourceBuffer", ")", "{", "this", ".", "reader", "=", "reader", ";", "this", ".", "sourceBuffer", "=", "sourceBuffer", ";", "if", "(", "sourceBuffer", "!=", "null", ")", "{", "sourceBuffer", ".", "setUnescaper", "(", "this", ")", ";", "}", "this", ".", "lexer", "=", "new", "DummyLexer", "(", ")", ";", "}", "public", "void", "setLexer", "(", "CharScanner", "lexer", ")", "{", "this", ".", "lexer", "=", "lexer", ";", "}", "public", "int", "read", "(", "char", "cbuf", "[", "]", ",", "int", "off", ",", "int", "len", ")", "throws", "IOException", "{", "int", "c", "=", "0", ";", "int", "count", "=", "0", ";", "while", "(", "count", "<", "len", "&&", "(", "c", "=", "read", "(", ")", ")", "!=", "-", "1", ")", "{", "cbuf", "[", "off", "+", "count", "]", "=", "(", "char", ")", "c", ";", "count", "++", ";", "}", "return", "(", "count", "==", "0", "&&", "c", "==", "-", "1", ")", "?", "-", "1", ":", "count", ";", "}", "public", "int", "read", "(", ")", "throws", "IOException", "{", "if", "(", "hasNextChar", ")", "{", "hasNextChar", "=", "false", ";", "write", "(", "nextChar", ")", ";", "return", "nextChar", ";", "}", "if", "(", "previousLine", "!=", "lexer", ".", "getLine", "(", ")", ")", "{", "numUnicodeEscapesFoundOnCurrentLine", "=", "0", ";", "previousLine", "=", "lexer", ".", "getLine", "(", ")", ";", "}", "int", "c", "=", "reader", ".", "read", "(", ")", ";", "if", "(", "c", "!=", "'\\\\'", ")", "{", "write", "(", "c", ")", ";", "return", "c", ";", "}", "c", "=", "reader", ".", "read", "(", ")", ";", "if", "(", "c", "!=", "'u'", ")", "{", "hasNextChar", "=", "true", ";", "nextChar", "=", "c", ";", "write", "(", "'\\\\'", ")", ";", "return", "'\\\\'", ";", "}", "int", "numberOfUChars", "=", "0", ";", "do", "{", "numberOfUChars", "++", ";", "c", "=", "reader", ".", "read", "(", ")", ";", "}", "while", "(", "c", "==", "'u'", ")", ";", "checkHexDigit", "(", "c", ")", ";", "StringBuffer", "charNum", "=", "new", "StringBuffer", "(", ")", ";", "charNum", ".", "append", "(", "(", "char", ")", "c", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "3", ";", "i", "++", ")", "{", "c", "=", "reader", ".", "read", "(", ")", ";", "checkHexDigit", "(", "c", ")", ";", "charNum", ".", "append", "(", "(", "char", ")", "c", ")", ";", "}", "int", "rv", "=", "Integer", ".", "parseInt", "(", "charNum", ".", "toString", "(", ")", ",", "16", ")", ";", "write", "(", "rv", ")", ";", "numUnicodeEscapesFound", "+=", "4", "+", "numberOfUChars", ";", "numUnicodeEscapesFoundOnCurrentLine", "+=", "4", "+", "numberOfUChars", ";", "return", "rv", ";", "}", "private", "void", "write", "(", "int", "c", ")", "{", "if", "(", "sourceBuffer", "!=", "null", ")", "{", "sourceBuffer", ".", "write", "(", "c", ")", ";", "}", "}", "private", "void", "checkHexDigit", "(", "int", "c", ")", "throws", "IOException", "{", "if", "(", "c", ">=", "'0'", "&&", "c", "<=", "'9'", ")", "{", "return", ";", "}", "if", "(", "c", ">=", "'a'", "&&", "c", "<=", "'f'", ")", "{", "return", ";", "}", "if", "(", "c", ">=", "'A'", "&&", "c", "<=", "'F'", ")", "{", "return", ";", "}", "hasNextChar", "=", "true", ";", "nextChar", "=", "c", ";", "throw", "new", "IOException", "(", "\"\"", "+", "\"", "line:", "\"", "+", "lexer", ".", "getLine", "(", ")", "+", "\"", "col:\"", "+", "lexer", ".", "getColumn", "(", ")", ")", ";", "}", "public", "int", "getUnescapedUnicodeColumnCount", "(", ")", "{", "return", "numUnicodeEscapesFoundOnCurrentLine", ";", "}", "public", "int", "getUnescapedUnicodeOffsetCount", "(", ")", "{", "return", "numUnicodeEscapesFound", ";", "}", "public", "void", "close", "(", ")", "throws", "IOException", "{", "reader", ".", "close", "(", ")", ";", "}", "}", "</s>" ]
6,618
[ "<s>", "package", "org", ".", "codehaus", ".", "groovy", ".", "antlr", ";", "import", "java", ".", "util", ".", "List", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "antlr", ".", "GroovySourceAST", ";", "public", "interface", "ICSTReporter", "{", "public", "void", "generatedCST", "(", "String", "fileName", ",", "GroovySourceAST", "ast", ")", ";", "public", "void", "reportErrors", "(", "String", "fileName", ",", "List", "errors", ")", ";", "}", "</s>" ]
6,619
[ "<s>", "package", "org", ".", "codehaus", ".", "groovy", ".", "antlr", ".", "parser", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "antlr", ".", "*", ";", "import", "java", ".", "util", ".", "*", ";", "import", "java", ".", "io", ".", "InputStream", ";", "import", "java", ".", "io", ".", "Reader", ";", "import", "antlr", ".", "InputBuffer", ";", "import", "antlr", ".", "LexerSharedInputState", ";", "import", "antlr", ".", "CommonToken", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "GroovyBugError", ";", "import", "antlr", ".", "TokenStreamRecognitionException", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "Comment", ";", "import", "java", ".", "io", ".", "InputStream", ";", "import", "antlr", ".", "TokenStreamException", ";", "import", "antlr", ".", "TokenStreamIOException", ";", "import", "antlr", ".", "TokenStreamRecognitionException", ";", "import", "antlr", ".", "CharStreamException", ";", "import", "antlr", ".", "CharStreamIOException", ";", "import", "antlr", ".", "ANTLRException", ";", "import", "java", ".", "io", ".", "Reader", ";", "import", "java", ".", "util", ".", "Hashtable", ";", "import", "antlr", ".", "CharScanner", ";", "import", "antlr", ".", "InputBuffer", ";", "import", "antlr", ".", "ByteBuffer", ";", "import", "antlr", ".", "CharBuffer", ";", "import", "antlr", ".", "Token", ";", "import", "antlr", ".", "CommonToken", ";", "import", "antlr", ".", "RecognitionException", ";", "import", "antlr", ".", "NoViableAltForCharException", ";", "import", "antlr", ".", "MismatchedCharException", ";", "import", "antlr", ".", "TokenStream", ";", "import", "antlr", ".", "ANTLRHashString", ";", "import", "antlr", ".", "LexerSharedInputState", ";", "import", "antlr", ".", "collections", ".", "impl", ".", "BitSet", ";", "import", "antlr", ".", "SemanticException", ";", "public", "class", "GroovyLexer", "extends", "antlr", ".", "CharScanner", "implements", "GroovyTokenTypes", ",", "TokenStream", "{", "private", "boolean", "assertEnabled", "=", "true", ";", "private", "boolean", "enumEnabled", "=", "true", ";", "private", "boolean", "whitespaceIncluded", "=", "false", ";", "public", "void", "enableAssert", "(", "boolean", "shouldEnable", ")", "{", "assertEnabled", "=", "shouldEnable", ";", "}", "public", "boolean", "isAssertEnabled", "(", ")", "{", "return", "assertEnabled", ";", "}", "public", "void", "enableEnum", "(", "boolean", "shouldEnable", ")", "{", "enumEnabled", "=", "shouldEnable", ";", "}", "public", "boolean", "isEnumEnabled", "(", ")", "{", "return", "enumEnabled", ";", "}", "public", "void", "setWhitespaceIncluded", "(", "boolean", "z", ")", "{", "whitespaceIncluded", "=", "z", ";", "}", "public", "boolean", "isWhitespaceIncluded", "(", ")", "{", "return", "whitespaceIncluded", ";", "}", "{", "setTabSize", "(", "1", ")", ";", "}", "protected", "int", "parenLevel", "=", "0", ";", "protected", "int", "suppressNewline", "=", "0", ";", "protected", "static", "final", "int", "SCS_TYPE", "=", "3", ",", "SCS_VAL", "=", "4", ",", "SCS_LIT", "=", "8", ",", "SCS_LIMIT", "=", "16", ";", "protected", "static", "final", "int", "SCS_SQ_TYPE", "=", "0", ",", "SCS_TQ_TYPE", "=", "1", ",", "SCS_RE_TYPE", "=", "2", ",", "SCS_DRE_TYPE", "=", "3", ";", "protected", "int", "stringCtorState", "=", "0", ";", "protected", "ArrayList", "parenLevelStack", "=", "new", "ArrayList", "(", ")", ";", "protected", "int", "lastSigTokenType", "=", "EOF", ";", "public", "void", "setTokenObjectClass", "(", "String", "name", ")", "{", "}", "protected", "Token", "makeToken", "(", "int", "t", ")", "{", "GroovySourceToken", "tok", "=", "new", "GroovySourceToken", "(", "t", ")", ";", "tok", ".", "setColumn", "(", "inputState", ".", "getTokenStartColumn", "(", ")", ")", ";", "tok", ".", "setLine", "(", "inputState", ".", "getTokenStartLine", "(", ")", ")", ";", "tok", ".", "setColumnLast", "(", "inputState", ".", "getColumn", "(", ")", ")", ";", "tok", ".", "setLineLast", "(", "inputState", ".", "getLine", "(", ")", ")", ";", "return", "tok", ";", "}", "protected", "void", "pushParenLevel", "(", ")", "{", "parenLevelStack", ".", "add", "(", "Integer", ".", "valueOf", "(", "parenLevel", "*", "SCS_LIMIT", "+", "stringCtorState", ")", ")", ";", "parenLevel", "=", "0", ";", "stringCtorState", "=", "0", ";", "}", "protected", "void", "popParenLevel", "(", ")", "{", "int", "npl", "=", "parenLevelStack", ".", "size", "(", ")", ";", "if", "(", "npl", "==", "0", ")", "return", ";", "int", "i", "=", "(", "(", "Integer", ")", "parenLevelStack", ".", "remove", "(", "--", "npl", ")", ")", ".", "intValue", "(", ")", ";", "parenLevel", "=", "i", "/", "SCS_LIMIT", ";", "stringCtorState", "=", "i", "%", "SCS_LIMIT", ";", "}", "protected", "void", "restartStringCtor", "(", "boolean", "expectLiteral", ")", "{", "if", "(", "stringCtorState", "!=", "0", ")", "{", "stringCtorState", "=", "(", "expectLiteral", "?", "SCS_LIT", ":", "SCS_VAL", ")", "+", "(", "stringCtorState", "&", "SCS_TYPE", ")", ";", "}", "}", "protected", "boolean", "allowRegexpLiteral", "(", ")", "{", "return", "!", "isExpressionEndingToken", "(", "lastSigTokenType", ")", ";", "}", "protected", "static", "boolean", "isExpressionEndingToken", "(", "int", "ttype", ")", "{", "switch", "(", "ttype", ")", "{", "case", "INC", ":", "case", "DEC", ":", "case", "RPAREN", ":", "case", "RBRACK", ":", "case", "RCURLY", ":", "case", "STRING_LITERAL", ":", "case", "STRING_CTOR_END", ":", "case", "NUM_INT", ":", "case", "NUM_FLOAT", ":", "case", "NUM_LONG", ":", "case", "NUM_DOUBLE", ":", "case", "NUM_BIG_INT", ":", "case", "NUM_BIG_DECIMAL", ":", "case", "IDENT", ":", "case", "LITERAL_as", ":", "case", "LITERAL_assert", ":", "case", "LITERAL_boolean", ":", "case", "LITERAL_break", ":", "case", "LITERAL_byte", ":", "case", "LITERAL_case", ":", "case", "LITERAL_catch", ":", "case", "LITERAL_char", ":", "case", "LITERAL_class", ":", "case", "LITERAL_continue", ":", "case", "LITERAL_def", ":", "case", "LITERAL_default", ":", "case", "LITERAL_double", ":", "case", "LITERAL_else", ":", "case", "LITERAL_enum", ":", "case", "LITERAL_extends", ":", "case", "LITERAL_false", ":", "case", "LITERAL_finally", ":", "case", "LITERAL_float", ":", "case", "LITERAL_for", ":", "case", "LITERAL_if", ":", "case", "LITERAL_implements", ":", "case", "LITERAL_import", ":", "case", "LITERAL_in", ":", "case", "LITERAL_instanceof", ":", "case", "LITERAL_int", ":", "case", "LITERAL_interface", ":", "case", "LITERAL_long", ":", "case", "LITERAL_native", ":", "case", "LITERAL_new", ":", "case", "LITERAL_null", ":", "case", "LITERAL_package", ":", "case", "LITERAL_private", ":", "case", "LITERAL_protected", ":", "case", "LITERAL_public", ":", "case", "LITERAL_return", ":", "case", "LITERAL_short", ":", "case", "LITERAL_static", ":", "case", "LITERAL_super", ":", "case", "LITERAL_switch", ":", "case", "LITERAL_synchronized", ":", "case", "LITERAL_this", ":", "case", "LITERAL_threadsafe", ":", "case", "LITERAL_throw", ":", "case", "LITERAL_throws", ":", "case", "LITERAL_transient", ":", "case", "LITERAL_true", ":", "case", "LITERAL_try", ":", "case", "LITERAL_void", ":", "case", "LITERAL_volatile", ":", "case", "LITERAL_while", ":", "return", "true", ";", "default", ":", "return", "false", ";", "}", "}", "protected", "void", "newlineCheck", "(", "boolean", "check", ")", "throws", "RecognitionException", "{", "if", "(", "check", "&&", "suppressNewline", ">", "0", ")", "{", "require", "(", "suppressNewline", "==", "0", ",", "\"\"", ",", "\"\"", ")", ";", "suppressNewline", "=", "0", ";", "}", "newline", "(", ")", ";", "}", "protected", "boolean", "atValidDollarEscape", "(", ")", "throws", "CharStreamException", "{", "int", "k", "=", "1", ";", "char", "lc", "=", "LA", "(", "k", "++", ")", ";", "if", "(", "lc", "!=", "'$'", ")", "return", "false", ";", "lc", "=", "LA", "(", "k", "++", ")", ";", "if", "(", "lc", "==", "'*'", ")", "lc", "=", "LA", "(", "k", "++", ")", ";", "return", "(", "lc", "==", "'{'", "||", "(", "lc", "!=", "'$'", "&&", "Character", ".", "isJavaIdentifierStart", "(", "lc", ")", ")", ")", ";", "}", "protected", "boolean", "atDollarDollarEscape", "(", ")", "throws", "CharStreamException", "{", "return", "LA", "(", "1", ")", "==", "'$'", "&&", "LA", "(", "2", ")", "==", "'$'", ";", "}", "protected", "boolean", "atDollarSlashEscape", "(", ")", "throws", "CharStreamException", "{", "return", "LA", "(", "1", ")", "==", "'$'", "&&", "LA", "(", "2", ")", "==", "'/'", ";", "}", "public", "TokenStream", "plumb", "(", ")", "{", "return", "new", "TokenStream", "(", ")", "{", "public", "Token", "nextToken", "(", ")", "throws", "TokenStreamException", "{", "if", "(", "stringCtorState", ">=", "SCS_LIT", ")", "{", "int", "quoteType", "=", "(", "stringCtorState", "&", "SCS_TYPE", ")", ";", "stringCtorState", "=", "0", ";", "resetText", "(", ")", ";", "try", "{", "switch", "(", "quoteType", ")", "{", "case", "SCS_SQ_TYPE", ":", "mSTRING_CTOR_END", "(", "true", ",", "false", ",", "false", ")", ";", "break", ";", "case", "SCS_TQ_TYPE", ":", "mSTRING_CTOR_END", "(", "true", ",", "false", ",", "true", ")", ";", "break", ";", "case", "SCS_RE_TYPE", ":", "mREGEXP_CTOR_END", "(", "true", ",", "false", ")", ";", "break", ";", "case", "SCS_DRE_TYPE", ":", "mDOLLAR_REGEXP_CTOR_END", "(", "true", ",", "false", ")", ";", "break", ";", "default", ":", "throw", "new", "AssertionError", "(", "false", ")", ";", "}", "lastSigTokenType", "=", "_returnToken", ".", "getType", "(", ")", ";", "return", "_returnToken", ";", "}", "catch", "(", "RecognitionException", "e", ")", "{", "throw", "new", "TokenStreamRecognitionException", "(", "e", ")", ";", "}", "catch", "(", "CharStreamException", "cse", ")", "{", "if", "(", "cse", "instanceof", "CharStreamIOException", ")", "{", "throw", "new", "TokenStreamIOException", "(", "(", "(", "CharStreamIOException", ")", "cse", ")", ".", "io", ")", ";", "}", "else", "{", "throw", "new", "TokenStreamException", "(", "cse", ".", "getMessage", "(", ")", ")", ";", "}", "}", "}", "Token", "token", "=", "GroovyLexer", ".", "this", ".", "nextToken", "(", ")", ";", "int", "lasttype", "=", "token", ".", "getType", "(", ")", ";", "if", "(", "whitespaceIncluded", ")", "{", "switch", "(", "lasttype", ")", "{", "case", "WS", ":", "case", "ONE_NL", ":", "case", "SL_COMMENT", ":", "case", "ML_COMMENT", ":", "lasttype", "=", "lastSigTokenType", ";", "}", "}", "lastSigTokenType", "=", "lasttype", ";", "return", "token", ";", "}", "}", ";", "}", "public", "static", "boolean", "tracing", "=", "false", ";", "public", "void", "traceIn", "(", "String", "rname", ")", "throws", "CharStreamException", "{", "if", "(", "!", "GroovyLexer", ".", "tracing", ")", "return", ";", "super", ".", "traceIn", "(", "rname", ")", ";", "}", "public", "void", "traceOut", "(", "String", "rname", ")", "throws", "CharStreamException", "{", "if", "(", "!", "GroovyLexer", ".", "tracing", ")", "return", ";", "if", "(", "_returnToken", "!=", "null", ")", "rname", "+=", "tokenStringOf", "(", "_returnToken", ")", ";", "super", ".", "traceOut", "(", "rname", ")", ";", "}", "private", "static", "java", ".", "util", ".", "HashMap", "ttypes", ";", "private", "static", "String", "tokenStringOf", "(", "Token", "t", ")", "{", "if", "(", "ttypes", "==", "null", ")", "{", "java", ".", "util", ".", "HashMap", "map", "=", "new", "java", ".", "util", ".", "HashMap", "(", ")", ";", "java", ".", "lang", ".", "reflect", ".", "Field", "[", "]", "fields", "=", "GroovyTokenTypes", ".", "class", ".", "getDeclaredFields", "(", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "fields", ".", "length", ";", "i", "++", ")", "{", "if", "(", "fields", "[", "i", "]", ".", "getType", "(", ")", "!=", "int", ".", "class", ")", "continue", ";", "try", "{", "map", ".", "put", "(", "fields", "[", "i", "]", ".", "get", "(", "null", ")", ",", "fields", "[", "i", "]", ".", "getName", "(", ")", ")", ";", "}", "catch", "(", "IllegalAccessException", "ee", ")", "{", "}", "}", "ttypes", "=", "map", ";", "}", "Integer", "tt", "=", "Integer", ".", "valueOf", "(", "t", ".", "getType", "(", ")", ")", ";", "Object", "ttn", "=", "ttypes", ".", "get", "(", "tt", ")", ";", "if", "(", "ttn", "==", "null", ")", "ttn", "=", "\"<\"", "+", "tt", "+", "\">\"", ";", "return", "\"[\"", "+", "ttn", "+", "\",\\\"\"", "+", "t", ".", "getText", "(", ")", "+", "\"\\\"]\"", ";", "}", "protected", "GroovyRecognizer", "parser", ";", "private", "void", "require", "(", "boolean", "z", ",", "String", "problem", ",", "String", "solution", ")", "throws", "SemanticException", "{", "if", "(", "!", "z", ")", "parser", ".", "requireFailed", "(", "problem", ",", "solution", ")", ";", "}", "public", "GroovyLexer", "(", "InputStream", "in", ")", "{", "this", "(", "new", "ByteBuffer", "(", "in", ")", ")", ";", "}", "public", "GroovyLexer", "(", "Reader", "in", ")", "{", "this", "(", "new", "CharBuffer", "(", "in", ")", ")", ";", "}", "public", "GroovyLexer", "(", "InputBuffer", "ib", ")", "{", "this", "(", "new", "LexerSharedInputState", "(", "ib", ")", ")", ";", "}", "public", "GroovyLexer", "(", "LexerSharedInputState", "state", ")", "{", "super", "(", "state", ")", ";", "caseSensitiveLiterals", "=", "true", ";", "setCaseSensitive", "(", "true", ")", ";", "literals", "=", "new", "Hashtable", "(", ")", ";", "literals", ".", "put", "(", "new", "ANTLRHashString", "(", "\"byte\"", ",", "this", ")", ",", "new", "Integer", "(", "102", ")", ")", ";", "literals", ".", "put", "(", "new", "ANTLRHashString", "(", "\"public\"", ",", "this", ")", ",", "new", "Integer", "(", "112", ")", ")", ";", "literals", ".", "put", "(", "new", "ANTLRHashString", "(", "\"case\"", ",", "this", ")", ",", "new", "Integer", "(", "145", ")", ")", ";", "literals", ".", "put", "(", "new", "ANTLRHashString", "(", "\"short\"", ",", "this", ")", ",", "new", "Integer", "(", "104", ")", ")", ";", "literals", ".", "put", "(", "new", "ANTLRHashString", "(", "\"break\"", ",", "this", ")", ",", "new", "Integer", "(", "139", ")", ")", ";", "literals", ".", "put", "(", "new", "ANTLRHashString", "(", "\"while\"", ",", "this", ")", ",", "new", "Integer", "(", "134", ")", ")", ";", "literals", ".", "put", "(", "new", "ANTLRHashString", "(", "\"new\"", ",", "this", ")", ",", "new", "Integer", "(", "154", ")", ")", ";", "literals", ".", "put", "(", "new", "ANTLRHashString", "(", "\"instanceof\"", ",", "this", ")", ",", "new", "Integer", "(", "153", ")", ")", ";", "literals", ".", "put", "(", "new", "ANTLRHashString", "(", "\"implements\"", ",", "this", ")", ",", "new", "Integer", "(", "127", ")", ")", ";", "literals", ".", "put", "(", "new", "ANTLRHashString", "(", "\"synchronized\"", ",", "this", ")", ",", "new", "Integer", "(", "117", ")", ")", ";", "literals", ".", "put", "(", "new", "ANTLRHashString", "(", "\"const\"", ",", "this", ")", ",", "new", "Integer", "(", "40", ")", ")", ";", "literals", ".", "put", "(", "new", "ANTLRHashString", "(", "\"float\"", ",", "this", ")", ",", "new", "Integer", "(", "106", ")", ")", ";", "literals", ".", "put", "(", "new", "ANTLRHashString", "(", "\"package\"", ",", "this", ")", ",", "new", "Integer", "(", "78", ")", ")", ";", "literals", ".", "put", "(", "new", "ANTLRHashString", "(", "\"return\"", ",", "this", ")", ",", "new", "Integer", "(", "138", ")", ")", ";", "literals", ".", "put", "(", "new", "ANTLRHashString", "(", "\"throw\"", ",", "this", ")", ",", "new", "Integer", "(", "141", ")", ")", ";", "literals", ".", "put", "(", "new", "ANTLRHashString", "(", "\"null\"", ",", "this", ")", ",", "new", "Integer", "(", "155", ")", ")", ";", "literals", ".", "put", "(", "new", "ANTLRHashString", "(", "\"def\"", ",", "this", ")", ",", "new", "Integer", "(", "81", ")", ")", ";", "literals", ".", "put", "(", "new", "ANTLRHashString", "(", "\"threadsafe\"", ",", "this", ")", ",", "new", "Integer", "(", "116", ")", ")", ";", "literals", ".", "put", "(", "new", "ANTLRHashString", "(", "\"protected\"", ",", "this", ")", ",", "new", "Integer", "(", "113", ")", ")", ";", "literals", ".", "put", "(", "new", "ANTLRHashString", "(", "\"class\"", ",", "this", ")", ",", "new", "Integer", "(", "89", ")", ")", ";", "literals", ".", "put", "(", "new", "ANTLRHashString", "(", "\"throws\"", ",", "this", ")", ",", "new", "Integer", "(", "126", ")", ")", ";", "literals", ".", "put", "(", "new", "ANTLRHashString", "(", "\"do\"", ",", "this", ")", ",", "new", "Integer", "(", "41", ")", ")", ";", "literals", ".", "put", "(", "new", "ANTLRHashString", "(", "\"strictfp\"", ",", "this", ")", ",", "new", "Integer", "(", "42", ")", ")", ";", "literals", ".", "put", "(", "new", "ANTLRHashString", "(", "\"super\"", ",", "this", ")", ",", "new", "Integer", "(", "95", ")", ")", ";", "literals", ".", "put", "(", "new", "ANTLRHashString", "(", "\"transient\"", ",", "this", ")", ",", "new", "Integer", "(", "114", ")", ")", ";", "literals", ".", "put", "(", "new", "ANTLRHashString", "(", "\"native\"", ",", "this", ")", ",", "new", "Integer", "(", "115", ")", ")", ";", "literals", ".", "put", "(", "new", "ANTLRHashString", "(", "\"interface\"", ",", "this", ")", ",", "new", "Integer", "(", "90", ")", ")", ";", "literals", ".", "put", "(", "new", "ANTLRHashString", "(", "\"final\"", ",", "this", ")", ",", "new", "Integer", "(", "37", ")", ")", ";", "literals", ".", "put", "(", "new", "ANTLRHashString", "(", "\"if\"", ",", "this", ")", ",", "new", "Integer", "(", "132", ")", ")", ";", "literals", ".", "put", "(", "new", "ANTLRHashString", "(", "\"double\"", ",", "this", ")", ",", "new", "Integer", "(", "108", ")", ")", ";", "literals", ".", "put", "(", "new", "ANTLRHashString", "(", "\"volatile\"", ",", "this", ")", ",", "new", "Integer", "(", "118", ")", ")", ";", "literals", ".", "put", "(", "new", "ANTLRHashString", "(", "\"as\"", ",", "this", ")", ",", "new", "Integer", "(", "110", ")", ")", ";", "literals", ".", "put", "(", "new", "ANTLRHashString", "(", "\"assert\"", ",", "this", ")", ",", "new", "Integer", "(", "142", ")", ")", ";", "literals", ".", "put", "(", "new", "ANTLRHashString", "(", "\"catch\"", ",", "this", ")", ",", "new", "Integer", "(", "148", ")", ")", ";", "literals", ".", "put", "(", "new", "ANTLRHashString", "(", "\"try\"", ",", "this", ")", ",", "new", "Integer", "(", "146", ")", ")", ";", "literals", ".", "put", "(", "new", "ANTLRHashString", "(", "\"goto\"", ",", "this", ")", ",", "new", "Integer", "(", "39", ")", ")", ";", "literals", ".", "put", "(", "new", "ANTLRHashString", "(", "\"enum\"", ",", "this", ")", ",", "new", "Integer", "(", "91", ")", ")", ";", "literals", ".", "put", "(", "new", "ANTLRHashString", "(", "\"int\"", ",", "this", ")", ",", "new", "Integer", "(", "105", ")", ")", ";", "literals", ".", "put", "(", "new", "ANTLRHashString", "(", "\"for\"", ",", "this", ")", ",", "new", "Integer", "(", "136", ")", ")", ";", "literals", ".", "put", "(", "new", "ANTLRHashString", "(", "\"extends\"", ",", "this", ")", ",", "new", "Integer", "(", "94", ")", ")", ";", "literals", ".", "put", "(", "new", "ANTLRHashString", "(", "\"boolean\"", ",", "this", ")", ",", "new", "Integer", "(", "101", ")", ")", ";", "literals", ".", "put", "(", "new", "ANTLRHashString", "(", "\"char\"", ",", "this", ")", ",", "new", "Integer", "(", "103", ")", ")", ";", "literals", ".", "put", "(", "new", "ANTLRHashString", "(", "\"private\"", ",", "this", ")", ",", "new", "Integer", "(", "111", ")", ")", ";", "literals", ".", "put", "(", "new", "ANTLRHashString", "(", "\"default\"", ",", "this", ")", ",", "new", "Integer", "(", "125", ")", ")", ";", "literals", ".", "put", "(", "new", "ANTLRHashString", "(", "\"false\"", ",", "this", ")", ",", "new", "Integer", "(", "152", ")", ")", ";", "literals", ".", "put", "(", "new", "ANTLRHashString", "(", "\"this\"", ",", "this", ")", ",", "new", "Integer", "(", "128", ")", ")", ";", "literals", ".", "put", "(", "new", "ANTLRHashString", "(", "\"static\"", ",", "this", ")", ",", "new", "Integer", "(", "80", ")", ")", ";", "literals", ".", "put", "(", "new", "ANTLRHashString", "(", "\"abstract\"", ",", "this", ")", ",", "new", "Integer", "(", "38", ")", ")", ";", "literals", ".", "put", "(", "new", "ANTLRHashString", "(", "\"continue\"", ",", "this", ")", ",", "new", "Integer", "(", "140", ")", ")", ";", "literals", ".", "put", "(", "new", "ANTLRHashString", "(", "\"finally\"", ",", "this", ")", ",", "new", "Integer", "(", "147", ")", ")", ";", "literals", ".", "put", "(", "new", "ANTLRHashString", "(", "\"else\"", ",", "this", ")", ",", "new", "Integer", "(", "133", ")", ")", ";", "literals", ".", "put", "(", "new", "ANTLRHashString", "(", "\"import\"", ",", "this", ")", ",", "new", "Integer", "(", "79", ")", ")", ";", "literals", ".", "put", "(", "new", "ANTLRHashString", "(", "\"in\"", ",", "this", ")", ",", "new", "Integer", "(", "137", ")", ")", ";", "literals", ".", "put", "(", "new", "ANTLRHashString", "(", "\"void\"", ",", "this", ")", ",", "new", "Integer", "(", "100", ")", ")", ";", "literals", ".", "put", "(", "new", "ANTLRHashString", "(", "\"switch\"", ",", "this", ")", ",", "new", "Integer", "(", "135", ")", ")", ";", "literals", ".", "put", "(", "new", "ANTLRHashString", "(", "\"true\"", ",", "this", ")", ",", "new", "Integer", "(", "156", ")", ")", ";", "literals", ".", "put", "(", "new", "ANTLRHashString", "(", "\"long\"", ",", "this", ")", ",", "new", "Integer", "(", "107", ")", ")", ";", "}", "public", "Token", "nextToken", "(", ")", "throws", "TokenStreamException", "{", "Token", "theRetToken", "=", "null", ";", "tryAgain", ":", "for", "(", ";", ";", ")", "{", "Token", "_token", "=", "null", ";", "int", "_ttype", "=", "Token", ".", "INVALID_TYPE", ";", "resetText", "(", ")", ";", "try", "{", "try", "{", "switch", "(", "LA", "(", "1", ")", ")", "{", "case", "'('", ":", "{", "mLPAREN", "(", "true", ")", ";", "theRetToken", "=", "_returnToken", ";", "break", ";", "}", "case", "')'", ":", "{", "mRPAREN", "(", "true", ")", ";", "theRetToken", "=", "_returnToken", ";", "break", ";", "}", "case", "'['", ":", "{", "mLBRACK", "(", "true", ")", ";", "theRetToken", "=", "_returnToken", ";", "break", ";", "}", "case", "']'", ":", "{", "mRBRACK", "(", "true", ")", ";", "theRetToken", "=", "_returnToken", ";", "break", ";", "}", "case", "'{'", ":", "{", "mLCURLY", "(", "true", ")", ";", "theRetToken", "=", "_returnToken", ";", "break", ";", "}", "case", "'}'", ":", "{", "mRCURLY", "(", "true", ")", ";", "theRetToken", "=", "_returnToken", ";", "break", ";", "}", "case", "':'", ":", "{", "mCOLON", "(", "true", ")", ";", "theRetToken", "=", "_returnToken", ";", "break", ";", "}", "case", "','", ":", "{", "mCOMMA", "(", "true", ")", ";", "theRetToken", "=", "_returnToken", ";", "break", ";", "}", "case", "'~'", ":", "{", "mBNOT", "(", "true", ")", ";", "theRetToken", "=", "_returnToken", ";", "break", ";", "}", "case", "';'", ":", "{", "mSEMI", "(", "true", ")", ";", "theRetToken", "=", "_returnToken", ";", "break", ";", "}", "case", "'\\t'", ":", "case", "'", "'", ":", "case", "'", "'", ":", "case", "'\\\\'", ":", "{", "mWS", "(", "true", ")", ";", "theRetToken", "=", "_returnToken", ";", "break", ";", "}", "case", "'\\n'", ":", "case", "'\\r'", ":", "{", "mNLS", "(", "true", ")", ";", "theRetToken", "=", "_returnToken", ";", "break", ";", "}", "case", "'\"'", ":", "case", "'\\''", ":", "{", "mSTRING_LITERAL", "(", "true", ")", ";", "theRetToken", "=", "_returnToken", ";", "break", ";", "}", "case", "'0'", ":", "case", "'1'", ":", "case", "'2'", ":", "case", "'3'", ":", "case", "'4'", ":", "case", "'5'", ":", "case", "'6'", ":", "case", "'7'", ":", "case", "'8'", ":", "case", "'9'", ":", "{", "mNUM_INT", "(", "true", ")", ";", "theRetToken", "=", "_returnToken", ";", "break", ";", "}", "case", "'@'", ":", "{", "mAT", "(", "true", ")", ";", "theRetToken", "=", "_returnToken", ";", "break", ";", "}", "default", ":", "if", "(", "(", "LA", "(", "1", ")", "==", "'>'", ")", "&&", "(", "LA", "(", "2", ")", "==", "'>'", ")", "&&", "(", "LA", "(", "3", ")", "==", "'>'", ")", "&&", "(", "LA", "(", "4", ")", "==", "'='", ")", ")", "{", "mBSR_ASSIGN", "(", "true", ")", ";", "theRetToken", "=", "_returnToken", ";", "}", "else", "if", "(", "(", "LA", "(", "1", ")", "==", "'<'", ")", "&&", "(", "LA", "(", "2", ")", "==", "'='", ")", "&&", "(", "LA", "(", "3", ")", "==", "'>'", ")", ")", "{", "mCOMPARE_TO", "(", "true", ")", ";", "theRetToken", "=", "_returnToken", ";", "}", "else", "if", "(", "(", "LA", "(", "1", ")", "==", "'='", ")", "&&", "(", "LA", "(", "2", ")", "==", "'='", ")", "&&", "(", "LA", "(", "3", ")", "==", "'='", ")", ")", "{", "mIDENTICAL", "(", "true", ")", ";", "theRetToken", "=", "_returnToken", ";", "}", "else", "if", "(", "(", "LA", "(", "1", ")", "==", "'!'", ")", "&&", "(", "LA", "(", "2", ")", "==", "'='", ")", "&&", "(", "LA", "(", "3", ")", "==", "'='", ")", ")", "{", "mNOT_IDENTICAL", "(", "true", ")", ";", "theRetToken", "=", "_returnToken", ";", "}", "else", "if", "(", "(", "LA", "(", "1", ")", "==", "'>'", ")", "&&", "(", "LA", "(", "2", ")", "==", "'>'", ")", "&&", "(", "LA", "(", "3", ")", "==", "'='", ")", ")", "{", "mSR_ASSIGN", "(", "true", ")", ";", "theRetToken", "=", "_returnToken", ";", "}", "else", "if", "(", "(", "LA", "(", "1", ")", "==", "'>'", ")", "&&", "(", "LA", "(", "2", ")", "==", "'>'", ")", "&&", "(", "LA", "(", "3", ")", "==", "'>'", ")", "&&", "(", "true", ")", ")", "{", "mBSR", "(", "true", ")", ";", "theRetToken", "=", "_returnToken", ";", "}", "else", "if", "(", "(", "LA", "(", "1", ")", "==", "'<'", ")", "&&", "(", "LA", "(", "2", ")", "==", "'<'", ")", "&&", "(", "LA", "(", "3", ")", "==", "'='", ")", ")", "{", "mSL_ASSIGN", "(", "true", ")", ";", "theRetToken", "=", "_returnToken", ";", "}", "else", "if", "(", "(", "LA", "(", "1", ")", "==", "'.'", ")", "&&", "(", "LA", "(", "2", ")", "==", "'.'", ")", "&&", "(", "LA", "(", "3", ")", "==", "'<'", ")", ")", "{", "mRANGE_EXCLUSIVE", "(", "true", ")", ";", "theRetToken", "=", "_returnToken", ";", "}", "else", "if", "(", "(", "LA", "(", "1", ")", "==", "'.'", ")", "&&", "(", "LA", "(", "2", ")", "==", "'.'", ")", "&&", "(", "LA", "(", "3", ")", "==", "'.'", ")", ")", "{", "mTRIPLE_DOT", "(", "true", ")", ";", "theRetToken", "=", "_returnToken", ";", "}", "else", "if", "(", "(", "LA", "(", "1", ")", "==", "'='", ")", "&&", "(", "LA", "(", "2", ")", "==", "'='", ")", "&&", "(", "LA", "(", "3", ")", "==", "'~'", ")", ")", "{", "mREGEX_MATCH", "(", "true", ")", ";", "theRetToken", "=", "_returnToken", ";", "}", "else", "if", "(", "(", "LA", "(", "1", ")", "==", "'*'", ")", "&&", "(", "LA", "(", "2", ")", "==", "'*'", ")", "&&", "(", "LA", "(", "3", ")", "==", "'='", ")", ")", "{", "mSTAR_STAR_ASSIGN", "(", "true", ")", ";", "theRetToken", "=", "_returnToken", ";", "}", "else", "if", "(", "(", "LA", "(", "1", ")", "==", "'='", ")", "&&", "(", "LA", "(", "2", ")", "==", "'='", ")", "&&", "(", "true", ")", ")", "{", "mEQUAL", "(", "true", ")", ";", "theRetToken", "=", "_returnToken", ";", "}", "else", "if", "(", "(", "LA", "(", "1", ")", "==", "'!'", ")", "&&", "(", "LA", "(", "2", ")", "==", "'='", ")", "&&", "(", "true", ")", ")", "{", "mNOT_EQUAL", "(", "true", ")", ";", "theRetToken", "=", "_returnToken", ";", "}", "else", "if", "(", "(", "LA", "(", "1", ")", "==", "'+'", ")", "&&", "(", "LA", "(", "2", ")", "==", "'='", ")", ")", "{", "mPLUS_ASSIGN", "(", "true", ")", ";", "theRetToken", "=", "_returnToken", ";", "}", "else", "if", "(", "(", "LA", "(", "1", ")", "==", "'+'", ")", "&&", "(", "LA", "(", "2", ")", "==", "'+'", ")", ")", "{", "mINC", "(", "true", ")", ";", "theRetToken", "=", "_returnToken", ";", "}", "else", "if", "(", "(", "LA", "(", "1", ")", "==", "'-'", ")", "&&", "(", "LA", "(", "2", ")", "==", "'='", ")", ")", "{", "mMINUS_ASSIGN", "(", "true", ")", ";", "theRetToken", "=", "_returnToken", ";", "}", "else", "if", "(", "(", "LA", "(", "1", ")", "==", "'-'", ")", "&&", "(", "LA", "(", "2", ")", "==", "'-'", ")", ")", "{", "mDEC", "(", "true", ")", ";", "theRetToken", "=", "_returnToken", ";", "}", "else", "if", "(", "(", "LA", "(", "1", ")", "==", "'*'", ")", "&&", "(", "LA", "(", "2", ")", "==", "'='", ")", ")", "{", "mSTAR_ASSIGN", "(", "true", ")", ";", "theRetToken", "=", "_returnToken", ";", "}", "else", "if", "(", "(", "LA", "(", "1", ")", "==", "'%'", ")", "&&", "(", "LA", "(", "2", ")", "==", "'='", ")", ")", "{", "mMOD_ASSIGN", "(", "true", ")", ";", "theRetToken", "=", "_returnToken", ";", "}", "else", "if", "(", "(", "LA", "(", "1", ")", "==", "'>'", ")", "&&", "(", "LA", "(", "2", ")", "==", "'>'", ")", "&&", "(", "true", ")", ")", "{", "mSR", "(", "true", ")", ";", "theRetToken", "=", "_returnToken", ";", "}", "else", "if", "(", "(", "LA", "(", "1", ")", "==", "'>'", ")", "&&", "(", "LA", "(", "2", ")", "==", "'='", ")", ")", "{", "mGE", "(", "true", ")", ";", "theRetToken", "=", "_returnToken", ";", "}", "else", "if", "(", "(", "LA", "(", "1", ")", "==", "'<'", ")", "&&", "(", "LA", "(", "2", ")", "==", "'<'", ")", "&&", "(", "true", ")", ")", "{", "mSL", "(", "true", ")", ";", "theRetToken", "=", "_returnToken", ";", "}", "else", "if", "(", "(", "LA", "(", "1", ")", "==", "'<'", ")", "&&", "(", "LA", "(", "2", ")", "==", "'='", ")", "&&", "(", "true", ")", ")", "{", "mLE", "(", "true", ")", ";", "theRetToken", "=", "_returnToken", ";", "}", "else", "if", "(", "(", "LA", "(", "1", ")", "==", "'^'", ")", "&&", "(", "LA", "(", "2", ")", "==", "'='", ")", ")", "{", "mBXOR_ASSIGN", "(", "true", ")", ";", "theRetToken", "=", "_returnToken", ";", "}", "else", "if", "(", "(", "LA", "(", "1", ")", "==", "'|'", ")", "&&", "(", "LA", "(", "2", ")", "==", "'='", ")", ")", "{", "mBOR_ASSIGN", "(", "true", ")", ";", "theRetToken", "=", "_returnToken", ";", "}", "else", "if", "(", "(", "LA", "(", "1", ")", "==", "'|'", ")", "&&", "(", "LA", "(", "2", ")", "==", "'|'", ")", ")", "{", "mLOR", "(", "true", ")", ";", "theRetToken", "=", "_returnToken", ";", "}", "else", "if", "(", "(", "LA", "(", "1", ")", "==", "'&'", ")", "&&", "(", "LA", "(", "2", ")", "==", "'='", ")", ")", "{", "mBAND_ASSIGN", "(", "true", ")", ";", "theRetToken", "=", "_returnToken", ";", "}", "else", "if", "(", "(", "LA", "(", "1", ")", "==", "'&'", ")", "&&", "(", "LA", "(", "2", ")", "==", "'&'", ")", ")", "{", "mLAND", "(", "true", ")", ";", "theRetToken", "=", "_returnToken", ";", "}", "else", "if", "(", "(", "LA", "(", "1", ")", "==", "'.'", ")", "&&", "(", "LA", "(", "2", ")", "==", "'.'", ")", "&&", "(", "true", ")", ")", "{", "mRANGE_INCLUSIVE", "(", "true", ")", ";", "theRetToken", "=", "_returnToken", ";", "}", "else", "if", "(", "(", "LA", "(", "1", ")", "==", "'*'", ")", "&&", "(", "LA", "(", "2", ")", "==", "'.'", ")", ")", "{", "mSPREAD_DOT", "(", "true", ")", ";", "theRetToken", "=", "_returnToken", ";", "}", "else", "if", "(", "(", "LA", "(", "1", ")", "==", "'?'", ")", "&&", "(", "LA", "(", "2", ")", "==", "'.'", ")", ")", "{", "mOPTIONAL_DOT", "(", "true", ")", ";", "theRetToken", "=", "_returnToken", ";", "}", "else", "if", "(", "(", "LA", "(", "1", ")", "==", "'?'", ")", "&&", "(", "LA", "(", "2", ")", "==", "':'", ")", ")", "{", "mELVIS_OPERATOR", "(", "true", ")", ";", "theRetToken", "=", "_returnToken", ";", "}", "else", "if", "(", "(", "LA", "(", "1", ")", "==", "'.'", ")", "&&", "(", "LA", "(", "2", ")", "==", "'&'", ")", ")", "{", "mMEMBER_POINTER", "(", "true", ")", ";", "theRetToken", "=", "_returnToken", ";", "}", "else", "if", "(", "(", "LA", "(", "1", ")", "==", "'='", ")", "&&", "(", "LA", "(", "2", ")", "==", "'~'", ")", ")", "{", "mREGEX_FIND", "(", "true", ")", ";", "theRetToken", "=", "_returnToken", ";", "}", "else", "if", "(", "(", "LA", "(", "1", ")", "==", "'*'", ")", "&&", "(", "LA", "(", "2", ")", "==", "'*'", ")", "&&", "(", "true", ")", ")", "{", "mSTAR_STAR", "(", "true", ")", ";", "theRetToken", "=", "_returnToken", ";", "}", "else", "if", "(", "(", "LA", "(", "1", ")", "==", "'-'", ")", "&&", "(", "LA", "(", "2", ")", "==", "'>'", ")", ")", "{", "mCLOSABLE_BLOCK_OP", "(", "true", ")", ";", "theRetToken", "=", "_returnToken", ";", "}", "else", "if", "(", "(", "LA", "(", "1", ")", "==", "'/'", ")", "&&", "(", "LA", "(", "2", ")", "==", "'/'", ")", ")", "{", "mSL_COMMENT", "(", "true", ")", ";", "theRetToken", "=", "_returnToken", ";", "}", "else", "if", "(", "(", "LA", "(", "1", ")", "==", "'/'", ")", "&&", "(", "LA", "(", "2", ")", "==", "'*'", ")", ")", "{", "mML_COMMENT", "(", "true", ")", ";", "theRetToken", "=", "_returnToken", ";", "}", "else", "if", "(", "(", "(", "LA", "(", "1", ")", "==", "'$'", ")", "&&", "(", "LA", "(", "2", ")", "==", "'/'", ")", ")", "&&", "(", "allowRegexpLiteral", "(", ")", ")", ")", "{", "mDOLLAR_REGEXP_LITERAL", "(", "true", ")", ";", "theRetToken", "=", "_returnToken", ";", "}", "else", "if", "(", "(", "LA", "(", "1", ")", "==", "'?'", ")", "&&", "(", "true", ")", ")", "{", "mQUESTION", "(", "true", ")", ";", "theRetToken", "=", "_returnToken", ";", "}", "else", "if", "(", "(", "LA", "(", "1", ")", "==", "'.'", ")", "&&", "(", "true", ")", ")", "{", "mDOT", "(", "true", ")", ";", "theRetToken", "=", "_returnToken", ";", "}", "else", "if", "(", "(", "LA", "(", "1", ")", "==", "'='", ")", "&&", "(", "true", ")", ")", "{", "mASSIGN", "(", "true", ")", ";", "theRetToken", "=", "_returnToken", ";", "}", "else", "if", "(", "(", "LA", "(", "1", ")", "==", "'!'", ")", "&&", "(", "true", ")", ")", "{", "mLNOT", "(", "true", ")", ";", "theRetToken", "=", "_returnToken", ";", "}", "else", "if", "(", "(", "LA", "(", "1", ")", "==", "'+'", ")", "&&", "(", "true", ")", ")", "{", "mPLUS", "(", "true", ")", ";", "theRetToken", "=", "_returnToken", ";", "}", "else", "if", "(", "(", "LA", "(", "1", ")", "==", "'-'", ")", "&&", "(", "true", ")", ")", "{", "mMINUS", "(", "true", ")", ";", "theRetToken", "=", "_returnToken", ";", "}", "else", "if", "(", "(", "LA", "(", "1", ")", "==", "'*'", ")", "&&", "(", "true", ")", ")", "{", "mSTAR", "(", "true", ")", ";", "theRetToken", "=", "_returnToken", ";", "}", "else", "if", "(", "(", "LA", "(", "1", ")", "==", "'%'", ")", "&&", "(", "true", ")", ")", "{", "mMOD", "(", "true", ")", ";", "theRetToken", "=", "_returnToken", ";", "}", "else", "if", "(", "(", "LA", "(", "1", ")", "==", "'>'", ")", "&&", "(", "true", ")", ")", "{", "mGT", "(", "true", ")", ";", "theRetToken", "=", "_returnToken", ";", "}", "else", "if", "(", "(", "LA", "(", "1", ")", "==", "'<'", ")", "&&", "(", "true", ")", ")", "{", "mLT", "(", "true", ")", ";", "theRetToken", "=", "_returnToken", ";", "}", "else", "if", "(", "(", "LA", "(", "1", ")", "==", "'^'", ")", "&&", "(", "true", ")", ")", "{", "mBXOR", "(", "true", ")", ";", "theRetToken", "=", "_returnToken", ";", "}", "else", "if", "(", "(", "LA", "(", "1", ")", "==", "'|'", ")", "&&", "(", "true", ")", ")", "{", "mBOR", "(", "true", ")", ";", "theRetToken", "=", "_returnToken", ";", "}", "else", "if", "(", "(", "LA", "(", "1", ")", "==", "'&'", ")", "&&", "(", "true", ")", ")", "{", "mBAND", "(", "true", ")", ";", "theRetToken", "=", "_returnToken", ";", "}", "else", "if", "(", "(", "(", "LA", "(", "1", ")", "==", "'#'", ")", ")", "&&", "(", "getLine", "(", ")", "==", "1", "&&", "getColumn", "(", ")", "==", "1", ")", ")", "{", "mSH_COMMENT", "(", "true", ")", ";", "theRetToken", "=", "_returnToken", ";", "}", "else", "if", "(", "(", "LA", "(", "1", ")", "==", "'/'", ")", "&&", "(", "true", ")", ")", "{", "mREGEXP_LITERAL", "(", "true", ")", ";", "theRetToken", "=", "_returnToken", ";", "}", "else", "if", "(", "(", "_tokenSet_0", ".", "member", "(", "LA", "(", "1", ")", ")", ")", "&&", "(", "true", ")", ")", "{", "mIDENT", "(", "true", ")", ";", "theRetToken", "=", "_returnToken", ";", "}", "else", "{", "if", "(", "LA", "(", "1", ")", "==", "EOF_CHAR", ")", "{", "uponEOF", "(", ")", ";", "_returnToken", "=", "makeToken", "(", "Token", ".", "EOF_TYPE", ")", ";", "}", "else", "{", "throw", "new", "NoViableAltForCharException", "(", "(", "char", ")", "LA", "(", "1", ")", ",", "getFilename", "(", ")", ",", "getLine", "(", ")", ",", "getColumn", "(", ")", ")", ";", "}", "}", "}", "if", "(", "_returnToken", "==", "null", ")", "continue", "tryAgain", ";", "_ttype", "=", "_returnToken", ".", "getType", "(", ")", ";", "_returnToken", ".", "setType", "(", "_ttype", ")", ";", "return", "_returnToken", ";", "}", "catch", "(", "RecognitionException", "e", ")", "{", "throw", "new", "TokenStreamRecognitionException", "(", "e", ")", ";", "}", "}", "catch", "(", "CharStreamException", "cse", ")", "{", "if", "(", "cse", "instanceof", "CharStreamIOException", ")", "{", "throw", "new", "TokenStreamIOException", "(", "(", "(", "CharStreamIOException", ")", "cse", ")", ".", "io", ")", ";", "}", "else", "{", "throw", "new", "TokenStreamException", "(", "cse", ".", "getMessage", "(", ")", ")", ";", "}", "}", "}", "}", "public", "final", "void", "mQUESTION", "(", "boolean", "_createToken", ")", "throws", "RecognitionException", ",", "CharStreamException", ",", "TokenStreamException", "{", "int", "_ttype", ";", "Token", "_token", "=", "null", ";", "int", "_begin", "=", "text", ".", "length", "(", ")", ";", "_ttype", "=", "QUESTION", ";", "int", "_saveIndex", ";", "match", "(", "'?'", ")", ";", "if", "(", "_createToken", "&&", "_token", "==", "null", "&&", "_ttype", "!=", "Token", ".", "SKIP", ")", "{", "_token", "=", "makeToken", "(", "_ttype", ")", ";", "_token", ".", "setText", "(", "new", "String", "(", "text", ".", "getBuffer", "(", ")", ",", "_begin", ",", "text", ".", "length", "(", ")", "-", "_begin", ")", ")", ";", "}", "_returnToken", "=", "_token", ";", "}", "public", "final", "void", "mLPAREN", "(", "boolean", "_createToken", ")", "throws", "RecognitionException", ",", "CharStreamException", ",", "TokenStreamException", "{", "int", "_ttype", ";", "Token", "_token", "=", "null", ";", "int", "_begin", "=", "text", ".", "length", "(", ")", ";", "_ttype", "=", "LPAREN", ";", "int", "_saveIndex", ";", "match", "(", "'('", ")", ";", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "++", "parenLevel", ";", "}", "if", "(", "_createToken", "&&", "_token", "==", "null", "&&", "_ttype", "!=", "Token", ".", "SKIP", ")", "{", "_token", "=", "makeToken", "(", "_ttype", ")", ";", "_token", ".", "setText", "(", "new", "String", "(", "text", ".", "getBuffer", "(", ")", ",", "_begin", ",", "text", ".", "length", "(", ")", "-", "_begin", ")", ")", ";", "}", "_returnToken", "=", "_token", ";", "}", "public", "final", "void", "mRPAREN", "(", "boolean", "_createToken", ")", "throws", "RecognitionException", ",", "CharStreamException", ",", "TokenStreamException", "{", "int", "_ttype", ";", "Token", "_token", "=", "null", ";", "int", "_begin", "=", "text", ".", "length", "(", ")", ";", "_ttype", "=", "RPAREN", ";", "int", "_saveIndex", ";", "match", "(", "')'", ")", ";", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "--", "parenLevel", ";", "}", "if", "(", "_createToken", "&&", "_token", "==", "null", "&&", "_ttype", "!=", "Token", ".", "SKIP", ")", "{", "_token", "=", "makeToken", "(", "_ttype", ")", ";", "_token", ".", "setText", "(", "new", "String", "(", "text", ".", "getBuffer", "(", ")", ",", "_begin", ",", "text", ".", "length", "(", ")", "-", "_begin", ")", ")", ";", "}", "_returnToken", "=", "_token", ";", "}", "public", "final", "void", "mLBRACK", "(", "boolean", "_createToken", ")", "throws", "RecognitionException", ",", "CharStreamException", ",", "TokenStreamException", "{", "int", "_ttype", ";", "Token", "_token", "=", "null", ";", "int", "_begin", "=", "text", ".", "length", "(", ")", ";", "_ttype", "=", "LBRACK", ";", "int", "_saveIndex", ";", "match", "(", "'['", ")", ";", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "++", "parenLevel", ";", "}", "if", "(", "_createToken", "&&", "_token", "==", "null", "&&", "_ttype", "!=", "Token", ".", "SKIP", ")", "{", "_token", "=", "makeToken", "(", "_ttype", ")", ";", "_token", ".", "setText", "(", "new", "String", "(", "text", ".", "getBuffer", "(", ")", ",", "_begin", ",", "text", ".", "length", "(", ")", "-", "_begin", ")", ")", ";", "}", "_returnToken", "=", "_token", ";", "}", "public", "final", "void", "mRBRACK", "(", "boolean", "_createToken", ")", "throws", "RecognitionException", ",", "CharStreamException", ",", "TokenStreamException", "{", "int", "_ttype", ";", "Token", "_token", "=", "null", ";", "int", "_begin", "=", "text", ".", "length", "(", ")", ";", "_ttype", "=", "RBRACK", ";", "int", "_saveIndex", ";", "match", "(", "']'", ")", ";", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "--", "parenLevel", ";", "}", "if", "(", "_createToken", "&&", "_token", "==", "null", "&&", "_ttype", "!=", "Token", ".", "SKIP", ")", "{", "_token", "=", "makeToken", "(", "_ttype", ")", ";", "_token", ".", "setText", "(", "new", "String", "(", "text", ".", "getBuffer", "(", ")", ",", "_begin", ",", "text", ".", "length", "(", ")", "-", "_begin", ")", ")", ";", "}", "_returnToken", "=", "_token", ";", "}", "public", "final", "void", "mLCURLY", "(", "boolean", "_createToken", ")", "throws", "RecognitionException", ",", "CharStreamException", ",", "TokenStreamException", "{", "int", "_ttype", ";", "Token", "_token", "=", "null", ";", "int", "_begin", "=", "text", ".", "length", "(", ")", ";", "_ttype", "=", "LCURLY", ";", "int", "_saveIndex", ";", "match", "(", "'{'", ")", ";", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "pushParenLevel", "(", ")", ";", "}", "if", "(", "_createToken", "&&", "_token", "==", "null", "&&", "_ttype", "!=", "Token", ".", "SKIP", ")", "{", "_token", "=", "makeToken", "(", "_ttype", ")", ";", "_token", ".", "setText", "(", "new", "String", "(", "text", ".", "getBuffer", "(", ")", ",", "_begin", ",", "text", ".", "length", "(", ")", "-", "_begin", ")", ")", ";", "}", "_returnToken", "=", "_token", ";", "}", "public", "final", "void", "mRCURLY", "(", "boolean", "_createToken", ")", "throws", "RecognitionException", ",", "CharStreamException", ",", "TokenStreamException", "{", "int", "_ttype", ";", "Token", "_token", "=", "null", ";", "int", "_begin", "=", "text", ".", "length", "(", ")", ";", "_ttype", "=", "RCURLY", ";", "int", "_saveIndex", ";", "match", "(", "'}'", ")", ";", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "popParenLevel", "(", ")", ";", "if", "(", "stringCtorState", "!=", "0", ")", "restartStringCtor", "(", "true", ")", ";", "}", "if", "(", "_createToken", "&&", "_token", "==", "null", "&&", "_ttype", "!=", "Token", ".", "SKIP", ")", "{", "_token", "=", "makeToken", "(", "_ttype", ")", ";", "_token", ".", "setText", "(", "new", "String", "(", "text", ".", "getBuffer", "(", ")", ",", "_begin", ",", "text", ".", "length", "(", ")", "-", "_begin", ")", ")", ";", "}", "_returnToken", "=", "_token", ";", "}", "public", "final", "void", "mCOLON", "(", "boolean", "_createToken", ")", "throws", "RecognitionException", ",", "CharStreamException", ",", "TokenStreamException", "{", "int", "_ttype", ";", "Token", "_token", "=", "null", ";", "int", "_begin", "=", "text", ".", "length", "(", ")", ";", "_ttype", "=", "COLON", ";", "int", "_saveIndex", ";", "match", "(", "':'", ")", ";", "if", "(", "_createToken", "&&", "_token", "==", "null", "&&", "_ttype", "!=", "Token", ".", "SKIP", ")", "{", "_token", "=", "makeToken", "(", "_ttype", ")", ";", "_token", ".", "setText", "(", "new", "String", "(", "text", ".", "getBuffer", "(", ")", ",", "_begin", ",", "text", ".", "length", "(", ")", "-", "_begin", ")", ")", ";", "}", "_returnToken", "=", "_token", ";", "}", "public", "final", "void", "mCOMMA", "(", "boolean", "_createToken", ")", "throws", "RecognitionException", ",", "CharStreamException", ",", "TokenStreamException", "{", "int", "_ttype", ";", "Token", "_token", "=", "null", ";", "int", "_begin", "=", "text", ".", "length", "(", ")", ";", "_ttype", "=", "COMMA", ";", "int", "_saveIndex", ";", "match", "(", "','", ")", ";", "if", "(", "_createToken", "&&", "_token", "==", "null", "&&", "_ttype", "!=", "Token", ".", "SKIP", ")", "{", "_token", "=", "makeToken", "(", "_ttype", ")", ";", "_token", ".", "setText", "(", "new", "String", "(", "text", ".", "getBuffer", "(", ")", ",", "_begin", ",", "text", ".", "length", "(", ")", "-", "_begin", ")", ")", ";", "}", "_returnToken", "=", "_token", ";", "}", "public", "final", "void", "mDOT", "(", "boolean", "_createToken", ")", "throws", "RecognitionException", ",", "CharStreamException", ",", "TokenStreamException", "{", "int", "_ttype", ";", "Token", "_token", "=", "null", ";", "int", "_begin", "=", "text", ".", "length", "(", ")", ";", "_ttype", "=", "DOT", ";", "int", "_saveIndex", ";", "match", "(", "'.'", ")", ";", "if", "(", "_createToken", "&&", "_token", "==", "null", "&&", "_ttype", "!=", "Token", ".", "SKIP", ")", "{", "_token", "=", "makeToken", "(", "_ttype", ")", ";", "_token", ".", "setText", "(", "new", "String", "(", "text", ".", "getBuffer", "(", ")", ",", "_begin", ",", "text", ".", "length", "(", ")", "-", "_begin", ")", ")", ";", "}", "_returnToken", "=", "_token", ";", "}", "public", "final", "void", "mASSIGN", "(", "boolean", "_createToken", ")", "throws", "RecognitionException", ",", "CharStreamException", ",", "TokenStreamException", "{", "int", "_ttype", ";", "Token", "_token", "=", "null", ";", "int", "_begin", "=", "text", ".", "length", "(", ")", ";", "_ttype", "=", "ASSIGN", ";", "int", "_saveIndex", ";", "match", "(", "'='", ")", ";", "if", "(", "_createToken", "&&", "_token", "==", "null", "&&", "_ttype", "!=", "Token", ".", "SKIP", ")", "{", "_token", "=", "makeToken", "(", "_ttype", ")", ";", "_token", ".", "setText", "(", "new", "String", "(", "text", ".", "getBuffer", "(", ")", ",", "_begin", ",", "text", ".", "length", "(", ")", "-", "_begin", ")", ")", ";", "}", "_returnToken", "=", "_token", ";", "}", "public", "final", "void", "mCOMPARE_TO", "(", "boolean", "_createToken", ")", "throws", "RecognitionException", ",", "CharStreamException", ",", "TokenStreamException", "{", "int", "_ttype", ";", "Token", "_token", "=", "null", ";", "int", "_begin", "=", "text", ".", "length", "(", ")", ";", "_ttype", "=", "COMPARE_TO", ";", "int", "_saveIndex", ";", "match", "(", "\"<=>\"", ")", ";", "if", "(", "_createToken", "&&", "_token", "==", "null", "&&", "_ttype", "!=", "Token", ".", "SKIP", ")", "{", "_token", "=", "makeToken", "(", "_ttype", ")", ";", "_token", ".", "setText", "(", "new", "String", "(", "text", ".", "getBuffer", "(", ")", ",", "_begin", ",", "text", ".", "length", "(", ")", "-", "_begin", ")", ")", ";", "}", "_returnToken", "=", "_token", ";", "}", "public", "final", "void", "mEQUAL", "(", "boolean", "_createToken", ")", "throws", "RecognitionException", ",", "CharStreamException", ",", "TokenStreamException", "{", "int", "_ttype", ";", "Token", "_token", "=", "null", ";", "int", "_begin", "=", "text", ".", "length", "(", ")", ";", "_ttype", "=", "EQUAL", ";", "int", "_saveIndex", ";", "match", "(", "\"==\"", ")", ";", "if", "(", "_createToken", "&&", "_token", "==", "null", "&&", "_ttype", "!=", "Token", ".", "SKIP", ")", "{", "_token", "=", "makeToken", "(", "_ttype", ")", ";", "_token", ".", "setText", "(", "new", "String", "(", "text", ".", "getBuffer", "(", ")", ",", "_begin", ",", "text", ".", "length", "(", ")", "-", "_begin", ")", ")", ";", "}", "_returnToken", "=", "_token", ";", "}", "public", "final", "void", "mIDENTICAL", "(", "boolean", "_createToken", ")", "throws", "RecognitionException", ",", "CharStreamException", ",", "TokenStreamException", "{", "int", "_ttype", ";", "Token", "_token", "=", "null", ";", "int", "_begin", "=", "text", ".", "length", "(", ")", ";", "_ttype", "=", "IDENTICAL", ";", "int", "_saveIndex", ";", "match", "(", "\"===\"", ")", ";", "if", "(", "_createToken", "&&", "_token", "==", "null", "&&", "_ttype", "!=", "Token", ".", "SKIP", ")", "{", "_token", "=", "makeToken", "(", "_ttype", ")", ";", "_token", ".", "setText", "(", "new", "String", "(", "text", ".", "getBuffer", "(", ")", ",", "_begin", ",", "text", ".", "length", "(", ")", "-", "_begin", ")", ")", ";", "}", "_returnToken", "=", "_token", ";", "}", "public", "final", "void", "mLNOT", "(", "boolean", "_createToken", ")", "throws", "RecognitionException", ",", "CharStreamException", ",", "TokenStreamException", "{", "int", "_ttype", ";", "Token", "_token", "=", "null", ";", "int", "_begin", "=", "text", ".", "length", "(", ")", ";", "_ttype", "=", "LNOT", ";", "int", "_saveIndex", ";", "match", "(", "'!'", ")", ";", "if", "(", "_createToken", "&&", "_token", "==", "null", "&&", "_ttype", "!=", "Token", ".", "SKIP", ")", "{", "_token", "=", "makeToken", "(", "_ttype", ")", ";", "_token", ".", "setText", "(", "new", "String", "(", "text", ".", "getBuffer", "(", ")", ",", "_begin", ",", "text", ".", "length", "(", ")", "-", "_begin", ")", ")", ";", "}", "_returnToken", "=", "_token", ";", "}", "public", "final", "void", "mBNOT", "(", "boolean", "_createToken", ")", "throws", "RecognitionException", ",", "CharStreamException", ",", "TokenStreamException", "{", "int", "_ttype", ";", "Token", "_token", "=", "null", ";", "int", "_begin", "=", "text", ".", "length", "(", ")", ";", "_ttype", "=", "BNOT", ";", "int", "_saveIndex", ";", "match", "(", "'~'", ")", ";", "if", "(", "_createToken", "&&", "_token", "==", "null", "&&", "_ttype", "!=", "Token", ".", "SKIP", ")", "{", "_token", "=", "makeToken", "(", "_ttype", ")", ";", "_token", ".", "setText", "(", "new", "String", "(", "text", ".", "getBuffer", "(", ")", ",", "_begin", ",", "text", ".", "length", "(", ")", "-", "_begin", ")", ")", ";", "}", "_returnToken", "=", "_token", ";", "}", "public", "final", "void", "mNOT_EQUAL", "(", "boolean", "_createToken", ")", "throws", "RecognitionException", ",", "CharStreamException", ",", "TokenStreamException", "{", "int", "_ttype", ";", "Token", "_token", "=", "null", ";", "int", "_begin", "=", "text", ".", "length", "(", ")", ";", "_ttype", "=", "NOT_EQUAL", ";", "int", "_saveIndex", ";", "match", "(", "\"!=\"", ")", ";", "if", "(", "_createToken", "&&", "_token", "==", "null", "&&", "_ttype", "!=", "Token", ".", "SKIP", ")", "{", "_token", "=", "makeToken", "(", "_ttype", ")", ";", "_token", ".", "setText", "(", "new", "String", "(", "text", ".", "getBuffer", "(", ")", ",", "_begin", ",", "text", ".", "length", "(", ")", "-", "_begin", ")", ")", ";", "}", "_returnToken", "=", "_token", ";", "}", "public", "final", "void", "mNOT_IDENTICAL", "(", "boolean", "_createToken", ")", "throws", "RecognitionException", ",", "CharStreamException", ",", "TokenStreamException", "{", "int", "_ttype", ";", "Token", "_token", "=", "null", ";", "int", "_begin", "=", "text", ".", "length", "(", ")", ";", "_ttype", "=", "NOT_IDENTICAL", ";", "int", "_saveIndex", ";", "match", "(", "\"!==\"", ")", ";", "if", "(", "_createToken", "&&", "_token", "==", "null", "&&", "_ttype", "!=", "Token", ".", "SKIP", ")", "{", "_token", "=", "makeToken", "(", "_ttype", ")", ";", "_token", ".", "setText", "(", "new", "String", "(", "text", ".", "getBuffer", "(", ")", ",", "_begin", ",", "text", ".", "length", "(", ")", "-", "_begin", ")", ")", ";", "}", "_returnToken", "=", "_token", ";", "}", "protected", "final", "void", "mDIV", "(", "boolean", "_createToken", ")", "throws", "RecognitionException", ",", "CharStreamException", ",", "TokenStreamException", "{", "int", "_ttype", ";", "Token", "_token", "=", "null", ";", "int", "_begin", "=", "text", ".", "length", "(", ")", ";", "_ttype", "=", "DIV", ";", "int", "_saveIndex", ";", "match", "(", "'/'", ")", ";", "if", "(", "_createToken", "&&", "_token", "==", "null", "&&", "_ttype", "!=", "Token", ".", "SKIP", ")", "{", "_token", "=", "makeToken", "(", "_ttype", ")", ";", "_token", ".", "setText", "(", "new", "String", "(", "text", ".", "getBuffer", "(", ")", ",", "_begin", ",", "text", ".", "length", "(", ")", "-", "_begin", ")", ")", ";", "}", "_returnToken", "=", "_token", ";", "}", "protected", "final", "void", "mDIV_ASSIGN", "(", "boolean", "_createToken", ")", "throws", "RecognitionException", ",", "CharStreamException", ",", "TokenStreamException", "{", "int", "_ttype", ";", "Token", "_token", "=", "null", ";", "int", "_begin", "=", "text", ".", "length", "(", ")", ";", "_ttype", "=", "DIV_ASSIGN", ";", "int", "_saveIndex", ";", "match", "(", "\"/=\"", ")", ";", "if", "(", "_createToken", "&&", "_token", "==", "null", "&&", "_ttype", "!=", "Token", ".", "SKIP", ")", "{", "_token", "=", "makeToken", "(", "_ttype", ")", ";", "_token", ".", "setText", "(", "new", "String", "(", "text", ".", "getBuffer", "(", ")", ",", "_begin", ",", "text", ".", "length", "(", ")", "-", "_begin", ")", ")", ";", "}", "_returnToken", "=", "_token", ";", "}", "public", "final", "void", "mPLUS", "(", "boolean", "_createToken", ")", "throws", "RecognitionException", ",", "CharStreamException", ",", "TokenStreamException", "{", "int", "_ttype", ";", "Token", "_token", "=", "null", ";", "int", "_begin", "=", "text", ".", "length", "(", ")", ";", "_ttype", "=", "PLUS", ";", "int", "_saveIndex", ";", "match", "(", "'+'", ")", ";", "if", "(", "_createToken", "&&", "_token", "==", "null", "&&", "_ttype", "!=", "Token", ".", "SKIP", ")", "{", "_token", "=", "makeToken", "(", "_ttype", ")", ";", "_token", ".", "setText", "(", "new", "String", "(", "text", ".", "getBuffer", "(", ")", ",", "_begin", ",", "text", ".", "length", "(", ")", "-", "_begin", ")", ")", ";", "}", "_returnToken", "=", "_token", ";", "}", "public", "final", "void", "mPLUS_ASSIGN", "(", "boolean", "_createToken", ")", "throws", "RecognitionException", ",", "CharStreamException", ",", "TokenStreamException", "{", "int", "_ttype", ";", "Token", "_token", "=", "null", ";", "int", "_begin", "=", "text", ".", "length", "(", ")", ";", "_ttype", "=", "PLUS_ASSIGN", ";", "int", "_saveIndex", ";", "match", "(", "\"+=\"", ")", ";", "if", "(", "_createToken", "&&", "_token", "==", "null", "&&", "_ttype", "!=", "Token", ".", "SKIP", ")", "{", "_token", "=", "makeToken", "(", "_ttype", ")", ";", "_token", ".", "setText", "(", "new", "String", "(", "text", ".", "getBuffer", "(", ")", ",", "_begin", ",", "text", ".", "length", "(", ")", "-", "_begin", ")", ")", ";", "}", "_returnToken", "=", "_token", ";", "}", "public", "final", "void", "mINC", "(", "boolean", "_createToken", ")", "throws", "RecognitionException", ",", "CharStreamException", ",", "TokenStreamException", "{", "int", "_ttype", ";", "Token", "_token", "=", "null", ";", "int", "_begin", "=", "text", ".", "length", "(", ")", ";", "_ttype", "=", "INC", ";", "int", "_saveIndex", ";", "match", "(", "\"++\"", ")", ";", "if", "(", "_createToken", "&&", "_token", "==", "null", "&&", "_ttype", "!=", "Token", ".", "SKIP", ")", "{", "_token", "=", "makeToken", "(", "_ttype", ")", ";", "_token", ".", "setText", "(", "new", "String", "(", "text", ".", "getBuffer", "(", ")", ",", "_begin", ",", "text", ".", "length", "(", ")", "-", "_begin", ")", ")", ";", "}", "_returnToken", "=", "_token", ";", "}", "public", "final", "void", "mMINUS", "(", "boolean", "_createToken", ")", "throws", "RecognitionException", ",", "CharStreamException", ",", "TokenStreamException", "{", "int", "_ttype", ";", "Token", "_token", "=", "null", ";", "int", "_begin", "=", "text", ".", "length", "(", ")", ";", "_ttype", "=", "MINUS", ";", "int", "_saveIndex", ";", "match", "(", "'-'", ")", ";", "if", "(", "_createToken", "&&", "_token", "==", "null", "&&", "_ttype", "!=", "Token", ".", "SKIP", ")", "{", "_token", "=", "makeToken", "(", "_ttype", ")", ";", "_token", ".", "setText", "(", "new", "String", "(", "text", ".", "getBuffer", "(", ")", ",", "_begin", ",", "text", ".", "length", "(", ")", "-", "_begin", ")", ")", ";", "}", "_returnToken", "=", "_token", ";", "}", "public", "final", "void", "mMINUS_ASSIGN", "(", "boolean", "_createToken", ")", "throws", "RecognitionException", ",", "CharStreamException", ",", "TokenStreamException", "{", "int", "_ttype", ";", "Token", "_token", "=", "null", ";", "int", "_begin", "=", "text", ".", "length", "(", ")", ";", "_ttype", "=", "MINUS_ASSIGN", ";", "int", "_saveIndex", ";", "match", "(", "\"-=\"", ")", ";", "if", "(", "_createToken", "&&", "_token", "==", "null", "&&", "_ttype", "!=", "Token", ".", "SKIP", ")", "{", "_token", "=", "makeToken", "(", "_ttype", ")", ";", "_token", ".", "setText", "(", "new", "String", "(", "text", ".", "getBuffer", "(", ")", ",", "_begin", ",", "text", ".", "length", "(", ")", "-", "_begin", ")", ")", ";", "}", "_returnToken", "=", "_token", ";", "}", "public", "final", "void", "mDEC", "(", "boolean", "_createToken", ")", "throws", "RecognitionException", ",", "CharStreamException", ",", "TokenStreamException", "{", "int", "_ttype", ";", "Token", "_token", "=", "null", ";", "int", "_begin", "=", "text", ".", "length", "(", ")", ";", "_ttype", "=", "DEC", ";", "int", "_saveIndex", ";", "match", "(", "\"--\"", ")", ";", "if", "(", "_createToken", "&&", "_token", "==", "null", "&&", "_ttype", "!=", "Token", ".", "SKIP", ")", "{", "_token", "=", "makeToken", "(", "_ttype", ")", ";", "_token", ".", "setText", "(", "new", "String", "(", "text", ".", "getBuffer", "(", ")", ",", "_begin", ",", "text", ".", "length", "(", ")", "-", "_begin", ")", ")", ";", "}", "_returnToken", "=", "_token", ";", "}", "public", "final", "void", "mSTAR", "(", "boolean", "_createToken", ")", "throws", "RecognitionException", ",", "CharStreamException", ",", "TokenStreamException", "{", "int", "_ttype", ";", "Token", "_token", "=", "null", ";", "int", "_begin", "=", "text", ".", "length", "(", ")", ";", "_ttype", "=", "STAR", ";", "int", "_saveIndex", ";", "match", "(", "'*'", ")", ";", "if", "(", "_createToken", "&&", "_token", "==", "null", "&&", "_ttype", "!=", "Token", ".", "SKIP", ")", "{", "_token", "=", "makeToken", "(", "_ttype", ")", ";", "_token", ".", "setText", "(", "new", "String", "(", "text", ".", "getBuffer", "(", ")", ",", "_begin", ",", "text", ".", "length", "(", ")", "-", "_begin", ")", ")", ";", "}", "_returnToken", "=", "_token", ";", "}", "public", "final", "void", "mSTAR_ASSIGN", "(", "boolean", "_createToken", ")", "throws", "RecognitionException", ",", "CharStreamException", ",", "TokenStreamException", "{", "int", "_ttype", ";", "Token", "_token", "=", "null", ";", "int", "_begin", "=", "text", ".", "length", "(", ")", ";", "_ttype", "=", "STAR_ASSIGN", ";", "int", "_saveIndex", ";", "match", "(", "\"*=\"", ")", ";", "if", "(", "_createToken", "&&", "_token", "==", "null", "&&", "_ttype", "!=", "Token", ".", "SKIP", ")", "{", "_token", "=", "makeToken", "(", "_ttype", ")", ";", "_token", ".", "setText", "(", "new", "String", "(", "text", ".", "getBuffer", "(", ")", ",", "_begin", ",", "text", ".", "length", "(", ")", "-", "_begin", ")", ")", ";", "}", "_returnToken", "=", "_token", ";", "}", "public", "final", "void", "mMOD", "(", "boolean", "_createToken", ")", "throws", "RecognitionException", ",", "CharStreamException", ",", "TokenStreamException", "{", "int", "_ttype", ";", "Token", "_token", "=", "null", ";", "int", "_begin", "=", "text", ".", "length", "(", ")", ";", "_ttype", "=", "MOD", ";", "int", "_saveIndex", ";", "match", "(", "'%'", ")", ";", "if", "(", "_createToken", "&&", "_token", "==", "null", "&&", "_ttype", "!=", "Token", ".", "SKIP", ")", "{", "_token", "=", "makeToken", "(", "_ttype", ")", ";", "_token", ".", "setText", "(", "new", "String", "(", "text", ".", "getBuffer", "(", ")", ",", "_begin", ",", "text", ".", "length", "(", ")", "-", "_begin", ")", ")", ";", "}", "_returnToken", "=", "_token", ";", "}", "public", "final", "void", "mMOD_ASSIGN", "(", "boolean", "_createToken", ")", "throws", "RecognitionException", ",", "CharStreamException", ",", "TokenStreamException", "{", "int", "_ttype", ";", "Token", "_token", "=", "null", ";", "int", "_begin", "=", "text", ".", "length", "(", ")", ";", "_ttype", "=", "MOD_ASSIGN", ";", "int", "_saveIndex", ";", "match", "(", "\"%=\"", ")", ";", "if", "(", "_createToken", "&&", "_token", "==", "null", "&&", "_ttype", "!=", "Token", ".", "SKIP", ")", "{", "_token", "=", "makeToken", "(", "_ttype", ")", ";", "_token", ".", "setText", "(", "new", "String", "(", "text", ".", "getBuffer", "(", ")", ",", "_begin", ",", "text", ".", "length", "(", ")", "-", "_begin", ")", ")", ";", "}", "_returnToken", "=", "_token", ";", "}", "public", "final", "void", "mSR", "(", "boolean", "_createToken", ")", "throws", "RecognitionException", ",", "CharStreamException", ",", "TokenStreamException", "{", "int", "_ttype", ";", "Token", "_token", "=", "null", ";", "int", "_begin", "=", "text", ".", "length", "(", ")", ";", "_ttype", "=", "SR", ";", "int", "_saveIndex", ";", "match", "(", "\">>\"", ")", ";", "if", "(", "_createToken", "&&", "_token", "==", "null", "&&", "_ttype", "!=", "Token", ".", "SKIP", ")", "{", "_token", "=", "makeToken", "(", "_ttype", ")", ";", "_token", ".", "setText", "(", "new", "String", "(", "text", ".", "getBuffer", "(", ")", ",", "_begin", ",", "text", ".", "length", "(", ")", "-", "_begin", ")", ")", ";", "}", "_returnToken", "=", "_token", ";", "}", "public", "final", "void", "mSR_ASSIGN", "(", "boolean", "_createToken", ")", "throws", "RecognitionException", ",", "CharStreamException", ",", "TokenStreamException", "{", "int", "_ttype", ";", "Token", "_token", "=", "null", ";", "int", "_begin", "=", "text", ".", "length", "(", ")", ";", "_ttype", "=", "SR_ASSIGN", ";", "int", "_saveIndex", ";", "match", "(", "\">>=\"", ")", ";", "if", "(", "_createToken", "&&", "_token", "==", "null", "&&", "_ttype", "!=", "Token", ".", "SKIP", ")", "{", "_token", "=", "makeToken", "(", "_ttype", ")", ";", "_token", ".", "setText", "(", "new", "String", "(", "text", ".", "getBuffer", "(", ")", ",", "_begin", ",", "text", ".", "length", "(", ")", "-", "_begin", ")", ")", ";", "}", "_returnToken", "=", "_token", ";", "}", "public", "final", "void", "mBSR", "(", "boolean", "_createToken", ")", "throws", "RecognitionException", ",", "CharStreamException", ",", "TokenStreamException", "{", "int", "_ttype", ";", "Token", "_token", "=", "null", ";", "int", "_begin", "=", "text", ".", "length", "(", ")", ";", "_ttype", "=", "BSR", ";", "int", "_saveIndex", ";", "match", "(", "\">>>\"", ")", ";", "if", "(", "_createToken", "&&", "_token", "==", "null", "&&", "_ttype", "!=", "Token", ".", "SKIP", ")", "{", "_token", "=", "makeToken", "(", "_ttype", ")", ";", "_token", ".", "setText", "(", "new", "String", "(", "text", ".", "getBuffer", "(", ")", ",", "_begin", ",", "text", ".", "length", "(", ")", "-", "_begin", ")", ")", ";", "}", "_returnToken", "=", "_token", ";", "}", "public", "final", "void", "mBSR_ASSIGN", "(", "boolean", "_createToken", ")", "throws", "RecognitionException", ",", "CharStreamException", ",", "TokenStreamException", "{", "int", "_ttype", ";", "Token", "_token", "=", "null", ";", "int", "_begin", "=", "text", ".", "length", "(", ")", ";", "_ttype", "=", "BSR_ASSIGN", ";", "int", "_saveIndex", ";", "match", "(", "\">>>=\"", ")", ";", "if", "(", "_createToken", "&&", "_token", "==", "null", "&&", "_ttype", "!=", "Token", ".", "SKIP", ")", "{", "_token", "=", "makeToken", "(", "_ttype", ")", ";", "_token", ".", "setText", "(", "new", "String", "(", "text", ".", "getBuffer", "(", ")", ",", "_begin", ",", "text", ".", "length", "(", ")", "-", "_begin", ")", ")", ";", "}", "_returnToken", "=", "_token", ";", "}", "public", "final", "void", "mGE", "(", "boolean", "_createToken", ")", "throws", "RecognitionException", ",", "CharStreamException", ",", "TokenStreamException", "{", "int", "_ttype", ";", "Token", "_token", "=", "null", ";", "int", "_begin", "=", "text", ".", "length", "(", ")", ";", "_ttype", "=", "GE", ";", "int", "_saveIndex", ";", "match", "(", "\">=\"", ")", ";", "if", "(", "_createToken", "&&", "_token", "==", "null", "&&", "_ttype", "!=", "Token", ".", "SKIP", ")", "{", "_token", "=", "makeToken", "(", "_ttype", ")", ";", "_token", ".", "setText", "(", "new", "String", "(", "text", ".", "getBuffer", "(", ")", ",", "_begin", ",", "text", ".", "length", "(", ")", "-", "_begin", ")", ")", ";", "}", "_returnToken", "=", "_token", ";", "}", "public", "final", "void", "mGT", "(", "boolean", "_createToken", ")", "throws", "RecognitionException", ",", "CharStreamException", ",", "TokenStreamException", "{", "int", "_ttype", ";", "Token", "_token", "=", "null", ";", "int", "_begin", "=", "text", ".", "length", "(", ")", ";", "_ttype", "=", "GT", ";", "int", "_saveIndex", ";", "match", "(", "\">\"", ")", ";", "if", "(", "_createToken", "&&", "_token", "==", "null", "&&", "_ttype", "!=", "Token", ".", "SKIP", ")", "{", "_token", "=", "makeToken", "(", "_ttype", ")", ";", "_token", ".", "setText", "(", "new", "String", "(", "text", ".", "getBuffer", "(", ")", ",", "_begin", ",", "text", ".", "length", "(", ")", "-", "_begin", ")", ")", ";", "}", "_returnToken", "=", "_token", ";", "}", "public", "final", "void", "mSL", "(", "boolean", "_createToken", ")", "throws", "RecognitionException", ",", "CharStreamException", ",", "TokenStreamException", "{", "int", "_ttype", ";", "Token", "_token", "=", "null", ";", "int", "_begin", "=", "text", ".", "length", "(", ")", ";", "_ttype", "=", "SL", ";", "int", "_saveIndex", ";", "match", "(", "\"<<\"", ")", ";", "if", "(", "_createToken", "&&", "_token", "==", "null", "&&", "_ttype", "!=", "Token", ".", "SKIP", ")", "{", "_token", "=", "makeToken", "(", "_ttype", ")", ";", "_token", ".", "setText", "(", "new", "String", "(", "text", ".", "getBuffer", "(", ")", ",", "_begin", ",", "text", ".", "length", "(", ")", "-", "_begin", ")", ")", ";", "}", "_returnToken", "=", "_token", ";", "}", "public", "final", "void", "mSL_ASSIGN", "(", "boolean", "_createToken", ")", "throws", "RecognitionException", ",", "CharStreamException", ",", "TokenStreamException", "{", "int", "_ttype", ";", "Token", "_token", "=", "null", ";", "int", "_begin", "=", "text", ".", "length", "(", ")", ";", "_ttype", "=", "SL_ASSIGN", ";", "int", "_saveIndex", ";", "match", "(", "\"<<=\"", ")", ";", "if", "(", "_createToken", "&&", "_token", "==", "null", "&&", "_ttype", "!=", "Token", ".", "SKIP", ")", "{", "_token", "=", "makeToken", "(", "_ttype", ")", ";", "_token", ".", "setText", "(", "new", "String", "(", "text", ".", "getBuffer", "(", ")", ",", "_begin", ",", "text", ".", "length", "(", ")", "-", "_begin", ")", ")", ";", "}", "_returnToken", "=", "_token", ";", "}", "public", "final", "void", "mLE", "(", "boolean", "_createToken", ")", "throws", "RecognitionException", ",", "CharStreamException", ",", "TokenStreamException", "{", "int", "_ttype", ";", "Token", "_token", "=", "null", ";", "int", "_begin", "=", "text", ".", "length", "(", ")", ";", "_ttype", "=", "LE", ";", "int", "_saveIndex", ";", "match", "(", "\"<=\"", ")", ";", "if", "(", "_createToken", "&&", "_token", "==", "null", "&&", "_ttype", "!=", "Token", ".", "SKIP", ")", "{", "_token", "=", "makeToken", "(", "_ttype", ")", ";", "_token", ".", "setText", "(", "new", "String", "(", "text", ".", "getBuffer", "(", ")", ",", "_begin", ",", "text", ".", "length", "(", ")", "-", "_begin", ")", ")", ";", "}", "_returnToken", "=", "_token", ";", "}", "public", "final", "void", "mLT", "(", "boolean", "_createToken", ")", "throws", "RecognitionException", ",", "CharStreamException", ",", "TokenStreamException", "{", "int", "_ttype", ";", "Token", "_token", "=", "null", ";", "int", "_begin", "=", "text", ".", "length", "(", ")", ";", "_ttype", "=", "LT", ";", "int", "_saveIndex", ";", "match", "(", "'<'", ")", ";", "if", "(", "_createToken", "&&", "_token", "==", "null", "&&", "_ttype", "!=", "Token", ".", "SKIP", ")", "{", "_token", "=", "makeToken", "(", "_ttype", ")", ";", "_token", ".", "setText", "(", "new", "String", "(", "text", ".", "getBuffer", "(", ")", ",", "_begin", ",", "text", ".", "length", "(", ")", "-", "_begin", ")", ")", ";", "}", "_returnToken", "=", "_token", ";", "}", "public", "final", "void", "mBXOR", "(", "boolean", "_createToken", ")", "throws", "RecognitionException", ",", "CharStreamException", ",", "TokenStreamException", "{", "int", "_ttype", ";", "Token", "_token", "=", "null", ";", "int", "_begin", "=", "text", ".", "length", "(", ")", ";", "_ttype", "=", "BXOR", ";", "int", "_saveIndex", ";", "match", "(", "'^'", ")", ";", "if", "(", "_createToken", "&&", "_token", "==", "null", "&&", "_ttype", "!=", "Token", ".", "SKIP", ")", "{", "_token", "=", "makeToken", "(", "_ttype", ")", ";", "_token", ".", "setText", "(", "new", "String", "(", "text", ".", "getBuffer", "(", ")", ",", "_begin", ",", "text", ".", "length", "(", ")", "-", "_begin", ")", ")", ";", "}", "_returnToken", "=", "_token", ";", "}", "public", "final", "void", "mBXOR_ASSIGN", "(", "boolean", "_createToken", ")", "throws", "RecognitionException", ",", "CharStreamException", ",", "TokenStreamException", "{", "int", "_ttype", ";", "Token", "_token", "=", "null", ";", "int", "_begin", "=", "text", ".", "length", "(", ")", ";", "_ttype", "=", "BXOR_ASSIGN", ";", "int", "_saveIndex", ";", "match", "(", "\"^=\"", ")", ";", "if", "(", "_createToken", "&&", "_token", "==", "null", "&&", "_ttype", "!=", "Token", ".", "SKIP", ")", "{", "_token", "=", "makeToken", "(", "_ttype", ")", ";", "_token", ".", "setText", "(", "new", "String", "(", "text", ".", "getBuffer", "(", ")", ",", "_begin", ",", "text", ".", "length", "(", ")", "-", "_begin", ")", ")", ";", "}", "_returnToken", "=", "_token", ";", "}", "public", "final", "void", "mBOR", "(", "boolean", "_createToken", ")", "throws", "RecognitionException", ",", "CharStreamException", ",", "TokenStreamException", "{", "int", "_ttype", ";", "Token", "_token", "=", "null", ";", "int", "_begin", "=", "text", ".", "length", "(", ")", ";", "_ttype", "=", "BOR", ";", "int", "_saveIndex", ";", "match", "(", "'|'", ")", ";", "if", "(", "_createToken", "&&", "_token", "==", "null", "&&", "_ttype", "!=", "Token", ".", "SKIP", ")", "{", "_token", "=", "makeToken", "(", "_ttype", ")", ";", "_token", ".", "setText", "(", "new", "String", "(", "text", ".", "getBuffer", "(", ")", ",", "_begin", ",", "text", ".", "length", "(", ")", "-", "_begin", ")", ")", ";", "}", "_returnToken", "=", "_token", ";", "}", "public", "final", "void", "mBOR_ASSIGN", "(", "boolean", "_createToken", ")", "throws", "RecognitionException", ",", "CharStreamException", ",", "TokenStreamException", "{", "int", "_ttype", ";", "Token", "_token", "=", "null", ";", "int", "_begin", "=", "text", ".", "length", "(", ")", ";", "_ttype", "=", "BOR_ASSIGN", ";", "int", "_saveIndex", ";", "match", "(", "\"|=\"", ")", ";", "if", "(", "_createToken", "&&", "_token", "==", "null", "&&", "_ttype", "!=", "Token", ".", "SKIP", ")", "{", "_token", "=", "makeToken", "(", "_ttype", ")", ";", "_token", ".", "setText", "(", "new", "String", "(", "text", ".", "getBuffer", "(", ")", ",", "_begin", ",", "text", ".", "length", "(", ")", "-", "_begin", ")", ")", ";", "}", "_returnToken", "=", "_token", ";", "}", "public", "final", "void", "mLOR", "(", "boolean", "_createToken", ")", "throws", "RecognitionException", ",", "CharStreamException", ",", "TokenStreamException", "{", "int", "_ttype", ";", "Token", "_token", "=", "null", ";", "int", "_begin", "=", "text", ".", "length", "(", ")", ";", "_ttype", "=", "LOR", ";", "int", "_saveIndex", ";", "match", "(", "\"||\"", ")", ";", "if", "(", "_createToken", "&&", "_token", "==", "null", "&&", "_ttype", "!=", "Token", ".", "SKIP", ")", "{", "_token", "=", "makeToken", "(", "_ttype", ")", ";", "_token", ".", "setText", "(", "new", "String", "(", "text", ".", "getBuffer", "(", ")", ",", "_begin", ",", "text", ".", "length", "(", ")", "-", "_begin", ")", ")", ";", "}", "_returnToken", "=", "_token", ";", "}", "public", "final", "void", "mBAND", "(", "boolean", "_createToken", ")", "throws", "RecognitionException", ",", "CharStreamException", ",", "TokenStreamException", "{", "int", "_ttype", ";", "Token", "_token", "=", "null", ";", "int", "_begin", "=", "text", ".", "length", "(", ")", ";", "_ttype", "=", "BAND", ";", "int", "_saveIndex", ";", "match", "(", "'&'", ")", ";", "if", "(", "_createToken", "&&", "_token", "==", "null", "&&", "_ttype", "!=", "Token", ".", "SKIP", ")", "{", "_token", "=", "makeToken", "(", "_ttype", ")", ";", "_token", ".", "setText", "(", "new", "String", "(", "text", ".", "getBuffer", "(", ")", ",", "_begin", ",", "text", ".", "length", "(", ")", "-", "_begin", ")", ")", ";", "}", "_returnToken", "=", "_token", ";", "}", "public", "final", "void", "mBAND_ASSIGN", "(", "boolean", "_createToken", ")", "throws", "RecognitionException", ",", "CharStreamException", ",", "TokenStreamException", "{", "int", "_ttype", ";", "Token", "_token", "=", "null", ";", "int", "_begin", "=", "text", ".", "length", "(", ")", ";", "_ttype", "=", "BAND_ASSIGN", ";", "int", "_saveIndex", ";", "match", "(", "\"&=\"", ")", ";", "if", "(", "_createToken", "&&", "_token", "==", "null", "&&", "_ttype", "!=", "Token", ".", "SKIP", ")", "{", "_token", "=", "makeToken", "(", "_ttype", ")", ";", "_token", ".", "setText", "(", "new", "String", "(", "text", ".", "getBuffer", "(", ")", ",", "_begin", ",", "text", ".", "length", "(", ")", "-", "_begin", ")", ")", ";", "}", "_returnToken", "=", "_token", ";", "}", "public", "final", "void", "mLAND", "(", "boolean", "_createToken", ")", "throws", "RecognitionException", ",", "CharStreamException", ",", "TokenStreamException", "{", "int", "_ttype", ";", "Token", "_token", "=", "null", ";", "int", "_begin", "=", "text", ".", "length", "(", ")", ";", "_ttype", "=", "LAND", ";", "int", "_saveIndex", ";", "match", "(", "\"&&\"", ")", ";", "if", "(", "_createToken", "&&", "_token", "==", "null", "&&", "_ttype", "!=", "Token", ".", "SKIP", ")", "{", "_token", "=", "makeToken", "(", "_ttype", ")", ";", "_token", ".", "setText", "(", "new", "String", "(", "text", ".", "getBuffer", "(", ")", ",", "_begin", ",", "text", ".", "length", "(", ")", "-", "_begin", ")", ")", ";", "}", "_returnToken", "=", "_token", ";", "}", "public", "final", "void", "mSEMI", "(", "boolean", "_createToken", ")", "throws", "RecognitionException", ",", "CharStreamException", ",", "TokenStreamException", "{", "int", "_ttype", ";", "Token", "_token", "=", "null", ";", "int", "_begin", "=", "text", ".", "length", "(", ")", ";", "_ttype", "=", "SEMI", ";", "int", "_saveIndex", ";", "match", "(", "';'", ")", ";", "if", "(", "_createToken", "&&", "_token", "==", "null", "&&", "_ttype", "!=", "Token", ".", "SKIP", ")", "{", "_token", "=", "makeToken", "(", "_ttype", ")", ";", "_token", ".", "setText", "(", "new", "String", "(", "text", ".", "getBuffer", "(", ")", ",", "_begin", ",", "text", ".", "length", "(", ")", "-", "_begin", ")", ")", ";", "}", "_returnToken", "=", "_token", ";", "}", "protected", "final", "void", "mDOLLAR", "(", "boolean", "_createToken", ")", "throws", "RecognitionException", ",", "CharStreamException", ",", "TokenStreamException", "{", "int", "_ttype", ";", "Token", "_token", "=", "null", ";", "int", "_begin", "=", "text", ".", "length", "(", ")", ";", "_ttype", "=", "DOLLAR", ";", "int", "_saveIndex", ";", "match", "(", "'$'", ")", ";", "if", "(", "_createToken", "&&", "_token", "==", "null", "&&", "_ttype", "!=", "Token", ".", "SKIP", ")", "{", "_token", "=", "makeToken", "(", "_ttype", ")", ";", "_token", ".", "setText", "(", "new", "String", "(", "text", ".", "getBuffer", "(", ")", ",", "_begin", ",", "text", ".", "length", "(", ")", "-", "_begin", ")", ")", ";", "}", "_returnToken", "=", "_token", ";", "}", "public", "final", "void", "mRANGE_INCLUSIVE", "(", "boolean", "_createToken", ")", "throws", "RecognitionException", ",", "CharStreamException", ",", "TokenStreamException", "{", "int", "_ttype", ";", "Token", "_token", "=", "null", ";", "int", "_begin", "=", "text", ".", "length", "(", ")", ";", "_ttype", "=", "RANGE_INCLUSIVE", ";", "int", "_saveIndex", ";", "match", "(", "\"..\"", ")", ";", "if", "(", "_createToken", "&&", "_token", "==", "null", "&&", "_ttype", "!=", "Token", ".", "SKIP", ")", "{", "_token", "=", "makeToken", "(", "_ttype", ")", ";", "_token", ".", "setText", "(", "new", "String", "(", "text", ".", "getBuffer", "(", ")", ",", "_begin", ",", "text", ".", "length", "(", ")", "-", "_begin", ")", ")", ";", "}", "_returnToken", "=", "_token", ";", "}", "public", "final", "void", "mRANGE_EXCLUSIVE", "(", "boolean", "_createToken", ")", "throws", "RecognitionException", ",", "CharStreamException", ",", "TokenStreamException", "{", "int", "_ttype", ";", "Token", "_token", "=", "null", ";", "int", "_begin", "=", "text", ".", "length", "(", ")", ";", "_ttype", "=", "RANGE_EXCLUSIVE", ";", "int", "_saveIndex", ";", "match", "(", "\"..<\"", ")", ";", "if", "(", "_createToken", "&&", "_token", "==", "null", "&&", "_ttype", "!=", "Token", ".", "SKIP", ")", "{", "_token", "=", "makeToken", "(", "_ttype", ")", ";", "_token", ".", "setText", "(", "new", "String", "(", "text", ".", "getBuffer", "(", ")", ",", "_begin", ",", "text", ".", "length", "(", ")", "-", "_begin", ")", ")", ";", "}", "_returnToken", "=", "_token", ";", "}", "public", "final", "void", "mTRIPLE_DOT", "(", "boolean", "_createToken", ")", "throws", "RecognitionException", ",", "CharStreamException", ",", "TokenStreamException", "{", "int", "_ttype", ";", "Token", "_token", "=", "null", ";", "int", "_begin", "=", "text", ".", "length", "(", ")", ";", "_ttype", "=", "TRIPLE_DOT", ";", "int", "_saveIndex", ";", "match", "(", "\"...\"", ")", ";", "if", "(", "_createToken", "&&", "_token", "==", "null", "&&", "_ttype", "!=", "Token", ".", "SKIP", ")", "{", "_token", "=", "makeToken", "(", "_ttype", ")", ";", "_token", ".", "setText", "(", "new", "String", "(", "text", ".", "getBuffer", "(", ")", ",", "_begin", ",", "text", ".", "length", "(", ")", "-", "_begin", ")", ")", ";", "}", "_returnToken", "=", "_token", ";", "}", "public", "final", "void", "mSPREAD_DOT", "(", "boolean", "_createToken", ")", "throws", "RecognitionException", ",", "CharStreamException", ",", "TokenStreamException", "{", "int", "_ttype", ";", "Token", "_token", "=", "null", ";", "int", "_begin", "=", "text", ".", "length", "(", ")", ";", "_ttype", "=", "SPREAD_DOT", ";", "int", "_saveIndex", ";", "match", "(", "\"*.\"", ")", ";", "if", "(", "_createToken", "&&", "_token", "==", "null", "&&", "_ttype", "!=", "Token", ".", "SKIP", ")", "{", "_token", "=", "makeToken", "(", "_ttype", ")", ";", "_token", ".", "setText", "(", "new", "String", "(", "text", ".", "getBuffer", "(", ")", ",", "_begin", ",", "text", ".", "length", "(", ")", "-", "_begin", ")", ")", ";", "}", "_returnToken", "=", "_token", ";", "}", "public", "final", "void", "mOPTIONAL_DOT", "(", "boolean", "_createToken", ")", "throws", "RecognitionException", ",", "CharStreamException", ",", "TokenStreamException", "{", "int", "_ttype", ";", "Token", "_token", "=", "null", ";", "int", "_begin", "=", "text", ".", "length", "(", ")", ";", "_ttype", "=", "OPTIONAL_DOT", ";", "int", "_saveIndex", ";", "match", "(", "\"?.\"", ")", ";", "if", "(", "_createToken", "&&", "_token", "==", "null", "&&", "_ttype", "!=", "Token", ".", "SKIP", ")", "{", "_token", "=", "makeToken", "(", "_ttype", ")", ";", "_token", ".", "setText", "(", "new", "String", "(", "text", ".", "getBuffer", "(", ")", ",", "_begin", ",", "text", ".", "length", "(", ")", "-", "_begin", ")", ")", ";", "}", "_returnToken", "=", "_token", ";", "}", "public", "final", "void", "mELVIS_OPERATOR", "(", "boolean", "_createToken", ")", "throws", "RecognitionException", ",", "CharStreamException", ",", "TokenStreamException", "{", "int", "_ttype", ";", "Token", "_token", "=", "null", ";", "int", "_begin", "=", "text", ".", "length", "(", ")", ";", "_ttype", "=", "ELVIS_OPERATOR", ";", "int", "_saveIndex", ";", "match", "(", "\"?:\"", ")", ";", "if", "(", "_createToken", "&&", "_token", "==", "null", "&&", "_ttype", "!=", "Token", ".", "SKIP", ")", "{", "_token", "=", "makeToken", "(", "_ttype", ")", ";", "_token", ".", "setText", "(", "new", "String", "(", "text", ".", "getBuffer", "(", ")", ",", "_begin", ",", "text", ".", "length", "(", ")", "-", "_begin", ")", ")", ";", "}", "_returnToken", "=", "_token", ";", "}", "public", "final", "void", "mMEMBER_POINTER", "(", "boolean", "_createToken", ")", "throws", "RecognitionException", ",", "CharStreamException", ",", "TokenStreamException", "{", "int", "_ttype", ";", "Token", "_token", "=", "null", ";", "int", "_begin", "=", "text", ".", "length", "(", ")", ";", "_ttype", "=", "MEMBER_POINTER", ";", "int", "_saveIndex", ";", "match", "(", "\".&\"", ")", ";", "if", "(", "_createToken", "&&", "_token", "==", "null", "&&", "_ttype", "!=", "Token", ".", "SKIP", ")", "{", "_token", "=", "makeToken", "(", "_ttype", ")", ";", "_token", ".", "setText", "(", "new", "String", "(", "text", ".", "getBuffer", "(", ")", ",", "_begin", ",", "text", ".", "length", "(", ")", "-", "_begin", ")", ")", ";", "}", "_returnToken", "=", "_token", ";", "}", "public", "final", "void", "mREGEX_FIND", "(", "boolean", "_createToken", ")", "throws", "RecognitionException", ",", "CharStreamException", ",", "TokenStreamException", "{", "int", "_ttype", ";", "Token", "_token", "=", "null", ";", "int", "_begin", "=", "text", ".", "length", "(", ")", ";", "_ttype", "=", "REGEX_FIND", ";", "int", "_saveIndex", ";", "match", "(", "\"=~\"", ")", ";", "if", "(", "_createToken", "&&", "_token", "==", "null", "&&", "_ttype", "!=", "Token", ".", "SKIP", ")", "{", "_token", "=", "makeToken", "(", "_ttype", ")", ";", "_token", ".", "setText", "(", "new", "String", "(", "text", ".", "getBuffer", "(", ")", ",", "_begin", ",", "text", ".", "length", "(", ")", "-", "_begin", ")", ")", ";", "}", "_returnToken", "=", "_token", ";", "}", "public", "final", "void", "mREGEX_MATCH", "(", "boolean", "_createToken", ")", "throws", "RecognitionException", ",", "CharStreamException", ",", "TokenStreamException", "{", "int", "_ttype", ";", "Token", "_token", "=", "null", ";", "int", "_begin", "=", "text", ".", "length", "(", ")", ";", "_ttype", "=", "REGEX_MATCH", ";", "int", "_saveIndex", ";", "match", "(", "\"==~\"", ")", ";", "if", "(", "_createToken", "&&", "_token", "==", "null", "&&", "_ttype", "!=", "Token", ".", "SKIP", ")", "{", "_token", "=", "makeToken", "(", "_ttype", ")", ";", "_token", ".", "setText", "(", "new", "String", "(", "text", ".", "getBuffer", "(", ")", ",", "_begin", ",", "text", ".", "length", "(", ")", "-", "_begin", ")", ")", ";", "}", "_returnToken", "=", "_token", ";", "}", "public", "final", "void", "mSTAR_STAR", "(", "boolean", "_createToken", ")", "throws", "RecognitionException", ",", "CharStreamException", ",", "TokenStreamException", "{", "int", "_ttype", ";", "Token", "_token", "=", "null", ";", "int", "_begin", "=", "text", ".", "length", "(", ")", ";", "_ttype", "=", "STAR_STAR", ";", "int", "_saveIndex", ";", "match", "(", "\"**\"", ")", ";", "if", "(", "_createToken", "&&", "_token", "==", "null", "&&", "_ttype", "!=", "Token", ".", "SKIP", ")", "{", "_token", "=", "makeToken", "(", "_ttype", ")", ";", "_token", ".", "setText", "(", "new", "String", "(", "text", ".", "getBuffer", "(", ")", ",", "_begin", ",", "text", ".", "length", "(", ")", "-", "_begin", ")", ")", ";", "}", "_returnToken", "=", "_token", ";", "}", "public", "final", "void", "mSTAR_STAR_ASSIGN", "(", "boolean", "_createToken", ")", "throws", "RecognitionException", ",", "CharStreamException", ",", "TokenStreamException", "{", "int", "_ttype", ";", "Token", "_token", "=", "null", ";", "int", "_begin", "=", "text", ".", "length", "(", ")", ";", "_ttype", "=", "STAR_STAR_ASSIGN", ";", "int", "_saveIndex", ";", "match", "(", "\"**=\"", ")", ";", "if", "(", "_createToken", "&&", "_token", "==", "null", "&&", "_ttype", "!=", "Token", ".", "SKIP", ")", "{", "_token", "=", "makeToken", "(", "_ttype", ")", ";", "_token", ".", "setText", "(", "new", "String", "(", "text", ".", "getBuffer", "(", ")", ",", "_begin", ",", "text", ".", "length", "(", ")", "-", "_begin", ")", ")", ";", "}", "_returnToken", "=", "_token", ";", "}", "public", "final", "void", "mCLOSABLE_BLOCK_OP", "(", "boolean", "_createToken", ")", "throws", "RecognitionException", ",", "CharStreamException", ",", "TokenStreamException", "{", "int", "_ttype", ";", "Token", "_token", "=", "null", ";", "int", "_begin", "=", "text", ".", "length", "(", ")", ";", "_ttype", "=", "CLOSABLE_BLOCK_OP", ";", "int", "_saveIndex", ";", "match", "(", "\"->\"", ")", ";", "if", "(", "_createToken", "&&", "_token", "==", "null", "&&", "_ttype", "!=", "Token", ".", "SKIP", ")", "{", "_token", "=", "makeToken", "(", "_ttype", ")", ";", "_token", ".", "setText", "(", "new", "String", "(", "text", ".", "getBuffer", "(", ")", ",", "_begin", ",", "text", ".", "length", "(", ")", "-", "_begin", ")", ")", ";", "}", "_returnToken", "=", "_token", ";", "}", "public", "final", "void", "mWS", "(", "boolean", "_createToken", ")", "throws", "RecognitionException", ",", "CharStreamException", ",", "TokenStreamException", "{", "int", "_ttype", ";", "Token", "_token", "=", "null", ";", "int", "_begin", "=", "text", ".", "length", "(", ")", ";", "_ttype", "=", "WS", ";", "int", "_saveIndex", ";", "{", "int", "_cnt646", "=", "0", ";", "_loop646", ":", "do", "{", "if", "(", "(", "LA", "(", "1", ")", "==", "'\\\\'", ")", "&&", "(", "LA", "(", "2", ")", "==", "'\\n'", "||", "LA", "(", "2", ")", "==", "'\\r'", ")", "&&", "(", "true", ")", "&&", "(", "true", ")", ")", "{", "match", "(", "'\\\\'", ")", ";", "mONE_NL", "(", "false", ",", "false", ")", ";", "}", "else", "if", "(", "(", "LA", "(", "1", ")", "==", "'", "'", ")", "&&", "(", "true", ")", "&&", "(", "true", ")", "&&", "(", "true", ")", ")", "{", "match", "(", "'", "'", ")", ";", "}", "else", "if", "(", "(", "LA", "(", "1", ")", "==", "'\\t'", ")", "&&", "(", "true", ")", "&&", "(", "true", ")", "&&", "(", "true", ")", ")", "{", "match", "(", "'\\t'", ")", ";", "}", "else", "if", "(", "(", "LA", "(", "1", ")", "==", "'", "'", ")", "&&", "(", "true", ")", "&&", "(", "true", ")", "&&", "(", "true", ")", ")", "{", "match", "(", "'\\f'", ")", ";", "}", "else", "{", "if", "(", "_cnt646", ">=", "1", ")", "{", "break", "_loop646", ";", "}", "else", "{", "throw", "new", "NoViableAltForCharException", "(", "(", "char", ")", "LA", "(", "1", ")", ",", "getFilename", "(", ")", ",", "getLine", "(", ")", ",", "getColumn", "(", ")", ")", ";", "}", "}", "_cnt646", "++", ";", "}", "while", "(", "true", ")", ";", "}", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "if", "(", "!", "whitespaceIncluded", ")", "_ttype", "=", "Token", ".", "SKIP", ";", "}", "if", "(", "_createToken", "&&", "_token", "==", "null", "&&", "_ttype", "!=", "Token", ".", "SKIP", ")", "{", "_token", "=", "makeToken", "(", "_ttype", ")", ";", "_token", ".", "setText", "(", "new", "String", "(", "text", ".", "getBuffer", "(", ")", ",", "_begin", ",", "text", ".", "length", "(", ")", "-", "_begin", ")", ")", ";", "}", "_returnToken", "=", "_token", ";", "}", "protected", "final", "void", "mONE_NL", "(", "boolean", "_createToken", ",", "boolean", "check", ")", "throws", "RecognitionException", ",", "CharStreamException", ",", "TokenStreamException", "{", "int", "_ttype", ";", "Token", "_token", "=", "null", ";", "int", "_begin", "=", "text", ".", "length", "(", ")", ";", "_ttype", "=", "ONE_NL", ";", "int", "_saveIndex", ";", "{", "if", "(", "(", "LA", "(", "1", ")", "==", "'\\r'", ")", "&&", "(", "LA", "(", "2", ")", "==", "'\\n'", ")", "&&", "(", "true", ")", "&&", "(", "true", ")", ")", "{", "_saveIndex", "=", "text", ".", "length", "(", ")", ";", "match", "(", "\"rn\"", ")", ";", "text", ".", "setLength", "(", "_saveIndex", ")", ";", "}", "else", "if", "(", "(", "LA", "(", "1", ")", "==", "'\\r'", ")", "&&", "(", "true", ")", "&&", "(", "true", ")", "&&", "(", "true", ")", ")", "{", "_saveIndex", "=", "text", ".", "length", "(", ")", ";", "match", "(", "'\\r'", ")", ";", "text", ".", "setLength", "(", "_saveIndex", ")", ";", "}", "else", "if", "(", "(", "LA", "(", "1", ")", "==", "'\\n'", ")", ")", "{", "_saveIndex", "=", "text", ".", "length", "(", ")", ";", "match", "(", "'\\n'", ")", ";", "text", ".", "setLength", "(", "_saveIndex", ")", ";", "}", "else", "{", "throw", "new", "NoViableAltForCharException", "(", "(", "char", ")", "LA", "(", "1", ")", ",", "getFilename", "(", ")", ",", "getLine", "(", ")", ",", "getColumn", "(", ")", ")", ";", "}", "}", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "newlineCheck", "(", "check", ")", ";", "}", "if", "(", "_createToken", "&&", "_token", "==", "null", "&&", "_ttype", "!=", "Token", ".", "SKIP", ")", "{", "_token", "=", "makeToken", "(", "_ttype", ")", ";", "_token", ".", "setText", "(", "new", "String", "(", "text", ".", "getBuffer", "(", ")", ",", "_begin", ",", "text", ".", "length", "(", ")", "-", "_begin", ")", ")", ";", "}", "_returnToken", "=", "_token", ";", "}", "protected", "final", "void", "mONE_NL_KEEP", "(", "boolean", "_createToken", ",", "boolean", "check", ")", "throws", "RecognitionException", ",", "CharStreamException", ",", "TokenStreamException", "{", "int", "_ttype", ";", "Token", "_token", "=", "null", ";", "int", "_begin", "=", "text", ".", "length", "(", ")", ";", "_ttype", "=", "ONE_NL_KEEP", ";", "int", "_saveIndex", ";", "{", "if", "(", "(", "LA", "(", "1", ")", "==", "'\\r'", ")", "&&", "(", "LA", "(", "2", ")", "==", "'\\n'", ")", "&&", "(", "(", "LA", "(", "3", ")", ">=", "'\u0000'", "&&", "LA", "(", "3", ")", "<=", "'-UNK-'", ")", ")", "&&", "(", "(", "LA", "(", "4", ")", ">=", "'\u0000'", "&&", "LA", "(", "4", ")", "<=", "'-UNK-'", ")", ")", ")", "{", "match", "(", "\"rn\"", ")", ";", "}", "else", "if", "(", "(", "LA", "(", "1", ")", "==", "'\\r'", ")", "&&", "(", "(", "LA", "(", "2", ")", ">=", "'\u0000'", "&&", "LA", "(", "2", ")", "<=", "'-UNK-'", ")", ")", "&&", "(", "(", "LA", "(", "3", ")", ">=", "'\u0000'", "&&", "LA", "(", "3", ")", "<=", "'-UNK-'", ")", ")", "&&", "(", "true", ")", ")", "{", "match", "(", "'\\r'", ")", ";", "}", "else", "if", "(", "(", "LA", "(", "1", ")", "==", "'\\n'", ")", ")", "{", "match", "(", "'\\n'", ")", ";", "}", "else", "{", "throw", "new", "NoViableAltForCharException", "(", "(", "char", ")", "LA", "(", "1", ")", ",", "getFilename", "(", ")", ",", "getLine", "(", ")", ",", "getColumn", "(", ")", ")", ";", "}", "}", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "newlineCheck", "(", "check", ")", ";", "}", "if", "(", "_createToken", "&&", "_token", "==", "null", "&&", "_ttype", "!=", "Token", ".", "SKIP", ")", "{", "_token", "=", "makeToken", "(", "_ttype", ")", ";", "_token", ".", "setText", "(", "new", "String", "(", "text", ".", "getBuffer", "(", ")", ",", "_begin", ",", "text", ".", "length", "(", ")", "-", "_begin", ")", ")", ";", "}", "_returnToken", "=", "_token", ";", "}", "public", "final", "void", "mNLS", "(", "boolean", "_createToken", ")", "throws", "RecognitionException", ",", "CharStreamException", ",", "TokenStreamException", "{", "int", "_ttype", ";", "Token", "_token", "=", "null", ";", "int", "_begin", "=", "text", ".", "length", "(", ")", ";", "_ttype", "=", "NLS", ";", "int", "_saveIndex", ";", "mONE_NL", "(", "false", ",", "true", ")", ";", "{", "if", "(", "(", "(", "LA", "(", "1", ")", "==", "'\\t'", "||", "LA", "(", "1", ")", "==", "'\\n'", "||", "LA", "(", "1", ")", "==", "'", "'", "||", "LA", "(", "1", ")", "==", "'\\r'", "||", "LA", "(", "1", ")", "==", "'", "'", "||", "LA", "(", "1", ")", "==", "'/'", "||", "LA", "(", "1", ")", "==", "'\\\\'", ")", ")", "&&", "(", "!", "whitespaceIncluded", ")", ")", "{", "{", "int", "_cnt654", "=", "0", ";", "_loop654", ":", "do", "{", "switch", "(", "LA", "(", "1", ")", ")", "{", "case", "'\\n'", ":", "case", "'\\r'", ":", "{", "mONE_NL", "(", "false", ",", "true", ")", ";", "break", ";", "}", "case", "'\\t'", ":", "case", "'", "'", ":", "case", "'", "'", ":", "case", "'\\\\'", ":", "{", "mWS", "(", "false", ")", ";", "break", ";", "}", "default", ":", "if", "(", "(", "LA", "(", "1", ")", "==", "'/'", ")", "&&", "(", "LA", "(", "2", ")", "==", "'/'", ")", ")", "{", "mSL_COMMENT", "(", "false", ")", ";", "}", "else", "if", "(", "(", "LA", "(", "1", ")", "==", "'/'", ")", "&&", "(", "LA", "(", "2", ")", "==", "'*'", ")", ")", "{", "mML_COMMENT", "(", "false", ")", ";", "}", "else", "{", "if", "(", "_cnt654", ">=", "1", ")", "{", "break", "_loop654", ";", "}", "else", "{", "throw", "new", "NoViableAltForCharException", "(", "(", "char", ")", "LA", "(", "1", ")", ",", "getFilename", "(", ")", ",", "getLine", "(", ")", ",", "getColumn", "(", ")", ")", ";", "}", "}", "}", "_cnt654", "++", ";", "}", "while", "(", "true", ")", ";", "}", "}", "else", "{", "}", "}", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "if", "(", "whitespaceIncluded", ")", "{", "}", "else", "if", "(", "parenLevel", "!=", "0", ")", "{", "_ttype", "=", "Token", ".", "SKIP", ";", "}", "else", "{", "text", ".", "setLength", "(", "_begin", ")", ";", "text", ".", "append", "(", "\"<newline>\"", ")", ";", "}", "}", "if", "(", "_createToken", "&&", "_token", "==", "null", "&&", "_ttype", "!=", "Token", ".", "SKIP", ")", "{", "_token", "=", "makeToken", "(", "_ttype", ")", ";", "_token", ".", "setText", "(", "new", "String", "(", "text", ".", "getBuffer", "(", ")", ",", "_begin", ",", "text", ".", "length", "(", ")", "-", "_begin", ")", ")", ";", "}", "_returnToken", "=", "_token", ";", "}", "public", "final", "void", "mSL_COMMENT", "(", "boolean", "_createToken", ")", "throws", "RecognitionException", ",", "CharStreamException", ",", "TokenStreamException", "{", "int", "_ttype", ";", "Token", "_token", "=", "null", ";", "int", "_begin", "=", "text", ".", "length", "(", ")", ";", "_ttype", "=", "SL_COMMENT", ";", "int", "_saveIndex", ";", "match", "(", "\"//\"", ")", ";", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "if", "(", "parser", "!=", "null", ")", "{", "parser", ".", "startComment", "(", "inputState", ".", "getLine", "(", ")", ",", "inputState", ".", "getColumn", "(", ")", "-", "2", ")", ";", "}", "}", "{", "_loop658", ":", "do", "{", "if", "(", "(", "_tokenSet_1", ".", "member", "(", "LA", "(", "1", ")", ")", ")", "&&", "(", "true", ")", "&&", "(", "true", ")", "&&", "(", "true", ")", ")", "{", "{", "match", "(", "_tokenSet_1", ")", ";", "}", "}", "else", "{", "break", "_loop658", ";", "}", "}", "while", "(", "true", ")", ";", "}", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "if", "(", "parser", "!=", "null", ")", "{", "parser", ".", "endComment", "(", "0", ",", "inputState", ".", "getLine", "(", ")", ",", "inputState", ".", "getColumn", "(", ")", ",", "new", "String", "(", "text", ".", "getBuffer", "(", ")", ",", "_begin", ",", "text", ".", "length", "(", ")", "-", "_begin", ")", ")", ";", "}", "if", "(", "!", "whitespaceIncluded", ")", "_ttype", "=", "Token", ".", "SKIP", ";", "}", "if", "(", "_createToken", "&&", "_token", "==", "null", "&&", "_ttype", "!=", "Token", ".", "SKIP", ")", "{", "_token", "=", "makeToken", "(", "_ttype", ")", ";", "_token", ".", "setText", "(", "new", "String", "(", "text", ".", "getBuffer", "(", ")", ",", "_begin", ",", "text", ".", "length", "(", ")", "-", "_begin", ")", ")", ";", "}", "_returnToken", "=", "_token", ";", "}", "public", "final", "void", "mML_COMMENT", "(", "boolean", "_createToken", ")", "throws", "RecognitionException", ",", "CharStreamException", ",", "TokenStreamException", "{", "int", "_ttype", ";", "Token", "_token", "=", "null", ";", "int", "_begin", "=", "text", ".", "length", "(", ")", ";", "_ttype", "=", "ML_COMMENT", ";", "int", "_saveIndex", ";", "match", "(", "\"/*\"", ")", ";", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "if", "(", "parser", "!=", "null", ")", "{", "parser", ".", "startComment", "(", "inputState", ".", "getLine", "(", ")", ",", "inputState", ".", "getColumn", "(", ")", "-", "2", ")", ";", "}", "}", "{", "_loop668", ":", "do", "{", "boolean", "synPredMatched666", "=", "false", ";", "if", "(", "(", "(", "LA", "(", "1", ")", "==", "'*'", ")", "&&", "(", "(", "LA", "(", "2", ")", ">=", "'\u0000'", "&&", "LA", "(", "2", ")", "<=", "'-UNK-'", ")", ")", "&&", "(", "(", "LA", "(", "3", ")", ">=", "'\u0000'", "&&", "LA", "(", "3", ")", "<=", "'-UNK-'", ")", ")", "&&", "(", "true", ")", ")", ")", "{", "int", "_m666", "=", "mark", "(", ")", ";", "synPredMatched666", "=", "true", ";", "inputState", ".", "guessing", "++", ";", "try", "{", "{", "match", "(", "'*'", ")", ";", "matchNot", "(", "'/'", ")", ";", "}", "}", "catch", "(", "RecognitionException", "pe", ")", "{", "synPredMatched666", "=", "false", ";", "}", "rewind", "(", "_m666", ")", ";", "inputState", ".", "guessing", "--", ";", "}", "if", "(", "synPredMatched666", ")", "{", "match", "(", "'*'", ")", ";", "}", "else", "if", "(", "(", "LA", "(", "1", ")", "==", "'\\n'", "||", "LA", "(", "1", ")", "==", "'\\r'", ")", ")", "{", "mONE_NL_KEEP", "(", "false", ",", "true", ")", ";", "}", "else", "if", "(", "(", "_tokenSet_2", ".", "member", "(", "LA", "(", "1", ")", ")", ")", ")", "{", "{", "match", "(", "_tokenSet_2", ")", ";", "}", "}", "else", "{", "break", "_loop668", ";", "}", "}", "while", "(", "true", ")", ";", "}", "match", "(", "\"*/\"", ")", ";", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "if", "(", "parser", "!=", "null", ")", "{", "parser", ".", "endComment", "(", "1", ",", "inputState", ".", "getLine", "(", ")", ",", "inputState", ".", "getColumn", "(", ")", ",", "new", "String", "(", "text", ".", "getBuffer", "(", ")", ",", "_begin", ",", "text", ".", "length", "(", ")", "-", "_begin", ")", ")", ";", "}", "if", "(", "!", "whitespaceIncluded", ")", "_ttype", "=", "Token", ".", "SKIP", ";", "}", "if", "(", "_createToken", "&&", "_token", "==", "null", "&&", "_ttype", "!=", "Token", ".", "SKIP", ")", "{", "_token", "=", "makeToken", "(", "_ttype", ")", ";", "_token", ".", "setText", "(", "new", "String", "(", "text", ".", "getBuffer", "(", ")", ",", "_begin", ",", "text", ".", "length", "(", ")", "-", "_begin", ")", ")", ";", "}", "_returnToken", "=", "_token", ";", "}", "public", "final", "void", "mSH_COMMENT", "(", "boolean", "_createToken", ")", "throws", "RecognitionException", ",", "CharStreamException", ",", "TokenStreamException", "{", "int", "_ttype", ";", "Token", "_token", "=", "null", ";", "int", "_begin", "=", "text", ".", "length", "(", ")", ";", "_ttype", "=", "SH_COMMENT", ";", "int", "_saveIndex", ";", "if", "(", "!", "(", "getLine", "(", ")", "==", "1", "&&", "getColumn", "(", ")", "==", "1", ")", ")", "throw", "new", "SemanticException", "(", "\"\"", ")", ";", "match", "(", "\"#!\"", ")", ";", "{", "_loop662", ":", "do", "{", "if", "(", "(", "_tokenSet_1", ".", "member", "(", "LA", "(", "1", ")", ")", ")", ")", "{", "{", "match", "(", "_tokenSet_1", ")", ";", "}", "}", "else", "{", "break", "_loop662", ";", "}", "}", "while", "(", "true", ")", ";", "}", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "if", "(", "!", "whitespaceIncluded", ")", "_ttype", "=", "Token", ".", "SKIP", ";", "}", "if", "(", "_createToken", "&&", "_token", "==", "null", "&&", "_ttype", "!=", "Token", ".", "SKIP", ")", "{", "_token", "=", "makeToken", "(", "_ttype", ")", ";", "_token", ".", "setText", "(", "new", "String", "(", "text", ".", "getBuffer", "(", ")", ",", "_begin", ",", "text", ".", "length", "(", ")", "-", "_begin", ")", ")", ";", "}", "_returnToken", "=", "_token", ";", "}", "public", "final", "void", "mSTRING_LITERAL", "(", "boolean", "_createToken", ")", "throws", "RecognitionException", ",", "CharStreamException", ",", "TokenStreamException", "{", "int", "_ttype", ";", "Token", "_token", "=", "null", ";", "int", "_begin", "=", "text", ".", "length", "(", ")", ";", "_ttype", "=", "STRING_LITERAL", ";", "int", "_saveIndex", ";", "int", "tt", "=", "0", ";", "boolean", "synPredMatched671", "=", "false", ";", "if", "(", "(", "(", "LA", "(", "1", ")", "==", "'\\''", ")", "&&", "(", "LA", "(", "2", ")", "==", "'\\''", ")", "&&", "(", "LA", "(", "3", ")", "==", "'\\''", ")", "&&", "(", "(", "LA", "(", "4", ")", ">=", "'\u0000'", "&&", "LA", "(", "4", ")", "<=", "'-UNK-'", ")", ")", ")", ")", "{", "int", "_m671", "=", "mark", "(", ")", ";", "synPredMatched671", "=", "true", ";", "inputState", ".", "guessing", "++", ";", "try", "{", "{", "match", "(", "\"'''\"", ")", ";", "}", "}", "catch", "(", "RecognitionException", "pe", ")", "{", "synPredMatched671", "=", "false", ";", "}", "rewind", "(", "_m671", ")", ";", "inputState", ".", "guessing", "--", ";", "}", "if", "(", "synPredMatched671", ")", "{", "_saveIndex", "=", "text", ".", "length", "(", ")", ";", "match", "(", "\"'''\"", ")", ";", "text", ".", "setLength", "(", "_saveIndex", ")", ";", "{", "_loop676", ":", "do", "{", "switch", "(", "LA", "(", "1", ")", ")", "{", "case", "'\\\\'", ":", "{", "mESC", "(", "false", ")", ";", "break", ";", "}", "case", "'\"'", ":", "{", "match", "(", "'\"'", ")", ";", "break", ";", "}", "case", "'$'", ":", "{", "match", "(", "'$'", ")", ";", "break", ";", "}", "case", "'\\n'", ":", "case", "'\\r'", ":", "{", "mSTRING_NL", "(", "false", ",", "true", ")", ";", "break", ";", "}", "default", ":", "boolean", "synPredMatched675", "=", "false", ";", "if", "(", "(", "(", "LA", "(", "1", ")", "==", "'\\''", ")", "&&", "(", "(", "LA", "(", "2", ")", ">=", "'\u0000'", "&&", "LA", "(", "2", ")", "<=", "'-UNK-'", ")", ")", "&&", "(", "(", "LA", "(", "3", ")", ">=", "'\u0000'", "&&", "LA", "(", "3", ")", "<=", "'-UNK-'", ")", ")", "&&", "(", "(", "LA", "(", "4", ")", ">=", "'\u0000'", "&&", "LA", "(", "4", ")", "<=", "'-UNK-'", ")", ")", ")", ")", "{", "int", "_m675", "=", "mark", "(", ")", ";", "synPredMatched675", "=", "true", ";", "inputState", ".", "guessing", "++", ";", "try", "{", "{", "match", "(", "'\\''", ")", ";", "{", "if", "(", "(", "_tokenSet_3", ".", "member", "(", "LA", "(", "1", ")", ")", ")", ")", "{", "matchNot", "(", "'\\''", ")", ";", "}", "else", "if", "(", "(", "LA", "(", "1", ")", "==", "'\\''", ")", ")", "{", "match", "(", "'\\''", ")", ";", "matchNot", "(", "'\\''", ")", ";", "}", "else", "{", "throw", "new", "NoViableAltForCharException", "(", "(", "char", ")", "LA", "(", "1", ")", ",", "getFilename", "(", ")", ",", "getLine", "(", ")", ",", "getColumn", "(", ")", ")", ";", "}", "}", "}", "}", "catch", "(", "RecognitionException", "pe", ")", "{", "synPredMatched675", "=", "false", ";", "}", "rewind", "(", "_m675", ")", ";", "inputState", ".", "guessing", "--", ";", "}", "if", "(", "synPredMatched675", ")", "{", "match", "(", "'\\''", ")", ";", "}", "else", "if", "(", "(", "_tokenSet_4", ".", "member", "(", "LA", "(", "1", ")", ")", ")", ")", "{", "mSTRING_CH", "(", "false", ")", ";", "}", "else", "{", "break", "_loop676", ";", "}", "}", "}", "while", "(", "true", ")", ";", "}", "_saveIndex", "=", "text", ".", "length", "(", ")", ";", "match", "(", "\"'''\"", ")", ";", "text", ".", "setLength", "(", "_saveIndex", ")", ";", "}", "else", "{", "boolean", "synPredMatched680", "=", "false", ";", "if", "(", "(", "(", "LA", "(", "1", ")", "==", "'\"'", ")", "&&", "(", "LA", "(", "2", ")", "==", "'\"'", ")", "&&", "(", "LA", "(", "3", ")", "==", "'\"'", ")", "&&", "(", "(", "LA", "(", "4", ")", ">=", "'\u0000'", "&&", "LA", "(", "4", ")", "<=", "'-UNK-'", ")", ")", ")", ")", "{", "int", "_m680", "=", "mark", "(", ")", ";", "synPredMatched680", "=", "true", ";", "inputState", ".", "guessing", "++", ";", "try", "{", "{", "match", "(", "\"\\\"\\\"\\\"\"", ")", ";", "}", "}", "catch", "(", "RecognitionException", "pe", ")", "{", "synPredMatched680", "=", "false", ";", "}", "rewind", "(", "_m680", ")", ";", "inputState", ".", "guessing", "--", ";", "}", "if", "(", "synPredMatched680", ")", "{", "_saveIndex", "=", "text", ".", "length", "(", ")", ";", "match", "(", "\"\\\"\\\"\\\"\"", ")", ";", "text", ".", "setLength", "(", "_saveIndex", ")", ";", "tt", "=", "mSTRING_CTOR_END", "(", "false", ",", "true", ",", "true", ")", ";", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "_ttype", "=", "tt", ";", "}", "}", "else", "if", "(", "(", "LA", "(", "1", ")", "==", "'\\''", ")", "&&", "(", "_tokenSet_1", ".", "member", "(", "LA", "(", "2", ")", ")", ")", "&&", "(", "true", ")", "&&", "(", "true", ")", ")", "{", "_saveIndex", "=", "text", ".", "length", "(", ")", ";", "match", "(", "'\\''", ")", ";", "text", ".", "setLength", "(", "_saveIndex", ")", ";", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "++", "suppressNewline", ";", "}", "{", "_loop678", ":", "do", "{", "switch", "(", "LA", "(", "1", ")", ")", "{", "case", "'\\\\'", ":", "{", "mESC", "(", "false", ")", ";", "break", ";", "}", "case", "'\"'", ":", "{", "match", "(", "'\"'", ")", ";", "break", ";", "}", "case", "'$'", ":", "{", "match", "(", "'$'", ")", ";", "break", ";", "}", "default", ":", "if", "(", "(", "_tokenSet_4", ".", "member", "(", "LA", "(", "1", ")", ")", ")", ")", "{", "mSTRING_CH", "(", "false", ")", ";", "}", "else", "{", "break", "_loop678", ";", "}", "}", "}", "while", "(", "true", ")", ";", "}", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "--", "suppressNewline", ";", "}", "_saveIndex", "=", "text", ".", "length", "(", ")", ";", "match", "(", "'\\''", ")", ";", "text", ".", "setLength", "(", "_saveIndex", ")", ";", "}", "else", "if", "(", "(", "LA", "(", "1", ")", "==", "'\"'", ")", "&&", "(", "(", "LA", "(", "2", ")", ">=", "'\u0000'", "&&", "LA", "(", "2", ")", "<=", "'-UNK-'", ")", ")", "&&", "(", "true", ")", "&&", "(", "true", ")", ")", "{", "_saveIndex", "=", "text", ".", "length", "(", ")", ";", "match", "(", "'\"'", ")", ";", "text", ".", "setLength", "(", "_saveIndex", ")", ";", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "++", "suppressNewline", ";", "}", "tt", "=", "mSTRING_CTOR_END", "(", "false", ",", "true", ",", "false", ")", ";", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "_ttype", "=", "tt", ";", "}", "}", "else", "{", "throw", "new", "NoViableAltForCharException", "(", "(", "char", ")", "LA", "(", "1", ")", ",", "getFilename", "(", ")", ",", "getLine", "(", ")", ",", "getColumn", "(", ")", ")", ";", "}", "}", "if", "(", "_createToken", "&&", "_token", "==", "null", "&&", "_ttype", "!=", "Token", ".", "SKIP", ")", "{", "_token", "=", "makeToken", "(", "_ttype", ")", ";", "_token", ".", "setText", "(", "new", "String", "(", "text", ".", "getBuffer", "(", ")", ",", "_begin", ",", "text", ".", "length", "(", ")", "-", "_begin", ")", ")", ";", "}", "_returnToken", "=", "_token", ";", "}", "protected", "final", "void", "mSTRING_CH", "(", "boolean", "_createToken", ")", "throws", "RecognitionException", ",", "CharStreamException", ",", "TokenStreamException", "{", "int", "_ttype", ";", "Token", "_token", "=", "null", ";", "int", "_begin", "=", "text", ".", "length", "(", ")", ";", "_ttype", "=", "STRING_CH", ";", "int", "_saveIndex", ";", "{", "match", "(", "_tokenSet_4", ")", ";", "}", "if", "(", "_createToken", "&&", "_token", "==", "null", "&&", "_ttype", "!=", "Token", ".", "SKIP", ")", "{", "_token", "=", "makeToken", "(", "_ttype", ")", ";", "_token", ".", "setText", "(", "new", "String", "(", "text", ".", "getBuffer", "(", ")", ",", "_begin", ",", "text", ".", "length", "(", ")", "-", "_begin", ")", ")", ";", "}", "_returnToken", "=", "_token", ";", "}", "protected", "final", "void", "mESC", "(", "boolean", "_createToken", ")", "throws", "RecognitionException", ",", "CharStreamException", ",", "TokenStreamException", "{", "int", "_ttype", ";", "Token", "_token", "=", "null", ";", "int", "_begin", "=", "text", ".", "length", "(", ")", ";", "_ttype", "=", "ESC", ";", "int", "_saveIndex", ";", "if", "(", "(", "LA", "(", "1", ")", "==", "'\\\\'", ")", "&&", "(", "LA", "(", "2", ")", "==", "'\"'", "||", "LA", "(", "2", ")", "==", "'$'", "||", "LA", "(", "2", ")", "==", "'\\''", "||", "LA", "(", "2", ")", "==", "'0'", "||", "LA", "(", "2", ")", "==", "'1'", "||", "LA", "(", "2", ")", "==", "'2'", "||", "LA", "(", "2", ")", "==", "'3'", "||", "LA", "(", "2", ")", "==", "'4'", "||", "LA", "(", "2", ")", "==", "'5'", "||", "LA", "(", "2", ")", "==", "'6'", "||", "LA", "(", "2", ")", "==", "'7'", "||", "LA", "(", "2", ")", "==", "'\\\\'", "||", "LA", "(", "2", ")", "==", "'b'", "||", "LA", "(", "2", ")", "==", "'f'", "||", "LA", "(", "2", ")", "==", "'n'", "||", "LA", "(", "2", ")", "==", "'r'", "||", "LA", "(", "2", ")", "==", "'t'", "||", "LA", "(", "2", ")", "==", "'u'", ")", ")", "{", "_saveIndex", "=", "text", ".", "length", "(", ")", ";", "match", "(", "'\\\\'", ")", ";", "text", ".", "setLength", "(", "_saveIndex", ")", ";", "{", "switch", "(", "LA", "(", "1", ")", ")", "{", "case", "'n'", ":", "{", "match", "(", "'n'", ")", ";", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "text", ".", "setLength", "(", "_begin", ")", ";", "text", ".", "append", "(", "\"n\"", ")", ";", "}", "break", ";", "}", "case", "'r'", ":", "{", "match", "(", "'r'", ")", ";", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "text", ".", "setLength", "(", "_begin", ")", ";", "text", ".", "append", "(", "\"r\"", ")", ";", "}", "break", ";", "}", "case", "'t'", ":", "{", "match", "(", "'t'", ")", ";", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "text", ".", "setLength", "(", "_begin", ")", ";", "text", ".", "append", "(", "\"t\"", ")", ";", "}", "break", ";", "}", "case", "'b'", ":", "{", "match", "(", "'b'", ")", ";", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "text", ".", "setLength", "(", "_begin", ")", ";", "text", ".", "append", "(", "\"\b\"", ")", ";", "}", "break", ";", "}", "case", "'f'", ":", "{", "match", "(", "'f'", ")", ";", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "text", ".", "setLength", "(", "_begin", ")", ";", "text", ".", "append", "(", "\"", "\"", ")", ";", "}", "break", ";", "}", "case", "'\"'", ":", "{", "match", "(", "'\"'", ")", ";", "break", ";", "}", "case", "'\\''", ":", "{", "match", "(", "'\\''", ")", ";", "break", ";", "}", "case", "'\\\\'", ":", "{", "match", "(", "'\\\\'", ")", ";", "break", ";", "}", "case", "'$'", ":", "{", "match", "(", "'$'", ")", ";", "break", ";", "}", "case", "'u'", ":", "{", "{", "int", "_cnt722", "=", "0", ";", "_loop722", ":", "do", "{", "if", "(", "(", "LA", "(", "1", ")", "==", "'u'", ")", ")", "{", "match", "(", "'u'", ")", ";", "}", "else", "{", "if", "(", "_cnt722", ">=", "1", ")", "{", "break", "_loop722", ";", "}", "else", "{", "throw", "new", "NoViableAltForCharException", "(", "(", "char", ")", "LA", "(", "1", ")", ",", "getFilename", "(", ")", ",", "getLine", "(", ")", ",", "getColumn", "(", ")", ")", ";", "}", "}", "_cnt722", "++", ";", "}", "while", "(", "true", ")", ";", "}", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "text", ".", "setLength", "(", "_begin", ")", ";", "text", ".", "append", "(", "\"\"", ")", ";", "}", "mHEX_DIGIT", "(", "false", ")", ";", "mHEX_DIGIT", "(", "false", ")", ";", "mHEX_DIGIT", "(", "false", ")", ";", "mHEX_DIGIT", "(", "false", ")", ";", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "char", "ch", "=", "(", "char", ")", "Integer", ".", "parseInt", "(", "new", "String", "(", "text", ".", "getBuffer", "(", ")", ",", "_begin", ",", "text", ".", "length", "(", ")", "-", "_begin", ")", ",", "16", ")", ";", "text", ".", "setLength", "(", "_begin", ")", ";", "text", ".", "append", "(", "ch", ")", ";", "}", "break", ";", "}", "case", "'0'", ":", "case", "'1'", ":", "case", "'2'", ":", "case", "'3'", ":", "{", "matchRange", "(", "'0'", ",", "'3'", ")", ";", "{", "if", "(", "(", "(", "LA", "(", "1", ")", ">=", "'0'", "&&", "LA", "(", "1", ")", "<=", "'7'", ")", ")", "&&", "(", "(", "LA", "(", "2", ")", ">=", "'\u0000'", "&&", "LA", "(", "2", ")", "<=", "'-UNK-'", ")", ")", "&&", "(", "true", ")", "&&", "(", "true", ")", ")", "{", "matchRange", "(", "'0'", ",", "'7'", ")", ";", "{", "if", "(", "(", "(", "LA", "(", "1", ")", ">=", "'0'", "&&", "LA", "(", "1", ")", "<=", "'7'", ")", ")", "&&", "(", "(", "LA", "(", "2", ")", ">=", "'\u0000'", "&&", "LA", "(", "2", ")", "<=", "'-UNK-'", ")", ")", "&&", "(", "true", ")", "&&", "(", "true", ")", ")", "{", "matchRange", "(", "'0'", ",", "'7'", ")", ";", "}", "else", "if", "(", "(", "(", "LA", "(", "1", ")", ">=", "'\u0000'", "&&", "LA", "(", "1", ")", "<=", "'-UNK-'", ")", ")", "&&", "(", "true", ")", "&&", "(", "true", ")", "&&", "(", "true", ")", ")", "{", "}", "else", "{", "throw", "new", "NoViableAltForCharException", "(", "(", "char", ")", "LA", "(", "1", ")", ",", "getFilename", "(", ")", ",", "getLine", "(", ")", ",", "getColumn", "(", ")", ")", ";", "}", "}", "}", "else", "if", "(", "(", "(", "LA", "(", "1", ")", ">=", "'\u0000'", "&&", "LA", "(", "1", ")", "<=", "'-UNK-'", ")", ")", "&&", "(", "true", ")", "&&", "(", "true", ")", "&&", "(", "true", ")", ")", "{", "}", "else", "{", "throw", "new", "NoViableAltForCharException", "(", "(", "char", ")", "LA", "(", "1", ")", ",", "getFilename", "(", ")", ",", "getLine", "(", ")", ",", "getColumn", "(", ")", ")", ";", "}", "}", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "char", "ch", "=", "(", "char", ")", "Integer", ".", "parseInt", "(", "new", "String", "(", "text", ".", "getBuffer", "(", ")", ",", "_begin", ",", "text", ".", "length", "(", ")", "-", "_begin", ")", ",", "8", ")", ";", "text", ".", "setLength", "(", "_begin", ")", ";", "text", ".", "append", "(", "ch", ")", ";", "}", "break", ";", "}", "case", "'4'", ":", "case", "'5'", ":", "case", "'6'", ":", "case", "'7'", ":", "{", "matchRange", "(", "'4'", ",", "'7'", ")", ";", "{", "if", "(", "(", "(", "LA", "(", "1", ")", ">=", "'0'", "&&", "LA", "(", "1", ")", "<=", "'7'", ")", ")", "&&", "(", "(", "LA", "(", "2", ")", ">=", "'\u0000'", "&&", "LA", "(", "2", ")", "<=", "'-UNK-'", ")", ")", "&&", "(", "true", ")", "&&", "(", "true", ")", ")", "{", "matchRange", "(", "'0'", ",", "'7'", ")", ";", "}", "else", "if", "(", "(", "(", "LA", "(", "1", ")", ">=", "'\u0000'", "&&", "LA", "(", "1", ")", "<=", "'-UNK-'", ")", ")", "&&", "(", "true", ")", "&&", "(", "true", ")", "&&", "(", "true", ")", ")", "{", "}", "else", "{", "throw", "new", "NoViableAltForCharException", "(", "(", "char", ")", "LA", "(", "1", ")", ",", "getFilename", "(", ")", ",", "getLine", "(", ")", ",", "getColumn", "(", ")", ")", ";", "}", "}", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "char", "ch", "=", "(", "char", ")", "Integer", ".", "parseInt", "(", "new", "String", "(", "text", ".", "getBuffer", "(", ")", ",", "_begin", ",", "text", ".", "length", "(", ")", "-", "_begin", ")", ",", "8", ")", ";", "text", ".", "setLength", "(", "_begin", ")", ";", "text", ".", "append", "(", "ch", ")", ";", "}", "break", ";", "}", "default", ":", "{", "throw", "new", "NoViableAltForCharException", "(", "(", "char", ")", "LA", "(", "1", ")", ",", "getFilename", "(", ")", ",", "getLine", "(", ")", ",", "getColumn", "(", ")", ")", ";", "}", "}", "}", "}", "else", "if", "(", "(", "LA", "(", "1", ")", "==", "'\\\\'", ")", "&&", "(", "LA", "(", "2", ")", "==", "'\\n'", "||", "LA", "(", "2", ")", "==", "'\\r'", ")", ")", "{", "_saveIndex", "=", "text", ".", "length", "(", ")", ";", "match", "(", "'\\\\'", ")", ";", "text", ".", "setLength", "(", "_saveIndex", ")", ";", "_saveIndex", "=", "text", ".", "length", "(", ")", ";", "mONE_NL", "(", "false", ",", "false", ")", ";", "text", ".", "setLength", "(", "_saveIndex", ")", ";", "}", "else", "{", "throw", "new", "NoViableAltForCharException", "(", "(", "char", ")", "LA", "(", "1", ")", ",", "getFilename", "(", ")", ",", "getLine", "(", ")", ",", "getColumn", "(", ")", ")", ";", "}", "if", "(", "_createToken", "&&", "_token", "==", "null", "&&", "_ttype", "!=", "Token", ".", "SKIP", ")", "{", "_token", "=", "makeToken", "(", "_ttype", ")", ";", "_token", ".", "setText", "(", "new", "String", "(", "text", ".", "getBuffer", "(", ")", ",", "_begin", ",", "text", ".", "length", "(", ")", "-", "_begin", ")", ")", ";", "}", "_returnToken", "=", "_token", ";", "}", "protected", "final", "void", "mSTRING_NL", "(", "boolean", "_createToken", ",", "boolean", "allowNewline", ")", "throws", "RecognitionException", ",", "CharStreamException", ",", "TokenStreamException", "{", "int", "_ttype", ";", "Token", "_token", "=", "null", ";", "int", "_begin", "=", "text", ".", "length", "(", ")", ";", "_ttype", "=", "STRING_NL", ";", "int", "_saveIndex", ";", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "if", "(", "!", "allowNewline", ")", "throw", "new", "MismatchedCharException", "(", "'\\n'", ",", "'\\n'", ",", "true", ",", "this", ")", ";", "}", "mONE_NL", "(", "false", ",", "false", ")", ";", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "text", ".", "setLength", "(", "_begin", ")", ";", "text", ".", "append", "(", "'\\n'", ")", ";", "}", "if", "(", "_createToken", "&&", "_token", "==", "null", "&&", "_ttype", "!=", "Token", ".", "SKIP", ")", "{", "_token", "=", "makeToken", "(", "_ttype", ")", ";", "_token", ".", "setText", "(", "new", "String", "(", "text", ".", "getBuffer", "(", ")", ",", "_begin", ",", "text", ".", "length", "(", ")", "-", "_begin", ")", ")", ";", "}", "_returnToken", "=", "_token", ";", "}", "protected", "final", "int", "mSTRING_CTOR_END", "(", "boolean", "_createToken", ",", "boolean", "fromStart", ",", "boolean", "tripleQuote", ")", "throws", "RecognitionException", ",", "CharStreamException", ",", "TokenStreamException", "{", "int", "tt", "=", "STRING_CTOR_END", ";", "int", "_ttype", ";", "Token", "_token", "=", "null", ";", "int", "_begin", "=", "text", ".", "length", "(", ")", ";", "_ttype", "=", "STRING_CTOR_END", ";", "int", "_saveIndex", ";", "boolean", "dollarOK", "=", "false", ";", "{", "_loop686", ":", "do", "{", "switch", "(", "LA", "(", "1", ")", ")", "{", "case", "'\\\\'", ":", "{", "mESC", "(", "false", ")", ";", "break", ";", "}", "case", "'\\''", ":", "{", "match", "(", "'\\''", ")", ";", "break", ";", "}", "case", "'\\n'", ":", "case", "'\\r'", ":", "{", "mSTRING_NL", "(", "false", ",", "tripleQuote", ")", ";", "break", ";", "}", "default", ":", "boolean", "synPredMatched685", "=", "false", ";", "if", "(", "(", "(", "(", "LA", "(", "1", ")", "==", "'\"'", ")", "&&", "(", "(", "LA", "(", "2", ")", ">=", "'\u0000'", "&&", "LA", "(", "2", ")", "<=", "'-UNK-'", ")", ")", "&&", "(", "true", ")", "&&", "(", "true", ")", ")", "&&", "(", "tripleQuote", ")", ")", ")", "{", "int", "_m685", "=", "mark", "(", ")", ";", "synPredMatched685", "=", "true", ";", "inputState", ".", "guessing", "++", ";", "try", "{", "{", "match", "(", "'\"'", ")", ";", "{", "if", "(", "(", "_tokenSet_5", ".", "member", "(", "LA", "(", "1", ")", ")", ")", ")", "{", "matchNot", "(", "'\"'", ")", ";", "}", "else", "if", "(", "(", "LA", "(", "1", ")", "==", "'\"'", ")", ")", "{", "match", "(", "'\"'", ")", ";", "matchNot", "(", "'\"'", ")", ";", "}", "else", "{", "throw", "new", "NoViableAltForCharException", "(", "(", "char", ")", "LA", "(", "1", ")", ",", "getFilename", "(", ")", ",", "getLine", "(", ")", ",", "getColumn", "(", ")", ")", ";", "}", "}", "}", "}", "catch", "(", "RecognitionException", "pe", ")", "{", "synPredMatched685", "=", "false", ";", "}", "rewind", "(", "_m685", ")", ";", "inputState", ".", "guessing", "--", ";", "}", "if", "(", "synPredMatched685", ")", "{", "match", "(", "'\"'", ")", ";", "}", "else", "if", "(", "(", "_tokenSet_4", ".", "member", "(", "LA", "(", "1", ")", ")", ")", ")", "{", "mSTRING_CH", "(", "false", ")", ";", "}", "else", "{", "break", "_loop686", ";", "}", "}", "}", "while", "(", "true", ")", ";", "}", "{", "switch", "(", "LA", "(", "1", ")", ")", "{", "case", "'\"'", ":", "{", "{", "if", "(", "(", "(", "LA", "(", "1", ")", "==", "'\"'", ")", "&&", "(", "LA", "(", "2", ")", "==", "'\"'", ")", ")", "&&", "(", "tripleQuote", ")", ")", "{", "_saveIndex", "=", "text", ".", "length", "(", ")", ";", "match", "(", "\"\\\"\\\"\\\"\"", ")", ";", "text", ".", "setLength", "(", "_saveIndex", ")", ";", "}", "else", "if", "(", "(", "(", "LA", "(", "1", ")", "==", "'\"'", ")", "&&", "(", "true", ")", ")", "&&", "(", "!", "tripleQuote", ")", ")", "{", "_saveIndex", "=", "text", ".", "length", "(", ")", ";", "match", "(", "\"\\\"\"", ")", ";", "text", ".", "setLength", "(", "_saveIndex", ")", ";", "}", "else", "{", "throw", "new", "NoViableAltForCharException", "(", "(", "char", ")", "LA", "(", "1", ")", ",", "getFilename", "(", ")", ",", "getLine", "(", ")", ",", "getColumn", "(", ")", ")", ";", "}", "}", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "if", "(", "fromStart", ")", "tt", "=", "STRING_LITERAL", ";", "if", "(", "!", "tripleQuote", ")", "{", "--", "suppressNewline", ";", "}", "}", "break", ";", "}", "case", "'$'", ":", "{", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "dollarOK", "=", "atValidDollarEscape", "(", ")", ";", "}", "_saveIndex", "=", "text", ".", "length", "(", ")", ";", "match", "(", "'$'", ")", ";", "text", ".", "setLength", "(", "_saveIndex", ")", ";", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "require", "(", "dollarOK", ",", "\"\"", ",", "\"\"", ")", ";", "tt", "=", "(", "fromStart", "?", "STRING_CTOR_START", ":", "STRING_CTOR_MIDDLE", ")", ";", "stringCtorState", "=", "SCS_VAL", "+", "(", "tripleQuote", "?", "SCS_TQ_TYPE", ":", "SCS_SQ_TYPE", ")", ";", "}", "break", ";", "}", "default", ":", "{", "throw", "new", "NoViableAltForCharException", "(", "(", "char", ")", "LA", "(", "1", ")", ",", "getFilename", "(", ")", ",", "getLine", "(", ")", ",", "getColumn", "(", ")", ")", ";", "}", "}", "}", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "_ttype", "=", "tt", ";", "}", "if", "(", "_createToken", "&&", "_token", "==", "null", "&&", "_ttype", "!=", "Token", ".", "SKIP", ")", "{", "_token", "=", "makeToken", "(", "_ttype", ")", ";", "_token", ".", "setText", "(", "new", "String", "(", "text", ".", "getBuffer", "(", ")", ",", "_begin", ",", "text", ".", "length", "(", ")", "-", "_begin", ")", ")", ";", "}", "_returnToken", "=", "_token", ";", "return", "tt", ";", "}", "public", "final", "void", "mREGEXP_LITERAL", "(", "boolean", "_createToken", ")", "throws", "RecognitionException", ",", "CharStreamException", ",", "TokenStreamException", "{", "int", "_ttype", ";", "Token", "_token", "=", "null", ";", "int", "_begin", "=", "text", ".", "length", "(", ")", ";", "_ttype", "=", "REGEXP_LITERAL", ";", "int", "_saveIndex", ";", "int", "tt", "=", "0", ";", "if", "(", "(", "(", "LA", "(", "1", ")", "==", "'/'", ")", "&&", "(", "_tokenSet_6", ".", "member", "(", "LA", "(", "2", ")", ")", ")", "&&", "(", "true", ")", "&&", "(", "true", ")", ")", "&&", "(", "allowRegexpLiteral", "(", ")", ")", ")", "{", "_saveIndex", "=", "text", ".", "length", "(", ")", ";", "match", "(", "'/'", ")", ";", "text", ".", "setLength", "(", "_saveIndex", ")", ";", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "++", "suppressNewline", ";", "}", "{", "if", "(", "(", "(", "LA", "(", "1", ")", "==", "'$'", ")", "&&", "(", "_tokenSet_7", ".", "member", "(", "LA", "(", "2", ")", ")", ")", ")", "&&", "(", "!", "atValidDollarEscape", "(", ")", ")", ")", "{", "match", "(", "'$'", ")", ";", "tt", "=", "mREGEXP_CTOR_END", "(", "false", ",", "true", ")", ";", "}", "else", "if", "(", "(", "_tokenSet_8", ".", "member", "(", "LA", "(", "1", ")", ")", ")", ")", "{", "mREGEXP_SYMBOL", "(", "false", ")", ";", "tt", "=", "mREGEXP_CTOR_END", "(", "false", ",", "true", ")", ";", "}", "else", "if", "(", "(", "LA", "(", "1", ")", "==", "'$'", ")", "&&", "(", "true", ")", ")", "{", "_saveIndex", "=", "text", ".", "length", "(", ")", ";", "match", "(", "'$'", ")", ";", "text", ".", "setLength", "(", "_saveIndex", ")", ";", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "tt", "=", "STRING_CTOR_START", ";", "stringCtorState", "=", "SCS_VAL", "+", "SCS_RE_TYPE", ";", "}", "}", "else", "{", "throw", "new", "NoViableAltForCharException", "(", "(", "char", ")", "LA", "(", "1", ")", ",", "getFilename", "(", ")", ",", "getLine", "(", ")", ",", "getColumn", "(", ")", ")", ";", "}", "}", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "_ttype", "=", "tt", ";", "}", "}", "else", "if", "(", "(", "LA", "(", "1", ")", "==", "'/'", ")", "&&", "(", "LA", "(", "2", ")", "==", "'='", ")", "&&", "(", "true", ")", "&&", "(", "true", ")", ")", "{", "mDIV_ASSIGN", "(", "false", ")", ";", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "_ttype", "=", "DIV_ASSIGN", ";", "}", "}", "else", "if", "(", "(", "LA", "(", "1", ")", "==", "'/'", ")", "&&", "(", "true", ")", ")", "{", "mDIV", "(", "false", ")", ";", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "_ttype", "=", "DIV", ";", "}", "}", "else", "{", "throw", "new", "NoViableAltForCharException", "(", "(", "char", ")", "LA", "(", "1", ")", ",", "getFilename", "(", ")", ",", "getLine", "(", ")", ",", "getColumn", "(", ")", ")", ";", "}", "if", "(", "_createToken", "&&", "_token", "==", "null", "&&", "_ttype", "!=", "Token", ".", "SKIP", ")", "{", "_token", "=", "makeToken", "(", "_ttype", ")", ";", "_token", ".", "setText", "(", "new", "String", "(", "text", ".", "getBuffer", "(", ")", ",", "_begin", ",", "text", ".", "length", "(", ")", "-", "_begin", ")", ")", ";", "}", "_returnToken", "=", "_token", ";", "}", "protected", "final", "void", "mREGEXP_SYMBOL", "(", "boolean", "_createToken", ")", "throws", "RecognitionException", ",", "CharStreamException", ",", "TokenStreamException", "{", "int", "_ttype", ";", "Token", "_token", "=", "null", ";", "int", "_begin", "=", "text", ".", "length", "(", ")", ";", "_ttype", "=", "REGEXP_SYMBOL", ";", "int", "_saveIndex", ";", "{", "if", "(", "(", "LA", "(", "1", ")", "==", "'\\\\'", ")", "&&", "(", "LA", "(", "2", ")", "==", "'/'", ")", "&&", "(", "(", "LA", "(", "3", ")", ">=", "'\u0000'", "&&", "LA", "(", "3", ")", "<=", "'-UNK-'", ")", ")", "&&", "(", "true", ")", ")", "{", "match", "(", "'\\\\'", ")", ";", "match", "(", "'/'", ")", ";", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "text", ".", "setLength", "(", "_begin", ")", ";", "text", ".", "append", "(", "'/'", ")", ";", "}", "}", "else", "if", "(", "(", "LA", "(", "1", ")", "==", "'\\\\'", ")", "&&", "(", "LA", "(", "2", ")", "==", "'\\n'", "||", "LA", "(", "2", ")", "==", "'\\r'", ")", "&&", "(", "(", "LA", "(", "3", ")", ">=", "'\u0000'", "&&", "LA", "(", "3", ")", "<=", "'-UNK-'", ")", ")", "&&", "(", "true", ")", ")", "{", "_saveIndex", "=", "text", ".", "length", "(", ")", ";", "match", "(", "'\\\\'", ")", ";", "text", ".", "setLength", "(", "_saveIndex", ")", ";", "_saveIndex", "=", "text", ".", "length", "(", ")", ";", "mONE_NL", "(", "false", ",", "false", ")", ";", "text", ".", "setLength", "(", "_saveIndex", ")", ";", "}", "else", "if", "(", "(", "(", "LA", "(", "1", ")", "==", "'\\\\'", ")", "&&", "(", "(", "LA", "(", "2", ")", ">=", "'\u0000'", "&&", "LA", "(", "2", ")", "<=", "'-UNK-'", ")", ")", "&&", "(", "true", ")", "&&", "(", "true", ")", ")", "&&", "(", "LA", "(", "2", ")", "!=", "'/'", "&&", "LA", "(", "2", ")", "!=", "'\\n'", "&&", "LA", "(", "2", ")", "!=", "'\\r'", ")", ")", "{", "match", "(", "'\\\\'", ")", ";", "}", "else", "if", "(", "(", "_tokenSet_9", ".", "member", "(", "LA", "(", "1", ")", ")", ")", ")", "{", "{", "match", "(", "_tokenSet_9", ")", ";", "}", "}", "else", "if", "(", "(", "LA", "(", "1", ")", "==", "'\\n'", "||", "LA", "(", "1", ")", "==", "'\\r'", ")", ")", "{", "mSTRING_NL", "(", "false", ",", "true", ")", ";", "}", "else", "{", "throw", "new", "NoViableAltForCharException", "(", "(", "char", ")", "LA", "(", "1", ")", ",", "getFilename", "(", ")", ",", "getLine", "(", ")", ",", "getColumn", "(", ")", ")", ";", "}", "}", "{", "_loop713", ":", "do", "{", "if", "(", "(", "LA", "(", "1", ")", "==", "'*'", ")", ")", "{", "match", "(", "'*'", ")", ";", "}", "else", "{", "break", "_loop713", ";", "}", "}", "while", "(", "true", ")", ";", "}", "if", "(", "_createToken", "&&", "_token", "==", "null", "&&", "_ttype", "!=", "Token", ".", "SKIP", ")", "{", "_token", "=", "makeToken", "(", "_ttype", ")", ";", "_token", ".", "setText", "(", "new", "String", "(", "text", ".", "getBuffer", "(", ")", ",", "_begin", ",", "text", ".", "length", "(", ")", "-", "_begin", ")", ")", ";", "}", "_returnToken", "=", "_token", ";", "}", "protected", "final", "int", "mREGEXP_CTOR_END", "(", "boolean", "_createToken", ",", "boolean", "fromStart", ")", "throws", "RecognitionException", ",", "CharStreamException", ",", "TokenStreamException", "{", "int", "tt", "=", "STRING_CTOR_END", ";", "int", "_ttype", ";", "Token", "_token", "=", "null", ";", "int", "_begin", "=", "text", ".", "length", "(", ")", ";", "_ttype", "=", "REGEXP_CTOR_END", ";", "int", "_saveIndex", ";", "{", "_loop697", ":", "do", "{", "if", "(", "(", "(", "LA", "(", "1", ")", "==", "'$'", ")", "&&", "(", "_tokenSet_7", ".", "member", "(", "LA", "(", "2", ")", ")", ")", ")", "&&", "(", "!", "atValidDollarEscape", "(", ")", ")", ")", "{", "match", "(", "'$'", ")", ";", "}", "else", "if", "(", "(", "_tokenSet_8", ".", "member", "(", "LA", "(", "1", ")", ")", ")", ")", "{", "mREGEXP_SYMBOL", "(", "false", ")", ";", "}", "else", "{", "break", "_loop697", ";", "}", "}", "while", "(", "true", ")", ";", "}", "{", "switch", "(", "LA", "(", "1", ")", ")", "{", "case", "'/'", ":", "{", "_saveIndex", "=", "text", ".", "length", "(", ")", ";", "match", "(", "'/'", ")", ";", "text", ".", "setLength", "(", "_saveIndex", ")", ";", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "if", "(", "fromStart", ")", "tt", "=", "STRING_LITERAL", ";", "{", "--", "suppressNewline", ";", "}", "}", "break", ";", "}", "case", "'$'", ":", "{", "_saveIndex", "=", "text", ".", "length", "(", ")", ";", "match", "(", "'$'", ")", ";", "text", ".", "setLength", "(", "_saveIndex", ")", ";", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "tt", "=", "(", "fromStart", "?", "STRING_CTOR_START", ":", "STRING_CTOR_MIDDLE", ")", ";", "stringCtorState", "=", "SCS_VAL", "+", "SCS_RE_TYPE", ";", "}", "break", ";", "}", "default", ":", "{", "throw", "new", "NoViableAltForCharException", "(", "(", "char", ")", "LA", "(", "1", ")", ",", "getFilename", "(", ")", ",", "getLine", "(", ")", ",", "getColumn", "(", ")", ")", ";", "}", "}", "}", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "_ttype", "=", "tt", ";", "}", "if", "(", "_createToken", "&&", "_token", "==", "null", "&&", "_ttype", "!=", "Token", ".", "SKIP", ")", "{", "_token", "=", "makeToken", "(", "_ttype", ")", ";", "_token", ".", "setText", "(", "new", "String", "(", "text", ".", "getBuffer", "(", ")", ",", "_begin", ",", "text", ".", "length", "(", ")", "-", "_begin", ")", ")", ";", "}", "_returnToken", "=", "_token", ";", "return", "tt", ";", "}", "public", "final", "void", "mDOLLAR_REGEXP_LITERAL", "(", "boolean", "_createToken", ")", "throws", "RecognitionException", ",", "CharStreamException", ",", "TokenStreamException", "{", "int", "_ttype", ";", "Token", "_token", "=", "null", ";", "int", "_begin", "=", "text", ".", "length", "(", ")", ";", "_ttype", "=", "DOLLAR_REGEXP_LITERAL", ";", "int", "_saveIndex", ";", "int", "tt", "=", "0", ";", "if", "(", "!", "(", "allowRegexpLiteral", "(", ")", ")", ")", "throw", "new", "SemanticException", "(", "\"\"", ")", ";", "_saveIndex", "=", "text", ".", "length", "(", ")", ";", "match", "(", "\"$/\"", ")", ";", "text", ".", "setLength", "(", "_saveIndex", ")", ";", "{", "if", "(", "(", "(", "LA", "(", "1", ")", "==", "'$'", ")", "&&", "(", "(", "LA", "(", "2", ")", ">=", "'\u0000'", "&&", "LA", "(", "2", ")", "<=", "'-UNK-'", ")", ")", ")", "&&", "(", "!", "atValidDollarEscape", "(", ")", ")", ")", "{", "match", "(", "'$'", ")", ";", "tt", "=", "mDOLLAR_REGEXP_CTOR_END", "(", "false", ",", "true", ")", ";", "}", "else", "if", "(", "(", "_tokenSet_10", ".", "member", "(", "LA", "(", "1", ")", ")", ")", ")", "{", "mDOLLAR_REGEXP_SYMBOL", "(", "false", ")", ";", "tt", "=", "mDOLLAR_REGEXP_CTOR_END", "(", "false", ",", "true", ")", ";", "}", "else", "if", "(", "(", "LA", "(", "1", ")", "==", "'$'", ")", "&&", "(", "true", ")", ")", "{", "_saveIndex", "=", "text", ".", "length", "(", ")", ";", "match", "(", "'$'", ")", ";", "text", ".", "setLength", "(", "_saveIndex", ")", ";", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "tt", "=", "STRING_CTOR_START", ";", "stringCtorState", "=", "SCS_VAL", "+", "SCS_DRE_TYPE", ";", "}", "}", "else", "{", "throw", "new", "NoViableAltForCharException", "(", "(", "char", ")", "LA", "(", "1", ")", ",", "getFilename", "(", ")", ",", "getLine", "(", ")", ",", "getColumn", "(", ")", ")", ";", "}", "}", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "_ttype", "=", "tt", ";", "}", "if", "(", "_createToken", "&&", "_token", "==", "null", "&&", "_ttype", "!=", "Token", ".", "SKIP", ")", "{", "_token", "=", "makeToken", "(", "_ttype", ")", ";", "_token", ".", "setText", "(", "new", "String", "(", "text", ".", "getBuffer", "(", ")", ",", "_begin", ",", "text", ".", "length", "(", ")", "-", "_begin", ")", ")", ";", "}", "_returnToken", "=", "_token", ";", "}", "protected", "final", "void", "mDOLLAR_REGEXP_SYMBOL", "(", "boolean", "_createToken", ")", "throws", "RecognitionException", ",", "CharStreamException", ",", "TokenStreamException", "{", "int", "_ttype", ";", "Token", "_token", "=", "null", ";", "int", "_begin", "=", "text", ".", "length", "(", ")", ";", "_ttype", "=", "DOLLAR_REGEXP_SYMBOL", ";", "int", "_saveIndex", ";", "{", "switch", "(", "LA", "(", "1", ")", ")", "{", "case", "'/'", ":", "{", "match", "(", "'/'", ")", ";", "break", ";", "}", "case", "'\\n'", ":", "case", "'\\r'", ":", "{", "mSTRING_NL", "(", "false", ",", "true", ")", ";", "break", ";", "}", "default", ":", "if", "(", "(", "LA", "(", "1", ")", "==", "'\\\\'", ")", "&&", "(", "LA", "(", "2", ")", "==", "'\\n'", "||", "LA", "(", "2", ")", "==", "'\\r'", ")", "&&", "(", "(", "LA", "(", "3", ")", ">=", "'\u0000'", "&&", "LA", "(", "3", ")", "<=", "'-UNK-'", ")", ")", "&&", "(", "true", ")", ")", "{", "_saveIndex", "=", "text", ".", "length", "(", ")", ";", "match", "(", "'\\\\'", ")", ";", "text", ".", "setLength", "(", "_saveIndex", ")", ";", "_saveIndex", "=", "text", ".", "length", "(", ")", ";", "mONE_NL", "(", "false", ",", "false", ")", ";", "text", ".", "setLength", "(", "_saveIndex", ")", ";", "}", "else", "if", "(", "(", "(", "LA", "(", "1", ")", "==", "'\\\\'", ")", "&&", "(", "(", "LA", "(", "2", ")", ">=", "'\u0000'", "&&", "LA", "(", "2", ")", "<=", "'-UNK-'", ")", ")", "&&", "(", "true", ")", "&&", "(", "true", ")", ")", "&&", "(", "LA", "(", "2", ")", "!=", "'\\n'", "&&", "LA", "(", "2", ")", "!=", "'\\r'", ")", ")", "{", "match", "(", "'\\\\'", ")", ";", "}", "else", "if", "(", "(", "_tokenSet_11", ".", "member", "(", "LA", "(", "1", ")", ")", ")", ")", "{", "{", "match", "(", "_tokenSet_11", ")", ";", "}", "}", "else", "{", "throw", "new", "NoViableAltForCharException", "(", "(", "char", ")", "LA", "(", "1", ")", ",", "getFilename", "(", ")", ",", "getLine", "(", ")", ",", "getColumn", "(", ")", ")", ";", "}", "}", "}", "if", "(", "_createToken", "&&", "_token", "==", "null", "&&", "_ttype", "!=", "Token", ".", "SKIP", ")", "{", "_token", "=", "makeToken", "(", "_ttype", ")", ";", "_token", ".", "setText", "(", "new", "String", "(", "text", ".", "getBuffer", "(", ")", ",", "_begin", ",", "text", ".", "length", "(", ")", "-", "_begin", ")", ")", ";", "}", "_returnToken", "=", "_token", ";", "}", "protected", "final", "int", "mDOLLAR_REGEXP_CTOR_END", "(", "boolean", "_createToken", ",", "boolean", "fromStart", ")", "throws", "RecognitionException", ",", "CharStreamException", ",", "TokenStreamException", "{", "int", "tt", "=", "STRING_CTOR_END", ";", "int", "_ttype", ";", "Token", "_token", "=", "null", ";", "int", "_begin", "=", "text", ".", "length", "(", ")", ";", "_ttype", "=", "DOLLAR_REGEXP_CTOR_END", ";", "int", "_saveIndex", ";", "{", "_loop705", ":", "do", "{", "boolean", "synPredMatched702", "=", "false", ";", "if", "(", "(", "(", "LA", "(", "1", ")", "==", "'$'", ")", "&&", "(", "LA", "(", "2", ")", "==", "'/'", ")", "&&", "(", "(", "LA", "(", "3", ")", ">=", "'\u0000'", "&&", "LA", "(", "3", ")", "<=", "'-UNK-'", ")", ")", "&&", "(", "true", ")", ")", ")", "{", "int", "_m702", "=", "mark", "(", ")", ";", "synPredMatched702", "=", "true", ";", "inputState", ".", "guessing", "++", ";", "try", "{", "{", "match", "(", "'$'", ")", ";", "match", "(", "'/'", ")", ";", "}", "}", "catch", "(", "RecognitionException", "pe", ")", "{", "synPredMatched702", "=", "false", ";", "}", "rewind", "(", "_m702", ")", ";", "inputState", ".", "guessing", "--", ";", "}", "if", "(", "synPredMatched702", ")", "{", "mESCAPED_SLASH", "(", "false", ")", ";", "}", "else", "{", "boolean", "synPredMatched704", "=", "false", ";", "if", "(", "(", "(", "LA", "(", "1", ")", "==", "'$'", ")", "&&", "(", "LA", "(", "2", ")", "==", "'$'", ")", "&&", "(", "(", "LA", "(", "3", ")", ">=", "'\u0000'", "&&", "LA", "(", "3", ")", "<=", "'-UNK-'", ")", ")", "&&", "(", "true", ")", ")", ")", "{", "int", "_m704", "=", "mark", "(", ")", ";", "synPredMatched704", "=", "true", ";", "inputState", ".", "guessing", "++", ";", "try", "{", "{", "match", "(", "'$'", ")", ";", "match", "(", "'$'", ")", ";", "}", "}", "catch", "(", "RecognitionException", "pe", ")", "{", "synPredMatched704", "=", "false", ";", "}", "rewind", "(", "_m704", ")", ";", "inputState", ".", "guessing", "--", ";", "}", "if", "(", "synPredMatched704", ")", "{", "mESCAPED_DOLLAR", "(", "false", ")", ";", "}", "else", "if", "(", "(", "(", "_tokenSet_10", ".", "member", "(", "LA", "(", "1", ")", ")", ")", "&&", "(", "(", "LA", "(", "2", ")", ">=", "'\u0000'", "&&", "LA", "(", "2", ")", "<=", "'-UNK-'", ")", ")", "&&", "(", "true", ")", "&&", "(", "true", ")", ")", "&&", "(", "!", "(", "LA", "(", "1", ")", "==", "'/'", "&&", "LA", "(", "2", ")", "==", "'$'", ")", ")", ")", "{", "mDOLLAR_REGEXP_SYMBOL", "(", "false", ")", ";", "}", "else", "if", "(", "(", "(", "LA", "(", "1", ")", "==", "'$'", ")", "&&", "(", "(", "LA", "(", "2", ")", ">=", "'\u0000'", "&&", "LA", "(", "2", ")", "<=", "'-UNK-'", ")", ")", "&&", "(", "true", ")", "&&", "(", "true", ")", ")", "&&", "(", "!", "atValidDollarEscape", "(", ")", "&&", "!", "atDollarSlashEscape", "(", ")", "&&", "!", "atDollarDollarEscape", "(", ")", ")", ")", "{", "match", "(", "'$'", ")", ";", "}", "else", "{", "break", "_loop705", ";", "}", "}", "}", "while", "(", "true", ")", ";", "}", "{", "switch", "(", "LA", "(", "1", ")", ")", "{", "case", "'/'", ":", "{", "_saveIndex", "=", "text", ".", "length", "(", ")", ";", "match", "(", "\"/$\"", ")", ";", "text", ".", "setLength", "(", "_saveIndex", ")", ";", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "if", "(", "fromStart", ")", "tt", "=", "STRING_LITERAL", ";", "}", "break", ";", "}", "case", "'$'", ":", "{", "_saveIndex", "=", "text", ".", "length", "(", ")", ";", "match", "(", "'$'", ")", ";", "text", ".", "setLength", "(", "_saveIndex", ")", ";", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "tt", "=", "(", "fromStart", "?", "STRING_CTOR_START", ":", "STRING_CTOR_MIDDLE", ")", ";", "stringCtorState", "=", "SCS_VAL", "+", "SCS_DRE_TYPE", ";", "}", "break", ";", "}", "default", ":", "{", "throw", "new", "NoViableAltForCharException", "(", "(", "char", ")", "LA", "(", "1", ")", ",", "getFilename", "(", ")", ",", "getLine", "(", ")", ",", "getColumn", "(", ")", ")", ";", "}", "}", "}", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "_ttype", "=", "tt", ";", "}", "if", "(", "_createToken", "&&", "_token", "==", "null", "&&", "_ttype", "!=", "Token", ".", "SKIP", ")", "{", "_token", "=", "makeToken", "(", "_ttype", ")", ";", "_token", ".", "setText", "(", "new", "String", "(", "text", ".", "getBuffer", "(", ")", ",", "_begin", ",", "text", ".", "length", "(", ")", "-", "_begin", ")", ")", ";", "}", "_returnToken", "=", "_token", ";", "return", "tt", ";", "}", "protected", "final", "void", "mESCAPED_SLASH", "(", "boolean", "_createToken", ")", "throws", "RecognitionException", ",", "CharStreamException", ",", "TokenStreamException", "{", "int", "_ttype", ";", "Token", "_token", "=", "null", ";", "int", "_begin", "=", "text", ".", "length", "(", ")", ";", "_ttype", "=", "ESCAPED_SLASH", ";", "int", "_saveIndex", ";", "match", "(", "'$'", ")", ";", "match", "(", "'/'", ")", ";", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "text", ".", "setLength", "(", "_begin", ")", ";", "text", ".", "append", "(", "'/'", ")", ";", "}", "if", "(", "_createToken", "&&", "_token", "==", "null", "&&", "_ttype", "!=", "Token", ".", "SKIP", ")", "{", "_token", "=", "makeToken", "(", "_ttype", ")", ";", "_token", ".", "setText", "(", "new", "String", "(", "text", ".", "getBuffer", "(", ")", ",", "_begin", ",", "text", ".", "length", "(", ")", "-", "_begin", ")", ")", ";", "}", "_returnToken", "=", "_token", ";", "}", "protected", "final", "void", "mESCAPED_DOLLAR", "(", "boolean", "_createToken", ")", "throws", "RecognitionException", ",", "CharStreamException", ",", "TokenStreamException", "{", "int", "_ttype", ";", "Token", "_token", "=", "null", ";", "int", "_begin", "=", "text", ".", "length", "(", ")", ";", "_ttype", "=", "ESCAPED_DOLLAR", ";", "int", "_saveIndex", ";", "match", "(", "'$'", ")", ";", "match", "(", "'$'", ")", ";", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "text", ".", "setLength", "(", "_begin", ")", ";", "text", ".", "append", "(", "'$'", ")", ";", "}", "if", "(", "_createToken", "&&", "_token", "==", "null", "&&", "_ttype", "!=", "Token", ".", "SKIP", ")", "{", "_token", "=", "makeToken", "(", "_ttype", ")", ";", "_token", ".", "setText", "(", "new", "String", "(", "text", ".", "getBuffer", "(", ")", ",", "_begin", ",", "text", ".", "length", "(", ")", "-", "_begin", ")", ")", ";", "}", "_returnToken", "=", "_token", ";", "}", "protected", "final", "void", "mHEX_DIGIT", "(", "boolean", "_createToken", ")", "throws", "RecognitionException", ",", "CharStreamException", ",", "TokenStreamException", "{", "int", "_ttype", ";", "Token", "_token", "=", "null", ";", "int", "_begin", "=", "text", ".", "length", "(", ")", ";", "_ttype", "=", "HEX_DIGIT", ";", "int", "_saveIndex", ";", "{", "switch", "(", "LA", "(", "1", ")", ")", "{", "case", "'0'", ":", "case", "'1'", ":", "case", "'2'", ":", "case", "'3'", ":", "case", "'4'", ":", "case", "'5'", ":", "case", "'6'", ":", "case", "'7'", ":", "case", "'8'", ":", "case", "'9'", ":", "{", "matchRange", "(", "'0'", ",", "'9'", ")", ";", "break", ";", "}", "case", "'A'", ":", "case", "'B'", ":", "case", "'C'", ":", "case", "'D'", ":", "case", "'E'", ":", "case", "'F'", ":", "{", "matchRange", "(", "'A'", ",", "'F'", ")", ";", "break", ";", "}", "case", "'a'", ":", "case", "'b'", ":", "case", "'c'", ":", "case", "'d'", ":", "case", "'e'", ":", "case", "'f'", ":", "{", "matchRange", "(", "'a'", ",", "'f'", ")", ";", "break", ";", "}", "default", ":", "{", "throw", "new", "NoViableAltForCharException", "(", "(", "char", ")", "LA", "(", "1", ")", ",", "getFilename", "(", ")", ",", "getLine", "(", ")", ",", "getColumn", "(", ")", ")", ";", "}", "}", "}", "if", "(", "_createToken", "&&", "_token", "==", "null", "&&", "_ttype", "!=", "Token", ".", "SKIP", ")", "{", "_token", "=", "makeToken", "(", "_ttype", ")", ";", "_token", ".", "setText", "(", "new", "String", "(", "text", ".", "getBuffer", "(", ")", ",", "_begin", ",", "text", ".", "length", "(", ")", "-", "_begin", ")", ")", ";", "}", "_returnToken", "=", "_token", ";", "}", "protected", "final", "void", "mVOCAB", "(", "boolean", "_createToken", ")", "throws", "RecognitionException", ",", "CharStreamException", ",", "TokenStreamException", "{", "int", "_ttype", ";", "Token", "_token", "=", "null", ";", "int", "_begin", "=", "text", ".", "length", "(", ")", ";", "_ttype", "=", "VOCAB", ";", "int", "_saveIndex", ";", "matchRange", "(", "'\\3'", ",", "'\\377'", ")", ";", "if", "(", "_createToken", "&&", "_token", "==", "null", "&&", "_ttype", "!=", "Token", ".", "SKIP", ")", "{", "_token", "=", "makeToken", "(", "_ttype", ")", ";", "_token", ".", "setText", "(", "new", "String", "(", "text", ".", "getBuffer", "(", ")", ",", "_begin", ",", "text", ".", "length", "(", ")", "-", "_begin", ")", ")", ";", "}", "_returnToken", "=", "_token", ";", "}", "public", "final", "void", "mIDENT", "(", "boolean", "_createToken", ")", "throws", "RecognitionException", ",", "CharStreamException", ",", "TokenStreamException", "{", "int", "_ttype", ";", "Token", "_token", "=", "null", ";", "int", "_begin", "=", "text", ".", "length", "(", ")", ";", "_ttype", "=", "IDENT", ";", "int", "_saveIndex", ";", "{", "if", "(", "(", "(", "_tokenSet_0", ".", "member", "(", "LA", "(", "1", ")", ")", ")", "&&", "(", "true", ")", "&&", "(", "true", ")", "&&", "(", "true", ")", ")", "&&", "(", "stringCtorState", "==", "0", ")", ")", "{", "{", "if", "(", "(", "LA", "(", "1", ")", "==", "'$'", ")", ")", "{", "mDOLLAR", "(", "false", ")", ";", "}", "else", "if", "(", "(", "_tokenSet_12", ".", "member", "(", "LA", "(", "1", ")", ")", ")", ")", "{", "mLETTER", "(", "false", ")", ";", "}", "else", "{", "throw", "new", "NoViableAltForCharException", "(", "(", "char", ")", "LA", "(", "1", ")", ",", "getFilename", "(", ")", ",", "getLine", "(", ")", ",", "getColumn", "(", ")", ")", ";", "}", "}", "{", "_loop734", ":", "do", "{", "switch", "(", "LA", "(", "1", ")", ")", "{", "case", "'0'", ":", "case", "'1'", ":", "case", "'2'", ":", "case", "'3'", ":", "case", "'4'", ":", "case", "'5'", ":", "case", "'6'", ":", "case", "'7'", ":", "case", "'8'", ":", "case", "'9'", ":", "{", "mDIGIT", "(", "false", ")", ";", "break", ";", "}", "case", "'$'", ":", "{", "mDOLLAR", "(", "false", ")", ";", "break", ";", "}", "default", ":", "if", "(", "(", "_tokenSet_12", ".", "member", "(", "LA", "(", "1", ")", ")", ")", ")", "{", "mLETTER", "(", "false", ")", ";", "}", "else", "{", "break", "_loop734", ";", "}", "}", "}", "while", "(", "true", ")", ";", "}", "}", "else", "if", "(", "(", "_tokenSet_12", ".", "member", "(", "LA", "(", "1", ")", ")", ")", "&&", "(", "true", ")", "&&", "(", "true", ")", "&&", "(", "true", ")", ")", "{", "mLETTER", "(", "false", ")", ";", "{", "_loop736", ":", "do", "{", "if", "(", "(", "_tokenSet_12", ".", "member", "(", "LA", "(", "1", ")", ")", ")", ")", "{", "mLETTER", "(", "false", ")", ";", "}", "else", "if", "(", "(", "(", "LA", "(", "1", ")", ">=", "'0'", "&&", "LA", "(", "1", ")", "<=", "'9'", ")", ")", ")", "{", "mDIGIT", "(", "false", ")", ";", "}", "else", "{", "break", "_loop736", ";", "}", "}", "while", "(", "true", ")", ";", "}", "}", "else", "{", "throw", "new", "NoViableAltForCharException", "(", "(", "char", ")", "LA", "(", "1", ")", ",", "getFilename", "(", ")", ",", "getLine", "(", ")", ",", "getColumn", "(", ")", ")", ";", "}", "}", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "if", "(", "stringCtorState", "!=", "0", ")", "{", "if", "(", "LA", "(", "1", ")", "==", "'.'", "&&", "LA", "(", "2", ")", "!=", "'$'", "&&", "Character", ".", "isJavaIdentifierStart", "(", "LA", "(", "2", ")", ")", ")", "{", "restartStringCtor", "(", "false", ")", ";", "}", "else", "{", "restartStringCtor", "(", "true", ")", ";", "}", "}", "int", "ttype", "=", "testLiteralsTable", "(", "IDENT", ")", ";", "if", "(", "(", "ttype", "==", "LITERAL_as", "||", "ttype", "==", "LITERAL_def", "||", "ttype", "==", "LITERAL_in", ")", "&&", "(", "LA", "(", "1", ")", "==", "'.'", "||", "lastSigTokenType", "==", "DOT", "||", "lastSigTokenType", "==", "LITERAL_package", ")", ")", "{", "ttype", "=", "IDENT", ";", "}", "if", "(", "ttype", "==", "LITERAL_static", "&&", "LA", "(", "1", ")", "==", "'.'", ")", "{", "ttype", "=", "IDENT", ";", "}", "_ttype", "=", "ttype", ";", "if", "(", "assertEnabled", "&&", "\"assert\"", ".", "equals", "(", "new", "String", "(", "text", ".", "getBuffer", "(", ")", ",", "_begin", ",", "text", ".", "length", "(", ")", "-", "_begin", ")", ")", ")", "{", "_ttype", "=", "LITERAL_assert", ";", "}", "if", "(", "enumEnabled", "&&", "\"enum\"", ".", "equals", "(", "new", "String", "(", "text", ".", "getBuffer", "(", ")", ",", "_begin", ",", "text", ".", "length", "(", ")", "-", "_begin", ")", ")", ")", "{", "_ttype", "=", "LITERAL_enum", ";", "}", "}", "if", "(", "_createToken", "&&", "_token", "==", "null", "&&", "_ttype", "!=", "Token", ".", "SKIP", ")", "{", "_token", "=", "makeToken", "(", "_ttype", ")", ";", "_token", ".", "setText", "(", "new", "String", "(", "text", ".", "getBuffer", "(", ")", ",", "_begin", ",", "text", ".", "length", "(", ")", "-", "_begin", ")", ")", ";", "}", "_returnToken", "=", "_token", ";", "}", "protected", "final", "void", "mLETTER", "(", "boolean", "_createToken", ")", "throws", "RecognitionException", ",", "CharStreamException", ",", "TokenStreamException", "{", "int", "_ttype", ";", "Token", "_token", "=", "null", ";", "int", "_begin", "=", "text", ".", "length", "(", ")", ";", "_ttype", "=", "LETTER", ";", "int", "_saveIndex", ";", "switch", "(", "LA", "(", "1", ")", ")", "{", "case", "'a'", ":", "case", "'b'", ":", "case", "'c'", ":", "case", "'d'", ":", "case", "'e'", ":", "case", "'f'", ":", "case", "'g'", ":", "case", "'h'", ":", "case", "'i'", ":", "case", "'j'", ":", "case", "'k'", ":", "case", "'l'", ":", "case", "'m'", ":", "case", "'n'", ":", "case", "'o'", ":", "case", "'p'", ":", "case", "'q'", ":", "case", "'r'", ":", "case", "'s'", ":", "case", "'t'", ":", "case", "'u'", ":", "case", "'v'", ":", "case", "'w'", ":", "case", "'x'", ":", "case", "'y'", ":", "case", "'z'", ":", "{", "matchRange", "(", "'a'", ",", "'z'", ")", ";", "break", ";", "}", "case", "'A'", ":", "case", "'B'", ":", "case", "'C'", ":", "case", "'D'", ":", "case", "'E'", ":", "case", "'F'", ":", "case", "'G'", ":", "case", "'H'", ":", "case", "'I'", ":", "case", "'J'", ":", "case", "'K'", ":", "case", "'L'", ":", "case", "'M'", ":", "case", "'N'", ":", "case", "'O'", ":", "case", "'P'", ":", "case", "'Q'", ":", "case", "'R'", ":", "case", "'S'", ":", "case", "'T'", ":", "case", "'U'", ":", "case", "'V'", ":", "case", "'W'", ":", "case", "'X'", ":", "case", "'Y'", ":", "case", "'Z'", ":", "{", "matchRange", "(", "'A'", ",", "'Z'", ")", ";", "break", ";", "}", "case", "'-UNK-'", ":", "case", "'-UNK-'", ":", "case", "'-UNK-'", ":", "case", "'-UNK-'", ":", "case", "'-UNK-'", ":", "case", "'-UNK-'", ":", "case", "'-UNK-'", ":", "case", "'-UNK-'", ":", "case", "'-UNK-'", ":", "case", "'-UNK-'", ":", "case", "'-UNK-'", ":", "case", "'-UNK-'", ":", "case", "'-UNK-'", ":", "case", "'-UNK-'", ":", "case", "'-UNK-'", ":", "case", "'-UNK-'", ":", "case", "'-UNK-'", ":", "case", "'-UNK-'", ":", "case", "'-UNK-'", ":", "case", "'-UNK-'", ":", "case", "'-UNK-'", ":", "case", "'-UNK-'", ":", "case", "'-UNK-'", ":", "{", "matchRange", "(", "'-UNK-'", ",", "'-UNK-'", ")", ";", "break", ";", "}", "case", "'-UNK-'", ":", "case", "'-UNK-'", ":", "case", "'-UNK-'", ":", "case", "'-UNK-'", ":", "case", "'-UNK-'", ":", "case", "'-UNK-'", ":", "case", "'-UNK-'", ":", "case", "'-UNK-'", ":", "case", "'-UNK-'", ":", "case", "'-UNK-'", ":", "case", "'-UNK-'", ":", "case", "'-UNK-'", ":", "case", "'-UNK-'", ":", "case", "'-UNK-'", ":", "case", "'-UNK-'", ":", "case", "'-UNK-'", ":", "case", "'-UNK-'", ":", "case", "'-UNK-'", ":", "case", "'-UNK-'", ":", "case", "'-UNK-'", ":", "case", "'-UNK-'", ":", "case", "'-UNK-'", ":", "case", "'-UNK-'", ":", "case", "'-UNK-'", ":", "case", "'-UNK-'", ":", "case", "'-UNK-'", ":", "case", "'-UNK-'", ":", "case", "'-UNK-'", ":", "case", "'-UNK-'", ":", "case", "'-UNK-'", ":", "case", "'-UNK-'", ":", "{", "matchRange", "(", "'-UNK-'", ",", "'-UNK-'", ")", ";", "break", ";", "}", "case", "'-UNK-'", ":", "case", "'-UNK-'", ":", "case", "'-UNK-'", ":", "case", "'-UNK-'", ":", "case", "'-UNK-'", ":", "case", "'-UNK-'", ":", "case", "'-UNK-'", ":", "case", "'-UNK-'", ":", "{", "matchRange", "(", "'-UNK-'", ",", "'-UNK-'", ")", ";", "break", ";", "}", "case", "'_'", ":", "{", "match", "(", "'_'", ")", ";", "break", ";", "}", "default", ":", "if", "(", "(", "(", "LA", "(", "1", ")", ">=", "'-UNK-'", "&&", "LA", "(", "1", ")", "<=", "'-UNK-'", ")", ")", ")", "{", "matchRange", "(", "'-UNK-'", ",", "'-UNK-'", ")", ";", "}", "else", "{", "throw", "new", "NoViableAltForCharException", "(", "(", "char", ")", "LA", "(", "1", ")", ",", "getFilename", "(", ")", ",", "getLine", "(", ")", ",", "getColumn", "(", ")", ")", ";", "}", "}", "if", "(", "_createToken", "&&", "_token", "==", "null", "&&", "_ttype", "!=", "Token", ".", "SKIP", ")", "{", "_token", "=", "makeToken", "(", "_ttype", ")", ";", "_token", ".", "setText", "(", "new", "String", "(", "text", ".", "getBuffer", "(", ")", ",", "_begin", ",", "text", ".", "length", "(", ")", "-", "_begin", ")", ")", ";", "}", "_returnToken", "=", "_token", ";", "}", "protected", "final", "void", "mDIGIT", "(", "boolean", "_createToken", ")", "throws", "RecognitionException", ",", "CharStreamException", ",", "TokenStreamException", "{", "int", "_ttype", ";", "Token", "_token", "=", "null", ";", "int", "_begin", "=", "text", ".", "length", "(", ")", ";", "_ttype", "=", "DIGIT", ";", "int", "_saveIndex", ";", "matchRange", "(", "'0'", ",", "'9'", ")", ";", "if", "(", "_createToken", "&&", "_token", "==", "null", "&&", "_ttype", "!=", "Token", ".", "SKIP", ")", "{", "_token", "=", "makeToken", "(", "_ttype", ")", ";", "_token", ".", "setText", "(", "new", "String", "(", "text", ".", "getBuffer", "(", ")", ",", "_begin", ",", "text", ".", "length", "(", ")", "-", "_begin", ")", ")", ";", "}", "_returnToken", "=", "_token", ";", "}", "public", "final", "void", "mNUM_INT", "(", "boolean", "_createToken", ")", "throws", "RecognitionException", ",", "CharStreamException", ",", "TokenStreamException", "{", "int", "_ttype", ";", "Token", "_token", "=", "null", ";", "int", "_begin", "=", "text", ".", "length", "(", ")", ";", "_ttype", "=", "NUM_INT", ";", "int", "_saveIndex", ";", "Token", "f2", "=", "null", ";", "Token", "g2", "=", "null", ";", "Token", "f3", "=", "null", ";", "Token", "g3", "=", "null", ";", "Token", "f4", "=", "null", ";", "boolean", "isDecimal", "=", "false", ";", "Token", "t", "=", "null", ";", "{", "switch", "(", "LA", "(", "1", ")", ")", "{", "case", "'0'", ":", "{", "match", "(", "'0'", ")", ";", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "isDecimal", "=", "true", ";", "}", "{", "if", "(", "(", "LA", "(", "1", ")", "==", "'X'", "||", "LA", "(", "1", ")", "==", "'x'", ")", ")", "{", "{", "switch", "(", "LA", "(", "1", ")", ")", "{", "case", "'x'", ":", "{", "match", "(", "'x'", ")", ";", "break", ";", "}", "case", "'X'", ":", "{", "match", "(", "'X'", ")", ";", "break", ";", "}", "default", ":", "{", "throw", "new", "NoViableAltForCharException", "(", "(", "char", ")", "LA", "(", "1", ")", ",", "getFilename", "(", ")", ",", "getLine", "(", ")", ",", "getColumn", "(", ")", ")", ";", "}", "}", "}", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "isDecimal", "=", "false", ";", "}", "{", "int", "_cnt744", "=", "0", ";", "_loop744", ":", "do", "{", "if", "(", "(", "_tokenSet_13", ".", "member", "(", "LA", "(", "1", ")", ")", ")", "&&", "(", "true", ")", "&&", "(", "true", ")", "&&", "(", "true", ")", ")", "{", "mHEX_DIGIT", "(", "false", ")", ";", "}", "else", "{", "if", "(", "_cnt744", ">=", "1", ")", "{", "break", "_loop744", ";", "}", "else", "{", "throw", "new", "NoViableAltForCharException", "(", "(", "char", ")", "LA", "(", "1", ")", ",", "getFilename", "(", ")", ",", "getLine", "(", ")", ",", "getColumn", "(", ")", ")", ";", "}", "}", "_cnt744", "++", ";", "}", "while", "(", "true", ")", ";", "}", "}", "else", "{", "boolean", "synPredMatched750", "=", "false", ";", "if", "(", "(", "(", "(", "LA", "(", "1", ")", ">=", "'0'", "&&", "LA", "(", "1", ")", "<=", "'9'", ")", ")", "&&", "(", "true", ")", "&&", "(", "true", ")", "&&", "(", "true", ")", ")", ")", "{", "int", "_m750", "=", "mark", "(", ")", ";", "synPredMatched750", "=", "true", ";", "inputState", ".", "guessing", "++", ";", "try", "{", "{", "{", "int", "_cnt747", "=", "0", ";", "_loop747", ":", "do", "{", "if", "(", "(", "(", "LA", "(", "1", ")", ">=", "'0'", "&&", "LA", "(", "1", ")", "<=", "'9'", ")", ")", ")", "{", "matchRange", "(", "'0'", ",", "'9'", ")", ";", "}", "else", "{", "if", "(", "_cnt747", ">=", "1", ")", "{", "break", "_loop747", ";", "}", "else", "{", "throw", "new", "NoViableAltForCharException", "(", "(", "char", ")", "LA", "(", "1", ")", ",", "getFilename", "(", ")", ",", "getLine", "(", ")", ",", "getColumn", "(", ")", ")", ";", "}", "}", "_cnt747", "++", ";", "}", "while", "(", "true", ")", ";", "}", "{", "switch", "(", "LA", "(", "1", ")", ")", "{", "case", "'.'", ":", "{", "match", "(", "'.'", ")", ";", "{", "matchRange", "(", "'0'", ",", "'9'", ")", ";", "}", "break", ";", "}", "case", "'E'", ":", "case", "'e'", ":", "{", "mEXPONENT", "(", "false", ")", ";", "break", ";", "}", "case", "'D'", ":", "case", "'F'", ":", "case", "'d'", ":", "case", "'f'", ":", "{", "mFLOAT_SUFFIX", "(", "false", ")", ";", "break", ";", "}", "default", ":", "{", "throw", "new", "NoViableAltForCharException", "(", "(", "char", ")", "LA", "(", "1", ")", ",", "getFilename", "(", ")", ",", "getLine", "(", ")", ",", "getColumn", "(", ")", ")", ";", "}", "}", "}", "}", "}", "catch", "(", "RecognitionException", "pe", ")", "{", "synPredMatched750", "=", "false", ";", "}", "rewind", "(", "_m750", ")", ";", "inputState", ".", "guessing", "--", ";", "}", "if", "(", "synPredMatched750", ")", "{", "{", "int", "_cnt752", "=", "0", ";", "_loop752", ":", "do", "{", "if", "(", "(", "(", "LA", "(", "1", ")", ">=", "'0'", "&&", "LA", "(", "1", ")", "<=", "'9'", ")", ")", ")", "{", "matchRange", "(", "'0'", ",", "'9'", ")", ";", "}", "else", "{", "if", "(", "_cnt752", ">=", "1", ")", "{", "break", "_loop752", ";", "}", "else", "{", "throw", "new", "NoViableAltForCharException", "(", "(", "char", ")", "LA", "(", "1", ")", ",", "getFilename", "(", ")", ",", "getLine", "(", ")", ",", "getColumn", "(", ")", ")", ";", "}", "}", "_cnt752", "++", ";", "}", "while", "(", "true", ")", ";", "}", "}", "else", "if", "(", "(", "(", "LA", "(", "1", ")", ">=", "'0'", "&&", "LA", "(", "1", ")", "<=", "'7'", ")", ")", "&&", "(", "true", ")", "&&", "(", "true", ")", "&&", "(", "true", ")", ")", "{", "{", "int", "_cnt754", "=", "0", ";", "_loop754", ":", "do", "{", "if", "(", "(", "(", "LA", "(", "1", ")", ">=", "'0'", "&&", "LA", "(", "1", ")", "<=", "'7'", ")", ")", ")", "{", "matchRange", "(", "'0'", ",", "'7'", ")", ";", "}", "else", "{", "if", "(", "_cnt754", ">=", "1", ")", "{", "break", "_loop754", ";", "}", "else", "{", "throw", "new", "NoViableAltForCharException", "(", "(", "char", ")", "LA", "(", "1", ")", ",", "getFilename", "(", ")", ",", "getLine", "(", ")", ",", "getColumn", "(", ")", ")", ";", "}", "}", "_cnt754", "++", ";", "}", "while", "(", "true", ")", ";", "}", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "isDecimal", "=", "false", ";", "}", "}", "else", "{", "}", "}", "}", "break", ";", "}", "case", "'1'", ":", "case", "'2'", ":", "case", "'3'", ":", "case", "'4'", ":", "case", "'5'", ":", "case", "'6'", ":", "case", "'7'", ":", "case", "'8'", ":", "case", "'9'", ":", "{", "{", "matchRange", "(", "'1'", ",", "'9'", ")", ";", "}", "{", "_loop757", ":", "do", "{", "if", "(", "(", "(", "LA", "(", "1", ")", ">=", "'0'", "&&", "LA", "(", "1", ")", "<=", "'9'", ")", ")", ")", "{", "matchRange", "(", "'0'", ",", "'9'", ")", ";", "}", "else", "{", "break", "_loop757", ";", "}", "}", "while", "(", "true", ")", ";", "}", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "isDecimal", "=", "true", ";", "}", "break", ";", "}", "default", ":", "{", "throw", "new", "NoViableAltForCharException", "(", "(", "char", ")", "LA", "(", "1", ")", ",", "getFilename", "(", ")", ",", "getLine", "(", ")", ",", "getColumn", "(", ")", ")", ";", "}", "}", "}", "{", "switch", "(", "LA", "(", "1", ")", ")", "{", "case", "'L'", ":", "case", "'l'", ":", "{", "{", "switch", "(", "LA", "(", "1", ")", ")", "{", "case", "'l'", ":", "{", "match", "(", "'l'", ")", ";", "break", ";", "}", "case", "'L'", ":", "{", "match", "(", "'L'", ")", ";", "break", ";", "}", "default", ":", "{", "throw", "new", "NoViableAltForCharException", "(", "(", "char", ")", "LA", "(", "1", ")", ",", "getFilename", "(", ")", ",", "getLine", "(", ")", ",", "getColumn", "(", ")", ")", ";", "}", "}", "}", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "_ttype", "=", "NUM_LONG", ";", "}", "break", ";", "}", "case", "'I'", ":", "case", "'i'", ":", "{", "{", "switch", "(", "LA", "(", "1", ")", ")", "{", "case", "'i'", ":", "{", "match", "(", "'i'", ")", ";", "break", ";", "}", "case", "'I'", ":", "{", "match", "(", "'I'", ")", ";", "break", ";", "}", "default", ":", "{", "throw", "new", "NoViableAltForCharException", "(", "(", "char", ")", "LA", "(", "1", ")", ",", "getFilename", "(", ")", ",", "getLine", "(", ")", ",", "getColumn", "(", ")", ")", ";", "}", "}", "}", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "_ttype", "=", "NUM_INT", ";", "}", "break", ";", "}", "case", "'G'", ":", "case", "'g'", ":", "{", "mBIG_SUFFIX", "(", "false", ")", ";", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "_ttype", "=", "NUM_BIG_INT", ";", "}", "break", ";", "}", "default", ":", "boolean", "synPredMatched763", "=", "false", ";", "if", "(", "(", "(", "(", "LA", "(", "1", ")", "==", "'.'", "||", "LA", "(", "1", ")", "==", "'D'", "||", "LA", "(", "1", ")", "==", "'E'", "||", "LA", "(", "1", ")", "==", "'F'", "||", "LA", "(", "1", ")", "==", "'d'", "||", "LA", "(", "1", ")", "==", "'e'", "||", "LA", "(", "1", ")", "==", "'f'", ")", ")", "&&", "(", "isDecimal", ")", ")", ")", "{", "int", "_m763", "=", "mark", "(", ")", ";", "synPredMatched763", "=", "true", ";", "inputState", ".", "guessing", "++", ";", "try", "{", "{", "if", "(", "(", "_tokenSet_14", ".", "member", "(", "LA", "(", "1", ")", ")", ")", ")", "{", "matchNot", "(", "'.'", ")", ";", "}", "else", "if", "(", "(", "LA", "(", "1", ")", "==", "'.'", ")", ")", "{", "match", "(", "'.'", ")", ";", "{", "matchRange", "(", "'0'", ",", "'9'", ")", ";", "}", "}", "else", "{", "throw", "new", "NoViableAltForCharException", "(", "(", "char", ")", "LA", "(", "1", ")", ",", "getFilename", "(", ")", ",", "getLine", "(", ")", ",", "getColumn", "(", ")", ")", ";", "}", "}", "}", "catch", "(", "RecognitionException", "pe", ")", "{", "synPredMatched763", "=", "false", ";", "}", "rewind", "(", "_m763", ")", ";", "inputState", ".", "guessing", "--", ";", "}", "if", "(", "synPredMatched763", ")", "{", "{", "switch", "(", "LA", "(", "1", ")", ")", "{", "case", "'.'", ":", "{", "match", "(", "'.'", ")", ";", "{", "int", "_cnt766", "=", "0", ";", "_loop766", ":", "do", "{", "if", "(", "(", "(", "LA", "(", "1", ")", ">=", "'0'", "&&", "LA", "(", "1", ")", "<=", "'9'", ")", ")", ")", "{", "matchRange", "(", "'0'", ",", "'9'", ")", ";", "}", "else", "{", "if", "(", "_cnt766", ">=", "1", ")", "{", "break", "_loop766", ";", "}", "else", "{", "throw", "new", "NoViableAltForCharException", "(", "(", "char", ")", "LA", "(", "1", ")", ",", "getFilename", "(", ")", ",", "getLine", "(", ")", ",", "getColumn", "(", ")", ")", ";", "}", "}", "_cnt766", "++", ";", "}", "while", "(", "true", ")", ";", "}", "{", "if", "(", "(", "LA", "(", "1", ")", "==", "'E'", "||", "LA", "(", "1", ")", "==", "'e'", ")", ")", "{", "mEXPONENT", "(", "false", ")", ";", "}", "else", "{", "}", "}", "{", "switch", "(", "LA", "(", "1", ")", ")", "{", "case", "'D'", ":", "case", "'F'", ":", "case", "'d'", ":", "case", "'f'", ":", "{", "mFLOAT_SUFFIX", "(", "true", ")", ";", "f2", "=", "_returnToken", ";", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "t", "=", "f2", ";", "}", "break", ";", "}", "case", "'G'", ":", "case", "'g'", ":", "{", "mBIG_SUFFIX", "(", "true", ")", ";", "g2", "=", "_returnToken", ";", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "t", "=", "g2", ";", "}", "break", ";", "}", "default", ":", "{", "}", "}", "}", "break", ";", "}", "case", "'E'", ":", "case", "'e'", ":", "{", "mEXPONENT", "(", "false", ")", ";", "{", "switch", "(", "LA", "(", "1", ")", ")", "{", "case", "'D'", ":", "case", "'F'", ":", "case", "'d'", ":", "case", "'f'", ":", "{", "mFLOAT_SUFFIX", "(", "true", ")", ";", "f3", "=", "_returnToken", ";", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "t", "=", "f3", ";", "}", "break", ";", "}", "case", "'G'", ":", "case", "'g'", ":", "{", "mBIG_SUFFIX", "(", "true", ")", ";", "g3", "=", "_returnToken", ";", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "t", "=", "g3", ";", "}", "break", ";", "}", "default", ":", "{", "}", "}", "}", "break", ";", "}", "case", "'D'", ":", "case", "'F'", ":", "case", "'d'", ":", "case", "'f'", ":", "{", "mFLOAT_SUFFIX", "(", "true", ")", ";", "f4", "=", "_returnToken", ";", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "t", "=", "f4", ";", "}", "break", ";", "}", "default", ":", "{", "throw", "new", "NoViableAltForCharException", "(", "(", "char", ")", "LA", "(", "1", ")", ",", "getFilename", "(", ")", ",", "getLine", "(", ")", ",", "getColumn", "(", ")", ")", ";", "}", "}", "}", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "String", "txt", "=", "(", "t", "==", "null", "?", "\"\"", ":", "t", ".", "getText", "(", ")", ".", "toUpperCase", "(", ")", ")", ";", "if", "(", "txt", ".", "indexOf", "(", "'F'", ")", ">=", "0", ")", "{", "_ttype", "=", "NUM_FLOAT", ";", "}", "else", "if", "(", "txt", ".", "indexOf", "(", "'G'", ")", ">=", "0", ")", "{", "_ttype", "=", "NUM_BIG_DECIMAL", ";", "}", "else", "{", "_ttype", "=", "NUM_DOUBLE", ";", "}", "}", "}", "else", "{", "}", "}", "}", "if", "(", "_createToken", "&&", "_token", "==", "null", "&&", "_ttype", "!=", "Token", ".", "SKIP", ")", "{", "_token", "=", "makeToken", "(", "_ttype", ")", ";", "_token", ".", "setText", "(", "new", "String", "(", "text", ".", "getBuffer", "(", ")", ",", "_begin", ",", "text", ".", "length", "(", ")", "-", "_begin", ")", ")", ";", "}", "_returnToken", "=", "_token", ";", "}", "protected", "final", "void", "mEXPONENT", "(", "boolean", "_createToken", ")", "throws", "RecognitionException", ",", "CharStreamException", ",", "TokenStreamException", "{", "int", "_ttype", ";", "Token", "_token", "=", "null", ";", "int", "_begin", "=", "text", ".", "length", "(", ")", ";", "_ttype", "=", "EXPONENT", ";", "int", "_saveIndex", ";", "{", "switch", "(", "LA", "(", "1", ")", ")", "{", "case", "'e'", ":", "{", "match", "(", "'e'", ")", ";", "break", ";", "}", "case", "'E'", ":", "{", "match", "(", "'E'", ")", ";", "break", ";", "}", "default", ":", "{", "throw", "new", "NoViableAltForCharException", "(", "(", "char", ")", "LA", "(", "1", ")", ",", "getFilename", "(", ")", ",", "getLine", "(", ")", ",", "getColumn", "(", ")", ")", ";", "}", "}", "}", "{", "switch", "(", "LA", "(", "1", ")", ")", "{", "case", "'+'", ":", "{", "match", "(", "'+'", ")", ";", "break", ";", "}", "case", "'-'", ":", "{", "match", "(", "'-'", ")", ";", "break", ";", "}", "case", "'0'", ":", "case", "'1'", ":", "case", "'2'", ":", "case", "'3'", ":", "case", "'4'", ":", "case", "'5'", ":", "case", "'6'", ":", "case", "'7'", ":", "case", "'8'", ":", "case", "'9'", ":", "{", "break", ";", "}", "default", ":", "{", "throw", "new", "NoViableAltForCharException", "(", "(", "char", ")", "LA", "(", "1", ")", ",", "getFilename", "(", ")", ",", "getLine", "(", ")", ",", "getColumn", "(", ")", ")", ";", "}", "}", "}", "{", "int", "_cnt775", "=", "0", ";", "_loop775", ":", "do", "{", "if", "(", "(", "(", "LA", "(", "1", ")", ">=", "'0'", "&&", "LA", "(", "1", ")", "<=", "'9'", ")", ")", ")", "{", "matchRange", "(", "'0'", ",", "'9'", ")", ";", "}", "else", "{", "if", "(", "_cnt775", ">=", "1", ")", "{", "break", "_loop775", ";", "}", "else", "{", "throw", "new", "NoViableAltForCharException", "(", "(", "char", ")", "LA", "(", "1", ")", ",", "getFilename", "(", ")", ",", "getLine", "(", ")", ",", "getColumn", "(", ")", ")", ";", "}", "}", "_cnt775", "++", ";", "}", "while", "(", "true", ")", ";", "}", "if", "(", "_createToken", "&&", "_token", "==", "null", "&&", "_ttype", "!=", "Token", ".", "SKIP", ")", "{", "_token", "=", "makeToken", "(", "_ttype", ")", ";", "_token", ".", "setText", "(", "new", "String", "(", "text", ".", "getBuffer", "(", ")", ",", "_begin", ",", "text", ".", "length", "(", ")", "-", "_begin", ")", ")", ";", "}", "_returnToken", "=", "_token", ";", "}", "protected", "final", "void", "mFLOAT_SUFFIX", "(", "boolean", "_createToken", ")", "throws", "RecognitionException", ",", "CharStreamException", ",", "TokenStreamException", "{", "int", "_ttype", ";", "Token", "_token", "=", "null", ";", "int", "_begin", "=", "text", ".", "length", "(", ")", ";", "_ttype", "=", "FLOAT_SUFFIX", ";", "int", "_saveIndex", ";", "switch", "(", "LA", "(", "1", ")", ")", "{", "case", "'f'", ":", "{", "match", "(", "'f'", ")", ";", "break", ";", "}", "case", "'F'", ":", "{", "match", "(", "'F'", ")", ";", "break", ";", "}", "case", "'d'", ":", "{", "match", "(", "'d'", ")", ";", "break", ";", "}", "case", "'D'", ":", "{", "match", "(", "'D'", ")", ";", "break", ";", "}", "default", ":", "{", "throw", "new", "NoViableAltForCharException", "(", "(", "char", ")", "LA", "(", "1", ")", ",", "getFilename", "(", ")", ",", "getLine", "(", ")", ",", "getColumn", "(", ")", ")", ";", "}", "}", "if", "(", "_createToken", "&&", "_token", "==", "null", "&&", "_ttype", "!=", "Token", ".", "SKIP", ")", "{", "_token", "=", "makeToken", "(", "_ttype", ")", ";", "_token", ".", "setText", "(", "new", "String", "(", "text", ".", "getBuffer", "(", ")", ",", "_begin", ",", "text", ".", "length", "(", ")", "-", "_begin", ")", ")", ";", "}", "_returnToken", "=", "_token", ";", "}", "protected", "final", "void", "mBIG_SUFFIX", "(", "boolean", "_createToken", ")", "throws", "RecognitionException", ",", "CharStreamException", ",", "TokenStreamException", "{", "int", "_ttype", ";", "Token", "_token", "=", "null", ";", "int", "_begin", "=", "text", ".", "length", "(", ")", ";", "_ttype", "=", "BIG_SUFFIX", ";", "int", "_saveIndex", ";", "switch", "(", "LA", "(", "1", ")", ")", "{", "case", "'g'", ":", "{", "match", "(", "'g'", ")", ";", "break", ";", "}", "case", "'G'", ":", "{", "match", "(", "'G'", ")", ";", "break", ";", "}", "default", ":", "{", "throw", "new", "NoViableAltForCharException", "(", "(", "char", ")", "LA", "(", "1", ")", ",", "getFilename", "(", ")", ",", "getLine", "(", ")", ",", "getColumn", "(", ")", ")", ";", "}", "}", "if", "(", "_createToken", "&&", "_token", "==", "null", "&&", "_ttype", "!=", "Token", ".", "SKIP", ")", "{", "_token", "=", "makeToken", "(", "_ttype", ")", ";", "_token", ".", "setText", "(", "new", "String", "(", "text", ".", "getBuffer", "(", ")", ",", "_begin", ",", "text", ".", "length", "(", ")", "-", "_begin", ")", ")", ";", "}", "_returnToken", "=", "_token", ";", "}", "public", "final", "void", "mAT", "(", "boolean", "_createToken", ")", "throws", "RecognitionException", ",", "CharStreamException", ",", "TokenStreamException", "{", "int", "_ttype", ";", "Token", "_token", "=", "null", ";", "int", "_begin", "=", "text", ".", "length", "(", ")", ";", "_ttype", "=", "AT", ";", "int", "_saveIndex", ";", "match", "(", "'@'", ")", ";", "if", "(", "_createToken", "&&", "_token", "==", "null", "&&", "_ttype", "!=", "Token", ".", "SKIP", ")", "{", "_token", "=", "makeToken", "(", "_ttype", ")", ";", "_token", ".", "setText", "(", "new", "String", "(", "text", ".", "getBuffer", "(", ")", ",", "_begin", ",", "text", ".", "length", "(", ")", "-", "_begin", ")", ")", ";", "}", "_returnToken", "=", "_token", ";", "}", "private", "static", "final", "long", "[", "]", "mk_tokenSet_0", "(", ")", "{", "long", "[", "]", "data", "=", "new", "long", "[", "2560", "]", ";", "data", "[", "0", "]", "=", "68719476736L", ";", "data", "[", "1", "]", "=", "576460745995190270L", ";", "data", "[", "3", "]", "=", "-", "36028797027352577L", ";", "for", "(", "int", "i", "=", "4", ";", "i", "<=", "1022", ";", "i", "++", ")", "{", "data", "[", "i", "]", "=", "-", "1L", ";", "}", "data", "[", "1023", "]", "=", "9223372036854775807L", ";", "return", "data", ";", "}", "public", "static", "final", "BitSet", "_tokenSet_0", "=", "new", "BitSet", "(", "mk_tokenSet_0", "(", ")", ")", ";", "private", "static", "final", "long", "[", "]", "mk_tokenSet_1", "(", ")", "{", "long", "[", "]", "data", "=", "new", "long", "[", "2048", "]", ";", "data", "[", "0", "]", "=", "-", "9217L", ";", "for", "(", "int", "i", "=", "1", ";", "i", "<=", "1022", ";", "i", "++", ")", "{", "data", "[", "i", "]", "=", "-", "1L", ";", "}", "data", "[", "1023", "]", "=", "9223372036854775807L", ";", "return", "data", ";", "}", "public", "static", "final", "BitSet", "_tokenSet_1", "=", "new", "BitSet", "(", "mk_tokenSet_1", "(", ")", ")", ";", "private", "static", "final", "long", "[", "]", "mk_tokenSet_2", "(", ")", "{", "long", "[", "]", "data", "=", "new", "long", "[", "2048", "]", ";", "data", "[", "0", "]", "=", "-", "4398046520321L", ";", "for", "(", "int", "i", "=", "1", ";", "i", "<=", "1022", ";", "i", "++", ")", "{", "data", "[", "i", "]", "=", "-", "1L", ";", "}", "data", "[", "1023", "]", "=", "9223372036854775807L", ";", "return", "data", ";", "}", "public", "static", "final", "BitSet", "_tokenSet_2", "=", "new", "BitSet", "(", "mk_tokenSet_2", "(", ")", ")", ";", "private", "static", "final", "long", "[", "]", "mk_tokenSet_3", "(", ")", "{", "long", "[", "]", "data", "=", "new", "long", "[", "2048", "]", ";", "data", "[", "0", "]", "=", "-", "549755813889L", ";", "for", "(", "int", "i", "=", "1", ";", "i", "<=", "1023", ";", "i", "++", ")", "{", "data", "[", "i", "]", "=", "-", "1L", ";", "}", "return", "data", ";", "}", "public", "static", "final", "BitSet", "_tokenSet_3", "=", "new", "BitSet", "(", "mk_tokenSet_3", "(", ")", ")", ";", "private", "static", "final", "long", "[", "]", "mk_tokenSet_4", "(", ")", "{", "long", "[", "]", "data", "=", "new", "long", "[", "2048", "]", ";", "data", "[", "0", "]", "=", "-", "635655169025L", ";", "data", "[", "1", "]", "=", "-", "268435457L", ";", "for", "(", "int", "i", "=", "2", ";", "i", "<=", "1022", ";", "i", "++", ")", "{", "data", "[", "i", "]", "=", "-", "1L", ";", "}", "data", "[", "1023", "]", "=", "9223372036854775807L", ";", "return", "data", ";", "}", "public", "static", "final", "BitSet", "_tokenSet_4", "=", "new", "BitSet", "(", "mk_tokenSet_4", "(", ")", ")", ";", "private", "static", "final", "long", "[", "]", "mk_tokenSet_5", "(", ")", "{", "long", "[", "]", "data", "=", "new", "long", "[", "2048", "]", ";", "data", "[", "0", "]", "=", "-", "17179869185L", ";", "for", "(", "int", "i", "=", "1", ";", "i", "<=", "1023", ";", "i", "++", ")", "{", "data", "[", "i", "]", "=", "-", "1L", ";", "}", "return", "data", ";", "}", "public", "static", "final", "BitSet", "_tokenSet_5", "=", "new", "BitSet", "(", "mk_tokenSet_5", "(", ")", ")", ";", "private", "static", "final", "long", "[", "]", "mk_tokenSet_6", "(", ")", "{", "long", "[", "]", "data", "=", "new", "long", "[", "2048", "]", ";", "data", "[", "0", "]", "=", "-", "145135534866433L", ";", "for", "(", "int", "i", "=", "1", ";", "i", "<=", "1022", ";", "i", "++", ")", "{", "data", "[", "i", "]", "=", "-", "1L", ";", "}", "data", "[", "1023", "]", "=", "9223372036854775807L", ";", "return", "data", ";", "}", "public", "static", "final", "BitSet", "_tokenSet_6", "=", "new", "BitSet", "(", "mk_tokenSet_6", "(", ")", ")", ";", "private", "static", "final", "long", "[", "]", "mk_tokenSet_7", "(", ")", "{", "long", "[", "]", "data", "=", "new", "long", "[", "2048", "]", ";", "data", "[", "0", "]", "=", "-", "4398046511105L", ";", "for", "(", "int", "i", "=", "1", ";", "i", "<=", "1022", ";", "i", "++", ")", "{", "data", "[", "i", "]", "=", "-", "1L", ";", "}", "data", "[", "1023", "]", "=", "9223372036854775807L", ";", "return", "data", ";", "}", "public", "static", "final", "BitSet", "_tokenSet_7", "=", "new", "BitSet", "(", "mk_tokenSet_7", "(", ")", ")", ";", "private", "static", "final", "long", "[", "]", "mk_tokenSet_8", "(", ")", "{", "long", "[", "]", "data", "=", "new", "long", "[", "2048", "]", ";", "data", "[", "0", "]", "=", "-", "145204254343169L", ";", "for", "(", "int", "i", "=", "1", ";", "i", "<=", "1022", ";", "i", "++", ")", "{", "data", "[", "i", "]", "=", "-", "1L", ";", "}", "data", "[", "1023", "]", "=", "9223372036854775807L", ";", "return", "data", ";", "}", "public", "static", "final", "BitSet", "_tokenSet_8", "=", "new", "BitSet", "(", "mk_tokenSet_8", "(", ")", ")", ";", "private", "static", "final", "long", "[", "]", "mk_tokenSet_9", "(", ")", "{", "long", "[", "]", "data", "=", "new", "long", "[", "2048", "]", ";", "data", "[", "0", "]", "=", "-", "145204254352385L", ";", "data", "[", "1", "]", "=", "-", "268435457L", ";", "for", "(", "int", "i", "=", "2", ";", "i", "<=", "1022", ";", "i", "++", ")", "{", "data", "[", "i", "]", "=", "-", "1L", ";", "}", "data", "[", "1023", "]", "=", "9223372036854775807L", ";", "return", "data", ";", "}", "public", "static", "final", "BitSet", "_tokenSet_9", "=", "new", "BitSet", "(", "mk_tokenSet_9", "(", ")", ")", ";", "private", "static", "final", "long", "[", "]", "mk_tokenSet_10", "(", ")", "{", "long", "[", "]", "data", "=", "new", "long", "[", "2048", "]", ";", "data", "[", "0", "]", "=", "-", "68719476737L", ";", "for", "(", "int", "i", "=", "1", ";", "i", "<=", "1022", ";", "i", "++", ")", "{", "data", "[", "i", "]", "=", "-", "1L", ";", "}", "data", "[", "1023", "]", "=", "9223372036854775807L", ";", "return", "data", ";", "}", "public", "static", "final", "BitSet", "_tokenSet_10", "=", "new", "BitSet", "(", "mk_tokenSet_10", "(", ")", ")", ";", "private", "static", "final", "long", "[", "]", "mk_tokenSet_11", "(", ")", "{", "long", "[", "]", "data", "=", "new", "long", "[", "2048", "]", ";", "data", "[", "0", "]", "=", "-", "140806207841281L", ";", "data", "[", "1", "]", "=", "-", "268435457L", ";", "for", "(", "int", "i", "=", "2", ";", "i", "<=", "1022", ";", "i", "++", ")", "{", "data", "[", "i", "]", "=", "-", "1L", ";", "}", "data", "[", "1023", "]", "=", "9223372036854775807L", ";", "return", "data", ";", "}", "public", "static", "final", "BitSet", "_tokenSet_11", "=", "new", "BitSet", "(", "mk_tokenSet_11", "(", ")", ")", ";", "private", "static", "final", "long", "[", "]", "mk_tokenSet_12", "(", ")", "{", "long", "[", "]", "data", "=", "new", "long", "[", "2560", "]", ";", "data", "[", "1", "]", "=", "576460745995190270L", ";", "data", "[", "3", "]", "=", "-", "36028797027352577L", ";", "for", "(", "int", "i", "=", "4", ";", "i", "<=", "1022", ";", "i", "++", ")", "{", "data", "[", "i", "]", "=", "-", "1L", ";", "}", "data", "[", "1023", "]", "=", "9223372036854775807L", ";", "return", "data", ";", "}", "public", "static", "final", "BitSet", "_tokenSet_12", "=", "new", "BitSet", "(", "mk_tokenSet_12", "(", ")", ")", ";", "private", "static", "final", "long", "[", "]", "mk_tokenSet_13", "(", ")", "{", "long", "[", "]", "data", "=", "new", "long", "[", "1025", "]", ";", "data", "[", "0", "]", "=", "287948901175001088L", ";", "data", "[", "1", "]", "=", "541165879422L", ";", "return", "data", ";", "}", "public", "static", "final", "BitSet", "_tokenSet_13", "=", "new", "BitSet", "(", "mk_tokenSet_13", "(", ")", ")", ";", "private", "static", "final", "long", "[", "]", "mk_tokenSet_14", "(", ")", "{", "long", "[", "]", "data", "=", "new", "long", "[", "2048", "]", ";", "data", "[", "0", "]", "=", "-", "70368744177665L", ";", "for", "(", "int", "i", "=", "1", ";", "i", "<=", "1023", ";", "i", "++", ")", "{", "data", "[", "i", "]", "=", "-", "1L", ";", "}", "return", "data", ";", "}", "public", "static", "final", "BitSet", "_tokenSet_14", "=", "new", "BitSet", "(", "mk_tokenSet_14", "(", ")", ")", ";", "}", "</s>" ]
6,620
[ "<s>", "package", "org", ".", "codehaus", ".", "groovy", ".", "antlr", ".", "parser", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "antlr", ".", "*", ";", "import", "java", ".", "util", ".", "*", ";", "import", "java", ".", "io", ".", "InputStream", ";", "import", "java", ".", "io", ".", "Reader", ";", "import", "antlr", ".", "InputBuffer", ";", "import", "antlr", ".", "LexerSharedInputState", ";", "import", "antlr", ".", "CommonToken", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "GroovyBugError", ";", "import", "antlr", ".", "TokenStreamRecognitionException", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "Comment", ";", "public", "interface", "GroovyTokenTypes", "{", "int", "EOF", "=", "1", ";", "int", "NULL_TREE_LOOKAHEAD", "=", "3", ";", "int", "BLOCK", "=", "4", ";", "int", "MODIFIERS", "=", "5", ";", "int", "OBJBLOCK", "=", "6", ";", "int", "SLIST", "=", "7", ";", "int", "METHOD_DEF", "=", "8", ";", "int", "VARIABLE_DEF", "=", "9", ";", "int", "INSTANCE_INIT", "=", "10", ";", "int", "STATIC_INIT", "=", "11", ";", "int", "TYPE", "=", "12", ";", "int", "CLASS_DEF", "=", "13", ";", "int", "INTERFACE_DEF", "=", "14", ";", "int", "PACKAGE_DEF", "=", "15", ";", "int", "ARRAY_DECLARATOR", "=", "16", ";", "int", "EXTENDS_CLAUSE", "=", "17", ";", "int", "IMPLEMENTS_CLAUSE", "=", "18", ";", "int", "PARAMETERS", "=", "19", ";", "int", "PARAMETER_DEF", "=", "20", ";", "int", "LABELED_STAT", "=", "21", ";", "int", "TYPECAST", "=", "22", ";", "int", "INDEX_OP", "=", "23", ";", "int", "POST_INC", "=", "24", ";", "int", "POST_DEC", "=", "25", ";", "int", "METHOD_CALL", "=", "26", ";", "int", "EXPR", "=", "27", ";", "int", "IMPORT", "=", "28", ";", "int", "UNARY_MINUS", "=", "29", ";", "int", "UNARY_PLUS", "=", "30", ";", "int", "CASE_GROUP", "=", "31", ";", "int", "ELIST", "=", "32", ";", "int", "FOR_INIT", "=", "33", ";", "int", "FOR_CONDITION", "=", "34", ";", "int", "FOR_ITERATOR", "=", "35", ";", "int", "EMPTY_STAT", "=", "36", ";", "int", "FINAL", "=", "37", ";", "int", "ABSTRACT", "=", "38", ";", "int", "UNUSED_GOTO", "=", "39", ";", "int", "UNUSED_CONST", "=", "40", ";", "int", "UNUSED_DO", "=", "41", ";", "int", "STRICTFP", "=", "42", ";", "int", "SUPER_CTOR_CALL", "=", "43", ";", "int", "CTOR_CALL", "=", "44", ";", "int", "CTOR_IDENT", "=", "45", ";", "int", "VARIABLE_PARAMETER_DEF", "=", "46", ";", "int", "STRING_CONSTRUCTOR", "=", "47", ";", "int", "STRING_CTOR_MIDDLE", "=", "48", ";", "int", "CLOSABLE_BLOCK", "=", "49", ";", "int", "IMPLICIT_PARAMETERS", "=", "50", ";", "int", "SELECT_SLOT", "=", "51", ";", "int", "DYNAMIC_MEMBER", "=", "52", ";", "int", "LABELED_ARG", "=", "53", ";", "int", "SPREAD_ARG", "=", "54", ";", "int", "SPREAD_MAP_ARG", "=", "55", ";", "int", "LIST_CONSTRUCTOR", "=", "56", ";", "int", "MAP_CONSTRUCTOR", "=", "57", ";", "int", "FOR_IN_ITERABLE", "=", "58", ";", "int", "STATIC_IMPORT", "=", "59", ";", "int", "ENUM_DEF", "=", "60", ";", "int", "ENUM_CONSTANT_DEF", "=", "61", ";", "int", "FOR_EACH_CLAUSE", "=", "62", ";", "int", "ANNOTATION_DEF", "=", "63", ";", "int", "ANNOTATIONS", "=", "64", ";", "int", "ANNOTATION", "=", "65", ";", "int", "ANNOTATION_MEMBER_VALUE_PAIR", "=", "66", ";", "int", "ANNOTATION_FIELD_DEF", "=", "67", ";", "int", "ANNOTATION_ARRAY_INIT", "=", "68", ";", "int", "TYPE_ARGUMENTS", "=", "69", ";", "int", "TYPE_ARGUMENT", "=", "70", ";", "int", "TYPE_PARAMETERS", "=", "71", ";", "int", "TYPE_PARAMETER", "=", "72", ";", "int", "WILDCARD_TYPE", "=", "73", ";", "int", "TYPE_UPPER_BOUNDS", "=", "74", ";", "int", "TYPE_LOWER_BOUNDS", "=", "75", ";", "int", "CLOSURE_LIST", "=", "76", ";", "int", "SH_COMMENT", "=", "77", ";", "int", "LITERAL_package", "=", "78", ";", "int", "LITERAL_import", "=", "79", ";", "int", "LITERAL_static", "=", "80", ";", "int", "LITERAL_def", "=", "81", ";", "int", "LBRACK", "=", "82", ";", "int", "RBRACK", "=", "83", ";", "int", "IDENT", "=", "84", ";", "int", "STRING_LITERAL", "=", "85", ";", "int", "LT", "=", "86", ";", "int", "DOT", "=", "87", ";", "int", "LPAREN", "=", "88", ";", "int", "LITERAL_class", "=", "89", ";", "int", "LITERAL_interface", "=", "90", ";", "int", "LITERAL_enum", "=", "91", ";", "int", "AT", "=", "92", ";", "int", "QUESTION", "=", "93", ";", "int", "LITERAL_extends", "=", "94", ";", "int", "LITERAL_super", "=", "95", ";", "int", "GT", "=", "96", ";", "int", "COMMA", "=", "97", ";", "int", "SR", "=", "98", ";", "int", "BSR", "=", "99", ";", "int", "LITERAL_void", "=", "100", ";", "int", "LITERAL_boolean", "=", "101", ";", "int", "LITERAL_byte", "=", "102", ";", "int", "LITERAL_char", "=", "103", ";", "int", "LITERAL_short", "=", "104", ";", "int", "LITERAL_int", "=", "105", ";", "int", "LITERAL_float", "=", "106", ";", "int", "LITERAL_long", "=", "107", ";", "int", "LITERAL_double", "=", "108", ";", "int", "STAR", "=", "109", ";", "int", "LITERAL_as", "=", "110", ";", "int", "LITERAL_private", "=", "111", ";", "int", "LITERAL_public", "=", "112", ";", "int", "LITERAL_protected", "=", "113", ";", "int", "LITERAL_transient", "=", "114", ";", "int", "LITERAL_native", "=", "115", ";", "int", "LITERAL_threadsafe", "=", "116", ";", "int", "LITERAL_synchronized", "=", "117", ";", "int", "LITERAL_volatile", "=", "118", ";", "int", "RPAREN", "=", "119", ";", "int", "ASSIGN", "=", "120", ";", "int", "BAND", "=", "121", ";", "int", "LCURLY", "=", "122", ";", "int", "RCURLY", "=", "123", ";", "int", "SEMI", "=", "124", ";", "int", "LITERAL_default", "=", "125", ";", "int", "LITERAL_throws", "=", "126", ";", "int", "LITERAL_implements", "=", "127", ";", "int", "LITERAL_this", "=", "128", ";", "int", "TRIPLE_DOT", "=", "129", ";", "int", "CLOSABLE_BLOCK_OP", "=", "130", ";", "int", "COLON", "=", "131", ";", "int", "LITERAL_if", "=", "132", ";", "int", "LITERAL_else", "=", "133", ";", "int", "LITERAL_while", "=", "134", ";", "int", "LITERAL_switch", "=", "135", ";", "int", "LITERAL_for", "=", "136", ";", "int", "LITERAL_in", "=", "137", ";", "int", "LITERAL_return", "=", "138", ";", "int", "LITERAL_break", "=", "139", ";", "int", "LITERAL_continue", "=", "140", ";", "int", "LITERAL_throw", "=", "141", ";", "int", "LITERAL_assert", "=", "142", ";", "int", "PLUS", "=", "143", ";", "int", "MINUS", "=", "144", ";", "int", "LITERAL_case", "=", "145", ";", "int", "LITERAL_try", "=", "146", ";", "int", "LITERAL_finally", "=", "147", ";", "int", "LITERAL_catch", "=", "148", ";", "int", "SPREAD_DOT", "=", "149", ";", "int", "OPTIONAL_DOT", "=", "150", ";", "int", "MEMBER_POINTER", "=", "151", ";", "int", "LITERAL_false", "=", "152", ";", "int", "LITERAL_instanceof", "=", "153", ";", "int", "LITERAL_new", "=", "154", ";", "int", "LITERAL_null", "=", "155", ";", "int", "LITERAL_true", "=", "156", ";", "int", "PLUS_ASSIGN", "=", "157", ";", "int", "MINUS_ASSIGN", "=", "158", ";", "int", "STAR_ASSIGN", "=", "159", ";", "int", "DIV_ASSIGN", "=", "160", ";", "int", "MOD_ASSIGN", "=", "161", ";", "int", "SR_ASSIGN", "=", "162", ";", "int", "BSR_ASSIGN", "=", "163", ";", "int", "SL_ASSIGN", "=", "164", ";", "int", "BAND_ASSIGN", "=", "165", ";", "int", "BXOR_ASSIGN", "=", "166", ";", "int", "BOR_ASSIGN", "=", "167", ";", "int", "STAR_STAR_ASSIGN", "=", "168", ";", "int", "ELVIS_OPERATOR", "=", "169", ";", "int", "LOR", "=", "170", ";", "int", "LAND", "=", "171", ";", "int", "BOR", "=", "172", ";", "int", "BXOR", "=", "173", ";", "int", "REGEX_FIND", "=", "174", ";", "int", "REGEX_MATCH", "=", "175", ";", "int", "NOT_EQUAL", "=", "176", ";", "int", "EQUAL", "=", "177", ";", "int", "IDENTICAL", "=", "178", ";", "int", "NOT_IDENTICAL", "=", "179", ";", "int", "COMPARE_TO", "=", "180", ";", "int", "LE", "=", "181", ";", "int", "GE", "=", "182", ";", "int", "SL", "=", "183", ";", "int", "RANGE_INCLUSIVE", "=", "184", ";", "int", "RANGE_EXCLUSIVE", "=", "185", ";", "int", "INC", "=", "186", ";", "int", "DIV", "=", "187", ";", "int", "MOD", "=", "188", ";", "int", "DEC", "=", "189", ";", "int", "STAR_STAR", "=", "190", ";", "int", "BNOT", "=", "191", ";", "int", "LNOT", "=", "192", ";", "int", "STRING_CTOR_START", "=", "193", ";", "int", "STRING_CTOR_END", "=", "194", ";", "int", "NUM_INT", "=", "195", ";", "int", "NUM_FLOAT", "=", "196", ";", "int", "NUM_LONG", "=", "197", ";", "int", "NUM_DOUBLE", "=", "198", ";", "int", "NUM_BIG_INT", "=", "199", ";", "int", "NUM_BIG_DECIMAL", "=", "200", ";", "int", "NLS", "=", "201", ";", "int", "DOLLAR", "=", "202", ";", "int", "WS", "=", "203", ";", "int", "ONE_NL", "=", "204", ";", "int", "ONE_NL_KEEP", "=", "205", ";", "int", "SL_COMMENT", "=", "206", ";", "int", "ML_COMMENT", "=", "207", ";", "int", "STRING_CH", "=", "208", ";", "int", "REGEXP_LITERAL", "=", "209", ";", "int", "DOLLAR_REGEXP_LITERAL", "=", "210", ";", "int", "REGEXP_CTOR_END", "=", "211", ";", "int", "DOLLAR_REGEXP_CTOR_END", "=", "212", ";", "int", "ESCAPED_SLASH", "=", "213", ";", "int", "ESCAPED_DOLLAR", "=", "214", ";", "int", "REGEXP_SYMBOL", "=", "215", ";", "int", "DOLLAR_REGEXP_SYMBOL", "=", "216", ";", "int", "ESC", "=", "217", ";", "int", "STRING_NL", "=", "218", ";", "int", "HEX_DIGIT", "=", "219", ";", "int", "VOCAB", "=", "220", ";", "int", "LETTER", "=", "221", ";", "int", "DIGIT", "=", "222", ";", "int", "EXPONENT", "=", "223", ";", "int", "FLOAT_SUFFIX", "=", "224", ";", "int", "BIG_SUFFIX", "=", "225", ";", "}", "</s>" ]
6,621
[ "<s>", "package", "org", ".", "codehaus", ".", "groovy", ".", "antlr", ".", "parser", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "antlr", ".", "*", ";", "import", "java", ".", "util", ".", "*", ";", "import", "java", ".", "io", ".", "InputStream", ";", "import", "java", ".", "io", ".", "Reader", ";", "import", "antlr", ".", "InputBuffer", ";", "import", "antlr", ".", "LexerSharedInputState", ";", "import", "antlr", ".", "CommonToken", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "GroovyBugError", ";", "import", "antlr", ".", "TokenStreamRecognitionException", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "Comment", ";", "import", "antlr", ".", "TokenBuffer", ";", "import", "antlr", ".", "TokenStreamException", ";", "import", "antlr", ".", "TokenStreamIOException", ";", "import", "antlr", ".", "ANTLRException", ";", "import", "antlr", ".", "LLkParser", ";", "import", "antlr", ".", "Token", ";", "import", "antlr", ".", "TokenStream", ";", "import", "antlr", ".", "RecognitionException", ";", "import", "antlr", ".", "NoViableAltException", ";", "import", "antlr", ".", "MismatchedTokenException", ";", "import", "antlr", ".", "SemanticException", ";", "import", "antlr", ".", "ParserSharedInputState", ";", "import", "antlr", ".", "collections", ".", "impl", ".", "BitSet", ";", "import", "antlr", ".", "collections", ".", "AST", ";", "import", "java", ".", "util", ".", "Hashtable", ";", "import", "antlr", ".", "ASTFactory", ";", "import", "antlr", ".", "ASTPair", ";", "import", "antlr", ".", "collections", ".", "impl", ".", "ASTArray", ";", "public", "class", "GroovyRecognizer", "extends", "antlr", ".", "LLkParser", "implements", "GroovyTokenTypes", "{", "public", "static", "GroovyRecognizer", "make", "(", "GroovyLexer", "lexer", ")", "{", "GroovyRecognizer", "parser", "=", "new", "GroovyRecognizer", "(", "lexer", ".", "plumb", "(", ")", ")", ";", "parser", ".", "lexer", "=", "lexer", ";", "lexer", ".", "parser", "=", "parser", ";", "parser", ".", "getASTFactory", "(", ")", ".", "setASTNodeClass", "(", "GroovySourceAST", ".", "class", ")", ";", "parser", ".", "warningList", "=", "new", "ArrayList", "(", ")", ";", "parser", ".", "errorList", "=", "new", "ArrayList", "(", ")", ";", "return", "parser", ";", "}", "public", "static", "GroovyRecognizer", "make", "(", "InputStream", "in", ")", "{", "return", "make", "(", "new", "GroovyLexer", "(", "in", ")", ")", ";", "}", "public", "static", "GroovyRecognizer", "make", "(", "Reader", "in", ")", "{", "return", "make", "(", "new", "GroovyLexer", "(", "in", ")", ")", ";", "}", "public", "static", "GroovyRecognizer", "make", "(", "InputBuffer", "in", ")", "{", "return", "make", "(", "new", "GroovyLexer", "(", "in", ")", ")", ";", "}", "public", "static", "GroovyRecognizer", "make", "(", "LexerSharedInputState", "in", ")", "{", "return", "make", "(", "new", "GroovyLexer", "(", "in", ")", ")", ";", "}", "private", "static", "GroovySourceAST", "dummyVariableToforceClassLoaderToFindASTClass", "=", "new", "GroovySourceAST", "(", ")", ";", "List", "warningList", ";", "public", "List", "getWarningList", "(", ")", "{", "return", "warningList", ";", "}", "List", "errorList", ";", "public", "List", "getErrorList", "(", ")", "{", "return", "errorList", ";", "}", "List", "<", "Comment", ">", "comments", "=", "new", "ArrayList", "<", "Comment", ">", "(", ")", ";", "public", "List", "<", "Comment", ">", "getComments", "(", ")", "{", "return", "comments", ";", "}", "GroovyLexer", "lexer", ";", "public", "GroovyLexer", "getLexer", "(", ")", "{", "return", "lexer", ";", "}", "public", "void", "setFilename", "(", "String", "f", ")", "{", "super", ".", "setFilename", "(", "f", ")", ";", "lexer", ".", "setFilename", "(", "f", ")", ";", "}", "private", "SourceBuffer", "sourceBuffer", ";", "public", "void", "setSourceBuffer", "(", "SourceBuffer", "sourceBuffer", ")", "{", "this", ".", "sourceBuffer", "=", "sourceBuffer", ";", "}", "public", "AST", "create", "(", "int", "type", ",", "String", "txt", ",", "AST", "first", ")", "{", "AST", "t", "=", "astFactory", ".", "create", "(", "type", ",", "txt", ")", ";", "if", "(", "t", "!=", "null", "&&", "first", "!=", "null", ")", "{", "t", ".", "initialize", "(", "first", ")", ";", "t", ".", "initialize", "(", "type", ",", "txt", ")", ";", "}", "return", "t", ";", "}", "public", "AST", "create2", "(", "int", "type", ",", "String", "txt", ",", "Token", "first", ",", "Token", "last", ")", "{", "return", "setEndLocationBasedOnThisNode", "(", "create", "(", "type", ",", "txt", ",", "astFactory", ".", "create", "(", "first", ")", ")", ",", "last", ")", ";", "}", "private", "AST", "setEndLocationBasedOnThisNode", "(", "AST", "ast", ",", "Object", "node", ")", "{", "if", "(", "(", "ast", "instanceof", "GroovySourceAST", ")", "&&", "(", "node", "instanceof", "SourceInfo", ")", ")", "{", "SourceInfo", "lastInfo", "=", "(", "SourceInfo", ")", "node", ";", "GroovySourceAST", "groovySourceAst", "=", "(", "GroovySourceAST", ")", "ast", ";", "groovySourceAst", ".", "setColumnLast", "(", "lastInfo", ".", "getColumnLast", "(", ")", ")", ";", "groovySourceAst", ".", "setLineLast", "(", "lastInfo", ".", "getLineLast", "(", ")", ")", ";", "}", "return", "ast", ";", "}", "private", "AST", "attachLast", "(", "AST", "t", ",", "Object", "last", ")", "{", "if", "(", "(", "t", "instanceof", "GroovySourceAST", ")", "&&", "(", "last", "instanceof", "SourceInfo", ")", ")", "{", "SourceInfo", "lastInfo", "=", "(", "SourceInfo", ")", "last", ";", "GroovySourceAST", "node", "=", "(", "GroovySourceAST", ")", "t", ";", "node", ".", "setColumnLast", "(", "lastInfo", ".", "getColumn", "(", ")", ")", ";", "node", ".", "setLineLast", "(", "lastInfo", ".", "getLine", "(", ")", ")", ";", "}", "return", "t", ";", "}", "public", "AST", "create", "(", "int", "type", ",", "String", "txt", ",", "Token", "first", ",", "Token", "last", ")", "{", "return", "attachLast", "(", "create", "(", "type", ",", "txt", ",", "astFactory", ".", "create", "(", "first", ")", ")", ",", "last", ")", ";", "}", "public", "AST", "create", "(", "int", "type", ",", "String", "txt", ",", "AST", "first", ",", "Token", "last", ")", "{", "return", "attachLast", "(", "create", "(", "type", ",", "txt", ",", "first", ")", ",", "last", ")", ";", "}", "public", "AST", "create", "(", "int", "type", ",", "String", "txt", ",", "AST", "first", ",", "AST", "last", ")", "{", "return", "attachLast", "(", "create", "(", "type", ",", "txt", ",", "first", ")", ",", "last", ")", ";", "}", "private", "Stack", "<", "Integer", ">", "commentStartPositions", "=", "new", "Stack", "<", "Integer", ">", "(", ")", ";", "public", "void", "startComment", "(", "int", "line", ",", "int", "column", ")", "{", "commentStartPositions", ".", "push", "(", "(", "line", "<<", "16", ")", "+", "column", ")", ";", "}", "public", "void", "endComment", "(", "int", "type", ",", "int", "line", ",", "int", "column", ",", "String", "text", ")", "{", "int", "lineAndColumn", "=", "commentStartPositions", ".", "pop", "(", ")", ";", "int", "startLine", "=", "lineAndColumn", ">>>", "16", ";", "int", "startColumn", "=", "lineAndColumn", "&", "0xffff", ";", "if", "(", "type", "==", "0", ")", "{", "Comment", "comment", "=", "Comment", ".", "makeSingleLineComment", "(", "startLine", ",", "startColumn", ",", "line", ",", "column", ",", "text", ")", ";", "comments", ".", "add", "(", "comment", ")", ";", "}", "else", "if", "(", "type", "==", "1", ")", "{", "Comment", "comment", "=", "Comment", ".", "makeMultiLineComment", "(", "startLine", ",", "startColumn", ",", "line", ",", "column", ",", "text", ")", ";", "comments", ".", "add", "(", "comment", ")", ";", "}", "}", "public", "Token", "cloneToken", "(", "Token", "t", ")", "{", "CommonToken", "clone", "=", "new", "CommonToken", "(", "t", ".", "getType", "(", ")", ",", "t", ".", "getText", "(", ")", ")", ";", "clone", ".", "setLine", "(", "t", ".", "getLine", "(", ")", ")", ";", "clone", ".", "setColumn", "(", "t", ".", "getColumn", "(", ")", ")", ";", "return", "clone", ";", "}", "public", "static", "boolean", "tracing", "=", "false", ";", "public", "void", "traceIn", "(", "String", "rname", ")", "throws", "TokenStreamException", "{", "if", "(", "!", "GroovyRecognizer", ".", "tracing", ")", "return", ";", "super", ".", "traceIn", "(", "rname", ")", ";", "}", "public", "void", "traceOut", "(", "String", "rname", ")", "throws", "TokenStreamException", "{", "if", "(", "!", "GroovyRecognizer", ".", "tracing", ")", "return", ";", "if", "(", "returnAST", "!=", "null", ")", "rname", "+=", "returnAST", ".", "toStringList", "(", ")", ";", "super", ".", "traceOut", "(", "rname", ")", ";", "}", "public", "void", "requireFailed", "(", "String", "problem", ",", "String", "solution", ")", "throws", "SemanticException", "{", "Token", "lt", "=", "null", ";", "int", "lineNum", "=", "Token", ".", "badToken", ".", "getLine", "(", ")", ",", "colNum", "=", "Token", ".", "badToken", ".", "getColumn", "(", ")", ";", "try", "{", "lt", "=", "LT", "(", "1", ")", ";", "if", "(", "lt", "!=", "null", ")", "{", "lineNum", "=", "lt", ".", "getLine", "(", ")", ";", "colNum", "=", "lt", ".", "getColumn", "(", ")", ";", "}", "}", "catch", "(", "TokenStreamException", "ee", ")", "{", "if", "(", "ee", "instanceof", "TokenStreamRecognitionException", ")", "{", "lineNum", "=", "(", "(", "TokenStreamRecognitionException", ")", "ee", ")", ".", "recog", ".", "getLine", "(", ")", ";", "colNum", "=", "(", "(", "TokenStreamRecognitionException", ")", "ee", ")", ".", "recog", ".", "getColumn", "(", ")", ";", "}", "}", "throw", "new", "SemanticException", "(", "problem", "+", "\"\"", "+", "solution", ",", "getFilename", "(", ")", ",", "lineNum", ",", "colNum", ")", ";", "}", "public", "void", "addWarning", "(", "String", "warning", ",", "String", "solution", ")", "{", "Token", "lt", "=", "null", ";", "try", "{", "lt", "=", "LT", "(", "1", ")", ";", "}", "catch", "(", "TokenStreamException", "ee", ")", "{", "}", "if", "(", "lt", "==", "null", ")", "lt", "=", "Token", ".", "badToken", ";", "Map", "row", "=", "new", "HashMap", "(", ")", ";", "row", ".", "put", "(", "\"warning\"", ",", "warning", ")", ";", "row", ".", "put", "(", "\"solution\"", ",", "solution", ")", ";", "row", ".", "put", "(", "\"filename\"", ",", "getFilename", "(", ")", ")", ";", "row", ".", "put", "(", "\"line\"", ",", "Integer", ".", "valueOf", "(", "lt", ".", "getLine", "(", ")", ")", ")", ";", "row", ".", "put", "(", "\"column\"", ",", "Integer", ".", "valueOf", "(", "lt", ".", "getColumn", "(", ")", ")", ")", ";", "warningList", ".", "add", "(", "row", ")", ";", "}", "public", "void", "reportError", "(", "String", "message", ")", "{", "Token", "lt", "=", "null", ";", "try", "{", "lt", "=", "LT", "(", "1", ")", ";", "}", "catch", "(", "TokenStreamException", "ee", ")", "{", "}", "if", "(", "lt", "==", "null", ")", "lt", "=", "Token", ".", "badToken", ";", "Map", "row", "=", "new", "HashMap", "(", ")", ";", "row", ".", "put", "(", "\"error\"", ",", "message", ")", ";", "row", ".", "put", "(", "\"filename\"", ",", "getFilename", "(", ")", ")", ";", "row", ".", "put", "(", "\"line\"", ",", "new", "Integer", "(", "lt", ".", "getLine", "(", ")", ")", ")", ";", "row", ".", "put", "(", "\"column\"", ",", "new", "Integer", "(", "lt", ".", "getColumn", "(", ")", ")", ")", ";", "errorList", ".", "add", "(", "row", ")", ";", "}", "public", "void", "reportError", "(", "String", "message", ",", "Token", "lt", ")", "{", "Map", "row", "=", "new", "HashMap", "(", ")", ";", "row", ".", "put", "(", "\"error\"", ",", "message", ")", ";", "row", ".", "put", "(", "\"filename\"", ",", "getFilename", "(", ")", ")", ";", "row", ".", "put", "(", "\"line\"", ",", "new", "Integer", "(", "lt", ".", "getLine", "(", ")", ")", ")", ";", "row", ".", "put", "(", "\"column\"", ",", "new", "Integer", "(", "lt", ".", "getColumn", "(", ")", ")", ")", ";", "errorList", ".", "add", "(", "row", ")", ";", "}", "public", "void", "reportError", "(", "String", "message", ",", "AST", "lt", ")", "{", "Map", "row", "=", "new", "HashMap", "(", ")", ";", "row", ".", "put", "(", "\"error\"", ",", "message", ")", ";", "row", ".", "put", "(", "\"filename\"", ",", "getFilename", "(", ")", ")", ";", "row", ".", "put", "(", "\"line\"", ",", "new", "Integer", "(", "lt", ".", "getLine", "(", ")", ")", ")", ";", "row", ".", "put", "(", "\"column\"", ",", "new", "Integer", "(", "lt", ".", "getColumn", "(", ")", ")", ")", ";", "errorList", ".", "add", "(", "row", ")", ";", "}", "public", "void", "reportError", "(", "RecognitionException", "e", ")", "{", "Token", "lt", "=", "null", ";", "try", "{", "lt", "=", "LT", "(", "1", ")", ";", "}", "catch", "(", "TokenStreamException", "ee", ")", "{", "}", "if", "(", "lt", "==", "null", ")", "lt", "=", "Token", ".", "badToken", ";", "Map", "row", "=", "new", "HashMap", "(", ")", ";", "row", ".", "put", "(", "\"error\"", ",", "e", ".", "getMessage", "(", ")", ")", ";", "row", ".", "put", "(", "\"filename\"", ",", "getFilename", "(", ")", ")", ";", "row", ".", "put", "(", "\"line\"", ",", "Integer", ".", "valueOf", "(", "lt", ".", "getLine", "(", ")", ")", ")", ";", "row", ".", "put", "(", "\"column\"", ",", "Integer", ".", "valueOf", "(", "lt", ".", "getColumn", "(", ")", ")", ")", ";", "errorList", ".", "add", "(", "row", ")", ";", "}", "private", "void", "require", "(", "boolean", "z", ",", "String", "problem", ",", "String", "solution", ")", "throws", "SemanticException", "{", "if", "(", "!", "z", ")", "requireFailed", "(", "problem", ",", "solution", ")", ";", "}", "private", "boolean", "matchGenericTypeBrackets", "(", "boolean", "z", ",", "String", "problem", ",", "String", "solution", ")", "throws", "SemanticException", "{", "if", "(", "!", "z", ")", "matchGenericTypeBracketsFailed", "(", "problem", ",", "solution", ")", ";", "return", "z", ";", "}", "public", "void", "matchGenericTypeBracketsFailed", "(", "String", "problem", ",", "String", "solution", ")", "throws", "SemanticException", "{", "Token", "lt", "=", "null", ";", "int", "lineNum", "=", "Token", ".", "badToken", ".", "getLine", "(", ")", ",", "colNum", "=", "Token", ".", "badToken", ".", "getColumn", "(", ")", ";", "try", "{", "lt", "=", "LT", "(", "1", ")", ";", "if", "(", "lt", "!=", "null", ")", "{", "lineNum", "=", "lt", ".", "getLine", "(", ")", ";", "colNum", "=", "lt", ".", "getColumn", "(", ")", ";", "}", "}", "catch", "(", "TokenStreamException", "ee", ")", "{", "if", "(", "ee", "instanceof", "TokenStreamRecognitionException", ")", "{", "lineNum", "=", "(", "(", "TokenStreamRecognitionException", ")", "ee", ")", ".", "recog", ".", "getLine", "(", ")", ";", "colNum", "=", "(", "(", "TokenStreamRecognitionException", ")", "ee", ")", ".", "recog", ".", "getColumn", "(", ")", ";", "}", "}", "throw", "new", "SemanticException", "(", "problem", "+", "\"\"", "+", "solution", ",", "getFilename", "(", ")", ",", "lineNum", ",", "colNum", ")", ";", "}", "private", "boolean", "isUpperCase", "(", "Token", "x", ")", "{", "if", "(", "x", "==", "null", "||", "x", ".", "getType", "(", ")", "!=", "IDENT", ")", "return", "false", ";", "String", "xtext", "=", "x", ".", "getText", "(", ")", ";", "return", "(", "xtext", ".", "length", "(", ")", ">", "0", "&&", "Character", ".", "isUpperCase", "(", "xtext", ".", "charAt", "(", "0", ")", ")", ")", ";", "}", "private", "AST", "currentClass", "=", "null", ";", "private", "boolean", "isConstructorIdent", "(", "Token", "x", ")", "{", "if", "(", "currentClass", "==", "null", ")", "return", "false", ";", "if", "(", "currentClass", ".", "getType", "(", ")", "!=", "IDENT", ")", "return", "false", ";", "String", "cname", "=", "currentClass", ".", "getText", "(", ")", ";", "if", "(", "x", "==", "null", "||", "x", ".", "getType", "(", ")", "!=", "IDENT", ")", "return", "false", ";", "return", "cname", ".", "equals", "(", "x", ".", "getText", "(", ")", ")", ";", "}", "private", "void", "dumpTree", "(", "AST", "ast", ",", "String", "offset", ")", "{", "dump", "(", "ast", ",", "offset", ")", ";", "for", "(", "AST", "node", "=", "ast", ".", "getFirstChild", "(", ")", ";", "node", "!=", "null", ";", "node", "=", "node", ".", "getNextSibling", "(", ")", ")", "{", "dumpTree", "(", "node", ",", "offset", "+", "\"t\"", ")", ";", "}", "}", "private", "void", "dump", "(", "AST", "node", ",", "String", "offset", ")", "{", "System", ".", "out", ".", "println", "(", "offset", "+", "\"Type:", "\"", "+", "getTokenName", "(", "node", ")", "+", "\"", "text:", "\"", "+", "node", ".", "getText", "(", ")", ")", ";", "}", "private", "String", "getTokenName", "(", "AST", "node", ")", "{", "if", "(", "node", "==", "null", ")", "return", "\"null\"", ";", "return", "getTokenName", "(", "node", ".", "getType", "(", ")", ")", ";", "}", "private", "int", "sepToken", "=", "EOF", ";", "private", "boolean", "argListHasLabels", "=", "false", ";", "private", "AST", "lastPathExpression", "=", "null", ";", "private", "final", "int", "LC_STMT", "=", "1", ",", "LC_INIT", "=", "2", ";", "private", "int", "ltCounter", "=", "0", ";", "private", "static", "final", "boolean", "ANTLR_LOOP_EXIT", "=", "false", ";", "protected", "GroovyRecognizer", "(", "TokenBuffer", "tokenBuf", ",", "int", "k", ")", "{", "super", "(", "tokenBuf", ",", "k", ")", ";", "tokenNames", "=", "_tokenNames", ";", "buildTokenTypeASTClassMap", "(", ")", ";", "astFactory", "=", "new", "ASTFactory", "(", "getTokenTypeToASTClassMap", "(", ")", ")", ";", "}", "public", "GroovyRecognizer", "(", "TokenBuffer", "tokenBuf", ")", "{", "this", "(", "tokenBuf", ",", "2", ")", ";", "}", "protected", "GroovyRecognizer", "(", "TokenStream", "lexer", ",", "int", "k", ")", "{", "super", "(", "lexer", ",", "k", ")", ";", "tokenNames", "=", "_tokenNames", ";", "buildTokenTypeASTClassMap", "(", ")", ";", "astFactory", "=", "new", "ASTFactory", "(", "getTokenTypeToASTClassMap", "(", ")", ")", ";", "}", "public", "GroovyRecognizer", "(", "TokenStream", "lexer", ")", "{", "this", "(", "lexer", ",", "2", ")", ";", "}", "public", "GroovyRecognizer", "(", "ParserSharedInputState", "state", ")", "{", "super", "(", "state", ",", "2", ")", ";", "tokenNames", "=", "_tokenNames", ";", "buildTokenTypeASTClassMap", "(", ")", ";", "astFactory", "=", "new", "ASTFactory", "(", "getTokenTypeToASTClassMap", "(", ")", ")", ";", "}", "public", "final", "void", "compilationUnit", "(", ")", "throws", "RecognitionException", ",", "TokenStreamException", "{", "returnAST", "=", "null", ";", "ASTPair", "currentAST", "=", "new", "ASTPair", "(", ")", ";", "AST", "compilationUnit_AST", "=", "null", ";", "try", "{", "{", "switch", "(", "LA", "(", "1", ")", ")", "{", "case", "SH_COMMENT", ":", "{", "match", "(", "SH_COMMENT", ")", ";", "break", ";", "}", "case", "EOF", ":", "case", "FINAL", ":", "case", "ABSTRACT", ":", "case", "STRICTFP", ":", "case", "LITERAL_package", ":", "case", "LITERAL_import", ":", "case", "LITERAL_static", ":", "case", "LITERAL_def", ":", "case", "LBRACK", ":", "case", "IDENT", ":", "case", "STRING_LITERAL", ":", "case", "LPAREN", ":", "case", "LITERAL_class", ":", "case", "LITERAL_interface", ":", "case", "LITERAL_enum", ":", "case", "AT", ":", "case", "LITERAL_super", ":", "case", "LITERAL_void", ":", "case", "LITERAL_boolean", ":", "case", "LITERAL_byte", ":", "case", "LITERAL_char", ":", "case", "LITERAL_short", ":", "case", "LITERAL_int", ":", "case", "LITERAL_float", ":", "case", "LITERAL_long", ":", "case", "LITERAL_double", ":", "case", "LITERAL_private", ":", "case", "LITERAL_public", ":", "case", "LITERAL_protected", ":", "case", "LITERAL_transient", ":", "case", "LITERAL_native", ":", "case", "LITERAL_threadsafe", ":", "case", "LITERAL_synchronized", ":", "case", "LITERAL_volatile", ":", "case", "LCURLY", ":", "case", "SEMI", ":", "case", "LITERAL_this", ":", "case", "LITERAL_if", ":", "case", "LITERAL_while", ":", "case", "LITERAL_switch", ":", "case", "LITERAL_for", ":", "case", "LITERAL_return", ":", "case", "LITERAL_break", ":", "case", "LITERAL_continue", ":", "case", "LITERAL_throw", ":", "case", "LITERAL_assert", ":", "case", "PLUS", ":", "case", "MINUS", ":", "case", "LITERAL_try", ":", "case", "LITERAL_false", ":", "case", "LITERAL_new", ":", "case", "LITERAL_null", ":", "case", "LITERAL_true", ":", "case", "INC", ":", "case", "DEC", ":", "case", "BNOT", ":", "case", "LNOT", ":", "case", "STRING_CTOR_START", ":", "case", "NUM_INT", ":", "case", "NUM_FLOAT", ":", "case", "NUM_LONG", ":", "case", "NUM_DOUBLE", ":", "case", "NUM_BIG_INT", ":", "case", "NUM_BIG_DECIMAL", ":", "case", "NLS", ":", "{", "break", ";", "}", "default", ":", "{", "throw", "new", "NoViableAltException", "(", "LT", "(", "1", ")", ",", "getFilename", "(", ")", ")", ";", "}", "}", "}", "nls", "(", ")", ";", "{", "boolean", "synPredMatched5", "=", "false", ";", "if", "(", "(", "(", "LA", "(", "1", ")", "==", "LITERAL_package", "||", "LA", "(", "1", ")", "==", "AT", ")", "&&", "(", "_tokenSet_0", ".", "member", "(", "LA", "(", "2", ")", ")", ")", ")", ")", "{", "int", "_m5", "=", "mark", "(", ")", ";", "synPredMatched5", "=", "true", ";", "inputState", ".", "guessing", "++", ";", "try", "{", "{", "annotationsOpt", "(", ")", ";", "match", "(", "LITERAL_package", ")", ";", "}", "}", "catch", "(", "RecognitionException", "pe", ")", "{", "synPredMatched5", "=", "false", ";", "}", "rewind", "(", "_m5", ")", ";", "inputState", ".", "guessing", "--", ";", "}", "if", "(", "synPredMatched5", ")", "{", "packageDefinition", "(", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "returnAST", ")", ";", "}", "else", "if", "(", "(", "_tokenSet_1", ".", "member", "(", "LA", "(", "1", ")", ")", ")", "&&", "(", "_tokenSet_2", ".", "member", "(", "LA", "(", "2", ")", ")", ")", ")", "{", "{", "switch", "(", "LA", "(", "1", ")", ")", "{", "case", "FINAL", ":", "case", "ABSTRACT", ":", "case", "STRICTFP", ":", "case", "LITERAL_import", ":", "case", "LITERAL_static", ":", "case", "LITERAL_def", ":", "case", "LBRACK", ":", "case", "IDENT", ":", "case", "STRING_LITERAL", ":", "case", "LPAREN", ":", "case", "LITERAL_class", ":", "case", "LITERAL_interface", ":", "case", "LITERAL_enum", ":", "case", "AT", ":", "case", "LITERAL_super", ":", "case", "LITERAL_void", ":", "case", "LITERAL_boolean", ":", "case", "LITERAL_byte", ":", "case", "LITERAL_char", ":", "case", "LITERAL_short", ":", "case", "LITERAL_int", ":", "case", "LITERAL_float", ":", "case", "LITERAL_long", ":", "case", "LITERAL_double", ":", "case", "LITERAL_private", ":", "case", "LITERAL_public", ":", "case", "LITERAL_protected", ":", "case", "LITERAL_transient", ":", "case", "LITERAL_native", ":", "case", "LITERAL_threadsafe", ":", "case", "LITERAL_synchronized", ":", "case", "LITERAL_volatile", ":", "case", "LCURLY", ":", "case", "LITERAL_this", ":", "case", "LITERAL_if", ":", "case", "LITERAL_while", ":", "case", "LITERAL_switch", ":", "case", "LITERAL_for", ":", "case", "LITERAL_return", ":", "case", "LITERAL_break", ":", "case", "LITERAL_continue", ":", "case", "LITERAL_throw", ":", "case", "LITERAL_assert", ":", "case", "PLUS", ":", "case", "MINUS", ":", "case", "LITERAL_try", ":", "case", "LITERAL_false", ":", "case", "LITERAL_new", ":", "case", "LITERAL_null", ":", "case", "LITERAL_true", ":", "case", "INC", ":", "case", "DEC", ":", "case", "BNOT", ":", "case", "LNOT", ":", "case", "STRING_CTOR_START", ":", "case", "NUM_INT", ":", "case", "NUM_FLOAT", ":", "case", "NUM_LONG", ":", "case", "NUM_DOUBLE", ":", "case", "NUM_BIG_INT", ":", "case", "NUM_BIG_DECIMAL", ":", "{", "statement", "(", "EOF", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "returnAST", ")", ";", "break", ";", "}", "case", "EOF", ":", "case", "SEMI", ":", "case", "NLS", ":", "{", "break", ";", "}", "default", ":", "{", "throw", "new", "NoViableAltException", "(", "LT", "(", "1", ")", ",", "getFilename", "(", ")", ")", ";", "}", "}", "}", "}", "else", "{", "throw", "new", "NoViableAltException", "(", "LT", "(", "1", ")", ",", "getFilename", "(", ")", ")", ";", "}", "}", "{", "_loop9", ":", "do", "{", "if", "(", "(", "LA", "(", "1", ")", "==", "SEMI", "||", "LA", "(", "1", ")", "==", "NLS", ")", ")", "{", "sep", "(", ")", ";", "{", "switch", "(", "LA", "(", "1", ")", ")", "{", "case", "FINAL", ":", "case", "ABSTRACT", ":", "case", "STRICTFP", ":", "case", "LITERAL_import", ":", "case", "LITERAL_static", ":", "case", "LITERAL_def", ":", "case", "LBRACK", ":", "case", "IDENT", ":", "case", "STRING_LITERAL", ":", "case", "LPAREN", ":", "case", "LITERAL_class", ":", "case", "LITERAL_interface", ":", "case", "LITERAL_enum", ":", "case", "AT", ":", "case", "LITERAL_super", ":", "case", "LITERAL_void", ":", "case", "LITERAL_boolean", ":", "case", "LITERAL_byte", ":", "case", "LITERAL_char", ":", "case", "LITERAL_short", ":", "case", "LITERAL_int", ":", "case", "LITERAL_float", ":", "case", "LITERAL_long", ":", "case", "LITERAL_double", ":", "case", "LITERAL_private", ":", "case", "LITERAL_public", ":", "case", "LITERAL_protected", ":", "case", "LITERAL_transient", ":", "case", "LITERAL_native", ":", "case", "LITERAL_threadsafe", ":", "case", "LITERAL_synchronized", ":", "case", "LITERAL_volatile", ":", "case", "LCURLY", ":", "case", "LITERAL_this", ":", "case", "LITERAL_if", ":", "case", "LITERAL_while", ":", "case", "LITERAL_switch", ":", "case", "LITERAL_for", ":", "case", "LITERAL_return", ":", "case", "LITERAL_break", ":", "case", "LITERAL_continue", ":", "case", "LITERAL_throw", ":", "case", "LITERAL_assert", ":", "case", "PLUS", ":", "case", "MINUS", ":", "case", "LITERAL_try", ":", "case", "LITERAL_false", ":", "case", "LITERAL_new", ":", "case", "LITERAL_null", ":", "case", "LITERAL_true", ":", "case", "INC", ":", "case", "DEC", ":", "case", "BNOT", ":", "case", "LNOT", ":", "case", "STRING_CTOR_START", ":", "case", "NUM_INT", ":", "case", "NUM_FLOAT", ":", "case", "NUM_LONG", ":", "case", "NUM_DOUBLE", ":", "case", "NUM_BIG_INT", ":", "case", "NUM_BIG_DECIMAL", ":", "{", "statement", "(", "sepToken", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "returnAST", ")", ";", "break", ";", "}", "case", "EOF", ":", "case", "SEMI", ":", "case", "NLS", ":", "{", "break", ";", "}", "default", ":", "{", "throw", "new", "NoViableAltException", "(", "LT", "(", "1", ")", ",", "getFilename", "(", ")", ")", ";", "}", "}", "}", "}", "else", "{", "break", "_loop9", ";", "}", "}", "while", "(", "true", ")", ";", "}", "match", "(", "Token", ".", "EOF_TYPE", ")", ";", "compilationUnit_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "}", "catch", "(", "RecognitionException", "e", ")", "{", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "reportError", "(", "e", ")", ";", "compilationUnit_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "}", "else", "{", "throw", "e", ";", "}", "}", "returnAST", "=", "compilationUnit_AST", ";", "}", "public", "final", "void", "nls", "(", ")", "throws", "RecognitionException", ",", "TokenStreamException", "{", "returnAST", "=", "null", ";", "ASTPair", "currentAST", "=", "new", "ASTPair", "(", ")", ";", "AST", "nls_AST", "=", "null", ";", "{", "if", "(", "(", "LA", "(", "1", ")", "==", "NLS", ")", "&&", "(", "_tokenSet_3", ".", "member", "(", "LA", "(", "2", ")", ")", ")", ")", "{", "match", "(", "NLS", ")", ";", "}", "else", "if", "(", "(", "_tokenSet_3", ".", "member", "(", "LA", "(", "1", ")", ")", ")", "&&", "(", "_tokenSet_4", ".", "member", "(", "LA", "(", "2", ")", ")", ")", ")", "{", "}", "else", "{", "throw", "new", "NoViableAltException", "(", "LT", "(", "1", ")", ",", "getFilename", "(", ")", ")", ";", "}", "}", "returnAST", "=", "nls_AST", ";", "}", "public", "final", "void", "annotationsOpt", "(", ")", "throws", "RecognitionException", ",", "TokenStreamException", "{", "returnAST", "=", "null", ";", "ASTPair", "currentAST", "=", "new", "ASTPair", "(", ")", ";", "AST", "annotationsOpt_AST", "=", "null", ";", "Token", "first", "=", "LT", "(", "1", ")", ";", "{", "if", "(", "(", "_tokenSet_5", ".", "member", "(", "LA", "(", "1", ")", ")", ")", "&&", "(", "_tokenSet_6", ".", "member", "(", "LA", "(", "2", ")", ")", ")", ")", "{", "annotationsInternal", "(", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "returnAST", ")", ";", "}", "else", "if", "(", "(", "_tokenSet_7", ".", "member", "(", "LA", "(", "1", ")", ")", ")", "&&", "(", "_tokenSet_8", ".", "member", "(", "LA", "(", "2", ")", ")", ")", ")", "{", "}", "else", "{", "throw", "new", "NoViableAltException", "(", "LT", "(", "1", ")", ",", "getFilename", "(", ")", ")", ";", "}", "}", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "annotationsOpt_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "annotationsOpt_AST", "=", "(", "AST", ")", "astFactory", ".", "make", "(", "(", "new", "ASTArray", "(", "2", ")", ")", ".", "add", "(", "create", "(", "ANNOTATIONS", ",", "\"ANNOTATIONS\"", ",", "first", ",", "LT", "(", "1", ")", ")", ")", ".", "add", "(", "annotationsOpt_AST", ")", ")", ";", "currentAST", ".", "root", "=", "annotationsOpt_AST", ";", "currentAST", ".", "child", "=", "annotationsOpt_AST", "!=", "null", "&&", "annotationsOpt_AST", ".", "getFirstChild", "(", ")", "!=", "null", "?", "annotationsOpt_AST", ".", "getFirstChild", "(", ")", ":", "annotationsOpt_AST", ";", "currentAST", ".", "advanceChildToEnd", "(", ")", ";", "}", "annotationsOpt_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "returnAST", "=", "annotationsOpt_AST", ";", "}", "public", "final", "void", "packageDefinition", "(", ")", "throws", "RecognitionException", ",", "TokenStreamException", "{", "returnAST", "=", "null", ";", "ASTPair", "currentAST", "=", "new", "ASTPair", "(", ")", ";", "AST", "packageDefinition_AST", "=", "null", ";", "AST", "an_AST", "=", "null", ";", "AST", "id_AST", "=", "null", ";", "Token", "first", "=", "LT", "(", "1", ")", ";", "annotationsOpt", "(", ")", ";", "an_AST", "=", "(", "AST", ")", "returnAST", ";", "match", "(", "LITERAL_package", ")", ";", "{", "switch", "(", "LA", "(", "1", ")", ")", "{", "case", "IDENT", ":", "{", "identifier", "(", ")", ";", "id_AST", "=", "(", "AST", ")", "returnAST", ";", "break", ";", "}", "case", "EOF", ":", "case", "SEMI", ":", "case", "NLS", ":", "{", "break", ";", "}", "default", ":", "{", "throw", "new", "NoViableAltException", "(", "LT", "(", "1", ")", ",", "getFilename", "(", ")", ")", ";", "}", "}", "}", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "packageDefinition_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "if", "(", "id_AST", "==", "null", ")", "{", "reportError", "(", "\"\"", ",", "LT", "(", "0", ")", ")", ";", "}", "else", "{", "packageDefinition_AST", "=", "(", "AST", ")", "astFactory", ".", "make", "(", "(", "new", "ASTArray", "(", "3", ")", ")", ".", "add", "(", "create", "(", "PACKAGE_DEF", ",", "\"package\"", ",", "first", ",", "LT", "(", "1", ")", ")", ")", ".", "add", "(", "an_AST", ")", ".", "add", "(", "id_AST", ")", ")", ";", "}", "currentAST", ".", "root", "=", "packageDefinition_AST", ";", "currentAST", ".", "child", "=", "packageDefinition_AST", "!=", "null", "&&", "packageDefinition_AST", ".", "getFirstChild", "(", ")", "!=", "null", "?", "packageDefinition_AST", ".", "getFirstChild", "(", ")", ":", "packageDefinition_AST", ";", "currentAST", ".", "advanceChildToEnd", "(", ")", ";", "}", "packageDefinition_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "returnAST", "=", "packageDefinition_AST", ";", "}", "public", "final", "void", "statement", "(", "int", "prevToken", ")", "throws", "RecognitionException", ",", "TokenStreamException", "{", "returnAST", "=", "null", ";", "ASTPair", "currentAST", "=", "new", "ASTPair", "(", ")", ";", "AST", "statement_AST", "=", "null", ";", "AST", "pfx_AST", "=", "null", ";", "AST", "es_AST", "=", "null", ";", "AST", "ale_AST", "=", "null", ";", "AST", "ifCbs_AST", "=", "null", ";", "AST", "elseCbs_AST", "=", "null", ";", "AST", "while_sce_AST", "=", "null", ";", "Token", "s", "=", "null", ";", "AST", "s_AST", "=", "null", ";", "AST", "while_cbs_AST", "=", "null", ";", "AST", "m_AST", "=", "null", ";", "AST", "switchSce_AST", "=", "null", ";", "AST", "cg_AST", "=", "null", ";", "AST", "synch_sce_AST", "=", "null", ";", "AST", "synch_cs_AST", "=", "null", ";", "boolean", "sce", "=", "false", ";", "Token", "first", "=", "LT", "(", "1", ")", ";", "AST", "casesGroup_AST", "=", "null", ";", "try", "{", "switch", "(", "LA", "(", "1", ")", ")", "{", "case", "LITERAL_if", ":", "{", "match", "(", "LITERAL_if", ")", ";", "match", "(", "LPAREN", ")", ";", "assignmentLessExpression", "(", ")", ";", "ale_AST", "=", "(", "AST", ")", "returnAST", ";", "match", "(", "RPAREN", ")", ";", "nlsWarn", "(", ")", ";", "compatibleBodyStatement", "(", ")", ";", "ifCbs_AST", "=", "(", "AST", ")", "returnAST", ";", "{", "boolean", "synPredMatched297", "=", "false", ";", "if", "(", "(", "(", "_tokenSet_9", ".", "member", "(", "LA", "(", "1", ")", ")", ")", "&&", "(", "_tokenSet_10", ".", "member", "(", "LA", "(", "2", ")", ")", ")", ")", ")", "{", "int", "_m297", "=", "mark", "(", ")", ";", "synPredMatched297", "=", "true", ";", "inputState", ".", "guessing", "++", ";", "try", "{", "{", "{", "switch", "(", "LA", "(", "1", ")", ")", "{", "case", "SEMI", ":", "case", "NLS", ":", "{", "sep", "(", ")", ";", "break", ";", "}", "case", "LITERAL_else", ":", "{", "break", ";", "}", "default", ":", "{", "throw", "new", "NoViableAltException", "(", "LT", "(", "1", ")", ",", "getFilename", "(", ")", ")", ";", "}", "}", "}", "match", "(", "LITERAL_else", ")", ";", "}", "}", "catch", "(", "RecognitionException", "pe", ")", "{", "synPredMatched297", "=", "false", ";", "}", "rewind", "(", "_m297", ")", ";", "inputState", ".", "guessing", "--", ";", "}", "if", "(", "synPredMatched297", ")", "{", "{", "switch", "(", "LA", "(", "1", ")", ")", "{", "case", "SEMI", ":", "case", "NLS", ":", "{", "sep", "(", ")", ";", "break", ";", "}", "case", "LITERAL_else", ":", "{", "break", ";", "}", "default", ":", "{", "throw", "new", "NoViableAltException", "(", "LT", "(", "1", ")", ",", "getFilename", "(", ")", ")", ";", "}", "}", "}", "match", "(", "LITERAL_else", ")", ";", "nlsWarn", "(", ")", ";", "compatibleBodyStatement", "(", ")", ";", "elseCbs_AST", "=", "(", "AST", ")", "returnAST", ";", "}", "else", "if", "(", "(", "_tokenSet_11", ".", "member", "(", "LA", "(", "1", ")", ")", ")", "&&", "(", "_tokenSet_12", ".", "member", "(", "LA", "(", "2", ")", ")", ")", ")", "{", "}", "else", "{", "throw", "new", "NoViableAltException", "(", "LT", "(", "1", ")", ",", "getFilename", "(", ")", ")", ";", "}", "}", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "statement_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "statement_AST", "=", "(", "AST", ")", "astFactory", ".", "make", "(", "(", "new", "ASTArray", "(", "4", ")", ")", ".", "add", "(", "create", "(", "LITERAL_if", ",", "\"if\"", ",", "first", ",", "LT", "(", "1", ")", ")", ")", ".", "add", "(", "ale_AST", ")", ".", "add", "(", "ifCbs_AST", ")", ".", "add", "(", "elseCbs_AST", ")", ")", ";", "currentAST", ".", "root", "=", "statement_AST", ";", "currentAST", ".", "child", "=", "statement_AST", "!=", "null", "&&", "statement_AST", ".", "getFirstChild", "(", ")", "!=", "null", "?", "statement_AST", ".", "getFirstChild", "(", ")", ":", "statement_AST", ";", "currentAST", ".", "advanceChildToEnd", "(", ")", ";", "}", "statement_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "break", ";", "}", "case", "LITERAL_for", ":", "{", "forStatement", "(", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "returnAST", ")", ";", "statement_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "break", ";", "}", "case", "LITERAL_while", ":", "{", "match", "(", "LITERAL_while", ")", ";", "match", "(", "LPAREN", ")", ";", "sce", "=", "strictContextExpression", "(", "false", ")", ";", "while_sce_AST", "=", "(", "AST", ")", "returnAST", ";", "match", "(", "RPAREN", ")", ";", "nlsWarn", "(", ")", ";", "{", "switch", "(", "LA", "(", "1", ")", ")", "{", "case", "SEMI", ":", "{", "s", "=", "LT", "(", "1", ")", ";", "s_AST", "=", "astFactory", ".", "create", "(", "s", ")", ";", "match", "(", "SEMI", ")", ";", "break", ";", "}", "case", "FINAL", ":", "case", "ABSTRACT", ":", "case", "STRICTFP", ":", "case", "LITERAL_import", ":", "case", "LITERAL_static", ":", "case", "LITERAL_def", ":", "case", "LBRACK", ":", "case", "IDENT", ":", "case", "STRING_LITERAL", ":", "case", "LPAREN", ":", "case", "LITERAL_class", ":", "case", "LITERAL_interface", ":", "case", "LITERAL_enum", ":", "case", "AT", ":", "case", "LITERAL_super", ":", "case", "LITERAL_void", ":", "case", "LITERAL_boolean", ":", "case", "LITERAL_byte", ":", "case", "LITERAL_char", ":", "case", "LITERAL_short", ":", "case", "LITERAL_int", ":", "case", "LITERAL_float", ":", "case", "LITERAL_long", ":", "case", "LITERAL_double", ":", "case", "LITERAL_private", ":", "case", "LITERAL_public", ":", "case", "LITERAL_protected", ":", "case", "LITERAL_transient", ":", "case", "LITERAL_native", ":", "case", "LITERAL_threadsafe", ":", "case", "LITERAL_synchronized", ":", "case", "LITERAL_volatile", ":", "case", "LCURLY", ":", "case", "LITERAL_this", ":", "case", "LITERAL_if", ":", "case", "LITERAL_while", ":", "case", "LITERAL_switch", ":", "case", "LITERAL_for", ":", "case", "LITERAL_return", ":", "case", "LITERAL_break", ":", "case", "LITERAL_continue", ":", "case", "LITERAL_throw", ":", "case", "LITERAL_assert", ":", "case", "PLUS", ":", "case", "MINUS", ":", "case", "LITERAL_try", ":", "case", "LITERAL_false", ":", "case", "LITERAL_new", ":", "case", "LITERAL_null", ":", "case", "LITERAL_true", ":", "case", "INC", ":", "case", "DEC", ":", "case", "BNOT", ":", "case", "LNOT", ":", "case", "STRING_CTOR_START", ":", "case", "NUM_INT", ":", "case", "NUM_FLOAT", ":", "case", "NUM_LONG", ":", "case", "NUM_DOUBLE", ":", "case", "NUM_BIG_INT", ":", "case", "NUM_BIG_DECIMAL", ":", "{", "compatibleBodyStatement", "(", ")", ";", "while_cbs_AST", "=", "(", "AST", ")", "returnAST", ";", "break", ";", "}", "default", ":", "{", "throw", "new", "NoViableAltException", "(", "LT", "(", "1", ")", ",", "getFilename", "(", ")", ")", ";", "}", "}", "}", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "statement_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "if", "(", "s_AST", "!=", "null", ")", "statement_AST", "=", "(", "AST", ")", "astFactory", ".", "make", "(", "(", "new", "ASTArray", "(", "3", ")", ")", ".", "add", "(", "create", "(", "LITERAL_while", ",", "\"\"", ",", "first", ",", "LT", "(", "1", ")", ")", ")", ".", "add", "(", "while_sce_AST", ")", ".", "add", "(", "s_AST", ")", ")", ";", "else", "statement_AST", "=", "(", "AST", ")", "astFactory", ".", "make", "(", "(", "new", "ASTArray", "(", "3", ")", ")", ".", "add", "(", "create", "(", "LITERAL_while", ",", "\"\"", ",", "first", ",", "LT", "(", "1", ")", ")", ")", ".", "add", "(", "while_sce_AST", ")", ".", "add", "(", "while_cbs_AST", ")", ")", ";", "currentAST", ".", "root", "=", "statement_AST", ";", "currentAST", ".", "child", "=", "statement_AST", "!=", "null", "&&", "statement_AST", ".", "getFirstChild", "(", ")", "!=", "null", "?", "statement_AST", ".", "getFirstChild", "(", ")", ":", "statement_AST", ";", "currentAST", ".", "advanceChildToEnd", "(", ")", ";", "}", "statement_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "break", ";", "}", "case", "LITERAL_switch", ":", "{", "match", "(", "LITERAL_switch", ")", ";", "match", "(", "LPAREN", ")", ";", "sce", "=", "strictContextExpression", "(", "false", ")", ";", "switchSce_AST", "=", "(", "AST", ")", "returnAST", ";", "match", "(", "RPAREN", ")", ";", "nlsWarn", "(", ")", ";", "match", "(", "LCURLY", ")", ";", "nls", "(", ")", ";", "{", "_loop303", ":", "do", "{", "if", "(", "(", "LA", "(", "1", ")", "==", "LITERAL_default", "||", "LA", "(", "1", ")", "==", "LITERAL_case", ")", ")", "{", "casesGroup", "(", ")", ";", "cg_AST", "=", "(", "AST", ")", "returnAST", ";", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "casesGroup_AST", "=", "(", "AST", ")", "astFactory", ".", "make", "(", "(", "new", "ASTArray", "(", "3", ")", ")", ".", "add", "(", "null", ")", ".", "add", "(", "casesGroup_AST", ")", ".", "add", "(", "cg_AST", ")", ")", ";", "}", "}", "else", "{", "break", "_loop303", ";", "}", "}", "while", "(", "true", ")", ";", "}", "match", "(", "RCURLY", ")", ";", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "statement_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "statement_AST", "=", "(", "AST", ")", "astFactory", ".", "make", "(", "(", "new", "ASTArray", "(", "3", ")", ")", ".", "add", "(", "create", "(", "LITERAL_switch", ",", "\"switch\"", ",", "first", ",", "LT", "(", "1", ")", ")", ")", ".", "add", "(", "switchSce_AST", ")", ".", "add", "(", "casesGroup_AST", ")", ")", ";", "currentAST", ".", "root", "=", "statement_AST", ";", "currentAST", ".", "child", "=", "statement_AST", "!=", "null", "&&", "statement_AST", ".", "getFirstChild", "(", ")", "!=", "null", "?", "statement_AST", ".", "getFirstChild", "(", ")", ":", "statement_AST", ";", "currentAST", ".", "advanceChildToEnd", "(", ")", ";", "}", "statement_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "break", ";", "}", "case", "LITERAL_try", ":", "{", "tryBlock", "(", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "returnAST", ")", ";", "statement_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "break", ";", "}", "case", "LITERAL_return", ":", "case", "LITERAL_break", ":", "case", "LITERAL_continue", ":", "case", "LITERAL_throw", ":", "case", "LITERAL_assert", ":", "{", "branchStatement", "(", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "returnAST", ")", ";", "statement_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "break", ";", "}", "default", ":", "boolean", "synPredMatched284", "=", "false", ";", "if", "(", "(", "(", "_tokenSet_13", ".", "member", "(", "LA", "(", "1", ")", ")", ")", "&&", "(", "_tokenSet_14", ".", "member", "(", "LA", "(", "2", ")", ")", ")", ")", ")", "{", "int", "_m284", "=", "mark", "(", ")", ";", "synPredMatched284", "=", "true", ";", "inputState", ".", "guessing", "++", ";", "try", "{", "{", "genericMethodStart", "(", ")", ";", "}", "}", "catch", "(", "RecognitionException", "pe", ")", "{", "synPredMatched284", "=", "false", ";", "}", "rewind", "(", "_m284", ")", ";", "inputState", ".", "guessing", "--", ";", "}", "if", "(", "synPredMatched284", ")", "{", "genericMethod", "(", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "returnAST", ")", ";", "statement_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "}", "else", "{", "boolean", "synPredMatched286", "=", "false", ";", "if", "(", "(", "(", "_tokenSet_13", ".", "member", "(", "LA", "(", "1", ")", ")", ")", "&&", "(", "_tokenSet_15", ".", "member", "(", "LA", "(", "2", ")", ")", ")", ")", ")", "{", "int", "_m286", "=", "mark", "(", ")", ";", "synPredMatched286", "=", "true", ";", "inputState", ".", "guessing", "++", ";", "try", "{", "{", "multipleAssignmentDeclarationStart", "(", ")", ";", "}", "}", "catch", "(", "RecognitionException", "pe", ")", "{", "synPredMatched286", "=", "false", ";", "}", "rewind", "(", "_m286", ")", ";", "inputState", ".", "guessing", "--", ";", "}", "if", "(", "synPredMatched286", ")", "{", "multipleAssignmentDeclaration", "(", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "returnAST", ")", ";", "statement_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "}", "else", "{", "boolean", "synPredMatched288", "=", "false", ";", "if", "(", "(", "(", "_tokenSet_16", ".", "member", "(", "LA", "(", "1", ")", ")", ")", "&&", "(", "_tokenSet_17", ".", "member", "(", "LA", "(", "2", ")", ")", ")", ")", ")", "{", "int", "_m288", "=", "mark", "(", ")", ";", "synPredMatched288", "=", "true", ";", "inputState", ".", "guessing", "++", ";", "try", "{", "{", "declarationStart", "(", ")", ";", "}", "}", "catch", "(", "RecognitionException", "pe", ")", "{", "synPredMatched288", "=", "false", ";", "}", "rewind", "(", "_m288", ")", ";", "inputState", ".", "guessing", "--", ";", "}", "if", "(", "synPredMatched288", ")", "{", "declaration", "(", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "returnAST", ")", ";", "statement_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "}", "else", "{", "boolean", "synPredMatched290", "=", "false", ";", "if", "(", "(", "(", "LA", "(", "1", ")", "==", "IDENT", ")", "&&", "(", "LA", "(", "2", ")", "==", "COLON", ")", ")", ")", "{", "int", "_m290", "=", "mark", "(", ")", ";", "synPredMatched290", "=", "true", ";", "inputState", ".", "guessing", "++", ";", "try", "{", "{", "match", "(", "IDENT", ")", ";", "match", "(", "COLON", ")", ";", "}", "}", "catch", "(", "RecognitionException", "pe", ")", "{", "synPredMatched290", "=", "false", ";", "}", "rewind", "(", "_m290", ")", ";", "inputState", ".", "guessing", "--", ";", "}", "if", "(", "synPredMatched290", ")", "{", "statementLabelPrefix", "(", ")", ";", "pfx_AST", "=", "(", "AST", ")", "returnAST", ";", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "statement_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "statement_AST", "=", "pfx_AST", ";", "currentAST", ".", "root", "=", "statement_AST", ";", "currentAST", ".", "child", "=", "statement_AST", "!=", "null", "&&", "statement_AST", ".", "getFirstChild", "(", ")", "!=", "null", "?", "statement_AST", ".", "getFirstChild", "(", ")", ":", "statement_AST", ";", "currentAST", ".", "advanceChildToEnd", "(", ")", ";", "}", "{", "boolean", "synPredMatched293", "=", "false", ";", "if", "(", "(", "(", "LA", "(", "1", ")", "==", "LCURLY", ")", "&&", "(", "_tokenSet_18", ".", "member", "(", "LA", "(", "2", ")", ")", ")", ")", ")", "{", "int", "_m293", "=", "mark", "(", ")", ";", "synPredMatched293", "=", "true", ";", "inputState", ".", "guessing", "++", ";", "try", "{", "{", "match", "(", "LCURLY", ")", ";", "}", "}", "catch", "(", "RecognitionException", "pe", ")", "{", "synPredMatched293", "=", "false", ";", "}", "rewind", "(", "_m293", ")", ";", "inputState", ".", "guessing", "--", ";", "}", "if", "(", "synPredMatched293", ")", "{", "openOrClosableBlock", "(", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "returnAST", ")", ";", "}", "else", "if", "(", "(", "_tokenSet_19", ".", "member", "(", "LA", "(", "1", ")", ")", ")", "&&", "(", "_tokenSet_2", ".", "member", "(", "LA", "(", "2", ")", ")", ")", ")", "{", "statement", "(", "COLON", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "returnAST", ")", ";", "}", "else", "{", "throw", "new", "NoViableAltException", "(", "LT", "(", "1", ")", ",", "getFilename", "(", ")", ")", ";", "}", "}", "statement_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "}", "else", "if", "(", "(", "_tokenSet_20", ".", "member", "(", "LA", "(", "1", ")", ")", ")", "&&", "(", "_tokenSet_2", ".", "member", "(", "LA", "(", "2", ")", ")", ")", ")", "{", "expressionStatement", "(", "prevToken", ")", ";", "es_AST", "=", "(", "AST", ")", "returnAST", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "returnAST", ")", ";", "statement_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "}", "else", "{", "boolean", "synPredMatched301", "=", "false", ";", "if", "(", "(", "(", "LA", "(", "1", ")", "==", "LITERAL_import", "||", "LA", "(", "1", ")", "==", "AT", ")", "&&", "(", "_tokenSet_21", ".", "member", "(", "LA", "(", "2", ")", ")", ")", ")", ")", "{", "int", "_m301", "=", "mark", "(", ")", ";", "synPredMatched301", "=", "true", ";", "inputState", ".", "guessing", "++", ";", "try", "{", "{", "annotationsOpt", "(", ")", ";", "match", "(", "LITERAL_import", ")", ";", "}", "}", "catch", "(", "RecognitionException", "pe", ")", "{", "synPredMatched301", "=", "false", ";", "}", "rewind", "(", "_m301", ")", ";", "inputState", ".", "guessing", "--", ";", "}", "if", "(", "synPredMatched301", ")", "{", "importStatement", "(", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "returnAST", ")", ";", "statement_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "}", "else", "if", "(", "(", "_tokenSet_22", ".", "member", "(", "LA", "(", "1", ")", ")", ")", "&&", "(", "_tokenSet_23", ".", "member", "(", "LA", "(", "2", ")", ")", ")", ")", "{", "modifiersOpt", "(", ")", ";", "m_AST", "=", "(", "AST", ")", "returnAST", ";", "typeDefinitionInternal", "(", "m_AST", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "returnAST", ")", ";", "statement_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "}", "else", "if", "(", "(", "LA", "(", "1", ")", "==", "LITERAL_synchronized", ")", "&&", "(", "LA", "(", "2", ")", "==", "LPAREN", ")", ")", "{", "match", "(", "LITERAL_synchronized", ")", ";", "match", "(", "LPAREN", ")", ";", "sce", "=", "strictContextExpression", "(", "false", ")", ";", "synch_sce_AST", "=", "(", "AST", ")", "returnAST", ";", "match", "(", "RPAREN", ")", ";", "nlsWarn", "(", ")", ";", "compoundStatement", "(", ")", ";", "synch_cs_AST", "=", "(", "AST", ")", "returnAST", ";", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "statement_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "statement_AST", "=", "(", "AST", ")", "astFactory", ".", "make", "(", "(", "new", "ASTArray", "(", "3", ")", ")", ".", "add", "(", "create", "(", "LITERAL_synchronized", ",", "\"synchronized\"", ",", "first", ",", "LT", "(", "1", ")", ")", ")", ".", "add", "(", "synch_sce_AST", ")", ".", "add", "(", "synch_cs_AST", ")", ")", ";", "currentAST", ".", "root", "=", "statement_AST", ";", "currentAST", ".", "child", "=", "statement_AST", "!=", "null", "&&", "statement_AST", ".", "getFirstChild", "(", ")", "!=", "null", "?", "statement_AST", ".", "getFirstChild", "(", ")", ":", "statement_AST", ";", "currentAST", ".", "advanceChildToEnd", "(", ")", ";", "}", "statement_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "}", "else", "{", "throw", "new", "NoViableAltException", "(", "LT", "(", "1", ")", ",", "getFilename", "(", ")", ")", ";", "}", "}", "}", "}", "}", "}", "}", "catch", "(", "RecognitionException", "e", ")", "{", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "boolean", "bang", "=", "true", ";", "if", "(", "pfx_AST", "!=", "null", ")", "{", "bang", "=", "false", ";", "reportError", "(", "e", ")", ";", "if", "(", "e", "instanceof", "NoViableAltException", ")", "{", "NoViableAltException", "nvae", "=", "(", "NoViableAltException", ")", "e", ";", "if", "(", "pfx_AST", ".", "getLine", "(", ")", "==", "nvae", ".", "token", ".", "getLine", "(", ")", ")", "{", "consumeUntil", "(", "NLS", ")", ";", "}", "}", "}", "if", "(", "ale_AST", "!=", "null", "&&", "ifCbs_AST", "==", "null", ")", "{", "statement_AST", "=", "(", "AST", ")", "astFactory", ".", "make", "(", "(", "new", "ASTArray", "(", "4", ")", ")", ".", "add", "(", "create", "(", "LITERAL_if", ",", "\"if\"", ",", "first", ",", "LT", "(", "1", ")", ")", ")", ".", "add", "(", "ale_AST", ")", ".", "add", "(", "ifCbs_AST", ")", ".", "add", "(", "elseCbs_AST", ")", ")", ";", "bang", "=", "false", ";", "}", "if", "(", "bang", ")", "{", "throw", "e", ";", "}", "}", "else", "{", "throw", "e", ";", "}", "}", "returnAST", "=", "statement_AST", ";", "}", "public", "final", "void", "sep", "(", ")", "throws", "RecognitionException", ",", "TokenStreamException", "{", "returnAST", "=", "null", ";", "ASTPair", "currentAST", "=", "new", "ASTPair", "(", ")", ";", "AST", "sep_AST", "=", "null", ";", "switch", "(", "LA", "(", "1", ")", ")", "{", "case", "SEMI", ":", "{", "match", "(", "SEMI", ")", ";", "{", "_loop571", ":", "do", "{", "if", "(", "(", "LA", "(", "1", ")", "==", "NLS", ")", "&&", "(", "_tokenSet_24", ".", "member", "(", "LA", "(", "2", ")", ")", ")", ")", "{", "match", "(", "NLS", ")", ";", "}", "else", "{", "break", "_loop571", ";", "}", "}", "while", "(", "true", ")", ";", "}", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "sepToken", "=", "SEMI", ";", "}", "break", ";", "}", "case", "NLS", ":", "{", "match", "(", "NLS", ")", ";", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "sepToken", "=", "NLS", ";", "}", "{", "_loop575", ":", "do", "{", "if", "(", "(", "LA", "(", "1", ")", "==", "SEMI", ")", "&&", "(", "_tokenSet_24", ".", "member", "(", "LA", "(", "2", ")", ")", ")", ")", "{", "match", "(", "SEMI", ")", ";", "{", "_loop574", ":", "do", "{", "if", "(", "(", "LA", "(", "1", ")", "==", "NLS", ")", "&&", "(", "_tokenSet_24", ".", "member", "(", "LA", "(", "2", ")", ")", ")", ")", "{", "match", "(", "NLS", ")", ";", "}", "else", "{", "break", "_loop574", ";", "}", "}", "while", "(", "true", ")", ";", "}", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "sepToken", "=", "SEMI", ";", "}", "}", "else", "{", "break", "_loop575", ";", "}", "}", "while", "(", "true", ")", ";", "}", "break", ";", "}", "default", ":", "{", "throw", "new", "NoViableAltException", "(", "LT", "(", "1", ")", ",", "getFilename", "(", ")", ")", ";", "}", "}", "returnAST", "=", "sep_AST", ";", "}", "public", "final", "void", "snippetUnit", "(", ")", "throws", "RecognitionException", ",", "TokenStreamException", "{", "returnAST", "=", "null", ";", "ASTPair", "currentAST", "=", "new", "ASTPair", "(", ")", ";", "AST", "snippetUnit_AST", "=", "null", ";", "nls", "(", ")", ";", "blockBody", "(", "EOF", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "returnAST", ")", ";", "snippetUnit_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "returnAST", "=", "snippetUnit_AST", ";", "}", "public", "final", "void", "blockBody", "(", "int", "prevToken", ")", "throws", "RecognitionException", ",", "TokenStreamException", "{", "returnAST", "=", "null", ";", "ASTPair", "currentAST", "=", "new", "ASTPair", "(", ")", ";", "AST", "blockBody_AST", "=", "null", ";", "{", "switch", "(", "LA", "(", "1", ")", ")", "{", "case", "FINAL", ":", "case", "ABSTRACT", ":", "case", "STRICTFP", ":", "case", "LITERAL_import", ":", "case", "LITERAL_static", ":", "case", "LITERAL_def", ":", "case", "LBRACK", ":", "case", "IDENT", ":", "case", "STRING_LITERAL", ":", "case", "LPAREN", ":", "case", "LITERAL_class", ":", "case", "LITERAL_interface", ":", "case", "LITERAL_enum", ":", "case", "AT", ":", "case", "LITERAL_super", ":", "case", "LITERAL_void", ":", "case", "LITERAL_boolean", ":", "case", "LITERAL_byte", ":", "case", "LITERAL_char", ":", "case", "LITERAL_short", ":", "case", "LITERAL_int", ":", "case", "LITERAL_float", ":", "case", "LITERAL_long", ":", "case", "LITERAL_double", ":", "case", "LITERAL_private", ":", "case", "LITERAL_public", ":", "case", "LITERAL_protected", ":", "case", "LITERAL_transient", ":", "case", "LITERAL_native", ":", "case", "LITERAL_threadsafe", ":", "case", "LITERAL_synchronized", ":", "case", "LITERAL_volatile", ":", "case", "LCURLY", ":", "case", "LITERAL_this", ":", "case", "LITERAL_if", ":", "case", "LITERAL_while", ":", "case", "LITERAL_switch", ":", "case", "LITERAL_for", ":", "case", "LITERAL_return", ":", "case", "LITERAL_break", ":", "case", "LITERAL_continue", ":", "case", "LITERAL_throw", ":", "case", "LITERAL_assert", ":", "case", "PLUS", ":", "case", "MINUS", ":", "case", "LITERAL_try", ":", "case", "LITERAL_false", ":", "case", "LITERAL_new", ":", "case", "LITERAL_null", ":", "case", "LITERAL_true", ":", "case", "INC", ":", "case", "DEC", ":", "case", "BNOT", ":", "case", "LNOT", ":", "case", "STRING_CTOR_START", ":", "case", "NUM_INT", ":", "case", "NUM_FLOAT", ":", "case", "NUM_LONG", ":", "case", "NUM_DOUBLE", ":", "case", "NUM_BIG_INT", ":", "case", "NUM_BIG_DECIMAL", ":", "{", "statement", "(", "prevToken", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "returnAST", ")", ";", "break", ";", "}", "case", "EOF", ":", "case", "RCURLY", ":", "case", "SEMI", ":", "case", "NLS", ":", "{", "break", ";", "}", "default", ":", "{", "throw", "new", "NoViableAltException", "(", "LT", "(", "1", ")", ",", "getFilename", "(", ")", ")", ";", "}", "}", "}", "{", "_loop278", ":", "do", "{", "if", "(", "(", "LA", "(", "1", ")", "==", "SEMI", "||", "LA", "(", "1", ")", "==", "NLS", ")", ")", "{", "sep", "(", ")", ";", "{", "switch", "(", "LA", "(", "1", ")", ")", "{", "case", "FINAL", ":", "case", "ABSTRACT", ":", "case", "STRICTFP", ":", "case", "LITERAL_import", ":", "case", "LITERAL_static", ":", "case", "LITERAL_def", ":", "case", "LBRACK", ":", "case", "IDENT", ":", "case", "STRING_LITERAL", ":", "case", "LPAREN", ":", "case", "LITERAL_class", ":", "case", "LITERAL_interface", ":", "case", "LITERAL_enum", ":", "case", "AT", ":", "case", "LITERAL_super", ":", "case", "LITERAL_void", ":", "case", "LITERAL_boolean", ":", "case", "LITERAL_byte", ":", "case", "LITERAL_char", ":", "case", "LITERAL_short", ":", "case", "LITERAL_int", ":", "case", "LITERAL_float", ":", "case", "LITERAL_long", ":", "case", "LITERAL_double", ":", "case", "LITERAL_private", ":", "case", "LITERAL_public", ":", "case", "LITERAL_protected", ":", "case", "LITERAL_transient", ":", "case", "LITERAL_native", ":", "case", "LITERAL_threadsafe", ":", "case", "LITERAL_synchronized", ":", "case", "LITERAL_volatile", ":", "case", "LCURLY", ":", "case", "LITERAL_this", ":", "case", "LITERAL_if", ":", "case", "LITERAL_while", ":", "case", "LITERAL_switch", ":", "case", "LITERAL_for", ":", "case", "LITERAL_return", ":", "case", "LITERAL_break", ":", "case", "LITERAL_continue", ":", "case", "LITERAL_throw", ":", "case", "LITERAL_assert", ":", "case", "PLUS", ":", "case", "MINUS", ":", "case", "LITERAL_try", ":", "case", "LITERAL_false", ":", "case", "LITERAL_new", ":", "case", "LITERAL_null", ":", "case", "LITERAL_true", ":", "case", "INC", ":", "case", "DEC", ":", "case", "BNOT", ":", "case", "LNOT", ":", "case", "STRING_CTOR_START", ":", "case", "NUM_INT", ":", "case", "NUM_FLOAT", ":", "case", "NUM_LONG", ":", "case", "NUM_DOUBLE", ":", "case", "NUM_BIG_INT", ":", "case", "NUM_BIG_DECIMAL", ":", "{", "statement", "(", "sepToken", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "returnAST", ")", ";", "break", ";", "}", "case", "EOF", ":", "case", "RCURLY", ":", "case", "SEMI", ":", "case", "NLS", ":", "{", "break", ";", "}", "default", ":", "{", "throw", "new", "NoViableAltException", "(", "LT", "(", "1", ")", ",", "getFilename", "(", ")", ")", ";", "}", "}", "}", "}", "else", "{", "break", "_loop278", ";", "}", "}", "while", "(", "true", ")", ";", "}", "blockBody_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "returnAST", "=", "blockBody_AST", ";", "}", "public", "final", "void", "identifier", "(", ")", "throws", "RecognitionException", ",", "TokenStreamException", "{", "returnAST", "=", "null", ";", "ASTPair", "currentAST", "=", "new", "ASTPair", "(", ")", ";", "AST", "identifier_AST", "=", "null", ";", "Token", "i1", "=", "null", ";", "AST", "i1_AST", "=", "null", ";", "Token", "d", "=", "null", ";", "AST", "d_AST", "=", "null", ";", "Token", "i2", "=", "null", ";", "AST", "i2_AST", "=", "null", ";", "Token", "first", "=", "LT", "(", "1", ")", ";", "i1", "=", "LT", "(", "1", ")", ";", "i1_AST", "=", "astFactory", ".", "create", "(", "i1", ")", ";", "match", "(", "IDENT", ")", ";", "{", "_loop74", ":", "do", "{", "if", "(", "(", "LA", "(", "1", ")", "==", "DOT", ")", ")", "{", "d", "=", "LT", "(", "1", ")", ";", "d_AST", "=", "astFactory", ".", "create", "(", "d", ")", ";", "match", "(", "DOT", ")", ";", "nls", "(", ")", ";", "i2", "=", "LT", "(", "1", ")", ";", "i2_AST", "=", "astFactory", ".", "create", "(", "i2", ")", ";", "match", "(", "IDENT", ")", ";", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "i1_AST", "=", "(", "AST", ")", "astFactory", ".", "make", "(", "(", "new", "ASTArray", "(", "3", ")", ")", ".", "add", "(", "create", "(", "DOT", ",", "\".\"", ",", "first", ",", "LT", "(", "1", ")", ")", ")", ".", "add", "(", "i1_AST", ")", ".", "add", "(", "i2_AST", ")", ")", ";", "}", "}", "else", "{", "break", "_loop74", ";", "}", "}", "while", "(", "true", ")", ";", "}", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "identifier_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "identifier_AST", "=", "i1_AST", ";", "currentAST", ".", "root", "=", "identifier_AST", ";", "currentAST", ".", "child", "=", "identifier_AST", "!=", "null", "&&", "identifier_AST", ".", "getFirstChild", "(", ")", "!=", "null", "?", "identifier_AST", ".", "getFirstChild", "(", ")", ":", "identifier_AST", ";", "currentAST", ".", "advanceChildToEnd", "(", ")", ";", "}", "identifier_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "returnAST", "=", "identifier_AST", ";", "}", "public", "final", "void", "importStatement", "(", ")", "throws", "RecognitionException", ",", "TokenStreamException", "{", "returnAST", "=", "null", ";", "ASTPair", "currentAST", "=", "new", "ASTPair", "(", ")", ";", "AST", "importStatement_AST", "=", "null", ";", "AST", "an_AST", "=", "null", ";", "AST", "is_AST", "=", "null", ";", "Token", "first", "=", "LT", "(", "1", ")", ";", "boolean", "isStatic", "=", "false", ";", "annotationsOpt", "(", ")", ";", "an_AST", "=", "(", "AST", ")", "returnAST", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "returnAST", ")", ";", "match", "(", "LITERAL_import", ")", ";", "{", "switch", "(", "LA", "(", "1", ")", ")", "{", "case", "LITERAL_static", ":", "{", "match", "(", "LITERAL_static", ")", ";", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "isStatic", "=", "true", ";", "}", "break", ";", "}", "case", "EOF", ":", "case", "IDENT", ":", "case", "RCURLY", ":", "case", "SEMI", ":", "case", "LITERAL_default", ":", "case", "LITERAL_else", ":", "case", "LITERAL_case", ":", "case", "NLS", ":", "{", "break", ";", "}", "default", ":", "{", "throw", "new", "NoViableAltException", "(", "LT", "(", "1", ")", ",", "getFilename", "(", ")", ")", ";", "}", "}", "}", "{", "switch", "(", "LA", "(", "1", ")", ")", "{", "case", "IDENT", ":", "{", "identifierStar", "(", ")", ";", "is_AST", "=", "(", "AST", ")", "returnAST", ";", "break", ";", "}", "case", "EOF", ":", "case", "RCURLY", ":", "case", "SEMI", ":", "case", "LITERAL_default", ":", "case", "LITERAL_else", ":", "case", "LITERAL_case", ":", "case", "NLS", ":", "{", "break", ";", "}", "default", ":", "{", "throw", "new", "NoViableAltException", "(", "LT", "(", "1", ")", ",", "getFilename", "(", ")", ")", ";", "}", "}", "}", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "importStatement_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "if", "(", "isStatic", ")", "{", "if", "(", "is_AST", "==", "null", ")", "{", "reportError", "(", "\"\"", ",", "first", ")", ";", "importStatement_AST", "=", "(", "AST", ")", "astFactory", ".", "make", "(", "(", "new", "ASTArray", "(", "3", ")", ")", ".", "add", "(", "create", "(", "STATIC_IMPORT", ",", "\"\"", ",", "first", ",", "null", ")", ")", ".", "add", "(", "an_AST", ")", ".", "add", "(", "is_AST", ")", ")", ";", "}", "else", "{", "importStatement_AST", "=", "(", "AST", ")", "astFactory", ".", "make", "(", "(", "new", "ASTArray", "(", "3", ")", ")", ".", "add", "(", "create", "(", "STATIC_IMPORT", ",", "\"\"", ",", "first", ",", "LT", "(", "1", ")", ")", ")", ".", "add", "(", "an_AST", ")", ".", "add", "(", "is_AST", ")", ")", ";", "}", "}", "else", "{", "if", "(", "is_AST", "==", "null", ")", "{", "reportError", "(", "\"\"", ",", "LT", "(", "0", ")", ")", ";", "importStatement_AST", "=", "(", "AST", ")", "astFactory", ".", "make", "(", "(", "new", "ASTArray", "(", "3", ")", ")", ".", "add", "(", "create", "(", "IMPORT", ",", "\"import\"", ",", "first", ",", "null", ")", ")", ".", "add", "(", "an_AST", ")", ".", "add", "(", "is_AST", ")", ")", ";", "}", "else", "{", "importStatement_AST", "=", "(", "AST", ")", "astFactory", ".", "make", "(", "(", "new", "ASTArray", "(", "3", ")", ")", ".", "add", "(", "create", "(", "IMPORT", ",", "\"import\"", ",", "first", ",", "LT", "(", "1", ")", ")", ")", ".", "add", "(", "an_AST", ")", ".", "add", "(", "is_AST", ")", ")", ";", "}", "}", "currentAST", ".", "root", "=", "importStatement_AST", ";", "currentAST", ".", "child", "=", "importStatement_AST", "!=", "null", "&&", "importStatement_AST", ".", "getFirstChild", "(", ")", "!=", "null", "?", "importStatement_AST", ".", "getFirstChild", "(", ")", ":", "importStatement_AST", ";", "currentAST", ".", "advanceChildToEnd", "(", ")", ";", "}", "importStatement_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "returnAST", "=", "importStatement_AST", ";", "}", "public", "final", "void", "identifierStar", "(", ")", "throws", "RecognitionException", ",", "TokenStreamException", "{", "returnAST", "=", "null", ";", "ASTPair", "currentAST", "=", "new", "ASTPair", "(", ")", ";", "AST", "identifierStar_AST", "=", "null", ";", "Token", "i1", "=", "null", ";", "AST", "i1_AST", "=", "null", ";", "Token", "d1", "=", "null", ";", "AST", "d1_AST", "=", "null", ";", "Token", "i2", "=", "null", ";", "AST", "i2_AST", "=", "null", ";", "Token", "d2", "=", "null", ";", "AST", "d2_AST", "=", "null", ";", "Token", "s", "=", "null", ";", "AST", "s_AST", "=", "null", ";", "Token", "alias", "=", "null", ";", "AST", "alias_AST", "=", "null", ";", "Token", "first", "=", "LT", "(", "1", ")", ";", "int", "mark", "=", "mark", "(", ")", ";", "try", "{", "i1", "=", "LT", "(", "1", ")", ";", "i1_AST", "=", "astFactory", ".", "create", "(", "i1", ")", ";", "match", "(", "IDENT", ")", ";", "{", "_loop77", ":", "do", "{", "if", "(", "(", "LA", "(", "1", ")", "==", "DOT", ")", "&&", "(", "LA", "(", "2", ")", "==", "IDENT", "||", "LA", "(", "2", ")", "==", "NLS", ")", ")", "{", "d1", "=", "LT", "(", "1", ")", ";", "d1_AST", "=", "astFactory", ".", "create", "(", "d1", ")", ";", "match", "(", "DOT", ")", ";", "nls", "(", ")", ";", "i2", "=", "LT", "(", "1", ")", ";", "i2_AST", "=", "astFactory", ".", "create", "(", "i2", ")", ";", "match", "(", "IDENT", ")", ";", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "i1_AST", "=", "(", "AST", ")", "astFactory", ".", "make", "(", "(", "new", "ASTArray", "(", "3", ")", ")", ".", "add", "(", "create", "(", "DOT", ",", "\".\"", ",", "first", ",", "LT", "(", "1", ")", ")", ")", ".", "add", "(", "i1_AST", ")", ".", "add", "(", "i2_AST", ")", ")", ";", "}", "}", "else", "{", "break", "_loop77", ";", "}", "}", "while", "(", "true", ")", ";", "}", "{", "switch", "(", "LA", "(", "1", ")", ")", "{", "case", "DOT", ":", "{", "d2", "=", "LT", "(", "1", ")", ";", "d2_AST", "=", "astFactory", ".", "create", "(", "d2", ")", ";", "match", "(", "DOT", ")", ";", "nls", "(", ")", ";", "s", "=", "LT", "(", "1", ")", ";", "s_AST", "=", "astFactory", ".", "create", "(", "s", ")", ";", "match", "(", "STAR", ")", ";", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "i1_AST", "=", "(", "AST", ")", "astFactory", ".", "make", "(", "(", "new", "ASTArray", "(", "3", ")", ")", ".", "add", "(", "create", "(", "DOT", ",", "\".\"", ",", "first", ",", "LT", "(", "1", ")", ")", ")", ".", "add", "(", "i1_AST", ")", ".", "add", "(", "s_AST", ")", ")", ";", "}", "break", ";", "}", "case", "LITERAL_as", ":", "{", "match", "(", "LITERAL_as", ")", ";", "nls", "(", ")", ";", "alias", "=", "LT", "(", "1", ")", ";", "alias_AST", "=", "astFactory", ".", "create", "(", "alias", ")", ";", "match", "(", "IDENT", ")", ";", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "i1_AST", "=", "(", "AST", ")", "astFactory", ".", "make", "(", "(", "new", "ASTArray", "(", "3", ")", ")", ".", "add", "(", "create", "(", "LITERAL_as", ",", "\"as\"", ",", "first", ",", "LT", "(", "1", ")", ")", ")", ".", "add", "(", "i1_AST", ")", ".", "add", "(", "alias_AST", ")", ")", ";", "}", "break", ";", "}", "case", "EOF", ":", "case", "RCURLY", ":", "case", "SEMI", ":", "case", "LITERAL_default", ":", "case", "LITERAL_else", ":", "case", "LITERAL_case", ":", "case", "NLS", ":", "{", "break", ";", "}", "default", ":", "{", "throw", "new", "NoViableAltException", "(", "LT", "(", "1", ")", ",", "getFilename", "(", ")", ")", ";", "}", "}", "}", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "identifierStar_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "identifierStar_AST", "=", "i1_AST", ";", "currentAST", ".", "root", "=", "identifierStar_AST", ";", "currentAST", ".", "child", "=", "identifierStar_AST", "!=", "null", "&&", "identifierStar_AST", ".", "getFirstChild", "(", ")", "!=", "null", "?", "identifierStar_AST", ".", "getFirstChild", "(", ")", ":", "identifierStar_AST", ";", "currentAST", ".", "advanceChildToEnd", "(", ")", ";", "}", "identifierStar_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "}", "catch", "(", "RecognitionException", "e", ")", "{", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "reportError", "(", "\"\"", ",", "first", ")", ";", "identifierStar_AST", "=", "(", "AST", ")", "astFactory", ".", "make", "(", "(", "new", "ASTArray", "(", "3", ")", ")", ".", "add", "(", "create", "(", "DOT", ",", "\".\"", ",", "first", ",", "LT", "(", "1", ")", ")", ")", ".", "add", "(", "i1_AST", ")", ".", "add", "(", "(", "AST", ")", "astFactory", ".", "make", "(", "(", "new", "ASTArray", "(", "1", ")", ")", ".", "add", "(", "create", "(", "STAR", ",", "\"*\"", ",", "null", ")", ")", ")", ")", ")", ";", "rewind", "(", "mark", ")", ";", "consumeUntil", "(", "NLS", ")", ";", "}", "else", "{", "throw", "e", ";", "}", "}", "returnAST", "=", "identifierStar_AST", ";", "}", "protected", "final", "void", "typeDefinitionInternal", "(", "AST", "mods", ")", "throws", "RecognitionException", ",", "TokenStreamException", "{", "returnAST", "=", "null", ";", "ASTPair", "currentAST", "=", "new", "ASTPair", "(", ")", ";", "AST", "typeDefinitionInternal_AST", "=", "null", ";", "AST", "cd_AST", "=", "null", ";", "AST", "id_AST", "=", "null", ";", "AST", "ed_AST", "=", "null", ";", "AST", "ad_AST", "=", "null", ";", "switch", "(", "LA", "(", "1", ")", ")", "{", "case", "LITERAL_class", ":", "{", "classDefinition", "(", "mods", ")", ";", "cd_AST", "=", "(", "AST", ")", "returnAST", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "returnAST", ")", ";", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "typeDefinitionInternal_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "typeDefinitionInternal_AST", "=", "cd_AST", ";", "currentAST", ".", "root", "=", "typeDefinitionInternal_AST", ";", "currentAST", ".", "child", "=", "typeDefinitionInternal_AST", "!=", "null", "&&", "typeDefinitionInternal_AST", ".", "getFirstChild", "(", ")", "!=", "null", "?", "typeDefinitionInternal_AST", ".", "getFirstChild", "(", ")", ":", "typeDefinitionInternal_AST", ";", "currentAST", ".", "advanceChildToEnd", "(", ")", ";", "}", "typeDefinitionInternal_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "break", ";", "}", "case", "LITERAL_interface", ":", "{", "interfaceDefinition", "(", "mods", ")", ";", "id_AST", "=", "(", "AST", ")", "returnAST", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "returnAST", ")", ";", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "typeDefinitionInternal_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "typeDefinitionInternal_AST", "=", "id_AST", ";", "currentAST", ".", "root", "=", "typeDefinitionInternal_AST", ";", "currentAST", ".", "child", "=", "typeDefinitionInternal_AST", "!=", "null", "&&", "typeDefinitionInternal_AST", ".", "getFirstChild", "(", ")", "!=", "null", "?", "typeDefinitionInternal_AST", ".", "getFirstChild", "(", ")", ":", "typeDefinitionInternal_AST", ";", "currentAST", ".", "advanceChildToEnd", "(", ")", ";", "}", "typeDefinitionInternal_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "break", ";", "}", "case", "LITERAL_enum", ":", "{", "enumDefinition", "(", "mods", ")", ";", "ed_AST", "=", "(", "AST", ")", "returnAST", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "returnAST", ")", ";", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "typeDefinitionInternal_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "typeDefinitionInternal_AST", "=", "ed_AST", ";", "currentAST", ".", "root", "=", "typeDefinitionInternal_AST", ";", "currentAST", ".", "child", "=", "typeDefinitionInternal_AST", "!=", "null", "&&", "typeDefinitionInternal_AST", ".", "getFirstChild", "(", ")", "!=", "null", "?", "typeDefinitionInternal_AST", ".", "getFirstChild", "(", ")", ":", "typeDefinitionInternal_AST", ";", "currentAST", ".", "advanceChildToEnd", "(", ")", ";", "}", "typeDefinitionInternal_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "break", ";", "}", "case", "AT", ":", "{", "annotationDefinition", "(", "mods", ")", ";", "ad_AST", "=", "(", "AST", ")", "returnAST", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "returnAST", ")", ";", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "typeDefinitionInternal_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "typeDefinitionInternal_AST", "=", "ad_AST", ";", "currentAST", ".", "root", "=", "typeDefinitionInternal_AST", ";", "currentAST", ".", "child", "=", "typeDefinitionInternal_AST", "!=", "null", "&&", "typeDefinitionInternal_AST", ".", "getFirstChild", "(", ")", "!=", "null", "?", "typeDefinitionInternal_AST", ".", "getFirstChild", "(", ")", ":", "typeDefinitionInternal_AST", ";", "currentAST", ".", "advanceChildToEnd", "(", ")", ";", "}", "typeDefinitionInternal_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "break", ";", "}", "default", ":", "{", "throw", "new", "NoViableAltException", "(", "LT", "(", "1", ")", ",", "getFilename", "(", ")", ")", ";", "}", "}", "returnAST", "=", "typeDefinitionInternal_AST", ";", "}", "public", "final", "void", "classDefinition", "(", "AST", "modifiers", ")", "throws", "RecognitionException", ",", "TokenStreamException", "{", "returnAST", "=", "null", ";", "ASTPair", "currentAST", "=", "new", "ASTPair", "(", ")", ";", "AST", "classDefinition_AST", "=", "null", ";", "AST", "tp_AST", "=", "null", ";", "AST", "sc_AST", "=", "null", ";", "AST", "ic_AST", "=", "null", ";", "AST", "cb_AST", "=", "null", ";", "Token", "first", "=", "cloneToken", "(", "LT", "(", "1", ")", ")", ";", "AST", "prevCurrentClass", "=", "currentClass", ";", "if", "(", "modifiers", "!=", "null", ")", "{", "first", ".", "setLine", "(", "modifiers", ".", "getLine", "(", ")", ")", ";", "first", ".", "setColumn", "(", "modifiers", ".", "getColumn", "(", ")", ")", ";", "}", "match", "(", "LITERAL_class", ")", ";", "AST", "tmp29_AST", "=", "null", ";", "tmp29_AST", "=", "astFactory", ".", "create", "(", "LT", "(", "1", ")", ")", ";", "match", "(", "IDENT", ")", ";", "nls", "(", ")", ";", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "currentClass", "=", "tmp29_AST", ";", "}", "{", "switch", "(", "LA", "(", "1", ")", ")", "{", "case", "LT", ":", "{", "typeParameters", "(", ")", ";", "tp_AST", "=", "(", "AST", ")", "returnAST", ";", "nls", "(", ")", ";", "break", ";", "}", "case", "EOF", ":", "case", "LITERAL_extends", ":", "case", "LCURLY", ":", "case", "RCURLY", ":", "case", "SEMI", ":", "case", "LITERAL_default", ":", "case", "LITERAL_implements", ":", "case", "LITERAL_else", ":", "case", "LITERAL_case", ":", "case", "NLS", ":", "{", "break", ";", "}", "default", ":", "{", "throw", "new", "NoViableAltException", "(", "LT", "(", "1", ")", ",", "getFilename", "(", ")", ")", ";", "}", "}", "}", "superClassClause", "(", ")", ";", "sc_AST", "=", "(", "AST", ")", "returnAST", ";", "implementsClause", "(", ")", ";", "ic_AST", "=", "(", "AST", ")", "returnAST", ";", "{", "switch", "(", "LA", "(", "1", ")", ")", "{", "case", "LCURLY", ":", "{", "classBlock", "(", ")", ";", "cb_AST", "=", "(", "AST", ")", "returnAST", ";", "break", ";", "}", "case", "EOF", ":", "case", "RCURLY", ":", "case", "SEMI", ":", "case", "LITERAL_default", ":", "case", "LITERAL_else", ":", "case", "LITERAL_case", ":", "case", "NLS", ":", "{", "break", ";", "}", "default", ":", "{", "throw", "new", "NoViableAltException", "(", "LT", "(", "1", ")", ",", "getFilename", "(", ")", ")", ";", "}", "}", "}", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "classDefinition_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "if", "(", "cb_AST", "!=", "null", ")", "{", "classDefinition_AST", "=", "(", "AST", ")", "astFactory", ".", "make", "(", "(", "new", "ASTArray", "(", "7", ")", ")", ".", "add", "(", "create", "(", "CLASS_DEF", ",", "\"CLASS_DEF\"", ",", "first", ",", "LT", "(", "1", ")", ")", ")", ".", "add", "(", "modifiers", ")", ".", "add", "(", "tmp29_AST", ")", ".", "add", "(", "tp_AST", ")", ".", "add", "(", "sc_AST", ")", ".", "add", "(", "ic_AST", ")", ".", "add", "(", "cb_AST", ")", ")", ";", "}", "else", "{", "reportError", "(", "\"\"", ",", "LT", "(", "1", ")", ")", ";", "classDefinition_AST", "=", "(", "AST", ")", "astFactory", ".", "make", "(", "(", "new", "ASTArray", "(", "7", ")", ")", ".", "add", "(", "create", "(", "CLASS_DEF", ",", "\"CLASS_DEF\"", ",", "first", ",", "LT", "(", "1", ")", ")", ")", ".", "add", "(", "modifiers", ")", ".", "add", "(", "tmp29_AST", ")", ".", "add", "(", "tp_AST", ")", ".", "add", "(", "sc_AST", ")", ".", "add", "(", "ic_AST", ")", ".", "add", "(", "null", ")", ")", ";", "}", "currentAST", ".", "root", "=", "classDefinition_AST", ";", "currentAST", ".", "child", "=", "classDefinition_AST", "!=", "null", "&&", "classDefinition_AST", ".", "getFirstChild", "(", ")", "!=", "null", "?", "classDefinition_AST", ".", "getFirstChild", "(", ")", ":", "classDefinition_AST", ";", "currentAST", ".", "advanceChildToEnd", "(", ")", ";", "}", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "currentClass", "=", "prevCurrentClass", ";", "}", "returnAST", "=", "classDefinition_AST", ";", "}", "public", "final", "void", "interfaceDefinition", "(", "AST", "modifiers", ")", "throws", "RecognitionException", ",", "TokenStreamException", "{", "returnAST", "=", "null", ";", "ASTPair", "currentAST", "=", "new", "ASTPair", "(", ")", ";", "AST", "interfaceDefinition_AST", "=", "null", ";", "AST", "tp_AST", "=", "null", ";", "AST", "ie_AST", "=", "null", ";", "AST", "ib_AST", "=", "null", ";", "Token", "first", "=", "cloneToken", "(", "LT", "(", "1", ")", ")", ";", "if", "(", "modifiers", "!=", "null", ")", "{", "first", ".", "setLine", "(", "modifiers", ".", "getLine", "(", ")", ")", ";", "first", ".", "setColumn", "(", "modifiers", ".", "getColumn", "(", ")", ")", ";", "}", "match", "(", "LITERAL_interface", ")", ";", "AST", "tmp31_AST", "=", "null", ";", "tmp31_AST", "=", "astFactory", ".", "create", "(", "LT", "(", "1", ")", ")", ";", "match", "(", "IDENT", ")", ";", "nls", "(", ")", ";", "{", "switch", "(", "LA", "(", "1", ")", ")", "{", "case", "LT", ":", "{", "typeParameters", "(", ")", ";", "tp_AST", "=", "(", "AST", ")", "returnAST", ";", "nls", "(", ")", ";", "break", ";", "}", "case", "LITERAL_extends", ":", "case", "LCURLY", ":", "{", "break", ";", "}", "default", ":", "{", "throw", "new", "NoViableAltException", "(", "LT", "(", "1", ")", ",", "getFilename", "(", ")", ")", ";", "}", "}", "}", "interfaceExtends", "(", ")", ";", "ie_AST", "=", "(", "AST", ")", "returnAST", ";", "interfaceBlock", "(", ")", ";", "ib_AST", "=", "(", "AST", ")", "returnAST", ";", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "interfaceDefinition_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "interfaceDefinition_AST", "=", "(", "AST", ")", "astFactory", ".", "make", "(", "(", "new", "ASTArray", "(", "6", ")", ")", ".", "add", "(", "create", "(", "INTERFACE_DEF", ",", "\"\"", ",", "first", ",", "LT", "(", "1", ")", ")", ")", ".", "add", "(", "modifiers", ")", ".", "add", "(", "tmp31_AST", ")", ".", "add", "(", "tp_AST", ")", ".", "add", "(", "ie_AST", ")", ".", "add", "(", "ib_AST", ")", ")", ";", "currentAST", ".", "root", "=", "interfaceDefinition_AST", ";", "currentAST", ".", "child", "=", "interfaceDefinition_AST", "!=", "null", "&&", "interfaceDefinition_AST", ".", "getFirstChild", "(", ")", "!=", "null", "?", "interfaceDefinition_AST", ".", "getFirstChild", "(", ")", ":", "interfaceDefinition_AST", ";", "currentAST", ".", "advanceChildToEnd", "(", ")", ";", "}", "returnAST", "=", "interfaceDefinition_AST", ";", "}", "public", "final", "void", "enumDefinition", "(", "AST", "modifiers", ")", "throws", "RecognitionException", ",", "TokenStreamException", "{", "returnAST", "=", "null", ";", "ASTPair", "currentAST", "=", "new", "ASTPair", "(", ")", ";", "AST", "enumDefinition_AST", "=", "null", ";", "AST", "ic_AST", "=", "null", ";", "AST", "eb_AST", "=", "null", ";", "Token", "first", "=", "cloneToken", "(", "LT", "(", "1", ")", ")", ";", "AST", "prevCurrentClass", "=", "currentClass", ";", "if", "(", "modifiers", "!=", "null", ")", "{", "first", ".", "setLine", "(", "modifiers", ".", "getLine", "(", ")", ")", ";", "first", ".", "setColumn", "(", "modifiers", ".", "getColumn", "(", ")", ")", ";", "}", "match", "(", "LITERAL_enum", ")", ";", "AST", "tmp33_AST", "=", "null", ";", "tmp33_AST", "=", "astFactory", ".", "create", "(", "LT", "(", "1", ")", ")", ";", "match", "(", "IDENT", ")", ";", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "currentClass", "=", "tmp33_AST", ";", "}", "nls", "(", ")", ";", "implementsClause", "(", ")", ";", "ic_AST", "=", "(", "AST", ")", "returnAST", ";", "nls", "(", ")", ";", "enumBlock", "(", ")", ";", "eb_AST", "=", "(", "AST", ")", "returnAST", ";", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "enumDefinition_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "enumDefinition_AST", "=", "(", "AST", ")", "astFactory", ".", "make", "(", "(", "new", "ASTArray", "(", "5", ")", ")", ".", "add", "(", "create", "(", "ENUM_DEF", ",", "\"ENUM_DEF\"", ",", "first", ",", "LT", "(", "1", ")", ")", ")", ".", "add", "(", "modifiers", ")", ".", "add", "(", "tmp33_AST", ")", ".", "add", "(", "ic_AST", ")", ".", "add", "(", "eb_AST", ")", ")", ";", "currentAST", ".", "root", "=", "enumDefinition_AST", ";", "currentAST", ".", "child", "=", "enumDefinition_AST", "!=", "null", "&&", "enumDefinition_AST", ".", "getFirstChild", "(", ")", "!=", "null", "?", "enumDefinition_AST", ".", "getFirstChild", "(", ")", ":", "enumDefinition_AST", ";", "currentAST", ".", "advanceChildToEnd", "(", ")", ";", "}", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "currentClass", "=", "prevCurrentClass", ";", "}", "returnAST", "=", "enumDefinition_AST", ";", "}", "public", "final", "void", "annotationDefinition", "(", "AST", "modifiers", ")", "throws", "RecognitionException", ",", "TokenStreamException", "{", "returnAST", "=", "null", ";", "ASTPair", "currentAST", "=", "new", "ASTPair", "(", ")", ";", "AST", "annotationDefinition_AST", "=", "null", ";", "AST", "ab_AST", "=", "null", ";", "Token", "first", "=", "cloneToken", "(", "LT", "(", "1", ")", ")", ";", "if", "(", "modifiers", "!=", "null", ")", "{", "first", ".", "setLine", "(", "modifiers", ".", "getLine", "(", ")", ")", ";", "first", ".", "setColumn", "(", "modifiers", ".", "getColumn", "(", ")", ")", ";", "}", "AST", "tmp34_AST", "=", "null", ";", "tmp34_AST", "=", "astFactory", ".", "create", "(", "LT", "(", "1", ")", ")", ";", "match", "(", "AT", ")", ";", "match", "(", "LITERAL_interface", ")", ";", "AST", "tmp36_AST", "=", "null", ";", "tmp36_AST", "=", "astFactory", ".", "create", "(", "LT", "(", "1", ")", ")", ";", "match", "(", "IDENT", ")", ";", "annotationBlock", "(", ")", ";", "ab_AST", "=", "(", "AST", ")", "returnAST", ";", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "annotationDefinition_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "annotationDefinition_AST", "=", "(", "AST", ")", "astFactory", ".", "make", "(", "(", "new", "ASTArray", "(", "4", ")", ")", ".", "add", "(", "create", "(", "ANNOTATION_DEF", ",", "\"\"", ",", "first", ",", "LT", "(", "1", ")", ")", ")", ".", "add", "(", "modifiers", ")", ".", "add", "(", "tmp36_AST", ")", ".", "add", "(", "ab_AST", ")", ")", ";", "currentAST", ".", "root", "=", "annotationDefinition_AST", ";", "currentAST", ".", "child", "=", "annotationDefinition_AST", "!=", "null", "&&", "annotationDefinition_AST", ".", "getFirstChild", "(", ")", "!=", "null", "?", "annotationDefinition_AST", ".", "getFirstChild", "(", ")", ":", "annotationDefinition_AST", ";", "currentAST", ".", "advanceChildToEnd", "(", ")", ";", "}", "returnAST", "=", "annotationDefinition_AST", ";", "}", "public", "final", "void", "declaration", "(", ")", "throws", "RecognitionException", ",", "TokenStreamException", "{", "returnAST", "=", "null", ";", "ASTPair", "currentAST", "=", "new", "ASTPair", "(", ")", ";", "AST", "declaration_AST", "=", "null", ";", "AST", "m_AST", "=", "null", ";", "AST", "t_AST", "=", "null", ";", "AST", "v_AST", "=", "null", ";", "AST", "t2_AST", "=", "null", ";", "AST", "v2_AST", "=", "null", ";", "switch", "(", "LA", "(", "1", ")", ")", "{", "case", "FINAL", ":", "case", "ABSTRACT", ":", "case", "STRICTFP", ":", "case", "LITERAL_static", ":", "case", "LITERAL_def", ":", "case", "AT", ":", "case", "LITERAL_private", ":", "case", "LITERAL_public", ":", "case", "LITERAL_protected", ":", "case", "LITERAL_transient", ":", "case", "LITERAL_native", ":", "case", "LITERAL_threadsafe", ":", "case", "LITERAL_synchronized", ":", "case", "LITERAL_volatile", ":", "{", "modifiers", "(", ")", ";", "m_AST", "=", "(", "AST", ")", "returnAST", ";", "{", "if", "(", "(", "_tokenSet_25", ".", "member", "(", "LA", "(", "1", ")", ")", ")", "&&", "(", "_tokenSet_26", ".", "member", "(", "LA", "(", "2", ")", ")", ")", ")", "{", "typeSpec", "(", "false", ")", ";", "t_AST", "=", "(", "AST", ")", "returnAST", ";", "}", "else", "if", "(", "(", "LA", "(", "1", ")", "==", "IDENT", "||", "LA", "(", "1", ")", "==", "STRING_LITERAL", ")", "&&", "(", "_tokenSet_27", ".", "member", "(", "LA", "(", "2", ")", ")", ")", ")", "{", "}", "else", "{", "throw", "new", "NoViableAltException", "(", "LT", "(", "1", ")", ",", "getFilename", "(", ")", ")", ";", "}", "}", "variableDefinitions", "(", "m_AST", ",", "t_AST", ")", ";", "v_AST", "=", "(", "AST", ")", "returnAST", ";", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "declaration_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "declaration_AST", "=", "v_AST", ";", "currentAST", ".", "root", "=", "declaration_AST", ";", "currentAST", ".", "child", "=", "declaration_AST", "!=", "null", "&&", "declaration_AST", ".", "getFirstChild", "(", ")", "!=", "null", "?", "declaration_AST", ".", "getFirstChild", "(", ")", ":", "declaration_AST", ";", "currentAST", ".", "advanceChildToEnd", "(", ")", ";", "}", "break", ";", "}", "case", "IDENT", ":", "case", "LITERAL_void", ":", "case", "LITERAL_boolean", ":", "case", "LITERAL_byte", ":", "case", "LITERAL_char", ":", "case", "LITERAL_short", ":", "case", "LITERAL_int", ":", "case", "LITERAL_float", ":", "case", "LITERAL_long", ":", "case", "LITERAL_double", ":", "{", "typeSpec", "(", "false", ")", ";", "t2_AST", "=", "(", "AST", ")", "returnAST", ";", "variableDefinitions", "(", "null", ",", "t2_AST", ")", ";", "v2_AST", "=", "(", "AST", ")", "returnAST", ";", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "declaration_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "declaration_AST", "=", "v2_AST", ";", "currentAST", ".", "root", "=", "declaration_AST", ";", "currentAST", ".", "child", "=", "declaration_AST", "!=", "null", "&&", "declaration_AST", ".", "getFirstChild", "(", ")", "!=", "null", "?", "declaration_AST", ".", "getFirstChild", "(", ")", ":", "declaration_AST", ";", "currentAST", ".", "advanceChildToEnd", "(", ")", ";", "}", "break", ";", "}", "default", ":", "{", "throw", "new", "NoViableAltException", "(", "LT", "(", "1", ")", ",", "getFilename", "(", ")", ")", ";", "}", "}", "returnAST", "=", "declaration_AST", ";", "}", "public", "final", "void", "modifiers", "(", ")", "throws", "RecognitionException", ",", "TokenStreamException", "{", "returnAST", "=", "null", ";", "ASTPair", "currentAST", "=", "new", "ASTPair", "(", ")", ";", "AST", "modifiers_AST", "=", "null", ";", "Token", "first", "=", "LT", "(", "1", ")", ";", "modifiersInternal", "(", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "returnAST", ")", ";", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "modifiers_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "modifiers_AST", "=", "(", "AST", ")", "astFactory", ".", "make", "(", "(", "new", "ASTArray", "(", "2", ")", ")", ".", "add", "(", "create", "(", "MODIFIERS", ",", "\"MODIFIERS\"", ",", "first", ",", "LT", "(", "1", ")", ")", ")", ".", "add", "(", "modifiers_AST", ")", ")", ";", "currentAST", ".", "root", "=", "modifiers_AST", ";", "currentAST", ".", "child", "=", "modifiers_AST", "!=", "null", "&&", "modifiers_AST", ".", "getFirstChild", "(", ")", "!=", "null", "?", "modifiers_AST", ".", "getFirstChild", "(", ")", ":", "modifiers_AST", ";", "currentAST", ".", "advanceChildToEnd", "(", ")", ";", "}", "modifiers_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "returnAST", "=", "modifiers_AST", ";", "}", "public", "final", "void", "typeSpec", "(", "boolean", "addImagNode", ")", "throws", "RecognitionException", ",", "TokenStreamException", "{", "returnAST", "=", "null", ";", "ASTPair", "currentAST", "=", "new", "ASTPair", "(", ")", ";", "AST", "typeSpec_AST", "=", "null", ";", "switch", "(", "LA", "(", "1", ")", ")", "{", "case", "IDENT", ":", "{", "classTypeSpec", "(", "addImagNode", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "returnAST", ")", ";", "typeSpec_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "break", ";", "}", "case", "LITERAL_void", ":", "case", "LITERAL_boolean", ":", "case", "LITERAL_byte", ":", "case", "LITERAL_char", ":", "case", "LITERAL_short", ":", "case", "LITERAL_int", ":", "case", "LITERAL_float", ":", "case", "LITERAL_long", ":", "case", "LITERAL_double", ":", "{", "builtInTypeSpec", "(", "addImagNode", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "returnAST", ")", ";", "typeSpec_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "break", ";", "}", "default", ":", "{", "throw", "new", "NoViableAltException", "(", "LT", "(", "1", ")", ",", "getFilename", "(", ")", ")", ";", "}", "}", "returnAST", "=", "typeSpec_AST", ";", "}", "public", "final", "void", "variableDefinitions", "(", "AST", "mods", ",", "AST", "t", ")", "throws", "RecognitionException", ",", "TokenStreamException", "{", "returnAST", "=", "null", ";", "ASTPair", "currentAST", "=", "new", "ASTPair", "(", ")", ";", "AST", "variableDefinitions_AST", "=", "null", ";", "Token", "id", "=", "null", ";", "AST", "id_AST", "=", "null", ";", "Token", "qid", "=", "null", ";", "AST", "qid_AST", "=", "null", ";", "AST", "param_AST", "=", "null", ";", "AST", "tc_AST", "=", "null", ";", "AST", "mb_AST", "=", "null", ";", "Token", "first", "=", "cloneToken", "(", "LT", "(", "1", ")", ")", ";", "if", "(", "mods", "!=", "null", ")", "{", "first", ".", "setLine", "(", "mods", ".", "getLine", "(", ")", ")", ";", "first", ".", "setColumn", "(", "mods", ".", "getColumn", "(", ")", ")", ";", "}", "else", "if", "(", "t", "!=", "null", ")", "{", "first", ".", "setLine", "(", "t", ".", "getLine", "(", ")", ")", ";", "first", ".", "setColumn", "(", "t", ".", "getColumn", "(", ")", ")", ";", "}", "if", "(", "(", "LA", "(", "1", ")", "==", "IDENT", ")", "&&", "(", "_tokenSet_28", ".", "member", "(", "LA", "(", "2", ")", ")", ")", ")", "{", "listOfVariables", "(", "mods", ",", "t", ",", "first", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "returnAST", ")", ";", "variableDefinitions_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "}", "else", "if", "(", "(", "LA", "(", "1", ")", "==", "IDENT", "||", "LA", "(", "1", ")", "==", "STRING_LITERAL", ")", "&&", "(", "LA", "(", "2", ")", "==", "LPAREN", ")", ")", "{", "{", "switch", "(", "LA", "(", "1", ")", ")", "{", "case", "IDENT", ":", "{", "id", "=", "LT", "(", "1", ")", ";", "id_AST", "=", "astFactory", ".", "create", "(", "id", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "id_AST", ")", ";", "match", "(", "IDENT", ")", ";", "break", ";", "}", "case", "STRING_LITERAL", ":", "{", "qid", "=", "LT", "(", "1", ")", ";", "qid_AST", "=", "astFactory", ".", "create", "(", "qid", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "qid_AST", ")", ";", "match", "(", "STRING_LITERAL", ")", ";", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "qid_AST", ".", "setType", "(", "IDENT", ")", ";", "}", "break", ";", "}", "default", ":", "{", "throw", "new", "NoViableAltException", "(", "LT", "(", "1", ")", ",", "getFilename", "(", ")", ")", ";", "}", "}", "}", "match", "(", "LPAREN", ")", ";", "parameterDeclarationList", "(", ")", ";", "param_AST", "=", "(", "AST", ")", "returnAST", ";", "match", "(", "RPAREN", ")", ";", "{", "boolean", "synPredMatched236", "=", "false", ";", "if", "(", "(", "(", "LA", "(", "1", ")", "==", "LITERAL_throws", "||", "LA", "(", "1", ")", "==", "NLS", ")", "&&", "(", "_tokenSet_29", ".", "member", "(", "LA", "(", "2", ")", ")", ")", ")", ")", "{", "int", "_m236", "=", "mark", "(", ")", ";", "synPredMatched236", "=", "true", ";", "inputState", ".", "guessing", "++", ";", "try", "{", "{", "nls", "(", ")", ";", "match", "(", "LITERAL_throws", ")", ";", "}", "}", "catch", "(", "RecognitionException", "pe", ")", "{", "synPredMatched236", "=", "false", ";", "}", "rewind", "(", "_m236", ")", ";", "inputState", ".", "guessing", "--", ";", "}", "if", "(", "synPredMatched236", ")", "{", "throwsClause", "(", ")", ";", "tc_AST", "=", "(", "AST", ")", "returnAST", ";", "}", "else", "if", "(", "(", "_tokenSet_30", ".", "member", "(", "LA", "(", "1", ")", ")", ")", "&&", "(", "_tokenSet_12", ".", "member", "(", "LA", "(", "2", ")", ")", ")", ")", "{", "}", "else", "{", "throw", "new", "NoViableAltException", "(", "LT", "(", "1", ")", ",", "getFilename", "(", ")", ")", ";", "}", "}", "{", "boolean", "synPredMatched239", "=", "false", ";", "if", "(", "(", "(", "LA", "(", "1", ")", "==", "LCURLY", "||", "LA", "(", "1", ")", "==", "NLS", ")", "&&", "(", "_tokenSet_31", ".", "member", "(", "LA", "(", "2", ")", ")", ")", ")", ")", "{", "int", "_m239", "=", "mark", "(", ")", ";", "synPredMatched239", "=", "true", ";", "inputState", ".", "guessing", "++", ";", "try", "{", "{", "nls", "(", ")", ";", "match", "(", "LCURLY", ")", ";", "}", "}", "catch", "(", "RecognitionException", "pe", ")", "{", "synPredMatched239", "=", "false", ";", "}", "rewind", "(", "_m239", ")", ";", "inputState", ".", "guessing", "--", ";", "}", "if", "(", "synPredMatched239", ")", "{", "{", "nlsWarn", "(", ")", ";", "openBlock", "(", ")", ";", "mb_AST", "=", "(", "AST", ")", "returnAST", ";", "}", "}", "else", "if", "(", "(", "_tokenSet_11", ".", "member", "(", "LA", "(", "1", ")", ")", ")", "&&", "(", "_tokenSet_12", ".", "member", "(", "LA", "(", "2", ")", ")", ")", ")", "{", "}", "else", "{", "throw", "new", "NoViableAltException", "(", "LT", "(", "1", ")", ",", "getFilename", "(", ")", ")", ";", "}", "}", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "variableDefinitions_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "if", "(", "qid_AST", "!=", "null", ")", "id_AST", "=", "qid_AST", ";", "variableDefinitions_AST", "=", "(", "AST", ")", "astFactory", ".", "make", "(", "(", "new", "ASTArray", "(", "7", ")", ")", ".", "add", "(", "create", "(", "METHOD_DEF", ",", "\"METHOD_DEF\"", ",", "first", ",", "LT", "(", "1", ")", ")", ")", ".", "add", "(", "mods", ")", ".", "add", "(", "(", "AST", ")", "astFactory", ".", "make", "(", "(", "new", "ASTArray", "(", "2", ")", ")", ".", "add", "(", "create", "(", "TYPE", ",", "\"TYPE\"", ",", "first", ",", "LT", "(", "1", ")", ")", ")", ".", "add", "(", "t", ")", ")", ")", ".", "add", "(", "id_AST", ")", ".", "add", "(", "param_AST", ")", ".", "add", "(", "tc_AST", ")", ".", "add", "(", "mb_AST", ")", ")", ";", "currentAST", ".", "root", "=", "variableDefinitions_AST", ";", "currentAST", ".", "child", "=", "variableDefinitions_AST", "!=", "null", "&&", "variableDefinitions_AST", ".", "getFirstChild", "(", ")", "!=", "null", "?", "variableDefinitions_AST", ".", "getFirstChild", "(", ")", ":", "variableDefinitions_AST", ";", "currentAST", ".", "advanceChildToEnd", "(", ")", ";", "}", "variableDefinitions_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "}", "else", "{", "throw", "new", "NoViableAltException", "(", "LT", "(", "1", ")", ",", "getFilename", "(", ")", ")", ";", "}", "returnAST", "=", "variableDefinitions_AST", ";", "}", "public", "final", "void", "genericMethod", "(", ")", "throws", "RecognitionException", ",", "TokenStreamException", "{", "returnAST", "=", "null", ";", "ASTPair", "currentAST", "=", "new", "ASTPair", "(", ")", ";", "AST", "genericMethod_AST", "=", "null", ";", "AST", "m_AST", "=", "null", ";", "AST", "p_AST", "=", "null", ";", "AST", "t_AST", "=", "null", ";", "AST", "v_AST", "=", "null", ";", "modifiers", "(", ")", ";", "m_AST", "=", "(", "AST", ")", "returnAST", ";", "typeParameters", "(", ")", ";", "p_AST", "=", "(", "AST", ")", "returnAST", ";", "typeSpec", "(", "false", ")", ";", "t_AST", "=", "(", "AST", ")", "returnAST", ";", "variableDefinitions", "(", "m_AST", ",", "t_AST", ")", ";", "v_AST", "=", "(", "AST", ")", "returnAST", ";", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "genericMethod_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "genericMethod_AST", "=", "v_AST", ";", "AST", "old", "=", "v_AST", ".", "getFirstChild", "(", ")", ";", "genericMethod_AST", ".", "setFirstChild", "(", "p_AST", ")", ";", "p_AST", ".", "setNextSibling", "(", "old", ")", ";", "currentAST", ".", "root", "=", "genericMethod_AST", ";", "currentAST", ".", "child", "=", "genericMethod_AST", "!=", "null", "&&", "genericMethod_AST", ".", "getFirstChild", "(", ")", "!=", "null", "?", "genericMethod_AST", ".", "getFirstChild", "(", ")", ":", "genericMethod_AST", ";", "currentAST", ".", "advanceChildToEnd", "(", ")", ";", "}", "returnAST", "=", "genericMethod_AST", ";", "}", "public", "final", "void", "typeParameters", "(", ")", "throws", "RecognitionException", ",", "TokenStreamException", "{", "returnAST", "=", "null", ";", "ASTPair", "currentAST", "=", "new", "ASTPair", "(", ")", ";", "AST", "typeParameters_AST", "=", "null", ";", "Token", "first", "=", "LT", "(", "1", ")", ";", "int", "currentLtLevel", "=", "0", ";", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "currentLtLevel", "=", "ltCounter", ";", "}", "match", "(", "LT", ")", ";", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "ltCounter", "++", ";", "}", "nls", "(", ")", ";", "typeParameter", "(", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "returnAST", ")", ";", "{", "_loop113", ":", "do", "{", "if", "(", "(", "LA", "(", "1", ")", "==", "COMMA", ")", ")", "{", "match", "(", "COMMA", ")", ";", "nls", "(", ")", ";", "typeParameter", "(", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "returnAST", ")", ";", "}", "else", "{", "break", "_loop113", ";", "}", "}", "while", "(", "true", ")", ";", "}", "nls", "(", ")", ";", "{", "switch", "(", "LA", "(", "1", ")", ")", "{", "case", "GT", ":", "case", "SR", ":", "case", "BSR", ":", "{", "typeArgumentsOrParametersEnd", "(", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "returnAST", ")", ";", "break", ";", "}", "case", "EOF", ":", "case", "IDENT", ":", "case", "LITERAL_extends", ":", "case", "LITERAL_void", ":", "case", "LITERAL_boolean", ":", "case", "LITERAL_byte", ":", "case", "LITERAL_char", ":", "case", "LITERAL_short", ":", "case", "LITERAL_int", ":", "case", "LITERAL_float", ":", "case", "LITERAL_long", ":", "case", "LITERAL_double", ":", "case", "LCURLY", ":", "case", "RCURLY", ":", "case", "SEMI", ":", "case", "LITERAL_default", ":", "case", "LITERAL_implements", ":", "case", "LITERAL_else", ":", "case", "LITERAL_case", ":", "case", "NLS", ":", "{", "break", ";", "}", "default", ":", "{", "throw", "new", "NoViableAltException", "(", "LT", "(", "1", ")", ",", "getFilename", "(", ")", ")", ";", "}", "}", "}", "if", "(", "!", "(", "matchGenericTypeBrackets", "(", "(", "(", "currentLtLevel", "!=", "0", ")", "||", "ltCounter", "==", "currentLtLevel", ")", ",", "\"\"", ",", "\"\"", ")", ")", ")", "throw", "new", "SemanticException", "(", "\"\"", ")", ";", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "typeParameters_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "typeParameters_AST", "=", "(", "AST", ")", "astFactory", ".", "make", "(", "(", "new", "ASTArray", "(", "2", ")", ")", ".", "add", "(", "create", "(", "TYPE_PARAMETERS", ",", "\"\"", ",", "first", ",", "LT", "(", "1", ")", ")", ")", ".", "add", "(", "typeParameters_AST", ")", ")", ";", "currentAST", ".", "root", "=", "typeParameters_AST", ";", "currentAST", ".", "child", "=", "typeParameters_AST", "!=", "null", "&&", "typeParameters_AST", ".", "getFirstChild", "(", ")", "!=", "null", "?", "typeParameters_AST", ".", "getFirstChild", "(", ")", ":", "typeParameters_AST", ";", "currentAST", ".", "advanceChildToEnd", "(", ")", ";", "}", "typeParameters_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "returnAST", "=", "typeParameters_AST", ";", "}", "public", "final", "void", "singleDeclarationNoInit", "(", ")", "throws", "RecognitionException", ",", "TokenStreamException", "{", "returnAST", "=", "null", ";", "ASTPair", "currentAST", "=", "new", "ASTPair", "(", ")", ";", "AST", "singleDeclarationNoInit_AST", "=", "null", ";", "AST", "m_AST", "=", "null", ";", "AST", "t_AST", "=", "null", ";", "AST", "v_AST", "=", "null", ";", "AST", "t2_AST", "=", "null", ";", "AST", "v2_AST", "=", "null", ";", "switch", "(", "LA", "(", "1", ")", ")", "{", "case", "FINAL", ":", "case", "ABSTRACT", ":", "case", "STRICTFP", ":", "case", "LITERAL_static", ":", "case", "LITERAL_def", ":", "case", "AT", ":", "case", "LITERAL_private", ":", "case", "LITERAL_public", ":", "case", "LITERAL_protected", ":", "case", "LITERAL_transient", ":", "case", "LITERAL_native", ":", "case", "LITERAL_threadsafe", ":", "case", "LITERAL_synchronized", ":", "case", "LITERAL_volatile", ":", "{", "modifiers", "(", ")", ";", "m_AST", "=", "(", "AST", ")", "returnAST", ";", "{", "if", "(", "(", "_tokenSet_25", ".", "member", "(", "LA", "(", "1", ")", ")", ")", "&&", "(", "_tokenSet_32", ".", "member", "(", "LA", "(", "2", ")", ")", ")", ")", "{", "typeSpec", "(", "false", ")", ";", "t_AST", "=", "(", "AST", ")", "returnAST", ";", "}", "else", "if", "(", "(", "LA", "(", "1", ")", "==", "IDENT", ")", "&&", "(", "_tokenSet_33", ".", "member", "(", "LA", "(", "2", ")", ")", ")", ")", "{", "}", "else", "{", "throw", "new", "NoViableAltException", "(", "LT", "(", "1", ")", ",", "getFilename", "(", ")", ")", ";", "}", "}", "singleVariable", "(", "m_AST", ",", "t_AST", ")", ";", "v_AST", "=", "(", "AST", ")", "returnAST", ";", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "singleDeclarationNoInit_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "singleDeclarationNoInit_AST", "=", "v_AST", ";", "currentAST", ".", "root", "=", "singleDeclarationNoInit_AST", ";", "currentAST", ".", "child", "=", "singleDeclarationNoInit_AST", "!=", "null", "&&", "singleDeclarationNoInit_AST", ".", "getFirstChild", "(", ")", "!=", "null", "?", "singleDeclarationNoInit_AST", ".", "getFirstChild", "(", ")", ":", "singleDeclarationNoInit_AST", ";", "currentAST", ".", "advanceChildToEnd", "(", ")", ";", "}", "break", ";", "}", "case", "IDENT", ":", "case", "LITERAL_void", ":", "case", "LITERAL_boolean", ":", "case", "LITERAL_byte", ":", "case", "LITERAL_char", ":", "case", "LITERAL_short", ":", "case", "LITERAL_int", ":", "case", "LITERAL_float", ":", "case", "LITERAL_long", ":", "case", "LITERAL_double", ":", "{", "typeSpec", "(", "false", ")", ";", "t2_AST", "=", "(", "AST", ")", "returnAST", ";", "singleVariable", "(", "null", ",", "t2_AST", ")", ";", "v2_AST", "=", "(", "AST", ")", "returnAST", ";", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "singleDeclarationNoInit_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "singleDeclarationNoInit_AST", "=", "v2_AST", ";", "currentAST", ".", "root", "=", "singleDeclarationNoInit_AST", ";", "currentAST", ".", "child", "=", "singleDeclarationNoInit_AST", "!=", "null", "&&", "singleDeclarationNoInit_AST", ".", "getFirstChild", "(", ")", "!=", "null", "?", "singleDeclarationNoInit_AST", ".", "getFirstChild", "(", ")", ":", "singleDeclarationNoInit_AST", ";", "currentAST", ".", "advanceChildToEnd", "(", ")", ";", "}", "break", ";", "}", "default", ":", "{", "throw", "new", "NoViableAltException", "(", "LT", "(", "1", ")", ",", "getFilename", "(", ")", ")", ";", "}", "}", "returnAST", "=", "singleDeclarationNoInit_AST", ";", "}", "public", "final", "void", "singleVariable", "(", "AST", "mods", ",", "AST", "t", ")", "throws", "RecognitionException", ",", "TokenStreamException", "{", "returnAST", "=", "null", ";", "ASTPair", "currentAST", "=", "new", "ASTPair", "(", ")", ";", "AST", "singleVariable_AST", "=", "null", ";", "AST", "id_AST", "=", "null", ";", "Token", "first", "=", "LT", "(", "1", ")", ";", "variableName", "(", ")", ";", "id_AST", "=", "(", "AST", ")", "returnAST", ";", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "singleVariable_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "singleVariable_AST", "=", "(", "AST", ")", "astFactory", ".", "make", "(", "(", "new", "ASTArray", "(", "4", ")", ")", ".", "add", "(", "create", "(", "VARIABLE_DEF", ",", "\"VARIABLE_DEF\"", ",", "first", ",", "LT", "(", "1", ")", ")", ")", ".", "add", "(", "mods", ")", ".", "add", "(", "(", "AST", ")", "astFactory", ".", "make", "(", "(", "new", "ASTArray", "(", "2", ")", ")", ".", "add", "(", "create", "(", "TYPE", ",", "\"TYPE\"", ",", "first", ",", "LT", "(", "1", ")", ")", ")", ".", "add", "(", "t", ")", ")", ")", ".", "add", "(", "id_AST", ")", ")", ";", "currentAST", ".", "root", "=", "singleVariable_AST", ";", "currentAST", ".", "child", "=", "singleVariable_AST", "!=", "null", "&&", "singleVariable_AST", ".", "getFirstChild", "(", ")", "!=", "null", "?", "singleVariable_AST", ".", "getFirstChild", "(", ")", ":", "singleVariable_AST", ";", "currentAST", ".", "advanceChildToEnd", "(", ")", ";", "}", "returnAST", "=", "singleVariable_AST", ";", "}", "public", "final", "void", "singleDeclaration", "(", ")", "throws", "RecognitionException", ",", "TokenStreamException", "{", "returnAST", "=", "null", ";", "ASTPair", "currentAST", "=", "new", "ASTPair", "(", ")", ";", "AST", "singleDeclaration_AST", "=", "null", ";", "AST", "sd_AST", "=", "null", ";", "singleDeclarationNoInit", "(", ")", ";", "sd_AST", "=", "(", "AST", ")", "returnAST", ";", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "singleDeclaration_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "singleDeclaration_AST", "=", "sd_AST", ";", "currentAST", ".", "root", "=", "singleDeclaration_AST", ";", "currentAST", ".", "child", "=", "singleDeclaration_AST", "!=", "null", "&&", "singleDeclaration_AST", ".", "getFirstChild", "(", ")", "!=", "null", "?", "singleDeclaration_AST", ".", "getFirstChild", "(", ")", ":", "singleDeclaration_AST", ";", "currentAST", ".", "advanceChildToEnd", "(", ")", ";", "}", "{", "switch", "(", "LA", "(", "1", ")", ")", "{", "case", "ASSIGN", ":", "{", "varInitializer", "(", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "returnAST", ")", ";", "break", ";", "}", "case", "EOF", ":", "case", "RBRACK", ":", "case", "COMMA", ":", "case", "RPAREN", ":", "case", "SEMI", ":", "{", "break", ";", "}", "default", ":", "{", "throw", "new", "NoViableAltException", "(", "LT", "(", "1", ")", ",", "getFilename", "(", ")", ")", ";", "}", "}", "}", "singleDeclaration_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "returnAST", "=", "singleDeclaration_AST", ";", "}", "public", "final", "void", "varInitializer", "(", ")", "throws", "RecognitionException", ",", "TokenStreamException", "{", "returnAST", "=", "null", ";", "ASTPair", "currentAST", "=", "new", "ASTPair", "(", ")", ";", "AST", "varInitializer_AST", "=", "null", ";", "AST", "tmp41_AST", "=", "null", ";", "tmp41_AST", "=", "astFactory", ".", "create", "(", "LT", "(", "1", ")", ")", ";", "astFactory", ".", "makeASTRoot", "(", "currentAST", ",", "tmp41_AST", ")", ";", "match", "(", "ASSIGN", ")", ";", "nls", "(", ")", ";", "expressionStatementNoCheck", "(", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "returnAST", ")", ";", "varInitializer_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "returnAST", "=", "varInitializer_AST", ";", "}", "public", "final", "void", "declarationStart", "(", ")", "throws", "RecognitionException", ",", "TokenStreamException", "{", "returnAST", "=", "null", ";", "ASTPair", "currentAST", "=", "new", "ASTPair", "(", ")", ";", "AST", "declarationStart_AST", "=", "null", ";", "{", "int", "_cnt31", "=", "0", ";", "_loop31", ":", "do", "{", "switch", "(", "LA", "(", "1", ")", ")", "{", "case", "LITERAL_def", ":", "{", "{", "match", "(", "LITERAL_def", ")", ";", "nls", "(", ")", ";", "}", "break", ";", "}", "case", "FINAL", ":", "case", "ABSTRACT", ":", "case", "STRICTFP", ":", "case", "LITERAL_static", ":", "case", "LITERAL_private", ":", "case", "LITERAL_public", ":", "case", "LITERAL_protected", ":", "case", "LITERAL_transient", ":", "case", "LITERAL_native", ":", "case", "LITERAL_threadsafe", ":", "case", "LITERAL_synchronized", ":", "case", "LITERAL_volatile", ":", "{", "modifier", "(", ")", ";", "nls", "(", ")", ";", "break", ";", "}", "case", "AT", ":", "{", "annotation", "(", ")", ";", "nls", "(", ")", ";", "break", ";", "}", "default", ":", "if", "(", "(", "_tokenSet_25", ".", "member", "(", "LA", "(", "1", ")", ")", ")", "&&", "(", "_tokenSet_34", ".", "member", "(", "LA", "(", "2", ")", ")", ")", ")", "{", "{", "if", "(", "(", "LA", "(", "1", ")", "==", "IDENT", ")", "&&", "(", "_tokenSet_35", ".", "member", "(", "LA", "(", "2", ")", ")", ")", ")", "{", "upperCaseIdent", "(", ")", ";", "}", "else", "if", "(", "(", "(", "LA", "(", "1", ")", ">=", "LITERAL_void", "&&", "LA", "(", "1", ")", "<=", "LITERAL_double", ")", ")", ")", "{", "builtInType", "(", ")", ";", "}", "else", "if", "(", "(", "LA", "(", "1", ")", "==", "IDENT", ")", "&&", "(", "LA", "(", "2", ")", "==", "DOT", ")", ")", "{", "qualifiedTypeName", "(", ")", ";", "}", "else", "{", "throw", "new", "NoViableAltException", "(", "LT", "(", "1", ")", ",", "getFilename", "(", ")", ")", ";", "}", "}", "{", "switch", "(", "LA", "(", "1", ")", ")", "{", "case", "LT", ":", "{", "typeArguments", "(", ")", ";", "break", ";", "}", "case", "FINAL", ":", "case", "ABSTRACT", ":", "case", "STRICTFP", ":", "case", "LITERAL_static", ":", "case", "LITERAL_def", ":", "case", "LBRACK", ":", "case", "IDENT", ":", "case", "STRING_LITERAL", ":", "case", "AT", ":", "case", "LITERAL_void", ":", "case", "LITERAL_boolean", ":", "case", "LITERAL_byte", ":", "case", "LITERAL_char", ":", "case", "LITERAL_short", ":", "case", "LITERAL_int", ":", "case", "LITERAL_float", ":", "case", "LITERAL_long", ":", "case", "LITERAL_double", ":", "case", "LITERAL_private", ":", "case", "LITERAL_public", ":", "case", "LITERAL_protected", ":", "case", "LITERAL_transient", ":", "case", "LITERAL_native", ":", "case", "LITERAL_threadsafe", ":", "case", "LITERAL_synchronized", ":", "case", "LITERAL_volatile", ":", "{", "break", ";", "}", "default", ":", "{", "throw", "new", "NoViableAltException", "(", "LT", "(", "1", ")", ",", "getFilename", "(", ")", ")", ";", "}", "}", "}", "{", "_loop30", ":", "do", "{", "if", "(", "(", "LA", "(", "1", ")", "==", "LBRACK", ")", ")", "{", "AST", "tmp43_AST", "=", "null", ";", "tmp43_AST", "=", "astFactory", ".", "create", "(", "LT", "(", "1", ")", ")", ";", "match", "(", "LBRACK", ")", ";", "balancedTokens", "(", ")", ";", "AST", "tmp44_AST", "=", "null", ";", "tmp44_AST", "=", "astFactory", ".", "create", "(", "LT", "(", "1", ")", ")", ";", "match", "(", "RBRACK", ")", ";", "}", "else", "{", "break", "_loop30", ";", "}", "}", "while", "(", "true", ")", ";", "}", "}", "else", "{", "if", "(", "_cnt31", ">=", "1", ")", "{", "break", "_loop31", ";", "}", "else", "{", "throw", "new", "NoViableAltException", "(", "LT", "(", "1", ")", ",", "getFilename", "(", ")", ")", ";", "}", "}", "}", "_cnt31", "++", ";", "}", "while", "(", "true", ")", ";", "}", "{", "switch", "(", "LA", "(", "1", ")", ")", "{", "case", "IDENT", ":", "{", "AST", "tmp45_AST", "=", "null", ";", "tmp45_AST", "=", "astFactory", ".", "create", "(", "LT", "(", "1", ")", ")", ";", "match", "(", "IDENT", ")", ";", "break", ";", "}", "case", "STRING_LITERAL", ":", "{", "AST", "tmp46_AST", "=", "null", ";", "tmp46_AST", "=", "astFactory", ".", "create", "(", "LT", "(", "1", ")", ")", ";", "match", "(", "STRING_LITERAL", ")", ";", "break", ";", "}", "default", ":", "{", "throw", "new", "NoViableAltException", "(", "LT", "(", "1", ")", ",", "getFilename", "(", ")", ")", ";", "}", "}", "}", "returnAST", "=", "declarationStart_AST", ";", "}", "public", "final", "void", "modifier", "(", ")", "throws", "RecognitionException", ",", "TokenStreamException", "{", "returnAST", "=", "null", ";", "ASTPair", "currentAST", "=", "new", "ASTPair", "(", ")", ";", "AST", "modifier_AST", "=", "null", ";", "switch", "(", "LA", "(", "1", ")", ")", "{", "case", "LITERAL_private", ":", "{", "AST", "tmp47_AST", "=", "null", ";", "tmp47_AST", "=", "astFactory", ".", "create", "(", "LT", "(", "1", ")", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "tmp47_AST", ")", ";", "match", "(", "LITERAL_private", ")", ";", "modifier_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "break", ";", "}", "case", "LITERAL_public", ":", "{", "AST", "tmp48_AST", "=", "null", ";", "tmp48_AST", "=", "astFactory", ".", "create", "(", "LT", "(", "1", ")", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "tmp48_AST", ")", ";", "match", "(", "LITERAL_public", ")", ";", "modifier_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "break", ";", "}", "case", "LITERAL_protected", ":", "{", "AST", "tmp49_AST", "=", "null", ";", "tmp49_AST", "=", "astFactory", ".", "create", "(", "LT", "(", "1", ")", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "tmp49_AST", ")", ";", "match", "(", "LITERAL_protected", ")", ";", "modifier_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "break", ";", "}", "case", "LITERAL_static", ":", "{", "AST", "tmp50_AST", "=", "null", ";", "tmp50_AST", "=", "astFactory", ".", "create", "(", "LT", "(", "1", ")", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "tmp50_AST", ")", ";", "match", "(", "LITERAL_static", ")", ";", "modifier_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "break", ";", "}", "case", "LITERAL_transient", ":", "{", "AST", "tmp51_AST", "=", "null", ";", "tmp51_AST", "=", "astFactory", ".", "create", "(", "LT", "(", "1", ")", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "tmp51_AST", ")", ";", "match", "(", "LITERAL_transient", ")", ";", "modifier_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "break", ";", "}", "case", "FINAL", ":", "{", "AST", "tmp52_AST", "=", "null", ";", "tmp52_AST", "=", "astFactory", ".", "create", "(", "LT", "(", "1", ")", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "tmp52_AST", ")", ";", "match", "(", "FINAL", ")", ";", "modifier_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "break", ";", "}", "case", "ABSTRACT", ":", "{", "AST", "tmp53_AST", "=", "null", ";", "tmp53_AST", "=", "astFactory", ".", "create", "(", "LT", "(", "1", ")", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "tmp53_AST", ")", ";", "match", "(", "ABSTRACT", ")", ";", "modifier_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "break", ";", "}", "case", "LITERAL_native", ":", "{", "AST", "tmp54_AST", "=", "null", ";", "tmp54_AST", "=", "astFactory", ".", "create", "(", "LT", "(", "1", ")", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "tmp54_AST", ")", ";", "match", "(", "LITERAL_native", ")", ";", "modifier_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "break", ";", "}", "case", "LITERAL_threadsafe", ":", "{", "AST", "tmp55_AST", "=", "null", ";", "tmp55_AST", "=", "astFactory", ".", "create", "(", "LT", "(", "1", ")", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "tmp55_AST", ")", ";", "match", "(", "LITERAL_threadsafe", ")", ";", "modifier_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "break", ";", "}", "case", "LITERAL_synchronized", ":", "{", "AST", "tmp56_AST", "=", "null", ";", "tmp56_AST", "=", "astFactory", ".", "create", "(", "LT", "(", "1", ")", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "tmp56_AST", ")", ";", "match", "(", "LITERAL_synchronized", ")", ";", "modifier_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "break", ";", "}", "case", "LITERAL_volatile", ":", "{", "AST", "tmp57_AST", "=", "null", ";", "tmp57_AST", "=", "astFactory", ".", "create", "(", "LT", "(", "1", ")", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "tmp57_AST", ")", ";", "match", "(", "LITERAL_volatile", ")", ";", "modifier_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "break", ";", "}", "case", "STRICTFP", ":", "{", "AST", "tmp58_AST", "=", "null", ";", "tmp58_AST", "=", "astFactory", ".", "create", "(", "LT", "(", "1", ")", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "tmp58_AST", ")", ";", "match", "(", "STRICTFP", ")", ";", "modifier_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "break", ";", "}", "default", ":", "{", "throw", "new", "NoViableAltException", "(", "LT", "(", "1", ")", ",", "getFilename", "(", ")", ")", ";", "}", "}", "returnAST", "=", "modifier_AST", ";", "}", "public", "final", "void", "annotation", "(", ")", "throws", "RecognitionException", ",", "TokenStreamException", "{", "returnAST", "=", "null", ";", "ASTPair", "currentAST", "=", "new", "ASTPair", "(", ")", ";", "AST", "annotation_AST", "=", "null", ";", "AST", "i_AST", "=", "null", ";", "AST", "args_AST", "=", "null", ";", "Token", "first", "=", "LT", "(", "1", ")", ";", "match", "(", "AT", ")", ";", "identifier", "(", ")", ";", "i_AST", "=", "(", "AST", ")", "returnAST", ";", "nls", "(", ")", ";", "{", "if", "(", "(", "LA", "(", "1", ")", "==", "LPAREN", ")", "&&", "(", "_tokenSet_36", ".", "member", "(", "LA", "(", "2", ")", ")", ")", ")", "{", "match", "(", "LPAREN", ")", ";", "{", "switch", "(", "LA", "(", "1", ")", ")", "{", "case", "FINAL", ":", "case", "ABSTRACT", ":", "case", "UNUSED_GOTO", ":", "case", "UNUSED_CONST", ":", "case", "UNUSED_DO", ":", "case", "STRICTFP", ":", "case", "LITERAL_package", ":", "case", "LITERAL_import", ":", "case", "LITERAL_static", ":", "case", "LITERAL_def", ":", "case", "LBRACK", ":", "case", "IDENT", ":", "case", "STRING_LITERAL", ":", "case", "LPAREN", ":", "case", "LITERAL_class", ":", "case", "LITERAL_interface", ":", "case", "LITERAL_enum", ":", "case", "AT", ":", "case", "LITERAL_extends", ":", "case", "LITERAL_super", ":", "case", "LITERAL_void", ":", "case", "LITERAL_boolean", ":", "case", "LITERAL_byte", ":", "case", "LITERAL_char", ":", "case", "LITERAL_short", ":", "case", "LITERAL_int", ":", "case", "LITERAL_float", ":", "case", "LITERAL_long", ":", "case", "LITERAL_double", ":", "case", "LITERAL_as", ":", "case", "LITERAL_private", ":", "case", "LITERAL_public", ":", "case", "LITERAL_protected", ":", "case", "LITERAL_transient", ":", "case", "LITERAL_native", ":", "case", "LITERAL_threadsafe", ":", "case", "LITERAL_synchronized", ":", "case", "LITERAL_volatile", ":", "case", "LCURLY", ":", "case", "LITERAL_default", ":", "case", "LITERAL_throws", ":", "case", "LITERAL_implements", ":", "case", "LITERAL_this", ":", "case", "LITERAL_if", ":", "case", "LITERAL_else", ":", "case", "LITERAL_while", ":", "case", "LITERAL_switch", ":", "case", "LITERAL_for", ":", "case", "LITERAL_in", ":", "case", "LITERAL_return", ":", "case", "LITERAL_break", ":", "case", "LITERAL_continue", ":", "case", "LITERAL_throw", ":", "case", "LITERAL_assert", ":", "case", "PLUS", ":", "case", "MINUS", ":", "case", "LITERAL_case", ":", "case", "LITERAL_try", ":", "case", "LITERAL_finally", ":", "case", "LITERAL_catch", ":", "case", "LITERAL_false", ":", "case", "LITERAL_instanceof", ":", "case", "LITERAL_new", ":", "case", "LITERAL_null", ":", "case", "LITERAL_true", ":", "case", "INC", ":", "case", "DEC", ":", "case", "BNOT", ":", "case", "LNOT", ":", "case", "STRING_CTOR_START", ":", "case", "NUM_INT", ":", "case", "NUM_FLOAT", ":", "case", "NUM_LONG", ":", "case", "NUM_DOUBLE", ":", "case", "NUM_BIG_INT", ":", "case", "NUM_BIG_DECIMAL", ":", "{", "annotationArguments", "(", ")", ";", "args_AST", "=", "(", "AST", ")", "returnAST", ";", "break", ";", "}", "case", "RPAREN", ":", "{", "break", ";", "}", "default", ":", "{", "throw", "new", "NoViableAltException", "(", "LT", "(", "1", ")", ",", "getFilename", "(", ")", ")", ";", "}", "}", "}", "match", "(", "RPAREN", ")", ";", "}", "else", "if", "(", "(", "_tokenSet_37", ".", "member", "(", "LA", "(", "1", ")", ")", ")", "&&", "(", "_tokenSet_38", ".", "member", "(", "LA", "(", "2", ")", ")", ")", ")", "{", "}", "else", "{", "throw", "new", "NoViableAltException", "(", "LT", "(", "1", ")", ",", "getFilename", "(", ")", ")", ";", "}", "}", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "annotation_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "annotation_AST", "=", "(", "AST", ")", "astFactory", ".", "make", "(", "(", "new", "ASTArray", "(", "3", ")", ")", ".", "add", "(", "create", "(", "ANNOTATION", ",", "\"ANNOTATION\"", ",", "first", ",", "LT", "(", "1", ")", ")", ")", ".", "add", "(", "i_AST", ")", ".", "add", "(", "args_AST", ")", ")", ";", "currentAST", ".", "root", "=", "annotation_AST", ";", "currentAST", ".", "child", "=", "annotation_AST", "!=", "null", "&&", "annotation_AST", ".", "getFirstChild", "(", ")", "!=", "null", "?", "annotation_AST", ".", "getFirstChild", "(", ")", ":", "annotation_AST", ";", "currentAST", ".", "advanceChildToEnd", "(", ")", ";", "}", "returnAST", "=", "annotation_AST", ";", "}", "public", "final", "void", "upperCaseIdent", "(", ")", "throws", "RecognitionException", ",", "TokenStreamException", "{", "returnAST", "=", "null", ";", "ASTPair", "currentAST", "=", "new", "ASTPair", "(", ")", ";", "AST", "upperCaseIdent_AST", "=", "null", ";", "if", "(", "!", "(", "isUpperCase", "(", "LT", "(", "1", ")", ")", ")", ")", "throw", "new", "SemanticException", "(", "\"\"", ")", ";", "AST", "tmp62_AST", "=", "null", ";", "tmp62_AST", "=", "astFactory", ".", "create", "(", "LT", "(", "1", ")", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "tmp62_AST", ")", ";", "match", "(", "IDENT", ")", ";", "upperCaseIdent_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "returnAST", "=", "upperCaseIdent_AST", ";", "}", "public", "final", "void", "builtInType", "(", ")", "throws", "RecognitionException", ",", "TokenStreamException", "{", "returnAST", "=", "null", ";", "ASTPair", "currentAST", "=", "new", "ASTPair", "(", ")", ";", "AST", "builtInType_AST", "=", "null", ";", "switch", "(", "LA", "(", "1", ")", ")", "{", "case", "LITERAL_void", ":", "{", "AST", "tmp63_AST", "=", "null", ";", "tmp63_AST", "=", "astFactory", ".", "create", "(", "LT", "(", "1", ")", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "tmp63_AST", ")", ";", "match", "(", "LITERAL_void", ")", ";", "builtInType_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "break", ";", "}", "case", "LITERAL_boolean", ":", "{", "AST", "tmp64_AST", "=", "null", ";", "tmp64_AST", "=", "astFactory", ".", "create", "(", "LT", "(", "1", ")", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "tmp64_AST", ")", ";", "match", "(", "LITERAL_boolean", ")", ";", "builtInType_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "break", ";", "}", "case", "LITERAL_byte", ":", "{", "AST", "tmp65_AST", "=", "null", ";", "tmp65_AST", "=", "astFactory", ".", "create", "(", "LT", "(", "1", ")", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "tmp65_AST", ")", ";", "match", "(", "LITERAL_byte", ")", ";", "builtInType_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "break", ";", "}", "case", "LITERAL_char", ":", "{", "AST", "tmp66_AST", "=", "null", ";", "tmp66_AST", "=", "astFactory", ".", "create", "(", "LT", "(", "1", ")", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "tmp66_AST", ")", ";", "match", "(", "LITERAL_char", ")", ";", "builtInType_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "break", ";", "}", "case", "LITERAL_short", ":", "{", "AST", "tmp67_AST", "=", "null", ";", "tmp67_AST", "=", "astFactory", ".", "create", "(", "LT", "(", "1", ")", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "tmp67_AST", ")", ";", "match", "(", "LITERAL_short", ")", ";", "builtInType_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "break", ";", "}", "case", "LITERAL_int", ":", "{", "AST", "tmp68_AST", "=", "null", ";", "tmp68_AST", "=", "astFactory", ".", "create", "(", "LT", "(", "1", ")", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "tmp68_AST", ")", ";", "match", "(", "LITERAL_int", ")", ";", "builtInType_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "break", ";", "}", "case", "LITERAL_float", ":", "{", "AST", "tmp69_AST", "=", "null", ";", "tmp69_AST", "=", "astFactory", ".", "create", "(", "LT", "(", "1", ")", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "tmp69_AST", ")", ";", "match", "(", "LITERAL_float", ")", ";", "builtInType_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "break", ";", "}", "case", "LITERAL_long", ":", "{", "AST", "tmp70_AST", "=", "null", ";", "tmp70_AST", "=", "astFactory", ".", "create", "(", "LT", "(", "1", ")", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "tmp70_AST", ")", ";", "match", "(", "LITERAL_long", ")", ";", "builtInType_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "break", ";", "}", "case", "LITERAL_double", ":", "{", "AST", "tmp71_AST", "=", "null", ";", "tmp71_AST", "=", "astFactory", ".", "create", "(", "LT", "(", "1", ")", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "tmp71_AST", ")", ";", "match", "(", "LITERAL_double", ")", ";", "builtInType_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "break", ";", "}", "default", ":", "{", "throw", "new", "NoViableAltException", "(", "LT", "(", "1", ")", ",", "getFilename", "(", ")", ")", ";", "}", "}", "returnAST", "=", "builtInType_AST", ";", "}", "public", "final", "void", "qualifiedTypeName", "(", ")", "throws", "RecognitionException", ",", "TokenStreamException", "{", "returnAST", "=", "null", ";", "ASTPair", "currentAST", "=", "new", "ASTPair", "(", ")", ";", "AST", "qualifiedTypeName_AST", "=", "null", ";", "AST", "tmp72_AST", "=", "null", ";", "tmp72_AST", "=", "astFactory", ".", "create", "(", "LT", "(", "1", ")", ")", ";", "match", "(", "IDENT", ")", ";", "AST", "tmp73_AST", "=", "null", ";", "tmp73_AST", "=", "astFactory", ".", "create", "(", "LT", "(", "1", ")", ")", ";", "match", "(", "DOT", ")", ";", "{", "_loop38", ":", "do", "{", "if", "(", "(", "LA", "(", "1", ")", "==", "IDENT", ")", "&&", "(", "LA", "(", "2", ")", "==", "DOT", ")", ")", "{", "AST", "tmp74_AST", "=", "null", ";", "tmp74_AST", "=", "astFactory", ".", "create", "(", "LT", "(", "1", ")", ")", ";", "match", "(", "IDENT", ")", ";", "AST", "tmp75_AST", "=", "null", ";", "tmp75_AST", "=", "astFactory", ".", "create", "(", "LT", "(", "1", ")", ")", ";", "match", "(", "DOT", ")", ";", "}", "else", "{", "break", "_loop38", ";", "}", "}", "while", "(", "true", ")", ";", "}", "upperCaseIdent", "(", ")", ";", "returnAST", "=", "qualifiedTypeName_AST", ";", "}", "public", "final", "void", "typeArguments", "(", ")", "throws", "RecognitionException", ",", "TokenStreamException", "{", "returnAST", "=", "null", ";", "ASTPair", "currentAST", "=", "new", "ASTPair", "(", ")", ";", "AST", "typeArguments_AST", "=", "null", ";", "Token", "first", "=", "LT", "(", "1", ")", ";", "int", "currentLtLevel", "=", "0", ";", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "currentLtLevel", "=", "ltCounter", ";", "}", "match", "(", "LT", ")", ";", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "ltCounter", "++", ";", "}", "nls", "(", ")", ";", "typeArgument", "(", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "returnAST", ")", ";", "{", "_loop60", ":", "do", "{", "if", "(", "(", "(", "LA", "(", "1", ")", "==", "COMMA", ")", "&&", "(", "_tokenSet_39", ".", "member", "(", "LA", "(", "2", ")", ")", ")", ")", "&&", "(", "inputState", ".", "guessing", "!=", "0", "||", "ltCounter", "==", "currentLtLevel", "+", "1", ")", ")", "{", "match", "(", "COMMA", ")", ";", "nls", "(", ")", ";", "typeArgument", "(", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "returnAST", ")", ";", "}", "else", "{", "break", "_loop60", ";", "}", "}", "while", "(", "true", ")", ";", "}", "nls", "(", ")", ";", "{", "if", "(", "(", "_tokenSet_40", ".", "member", "(", "LA", "(", "1", ")", ")", ")", "&&", "(", "_tokenSet_41", ".", "member", "(", "LA", "(", "2", ")", ")", ")", ")", "{", "typeArgumentsOrParametersEnd", "(", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "returnAST", ")", ";", "}", "else", "if", "(", "(", "_tokenSet_41", ".", "member", "(", "LA", "(", "1", ")", ")", ")", "&&", "(", "_tokenSet_4", ".", "member", "(", "LA", "(", "2", ")", ")", ")", ")", "{", "}", "else", "{", "throw", "new", "NoViableAltException", "(", "LT", "(", "1", ")", ",", "getFilename", "(", ")", ")", ";", "}", "}", "if", "(", "!", "(", "matchGenericTypeBrackets", "(", "(", "(", "currentLtLevel", "!=", "0", ")", "||", "ltCounter", "==", "currentLtLevel", ")", ",", "\"\"", ",", "\"\"", ")", ")", ")", "throw", "new", "SemanticException", "(", "\"\"", ")", ";", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "typeArguments_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "typeArguments_AST", "=", "(", "AST", ")", "astFactory", ".", "make", "(", "(", "new", "ASTArray", "(", "2", ")", ")", ".", "add", "(", "create", "(", "TYPE_ARGUMENTS", ",", "\"\"", ",", "first", ",", "LT", "(", "1", ")", ")", ")", ".", "add", "(", "typeArguments_AST", ")", ")", ";", "currentAST", ".", "root", "=", "typeArguments_AST", ";", "currentAST", ".", "child", "=", "typeArguments_AST", "!=", "null", "&&", "typeArguments_AST", ".", "getFirstChild", "(", ")", "!=", "null", "?", "typeArguments_AST", ".", "getFirstChild", "(", ")", ":", "typeArguments_AST", ";", "currentAST", ".", "advanceChildToEnd", "(", ")", ";", "}", "typeArguments_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "returnAST", "=", "typeArguments_AST", ";", "}", "public", "final", "void", "balancedTokens", "(", ")", "throws", "RecognitionException", ",", "TokenStreamException", "{", "returnAST", "=", "null", ";", "ASTPair", "currentAST", "=", "new", "ASTPair", "(", ")", ";", "AST", "balancedTokens_AST", "=", "null", ";", "{", "_loop568", ":", "do", "{", "if", "(", "(", "_tokenSet_42", ".", "member", "(", "LA", "(", "1", ")", ")", ")", ")", "{", "balancedBrackets", "(", ")", ";", "}", "else", "if", "(", "(", "_tokenSet_43", ".", "member", "(", "LA", "(", "1", ")", ")", ")", ")", "{", "{", "match", "(", "_tokenSet_43", ")", ";", "}", "}", "else", "{", "break", "_loop568", ";", "}", "}", "while", "(", "true", ")", ";", "}", "returnAST", "=", "balancedTokens_AST", ";", "}", "public", "final", "void", "genericMethodStart", "(", ")", "throws", "RecognitionException", ",", "TokenStreamException", "{", "returnAST", "=", "null", ";", "ASTPair", "currentAST", "=", "new", "ASTPair", "(", ")", ";", "AST", "genericMethodStart_AST", "=", "null", ";", "{", "int", "_cnt35", "=", "0", ";", "_loop35", ":", "do", "{", "switch", "(", "LA", "(", "1", ")", ")", "{", "case", "LITERAL_def", ":", "{", "match", "(", "LITERAL_def", ")", ";", "nls", "(", ")", ";", "break", ";", "}", "case", "FINAL", ":", "case", "ABSTRACT", ":", "case", "STRICTFP", ":", "case", "LITERAL_static", ":", "case", "LITERAL_private", ":", "case", "LITERAL_public", ":", "case", "LITERAL_protected", ":", "case", "LITERAL_transient", ":", "case", "LITERAL_native", ":", "case", "LITERAL_threadsafe", ":", "case", "LITERAL_synchronized", ":", "case", "LITERAL_volatile", ":", "{", "modifier", "(", ")", ";", "nls", "(", ")", ";", "break", ";", "}", "case", "AT", ":", "{", "annotation", "(", ")", ";", "nls", "(", ")", ";", "break", ";", "}", "default", ":", "{", "if", "(", "_cnt35", ">=", "1", ")", "{", "break", "_loop35", ";", "}", "else", "{", "throw", "new", "NoViableAltException", "(", "LT", "(", "1", ")", ",", "getFilename", "(", ")", ")", ";", "}", "}", "}", "_cnt35", "++", ";", "}", "while", "(", "true", ")", ";", "}", "AST", "tmp80_AST", "=", "null", ";", "tmp80_AST", "=", "astFactory", ".", "create", "(", "LT", "(", "1", ")", ")", ";", "match", "(", "LT", ")", ";", "returnAST", "=", "genericMethodStart_AST", ";", "}", "public", "final", "void", "constructorStart", "(", ")", "throws", "RecognitionException", ",", "TokenStreamException", "{", "returnAST", "=", "null", ";", "ASTPair", "currentAST", "=", "new", "ASTPair", "(", ")", ";", "AST", "constructorStart_AST", "=", "null", ";", "Token", "id", "=", "null", ";", "AST", "id_AST", "=", "null", ";", "modifiersOpt", "(", ")", ";", "id", "=", "LT", "(", "1", ")", ";", "id_AST", "=", "astFactory", ".", "create", "(", "id", ")", ";", "match", "(", "IDENT", ")", ";", "if", "(", "!", "(", "isConstructorIdent", "(", "id", ")", ")", ")", "throw", "new", "SemanticException", "(", "\"\"", ")", ";", "nls", "(", ")", ";", "match", "(", "LPAREN", ")", ";", "returnAST", "=", "constructorStart_AST", ";", "}", "public", "final", "void", "modifiersOpt", "(", ")", "throws", "RecognitionException", ",", "TokenStreamException", "{", "returnAST", "=", "null", ";", "ASTPair", "currentAST", "=", "new", "ASTPair", "(", ")", ";", "AST", "modifiersOpt_AST", "=", "null", ";", "Token", "first", "=", "LT", "(", "1", ")", ";", "{", "if", "(", "(", "_tokenSet_13", ".", "member", "(", "LA", "(", "1", ")", ")", ")", "&&", "(", "_tokenSet_44", ".", "member", "(", "LA", "(", "2", ")", ")", ")", ")", "{", "modifiersInternal", "(", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "returnAST", ")", ";", "}", "else", "if", "(", "(", "_tokenSet_45", ".", "member", "(", "LA", "(", "1", ")", ")", ")", "&&", "(", "_tokenSet_46", ".", "member", "(", "LA", "(", "2", ")", ")", ")", ")", "{", "}", "else", "{", "throw", "new", "NoViableAltException", "(", "LT", "(", "1", ")", ",", "getFilename", "(", ")", ")", ";", "}", "}", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "modifiersOpt_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "modifiersOpt_AST", "=", "(", "AST", ")", "astFactory", ".", "make", "(", "(", "new", "ASTArray", "(", "2", ")", ")", ".", "add", "(", "create", "(", "MODIFIERS", ",", "\"MODIFIERS\"", ",", "first", ",", "LT", "(", "1", ")", ")", ")", ".", "add", "(", "modifiersOpt_AST", ")", ")", ";", "currentAST", ".", "root", "=", "modifiersOpt_AST", ";", "currentAST", ".", "child", "=", "modifiersOpt_AST", "!=", "null", "&&", "modifiersOpt_AST", ".", "getFirstChild", "(", ")", "!=", "null", "?", "modifiersOpt_AST", ".", "getFirstChild", "(", ")", ":", "modifiersOpt_AST", ";", "currentAST", ".", "advanceChildToEnd", "(", ")", ";", "}", "modifiersOpt_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "returnAST", "=", "modifiersOpt_AST", ";", "}", "public", "final", "void", "typeDeclarationStart", "(", ")", "throws", "RecognitionException", ",", "TokenStreamException", "{", "returnAST", "=", "null", ";", "ASTPair", "currentAST", "=", "new", "ASTPair", "(", ")", ";", "AST", "typeDeclarationStart_AST", "=", "null", ";", "modifiersOpt", "(", ")", ";", "{", "switch", "(", "LA", "(", "1", ")", ")", "{", "case", "LITERAL_class", ":", "{", "match", "(", "LITERAL_class", ")", ";", "break", ";", "}", "case", "LITERAL_interface", ":", "{", "match", "(", "LITERAL_interface", ")", ";", "break", ";", "}", "case", "LITERAL_enum", ":", "{", "match", "(", "LITERAL_enum", ")", ";", "break", ";", "}", "case", "AT", ":", "{", "AST", "tmp85_AST", "=", "null", ";", "tmp85_AST", "=", "astFactory", ".", "create", "(", "LT", "(", "1", ")", ")", ";", "match", "(", "AT", ")", ";", "match", "(", "LITERAL_interface", ")", ";", "break", ";", "}", "default", ":", "{", "throw", "new", "NoViableAltException", "(", "LT", "(", "1", ")", ",", "getFilename", "(", ")", ")", ";", "}", "}", "}", "returnAST", "=", "typeDeclarationStart_AST", ";", "}", "public", "final", "void", "classTypeSpec", "(", "boolean", "addImagNode", ")", "throws", "RecognitionException", ",", "TokenStreamException", "{", "returnAST", "=", "null", ";", "ASTPair", "currentAST", "=", "new", "ASTPair", "(", ")", ";", "AST", "classTypeSpec_AST", "=", "null", ";", "AST", "ct_AST", "=", "null", ";", "Token", "first", "=", "LT", "(", "1", ")", ";", "classOrInterfaceType", "(", "false", ")", ";", "ct_AST", "=", "(", "AST", ")", "returnAST", ";", "declaratorBrackets", "(", "ct_AST", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "returnAST", ")", ";", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "classTypeSpec_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "if", "(", "addImagNode", ")", "{", "classTypeSpec_AST", "=", "(", "AST", ")", "astFactory", ".", "make", "(", "(", "new", "ASTArray", "(", "2", ")", ")", ".", "add", "(", "create", "(", "TYPE", ",", "\"TYPE\"", ",", "first", ",", "LT", "(", "1", ")", ")", ")", ".", "add", "(", "classTypeSpec_AST", ")", ")", ";", "}", "currentAST", ".", "root", "=", "classTypeSpec_AST", ";", "currentAST", ".", "child", "=", "classTypeSpec_AST", "!=", "null", "&&", "classTypeSpec_AST", ".", "getFirstChild", "(", ")", "!=", "null", "?", "classTypeSpec_AST", ".", "getFirstChild", "(", ")", ":", "classTypeSpec_AST", ";", "currentAST", ".", "advanceChildToEnd", "(", ")", ";", "}", "classTypeSpec_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "returnAST", "=", "classTypeSpec_AST", ";", "}", "public", "final", "void", "builtInTypeSpec", "(", "boolean", "addImagNode", ")", "throws", "RecognitionException", ",", "TokenStreamException", "{", "returnAST", "=", "null", ";", "ASTPair", "currentAST", "=", "new", "ASTPair", "(", ")", ";", "AST", "builtInTypeSpec_AST", "=", "null", ";", "AST", "bt_AST", "=", "null", ";", "Token", "first", "=", "LT", "(", "1", ")", ";", "builtInType", "(", ")", ";", "bt_AST", "=", "(", "AST", ")", "returnAST", ";", "declaratorBrackets", "(", "bt_AST", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "returnAST", ")", ";", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "builtInTypeSpec_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "if", "(", "addImagNode", ")", "{", "builtInTypeSpec_AST", "=", "(", "AST", ")", "astFactory", ".", "make", "(", "(", "new", "ASTArray", "(", "2", ")", ")", ".", "add", "(", "create", "(", "TYPE", ",", "\"TYPE\"", ",", "first", ",", "LT", "(", "1", ")", ")", ")", ".", "add", "(", "builtInTypeSpec_AST", ")", ")", ";", "}", "currentAST", ".", "root", "=", "builtInTypeSpec_AST", ";", "currentAST", ".", "child", "=", "builtInTypeSpec_AST", "!=", "null", "&&", "builtInTypeSpec_AST", ".", "getFirstChild", "(", ")", "!=", "null", "?", "builtInTypeSpec_AST", ".", "getFirstChild", "(", ")", ":", "builtInTypeSpec_AST", ";", "currentAST", ".", "advanceChildToEnd", "(", ")", ";", "}", "builtInTypeSpec_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "returnAST", "=", "builtInTypeSpec_AST", ";", "}", "public", "final", "void", "classOrInterfaceType", "(", "boolean", "addImagNode", ")", "throws", "RecognitionException", ",", "TokenStreamException", "{", "returnAST", "=", "null", ";", "ASTPair", "currentAST", "=", "new", "ASTPair", "(", ")", ";", "AST", "classOrInterfaceType_AST", "=", "null", ";", "Token", "i1", "=", "null", ";", "AST", "i1_AST", "=", "null", ";", "Token", "d", "=", "null", ";", "AST", "d_AST", "=", "null", ";", "Token", "i2", "=", "null", ";", "AST", "i2_AST", "=", "null", ";", "AST", "ta_AST", "=", "null", ";", "Token", "first", "=", "LT", "(", "1", ")", ";", "i1", "=", "LT", "(", "1", ")", ";", "i1_AST", "=", "astFactory", ".", "create", "(", "i1", ")", ";", "astFactory", ".", "makeASTRoot", "(", "currentAST", ",", "i1_AST", ")", ";", "match", "(", "IDENT", ")", ";", "{", "if", "(", "(", "LA", "(", "1", ")", "==", "LT", ")", "&&", "(", "_tokenSet_39", ".", "member", "(", "LA", "(", "2", ")", ")", ")", ")", "{", "typeArguments", "(", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "returnAST", ")", ";", "}", "else", "if", "(", "(", "LA", "(", "1", ")", "==", "LT", ")", "&&", "(", "LA", "(", "2", ")", "==", "GT", ")", ")", "{", "typeArgumentsDiamond", "(", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "returnAST", ")", ";", "}", "else", "if", "(", "(", "_tokenSet_41", ".", "member", "(", "LA", "(", "1", ")", ")", ")", ")", "{", "}", "else", "{", "throw", "new", "NoViableAltException", "(", "LT", "(", "1", ")", ",", "getFilename", "(", ")", ")", ";", "}", "}", "{", "_loop49", ":", "do", "{", "if", "(", "(", "LA", "(", "1", ")", "==", "DOT", ")", "&&", "(", "LA", "(", "2", ")", "==", "IDENT", ")", ")", "{", "d", "=", "LT", "(", "1", ")", ";", "d_AST", "=", "astFactory", ".", "create", "(", "d", ")", ";", "match", "(", "DOT", ")", ";", "i2", "=", "LT", "(", "1", ")", ";", "i2_AST", "=", "astFactory", ".", "create", "(", "i2", ")", ";", "match", "(", "IDENT", ")", ";", "{", "switch", "(", "LA", "(", "1", ")", ")", "{", "case", "LT", ":", "{", "typeArguments", "(", ")", ";", "ta_AST", "=", "(", "AST", ")", "returnAST", ";", "break", ";", "}", "case", "EOF", ":", "case", "FINAL", ":", "case", "ABSTRACT", ":", "case", "UNUSED_GOTO", ":", "case", "UNUSED_CONST", ":", "case", "UNUSED_DO", ":", "case", "STRICTFP", ":", "case", "LITERAL_package", ":", "case", "LITERAL_import", ":", "case", "LITERAL_static", ":", "case", "LITERAL_def", ":", "case", "LBRACK", ":", "case", "RBRACK", ":", "case", "IDENT", ":", "case", "STRING_LITERAL", ":", "case", "DOT", ":", "case", "LPAREN", ":", "case", "LITERAL_class", ":", "case", "LITERAL_interface", ":", "case", "LITERAL_enum", ":", "case", "AT", ":", "case", "QUESTION", ":", "case", "LITERAL_extends", ":", "case", "LITERAL_super", ":", "case", "GT", ":", "case", "COMMA", ":", "case", "SR", ":", "case", "BSR", ":", "case", "LITERAL_void", ":", "case", "LITERAL_boolean", ":", "case", "LITERAL_byte", ":", "case", "LITERAL_char", ":", "case", "LITERAL_short", ":", "case", "LITERAL_int", ":", "case", "LITERAL_float", ":", "case", "LITERAL_long", ":", "case", "LITERAL_double", ":", "case", "LITERAL_as", ":", "case", "LITERAL_private", ":", "case", "LITERAL_public", ":", "case", "LITERAL_protected", ":", "case", "LITERAL_transient", ":", "case", "LITERAL_native", ":", "case", "LITERAL_threadsafe", ":", "case", "LITERAL_synchronized", ":", "case", "LITERAL_volatile", ":", "case", "RPAREN", ":", "case", "ASSIGN", ":", "case", "BAND", ":", "case", "LCURLY", ":", "case", "RCURLY", ":", "case", "SEMI", ":", "case", "LITERAL_default", ":", "case", "LITERAL_throws", ":", "case", "LITERAL_implements", ":", "case", "LITERAL_this", ":", "case", "TRIPLE_DOT", ":", "case", "CLOSABLE_BLOCK_OP", ":", "case", "COLON", ":", "case", "LITERAL_if", ":", "case", "LITERAL_else", ":", "case", "LITERAL_while", ":", "case", "LITERAL_switch", ":", "case", "LITERAL_for", ":", "case", "LITERAL_in", ":", "case", "LITERAL_return", ":", "case", "LITERAL_break", ":", "case", "LITERAL_continue", ":", "case", "LITERAL_throw", ":", "case", "LITERAL_assert", ":", "case", "PLUS", ":", "case", "MINUS", ":", "case", "LITERAL_case", ":", "case", "LITERAL_try", ":", "case", "LITERAL_finally", ":", "case", "LITERAL_catch", ":", "case", "LITERAL_false", ":", "case", "LITERAL_instanceof", ":", "case", "LITERAL_new", ":", "case", "LITERAL_null", ":", "case", "LITERAL_true", ":", "case", "PLUS_ASSIGN", ":", "case", "MINUS_ASSIGN", ":", "case", "STAR_ASSIGN", ":", "case", "DIV_ASSIGN", ":", "case", "MOD_ASSIGN", ":", "case", "SR_ASSIGN", ":", "case", "BSR_ASSIGN", ":", "case", "SL_ASSIGN", ":", "case", "BAND_ASSIGN", ":", "case", "BXOR_ASSIGN", ":", "case", "BOR_ASSIGN", ":", "case", "STAR_STAR_ASSIGN", ":", "case", "ELVIS_OPERATOR", ":", "case", "LOR", ":", "case", "LAND", ":", "case", "BOR", ":", "case", "BXOR", ":", "case", "REGEX_FIND", ":", "case", "REGEX_MATCH", ":", "case", "NOT_EQUAL", ":", "case", "EQUAL", ":", "case", "IDENTICAL", ":", "case", "NOT_IDENTICAL", ":", "case", "COMPARE_TO", ":", "case", "INC", ":", "case", "DEC", ":", "case", "BNOT", ":", "case", "LNOT", ":", "case", "STRING_CTOR_START", ":", "case", "NUM_INT", ":", "case", "NUM_FLOAT", ":", "case", "NUM_LONG", ":", "case", "NUM_DOUBLE", ":", "case", "NUM_BIG_INT", ":", "case", "NUM_BIG_DECIMAL", ":", "case", "NLS", ":", "{", "break", ";", "}", "default", ":", "{", "throw", "new", "NoViableAltException", "(", "LT", "(", "1", ")", ",", "getFilename", "(", ")", ")", ";", "}", "}", "}", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "i1_AST", "=", "(", "AST", ")", "astFactory", ".", "make", "(", "(", "new", "ASTArray", "(", "4", ")", ")", ".", "add", "(", "create", "(", "DOT", ",", "\".\"", ",", "first", ",", "LT", "(", "1", ")", ")", ")", ".", "add", "(", "i1_AST", ")", ".", "add", "(", "i2_AST", ")", ".", "add", "(", "ta_AST", ")", ")", ";", "}", "}", "else", "{", "break", "_loop49", ";", "}", "}", "while", "(", "true", ")", ";", "}", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "classOrInterfaceType_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "classOrInterfaceType_AST", "=", "i1_AST", ";", "if", "(", "addImagNode", ")", "{", "classOrInterfaceType_AST", "=", "(", "AST", ")", "astFactory", ".", "make", "(", "(", "new", "ASTArray", "(", "2", ")", ")", ".", "add", "(", "create", "(", "TYPE", ",", "\"TYPE\"", ",", "first", ",", "LT", "(", "1", ")", ")", ")", ".", "add", "(", "classOrInterfaceType_AST", ")", ")", ";", "}", "currentAST", ".", "root", "=", "classOrInterfaceType_AST", ";", "currentAST", ".", "child", "=", "classOrInterfaceType_AST", "!=", "null", "&&", "classOrInterfaceType_AST", ".", "getFirstChild", "(", ")", "!=", "null", "?", "classOrInterfaceType_AST", ".", "getFirstChild", "(", ")", ":", "classOrInterfaceType_AST", ";", "currentAST", ".", "advanceChildToEnd", "(", ")", ";", "}", "classOrInterfaceType_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "returnAST", "=", "classOrInterfaceType_AST", ";", "}", "public", "final", "void", "declaratorBrackets", "(", "AST", "typ", ")", "throws", "RecognitionException", ",", "TokenStreamException", "{", "returnAST", "=", "null", ";", "ASTPair", "currentAST", "=", "new", "ASTPair", "(", ")", ";", "AST", "declaratorBrackets_AST", "=", "null", ";", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "declaratorBrackets_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "declaratorBrackets_AST", "=", "typ", ";", "currentAST", ".", "root", "=", "declaratorBrackets_AST", ";", "currentAST", ".", "child", "=", "declaratorBrackets_AST", "!=", "null", "&&", "declaratorBrackets_AST", ".", "getFirstChild", "(", ")", "!=", "null", "?", "declaratorBrackets_AST", ".", "getFirstChild", "(", ")", ":", "declaratorBrackets_AST", ";", "currentAST", ".", "advanceChildToEnd", "(", ")", ";", "}", "{", "_loop251", ":", "do", "{", "if", "(", "(", "LA", "(", "1", ")", "==", "LBRACK", ")", "&&", "(", "LA", "(", "2", ")", "==", "RBRACK", ")", ")", "{", "match", "(", "LBRACK", ")", ";", "match", "(", "RBRACK", ")", ";", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "declaratorBrackets_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "declaratorBrackets_AST", "=", "(", "AST", ")", "astFactory", ".", "make", "(", "(", "new", "ASTArray", "(", "2", ")", ")", ".", "add", "(", "create", "(", "ARRAY_DECLARATOR", ",", "\"[\"", ",", "typ", ",", "LT", "(", "1", ")", ")", ")", ".", "add", "(", "declaratorBrackets_AST", ")", ")", ";", "currentAST", ".", "root", "=", "declaratorBrackets_AST", ";", "currentAST", ".", "child", "=", "declaratorBrackets_AST", "!=", "null", "&&", "declaratorBrackets_AST", ".", "getFirstChild", "(", ")", "!=", "null", "?", "declaratorBrackets_AST", ".", "getFirstChild", "(", ")", ":", "declaratorBrackets_AST", ";", "currentAST", ".", "advanceChildToEnd", "(", ")", ";", "}", "}", "else", "{", "break", "_loop251", ";", "}", "}", "while", "(", "true", ")", ";", "}", "declaratorBrackets_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "returnAST", "=", "declaratorBrackets_AST", ";", "}", "public", "final", "void", "typeArgumentsDiamond", "(", ")", "throws", "RecognitionException", ",", "TokenStreamException", "{", "returnAST", "=", "null", ";", "ASTPair", "currentAST", "=", "new", "ASTPair", "(", ")", ";", "AST", "typeArgumentsDiamond_AST", "=", "null", ";", "Token", "first", "=", "LT", "(", "1", ")", ";", "match", "(", "LT", ")", ";", "match", "(", "GT", ")", ";", "nls", "(", ")", ";", "typeArgumentsDiamond_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "returnAST", "=", "typeArgumentsDiamond_AST", ";", "}", "public", "final", "void", "typeArgumentSpec", "(", ")", "throws", "RecognitionException", ",", "TokenStreamException", "{", "returnAST", "=", "null", ";", "ASTPair", "currentAST", "=", "new", "ASTPair", "(", ")", ";", "AST", "typeArgumentSpec_AST", "=", "null", ";", "switch", "(", "LA", "(", "1", ")", ")", "{", "case", "IDENT", ":", "{", "classTypeSpec", "(", "true", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "returnAST", ")", ";", "typeArgumentSpec_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "break", ";", "}", "case", "LITERAL_void", ":", "case", "LITERAL_boolean", ":", "case", "LITERAL_byte", ":", "case", "LITERAL_char", ":", "case", "LITERAL_short", ":", "case", "LITERAL_int", ":", "case", "LITERAL_float", ":", "case", "LITERAL_long", ":", "case", "LITERAL_double", ":", "{", "builtInTypeArraySpec", "(", "true", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "returnAST", ")", ";", "typeArgumentSpec_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "break", ";", "}", "default", ":", "{", "throw", "new", "NoViableAltException", "(", "LT", "(", "1", ")", ",", "getFilename", "(", ")", ")", ";", "}", "}", "returnAST", "=", "typeArgumentSpec_AST", ";", "}", "public", "final", "void", "builtInTypeArraySpec", "(", "boolean", "addImagNode", ")", "throws", "RecognitionException", ",", "TokenStreamException", "{", "returnAST", "=", "null", ";", "ASTPair", "currentAST", "=", "new", "ASTPair", "(", ")", ";", "AST", "builtInTypeArraySpec_AST", "=", "null", ";", "AST", "bt_AST", "=", "null", ";", "Token", "first", "=", "LT", "(", "1", ")", ";", "builtInType", "(", ")", ";", "bt_AST", "=", "(", "AST", ")", "returnAST", ";", "{", "boolean", "synPredMatched68", "=", "false", ";", "if", "(", "(", "(", "_tokenSet_41", ".", "member", "(", "LA", "(", "1", ")", ")", ")", "&&", "(", "_tokenSet_4", ".", "member", "(", "LA", "(", "2", ")", ")", ")", ")", ")", "{", "int", "_m68", "=", "mark", "(", ")", ";", "synPredMatched68", "=", "true", ";", "inputState", ".", "guessing", "++", ";", "try", "{", "{", "match", "(", "LBRACK", ")", ";", "}", "}", "catch", "(", "RecognitionException", "pe", ")", "{", "synPredMatched68", "=", "false", ";", "}", "rewind", "(", "_m68", ")", ";", "inputState", ".", "guessing", "--", ";", "}", "if", "(", "synPredMatched68", ")", "{", "declaratorBrackets", "(", "bt_AST", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "returnAST", ")", ";", "}", "else", "if", "(", "(", "_tokenSet_41", ".", "member", "(", "LA", "(", "1", ")", ")", ")", "&&", "(", "_tokenSet_4", ".", "member", "(", "LA", "(", "2", ")", ")", ")", ")", "{", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "require", "(", "false", ",", "\"\"", ",", "\"\"", ")", ";", "}", "}", "else", "{", "throw", "new", "NoViableAltException", "(", "LT", "(", "1", ")", ",", "getFilename", "(", ")", ")", ";", "}", "}", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "builtInTypeArraySpec_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "if", "(", "addImagNode", ")", "{", "builtInTypeArraySpec_AST", "=", "(", "AST", ")", "astFactory", ".", "make", "(", "(", "new", "ASTArray", "(", "2", ")", ")", ".", "add", "(", "create", "(", "TYPE", ",", "\"TYPE\"", ",", "first", ",", "LT", "(", "1", ")", ")", ")", ".", "add", "(", "builtInTypeArraySpec_AST", ")", ")", ";", "}", "currentAST", ".", "root", "=", "builtInTypeArraySpec_AST", ";", "currentAST", ".", "child", "=", "builtInTypeArraySpec_AST", "!=", "null", "&&", "builtInTypeArraySpec_AST", ".", "getFirstChild", "(", ")", "!=", "null", "?", "builtInTypeArraySpec_AST", ".", "getFirstChild", "(", ")", ":", "builtInTypeArraySpec_AST", ";", "currentAST", ".", "advanceChildToEnd", "(", ")", ";", "}", "builtInTypeArraySpec_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "returnAST", "=", "builtInTypeArraySpec_AST", ";", "}", "public", "final", "void", "typeArgument", "(", ")", "throws", "RecognitionException", ",", "TokenStreamException", "{", "returnAST", "=", "null", ";", "ASTPair", "currentAST", "=", "new", "ASTPair", "(", ")", ";", "AST", "typeArgument_AST", "=", "null", ";", "Token", "first", "=", "LT", "(", "1", ")", ";", "{", "switch", "(", "LA", "(", "1", ")", ")", "{", "case", "IDENT", ":", "case", "LITERAL_void", ":", "case", "LITERAL_boolean", ":", "case", "LITERAL_byte", ":", "case", "LITERAL_char", ":", "case", "LITERAL_short", ":", "case", "LITERAL_int", ":", "case", "LITERAL_float", ":", "case", "LITERAL_long", ":", "case", "LITERAL_double", ":", "{", "typeArgumentSpec", "(", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "returnAST", ")", ";", "break", ";", "}", "case", "QUESTION", ":", "{", "wildcardType", "(", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "returnAST", ")", ";", "break", ";", "}", "default", ":", "{", "throw", "new", "NoViableAltException", "(", "LT", "(", "1", ")", ",", "getFilename", "(", ")", ")", ";", "}", "}", "}", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "typeArgument_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "typeArgument_AST", "=", "(", "AST", ")", "astFactory", ".", "make", "(", "(", "new", "ASTArray", "(", "2", ")", ")", ".", "add", "(", "create", "(", "TYPE_ARGUMENT", ",", "\"\"", ",", "first", ",", "LT", "(", "1", ")", ")", ")", ".", "add", "(", "typeArgument_AST", ")", ")", ";", "currentAST", ".", "root", "=", "typeArgument_AST", ";", "currentAST", ".", "child", "=", "typeArgument_AST", "!=", "null", "&&", "typeArgument_AST", ".", "getFirstChild", "(", ")", "!=", "null", "?", "typeArgument_AST", ".", "getFirstChild", "(", ")", ":", "typeArgument_AST", ";", "currentAST", ".", "advanceChildToEnd", "(", ")", ";", "}", "typeArgument_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "returnAST", "=", "typeArgument_AST", ";", "}", "public", "final", "void", "wildcardType", "(", ")", "throws", "RecognitionException", ",", "TokenStreamException", "{", "returnAST", "=", "null", ";", "ASTPair", "currentAST", "=", "new", "ASTPair", "(", ")", ";", "AST", "wildcardType_AST", "=", "null", ";", "AST", "tmp91_AST", "=", "null", ";", "tmp91_AST", "=", "astFactory", ".", "create", "(", "LT", "(", "1", ")", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "tmp91_AST", ")", ";", "match", "(", "QUESTION", ")", ";", "{", "boolean", "synPredMatched56", "=", "false", ";", "if", "(", "(", "(", "LA", "(", "1", ")", "==", "LITERAL_extends", "||", "LA", "(", "1", ")", "==", "LITERAL_super", ")", "&&", "(", "LA", "(", "2", ")", "==", "IDENT", "||", "LA", "(", "2", ")", "==", "NLS", ")", ")", ")", "{", "int", "_m56", "=", "mark", "(", ")", ";", "synPredMatched56", "=", "true", ";", "inputState", ".", "guessing", "++", ";", "try", "{", "{", "switch", "(", "LA", "(", "1", ")", ")", "{", "case", "LITERAL_extends", ":", "{", "match", "(", "LITERAL_extends", ")", ";", "break", ";", "}", "case", "LITERAL_super", ":", "{", "match", "(", "LITERAL_super", ")", ";", "break", ";", "}", "default", ":", "{", "throw", "new", "NoViableAltException", "(", "LT", "(", "1", ")", ",", "getFilename", "(", ")", ")", ";", "}", "}", "}", "}", "catch", "(", "RecognitionException", "pe", ")", "{", "synPredMatched56", "=", "false", ";", "}", "rewind", "(", "_m56", ")", ";", "inputState", ".", "guessing", "--", ";", "}", "if", "(", "synPredMatched56", ")", "{", "typeArgumentBounds", "(", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "returnAST", ")", ";", "}", "else", "if", "(", "(", "_tokenSet_41", ".", "member", "(", "LA", "(", "1", ")", ")", ")", "&&", "(", "_tokenSet_4", ".", "member", "(", "LA", "(", "2", ")", ")", ")", ")", "{", "}", "else", "{", "throw", "new", "NoViableAltException", "(", "LT", "(", "1", ")", ",", "getFilename", "(", ")", ")", ";", "}", "}", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "wildcardType_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "wildcardType_AST", ".", "setType", "(", "WILDCARD_TYPE", ")", ";", "}", "wildcardType_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "returnAST", "=", "wildcardType_AST", ";", "}", "public", "final", "void", "typeArgumentBounds", "(", ")", "throws", "RecognitionException", ",", "TokenStreamException", "{", "returnAST", "=", "null", ";", "ASTPair", "currentAST", "=", "new", "ASTPair", "(", ")", ";", "AST", "typeArgumentBounds_AST", "=", "null", ";", "Token", "first", "=", "LT", "(", "1", ")", ";", "boolean", "isUpperBounds", "=", "false", ";", "{", "switch", "(", "LA", "(", "1", ")", ")", "{", "case", "LITERAL_extends", ":", "{", "match", "(", "LITERAL_extends", ")", ";", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "isUpperBounds", "=", "true", ";", "}", "break", ";", "}", "case", "LITERAL_super", ":", "{", "match", "(", "LITERAL_super", ")", ";", "break", ";", "}", "default", ":", "{", "throw", "new", "NoViableAltException", "(", "LT", "(", "1", ")", ",", "getFilename", "(", ")", ")", ";", "}", "}", "}", "nls", "(", ")", ";", "classOrInterfaceType", "(", "true", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "returnAST", ")", ";", "nls", "(", ")", ";", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "typeArgumentBounds_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "if", "(", "isUpperBounds", ")", "{", "typeArgumentBounds_AST", "=", "(", "AST", ")", "astFactory", ".", "make", "(", "(", "new", "ASTArray", "(", "2", ")", ")", ".", "add", "(", "create", "(", "TYPE_UPPER_BOUNDS", ",", "\"\"", ",", "first", ",", "LT", "(", "1", ")", ")", ")", ".", "add", "(", "typeArgumentBounds_AST", ")", ")", ";", "}", "else", "{", "typeArgumentBounds_AST", "=", "(", "AST", ")", "astFactory", ".", "make", "(", "(", "new", "ASTArray", "(", "2", ")", ")", ".", "add", "(", "create", "(", "TYPE_LOWER_BOUNDS", ",", "\"\"", ",", "first", ",", "LT", "(", "1", ")", ")", ")", ".", "add", "(", "typeArgumentBounds_AST", ")", ")", ";", "}", "currentAST", ".", "root", "=", "typeArgumentBounds_AST", ";", "currentAST", ".", "child", "=", "typeArgumentBounds_AST", "!=", "null", "&&", "typeArgumentBounds_AST", ".", "getFirstChild", "(", ")", "!=", "null", "?", "typeArgumentBounds_AST", ".", "getFirstChild", "(", ")", ":", "typeArgumentBounds_AST", ";", "currentAST", ".", "advanceChildToEnd", "(", ")", ";", "}", "typeArgumentBounds_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "returnAST", "=", "typeArgumentBounds_AST", ";", "}", "protected", "final", "void", "typeArgumentsOrParametersEnd", "(", ")", "throws", "RecognitionException", ",", "TokenStreamException", "{", "returnAST", "=", "null", ";", "ASTPair", "currentAST", "=", "new", "ASTPair", "(", ")", ";", "AST", "typeArgumentsOrParametersEnd_AST", "=", "null", ";", "switch", "(", "LA", "(", "1", ")", ")", "{", "case", "GT", ":", "{", "match", "(", "GT", ")", ";", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "ltCounter", "-=", "1", ";", "}", "typeArgumentsOrParametersEnd_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "break", ";", "}", "case", "SR", ":", "{", "match", "(", "SR", ")", ";", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "ltCounter", "-=", "2", ";", "}", "typeArgumentsOrParametersEnd_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "break", ";", "}", "case", "BSR", ":", "{", "match", "(", "BSR", ")", ";", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "ltCounter", "-=", "3", ";", "}", "typeArgumentsOrParametersEnd_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "break", ";", "}", "default", ":", "{", "throw", "new", "NoViableAltException", "(", "LT", "(", "1", ")", ",", "getFilename", "(", ")", ")", ";", "}", "}", "returnAST", "=", "typeArgumentsOrParametersEnd_AST", ";", "}", "public", "final", "void", "type", "(", ")", "throws", "RecognitionException", ",", "TokenStreamException", "{", "returnAST", "=", "null", ";", "ASTPair", "currentAST", "=", "new", "ASTPair", "(", ")", ";", "AST", "type_AST", "=", "null", ";", "switch", "(", "LA", "(", "1", ")", ")", "{", "case", "IDENT", ":", "{", "classOrInterfaceType", "(", "false", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "returnAST", ")", ";", "type_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "break", ";", "}", "case", "LITERAL_void", ":", "case", "LITERAL_boolean", ":", "case", "LITERAL_byte", ":", "case", "LITERAL_char", ":", "case", "LITERAL_short", ":", "case", "LITERAL_int", ":", "case", "LITERAL_float", ":", "case", "LITERAL_long", ":", "case", "LITERAL_double", ":", "{", "builtInType", "(", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "returnAST", ")", ";", "type_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "break", ";", "}", "default", ":", "{", "throw", "new", "NoViableAltException", "(", "LT", "(", "1", ")", ",", "getFilename", "(", ")", ")", ";", "}", "}", "returnAST", "=", "type_AST", ";", "}", "public", "final", "void", "modifiersInternal", "(", ")", "throws", "RecognitionException", ",", "TokenStreamException", "{", "returnAST", "=", "null", ";", "ASTPair", "currentAST", "=", "new", "ASTPair", "(", ")", ";", "AST", "modifiersInternal_AST", "=", "null", ";", "int", "seenDef", "=", "0", ";", "{", "int", "_cnt81", "=", "0", ";", "_loop81", ":", "do", "{", "if", "(", "(", "(", "LA", "(", "1", ")", "==", "LITERAL_def", ")", ")", "&&", "(", "seenDef", "++", "==", "0", ")", ")", "{", "match", "(", "LITERAL_def", ")", ";", "nls", "(", ")", ";", "}", "else", "if", "(", "(", "_tokenSet_47", ".", "member", "(", "LA", "(", "1", ")", ")", ")", ")", "{", "modifier", "(", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "returnAST", ")", ";", "nls", "(", ")", ";", "}", "else", "if", "(", "(", "LA", "(", "1", ")", "==", "AT", ")", "&&", "(", "LA", "(", "2", ")", "==", "LITERAL_interface", ")", ")", "{", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "break", ";", "}", "AST", "tmp98_AST", "=", "null", ";", "tmp98_AST", "=", "astFactory", ".", "create", "(", "LT", "(", "1", ")", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "tmp98_AST", ")", ";", "match", "(", "AT", ")", ";", "AST", "tmp99_AST", "=", "null", ";", "tmp99_AST", "=", "astFactory", ".", "create", "(", "LT", "(", "1", ")", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "tmp99_AST", ")", ";", "match", "(", "LITERAL_interface", ")", ";", "}", "else", "if", "(", "(", "LA", "(", "1", ")", "==", "AT", ")", "&&", "(", "LA", "(", "2", ")", "==", "IDENT", ")", ")", "{", "annotation", "(", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "returnAST", ")", ";", "nls", "(", ")", ";", "}", "else", "{", "if", "(", "_cnt81", ">=", "1", ")", "{", "break", "_loop81", ";", "}", "else", "{", "throw", "new", "NoViableAltException", "(", "LT", "(", "1", ")", ",", "getFilename", "(", ")", ")", ";", "}", "}", "_cnt81", "++", ";", "}", "while", "(", "true", ")", ";", "}", "modifiersInternal_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "returnAST", "=", "modifiersInternal_AST", ";", "}", "public", "final", "void", "annotationArguments", "(", ")", "throws", "RecognitionException", ",", "TokenStreamException", "{", "returnAST", "=", "null", ";", "ASTPair", "currentAST", "=", "new", "ASTPair", "(", ")", ";", "AST", "annotationArguments_AST", "=", "null", ";", "AST", "v_AST", "=", "null", ";", "if", "(", "(", "_tokenSet_48", ".", "member", "(", "LA", "(", "1", ")", ")", ")", "&&", "(", "_tokenSet_49", ".", "member", "(", "LA", "(", "2", ")", ")", ")", ")", "{", "annotationMemberValueInitializer", "(", ")", ";", "v_AST", "=", "(", "AST", ")", "returnAST", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "returnAST", ")", ";", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "annotationArguments_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "Token", "itkn", "=", "new", "Token", "(", "IDENT", ",", "\"value\"", ")", ";", "AST", "i", ";", "i", "=", "(", "AST", ")", "astFactory", ".", "make", "(", "(", "new", "ASTArray", "(", "1", ")", ")", ".", "add", "(", "create", "(", "IDENT", ",", "\"value\"", ",", "itkn", ",", "itkn", ")", ")", ")", ";", "annotationArguments_AST", "=", "(", "AST", ")", "astFactory", ".", "make", "(", "(", "new", "ASTArray", "(", "3", ")", ")", ".", "add", "(", "create", "(", "ANNOTATION_MEMBER_VALUE_PAIR", ",", "\"\"", ",", "LT", "(", "1", ")", ",", "LT", "(", "1", ")", ")", ")", ".", "add", "(", "i", ")", ".", "add", "(", "v_AST", ")", ")", ";", "currentAST", ".", "root", "=", "annotationArguments_AST", ";", "currentAST", ".", "child", "=", "annotationArguments_AST", "!=", "null", "&&", "annotationArguments_AST", ".", "getFirstChild", "(", ")", "!=", "null", "?", "annotationArguments_AST", ".", "getFirstChild", "(", ")", ":", "annotationArguments_AST", ";", "currentAST", ".", "advanceChildToEnd", "(", ")", ";", "}", "annotationArguments_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "}", "else", "if", "(", "(", "_tokenSet_50", ".", "member", "(", "LA", "(", "1", ")", ")", ")", "&&", "(", "LA", "(", "2", ")", "==", "ASSIGN", ")", ")", "{", "annotationMemberValuePairs", "(", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "returnAST", ")", ";", "annotationArguments_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "}", "else", "{", "throw", "new", "NoViableAltException", "(", "LT", "(", "1", ")", ",", "getFilename", "(", ")", ")", ";", "}", "returnAST", "=", "annotationArguments_AST", ";", "}", "public", "final", "void", "annotationsInternal", "(", ")", "throws", "RecognitionException", ",", "TokenStreamException", "{", "returnAST", "=", "null", ";", "ASTPair", "currentAST", "=", "new", "ASTPair", "(", ")", ";", "AST", "annotationsInternal_AST", "=", "null", ";", "{", "_loop91", ":", "do", "{", "if", "(", "(", "LA", "(", "1", ")", "==", "AT", ")", "&&", "(", "LA", "(", "2", ")", "==", "LITERAL_interface", ")", ")", "{", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "break", ";", "}", "AST", "tmp100_AST", "=", "null", ";", "tmp100_AST", "=", "astFactory", ".", "create", "(", "LT", "(", "1", ")", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "tmp100_AST", ")", ";", "match", "(", "AT", ")", ";", "AST", "tmp101_AST", "=", "null", ";", "tmp101_AST", "=", "astFactory", ".", "create", "(", "LT", "(", "1", ")", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "tmp101_AST", ")", ";", "match", "(", "LITERAL_interface", ")", ";", "}", "else", "if", "(", "(", "LA", "(", "1", ")", "==", "AT", ")", "&&", "(", "LA", "(", "2", ")", "==", "IDENT", ")", ")", "{", "annotation", "(", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "returnAST", ")", ";", "nls", "(", ")", ";", "}", "else", "{", "break", "_loop91", ";", "}", "}", "while", "(", "true", ")", ";", "}", "annotationsInternal_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "returnAST", "=", "annotationsInternal_AST", ";", "}", "public", "final", "void", "annotationMemberValueInitializer", "(", ")", "throws", "RecognitionException", ",", "TokenStreamException", "{", "returnAST", "=", "null", ";", "ASTPair", "currentAST", "=", "new", "ASTPair", "(", ")", ";", "AST", "annotationMemberValueInitializer_AST", "=", "null", ";", "switch", "(", "LA", "(", "1", ")", ")", "{", "case", "LBRACK", ":", "case", "IDENT", ":", "case", "STRING_LITERAL", ":", "case", "LPAREN", ":", "case", "LITERAL_super", ":", "case", "LITERAL_void", ":", "case", "LITERAL_boolean", ":", "case", "LITERAL_byte", ":", "case", "LITERAL_char", ":", "case", "LITERAL_short", ":", "case", "LITERAL_int", ":", "case", "LITERAL_float", ":", "case", "LITERAL_long", ":", "case", "LITERAL_double", ":", "case", "LCURLY", ":", "case", "LITERAL_this", ":", "case", "PLUS", ":", "case", "MINUS", ":", "case", "LITERAL_false", ":", "case", "LITERAL_new", ":", "case", "LITERAL_null", ":", "case", "LITERAL_true", ":", "case", "INC", ":", "case", "DEC", ":", "case", "BNOT", ":", "case", "LNOT", ":", "case", "STRING_CTOR_START", ":", "case", "NUM_INT", ":", "case", "NUM_FLOAT", ":", "case", "NUM_LONG", ":", "case", "NUM_DOUBLE", ":", "case", "NUM_BIG_INT", ":", "case", "NUM_BIG_DECIMAL", ":", "{", "conditionalExpression", "(", "0", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "returnAST", ")", ";", "annotationMemberValueInitializer_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "break", ";", "}", "case", "AT", ":", "{", "annotation", "(", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "returnAST", ")", ";", "annotationMemberValueInitializer_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "break", ";", "}", "default", ":", "{", "throw", "new", "NoViableAltException", "(", "LT", "(", "1", ")", ",", "getFilename", "(", ")", ")", ";", "}", "}", "returnAST", "=", "annotationMemberValueInitializer_AST", ";", "}", "public", "final", "void", "annotationMemberValuePairs", "(", ")", "throws", "RecognitionException", ",", "TokenStreamException", "{", "returnAST", "=", "null", ";", "ASTPair", "currentAST", "=", "new", "ASTPair", "(", ")", ";", "AST", "annotationMemberValuePairs_AST", "=", "null", ";", "annotationMemberValuePair", "(", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "returnAST", ")", ";", "{", "_loop97", ":", "do", "{", "if", "(", "(", "LA", "(", "1", ")", "==", "COMMA", ")", ")", "{", "match", "(", "COMMA", ")", ";", "nls", "(", ")", ";", "annotationMemberValuePair", "(", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "returnAST", ")", ";", "}", "else", "{", "break", "_loop97", ";", "}", "}", "while", "(", "true", ")", ";", "}", "annotationMemberValuePairs_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "returnAST", "=", "annotationMemberValuePairs_AST", ";", "}", "public", "final", "void", "annotationMemberValuePair", "(", ")", "throws", "RecognitionException", ",", "TokenStreamException", "{", "returnAST", "=", "null", ";", "ASTPair", "currentAST", "=", "new", "ASTPair", "(", ")", ";", "AST", "annotationMemberValuePair_AST", "=", "null", ";", "AST", "i_AST", "=", "null", ";", "AST", "v_AST", "=", "null", ";", "Token", "first", "=", "LT", "(", "1", ")", ";", "annotationIdent", "(", ")", ";", "i_AST", "=", "(", "AST", ")", "returnAST", ";", "match", "(", "ASSIGN", ")", ";", "nls", "(", ")", ";", "annotationMemberValueInitializer", "(", ")", ";", "v_AST", "=", "(", "AST", ")", "returnAST", ";", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "annotationMemberValuePair_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "annotationMemberValuePair_AST", "=", "(", "AST", ")", "astFactory", ".", "make", "(", "(", "new", "ASTArray", "(", "3", ")", ")", ".", "add", "(", "create", "(", "ANNOTATION_MEMBER_VALUE_PAIR", ",", "\"\"", ",", "first", ",", "LT", "(", "1", ")", ")", ")", ".", "add", "(", "i_AST", ")", ".", "add", "(", "v_AST", ")", ")", ";", "currentAST", ".", "root", "=", "annotationMemberValuePair_AST", ";", "currentAST", ".", "child", "=", "annotationMemberValuePair_AST", "!=", "null", "&&", "annotationMemberValuePair_AST", ".", "getFirstChild", "(", ")", "!=", "null", "?", "annotationMemberValuePair_AST", ".", "getFirstChild", "(", ")", ":", "annotationMemberValuePair_AST", ";", "currentAST", ".", "advanceChildToEnd", "(", ")", ";", "}", "returnAST", "=", "annotationMemberValuePair_AST", ";", "}", "public", "final", "void", "annotationIdent", "(", ")", "throws", "RecognitionException", ",", "TokenStreamException", "{", "returnAST", "=", "null", ";", "ASTPair", "currentAST", "=", "new", "ASTPair", "(", ")", ";", "AST", "annotationIdent_AST", "=", "null", ";", "switch", "(", "LA", "(", "1", ")", ")", "{", "case", "IDENT", ":", "{", "AST", "tmp104_AST", "=", "null", ";", "tmp104_AST", "=", "astFactory", ".", "create", "(", "LT", "(", "1", ")", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "tmp104_AST", ")", ";", "match", "(", "IDENT", ")", ";", "annotationIdent_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "break", ";", "}", "case", "FINAL", ":", "case", "ABSTRACT", ":", "case", "UNUSED_GOTO", ":", "case", "UNUSED_CONST", ":", "case", "UNUSED_DO", ":", "case", "STRICTFP", ":", "case", "LITERAL_package", ":", "case", "LITERAL_import", ":", "case", "LITERAL_static", ":", "case", "LITERAL_def", ":", "case", "LITERAL_class", ":", "case", "LITERAL_interface", ":", "case", "LITERAL_enum", ":", "case", "LITERAL_extends", ":", "case", "LITERAL_super", ":", "case", "LITERAL_void", ":", "case", "LITERAL_boolean", ":", "case", "LITERAL_byte", ":", "case", "LITERAL_char", ":", "case", "LITERAL_short", ":", "case", "LITERAL_int", ":", "case", "LITERAL_float", ":", "case", "LITERAL_long", ":", "case", "LITERAL_double", ":", "case", "LITERAL_as", ":", "case", "LITERAL_private", ":", "case", "LITERAL_public", ":", "case", "LITERAL_protected", ":", "case", "LITERAL_transient", ":", "case", "LITERAL_native", ":", "case", "LITERAL_threadsafe", ":", "case", "LITERAL_synchronized", ":", "case", "LITERAL_volatile", ":", "case", "LITERAL_default", ":", "case", "LITERAL_throws", ":", "case", "LITERAL_implements", ":", "case", "LITERAL_this", ":", "case", "LITERAL_if", ":", "case", "LITERAL_else", ":", "case", "LITERAL_while", ":", "case", "LITERAL_switch", ":", "case", "LITERAL_for", ":", "case", "LITERAL_in", ":", "case", "LITERAL_return", ":", "case", "LITERAL_break", ":", "case", "LITERAL_continue", ":", "case", "LITERAL_throw", ":", "case", "LITERAL_assert", ":", "case", "LITERAL_case", ":", "case", "LITERAL_try", ":", "case", "LITERAL_finally", ":", "case", "LITERAL_catch", ":", "case", "LITERAL_false", ":", "case", "LITERAL_instanceof", ":", "case", "LITERAL_new", ":", "case", "LITERAL_null", ":", "case", "LITERAL_true", ":", "{", "keywordPropertyNames", "(", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "returnAST", ")", ";", "annotationIdent_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "break", ";", "}", "default", ":", "{", "throw", "new", "NoViableAltException", "(", "LT", "(", "1", ")", ",", "getFilename", "(", ")", ")", ";", "}", "}", "returnAST", "=", "annotationIdent_AST", ";", "}", "public", "final", "void", "keywordPropertyNames", "(", ")", "throws", "RecognitionException", ",", "TokenStreamException", "{", "returnAST", "=", "null", ";", "ASTPair", "currentAST", "=", "new", "ASTPair", "(", ")", ";", "AST", "keywordPropertyNames_AST", "=", "null", ";", "{", "switch", "(", "LA", "(", "1", ")", ")", "{", "case", "LITERAL_as", ":", "{", "AST", "tmp105_AST", "=", "null", ";", "tmp105_AST", "=", "astFactory", ".", "create", "(", "LT", "(", "1", ")", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "tmp105_AST", ")", ";", "match", "(", "LITERAL_as", ")", ";", "break", ";", "}", "case", "LITERAL_assert", ":", "{", "AST", "tmp106_AST", "=", "null", ";", "tmp106_AST", "=", "astFactory", ".", "create", "(", "LT", "(", "1", ")", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "tmp106_AST", ")", ";", "match", "(", "LITERAL_assert", ")", ";", "break", ";", "}", "case", "LITERAL_break", ":", "{", "AST", "tmp107_AST", "=", "null", ";", "tmp107_AST", "=", "astFactory", ".", "create", "(", "LT", "(", "1", ")", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "tmp107_AST", ")", ";", "match", "(", "LITERAL_break", ")", ";", "break", ";", "}", "case", "LITERAL_case", ":", "{", "AST", "tmp108_AST", "=", "null", ";", "tmp108_AST", "=", "astFactory", ".", "create", "(", "LT", "(", "1", ")", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "tmp108_AST", ")", ";", "match", "(", "LITERAL_case", ")", ";", "break", ";", "}", "case", "LITERAL_catch", ":", "{", "AST", "tmp109_AST", "=", "null", ";", "tmp109_AST", "=", "astFactory", ".", "create", "(", "LT", "(", "1", ")", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "tmp109_AST", ")", ";", "match", "(", "LITERAL_catch", ")", ";", "break", ";", "}", "case", "LITERAL_class", ":", "{", "AST", "tmp110_AST", "=", "null", ";", "tmp110_AST", "=", "astFactory", ".", "create", "(", "LT", "(", "1", ")", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "tmp110_AST", ")", ";", "match", "(", "LITERAL_class", ")", ";", "break", ";", "}", "case", "UNUSED_CONST", ":", "{", "AST", "tmp111_AST", "=", "null", ";", "tmp111_AST", "=", "astFactory", ".", "create", "(", "LT", "(", "1", ")", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "tmp111_AST", ")", ";", "match", "(", "UNUSED_CONST", ")", ";", "break", ";", "}", "case", "LITERAL_continue", ":", "{", "AST", "tmp112_AST", "=", "null", ";", "tmp112_AST", "=", "astFactory", ".", "create", "(", "LT", "(", "1", ")", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "tmp112_AST", ")", ";", "match", "(", "LITERAL_continue", ")", ";", "break", ";", "}", "case", "LITERAL_def", ":", "{", "AST", "tmp113_AST", "=", "null", ";", "tmp113_AST", "=", "astFactory", ".", "create", "(", "LT", "(", "1", ")", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "tmp113_AST", ")", ";", "match", "(", "LITERAL_def", ")", ";", "break", ";", "}", "case", "LITERAL_default", ":", "{", "AST", "tmp114_AST", "=", "null", ";", "tmp114_AST", "=", "astFactory", ".", "create", "(", "LT", "(", "1", ")", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "tmp114_AST", ")", ";", "match", "(", "LITERAL_default", ")", ";", "break", ";", "}", "case", "UNUSED_DO", ":", "{", "AST", "tmp115_AST", "=", "null", ";", "tmp115_AST", "=", "astFactory", ".", "create", "(", "LT", "(", "1", ")", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "tmp115_AST", ")", ";", "match", "(", "UNUSED_DO", ")", ";", "break", ";", "}", "case", "LITERAL_else", ":", "{", "AST", "tmp116_AST", "=", "null", ";", "tmp116_AST", "=", "astFactory", ".", "create", "(", "LT", "(", "1", ")", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "tmp116_AST", ")", ";", "match", "(", "LITERAL_else", ")", ";", "break", ";", "}", "case", "LITERAL_enum", ":", "{", "AST", "tmp117_AST", "=", "null", ";", "tmp117_AST", "=", "astFactory", ".", "create", "(", "LT", "(", "1", ")", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "tmp117_AST", ")", ";", "match", "(", "LITERAL_enum", ")", ";", "break", ";", "}", "case", "LITERAL_extends", ":", "{", "AST", "tmp118_AST", "=", "null", ";", "tmp118_AST", "=", "astFactory", ".", "create", "(", "LT", "(", "1", ")", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "tmp118_AST", ")", ";", "match", "(", "LITERAL_extends", ")", ";", "break", ";", "}", "case", "LITERAL_false", ":", "{", "AST", "tmp119_AST", "=", "null", ";", "tmp119_AST", "=", "astFactory", ".", "create", "(", "LT", "(", "1", ")", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "tmp119_AST", ")", ";", "match", "(", "LITERAL_false", ")", ";", "break", ";", "}", "case", "LITERAL_finally", ":", "{", "AST", "tmp120_AST", "=", "null", ";", "tmp120_AST", "=", "astFactory", ".", "create", "(", "LT", "(", "1", ")", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "tmp120_AST", ")", ";", "match", "(", "LITERAL_finally", ")", ";", "break", ";", "}", "case", "LITERAL_for", ":", "{", "AST", "tmp121_AST", "=", "null", ";", "tmp121_AST", "=", "astFactory", ".", "create", "(", "LT", "(", "1", ")", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "tmp121_AST", ")", ";", "match", "(", "LITERAL_for", ")", ";", "break", ";", "}", "case", "UNUSED_GOTO", ":", "{", "AST", "tmp122_AST", "=", "null", ";", "tmp122_AST", "=", "astFactory", ".", "create", "(", "LT", "(", "1", ")", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "tmp122_AST", ")", ";", "match", "(", "UNUSED_GOTO", ")", ";", "break", ";", "}", "case", "LITERAL_if", ":", "{", "AST", "tmp123_AST", "=", "null", ";", "tmp123_AST", "=", "astFactory", ".", "create", "(", "LT", "(", "1", ")", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "tmp123_AST", ")", ";", "match", "(", "LITERAL_if", ")", ";", "break", ";", "}", "case", "LITERAL_implements", ":", "{", "AST", "tmp124_AST", "=", "null", ";", "tmp124_AST", "=", "astFactory", ".", "create", "(", "LT", "(", "1", ")", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "tmp124_AST", ")", ";", "match", "(", "LITERAL_implements", ")", ";", "break", ";", "}", "case", "LITERAL_import", ":", "{", "AST", "tmp125_AST", "=", "null", ";", "tmp125_AST", "=", "astFactory", ".", "create", "(", "LT", "(", "1", ")", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "tmp125_AST", ")", ";", "match", "(", "LITERAL_import", ")", ";", "break", ";", "}", "case", "LITERAL_in", ":", "{", "AST", "tmp126_AST", "=", "null", ";", "tmp126_AST", "=", "astFactory", ".", "create", "(", "LT", "(", "1", ")", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "tmp126_AST", ")", ";", "match", "(", "LITERAL_in", ")", ";", "break", ";", "}", "case", "LITERAL_instanceof", ":", "{", "AST", "tmp127_AST", "=", "null", ";", "tmp127_AST", "=", "astFactory", ".", "create", "(", "LT", "(", "1", ")", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "tmp127_AST", ")", ";", "match", "(", "LITERAL_instanceof", ")", ";", "break", ";", "}", "case", "LITERAL_interface", ":", "{", "AST", "tmp128_AST", "=", "null", ";", "tmp128_AST", "=", "astFactory", ".", "create", "(", "LT", "(", "1", ")", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "tmp128_AST", ")", ";", "match", "(", "LITERAL_interface", ")", ";", "break", ";", "}", "case", "LITERAL_new", ":", "{", "AST", "tmp129_AST", "=", "null", ";", "tmp129_AST", "=", "astFactory", ".", "create", "(", "LT", "(", "1", ")", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "tmp129_AST", ")", ";", "match", "(", "LITERAL_new", ")", ";", "break", ";", "}", "case", "LITERAL_null", ":", "{", "AST", "tmp130_AST", "=", "null", ";", "tmp130_AST", "=", "astFactory", ".", "create", "(", "LT", "(", "1", ")", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "tmp130_AST", ")", ";", "match", "(", "LITERAL_null", ")", ";", "break", ";", "}", "case", "LITERAL_package", ":", "{", "AST", "tmp131_AST", "=", "null", ";", "tmp131_AST", "=", "astFactory", ".", "create", "(", "LT", "(", "1", ")", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "tmp131_AST", ")", ";", "match", "(", "LITERAL_package", ")", ";", "break", ";", "}", "case", "LITERAL_return", ":", "{", "AST", "tmp132_AST", "=", "null", ";", "tmp132_AST", "=", "astFactory", ".", "create", "(", "LT", "(", "1", ")", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "tmp132_AST", ")", ";", "match", "(", "LITERAL_return", ")", ";", "break", ";", "}", "case", "LITERAL_super", ":", "{", "AST", "tmp133_AST", "=", "null", ";", "tmp133_AST", "=", "astFactory", ".", "create", "(", "LT", "(", "1", ")", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "tmp133_AST", ")", ";", "match", "(", "LITERAL_super", ")", ";", "break", ";", "}", "case", "LITERAL_switch", ":", "{", "AST", "tmp134_AST", "=", "null", ";", "tmp134_AST", "=", "astFactory", ".", "create", "(", "LT", "(", "1", ")", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "tmp134_AST", ")", ";", "match", "(", "LITERAL_switch", ")", ";", "break", ";", "}", "case", "LITERAL_this", ":", "{", "AST", "tmp135_AST", "=", "null", ";", "tmp135_AST", "=", "astFactory", ".", "create", "(", "LT", "(", "1", ")", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "tmp135_AST", ")", ";", "match", "(", "LITERAL_this", ")", ";", "break", ";", "}", "case", "LITERAL_throw", ":", "{", "AST", "tmp136_AST", "=", "null", ";", "tmp136_AST", "=", "astFactory", ".", "create", "(", "LT", "(", "1", ")", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "tmp136_AST", ")", ";", "match", "(", "LITERAL_throw", ")", ";", "break", ";", "}", "case", "LITERAL_throws", ":", "{", "AST", "tmp137_AST", "=", "null", ";", "tmp137_AST", "=", "astFactory", ".", "create", "(", "LT", "(", "1", ")", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "tmp137_AST", ")", ";", "match", "(", "LITERAL_throws", ")", ";", "break", ";", "}", "case", "LITERAL_true", ":", "{", "AST", "tmp138_AST", "=", "null", ";", "tmp138_AST", "=", "astFactory", ".", "create", "(", "LT", "(", "1", ")", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "tmp138_AST", ")", ";", "match", "(", "LITERAL_true", ")", ";", "break", ";", "}", "case", "LITERAL_try", ":", "{", "AST", "tmp139_AST", "=", "null", ";", "tmp139_AST", "=", "astFactory", ".", "create", "(", "LT", "(", "1", ")", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "tmp139_AST", ")", ";", "match", "(", "LITERAL_try", ")", ";", "break", ";", "}", "case", "LITERAL_while", ":", "{", "AST", "tmp140_AST", "=", "null", ";", "tmp140_AST", "=", "astFactory", ".", "create", "(", "LT", "(", "1", ")", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "tmp140_AST", ")", ";", "match", "(", "LITERAL_while", ")", ";", "break", ";", "}", "case", "FINAL", ":", "case", "ABSTRACT", ":", "case", "STRICTFP", ":", "case", "LITERAL_static", ":", "case", "LITERAL_private", ":", "case", "LITERAL_public", ":", "case", "LITERAL_protected", ":", "case", "LITERAL_transient", ":", "case", "LITERAL_native", ":", "case", "LITERAL_threadsafe", ":", "case", "LITERAL_synchronized", ":", "case", "LITERAL_volatile", ":", "{", "modifier", "(", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "returnAST", ")", ";", "break", ";", "}", "case", "LITERAL_void", ":", "case", "LITERAL_boolean", ":", "case", "LITERAL_byte", ":", "case", "LITERAL_char", ":", "case", "LITERAL_short", ":", "case", "LITERAL_int", ":", "case", "LITERAL_float", ":", "case", "LITERAL_long", ":", "case", "LITERAL_double", ":", "{", "builtInType", "(", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "returnAST", ")", ";", "break", ";", "}", "default", ":", "{", "throw", "new", "NoViableAltException", "(", "LT", "(", "1", ")", ",", "getFilename", "(", ")", ")", ";", "}", "}", "}", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "keywordPropertyNames_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "keywordPropertyNames_AST", ".", "setType", "(", "IDENT", ")", ";", "}", "keywordPropertyNames_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "returnAST", "=", "keywordPropertyNames_AST", ";", "}", "public", "final", "void", "conditionalExpression", "(", "int", "lc_stmt", ")", "throws", "RecognitionException", ",", "TokenStreamException", "{", "returnAST", "=", "null", ";", "ASTPair", "currentAST", "=", "new", "ASTPair", "(", ")", ";", "AST", "conditionalExpression_AST", "=", "null", ";", "logicalOrExpression", "(", "lc_stmt", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "returnAST", ")", ";", "{", "switch", "(", "LA", "(", "1", ")", ")", "{", "case", "ELVIS_OPERATOR", ":", "{", "AST", "tmp141_AST", "=", "null", ";", "tmp141_AST", "=", "astFactory", ".", "create", "(", "LT", "(", "1", ")", ")", ";", "astFactory", ".", "makeASTRoot", "(", "currentAST", ",", "tmp141_AST", ")", ";", "match", "(", "ELVIS_OPERATOR", ")", ";", "nls", "(", ")", ";", "conditionalExpression", "(", "0", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "returnAST", ")", ";", "break", ";", "}", "case", "QUESTION", ":", "{", "AST", "tmp142_AST", "=", "null", ";", "tmp142_AST", "=", "astFactory", ".", "create", "(", "LT", "(", "1", ")", ")", ";", "astFactory", ".", "makeASTRoot", "(", "currentAST", ",", "tmp142_AST", ")", ";", "match", "(", "QUESTION", ")", ";", "nls", "(", ")", ";", "assignmentExpression", "(", "0", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "returnAST", ")", ";", "nls", "(", ")", ";", "match", "(", "COLON", ")", ";", "nls", "(", ")", ";", "conditionalExpression", "(", "0", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "returnAST", ")", ";", "break", ";", "}", "case", "EOF", ":", "case", "FINAL", ":", "case", "ABSTRACT", ":", "case", "UNUSED_GOTO", ":", "case", "UNUSED_CONST", ":", "case", "UNUSED_DO", ":", "case", "STRICTFP", ":", "case", "LITERAL_package", ":", "case", "LITERAL_import", ":", "case", "LITERAL_static", ":", "case", "LITERAL_def", ":", "case", "LBRACK", ":", "case", "RBRACK", ":", "case", "IDENT", ":", "case", "STRING_LITERAL", ":", "case", "LPAREN", ":", "case", "LITERAL_class", ":", "case", "LITERAL_interface", ":", "case", "LITERAL_enum", ":", "case", "LITERAL_extends", ":", "case", "LITERAL_super", ":", "case", "COMMA", ":", "case", "LITERAL_void", ":", "case", "LITERAL_boolean", ":", "case", "LITERAL_byte", ":", "case", "LITERAL_char", ":", "case", "LITERAL_short", ":", "case", "LITERAL_int", ":", "case", "LITERAL_float", ":", "case", "LITERAL_long", ":", "case", "LITERAL_double", ":", "case", "LITERAL_as", ":", "case", "LITERAL_private", ":", "case", "LITERAL_public", ":", "case", "LITERAL_protected", ":", "case", "LITERAL_transient", ":", "case", "LITERAL_native", ":", "case", "LITERAL_threadsafe", ":", "case", "LITERAL_synchronized", ":", "case", "LITERAL_volatile", ":", "case", "RPAREN", ":", "case", "ASSIGN", ":", "case", "LCURLY", ":", "case", "RCURLY", ":", "case", "SEMI", ":", "case", "LITERAL_default", ":", "case", "LITERAL_throws", ":", "case", "LITERAL_implements", ":", "case", "LITERAL_this", ":", "case", "CLOSABLE_BLOCK_OP", ":", "case", "COLON", ":", "case", "LITERAL_if", ":", "case", "LITERAL_else", ":", "case", "LITERAL_while", ":", "case", "LITERAL_switch", ":", "case", "LITERAL_for", ":", "case", "LITERAL_in", ":", "case", "LITERAL_return", ":", "case", "LITERAL_break", ":", "case", "LITERAL_continue", ":", "case", "LITERAL_throw", ":", "case", "LITERAL_assert", ":", "case", "PLUS", ":", "case", "MINUS", ":", "case", "LITERAL_case", ":", "case", "LITERAL_try", ":", "case", "LITERAL_finally", ":", "case", "LITERAL_catch", ":", "case", "LITERAL_false", ":", "case", "LITERAL_instanceof", ":", "case", "LITERAL_new", ":", "case", "LITERAL_null", ":", "case", "LITERAL_true", ":", "case", "PLUS_ASSIGN", ":", "case", "MINUS_ASSIGN", ":", "case", "STAR_ASSIGN", ":", "case", "DIV_ASSIGN", ":", "case", "MOD_ASSIGN", ":", "case", "SR_ASSIGN", ":", "case", "BSR_ASSIGN", ":", "case", "SL_ASSIGN", ":", "case", "BAND_ASSIGN", ":", "case", "BXOR_ASSIGN", ":", "case", "BOR_ASSIGN", ":", "case", "STAR_STAR_ASSIGN", ":", "case", "INC", ":", "case", "DEC", ":", "case", "BNOT", ":", "case", "LNOT", ":", "case", "STRING_CTOR_START", ":", "case", "NUM_INT", ":", "case", "NUM_FLOAT", ":", "case", "NUM_LONG", ":", "case", "NUM_DOUBLE", ":", "case", "NUM_BIG_INT", ":", "case", "NUM_BIG_DECIMAL", ":", "case", "NLS", ":", "{", "break", ";", "}", "default", ":", "{", "throw", "new", "NoViableAltException", "(", "LT", "(", "1", ")", ",", "getFilename", "(", ")", ")", ";", "}", "}", "}", "conditionalExpression_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "returnAST", "=", "conditionalExpression_AST", ";", "}", "public", "final", "void", "annotationMemberArrayValueInitializer", "(", ")", "throws", "RecognitionException", ",", "TokenStreamException", "{", "returnAST", "=", "null", ";", "ASTPair", "currentAST", "=", "new", "ASTPair", "(", ")", ";", "AST", "annotationMemberArrayValueInitializer_AST", "=", "null", ";", "switch", "(", "LA", "(", "1", ")", ")", "{", "case", "LBRACK", ":", "case", "IDENT", ":", "case", "STRING_LITERAL", ":", "case", "LPAREN", ":", "case", "LITERAL_super", ":", "case", "LITERAL_void", ":", "case", "LITERAL_boolean", ":", "case", "LITERAL_byte", ":", "case", "LITERAL_char", ":", "case", "LITERAL_short", ":", "case", "LITERAL_int", ":", "case", "LITERAL_float", ":", "case", "LITERAL_long", ":", "case", "LITERAL_double", ":", "case", "LCURLY", ":", "case", "LITERAL_this", ":", "case", "PLUS", ":", "case", "MINUS", ":", "case", "LITERAL_false", ":", "case", "LITERAL_new", ":", "case", "LITERAL_null", ":", "case", "LITERAL_true", ":", "case", "INC", ":", "case", "DEC", ":", "case", "BNOT", ":", "case", "LNOT", ":", "case", "STRING_CTOR_START", ":", "case", "NUM_INT", ":", "case", "NUM_FLOAT", ":", "case", "NUM_LONG", ":", "case", "NUM_DOUBLE", ":", "case", "NUM_BIG_INT", ":", "case", "NUM_BIG_DECIMAL", ":", "{", "conditionalExpression", "(", "0", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "returnAST", ")", ";", "annotationMemberArrayValueInitializer_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "break", ";", "}", "case", "AT", ":", "{", "annotation", "(", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "returnAST", ")", ";", "nls", "(", ")", ";", "annotationMemberArrayValueInitializer_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "break", ";", "}", "default", ":", "{", "throw", "new", "NoViableAltException", "(", "LT", "(", "1", ")", ",", "getFilename", "(", ")", ")", ";", "}", "}", "returnAST", "=", "annotationMemberArrayValueInitializer_AST", ";", "}", "public", "final", "void", "superClassClause", "(", ")", "throws", "RecognitionException", ",", "TokenStreamException", "{", "returnAST", "=", "null", ";", "ASTPair", "currentAST", "=", "new", "ASTPair", "(", ")", ";", "AST", "superClassClause_AST", "=", "null", ";", "AST", "c_AST", "=", "null", ";", "Token", "first", "=", "LT", "(", "1", ")", ";", "{", "switch", "(", "LA", "(", "1", ")", ")", "{", "case", "LITERAL_extends", ":", "{", "match", "(", "LITERAL_extends", ")", ";", "nls", "(", ")", ";", "classOrInterfaceType", "(", "false", ")", ";", "c_AST", "=", "(", "AST", ")", "returnAST", ";", "nls", "(", ")", ";", "break", ";", "}", "case", "EOF", ":", "case", "LCURLY", ":", "case", "RCURLY", ":", "case", "SEMI", ":", "case", "LITERAL_default", ":", "case", "LITERAL_implements", ":", "case", "LITERAL_else", ":", "case", "LITERAL_case", ":", "case", "NLS", ":", "{", "break", ";", "}", "default", ":", "{", "throw", "new", "NoViableAltException", "(", "LT", "(", "1", ")", ",", "getFilename", "(", ")", ")", ";", "}", "}", "}", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "superClassClause_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "superClassClause_AST", "=", "(", "AST", ")", "astFactory", ".", "make", "(", "(", "new", "ASTArray", "(", "2", ")", ")", ".", "add", "(", "create", "(", "EXTENDS_CLAUSE", ",", "\"\"", ",", "first", ",", "LT", "(", "1", ")", ")", ")", ".", "add", "(", "c_AST", ")", ")", ";", "currentAST", ".", "root", "=", "superClassClause_AST", ";", "currentAST", ".", "child", "=", "superClassClause_AST", "!=", "null", "&&", "superClassClause_AST", ".", "getFirstChild", "(", ")", "!=", "null", "?", "superClassClause_AST", ".", "getFirstChild", "(", ")", ":", "superClassClause_AST", ";", "currentAST", ".", "advanceChildToEnd", "(", ")", ";", "}", "returnAST", "=", "superClassClause_AST", ";", "}", "public", "final", "void", "implementsClause", "(", ")", "throws", "RecognitionException", ",", "TokenStreamException", "{", "returnAST", "=", "null", ";", "ASTPair", "currentAST", "=", "new", "ASTPair", "(", ")", ";", "AST", "implementsClause_AST", "=", "null", ";", "Token", "i", "=", "null", ";", "AST", "i_AST", "=", "null", ";", "Token", "first", "=", "LT", "(", "1", ")", ";", "{", "switch", "(", "LA", "(", "1", ")", ")", "{", "case", "LITERAL_implements", ":", "{", "i", "=", "LT", "(", "1", ")", ";", "i_AST", "=", "astFactory", ".", "create", "(", "i", ")", ";", "match", "(", "LITERAL_implements", ")", ";", "nls", "(", ")", ";", "classOrInterfaceType", "(", "true", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "returnAST", ")", ";", "{", "_loop190", ":", "do", "{", "if", "(", "(", "LA", "(", "1", ")", "==", "COMMA", ")", ")", "{", "match", "(", "COMMA", ")", ";", "nls", "(", ")", ";", "classOrInterfaceType", "(", "true", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "returnAST", ")", ";", "}", "else", "{", "break", "_loop190", ";", "}", "}", "while", "(", "true", ")", ";", "}", "nls", "(", ")", ";", "break", ";", "}", "case", "EOF", ":", "case", "LCURLY", ":", "case", "RCURLY", ":", "case", "SEMI", ":", "case", "LITERAL_default", ":", "case", "LITERAL_else", ":", "case", "LITERAL_case", ":", "case", "NLS", ":", "{", "break", ";", "}", "default", ":", "{", "throw", "new", "NoViableAltException", "(", "LT", "(", "1", ")", ",", "getFilename", "(", ")", ")", ";", "}", "}", "}", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "implementsClause_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "implementsClause_AST", "=", "(", "AST", ")", "astFactory", ".", "make", "(", "(", "new", "ASTArray", "(", "2", ")", ")", ".", "add", "(", "create", "(", "IMPLEMENTS_CLAUSE", ",", "\"\"", ",", "first", ",", "LT", "(", "1", ")", ")", ")", ".", "add", "(", "implementsClause_AST", ")", ")", ";", "currentAST", ".", "root", "=", "implementsClause_AST", ";", "currentAST", ".", "child", "=", "implementsClause_AST", "!=", "null", "&&", "implementsClause_AST", ".", "getFirstChild", "(", ")", "!=", "null", "?", "implementsClause_AST", ".", "getFirstChild", "(", ")", ":", "implementsClause_AST", ";", "currentAST", ".", "advanceChildToEnd", "(", ")", ";", "}", "implementsClause_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "returnAST", "=", "implementsClause_AST", ";", "}", "public", "final", "void", "classBlock", "(", ")", "throws", "RecognitionException", ",", "TokenStreamException", "{", "returnAST", "=", "null", ";", "ASTPair", "currentAST", "=", "new", "ASTPair", "(", ")", ";", "AST", "classBlock_AST", "=", "null", ";", "Token", "first", "=", "LT", "(", "1", ")", ";", "try", "{", "match", "(", "LCURLY", ")", ";", "{", "switch", "(", "LA", "(", "1", ")", ")", "{", "case", "FINAL", ":", "case", "ABSTRACT", ":", "case", "STRICTFP", ":", "case", "LITERAL_static", ":", "case", "LITERAL_def", ":", "case", "IDENT", ":", "case", "LITERAL_class", ":", "case", "LITERAL_interface", ":", "case", "LITERAL_enum", ":", "case", "AT", ":", "case", "LITERAL_void", ":", "case", "LITERAL_boolean", ":", "case", "LITERAL_byte", ":", "case", "LITERAL_char", ":", "case", "LITERAL_short", ":", "case", "LITERAL_int", ":", "case", "LITERAL_float", ":", "case", "LITERAL_long", ":", "case", "LITERAL_double", ":", "case", "LITERAL_private", ":", "case", "LITERAL_public", ":", "case", "LITERAL_protected", ":", "case", "LITERAL_transient", ":", "case", "LITERAL_native", ":", "case", "LITERAL_threadsafe", ":", "case", "LITERAL_synchronized", ":", "case", "LITERAL_volatile", ":", "case", "LCURLY", ":", "{", "classField", "(", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "returnAST", ")", ";", "break", ";", "}", "case", "RCURLY", ":", "case", "SEMI", ":", "case", "NLS", ":", "{", "break", ";", "}", "default", ":", "{", "throw", "new", "NoViableAltException", "(", "LT", "(", "1", ")", ",", "getFilename", "(", ")", ")", ";", "}", "}", "}", "{", "_loop125", ":", "do", "{", "if", "(", "(", "LA", "(", "1", ")", "==", "SEMI", "||", "LA", "(", "1", ")", "==", "NLS", ")", ")", "{", "sep", "(", ")", ";", "{", "switch", "(", "LA", "(", "1", ")", ")", "{", "case", "FINAL", ":", "case", "ABSTRACT", ":", "case", "STRICTFP", ":", "case", "LITERAL_static", ":", "case", "LITERAL_def", ":", "case", "IDENT", ":", "case", "LITERAL_class", ":", "case", "LITERAL_interface", ":", "case", "LITERAL_enum", ":", "case", "AT", ":", "case", "LITERAL_void", ":", "case", "LITERAL_boolean", ":", "case", "LITERAL_byte", ":", "case", "LITERAL_char", ":", "case", "LITERAL_short", ":", "case", "LITERAL_int", ":", "case", "LITERAL_float", ":", "case", "LITERAL_long", ":", "case", "LITERAL_double", ":", "case", "LITERAL_private", ":", "case", "LITERAL_public", ":", "case", "LITERAL_protected", ":", "case", "LITERAL_transient", ":", "case", "LITERAL_native", ":", "case", "LITERAL_threadsafe", ":", "case", "LITERAL_synchronized", ":", "case", "LITERAL_volatile", ":", "case", "LCURLY", ":", "{", "classField", "(", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "returnAST", ")", ";", "break", ";", "}", "case", "RCURLY", ":", "case", "SEMI", ":", "case", "NLS", ":", "{", "break", ";", "}", "default", ":", "{", "throw", "new", "NoViableAltException", "(", "LT", "(", "1", ")", ",", "getFilename", "(", ")", ")", ";", "}", "}", "}", "}", "else", "{", "break", "_loop125", ";", "}", "}", "while", "(", "true", ")", ";", "}", "match", "(", "RCURLY", ")", ";", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "classBlock_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "classBlock_AST", "=", "(", "AST", ")", "astFactory", ".", "make", "(", "(", "new", "ASTArray", "(", "2", ")", ")", ".", "add", "(", "create", "(", "OBJBLOCK", ",", "\"OBJBLOCK\"", ",", "first", ",", "LT", "(", "1", ")", ")", ")", ".", "add", "(", "classBlock_AST", ")", ")", ";", "currentAST", ".", "root", "=", "classBlock_AST", ";", "currentAST", ".", "child", "=", "classBlock_AST", "!=", "null", "&&", "classBlock_AST", ".", "getFirstChild", "(", ")", "!=", "null", "?", "classBlock_AST", ".", "getFirstChild", "(", ")", ":", "classBlock_AST", ";", "currentAST", ".", "advanceChildToEnd", "(", ")", ";", "}", "classBlock_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "}", "catch", "(", "RecognitionException", "e", ")", "{", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "if", "(", "errorList", ".", "isEmpty", "(", ")", ")", "{", "classBlock_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "}", "reportError", "(", "e", ")", ";", "classBlock_AST", "=", "(", "AST", ")", "astFactory", ".", "make", "(", "(", "new", "ASTArray", "(", "2", ")", ")", ".", "add", "(", "create", "(", "OBJBLOCK", ",", "\"OBJBLOCK\"", ",", "first", ",", "LT", "(", "1", ")", ")", ")", ".", "add", "(", "classBlock_AST", ")", ")", ";", "currentAST", ".", "root", "=", "classBlock_AST", ";", "currentAST", ".", "child", "=", "classBlock_AST", "!=", "null", "&&", "classBlock_AST", ".", "getFirstChild", "(", ")", "!=", "null", "?", "classBlock_AST", ".", "getFirstChild", "(", ")", ":", "classBlock_AST", ";", "currentAST", ".", "advanceChildToEnd", "(", ")", ";", "}", "else", "{", "throw", "e", ";", "}", "}", "returnAST", "=", "classBlock_AST", ";", "}", "public", "final", "void", "interfaceExtends", "(", ")", "throws", "RecognitionException", ",", "TokenStreamException", "{", "returnAST", "=", "null", ";", "ASTPair", "currentAST", "=", "new", "ASTPair", "(", ")", ";", "AST", "interfaceExtends_AST", "=", "null", ";", "Token", "e", "=", "null", ";", "AST", "e_AST", "=", "null", ";", "Token", "first", "=", "LT", "(", "1", ")", ";", "{", "switch", "(", "LA", "(", "1", ")", ")", "{", "case", "LITERAL_extends", ":", "{", "e", "=", "LT", "(", "1", ")", ";", "e_AST", "=", "astFactory", ".", "create", "(", "e", ")", ";", "match", "(", "LITERAL_extends", ")", ";", "nls", "(", ")", ";", "classOrInterfaceType", "(", "true", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "returnAST", ")", ";", "{", "_loop186", ":", "do", "{", "if", "(", "(", "LA", "(", "1", ")", "==", "COMMA", ")", ")", "{", "match", "(", "COMMA", ")", ";", "nls", "(", ")", ";", "classOrInterfaceType", "(", "true", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "returnAST", ")", ";", "}", "else", "{", "break", "_loop186", ";", "}", "}", "while", "(", "true", ")", ";", "}", "nls", "(", ")", ";", "break", ";", "}", "case", "LCURLY", ":", "{", "break", ";", "}", "default", ":", "{", "throw", "new", "NoViableAltException", "(", "LT", "(", "1", ")", ",", "getFilename", "(", ")", ")", ";", "}", "}", "}", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "interfaceExtends_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "interfaceExtends_AST", "=", "(", "AST", ")", "astFactory", ".", "make", "(", "(", "new", "ASTArray", "(", "2", ")", ")", ".", "add", "(", "create", "(", "EXTENDS_CLAUSE", ",", "\"\"", ",", "first", ",", "LT", "(", "1", ")", ")", ")", ".", "add", "(", "interfaceExtends_AST", ")", ")", ";", "currentAST", ".", "root", "=", "interfaceExtends_AST", ";", "currentAST", ".", "child", "=", "interfaceExtends_AST", "!=", "null", "&&", "interfaceExtends_AST", ".", "getFirstChild", "(", ")", "!=", "null", "?", "interfaceExtends_AST", ".", "getFirstChild", "(", ")", ":", "interfaceExtends_AST", ";", "currentAST", ".", "advanceChildToEnd", "(", ")", ";", "}", "interfaceExtends_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "returnAST", "=", "interfaceExtends_AST", ";", "}", "public", "final", "void", "interfaceBlock", "(", ")", "throws", "RecognitionException", ",", "TokenStreamException", "{", "returnAST", "=", "null", ";", "ASTPair", "currentAST", "=", "new", "ASTPair", "(", ")", ";", "AST", "interfaceBlock_AST", "=", "null", ";", "Token", "first", "=", "LT", "(", "1", ")", ";", "match", "(", "LCURLY", ")", ";", "{", "switch", "(", "LA", "(", "1", ")", ")", "{", "case", "FINAL", ":", "case", "ABSTRACT", ":", "case", "STRICTFP", ":", "case", "LITERAL_static", ":", "case", "LITERAL_def", ":", "case", "IDENT", ":", "case", "LITERAL_class", ":", "case", "LITERAL_interface", ":", "case", "LITERAL_enum", ":", "case", "AT", ":", "case", "LITERAL_void", ":", "case", "LITERAL_boolean", ":", "case", "LITERAL_byte", ":", "case", "LITERAL_char", ":", "case", "LITERAL_short", ":", "case", "LITERAL_int", ":", "case", "LITERAL_float", ":", "case", "LITERAL_long", ":", "case", "LITERAL_double", ":", "case", "LITERAL_private", ":", "case", "LITERAL_public", ":", "case", "LITERAL_protected", ":", "case", "LITERAL_transient", ":", "case", "LITERAL_native", ":", "case", "LITERAL_threadsafe", ":", "case", "LITERAL_synchronized", ":", "case", "LITERAL_volatile", ":", "{", "interfaceField", "(", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "returnAST", ")", ";", "break", ";", "}", "case", "RCURLY", ":", "case", "SEMI", ":", "case", "NLS", ":", "{", "break", ";", "}", "default", ":", "{", "throw", "new", "NoViableAltException", "(", "LT", "(", "1", ")", ",", "getFilename", "(", ")", ")", ";", "}", "}", "}", "{", "_loop130", ":", "do", "{", "if", "(", "(", "LA", "(", "1", ")", "==", "SEMI", "||", "LA", "(", "1", ")", "==", "NLS", ")", ")", "{", "sep", "(", ")", ";", "{", "switch", "(", "LA", "(", "1", ")", ")", "{", "case", "FINAL", ":", "case", "ABSTRACT", ":", "case", "STRICTFP", ":", "case", "LITERAL_static", ":", "case", "LITERAL_def", ":", "case", "IDENT", ":", "case", "LITERAL_class", ":", "case", "LITERAL_interface", ":", "case", "LITERAL_enum", ":", "case", "AT", ":", "case", "LITERAL_void", ":", "case", "LITERAL_boolean", ":", "case", "LITERAL_byte", ":", "case", "LITERAL_char", ":", "case", "LITERAL_short", ":", "case", "LITERAL_int", ":", "case", "LITERAL_float", ":", "case", "LITERAL_long", ":", "case", "LITERAL_double", ":", "case", "LITERAL_private", ":", "case", "LITERAL_public", ":", "case", "LITERAL_protected", ":", "case", "LITERAL_transient", ":", "case", "LITERAL_native", ":", "case", "LITERAL_threadsafe", ":", "case", "LITERAL_synchronized", ":", "case", "LITERAL_volatile", ":", "{", "interfaceField", "(", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "returnAST", ")", ";", "break", ";", "}", "case", "RCURLY", ":", "case", "SEMI", ":", "case", "NLS", ":", "{", "break", ";", "}", "default", ":", "{", "throw", "new", "NoViableAltException", "(", "LT", "(", "1", ")", ",", "getFilename", "(", ")", ")", ";", "}", "}", "}", "}", "else", "{", "break", "_loop130", ";", "}", "}", "while", "(", "true", ")", ";", "}", "match", "(", "RCURLY", ")", ";", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "interfaceBlock_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "interfaceBlock_AST", "=", "(", "AST", ")", "astFactory", ".", "make", "(", "(", "new", "ASTArray", "(", "2", ")", ")", ".", "add", "(", "create", "(", "OBJBLOCK", ",", "\"OBJBLOCK\"", ",", "first", ",", "LT", "(", "1", ")", ")", ")", ".", "add", "(", "interfaceBlock_AST", ")", ")", ";", "currentAST", ".", "root", "=", "interfaceBlock_AST", ";", "currentAST", ".", "child", "=", "interfaceBlock_AST", "!=", "null", "&&", "interfaceBlock_AST", ".", "getFirstChild", "(", ")", "!=", "null", "?", "interfaceBlock_AST", ".", "getFirstChild", "(", ")", ":", "interfaceBlock_AST", ";", "currentAST", ".", "advanceChildToEnd", "(", ")", ";", "}", "interfaceBlock_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "returnAST", "=", "interfaceBlock_AST", ";", "}", "public", "final", "void", "enumBlock", "(", ")", "throws", "RecognitionException", ",", "TokenStreamException", "{", "returnAST", "=", "null", ";", "ASTPair", "currentAST", "=", "new", "ASTPair", "(", ")", ";", "AST", "enumBlock_AST", "=", "null", ";", "Token", "first", "=", "LT", "(", "1", ")", ";", "match", "(", "LCURLY", ")", ";", "nls", "(", ")", ";", "{", "boolean", "synPredMatched139", "=", "false", ";", "if", "(", "(", "(", "LA", "(", "1", ")", "==", "IDENT", "||", "LA", "(", "1", ")", "==", "AT", ")", "&&", "(", "_tokenSet_51", ".", "member", "(", "LA", "(", "2", ")", ")", ")", ")", ")", "{", "int", "_m139", "=", "mark", "(", ")", ";", "synPredMatched139", "=", "true", ";", "inputState", ".", "guessing", "++", ";", "try", "{", "{", "enumConstantsStart", "(", ")", ";", "}", "}", "catch", "(", "RecognitionException", "pe", ")", "{", "synPredMatched139", "=", "false", ";", "}", "rewind", "(", "_m139", ")", ";", "inputState", ".", "guessing", "--", ";", "}", "if", "(", "synPredMatched139", ")", "{", "enumConstants", "(", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "returnAST", ")", ";", "}", "else", "if", "(", "(", "_tokenSet_52", ".", "member", "(", "LA", "(", "1", ")", ")", ")", "&&", "(", "_tokenSet_53", ".", "member", "(", "LA", "(", "2", ")", ")", ")", ")", "{", "{", "switch", "(", "LA", "(", "1", ")", ")", "{", "case", "FINAL", ":", "case", "ABSTRACT", ":", "case", "STRICTFP", ":", "case", "LITERAL_static", ":", "case", "LITERAL_def", ":", "case", "IDENT", ":", "case", "LITERAL_class", ":", "case", "LITERAL_interface", ":", "case", "LITERAL_enum", ":", "case", "AT", ":", "case", "LITERAL_void", ":", "case", "LITERAL_boolean", ":", "case", "LITERAL_byte", ":", "case", "LITERAL_char", ":", "case", "LITERAL_short", ":", "case", "LITERAL_int", ":", "case", "LITERAL_float", ":", "case", "LITERAL_long", ":", "case", "LITERAL_double", ":", "case", "LITERAL_private", ":", "case", "LITERAL_public", ":", "case", "LITERAL_protected", ":", "case", "LITERAL_transient", ":", "case", "LITERAL_native", ":", "case", "LITERAL_threadsafe", ":", "case", "LITERAL_synchronized", ":", "case", "LITERAL_volatile", ":", "case", "LCURLY", ":", "{", "classField", "(", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "returnAST", ")", ";", "break", ";", "}", "case", "RCURLY", ":", "case", "SEMI", ":", "case", "NLS", ":", "{", "break", ";", "}", "default", ":", "{", "throw", "new", "NoViableAltException", "(", "LT", "(", "1", ")", ",", "getFilename", "(", ")", ")", ";", "}", "}", "}", "}", "else", "{", "throw", "new", "NoViableAltException", "(", "LT", "(", "1", ")", ",", "getFilename", "(", ")", ")", ";", "}", "}", "{", "_loop143", ":", "do", "{", "if", "(", "(", "LA", "(", "1", ")", "==", "SEMI", "||", "LA", "(", "1", ")", "==", "NLS", ")", ")", "{", "sep", "(", ")", ";", "{", "switch", "(", "LA", "(", "1", ")", ")", "{", "case", "FINAL", ":", "case", "ABSTRACT", ":", "case", "STRICTFP", ":", "case", "LITERAL_static", ":", "case", "LITERAL_def", ":", "case", "IDENT", ":", "case", "LITERAL_class", ":", "case", "LITERAL_interface", ":", "case", "LITERAL_enum", ":", "case", "AT", ":", "case", "LITERAL_void", ":", "case", "LITERAL_boolean", ":", "case", "LITERAL_byte", ":", "case", "LITERAL_char", ":", "case", "LITERAL_short", ":", "case", "LITERAL_int", ":", "case", "LITERAL_float", ":", "case", "LITERAL_long", ":", "case", "LITERAL_double", ":", "case", "LITERAL_private", ":", "case", "LITERAL_public", ":", "case", "LITERAL_protected", ":", "case", "LITERAL_transient", ":", "case", "LITERAL_native", ":", "case", "LITERAL_threadsafe", ":", "case", "LITERAL_synchronized", ":", "case", "LITERAL_volatile", ":", "case", "LCURLY", ":", "{", "classField", "(", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "returnAST", ")", ";", "break", ";", "}", "case", "RCURLY", ":", "case", "SEMI", ":", "case", "NLS", ":", "{", "break", ";", "}", "default", ":", "{", "throw", "new", "NoViableAltException", "(", "LT", "(", "1", ")", ",", "getFilename", "(", ")", ")", ";", "}", "}", "}", "}", "else", "{", "break", "_loop143", ";", "}", "}", "while", "(", "true", ")", ";", "}", "match", "(", "RCURLY", ")", ";", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "enumBlock_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "enumBlock_AST", "=", "(", "AST", ")", "astFactory", ".", "make", "(", "(", "new", "ASTArray", "(", "2", ")", ")", ".", "add", "(", "create", "(", "OBJBLOCK", ",", "\"OBJBLOCK\"", ",", "first", ",", "LT", "(", "1", ")", ")", ")", ".", "add", "(", "enumBlock_AST", ")", ")", ";", "currentAST", ".", "root", "=", "enumBlock_AST", ";", "currentAST", ".", "child", "=", "enumBlock_AST", "!=", "null", "&&", "enumBlock_AST", ".", "getFirstChild", "(", ")", "!=", "null", "?", "enumBlock_AST", ".", "getFirstChild", "(", ")", ":", "enumBlock_AST", ";", "currentAST", ".", "advanceChildToEnd", "(", ")", ";", "}", "enumBlock_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "returnAST", "=", "enumBlock_AST", ";", "}", "public", "final", "void", "annotationBlock", "(", ")", "throws", "RecognitionException", ",", "TokenStreamException", "{", "returnAST", "=", "null", ";", "ASTPair", "currentAST", "=", "new", "ASTPair", "(", ")", ";", "AST", "annotationBlock_AST", "=", "null", ";", "Token", "first", "=", "LT", "(", "1", ")", ";", "match", "(", "LCURLY", ")", ";", "{", "switch", "(", "LA", "(", "1", ")", ")", "{", "case", "FINAL", ":", "case", "ABSTRACT", ":", "case", "STRICTFP", ":", "case", "LITERAL_static", ":", "case", "LITERAL_def", ":", "case", "IDENT", ":", "case", "LITERAL_class", ":", "case", "LITERAL_interface", ":", "case", "LITERAL_enum", ":", "case", "AT", ":", "case", "LITERAL_void", ":", "case", "LITERAL_boolean", ":", "case", "LITERAL_byte", ":", "case", "LITERAL_char", ":", "case", "LITERAL_short", ":", "case", "LITERAL_int", ":", "case", "LITERAL_float", ":", "case", "LITERAL_long", ":", "case", "LITERAL_double", ":", "case", "LITERAL_private", ":", "case", "LITERAL_public", ":", "case", "LITERAL_protected", ":", "case", "LITERAL_transient", ":", "case", "LITERAL_native", ":", "case", "LITERAL_threadsafe", ":", "case", "LITERAL_synchronized", ":", "case", "LITERAL_volatile", ":", "{", "annotationField", "(", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "returnAST", ")", ";", "break", ";", "}", "case", "RCURLY", ":", "case", "SEMI", ":", "case", "NLS", ":", "{", "break", ";", "}", "default", ":", "{", "throw", "new", "NoViableAltException", "(", "LT", "(", "1", ")", ",", "getFilename", "(", ")", ")", ";", "}", "}", "}", "{", "_loop135", ":", "do", "{", "if", "(", "(", "LA", "(", "1", ")", "==", "SEMI", "||", "LA", "(", "1", ")", "==", "NLS", ")", ")", "{", "sep", "(", ")", ";", "{", "switch", "(", "LA", "(", "1", ")", ")", "{", "case", "FINAL", ":", "case", "ABSTRACT", ":", "case", "STRICTFP", ":", "case", "LITERAL_static", ":", "case", "LITERAL_def", ":", "case", "IDENT", ":", "case", "LITERAL_class", ":", "case", "LITERAL_interface", ":", "case", "LITERAL_enum", ":", "case", "AT", ":", "case", "LITERAL_void", ":", "case", "LITERAL_boolean", ":", "case", "LITERAL_byte", ":", "case", "LITERAL_char", ":", "case", "LITERAL_short", ":", "case", "LITERAL_int", ":", "case", "LITERAL_float", ":", "case", "LITERAL_long", ":", "case", "LITERAL_double", ":", "case", "LITERAL_private", ":", "case", "LITERAL_public", ":", "case", "LITERAL_protected", ":", "case", "LITERAL_transient", ":", "case", "LITERAL_native", ":", "case", "LITERAL_threadsafe", ":", "case", "LITERAL_synchronized", ":", "case", "LITERAL_volatile", ":", "{", "annotationField", "(", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "returnAST", ")", ";", "break", ";", "}", "case", "RCURLY", ":", "case", "SEMI", ":", "case", "NLS", ":", "{", "break", ";", "}", "default", ":", "{", "throw", "new", "NoViableAltException", "(", "LT", "(", "1", ")", ",", "getFilename", "(", ")", ")", ";", "}", "}", "}", "}", "else", "{", "break", "_loop135", ";", "}", "}", "while", "(", "true", ")", ";", "}", "match", "(", "RCURLY", ")", ";", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "annotationBlock_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "annotationBlock_AST", "=", "(", "AST", ")", "astFactory", ".", "make", "(", "(", "new", "ASTArray", "(", "2", ")", ")", ".", "add", "(", "create", "(", "OBJBLOCK", ",", "\"OBJBLOCK\"", ",", "first", ",", "LT", "(", "1", ")", ")", ")", ".", "add", "(", "annotationBlock_AST", ")", ")", ";", "currentAST", ".", "root", "=", "annotationBlock_AST", ";", "currentAST", ".", "child", "=", "annotationBlock_AST", "!=", "null", "&&", "annotationBlock_AST", ".", "getFirstChild", "(", ")", "!=", "null", "?", "annotationBlock_AST", ".", "getFirstChild", "(", ")", ":", "annotationBlock_AST", ";", "currentAST", ".", "advanceChildToEnd", "(", ")", ";", "}", "annotationBlock_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "returnAST", "=", "annotationBlock_AST", ";", "}", "public", "final", "void", "typeParameter", "(", ")", "throws", "RecognitionException", ",", "TokenStreamException", "{", "returnAST", "=", "null", ";", "ASTPair", "currentAST", "=", "new", "ASTPair", "(", ")", ";", "AST", "typeParameter_AST", "=", "null", ";", "Token", "id", "=", "null", ";", "AST", "id_AST", "=", "null", ";", "Token", "first", "=", "LT", "(", "1", ")", ";", "{", "id", "=", "LT", "(", "1", ")", ";", "id_AST", "=", "astFactory", ".", "create", "(", "id", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "id_AST", ")", ";", "match", "(", "IDENT", ")", ";", "}", "{", "if", "(", "(", "LA", "(", "1", ")", "==", "LITERAL_extends", ")", "&&", "(", "LA", "(", "2", ")", "==", "IDENT", "||", "LA", "(", "2", ")", "==", "NLS", ")", ")", "{", "typeParameterBounds", "(", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "returnAST", ")", ";", "}", "else", "if", "(", "(", "_tokenSet_54", ".", "member", "(", "LA", "(", "1", ")", ")", ")", "&&", "(", "_tokenSet_12", ".", "member", "(", "LA", "(", "2", ")", ")", ")", ")", "{", "}", "else", "{", "throw", "new", "NoViableAltException", "(", "LT", "(", "1", ")", ",", "getFilename", "(", ")", ")", ";", "}", "}", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "typeParameter_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "typeParameter_AST", "=", "(", "AST", ")", "astFactory", ".", "make", "(", "(", "new", "ASTArray", "(", "2", ")", ")", ".", "add", "(", "create", "(", "TYPE_PARAMETER", ",", "\"\"", ",", "first", ",", "LT", "(", "1", ")", ")", ")", ".", "add", "(", "typeParameter_AST", ")", ")", ";", "currentAST", ".", "root", "=", "typeParameter_AST", ";", "currentAST", ".", "child", "=", "typeParameter_AST", "!=", "null", "&&", "typeParameter_AST", ".", "getFirstChild", "(", ")", "!=", "null", "?", "typeParameter_AST", ".", "getFirstChild", "(", ")", ":", "typeParameter_AST", ";", "currentAST", ".", "advanceChildToEnd", "(", ")", ";", "}", "typeParameter_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "returnAST", "=", "typeParameter_AST", ";", "}", "public", "final", "void", "typeParameterBounds", "(", ")", "throws", "RecognitionException", ",", "TokenStreamException", "{", "returnAST", "=", "null", ";", "ASTPair", "currentAST", "=", "new", "ASTPair", "(", ")", ";", "AST", "typeParameterBounds_AST", "=", "null", ";", "Token", "first", "=", "LT", "(", "1", ")", ";", "match", "(", "LITERAL_extends", ")", ";", "nls", "(", ")", ";", "classOrInterfaceType", "(", "true", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "returnAST", ")", ";", "{", "_loop120", ":", "do", "{", "if", "(", "(", "LA", "(", "1", ")", "==", "BAND", ")", ")", "{", "match", "(", "BAND", ")", ";", "nls", "(", ")", ";", "classOrInterfaceType", "(", "true", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "returnAST", ")", ";", "}", "else", "{", "break", "_loop120", ";", "}", "}", "while", "(", "true", ")", ";", "}", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "typeParameterBounds_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "typeParameterBounds_AST", "=", "(", "AST", ")", "astFactory", ".", "make", "(", "(", "new", "ASTArray", "(", "2", ")", ")", ".", "add", "(", "create", "(", "TYPE_UPPER_BOUNDS", ",", "\"\"", ",", "first", ",", "LT", "(", "1", ")", ")", ")", ".", "add", "(", "typeParameterBounds_AST", ")", ")", ";", "currentAST", ".", "root", "=", "typeParameterBounds_AST", ";", "currentAST", ".", "child", "=", "typeParameterBounds_AST", "!=", "null", "&&", "typeParameterBounds_AST", ".", "getFirstChild", "(", ")", "!=", "null", "?", "typeParameterBounds_AST", ".", "getFirstChild", "(", ")", ":", "typeParameterBounds_AST", ";", "currentAST", ".", "advanceChildToEnd", "(", ")", ";", "}", "typeParameterBounds_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "returnAST", "=", "typeParameterBounds_AST", ";", "}", "public", "final", "void", "classField", "(", ")", "throws", "RecognitionException", ",", "TokenStreamException", "{", "returnAST", "=", "null", ";", "ASTPair", "currentAST", "=", "new", "ASTPair", "(", ")", ";", "AST", "classField_AST", "=", "null", ";", "AST", "mc_AST", "=", "null", ";", "AST", "ctor_AST", "=", "null", ";", "AST", "dg_AST", "=", "null", ";", "AST", "mad_AST", "=", "null", ";", "AST", "dd_AST", "=", "null", ";", "AST", "mods_AST", "=", "null", ";", "AST", "td_AST", "=", "null", ";", "AST", "s3_AST", "=", "null", ";", "AST", "s4_AST", "=", "null", ";", "Token", "first", "=", "LT", "(", "1", ")", ";", "try", "{", "boolean", "synPredMatched193", "=", "false", ";", "if", "(", "(", "(", "_tokenSet_55", ".", "member", "(", "LA", "(", "1", ")", ")", ")", "&&", "(", "_tokenSet_56", ".", "member", "(", "LA", "(", "2", ")", ")", ")", ")", ")", "{", "int", "_m193", "=", "mark", "(", ")", ";", "synPredMatched193", "=", "true", ";", "inputState", ".", "guessing", "++", ";", "try", "{", "{", "constructorStart", "(", ")", ";", "}", "}", "catch", "(", "RecognitionException", "pe", ")", "{", "synPredMatched193", "=", "false", ";", "}", "rewind", "(", "_m193", ")", ";", "inputState", ".", "guessing", "--", ";", "}", "if", "(", "synPredMatched193", ")", "{", "modifiersOpt", "(", ")", ";", "mc_AST", "=", "(", "AST", ")", "returnAST", ";", "constructorDefinition", "(", "mc_AST", ")", ";", "ctor_AST", "=", "(", "AST", ")", "returnAST", ";", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "classField_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "classField_AST", "=", "ctor_AST", ";", "currentAST", ".", "root", "=", "classField_AST", ";", "currentAST", ".", "child", "=", "classField_AST", "!=", "null", "&&", "classField_AST", ".", "getFirstChild", "(", ")", "!=", "null", "?", "classField_AST", ".", "getFirstChild", "(", ")", ":", "classField_AST", ";", "currentAST", ".", "advanceChildToEnd", "(", ")", ";", "}", "}", "else", "{", "boolean", "synPredMatched195", "=", "false", ";", "if", "(", "(", "(", "_tokenSet_13", ".", "member", "(", "LA", "(", "1", ")", ")", ")", "&&", "(", "_tokenSet_14", ".", "member", "(", "LA", "(", "2", ")", ")", ")", ")", ")", "{", "int", "_m195", "=", "mark", "(", ")", ";", "synPredMatched195", "=", "true", ";", "inputState", ".", "guessing", "++", ";", "try", "{", "{", "genericMethodStart", "(", ")", ";", "}", "}", "catch", "(", "RecognitionException", "pe", ")", "{", "synPredMatched195", "=", "false", ";", "}", "rewind", "(", "_m195", ")", ";", "inputState", ".", "guessing", "--", ";", "}", "if", "(", "synPredMatched195", ")", "{", "genericMethod", "(", ")", ";", "dg_AST", "=", "(", "AST", ")", "returnAST", ";", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "classField_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "classField_AST", "=", "dg_AST", ";", "currentAST", ".", "root", "=", "classField_AST", ";", "currentAST", ".", "child", "=", "classField_AST", "!=", "null", "&&", "classField_AST", ".", "getFirstChild", "(", ")", "!=", "null", "?", "classField_AST", ".", "getFirstChild", "(", ")", ":", "classField_AST", ";", "currentAST", ".", "advanceChildToEnd", "(", ")", ";", "}", "}", "else", "{", "boolean", "synPredMatched197", "=", "false", ";", "if", "(", "(", "(", "_tokenSet_13", ".", "member", "(", "LA", "(", "1", ")", ")", ")", "&&", "(", "_tokenSet_15", ".", "member", "(", "LA", "(", "2", ")", ")", ")", ")", ")", "{", "int", "_m197", "=", "mark", "(", ")", ";", "synPredMatched197", "=", "true", ";", "inputState", ".", "guessing", "++", ";", "try", "{", "{", "multipleAssignmentDeclarationStart", "(", ")", ";", "}", "}", "catch", "(", "RecognitionException", "pe", ")", "{", "synPredMatched197", "=", "false", ";", "}", "rewind", "(", "_m197", ")", ";", "inputState", ".", "guessing", "--", ";", "}", "if", "(", "synPredMatched197", ")", "{", "multipleAssignmentDeclaration", "(", ")", ";", "mad_AST", "=", "(", "AST", ")", "returnAST", ";", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "classField_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "classField_AST", "=", "mad_AST", ";", "currentAST", ".", "root", "=", "classField_AST", ";", "currentAST", ".", "child", "=", "classField_AST", "!=", "null", "&&", "classField_AST", ".", "getFirstChild", "(", ")", "!=", "null", "?", "classField_AST", ".", "getFirstChild", "(", ")", ":", "classField_AST", ";", "currentAST", ".", "advanceChildToEnd", "(", ")", ";", "}", "}", "else", "{", "boolean", "synPredMatched199", "=", "false", ";", "if", "(", "(", "(", "_tokenSet_16", ".", "member", "(", "LA", "(", "1", ")", ")", ")", "&&", "(", "_tokenSet_17", ".", "member", "(", "LA", "(", "2", ")", ")", ")", ")", ")", "{", "int", "_m199", "=", "mark", "(", ")", ";", "synPredMatched199", "=", "true", ";", "inputState", ".", "guessing", "++", ";", "try", "{", "{", "declarationStart", "(", ")", ";", "}", "}", "catch", "(", "RecognitionException", "pe", ")", "{", "synPredMatched199", "=", "false", ";", "}", "rewind", "(", "_m199", ")", ";", "inputState", ".", "guessing", "--", ";", "}", "if", "(", "synPredMatched199", ")", "{", "declaration", "(", ")", ";", "dd_AST", "=", "(", "AST", ")", "returnAST", ";", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "classField_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "classField_AST", "=", "dd_AST", ";", "currentAST", ".", "root", "=", "classField_AST", ";", "currentAST", ".", "child", "=", "classField_AST", "!=", "null", "&&", "classField_AST", ".", "getFirstChild", "(", ")", "!=", "null", "?", "classField_AST", ".", "getFirstChild", "(", ")", ":", "classField_AST", ";", "currentAST", ".", "advanceChildToEnd", "(", ")", ";", "}", "}", "else", "{", "boolean", "synPredMatched201", "=", "false", ";", "if", "(", "(", "(", "_tokenSet_22", ".", "member", "(", "LA", "(", "1", ")", ")", ")", "&&", "(", "_tokenSet_23", ".", "member", "(", "LA", "(", "2", ")", ")", ")", ")", ")", "{", "int", "_m201", "=", "mark", "(", ")", ";", "synPredMatched201", "=", "true", ";", "inputState", ".", "guessing", "++", ";", "try", "{", "{", "typeDeclarationStart", "(", ")", ";", "}", "}", "catch", "(", "RecognitionException", "pe", ")", "{", "synPredMatched201", "=", "false", ";", "}", "rewind", "(", "_m201", ")", ";", "inputState", ".", "guessing", "--", ";", "}", "if", "(", "synPredMatched201", ")", "{", "modifiersOpt", "(", ")", ";", "mods_AST", "=", "(", "AST", ")", "returnAST", ";", "{", "typeDefinitionInternal", "(", "mods_AST", ")", ";", "td_AST", "=", "(", "AST", ")", "returnAST", ";", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "classField_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "classField_AST", "=", "td_AST", ";", "currentAST", ".", "root", "=", "classField_AST", ";", "currentAST", ".", "child", "=", "classField_AST", "!=", "null", "&&", "classField_AST", ".", "getFirstChild", "(", ")", "!=", "null", "?", "classField_AST", ".", "getFirstChild", "(", ")", ":", "classField_AST", ";", "currentAST", ".", "advanceChildToEnd", "(", ")", ";", "}", "}", "}", "else", "if", "(", "(", "LA", "(", "1", ")", "==", "LITERAL_static", ")", "&&", "(", "LA", "(", "2", ")", "==", "LCURLY", "||", "LA", "(", "2", ")", "==", "NLS", ")", ")", "{", "match", "(", "LITERAL_static", ")", ";", "nls", "(", ")", ";", "compoundStatement", "(", ")", ";", "s3_AST", "=", "(", "AST", ")", "returnAST", ";", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "classField_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "classField_AST", "=", "(", "AST", ")", "astFactory", ".", "make", "(", "(", "new", "ASTArray", "(", "2", ")", ")", ".", "add", "(", "create", "(", "STATIC_INIT", ",", "\"STATIC_INIT\"", ",", "first", ",", "LT", "(", "1", ")", ")", ")", ".", "add", "(", "s3_AST", ")", ")", ";", "currentAST", ".", "root", "=", "classField_AST", ";", "currentAST", ".", "child", "=", "classField_AST", "!=", "null", "&&", "classField_AST", ".", "getFirstChild", "(", ")", "!=", "null", "?", "classField_AST", ".", "getFirstChild", "(", ")", ":", "classField_AST", ";", "currentAST", ".", "advanceChildToEnd", "(", ")", ";", "}", "}", "else", "if", "(", "(", "LA", "(", "1", ")", "==", "LCURLY", ")", ")", "{", "compoundStatement", "(", ")", ";", "s4_AST", "=", "(", "AST", ")", "returnAST", ";", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "classField_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "classField_AST", "=", "(", "AST", ")", "astFactory", ".", "make", "(", "(", "new", "ASTArray", "(", "2", ")", ")", ".", "add", "(", "create", "(", "INSTANCE_INIT", ",", "\"\"", ",", "first", ",", "LT", "(", "1", ")", ")", ")", ".", "add", "(", "s4_AST", ")", ")", ";", "currentAST", ".", "root", "=", "classField_AST", ";", "currentAST", ".", "child", "=", "classField_AST", "!=", "null", "&&", "classField_AST", ".", "getFirstChild", "(", ")", "!=", "null", "?", "classField_AST", ".", "getFirstChild", "(", ")", ":", "classField_AST", ";", "currentAST", ".", "advanceChildToEnd", "(", ")", ";", "}", "}", "else", "{", "throw", "new", "NoViableAltException", "(", "LT", "(", "1", ")", ",", "getFilename", "(", ")", ")", ";", "}", "}", "}", "}", "}", "}", "catch", "(", "RecognitionException", "e", ")", "{", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "reportError", "(", "e", ")", ";", "classField_AST", "=", "(", "AST", ")", "astFactory", ".", "make", "(", "(", "new", "ASTArray", "(", "4", ")", ")", ".", "add", "(", "create", "(", "VARIABLE_DEF", ",", "\"VARIABLE_DEF\"", ",", "first", ",", "LT", "(", "1", ")", ")", ")", ".", "add", "(", "null", ")", ".", "add", "(", "create", "(", "TYPE", ",", "\"\"", ",", "LT", "(", "1", ")", ",", "LT", "(", "2", ")", ")", ")", ".", "add", "(", "create", "(", "IDENT", ",", "first", ".", "getText", "(", ")", ",", "LT", "(", "1", ")", ",", "LT", "(", "2", ")", ")", ")", ")", ";", "consumeUntil", "(", "NLS", ")", ";", "}", "else", "{", "throw", "e", ";", "}", "}", "returnAST", "=", "classField_AST", ";", "}", "public", "final", "void", "interfaceField", "(", ")", "throws", "RecognitionException", ",", "TokenStreamException", "{", "returnAST", "=", "null", ";", "ASTPair", "currentAST", "=", "new", "ASTPair", "(", ")", ";", "AST", "interfaceField_AST", "=", "null", ";", "AST", "d_AST", "=", "null", ";", "AST", "dg_AST", "=", "null", ";", "AST", "mods_AST", "=", "null", ";", "AST", "td_AST", "=", "null", ";", "boolean", "synPredMatched205", "=", "false", ";", "if", "(", "(", "(", "_tokenSet_16", ".", "member", "(", "LA", "(", "1", ")", ")", ")", "&&", "(", "_tokenSet_17", ".", "member", "(", "LA", "(", "2", ")", ")", ")", ")", ")", "{", "int", "_m205", "=", "mark", "(", ")", ";", "synPredMatched205", "=", "true", ";", "inputState", ".", "guessing", "++", ";", "try", "{", "{", "declarationStart", "(", ")", ";", "}", "}", "catch", "(", "RecognitionException", "pe", ")", "{", "synPredMatched205", "=", "false", ";", "}", "rewind", "(", "_m205", ")", ";", "inputState", ".", "guessing", "--", ";", "}", "if", "(", "synPredMatched205", ")", "{", "declaration", "(", ")", ";", "d_AST", "=", "(", "AST", ")", "returnAST", ";", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "interfaceField_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "interfaceField_AST", "=", "d_AST", ";", "currentAST", ".", "root", "=", "interfaceField_AST", ";", "currentAST", ".", "child", "=", "interfaceField_AST", "!=", "null", "&&", "interfaceField_AST", ".", "getFirstChild", "(", ")", "!=", "null", "?", "interfaceField_AST", ".", "getFirstChild", "(", ")", ":", "interfaceField_AST", ";", "currentAST", ".", "advanceChildToEnd", "(", ")", ";", "}", "}", "else", "{", "boolean", "synPredMatched207", "=", "false", ";", "if", "(", "(", "(", "_tokenSet_13", ".", "member", "(", "LA", "(", "1", ")", ")", ")", "&&", "(", "_tokenSet_14", ".", "member", "(", "LA", "(", "2", ")", ")", ")", ")", ")", "{", "int", "_m207", "=", "mark", "(", ")", ";", "synPredMatched207", "=", "true", ";", "inputState", ".", "guessing", "++", ";", "try", "{", "{", "genericMethodStart", "(", ")", ";", "}", "}", "catch", "(", "RecognitionException", "pe", ")", "{", "synPredMatched207", "=", "false", ";", "}", "rewind", "(", "_m207", ")", ";", "inputState", ".", "guessing", "--", ";", "}", "if", "(", "synPredMatched207", ")", "{", "genericMethod", "(", ")", ";", "dg_AST", "=", "(", "AST", ")", "returnAST", ";", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "interfaceField_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "interfaceField_AST", "=", "dg_AST", ";", "currentAST", ".", "root", "=", "interfaceField_AST", ";", "currentAST", ".", "child", "=", "interfaceField_AST", "!=", "null", "&&", "interfaceField_AST", ".", "getFirstChild", "(", ")", "!=", "null", "?", "interfaceField_AST", ".", "getFirstChild", "(", ")", ":", "interfaceField_AST", ";", "currentAST", ".", "advanceChildToEnd", "(", ")", ";", "}", "}", "else", "{", "boolean", "synPredMatched209", "=", "false", ";", "if", "(", "(", "(", "_tokenSet_22", ".", "member", "(", "LA", "(", "1", ")", ")", ")", "&&", "(", "_tokenSet_23", ".", "member", "(", "LA", "(", "2", ")", ")", ")", ")", ")", "{", "int", "_m209", "=", "mark", "(", ")", ";", "synPredMatched209", "=", "true", ";", "inputState", ".", "guessing", "++", ";", "try", "{", "{", "typeDeclarationStart", "(", ")", ";", "}", "}", "catch", "(", "RecognitionException", "pe", ")", "{", "synPredMatched209", "=", "false", ";", "}", "rewind", "(", "_m209", ")", ";", "inputState", ".", "guessing", "--", ";", "}", "if", "(", "synPredMatched209", ")", "{", "modifiersOpt", "(", ")", ";", "mods_AST", "=", "(", "AST", ")", "returnAST", ";", "{", "typeDefinitionInternal", "(", "mods_AST", ")", ";", "td_AST", "=", "(", "AST", ")", "returnAST", ";", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "interfaceField_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "interfaceField_AST", "=", "td_AST", ";", "currentAST", ".", "root", "=", "interfaceField_AST", ";", "currentAST", ".", "child", "=", "interfaceField_AST", "!=", "null", "&&", "interfaceField_AST", ".", "getFirstChild", "(", ")", "!=", "null", "?", "interfaceField_AST", ".", "getFirstChild", "(", ")", ":", "interfaceField_AST", ";", "currentAST", ".", "advanceChildToEnd", "(", ")", ";", "}", "}", "}", "else", "{", "throw", "new", "NoViableAltException", "(", "LT", "(", "1", ")", ",", "getFilename", "(", ")", ")", ";", "}", "}", "}", "returnAST", "=", "interfaceField_AST", ";", "}", "public", "final", "void", "annotationField", "(", ")", "throws", "RecognitionException", ",", "TokenStreamException", "{", "returnAST", "=", "null", ";", "ASTPair", "currentAST", "=", "new", "ASTPair", "(", ")", ";", "AST", "annotationField_AST", "=", "null", ";", "AST", "mods_AST", "=", "null", ";", "AST", "td_AST", "=", "null", ";", "AST", "t_AST", "=", "null", ";", "Token", "i", "=", "null", ";", "AST", "i_AST", "=", "null", ";", "AST", "amvi_AST", "=", "null", ";", "AST", "v_AST", "=", "null", ";", "Token", "first", "=", "LT", "(", "1", ")", ";", "modifiersOpt", "(", ")", ";", "mods_AST", "=", "(", "AST", ")", "returnAST", ";", "{", "switch", "(", "LA", "(", "1", ")", ")", "{", "case", "LITERAL_class", ":", "case", "LITERAL_interface", ":", "case", "LITERAL_enum", ":", "case", "AT", ":", "{", "typeDefinitionInternal", "(", "mods_AST", ")", ";", "td_AST", "=", "(", "AST", ")", "returnAST", ";", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "annotationField_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "annotationField_AST", "=", "td_AST", ";", "currentAST", ".", "root", "=", "annotationField_AST", ";", "currentAST", ".", "child", "=", "annotationField_AST", "!=", "null", "&&", "annotationField_AST", ".", "getFirstChild", "(", ")", "!=", "null", "?", "annotationField_AST", ".", "getFirstChild", "(", ")", ":", "annotationField_AST", ";", "currentAST", ".", "advanceChildToEnd", "(", ")", ";", "}", "break", ";", "}", "case", "IDENT", ":", "case", "LITERAL_void", ":", "case", "LITERAL_boolean", ":", "case", "LITERAL_byte", ":", "case", "LITERAL_char", ":", "case", "LITERAL_short", ":", "case", "LITERAL_int", ":", "case", "LITERAL_float", ":", "case", "LITERAL_long", ":", "case", "LITERAL_double", ":", "{", "typeSpec", "(", "false", ")", ";", "t_AST", "=", "(", "AST", ")", "returnAST", ";", "{", "boolean", "synPredMatched163", "=", "false", ";", "if", "(", "(", "(", "LA", "(", "1", ")", "==", "IDENT", ")", "&&", "(", "LA", "(", "2", ")", "==", "LPAREN", ")", ")", ")", "{", "int", "_m163", "=", "mark", "(", ")", ";", "synPredMatched163", "=", "true", ";", "inputState", ".", "guessing", "++", ";", "try", "{", "{", "match", "(", "IDENT", ")", ";", "match", "(", "LPAREN", ")", ";", "}", "}", "catch", "(", "RecognitionException", "pe", ")", "{", "synPredMatched163", "=", "false", ";", "}", "rewind", "(", "_m163", ")", ";", "inputState", ".", "guessing", "--", ";", "}", "if", "(", "synPredMatched163", ")", "{", "i", "=", "LT", "(", "1", ")", ";", "i_AST", "=", "astFactory", ".", "create", "(", "i", ")", ";", "match", "(", "IDENT", ")", ";", "match", "(", "LPAREN", ")", ";", "match", "(", "RPAREN", ")", ";", "{", "switch", "(", "LA", "(", "1", ")", ")", "{", "case", "LITERAL_default", ":", "{", "match", "(", "LITERAL_default", ")", ";", "nls", "(", ")", ";", "annotationMemberValueInitializer", "(", ")", ";", "amvi_AST", "=", "(", "AST", ")", "returnAST", ";", "break", ";", "}", "case", "RCURLY", ":", "case", "SEMI", ":", "case", "NLS", ":", "{", "break", ";", "}", "default", ":", "{", "throw", "new", "NoViableAltException", "(", "LT", "(", "1", ")", ",", "getFilename", "(", ")", ")", ";", "}", "}", "}", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "annotationField_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "annotationField_AST", "=", "(", "AST", ")", "astFactory", ".", "make", "(", "(", "new", "ASTArray", "(", "5", ")", ")", ".", "add", "(", "create", "(", "ANNOTATION_FIELD_DEF", ",", "\"\"", ",", "first", ",", "LT", "(", "1", ")", ")", ")", ".", "add", "(", "mods_AST", ")", ".", "add", "(", "(", "AST", ")", "astFactory", ".", "make", "(", "(", "new", "ASTArray", "(", "2", ")", ")", ".", "add", "(", "create", "(", "TYPE", ",", "\"TYPE\"", ",", "first", ",", "LT", "(", "1", ")", ")", ")", ".", "add", "(", "t_AST", ")", ")", ")", ".", "add", "(", "i_AST", ")", ".", "add", "(", "amvi_AST", ")", ")", ";", "currentAST", ".", "root", "=", "annotationField_AST", ";", "currentAST", ".", "child", "=", "annotationField_AST", "!=", "null", "&&", "annotationField_AST", ".", "getFirstChild", "(", ")", "!=", "null", "?", "annotationField_AST", ".", "getFirstChild", "(", ")", ":", "annotationField_AST", ";", "currentAST", ".", "advanceChildToEnd", "(", ")", ";", "}", "}", "else", "if", "(", "(", "LA", "(", "1", ")", "==", "IDENT", "||", "LA", "(", "1", ")", "==", "STRING_LITERAL", ")", "&&", "(", "_tokenSet_57", ".", "member", "(", "LA", "(", "2", ")", ")", ")", ")", "{", "variableDefinitions", "(", "mods_AST", ",", "t_AST", ")", ";", "v_AST", "=", "(", "AST", ")", "returnAST", ";", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "annotationField_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "annotationField_AST", "=", "v_AST", ";", "currentAST", ".", "root", "=", "annotationField_AST", ";", "currentAST", ".", "child", "=", "annotationField_AST", "!=", "null", "&&", "annotationField_AST", ".", "getFirstChild", "(", ")", "!=", "null", "?", "annotationField_AST", ".", "getFirstChild", "(", ")", ":", "annotationField_AST", ";", "currentAST", ".", "advanceChildToEnd", "(", ")", ";", "}", "}", "else", "{", "throw", "new", "NoViableAltException", "(", "LT", "(", "1", ")", ",", "getFilename", "(", ")", ")", ";", "}", "}", "break", ";", "}", "default", ":", "{", "throw", "new", "NoViableAltException", "(", "LT", "(", "1", ")", ",", "getFilename", "(", ")", ")", ";", "}", "}", "}", "returnAST", "=", "annotationField_AST", ";", "}", "public", "final", "void", "enumConstantsStart", "(", ")", "throws", "RecognitionException", ",", "TokenStreamException", "{", "returnAST", "=", "null", ";", "ASTPair", "currentAST", "=", "new", "ASTPair", "(", ")", ";", "AST", "enumConstantsStart_AST", "=", "null", ";", "annotationsOpt", "(", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "returnAST", ")", ";", "AST", "tmp161_AST", "=", "null", ";", "tmp161_AST", "=", "astFactory", ".", "create", "(", "LT", "(", "1", ")", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "tmp161_AST", ")", ";", "match", "(", "IDENT", ")", ";", "{", "switch", "(", "LA", "(", "1", ")", ")", "{", "case", "LCURLY", ":", "{", "AST", "tmp162_AST", "=", "null", ";", "tmp162_AST", "=", "astFactory", ".", "create", "(", "LT", "(", "1", ")", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "tmp162_AST", ")", ";", "match", "(", "LCURLY", ")", ";", "break", ";", "}", "case", "LPAREN", ":", "{", "AST", "tmp163_AST", "=", "null", ";", "tmp163_AST", "=", "astFactory", ".", "create", "(", "LT", "(", "1", ")", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "tmp163_AST", ")", ";", "match", "(", "LPAREN", ")", ";", "break", ";", "}", "case", "FINAL", ":", "case", "ABSTRACT", ":", "case", "STRICTFP", ":", "case", "LITERAL_static", ":", "case", "LITERAL_def", ":", "case", "IDENT", ":", "case", "AT", ":", "case", "COMMA", ":", "case", "LITERAL_void", ":", "case", "LITERAL_boolean", ":", "case", "LITERAL_byte", ":", "case", "LITERAL_char", ":", "case", "LITERAL_short", ":", "case", "LITERAL_int", ":", "case", "LITERAL_float", ":", "case", "LITERAL_long", ":", "case", "LITERAL_double", ":", "case", "LITERAL_private", ":", "case", "LITERAL_public", ":", "case", "LITERAL_protected", ":", "case", "LITERAL_transient", ":", "case", "LITERAL_native", ":", "case", "LITERAL_threadsafe", ":", "case", "LITERAL_synchronized", ":", "case", "LITERAL_volatile", ":", "case", "RCURLY", ":", "case", "SEMI", ":", "case", "NLS", ":", "{", "nls", "(", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "returnAST", ")", ";", "{", "switch", "(", "LA", "(", "1", ")", ")", "{", "case", "SEMI", ":", "{", "AST", "tmp164_AST", "=", "null", ";", "tmp164_AST", "=", "astFactory", ".", "create", "(", "LT", "(", "1", ")", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "tmp164_AST", ")", ";", "match", "(", "SEMI", ")", ";", "break", ";", "}", "case", "COMMA", ":", "{", "AST", "tmp165_AST", "=", "null", ";", "tmp165_AST", "=", "astFactory", ".", "create", "(", "LT", "(", "1", ")", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "tmp165_AST", ")", ";", "match", "(", "COMMA", ")", ";", "break", ";", "}", "case", "FINAL", ":", "case", "ABSTRACT", ":", "case", "STRICTFP", ":", "case", "LITERAL_static", ":", "case", "LITERAL_def", ":", "case", "IDENT", ":", "case", "AT", ":", "case", "LITERAL_void", ":", "case", "LITERAL_boolean", ":", "case", "LITERAL_byte", ":", "case", "LITERAL_char", ":", "case", "LITERAL_short", ":", "case", "LITERAL_int", ":", "case", "LITERAL_float", ":", "case", "LITERAL_long", ":", "case", "LITERAL_double", ":", "case", "LITERAL_private", ":", "case", "LITERAL_public", ":", "case", "LITERAL_protected", ":", "case", "LITERAL_transient", ":", "case", "LITERAL_native", ":", "case", "LITERAL_threadsafe", ":", "case", "LITERAL_synchronized", ":", "case", "LITERAL_volatile", ":", "{", "declarationStart", "(", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "returnAST", ")", ";", "break", ";", "}", "case", "RCURLY", ":", "{", "AST", "tmp166_AST", "=", "null", ";", "tmp166_AST", "=", "astFactory", ".", "create", "(", "LT", "(", "1", ")", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "tmp166_AST", ")", ";", "match", "(", "RCURLY", ")", ";", "break", ";", "}", "default", ":", "{", "throw", "new", "NoViableAltException", "(", "LT", "(", "1", ")", ",", "getFilename", "(", ")", ")", ";", "}", "}", "}", "break", ";", "}", "default", ":", "{", "throw", "new", "NoViableAltException", "(", "LT", "(", "1", ")", ",", "getFilename", "(", ")", ")", ";", "}", "}", "}", "enumConstantsStart_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "returnAST", "=", "enumConstantsStart_AST", ";", "}", "public", "final", "void", "enumConstants", "(", ")", "throws", "RecognitionException", ",", "TokenStreamException", "{", "returnAST", "=", "null", ";", "ASTPair", "currentAST", "=", "new", "ASTPair", "(", ")", ";", "AST", "enumConstants_AST", "=", "null", ";", "enumConstant", "(", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "returnAST", ")", ";", "{", "_loop158", ":", "do", "{", "boolean", "synPredMatched151", "=", "false", ";", "if", "(", "(", "(", "_tokenSet_58", ".", "member", "(", "LA", "(", "1", ")", ")", ")", "&&", "(", "_tokenSet_59", ".", "member", "(", "LA", "(", "2", ")", ")", ")", ")", ")", "{", "int", "_m151", "=", "mark", "(", ")", ";", "synPredMatched151", "=", "true", ";", "inputState", ".", "guessing", "++", ";", "try", "{", "{", "nls", "(", ")", ";", "{", "switch", "(", "LA", "(", "1", ")", ")", "{", "case", "RCURLY", ":", "{", "match", "(", "RCURLY", ")", ";", "break", ";", "}", "case", "FINAL", ":", "case", "ABSTRACT", ":", "case", "STRICTFP", ":", "case", "LITERAL_static", ":", "case", "LITERAL_def", ":", "case", "IDENT", ":", "case", "LITERAL_class", ":", "case", "LITERAL_interface", ":", "case", "LITERAL_enum", ":", "case", "AT", ":", "case", "LITERAL_void", ":", "case", "LITERAL_boolean", ":", "case", "LITERAL_byte", ":", "case", "LITERAL_char", ":", "case", "LITERAL_short", ":", "case", "LITERAL_int", ":", "case", "LITERAL_float", ":", "case", "LITERAL_long", ":", "case", "LITERAL_double", ":", "case", "LITERAL_private", ":", "case", "LITERAL_public", ":", "case", "LITERAL_protected", ":", "case", "LITERAL_transient", ":", "case", "LITERAL_native", ":", "case", "LITERAL_threadsafe", ":", "case", "LITERAL_synchronized", ":", "case", "LITERAL_volatile", ":", "case", "LCURLY", ":", "{", "classField", "(", ")", ";", "break", ";", "}", "default", ":", "{", "throw", "new", "NoViableAltException", "(", "LT", "(", "1", ")", ",", "getFilename", "(", ")", ")", ";", "}", "}", "}", "}", "}", "catch", "(", "RecognitionException", "pe", ")", "{", "synPredMatched151", "=", "false", ";", "}", "rewind", "(", "_m151", ")", ";", "inputState", ".", "guessing", "--", ";", "}", "if", "(", "synPredMatched151", ")", "{", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "break", ";", "}", "}", "else", "if", "(", "(", "LA", "(", "1", ")", "==", "COMMA", "||", "LA", "(", "1", ")", "==", "NLS", ")", "&&", "(", "_tokenSet_60", ".", "member", "(", "LA", "(", "2", ")", ")", ")", ")", "{", "nls", "(", ")", ";", "match", "(", "COMMA", ")", ";", "{", "boolean", "synPredMatched155", "=", "false", ";", "if", "(", "(", "(", "_tokenSet_58", ".", "member", "(", "LA", "(", "1", ")", ")", ")", "&&", "(", "_tokenSet_59", ".", "member", "(", "LA", "(", "2", ")", ")", ")", ")", ")", "{", "int", "_m155", "=", "mark", "(", ")", ";", "synPredMatched155", "=", "true", ";", "inputState", ".", "guessing", "++", ";", "try", "{", "{", "nls", "(", ")", ";", "{", "switch", "(", "LA", "(", "1", ")", ")", "{", "case", "RCURLY", ":", "{", "match", "(", "RCURLY", ")", ";", "break", ";", "}", "case", "FINAL", ":", "case", "ABSTRACT", ":", "case", "STRICTFP", ":", "case", "LITERAL_static", ":", "case", "LITERAL_def", ":", "case", "IDENT", ":", "case", "LITERAL_class", ":", "case", "LITERAL_interface", ":", "case", "LITERAL_enum", ":", "case", "AT", ":", "case", "LITERAL_void", ":", "case", "LITERAL_boolean", ":", "case", "LITERAL_byte", ":", "case", "LITERAL_char", ":", "case", "LITERAL_short", ":", "case", "LITERAL_int", ":", "case", "LITERAL_float", ":", "case", "LITERAL_long", ":", "case", "LITERAL_double", ":", "case", "LITERAL_private", ":", "case", "LITERAL_public", ":", "case", "LITERAL_protected", ":", "case", "LITERAL_transient", ":", "case", "LITERAL_native", ":", "case", "LITERAL_threadsafe", ":", "case", "LITERAL_synchronized", ":", "case", "LITERAL_volatile", ":", "case", "LCURLY", ":", "{", "classField", "(", ")", ";", "break", ";", "}", "default", ":", "{", "throw", "new", "NoViableAltException", "(", "LT", "(", "1", ")", ",", "getFilename", "(", ")", ")", ";", "}", "}", "}", "}", "}", "catch", "(", "RecognitionException", "pe", ")", "{", "synPredMatched155", "=", "false", ";", "}", "rewind", "(", "_m155", ")", ";", "inputState", ".", "guessing", "--", ";", "}", "if", "(", "synPredMatched155", ")", "{", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "break", ";", "}", "}", "else", "{", "boolean", "synPredMatched157", "=", "false", ";", "if", "(", "(", "(", "_tokenSet_61", ".", "member", "(", "LA", "(", "1", ")", ")", ")", "&&", "(", "_tokenSet_62", ".", "member", "(", "LA", "(", "2", ")", ")", ")", ")", ")", "{", "int", "_m157", "=", "mark", "(", ")", ";", "synPredMatched157", "=", "true", ";", "inputState", ".", "guessing", "++", ";", "try", "{", "{", "nls", "(", ")", ";", "annotationsOpt", "(", ")", ";", "match", "(", "IDENT", ")", ";", "}", "}", "catch", "(", "RecognitionException", "pe", ")", "{", "synPredMatched157", "=", "false", ";", "}", "rewind", "(", "_m157", ")", ";", "inputState", ".", "guessing", "--", ";", "}", "if", "(", "synPredMatched157", ")", "{", "nls", "(", ")", ";", "enumConstant", "(", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "returnAST", ")", ";", "}", "else", "{", "throw", "new", "NoViableAltException", "(", "LT", "(", "1", ")", ",", "getFilename", "(", ")", ")", ";", "}", "}", "}", "}", "else", "{", "break", "_loop158", ";", "}", "}", "while", "(", "true", ")", ";", "}", "enumConstants_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "returnAST", "=", "enumConstants_AST", ";", "}", "public", "final", "void", "enumConstant", "(", ")", "throws", "RecognitionException", ",", "TokenStreamException", "{", "returnAST", "=", "null", ";", "ASTPair", "currentAST", "=", "new", "ASTPair", "(", ")", ";", "AST", "enumConstant_AST", "=", "null", ";", "AST", "an_AST", "=", "null", ";", "Token", "i", "=", "null", ";", "AST", "i_AST", "=", "null", ";", "AST", "a_AST", "=", "null", ";", "AST", "b_AST", "=", "null", ";", "Token", "first", "=", "LT", "(", "1", ")", ";", "annotationsOpt", "(", ")", ";", "an_AST", "=", "(", "AST", ")", "returnAST", ";", "i", "=", "LT", "(", "1", ")", ";", "i_AST", "=", "astFactory", ".", "create", "(", "i", ")", ";", "match", "(", "IDENT", ")", ";", "{", "switch", "(", "LA", "(", "1", ")", ")", "{", "case", "LPAREN", ":", "{", "match", "(", "LPAREN", ")", ";", "argList", "(", ")", ";", "a_AST", "=", "(", "AST", ")", "returnAST", ";", "match", "(", "RPAREN", ")", ";", "break", ";", "}", "case", "COMMA", ":", "case", "LCURLY", ":", "case", "RCURLY", ":", "case", "SEMI", ":", "case", "NLS", ":", "{", "break", ";", "}", "default", ":", "{", "throw", "new", "NoViableAltException", "(", "LT", "(", "1", ")", ",", "getFilename", "(", ")", ")", ";", "}", "}", "}", "{", "switch", "(", "LA", "(", "1", ")", ")", "{", "case", "LCURLY", ":", "{", "enumConstantBlock", "(", ")", ";", "b_AST", "=", "(", "AST", ")", "returnAST", ";", "break", ";", "}", "case", "COMMA", ":", "case", "RCURLY", ":", "case", "SEMI", ":", "case", "NLS", ":", "{", "break", ";", "}", "default", ":", "{", "throw", "new", "NoViableAltException", "(", "LT", "(", "1", ")", ",", "getFilename", "(", ")", ")", ";", "}", "}", "}", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "enumConstant_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "enumConstant_AST", "=", "(", "AST", ")", "astFactory", ".", "make", "(", "(", "new", "ASTArray", "(", "5", ")", ")", ".", "add", "(", "create", "(", "ENUM_CONSTANT_DEF", ",", "\"\"", ",", "first", ",", "LT", "(", "1", ")", ")", ")", ".", "add", "(", "an_AST", ")", ".", "add", "(", "i_AST", ")", ".", "add", "(", "a_AST", ")", ".", "add", "(", "b_AST", ")", ")", ";", "currentAST", ".", "root", "=", "enumConstant_AST", ";", "currentAST", ".", "child", "=", "enumConstant_AST", "!=", "null", "&&", "enumConstant_AST", ".", "getFirstChild", "(", ")", "!=", "null", "?", "enumConstant_AST", ".", "getFirstChild", "(", ")", ":", "enumConstant_AST", ";", "currentAST", ".", "advanceChildToEnd", "(", ")", ";", "}", "returnAST", "=", "enumConstant_AST", ";", "}", "public", "final", "void", "argList", "(", ")", "throws", "RecognitionException", ",", "TokenStreamException", "{", "returnAST", "=", "null", ";", "ASTPair", "currentAST", "=", "new", "ASTPair", "(", ")", ";", "AST", "argList_AST", "=", "null", ";", "Token", "first", "=", "LT", "(", "1", ")", ";", "Token", "lastComma", "=", "null", ";", "int", "hls", "=", "0", ",", "hls2", "=", "0", ";", "boolean", "hasClosureList", "=", "false", ";", "boolean", "trailingComma", "=", "false", ";", "boolean", "sce", "=", "false", ";", "{", "switch", "(", "LA", "(", "1", ")", ")", "{", "case", "FINAL", ":", "case", "ABSTRACT", ":", "case", "UNUSED_GOTO", ":", "case", "UNUSED_CONST", ":", "case", "UNUSED_DO", ":", "case", "STRICTFP", ":", "case", "LITERAL_package", ":", "case", "LITERAL_import", ":", "case", "LITERAL_static", ":", "case", "LITERAL_def", ":", "case", "LBRACK", ":", "case", "IDENT", ":", "case", "STRING_LITERAL", ":", "case", "LPAREN", ":", "case", "LITERAL_class", ":", "case", "LITERAL_interface", ":", "case", "LITERAL_enum", ":", "case", "AT", ":", "case", "LITERAL_extends", ":", "case", "LITERAL_super", ":", "case", "LITERAL_void", ":", "case", "LITERAL_boolean", ":", "case", "LITERAL_byte", ":", "case", "LITERAL_char", ":", "case", "LITERAL_short", ":", "case", "LITERAL_int", ":", "case", "LITERAL_float", ":", "case", "LITERAL_long", ":", "case", "LITERAL_double", ":", "case", "STAR", ":", "case", "LITERAL_as", ":", "case", "LITERAL_private", ":", "case", "LITERAL_public", ":", "case", "LITERAL_protected", ":", "case", "LITERAL_transient", ":", "case", "LITERAL_native", ":", "case", "LITERAL_threadsafe", ":", "case", "LITERAL_synchronized", ":", "case", "LITERAL_volatile", ":", "case", "LCURLY", ":", "case", "LITERAL_default", ":", "case", "LITERAL_throws", ":", "case", "LITERAL_implements", ":", "case", "LITERAL_this", ":", "case", "LITERAL_if", ":", "case", "LITERAL_else", ":", "case", "LITERAL_while", ":", "case", "LITERAL_switch", ":", "case", "LITERAL_for", ":", "case", "LITERAL_in", ":", "case", "LITERAL_return", ":", "case", "LITERAL_break", ":", "case", "LITERAL_continue", ":", "case", "LITERAL_throw", ":", "case", "LITERAL_assert", ":", "case", "PLUS", ":", "case", "MINUS", ":", "case", "LITERAL_case", ":", "case", "LITERAL_try", ":", "case", "LITERAL_finally", ":", "case", "LITERAL_catch", ":", "case", "LITERAL_false", ":", "case", "LITERAL_instanceof", ":", "case", "LITERAL_new", ":", "case", "LITERAL_null", ":", "case", "LITERAL_true", ":", "case", "INC", ":", "case", "DEC", ":", "case", "BNOT", ":", "case", "LNOT", ":", "case", "STRING_CTOR_START", ":", "case", "NUM_INT", ":", "case", "NUM_FLOAT", ":", "case", "NUM_LONG", ":", "case", "NUM_DOUBLE", ":", "case", "NUM_BIG_INT", ":", "case", "NUM_BIG_DECIMAL", ":", "{", "hls", "=", "argument", "(", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "returnAST", ")", ";", "{", "switch", "(", "LA", "(", "1", ")", ")", "{", "case", "SEMI", ":", "{", "{", "{", "int", "_cnt536", "=", "0", ";", "_loop536", ":", "do", "{", "if", "(", "(", "LA", "(", "1", ")", "==", "SEMI", ")", ")", "{", "match", "(", "SEMI", ")", ";", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "hasClosureList", "=", "true", ";", "}", "{", "switch", "(", "LA", "(", "1", ")", ")", "{", "case", "FINAL", ":", "case", "ABSTRACT", ":", "case", "STRICTFP", ":", "case", "LITERAL_static", ":", "case", "LITERAL_def", ":", "case", "LBRACK", ":", "case", "IDENT", ":", "case", "STRING_LITERAL", ":", "case", "LPAREN", ":", "case", "AT", ":", "case", "LITERAL_super", ":", "case", "LITERAL_void", ":", "case", "LITERAL_boolean", ":", "case", "LITERAL_byte", ":", "case", "LITERAL_char", ":", "case", "LITERAL_short", ":", "case", "LITERAL_int", ":", "case", "LITERAL_float", ":", "case", "LITERAL_long", ":", "case", "LITERAL_double", ":", "case", "LITERAL_private", ":", "case", "LITERAL_public", ":", "case", "LITERAL_protected", ":", "case", "LITERAL_transient", ":", "case", "LITERAL_native", ":", "case", "LITERAL_threadsafe", ":", "case", "LITERAL_synchronized", ":", "case", "LITERAL_volatile", ":", "case", "LCURLY", ":", "case", "LITERAL_this", ":", "case", "LITERAL_return", ":", "case", "LITERAL_break", ":", "case", "LITERAL_continue", ":", "case", "LITERAL_throw", ":", "case", "LITERAL_assert", ":", "case", "PLUS", ":", "case", "MINUS", ":", "case", "LITERAL_false", ":", "case", "LITERAL_new", ":", "case", "LITERAL_null", ":", "case", "LITERAL_true", ":", "case", "INC", ":", "case", "DEC", ":", "case", "BNOT", ":", "case", "LNOT", ":", "case", "STRING_CTOR_START", ":", "case", "NUM_INT", ":", "case", "NUM_FLOAT", ":", "case", "NUM_LONG", ":", "case", "NUM_DOUBLE", ":", "case", "NUM_BIG_INT", ":", "case", "NUM_BIG_DECIMAL", ":", "{", "sce", "=", "strictContextExpression", "(", "true", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "returnAST", ")", ";", "break", ";", "}", "case", "RBRACK", ":", "case", "RPAREN", ":", "case", "SEMI", ":", "{", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "astFactory", ".", "create", "(", "EMPTY_STAT", ",", "\"EMPTY_STAT\"", ")", ")", ";", "}", "break", ";", "}", "default", ":", "{", "throw", "new", "NoViableAltException", "(", "LT", "(", "1", ")", ",", "getFilename", "(", ")", ")", ";", "}", "}", "}", "}", "else", "{", "if", "(", "_cnt536", ">=", "1", ")", "{", "break", "_loop536", ";", "}", "else", "{", "throw", "new", "NoViableAltException", "(", "LT", "(", "1", ")", ",", "getFilename", "(", ")", ")", ";", "}", "}", "_cnt536", "++", ";", "}", "while", "(", "true", ")", ";", "}", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "argList_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "argList_AST", "=", "(", "AST", ")", "astFactory", ".", "make", "(", "(", "new", "ASTArray", "(", "2", ")", ")", ".", "add", "(", "create", "(", "CLOSURE_LIST", ",", "\"CLOSURE_LIST\"", ",", "first", ",", "LT", "(", "1", ")", ")", ")", ".", "add", "(", "argList_AST", ")", ")", ";", "currentAST", ".", "root", "=", "argList_AST", ";", "currentAST", ".", "child", "=", "argList_AST", "!=", "null", "&&", "argList_AST", ".", "getFirstChild", "(", ")", "!=", "null", "?", "argList_AST", ".", "getFirstChild", "(", ")", ":", "argList_AST", ";", "currentAST", ".", "advanceChildToEnd", "(", ")", ";", "}", "}", "break", ";", "}", "case", "RBRACK", ":", "case", "COMMA", ":", "case", "RPAREN", ":", "{", "{", "{", "_loop542", ":", "do", "{", "if", "(", "(", "LA", "(", "1", ")", "==", "COMMA", ")", ")", "{", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "lastComma", "=", "LT", "(", "1", ")", ";", "}", "match", "(", "COMMA", ")", ";", "{", "switch", "(", "LA", "(", "1", ")", ")", "{", "case", "FINAL", ":", "case", "ABSTRACT", ":", "case", "UNUSED_GOTO", ":", "case", "UNUSED_CONST", ":", "case", "UNUSED_DO", ":", "case", "STRICTFP", ":", "case", "LITERAL_package", ":", "case", "LITERAL_import", ":", "case", "LITERAL_static", ":", "case", "LITERAL_def", ":", "case", "LBRACK", ":", "case", "IDENT", ":", "case", "STRING_LITERAL", ":", "case", "LPAREN", ":", "case", "LITERAL_class", ":", "case", "LITERAL_interface", ":", "case", "LITERAL_enum", ":", "case", "AT", ":", "case", "LITERAL_extends", ":", "case", "LITERAL_super", ":", "case", "LITERAL_void", ":", "case", "LITERAL_boolean", ":", "case", "LITERAL_byte", ":", "case", "LITERAL_char", ":", "case", "LITERAL_short", ":", "case", "LITERAL_int", ":", "case", "LITERAL_float", ":", "case", "LITERAL_long", ":", "case", "LITERAL_double", ":", "case", "STAR", ":", "case", "LITERAL_as", ":", "case", "LITERAL_private", ":", "case", "LITERAL_public", ":", "case", "LITERAL_protected", ":", "case", "LITERAL_transient", ":", "case", "LITERAL_native", ":", "case", "LITERAL_threadsafe", ":", "case", "LITERAL_synchronized", ":", "case", "LITERAL_volatile", ":", "case", "LCURLY", ":", "case", "LITERAL_default", ":", "case", "LITERAL_throws", ":", "case", "LITERAL_implements", ":", "case", "LITERAL_this", ":", "case", "LITERAL_if", ":", "case", "LITERAL_else", ":", "case", "LITERAL_while", ":", "case", "LITERAL_switch", ":", "case", "LITERAL_for", ":", "case", "LITERAL_in", ":", "case", "LITERAL_return", ":", "case", "LITERAL_break", ":", "case", "LITERAL_continue", ":", "case", "LITERAL_throw", ":", "case", "LITERAL_assert", ":", "case", "PLUS", ":", "case", "MINUS", ":", "case", "LITERAL_case", ":", "case", "LITERAL_try", ":", "case", "LITERAL_finally", ":", "case", "LITERAL_catch", ":", "case", "LITERAL_false", ":", "case", "LITERAL_instanceof", ":", "case", "LITERAL_new", ":", "case", "LITERAL_null", ":", "case", "LITERAL_true", ":", "case", "INC", ":", "case", "DEC", ":", "case", "BNOT", ":", "case", "LNOT", ":", "case", "STRING_CTOR_START", ":", "case", "NUM_INT", ":", "case", "NUM_FLOAT", ":", "case", "NUM_LONG", ":", "case", "NUM_DOUBLE", ":", "case", "NUM_BIG_INT", ":", "case", "NUM_BIG_DECIMAL", ":", "{", "{", "hls2", "=", "argument", "(", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "returnAST", ")", ";", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "hls", "|=", "hls2", ";", "}", "}", "break", ";", "}", "case", "RBRACK", ":", "case", "COMMA", ":", "case", "RPAREN", ":", "{", "{", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "if", "(", "trailingComma", ")", "throw", "new", "NoViableAltException", "(", "lastComma", ",", "getFilename", "(", ")", ")", ";", "trailingComma", "=", "true", ";", "}", "}", "break", ";", "}", "default", ":", "{", "throw", "new", "NoViableAltException", "(", "LT", "(", "1", ")", ",", "getFilename", "(", ")", ")", ";", "}", "}", "}", "}", "else", "{", "break", "_loop542", ";", "}", "}", "while", "(", "true", ")", ";", "}", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "argList_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "argList_AST", "=", "(", "AST", ")", "astFactory", ".", "make", "(", "(", "new", "ASTArray", "(", "2", ")", ")", ".", "add", "(", "create", "(", "ELIST", ",", "\"ELIST\"", ",", "first", ",", "LT", "(", "1", ")", ")", ")", ".", "add", "(", "argList_AST", ")", ")", ";", "currentAST", ".", "root", "=", "argList_AST", ";", "currentAST", ".", "child", "=", "argList_AST", "!=", "null", "&&", "argList_AST", ".", "getFirstChild", "(", ")", "!=", "null", "?", "argList_AST", ".", "getFirstChild", "(", ")", ":", "argList_AST", ";", "currentAST", ".", "advanceChildToEnd", "(", ")", ";", "}", "}", "break", ";", "}", "default", ":", "{", "throw", "new", "NoViableAltException", "(", "LT", "(", "1", ")", ",", "getFilename", "(", ")", ")", ";", "}", "}", "}", "break", ";", "}", "case", "RBRACK", ":", "case", "RPAREN", ":", "{", "{", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "argList_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "argList_AST", "=", "create", "(", "ELIST", ",", "\"ELIST\"", ",", "first", ",", "LT", "(", "1", ")", ")", ";", "currentAST", ".", "root", "=", "argList_AST", ";", "currentAST", ".", "child", "=", "argList_AST", "!=", "null", "&&", "argList_AST", ".", "getFirstChild", "(", ")", "!=", "null", "?", "argList_AST", ".", "getFirstChild", "(", ")", ":", "argList_AST", ";", "currentAST", ".", "advanceChildToEnd", "(", ")", ";", "}", "}", "break", ";", "}", "default", ":", "{", "throw", "new", "NoViableAltException", "(", "LT", "(", "1", ")", ",", "getFilename", "(", ")", ")", ";", "}", "}", "}", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "argListHasLabels", "=", "(", "hls", "&", "1", ")", "!=", "0", ";", "}", "argList_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "returnAST", "=", "argList_AST", ";", "}", "public", "final", "void", "enumConstantBlock", "(", ")", "throws", "RecognitionException", ",", "TokenStreamException", "{", "returnAST", "=", "null", ";", "ASTPair", "currentAST", "=", "new", "ASTPair", "(", ")", ";", "AST", "enumConstantBlock_AST", "=", "null", ";", "Token", "first", "=", "LT", "(", "1", ")", ";", "match", "(", "LCURLY", ")", ";", "{", "switch", "(", "LA", "(", "1", ")", ")", "{", "case", "FINAL", ":", "case", "ABSTRACT", ":", "case", "STRICTFP", ":", "case", "LITERAL_static", ":", "case", "LITERAL_def", ":", "case", "IDENT", ":", "case", "LT", ":", "case", "LITERAL_class", ":", "case", "LITERAL_interface", ":", "case", "LITERAL_enum", ":", "case", "AT", ":", "case", "LITERAL_void", ":", "case", "LITERAL_boolean", ":", "case", "LITERAL_byte", ":", "case", "LITERAL_char", ":", "case", "LITERAL_short", ":", "case", "LITERAL_int", ":", "case", "LITERAL_float", ":", "case", "LITERAL_long", ":", "case", "LITERAL_double", ":", "case", "LITERAL_private", ":", "case", "LITERAL_public", ":", "case", "LITERAL_protected", ":", "case", "LITERAL_transient", ":", "case", "LITERAL_native", ":", "case", "LITERAL_threadsafe", ":", "case", "LITERAL_synchronized", ":", "case", "LITERAL_volatile", ":", "case", "LCURLY", ":", "{", "enumConstantField", "(", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "returnAST", ")", ";", "break", ";", "}", "case", "RCURLY", ":", "case", "SEMI", ":", "case", "NLS", ":", "{", "break", ";", "}", "default", ":", "{", "throw", "new", "NoViableAltException", "(", "LT", "(", "1", ")", ",", "getFilename", "(", ")", ")", ";", "}", "}", "}", "{", "_loop172", ":", "do", "{", "if", "(", "(", "LA", "(", "1", ")", "==", "SEMI", "||", "LA", "(", "1", ")", "==", "NLS", ")", ")", "{", "sep", "(", ")", ";", "{", "switch", "(", "LA", "(", "1", ")", ")", "{", "case", "FINAL", ":", "case", "ABSTRACT", ":", "case", "STRICTFP", ":", "case", "LITERAL_static", ":", "case", "LITERAL_def", ":", "case", "IDENT", ":", "case", "LT", ":", "case", "LITERAL_class", ":", "case", "LITERAL_interface", ":", "case", "LITERAL_enum", ":", "case", "AT", ":", "case", "LITERAL_void", ":", "case", "LITERAL_boolean", ":", "case", "LITERAL_byte", ":", "case", "LITERAL_char", ":", "case", "LITERAL_short", ":", "case", "LITERAL_int", ":", "case", "LITERAL_float", ":", "case", "LITERAL_long", ":", "case", "LITERAL_double", ":", "case", "LITERAL_private", ":", "case", "LITERAL_public", ":", "case", "LITERAL_protected", ":", "case", "LITERAL_transient", ":", "case", "LITERAL_native", ":", "case", "LITERAL_threadsafe", ":", "case", "LITERAL_synchronized", ":", "case", "LITERAL_volatile", ":", "case", "LCURLY", ":", "{", "enumConstantField", "(", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "returnAST", ")", ";", "break", ";", "}", "case", "RCURLY", ":", "case", "SEMI", ":", "case", "NLS", ":", "{", "break", ";", "}", "default", ":", "{", "throw", "new", "NoViableAltException", "(", "LT", "(", "1", ")", ",", "getFilename", "(", ")", ")", ";", "}", "}", "}", "}", "else", "{", "break", "_loop172", ";", "}", "}", "while", "(", "true", ")", ";", "}", "match", "(", "RCURLY", ")", ";", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "enumConstantBlock_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "enumConstantBlock_AST", "=", "(", "AST", ")", "astFactory", ".", "make", "(", "(", "new", "ASTArray", "(", "2", ")", ")", ".", "add", "(", "create", "(", "OBJBLOCK", ",", "\"OBJBLOCK\"", ",", "first", ",", "LT", "(", "1", ")", ")", ")", ".", "add", "(", "enumConstantBlock_AST", ")", ")", ";", "currentAST", ".", "root", "=", "enumConstantBlock_AST", ";", "currentAST", ".", "child", "=", "enumConstantBlock_AST", "!=", "null", "&&", "enumConstantBlock_AST", ".", "getFirstChild", "(", ")", "!=", "null", "?", "enumConstantBlock_AST", ".", "getFirstChild", "(", ")", ":", "enumConstantBlock_AST", ";", "currentAST", ".", "advanceChildToEnd", "(", ")", ";", "}", "enumConstantBlock_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "returnAST", "=", "enumConstantBlock_AST", ";", "}", "public", "final", "void", "enumConstantField", "(", ")", "throws", "RecognitionException", ",", "TokenStreamException", "{", "returnAST", "=", "null", ";", "ASTPair", "currentAST", "=", "new", "ASTPair", "(", ")", ";", "AST", "enumConstantField_AST", "=", "null", ";", "AST", "mods_AST", "=", "null", ";", "AST", "td_AST", "=", "null", ";", "AST", "tp_AST", "=", "null", ";", "AST", "t_AST", "=", "null", ";", "AST", "param_AST", "=", "null", ";", "AST", "tc_AST", "=", "null", ";", "AST", "s2_AST", "=", "null", ";", "AST", "v_AST", "=", "null", ";", "AST", "s4_AST", "=", "null", ";", "Token", "first", "=", "LT", "(", "1", ")", ";", "switch", "(", "LA", "(", "1", ")", ")", "{", "case", "FINAL", ":", "case", "ABSTRACT", ":", "case", "STRICTFP", ":", "case", "LITERAL_static", ":", "case", "LITERAL_def", ":", "case", "IDENT", ":", "case", "LT", ":", "case", "LITERAL_class", ":", "case", "LITERAL_interface", ":", "case", "LITERAL_enum", ":", "case", "AT", ":", "case", "LITERAL_void", ":", "case", "LITERAL_boolean", ":", "case", "LITERAL_byte", ":", "case", "LITERAL_char", ":", "case", "LITERAL_short", ":", "case", "LITERAL_int", ":", "case", "LITERAL_float", ":", "case", "LITERAL_long", ":", "case", "LITERAL_double", ":", "case", "LITERAL_private", ":", "case", "LITERAL_public", ":", "case", "LITERAL_protected", ":", "case", "LITERAL_transient", ":", "case", "LITERAL_native", ":", "case", "LITERAL_threadsafe", ":", "case", "LITERAL_synchronized", ":", "case", "LITERAL_volatile", ":", "{", "modifiersOpt", "(", ")", ";", "mods_AST", "=", "(", "AST", ")", "returnAST", ";", "{", "switch", "(", "LA", "(", "1", ")", ")", "{", "case", "LITERAL_class", ":", "case", "LITERAL_interface", ":", "case", "LITERAL_enum", ":", "case", "AT", ":", "{", "typeDefinitionInternal", "(", "mods_AST", ")", ";", "td_AST", "=", "(", "AST", ")", "returnAST", ";", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "enumConstantField_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "enumConstantField_AST", "=", "td_AST", ";", "currentAST", ".", "root", "=", "enumConstantField_AST", ";", "currentAST", ".", "child", "=", "enumConstantField_AST", "!=", "null", "&&", "enumConstantField_AST", ".", "getFirstChild", "(", ")", "!=", "null", "?", "enumConstantField_AST", ".", "getFirstChild", "(", ")", ":", "enumConstantField_AST", ";", "currentAST", ".", "advanceChildToEnd", "(", ")", ";", "}", "break", ";", "}", "case", "IDENT", ":", "case", "LT", ":", "case", "LITERAL_void", ":", "case", "LITERAL_boolean", ":", "case", "LITERAL_byte", ":", "case", "LITERAL_char", ":", "case", "LITERAL_short", ":", "case", "LITERAL_int", ":", "case", "LITERAL_float", ":", "case", "LITERAL_long", ":", "case", "LITERAL_double", ":", "{", "{", "switch", "(", "LA", "(", "1", ")", ")", "{", "case", "LT", ":", "{", "typeParameters", "(", ")", ";", "tp_AST", "=", "(", "AST", ")", "returnAST", ";", "break", ";", "}", "case", "IDENT", ":", "case", "LITERAL_void", ":", "case", "LITERAL_boolean", ":", "case", "LITERAL_byte", ":", "case", "LITERAL_char", ":", "case", "LITERAL_short", ":", "case", "LITERAL_int", ":", "case", "LITERAL_float", ":", "case", "LITERAL_long", ":", "case", "LITERAL_double", ":", "{", "break", ";", "}", "default", ":", "{", "throw", "new", "NoViableAltException", "(", "LT", "(", "1", ")", ",", "getFilename", "(", ")", ")", ";", "}", "}", "}", "typeSpec", "(", "false", ")", ";", "t_AST", "=", "(", "AST", ")", "returnAST", ";", "{", "boolean", "synPredMatched178", "=", "false", ";", "if", "(", "(", "(", "LA", "(", "1", ")", "==", "IDENT", ")", "&&", "(", "LA", "(", "2", ")", "==", "LPAREN", ")", ")", ")", "{", "int", "_m178", "=", "mark", "(", ")", ";", "synPredMatched178", "=", "true", ";", "inputState", ".", "guessing", "++", ";", "try", "{", "{", "match", "(", "IDENT", ")", ";", "match", "(", "LPAREN", ")", ";", "}", "}", "catch", "(", "RecognitionException", "pe", ")", "{", "synPredMatched178", "=", "false", ";", "}", "rewind", "(", "_m178", ")", ";", "inputState", ".", "guessing", "--", ";", "}", "if", "(", "synPredMatched178", ")", "{", "AST", "tmp174_AST", "=", "null", ";", "tmp174_AST", "=", "astFactory", ".", "create", "(", "LT", "(", "1", ")", ")", ";", "match", "(", "IDENT", ")", ";", "match", "(", "LPAREN", ")", ";", "parameterDeclarationList", "(", ")", ";", "param_AST", "=", "(", "AST", ")", "returnAST", ";", "match", "(", "RPAREN", ")", ";", "{", "boolean", "synPredMatched181", "=", "false", ";", "if", "(", "(", "(", "LA", "(", "1", ")", "==", "LITERAL_throws", "||", "LA", "(", "1", ")", "==", "NLS", ")", "&&", "(", "_tokenSet_29", ".", "member", "(", "LA", "(", "2", ")", ")", ")", ")", ")", "{", "int", "_m181", "=", "mark", "(", ")", ";", "synPredMatched181", "=", "true", ";", "inputState", ".", "guessing", "++", ";", "try", "{", "{", "nls", "(", ")", ";", "match", "(", "LITERAL_throws", ")", ";", "}", "}", "catch", "(", "RecognitionException", "pe", ")", "{", "synPredMatched181", "=", "false", ";", "}", "rewind", "(", "_m181", ")", ";", "inputState", ".", "guessing", "--", ";", "}", "if", "(", "synPredMatched181", ")", "{", "throwsClause", "(", ")", ";", "tc_AST", "=", "(", "AST", ")", "returnAST", ";", "}", "else", "if", "(", "(", "_tokenSet_63", ".", "member", "(", "LA", "(", "1", ")", ")", ")", "&&", "(", "_tokenSet_64", ".", "member", "(", "LA", "(", "2", ")", ")", ")", ")", "{", "}", "else", "{", "throw", "new", "NoViableAltException", "(", "LT", "(", "1", ")", ",", "getFilename", "(", ")", ")", ";", "}", "}", "{", "switch", "(", "LA", "(", "1", ")", ")", "{", "case", "LCURLY", ":", "{", "compoundStatement", "(", ")", ";", "s2_AST", "=", "(", "AST", ")", "returnAST", ";", "break", ";", "}", "case", "RCURLY", ":", "case", "SEMI", ":", "case", "NLS", ":", "{", "break", ";", "}", "default", ":", "{", "throw", "new", "NoViableAltException", "(", "LT", "(", "1", ")", ",", "getFilename", "(", ")", ")", ";", "}", "}", "}", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "enumConstantField_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "enumConstantField_AST", "=", "(", "AST", ")", "astFactory", ".", "make", "(", "(", "new", "ASTArray", "(", "8", ")", ")", ".", "add", "(", "create", "(", "METHOD_DEF", ",", "\"METHOD_DEF\"", ",", "first", ",", "LT", "(", "1", ")", ")", ")", ".", "add", "(", "mods_AST", ")", ".", "add", "(", "tp_AST", ")", ".", "add", "(", "(", "AST", ")", "astFactory", ".", "make", "(", "(", "new", "ASTArray", "(", "2", ")", ")", ".", "add", "(", "create", "(", "TYPE", ",", "\"TYPE\"", ",", "first", ",", "LT", "(", "1", ")", ")", ")", ".", "add", "(", "t_AST", ")", ")", ")", ".", "add", "(", "tmp174_AST", ")", ".", "add", "(", "param_AST", ")", ".", "add", "(", "tc_AST", ")", ".", "add", "(", "s2_AST", ")", ")", ";", "currentAST", ".", "root", "=", "enumConstantField_AST", ";", "currentAST", ".", "child", "=", "enumConstantField_AST", "!=", "null", "&&", "enumConstantField_AST", ".", "getFirstChild", "(", ")", "!=", "null", "?", "enumConstantField_AST", ".", "getFirstChild", "(", ")", ":", "enumConstantField_AST", ";", "currentAST", ".", "advanceChildToEnd", "(", ")", ";", "}", "}", "else", "if", "(", "(", "LA", "(", "1", ")", "==", "IDENT", "||", "LA", "(", "1", ")", "==", "STRING_LITERAL", ")", "&&", "(", "_tokenSet_57", ".", "member", "(", "LA", "(", "2", ")", ")", ")", ")", "{", "variableDefinitions", "(", "mods_AST", ",", "t_AST", ")", ";", "v_AST", "=", "(", "AST", ")", "returnAST", ";", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "enumConstantField_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "enumConstantField_AST", "=", "v_AST", ";", "currentAST", ".", "root", "=", "enumConstantField_AST", ";", "currentAST", ".", "child", "=", "enumConstantField_AST", "!=", "null", "&&", "enumConstantField_AST", ".", "getFirstChild", "(", ")", "!=", "null", "?", "enumConstantField_AST", ".", "getFirstChild", "(", ")", ":", "enumConstantField_AST", ";", "currentAST", ".", "advanceChildToEnd", "(", ")", ";", "}", "}", "else", "{", "throw", "new", "NoViableAltException", "(", "LT", "(", "1", ")", ",", "getFilename", "(", ")", ")", ";", "}", "}", "break", ";", "}", "default", ":", "{", "throw", "new", "NoViableAltException", "(", "LT", "(", "1", ")", ",", "getFilename", "(", ")", ")", ";", "}", "}", "}", "break", ";", "}", "case", "LCURLY", ":", "{", "compoundStatement", "(", ")", ";", "s4_AST", "=", "(", "AST", ")", "returnAST", ";", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "enumConstantField_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "enumConstantField_AST", "=", "(", "AST", ")", "astFactory", ".", "make", "(", "(", "new", "ASTArray", "(", "2", ")", ")", ".", "add", "(", "create", "(", "INSTANCE_INIT", ",", "\"\"", ",", "first", ",", "LT", "(", "1", ")", ")", ")", ".", "add", "(", "s4_AST", ")", ")", ";", "currentAST", ".", "root", "=", "enumConstantField_AST", ";", "currentAST", ".", "child", "=", "enumConstantField_AST", "!=", "null", "&&", "enumConstantField_AST", ".", "getFirstChild", "(", ")", "!=", "null", "?", "enumConstantField_AST", ".", "getFirstChild", "(", ")", ":", "enumConstantField_AST", ";", "currentAST", ".", "advanceChildToEnd", "(", ")", ";", "}", "break", ";", "}", "default", ":", "{", "throw", "new", "NoViableAltException", "(", "LT", "(", "1", ")", ",", "getFilename", "(", ")", ")", ";", "}", "}", "returnAST", "=", "enumConstantField_AST", ";", "}", "public", "final", "void", "parameterDeclarationList", "(", ")", "throws", "RecognitionException", ",", "TokenStreamException", "{", "returnAST", "=", "null", ";", "ASTPair", "currentAST", "=", "new", "ASTPair", "(", ")", ";", "AST", "parameterDeclarationList_AST", "=", "null", ";", "Token", "first", "=", "LT", "(", "1", ")", ";", "{", "switch", "(", "LA", "(", "1", ")", ")", "{", "case", "FINAL", ":", "case", "LITERAL_def", ":", "case", "IDENT", ":", "case", "AT", ":", "case", "LITERAL_void", ":", "case", "LITERAL_boolean", ":", "case", "LITERAL_byte", ":", "case", "LITERAL_char", ":", "case", "LITERAL_short", ":", "case", "LITERAL_int", ":", "case", "LITERAL_float", ":", "case", "LITERAL_long", ":", "case", "LITERAL_double", ":", "case", "TRIPLE_DOT", ":", "{", "parameterDeclaration", "(", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "returnAST", ")", ";", "{", "_loop259", ":", "do", "{", "if", "(", "(", "LA", "(", "1", ")", "==", "COMMA", ")", ")", "{", "match", "(", "COMMA", ")", ";", "nls", "(", ")", ";", "parameterDeclaration", "(", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "returnAST", ")", ";", "}", "else", "{", "break", "_loop259", ";", "}", "}", "while", "(", "true", ")", ";", "}", "break", ";", "}", "case", "RPAREN", ":", "case", "CLOSABLE_BLOCK_OP", ":", "case", "NLS", ":", "{", "break", ";", "}", "default", ":", "{", "throw", "new", "NoViableAltException", "(", "LT", "(", "1", ")", ",", "getFilename", "(", ")", ")", ";", "}", "}", "}", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "parameterDeclarationList_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "parameterDeclarationList_AST", "=", "(", "AST", ")", "astFactory", ".", "make", "(", "(", "new", "ASTArray", "(", "2", ")", ")", ".", "add", "(", "create", "(", "PARAMETERS", ",", "\"PARAMETERS\"", ",", "first", ",", "LT", "(", "1", ")", ")", ")", ".", "add", "(", "parameterDeclarationList_AST", ")", ")", ";", "currentAST", ".", "root", "=", "parameterDeclarationList_AST", ";", "currentAST", ".", "child", "=", "parameterDeclarationList_AST", "!=", "null", "&&", "parameterDeclarationList_AST", ".", "getFirstChild", "(", ")", "!=", "null", "?", "parameterDeclarationList_AST", ".", "getFirstChild", "(", ")", ":", "parameterDeclarationList_AST", ";", "currentAST", ".", "advanceChildToEnd", "(", ")", ";", "}", "parameterDeclarationList_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "returnAST", "=", "parameterDeclarationList_AST", ";", "}", "public", "final", "void", "throwsClause", "(", ")", "throws", "RecognitionException", ",", "TokenStreamException", "{", "returnAST", "=", "null", ";", "ASTPair", "currentAST", "=", "new", "ASTPair", "(", ")", ";", "AST", "throwsClause_AST", "=", "null", ";", "nls", "(", ")", ";", "AST", "tmp178_AST", "=", "null", ";", "tmp178_AST", "=", "astFactory", ".", "create", "(", "LT", "(", "1", ")", ")", ";", "astFactory", ".", "makeASTRoot", "(", "currentAST", ",", "tmp178_AST", ")", ";", "match", "(", "LITERAL_throws", ")", ";", "nls", "(", ")", ";", "identifier", "(", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "returnAST", ")", ";", "{", "_loop255", ":", "do", "{", "if", "(", "(", "LA", "(", "1", ")", "==", "COMMA", ")", ")", "{", "match", "(", "COMMA", ")", ";", "nls", "(", ")", ";", "identifier", "(", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "returnAST", ")", ";", "}", "else", "{", "break", "_loop255", ";", "}", "}", "while", "(", "true", ")", ";", "}", "throwsClause_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "returnAST", "=", "throwsClause_AST", ";", "}", "public", "final", "void", "compoundStatement", "(", ")", "throws", "RecognitionException", ",", "TokenStreamException", "{", "returnAST", "=", "null", ";", "ASTPair", "currentAST", "=", "new", "ASTPair", "(", ")", ";", "AST", "compoundStatement_AST", "=", "null", ";", "openBlock", "(", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "returnAST", ")", ";", "compoundStatement_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "returnAST", "=", "compoundStatement_AST", ";", "}", "public", "final", "void", "constructorDefinition", "(", "AST", "mods", ")", "throws", "RecognitionException", ",", "TokenStreamException", "{", "returnAST", "=", "null", ";", "ASTPair", "currentAST", "=", "new", "ASTPair", "(", ")", ";", "AST", "constructorDefinition_AST", "=", "null", ";", "Token", "id", "=", "null", ";", "AST", "id_AST", "=", "null", ";", "AST", "param_AST", "=", "null", ";", "AST", "tc_AST", "=", "null", ";", "AST", "cb_AST", "=", "null", ";", "Token", "first", "=", "cloneToken", "(", "LT", "(", "1", ")", ")", ";", "if", "(", "mods", "!=", "null", ")", "{", "first", ".", "setLine", "(", "mods", ".", "getLine", "(", ")", ")", ";", "first", ".", "setColumn", "(", "mods", ".", "getColumn", "(", ")", ")", ";", "}", "id", "=", "LT", "(", "1", ")", ";", "id_AST", "=", "astFactory", ".", "create", "(", "id", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "id_AST", ")", ";", "match", "(", "IDENT", ")", ";", "match", "(", "LPAREN", ")", ";", "parameterDeclarationList", "(", ")", ";", "param_AST", "=", "(", "AST", ")", "returnAST", ";", "match", "(", "RPAREN", ")", ";", "{", "boolean", "synPredMatched244", "=", "false", ";", "if", "(", "(", "(", "LA", "(", "1", ")", "==", "LITERAL_throws", "||", "LA", "(", "1", ")", "==", "NLS", ")", "&&", "(", "_tokenSet_29", ".", "member", "(", "LA", "(", "2", ")", ")", ")", ")", ")", "{", "int", "_m244", "=", "mark", "(", ")", ";", "synPredMatched244", "=", "true", ";", "inputState", ".", "guessing", "++", ";", "try", "{", "{", "nls", "(", ")", ";", "match", "(", "LITERAL_throws", ")", ";", "}", "}", "catch", "(", "RecognitionException", "pe", ")", "{", "synPredMatched244", "=", "false", ";", "}", "rewind", "(", "_m244", ")", ";", "inputState", ".", "guessing", "--", ";", "}", "if", "(", "synPredMatched244", ")", "{", "throwsClause", "(", ")", ";", "tc_AST", "=", "(", "AST", ")", "returnAST", ";", "}", "else", "if", "(", "(", "LA", "(", "1", ")", "==", "LCURLY", "||", "LA", "(", "1", ")", "==", "NLS", ")", "&&", "(", "_tokenSet_65", ".", "member", "(", "LA", "(", "2", ")", ")", ")", ")", "{", "}", "else", "{", "throw", "new", "NoViableAltException", "(", "LT", "(", "1", ")", ",", "getFilename", "(", ")", ")", ";", "}", "}", "nlsWarn", "(", ")", ";", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "isConstructorIdent", "(", "id", ")", ";", "}", "constructorBody", "(", ")", ";", "cb_AST", "=", "(", "AST", ")", "returnAST", ";", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "constructorDefinition_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "constructorDefinition_AST", "=", "(", "AST", ")", "astFactory", ".", "make", "(", "(", "new", "ASTArray", "(", "5", ")", ")", ".", "add", "(", "create", "(", "CTOR_IDENT", ",", "\"CTOR_IDENT\"", ",", "first", ",", "LT", "(", "1", ")", ")", ")", ".", "add", "(", "mods", ")", ".", "add", "(", "param_AST", ")", ".", "add", "(", "tc_AST", ")", ".", "add", "(", "cb_AST", ")", ")", ";", "currentAST", ".", "root", "=", "constructorDefinition_AST", ";", "currentAST", ".", "child", "=", "constructorDefinition_AST", "!=", "null", "&&", "constructorDefinition_AST", ".", "getFirstChild", "(", ")", "!=", "null", "?", "constructorDefinition_AST", ".", "getFirstChild", "(", ")", ":", "constructorDefinition_AST", ";", "currentAST", ".", "advanceChildToEnd", "(", ")", ";", "}", "constructorDefinition_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "returnAST", "=", "constructorDefinition_AST", ";", "}", "public", "final", "void", "multipleAssignmentDeclarationStart", "(", ")", "throws", "RecognitionException", ",", "TokenStreamException", "{", "returnAST", "=", "null", ";", "ASTPair", "currentAST", "=", "new", "ASTPair", "(", ")", ";", "AST", "multipleAssignmentDeclarationStart_AST", "=", "null", ";", "{", "_loop224", ":", "do", "{", "switch", "(", "LA", "(", "1", ")", ")", "{", "case", "FINAL", ":", "case", "ABSTRACT", ":", "case", "STRICTFP", ":", "case", "LITERAL_static", ":", "case", "LITERAL_private", ":", "case", "LITERAL_public", ":", "case", "LITERAL_protected", ":", "case", "LITERAL_transient", ":", "case", "LITERAL_native", ":", "case", "LITERAL_threadsafe", ":", "case", "LITERAL_synchronized", ":", "case", "LITERAL_volatile", ":", "{", "modifier", "(", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "returnAST", ")", ";", "nls", "(", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "returnAST", ")", ";", "break", ";", "}", "case", "AT", ":", "{", "annotation", "(", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "returnAST", ")", ";", "nls", "(", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "returnAST", ")", ";", "break", ";", "}", "default", ":", "{", "break", "_loop224", ";", "}", "}", "}", "while", "(", "true", ")", ";", "}", "AST", "tmp182_AST", "=", "null", ";", "tmp182_AST", "=", "astFactory", ".", "create", "(", "LT", "(", "1", ")", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "tmp182_AST", ")", ";", "match", "(", "LITERAL_def", ")", ";", "nls", "(", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "returnAST", ")", ";", "AST", "tmp183_AST", "=", "null", ";", "tmp183_AST", "=", "astFactory", ".", "create", "(", "LT", "(", "1", ")", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "tmp183_AST", ")", ";", "match", "(", "LPAREN", ")", ";", "multipleAssignmentDeclarationStart_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "returnAST", "=", "multipleAssignmentDeclarationStart_AST", ";", "}", "public", "final", "void", "multipleAssignmentDeclaration", "(", ")", "throws", "RecognitionException", ",", "TokenStreamException", "{", "returnAST", "=", "null", ";", "ASTPair", "currentAST", "=", "new", "ASTPair", "(", ")", ";", "AST", "multipleAssignmentDeclaration_AST", "=", "null", ";", "AST", "mods_AST", "=", "null", ";", "AST", "t_AST", "=", "null", ";", "Token", "first", "=", "cloneToken", "(", "LT", "(", "1", ")", ")", ";", "modifiers", "(", ")", ";", "mods_AST", "=", "(", "AST", ")", "returnAST", ";", "{", "switch", "(", "LA", "(", "1", ")", ")", "{", "case", "IDENT", ":", "case", "LITERAL_void", ":", "case", "LITERAL_boolean", ":", "case", "LITERAL_byte", ":", "case", "LITERAL_char", ":", "case", "LITERAL_short", ":", "case", "LITERAL_int", ":", "case", "LITERAL_float", ":", "case", "LITERAL_long", ":", "case", "LITERAL_double", ":", "{", "typeSpec", "(", "false", ")", ";", "t_AST", "=", "(", "AST", ")", "returnAST", ";", "break", ";", "}", "case", "LPAREN", ":", "{", "break", ";", "}", "default", ":", "{", "throw", "new", "NoViableAltException", "(", "LT", "(", "1", ")", ",", "getFilename", "(", ")", ")", ";", "}", "}", "}", "AST", "tmp184_AST", "=", "null", ";", "tmp184_AST", "=", "astFactory", ".", "create", "(", "LT", "(", "1", ")", ")", ";", "astFactory", ".", "makeASTRoot", "(", "currentAST", ",", "tmp184_AST", ")", ";", "match", "(", "LPAREN", ")", ";", "nls", "(", ")", ";", "typeNamePairs", "(", "mods_AST", ",", "first", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "returnAST", ")", ";", "match", "(", "RPAREN", ")", ";", "AST", "tmp186_AST", "=", "null", ";", "tmp186_AST", "=", "astFactory", ".", "create", "(", "LT", "(", "1", ")", ")", ";", "astFactory", ".", "makeASTRoot", "(", "currentAST", ",", "tmp186_AST", ")", ";", "match", "(", "ASSIGN", ")", ";", "nls", "(", ")", ";", "assignmentExpression", "(", "0", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "returnAST", ")", ";", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "multipleAssignmentDeclaration_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "multipleAssignmentDeclaration_AST", "=", "(", "AST", ")", "astFactory", ".", "make", "(", "(", "new", "ASTArray", "(", "4", ")", ")", ".", "add", "(", "create", "(", "VARIABLE_DEF", ",", "\"VARIABLE_DEF\"", ",", "first", ",", "LT", "(", "1", ")", ")", ")", ".", "add", "(", "mods_AST", ")", ".", "add", "(", "(", "AST", ")", "astFactory", ".", "make", "(", "(", "new", "ASTArray", "(", "2", ")", ")", ".", "add", "(", "create", "(", "TYPE", ",", "\"TYPE\"", ",", "first", ",", "LT", "(", "1", ")", ")", ")", ".", "add", "(", "t_AST", ")", ")", ")", ".", "add", "(", "multipleAssignmentDeclaration_AST", ")", ")", ";", "currentAST", ".", "root", "=", "multipleAssignmentDeclaration_AST", ";", "currentAST", ".", "child", "=", "multipleAssignmentDeclaration_AST", "!=", "null", "&&", "multipleAssignmentDeclaration_AST", ".", "getFirstChild", "(", ")", "!=", "null", "?", "multipleAssignmentDeclaration_AST", ".", "getFirstChild", "(", ")", ":", "multipleAssignmentDeclaration_AST", ";", "currentAST", ".", "advanceChildToEnd", "(", ")", ";", "}", "multipleAssignmentDeclaration_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "returnAST", "=", "multipleAssignmentDeclaration_AST", ";", "}", "public", "final", "void", "constructorBody", "(", ")", "throws", "RecognitionException", ",", "TokenStreamException", "{", "returnAST", "=", "null", ";", "ASTPair", "currentAST", "=", "new", "ASTPair", "(", ")", ";", "AST", "constructorBody_AST", "=", "null", ";", "AST", "eci_AST", "=", "null", ";", "AST", "bb1_AST", "=", "null", ";", "AST", "bb2_AST", "=", "null", ";", "Token", "first", "=", "LT", "(", "1", ")", ";", "match", "(", "LCURLY", ")", ";", "nls", "(", ")", ";", "{", "boolean", "synPredMatched214", "=", "false", ";", "if", "(", "(", "(", "_tokenSet_66", ".", "member", "(", "LA", "(", "1", ")", ")", ")", "&&", "(", "_tokenSet_67", ".", "member", "(", "LA", "(", "2", ")", ")", ")", ")", ")", "{", "int", "_m214", "=", "mark", "(", ")", ";", "synPredMatched214", "=", "true", ";", "inputState", ".", "guessing", "++", ";", "try", "{", "{", "explicitConstructorInvocation", "(", ")", ";", "}", "}", "catch", "(", "RecognitionException", "pe", ")", "{", "synPredMatched214", "=", "false", ";", "}", "rewind", "(", "_m214", ")", ";", "inputState", ".", "guessing", "--", ";", "}", "if", "(", "synPredMatched214", ")", "{", "explicitConstructorInvocation", "(", ")", ";", "eci_AST", "=", "(", "AST", ")", "returnAST", ";", "{", "switch", "(", "LA", "(", "1", ")", ")", "{", "case", "SEMI", ":", "case", "NLS", ":", "{", "sep", "(", ")", ";", "blockBody", "(", "sepToken", ")", ";", "bb1_AST", "=", "(", "AST", ")", "returnAST", ";", "break", ";", "}", "case", "RCURLY", ":", "{", "break", ";", "}", "default", ":", "{", "throw", "new", "NoViableAltException", "(", "LT", "(", "1", ")", ",", "getFilename", "(", ")", ")", ";", "}", "}", "}", "}", "else", "if", "(", "(", "_tokenSet_31", ".", "member", "(", "LA", "(", "1", ")", ")", ")", "&&", "(", "_tokenSet_68", ".", "member", "(", "LA", "(", "2", ")", ")", ")", ")", "{", "blockBody", "(", "EOF", ")", ";", "bb2_AST", "=", "(", "AST", ")", "returnAST", ";", "}", "else", "{", "throw", "new", "NoViableAltException", "(", "LT", "(", "1", ")", ",", "getFilename", "(", ")", ")", ";", "}", "}", "match", "(", "RCURLY", ")", ";", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "constructorBody_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "if", "(", "eci_AST", "!=", "null", ")", "constructorBody_AST", "=", "(", "AST", ")", "astFactory", ".", "make", "(", "(", "new", "ASTArray", "(", "3", ")", ")", ".", "add", "(", "create", "(", "SLIST", ",", "\"{\"", ",", "first", ",", "LT", "(", "1", ")", ")", ")", ".", "add", "(", "eci_AST", ")", ".", "add", "(", "bb1_AST", ")", ")", ";", "else", "constructorBody_AST", "=", "(", "AST", ")", "astFactory", ".", "make", "(", "(", "new", "ASTArray", "(", "2", ")", ")", ".", "add", "(", "create", "(", "SLIST", ",", "\"{\"", ",", "first", ",", "LT", "(", "1", ")", ")", ")", ".", "add", "(", "bb2_AST", ")", ")", ";", "currentAST", ".", "root", "=", "constructorBody_AST", ";", "currentAST", ".", "child", "=", "constructorBody_AST", "!=", "null", "&&", "constructorBody_AST", ".", "getFirstChild", "(", ")", "!=", "null", "?", "constructorBody_AST", ".", "getFirstChild", "(", ")", ":", "constructorBody_AST", ";", "currentAST", ".", "advanceChildToEnd", "(", ")", ";", "}", "constructorBody_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "returnAST", "=", "constructorBody_AST", ";", "}", "public", "final", "void", "explicitConstructorInvocation", "(", ")", "throws", "RecognitionException", ",", "TokenStreamException", "{", "returnAST", "=", "null", ";", "ASTPair", "currentAST", "=", "new", "ASTPair", "(", ")", ";", "AST", "explicitConstructorInvocation_AST", "=", "null", ";", "Token", "lp1", "=", "null", ";", "AST", "lp1_AST", "=", "null", ";", "Token", "lp2", "=", "null", ";", "AST", "lp2_AST", "=", "null", ";", "{", "switch", "(", "LA", "(", "1", ")", ")", "{", "case", "LT", ":", "{", "typeArguments", "(", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "returnAST", ")", ";", "break", ";", "}", "case", "LITERAL_super", ":", "case", "LITERAL_this", ":", "{", "break", ";", "}", "default", ":", "{", "throw", "new", "NoViableAltException", "(", "LT", "(", "1", ")", ",", "getFilename", "(", ")", ")", ";", "}", "}", "}", "{", "switch", "(", "LA", "(", "1", ")", ")", "{", "case", "LITERAL_this", ":", "{", "match", "(", "LITERAL_this", ")", ";", "lp1", "=", "LT", "(", "1", ")", ";", "lp1_AST", "=", "astFactory", ".", "create", "(", "lp1", ")", ";", "astFactory", ".", "makeASTRoot", "(", "currentAST", ",", "lp1_AST", ")", ";", "match", "(", "LPAREN", ")", ";", "argList", "(", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "returnAST", ")", ";", "match", "(", "RPAREN", ")", ";", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "lp1_AST", ".", "setType", "(", "CTOR_CALL", ")", ";", "}", "break", ";", "}", "case", "LITERAL_super", ":", "{", "match", "(", "LITERAL_super", ")", ";", "lp2", "=", "LT", "(", "1", ")", ";", "lp2_AST", "=", "astFactory", ".", "create", "(", "lp2", ")", ";", "astFactory", ".", "makeASTRoot", "(", "currentAST", ",", "lp2_AST", ")", ";", "match", "(", "LPAREN", ")", ";", "argList", "(", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "returnAST", ")", ";", "match", "(", "RPAREN", ")", ";", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "lp2_AST", ".", "setType", "(", "SUPER_CTOR_CALL", ")", ";", "}", "break", ";", "}", "default", ":", "{", "throw", "new", "NoViableAltException", "(", "LT", "(", "1", ")", ",", "getFilename", "(", ")", ")", ";", "}", "}", "}", "explicitConstructorInvocation_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "returnAST", "=", "explicitConstructorInvocation_AST", ";", "}", "public", "final", "void", "listOfVariables", "(", "AST", "mods", ",", "AST", "t", ",", "Token", "first", ")", "throws", "RecognitionException", ",", "TokenStreamException", "{", "returnAST", "=", "null", ";", "ASTPair", "currentAST", "=", "new", "ASTPair", "(", ")", ";", "AST", "listOfVariables_AST", "=", "null", ";", "variableDeclarator", "(", "getASTFactory", "(", ")", ".", "dupTree", "(", "mods", ")", ",", "getASTFactory", "(", ")", ".", "dupTree", "(", "t", ")", ",", "first", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "returnAST", ")", ";", "{", "_loop221", ":", "do", "{", "if", "(", "(", "LA", "(", "1", ")", "==", "COMMA", ")", ")", "{", "match", "(", "COMMA", ")", ";", "nls", "(", ")", ";", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "first", "=", "LT", "(", "1", ")", ";", "}", "variableDeclarator", "(", "getASTFactory", "(", ")", ".", "dupTree", "(", "mods", ")", ",", "getASTFactory", "(", ")", ".", "dupTree", "(", "t", ")", ",", "first", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "returnAST", ")", ";", "}", "else", "{", "break", "_loop221", ";", "}", "}", "while", "(", "true", ")", ";", "}", "listOfVariables_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "returnAST", "=", "listOfVariables_AST", ";", "}", "public", "final", "void", "variableDeclarator", "(", "AST", "mods", ",", "AST", "t", ",", "Token", "first", ")", "throws", "RecognitionException", ",", "TokenStreamException", "{", "returnAST", "=", "null", ";", "ASTPair", "currentAST", "=", "new", "ASTPair", "(", ")", ";", "AST", "variableDeclarator_AST", "=", "null", ";", "AST", "id_AST", "=", "null", ";", "AST", "v_AST", "=", "null", ";", "variableName", "(", ")", ";", "id_AST", "=", "(", "AST", ")", "returnAST", ";", "{", "switch", "(", "LA", "(", "1", ")", ")", "{", "case", "ASSIGN", ":", "{", "varInitializer", "(", ")", ";", "v_AST", "=", "(", "AST", ")", "returnAST", ";", "break", ";", "}", "case", "EOF", ":", "case", "COMMA", ":", "case", "RPAREN", ":", "case", "RCURLY", ":", "case", "SEMI", ":", "case", "LITERAL_default", ":", "case", "LITERAL_else", ":", "case", "LITERAL_case", ":", "case", "NLS", ":", "{", "break", ";", "}", "default", ":", "{", "throw", "new", "NoViableAltException", "(", "LT", "(", "1", ")", ",", "getFilename", "(", ")", ")", ";", "}", "}", "}", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "variableDeclarator_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "variableDeclarator_AST", "=", "(", "AST", ")", "astFactory", ".", "make", "(", "(", "new", "ASTArray", "(", "5", ")", ")", ".", "add", "(", "create", "(", "VARIABLE_DEF", ",", "\"VARIABLE_DEF\"", ",", "first", ",", "LT", "(", "1", ")", ")", ")", ".", "add", "(", "mods", ")", ".", "add", "(", "(", "AST", ")", "astFactory", ".", "make", "(", "(", "new", "ASTArray", "(", "2", ")", ")", ".", "add", "(", "create", "(", "TYPE", ",", "\"TYPE\"", ",", "first", ",", "LT", "(", "1", ")", ")", ")", ".", "add", "(", "t", ")", ")", ")", ".", "add", "(", "id_AST", ")", ".", "add", "(", "v_AST", ")", ")", ";", "currentAST", ".", "root", "=", "variableDeclarator_AST", ";", "currentAST", ".", "child", "=", "variableDeclarator_AST", "!=", "null", "&&", "variableDeclarator_AST", ".", "getFirstChild", "(", ")", "!=", "null", "?", "variableDeclarator_AST", ".", "getFirstChild", "(", ")", ":", "variableDeclarator_AST", ";", "currentAST", ".", "advanceChildToEnd", "(", ")", ";", "}", "returnAST", "=", "variableDeclarator_AST", ";", "}", "public", "final", "void", "typeNamePairs", "(", "AST", "mods", ",", "Token", "first", ")", "throws", "RecognitionException", ",", "TokenStreamException", "{", "returnAST", "=", "null", ";", "ASTPair", "currentAST", "=", "new", "ASTPair", "(", ")", ";", "AST", "typeNamePairs_AST", "=", "null", ";", "AST", "t_AST", "=", "null", ";", "AST", "tn_AST", "=", "null", ";", "{", "if", "(", "(", "_tokenSet_25", ".", "member", "(", "LA", "(", "1", ")", ")", ")", "&&", "(", "_tokenSet_32", ".", "member", "(", "LA", "(", "2", ")", ")", ")", ")", "{", "typeSpec", "(", "false", ")", ";", "t_AST", "=", "(", "AST", ")", "returnAST", ";", "}", "else", "if", "(", "(", "LA", "(", "1", ")", "==", "IDENT", ")", "&&", "(", "LA", "(", "2", ")", "==", "COMMA", "||", "LA", "(", "2", ")", "==", "RPAREN", ")", ")", "{", "}", "else", "{", "throw", "new", "NoViableAltException", "(", "LT", "(", "1", ")", ",", "getFilename", "(", ")", ")", ";", "}", "}", "singleVariable", "(", "getASTFactory", "(", ")", ".", "dupTree", "(", "mods", ")", ",", "t_AST", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "returnAST", ")", ";", "{", "_loop229", ":", "do", "{", "if", "(", "(", "LA", "(", "1", ")", "==", "COMMA", ")", ")", "{", "match", "(", "COMMA", ")", ";", "nls", "(", ")", ";", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "first", "=", "LT", "(", "1", ")", ";", "}", "{", "if", "(", "(", "_tokenSet_25", ".", "member", "(", "LA", "(", "1", ")", ")", ")", "&&", "(", "_tokenSet_32", ".", "member", "(", "LA", "(", "2", ")", ")", ")", ")", "{", "typeSpec", "(", "false", ")", ";", "tn_AST", "=", "(", "AST", ")", "returnAST", ";", "}", "else", "if", "(", "(", "LA", "(", "1", ")", "==", "IDENT", ")", "&&", "(", "LA", "(", "2", ")", "==", "COMMA", "||", "LA", "(", "2", ")", "==", "RPAREN", ")", ")", "{", "}", "else", "{", "throw", "new", "NoViableAltException", "(", "LT", "(", "1", ")", ",", "getFilename", "(", ")", ")", ";", "}", "}", "singleVariable", "(", "getASTFactory", "(", ")", ".", "dupTree", "(", "mods", ")", ",", "tn_AST", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "returnAST", ")", ";", "}", "else", "{", "break", "_loop229", ";", "}", "}", "while", "(", "true", ")", ";", "}", "typeNamePairs_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "returnAST", "=", "typeNamePairs_AST", ";", "}", "public", "final", "void", "assignmentExpression", "(", "int", "lc_stmt", ")", "throws", "RecognitionException", ",", "TokenStreamException", "{", "returnAST", "=", "null", ";", "ASTPair", "currentAST", "=", "new", "ASTPair", "(", ")", ";", "AST", "assignmentExpression_AST", "=", "null", ";", "conditionalExpression", "(", "lc_stmt", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "returnAST", ")", ";", "{", "switch", "(", "LA", "(", "1", ")", ")", "{", "case", "ASSIGN", ":", "case", "PLUS_ASSIGN", ":", "case", "MINUS_ASSIGN", ":", "case", "STAR_ASSIGN", ":", "case", "DIV_ASSIGN", ":", "case", "MOD_ASSIGN", ":", "case", "SR_ASSIGN", ":", "case", "BSR_ASSIGN", ":", "case", "SL_ASSIGN", ":", "case", "BAND_ASSIGN", ":", "case", "BXOR_ASSIGN", ":", "case", "BOR_ASSIGN", ":", "case", "STAR_STAR_ASSIGN", ":", "{", "{", "switch", "(", "LA", "(", "1", ")", ")", "{", "case", "ASSIGN", ":", "{", "AST", "tmp195_AST", "=", "null", ";", "tmp195_AST", "=", "astFactory", ".", "create", "(", "LT", "(", "1", ")", ")", ";", "astFactory", ".", "makeASTRoot", "(", "currentAST", ",", "tmp195_AST", ")", ";", "match", "(", "ASSIGN", ")", ";", "break", ";", "}", "case", "PLUS_ASSIGN", ":", "{", "AST", "tmp196_AST", "=", "null", ";", "tmp196_AST", "=", "astFactory", ".", "create", "(", "LT", "(", "1", ")", ")", ";", "astFactory", ".", "makeASTRoot", "(", "currentAST", ",", "tmp196_AST", ")", ";", "match", "(", "PLUS_ASSIGN", ")", ";", "break", ";", "}", "case", "MINUS_ASSIGN", ":", "{", "AST", "tmp197_AST", "=", "null", ";", "tmp197_AST", "=", "astFactory", ".", "create", "(", "LT", "(", "1", ")", ")", ";", "astFactory", ".", "makeASTRoot", "(", "currentAST", ",", "tmp197_AST", ")", ";", "match", "(", "MINUS_ASSIGN", ")", ";", "break", ";", "}", "case", "STAR_ASSIGN", ":", "{", "AST", "tmp198_AST", "=", "null", ";", "tmp198_AST", "=", "astFactory", ".", "create", "(", "LT", "(", "1", ")", ")", ";", "astFactory", ".", "makeASTRoot", "(", "currentAST", ",", "tmp198_AST", ")", ";", "match", "(", "STAR_ASSIGN", ")", ";", "break", ";", "}", "case", "DIV_ASSIGN", ":", "{", "AST", "tmp199_AST", "=", "null", ";", "tmp199_AST", "=", "astFactory", ".", "create", "(", "LT", "(", "1", ")", ")", ";", "astFactory", ".", "makeASTRoot", "(", "currentAST", ",", "tmp199_AST", ")", ";", "match", "(", "DIV_ASSIGN", ")", ";", "break", ";", "}", "case", "MOD_ASSIGN", ":", "{", "AST", "tmp200_AST", "=", "null", ";", "tmp200_AST", "=", "astFactory", ".", "create", "(", "LT", "(", "1", ")", ")", ";", "astFactory", ".", "makeASTRoot", "(", "currentAST", ",", "tmp200_AST", ")", ";", "match", "(", "MOD_ASSIGN", ")", ";", "break", ";", "}", "case", "SR_ASSIGN", ":", "{", "AST", "tmp201_AST", "=", "null", ";", "tmp201_AST", "=", "astFactory", ".", "create", "(", "LT", "(", "1", ")", ")", ";", "astFactory", ".", "makeASTRoot", "(", "currentAST", ",", "tmp201_AST", ")", ";", "match", "(", "SR_ASSIGN", ")", ";", "break", ";", "}", "case", "BSR_ASSIGN", ":", "{", "AST", "tmp202_AST", "=", "null", ";", "tmp202_AST", "=", "astFactory", ".", "create", "(", "LT", "(", "1", ")", ")", ";", "astFactory", ".", "makeASTRoot", "(", "currentAST", ",", "tmp202_AST", ")", ";", "match", "(", "BSR_ASSIGN", ")", ";", "break", ";", "}", "case", "SL_ASSIGN", ":", "{", "AST", "tmp203_AST", "=", "null", ";", "tmp203_AST", "=", "astFactory", ".", "create", "(", "LT", "(", "1", ")", ")", ";", "astFactory", ".", "makeASTRoot", "(", "currentAST", ",", "tmp203_AST", ")", ";", "match", "(", "SL_ASSIGN", ")", ";", "break", ";", "}", "case", "BAND_ASSIGN", ":", "{", "AST", "tmp204_AST", "=", "null", ";", "tmp204_AST", "=", "astFactory", ".", "create", "(", "LT", "(", "1", ")", ")", ";", "astFactory", ".", "makeASTRoot", "(", "currentAST", ",", "tmp204_AST", ")", ";", "match", "(", "BAND_ASSIGN", ")", ";", "break", ";", "}", "case", "BXOR_ASSIGN", ":", "{", "AST", "tmp205_AST", "=", "null", ";", "tmp205_AST", "=", "astFactory", ".", "create", "(", "LT", "(", "1", ")", ")", ";", "astFactory", ".", "makeASTRoot", "(", "currentAST", ",", "tmp205_AST", ")", ";", "match", "(", "BXOR_ASSIGN", ")", ";", "break", ";", "}", "case", "BOR_ASSIGN", ":", "{", "AST", "tmp206_AST", "=", "null", ";", "tmp206_AST", "=", "astFactory", ".", "create", "(", "LT", "(", "1", ")", ")", ";", "astFactory", ".", "makeASTRoot", "(", "currentAST", ",", "tmp206_AST", ")", ";", "match", "(", "BOR_ASSIGN", ")", ";", "break", ";", "}", "case", "STAR_STAR_ASSIGN", ":", "{", "AST", "tmp207_AST", "=", "null", ";", "tmp207_AST", "=", "astFactory", ".", "create", "(", "LT", "(", "1", ")", ")", ";", "astFactory", ".", "makeASTRoot", "(", "currentAST", ",", "tmp207_AST", ")", ";", "match", "(", "STAR_STAR_ASSIGN", ")", ";", "break", ";", "}", "default", ":", "{", "throw", "new", "NoViableAltException", "(", "LT", "(", "1", ")", ",", "getFilename", "(", ")", ")", ";", "}", "}", "}", "nls", "(", ")", ";", "expressionStatementNoCheck", "(", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "returnAST", ")", ";", "break", ";", "}", "case", "EOF", ":", "case", "FINAL", ":", "case", "ABSTRACT", ":", "case", "UNUSED_GOTO", ":", "case", "UNUSED_CONST", ":", "case", "UNUSED_DO", ":", "case", "STRICTFP", ":", "case", "LITERAL_package", ":", "case", "LITERAL_import", ":", "case", "LITERAL_static", ":", "case", "LITERAL_def", ":", "case", "LBRACK", ":", "case", "RBRACK", ":", "case", "IDENT", ":", "case", "STRING_LITERAL", ":", "case", "LPAREN", ":", "case", "LITERAL_class", ":", "case", "LITERAL_interface", ":", "case", "LITERAL_enum", ":", "case", "LITERAL_extends", ":", "case", "LITERAL_super", ":", "case", "COMMA", ":", "case", "LITERAL_void", ":", "case", "LITERAL_boolean", ":", "case", "LITERAL_byte", ":", "case", "LITERAL_char", ":", "case", "LITERAL_short", ":", "case", "LITERAL_int", ":", "case", "LITERAL_float", ":", "case", "LITERAL_long", ":", "case", "LITERAL_double", ":", "case", "LITERAL_as", ":", "case", "LITERAL_private", ":", "case", "LITERAL_public", ":", "case", "LITERAL_protected", ":", "case", "LITERAL_transient", ":", "case", "LITERAL_native", ":", "case", "LITERAL_threadsafe", ":", "case", "LITERAL_synchronized", ":", "case", "LITERAL_volatile", ":", "case", "RPAREN", ":", "case", "LCURLY", ":", "case", "RCURLY", ":", "case", "SEMI", ":", "case", "LITERAL_default", ":", "case", "LITERAL_throws", ":", "case", "LITERAL_implements", ":", "case", "LITERAL_this", ":", "case", "CLOSABLE_BLOCK_OP", ":", "case", "COLON", ":", "case", "LITERAL_if", ":", "case", "LITERAL_else", ":", "case", "LITERAL_while", ":", "case", "LITERAL_switch", ":", "case", "LITERAL_for", ":", "case", "LITERAL_in", ":", "case", "LITERAL_return", ":", "case", "LITERAL_break", ":", "case", "LITERAL_continue", ":", "case", "LITERAL_throw", ":", "case", "LITERAL_assert", ":", "case", "PLUS", ":", "case", "MINUS", ":", "case", "LITERAL_case", ":", "case", "LITERAL_try", ":", "case", "LITERAL_finally", ":", "case", "LITERAL_catch", ":", "case", "LITERAL_false", ":", "case", "LITERAL_instanceof", ":", "case", "LITERAL_new", ":", "case", "LITERAL_null", ":", "case", "LITERAL_true", ":", "case", "INC", ":", "case", "DEC", ":", "case", "BNOT", ":", "case", "LNOT", ":", "case", "STRING_CTOR_START", ":", "case", "NUM_INT", ":", "case", "NUM_FLOAT", ":", "case", "NUM_LONG", ":", "case", "NUM_DOUBLE", ":", "case", "NUM_BIG_INT", ":", "case", "NUM_BIG_DECIMAL", ":", "case", "NLS", ":", "{", "break", ";", "}", "default", ":", "{", "throw", "new", "NoViableAltException", "(", "LT", "(", "1", ")", ",", "getFilename", "(", ")", ")", ";", "}", "}", "}", "assignmentExpression_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "returnAST", "=", "assignmentExpression_AST", ";", "}", "public", "final", "void", "nlsWarn", "(", ")", "throws", "RecognitionException", ",", "TokenStreamException", "{", "returnAST", "=", "null", ";", "ASTPair", "currentAST", "=", "new", "ASTPair", "(", ")", ";", "AST", "nlsWarn_AST", "=", "null", ";", "{", "boolean", "synPredMatched581", "=", "false", ";", "if", "(", "(", "(", "_tokenSet_69", ".", "member", "(", "LA", "(", "1", ")", ")", ")", "&&", "(", "_tokenSet_2", ".", "member", "(", "LA", "(", "2", ")", ")", ")", ")", ")", "{", "int", "_m581", "=", "mark", "(", ")", ";", "synPredMatched581", "=", "true", ";", "inputState", ".", "guessing", "++", ";", "try", "{", "{", "match", "(", "NLS", ")", ";", "}", "}", "catch", "(", "RecognitionException", "pe", ")", "{", "synPredMatched581", "=", "false", ";", "}", "rewind", "(", "_m581", ")", ";", "inputState", ".", "guessing", "--", ";", "}", "if", "(", "synPredMatched581", ")", "{", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "addWarning", "(", "\"\"", ",", "\"\"", ")", ";", "}", "}", "else", "if", "(", "(", "_tokenSet_69", ".", "member", "(", "LA", "(", "1", ")", ")", ")", "&&", "(", "_tokenSet_2", ".", "member", "(", "LA", "(", "2", ")", ")", ")", ")", "{", "}", "else", "{", "throw", "new", "NoViableAltException", "(", "LT", "(", "1", ")", ",", "getFilename", "(", ")", ")", ";", "}", "}", "nls", "(", ")", ";", "returnAST", "=", "nlsWarn_AST", ";", "}", "public", "final", "void", "openBlock", "(", ")", "throws", "RecognitionException", ",", "TokenStreamException", "{", "returnAST", "=", "null", ";", "ASTPair", "currentAST", "=", "new", "ASTPair", "(", ")", ";", "AST", "openBlock_AST", "=", "null", ";", "AST", "bb_AST", "=", "null", ";", "Token", "first", "=", "LT", "(", "1", ")", ";", "match", "(", "LCURLY", ")", ";", "nls", "(", ")", ";", "blockBody", "(", "EOF", ")", ";", "bb_AST", "=", "(", "AST", ")", "returnAST", ";", "match", "(", "RCURLY", ")", ";", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "openBlock_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "openBlock_AST", "=", "(", "AST", ")", "astFactory", ".", "make", "(", "(", "new", "ASTArray", "(", "2", ")", ")", ".", "add", "(", "create", "(", "SLIST", ",", "\"{\"", ",", "first", ",", "LT", "(", "1", ")", ")", ")", ".", "add", "(", "bb_AST", ")", ")", ";", "currentAST", ".", "root", "=", "openBlock_AST", ";", "currentAST", ".", "child", "=", "openBlock_AST", "!=", "null", "&&", "openBlock_AST", ".", "getFirstChild", "(", ")", "!=", "null", "?", "openBlock_AST", ".", "getFirstChild", "(", ")", ":", "openBlock_AST", ";", "currentAST", ".", "advanceChildToEnd", "(", ")", ";", "}", "openBlock_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "returnAST", "=", "openBlock_AST", ";", "}", "public", "final", "void", "variableName", "(", ")", "throws", "RecognitionException", ",", "TokenStreamException", "{", "returnAST", "=", "null", ";", "ASTPair", "currentAST", "=", "new", "ASTPair", "(", ")", ";", "AST", "variableName_AST", "=", "null", ";", "AST", "tmp210_AST", "=", "null", ";", "tmp210_AST", "=", "astFactory", ".", "create", "(", "LT", "(", "1", ")", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "tmp210_AST", ")", ";", "match", "(", "IDENT", ")", ";", "variableName_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "returnAST", "=", "variableName_AST", ";", "}", "public", "final", "void", "expressionStatementNoCheck", "(", ")", "throws", "RecognitionException", ",", "TokenStreamException", "{", "returnAST", "=", "null", ";", "ASTPair", "currentAST", "=", "new", "ASTPair", "(", ")", ";", "AST", "expressionStatementNoCheck_AST", "=", "null", ";", "AST", "head_AST", "=", "null", ";", "AST", "cmd_AST", "=", "null", ";", "boolean", "isPathExpr", "=", "true", ";", "expression", "(", "LC_STMT", ")", ";", "head_AST", "=", "(", "AST", ")", "returnAST", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "returnAST", ")", ";", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "isPathExpr", "=", "(", "head_AST", "==", "lastPathExpression", ")", ";", "}", "{", "if", "(", "(", "(", "_tokenSet_70", ".", "member", "(", "LA", "(", "1", ")", ")", ")", "&&", "(", "_tokenSet_71", ".", "member", "(", "LA", "(", "2", ")", ")", ")", ")", "&&", "(", "LA", "(", "1", ")", "!=", "LITERAL_else", "&&", "isPathExpr", ")", ")", "{", "commandArgumentsGreedy", "(", "head_AST", ")", ";", "cmd_AST", "=", "(", "AST", ")", "returnAST", ";", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "expressionStatementNoCheck_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "expressionStatementNoCheck_AST", "=", "cmd_AST", ";", "currentAST", ".", "root", "=", "expressionStatementNoCheck_AST", ";", "currentAST", ".", "child", "=", "expressionStatementNoCheck_AST", "!=", "null", "&&", "expressionStatementNoCheck_AST", ".", "getFirstChild", "(", ")", "!=", "null", "?", "expressionStatementNoCheck_AST", ".", "getFirstChild", "(", ")", ":", "expressionStatementNoCheck_AST", ";", "currentAST", ".", "advanceChildToEnd", "(", ")", ";", "}", "}", "else", "if", "(", "(", "_tokenSet_70", ".", "member", "(", "LA", "(", "1", ")", ")", ")", "&&", "(", "_tokenSet_71", ".", "member", "(", "LA", "(", "2", ")", ")", ")", ")", "{", "}", "else", "{", "throw", "new", "NoViableAltException", "(", "LT", "(", "1", ")", ",", "getFilename", "(", ")", ")", ";", "}", "}", "expressionStatementNoCheck_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "returnAST", "=", "expressionStatementNoCheck_AST", ";", "}", "public", "final", "void", "parameterDeclaration", "(", ")", "throws", "RecognitionException", ",", "TokenStreamException", "{", "returnAST", "=", "null", ";", "ASTPair", "currentAST", "=", "new", "ASTPair", "(", ")", ";", "AST", "parameterDeclaration_AST", "=", "null", ";", "AST", "pm_AST", "=", "null", ";", "AST", "t_AST", "=", "null", ";", "Token", "id", "=", "null", ";", "AST", "id_AST", "=", "null", ";", "AST", "exp_AST", "=", "null", ";", "Token", "first", "=", "LT", "(", "1", ")", ";", "boolean", "spreadParam", "=", "false", ";", "parameterModifiersOpt", "(", ")", ";", "pm_AST", "=", "(", "AST", ")", "returnAST", ";", "{", "if", "(", "(", "_tokenSet_25", ".", "member", "(", "LA", "(", "1", ")", ")", ")", "&&", "(", "_tokenSet_72", ".", "member", "(", "LA", "(", "2", ")", ")", ")", ")", "{", "typeSpec", "(", "false", ")", ";", "t_AST", "=", "(", "AST", ")", "returnAST", ";", "}", "else", "if", "(", "(", "LA", "(", "1", ")", "==", "IDENT", "||", "LA", "(", "1", ")", "==", "TRIPLE_DOT", ")", "&&", "(", "_tokenSet_73", ".", "member", "(", "LA", "(", "2", ")", ")", ")", ")", "{", "}", "else", "{", "throw", "new", "NoViableAltException", "(", "LT", "(", "1", ")", ",", "getFilename", "(", ")", ")", ";", "}", "}", "{", "switch", "(", "LA", "(", "1", ")", ")", "{", "case", "TRIPLE_DOT", ":", "{", "match", "(", "TRIPLE_DOT", ")", ";", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "spreadParam", "=", "true", ";", "}", "break", ";", "}", "case", "IDENT", ":", "{", "break", ";", "}", "default", ":", "{", "throw", "new", "NoViableAltException", "(", "LT", "(", "1", ")", ",", "getFilename", "(", ")", ")", ";", "}", "}", "}", "id", "=", "LT", "(", "1", ")", ";", "id_AST", "=", "astFactory", ".", "create", "(", "id", ")", ";", "match", "(", "IDENT", ")", ";", "{", "switch", "(", "LA", "(", "1", ")", ")", "{", "case", "ASSIGN", ":", "{", "varInitializer", "(", ")", ";", "exp_AST", "=", "(", "AST", ")", "returnAST", ";", "break", ";", "}", "case", "COMMA", ":", "case", "RPAREN", ":", "case", "CLOSABLE_BLOCK_OP", ":", "case", "NLS", ":", "{", "break", ";", "}", "default", ":", "{", "throw", "new", "NoViableAltException", "(", "LT", "(", "1", ")", ",", "getFilename", "(", ")", ")", ";", "}", "}", "}", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "parameterDeclaration_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "if", "(", "spreadParam", ")", "{", "parameterDeclaration_AST", "=", "(", "AST", ")", "astFactory", ".", "make", "(", "(", "new", "ASTArray", "(", "5", ")", ")", ".", "add", "(", "create", "(", "VARIABLE_PARAMETER_DEF", ",", "\"\"", ",", "first", ",", "LT", "(", "1", ")", ")", ")", ".", "add", "(", "pm_AST", ")", ".", "add", "(", "(", "AST", ")", "astFactory", ".", "make", "(", "(", "new", "ASTArray", "(", "2", ")", ")", ".", "add", "(", "create", "(", "TYPE", ",", "\"TYPE\"", ",", "first", ",", "LT", "(", "1", ")", ")", ")", ".", "add", "(", "t_AST", ")", ")", ")", ".", "add", "(", "id_AST", ")", ".", "add", "(", "exp_AST", ")", ")", ";", "}", "else", "{", "parameterDeclaration_AST", "=", "(", "AST", ")", "astFactory", ".", "make", "(", "(", "new", "ASTArray", "(", "5", ")", ")", ".", "add", "(", "create", "(", "PARAMETER_DEF", ",", "\"\"", ",", "first", ",", "LT", "(", "1", ")", ")", ")", ".", "add", "(", "pm_AST", ")", ".", "add", "(", "(", "AST", ")", "astFactory", ".", "make", "(", "(", "new", "ASTArray", "(", "2", ")", ")", ".", "add", "(", "create", "(", "TYPE", ",", "\"TYPE\"", ",", "first", ",", "LT", "(", "1", ")", ")", ")", ".", "add", "(", "t_AST", ")", ")", ")", ".", "add", "(", "id_AST", ")", ".", "add", "(", "exp_AST", ")", ")", ";", "}", "currentAST", ".", "root", "=", "parameterDeclaration_AST", ";", "currentAST", ".", "child", "=", "parameterDeclaration_AST", "!=", "null", "&&", "parameterDeclaration_AST", ".", "getFirstChild", "(", ")", "!=", "null", "?", "parameterDeclaration_AST", ".", "getFirstChild", "(", ")", ":", "parameterDeclaration_AST", ";", "currentAST", ".", "advanceChildToEnd", "(", ")", ";", "}", "returnAST", "=", "parameterDeclaration_AST", ";", "}", "public", "final", "void", "parameterModifiersOpt", "(", ")", "throws", "RecognitionException", ",", "TokenStreamException", "{", "returnAST", "=", "null", ";", "ASTPair", "currentAST", "=", "new", "ASTPair", "(", ")", ";", "AST", "parameterModifiersOpt_AST", "=", "null", ";", "Token", "first", "=", "LT", "(", "1", ")", ";", "int", "seenDef", "=", "0", ";", "{", "_loop266", ":", "do", "{", "switch", "(", "LA", "(", "1", ")", ")", "{", "case", "FINAL", ":", "{", "AST", "tmp212_AST", "=", "null", ";", "tmp212_AST", "=", "astFactory", ".", "create", "(", "LT", "(", "1", ")", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "tmp212_AST", ")", ";", "match", "(", "FINAL", ")", ";", "nls", "(", ")", ";", "break", ";", "}", "case", "AT", ":", "{", "annotation", "(", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "returnAST", ")", ";", "nls", "(", ")", ";", "break", ";", "}", "default", ":", "if", "(", "(", "(", "LA", "(", "1", ")", "==", "LITERAL_def", ")", ")", "&&", "(", "seenDef", "++", "==", "0", ")", ")", "{", "match", "(", "LITERAL_def", ")", ";", "nls", "(", ")", ";", "}", "else", "{", "break", "_loop266", ";", "}", "}", "}", "while", "(", "true", ")", ";", "}", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "parameterModifiersOpt_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "parameterModifiersOpt_AST", "=", "(", "AST", ")", "astFactory", ".", "make", "(", "(", "new", "ASTArray", "(", "2", ")", ")", ".", "add", "(", "create", "(", "MODIFIERS", ",", "\"MODIFIERS\"", ",", "first", ",", "LT", "(", "1", ")", ")", ")", ".", "add", "(", "parameterModifiersOpt_AST", ")", ")", ";", "currentAST", ".", "root", "=", "parameterModifiersOpt_AST", ";", "currentAST", ".", "child", "=", "parameterModifiersOpt_AST", "!=", "null", "&&", "parameterModifiersOpt_AST", ".", "getFirstChild", "(", ")", "!=", "null", "?", "parameterModifiersOpt_AST", ".", "getFirstChild", "(", ")", ":", "parameterModifiersOpt_AST", ";", "currentAST", ".", "advanceChildToEnd", "(", ")", ";", "}", "parameterModifiersOpt_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "returnAST", "=", "parameterModifiersOpt_AST", ";", "}", "public", "final", "void", "closableBlockParamsOpt", "(", "boolean", "addImplicit", ")", "throws", "RecognitionException", ",", "TokenStreamException", "{", "returnAST", "=", "null", ";", "ASTPair", "currentAST", "=", "new", "ASTPair", "(", ")", ";", "AST", "closableBlockParamsOpt_AST", "=", "null", ";", "boolean", "synPredMatched269", "=", "false", ";", "if", "(", "(", "(", "_tokenSet_74", ".", "member", "(", "LA", "(", "1", ")", ")", ")", "&&", "(", "_tokenSet_75", ".", "member", "(", "LA", "(", "2", ")", ")", ")", ")", ")", "{", "int", "_m269", "=", "mark", "(", ")", ";", "synPredMatched269", "=", "true", ";", "inputState", ".", "guessing", "++", ";", "try", "{", "{", "parameterDeclarationList", "(", ")", ";", "nls", "(", ")", ";", "match", "(", "CLOSABLE_BLOCK_OP", ")", ";", "}", "}", "catch", "(", "RecognitionException", "pe", ")", "{", "synPredMatched269", "=", "false", ";", "}", "rewind", "(", "_m269", ")", ";", "inputState", ".", "guessing", "--", ";", "}", "if", "(", "synPredMatched269", ")", "{", "parameterDeclarationList", "(", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "returnAST", ")", ";", "nls", "(", ")", ";", "match", "(", "CLOSABLE_BLOCK_OP", ")", ";", "nls", "(", ")", ";", "closableBlockParamsOpt_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "}", "else", "if", "(", "(", "(", "_tokenSet_31", ".", "member", "(", "LA", "(", "1", ")", ")", ")", "&&", "(", "_tokenSet_71", ".", "member", "(", "LA", "(", "2", ")", ")", ")", ")", "&&", "(", "addImplicit", ")", ")", "{", "implicitParameters", "(", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "returnAST", ")", ";", "closableBlockParamsOpt_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "}", "else", "if", "(", "(", "_tokenSet_31", ".", "member", "(", "LA", "(", "1", ")", ")", ")", "&&", "(", "_tokenSet_71", ".", "member", "(", "LA", "(", "2", ")", ")", ")", ")", "{", "closableBlockParamsOpt_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "}", "else", "{", "throw", "new", "NoViableAltException", "(", "LT", "(", "1", ")", ",", "getFilename", "(", ")", ")", ";", "}", "returnAST", "=", "closableBlockParamsOpt_AST", ";", "}", "public", "final", "void", "implicitParameters", "(", ")", "throws", "RecognitionException", ",", "TokenStreamException", "{", "returnAST", "=", "null", ";", "ASTPair", "currentAST", "=", "new", "ASTPair", "(", ")", ";", "AST", "implicitParameters_AST", "=", "null", ";", "Token", "first", "=", "LT", "(", "1", ")", ";", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "implicitParameters_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "implicitParameters_AST", "=", "(", "AST", ")", "astFactory", ".", "make", "(", "(", "new", "ASTArray", "(", "1", ")", ")", ".", "add", "(", "create", "(", "IMPLICIT_PARAMETERS", ",", "\"\"", ",", "first", ",", "LT", "(", "1", ")", ")", ")", ")", ";", "currentAST", ".", "root", "=", "implicitParameters_AST", ";", "currentAST", ".", "child", "=", "implicitParameters_AST", "!=", "null", "&&", "implicitParameters_AST", ".", "getFirstChild", "(", ")", "!=", "null", "?", "implicitParameters_AST", ".", "getFirstChild", "(", ")", ":", "implicitParameters_AST", ";", "currentAST", ".", "advanceChildToEnd", "(", ")", ";", "}", "implicitParameters_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "returnAST", "=", "implicitParameters_AST", ";", "}", "public", "final", "void", "closableBlockParamsStart", "(", ")", "throws", "RecognitionException", ",", "TokenStreamException", "{", "returnAST", "=", "null", ";", "ASTPair", "currentAST", "=", "new", "ASTPair", "(", ")", ";", "AST", "closableBlockParamsStart_AST", "=", "null", ";", "nls", "(", ")", ";", "parameterDeclarationList", "(", ")", ";", "nls", "(", ")", ";", "AST", "tmp215_AST", "=", "null", ";", "tmp215_AST", "=", "astFactory", ".", "create", "(", "LT", "(", "1", ")", ")", ";", "match", "(", "CLOSABLE_BLOCK_OP", ")", ";", "returnAST", "=", "closableBlockParamsStart_AST", ";", "}", "public", "final", "void", "closableBlockParam", "(", ")", "throws", "RecognitionException", ",", "TokenStreamException", "{", "returnAST", "=", "null", ";", "ASTPair", "currentAST", "=", "new", "ASTPair", "(", ")", ";", "AST", "closableBlockParam_AST", "=", "null", ";", "Token", "id", "=", "null", ";", "AST", "id_AST", "=", "null", ";", "Token", "first", "=", "LT", "(", "1", ")", ";", "id", "=", "LT", "(", "1", ")", ";", "id_AST", "=", "astFactory", ".", "create", "(", "id", ")", ";", "match", "(", "IDENT", ")", ";", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "closableBlockParam_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "closableBlockParam_AST", "=", "(", "AST", ")", "astFactory", ".", "make", "(", "(", "new", "ASTArray", "(", "4", ")", ")", ".", "add", "(", "create", "(", "PARAMETER_DEF", ",", "\"\"", ",", "first", ",", "LT", "(", "1", ")", ")", ")", ".", "add", "(", "(", "AST", ")", "astFactory", ".", "make", "(", "(", "new", "ASTArray", "(", "1", ")", ")", ".", "add", "(", "create", "(", "MODIFIERS", ",", "\"MODIFIERS\"", ",", "first", ",", "LT", "(", "1", ")", ")", ")", ")", ")", ".", "add", "(", "(", "AST", ")", "astFactory", ".", "make", "(", "(", "new", "ASTArray", "(", "1", ")", ")", ".", "add", "(", "create", "(", "TYPE", ",", "\"TYPE\"", ",", "first", ",", "LT", "(", "1", ")", ")", ")", ")", ")", ".", "add", "(", "id_AST", ")", ")", ";", "currentAST", ".", "root", "=", "closableBlockParam_AST", ";", "currentAST", ".", "child", "=", "closableBlockParam_AST", "!=", "null", "&&", "closableBlockParam_AST", ".", "getFirstChild", "(", ")", "!=", "null", "?", "closableBlockParam_AST", ".", "getFirstChild", "(", ")", ":", "closableBlockParam_AST", ";", "currentAST", ".", "advanceChildToEnd", "(", ")", ";", "}", "returnAST", "=", "closableBlockParam_AST", ";", "}", "public", "final", "void", "closableBlock", "(", ")", "throws", "RecognitionException", ",", "TokenStreamException", "{", "returnAST", "=", "null", ";", "ASTPair", "currentAST", "=", "new", "ASTPair", "(", ")", ";", "AST", "closableBlock_AST", "=", "null", ";", "AST", "cbp_AST", "=", "null", ";", "AST", "bb_AST", "=", "null", ";", "Token", "first", "=", "LT", "(", "1", ")", ";", "match", "(", "LCURLY", ")", ";", "nls", "(", ")", ";", "closableBlockParamsOpt", "(", "true", ")", ";", "cbp_AST", "=", "(", "AST", ")", "returnAST", ";", "blockBody", "(", "EOF", ")", ";", "bb_AST", "=", "(", "AST", ")", "returnAST", ";", "match", "(", "RCURLY", ")", ";", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "closableBlock_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "closableBlock_AST", "=", "(", "AST", ")", "astFactory", ".", "make", "(", "(", "new", "ASTArray", "(", "3", ")", ")", ".", "add", "(", "create", "(", "CLOSABLE_BLOCK", ",", "\"{\"", ",", "first", ",", "LT", "(", "1", ")", ")", ")", ".", "add", "(", "cbp_AST", ")", ".", "add", "(", "bb_AST", ")", ")", ";", "currentAST", ".", "root", "=", "closableBlock_AST", ";", "currentAST", ".", "child", "=", "closableBlock_AST", "!=", "null", "&&", "closableBlock_AST", ".", "getFirstChild", "(", ")", "!=", "null", "?", "closableBlock_AST", ".", "getFirstChild", "(", ")", ":", "closableBlock_AST", ";", "currentAST", ".", "advanceChildToEnd", "(", ")", ";", "}", "closableBlock_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "returnAST", "=", "closableBlock_AST", ";", "}", "public", "final", "void", "openOrClosableBlock", "(", ")", "throws", "RecognitionException", ",", "TokenStreamException", "{", "returnAST", "=", "null", ";", "ASTPair", "currentAST", "=", "new", "ASTPair", "(", ")", ";", "AST", "openOrClosableBlock_AST", "=", "null", ";", "AST", "cp_AST", "=", "null", ";", "AST", "bb_AST", "=", "null", ";", "Token", "first", "=", "LT", "(", "1", ")", ";", "match", "(", "LCURLY", ")", ";", "nls", "(", ")", ";", "closableBlockParamsOpt", "(", "false", ")", ";", "cp_AST", "=", "(", "AST", ")", "returnAST", ";", "blockBody", "(", "EOF", ")", ";", "bb_AST", "=", "(", "AST", ")", "returnAST", ";", "match", "(", "RCURLY", ")", ";", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "openOrClosableBlock_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "if", "(", "cp_AST", "==", "null", ")", "openOrClosableBlock_AST", "=", "(", "AST", ")", "astFactory", ".", "make", "(", "(", "new", "ASTArray", "(", "2", ")", ")", ".", "add", "(", "create", "(", "SLIST", ",", "\"{\"", ",", "first", ",", "LT", "(", "1", ")", ")", ")", ".", "add", "(", "bb_AST", ")", ")", ";", "else", "openOrClosableBlock_AST", "=", "(", "AST", ")", "astFactory", ".", "make", "(", "(", "new", "ASTArray", "(", "3", ")", ")", ".", "add", "(", "create", "(", "CLOSABLE_BLOCK", ",", "\"{\"", ",", "first", ",", "LT", "(", "1", ")", ")", ")", ".", "add", "(", "cp_AST", ")", ".", "add", "(", "bb_AST", ")", ")", ";", "currentAST", ".", "root", "=", "openOrClosableBlock_AST", ";", "currentAST", ".", "child", "=", "openOrClosableBlock_AST", "!=", "null", "&&", "openOrClosableBlock_AST", ".", "getFirstChild", "(", ")", "!=", "null", "?", "openOrClosableBlock_AST", ".", "getFirstChild", "(", ")", ":", "openOrClosableBlock_AST", ";", "currentAST", ".", "advanceChildToEnd", "(", ")", ";", "}", "openOrClosableBlock_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "returnAST", "=", "openOrClosableBlock_AST", ";", "}", "public", "final", "void", "statementLabelPrefix", "(", ")", "throws", "RecognitionException", ",", "TokenStreamException", "{", "returnAST", "=", "null", ";", "ASTPair", "currentAST", "=", "new", "ASTPair", "(", ")", ";", "AST", "statementLabelPrefix_AST", "=", "null", ";", "Token", "c", "=", "null", ";", "AST", "c_AST", "=", "null", ";", "AST", "tmp220_AST", "=", "null", ";", "tmp220_AST", "=", "astFactory", ".", "create", "(", "LT", "(", "1", ")", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "tmp220_AST", ")", ";", "match", "(", "IDENT", ")", ";", "c", "=", "LT", "(", "1", ")", ";", "c_AST", "=", "astFactory", ".", "create", "(", "c", ")", ";", "astFactory", ".", "makeASTRoot", "(", "currentAST", ",", "c_AST", ")", ";", "match", "(", "COLON", ")", ";", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "c_AST", ".", "setType", "(", "LABELED_STAT", ")", ";", "}", "nls", "(", ")", ";", "statementLabelPrefix_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "returnAST", "=", "statementLabelPrefix_AST", ";", "}", "public", "final", "void", "expressionStatement", "(", "int", "prevToken", ")", "throws", "RecognitionException", ",", "TokenStreamException", "{", "returnAST", "=", "null", ";", "ASTPair", "currentAST", "=", "new", "ASTPair", "(", ")", ";", "AST", "expressionStatement_AST", "=", "null", ";", "AST", "esn_AST", "=", "null", ";", "Token", "first", "=", "LT", "(", "1", ")", ";", "{", "boolean", "synPredMatched332", "=", "false", ";", "if", "(", "(", "(", "_tokenSet_20", ".", "member", "(", "LA", "(", "1", ")", ")", ")", "&&", "(", "_tokenSet_2", ".", "member", "(", "LA", "(", "2", ")", ")", ")", ")", ")", "{", "int", "_m332", "=", "mark", "(", ")", ";", "synPredMatched332", "=", "true", ";", "inputState", ".", "guessing", "++", ";", "try", "{", "{", "suspiciousExpressionStatementStart", "(", ")", ";", "}", "}", "catch", "(", "RecognitionException", "pe", ")", "{", "synPredMatched332", "=", "false", ";", "}", "rewind", "(", "_m332", ")", ";", "inputState", ".", "guessing", "--", ";", "}", "if", "(", "synPredMatched332", ")", "{", "checkSuspiciousExpressionStatement", "(", "prevToken", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "returnAST", ")", ";", "}", "else", "if", "(", "(", "_tokenSet_20", ".", "member", "(", "LA", "(", "1", ")", ")", ")", "&&", "(", "_tokenSet_2", ".", "member", "(", "LA", "(", "2", ")", ")", ")", ")", "{", "}", "else", "{", "throw", "new", "NoViableAltException", "(", "LT", "(", "1", ")", ",", "getFilename", "(", ")", ")", ";", "}", "}", "expressionStatementNoCheck", "(", ")", ";", "esn_AST", "=", "(", "AST", ")", "returnAST", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "returnAST", ")", ";", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "expressionStatement_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "expressionStatement_AST", "=", "(", "AST", ")", "astFactory", ".", "make", "(", "(", "new", "ASTArray", "(", "2", ")", ")", ".", "add", "(", "create", "(", "EXPR", ",", "\"EXPR\"", ",", "first", ",", "LT", "(", "1", ")", ")", ")", ".", "add", "(", "esn_AST", ")", ")", ";", "currentAST", ".", "root", "=", "expressionStatement_AST", ";", "currentAST", ".", "child", "=", "expressionStatement_AST", "!=", "null", "&&", "expressionStatement_AST", ".", "getFirstChild", "(", ")", "!=", "null", "?", "expressionStatement_AST", ".", "getFirstChild", "(", ")", ":", "expressionStatement_AST", ";", "currentAST", ".", "advanceChildToEnd", "(", ")", ";", "}", "expressionStatement_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "returnAST", "=", "expressionStatement_AST", ";", "}", "public", "final", "void", "assignmentLessExpression", "(", ")", "throws", "RecognitionException", ",", "TokenStreamException", "{", "returnAST", "=", "null", ";", "ASTPair", "currentAST", "=", "new", "ASTPair", "(", ")", ";", "AST", "assignmentLessExpression_AST", "=", "null", ";", "Token", "first", "=", "LT", "(", "1", ")", ";", "{", "conditionalExpression", "(", "0", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "returnAST", ")", ";", "}", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "assignmentLessExpression_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "assignmentLessExpression_AST", "=", "(", "AST", ")", "astFactory", ".", "make", "(", "(", "new", "ASTArray", "(", "2", ")", ")", ".", "add", "(", "create", "(", "EXPR", ",", "\"EXPR\"", ",", "first", ",", "LT", "(", "1", ")", ")", ")", ".", "add", "(", "assignmentLessExpression_AST", ")", ")", ";", "currentAST", ".", "root", "=", "assignmentLessExpression_AST", ";", "currentAST", ".", "child", "=", "assignmentLessExpression_AST", "!=", "null", "&&", "assignmentLessExpression_AST", ".", "getFirstChild", "(", ")", "!=", "null", "?", "assignmentLessExpression_AST", ".", "getFirstChild", "(", ")", ":", "assignmentLessExpression_AST", ";", "currentAST", ".", "advanceChildToEnd", "(", ")", ";", "}", "assignmentLessExpression_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "returnAST", "=", "assignmentLessExpression_AST", ";", "}", "public", "final", "void", "compatibleBodyStatement", "(", ")", "throws", "RecognitionException", ",", "TokenStreamException", "{", "returnAST", "=", "null", ";", "ASTPair", "currentAST", "=", "new", "ASTPair", "(", ")", ";", "AST", "compatibleBodyStatement_AST", "=", "null", ";", "try", "{", "boolean", "synPredMatched321", "=", "false", ";", "if", "(", "(", "(", "LA", "(", "1", ")", "==", "LCURLY", ")", "&&", "(", "_tokenSet_31", ".", "member", "(", "LA", "(", "2", ")", ")", ")", ")", ")", "{", "int", "_m321", "=", "mark", "(", ")", ";", "synPredMatched321", "=", "true", ";", "inputState", ".", "guessing", "++", ";", "try", "{", "{", "match", "(", "LCURLY", ")", ";", "}", "}", "catch", "(", "RecognitionException", "pe", ")", "{", "synPredMatched321", "=", "false", ";", "}", "rewind", "(", "_m321", ")", ";", "inputState", ".", "guessing", "--", ";", "}", "if", "(", "synPredMatched321", ")", "{", "compoundStatement", "(", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "returnAST", ")", ";", "compatibleBodyStatement_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "}", "else", "if", "(", "(", "_tokenSet_19", ".", "member", "(", "LA", "(", "1", ")", ")", ")", "&&", "(", "_tokenSet_2", ".", "member", "(", "LA", "(", "2", ")", ")", ")", ")", "{", "statement", "(", "EOF", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "returnAST", ")", ";", "compatibleBodyStatement_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "}", "else", "{", "throw", "new", "NoViableAltException", "(", "LT", "(", "1", ")", ",", "getFilename", "(", ")", ")", ";", "}", "}", "catch", "(", "RecognitionException", "e", ")", "{", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "reportError", "(", "e", ")", ";", "}", "else", "{", "throw", "e", ";", "}", "}", "returnAST", "=", "compatibleBodyStatement_AST", ";", "}", "public", "final", "void", "forStatement", "(", ")", "throws", "RecognitionException", ",", "TokenStreamException", "{", "returnAST", "=", "null", ";", "ASTPair", "currentAST", "=", "new", "ASTPair", "(", ")", ";", "AST", "forStatement_AST", "=", "null", ";", "AST", "cl_AST", "=", "null", ";", "AST", "fic_AST", "=", "null", ";", "Token", "s", "=", "null", ";", "AST", "s_AST", "=", "null", ";", "AST", "forCbs_AST", "=", "null", ";", "Token", "first", "=", "LT", "(", "1", ")", ";", "match", "(", "LITERAL_for", ")", ";", "match", "(", "LPAREN", ")", ";", "{", "boolean", "synPredMatched308", "=", "false", ";", "if", "(", "(", "(", "_tokenSet_76", ".", "member", "(", "LA", "(", "1", ")", ")", ")", "&&", "(", "_tokenSet_77", ".", "member", "(", "LA", "(", "2", ")", ")", ")", ")", ")", "{", "int", "_m308", "=", "mark", "(", ")", ";", "synPredMatched308", "=", "true", ";", "inputState", ".", "guessing", "++", ";", "try", "{", "{", "switch", "(", "LA", "(", "1", ")", ")", "{", "case", "SEMI", ":", "{", "match", "(", "SEMI", ")", ";", "break", ";", "}", "case", "FINAL", ":", "case", "ABSTRACT", ":", "case", "STRICTFP", ":", "case", "LITERAL_static", ":", "case", "LITERAL_def", ":", "case", "LBRACK", ":", "case", "IDENT", ":", "case", "STRING_LITERAL", ":", "case", "LPAREN", ":", "case", "AT", ":", "case", "LITERAL_super", ":", "case", "LITERAL_void", ":", "case", "LITERAL_boolean", ":", "case", "LITERAL_byte", ":", "case", "LITERAL_char", ":", "case", "LITERAL_short", ":", "case", "LITERAL_int", ":", "case", "LITERAL_float", ":", "case", "LITERAL_long", ":", "case", "LITERAL_double", ":", "case", "LITERAL_private", ":", "case", "LITERAL_public", ":", "case", "LITERAL_protected", ":", "case", "LITERAL_transient", ":", "case", "LITERAL_native", ":", "case", "LITERAL_threadsafe", ":", "case", "LITERAL_synchronized", ":", "case", "LITERAL_volatile", ":", "case", "LCURLY", ":", "case", "LITERAL_this", ":", "case", "LITERAL_return", ":", "case", "LITERAL_break", ":", "case", "LITERAL_continue", ":", "case", "LITERAL_throw", ":", "case", "LITERAL_assert", ":", "case", "PLUS", ":", "case", "MINUS", ":", "case", "LITERAL_false", ":", "case", "LITERAL_new", ":", "case", "LITERAL_null", ":", "case", "LITERAL_true", ":", "case", "INC", ":", "case", "DEC", ":", "case", "BNOT", ":", "case", "LNOT", ":", "case", "STRING_CTOR_START", ":", "case", "NUM_INT", ":", "case", "NUM_FLOAT", ":", "case", "NUM_LONG", ":", "case", "NUM_DOUBLE", ":", "case", "NUM_BIG_INT", ":", "case", "NUM_BIG_DECIMAL", ":", "{", "{", "strictContextExpression", "(", "true", ")", ";", "match", "(", "SEMI", ")", ";", "}", "break", ";", "}", "default", ":", "{", "throw", "new", "NoViableAltException", "(", "LT", "(", "1", ")", ",", "getFilename", "(", ")", ")", ";", "}", "}", "}", "}", "catch", "(", "RecognitionException", "pe", ")", "{", "synPredMatched308", "=", "false", ";", "}", "rewind", "(", "_m308", ")", ";", "inputState", ".", "guessing", "--", ";", "}", "if", "(", "synPredMatched308", ")", "{", "closureList", "(", ")", ";", "cl_AST", "=", "(", "AST", ")", "returnAST", ";", "}", "else", "if", "(", "(", "_tokenSet_16", ".", "member", "(", "LA", "(", "1", ")", ")", ")", "&&", "(", "_tokenSet_78", ".", "member", "(", "LA", "(", "2", ")", ")", ")", ")", "{", "forInClause", "(", ")", ";", "fic_AST", "=", "(", "AST", ")", "returnAST", ";", "}", "else", "{", "throw", "new", "NoViableAltException", "(", "LT", "(", "1", ")", ",", "getFilename", "(", ")", ")", ";", "}", "}", "match", "(", "RPAREN", ")", ";", "nls", "(", ")", ";", "{", "switch", "(", "LA", "(", "1", ")", ")", "{", "case", "SEMI", ":", "{", "s", "=", "LT", "(", "1", ")", ";", "s_AST", "=", "astFactory", ".", "create", "(", "s", ")", ";", "match", "(", "SEMI", ")", ";", "break", ";", "}", "case", "FINAL", ":", "case", "ABSTRACT", ":", "case", "STRICTFP", ":", "case", "LITERAL_import", ":", "case", "LITERAL_static", ":", "case", "LITERAL_def", ":", "case", "LBRACK", ":", "case", "IDENT", ":", "case", "STRING_LITERAL", ":", "case", "LPAREN", ":", "case", "LITERAL_class", ":", "case", "LITERAL_interface", ":", "case", "LITERAL_enum", ":", "case", "AT", ":", "case", "LITERAL_super", ":", "case", "LITERAL_void", ":", "case", "LITERAL_boolean", ":", "case", "LITERAL_byte", ":", "case", "LITERAL_char", ":", "case", "LITERAL_short", ":", "case", "LITERAL_int", ":", "case", "LITERAL_float", ":", "case", "LITERAL_long", ":", "case", "LITERAL_double", ":", "case", "LITERAL_private", ":", "case", "LITERAL_public", ":", "case", "LITERAL_protected", ":", "case", "LITERAL_transient", ":", "case", "LITERAL_native", ":", "case", "LITERAL_threadsafe", ":", "case", "LITERAL_synchronized", ":", "case", "LITERAL_volatile", ":", "case", "LCURLY", ":", "case", "LITERAL_this", ":", "case", "LITERAL_if", ":", "case", "LITERAL_while", ":", "case", "LITERAL_switch", ":", "case", "LITERAL_for", ":", "case", "LITERAL_return", ":", "case", "LITERAL_break", ":", "case", "LITERAL_continue", ":", "case", "LITERAL_throw", ":", "case", "LITERAL_assert", ":", "case", "PLUS", ":", "case", "MINUS", ":", "case", "LITERAL_try", ":", "case", "LITERAL_false", ":", "case", "LITERAL_new", ":", "case", "LITERAL_null", ":", "case", "LITERAL_true", ":", "case", "INC", ":", "case", "DEC", ":", "case", "BNOT", ":", "case", "LNOT", ":", "case", "STRING_CTOR_START", ":", "case", "NUM_INT", ":", "case", "NUM_FLOAT", ":", "case", "NUM_LONG", ":", "case", "NUM_DOUBLE", ":", "case", "NUM_BIG_INT", ":", "case", "NUM_BIG_DECIMAL", ":", "{", "compatibleBodyStatement", "(", ")", ";", "forCbs_AST", "=", "(", "AST", ")", "returnAST", ";", "break", ";", "}", "default", ":", "{", "throw", "new", "NoViableAltException", "(", "LT", "(", "1", ")", ",", "getFilename", "(", ")", ")", ";", "}", "}", "}", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "forStatement_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "if", "(", "cl_AST", "!=", "null", ")", "{", "if", "(", "s_AST", "!=", "null", ")", "forStatement_AST", "=", "(", "AST", ")", "astFactory", ".", "make", "(", "(", "new", "ASTArray", "(", "3", ")", ")", ".", "add", "(", "create", "(", "LITERAL_for", ",", "\"for\"", ",", "first", ",", "LT", "(", "1", ")", ")", ")", ".", "add", "(", "cl_AST", ")", ".", "add", "(", "s_AST", ")", ")", ";", "else", "forStatement_AST", "=", "(", "AST", ")", "astFactory", ".", "make", "(", "(", "new", "ASTArray", "(", "3", ")", ")", ".", "add", "(", "create", "(", "LITERAL_for", ",", "\"for\"", ",", "first", ",", "LT", "(", "1", ")", ")", ")", ".", "add", "(", "cl_AST", ")", ".", "add", "(", "forCbs_AST", ")", ")", ";", "}", "else", "{", "if", "(", "s_AST", "!=", "null", ")", "forStatement_AST", "=", "(", "AST", ")", "astFactory", ".", "make", "(", "(", "new", "ASTArray", "(", "3", ")", ")", ".", "add", "(", "create", "(", "LITERAL_for", ",", "\"for\"", ",", "first", ",", "LT", "(", "1", ")", ")", ")", ".", "add", "(", "fic_AST", ")", ".", "add", "(", "s_AST", ")", ")", ";", "else", "forStatement_AST", "=", "(", "AST", ")", "astFactory", ".", "make", "(", "(", "new", "ASTArray", "(", "3", ")", ")", ".", "add", "(", "create", "(", "LITERAL_for", ",", "\"for\"", ",", "first", ",", "LT", "(", "1", ")", ")", ")", ".", "add", "(", "fic_AST", ")", ".", "add", "(", "forCbs_AST", ")", ")", ";", "}", "currentAST", ".", "root", "=", "forStatement_AST", ";", "currentAST", ".", "child", "=", "forStatement_AST", "!=", "null", "&&", "forStatement_AST", ".", "getFirstChild", "(", ")", "!=", "null", "?", "forStatement_AST", ".", "getFirstChild", "(", ")", ":", "forStatement_AST", ";", "currentAST", ".", "advanceChildToEnd", "(", ")", ";", "}", "forStatement_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "returnAST", "=", "forStatement_AST", ";", "}", "public", "final", "boolean", "strictContextExpression", "(", "boolean", "allowDeclaration", ")", "throws", "RecognitionException", ",", "TokenStreamException", "{", "boolean", "hasDeclaration", "=", "false", ";", "returnAST", "=", "null", ";", "ASTPair", "currentAST", "=", "new", "ASTPair", "(", ")", ";", "AST", "strictContextExpression_AST", "=", "null", ";", "Token", "first", "=", "LT", "(", "1", ")", ";", "{", "boolean", "synPredMatched515", "=", "false", ";", "if", "(", "(", "(", "_tokenSet_16", ".", "member", "(", "LA", "(", "1", ")", ")", ")", "&&", "(", "_tokenSet_79", ".", "member", "(", "LA", "(", "2", ")", ")", ")", ")", ")", "{", "int", "_m515", "=", "mark", "(", ")", ";", "synPredMatched515", "=", "true", ";", "inputState", ".", "guessing", "++", ";", "try", "{", "{", "if", "(", "!", "(", "allowDeclaration", ")", ")", "throw", "new", "SemanticException", "(", "\"\"", ")", ";", "declarationStart", "(", ")", ";", "}", "}", "catch", "(", "RecognitionException", "pe", ")", "{", "synPredMatched515", "=", "false", ";", "}", "rewind", "(", "_m515", ")", ";", "inputState", ".", "guessing", "--", ";", "}", "if", "(", "synPredMatched515", ")", "{", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "hasDeclaration", "=", "true", ";", "}", "singleDeclaration", "(", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "returnAST", ")", ";", "}", "else", "if", "(", "(", "_tokenSet_20", ".", "member", "(", "LA", "(", "1", ")", ")", ")", "&&", "(", "_tokenSet_38", ".", "member", "(", "LA", "(", "2", ")", ")", ")", ")", "{", "expression", "(", "0", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "returnAST", ")", ";", "}", "else", "if", "(", "(", "(", "LA", "(", "1", ")", ">=", "LITERAL_return", "&&", "LA", "(", "1", ")", "<=", "LITERAL_assert", ")", ")", ")", "{", "branchStatement", "(", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "returnAST", ")", ";", "}", "else", "if", "(", "(", "LA", "(", "1", ")", "==", "AT", ")", "&&", "(", "LA", "(", "2", ")", "==", "IDENT", ")", ")", "{", "annotation", "(", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "returnAST", ")", ";", "}", "else", "{", "throw", "new", "NoViableAltException", "(", "LT", "(", "1", ")", ",", "getFilename", "(", ")", ")", ";", "}", "}", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "strictContextExpression_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "strictContextExpression_AST", "=", "(", "AST", ")", "astFactory", ".", "make", "(", "(", "new", "ASTArray", "(", "2", ")", ")", ".", "add", "(", "create", "(", "EXPR", ",", "\"EXPR\"", ",", "first", ",", "LT", "(", "1", ")", ")", ")", ".", "add", "(", "strictContextExpression_AST", ")", ")", ";", "currentAST", ".", "root", "=", "strictContextExpression_AST", ";", "currentAST", ".", "child", "=", "strictContextExpression_AST", "!=", "null", "&&", "strictContextExpression_AST", ".", "getFirstChild", "(", ")", "!=", "null", "?", "strictContextExpression_AST", ".", "getFirstChild", "(", ")", ":", "strictContextExpression_AST", ";", "currentAST", ".", "advanceChildToEnd", "(", ")", ";", "}", "strictContextExpression_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "returnAST", "=", "strictContextExpression_AST", ";", "return", "hasDeclaration", ";", "}", "public", "final", "void", "casesGroup", "(", ")", "throws", "RecognitionException", ",", "TokenStreamException", "{", "returnAST", "=", "null", ";", "ASTPair", "currentAST", "=", "new", "ASTPair", "(", ")", ";", "AST", "casesGroup_AST", "=", "null", ";", "Token", "first", "=", "LT", "(", "1", ")", ";", "{", "int", "_cnt345", "=", "0", ";", "_loop345", ":", "do", "{", "if", "(", "(", "LA", "(", "1", ")", "==", "LITERAL_default", "||", "LA", "(", "1", ")", "==", "LITERAL_case", ")", ")", "{", "aCase", "(", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "returnAST", ")", ";", "}", "else", "{", "if", "(", "_cnt345", ">=", "1", ")", "{", "break", "_loop345", ";", "}", "else", "{", "throw", "new", "NoViableAltException", "(", "LT", "(", "1", ")", ",", "getFilename", "(", ")", ")", ";", "}", "}", "_cnt345", "++", ";", "}", "while", "(", "true", ")", ";", "}", "caseSList", "(", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "returnAST", ")", ";", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "casesGroup_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "casesGroup_AST", "=", "(", "AST", ")", "astFactory", ".", "make", "(", "(", "new", "ASTArray", "(", "2", ")", ")", ".", "add", "(", "create", "(", "CASE_GROUP", ",", "\"CASE_GROUP\"", ",", "first", ",", "LT", "(", "1", ")", ")", ")", ".", "add", "(", "casesGroup_AST", ")", ")", ";", "currentAST", ".", "root", "=", "casesGroup_AST", ";", "currentAST", ".", "child", "=", "casesGroup_AST", "!=", "null", "&&", "casesGroup_AST", ".", "getFirstChild", "(", ")", "!=", "null", "?", "casesGroup_AST", ".", "getFirstChild", "(", ")", ":", "casesGroup_AST", ";", "currentAST", ".", "advanceChildToEnd", "(", ")", ";", "}", "casesGroup_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "returnAST", "=", "casesGroup_AST", ";", "}", "public", "final", "void", "tryBlock", "(", ")", "throws", "RecognitionException", ",", "TokenStreamException", "{", "returnAST", "=", "null", ";", "ASTPair", "currentAST", "=", "new", "ASTPair", "(", ")", ";", "AST", "tryBlock_AST", "=", "null", ";", "AST", "tryCs_AST", "=", "null", ";", "AST", "h_AST", "=", "null", ";", "AST", "fc_AST", "=", "null", ";", "Token", "first", "=", "LT", "(", "1", ")", ";", "List", "catchNodes", "=", "new", "ArrayList", "(", ")", ";", "AST", "newHandler_AST", "=", "null", ";", "match", "(", "LITERAL_try", ")", ";", "nlsWarn", "(", ")", ";", "compoundStatement", "(", ")", ";", "tryCs_AST", "=", "(", "AST", ")", "returnAST", ";", "{", "_loop362", ":", "do", "{", "if", "(", "(", "(", "LA", "(", "1", ")", "==", "LITERAL_catch", "||", "LA", "(", "1", ")", "==", "NLS", ")", "&&", "(", "LA", "(", "2", ")", "==", "LPAREN", "||", "LA", "(", "2", ")", "==", "LITERAL_catch", ")", ")", "&&", "(", "!", "(", "LA", "(", "1", ")", "==", "NLS", "&&", "LA", "(", "2", ")", "==", "LPAREN", ")", ")", ")", "{", "nls", "(", ")", ";", "handler", "(", ")", ";", "h_AST", "=", "(", "AST", ")", "returnAST", ";", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "newHandler_AST", "=", "(", "AST", ")", "astFactory", ".", "make", "(", "(", "new", "ASTArray", "(", "3", ")", ")", ".", "add", "(", "null", ")", ".", "add", "(", "newHandler_AST", ")", ".", "add", "(", "h_AST", ")", ")", ";", "}", "}", "else", "{", "break", "_loop362", ";", "}", "}", "while", "(", "true", ")", ";", "}", "{", "if", "(", "(", "LA", "(", "1", ")", "==", "LITERAL_finally", "||", "LA", "(", "1", ")", "==", "NLS", ")", "&&", "(", "_tokenSet_80", ".", "member", "(", "LA", "(", "2", ")", ")", ")", ")", "{", "nls", "(", ")", ";", "finallyClause", "(", ")", ";", "fc_AST", "=", "(", "AST", ")", "returnAST", ";", "}", "else", "if", "(", "(", "_tokenSet_11", ".", "member", "(", "LA", "(", "1", ")", ")", ")", "&&", "(", "_tokenSet_12", ".", "member", "(", "LA", "(", "2", ")", ")", ")", ")", "{", "}", "else", "{", "throw", "new", "NoViableAltException", "(", "LT", "(", "1", ")", ",", "getFilename", "(", ")", ")", ";", "}", "}", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "tryBlock_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "tryBlock_AST", "=", "(", "AST", ")", "astFactory", ".", "make", "(", "(", "new", "ASTArray", "(", "4", ")", ")", ".", "add", "(", "create", "(", "LITERAL_try", ",", "\"try\"", ",", "first", ",", "LT", "(", "1", ")", ")", ")", ".", "add", "(", "tryCs_AST", ")", ".", "add", "(", "newHandler_AST", ")", ".", "add", "(", "fc_AST", ")", ")", ";", "currentAST", ".", "root", "=", "tryBlock_AST", ";", "currentAST", ".", "child", "=", "tryBlock_AST", "!=", "null", "&&", "tryBlock_AST", ".", "getFirstChild", "(", ")", "!=", "null", "?", "tryBlock_AST", ".", "getFirstChild", "(", ")", ":", "tryBlock_AST", ";", "currentAST", ".", "advanceChildToEnd", "(", ")", ";", "}", "tryBlock_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "returnAST", "=", "tryBlock_AST", ";", "}", "public", "final", "void", "branchStatement", "(", ")", "throws", "RecognitionException", ",", "TokenStreamException", "{", "returnAST", "=", "null", ";", "ASTPair", "currentAST", "=", "new", "ASTPair", "(", ")", ";", "AST", "branchStatement_AST", "=", "null", ";", "AST", "returnE_AST", "=", "null", ";", "Token", "breakI", "=", "null", ";", "AST", "breakI_AST", "=", "null", ";", "Token", "contI", "=", "null", ";", "AST", "contI_AST", "=", "null", ";", "AST", "throwE_AST", "=", "null", ";", "AST", "assertAle_AST", "=", "null", ";", "AST", "assertE_AST", "=", "null", ";", "Token", "first", "=", "LT", "(", "1", ")", ";", "switch", "(", "LA", "(", "1", ")", ")", "{", "case", "LITERAL_return", ":", "{", "match", "(", "LITERAL_return", ")", ";", "{", "switch", "(", "LA", "(", "1", ")", ")", "{", "case", "LBRACK", ":", "case", "IDENT", ":", "case", "STRING_LITERAL", ":", "case", "LPAREN", ":", "case", "LITERAL_super", ":", "case", "LITERAL_void", ":", "case", "LITERAL_boolean", ":", "case", "LITERAL_byte", ":", "case", "LITERAL_char", ":", "case", "LITERAL_short", ":", "case", "LITERAL_int", ":", "case", "LITERAL_float", ":", "case", "LITERAL_long", ":", "case", "LITERAL_double", ":", "case", "LCURLY", ":", "case", "LITERAL_this", ":", "case", "PLUS", ":", "case", "MINUS", ":", "case", "LITERAL_false", ":", "case", "LITERAL_new", ":", "case", "LITERAL_null", ":", "case", "LITERAL_true", ":", "case", "INC", ":", "case", "DEC", ":", "case", "BNOT", ":", "case", "LNOT", ":", "case", "STRING_CTOR_START", ":", "case", "NUM_INT", ":", "case", "NUM_FLOAT", ":", "case", "NUM_LONG", ":", "case", "NUM_DOUBLE", ":", "case", "NUM_BIG_INT", ":", "case", "NUM_BIG_DECIMAL", ":", "{", "expression", "(", "0", ")", ";", "returnE_AST", "=", "(", "AST", ")", "returnAST", ";", "break", ";", "}", "case", "EOF", ":", "case", "RBRACK", ":", "case", "COMMA", ":", "case", "RPAREN", ":", "case", "RCURLY", ":", "case", "SEMI", ":", "case", "LITERAL_default", ":", "case", "LITERAL_else", ":", "case", "LITERAL_case", ":", "case", "NLS", ":", "{", "break", ";", "}", "default", ":", "{", "throw", "new", "NoViableAltException", "(", "LT", "(", "1", ")", ",", "getFilename", "(", ")", ")", ";", "}", "}", "}", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "branchStatement_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "branchStatement_AST", "=", "(", "AST", ")", "astFactory", ".", "make", "(", "(", "new", "ASTArray", "(", "2", ")", ")", ".", "add", "(", "create2", "(", "LITERAL_return", ",", "\"return\"", ",", "first", ",", "LT", "(", "0", ")", ")", ")", ".", "add", "(", "returnE_AST", ")", ")", ";", "currentAST", ".", "root", "=", "branchStatement_AST", ";", "currentAST", ".", "child", "=", "branchStatement_AST", "!=", "null", "&&", "branchStatement_AST", ".", "getFirstChild", "(", ")", "!=", "null", "?", "branchStatement_AST", ".", "getFirstChild", "(", ")", ":", "branchStatement_AST", ";", "currentAST", ".", "advanceChildToEnd", "(", ")", ";", "}", "branchStatement_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "break", ";", "}", "case", "LITERAL_break", ":", "{", "match", "(", "LITERAL_break", ")", ";", "{", "switch", "(", "LA", "(", "1", ")", ")", "{", "case", "IDENT", ":", "{", "breakI", "=", "LT", "(", "1", ")", ";", "breakI_AST", "=", "astFactory", ".", "create", "(", "breakI", ")", ";", "match", "(", "IDENT", ")", ";", "break", ";", "}", "case", "EOF", ":", "case", "RBRACK", ":", "case", "COMMA", ":", "case", "RPAREN", ":", "case", "RCURLY", ":", "case", "SEMI", ":", "case", "LITERAL_default", ":", "case", "LITERAL_else", ":", "case", "LITERAL_case", ":", "case", "NLS", ":", "{", "break", ";", "}", "default", ":", "{", "throw", "new", "NoViableAltException", "(", "LT", "(", "1", ")", ",", "getFilename", "(", ")", ")", ";", "}", "}", "}", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "branchStatement_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "branchStatement_AST", "=", "(", "AST", ")", "astFactory", ".", "make", "(", "(", "new", "ASTArray", "(", "2", ")", ")", ".", "add", "(", "create", "(", "LITERAL_break", ",", "\"break\"", ",", "first", ",", "LT", "(", "1", ")", ")", ")", ".", "add", "(", "breakI_AST", ")", ")", ";", "currentAST", ".", "root", "=", "branchStatement_AST", ";", "currentAST", ".", "child", "=", "branchStatement_AST", "!=", "null", "&&", "branchStatement_AST", ".", "getFirstChild", "(", ")", "!=", "null", "?", "branchStatement_AST", ".", "getFirstChild", "(", ")", ":", "branchStatement_AST", ";", "currentAST", ".", "advanceChildToEnd", "(", ")", ";", "}", "branchStatement_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "break", ";", "}", "case", "LITERAL_continue", ":", "{", "match", "(", "LITERAL_continue", ")", ";", "{", "switch", "(", "LA", "(", "1", ")", ")", "{", "case", "IDENT", ":", "{", "contI", "=", "LT", "(", "1", ")", ";", "contI_AST", "=", "astFactory", ".", "create", "(", "contI", ")", ";", "match", "(", "IDENT", ")", ";", "break", ";", "}", "case", "EOF", ":", "case", "RBRACK", ":", "case", "COMMA", ":", "case", "RPAREN", ":", "case", "RCURLY", ":", "case", "SEMI", ":", "case", "LITERAL_default", ":", "case", "LITERAL_else", ":", "case", "LITERAL_case", ":", "case", "NLS", ":", "{", "break", ";", "}", "default", ":", "{", "throw", "new", "NoViableAltException", "(", "LT", "(", "1", ")", ",", "getFilename", "(", ")", ")", ";", "}", "}", "}", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "branchStatement_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "branchStatement_AST", "=", "(", "AST", ")", "astFactory", ".", "make", "(", "(", "new", "ASTArray", "(", "2", ")", ")", ".", "add", "(", "create", "(", "LITERAL_continue", ",", "\"continue\"", ",", "first", ",", "LT", "(", "1", ")", ")", ")", ".", "add", "(", "contI_AST", ")", ")", ";", "currentAST", ".", "root", "=", "branchStatement_AST", ";", "currentAST", ".", "child", "=", "branchStatement_AST", "!=", "null", "&&", "branchStatement_AST", ".", "getFirstChild", "(", ")", "!=", "null", "?", "branchStatement_AST", ".", "getFirstChild", "(", ")", ":", "branchStatement_AST", ";", "currentAST", ".", "advanceChildToEnd", "(", ")", ";", "}", "branchStatement_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "break", ";", "}", "case", "LITERAL_throw", ":", "{", "match", "(", "LITERAL_throw", ")", ";", "expression", "(", "0", ")", ";", "throwE_AST", "=", "(", "AST", ")", "returnAST", ";", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "branchStatement_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "branchStatement_AST", "=", "(", "AST", ")", "astFactory", ".", "make", "(", "(", "new", "ASTArray", "(", "2", ")", ")", ".", "add", "(", "create", "(", "LITERAL_throw", ",", "\"throw\"", ",", "first", ",", "LT", "(", "1", ")", ")", ")", ".", "add", "(", "throwE_AST", ")", ")", ";", "currentAST", ".", "root", "=", "branchStatement_AST", ";", "currentAST", ".", "child", "=", "branchStatement_AST", "!=", "null", "&&", "branchStatement_AST", ".", "getFirstChild", "(", ")", "!=", "null", "?", "branchStatement_AST", ".", "getFirstChild", "(", ")", ":", "branchStatement_AST", ";", "currentAST", ".", "advanceChildToEnd", "(", ")", ";", "}", "branchStatement_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "break", ";", "}", "case", "LITERAL_assert", ":", "{", "match", "(", "LITERAL_assert", ")", ";", "assignmentLessExpression", "(", ")", ";", "assertAle_AST", "=", "(", "AST", ")", "returnAST", ";", "{", "if", "(", "(", "LA", "(", "1", ")", "==", "COMMA", "||", "LA", "(", "1", ")", "==", "COLON", ")", "&&", "(", "_tokenSet_81", ".", "member", "(", "LA", "(", "2", ")", ")", ")", ")", "{", "{", "switch", "(", "LA", "(", "1", ")", ")", "{", "case", "COMMA", ":", "{", "match", "(", "COMMA", ")", ";", "nls", "(", ")", ";", "break", ";", "}", "case", "COLON", ":", "{", "match", "(", "COLON", ")", ";", "nls", "(", ")", ";", "break", ";", "}", "default", ":", "{", "throw", "new", "NoViableAltException", "(", "LT", "(", "1", ")", ",", "getFilename", "(", ")", ")", ";", "}", "}", "}", "expression", "(", "0", ")", ";", "assertE_AST", "=", "(", "AST", ")", "returnAST", ";", "}", "else", "if", "(", "(", "_tokenSet_82", ".", "member", "(", "LA", "(", "1", ")", ")", ")", "&&", "(", "_tokenSet_12", ".", "member", "(", "LA", "(", "2", ")", ")", ")", ")", "{", "}", "else", "{", "throw", "new", "NoViableAltException", "(", "LT", "(", "1", ")", ",", "getFilename", "(", ")", ")", ";", "}", "}", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "branchStatement_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "branchStatement_AST", "=", "(", "AST", ")", "astFactory", ".", "make", "(", "(", "new", "ASTArray", "(", "3", ")", ")", ".", "add", "(", "create", "(", "LITERAL_assert", ",", "\"assert\"", ",", "first", ",", "LT", "(", "1", ")", ")", ")", ".", "add", "(", "assertAle_AST", ")", ".", "add", "(", "assertE_AST", ")", ")", ";", "currentAST", ".", "root", "=", "branchStatement_AST", ";", "currentAST", ".", "child", "=", "branchStatement_AST", "!=", "null", "&&", "branchStatement_AST", ".", "getFirstChild", "(", ")", "!=", "null", "?", "branchStatement_AST", ".", "getFirstChild", "(", ")", ":", "branchStatement_AST", ";", "currentAST", ".", "advanceChildToEnd", "(", ")", ";", "}", "branchStatement_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "break", ";", "}", "default", ":", "{", "throw", "new", "NoViableAltException", "(", "LT", "(", "1", ")", ",", "getFilename", "(", ")", ")", ";", "}", "}", "returnAST", "=", "branchStatement_AST", ";", "}", "public", "final", "void", "closureList", "(", ")", "throws", "RecognitionException", ",", "TokenStreamException", "{", "returnAST", "=", "null", ";", "ASTPair", "currentAST", "=", "new", "ASTPair", "(", ")", ";", "AST", "closureList_AST", "=", "null", ";", "Token", "first", "=", "LT", "(", "1", ")", ";", "boolean", "sce", "=", "false", ";", "{", "switch", "(", "LA", "(", "1", ")", ")", "{", "case", "FINAL", ":", "case", "ABSTRACT", ":", "case", "STRICTFP", ":", "case", "LITERAL_static", ":", "case", "LITERAL_def", ":", "case", "LBRACK", ":", "case", "IDENT", ":", "case", "STRING_LITERAL", ":", "case", "LPAREN", ":", "case", "AT", ":", "case", "LITERAL_super", ":", "case", "LITERAL_void", ":", "case", "LITERAL_boolean", ":", "case", "LITERAL_byte", ":", "case", "LITERAL_char", ":", "case", "LITERAL_short", ":", "case", "LITERAL_int", ":", "case", "LITERAL_float", ":", "case", "LITERAL_long", ":", "case", "LITERAL_double", ":", "case", "LITERAL_private", ":", "case", "LITERAL_public", ":", "case", "LITERAL_protected", ":", "case", "LITERAL_transient", ":", "case", "LITERAL_native", ":", "case", "LITERAL_threadsafe", ":", "case", "LITERAL_synchronized", ":", "case", "LITERAL_volatile", ":", "case", "LCURLY", ":", "case", "LITERAL_this", ":", "case", "LITERAL_return", ":", "case", "LITERAL_break", ":", "case", "LITERAL_continue", ":", "case", "LITERAL_throw", ":", "case", "LITERAL_assert", ":", "case", "PLUS", ":", "case", "MINUS", ":", "case", "LITERAL_false", ":", "case", "LITERAL_new", ":", "case", "LITERAL_null", ":", "case", "LITERAL_true", ":", "case", "INC", ":", "case", "DEC", ":", "case", "BNOT", ":", "case", "LNOT", ":", "case", "STRING_CTOR_START", ":", "case", "NUM_INT", ":", "case", "NUM_FLOAT", ":", "case", "NUM_LONG", ":", "case", "NUM_DOUBLE", ":", "case", "NUM_BIG_INT", ":", "case", "NUM_BIG_DECIMAL", ":", "{", "sce", "=", "strictContextExpression", "(", "true", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "returnAST", ")", ";", "break", ";", "}", "case", "SEMI", ":", "{", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "astFactory", ".", "create", "(", "EMPTY_STAT", ",", "\"EMPTY_STAT\"", ")", ")", ";", "}", "break", ";", "}", "default", ":", "{", "throw", "new", "NoViableAltException", "(", "LT", "(", "1", ")", ",", "getFilename", "(", ")", ")", ";", "}", "}", "}", "{", "int", "_cnt313", "=", "0", ";", "_loop313", ":", "do", "{", "if", "(", "(", "LA", "(", "1", ")", "==", "SEMI", ")", "&&", "(", "_tokenSet_83", ".", "member", "(", "LA", "(", "2", ")", ")", ")", ")", "{", "match", "(", "SEMI", ")", ";", "sce", "=", "strictContextExpression", "(", "true", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "returnAST", ")", ";", "}", "else", "if", "(", "(", "LA", "(", "1", ")", "==", "SEMI", ")", "&&", "(", "LA", "(", "2", ")", "==", "RPAREN", "||", "LA", "(", "2", ")", "==", "SEMI", ")", ")", "{", "match", "(", "SEMI", ")", ";", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "astFactory", ".", "create", "(", "EMPTY_STAT", ",", "\"EMPTY_STAT\"", ")", ")", ";", "}", "}", "else", "{", "if", "(", "_cnt313", ">=", "1", ")", "{", "break", "_loop313", ";", "}", "else", "{", "throw", "new", "NoViableAltException", "(", "LT", "(", "1", ")", ",", "getFilename", "(", ")", ")", ";", "}", "}", "_cnt313", "++", ";", "}", "while", "(", "true", ")", ";", "}", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "closureList_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "closureList_AST", "=", "(", "AST", ")", "astFactory", ".", "make", "(", "(", "new", "ASTArray", "(", "2", ")", ")", ".", "add", "(", "create", "(", "CLOSURE_LIST", ",", "\"CLOSURE_LIST\"", ",", "first", ",", "LT", "(", "1", ")", ")", ")", ".", "add", "(", "closureList_AST", ")", ")", ";", "currentAST", ".", "root", "=", "closureList_AST", ";", "currentAST", ".", "child", "=", "closureList_AST", "!=", "null", "&&", "closureList_AST", ".", "getFirstChild", "(", ")", "!=", "null", "?", "closureList_AST", ".", "getFirstChild", "(", ")", ":", "closureList_AST", ";", "currentAST", ".", "advanceChildToEnd", "(", ")", ";", "}", "closureList_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "returnAST", "=", "closureList_AST", ";", "}", "public", "final", "void", "forInClause", "(", ")", "throws", "RecognitionException", ",", "TokenStreamException", "{", "returnAST", "=", "null", ";", "ASTPair", "currentAST", "=", "new", "ASTPair", "(", ")", ";", "AST", "forInClause_AST", "=", "null", ";", "AST", "decl_AST", "=", "null", ";", "Token", "i", "=", "null", ";", "AST", "i_AST", "=", "null", ";", "Token", "c", "=", "null", ";", "AST", "c_AST", "=", "null", ";", "{", "boolean", "synPredMatched317", "=", "false", ";", "if", "(", "(", "(", "_tokenSet_16", ".", "member", "(", "LA", "(", "1", ")", ")", ")", "&&", "(", "_tokenSet_79", ".", "member", "(", "LA", "(", "2", ")", ")", ")", ")", ")", "{", "int", "_m317", "=", "mark", "(", ")", ";", "synPredMatched317", "=", "true", ";", "inputState", ".", "guessing", "++", ";", "try", "{", "{", "declarationStart", "(", ")", ";", "}", "}", "catch", "(", "RecognitionException", "pe", ")", "{", "synPredMatched317", "=", "false", ";", "}", "rewind", "(", "_m317", ")", ";", "inputState", ".", "guessing", "--", ";", "}", "if", "(", "synPredMatched317", ")", "{", "singleDeclarationNoInit", "(", ")", ";", "decl_AST", "=", "(", "AST", ")", "returnAST", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "returnAST", ")", ";", "}", "else", "if", "(", "(", "LA", "(", "1", ")", "==", "IDENT", ")", "&&", "(", "LA", "(", "2", ")", "==", "COLON", "||", "LA", "(", "2", ")", "==", "LITERAL_in", ")", ")", "{", "AST", "tmp234_AST", "=", "null", ";", "tmp234_AST", "=", "astFactory", ".", "create", "(", "LT", "(", "1", ")", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "tmp234_AST", ")", ";", "match", "(", "IDENT", ")", ";", "}", "else", "{", "throw", "new", "NoViableAltException", "(", "LT", "(", "1", ")", ",", "getFilename", "(", ")", ")", ";", "}", "}", "{", "switch", "(", "LA", "(", "1", ")", ")", "{", "case", "LITERAL_in", ":", "{", "i", "=", "LT", "(", "1", ")", ";", "i_AST", "=", "astFactory", ".", "create", "(", "i", ")", ";", "astFactory", ".", "makeASTRoot", "(", "currentAST", ",", "i_AST", ")", ";", "match", "(", "LITERAL_in", ")", ";", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "i_AST", ".", "setType", "(", "FOR_IN_ITERABLE", ")", ";", "}", "shiftExpression", "(", "0", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "returnAST", ")", ";", "break", ";", "}", "case", "COLON", ":", "{", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "addWarning", "(", "\"\"", ",", "\"\"", ")", ";", "require", "(", "decl_AST", "!=", "null", ",", "\"\"", ",", "\"\"", ")", ";", "}", "c", "=", "LT", "(", "1", ")", ";", "c_AST", "=", "astFactory", ".", "create", "(", "c", ")", ";", "astFactory", ".", "makeASTRoot", "(", "currentAST", ",", "c_AST", ")", ";", "match", "(", "COLON", ")", ";", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "c_AST", ".", "setType", "(", "FOR_IN_ITERABLE", ")", ";", "}", "expression", "(", "0", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "returnAST", ")", ";", "break", ";", "}", "default", ":", "{", "throw", "new", "NoViableAltException", "(", "LT", "(", "1", ")", ",", "getFilename", "(", ")", ")", ";", "}", "}", "}", "forInClause_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "returnAST", "=", "forInClause_AST", ";", "}", "public", "final", "void", "shiftExpression", "(", "int", "lc_stmt", ")", "throws", "RecognitionException", ",", "TokenStreamException", "{", "returnAST", "=", "null", ";", "ASTPair", "currentAST", "=", "new", "ASTPair", "(", ")", ";", "AST", "shiftExpression_AST", "=", "null", ";", "additiveExpression", "(", "lc_stmt", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "returnAST", ")", ";", "{", "_loop466", ":", "do", "{", "if", "(", "(", "_tokenSet_84", ".", "member", "(", "LA", "(", "1", ")", ")", ")", ")", "{", "{", "switch", "(", "LA", "(", "1", ")", ")", "{", "case", "SR", ":", "case", "BSR", ":", "case", "SL", ":", "{", "{", "switch", "(", "LA", "(", "1", ")", ")", "{", "case", "SL", ":", "{", "AST", "tmp235_AST", "=", "null", ";", "tmp235_AST", "=", "astFactory", ".", "create", "(", "LT", "(", "1", ")", ")", ";", "astFactory", ".", "makeASTRoot", "(", "currentAST", ",", "tmp235_AST", ")", ";", "match", "(", "SL", ")", ";", "break", ";", "}", "case", "SR", ":", "{", "AST", "tmp236_AST", "=", "null", ";", "tmp236_AST", "=", "astFactory", ".", "create", "(", "LT", "(", "1", ")", ")", ";", "astFactory", ".", "makeASTRoot", "(", "currentAST", ",", "tmp236_AST", ")", ";", "match", "(", "SR", ")", ";", "break", ";", "}", "case", "BSR", ":", "{", "AST", "tmp237_AST", "=", "null", ";", "tmp237_AST", "=", "astFactory", ".", "create", "(", "LT", "(", "1", ")", ")", ";", "astFactory", ".", "makeASTRoot", "(", "currentAST", ",", "tmp237_AST", ")", ";", "match", "(", "BSR", ")", ";", "break", ";", "}", "default", ":", "{", "throw", "new", "NoViableAltException", "(", "LT", "(", "1", ")", ",", "getFilename", "(", ")", ")", ";", "}", "}", "}", "break", ";", "}", "case", "RANGE_INCLUSIVE", ":", "{", "AST", "tmp238_AST", "=", "null", ";", "tmp238_AST", "=", "astFactory", ".", "create", "(", "LT", "(", "1", ")", ")", ";", "astFactory", ".", "makeASTRoot", "(", "currentAST", ",", "tmp238_AST", ")", ";", "match", "(", "RANGE_INCLUSIVE", ")", ";", "break", ";", "}", "case", "RANGE_EXCLUSIVE", ":", "{", "AST", "tmp239_AST", "=", "null", ";", "tmp239_AST", "=", "astFactory", ".", "create", "(", "LT", "(", "1", ")", ")", ";", "astFactory", ".", "makeASTRoot", "(", "currentAST", ",", "tmp239_AST", ")", ";", "match", "(", "RANGE_EXCLUSIVE", ")", ";", "break", ";", "}", "default", ":", "{", "throw", "new", "NoViableAltException", "(", "LT", "(", "1", ")", ",", "getFilename", "(", ")", ")", ";", "}", "}", "}", "nls", "(", ")", ";", "additiveExpression", "(", "0", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "returnAST", ")", ";", "}", "else", "{", "break", "_loop466", ";", "}", "}", "while", "(", "true", ")", ";", "}", "shiftExpression_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "returnAST", "=", "shiftExpression_AST", ";", "}", "public", "final", "void", "expression", "(", "int", "lc_stmt", ")", "throws", "RecognitionException", ",", "TokenStreamException", "{", "returnAST", "=", "null", ";", "ASTPair", "currentAST", "=", "new", "ASTPair", "(", ")", ";", "AST", "expression_AST", "=", "null", ";", "Token", "lp", "=", "null", ";", "AST", "lp_AST", "=", "null", ";", "AST", "m_AST", "=", "null", ";", "boolean", "synPredMatched388", "=", "false", ";", "if", "(", "(", "(", "LA", "(", "1", ")", "==", "LPAREN", ")", "&&", "(", "_tokenSet_25", ".", "member", "(", "LA", "(", "2", ")", ")", ")", ")", ")", "{", "int", "_m388", "=", "mark", "(", ")", ";", "synPredMatched388", "=", "true", ";", "inputState", ".", "guessing", "++", ";", "try", "{", "{", "match", "(", "LPAREN", ")", ";", "typeSpec", "(", "true", ")", ";", "match", "(", "RPAREN", ")", ";", "expression", "(", "lc_stmt", ")", ";", "}", "}", "catch", "(", "RecognitionException", "pe", ")", "{", "synPredMatched388", "=", "false", ";", "}", "rewind", "(", "_m388", ")", ";", "inputState", ".", "guessing", "--", ";", "}", "if", "(", "synPredMatched388", ")", "{", "lp", "=", "LT", "(", "1", ")", ";", "lp_AST", "=", "astFactory", ".", "create", "(", "lp", ")", ";", "astFactory", ".", "makeASTRoot", "(", "currentAST", ",", "lp_AST", ")", ";", "match", "(", "LPAREN", ")", ";", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "lp_AST", ".", "setType", "(", "TYPECAST", ")", ";", "}", "typeSpec", "(", "true", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "returnAST", ")", ";", "match", "(", "RPAREN", ")", ";", "expression", "(", "lc_stmt", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "returnAST", ")", ";", "expression_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "}", "else", "{", "boolean", "synPredMatched392", "=", "false", ";", "if", "(", "(", "(", "LA", "(", "1", ")", "==", "LPAREN", ")", "&&", "(", "LA", "(", "2", ")", "==", "IDENT", "||", "LA", "(", "2", ")", "==", "NLS", ")", ")", ")", "{", "int", "_m392", "=", "mark", "(", ")", ";", "synPredMatched392", "=", "true", ";", "inputState", ".", "guessing", "++", ";", "try", "{", "{", "match", "(", "LPAREN", ")", ";", "nls", "(", ")", ";", "match", "(", "IDENT", ")", ";", "{", "_loop391", ":", "do", "{", "if", "(", "(", "LA", "(", "1", ")", "==", "COMMA", ")", ")", "{", "match", "(", "COMMA", ")", ";", "nls", "(", ")", ";", "match", "(", "IDENT", ")", ";", "}", "else", "{", "break", "_loop391", ";", "}", "}", "while", "(", "true", ")", ";", "}", "match", "(", "RPAREN", ")", ";", "match", "(", "ASSIGN", ")", ";", "}", "}", "catch", "(", "RecognitionException", "pe", ")", "{", "synPredMatched392", "=", "false", ";", "}", "rewind", "(", "_m392", ")", ";", "inputState", ".", "guessing", "--", ";", "}", "if", "(", "synPredMatched392", ")", "{", "multipleAssignment", "(", "lc_stmt", ")", ";", "m_AST", "=", "(", "AST", ")", "returnAST", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "returnAST", ")", ";", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "expression_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "expression_AST", "=", "m_AST", ";", "currentAST", ".", "root", "=", "expression_AST", ";", "currentAST", ".", "child", "=", "expression_AST", "!=", "null", "&&", "expression_AST", ".", "getFirstChild", "(", ")", "!=", "null", "?", "expression_AST", ".", "getFirstChild", "(", ")", ":", "expression_AST", ";", "currentAST", ".", "advanceChildToEnd", "(", ")", ";", "}", "expression_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "}", "else", "if", "(", "(", "_tokenSet_20", ".", "member", "(", "LA", "(", "1", ")", ")", ")", "&&", "(", "_tokenSet_38", ".", "member", "(", "LA", "(", "2", ")", ")", ")", ")", "{", "assignmentExpression", "(", "lc_stmt", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "returnAST", ")", ";", "expression_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "}", "else", "{", "throw", "new", "NoViableAltException", "(", "LT", "(", "1", ")", ",", "getFilename", "(", ")", ")", ";", "}", "}", "returnAST", "=", "expression_AST", ";", "}", "public", "final", "void", "suspiciousExpressionStatementStart", "(", ")", "throws", "RecognitionException", ",", "TokenStreamException", "{", "returnAST", "=", "null", ";", "ASTPair", "currentAST", "=", "new", "ASTPair", "(", ")", ";", "AST", "suspiciousExpressionStatementStart_AST", "=", "null", ";", "{", "switch", "(", "LA", "(", "1", ")", ")", "{", "case", "PLUS", ":", "case", "MINUS", ":", "{", "{", "switch", "(", "LA", "(", "1", ")", ")", "{", "case", "PLUS", ":", "{", "AST", "tmp241_AST", "=", "null", ";", "tmp241_AST", "=", "astFactory", ".", "create", "(", "LT", "(", "1", ")", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "tmp241_AST", ")", ";", "match", "(", "PLUS", ")", ";", "break", ";", "}", "case", "MINUS", ":", "{", "AST", "tmp242_AST", "=", "null", ";", "tmp242_AST", "=", "astFactory", ".", "create", "(", "LT", "(", "1", ")", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "tmp242_AST", ")", ";", "match", "(", "MINUS", ")", ";", "break", ";", "}", "default", ":", "{", "throw", "new", "NoViableAltException", "(", "LT", "(", "1", ")", ",", "getFilename", "(", ")", ")", ";", "}", "}", "}", "break", ";", "}", "case", "LBRACK", ":", "case", "LPAREN", ":", "case", "LCURLY", ":", "{", "{", "switch", "(", "LA", "(", "1", ")", ")", "{", "case", "LBRACK", ":", "{", "AST", "tmp243_AST", "=", "null", ";", "tmp243_AST", "=", "astFactory", ".", "create", "(", "LT", "(", "1", ")", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "tmp243_AST", ")", ";", "match", "(", "LBRACK", ")", ";", "break", ";", "}", "case", "LPAREN", ":", "{", "AST", "tmp244_AST", "=", "null", ";", "tmp244_AST", "=", "astFactory", ".", "create", "(", "LT", "(", "1", ")", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "tmp244_AST", ")", ";", "match", "(", "LPAREN", ")", ";", "break", ";", "}", "case", "LCURLY", ":", "{", "AST", "tmp245_AST", "=", "null", ";", "tmp245_AST", "=", "astFactory", ".", "create", "(", "LT", "(", "1", ")", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "tmp245_AST", ")", ";", "match", "(", "LCURLY", ")", ";", "break", ";", "}", "default", ":", "{", "throw", "new", "NoViableAltException", "(", "LT", "(", "1", ")", ",", "getFilename", "(", ")", ")", ";", "}", "}", "}", "break", ";", "}", "default", ":", "{", "throw", "new", "NoViableAltException", "(", "LT", "(", "1", ")", ",", "getFilename", "(", ")", ")", ";", "}", "}", "}", "suspiciousExpressionStatementStart_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "returnAST", "=", "suspiciousExpressionStatementStart_AST", ";", "}", "public", "final", "void", "checkSuspiciousExpressionStatement", "(", "int", "prevToken", ")", "throws", "RecognitionException", ",", "TokenStreamException", "{", "returnAST", "=", "null", ";", "ASTPair", "currentAST", "=", "new", "ASTPair", "(", ")", ";", "AST", "checkSuspiciousExpressionStatement_AST", "=", "null", ";", "boolean", "synPredMatched337", "=", "false", ";", "if", "(", "(", "(", "_tokenSet_20", ".", "member", "(", "LA", "(", "1", ")", ")", ")", "&&", "(", "_tokenSet_2", ".", "member", "(", "LA", "(", "2", ")", ")", ")", ")", ")", "{", "int", "_m337", "=", "mark", "(", ")", ";", "synPredMatched337", "=", "true", ";", "inputState", ".", "guessing", "++", ";", "try", "{", "{", "if", "(", "(", "_tokenSet_85", ".", "member", "(", "LA", "(", "1", ")", ")", ")", ")", "{", "matchNot", "(", "LCURLY", ")", ";", "}", "else", "if", "(", "(", "LA", "(", "1", ")", "==", "LCURLY", ")", ")", "{", "match", "(", "LCURLY", ")", ";", "closableBlockParamsStart", "(", ")", ";", "}", "else", "{", "throw", "new", "NoViableAltException", "(", "LT", "(", "1", ")", ",", "getFilename", "(", ")", ")", ";", "}", "}", "}", "catch", "(", "RecognitionException", "pe", ")", "{", "synPredMatched337", "=", "false", ";", "}", "rewind", "(", "_m337", ")", ";", "inputState", ".", "guessing", "--", ";", "}", "if", "(", "synPredMatched337", ")", "{", "{", "if", "(", "(", "(", "_tokenSet_20", ".", "member", "(", "LA", "(", "1", ")", ")", ")", "&&", "(", "_tokenSet_2", ".", "member", "(", "LA", "(", "2", ")", ")", ")", ")", "&&", "(", "prevToken", "==", "NLS", ")", ")", "{", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "addWarning", "(", "\"\"", ",", "\"\"", ")", ";", "}", "}", "else", "if", "(", "(", "_tokenSet_20", ".", "member", "(", "LA", "(", "1", ")", ")", ")", "&&", "(", "_tokenSet_2", ".", "member", "(", "LA", "(", "2", ")", ")", ")", ")", "{", "}", "else", "{", "throw", "new", "NoViableAltException", "(", "LT", "(", "1", ")", ",", "getFilename", "(", ")", ")", ";", "}", "}", "checkSuspiciousExpressionStatement_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "}", "else", "if", "(", "(", "(", "_tokenSet_20", ".", "member", "(", "LA", "(", "1", ")", ")", ")", "&&", "(", "_tokenSet_2", ".", "member", "(", "LA", "(", "2", ")", ")", ")", ")", "&&", "(", "prevToken", "==", "NLS", ")", ")", "{", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "require", "(", "false", ",", "\"\"", "+", "\"\"", ",", "\"\"", "+", "\"\"", "+", "\"\"", ")", ";", "}", "checkSuspiciousExpressionStatement_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "}", "else", "if", "(", "(", "(", "_tokenSet_20", ".", "member", "(", "LA", "(", "1", ")", ")", ")", "&&", "(", "_tokenSet_2", ".", "member", "(", "LA", "(", "2", ")", ")", ")", ")", "&&", "(", "prevToken", "!=", "NLS", ")", ")", "{", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "require", "(", "false", ",", "\"\"", "+", "\"\"", ",", "\"\"", "+", "\"\"", ")", ";", "}", "checkSuspiciousExpressionStatement_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "}", "else", "{", "throw", "new", "NoViableAltException", "(", "LT", "(", "1", ")", ",", "getFilename", "(", ")", ")", ";", "}", "returnAST", "=", "checkSuspiciousExpressionStatement_AST", ";", "}", "public", "final", "void", "commandArgumentsGreedy", "(", "AST", "head", ")", "throws", "RecognitionException", ",", "TokenStreamException", "{", "returnAST", "=", "null", ";", "ASTPair", "currentAST", "=", "new", "ASTPair", "(", ")", ";", "AST", "commandArgumentsGreedy_AST", "=", "null", ";", "AST", "first_AST", "=", "null", ";", "AST", "pre_AST", "=", "null", ";", "AST", "pc_AST", "=", "null", ";", "AST", "ca_AST", "=", "null", ";", "AST", "prev", "=", "head", ";", "{", "boolean", "synPredMatched372", "=", "false", ";", "if", "(", "(", "(", "_tokenSet_86", ".", "member", "(", "LA", "(", "1", ")", ")", ")", "&&", "(", "_tokenSet_38", ".", "member", "(", "LA", "(", "2", ")", ")", ")", ")", ")", "{", "int", "_m372", "=", "mark", "(", ")", ";", "synPredMatched372", "=", "true", ";", "inputState", ".", "guessing", "++", ";", "try", "{", "{", "if", "(", "!", "(", "prev", "==", "null", "||", "prev", ".", "getType", "(", ")", "!=", "METHOD_CALL", ")", ")", "throw", "new", "SemanticException", "(", "\"\"", ")", ";", "commandArgument", "(", ")", ";", "}", "}", "catch", "(", "RecognitionException", "pe", ")", "{", "synPredMatched372", "=", "false", ";", "}", "rewind", "(", "_m372", ")", ";", "inputState", ".", "guessing", "--", ";", "}", "if", "(", "synPredMatched372", ")", "{", "{", "commandArguments", "(", "head", ")", ";", "first_AST", "=", "(", "AST", ")", "returnAST", ";", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "prev", "=", "first_AST", ";", "}", "}", "}", "else", "if", "(", "(", "_tokenSet_70", ".", "member", "(", "LA", "(", "1", ")", ")", ")", "&&", "(", "_tokenSet_71", ".", "member", "(", "LA", "(", "2", ")", ")", ")", ")", "{", "}", "else", "{", "throw", "new", "NoViableAltException", "(", "LT", "(", "1", ")", ",", "getFilename", "(", ")", ")", ";", "}", "}", "{", "{", "_loop381", ":", "do", "{", "if", "(", "(", "_tokenSet_87", ".", "member", "(", "LA", "(", "1", ")", ")", ")", "&&", "(", "_tokenSet_88", ".", "member", "(", "LA", "(", "2", ")", ")", ")", ")", "{", "primaryExpression", "(", ")", ";", "pre_AST", "=", "(", "AST", ")", "returnAST", ";", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "prev", "=", "(", "AST", ")", "astFactory", ".", "make", "(", "(", "new", "ASTArray", "(", "3", ")", ")", ".", "add", "(", "create", "(", "DOT", ",", "\".\"", ",", "prev", ")", ")", ".", "add", "(", "prev", ")", ".", "add", "(", "pre_AST", ")", ")", ";", "}", "{", "boolean", "synPredMatched378", "=", "false", ";", "if", "(", "(", "(", "_tokenSet_89", ".", "member", "(", "LA", "(", "1", ")", ")", ")", "&&", "(", "_tokenSet_90", ".", "member", "(", "LA", "(", "2", ")", ")", ")", ")", ")", "{", "int", "_m378", "=", "mark", "(", ")", ";", "synPredMatched378", "=", "true", ";", "inputState", ".", "guessing", "++", ";", "try", "{", "{", "pathElementStart", "(", ")", ";", "}", "}", "catch", "(", "RecognitionException", "pe", ")", "{", "synPredMatched378", "=", "false", ";", "}", "rewind", "(", "_m378", ")", ";", "inputState", ".", "guessing", "--", ";", "}", "if", "(", "synPredMatched378", ")", "{", "{", "pathChain", "(", "LC_STMT", ",", "prev", ")", ";", "pc_AST", "=", "(", "AST", ")", "returnAST", ";", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "prev", "=", "pc_AST", ";", "}", "}", "}", "else", "if", "(", "(", "_tokenSet_86", ".", "member", "(", "LA", "(", "1", ")", ")", ")", "&&", "(", "_tokenSet_38", ".", "member", "(", "LA", "(", "2", ")", ")", ")", ")", "{", "{", "commandArguments", "(", "prev", ")", ";", "ca_AST", "=", "(", "AST", ")", "returnAST", ";", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "prev", "=", "ca_AST", ";", "}", "}", "}", "else", "if", "(", "(", "_tokenSet_70", ".", "member", "(", "LA", "(", "1", ")", ")", ")", "&&", "(", "_tokenSet_71", ".", "member", "(", "LA", "(", "2", ")", ")", ")", ")", "{", "}", "else", "{", "throw", "new", "NoViableAltException", "(", "LT", "(", "1", ")", ",", "getFilename", "(", ")", ")", ";", "}", "}", "}", "else", "{", "break", "_loop381", ";", "}", "}", "while", "(", "true", ")", ";", "}", "}", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "commandArgumentsGreedy_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "commandArgumentsGreedy_AST", "=", "prev", ";", "currentAST", ".", "root", "=", "commandArgumentsGreedy_AST", ";", "currentAST", ".", "child", "=", "commandArgumentsGreedy_AST", "!=", "null", "&&", "commandArgumentsGreedy_AST", ".", "getFirstChild", "(", ")", "!=", "null", "?", "commandArgumentsGreedy_AST", ".", "getFirstChild", "(", ")", ":", "commandArgumentsGreedy_AST", ";", "currentAST", ".", "advanceChildToEnd", "(", ")", ";", "}", "commandArgumentsGreedy_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "returnAST", "=", "commandArgumentsGreedy_AST", ";", "}", "public", "final", "void", "aCase", "(", ")", "throws", "RecognitionException", ",", "TokenStreamException", "{", "returnAST", "=", "null", ";", "ASTPair", "currentAST", "=", "new", "ASTPair", "(", ")", ";", "AST", "aCase_AST", "=", "null", ";", "{", "switch", "(", "LA", "(", "1", ")", ")", "{", "case", "LITERAL_case", ":", "{", "AST", "tmp246_AST", "=", "null", ";", "tmp246_AST", "=", "astFactory", ".", "create", "(", "LT", "(", "1", ")", ")", ";", "astFactory", ".", "makeASTRoot", "(", "currentAST", ",", "tmp246_AST", ")", ";", "match", "(", "LITERAL_case", ")", ";", "expression", "(", "0", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "returnAST", ")", ";", "break", ";", "}", "case", "LITERAL_default", ":", "{", "AST", "tmp247_AST", "=", "null", ";", "tmp247_AST", "=", "astFactory", ".", "create", "(", "LT", "(", "1", ")", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "tmp247_AST", ")", ";", "match", "(", "LITERAL_default", ")", ";", "break", ";", "}", "default", ":", "{", "throw", "new", "NoViableAltException", "(", "LT", "(", "1", ")", ",", "getFilename", "(", ")", ")", ";", "}", "}", "}", "match", "(", "COLON", ")", ";", "nls", "(", ")", ";", "aCase_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "returnAST", "=", "aCase_AST", ";", "}", "public", "final", "void", "caseSList", "(", ")", "throws", "RecognitionException", ",", "TokenStreamException", "{", "returnAST", "=", "null", ";", "ASTPair", "currentAST", "=", "new", "ASTPair", "(", ")", ";", "AST", "caseSList_AST", "=", "null", ";", "Token", "first", "=", "LT", "(", "1", ")", ";", "statement", "(", "COLON", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "returnAST", ")", ";", "{", "_loop351", ":", "do", "{", "if", "(", "(", "LA", "(", "1", ")", "==", "SEMI", "||", "LA", "(", "1", ")", "==", "NLS", ")", ")", "{", "sep", "(", ")", ";", "{", "switch", "(", "LA", "(", "1", ")", ")", "{", "case", "FINAL", ":", "case", "ABSTRACT", ":", "case", "STRICTFP", ":", "case", "LITERAL_import", ":", "case", "LITERAL_static", ":", "case", "LITERAL_def", ":", "case", "LBRACK", ":", "case", "IDENT", ":", "case", "STRING_LITERAL", ":", "case", "LPAREN", ":", "case", "LITERAL_class", ":", "case", "LITERAL_interface", ":", "case", "LITERAL_enum", ":", "case", "AT", ":", "case", "LITERAL_super", ":", "case", "LITERAL_void", ":", "case", "LITERAL_boolean", ":", "case", "LITERAL_byte", ":", "case", "LITERAL_char", ":", "case", "LITERAL_short", ":", "case", "LITERAL_int", ":", "case", "LITERAL_float", ":", "case", "LITERAL_long", ":", "case", "LITERAL_double", ":", "case", "LITERAL_private", ":", "case", "LITERAL_public", ":", "case", "LITERAL_protected", ":", "case", "LITERAL_transient", ":", "case", "LITERAL_native", ":", "case", "LITERAL_threadsafe", ":", "case", "LITERAL_synchronized", ":", "case", "LITERAL_volatile", ":", "case", "LCURLY", ":", "case", "LITERAL_this", ":", "case", "LITERAL_if", ":", "case", "LITERAL_while", ":", "case", "LITERAL_switch", ":", "case", "LITERAL_for", ":", "case", "LITERAL_return", ":", "case", "LITERAL_break", ":", "case", "LITERAL_continue", ":", "case", "LITERAL_throw", ":", "case", "LITERAL_assert", ":", "case", "PLUS", ":", "case", "MINUS", ":", "case", "LITERAL_try", ":", "case", "LITERAL_false", ":", "case", "LITERAL_new", ":", "case", "LITERAL_null", ":", "case", "LITERAL_true", ":", "case", "INC", ":", "case", "DEC", ":", "case", "BNOT", ":", "case", "LNOT", ":", "case", "STRING_CTOR_START", ":", "case", "NUM_INT", ":", "case", "NUM_FLOAT", ":", "case", "NUM_LONG", ":", "case", "NUM_DOUBLE", ":", "case", "NUM_BIG_INT", ":", "case", "NUM_BIG_DECIMAL", ":", "{", "statement", "(", "sepToken", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "returnAST", ")", ";", "break", ";", "}", "case", "RCURLY", ":", "case", "SEMI", ":", "case", "LITERAL_default", ":", "case", "LITERAL_case", ":", "case", "NLS", ":", "{", "break", ";", "}", "default", ":", "{", "throw", "new", "NoViableAltException", "(", "LT", "(", "1", ")", ",", "getFilename", "(", ")", ")", ";", "}", "}", "}", "}", "else", "{", "break", "_loop351", ";", "}", "}", "while", "(", "true", ")", ";", "}", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "caseSList_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "caseSList_AST", "=", "(", "AST", ")", "astFactory", ".", "make", "(", "(", "new", "ASTArray", "(", "2", ")", ")", ".", "add", "(", "create", "(", "SLIST", ",", "\"SLIST\"", ",", "first", ",", "LT", "(", "1", ")", ")", ")", ".", "add", "(", "caseSList_AST", ")", ")", ";", "currentAST", ".", "root", "=", "caseSList_AST", ";", "currentAST", ".", "child", "=", "caseSList_AST", "!=", "null", "&&", "caseSList_AST", ".", "getFirstChild", "(", ")", "!=", "null", "?", "caseSList_AST", ".", "getFirstChild", "(", ")", ":", "caseSList_AST", ";", "currentAST", ".", "advanceChildToEnd", "(", ")", ";", "}", "caseSList_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "returnAST", "=", "caseSList_AST", ";", "}", "public", "final", "void", "forInit", "(", ")", "throws", "RecognitionException", ",", "TokenStreamException", "{", "returnAST", "=", "null", ";", "ASTPair", "currentAST", "=", "new", "ASTPair", "(", ")", ";", "AST", "forInit_AST", "=", "null", ";", "Token", "first", "=", "LT", "(", "1", ")", ";", "boolean", "synPredMatched354", "=", "false", ";", "if", "(", "(", "(", "_tokenSet_16", ".", "member", "(", "LA", "(", "1", ")", ")", ")", "&&", "(", "_tokenSet_17", ".", "member", "(", "LA", "(", "2", ")", ")", ")", ")", ")", "{", "int", "_m354", "=", "mark", "(", ")", ";", "synPredMatched354", "=", "true", ";", "inputState", ".", "guessing", "++", ";", "try", "{", "{", "declarationStart", "(", ")", ";", "}", "}", "catch", "(", "RecognitionException", "pe", ")", "{", "synPredMatched354", "=", "false", ";", "}", "rewind", "(", "_m354", ")", ";", "inputState", ".", "guessing", "--", ";", "}", "if", "(", "synPredMatched354", ")", "{", "declaration", "(", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "returnAST", ")", ";", "forInit_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "}", "else", "if", "(", "(", "_tokenSet_91", ".", "member", "(", "LA", "(", "1", ")", ")", ")", "&&", "(", "_tokenSet_92", ".", "member", "(", "LA", "(", "2", ")", ")", ")", ")", "{", "{", "switch", "(", "LA", "(", "1", ")", ")", "{", "case", "FINAL", ":", "case", "ABSTRACT", ":", "case", "STRICTFP", ":", "case", "LITERAL_static", ":", "case", "LITERAL_def", ":", "case", "LBRACK", ":", "case", "IDENT", ":", "case", "STRING_LITERAL", ":", "case", "LPAREN", ":", "case", "AT", ":", "case", "LITERAL_super", ":", "case", "LITERAL_void", ":", "case", "LITERAL_boolean", ":", "case", "LITERAL_byte", ":", "case", "LITERAL_char", ":", "case", "LITERAL_short", ":", "case", "LITERAL_int", ":", "case", "LITERAL_float", ":", "case", "LITERAL_long", ":", "case", "LITERAL_double", ":", "case", "LITERAL_private", ":", "case", "LITERAL_public", ":", "case", "LITERAL_protected", ":", "case", "LITERAL_transient", ":", "case", "LITERAL_native", ":", "case", "LITERAL_threadsafe", ":", "case", "LITERAL_synchronized", ":", "case", "LITERAL_volatile", ":", "case", "LCURLY", ":", "case", "LITERAL_this", ":", "case", "LITERAL_return", ":", "case", "LITERAL_break", ":", "case", "LITERAL_continue", ":", "case", "LITERAL_throw", ":", "case", "LITERAL_assert", ":", "case", "PLUS", ":", "case", "MINUS", ":", "case", "LITERAL_false", ":", "case", "LITERAL_new", ":", "case", "LITERAL_null", ":", "case", "LITERAL_true", ":", "case", "INC", ":", "case", "DEC", ":", "case", "BNOT", ":", "case", "LNOT", ":", "case", "STRING_CTOR_START", ":", "case", "NUM_INT", ":", "case", "NUM_FLOAT", ":", "case", "NUM_LONG", ":", "case", "NUM_DOUBLE", ":", "case", "NUM_BIG_INT", ":", "case", "NUM_BIG_DECIMAL", ":", "{", "controlExpressionList", "(", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "returnAST", ")", ";", "break", ";", "}", "case", "EOF", ":", "{", "break", ";", "}", "default", ":", "{", "throw", "new", "NoViableAltException", "(", "LT", "(", "1", ")", ",", "getFilename", "(", ")", ")", ";", "}", "}", "}", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "forInit_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "forInit_AST", "=", "(", "AST", ")", "astFactory", ".", "make", "(", "(", "new", "ASTArray", "(", "2", ")", ")", ".", "add", "(", "create", "(", "FOR_INIT", ",", "\"FOR_INIT\"", ",", "first", ",", "LT", "(", "1", ")", ")", ")", ".", "add", "(", "forInit_AST", ")", ")", ";", "currentAST", ".", "root", "=", "forInit_AST", ";", "currentAST", ".", "child", "=", "forInit_AST", "!=", "null", "&&", "forInit_AST", ".", "getFirstChild", "(", ")", "!=", "null", "?", "forInit_AST", ".", "getFirstChild", "(", ")", ":", "forInit_AST", ";", "currentAST", ".", "advanceChildToEnd", "(", ")", ";", "}", "forInit_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "}", "else", "{", "throw", "new", "NoViableAltException", "(", "LT", "(", "1", ")", ",", "getFilename", "(", ")", ")", ";", "}", "returnAST", "=", "forInit_AST", ";", "}", "public", "final", "void", "controlExpressionList", "(", ")", "throws", "RecognitionException", ",", "TokenStreamException", "{", "returnAST", "=", "null", ";", "ASTPair", "currentAST", "=", "new", "ASTPair", "(", ")", ";", "AST", "controlExpressionList_AST", "=", "null", ";", "Token", "first", "=", "LT", "(", "1", ")", ";", "boolean", "sce", "=", "false", ";", "sce", "=", "strictContextExpression", "(", "false", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "returnAST", ")", ";", "{", "_loop396", ":", "do", "{", "if", "(", "(", "LA", "(", "1", ")", "==", "COMMA", ")", ")", "{", "match", "(", "COMMA", ")", ";", "nls", "(", ")", ";", "sce", "=", "strictContextExpression", "(", "false", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "returnAST", ")", ";", "}", "else", "{", "break", "_loop396", ";", "}", "}", "while", "(", "true", ")", ";", "}", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "controlExpressionList_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "controlExpressionList_AST", "=", "(", "AST", ")", "astFactory", ".", "make", "(", "(", "new", "ASTArray", "(", "2", ")", ")", ".", "add", "(", "create", "(", "ELIST", ",", "\"ELIST\"", ",", "first", ",", "LT", "(", "1", ")", ")", ")", ".", "add", "(", "controlExpressionList_AST", ")", ")", ";", "currentAST", ".", "root", "=", "controlExpressionList_AST", ";", "currentAST", ".", "child", "=", "controlExpressionList_AST", "!=", "null", "&&", "controlExpressionList_AST", ".", "getFirstChild", "(", ")", "!=", "null", "?", "controlExpressionList_AST", ".", "getFirstChild", "(", ")", ":", "controlExpressionList_AST", ";", "currentAST", ".", "advanceChildToEnd", "(", ")", ";", "}", "controlExpressionList_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "returnAST", "=", "controlExpressionList_AST", ";", "}", "public", "final", "void", "forCond", "(", ")", "throws", "RecognitionException", ",", "TokenStreamException", "{", "returnAST", "=", "null", ";", "ASTPair", "currentAST", "=", "new", "ASTPair", "(", ")", ";", "AST", "forCond_AST", "=", "null", ";", "Token", "first", "=", "LT", "(", "1", ")", ";", "boolean", "sce", "=", "false", ";", "{", "switch", "(", "LA", "(", "1", ")", ")", "{", "case", "FINAL", ":", "case", "ABSTRACT", ":", "case", "STRICTFP", ":", "case", "LITERAL_static", ":", "case", "LITERAL_def", ":", "case", "LBRACK", ":", "case", "IDENT", ":", "case", "STRING_LITERAL", ":", "case", "LPAREN", ":", "case", "AT", ":", "case", "LITERAL_super", ":", "case", "LITERAL_void", ":", "case", "LITERAL_boolean", ":", "case", "LITERAL_byte", ":", "case", "LITERAL_char", ":", "case", "LITERAL_short", ":", "case", "LITERAL_int", ":", "case", "LITERAL_float", ":", "case", "LITERAL_long", ":", "case", "LITERAL_double", ":", "case", "LITERAL_private", ":", "case", "LITERAL_public", ":", "case", "LITERAL_protected", ":", "case", "LITERAL_transient", ":", "case", "LITERAL_native", ":", "case", "LITERAL_threadsafe", ":", "case", "LITERAL_synchronized", ":", "case", "LITERAL_volatile", ":", "case", "LCURLY", ":", "case", "LITERAL_this", ":", "case", "LITERAL_return", ":", "case", "LITERAL_break", ":", "case", "LITERAL_continue", ":", "case", "LITERAL_throw", ":", "case", "LITERAL_assert", ":", "case", "PLUS", ":", "case", "MINUS", ":", "case", "LITERAL_false", ":", "case", "LITERAL_new", ":", "case", "LITERAL_null", ":", "case", "LITERAL_true", ":", "case", "INC", ":", "case", "DEC", ":", "case", "BNOT", ":", "case", "LNOT", ":", "case", "STRING_CTOR_START", ":", "case", "NUM_INT", ":", "case", "NUM_FLOAT", ":", "case", "NUM_LONG", ":", "case", "NUM_DOUBLE", ":", "case", "NUM_BIG_INT", ":", "case", "NUM_BIG_DECIMAL", ":", "{", "sce", "=", "strictContextExpression", "(", "false", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "returnAST", ")", ";", "break", ";", "}", "case", "EOF", ":", "{", "break", ";", "}", "default", ":", "{", "throw", "new", "NoViableAltException", "(", "LT", "(", "1", ")", ",", "getFilename", "(", ")", ")", ";", "}", "}", "}", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "forCond_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "forCond_AST", "=", "(", "AST", ")", "astFactory", ".", "make", "(", "(", "new", "ASTArray", "(", "2", ")", ")", ".", "add", "(", "create", "(", "FOR_CONDITION", ",", "\"\"", ",", "first", ",", "LT", "(", "1", ")", ")", ")", ".", "add", "(", "forCond_AST", ")", ")", ";", "currentAST", ".", "root", "=", "forCond_AST", ";", "currentAST", ".", "child", "=", "forCond_AST", "!=", "null", "&&", "forCond_AST", ".", "getFirstChild", "(", ")", "!=", "null", "?", "forCond_AST", ".", "getFirstChild", "(", ")", ":", "forCond_AST", ";", "currentAST", ".", "advanceChildToEnd", "(", ")", ";", "}", "forCond_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "returnAST", "=", "forCond_AST", ";", "}", "public", "final", "void", "forIter", "(", ")", "throws", "RecognitionException", ",", "TokenStreamException", "{", "returnAST", "=", "null", ";", "ASTPair", "currentAST", "=", "new", "ASTPair", "(", ")", ";", "AST", "forIter_AST", "=", "null", ";", "Token", "first", "=", "LT", "(", "1", ")", ";", "{", "switch", "(", "LA", "(", "1", ")", ")", "{", "case", "FINAL", ":", "case", "ABSTRACT", ":", "case", "STRICTFP", ":", "case", "LITERAL_static", ":", "case", "LITERAL_def", ":", "case", "LBRACK", ":", "case", "IDENT", ":", "case", "STRING_LITERAL", ":", "case", "LPAREN", ":", "case", "AT", ":", "case", "LITERAL_super", ":", "case", "LITERAL_void", ":", "case", "LITERAL_boolean", ":", "case", "LITERAL_byte", ":", "case", "LITERAL_char", ":", "case", "LITERAL_short", ":", "case", "LITERAL_int", ":", "case", "LITERAL_float", ":", "case", "LITERAL_long", ":", "case", "LITERAL_double", ":", "case", "LITERAL_private", ":", "case", "LITERAL_public", ":", "case", "LITERAL_protected", ":", "case", "LITERAL_transient", ":", "case", "LITERAL_native", ":", "case", "LITERAL_threadsafe", ":", "case", "LITERAL_synchronized", ":", "case", "LITERAL_volatile", ":", "case", "LCURLY", ":", "case", "LITERAL_this", ":", "case", "LITERAL_return", ":", "case", "LITERAL_break", ":", "case", "LITERAL_continue", ":", "case", "LITERAL_throw", ":", "case", "LITERAL_assert", ":", "case", "PLUS", ":", "case", "MINUS", ":", "case", "LITERAL_false", ":", "case", "LITERAL_new", ":", "case", "LITERAL_null", ":", "case", "LITERAL_true", ":", "case", "INC", ":", "case", "DEC", ":", "case", "BNOT", ":", "case", "LNOT", ":", "case", "STRING_CTOR_START", ":", "case", "NUM_INT", ":", "case", "NUM_FLOAT", ":", "case", "NUM_LONG", ":", "case", "NUM_DOUBLE", ":", "case", "NUM_BIG_INT", ":", "case", "NUM_BIG_DECIMAL", ":", "{", "controlExpressionList", "(", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "returnAST", ")", ";", "break", ";", "}", "case", "EOF", ":", "{", "break", ";", "}", "default", ":", "{", "throw", "new", "NoViableAltException", "(", "LT", "(", "1", ")", ",", "getFilename", "(", ")", ")", ";", "}", "}", "}", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "forIter_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "forIter_AST", "=", "(", "AST", ")", "astFactory", ".", "make", "(", "(", "new", "ASTArray", "(", "2", ")", ")", ".", "add", "(", "create", "(", "FOR_ITERATOR", ",", "\"FOR_ITERATOR\"", ",", "first", ",", "LT", "(", "1", ")", ")", ")", ".", "add", "(", "forIter_AST", ")", ")", ";", "currentAST", ".", "root", "=", "forIter_AST", ";", "currentAST", ".", "child", "=", "forIter_AST", "!=", "null", "&&", "forIter_AST", ".", "getFirstChild", "(", ")", "!=", "null", "?", "forIter_AST", ".", "getFirstChild", "(", ")", ":", "forIter_AST", ";", "currentAST", ".", "advanceChildToEnd", "(", ")", ";", "}", "forIter_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "returnAST", "=", "forIter_AST", ";", "}", "public", "final", "void", "handler", "(", ")", "throws", "RecognitionException", ",", "TokenStreamException", "{", "returnAST", "=", "null", ";", "ASTPair", "currentAST", "=", "new", "ASTPair", "(", ")", ";", "AST", "handler_AST", "=", "null", ";", "AST", "pd_AST", "=", "null", ";", "AST", "handlerCs_AST", "=", "null", ";", "Token", "first", "=", "LT", "(", "1", ")", ";", "match", "(", "LITERAL_catch", ")", ";", "match", "(", "LPAREN", ")", ";", "parameterDeclaration", "(", ")", ";", "pd_AST", "=", "(", "AST", ")", "returnAST", ";", "match", "(", "RPAREN", ")", ";", "nlsWarn", "(", ")", ";", "compoundStatement", "(", ")", ";", "handlerCs_AST", "=", "(", "AST", ")", "returnAST", ";", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "handler_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "handler_AST", "=", "(", "AST", ")", "astFactory", ".", "make", "(", "(", "new", "ASTArray", "(", "3", ")", ")", ".", "add", "(", "create", "(", "LITERAL_catch", ",", "\"catch\"", ",", "first", ",", "LT", "(", "1", ")", ")", ")", ".", "add", "(", "pd_AST", ")", ".", "add", "(", "handlerCs_AST", ")", ")", ";", "currentAST", ".", "root", "=", "handler_AST", ";", "currentAST", ".", "child", "=", "handler_AST", "!=", "null", "&&", "handler_AST", ".", "getFirstChild", "(", ")", "!=", "null", "?", "handler_AST", ".", "getFirstChild", "(", ")", ":", "handler_AST", ";", "currentAST", ".", "advanceChildToEnd", "(", ")", ";", "}", "handler_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "returnAST", "=", "handler_AST", ";", "}", "public", "final", "void", "finallyClause", "(", ")", "throws", "RecognitionException", ",", "TokenStreamException", "{", "returnAST", "=", "null", ";", "ASTPair", "currentAST", "=", "new", "ASTPair", "(", ")", ";", "AST", "finallyClause_AST", "=", "null", ";", "AST", "finallyCs_AST", "=", "null", ";", "Token", "first", "=", "LT", "(", "1", ")", ";", "match", "(", "LITERAL_finally", ")", ";", "nlsWarn", "(", ")", ";", "compoundStatement", "(", ")", ";", "finallyCs_AST", "=", "(", "AST", ")", "returnAST", ";", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "finallyClause_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "finallyClause_AST", "=", "(", "AST", ")", "astFactory", ".", "make", "(", "(", "new", "ASTArray", "(", "2", ")", ")", ".", "add", "(", "create", "(", "LITERAL_finally", ",", "\"finally\"", ",", "first", ",", "LT", "(", "1", ")", ")", ")", ".", "add", "(", "finallyCs_AST", ")", ")", ";", "currentAST", ".", "root", "=", "finallyClause_AST", ";", "currentAST", ".", "child", "=", "finallyClause_AST", "!=", "null", "&&", "finallyClause_AST", ".", "getFirstChild", "(", ")", "!=", "null", "?", "finallyClause_AST", ".", "getFirstChild", "(", ")", ":", "finallyClause_AST", ";", "currentAST", ".", "advanceChildToEnd", "(", ")", ";", "}", "finallyClause_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "returnAST", "=", "finallyClause_AST", ";", "}", "public", "final", "void", "commandArguments", "(", "AST", "head", ")", "throws", "RecognitionException", ",", "TokenStreamException", "{", "returnAST", "=", "null", ";", "ASTPair", "currentAST", "=", "new", "ASTPair", "(", ")", ";", "AST", "commandArguments_AST", "=", "null", ";", "Token", "first", "=", "LT", "(", "1", ")", ";", "try", "{", "commandArgument", "(", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "returnAST", ")", ";", "{", "_loop368", ":", "do", "{", "if", "(", "(", "LA", "(", "1", ")", "==", "COMMA", ")", "&&", "(", "_tokenSet_93", ".", "member", "(", "LA", "(", "2", ")", ")", ")", ")", "{", "match", "(", "COMMA", ")", ";", "nls", "(", ")", ";", "commandArgument", "(", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "returnAST", ")", ";", "}", "else", "{", "break", "_loop368", ";", "}", "}", "while", "(", "true", ")", ";", "}", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "commandArguments_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "AST", "elist", "=", "(", "AST", ")", "astFactory", ".", "make", "(", "(", "new", "ASTArray", "(", "2", ")", ")", ".", "add", "(", "create", "(", "ELIST", ",", "\"ELIST\"", ",", "first", ",", "LT", "(", "1", ")", ")", ")", ".", "add", "(", "commandArguments_AST", ")", ")", ";", "AST", "headid", "=", "(", "AST", ")", "astFactory", ".", "make", "(", "(", "new", "ASTArray", "(", "3", ")", ")", ".", "add", "(", "create", "(", "METHOD_CALL", ",", "\"<command>\"", ",", "first", ",", "LT", "(", "1", ")", ")", ")", ".", "add", "(", "head", ")", ".", "add", "(", "elist", ")", ")", ";", "commandArguments_AST", "=", "headid", ";", "currentAST", ".", "root", "=", "commandArguments_AST", ";", "currentAST", ".", "child", "=", "commandArguments_AST", "!=", "null", "&&", "commandArguments_AST", ".", "getFirstChild", "(", ")", "!=", "null", "?", "commandArguments_AST", ".", "getFirstChild", "(", ")", ":", "commandArguments_AST", ";", "currentAST", ".", "advanceChildToEnd", "(", ")", ";", "}", "commandArguments_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "}", "catch", "(", "RecognitionException", "e", ")", "{", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "reportError", "(", "e", ")", ";", "}", "else", "{", "throw", "e", ";", "}", "}", "returnAST", "=", "commandArguments_AST", ";", "}", "public", "final", "void", "commandArgument", "(", ")", "throws", "RecognitionException", ",", "TokenStreamException", "{", "returnAST", "=", "null", ";", "ASTPair", "currentAST", "=", "new", "ASTPair", "(", ")", ";", "AST", "commandArgument_AST", "=", "null", ";", "Token", "c", "=", "null", ";", "AST", "c_AST", "=", "null", ";", "boolean", "synPredMatched384", "=", "false", ";", "if", "(", "(", "(", "_tokenSet_94", ".", "member", "(", "LA", "(", "1", ")", ")", ")", "&&", "(", "_tokenSet_95", ".", "member", "(", "LA", "(", "2", ")", ")", ")", ")", ")", "{", "int", "_m384", "=", "mark", "(", ")", ";", "synPredMatched384", "=", "true", ";", "inputState", ".", "guessing", "++", ";", "try", "{", "{", "argumentLabel", "(", ")", ";", "match", "(", "COLON", ")", ";", "nls", "(", ")", ";", "}", "}", "catch", "(", "RecognitionException", "pe", ")", "{", "synPredMatched384", "=", "false", ";", "}", "rewind", "(", "_m384", ")", ";", "inputState", ".", "guessing", "--", ";", "}", "if", "(", "synPredMatched384", ")", "{", "{", "argumentLabel", "(", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "returnAST", ")", ";", "c", "=", "LT", "(", "1", ")", ";", "c_AST", "=", "astFactory", ".", "create", "(", "c", ")", ";", "astFactory", ".", "makeASTRoot", "(", "currentAST", ",", "c_AST", ")", ";", "match", "(", "COLON", ")", ";", "nls", "(", ")", ";", "expression", "(", "0", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "returnAST", ")", ";", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "c_AST", ".", "setType", "(", "LABELED_ARG", ")", ";", "}", "}", "commandArgument_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "}", "else", "if", "(", "(", "_tokenSet_20", ".", "member", "(", "LA", "(", "1", ")", ")", ")", "&&", "(", "_tokenSet_38", ".", "member", "(", "LA", "(", "2", ")", ")", ")", ")", "{", "expression", "(", "0", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "returnAST", ")", ";", "commandArgument_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "}", "else", "{", "throw", "new", "NoViableAltException", "(", "LT", "(", "1", ")", ",", "getFilename", "(", ")", ")", ";", "}", "returnAST", "=", "commandArgument_AST", ";", "}", "public", "final", "void", "primaryExpression", "(", ")", "throws", "RecognitionException", ",", "TokenStreamException", "{", "returnAST", "=", "null", ";", "ASTPair", "currentAST", "=", "new", "ASTPair", "(", ")", ";", "AST", "primaryExpression_AST", "=", "null", ";", "AST", "pe_AST", "=", "null", ";", "Token", "first", "=", "LT", "(", "1", ")", ";", "switch", "(", "LA", "(", "1", ")", ")", "{", "case", "IDENT", ":", "{", "AST", "tmp255_AST", "=", "null", ";", "tmp255_AST", "=", "astFactory", ".", "create", "(", "LT", "(", "1", ")", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "tmp255_AST", ")", ";", "match", "(", "IDENT", ")", ";", "primaryExpression_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "break", ";", "}", "case", "STRING_LITERAL", ":", "case", "LITERAL_false", ":", "case", "LITERAL_null", ":", "case", "LITERAL_true", ":", "case", "NUM_INT", ":", "case", "NUM_FLOAT", ":", "case", "NUM_LONG", ":", "case", "NUM_DOUBLE", ":", "case", "NUM_BIG_INT", ":", "case", "NUM_BIG_DECIMAL", ":", "{", "constant", "(", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "returnAST", ")", ";", "primaryExpression_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "break", ";", "}", "case", "LITERAL_new", ":", "{", "newExpression", "(", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "returnAST", ")", ";", "primaryExpression_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "break", ";", "}", "case", "LITERAL_this", ":", "{", "AST", "tmp256_AST", "=", "null", ";", "tmp256_AST", "=", "astFactory", ".", "create", "(", "LT", "(", "1", ")", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "tmp256_AST", ")", ";", "match", "(", "LITERAL_this", ")", ";", "primaryExpression_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "break", ";", "}", "case", "LITERAL_super", ":", "{", "AST", "tmp257_AST", "=", "null", ";", "tmp257_AST", "=", "astFactory", ".", "create", "(", "LT", "(", "1", ")", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "tmp257_AST", ")", ";", "match", "(", "LITERAL_super", ")", ";", "primaryExpression_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "break", ";", "}", "case", "LPAREN", ":", "{", "parenthesizedExpression", "(", ")", ";", "pe_AST", "=", "(", "AST", ")", "returnAST", ";", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "primaryExpression_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "primaryExpression_AST", "=", "(", "AST", ")", "astFactory", ".", "make", "(", "(", "new", "ASTArray", "(", "2", ")", ")", ".", "add", "(", "create", "(", "EXPR", ",", "\"EXPR\"", ",", "first", ",", "LT", "(", "1", ")", ")", ")", ".", "add", "(", "pe_AST", ")", ")", ";", "currentAST", ".", "root", "=", "primaryExpression_AST", ";", "currentAST", ".", "child", "=", "primaryExpression_AST", "!=", "null", "&&", "primaryExpression_AST", ".", "getFirstChild", "(", ")", "!=", "null", "?", "primaryExpression_AST", ".", "getFirstChild", "(", ")", ":", "primaryExpression_AST", ";", "currentAST", ".", "advanceChildToEnd", "(", ")", ";", "}", "primaryExpression_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "break", ";", "}", "case", "LCURLY", ":", "{", "closableBlockConstructorExpression", "(", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "returnAST", ")", ";", "primaryExpression_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "break", ";", "}", "case", "LBRACK", ":", "{", "listOrMapConstructorExpression", "(", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "returnAST", ")", ";", "primaryExpression_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "break", ";", "}", "case", "STRING_CTOR_START", ":", "{", "stringConstructorExpression", "(", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "returnAST", ")", ";", "primaryExpression_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "break", ";", "}", "case", "LITERAL_void", ":", "case", "LITERAL_boolean", ":", "case", "LITERAL_byte", ":", "case", "LITERAL_char", ":", "case", "LITERAL_short", ":", "case", "LITERAL_int", ":", "case", "LITERAL_float", ":", "case", "LITERAL_long", ":", "case", "LITERAL_double", ":", "{", "builtInType", "(", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "returnAST", ")", ";", "primaryExpression_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "break", ";", "}", "default", ":", "{", "throw", "new", "NoViableAltException", "(", "LT", "(", "1", ")", ",", "getFilename", "(", ")", ")", ";", "}", "}", "returnAST", "=", "primaryExpression_AST", ";", "}", "public", "final", "void", "pathElementStart", "(", ")", "throws", "RecognitionException", ",", "TokenStreamException", "{", "returnAST", "=", "null", ";", "ASTPair", "currentAST", "=", "new", "ASTPair", "(", ")", ";", "AST", "pathElementStart_AST", "=", "null", ";", "switch", "(", "LA", "(", "1", ")", ")", "{", "case", "DOT", ":", "case", "NLS", ":", "{", "{", "nls", "(", ")", ";", "AST", "tmp258_AST", "=", "null", ";", "tmp258_AST", "=", "astFactory", ".", "create", "(", "LT", "(", "1", ")", ")", ";", "match", "(", "DOT", ")", ";", "}", "break", ";", "}", "case", "SPREAD_DOT", ":", "{", "AST", "tmp259_AST", "=", "null", ";", "tmp259_AST", "=", "astFactory", ".", "create", "(", "LT", "(", "1", ")", ")", ";", "match", "(", "SPREAD_DOT", ")", ";", "break", ";", "}", "case", "OPTIONAL_DOT", ":", "{", "AST", "tmp260_AST", "=", "null", ";", "tmp260_AST", "=", "astFactory", ".", "create", "(", "LT", "(", "1", ")", ")", ";", "match", "(", "OPTIONAL_DOT", ")", ";", "break", ";", "}", "case", "MEMBER_POINTER", ":", "{", "AST", "tmp261_AST", "=", "null", ";", "tmp261_AST", "=", "astFactory", ".", "create", "(", "LT", "(", "1", ")", ")", ";", "match", "(", "MEMBER_POINTER", ")", ";", "break", ";", "}", "case", "LBRACK", ":", "{", "AST", "tmp262_AST", "=", "null", ";", "tmp262_AST", "=", "astFactory", ".", "create", "(", "LT", "(", "1", ")", ")", ";", "match", "(", "LBRACK", ")", ";", "break", ";", "}", "case", "LPAREN", ":", "{", "AST", "tmp263_AST", "=", "null", ";", "tmp263_AST", "=", "astFactory", ".", "create", "(", "LT", "(", "1", ")", ")", ";", "match", "(", "LPAREN", ")", ";", "break", ";", "}", "case", "LCURLY", ":", "{", "AST", "tmp264_AST", "=", "null", ";", "tmp264_AST", "=", "astFactory", ".", "create", "(", "LT", "(", "1", ")", ")", ";", "match", "(", "LCURLY", ")", ";", "break", ";", "}", "default", ":", "{", "throw", "new", "NoViableAltException", "(", "LT", "(", "1", ")", ",", "getFilename", "(", ")", ")", ";", "}", "}", "returnAST", "=", "pathElementStart_AST", ";", "}", "public", "final", "void", "pathChain", "(", "int", "lc_stmt", ",", "AST", "prefix", ")", "throws", "RecognitionException", ",", "TokenStreamException", "{", "returnAST", "=", "null", ";", "ASTPair", "currentAST", "=", "new", "ASTPair", "(", ")", ";", "AST", "pathChain_AST", "=", "null", ";", "AST", "pe_AST", "=", "null", ";", "AST", "apb_AST", "=", "null", ";", "{", "int", "_cnt403", "=", "0", ";", "_loop403", ":", "do", "{", "boolean", "synPredMatched400", "=", "false", ";", "if", "(", "(", "(", "_tokenSet_89", ".", "member", "(", "LA", "(", "1", ")", ")", ")", "&&", "(", "_tokenSet_90", ".", "member", "(", "LA", "(", "2", ")", ")", ")", ")", ")", "{", "int", "_m400", "=", "mark", "(", ")", ";", "synPredMatched400", "=", "true", ";", "inputState", ".", "guessing", "++", ";", "try", "{", "{", "pathElementStart", "(", ")", ";", "}", "}", "catch", "(", "RecognitionException", "pe", ")", "{", "synPredMatched400", "=", "false", ";", "}", "rewind", "(", "_m400", ")", ";", "inputState", ".", "guessing", "--", ";", "}", "if", "(", "synPredMatched400", ")", "{", "nls", "(", ")", ";", "pathElement", "(", "prefix", ")", ";", "pe_AST", "=", "(", "AST", ")", "returnAST", ";", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "prefix", "=", "pe_AST", ";", "}", "}", "else", "{", "boolean", "synPredMatched402", "=", "false", ";", "if", "(", "(", "(", "(", "LA", "(", "1", ")", "==", "LCURLY", "||", "LA", "(", "1", ")", "==", "NLS", ")", "&&", "(", "_tokenSet_18", ".", "member", "(", "LA", "(", "2", ")", ")", ")", ")", "&&", "(", "lc_stmt", "==", "LC_STMT", "||", "lc_stmt", "==", "LC_INIT", ")", ")", ")", "{", "int", "_m402", "=", "mark", "(", ")", ";", "synPredMatched402", "=", "true", ";", "inputState", ".", "guessing", "++", ";", "try", "{", "{", "nls", "(", ")", ";", "match", "(", "LCURLY", ")", ";", "}", "}", "catch", "(", "RecognitionException", "pe", ")", "{", "synPredMatched402", "=", "false", ";", "}", "rewind", "(", "_m402", ")", ";", "inputState", ".", "guessing", "--", ";", "}", "if", "(", "synPredMatched402", ")", "{", "nlsWarn", "(", ")", ";", "appendedBlock", "(", "prefix", ")", ";", "apb_AST", "=", "(", "AST", ")", "returnAST", ";", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "prefix", "=", "apb_AST", ";", "}", "}", "else", "{", "if", "(", "_cnt403", ">=", "1", ")", "{", "break", "_loop403", ";", "}", "else", "{", "throw", "new", "NoViableAltException", "(", "LT", "(", "1", ")", ",", "getFilename", "(", ")", ")", ";", "}", "}", "}", "_cnt403", "++", ";", "}", "while", "(", "true", ")", ";", "}", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "pathChain_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "pathChain_AST", "=", "prefix", ";", "currentAST", ".", "root", "=", "pathChain_AST", ";", "currentAST", ".", "child", "=", "pathChain_AST", "!=", "null", "&&", "pathChain_AST", ".", "getFirstChild", "(", ")", "!=", "null", "?", "pathChain_AST", ".", "getFirstChild", "(", ")", ":", "pathChain_AST", ";", "currentAST", ".", "advanceChildToEnd", "(", ")", ";", "}", "pathChain_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "returnAST", "=", "pathChain_AST", ";", "}", "public", "final", "void", "argumentLabel", "(", ")", "throws", "RecognitionException", ",", "TokenStreamException", "{", "returnAST", "=", "null", ";", "ASTPair", "currentAST", "=", "new", "ASTPair", "(", ")", ";", "AST", "argumentLabel_AST", "=", "null", ";", "Token", "id", "=", "null", ";", "AST", "id_AST", "=", "null", ";", "AST", "kw_AST", "=", "null", ";", "boolean", "synPredMatched551", "=", "false", ";", "if", "(", "(", "(", "LA", "(", "1", ")", "==", "IDENT", ")", "&&", "(", "LA", "(", "2", ")", "==", "COLON", ")", ")", ")", "{", "int", "_m551", "=", "mark", "(", ")", ";", "synPredMatched551", "=", "true", ";", "inputState", ".", "guessing", "++", ";", "try", "{", "{", "match", "(", "IDENT", ")", ";", "}", "}", "catch", "(", "RecognitionException", "pe", ")", "{", "synPredMatched551", "=", "false", ";", "}", "rewind", "(", "_m551", ")", ";", "inputState", ".", "guessing", "--", ";", "}", "if", "(", "synPredMatched551", ")", "{", "id", "=", "LT", "(", "1", ")", ";", "id_AST", "=", "astFactory", ".", "create", "(", "id", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "id_AST", ")", ";", "match", "(", "IDENT", ")", ";", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "id_AST", ".", "setType", "(", "STRING_LITERAL", ")", ";", "}", "argumentLabel_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "}", "else", "{", "boolean", "synPredMatched553", "=", "false", ";", "if", "(", "(", "(", "_tokenSet_96", ".", "member", "(", "LA", "(", "1", ")", ")", ")", "&&", "(", "LA", "(", "2", ")", "==", "COLON", ")", ")", ")", "{", "int", "_m553", "=", "mark", "(", ")", ";", "synPredMatched553", "=", "true", ";", "inputState", ".", "guessing", "++", ";", "try", "{", "{", "keywordPropertyNames", "(", ")", ";", "}", "}", "catch", "(", "RecognitionException", "pe", ")", "{", "synPredMatched553", "=", "false", ";", "}", "rewind", "(", "_m553", ")", ";", "inputState", ".", "guessing", "--", ";", "}", "if", "(", "synPredMatched553", ")", "{", "keywordPropertyNames", "(", ")", ";", "kw_AST", "=", "(", "AST", ")", "returnAST", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "returnAST", ")", ";", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "kw_AST", ".", "setType", "(", "STRING_LITERAL", ")", ";", "}", "argumentLabel_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "}", "else", "if", "(", "(", "_tokenSet_87", ".", "member", "(", "LA", "(", "1", ")", ")", ")", "&&", "(", "_tokenSet_95", ".", "member", "(", "LA", "(", "2", ")", ")", ")", ")", "{", "primaryExpression", "(", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "returnAST", ")", ";", "argumentLabel_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "}", "else", "{", "throw", "new", "NoViableAltException", "(", "LT", "(", "1", ")", ",", "getFilename", "(", ")", ")", ";", "}", "}", "returnAST", "=", "argumentLabel_AST", ";", "}", "public", "final", "void", "multipleAssignment", "(", "int", "lc_stmt", ")", "throws", "RecognitionException", ",", "TokenStreamException", "{", "returnAST", "=", "null", ";", "ASTPair", "currentAST", "=", "new", "ASTPair", "(", ")", ";", "AST", "multipleAssignment_AST", "=", "null", ";", "Token", "first", "=", "cloneToken", "(", "LT", "(", "1", ")", ")", ";", "AST", "tmp265_AST", "=", "null", ";", "tmp265_AST", "=", "astFactory", ".", "create", "(", "LT", "(", "1", ")", ")", ";", "astFactory", ".", "makeASTRoot", "(", "currentAST", ",", "tmp265_AST", ")", ";", "match", "(", "LPAREN", ")", ";", "nls", "(", ")", ";", "listOfVariables", "(", "null", ",", "null", ",", "first", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "returnAST", ")", ";", "match", "(", "RPAREN", ")", ";", "AST", "tmp267_AST", "=", "null", ";", "tmp267_AST", "=", "astFactory", ".", "create", "(", "LT", "(", "1", ")", ")", ";", "astFactory", ".", "makeASTRoot", "(", "currentAST", ",", "tmp267_AST", ")", ";", "match", "(", "ASSIGN", ")", ";", "nls", "(", ")", ";", "assignmentExpression", "(", "lc_stmt", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "returnAST", ")", ";", "multipleAssignment_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "returnAST", "=", "multipleAssignment_AST", ";", "}", "public", "final", "void", "pathElement", "(", "AST", "prefix", ")", "throws", "RecognitionException", ",", "TokenStreamException", "{", "returnAST", "=", "null", ";", "ASTPair", "currentAST", "=", "new", "ASTPair", "(", ")", ";", "AST", "pathElement_AST", "=", "null", ";", "AST", "ta_AST", "=", "null", ";", "AST", "np_AST", "=", "null", ";", "AST", "mca_AST", "=", "null", ";", "AST", "apb_AST", "=", "null", ";", "AST", "ipa_AST", "=", "null", ";", "Token", "operator", "=", "LT", "(", "1", ")", ";", "try", "{", "switch", "(", "LA", "(", "1", ")", ")", "{", "case", "DOT", ":", "case", "SPREAD_DOT", ":", "case", "OPTIONAL_DOT", ":", "case", "MEMBER_POINTER", ":", "case", "NLS", ":", "{", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "pathElement_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "pathElement_AST", "=", "prefix", ";", "currentAST", ".", "root", "=", "pathElement_AST", ";", "currentAST", ".", "child", "=", "pathElement_AST", "!=", "null", "&&", "pathElement_AST", ".", "getFirstChild", "(", ")", "!=", "null", "?", "pathElement_AST", ".", "getFirstChild", "(", ")", ":", "pathElement_AST", ";", "currentAST", ".", "advanceChildToEnd", "(", ")", ";", "}", "{", "switch", "(", "LA", "(", "1", ")", ")", "{", "case", "SPREAD_DOT", ":", "{", "match", "(", "SPREAD_DOT", ")", ";", "break", ";", "}", "case", "OPTIONAL_DOT", ":", "{", "match", "(", "OPTIONAL_DOT", ")", ";", "break", ";", "}", "case", "MEMBER_POINTER", ":", "{", "match", "(", "MEMBER_POINTER", ")", ";", "break", ";", "}", "case", "DOT", ":", "case", "NLS", ":", "{", "{", "nls", "(", ")", ";", "match", "(", "DOT", ")", ";", "}", "break", ";", "}", "default", ":", "{", "throw", "new", "NoViableAltException", "(", "LT", "(", "1", ")", ",", "getFilename", "(", ")", ")", ";", "}", "}", "}", "nls", "(", ")", ";", "{", "switch", "(", "LA", "(", "1", ")", ")", "{", "case", "LT", ":", "{", "typeArguments", "(", ")", ";", "ta_AST", "=", "(", "AST", ")", "returnAST", ";", "break", ";", "}", "case", "FINAL", ":", "case", "ABSTRACT", ":", "case", "UNUSED_GOTO", ":", "case", "UNUSED_CONST", ":", "case", "UNUSED_DO", ":", "case", "STRICTFP", ":", "case", "LITERAL_package", ":", "case", "LITERAL_import", ":", "case", "LITERAL_static", ":", "case", "LITERAL_def", ":", "case", "IDENT", ":", "case", "STRING_LITERAL", ":", "case", "LPAREN", ":", "case", "LITERAL_class", ":", "case", "LITERAL_interface", ":", "case", "LITERAL_enum", ":", "case", "AT", ":", "case", "LITERAL_extends", ":", "case", "LITERAL_super", ":", "case", "LITERAL_void", ":", "case", "LITERAL_boolean", ":", "case", "LITERAL_byte", ":", "case", "LITERAL_char", ":", "case", "LITERAL_short", ":", "case", "LITERAL_int", ":", "case", "LITERAL_float", ":", "case", "LITERAL_long", ":", "case", "LITERAL_double", ":", "case", "LITERAL_as", ":", "case", "LITERAL_private", ":", "case", "LITERAL_public", ":", "case", "LITERAL_protected", ":", "case", "LITERAL_transient", ":", "case", "LITERAL_native", ":", "case", "LITERAL_threadsafe", ":", "case", "LITERAL_synchronized", ":", "case", "LITERAL_volatile", ":", "case", "LCURLY", ":", "case", "LITERAL_default", ":", "case", "LITERAL_throws", ":", "case", "LITERAL_implements", ":", "case", "LITERAL_this", ":", "case", "LITERAL_if", ":", "case", "LITERAL_else", ":", "case", "LITERAL_while", ":", "case", "LITERAL_switch", ":", "case", "LITERAL_for", ":", "case", "LITERAL_in", ":", "case", "LITERAL_return", ":", "case", "LITERAL_break", ":", "case", "LITERAL_continue", ":", "case", "LITERAL_throw", ":", "case", "LITERAL_assert", ":", "case", "LITERAL_case", ":", "case", "LITERAL_try", ":", "case", "LITERAL_finally", ":", "case", "LITERAL_catch", ":", "case", "LITERAL_false", ":", "case", "LITERAL_instanceof", ":", "case", "LITERAL_new", ":", "case", "LITERAL_null", ":", "case", "LITERAL_true", ":", "case", "STRING_CTOR_START", ":", "{", "break", ";", "}", "default", ":", "{", "throw", "new", "NoViableAltException", "(", "LT", "(", "1", ")", ",", "getFilename", "(", ")", ")", ";", "}", "}", "}", "namePart", "(", ")", ";", "np_AST", "=", "(", "AST", ")", "returnAST", ";", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "pathElement_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "pathElement_AST", "=", "(", "AST", ")", "astFactory", ".", "make", "(", "(", "new", "ASTArray", "(", "4", ")", ")", ".", "add", "(", "create", "(", "operator", ".", "getType", "(", ")", ",", "operator", ".", "getText", "(", ")", ",", "prefix", ",", "LT", "(", "1", ")", ")", ")", ".", "add", "(", "prefix", ")", ".", "add", "(", "ta_AST", ")", ".", "add", "(", "np_AST", ")", ")", ";", "currentAST", ".", "root", "=", "pathElement_AST", ";", "currentAST", ".", "child", "=", "pathElement_AST", "!=", "null", "&&", "pathElement_AST", ".", "getFirstChild", "(", ")", "!=", "null", "?", "pathElement_AST", ".", "getFirstChild", "(", ")", ":", "pathElement_AST", ";", "currentAST", ".", "advanceChildToEnd", "(", ")", ";", "}", "pathElement_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "break", ";", "}", "case", "LPAREN", ":", "{", "methodCallArgs", "(", "prefix", ")", ";", "mca_AST", "=", "(", "AST", ")", "returnAST", ";", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "pathElement_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "pathElement_AST", "=", "mca_AST", ";", "currentAST", ".", "root", "=", "pathElement_AST", ";", "currentAST", ".", "child", "=", "pathElement_AST", "!=", "null", "&&", "pathElement_AST", ".", "getFirstChild", "(", ")", "!=", "null", "?", "pathElement_AST", ".", "getFirstChild", "(", ")", ":", "pathElement_AST", ";", "currentAST", ".", "advanceChildToEnd", "(", ")", ";", "}", "pathElement_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "break", ";", "}", "case", "LCURLY", ":", "{", "appendedBlock", "(", "prefix", ")", ";", "apb_AST", "=", "(", "AST", ")", "returnAST", ";", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "pathElement_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "pathElement_AST", "=", "apb_AST", ";", "currentAST", ".", "root", "=", "pathElement_AST", ";", "currentAST", ".", "child", "=", "pathElement_AST", "!=", "null", "&&", "pathElement_AST", ".", "getFirstChild", "(", ")", "!=", "null", "?", "pathElement_AST", ".", "getFirstChild", "(", ")", ":", "pathElement_AST", ";", "currentAST", ".", "advanceChildToEnd", "(", ")", ";", "}", "pathElement_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "break", ";", "}", "case", "LBRACK", ":", "{", "indexPropertyArgs", "(", "prefix", ")", ";", "ipa_AST", "=", "(", "AST", ")", "returnAST", ";", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "pathElement_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "pathElement_AST", "=", "ipa_AST", ";", "currentAST", ".", "root", "=", "pathElement_AST", ";", "currentAST", ".", "child", "=", "pathElement_AST", "!=", "null", "&&", "pathElement_AST", ".", "getFirstChild", "(", ")", "!=", "null", "?", "pathElement_AST", ".", "getFirstChild", "(", ")", ":", "pathElement_AST", ";", "currentAST", ".", "advanceChildToEnd", "(", ")", ";", "}", "pathElement_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "break", ";", "}", "default", ":", "{", "throw", "new", "NoViableAltException", "(", "LT", "(", "1", ")", ",", "getFilename", "(", ")", ")", ";", "}", "}", "}", "catch", "(", "RecognitionException", "e", ")", "{", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "if", "(", "pathElement_AST", "==", "null", ")", "{", "throw", "e", ";", "}", "reportError", "(", "e", ")", ";", "}", "else", "{", "throw", "e", ";", "}", "}", "returnAST", "=", "pathElement_AST", ";", "}", "public", "final", "void", "appendedBlock", "(", "AST", "callee", ")", "throws", "RecognitionException", ",", "TokenStreamException", "{", "returnAST", "=", "null", ";", "ASTPair", "currentAST", "=", "new", "ASTPair", "(", ")", ";", "AST", "appendedBlock_AST", "=", "null", ";", "AST", "cb_AST", "=", "null", ";", "closableBlock", "(", ")", ";", "cb_AST", "=", "(", "AST", ")", "returnAST", ";", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "appendedBlock_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "if", "(", "callee", "!=", "null", "&&", "callee", ".", "getType", "(", ")", "==", "METHOD_CALL", ")", "{", "appendedBlock_AST", "=", "(", "AST", ")", "astFactory", ".", "make", "(", "(", "new", "ASTArray", "(", "3", ")", ")", ".", "add", "(", "create", "(", "METHOD_CALL", ",", "\"(\"", ",", "callee", ",", "LT", "(", "1", ")", ")", ")", ".", "add", "(", "callee", ".", "getFirstChild", "(", ")", ")", ".", "add", "(", "cb_AST", ")", ")", ";", "}", "else", "{", "appendedBlock_AST", "=", "(", "AST", ")", "astFactory", ".", "make", "(", "(", "new", "ASTArray", "(", "3", ")", ")", ".", "add", "(", "create", "(", "METHOD_CALL", ",", "\"{\"", ",", "callee", ",", "LT", "(", "1", ")", ")", ")", ".", "add", "(", "callee", ")", ".", "add", "(", "cb_AST", ")", ")", ";", "}", "currentAST", ".", "root", "=", "appendedBlock_AST", ";", "currentAST", ".", "child", "=", "appendedBlock_AST", "!=", "null", "&&", "appendedBlock_AST", ".", "getFirstChild", "(", ")", "!=", "null", "?", "appendedBlock_AST", ".", "getFirstChild", "(", ")", ":", "appendedBlock_AST", ";", "currentAST", ".", "advanceChildToEnd", "(", ")", ";", "}", "appendedBlock_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "returnAST", "=", "appendedBlock_AST", ";", "}", "public", "final", "void", "pathExpression", "(", "int", "lc_stmt", ")", "throws", "RecognitionException", ",", "TokenStreamException", "{", "returnAST", "=", "null", ";", "ASTPair", "currentAST", "=", "new", "ASTPair", "(", ")", ";", "AST", "pathExpression_AST", "=", "null", ";", "AST", "pre_AST", "=", "null", ";", "AST", "pe_AST", "=", "null", ";", "AST", "apb_AST", "=", "null", ";", "AST", "prefix", "=", "null", ";", "primaryExpression", "(", ")", ";", "pre_AST", "=", "(", "AST", ")", "returnAST", ";", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "prefix", "=", "pre_AST", ";", "}", "{", "_loop411", ":", "do", "{", "boolean", "synPredMatched407", "=", "false", ";", "if", "(", "(", "(", "_tokenSet_89", ".", "member", "(", "LA", "(", "1", ")", ")", ")", "&&", "(", "_tokenSet_90", ".", "member", "(", "LA", "(", "2", ")", ")", ")", ")", ")", "{", "int", "_m407", "=", "mark", "(", ")", ";", "synPredMatched407", "=", "true", ";", "inputState", ".", "guessing", "++", ";", "try", "{", "{", "pathElementStart", "(", ")", ";", "}", "}", "catch", "(", "RecognitionException", "pe", ")", "{", "synPredMatched407", "=", "false", ";", "}", "rewind", "(", "_m407", ")", ";", "inputState", ".", "guessing", "--", ";", "}", "if", "(", "synPredMatched407", ")", "{", "nls", "(", ")", ";", "pathElement", "(", "prefix", ")", ";", "pe_AST", "=", "(", "AST", ")", "returnAST", ";", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "prefix", "=", "pe_AST", ";", "}", "}", "else", "{", "boolean", "synPredMatched409", "=", "false", ";", "if", "(", "(", "(", "(", "LA", "(", "1", ")", "==", "LCURLY", "||", "LA", "(", "1", ")", "==", "NLS", ")", "&&", "(", "_tokenSet_18", ".", "member", "(", "LA", "(", "2", ")", ")", ")", ")", "&&", "(", "lc_stmt", "==", "LC_STMT", "||", "lc_stmt", "==", "LC_INIT", ")", ")", ")", "{", "int", "_m409", "=", "mark", "(", ")", ";", "synPredMatched409", "=", "true", ";", "inputState", ".", "guessing", "++", ";", "try", "{", "{", "nls", "(", ")", ";", "match", "(", "LCURLY", ")", ";", "}", "}", "catch", "(", "RecognitionException", "pe", ")", "{", "synPredMatched409", "=", "false", ";", "}", "rewind", "(", "_m409", ")", ";", "inputState", ".", "guessing", "--", ";", "}", "if", "(", "synPredMatched409", ")", "{", "nlsWarn", "(", ")", ";", "appendedBlock", "(", "prefix", ")", ";", "apb_AST", "=", "(", "AST", ")", "returnAST", ";", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "prefix", "=", "apb_AST", ";", "}", "}", "else", "if", "(", "(", "_tokenSet_97", ".", "member", "(", "LA", "(", "1", ")", ")", ")", "&&", "(", "_tokenSet_98", ".", "member", "(", "LA", "(", "2", ")", ")", ")", ")", "{", "{", "switch", "(", "LA", "(", "1", ")", ")", "{", "case", "DOT", ":", "{", "match", "(", "DOT", ")", ";", "break", ";", "}", "case", "SPREAD_DOT", ":", "{", "match", "(", "SPREAD_DOT", ")", ";", "break", ";", "}", "case", "OPTIONAL_DOT", ":", "{", "AST", "tmp274_AST", "=", "null", ";", "tmp274_AST", "=", "astFactory", ".", "create", "(", "LT", "(", "1", ")", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "tmp274_AST", ")", ";", "match", "(", "OPTIONAL_DOT", ")", ";", "break", ";", "}", "default", ":", "{", "throw", "new", "NoViableAltException", "(", "LT", "(", "1", ")", ",", "getFilename", "(", ")", ")", ";", "}", "}", "}", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "reportError", "(", "\"\"", ")", ";", "}", "}", "else", "{", "break", "_loop411", ";", "}", "}", "}", "while", "(", "true", ")", ";", "}", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "pathExpression_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "pathExpression_AST", "=", "prefix", ";", "lastPathExpression", "=", "pathExpression_AST", ";", "currentAST", ".", "root", "=", "pathExpression_AST", ";", "currentAST", ".", "child", "=", "pathExpression_AST", "!=", "null", "&&", "pathExpression_AST", ".", "getFirstChild", "(", ")", "!=", "null", "?", "pathExpression_AST", ".", "getFirstChild", "(", ")", ":", "pathExpression_AST", ";", "currentAST", ".", "advanceChildToEnd", "(", ")", ";", "}", "pathExpression_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "returnAST", "=", "pathExpression_AST", ";", "}", "public", "final", "void", "namePart", "(", ")", "throws", "RecognitionException", ",", "TokenStreamException", "{", "returnAST", "=", "null", ";", "ASTPair", "currentAST", "=", "new", "ASTPair", "(", ")", ";", "AST", "namePart_AST", "=", "null", ";", "Token", "ats", "=", "null", ";", "AST", "ats_AST", "=", "null", ";", "Token", "sl", "=", "null", ";", "AST", "sl_AST", "=", "null", ";", "Token", "first", "=", "LT", "(", "1", ")", ";", "{", "switch", "(", "LA", "(", "1", ")", ")", "{", "case", "AT", ":", "{", "ats", "=", "LT", "(", "1", ")", ";", "ats_AST", "=", "astFactory", ".", "create", "(", "ats", ")", ";", "astFactory", ".", "makeASTRoot", "(", "currentAST", ",", "ats_AST", ")", ";", "match", "(", "AT", ")", ";", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "ats_AST", ".", "setType", "(", "SELECT_SLOT", ")", ";", "}", "break", ";", "}", "case", "FINAL", ":", "case", "ABSTRACT", ":", "case", "UNUSED_GOTO", ":", "case", "UNUSED_CONST", ":", "case", "UNUSED_DO", ":", "case", "STRICTFP", ":", "case", "LITERAL_package", ":", "case", "LITERAL_import", ":", "case", "LITERAL_static", ":", "case", "LITERAL_def", ":", "case", "IDENT", ":", "case", "STRING_LITERAL", ":", "case", "LPAREN", ":", "case", "LITERAL_class", ":", "case", "LITERAL_interface", ":", "case", "LITERAL_enum", ":", "case", "LITERAL_extends", ":", "case", "LITERAL_super", ":", "case", "LITERAL_void", ":", "case", "LITERAL_boolean", ":", "case", "LITERAL_byte", ":", "case", "LITERAL_char", ":", "case", "LITERAL_short", ":", "case", "LITERAL_int", ":", "case", "LITERAL_float", ":", "case", "LITERAL_long", ":", "case", "LITERAL_double", ":", "case", "LITERAL_as", ":", "case", "LITERAL_private", ":", "case", "LITERAL_public", ":", "case", "LITERAL_protected", ":", "case", "LITERAL_transient", ":", "case", "LITERAL_native", ":", "case", "LITERAL_threadsafe", ":", "case", "LITERAL_synchronized", ":", "case", "LITERAL_volatile", ":", "case", "LCURLY", ":", "case", "LITERAL_default", ":", "case", "LITERAL_throws", ":", "case", "LITERAL_implements", ":", "case", "LITERAL_this", ":", "case", "LITERAL_if", ":", "case", "LITERAL_else", ":", "case", "LITERAL_while", ":", "case", "LITERAL_switch", ":", "case", "LITERAL_for", ":", "case", "LITERAL_in", ":", "case", "LITERAL_return", ":", "case", "LITERAL_break", ":", "case", "LITERAL_continue", ":", "case", "LITERAL_throw", ":", "case", "LITERAL_assert", ":", "case", "LITERAL_case", ":", "case", "LITERAL_try", ":", "case", "LITERAL_finally", ":", "case", "LITERAL_catch", ":", "case", "LITERAL_false", ":", "case", "LITERAL_instanceof", ":", "case", "LITERAL_new", ":", "case", "LITERAL_null", ":", "case", "LITERAL_true", ":", "case", "STRING_CTOR_START", ":", "{", "break", ";", "}", "default", ":", "{", "throw", "new", "NoViableAltException", "(", "LT", "(", "1", ")", ",", "getFilename", "(", ")", ")", ";", "}", "}", "}", "{", "switch", "(", "LA", "(", "1", ")", ")", "{", "case", "IDENT", ":", "{", "AST", "tmp275_AST", "=", "null", ";", "tmp275_AST", "=", "astFactory", ".", "create", "(", "LT", "(", "1", ")", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "tmp275_AST", ")", ";", "match", "(", "IDENT", ")", ";", "break", ";", "}", "case", "STRING_LITERAL", ":", "{", "sl", "=", "LT", "(", "1", ")", ";", "sl_AST", "=", "astFactory", ".", "create", "(", "sl", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "sl_AST", ")", ";", "match", "(", "STRING_LITERAL", ")", ";", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "sl_AST", ".", "setType", "(", "IDENT", ")", ";", "}", "break", ";", "}", "case", "LPAREN", ":", "case", "STRING_CTOR_START", ":", "{", "dynamicMemberName", "(", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "returnAST", ")", ";", "break", ";", "}", "case", "LCURLY", ":", "{", "openBlock", "(", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "returnAST", ")", ";", "break", ";", "}", "case", "FINAL", ":", "case", "ABSTRACT", ":", "case", "UNUSED_GOTO", ":", "case", "UNUSED_CONST", ":", "case", "UNUSED_DO", ":", "case", "STRICTFP", ":", "case", "LITERAL_package", ":", "case", "LITERAL_import", ":", "case", "LITERAL_static", ":", "case", "LITERAL_def", ":", "case", "LITERAL_class", ":", "case", "LITERAL_interface", ":", "case", "LITERAL_enum", ":", "case", "LITERAL_extends", ":", "case", "LITERAL_super", ":", "case", "LITERAL_void", ":", "case", "LITERAL_boolean", ":", "case", "LITERAL_byte", ":", "case", "LITERAL_char", ":", "case", "LITERAL_short", ":", "case", "LITERAL_int", ":", "case", "LITERAL_float", ":", "case", "LITERAL_long", ":", "case", "LITERAL_double", ":", "case", "LITERAL_as", ":", "case", "LITERAL_private", ":", "case", "LITERAL_public", ":", "case", "LITERAL_protected", ":", "case", "LITERAL_transient", ":", "case", "LITERAL_native", ":", "case", "LITERAL_threadsafe", ":", "case", "LITERAL_synchronized", ":", "case", "LITERAL_volatile", ":", "case", "LITERAL_default", ":", "case", "LITERAL_throws", ":", "case", "LITERAL_implements", ":", "case", "LITERAL_this", ":", "case", "LITERAL_if", ":", "case", "LITERAL_else", ":", "case", "LITERAL_while", ":", "case", "LITERAL_switch", ":", "case", "LITERAL_for", ":", "case", "LITERAL_in", ":", "case", "LITERAL_return", ":", "case", "LITERAL_break", ":", "case", "LITERAL_continue", ":", "case", "LITERAL_throw", ":", "case", "LITERAL_assert", ":", "case", "LITERAL_case", ":", "case", "LITERAL_try", ":", "case", "LITERAL_finally", ":", "case", "LITERAL_catch", ":", "case", "LITERAL_false", ":", "case", "LITERAL_instanceof", ":", "case", "LITERAL_new", ":", "case", "LITERAL_null", ":", "case", "LITERAL_true", ":", "{", "keywordPropertyNames", "(", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "returnAST", ")", ";", "break", ";", "}", "default", ":", "{", "throw", "new", "NoViableAltException", "(", "LT", "(", "1", ")", ",", "getFilename", "(", ")", ")", ";", "}", "}", "}", "namePart_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "returnAST", "=", "namePart_AST", ";", "}", "public", "final", "void", "methodCallArgs", "(", "AST", "callee", ")", "throws", "RecognitionException", ",", "TokenStreamException", "{", "returnAST", "=", "null", ";", "ASTPair", "currentAST", "=", "new", "ASTPair", "(", ")", ";", "AST", "methodCallArgs_AST", "=", "null", ";", "AST", "al_AST", "=", "null", ";", "try", "{", "match", "(", "LPAREN", ")", ";", "argList", "(", ")", ";", "al_AST", "=", "(", "AST", ")", "returnAST", ";", "match", "(", "RPAREN", ")", ";", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "methodCallArgs_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "if", "(", "callee", "!=", "null", "&&", "callee", ".", "getFirstChild", "(", ")", "!=", "null", ")", "{", "methodCallArgs_AST", "=", "(", "AST", ")", "astFactory", ".", "make", "(", "(", "new", "ASTArray", "(", "3", ")", ")", ".", "add", "(", "create", "(", "METHOD_CALL", ",", "\"(\"", ",", "callee", ".", "getFirstChild", "(", ")", ",", "LT", "(", "1", ")", ")", ")", ".", "add", "(", "callee", ")", ".", "add", "(", "al_AST", ")", ")", ";", "}", "else", "{", "methodCallArgs_AST", "=", "(", "AST", ")", "astFactory", ".", "make", "(", "(", "new", "ASTArray", "(", "3", ")", ")", ".", "add", "(", "create", "(", "METHOD_CALL", ",", "\"(\"", ",", "callee", ",", "LT", "(", "1", ")", ")", ")", ".", "add", "(", "callee", ")", ".", "add", "(", "al_AST", ")", ")", ";", "}", "currentAST", ".", "root", "=", "methodCallArgs_AST", ";", "currentAST", ".", "child", "=", "methodCallArgs_AST", "!=", "null", "&&", "methodCallArgs_AST", ".", "getFirstChild", "(", ")", "!=", "null", "?", "methodCallArgs_AST", ".", "getFirstChild", "(", ")", ":", "methodCallArgs_AST", ";", "currentAST", ".", "advanceChildToEnd", "(", ")", ";", "}", "methodCallArgs_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "}", "catch", "(", "RecognitionException", "e", ")", "{", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "if", "(", "al_AST", "!=", "null", ")", "{", "reportError", "(", "e", ")", ";", "if", "(", "callee", "!=", "null", "&&", "callee", ".", "getFirstChild", "(", ")", "!=", "null", ")", "{", "methodCallArgs_AST", "=", "(", "AST", ")", "astFactory", ".", "make", "(", "(", "new", "ASTArray", "(", "3", ")", ")", ".", "add", "(", "create", "(", "METHOD_CALL", ",", "\"(\"", ",", "callee", ".", "getFirstChild", "(", ")", ",", "LT", "(", "1", ")", ")", ")", ".", "add", "(", "callee", ")", ".", "add", "(", "al_AST", ")", ")", ";", "}", "else", "{", "methodCallArgs_AST", "=", "(", "AST", ")", "astFactory", ".", "make", "(", "(", "new", "ASTArray", "(", "3", ")", ")", ".", "add", "(", "create", "(", "METHOD_CALL", ",", "\"(\"", ",", "callee", ",", "LT", "(", "1", ")", ")", ")", ".", "add", "(", "callee", ")", ".", "add", "(", "al_AST", ")", ")", ";", "}", "}", "else", "{", "throw", "e", ";", "}", "}", "else", "{", "throw", "e", ";", "}", "}", "returnAST", "=", "methodCallArgs_AST", ";", "}", "public", "final", "void", "indexPropertyArgs", "(", "AST", "indexee", ")", "throws", "RecognitionException", ",", "TokenStreamException", "{", "returnAST", "=", "null", ";", "ASTPair", "currentAST", "=", "new", "ASTPair", "(", ")", ";", "AST", "indexPropertyArgs_AST", "=", "null", ";", "Token", "lb", "=", "null", ";", "AST", "lb_AST", "=", "null", ";", "AST", "al_AST", "=", "null", ";", "lb", "=", "LT", "(", "1", ")", ";", "lb_AST", "=", "astFactory", ".", "create", "(", "lb", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "lb_AST", ")", ";", "match", "(", "LBRACK", ")", ";", "argList", "(", ")", ";", "al_AST", "=", "(", "AST", ")", "returnAST", ";", "match", "(", "RBRACK", ")", ";", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "indexPropertyArgs_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "if", "(", "indexee", "!=", "null", "&&", "indexee", ".", "getFirstChild", "(", ")", "!=", "null", ")", "{", "indexPropertyArgs_AST", "=", "(", "AST", ")", "astFactory", ".", "make", "(", "(", "new", "ASTArray", "(", "4", ")", ")", ".", "add", "(", "create", "(", "INDEX_OP", ",", "\"INDEX_OP\"", ",", "indexee", ".", "getFirstChild", "(", ")", ",", "LT", "(", "1", ")", ")", ")", ".", "add", "(", "lb_AST", ")", ".", "add", "(", "indexee", ")", ".", "add", "(", "al_AST", ")", ")", ";", "}", "else", "{", "indexPropertyArgs_AST", "=", "(", "AST", ")", "astFactory", ".", "make", "(", "(", "new", "ASTArray", "(", "4", ")", ")", ".", "add", "(", "create", "(", "INDEX_OP", ",", "\"INDEX_OP\"", ",", "indexee", ",", "LT", "(", "1", ")", ")", ")", ".", "add", "(", "lb_AST", ")", ".", "add", "(", "indexee", ")", ".", "add", "(", "al_AST", ")", ")", ";", "}", "currentAST", ".", "root", "=", "indexPropertyArgs_AST", ";", "currentAST", ".", "child", "=", "indexPropertyArgs_AST", "!=", "null", "&&", "indexPropertyArgs_AST", ".", "getFirstChild", "(", ")", "!=", "null", "?", "indexPropertyArgs_AST", ".", "getFirstChild", "(", ")", ":", "indexPropertyArgs_AST", ";", "currentAST", ".", "advanceChildToEnd", "(", ")", ";", "}", "indexPropertyArgs_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "returnAST", "=", "indexPropertyArgs_AST", ";", "}", "public", "final", "void", "dynamicMemberName", "(", ")", "throws", "RecognitionException", ",", "TokenStreamException", "{", "returnAST", "=", "null", ";", "ASTPair", "currentAST", "=", "new", "ASTPair", "(", ")", ";", "AST", "dynamicMemberName_AST", "=", "null", ";", "AST", "pe_AST", "=", "null", ";", "Token", "first", "=", "LT", "(", "1", ")", ";", "{", "switch", "(", "LA", "(", "1", ")", ")", "{", "case", "LPAREN", ":", "{", "parenthesizedExpression", "(", ")", ";", "pe_AST", "=", "(", "AST", ")", "returnAST", ";", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "dynamicMemberName_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "dynamicMemberName_AST", "=", "(", "AST", ")", "astFactory", ".", "make", "(", "(", "new", "ASTArray", "(", "2", ")", ")", ".", "add", "(", "create", "(", "EXPR", ",", "\"EXPR\"", ",", "first", ",", "LT", "(", "1", ")", ")", ")", ".", "add", "(", "pe_AST", ")", ")", ";", "currentAST", ".", "root", "=", "dynamicMemberName_AST", ";", "currentAST", ".", "child", "=", "dynamicMemberName_AST", "!=", "null", "&&", "dynamicMemberName_AST", ".", "getFirstChild", "(", ")", "!=", "null", "?", "dynamicMemberName_AST", ".", "getFirstChild", "(", ")", ":", "dynamicMemberName_AST", ";", "currentAST", ".", "advanceChildToEnd", "(", ")", ";", "}", "break", ";", "}", "case", "STRING_CTOR_START", ":", "{", "stringConstructorExpression", "(", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "returnAST", ")", ";", "break", ";", "}", "default", ":", "{", "throw", "new", "NoViableAltException", "(", "LT", "(", "1", ")", ",", "getFilename", "(", ")", ")", ";", "}", "}", "}", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "dynamicMemberName_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "dynamicMemberName_AST", "=", "(", "AST", ")", "astFactory", ".", "make", "(", "(", "new", "ASTArray", "(", "2", ")", ")", ".", "add", "(", "create", "(", "DYNAMIC_MEMBER", ",", "\"\"", ",", "first", ",", "LT", "(", "1", ")", ")", ")", ".", "add", "(", "dynamicMemberName_AST", ")", ")", ";", "currentAST", ".", "root", "=", "dynamicMemberName_AST", ";", "currentAST", ".", "child", "=", "dynamicMemberName_AST", "!=", "null", "&&", "dynamicMemberName_AST", ".", "getFirstChild", "(", ")", "!=", "null", "?", "dynamicMemberName_AST", ".", "getFirstChild", "(", ")", ":", "dynamicMemberName_AST", ";", "currentAST", ".", "advanceChildToEnd", "(", ")", ";", "}", "dynamicMemberName_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "returnAST", "=", "dynamicMemberName_AST", ";", "}", "public", "final", "void", "parenthesizedExpression", "(", ")", "throws", "RecognitionException", ",", "TokenStreamException", "{", "returnAST", "=", "null", ";", "ASTPair", "currentAST", "=", "new", "ASTPair", "(", ")", ";", "AST", "parenthesizedExpression_AST", "=", "null", ";", "Token", "first", "=", "LT", "(", "1", ")", ";", "Token", "declaration", "=", "null", ";", "boolean", "hasClosureList", "=", "false", ";", "boolean", "firstContainsDeclaration", "=", "false", ";", "boolean", "sce", "=", "false", ";", "try", "{", "match", "(", "LPAREN", ")", ";", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "declaration", "=", "LT", "(", "1", ")", ";", "}", "firstContainsDeclaration", "=", "strictContextExpression", "(", "true", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "returnAST", ")", ";", "{", "_loop511", ":", "do", "{", "if", "(", "(", "LA", "(", "1", ")", "==", "SEMI", ")", ")", "{", "match", "(", "SEMI", ")", ";", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "hasClosureList", "=", "true", ";", "}", "{", "switch", "(", "LA", "(", "1", ")", ")", "{", "case", "FINAL", ":", "case", "ABSTRACT", ":", "case", "STRICTFP", ":", "case", "LITERAL_static", ":", "case", "LITERAL_def", ":", "case", "LBRACK", ":", "case", "IDENT", ":", "case", "STRING_LITERAL", ":", "case", "LPAREN", ":", "case", "AT", ":", "case", "LITERAL_super", ":", "case", "LITERAL_void", ":", "case", "LITERAL_boolean", ":", "case", "LITERAL_byte", ":", "case", "LITERAL_char", ":", "case", "LITERAL_short", ":", "case", "LITERAL_int", ":", "case", "LITERAL_float", ":", "case", "LITERAL_long", ":", "case", "LITERAL_double", ":", "case", "LITERAL_private", ":", "case", "LITERAL_public", ":", "case", "LITERAL_protected", ":", "case", "LITERAL_transient", ":", "case", "LITERAL_native", ":", "case", "LITERAL_threadsafe", ":", "case", "LITERAL_synchronized", ":", "case", "LITERAL_volatile", ":", "case", "LCURLY", ":", "case", "LITERAL_this", ":", "case", "LITERAL_return", ":", "case", "LITERAL_break", ":", "case", "LITERAL_continue", ":", "case", "LITERAL_throw", ":", "case", "LITERAL_assert", ":", "case", "PLUS", ":", "case", "MINUS", ":", "case", "LITERAL_false", ":", "case", "LITERAL_new", ":", "case", "LITERAL_null", ":", "case", "LITERAL_true", ":", "case", "INC", ":", "case", "DEC", ":", "case", "BNOT", ":", "case", "LNOT", ":", "case", "STRING_CTOR_START", ":", "case", "NUM_INT", ":", "case", "NUM_FLOAT", ":", "case", "NUM_LONG", ":", "case", "NUM_DOUBLE", ":", "case", "NUM_BIG_INT", ":", "case", "NUM_BIG_DECIMAL", ":", "{", "sce", "=", "strictContextExpression", "(", "true", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "returnAST", ")", ";", "break", ";", "}", "case", "RPAREN", ":", "case", "SEMI", ":", "{", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "astFactory", ".", "create", "(", "EMPTY_STAT", ",", "\"EMPTY_STAT\"", ")", ")", ";", "}", "break", ";", "}", "default", ":", "{", "throw", "new", "NoViableAltException", "(", "LT", "(", "1", ")", ",", "getFilename", "(", ")", ")", ";", "}", "}", "}", "}", "else", "{", "break", "_loop511", ";", "}", "}", "while", "(", "true", ")", ";", "}", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "if", "(", "firstContainsDeclaration", "&&", "!", "hasClosureList", ")", "throw", "new", "NoViableAltException", "(", "declaration", ",", "getFilename", "(", ")", ")", ";", "}", "match", "(", "RPAREN", ")", ";", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "parenthesizedExpression_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "if", "(", "hasClosureList", ")", "{", "parenthesizedExpression_AST", "=", "(", "AST", ")", "astFactory", ".", "make", "(", "(", "new", "ASTArray", "(", "2", ")", ")", ".", "add", "(", "create", "(", "CLOSURE_LIST", ",", "\"CLOSURE_LIST\"", ",", "first", ",", "LT", "(", "1", ")", ")", ")", ".", "add", "(", "parenthesizedExpression_AST", ")", ")", ";", "}", "currentAST", ".", "root", "=", "parenthesizedExpression_AST", ";", "currentAST", ".", "child", "=", "parenthesizedExpression_AST", "!=", "null", "&&", "parenthesizedExpression_AST", ".", "getFirstChild", "(", ")", "!=", "null", "?", "parenthesizedExpression_AST", ".", "getFirstChild", "(", ")", ":", "parenthesizedExpression_AST", ";", "currentAST", ".", "advanceChildToEnd", "(", ")", ";", "}", "parenthesizedExpression_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "}", "catch", "(", "RecognitionException", "e", ")", "{", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "reportError", "(", "e", ")", ";", "parenthesizedExpression_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "}", "else", "{", "throw", "e", ";", "}", "}", "returnAST", "=", "parenthesizedExpression_AST", ";", "}", "public", "final", "void", "stringConstructorExpression", "(", ")", "throws", "RecognitionException", ",", "TokenStreamException", "{", "returnAST", "=", "null", ";", "ASTPair", "currentAST", "=", "new", "ASTPair", "(", ")", ";", "AST", "stringConstructorExpression_AST", "=", "null", ";", "Token", "cs", "=", "null", ";", "AST", "cs_AST", "=", "null", ";", "Token", "cm", "=", "null", ";", "AST", "cm_AST", "=", "null", ";", "Token", "ce", "=", "null", ";", "AST", "ce_AST", "=", "null", ";", "Token", "first", "=", "LT", "(", "1", ")", ";", "cs", "=", "LT", "(", "1", ")", ";", "cs_AST", "=", "astFactory", ".", "create", "(", "cs", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "cs_AST", ")", ";", "match", "(", "STRING_CTOR_START", ")", ";", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "cs_AST", ".", "setType", "(", "STRING_LITERAL", ")", ";", "}", "stringConstructorValuePart", "(", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "returnAST", ")", ";", "{", "_loop521", ":", "do", "{", "if", "(", "(", "LA", "(", "1", ")", "==", "STRING_CTOR_MIDDLE", ")", ")", "{", "cm", "=", "LT", "(", "1", ")", ";", "cm_AST", "=", "astFactory", ".", "create", "(", "cm", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "cm_AST", ")", ";", "match", "(", "STRING_CTOR_MIDDLE", ")", ";", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "cm_AST", ".", "setType", "(", "STRING_LITERAL", ")", ";", "}", "stringConstructorValuePart", "(", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "returnAST", ")", ";", "}", "else", "{", "break", "_loop521", ";", "}", "}", "while", "(", "true", ")", ";", "}", "ce", "=", "LT", "(", "1", ")", ";", "ce_AST", "=", "astFactory", ".", "create", "(", "ce", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "ce_AST", ")", ";", "match", "(", "STRING_CTOR_END", ")", ";", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "stringConstructorExpression_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "ce_AST", ".", "setType", "(", "STRING_LITERAL", ")", ";", "stringConstructorExpression_AST", "=", "(", "AST", ")", "astFactory", ".", "make", "(", "(", "new", "ASTArray", "(", "2", ")", ")", ".", "add", "(", "create", "(", "STRING_CONSTRUCTOR", ",", "\"\"", ",", "first", ",", "LT", "(", "1", ")", ")", ")", ".", "add", "(", "stringConstructorExpression_AST", ")", ")", ";", "currentAST", ".", "root", "=", "stringConstructorExpression_AST", ";", "currentAST", ".", "child", "=", "stringConstructorExpression_AST", "!=", "null", "&&", "stringConstructorExpression_AST", ".", "getFirstChild", "(", ")", "!=", "null", "?", "stringConstructorExpression_AST", ".", "getFirstChild", "(", ")", ":", "stringConstructorExpression_AST", ";", "currentAST", ".", "advanceChildToEnd", "(", ")", ";", "}", "stringConstructorExpression_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "returnAST", "=", "stringConstructorExpression_AST", ";", "}", "public", "final", "void", "logicalOrExpression", "(", "int", "lc_stmt", ")", "throws", "RecognitionException", ",", "TokenStreamException", "{", "returnAST", "=", "null", ";", "ASTPair", "currentAST", "=", "new", "ASTPair", "(", ")", ";", "AST", "logicalOrExpression_AST", "=", "null", ";", "logicalAndExpression", "(", "lc_stmt", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "returnAST", ")", ";", "{", "_loop437", ":", "do", "{", "if", "(", "(", "LA", "(", "1", ")", "==", "LOR", ")", ")", "{", "AST", "tmp282_AST", "=", "null", ";", "tmp282_AST", "=", "astFactory", ".", "create", "(", "LT", "(", "1", ")", ")", ";", "astFactory", ".", "makeASTRoot", "(", "currentAST", ",", "tmp282_AST", ")", ";", "match", "(", "LOR", ")", ";", "nls", "(", ")", ";", "logicalAndExpression", "(", "0", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "returnAST", ")", ";", "}", "else", "{", "break", "_loop437", ";", "}", "}", "while", "(", "true", ")", ";", "}", "logicalOrExpression_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "returnAST", "=", "logicalOrExpression_AST", ";", "}", "public", "final", "void", "logicalAndExpression", "(", "int", "lc_stmt", ")", "throws", "RecognitionException", ",", "TokenStreamException", "{", "returnAST", "=", "null", ";", "ASTPair", "currentAST", "=", "new", "ASTPair", "(", ")", ";", "AST", "logicalAndExpression_AST", "=", "null", ";", "inclusiveOrExpression", "(", "lc_stmt", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "returnAST", ")", ";", "{", "_loop440", ":", "do", "{", "if", "(", "(", "LA", "(", "1", ")", "==", "LAND", ")", ")", "{", "AST", "tmp283_AST", "=", "null", ";", "tmp283_AST", "=", "astFactory", ".", "create", "(", "LT", "(", "1", ")", ")", ";", "astFactory", ".", "makeASTRoot", "(", "currentAST", ",", "tmp283_AST", ")", ";", "match", "(", "LAND", ")", ";", "nls", "(", ")", ";", "inclusiveOrExpression", "(", "0", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "returnAST", ")", ";", "}", "else", "{", "break", "_loop440", ";", "}", "}", "while", "(", "true", ")", ";", "}", "logicalAndExpression_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "returnAST", "=", "logicalAndExpression_AST", ";", "}", "public", "final", "void", "inclusiveOrExpression", "(", "int", "lc_stmt", ")", "throws", "RecognitionException", ",", "TokenStreamException", "{", "returnAST", "=", "null", ";", "ASTPair", "currentAST", "=", "new", "ASTPair", "(", ")", ";", "AST", "inclusiveOrExpression_AST", "=", "null", ";", "exclusiveOrExpression", "(", "lc_stmt", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "returnAST", ")", ";", "{", "_loop443", ":", "do", "{", "if", "(", "(", "LA", "(", "1", ")", "==", "BOR", ")", ")", "{", "AST", "tmp284_AST", "=", "null", ";", "tmp284_AST", "=", "astFactory", ".", "create", "(", "LT", "(", "1", ")", ")", ";", "astFactory", ".", "makeASTRoot", "(", "currentAST", ",", "tmp284_AST", ")", ";", "match", "(", "BOR", ")", ";", "nls", "(", ")", ";", "exclusiveOrExpression", "(", "0", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "returnAST", ")", ";", "}", "else", "{", "break", "_loop443", ";", "}", "}", "while", "(", "true", ")", ";", "}", "inclusiveOrExpression_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "returnAST", "=", "inclusiveOrExpression_AST", ";", "}", "public", "final", "void", "exclusiveOrExpression", "(", "int", "lc_stmt", ")", "throws", "RecognitionException", ",", "TokenStreamException", "{", "returnAST", "=", "null", ";", "ASTPair", "currentAST", "=", "new", "ASTPair", "(", ")", ";", "AST", "exclusiveOrExpression_AST", "=", "null", ";", "andExpression", "(", "lc_stmt", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "returnAST", ")", ";", "{", "_loop446", ":", "do", "{", "if", "(", "(", "LA", "(", "1", ")", "==", "BXOR", ")", ")", "{", "AST", "tmp285_AST", "=", "null", ";", "tmp285_AST", "=", "astFactory", ".", "create", "(", "LT", "(", "1", ")", ")", ";", "astFactory", ".", "makeASTRoot", "(", "currentAST", ",", "tmp285_AST", ")", ";", "match", "(", "BXOR", ")", ";", "nls", "(", ")", ";", "andExpression", "(", "0", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "returnAST", ")", ";", "}", "else", "{", "break", "_loop446", ";", "}", "}", "while", "(", "true", ")", ";", "}", "exclusiveOrExpression_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "returnAST", "=", "exclusiveOrExpression_AST", ";", "}", "public", "final", "void", "andExpression", "(", "int", "lc_stmt", ")", "throws", "RecognitionException", ",", "TokenStreamException", "{", "returnAST", "=", "null", ";", "ASTPair", "currentAST", "=", "new", "ASTPair", "(", ")", ";", "AST", "andExpression_AST", "=", "null", ";", "regexExpression", "(", "lc_stmt", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "returnAST", ")", ";", "{", "_loop449", ":", "do", "{", "if", "(", "(", "LA", "(", "1", ")", "==", "BAND", ")", ")", "{", "AST", "tmp286_AST", "=", "null", ";", "tmp286_AST", "=", "astFactory", ".", "create", "(", "LT", "(", "1", ")", ")", ";", "astFactory", ".", "makeASTRoot", "(", "currentAST", ",", "tmp286_AST", ")", ";", "match", "(", "BAND", ")", ";", "nls", "(", ")", ";", "regexExpression", "(", "0", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "returnAST", ")", ";", "}", "else", "{", "break", "_loop449", ";", "}", "}", "while", "(", "true", ")", ";", "}", "andExpression_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "returnAST", "=", "andExpression_AST", ";", "}", "public", "final", "void", "regexExpression", "(", "int", "lc_stmt", ")", "throws", "RecognitionException", ",", "TokenStreamException", "{", "returnAST", "=", "null", ";", "ASTPair", "currentAST", "=", "new", "ASTPair", "(", ")", ";", "AST", "regexExpression_AST", "=", "null", ";", "equalityExpression", "(", "lc_stmt", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "returnAST", ")", ";", "{", "_loop453", ":", "do", "{", "if", "(", "(", "LA", "(", "1", ")", "==", "REGEX_FIND", "||", "LA", "(", "1", ")", "==", "REGEX_MATCH", ")", ")", "{", "{", "switch", "(", "LA", "(", "1", ")", ")", "{", "case", "REGEX_FIND", ":", "{", "AST", "tmp287_AST", "=", "null", ";", "tmp287_AST", "=", "astFactory", ".", "create", "(", "LT", "(", "1", ")", ")", ";", "astFactory", ".", "makeASTRoot", "(", "currentAST", ",", "tmp287_AST", ")", ";", "match", "(", "REGEX_FIND", ")", ";", "break", ";", "}", "case", "REGEX_MATCH", ":", "{", "AST", "tmp288_AST", "=", "null", ";", "tmp288_AST", "=", "astFactory", ".", "create", "(", "LT", "(", "1", ")", ")", ";", "astFactory", ".", "makeASTRoot", "(", "currentAST", ",", "tmp288_AST", ")", ";", "match", "(", "REGEX_MATCH", ")", ";", "break", ";", "}", "default", ":", "{", "throw", "new", "NoViableAltException", "(", "LT", "(", "1", ")", ",", "getFilename", "(", ")", ")", ";", "}", "}", "}", "nls", "(", ")", ";", "equalityExpression", "(", "0", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "returnAST", ")", ";", "}", "else", "{", "break", "_loop453", ";", "}", "}", "while", "(", "true", ")", ";", "}", "regexExpression_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "returnAST", "=", "regexExpression_AST", ";", "}", "public", "final", "void", "equalityExpression", "(", "int", "lc_stmt", ")", "throws", "RecognitionException", ",", "TokenStreamException", "{", "returnAST", "=", "null", ";", "ASTPair", "currentAST", "=", "new", "ASTPair", "(", ")", ";", "AST", "equalityExpression_AST", "=", "null", ";", "relationalExpression", "(", "lc_stmt", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "returnAST", ")", ";", "{", "_loop457", ":", "do", "{", "if", "(", "(", "(", "LA", "(", "1", ")", ">=", "NOT_EQUAL", "&&", "LA", "(", "1", ")", "<=", "COMPARE_TO", ")", ")", ")", "{", "{", "switch", "(", "LA", "(", "1", ")", ")", "{", "case", "NOT_EQUAL", ":", "{", "AST", "tmp289_AST", "=", "null", ";", "tmp289_AST", "=", "astFactory", ".", "create", "(", "LT", "(", "1", ")", ")", ";", "astFactory", ".", "makeASTRoot", "(", "currentAST", ",", "tmp289_AST", ")", ";", "match", "(", "NOT_EQUAL", ")", ";", "break", ";", "}", "case", "EQUAL", ":", "{", "AST", "tmp290_AST", "=", "null", ";", "tmp290_AST", "=", "astFactory", ".", "create", "(", "LT", "(", "1", ")", ")", ";", "astFactory", ".", "makeASTRoot", "(", "currentAST", ",", "tmp290_AST", ")", ";", "match", "(", "EQUAL", ")", ";", "break", ";", "}", "case", "IDENTICAL", ":", "{", "AST", "tmp291_AST", "=", "null", ";", "tmp291_AST", "=", "astFactory", ".", "create", "(", "LT", "(", "1", ")", ")", ";", "astFactory", ".", "makeASTRoot", "(", "currentAST", ",", "tmp291_AST", ")", ";", "match", "(", "IDENTICAL", ")", ";", "break", ";", "}", "case", "NOT_IDENTICAL", ":", "{", "AST", "tmp292_AST", "=", "null", ";", "tmp292_AST", "=", "astFactory", ".", "create", "(", "LT", "(", "1", ")", ")", ";", "astFactory", ".", "makeASTRoot", "(", "currentAST", ",", "tmp292_AST", ")", ";", "match", "(", "NOT_IDENTICAL", ")", ";", "break", ";", "}", "case", "COMPARE_TO", ":", "{", "AST", "tmp293_AST", "=", "null", ";", "tmp293_AST", "=", "astFactory", ".", "create", "(", "LT", "(", "1", ")", ")", ";", "astFactory", ".", "makeASTRoot", "(", "currentAST", ",", "tmp293_AST", ")", ";", "match", "(", "COMPARE_TO", ")", ";", "break", ";", "}", "default", ":", "{", "throw", "new", "NoViableAltException", "(", "LT", "(", "1", ")", ",", "getFilename", "(", ")", ")", ";", "}", "}", "}", "nls", "(", ")", ";", "relationalExpression", "(", "0", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "returnAST", ")", ";", "}", "else", "{", "break", "_loop457", ";", "}", "}", "while", "(", "true", ")", ";", "}", "equalityExpression_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "returnAST", "=", "equalityExpression_AST", ";", "}", "public", "final", "void", "relationalExpression", "(", "int", "lc_stmt", ")", "throws", "RecognitionException", ",", "TokenStreamException", "{", "returnAST", "=", "null", ";", "ASTPair", "currentAST", "=", "new", "ASTPair", "(", ")", ";", "AST", "relationalExpression_AST", "=", "null", ";", "shiftExpression", "(", "lc_stmt", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "returnAST", ")", ";", "{", "if", "(", "(", "_tokenSet_99", ".", "member", "(", "LA", "(", "1", ")", ")", ")", "&&", "(", "_tokenSet_81", ".", "member", "(", "LA", "(", "2", ")", ")", ")", ")", "{", "{", "{", "switch", "(", "LA", "(", "1", ")", ")", "{", "case", "LT", ":", "{", "AST", "tmp294_AST", "=", "null", ";", "tmp294_AST", "=", "astFactory", ".", "create", "(", "LT", "(", "1", ")", ")", ";", "astFactory", ".", "makeASTRoot", "(", "currentAST", ",", "tmp294_AST", ")", ";", "match", "(", "LT", ")", ";", "break", ";", "}", "case", "GT", ":", "{", "AST", "tmp295_AST", "=", "null", ";", "tmp295_AST", "=", "astFactory", ".", "create", "(", "LT", "(", "1", ")", ")", ";", "astFactory", ".", "makeASTRoot", "(", "currentAST", ",", "tmp295_AST", ")", ";", "match", "(", "GT", ")", ";", "break", ";", "}", "case", "LE", ":", "{", "AST", "tmp296_AST", "=", "null", ";", "tmp296_AST", "=", "astFactory", ".", "create", "(", "LT", "(", "1", ")", ")", ";", "astFactory", ".", "makeASTRoot", "(", "currentAST", ",", "tmp296_AST", ")", ";", "match", "(", "LE", ")", ";", "break", ";", "}", "case", "GE", ":", "{", "AST", "tmp297_AST", "=", "null", ";", "tmp297_AST", "=", "astFactory", ".", "create", "(", "LT", "(", "1", ")", ")", ";", "astFactory", ".", "makeASTRoot", "(", "currentAST", ",", "tmp297_AST", ")", ";", "match", "(", "GE", ")", ";", "break", ";", "}", "case", "LITERAL_in", ":", "{", "AST", "tmp298_AST", "=", "null", ";", "tmp298_AST", "=", "astFactory", ".", "create", "(", "LT", "(", "1", ")", ")", ";", "astFactory", ".", "makeASTRoot", "(", "currentAST", ",", "tmp298_AST", ")", ";", "match", "(", "LITERAL_in", ")", ";", "break", ";", "}", "default", ":", "{", "throw", "new", "NoViableAltException", "(", "LT", "(", "1", ")", ",", "getFilename", "(", ")", ")", ";", "}", "}", "}", "nls", "(", ")", ";", "shiftExpression", "(", "0", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "returnAST", ")", ";", "}", "}", "else", "if", "(", "(", "LA", "(", "1", ")", "==", "LITERAL_instanceof", ")", "&&", "(", "_tokenSet_100", ".", "member", "(", "LA", "(", "2", ")", ")", ")", ")", "{", "AST", "tmp299_AST", "=", "null", ";", "tmp299_AST", "=", "astFactory", ".", "create", "(", "LT", "(", "1", ")", ")", ";", "astFactory", ".", "makeASTRoot", "(", "currentAST", ",", "tmp299_AST", ")", ";", "match", "(", "LITERAL_instanceof", ")", ";", "nls", "(", ")", ";", "typeSpec", "(", "true", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "returnAST", ")", ";", "}", "else", "if", "(", "(", "LA", "(", "1", ")", "==", "LITERAL_as", ")", "&&", "(", "_tokenSet_100", ".", "member", "(", "LA", "(", "2", ")", ")", ")", ")", "{", "AST", "tmp300_AST", "=", "null", ";", "tmp300_AST", "=", "astFactory", ".", "create", "(", "LT", "(", "1", ")", ")", ";", "astFactory", ".", "makeASTRoot", "(", "currentAST", ",", "tmp300_AST", ")", ";", "match", "(", "LITERAL_as", ")", ";", "nls", "(", ")", ";", "typeSpec", "(", "true", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "returnAST", ")", ";", "}", "else", "if", "(", "(", "_tokenSet_101", ".", "member", "(", "LA", "(", "1", ")", ")", ")", "&&", "(", "_tokenSet_71", ".", "member", "(", "LA", "(", "2", ")", ")", ")", ")", "{", "}", "else", "{", "throw", "new", "NoViableAltException", "(", "LT", "(", "1", ")", ",", "getFilename", "(", ")", ")", ";", "}", "}", "relationalExpression_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "returnAST", "=", "relationalExpression_AST", ";", "}", "public", "final", "void", "additiveExpression", "(", "int", "lc_stmt", ")", "throws", "RecognitionException", ",", "TokenStreamException", "{", "returnAST", "=", "null", ";", "ASTPair", "currentAST", "=", "new", "ASTPair", "(", ")", ";", "AST", "additiveExpression_AST", "=", "null", ";", "multiplicativeExpression", "(", "lc_stmt", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "returnAST", ")", ";", "{", "_loop470", ":", "do", "{", "if", "(", "(", "LA", "(", "1", ")", "==", "PLUS", "||", "LA", "(", "1", ")", "==", "MINUS", ")", "&&", "(", "_tokenSet_81", ".", "member", "(", "LA", "(", "2", ")", ")", ")", ")", "{", "{", "switch", "(", "LA", "(", "1", ")", ")", "{", "case", "PLUS", ":", "{", "AST", "tmp301_AST", "=", "null", ";", "tmp301_AST", "=", "astFactory", ".", "create", "(", "LT", "(", "1", ")", ")", ";", "astFactory", ".", "makeASTRoot", "(", "currentAST", ",", "tmp301_AST", ")", ";", "match", "(", "PLUS", ")", ";", "break", ";", "}", "case", "MINUS", ":", "{", "AST", "tmp302_AST", "=", "null", ";", "tmp302_AST", "=", "astFactory", ".", "create", "(", "LT", "(", "1", ")", ")", ";", "astFactory", ".", "makeASTRoot", "(", "currentAST", ",", "tmp302_AST", ")", ";", "match", "(", "MINUS", ")", ";", "break", ";", "}", "default", ":", "{", "throw", "new", "NoViableAltException", "(", "LT", "(", "1", ")", ",", "getFilename", "(", ")", ")", ";", "}", "}", "}", "nls", "(", ")", ";", "multiplicativeExpression", "(", "0", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "returnAST", ")", ";", "}", "else", "{", "break", "_loop470", ";", "}", "}", "while", "(", "true", ")", ";", "}", "additiveExpression_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "returnAST", "=", "additiveExpression_AST", ";", "}", "public", "final", "void", "multiplicativeExpression", "(", "int", "lc_stmt", ")", "throws", "RecognitionException", ",", "TokenStreamException", "{", "returnAST", "=", "null", ";", "ASTPair", "currentAST", "=", "new", "ASTPair", "(", ")", ";", "AST", "multiplicativeExpression_AST", "=", "null", ";", "switch", "(", "LA", "(", "1", ")", ")", "{", "case", "INC", ":", "{", "{", "AST", "tmp303_AST", "=", "null", ";", "tmp303_AST", "=", "astFactory", ".", "create", "(", "LT", "(", "1", ")", ")", ";", "astFactory", ".", "makeASTRoot", "(", "currentAST", ",", "tmp303_AST", ")", ";", "match", "(", "INC", ")", ";", "nls", "(", ")", ";", "powerExpressionNotPlusMinus", "(", "0", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "returnAST", ")", ";", "{", "_loop475", ":", "do", "{", "if", "(", "(", "_tokenSet_102", ".", "member", "(", "LA", "(", "1", ")", ")", ")", ")", "{", "{", "switch", "(", "LA", "(", "1", ")", ")", "{", "case", "STAR", ":", "{", "AST", "tmp304_AST", "=", "null", ";", "tmp304_AST", "=", "astFactory", ".", "create", "(", "LT", "(", "1", ")", ")", ";", "astFactory", ".", "makeASTRoot", "(", "currentAST", ",", "tmp304_AST", ")", ";", "match", "(", "STAR", ")", ";", "break", ";", "}", "case", "DIV", ":", "{", "AST", "tmp305_AST", "=", "null", ";", "tmp305_AST", "=", "astFactory", ".", "create", "(", "LT", "(", "1", ")", ")", ";", "astFactory", ".", "makeASTRoot", "(", "currentAST", ",", "tmp305_AST", ")", ";", "match", "(", "DIV", ")", ";", "break", ";", "}", "case", "MOD", ":", "{", "AST", "tmp306_AST", "=", "null", ";", "tmp306_AST", "=", "astFactory", ".", "create", "(", "LT", "(", "1", ")", ")", ";", "astFactory", ".", "makeASTRoot", "(", "currentAST", ",", "tmp306_AST", ")", ";", "match", "(", "MOD", ")", ";", "break", ";", "}", "default", ":", "{", "throw", "new", "NoViableAltException", "(", "LT", "(", "1", ")", ",", "getFilename", "(", ")", ")", ";", "}", "}", "}", "nls", "(", ")", ";", "powerExpression", "(", "0", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "returnAST", ")", ";", "}", "else", "{", "break", "_loop475", ";", "}", "}", "while", "(", "true", ")", ";", "}", "}", "multiplicativeExpression_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "break", ";", "}", "case", "DEC", ":", "{", "{", "AST", "tmp307_AST", "=", "null", ";", "tmp307_AST", "=", "astFactory", ".", "create", "(", "LT", "(", "1", ")", ")", ";", "astFactory", ".", "makeASTRoot", "(", "currentAST", ",", "tmp307_AST", ")", ";", "match", "(", "DEC", ")", ";", "nls", "(", ")", ";", "powerExpressionNotPlusMinus", "(", "0", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "returnAST", ")", ";", "{", "_loop479", ":", "do", "{", "if", "(", "(", "_tokenSet_102", ".", "member", "(", "LA", "(", "1", ")", ")", ")", ")", "{", "{", "switch", "(", "LA", "(", "1", ")", ")", "{", "case", "STAR", ":", "{", "AST", "tmp308_AST", "=", "null", ";", "tmp308_AST", "=", "astFactory", ".", "create", "(", "LT", "(", "1", ")", ")", ";", "astFactory", ".", "makeASTRoot", "(", "currentAST", ",", "tmp308_AST", ")", ";", "match", "(", "STAR", ")", ";", "break", ";", "}", "case", "DIV", ":", "{", "AST", "tmp309_AST", "=", "null", ";", "tmp309_AST", "=", "astFactory", ".", "create", "(", "LT", "(", "1", ")", ")", ";", "astFactory", ".", "makeASTRoot", "(", "currentAST", ",", "tmp309_AST", ")", ";", "match", "(", "DIV", ")", ";", "break", ";", "}", "case", "MOD", ":", "{", "AST", "tmp310_AST", "=", "null", ";", "tmp310_AST", "=", "astFactory", ".", "create", "(", "LT", "(", "1", ")", ")", ";", "astFactory", ".", "makeASTRoot", "(", "currentAST", ",", "tmp310_AST", ")", ";", "match", "(", "MOD", ")", ";", "break", ";", "}", "default", ":", "{", "throw", "new", "NoViableAltException", "(", "LT", "(", "1", ")", ",", "getFilename", "(", ")", ")", ";", "}", "}", "}", "nls", "(", ")", ";", "powerExpression", "(", "0", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "returnAST", ")", ";", "}", "else", "{", "break", "_loop479", ";", "}", "}", "while", "(", "true", ")", ";", "}", "}", "multiplicativeExpression_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "break", ";", "}", "case", "MINUS", ":", "{", "{", "AST", "tmp311_AST", "=", "null", ";", "tmp311_AST", "=", "astFactory", ".", "create", "(", "LT", "(", "1", ")", ")", ";", "astFactory", ".", "makeASTRoot", "(", "currentAST", ",", "tmp311_AST", ")", ";", "match", "(", "MINUS", ")", ";", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "tmp311_AST", ".", "setType", "(", "UNARY_MINUS", ")", ";", "}", "nls", "(", ")", ";", "powerExpressionNotPlusMinus", "(", "0", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "returnAST", ")", ";", "{", "_loop483", ":", "do", "{", "if", "(", "(", "_tokenSet_102", ".", "member", "(", "LA", "(", "1", ")", ")", ")", ")", "{", "{", "switch", "(", "LA", "(", "1", ")", ")", "{", "case", "STAR", ":", "{", "AST", "tmp312_AST", "=", "null", ";", "tmp312_AST", "=", "astFactory", ".", "create", "(", "LT", "(", "1", ")", ")", ";", "astFactory", ".", "makeASTRoot", "(", "currentAST", ",", "tmp312_AST", ")", ";", "match", "(", "STAR", ")", ";", "break", ";", "}", "case", "DIV", ":", "{", "AST", "tmp313_AST", "=", "null", ";", "tmp313_AST", "=", "astFactory", ".", "create", "(", "LT", "(", "1", ")", ")", ";", "astFactory", ".", "makeASTRoot", "(", "currentAST", ",", "tmp313_AST", ")", ";", "match", "(", "DIV", ")", ";", "break", ";", "}", "case", "MOD", ":", "{", "AST", "tmp314_AST", "=", "null", ";", "tmp314_AST", "=", "astFactory", ".", "create", "(", "LT", "(", "1", ")", ")", ";", "astFactory", ".", "makeASTRoot", "(", "currentAST", ",", "tmp314_AST", ")", ";", "match", "(", "MOD", ")", ";", "break", ";", "}", "default", ":", "{", "throw", "new", "NoViableAltException", "(", "LT", "(", "1", ")", ",", "getFilename", "(", ")", ")", ";", "}", "}", "}", "nls", "(", ")", ";", "powerExpression", "(", "0", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "returnAST", ")", ";", "}", "else", "{", "break", "_loop483", ";", "}", "}", "while", "(", "true", ")", ";", "}", "}", "multiplicativeExpression_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "break", ";", "}", "case", "PLUS", ":", "{", "{", "AST", "tmp315_AST", "=", "null", ";", "tmp315_AST", "=", "astFactory", ".", "create", "(", "LT", "(", "1", ")", ")", ";", "astFactory", ".", "makeASTRoot", "(", "currentAST", ",", "tmp315_AST", ")", ";", "match", "(", "PLUS", ")", ";", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "tmp315_AST", ".", "setType", "(", "UNARY_PLUS", ")", ";", "}", "nls", "(", ")", ";", "powerExpressionNotPlusMinus", "(", "0", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "returnAST", ")", ";", "{", "_loop487", ":", "do", "{", "if", "(", "(", "_tokenSet_102", ".", "member", "(", "LA", "(", "1", ")", ")", ")", ")", "{", "{", "switch", "(", "LA", "(", "1", ")", ")", "{", "case", "STAR", ":", "{", "AST", "tmp316_AST", "=", "null", ";", "tmp316_AST", "=", "astFactory", ".", "create", "(", "LT", "(", "1", ")", ")", ";", "astFactory", ".", "makeASTRoot", "(", "currentAST", ",", "tmp316_AST", ")", ";", "match", "(", "STAR", ")", ";", "break", ";", "}", "case", "DIV", ":", "{", "AST", "tmp317_AST", "=", "null", ";", "tmp317_AST", "=", "astFactory", ".", "create", "(", "LT", "(", "1", ")", ")", ";", "astFactory", ".", "makeASTRoot", "(", "currentAST", ",", "tmp317_AST", ")", ";", "match", "(", "DIV", ")", ";", "break", ";", "}", "case", "MOD", ":", "{", "AST", "tmp318_AST", "=", "null", ";", "tmp318_AST", "=", "astFactory", ".", "create", "(", "LT", "(", "1", ")", ")", ";", "astFactory", ".", "makeASTRoot", "(", "currentAST", ",", "tmp318_AST", ")", ";", "match", "(", "MOD", ")", ";", "break", ";", "}", "default", ":", "{", "throw", "new", "NoViableAltException", "(", "LT", "(", "1", ")", ",", "getFilename", "(", ")", ")", ";", "}", "}", "}", "nls", "(", ")", ";", "powerExpression", "(", "0", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "returnAST", ")", ";", "}", "else", "{", "break", "_loop487", ";", "}", "}", "while", "(", "true", ")", ";", "}", "}", "multiplicativeExpression_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "break", ";", "}", "case", "LBRACK", ":", "case", "IDENT", ":", "case", "STRING_LITERAL", ":", "case", "LPAREN", ":", "case", "LITERAL_super", ":", "case", "LITERAL_void", ":", "case", "LITERAL_boolean", ":", "case", "LITERAL_byte", ":", "case", "LITERAL_char", ":", "case", "LITERAL_short", ":", "case", "LITERAL_int", ":", "case", "LITERAL_float", ":", "case", "LITERAL_long", ":", "case", "LITERAL_double", ":", "case", "LCURLY", ":", "case", "LITERAL_this", ":", "case", "LITERAL_false", ":", "case", "LITERAL_new", ":", "case", "LITERAL_null", ":", "case", "LITERAL_true", ":", "case", "BNOT", ":", "case", "LNOT", ":", "case", "STRING_CTOR_START", ":", "case", "NUM_INT", ":", "case", "NUM_FLOAT", ":", "case", "NUM_LONG", ":", "case", "NUM_DOUBLE", ":", "case", "NUM_BIG_INT", ":", "case", "NUM_BIG_DECIMAL", ":", "{", "{", "powerExpressionNotPlusMinus", "(", "lc_stmt", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "returnAST", ")", ";", "{", "_loop491", ":", "do", "{", "if", "(", "(", "_tokenSet_102", ".", "member", "(", "LA", "(", "1", ")", ")", ")", ")", "{", "{", "switch", "(", "LA", "(", "1", ")", ")", "{", "case", "STAR", ":", "{", "AST", "tmp319_AST", "=", "null", ";", "tmp319_AST", "=", "astFactory", ".", "create", "(", "LT", "(", "1", ")", ")", ";", "astFactory", ".", "makeASTRoot", "(", "currentAST", ",", "tmp319_AST", ")", ";", "match", "(", "STAR", ")", ";", "break", ";", "}", "case", "DIV", ":", "{", "AST", "tmp320_AST", "=", "null", ";", "tmp320_AST", "=", "astFactory", ".", "create", "(", "LT", "(", "1", ")", ")", ";", "astFactory", ".", "makeASTRoot", "(", "currentAST", ",", "tmp320_AST", ")", ";", "match", "(", "DIV", ")", ";", "break", ";", "}", "case", "MOD", ":", "{", "AST", "tmp321_AST", "=", "null", ";", "tmp321_AST", "=", "astFactory", ".", "create", "(", "LT", "(", "1", ")", ")", ";", "astFactory", ".", "makeASTRoot", "(", "currentAST", ",", "tmp321_AST", ")", ";", "match", "(", "MOD", ")", ";", "break", ";", "}", "default", ":", "{", "throw", "new", "NoViableAltException", "(", "LT", "(", "1", ")", ",", "getFilename", "(", ")", ")", ";", "}", "}", "}", "nls", "(", ")", ";", "powerExpression", "(", "0", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "returnAST", ")", ";", "}", "else", "{", "break", "_loop491", ";", "}", "}", "while", "(", "true", ")", ";", "}", "}", "multiplicativeExpression_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "break", ";", "}", "default", ":", "{", "throw", "new", "NoViableAltException", "(", "LT", "(", "1", ")", ",", "getFilename", "(", ")", ")", ";", "}", "}", "returnAST", "=", "multiplicativeExpression_AST", ";", "}", "public", "final", "void", "powerExpressionNotPlusMinus", "(", "int", "lc_stmt", ")", "throws", "RecognitionException", ",", "TokenStreamException", "{", "returnAST", "=", "null", ";", "ASTPair", "currentAST", "=", "new", "ASTPair", "(", ")", ";", "AST", "powerExpressionNotPlusMinus_AST", "=", "null", ";", "unaryExpressionNotPlusMinus", "(", "lc_stmt", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "returnAST", ")", ";", "{", "_loop497", ":", "do", "{", "if", "(", "(", "LA", "(", "1", ")", "==", "STAR_STAR", ")", ")", "{", "AST", "tmp322_AST", "=", "null", ";", "tmp322_AST", "=", "astFactory", ".", "create", "(", "LT", "(", "1", ")", ")", ";", "astFactory", ".", "makeASTRoot", "(", "currentAST", ",", "tmp322_AST", ")", ";", "match", "(", "STAR_STAR", ")", ";", "nls", "(", ")", ";", "unaryExpression", "(", "0", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "returnAST", ")", ";", "}", "else", "{", "break", "_loop497", ";", "}", "}", "while", "(", "true", ")", ";", "}", "powerExpressionNotPlusMinus_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "returnAST", "=", "powerExpressionNotPlusMinus_AST", ";", "}", "public", "final", "void", "powerExpression", "(", "int", "lc_stmt", ")", "throws", "RecognitionException", ",", "TokenStreamException", "{", "returnAST", "=", "null", ";", "ASTPair", "currentAST", "=", "new", "ASTPair", "(", ")", ";", "AST", "powerExpression_AST", "=", "null", ";", "unaryExpression", "(", "lc_stmt", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "returnAST", ")", ";", "{", "_loop494", ":", "do", "{", "if", "(", "(", "LA", "(", "1", ")", "==", "STAR_STAR", ")", ")", "{", "AST", "tmp323_AST", "=", "null", ";", "tmp323_AST", "=", "astFactory", ".", "create", "(", "LT", "(", "1", ")", ")", ";", "astFactory", ".", "makeASTRoot", "(", "currentAST", ",", "tmp323_AST", ")", ";", "match", "(", "STAR_STAR", ")", ";", "nls", "(", ")", ";", "unaryExpression", "(", "0", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "returnAST", ")", ";", "}", "else", "{", "break", "_loop494", ";", "}", "}", "while", "(", "true", ")", ";", "}", "powerExpression_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "returnAST", "=", "powerExpression_AST", ";", "}", "public", "final", "void", "unaryExpression", "(", "int", "lc_stmt", ")", "throws", "RecognitionException", ",", "TokenStreamException", "{", "returnAST", "=", "null", ";", "ASTPair", "currentAST", "=", "new", "ASTPair", "(", ")", ";", "AST", "unaryExpression_AST", "=", "null", ";", "switch", "(", "LA", "(", "1", ")", ")", "{", "case", "INC", ":", "{", "AST", "tmp324_AST", "=", "null", ";", "tmp324_AST", "=", "astFactory", ".", "create", "(", "LT", "(", "1", ")", ")", ";", "astFactory", ".", "makeASTRoot", "(", "currentAST", ",", "tmp324_AST", ")", ";", "match", "(", "INC", ")", ";", "nls", "(", ")", ";", "unaryExpression", "(", "0", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "returnAST", ")", ";", "unaryExpression_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "break", ";", "}", "case", "DEC", ":", "{", "AST", "tmp325_AST", "=", "null", ";", "tmp325_AST", "=", "astFactory", ".", "create", "(", "LT", "(", "1", ")", ")", ";", "astFactory", ".", "makeASTRoot", "(", "currentAST", ",", "tmp325_AST", ")", ";", "match", "(", "DEC", ")", ";", "nls", "(", ")", ";", "unaryExpression", "(", "0", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "returnAST", ")", ";", "unaryExpression_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "break", ";", "}", "case", "MINUS", ":", "{", "AST", "tmp326_AST", "=", "null", ";", "tmp326_AST", "=", "astFactory", ".", "create", "(", "LT", "(", "1", ")", ")", ";", "astFactory", ".", "makeASTRoot", "(", "currentAST", ",", "tmp326_AST", ")", ";", "match", "(", "MINUS", ")", ";", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "tmp326_AST", ".", "setType", "(", "UNARY_MINUS", ")", ";", "}", "nls", "(", ")", ";", "unaryExpression", "(", "0", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "returnAST", ")", ";", "unaryExpression_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "break", ";", "}", "case", "PLUS", ":", "{", "AST", "tmp327_AST", "=", "null", ";", "tmp327_AST", "=", "astFactory", ".", "create", "(", "LT", "(", "1", ")", ")", ";", "astFactory", ".", "makeASTRoot", "(", "currentAST", ",", "tmp327_AST", ")", ";", "match", "(", "PLUS", ")", ";", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "tmp327_AST", ".", "setType", "(", "UNARY_PLUS", ")", ";", "}", "nls", "(", ")", ";", "unaryExpression", "(", "0", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "returnAST", ")", ";", "unaryExpression_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "break", ";", "}", "case", "LBRACK", ":", "case", "IDENT", ":", "case", "STRING_LITERAL", ":", "case", "LPAREN", ":", "case", "LITERAL_super", ":", "case", "LITERAL_void", ":", "case", "LITERAL_boolean", ":", "case", "LITERAL_byte", ":", "case", "LITERAL_char", ":", "case", "LITERAL_short", ":", "case", "LITERAL_int", ":", "case", "LITERAL_float", ":", "case", "LITERAL_long", ":", "case", "LITERAL_double", ":", "case", "LCURLY", ":", "case", "LITERAL_this", ":", "case", "LITERAL_false", ":", "case", "LITERAL_new", ":", "case", "LITERAL_null", ":", "case", "LITERAL_true", ":", "case", "BNOT", ":", "case", "LNOT", ":", "case", "STRING_CTOR_START", ":", "case", "NUM_INT", ":", "case", "NUM_FLOAT", ":", "case", "NUM_LONG", ":", "case", "NUM_DOUBLE", ":", "case", "NUM_BIG_INT", ":", "case", "NUM_BIG_DECIMAL", ":", "{", "unaryExpressionNotPlusMinus", "(", "lc_stmt", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "returnAST", ")", ";", "unaryExpression_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "break", ";", "}", "default", ":", "{", "throw", "new", "NoViableAltException", "(", "LT", "(", "1", ")", ",", "getFilename", "(", ")", ")", ";", "}", "}", "returnAST", "=", "unaryExpression_AST", ";", "}", "public", "final", "void", "unaryExpressionNotPlusMinus", "(", "int", "lc_stmt", ")", "throws", "RecognitionException", ",", "TokenStreamException", "{", "returnAST", "=", "null", ";", "ASTPair", "currentAST", "=", "new", "ASTPair", "(", ")", ";", "AST", "unaryExpressionNotPlusMinus_AST", "=", "null", ";", "Token", "lpb", "=", "null", ";", "AST", "lpb_AST", "=", "null", ";", "Token", "lp", "=", "null", ";", "AST", "lp_AST", "=", "null", ";", "switch", "(", "LA", "(", "1", ")", ")", "{", "case", "BNOT", ":", "{", "AST", "tmp328_AST", "=", "null", ";", "tmp328_AST", "=", "astFactory", ".", "create", "(", "LT", "(", "1", ")", ")", ";", "astFactory", ".", "makeASTRoot", "(", "currentAST", ",", "tmp328_AST", ")", ";", "match", "(", "BNOT", ")", ";", "nls", "(", ")", ";", "unaryExpression", "(", "0", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "returnAST", ")", ";", "unaryExpressionNotPlusMinus_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "break", ";", "}", "case", "LNOT", ":", "{", "AST", "tmp329_AST", "=", "null", ";", "tmp329_AST", "=", "astFactory", ".", "create", "(", "LT", "(", "1", ")", ")", ";", "astFactory", ".", "makeASTRoot", "(", "currentAST", ",", "tmp329_AST", ")", ";", "match", "(", "LNOT", ")", ";", "nls", "(", ")", ";", "unaryExpression", "(", "0", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "returnAST", ")", ";", "unaryExpressionNotPlusMinus_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "break", ";", "}", "case", "LBRACK", ":", "case", "IDENT", ":", "case", "STRING_LITERAL", ":", "case", "LPAREN", ":", "case", "LITERAL_super", ":", "case", "LITERAL_void", ":", "case", "LITERAL_boolean", ":", "case", "LITERAL_byte", ":", "case", "LITERAL_char", ":", "case", "LITERAL_short", ":", "case", "LITERAL_int", ":", "case", "LITERAL_float", ":", "case", "LITERAL_long", ":", "case", "LITERAL_double", ":", "case", "LCURLY", ":", "case", "LITERAL_this", ":", "case", "LITERAL_false", ":", "case", "LITERAL_new", ":", "case", "LITERAL_null", ":", "case", "LITERAL_true", ":", "case", "STRING_CTOR_START", ":", "case", "NUM_INT", ":", "case", "NUM_FLOAT", ":", "case", "NUM_LONG", ":", "case", "NUM_DOUBLE", ":", "case", "NUM_BIG_INT", ":", "case", "NUM_BIG_DECIMAL", ":", "{", "{", "boolean", "synPredMatched502", "=", "false", ";", "if", "(", "(", "(", "LA", "(", "1", ")", "==", "LPAREN", ")", "&&", "(", "(", "LA", "(", "2", ")", ">=", "LITERAL_void", "&&", "LA", "(", "2", ")", "<=", "LITERAL_double", ")", ")", ")", ")", "{", "int", "_m502", "=", "mark", "(", ")", ";", "synPredMatched502", "=", "true", ";", "inputState", ".", "guessing", "++", ";", "try", "{", "{", "match", "(", "LPAREN", ")", ";", "builtInTypeSpec", "(", "true", ")", ";", "match", "(", "RPAREN", ")", ";", "unaryExpression", "(", "0", ")", ";", "}", "}", "catch", "(", "RecognitionException", "pe", ")", "{", "synPredMatched502", "=", "false", ";", "}", "rewind", "(", "_m502", ")", ";", "inputState", ".", "guessing", "--", ";", "}", "if", "(", "synPredMatched502", ")", "{", "lpb", "=", "LT", "(", "1", ")", ";", "lpb_AST", "=", "astFactory", ".", "create", "(", "lpb", ")", ";", "astFactory", ".", "makeASTRoot", "(", "currentAST", ",", "lpb_AST", ")", ";", "match", "(", "LPAREN", ")", ";", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "lpb_AST", ".", "setType", "(", "TYPECAST", ")", ";", "}", "builtInTypeSpec", "(", "true", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "returnAST", ")", ";", "match", "(", "RPAREN", ")", ";", "unaryExpression", "(", "0", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "returnAST", ")", ";", "}", "else", "{", "boolean", "synPredMatched504", "=", "false", ";", "if", "(", "(", "(", "LA", "(", "1", ")", "==", "LPAREN", ")", "&&", "(", "LA", "(", "2", ")", "==", "IDENT", ")", ")", ")", "{", "int", "_m504", "=", "mark", "(", ")", ";", "synPredMatched504", "=", "true", ";", "inputState", ".", "guessing", "++", ";", "try", "{", "{", "match", "(", "LPAREN", ")", ";", "classTypeSpec", "(", "true", ")", ";", "match", "(", "RPAREN", ")", ";", "unaryExpressionNotPlusMinus", "(", "0", ")", ";", "}", "}", "catch", "(", "RecognitionException", "pe", ")", "{", "synPredMatched504", "=", "false", ";", "}", "rewind", "(", "_m504", ")", ";", "inputState", ".", "guessing", "--", ";", "}", "if", "(", "synPredMatched504", ")", "{", "lp", "=", "LT", "(", "1", ")", ";", "lp_AST", "=", "astFactory", ".", "create", "(", "lp", ")", ";", "astFactory", ".", "makeASTRoot", "(", "currentAST", ",", "lp_AST", ")", ";", "match", "(", "LPAREN", ")", ";", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "lp_AST", ".", "setType", "(", "TYPECAST", ")", ";", "}", "classTypeSpec", "(", "true", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "returnAST", ")", ";", "match", "(", "RPAREN", ")", ";", "unaryExpressionNotPlusMinus", "(", "0", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "returnAST", ")", ";", "}", "else", "if", "(", "(", "_tokenSet_87", ".", "member", "(", "LA", "(", "1", ")", ")", ")", "&&", "(", "_tokenSet_38", ".", "member", "(", "LA", "(", "2", ")", ")", ")", ")", "{", "postfixExpression", "(", "lc_stmt", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "returnAST", ")", ";", "}", "else", "{", "throw", "new", "NoViableAltException", "(", "LT", "(", "1", ")", ",", "getFilename", "(", ")", ")", ";", "}", "}", "}", "unaryExpressionNotPlusMinus_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "break", ";", "}", "default", ":", "{", "throw", "new", "NoViableAltException", "(", "LT", "(", "1", ")", ",", "getFilename", "(", ")", ")", ";", "}", "}", "returnAST", "=", "unaryExpressionNotPlusMinus_AST", ";", "}", "public", "final", "void", "postfixExpression", "(", "int", "lc_stmt", ")", "throws", "RecognitionException", ",", "TokenStreamException", "{", "returnAST", "=", "null", ";", "ASTPair", "currentAST", "=", "new", "ASTPair", "(", ")", ";", "AST", "postfixExpression_AST", "=", "null", ";", "Token", "in", "=", "null", ";", "AST", "in_AST", "=", "null", ";", "Token", "de", "=", "null", ";", "AST", "de_AST", "=", "null", ";", "pathExpression", "(", "lc_stmt", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "returnAST", ")", ";", "{", "if", "(", "(", "LA", "(", "1", ")", "==", "INC", ")", "&&", "(", "_tokenSet_103", ".", "member", "(", "LA", "(", "2", ")", ")", ")", ")", "{", "in", "=", "LT", "(", "1", ")", ";", "in_AST", "=", "astFactory", ".", "create", "(", "in", ")", ";", "astFactory", ".", "makeASTRoot", "(", "currentAST", ",", "in_AST", ")", ";", "match", "(", "INC", ")", ";", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "in_AST", ".", "setType", "(", "POST_INC", ")", ";", "}", "}", "else", "if", "(", "(", "LA", "(", "1", ")", "==", "DEC", ")", "&&", "(", "_tokenSet_103", ".", "member", "(", "LA", "(", "2", ")", ")", ")", ")", "{", "de", "=", "LT", "(", "1", ")", ";", "de_AST", "=", "astFactory", ".", "create", "(", "de", ")", ";", "astFactory", ".", "makeASTRoot", "(", "currentAST", ",", "de_AST", ")", ";", "match", "(", "DEC", ")", ";", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "de_AST", ".", "setType", "(", "POST_DEC", ")", ";", "}", "}", "else", "if", "(", "(", "_tokenSet_103", ".", "member", "(", "LA", "(", "1", ")", ")", ")", "&&", "(", "_tokenSet_71", ".", "member", "(", "LA", "(", "2", ")", ")", ")", ")", "{", "}", "else", "{", "throw", "new", "NoViableAltException", "(", "LT", "(", "1", ")", ",", "getFilename", "(", ")", ")", ";", "}", "}", "postfixExpression_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "returnAST", "=", "postfixExpression_AST", ";", "}", "public", "final", "void", "constant", "(", ")", "throws", "RecognitionException", ",", "TokenStreamException", "{", "returnAST", "=", "null", ";", "ASTPair", "currentAST", "=", "new", "ASTPair", "(", ")", ";", "AST", "constant_AST", "=", "null", ";", "switch", "(", "LA", "(", "1", ")", ")", "{", "case", "NUM_INT", ":", "case", "NUM_FLOAT", ":", "case", "NUM_LONG", ":", "case", "NUM_DOUBLE", ":", "case", "NUM_BIG_INT", ":", "case", "NUM_BIG_DECIMAL", ":", "{", "constantNumber", "(", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "returnAST", ")", ";", "constant_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "break", ";", "}", "case", "STRING_LITERAL", ":", "{", "AST", "tmp332_AST", "=", "null", ";", "tmp332_AST", "=", "astFactory", ".", "create", "(", "LT", "(", "1", ")", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "tmp332_AST", ")", ";", "match", "(", "STRING_LITERAL", ")", ";", "constant_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "break", ";", "}", "case", "LITERAL_true", ":", "{", "AST", "tmp333_AST", "=", "null", ";", "tmp333_AST", "=", "astFactory", ".", "create", "(", "LT", "(", "1", ")", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "tmp333_AST", ")", ";", "match", "(", "LITERAL_true", ")", ";", "constant_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "break", ";", "}", "case", "LITERAL_false", ":", "{", "AST", "tmp334_AST", "=", "null", ";", "tmp334_AST", "=", "astFactory", ".", "create", "(", "LT", "(", "1", ")", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "tmp334_AST", ")", ";", "match", "(", "LITERAL_false", ")", ";", "constant_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "break", ";", "}", "case", "LITERAL_null", ":", "{", "AST", "tmp335_AST", "=", "null", ";", "tmp335_AST", "=", "astFactory", ".", "create", "(", "LT", "(", "1", ")", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "tmp335_AST", ")", ";", "match", "(", "LITERAL_null", ")", ";", "constant_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "break", ";", "}", "default", ":", "{", "throw", "new", "NoViableAltException", "(", "LT", "(", "1", ")", ",", "getFilename", "(", ")", ")", ";", "}", "}", "returnAST", "=", "constant_AST", ";", "}", "public", "final", "void", "newExpression", "(", ")", "throws", "RecognitionException", ",", "TokenStreamException", "{", "returnAST", "=", "null", ";", "ASTPair", "currentAST", "=", "new", "ASTPair", "(", ")", ";", "AST", "newExpression_AST", "=", "null", ";", "AST", "ta_AST", "=", "null", ";", "AST", "t_AST", "=", "null", ";", "AST", "mca_AST", "=", "null", ";", "AST", "cb_AST", "=", "null", ";", "AST", "ad_AST", "=", "null", ";", "Token", "first", "=", "LT", "(", "1", ")", ";", "int", "jumpBack", "=", "mark", "(", ")", ";", "try", "{", "match", "(", "LITERAL_new", ")", ";", "nls", "(", ")", ";", "{", "switch", "(", "LA", "(", "1", ")", ")", "{", "case", "LT", ":", "{", "typeArguments", "(", ")", ";", "ta_AST", "=", "(", "AST", ")", "returnAST", ";", "break", ";", "}", "case", "LBRACK", ":", "case", "IDENT", ":", "case", "LPAREN", ":", "case", "LITERAL_void", ":", "case", "LITERAL_boolean", ":", "case", "LITERAL_byte", ":", "case", "LITERAL_char", ":", "case", "LITERAL_short", ":", "case", "LITERAL_int", ":", "case", "LITERAL_float", ":", "case", "LITERAL_long", ":", "case", "LITERAL_double", ":", "case", "NLS", ":", "{", "break", ";", "}", "default", ":", "{", "throw", "new", "NoViableAltException", "(", "LT", "(", "1", ")", ",", "getFilename", "(", ")", ")", ";", "}", "}", "}", "{", "switch", "(", "LA", "(", "1", ")", ")", "{", "case", "IDENT", ":", "case", "LITERAL_void", ":", "case", "LITERAL_boolean", ":", "case", "LITERAL_byte", ":", "case", "LITERAL_char", ":", "case", "LITERAL_short", ":", "case", "LITERAL_int", ":", "case", "LITERAL_float", ":", "case", "LITERAL_long", ":", "case", "LITERAL_double", ":", "{", "type", "(", ")", ";", "t_AST", "=", "(", "AST", ")", "returnAST", ";", "break", ";", "}", "case", "LBRACK", ":", "case", "LPAREN", ":", "case", "NLS", ":", "{", "break", ";", "}", "default", ":", "{", "throw", "new", "NoViableAltException", "(", "LT", "(", "1", ")", ",", "getFilename", "(", ")", ")", ";", "}", "}", "}", "{", "switch", "(", "LA", "(", "1", ")", ")", "{", "case", "LPAREN", ":", "case", "NLS", ":", "{", "nls", "(", ")", ";", "methodCallArgs", "(", "null", ")", ";", "mca_AST", "=", "(", "AST", ")", "returnAST", ";", "{", "if", "(", "(", "LA", "(", "1", ")", "==", "LCURLY", ")", "&&", "(", "_tokenSet_52", ".", "member", "(", "LA", "(", "2", ")", ")", ")", ")", "{", "classBlock", "(", ")", ";", "cb_AST", "=", "(", "AST", ")", "returnAST", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "returnAST", ")", ";", "}", "else", "if", "(", "(", "_tokenSet_98", ".", "member", "(", "LA", "(", "1", ")", ")", ")", "&&", "(", "_tokenSet_71", ".", "member", "(", "LA", "(", "2", ")", ")", ")", ")", "{", "}", "else", "{", "throw", "new", "NoViableAltException", "(", "LT", "(", "1", ")", ",", "getFilename", "(", ")", ")", ";", "}", "}", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "newExpression_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "mca_AST", "=", "mca_AST", ".", "getFirstChild", "(", ")", ";", "newExpression_AST", "=", "(", "AST", ")", "astFactory", ".", "make", "(", "(", "new", "ASTArray", "(", "5", ")", ")", ".", "add", "(", "create", "(", "LITERAL_new", ",", "\"new\"", ",", "first", ",", "LT", "(", "1", ")", ")", ")", ".", "add", "(", "ta_AST", ")", ".", "add", "(", "t_AST", ")", ".", "add", "(", "mca_AST", ")", ".", "add", "(", "cb_AST", ")", ")", ";", "currentAST", ".", "root", "=", "newExpression_AST", ";", "currentAST", ".", "child", "=", "newExpression_AST", "!=", "null", "&&", "newExpression_AST", ".", "getFirstChild", "(", ")", "!=", "null", "?", "newExpression_AST", ".", "getFirstChild", "(", ")", ":", "newExpression_AST", ";", "currentAST", ".", "advanceChildToEnd", "(", ")", ";", "}", "break", ";", "}", "case", "LBRACK", ":", "{", "newArrayDeclarator", "(", ")", ";", "ad_AST", "=", "(", "AST", ")", "returnAST", ";", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "newExpression_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "newExpression_AST", "=", "(", "AST", ")", "astFactory", ".", "make", "(", "(", "new", "ASTArray", "(", "4", ")", ")", ".", "add", "(", "create", "(", "LITERAL_new", ",", "\"new\"", ",", "first", ",", "LT", "(", "1", ")", ")", ")", ".", "add", "(", "ta_AST", ")", ".", "add", "(", "t_AST", ")", ".", "add", "(", "ad_AST", ")", ")", ";", "currentAST", ".", "root", "=", "newExpression_AST", ";", "currentAST", ".", "child", "=", "newExpression_AST", "!=", "null", "&&", "newExpression_AST", ".", "getFirstChild", "(", ")", "!=", "null", "?", "newExpression_AST", ".", "getFirstChild", "(", ")", ":", "newExpression_AST", ";", "currentAST", ".", "advanceChildToEnd", "(", ")", ";", "}", "break", ";", "}", "default", ":", "{", "throw", "new", "NoViableAltException", "(", "LT", "(", "1", ")", ",", "getFilename", "(", ")", ")", ";", "}", "}", "}", "newExpression_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "}", "catch", "(", "RecognitionException", "e", ")", "{", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "if", "(", "t_AST", "==", "null", ")", "{", "reportError", "(", "\"\"", ",", "first", ")", ";", "newExpression_AST", "=", "(", "AST", ")", "astFactory", ".", "make", "(", "(", "new", "ASTArray", "(", "3", ")", ")", ".", "add", "(", "create", "(", "LITERAL_new", ",", "\"new\"", ",", "first", ",", "LT", "(", "1", ")", ")", ")", ".", "add", "(", "ta_AST", ")", ".", "add", "(", "null", ")", ")", ";", "if", "(", "e", "instanceof", "MismatchedTokenException", "||", "e", "instanceof", "NoViableAltException", ")", "{", "rewind", "(", "jumpBack", ")", ";", "consumeUntil", "(", "NLS", ")", ";", "}", "}", "else", "if", "(", "mca_AST", "==", "null", "&&", "ad_AST", "==", "null", ")", "{", "reportError", "(", "\"\"", ",", "t_AST", ")", ";", "newExpression_AST", "=", "(", "AST", ")", "astFactory", ".", "make", "(", "(", "new", "ASTArray", "(", "3", ")", ")", ".", "add", "(", "create", "(", "LITERAL_new", ",", "\"new\"", ",", "first", ",", "LT", "(", "1", ")", ")", ")", ".", "add", "(", "ta_AST", ")", ".", "add", "(", "t_AST", ")", ")", ";", "if", "(", "e", "instanceof", "MismatchedTokenException", ")", "{", "Token", "t", "=", "(", "(", "MismatchedTokenException", ")", "e", ")", ".", "token", ";", "int", "i", "=", "(", "(", "MismatchedTokenException", ")", "e", ")", ".", "token", ".", "getType", "(", ")", ";", "rewind", "(", "jumpBack", ")", ";", "consume", "(", ")", ";", "consumeUntil", "(", "NLS", ")", ";", "}", "}", "else", "{", "throw", "e", ";", "}", "}", "else", "{", "throw", "e", ";", "}", "}", "returnAST", "=", "newExpression_AST", ";", "}", "public", "final", "void", "closableBlockConstructorExpression", "(", ")", "throws", "RecognitionException", ",", "TokenStreamException", "{", "returnAST", "=", "null", ";", "ASTPair", "currentAST", "=", "new", "ASTPair", "(", ")", ";", "AST", "closableBlockConstructorExpression_AST", "=", "null", ";", "closableBlock", "(", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "returnAST", ")", ";", "closableBlockConstructorExpression_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "returnAST", "=", "closableBlockConstructorExpression_AST", ";", "}", "public", "final", "void", "listOrMapConstructorExpression", "(", ")", "throws", "RecognitionException", ",", "TokenStreamException", "{", "returnAST", "=", "null", ";", "ASTPair", "currentAST", "=", "new", "ASTPair", "(", ")", ";", "AST", "listOrMapConstructorExpression_AST", "=", "null", ";", "Token", "lcon", "=", "null", ";", "AST", "lcon_AST", "=", "null", ";", "AST", "args_AST", "=", "null", ";", "Token", "emcon", "=", "null", ";", "AST", "emcon_AST", "=", "null", ";", "boolean", "hasLabels", "=", "false", ";", "if", "(", "(", "LA", "(", "1", ")", "==", "LBRACK", ")", "&&", "(", "_tokenSet_104", ".", "member", "(", "LA", "(", "2", ")", ")", ")", ")", "{", "lcon", "=", "LT", "(", "1", ")", ";", "lcon_AST", "=", "astFactory", ".", "create", "(", "lcon", ")", ";", "match", "(", "LBRACK", ")", ";", "argList", "(", ")", ";", "args_AST", "=", "(", "AST", ")", "returnAST", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "returnAST", ")", ";", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "hasLabels", "|=", "argListHasLabels", ";", "}", "match", "(", "RBRACK", ")", ";", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "listOrMapConstructorExpression_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "int", "type", "=", "hasLabels", "?", "MAP_CONSTRUCTOR", ":", "LIST_CONSTRUCTOR", ";", "listOrMapConstructorExpression_AST", "=", "(", "AST", ")", "astFactory", ".", "make", "(", "(", "new", "ASTArray", "(", "2", ")", ")", ".", "add", "(", "create", "(", "type", ",", "\"[\"", ",", "lcon_AST", ",", "LT", "(", "1", ")", ")", ")", ".", "add", "(", "args_AST", ")", ")", ";", "currentAST", ".", "root", "=", "listOrMapConstructorExpression_AST", ";", "currentAST", ".", "child", "=", "listOrMapConstructorExpression_AST", "!=", "null", "&&", "listOrMapConstructorExpression_AST", ".", "getFirstChild", "(", ")", "!=", "null", "?", "listOrMapConstructorExpression_AST", ".", "getFirstChild", "(", ")", ":", "listOrMapConstructorExpression_AST", ";", "currentAST", ".", "advanceChildToEnd", "(", ")", ";", "}", "listOrMapConstructorExpression_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "}", "else", "if", "(", "(", "LA", "(", "1", ")", "==", "LBRACK", ")", "&&", "(", "LA", "(", "2", ")", "==", "COLON", ")", ")", "{", "emcon", "=", "LT", "(", "1", ")", ";", "emcon_AST", "=", "astFactory", ".", "create", "(", "emcon", ")", ";", "astFactory", ".", "makeASTRoot", "(", "currentAST", ",", "emcon_AST", ")", ";", "match", "(", "LBRACK", ")", ";", "match", "(", "COLON", ")", ";", "match", "(", "RBRACK", ")", ";", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "emcon_AST", ".", "setType", "(", "MAP_CONSTRUCTOR", ")", ";", "}", "listOrMapConstructorExpression_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "}", "else", "{", "throw", "new", "NoViableAltException", "(", "LT", "(", "1", ")", ",", "getFilename", "(", ")", ")", ";", "}", "returnAST", "=", "listOrMapConstructorExpression_AST", ";", "}", "public", "final", "void", "stringConstructorValuePart", "(", ")", "throws", "RecognitionException", ",", "TokenStreamException", "{", "returnAST", "=", "null", ";", "ASTPair", "currentAST", "=", "new", "ASTPair", "(", ")", ";", "AST", "stringConstructorValuePart_AST", "=", "null", ";", "{", "switch", "(", "LA", "(", "1", ")", ")", "{", "case", "IDENT", ":", "{", "identifier", "(", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "returnAST", ")", ";", "break", ";", "}", "case", "LITERAL_this", ":", "{", "AST", "tmp340_AST", "=", "null", ";", "tmp340_AST", "=", "astFactory", ".", "create", "(", "LT", "(", "1", ")", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "tmp340_AST", ")", ";", "match", "(", "LITERAL_this", ")", ";", "break", ";", "}", "case", "LITERAL_super", ":", "{", "AST", "tmp341_AST", "=", "null", ";", "tmp341_AST", "=", "astFactory", ".", "create", "(", "LT", "(", "1", ")", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "tmp341_AST", ")", ";", "match", "(", "LITERAL_super", ")", ";", "break", ";", "}", "case", "LCURLY", ":", "{", "openOrClosableBlock", "(", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "returnAST", ")", ";", "break", ";", "}", "default", ":", "{", "throw", "new", "NoViableAltException", "(", "LT", "(", "1", ")", ",", "getFilename", "(", ")", ")", ";", "}", "}", "}", "stringConstructorValuePart_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "returnAST", "=", "stringConstructorValuePart_AST", ";", "}", "public", "final", "void", "newArrayDeclarator", "(", ")", "throws", "RecognitionException", ",", "TokenStreamException", "{", "returnAST", "=", "null", ";", "ASTPair", "currentAST", "=", "new", "ASTPair", "(", ")", ";", "AST", "newArrayDeclarator_AST", "=", "null", ";", "Token", "lb", "=", "null", ";", "AST", "lb_AST", "=", "null", ";", "{", "int", "_cnt561", "=", "0", ";", "_loop561", ":", "do", "{", "if", "(", "(", "LA", "(", "1", ")", "==", "LBRACK", ")", "&&", "(", "_tokenSet_105", ".", "member", "(", "LA", "(", "2", ")", ")", ")", ")", "{", "lb", "=", "LT", "(", "1", ")", ";", "lb_AST", "=", "astFactory", ".", "create", "(", "lb", ")", ";", "astFactory", ".", "makeASTRoot", "(", "currentAST", ",", "lb_AST", ")", ";", "match", "(", "LBRACK", ")", ";", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "lb_AST", ".", "setType", "(", "ARRAY_DECLARATOR", ")", ";", "}", "{", "switch", "(", "LA", "(", "1", ")", ")", "{", "case", "LBRACK", ":", "case", "IDENT", ":", "case", "STRING_LITERAL", ":", "case", "LPAREN", ":", "case", "LITERAL_super", ":", "case", "LITERAL_void", ":", "case", "LITERAL_boolean", ":", "case", "LITERAL_byte", ":", "case", "LITERAL_char", ":", "case", "LITERAL_short", ":", "case", "LITERAL_int", ":", "case", "LITERAL_float", ":", "case", "LITERAL_long", ":", "case", "LITERAL_double", ":", "case", "LCURLY", ":", "case", "LITERAL_this", ":", "case", "PLUS", ":", "case", "MINUS", ":", "case", "LITERAL_false", ":", "case", "LITERAL_new", ":", "case", "LITERAL_null", ":", "case", "LITERAL_true", ":", "case", "INC", ":", "case", "DEC", ":", "case", "BNOT", ":", "case", "LNOT", ":", "case", "STRING_CTOR_START", ":", "case", "NUM_INT", ":", "case", "NUM_FLOAT", ":", "case", "NUM_LONG", ":", "case", "NUM_DOUBLE", ":", "case", "NUM_BIG_INT", ":", "case", "NUM_BIG_DECIMAL", ":", "{", "expression", "(", "0", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "returnAST", ")", ";", "break", ";", "}", "case", "RBRACK", ":", "{", "break", ";", "}", "default", ":", "{", "throw", "new", "NoViableAltException", "(", "LT", "(", "1", ")", ",", "getFilename", "(", ")", ")", ";", "}", "}", "}", "match", "(", "RBRACK", ")", ";", "}", "else", "{", "if", "(", "_cnt561", ">=", "1", ")", "{", "break", "_loop561", ";", "}", "else", "{", "throw", "new", "NoViableAltException", "(", "LT", "(", "1", ")", ",", "getFilename", "(", ")", ")", ";", "}", "}", "_cnt561", "++", ";", "}", "while", "(", "true", ")", ";", "}", "newArrayDeclarator_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "returnAST", "=", "newArrayDeclarator_AST", ";", "}", "public", "final", "byte", "argument", "(", ")", "throws", "RecognitionException", ",", "TokenStreamException", "{", "byte", "hasLabelOrSpread", "=", "0", ";", "returnAST", "=", "null", ";", "ASTPair", "currentAST", "=", "new", "ASTPair", "(", ")", ";", "AST", "argument_AST", "=", "null", ";", "Token", "c", "=", "null", ";", "AST", "c_AST", "=", "null", ";", "Token", "sp", "=", "null", ";", "AST", "sp_AST", "=", "null", ";", "boolean", "sce", "=", "false", ";", "{", "boolean", "synPredMatched547", "=", "false", ";", "if", "(", "(", "(", "_tokenSet_94", ".", "member", "(", "LA", "(", "1", ")", ")", ")", "&&", "(", "_tokenSet_95", ".", "member", "(", "LA", "(", "2", ")", ")", ")", ")", ")", "{", "int", "_m547", "=", "mark", "(", ")", ";", "synPredMatched547", "=", "true", ";", "inputState", ".", "guessing", "++", ";", "try", "{", "{", "argumentLabelStart", "(", ")", ";", "}", "}", "catch", "(", "RecognitionException", "pe", ")", "{", "synPredMatched547", "=", "false", ";", "}", "rewind", "(", "_m547", ")", ";", "inputState", ".", "guessing", "--", ";", "}", "if", "(", "synPredMatched547", ")", "{", "argumentLabel", "(", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "returnAST", ")", ";", "c", "=", "LT", "(", "1", ")", ";", "c_AST", "=", "astFactory", ".", "create", "(", "c", ")", ";", "astFactory", ".", "makeASTRoot", "(", "currentAST", ",", "c_AST", ")", ";", "match", "(", "COLON", ")", ";", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "c_AST", ".", "setType", "(", "LABELED_ARG", ")", ";", "}", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "hasLabelOrSpread", "|=", "1", ";", "}", "}", "else", "if", "(", "(", "LA", "(", "1", ")", "==", "STAR", ")", ")", "{", "sp", "=", "LT", "(", "1", ")", ";", "sp_AST", "=", "astFactory", ".", "create", "(", "sp", ")", ";", "astFactory", ".", "makeASTRoot", "(", "currentAST", ",", "sp_AST", ")", ";", "match", "(", "STAR", ")", ";", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "sp_AST", ".", "setType", "(", "SPREAD_ARG", ")", ";", "}", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "hasLabelOrSpread", "|=", "2", ";", "}", "{", "switch", "(", "LA", "(", "1", ")", ")", "{", "case", "COLON", ":", "{", "match", "(", "COLON", ")", ";", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "sp_AST", ".", "setType", "(", "SPREAD_MAP_ARG", ")", ";", "}", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "hasLabelOrSpread", "|=", "1", ";", "}", "break", ";", "}", "case", "FINAL", ":", "case", "ABSTRACT", ":", "case", "STRICTFP", ":", "case", "LITERAL_static", ":", "case", "LITERAL_def", ":", "case", "LBRACK", ":", "case", "IDENT", ":", "case", "STRING_LITERAL", ":", "case", "LPAREN", ":", "case", "AT", ":", "case", "LITERAL_super", ":", "case", "LITERAL_void", ":", "case", "LITERAL_boolean", ":", "case", "LITERAL_byte", ":", "case", "LITERAL_char", ":", "case", "LITERAL_short", ":", "case", "LITERAL_int", ":", "case", "LITERAL_float", ":", "case", "LITERAL_long", ":", "case", "LITERAL_double", ":", "case", "LITERAL_private", ":", "case", "LITERAL_public", ":", "case", "LITERAL_protected", ":", "case", "LITERAL_transient", ":", "case", "LITERAL_native", ":", "case", "LITERAL_threadsafe", ":", "case", "LITERAL_synchronized", ":", "case", "LITERAL_volatile", ":", "case", "LCURLY", ":", "case", "LITERAL_this", ":", "case", "LITERAL_return", ":", "case", "LITERAL_break", ":", "case", "LITERAL_continue", ":", "case", "LITERAL_throw", ":", "case", "LITERAL_assert", ":", "case", "PLUS", ":", "case", "MINUS", ":", "case", "LITERAL_false", ":", "case", "LITERAL_new", ":", "case", "LITERAL_null", ":", "case", "LITERAL_true", ":", "case", "INC", ":", "case", "DEC", ":", "case", "BNOT", ":", "case", "LNOT", ":", "case", "STRING_CTOR_START", ":", "case", "NUM_INT", ":", "case", "NUM_FLOAT", ":", "case", "NUM_LONG", ":", "case", "NUM_DOUBLE", ":", "case", "NUM_BIG_INT", ":", "case", "NUM_BIG_DECIMAL", ":", "{", "break", ";", "}", "default", ":", "{", "throw", "new", "NoViableAltException", "(", "LT", "(", "1", ")", ",", "getFilename", "(", ")", ")", ";", "}", "}", "}", "}", "else", "if", "(", "(", "_tokenSet_83", ".", "member", "(", "LA", "(", "1", ")", ")", ")", "&&", "(", "_tokenSet_106", ".", "member", "(", "LA", "(", "2", ")", ")", ")", ")", "{", "}", "else", "{", "throw", "new", "NoViableAltException", "(", "LT", "(", "1", ")", ",", "getFilename", "(", ")", ")", ";", "}", "}", "sce", "=", "strictContextExpression", "(", "true", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "returnAST", ")", ";", "if", "(", "inputState", ".", "guessing", "==", "0", ")", "{", "require", "(", "LA", "(", "1", ")", "!=", "COLON", ",", "\"\"", ",", "\"\"", ")", ";", "}", "argument_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "returnAST", "=", "argument_AST", ";", "return", "hasLabelOrSpread", ";", "}", "public", "final", "void", "argumentLabelStart", "(", ")", "throws", "RecognitionException", ",", "TokenStreamException", "{", "returnAST", "=", "null", ";", "ASTPair", "currentAST", "=", "new", "ASTPair", "(", ")", ";", "AST", "argumentLabelStart_AST", "=", "null", ";", "{", "switch", "(", "LA", "(", "1", ")", ")", "{", "case", "IDENT", ":", "{", "AST", "tmp344_AST", "=", "null", ";", "tmp344_AST", "=", "astFactory", ".", "create", "(", "LT", "(", "1", ")", ")", ";", "match", "(", "IDENT", ")", ";", "break", ";", "}", "case", "FINAL", ":", "case", "ABSTRACT", ":", "case", "UNUSED_GOTO", ":", "case", "UNUSED_CONST", ":", "case", "UNUSED_DO", ":", "case", "STRICTFP", ":", "case", "LITERAL_package", ":", "case", "LITERAL_import", ":", "case", "LITERAL_static", ":", "case", "LITERAL_def", ":", "case", "LITERAL_class", ":", "case", "LITERAL_interface", ":", "case", "LITERAL_enum", ":", "case", "LITERAL_extends", ":", "case", "LITERAL_super", ":", "case", "LITERAL_void", ":", "case", "LITERAL_boolean", ":", "case", "LITERAL_byte", ":", "case", "LITERAL_char", ":", "case", "LITERAL_short", ":", "case", "LITERAL_int", ":", "case", "LITERAL_float", ":", "case", "LITERAL_long", ":", "case", "LITERAL_double", ":", "case", "LITERAL_as", ":", "case", "LITERAL_private", ":", "case", "LITERAL_public", ":", "case", "LITERAL_protected", ":", "case", "LITERAL_transient", ":", "case", "LITERAL_native", ":", "case", "LITERAL_threadsafe", ":", "case", "LITERAL_synchronized", ":", "case", "LITERAL_volatile", ":", "case", "LITERAL_default", ":", "case", "LITERAL_throws", ":", "case", "LITERAL_implements", ":", "case", "LITERAL_this", ":", "case", "LITERAL_if", ":", "case", "LITERAL_else", ":", "case", "LITERAL_while", ":", "case", "LITERAL_switch", ":", "case", "LITERAL_for", ":", "case", "LITERAL_in", ":", "case", "LITERAL_return", ":", "case", "LITERAL_break", ":", "case", "LITERAL_continue", ":", "case", "LITERAL_throw", ":", "case", "LITERAL_assert", ":", "case", "LITERAL_case", ":", "case", "LITERAL_try", ":", "case", "LITERAL_finally", ":", "case", "LITERAL_catch", ":", "case", "LITERAL_false", ":", "case", "LITERAL_instanceof", ":", "case", "LITERAL_new", ":", "case", "LITERAL_null", ":", "case", "LITERAL_true", ":", "{", "keywordPropertyNames", "(", ")", ";", "break", ";", "}", "case", "NUM_INT", ":", "case", "NUM_FLOAT", ":", "case", "NUM_LONG", ":", "case", "NUM_DOUBLE", ":", "case", "NUM_BIG_INT", ":", "case", "NUM_BIG_DECIMAL", ":", "{", "constantNumber", "(", ")", ";", "break", ";", "}", "case", "STRING_LITERAL", ":", "{", "AST", "tmp345_AST", "=", "null", ";", "tmp345_AST", "=", "astFactory", ".", "create", "(", "LT", "(", "1", ")", ")", ";", "match", "(", "STRING_LITERAL", ")", ";", "break", ";", "}", "case", "LBRACK", ":", "case", "LPAREN", ":", "case", "LCURLY", ":", "case", "STRING_CTOR_START", ":", "{", "balancedBrackets", "(", ")", ";", "break", ";", "}", "default", ":", "{", "throw", "new", "NoViableAltException", "(", "LT", "(", "1", ")", ",", "getFilename", "(", ")", ")", ";", "}", "}", "}", "AST", "tmp346_AST", "=", "null", ";", "tmp346_AST", "=", "astFactory", ".", "create", "(", "LT", "(", "1", ")", ")", ";", "match", "(", "COLON", ")", ";", "returnAST", "=", "argumentLabelStart_AST", ";", "}", "public", "final", "void", "constantNumber", "(", ")", "throws", "RecognitionException", ",", "TokenStreamException", "{", "returnAST", "=", "null", ";", "ASTPair", "currentAST", "=", "new", "ASTPair", "(", ")", ";", "AST", "constantNumber_AST", "=", "null", ";", "switch", "(", "LA", "(", "1", ")", ")", "{", "case", "NUM_INT", ":", "{", "AST", "tmp347_AST", "=", "null", ";", "tmp347_AST", "=", "astFactory", ".", "create", "(", "LT", "(", "1", ")", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "tmp347_AST", ")", ";", "match", "(", "NUM_INT", ")", ";", "constantNumber_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "break", ";", "}", "case", "NUM_FLOAT", ":", "{", "AST", "tmp348_AST", "=", "null", ";", "tmp348_AST", "=", "astFactory", ".", "create", "(", "LT", "(", "1", ")", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "tmp348_AST", ")", ";", "match", "(", "NUM_FLOAT", ")", ";", "constantNumber_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "break", ";", "}", "case", "NUM_LONG", ":", "{", "AST", "tmp349_AST", "=", "null", ";", "tmp349_AST", "=", "astFactory", ".", "create", "(", "LT", "(", "1", ")", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "tmp349_AST", ")", ";", "match", "(", "NUM_LONG", ")", ";", "constantNumber_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "break", ";", "}", "case", "NUM_DOUBLE", ":", "{", "AST", "tmp350_AST", "=", "null", ";", "tmp350_AST", "=", "astFactory", ".", "create", "(", "LT", "(", "1", ")", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "tmp350_AST", ")", ";", "match", "(", "NUM_DOUBLE", ")", ";", "constantNumber_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "break", ";", "}", "case", "NUM_BIG_INT", ":", "{", "AST", "tmp351_AST", "=", "null", ";", "tmp351_AST", "=", "astFactory", ".", "create", "(", "LT", "(", "1", ")", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "tmp351_AST", ")", ";", "match", "(", "NUM_BIG_INT", ")", ";", "constantNumber_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "break", ";", "}", "case", "NUM_BIG_DECIMAL", ":", "{", "AST", "tmp352_AST", "=", "null", ";", "tmp352_AST", "=", "astFactory", ".", "create", "(", "LT", "(", "1", ")", ")", ";", "astFactory", ".", "addASTChild", "(", "currentAST", ",", "tmp352_AST", ")", ";", "match", "(", "NUM_BIG_DECIMAL", ")", ";", "constantNumber_AST", "=", "(", "AST", ")", "currentAST", ".", "root", ";", "break", ";", "}", "default", ":", "{", "throw", "new", "NoViableAltException", "(", "LT", "(", "1", ")", ",", "getFilename", "(", ")", ")", ";", "}", "}", "returnAST", "=", "constantNumber_AST", ";", "}", "public", "final", "void", "balancedBrackets", "(", ")", "throws", "RecognitionException", ",", "TokenStreamException", "{", "returnAST", "=", "null", ";", "ASTPair", "currentAST", "=", "new", "ASTPair", "(", ")", ";", "AST", "balancedBrackets_AST", "=", "null", ";", "switch", "(", "LA", "(", "1", ")", ")", "{", "case", "LPAREN", ":", "{", "AST", "tmp353_AST", "=", "null", ";", "tmp353_AST", "=", "astFactory", ".", "create", "(", "LT", "(", "1", ")", ")", ";", "match", "(", "LPAREN", ")", ";", "balancedTokens", "(", ")", ";", "AST", "tmp354_AST", "=", "null", ";", "tmp354_AST", "=", "astFactory", ".", "create", "(", "LT", "(", "1", ")", ")", ";", "match", "(", "RPAREN", ")", ";", "break", ";", "}", "case", "LBRACK", ":", "{", "AST", "tmp355_AST", "=", "null", ";", "tmp355_AST", "=", "astFactory", ".", "create", "(", "LT", "(", "1", ")", ")", ";", "match", "(", "LBRACK", ")", ";", "balancedTokens", "(", ")", ";", "AST", "tmp356_AST", "=", "null", ";", "tmp356_AST", "=", "astFactory", ".", "create", "(", "LT", "(", "1", ")", ")", ";", "match", "(", "RBRACK", ")", ";", "break", ";", "}", "case", "LCURLY", ":", "{", "AST", "tmp357_AST", "=", "null", ";", "tmp357_AST", "=", "astFactory", ".", "create", "(", "LT", "(", "1", ")", ")", ";", "match", "(", "LCURLY", ")", ";", "balancedTokens", "(", ")", ";", "AST", "tmp358_AST", "=", "null", ";", "tmp358_AST", "=", "astFactory", ".", "create", "(", "LT", "(", "1", ")", ")", ";", "match", "(", "RCURLY", ")", ";", "break", ";", "}", "case", "STRING_CTOR_START", ":", "{", "AST", "tmp359_AST", "=", "null", ";", "tmp359_AST", "=", "astFactory", ".", "create", "(", "LT", "(", "1", ")", ")", ";", "match", "(", "STRING_CTOR_START", ")", ";", "balancedTokens", "(", ")", ";", "AST", "tmp360_AST", "=", "null", ";", "tmp360_AST", "=", "astFactory", ".", "create", "(", "LT", "(", "1", ")", ")", ";", "match", "(", "STRING_CTOR_END", ")", ";", "break", ";", "}", "default", ":", "{", "throw", "new", "NoViableAltException", "(", "LT", "(", "1", ")", ",", "getFilename", "(", ")", ")", ";", "}", "}", "returnAST", "=", "balancedBrackets_AST", ";", "}", "public", "static", "final", "String", "[", "]", "_tokenNames", "=", "{", "\"<0>\"", ",", "\"EOF\"", ",", "\"<2>\"", ",", "\"\"", ",", "\"BLOCK\"", ",", "\"MODIFIERS\"", ",", "\"OBJBLOCK\"", ",", "\"SLIST\"", ",", "\"METHOD_DEF\"", ",", "\"VARIABLE_DEF\"", ",", "\"\"", ",", "\"STATIC_INIT\"", ",", "\"TYPE\"", ",", "\"CLASS_DEF\"", ",", "\"\"", ",", "\"PACKAGE_DEF\"", ",", "\"\"", ",", "\"\"", ",", "\"\"", ",", "\"PARAMETERS\"", ",", "\"\"", ",", "\"LABELED_STAT\"", ",", "\"TYPECAST\"", ",", "\"INDEX_OP\"", ",", "\"POST_INC\"", ",", "\"POST_DEC\"", ",", "\"METHOD_CALL\"", ",", "\"EXPR\"", ",", "\"IMPORT\"", ",", "\"UNARY_MINUS\"", ",", "\"UNARY_PLUS\"", ",", "\"CASE_GROUP\"", ",", "\"ELIST\"", ",", "\"FOR_INIT\"", ",", "\"\"", ",", "\"FOR_ITERATOR\"", ",", "\"EMPTY_STAT\"", ",", "\"\\\"final\\\"\"", ",", "\"\\\"abstract\\\"\"", ",", "\"\\\"goto\\\"\"", ",", "\"\\\"const\\\"\"", ",", "\"\\\"do\\\"\"", ",", "\"\\\"strictfp\\\"\"", ",", "\"\"", ",", "\"CTOR_CALL\"", ",", "\"CTOR_IDENT\"", ",", "\"\"", ",", "\"\"", ",", "\"\"", ",", "\"\"", ",", "\"\"", ",", "\"SELECT_SLOT\"", ",", "\"\"", ",", "\"LABELED_ARG\"", ",", "\"SPREAD_ARG\"", ",", "\"\"", ",", "\"\"", ",", "\"\"", ",", "\"\"", ",", "\"\"", ",", "\"ENUM_DEF\"", ",", "\"\"", ",", "\"\"", ",", "\"\"", ",", "\"ANNOTATIONS\"", ",", "\"ANNOTATION\"", ",", "\"\"", ",", "\"\"", ",", "\"\"", ",", "\"\"", ",", "\"\"", ",", "\"\"", ",", "\"\"", ",", "\"\"", ",", "\"\"", ",", "\"\"", ",", "\"CLOSURE_LIST\"", ",", "\"\"", ",", "\"\\\"package\\\"\"", ",", "\"\\\"import\\\"\"", ",", "\"\\\"static\\\"\"", ",", "\"\\\"def\\\"\"", ",", "\"'['\"", ",", "\"']'\"", ",", "\"\"", ",", "\"\"", ",", "\"'<'\"", ",", "\"'.'\"", ",", "\"'('\"", ",", "\"\\\"class\\\"\"", ",", "\"\\\"interface\\\"\"", ",", "\"\\\"enum\\\"\"", ",", "\"'@'\"", ",", "\"'?'\"", ",", "\"\\\"extends\\\"\"", ",", "\"\\\"super\\\"\"", ",", "\"'>'\"", ",", "\"','\"", ",", "\"'>>'\"", ",", "\"'>>>'\"", ",", "\"\\\"void\\\"\"", ",", "\"\\\"boolean\\\"\"", ",", "\"\\\"byte\\\"\"", ",", "\"\\\"char\\\"\"", ",", "\"\\\"short\\\"\"", ",", "\"\\\"int\\\"\"", ",", "\"\\\"float\\\"\"", ",", "\"\\\"long\\\"\"", ",", "\"\\\"double\\\"\"", ",", "\"'*'\"", ",", "\"\\\"as\\\"\"", ",", "\"\\\"private\\\"\"", ",", "\"\\\"public\\\"\"", ",", "\"\\\"protected\\\"\"", ",", "\"\\\"transient\\\"\"", ",", "\"\\\"native\\\"\"", ",", "\"\\\"threadsafe\\\"\"", ",", "\"\"", ",", "\"\\\"volatile\\\"\"", ",", "\"')'\"", ",", "\"'='\"", ",", "\"'&'\"", ",", "\"'{'\"", ",", "\"'}'\"", ",", "\"';'\"", ",", "\"\\\"default\\\"\"", ",", "\"\\\"throws\\\"\"", ",", "\"\\\"implements\\\"\"", ",", "\"\\\"this\\\"\"", ",", "\"'...'\"", ",", "\"'->'\"", ",", "\"':'\"", ",", "\"\\\"if\\\"\"", ",", "\"\\\"else\\\"\"", ",", "\"\\\"while\\\"\"", ",", "\"\\\"switch\\\"\"", ",", "\"\\\"for\\\"\"", ",", "\"\\\"in\\\"\"", ",", "\"\\\"return\\\"\"", ",", "\"\\\"break\\\"\"", ",", "\"\\\"continue\\\"\"", ",", "\"\\\"throw\\\"\"", ",", "\"\\\"assert\\\"\"", ",", "\"'+'\"", ",", "\"'-'\"", ",", "\"\\\"case\\\"\"", ",", "\"\\\"try\\\"\"", ",", "\"\\\"finally\\\"\"", ",", "\"\\\"catch\\\"\"", ",", "\"'*.'\"", ",", "\"'?.'\"", ",", "\"'.&'\"", ",", "\"\\\"false\\\"\"", ",", "\"\\\"instanceof\\\"\"", ",", "\"\\\"new\\\"\"", ",", "\"\\\"null\\\"\"", ",", "\"\\\"true\\\"\"", ",", "\"'+='\"", ",", "\"'-='\"", ",", "\"'*='\"", ",", "\"'/='\"", ",", "\"'%='\"", ",", "\"'>>='\"", ",", "\"'>>>='\"", ",", "\"'<<='\"", ",", "\"'&='\"", ",", "\"'^='\"", ",", "\"'|='\"", ",", "\"'**='\"", ",", "\"'?:'\"", ",", "\"'||'\"", ",", "\"'&&'\"", ",", "\"'|'\"", ",", "\"'^'\"", ",", "\"'=~'\"", ",", "\"'==~'\"", ",", "\"'!='\"", ",", "\"'=='\"", ",", "\"'==='\"", ",", "\"'!=='\"", ",", "\"'<=>'\"", ",", "\"'<='\"", ",", "\"'>='\"", ",", "\"'<<'\"", ",", "\"'..'\"", ",", "\"'..<'\"", ",", "\"'++'\"", ",", "\"'/'\"", ",", "\"'%'\"", ",", "\"'--'\"", ",", "\"'**'\"", ",", "\"'~'\"", ",", "\"'!'\"", ",", "\"\"", ",", "\"\"", ",", "\"\"", ",", "\"NUM_FLOAT\"", ",", "\"NUM_LONG\"", ",", "\"NUM_DOUBLE\"", ",", "\"NUM_BIG_INT\"", ",", "\"\"", ",", "\"\"", ",", "\"'$'\"", ",", "\"whitespace\"", ",", "\"a", "newline\"", ",", "\"a", "newline\"", ",", "\"\"", ",", "\"a", "comment\"", ",", "\"\"", ",", "\"\"", ",", "\"\"", ",", "\"\"", ",", "\"\"", ",", "\"\"", ",", "\"\"", ",", "\"\"", ",", "\"\"", ",", "\"\"", ",", "\"\"", ",", "\"\"", ",", "\"a", "character\"", ",", "\"a", "letter\"", ",", "\"a", "digit\"", ",", "\"an", "exponent\"", ",", "\"\"", ",", "\"\"", "}", ";", "protected", "void", "buildTokenTypeASTClassMap", "(", ")", "{", "tokenTypeToASTClassMap", "=", "null", ";", "}", ";", "private", "static", "final", "long", "[", "]", "mk_tokenSet_0", "(", ")", "{", "long", "[", "]", "data", "=", "new", "long", "[", "8", "]", ";", "data", "[", "0", "]", "=", "2L", ";", "data", "[", "1", "]", "=", "1152921504675004416L", ";", "data", "[", "3", "]", "=", "512L", ";", "return", "data", ";", "}", "public", "static", "final", "BitSet", "_tokenSet_0", "=", "new", "BitSet", "(", "mk_tokenSet_0", "(", ")", ")", ";", "private", "static", "final", "long", "[", "]", "mk_tokenSet_1", "(", ")", "{", "long", "[", "]", "data", "=", "new", "long", "[", "8", "]", ";", "data", "[", "0", "]", "=", "4810363371522L", ";", "data", "[", "1", "]", "=", "1477075058612994048L", ";", "data", "[", "2", "]", "=", "-", "6629298651002438191L", ";", "data", "[", "3", "]", "=", "1019L", ";", "return", "data", ";", "}", "public", "static", "final", "BitSet", "_tokenSet_1", "=", "new", "BitSet", "(", "mk_tokenSet_1", "(", ")", ")", ";", "private", "static", "final", "long", "[", "]", "mk_tokenSet_2", "(", ")", "{", "long", "[", "]", "data", "=", "new", "long", "[", "8", "]", ";", "data", "[", "0", "]", "=", "8658654068738L", ";", "data", "[", "1", "]", "=", "-", "36028805608914944L", ";", "data", "[", "2", "]", "=", "-", "1L", ";", "data", "[", "3", "]", "=", "1019L", ";", "return", "data", ";", "}", "public", "static", "final", "BitSet", "_tokenSet_2", "=", "new", "BitSet", "(", "mk_tokenSet_2", "(", ")", ")", ";", "private", "static", "final", "long", "[", "]", "mk_tokenSet_3", "(", ")", "{", "long", "[", "]", "data", "=", "new", "long", "[", "8", "]", ";", "data", "[", "0", "]", "=", "8658654068738L", ";", "data", "[", "1", "]", "=", "-", "16384L", ";", "data", "[", "2", "]", "=", "-", "6620291452234629121L", ";", "data", "[", "3", "]", "=", "1019L", ";", "return", "data", ";", "}", "public", "static", "final", "BitSet", "_tokenSet_3", "=", "new", "BitSet", "(", "mk_tokenSet_3", "(", ")", ")", ";", "private", "static", "final", "long", "[", "]", "mk_tokenSet_4", "(", ")", "{", "long", "[", "]", "data", "=", "new", "long", "[", "16", "]", ";", "data", "[", "0", "]", "=", "-", "14L", ";", "for", "(", "int", "i", "=", "1", ";", "i", "<=", "2", ";", "i", "++", ")", "{", "data", "[", "i", "]", "=", "-", "1L", ";", "}", "data", "[", "3", "]", "=", "17179869183L", ";", "return", "data", ";", "}", "public", "static", "final", "BitSet", "_tokenSet_4", "=", "new", "BitSet", "(", "mk_tokenSet_4", "(", ")", ")", ";", "private", "static", "final", "long", "[", "]", "mk_tokenSet_5", "(", ")", "{", "long", "[", "]", "data", "=", "{", "0L", ",", "269533184L", ",", "0L", ",", "0L", "}", ";", "return", "data", ";", "}", "public", "static", "final", "BitSet", "_tokenSet_5", "=", "new", "BitSet", "(", "mk_tokenSet_5", "(", ")", ")", ";", "private", "static", "final", "long", "[", "]", "mk_tokenSet_6", "(", ")", "{", "long", "[", "]", "data", "=", "new", "long", "[", "8", "]", ";", "data", "[", "0", "]", "=", "4810363371522L", ";", "data", "[", "1", "]", "=", "4359378826402398208L", ";", "data", "[", "2", "]", "=", "131104L", ";", "data", "[", "3", "]", "=", "512L", ";", "return", "data", ";", "}", "public", "static", "final", "BitSet", "_tokenSet_6", "=", "new", "BitSet", "(", "mk_tokenSet_6", "(", ")", ")", ";", "private", "static", "final", "long", "[", "]", "mk_tokenSet_7", "(", ")", "{", "long", "[", "]", "data", "=", "{", "0L", ",", "1097728L", ",", "0L", ",", "0L", "}", ";", "return", "data", ";", "}", "public", "static", "final", "BitSet", "_tokenSet_7", "=", "new", "BitSet", "(", "mk_tokenSet_7", "(", ")", ")", ";", "private", "static", "final", "long", "[", "]", "mk_tokenSet_8", "(", ")", "{", "long", "[", "]", "data", "=", "new", "long", "[", "8", "]", ";", "data", "[", "0", "]", "=", "4810363371522L", ";", "data", "[", "1", "]", "=", "4359378826335289344L", ";", "data", "[", "2", "]", "=", "131104L", ";", "data", "[", "3", "]", "=", "512L", ";", "return", "data", ";", "}", "public", "static", "final", "BitSet", "_tokenSet_8", "=", "new", "BitSet", "(", "mk_tokenSet_8", "(", ")", ")", ";", "private", "static", "final", "long", "[", "]", "mk_tokenSet_9", "(", ")", "{", "long", "[", "]", "data", "=", "new", "long", "[", "8", "]", ";", "data", "[", "1", "]", "=", "1152921504606846976L", ";", "data", "[", "2", "]", "=", "32L", ";", "data", "[", "3", "]", "=", "512L", ";", "return", "data", ";", "}", "public", "static", "final", "BitSet", "_tokenSet_9", "=", "new", "BitSet", "(", "mk_tokenSet_9", "(", ")", ")", ";", "private", "static", "final", "long", "[", "]", "mk_tokenSet_10", "(", ")", "{", "long", "[", "]", "data", "=", "new", "long", "[", "8", "]", ";", "data", "[", "0", "]", "=", "4810363371520L", ";", "data", "[", "1", "]", "=", "1477075058612994048L", ";", "data", "[", "2", "]", "=", "-", "6629298651002438159L", ";", "data", "[", "3", "]", "=", "1019L", ";", "return", "data", ";", "}", "public", "static", "final", "BitSet", "_tokenSet_10", "=", "new", "BitSet", "(", "mk_tokenSet_10", "(", ")", ")", ";", "private", "static", "final", "long", "[", "]", "mk_tokenSet_11", "(", ")", "{", "long", "[", "]", "data", "=", "new", "long", "[", "8", "]", ";", "data", "[", "0", "]", "=", "2L", ";", "data", "[", "1", "]", "=", "4035225266123964416L", ";", "data", "[", "2", "]", "=", "131104L", ";", "data", "[", "3", "]", "=", "512L", ";", "return", "data", ";", "}", "public", "static", "final", "BitSet", "_tokenSet_11", "=", "new", "BitSet", "(", "mk_tokenSet_11", "(", ")", ")", ";", "private", "static", "final", "long", "[", "]", "mk_tokenSet_12", "(", ")", "{", "long", "[", "]", "data", "=", "new", "long", "[", "8", "]", ";", "data", "[", "0", "]", "=", "290133630779394L", ";", "data", "[", "1", "]", "=", "-", "16384L", ";", "data", "[", "2", "]", "=", "-", "3L", ";", "data", "[", "3", "]", "=", "1023L", ";", "return", "data", ";", "}", "public", "static", "final", "BitSet", "_tokenSet_12", "=", "new", "BitSet", "(", "mk_tokenSet_12", "(", ")", ")", ";", "private", "static", "final", "long", "[", "]", "mk_tokenSet_13", "(", ")", "{", "long", "[", "]", "data", "=", "{", "4810363371520L", ",", "35888059799240704L", ",", "0L", ",", "0L", "}", ";", "return", "data", ";", "}", "public", "static", "final", "BitSet", "_tokenSet_13", "=", "new", "BitSet", "(", "mk_tokenSet_13", "(", ")", ")", ";", "private", "static", "final", "long", "[", "]", "mk_tokenSet_14", "(", ")", "{", "long", "[", "]", "data", "=", "new", "long", "[", "8", "]", ";", "data", "[", "0", "]", "=", "4810363371520L", ";", "data", "[", "1", "]", "=", "35888059871592448L", ";", "data", "[", "3", "]", "=", "512L", ";", "return", "data", ";", "}", "public", "static", "final", "BitSet", "_tokenSet_14", "=", "new", "BitSet", "(", "mk_tokenSet_14", "(", ")", ")", ";", "private", "static", "final", "long", "[", "]", "mk_tokenSet_15", "(", ")", "{", "long", "[", "]", "data", "=", "new", "long", "[", "8", "]", ";", "data", "[", "0", "]", "=", "4810363371520L", ";", "data", "[", "1", "]", "=", "35923175536787456L", ";", "data", "[", "3", "]", "=", "512L", ";", "return", "data", ";", "}", "public", "static", "final", "BitSet", "_tokenSet_15", "=", "new", "BitSet", "(", "mk_tokenSet_15", "(", ")", ")", ";", "private", "static", "final", "long", "[", "]", "mk_tokenSet_16", "(", ")", "{", "long", "[", "]", "data", "=", "{", "4810363371520L", ",", "35923175452901376L", ",", "0L", ",", "0L", "}", ";", "return", "data", ";", "}", "public", "static", "final", "BitSet", "_tokenSet_16", "=", "new", "BitSet", "(", "mk_tokenSet_16", "(", ")", ")", ";", "private", "static", "final", "long", "[", "]", "mk_tokenSet_17", "(", ")", "{", "long", "[", "]", "data", "=", "new", "long", "[", "8", "]", ";", "data", "[", "0", "]", "=", "4810363371520L", ";", "data", "[", "1", "]", "=", "35923175534952448L", ";", "data", "[", "3", "]", "=", "512L", ";", "return", "data", ";", "}", "public", "static", "final", "BitSet", "_tokenSet_17", "=", "new", "BitSet", "(", "mk_tokenSet_17", "(", ")", ")", ";", "private", "static", "final", "long", "[", "]", "mk_tokenSet_18", "(", ")", "{", "long", "[", "]", "data", "=", "new", "long", "[", "8", "]", ";", "data", "[", "0", "]", "=", "4810363371520L", ";", "data", "[", "1", "]", "=", "2053535810916417536L", ";", "data", "[", "2", "]", "=", "-", "6629298651002438185L", ";", "data", "[", "3", "]", "=", "1019L", ";", "return", "data", ";", "}", "public", "static", "final", "BitSet", "_tokenSet_18", "=", "new", "BitSet", "(", "mk_tokenSet_18", "(", ")", ")", ";", "private", "static", "final", "long", "[", "]", "mk_tokenSet_19", "(", ")", "{", "long", "[", "]", "data", "=", "new", "long", "[", "8", "]", ";", "data", "[", "0", "]", "=", "4810363371520L", ";", "data", "[", "1", "]", "=", "324153554006147072L", ";", "data", "[", "2", "]", "=", "-", "6629298651002438191L", ";", "data", "[", "3", "]", "=", "507L", ";", "return", "data", ";", "}", "public", "static", "final", "BitSet", "_tokenSet_19", "=", "new", "BitSet", "(", "mk_tokenSet_19", "(", ")", ")", ";", "private", "static", "final", "long", "[", "]", "mk_tokenSet_20", "(", ")", "{", "long", "[", "]", "data", "=", "new", "long", "[", "8", "]", ";", "data", "[", "1", "]", "=", "288265493971992576L", ";", "data", "[", "2", "]", "=", "-", "6629298651002732543L", ";", "data", "[", "3", "]", "=", "507L", ";", "return", "data", ";", "}", "public", "static", "final", "BitSet", "_tokenSet_20", "=", "new", "BitSet", "(", "mk_tokenSet_20", "(", ")", ")", ";", "private", "static", "final", "long", "[", "]", "mk_tokenSet_21", "(", ")", "{", "long", "[", "]", "data", "=", "new", "long", "[", "8", "]", ";", "data", "[", "0", "]", "=", "2L", ";", "data", "[", "1", "]", "=", "4035225266192187392L", ";", "data", "[", "2", "]", "=", "131104L", ";", "data", "[", "3", "]", "=", "512L", ";", "return", "data", ";", "}", "public", "static", "final", "BitSet", "_tokenSet_21", "=", "new", "BitSet", "(", "mk_tokenSet_21", "(", ")", ")", ";", "private", "static", "final", "long", "[", "]", "mk_tokenSet_22", "(", ")", "{", "long", "[", "]", "data", "=", "{", "4810363371520L", ",", "35888060034121728L", ",", "0L", ",", "0L", "}", ";", "return", "data", ";", "}", "public", "static", "final", "BitSet", "_tokenSet_22", "=", "new", "BitSet", "(", "mk_tokenSet_22", "(", ")", ")", ";", "private", "static", "final", "long", "[", "]", "mk_tokenSet_23", "(", ")", "{", "long", "[", "]", "data", "=", "new", "long", "[", "8", "]", ";", "data", "[", "0", "]", "=", "4810363371520L", ";", "data", "[", "1", "]", "=", "35888060035170304L", ";", "data", "[", "3", "]", "=", "512L", ";", "return", "data", ";", "}", "public", "static", "final", "BitSet", "_tokenSet_23", "=", "new", "BitSet", "(", "mk_tokenSet_23", "(", ")", ")", ";", "private", "static", "final", "long", "[", "]", "mk_tokenSet_24", "(", ")", "{", "long", "[", "]", "data", "=", "new", "long", "[", "8", "]", ";", "data", "[", "0", "]", "=", "4810363371522L", ";", "data", "[", "1", "]", "=", "4359378820134305792L", ";", "data", "[", "2", "]", "=", "-", "6629298651002307087L", ";", "data", "[", "3", "]", "=", "1019L", ";", "return", "data", ";", "}", "public", "static", "final", "BitSet", "_tokenSet_24", "=", "new", "BitSet", "(", "mk_tokenSet_24", "(", ")", ")", ";", "private", "static", "final", "long", "[", "]", "mk_tokenSet_25", "(", ")", "{", "long", "[", "]", "data", "=", "{", "0L", ",", "35115653660672L", ",", "0L", ",", "0L", "}", ";", "return", "data", ";", "}", "public", "static", "final", "BitSet", "_tokenSet_25", "=", "new", "BitSet", "(", "mk_tokenSet_25", "(", ")", ")", ";", "private", "static", "final", "long", "[", "]", "mk_tokenSet_26", "(", ")", "{", "long", "[", "]", "data", "=", "{", "0L", ",", "15990784L", ",", "0L", ",", "0L", "}", ";", "return", "data", ";", "}", "public", "static", "final", "BitSet", "_tokenSet_26", "=", "new", "BitSet", "(", "mk_tokenSet_26", "(", ")", ")", ";", "private", "static", "final", "long", "[", "]", "mk_tokenSet_27", "(", ")", "{", "long", "[", "]", "data", "=", "new", "long", "[", "8", "]", ";", "data", "[", "0", "]", "=", "2L", ";", "data", "[", "1", "]", "=", "4107282868768604160L", ";", "data", "[", "2", "]", "=", "131104L", ";", "data", "[", "3", "]", "=", "512L", ";", "return", "data", ";", "}", "public", "static", "final", "BitSet", "_tokenSet_27", "=", "new", "BitSet", "(", "mk_tokenSet_27", "(", ")", ")", ";", "private", "static", "final", "long", "[", "]", "mk_tokenSet_28", "(", ")", "{", "long", "[", "]", "data", "=", "new", "long", "[", "8", "]", ";", "data", "[", "0", "]", "=", "2L", ";", "data", "[", "1", "]", "=", "4107282868751826944L", ";", "data", "[", "2", "]", "=", "131104L", ";", "data", "[", "3", "]", "=", "512L", ";", "return", "data", ";", "}", "public", "static", "final", "BitSet", "_tokenSet_28", "=", "new", "BitSet", "(", "mk_tokenSet_28", "(", ")", ")", ";", "private", "static", "final", "long", "[", "]", "mk_tokenSet_29", "(", ")", "{", "long", "[", "]", "data", "=", "new", "long", "[", "8", "]", ";", "data", "[", "1", "]", "=", "4611686018428436480L", ";", "data", "[", "3", "]", "=", "512L", ";", "return", "data", ";", "}", "public", "static", "final", "BitSet", "_tokenSet_29", "=", "new", "BitSet", "(", "mk_tokenSet_29", "(", ")", ")", ";", "private", "static", "final", "long", "[", "]", "mk_tokenSet_30", "(", ")", "{", "long", "[", "]", "data", "=", "new", "long", "[", "8", "]", ";", "data", "[", "0", "]", "=", "2L", ";", "data", "[", "1", "]", "=", "4323455642275676160L", ";", "data", "[", "2", "]", "=", "131104L", ";", "data", "[", "3", "]", "=", "512L", ";", "return", "data", ";", "}", "public", "static", "final", "BitSet", "_tokenSet_30", "=", "new", "BitSet", "(", "mk_tokenSet_30", "(", ")", ")", ";", "private", "static", "final", "long", "[", "]", "mk_tokenSet_31", "(", ")", "{", "long", "[", "]", "data", "=", "new", "long", "[", "8", "]", ";", "data", "[", "0", "]", "=", "4810363371520L", ";", "data", "[", "1", "]", "=", "2053535810916417536L", ";", "data", "[", "2", "]", "=", "-", "6629298651002438191L", ";", "data", "[", "3", "]", "=", "1019L", ";", "return", "data", ";", "}", "public", "static", "final", "BitSet", "_tokenSet_31", "=", "new", "BitSet", "(", "mk_tokenSet_31", "(", ")", ")", ";", "private", "static", "final", "long", "[", "]", "mk_tokenSet_32", "(", ")", "{", "long", "[", "]", "data", "=", "{", "0L", ",", "13893632L", ",", "0L", ",", "0L", "}", ";", "return", "data", ";", "}", "public", "static", "final", "BitSet", "_tokenSet_32", "=", "new", "BitSet", "(", "mk_tokenSet_32", "(", ")", ")", ";", "private", "static", "final", "long", "[", "]", "mk_tokenSet_33", "(", ")", "{", "long", "[", "]", "data", "=", "{", "2L", ",", "1261007904254197760L", ",", "520L", ",", "0L", ",", "0L", ",", "0L", "}", ";", "return", "data", ";", "}", "public", "static", "final", "BitSet", "_tokenSet_33", "=", "new", "BitSet", "(", "mk_tokenSet_33", "(", ")", ")", ";", "private", "static", "final", "long", "[", "]", "mk_tokenSet_34", "(", ")", "{", "long", "[", "]", "data", "=", "{", "4810363371520L", ",", "35923175467843584L", ",", "0L", ",", "0L", "}", ";", "return", "data", ";", "}", "public", "static", "final", "BitSet", "_tokenSet_34", "=", "new", "BitSet", "(", "mk_tokenSet_34", "(", ")", ")", ";", "private", "static", "final", "long", "[", "]", "mk_tokenSet_35", "(", ")", "{", "long", "[", "]", "data", "=", "{", "4810363371520L", ",", "35923175459454976L", ",", "0L", ",", "0L", "}", ";", "return", "data", ";", "}", "public", "static", "final", "BitSet", "_tokenSet_35", "=", "new", "BitSet", "(", "mk_tokenSet_35", "(", ")", ")", ";", "private", "static", "final", "long", "[", "]", "mk_tokenSet_36", "(", ")", "{", "long", "[", "]", "data", "=", "new", "long", "[", "8", "]", ";", "data", "[", "0", "]", "=", "8658654068736L", ";", "data", "[", "1", "]", "=", "-", "1945590288370647040L", ";", "data", "[", "2", "]", "=", "-", "6629298650967179279L", ";", "data", "[", "3", "]", "=", "507L", ";", "return", "data", ";", "}", "public", "static", "final", "BitSet", "_tokenSet_36", "=", "new", "BitSet", "(", "mk_tokenSet_36", "(", ")", ")", ";", "private", "static", "final", "long", "[", "]", "mk_tokenSet_37", "(", ")", "{", "long", "[", "]", "data", "=", "new", "long", "[", "8", "]", ";", "data", "[", "0", "]", "=", "4810363371522L", ";", "data", "[", "1", "]", "=", "1801334238230593536L", ";", "data", "[", "2", "]", "=", "2L", ";", "data", "[", "3", "]", "=", "512L", ";", "return", "data", ";", "}", "public", "static", "final", "BitSet", "_tokenSet_37", "=", "new", "BitSet", "(", "mk_tokenSet_37", "(", ")", ")", ";", "private", "static", "final", "long", "[", "]", "mk_tokenSet_38", "(", ")", "{", "long", "[", "]", "data", "=", "new", "long", "[", "8", "]", ";", "data", "[", "0", "]", "=", "8658654068738L", ";", "data", "[", "1", "]", "=", "-", "16384L", ";", "data", "[", "2", "]", "=", "-", "1L", ";", "data", "[", "3", "]", "=", "1019L", ";", "return", "data", ";", "}", "public", "static", "final", "BitSet", "_tokenSet_38", "=", "new", "BitSet", "(", "mk_tokenSet_38", "(", ")", ")", ";", "private", "static", "final", "long", "[", "]", "mk_tokenSet_39", "(", ")", "{", "long", "[", "]", "data", "=", "new", "long", "[", "8", "]", ";", "data", "[", "1", "]", "=", "35116190531584L", ";", "data", "[", "3", "]", "=", "512L", ";", "return", "data", ";", "}", "public", "static", "final", "BitSet", "_tokenSet_39", "=", "new", "BitSet", "(", "mk_tokenSet_39", "(", ")", ")", ";", "private", "static", "final", "long", "[", "]", "mk_tokenSet_40", "(", ")", "{", "long", "[", "]", "data", "=", "{", "0L", ",", "55834574848L", ",", "0L", ",", "0L", "}", ";", "return", "data", ";", "}", "public", "static", "final", "BitSet", "_tokenSet_40", "=", "new", "BitSet", "(", "mk_tokenSet_40", "(", ")", ")", ";", "private", "static", "final", "long", "[", "]", "mk_tokenSet_41", "(", ")", "{", "long", "[", "]", "data", "=", "new", "long", "[", "8", "]", ";", "data", "[", "0", "]", "=", "8658654068738L", ";", "data", "[", "1", "]", "=", "-", "35184376299520L", ";", "data", "[", "2", "]", "=", "-", "6620291452249309185L", ";", "data", "[", "3", "]", "=", "1019L", ";", "return", "data", ";", "}", "public", "static", "final", "BitSet", "_tokenSet_41", "=", "new", "BitSet", "(", "mk_tokenSet_41", "(", ")", ")", ";", "private", "static", "final", "long", "[", "]", "mk_tokenSet_42", "(", ")", "{", "long", "[", "]", "data", "=", "new", "long", "[", "8", "]", ";", "data", "[", "1", "]", "=", "288230376168751104L", ";", "data", "[", "3", "]", "=", "2L", ";", "return", "data", ";", "}", "public", "static", "final", "BitSet", "_tokenSet_42", "=", "new", "BitSet", "(", "mk_tokenSet_42", "(", ")", ")", ";", "private", "static", "final", "long", "[", "]", "mk_tokenSet_43", "(", ")", "{", "long", "[", "]", "data", "=", "new", "long", "[", "16", "]", ";", "data", "[", "0", "]", "=", "-", "16L", ";", "data", "[", "1", "]", "=", "-", "900719925491662849L", ";", "data", "[", "2", "]", "=", "-", "1L", ";", "data", "[", "3", "]", "=", "17179869177L", ";", "return", "data", ";", "}", "public", "static", "final", "BitSet", "_tokenSet_43", "=", "new", "BitSet", "(", "mk_tokenSet_43", "(", ")", ")", ";", "private", "static", "final", "long", "[", "]", "mk_tokenSet_44", "(", ")", "{", "long", "[", "]", "data", "=", "new", "long", "[", "8", "]", ";", "data", "[", "0", "]", "=", "4810363371520L", ";", "data", "[", "1", "]", "=", "35923175691976704L", ";", "data", "[", "3", "]", "=", "512L", ";", "return", "data", ";", "}", "public", "static", "final", "BitSet", "_tokenSet_44", "=", "new", "BitSet", "(", "mk_tokenSet_44", "(", ")", ")", ";", "private", "static", "final", "long", "[", "]", "mk_tokenSet_45", "(", ")", "{", "long", "[", "]", "data", "=", "{", "0L", ",", "35116161171456L", ",", "0L", ",", "0L", "}", ";", "return", "data", ";", "}", "public", "static", "final", "BitSet", "_tokenSet_45", "=", "new", "BitSet", "(", "mk_tokenSet_45", "(", ")", ")", ";", "private", "static", "final", "long", "[", "]", "mk_tokenSet_46", "(", ")", "{", "long", "[", "]", "data", "=", "new", "long", "[", "8", "]", ";", "data", "[", "0", "]", "=", "2L", ";", "data", "[", "1", "]", "=", "99876864L", ";", "data", "[", "3", "]", "=", "512L", ";", "return", "data", ";", "}", "public", "static", "final", "BitSet", "_tokenSet_46", "=", "new", "BitSet", "(", "mk_tokenSet_46", "(", ")", ")", ";", "private", "static", "final", "long", "[", "]", "mk_tokenSet_47", "(", ")", "{", "long", "[", "]", "data", "=", "{", "4810363371520L", ",", "35888059530674176L", ",", "0L", ",", "0L", "}", ";", "return", "data", ";", "}", "public", "static", "final", "BitSet", "_tokenSet_47", "=", "new", "BitSet", "(", "mk_tokenSet_47", "(", ")", ")", ";", "private", "static", "final", "long", "[", "]", "mk_tokenSet_48", "(", ")", "{", "long", "[", "]", "data", "=", "new", "long", "[", "8", "]", ";", "data", "[", "1", "]", "=", "288265494240428032L", ";", "data", "[", "2", "]", "=", "-", "6629298651002732543L", ";", "data", "[", "3", "]", "=", "507L", ";", "return", "data", ";", "}", "public", "static", "final", "BitSet", "_tokenSet_48", "=", "new", "BitSet", "(", "mk_tokenSet_48", "(", ")", ")", ";", "private", "static", "final", "long", "[", "]", "mk_tokenSet_49", "(", ")", "{", "long", "[", "]", "data", "=", "new", "long", "[", "8", "]", ";", "data", "[", "0", "]", "=", "8658654068736L", ";", "data", "[", "1", "]", "=", "-", "72057602627878912L", ";", "data", "[", "2", "]", "=", "-", "2198486384641L", ";", "data", "[", "3", "]", "=", "1019L", ";", "return", "data", ";", "}", "public", "static", "final", "BitSet", "_tokenSet_49", "=", "new", "BitSet", "(", "mk_tokenSet_49", "(", ")", ")", ";", "private", "static", "final", "long", "[", "]", "mk_tokenSet_50", "(", ")", "{", "long", "[", "]", "data", "=", "{", "8658654068736L", ",", "-", "2269849461828894720L", ",", "522092529L", ",", "0L", ",", "0L", ",", "0L", "}", ";", "return", "data", ";", "}", "public", "static", "final", "BitSet", "_tokenSet_50", "=", "new", "BitSet", "(", "mk_tokenSet_50", "(", ")", ")", ";", "private", "static", "final", "long", "[", "]", "mk_tokenSet_51", "(", ")", "{", "long", "[", "]", "data", "=", "new", "long", "[", "8", "]", ";", "data", "[", "1", "]", "=", "2017612641736851456L", ";", "data", "[", "3", "]", "=", "512L", ";", "return", "data", ";", "}", "public", "static", "final", "BitSet", "_tokenSet_51", "=", "new", "BitSet", "(", "mk_tokenSet_51", "(", ")", ")", ";", "private", "static", "final", "long", "[", "]", "mk_tokenSet_52", "(", ")", "{", "long", "[", "]", "data", "=", "new", "long", "[", "8", "]", ";", "data", "[", "0", "]", "=", "4810363371520L", ";", "data", "[", "1", "]", "=", "2053535808749764608L", ";", "data", "[", "3", "]", "=", "512L", ";", "return", "data", ";", "}", "public", "static", "final", "BitSet", "_tokenSet_52", "=", "new", "BitSet", "(", "mk_tokenSet_52", "(", ")", ")", ";", "private", "static", "final", "long", "[", "]", "mk_tokenSet_53", "(", ")", "{", "long", "[", "]", "data", "=", "new", "long", "[", "8", "]", ";", "data", "[", "0", "]", "=", "4810363371522L", ";", "data", "[", "1", "]", "=", "4359378820142694400L", ";", "data", "[", "2", "]", "=", "-", "6629298651002307087L", ";", "data", "[", "3", "]", "=", "1019L", ";", "return", "data", ";", "}", "public", "static", "final", "BitSet", "_tokenSet_53", "=", "new", "BitSet", "(", "mk_tokenSet_53", "(", ")", ")", ";", "private", "static", "final", "long", "[", "]", "mk_tokenSet_54", "(", ")", "{", "long", "[", "]", "data", "=", "new", "long", "[", "8", "]", ";", "data", "[", "0", "]", "=", "2L", ";", "data", "[", "1", "]", "=", "-", "4899881213427187712L", ";", "data", "[", "2", "]", "=", "131104L", ";", "data", "[", "3", "]", "=", "512L", ";", "return", "data", ";", "}", "public", "static", "final", "BitSet", "_tokenSet_54", "=", "new", "BitSet", "(", "mk_tokenSet_54", "(", ")", ")", ";", "private", "static", "final", "long", "[", "]", "mk_tokenSet_55", "(", ")", "{", "long", "[", "]", "data", "=", "{", "4810363371520L", ",", "35888059800289280L", ",", "0L", ",", "0L", "}", ";", "return", "data", ";", "}", "public", "static", "final", "BitSet", "_tokenSet_55", "=", "new", "BitSet", "(", "mk_tokenSet_55", "(", ")", ")", ";", "private", "static", "final", "long", "[", "]", "mk_tokenSet_56", "(", ")", "{", "long", "[", "]", "data", "=", "new", "long", "[", "8", "]", ";", "data", "[", "0", "]", "=", "4810363371520L", ";", "data", "[", "1", "]", "=", "35888059884175360L", ";", "data", "[", "3", "]", "=", "512L", ";", "return", "data", ";", "}", "public", "static", "final", "BitSet", "_tokenSet_56", "=", "new", "BitSet", "(", "mk_tokenSet_56", "(", ")", ")", ";", "private", "static", "final", "long", "[", "]", "mk_tokenSet_57", "(", ")", "{", "long", "[", "]", "data", "=", "new", "long", "[", "8", "]", ";", "data", "[", "1", "]", "=", "1801439859554910208L", ";", "data", "[", "3", "]", "=", "512L", ";", "return", "data", ";", "}", "public", "static", "final", "BitSet", "_tokenSet_57", "=", "new", "BitSet", "(", "mk_tokenSet_57", "(", ")", ")", ";", "private", "static", "final", "long", "[", "]", "mk_tokenSet_58", "(", ")", "{", "long", "[", "]", "data", "=", "new", "long", "[", "8", "]", ";", "data", "[", "1", "]", "=", "1729382265500205056L", ";", "data", "[", "3", "]", "=", "512L", ";", "return", "data", ";", "}", "public", "static", "final", "BitSet", "_tokenSet_58", "=", "new", "BitSet", "(", "mk_tokenSet_58", "(", ")", ")", ";", "private", "static", "final", "long", "[", "]", "mk_tokenSet_59", "(", ")", "{", "long", "[", "]", "data", "=", "new", "long", "[", "8", "]", ";", "data", "[", "0", "]", "=", "4810363371522L", ";", "data", "[", "1", "]", "=", "4359378826553393152L", ";", "data", "[", "2", "]", "=", "131104L", ";", "data", "[", "3", "]", "=", "512L", ";", "return", "data", ";", "}", "public", "static", "final", "BitSet", "_tokenSet_59", "=", "new", "BitSet", "(", "mk_tokenSet_59", "(", ")", ")", ";", "private", "static", "final", "long", "[", "]", "mk_tokenSet_60", "(", ")", "{", "long", "[", "]", "data", "=", "new", "long", "[", "8", "]", ";", "data", "[", "1", "]", "=", "1729382265769689088L", ";", "data", "[", "3", "]", "=", "512L", ";", "return", "data", ";", "}", "public", "static", "final", "BitSet", "_tokenSet_60", "=", "new", "BitSet", "(", "mk_tokenSet_60", "(", ")", ")", ";", "private", "static", "final", "long", "[", "]", "mk_tokenSet_61", "(", ")", "{", "long", "[", "]", "data", "=", "new", "long", "[", "8", "]", ";", "data", "[", "1", "]", "=", "269484032L", ";", "data", "[", "3", "]", "=", "512L", ";", "return", "data", ";", "}", "public", "static", "final", "BitSet", "_tokenSet_61", "=", "new", "BitSet", "(", "mk_tokenSet_61", "(", ")", ")", ";", "private", "static", "final", "long", "[", "]", "mk_tokenSet_62", "(", ")", "{", "long", "[", "]", "data", "=", "new", "long", "[", "8", "]", ";", "data", "[", "1", "]", "=", "2017612642005286912L", ";", "data", "[", "3", "]", "=", "512L", ";", "return", "data", ";", "}", "public", "static", "final", "BitSet", "_tokenSet_62", "=", "new", "BitSet", "(", "mk_tokenSet_62", "(", ")", ")", ";", "private", "static", "final", "long", "[", "]", "mk_tokenSet_63", "(", ")", "{", "long", "[", "]", "data", "=", "new", "long", "[", "8", "]", ";", "data", "[", "1", "]", "=", "2017612633061982208L", ";", "data", "[", "3", "]", "=", "512L", ";", "return", "data", ";", "}", "public", "static", "final", "BitSet", "_tokenSet_63", "=", "new", "BitSet", "(", "mk_tokenSet_63", "(", ")", ")", ";", "private", "static", "final", "long", "[", "]", "mk_tokenSet_64", "(", ")", "{", "long", "[", "]", "data", "=", "new", "long", "[", "8", "]", ";", "data", "[", "0", "]", "=", "4810363371520L", ";", "data", "[", "1", "]", "=", "2053535819510546432L", ";", "data", "[", "2", "]", "=", "-", "6629298651002438191L", ";", "data", "[", "3", "]", "=", "1019L", ";", "return", "data", ";", "}", "public", "static", "final", "BitSet", "_tokenSet_64", "=", "new", "BitSet", "(", "mk_tokenSet_64", "(", ")", ")", ";", "private", "static", "final", "long", "[", "]", "mk_tokenSet_65", "(", ")", "{", "long", "[", "]", "data", "=", "new", "long", "[", "8", "]", ";", "data", "[", "0", "]", "=", "4810363371520L", ";", "data", "[", "1", "]", "=", "2053535810920611840L", ";", "data", "[", "2", "]", "=", "-", "6629298651002438191L", ";", "data", "[", "3", "]", "=", "1019L", ";", "return", "data", ";", "}", "public", "static", "final", "BitSet", "_tokenSet_65", "=", "new", "BitSet", "(", "mk_tokenSet_65", "(", ")", ")", ";", "private", "static", "final", "long", "[", "]", "mk_tokenSet_66", "(", ")", "{", "long", "[", "]", "data", "=", "{", "0L", ",", "2151677952L", ",", "1L", ",", "0L", ",", "0L", ",", "0L", "}", ";", "return", "data", ";", "}", "public", "static", "final", "BitSet", "_tokenSet_66", "=", "new", "BitSet", "(", "mk_tokenSet_66", "(", ")", ")", ";", "private", "static", "final", "long", "[", "]", "mk_tokenSet_67", "(", ")", "{", "long", "[", "]", "data", "=", "new", "long", "[", "8", "]", ";", "data", "[", "1", "]", "=", "35116207308800L", ";", "data", "[", "3", "]", "=", "512L", ";", "return", "data", ";", "}", "public", "static", "final", "BitSet", "_tokenSet_67", "=", "new", "BitSet", "(", "mk_tokenSet_67", "(", ")", ")", ";", "private", "static", "final", "long", "[", "]", "mk_tokenSet_68", "(", ")", "{", "long", "[", "]", "data", "=", "new", "long", "[", "8", "]", ";", "data", "[", "0", "]", "=", "8658654068736L", ";", "data", "[", "1", "]", "=", "-", "36028805608914944L", ";", "data", "[", "2", "]", "=", "-", "1L", ";", "data", "[", "3", "]", "=", "1019L", ";", "return", "data", ";", "}", "public", "static", "final", "BitSet", "_tokenSet_68", "=", "new", "BitSet", "(", "mk_tokenSet_68", "(", ")", ")", ";", "private", "static", "final", "long", "[", "]", "mk_tokenSet_69", "(", ")", "{", "long", "[", "]", "data", "=", "new", "long", "[", "8", "]", ";", "data", "[", "0", "]", "=", "4810363371520L", ";", "data", "[", "1", "]", "=", "1477075058612994048L", ";", "data", "[", "2", "]", "=", "-", "6629298651002438191L", ";", "data", "[", "3", "]", "=", "1019L", ";", "return", "data", ";", "}", "public", "static", "final", "BitSet", "_tokenSet_69", "=", "new", "BitSet", "(", "mk_tokenSet_69", "(", ")", ")", ";", "private", "static", "final", "long", "[", "]", "mk_tokenSet_70", "(", ")", "{", "long", "[", "]", "data", "=", "new", "long", "[", "8", "]", ";", "data", "[", "0", "]", "=", "8658654068738L", ";", "data", "[", "1", "]", "=", "-", "216208023138353152L", ";", "data", "[", "2", "]", "=", "-", "6629298650967179267L", ";", "data", "[", "3", "]", "=", "1019L", ";", "return", "data", ";", "}", "public", "static", "final", "BitSet", "_tokenSet_70", "=", "new", "BitSet", "(", "mk_tokenSet_70", "(", ")", ")", ";", "private", "static", "final", "long", "[", "]", "mk_tokenSet_71", "(", ")", "{", "long", "[", "]", "data", "=", "new", "long", "[", "8", "]", ";", "data", "[", "0", "]", "=", "290133630779394L", ";", "data", "[", "1", "]", "=", "-", "16384L", ";", "data", "[", "2", "]", "=", "-", "1L", ";", "data", "[", "3", "]", "=", "1023L", ";", "return", "data", ";", "}", "public", "static", "final", "BitSet", "_tokenSet_71", "=", "new", "BitSet", "(", "mk_tokenSet_71", "(", ")", ")", ";", "private", "static", "final", "long", "[", "]", "mk_tokenSet_72", "(", ")", "{", "long", "[", "]", "data", "=", "{", "0L", ",", "13893632L", ",", "2L", ",", "0L", ",", "0L", ",", "0L", "}", ";", "return", "data", ";", "}", "public", "static", "final", "BitSet", "_tokenSet_72", "=", "new", "BitSet", "(", "mk_tokenSet_72", "(", ")", ")", ";", "private", "static", "final", "long", "[", "]", "mk_tokenSet_73", "(", ")", "{", "long", "[", "]", "data", "=", "new", "long", "[", "8", "]", ";", "data", "[", "1", "]", "=", "108086399647875072L", ";", "data", "[", "2", "]", "=", "4L", ";", "data", "[", "3", "]", "=", "512L", ";", "return", "data", ";", "}", "public", "static", "final", "BitSet", "_tokenSet_73", "=", "new", "BitSet", "(", "mk_tokenSet_73", "(", ")", ")", ";", "private", "static", "final", "long", "[", "]", "mk_tokenSet_74", "(", ")", "{", "long", "[", "]", "data", "=", "new", "long", "[", "8", "]", ";", "data", "[", "0", "]", "=", "137438953472L", ";", "data", "[", "1", "]", "=", "35115922227200L", ";", "data", "[", "2", "]", "=", "6L", ";", "data", "[", "3", "]", "=", "512L", ";", "return", "data", ";", "}", "public", "static", "final", "BitSet", "_tokenSet_74", "=", "new", "BitSet", "(", "mk_tokenSet_74", "(", ")", ")", ";", "private", "static", "final", "long", "[", "]", "mk_tokenSet_75", "(", ")", "{", "long", "[", "]", "data", "=", "new", "long", "[", "8", "]", ";", "data", "[", "0", "]", "=", "4810363371520L", ";", "data", "[", "1", "]", "=", "2125593413556862976L", ";", "data", "[", "2", "]", "=", "-", "6629298651002438185L", ";", "data", "[", "3", "]", "=", "1019L", ";", "return", "data", ";", "}", "public", "static", "final", "BitSet", "_tokenSet_75", "=", "new", "BitSet", "(", "mk_tokenSet_75", "(", ")", ")", ";", "private", "static", "final", "long", "[", "]", "mk_tokenSet_76", "(", ")", "{", "long", "[", "]", "data", "=", "new", "long", "[", "8", "]", ";", "data", "[", "0", "]", "=", "4810363371520L", ";", "data", "[", "1", "]", "=", "1477075058378080256L", ";", "data", "[", "2", "]", "=", "-", "6629298651002700799L", ";", "data", "[", "3", "]", "=", "507L", ";", "return", "data", ";", "}", "public", "static", "final", "BitSet", "_tokenSet_76", "=", "new", "BitSet", "(", "mk_tokenSet_76", "(", ")", ")", ";", "private", "static", "final", "long", "[", "]", "mk_tokenSet_77", "(", ")", "{", "long", "[", "]", "data", "=", "new", "long", "[", "8", "]", ";", "data", "[", "0", "]", "=", "8658654068736L", ";", "data", "[", "1", "]", "=", "-", "8589950976L", ";", "data", "[", "2", "]", "=", "-", "1L", ";", "data", "[", "3", "]", "=", "1019L", ";", "return", "data", ";", "}", "public", "static", "final", "BitSet", "_tokenSet_77", "=", "new", "BitSet", "(", "mk_tokenSet_77", "(", ")", ")", ";", "private", "static", "final", "long", "[", "]", "mk_tokenSet_78", "(", ")", "{", "long", "[", "]", "data", "=", "new", "long", "[", "8", "]", ";", "data", "[", "0", "]", "=", "4810363371520L", ";", "data", "[", "1", "]", "=", "35923175532855296L", ";", "data", "[", "2", "]", "=", "520L", ";", "data", "[", "3", "]", "=", "512L", ";", "return", "data", ";", "}", "public", "static", "final", "BitSet", "_tokenSet_78", "=", "new", "BitSet", "(", "mk_tokenSet_78", "(", ")", ")", ";", "private", "static", "final", "long", "[", "]", "mk_tokenSet_79", "(", ")", "{", "long", "[", "]", "data", "=", "new", "long", "[", "8", "]", ";", "data", "[", "0", "]", "=", "4810363371520L", ";", "data", "[", "1", "]", "=", "35923175532855296L", ";", "data", "[", "3", "]", "=", "512L", ";", "return", "data", ";", "}", "public", "static", "final", "BitSet", "_tokenSet_79", "=", "new", "BitSet", "(", "mk_tokenSet_79", "(", ")", ")", ";", "private", "static", "final", "long", "[", "]", "mk_tokenSet_80", "(", ")", "{", "long", "[", "]", "data", "=", "new", "long", "[", "8", "]", ";", "data", "[", "1", "]", "=", "288230376151711744L", ";", "data", "[", "2", "]", "=", "524288L", ";", "data", "[", "3", "]", "=", "512L", ";", "return", "data", ";", "}", "public", "static", "final", "BitSet", "_tokenSet_80", "=", "new", "BitSet", "(", "mk_tokenSet_80", "(", ")", ")", ";", "private", "static", "final", "long", "[", "]", "mk_tokenSet_81", "(", ")", "{", "long", "[", "]", "data", "=", "new", "long", "[", "8", "]", ";", "data", "[", "1", "]", "=", "288265493971992576L", ";", "data", "[", "2", "]", "=", "-", "6629298651002732543L", ";", "data", "[", "3", "]", "=", "1019L", ";", "return", "data", ";", "}", "public", "static", "final", "BitSet", "_tokenSet_81", "=", "new", "BitSet", "(", "mk_tokenSet_81", "(", ")", ")", ";", "private", "static", "final", "long", "[", "]", "mk_tokenSet_82", "(", ")", "{", "long", "[", "]", "data", "=", "new", "long", "[", "8", "]", ";", "data", "[", "0", "]", "=", "2L", ";", "data", "[", "1", "]", "=", "4071254071733387264L", ";", "data", "[", "2", "]", "=", "131104L", ";", "data", "[", "3", "]", "=", "512L", ";", "return", "data", ";", "}", "public", "static", "final", "BitSet", "_tokenSet_82", "=", "new", "BitSet", "(", "mk_tokenSet_82", "(", ")", ")", ";", "private", "static", "final", "long", "[", "]", "mk_tokenSet_83", "(", ")", "{", "long", "[", "]", "data", "=", "new", "long", "[", "8", "]", ";", "data", "[", "0", "]", "=", "4810363371520L", ";", "data", "[", "1", "]", "=", "324153553771233280L", ";", "data", "[", "2", "]", "=", "-", "6629298651002700799L", ";", "data", "[", "3", "]", "=", "507L", ";", "return", "data", ";", "}", "public", "static", "final", "BitSet", "_tokenSet_83", "=", "new", "BitSet", "(", "mk_tokenSet_83", "(", ")", ")", ";", "private", "static", "final", "long", "[", "]", "mk_tokenSet_84", "(", ")", "{", "long", "[", "]", "data", "=", "{", "0L", ",", "51539607552L", ",", "252201579132747776L", ",", "0L", ",", "0L", ",", "0L", "}", ";", "return", "data", ";", "}", "public", "static", "final", "BitSet", "_tokenSet_84", "=", "new", "BitSet", "(", "mk_tokenSet_84", "(", ")", ")", ";", "private", "static", "final", "long", "[", "]", "mk_tokenSet_85", "(", ")", "{", "long", "[", "]", "data", "=", "new", "long", "[", "8", "]", ";", "data", "[", "0", "]", "=", "-", "16L", ";", "data", "[", "1", "]", "=", "-", "288230376151711745L", ";", "data", "[", "2", "]", "=", "-", "1L", ";", "data", "[", "3", "]", "=", "17179869183L", ";", "return", "data", ";", "}", "public", "static", "final", "BitSet", "_tokenSet_85", "=", "new", "BitSet", "(", "mk_tokenSet_85", "(", ")", ")", ";", "private", "static", "final", "long", "[", "]", "mk_tokenSet_86", "(", ")", "{", "long", "[", "]", "data", "=", "new", "long", "[", "8", "]", ";", "data", "[", "0", "]", "=", "8658654068736L", ";", "data", "[", "1", "]", "=", "-", "1981619085658046464L", ";", "data", "[", "2", "]", "=", "-", "6629298650967179279L", ";", "data", "[", "3", "]", "=", "507L", ";", "return", "data", ";", "}", "public", "static", "final", "BitSet", "_tokenSet_86", "=", "new", "BitSet", "(", "mk_tokenSet_86", "(", ")", ")", ";", "private", "static", "final", "long", "[", "]", "mk_tokenSet_87", "(", ")", "{", "long", "[", "]", "data", "=", "new", "long", "[", "8", "]", ";", "data", "[", "1", "]", "=", "288265493971992576L", ";", "data", "[", "2", "]", "=", "486539265L", ";", "data", "[", "3", "]", "=", "506L", ";", "return", "data", ";", "}", "public", "static", "final", "BitSet", "_tokenSet_87", "=", "new", "BitSet", "(", "mk_tokenSet_87", "(", ")", ")", ";", "private", "static", "final", "long", "[", "]", "mk_tokenSet_88", "(", ")", "{", "long", "[", "]", "data", "=", "new", "long", "[", "8", "]", ";", "data", "[", "0", "]", "=", "8658654068738L", ";", "data", "[", "1", "]", "=", "-", "216172838485245952L", ";", "data", "[", "2", "]", "=", "-", "6629298650952499201L", ";", "data", "[", "3", "]", "=", "1019L", ";", "return", "data", ";", "}", "public", "static", "final", "BitSet", "_tokenSet_88", "=", "new", "BitSet", "(", "mk_tokenSet_88", "(", ")", ")", ";", "private", "static", "final", "long", "[", "]", "mk_tokenSet_89", "(", ")", "{", "long", "[", "]", "data", "=", "new", "long", "[", "8", "]", ";", "data", "[", "1", "]", "=", "288230376177139712L", ";", "data", "[", "2", "]", "=", "14680064L", ";", "data", "[", "3", "]", "=", "512L", ";", "return", "data", ";", "}", "public", "static", "final", "BitSet", "_tokenSet_89", "=", "new", "BitSet", "(", "mk_tokenSet_89", "(", ")", ")", ";", "private", "static", "final", "long", "[", "]", "mk_tokenSet_90", "(", ")", "{", "long", "[", "]", "data", "=", "new", "long", "[", "8", "]", ";", "data", "[", "0", "]", "=", "8658654068736L", ";", "data", "[", "1", "]", "=", "-", "216172847075180544L", ";", "data", "[", "2", "]", "=", "-", "6629298650952499209L", ";", "data", "[", "3", "]", "=", "1019L", ";", "return", "data", ";", "}", "public", "static", "final", "BitSet", "_tokenSet_90", "=", "new", "BitSet", "(", "mk_tokenSet_90", "(", ")", ")", ";", "private", "static", "final", "long", "[", "]", "mk_tokenSet_91", "(", ")", "{", "long", "[", "]", "data", "=", "new", "long", "[", "8", "]", ";", "data", "[", "0", "]", "=", "4810363371522L", ";", "data", "[", "1", "]", "=", "324153553771233280L", ";", "data", "[", "2", "]", "=", "-", "6629298651002700799L", ";", "data", "[", "3", "]", "=", "507L", ";", "return", "data", ";", "}", "public", "static", "final", "BitSet", "_tokenSet_91", "=", "new", "BitSet", "(", "mk_tokenSet_91", "(", ")", ")", ";", "private", "static", "final", "long", "[", "]", "mk_tokenSet_92", "(", ")", "{", "long", "[", "]", "data", "=", "new", "long", "[", "8", "]", ";", "data", "[", "0", "]", "=", "8658654068738L", ";", "data", "[", "1", "]", "=", "-", "36028797018980352L", ";", "data", "[", "2", "]", "=", "-", "1L", ";", "data", "[", "3", "]", "=", "1019L", ";", "return", "data", ";", "}", "public", "static", "final", "BitSet", "_tokenSet_92", "=", "new", "BitSet", "(", "mk_tokenSet_92", "(", ")", ")", ";", "private", "static", "final", "long", "[", "]", "mk_tokenSet_93", "(", ")", "{", "long", "[", "]", "data", "=", "new", "long", "[", "8", "]", ";", "data", "[", "0", "]", "=", "8658654068736L", ";", "data", "[", "1", "]", "=", "-", "1981619085658046464L", ";", "data", "[", "2", "]", "=", "-", "6629298650967179279L", ";", "data", "[", "3", "]", "=", "1019L", ";", "return", "data", ";", "}", "public", "static", "final", "BitSet", "_tokenSet_93", "=", "new", "BitSet", "(", "mk_tokenSet_93", "(", ")", ")", ";", "private", "static", "final", "long", "[", "]", "mk_tokenSet_94", "(", ")", "{", "long", "[", "]", "data", "=", "new", "long", "[", "8", "]", ";", "data", "[", "0", "]", "=", "8658654068736L", ";", "data", "[", "1", "]", "=", "-", "1981619085658046464L", ";", "data", "[", "2", "]", "=", "522092529L", ";", "data", "[", "3", "]", "=", "506L", ";", "return", "data", ";", "}", "public", "static", "final", "BitSet", "_tokenSet_94", "=", "new", "BitSet", "(", "mk_tokenSet_94", "(", ")", ")", ";", "private", "static", "final", "long", "[", "]", "mk_tokenSet_95", "(", ")", "{", "long", "[", "]", "data", "=", "new", "long", "[", "8", "]", ";", "data", "[", "0", "]", "=", "8658654068736L", ";", "data", "[", "1", "]", "=", "-", "252201644102533120L", ";", "data", "[", "2", "]", "=", "-", "6629298650967179265L", ";", "data", "[", "3", "]", "=", "1019L", ";", "return", "data", ";", "}", "public", "static", "final", "BitSet", "_tokenSet_95", "=", "new", "BitSet", "(", "mk_tokenSet_95", "(", ")", ")", ";", "private", "static", "final", "long", "[", "]", "mk_tokenSet_96", "(", ")", "{", "long", "[", "]", "data", "=", "{", "8658654068736L", ",", "-", "2269849461829943296L", ",", "522092529L", ",", "0L", ",", "0L", ",", "0L", "}", ";", "return", "data", ";", "}", "public", "static", "final", "BitSet", "_tokenSet_96", "=", "new", "BitSet", "(", "mk_tokenSet_96", "(", ")", ")", ";", "private", "static", "final", "long", "[", "]", "mk_tokenSet_97", "(", ")", "{", "long", "[", "]", "data", "=", "{", "0L", ",", "8388608L", ",", "6291456L", ",", "0L", ",", "0L", ",", "0L", "}", ";", "return", "data", ";", "}", "public", "static", "final", "BitSet", "_tokenSet_97", "=", "new", "BitSet", "(", "mk_tokenSet_97", "(", ")", ")", ";", "private", "static", "final", "long", "[", "]", "mk_tokenSet_98", "(", ")", "{", "long", "[", "]", "data", "=", "new", "long", "[", "8", "]", ";", "data", "[", "0", "]", "=", "8658654068738L", ";", "data", "[", "1", "]", "=", "-", "268451840L", ";", "data", "[", "2", "]", "=", "-", "3L", ";", "data", "[", "3", "]", "=", "1019L", ";", "return", "data", ";", "}", "public", "static", "final", "BitSet", "_tokenSet_98", "=", "new", "BitSet", "(", "mk_tokenSet_98", "(", ")", ")", ";", "private", "static", "final", "long", "[", "]", "mk_tokenSet_99", "(", ")", "{", "long", "[", "]", "data", "=", "{", "0L", ",", "4299161600L", ",", "27021597764223488L", ",", "0L", ",", "0L", ",", "0L", "}", ";", "return", "data", ";", "}", "public", "static", "final", "BitSet", "_tokenSet_99", "=", "new", "BitSet", "(", "mk_tokenSet_99", "(", ")", ")", ";", "private", "static", "final", "long", "[", "]", "mk_tokenSet_100", "(", ")", "{", "long", "[", "]", "data", "=", "new", "long", "[", "8", "]", ";", "data", "[", "1", "]", "=", "35115653660672L", ";", "data", "[", "3", "]", "=", "512L", ";", "return", "data", ";", "}", "public", "static", "final", "BitSet", "_tokenSet_100", "=", "new", "BitSet", "(", "mk_tokenSet_100", "(", ")", ")", ";", "private", "static", "final", "long", "[", "]", "mk_tokenSet_101", "(", ")", "{", "long", "[", "]", "data", "=", "new", "long", "[", "8", "]", ";", "data", "[", "0", "]", "=", "8658654068738L", ";", "data", "[", "1", "]", "=", "-", "35240487698432L", ";", "data", "[", "2", "]", "=", "-", "6620291452249309187L", ";", "data", "[", "3", "]", "=", "1019L", ";", "return", "data", ";", "}", "public", "static", "final", "BitSet", "_tokenSet_101", "=", "new", "BitSet", "(", "mk_tokenSet_101", "(", ")", ")", ";", "private", "static", "final", "long", "[", "]", "mk_tokenSet_102", "(", ")", "{", "long", "[", "]", "data", "=", "{", "0L", ",", "35184372088832L", ",", "1729382256910270464L", ",", "0L", ",", "0L", ",", "0L", "}", ";", "return", "data", ";", "}", "public", "static", "final", "BitSet", "_tokenSet_102", "=", "new", "BitSet", "(", "mk_tokenSet_102", "(", ")", ")", ";", "private", "static", "final", "long", "[", "]", "mk_tokenSet_103", "(", ")", "{", "long", "[", "]", "data", "=", "new", "long", "[", "8", "]", ";", "data", "[", "0", "]", "=", "8658654068738L", ";", "data", "[", "1", "]", "=", "-", "276840448L", ";", "data", "[", "2", "]", "=", "-", "14680067L", ";", "data", "[", "3", "]", "=", "1019L", ";", "return", "data", ";", "}", "public", "static", "final", "BitSet", "_tokenSet_103", "=", "new", "BitSet", "(", "mk_tokenSet_103", "(", ")", ")", ";", "private", "static", "final", "long", "[", "]", "mk_tokenSet_104", "(", ")", "{", "long", "[", "]", "data", "=", "new", "long", "[", "8", "]", ";", "data", "[", "0", "]", "=", "8658654068736L", ";", "data", "[", "1", "]", "=", "-", "1981583901016997888L", ";", "data", "[", "2", "]", "=", "-", "6629298650967179279L", ";", "data", "[", "3", "]", "=", "507L", ";", "return", "data", ";", "}", "public", "static", "final", "BitSet", "_tokenSet_104", "=", "new", "BitSet", "(", "mk_tokenSet_104", "(", ")", ")", ";", "private", "static", "final", "long", "[", "]", "mk_tokenSet_105", "(", ")", "{", "long", "[", "]", "data", "=", "new", "long", "[", "8", "]", ";", "data", "[", "1", "]", "=", "288265493972516864L", ";", "data", "[", "2", "]", "=", "-", "6629298651002732543L", ";", "data", "[", "3", "]", "=", "507L", ";", "return", "data", ";", "}", "public", "static", "final", "BitSet", "_tokenSet_105", "=", "new", "BitSet", "(", "mk_tokenSet_105", "(", ")", ")", ";", "private", "static", "final", "long", "[", "]", "mk_tokenSet_106", "(", ")", "{", "long", "[", "]", "data", "=", "new", "long", "[", "8", "]", ";", "data", "[", "0", "]", "=", "8658654068736L", ";", "data", "[", "1", "]", "=", "-", "16384L", ";", "data", "[", "2", "]", "=", "-", "1L", ";", "data", "[", "3", "]", "=", "1019L", ";", "return", "data", ";", "}", "public", "static", "final", "BitSet", "_tokenSet_106", "=", "new", "BitSet", "(", "mk_tokenSet_106", "(", ")", ")", ";", "}", "</s>" ]
6,622
[ "<s>", "package", "org", ".", "codehaus", ".", "groovy", ".", "antlr", ";", "import", "java", ".", "util", ".", "ArrayList", ";", "import", "java", ".", "util", ".", "List", ";", "public", "class", "SourceBuffer", "{", "private", "final", "List", "<", "StringBuilder", ">", "lines", ";", "private", "StringBuilder", "current", ";", "private", "final", "List", "<", "Integer", ">", "lineEndings", ";", "private", "UnicodeEscapingReader", "unescaper", ";", "public", "SourceBuffer", "(", ")", "{", "lines", "=", "new", "ArrayList", "<", "StringBuilder", ">", "(", ")", ";", "lineEndings", "=", "new", "ArrayList", "<", "Integer", ">", "(", ")", ";", "lineEndings", ".", "add", "(", "0", ")", ";", "unescaper", "=", "new", "NoEscaper", "(", ")", ";", "current", "=", "new", "StringBuilder", "(", ")", ";", "lines", ".", "add", "(", "current", ")", ";", "}", "public", "String", "getSnippet", "(", "LineColumn", "start", ",", "LineColumn", "end", ")", "{", "if", "(", "start", "==", "null", "||", "end", "==", "null", ")", "{", "return", "null", ";", "}", "if", "(", "start", ".", "equals", "(", "end", ")", ")", "{", "return", "null", ";", "}", "if", "(", "lines", ".", "size", "(", ")", "==", "1", "&&", "current", ".", "length", "(", ")", "==", "0", ")", "{", "return", "null", ";", "}", "int", "startLine", "=", "start", ".", "getLine", "(", ")", ";", "int", "startColumn", "=", "start", ".", "getColumn", "(", ")", ";", "int", "endLine", "=", "end", ".", "getLine", "(", ")", ";", "int", "endColumn", "=", "end", ".", "getColumn", "(", ")", ";", "if", "(", "startLine", "<", "1", ")", "{", "startLine", "=", "1", ";", "}", "if", "(", "endLine", "<", "1", ")", "{", "endLine", "=", "1", ";", "}", "if", "(", "startColumn", "<", "1", ")", "{", "startColumn", "=", "1", ";", "}", "if", "(", "endColumn", "<", "1", ")", "{", "endColumn", "=", "1", ";", "}", "if", "(", "startLine", ">", "lines", ".", "size", "(", ")", ")", "{", "startLine", "=", "lines", ".", "size", "(", ")", ";", "}", "if", "(", "endLine", ">", "lines", ".", "size", "(", ")", ")", "{", "endLine", "=", "lines", ".", "size", "(", ")", ";", "}", "StringBuffer", "snippet", "=", "new", "StringBuffer", "(", ")", ";", "for", "(", "int", "i", "=", "startLine", "-", "1", ";", "i", "<", "endLine", ";", "i", "++", ")", "{", "String", "line", "=", "(", "lines", ".", "get", "(", "i", ")", ")", ".", "toString", "(", ")", ";", "if", "(", "startLine", "==", "endLine", ")", "{", "if", "(", "startColumn", ">", "line", ".", "length", "(", ")", ")", "{", "startColumn", "=", "line", ".", "length", "(", ")", ";", "}", "if", "(", "startColumn", "<", "1", ")", "{", "startColumn", "=", "1", ";", "}", "if", "(", "endColumn", ">", "line", ".", "length", "(", ")", ")", "{", "endColumn", "=", "line", ".", "length", "(", ")", "+", "1", ";", "}", "if", "(", "endColumn", "<", "1", ")", "{", "endColumn", "=", "1", ";", "}", "line", "=", "line", ".", "substring", "(", "startColumn", "-", "1", ",", "endColumn", "-", "1", ")", ";", "}", "else", "{", "if", "(", "i", "==", "startLine", "-", "1", ")", "{", "if", "(", "startColumn", "-", "1", "<", "line", ".", "length", "(", ")", ")", "{", "line", "=", "line", ".", "substring", "(", "startColumn", "-", "1", ")", ";", "}", "}", "if", "(", "i", "==", "endLine", "-", "1", ")", "{", "if", "(", "endColumn", "-", "1", "<", "line", ".", "length", "(", ")", ")", "{", "line", "=", "line", ".", "substring", "(", "0", ",", "endColumn", "-", "1", ")", ";", "}", "}", "}", "snippet", ".", "append", "(", "line", ")", ";", "}", "return", "snippet", ".", "toString", "(", ")", ";", "}", "public", "void", "setUnescaper", "(", "UnicodeEscapingReader", "unicodeEscapingReader", ")", "{", "this", ".", "unescaper", "=", "unicodeEscapingReader", ";", "}", "private", "boolean", "prevWasCarriageReturn", "=", "false", ";", "private", "int", "col", "=", "0", ";", "public", "void", "write", "(", "int", "c", ")", "{", "if", "(", "c", "!=", "-", "1", ")", "{", "col", "++", ";", "current", ".", "append", "(", "(", "char", ")", "c", ")", ";", "}", "if", "(", "c", "==", "'\\n'", ")", "{", "if", "(", "!", "prevWasCarriageReturn", ")", "{", "current", "=", "new", "StringBuilder", "(", ")", ";", "lines", ".", "add", "(", "current", ")", ";", "lineEndings", ".", "add", "(", "col", "+", "unescaper", ".", "getUnescapedUnicodeOffsetCount", "(", ")", ")", ";", "}", "else", "{", "current", "=", "new", "StringBuilder", "(", ")", ";", "lines", ".", "get", "(", "lines", ".", "size", "(", ")", "-", "1", ")", ".", "append", "(", "'\\n'", ")", ";", "lineEndings", ".", "remove", "(", "lineEndings", ".", "size", "(", ")", "-", "1", ")", ";", "lineEndings", ".", "add", "(", "col", "+", "unescaper", ".", "getUnescapedUnicodeOffsetCount", "(", ")", ")", ";", "}", "}", "if", "(", "c", "==", "'\\r'", ")", "{", "current", "=", "new", "StringBuilder", "(", ")", ";", "lines", ".", "add", "(", "current", ")", ";", "lineEndings", ".", "add", "(", "col", "+", "unescaper", ".", "getUnescapedUnicodeOffsetCount", "(", ")", ")", ";", "prevWasCarriageReturn", "=", "true", ";", "}", "else", "{", "prevWasCarriageReturn", "=", "false", ";", "}", "}", "public", "LocationSupport", "getLocationSupport", "(", ")", "{", "lineEndings", ".", "add", "(", "col", "+", "unescaper", ".", "getUnescapedUnicodeOffsetCount", "(", ")", ")", ";", "int", "[", "]", "lineEndingsArray", "=", "new", "int", "[", "lineEndings", ".", "size", "(", ")", "]", ";", "for", "(", "int", "i", "=", "0", ",", "max", "=", "lineEndings", ".", "size", "(", ")", ";", "i", "<", "max", ";", "i", "++", ")", "{", "lineEndingsArray", "[", "i", "]", "=", "lineEndings", ".", "get", "(", "i", ")", ".", "intValue", "(", ")", ";", "}", "return", "new", "LocationSupport", "(", "lineEndingsArray", ")", ";", "}", "}", "</s>" ]
6,623
[ "<s>", "package", "org", ".", "codehaus", ".", "groovy", ".", "antlr", ";", "import", "java", ".", "io", ".", "Reader", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "control", ".", "CompilationFailedException", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "control", ".", "SourceUnit", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "syntax", ".", "Reduction", ";", "public", "class", "CSTParserPlugin", "extends", "AntlrParserPlugin", "{", "private", "ICSTReporter", "cstReporter", ";", "CSTParserPlugin", "(", "ICSTReporter", "cstReporter", ")", "{", "this", ".", "cstReporter", "=", "cstReporter", ";", "}", "public", "Reduction", "parseCST", "(", "final", "SourceUnit", "sourceUnit", ",", "Reader", "reader", ")", "throws", "CompilationFailedException", "{", "Reduction", "reduction", "=", "super", ".", "parseCST", "(", "sourceUnit", ",", "reader", ")", ";", "GroovySourceAST", "cst", "=", "(", "GroovySourceAST", ")", "super", ".", "ast", ";", "if", "(", "cst", "!=", "null", ")", "{", "cstReporter", ".", "generatedCST", "(", "sourceUnit", ".", "getName", "(", ")", ",", "cst", ")", ";", "}", "return", "reduction", ";", "}", "}", "</s>" ]
6,624
[ "<s>", "package", "org", ".", "codehaus", ".", "groovy", ".", "antlr", ";", "import", "java", ".", "io", ".", "Reader", ";", "import", "java", ".", "util", ".", "Collections", ";", "import", "java", ".", "util", ".", "List", ";", "import", "java", ".", "util", ".", "Map", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "control", ".", "CompilationFailedException", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "control", ".", "SourceUnit", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "antlr", ".", "parser", ".", "GroovyLexer", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "antlr", ".", "parser", ".", "GroovyRecognizer", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "syntax", ".", "SyntaxException", ";", "import", "antlr", ".", "RecognitionException", ";", "import", "antlr", ".", "TokenStreamException", ";", "import", "antlr", ".", "TokenStreamIOException", ";", "import", "antlr", ".", "TokenStreamRecognitionException", ";", "public", "class", "ErrorRecoveredCSTParserPlugin", "extends", "AntlrParserPlugin", "{", "private", "final", "ICSTReporter", "reporter", ";", "ErrorRecoveredCSTParserPlugin", "(", "ICSTReporter", "reporter", ")", "{", "this", ".", "reporter", "=", "reporter", ";", "}", "@", "Override", "public", "void", "transformCSTIntoAST", "(", "final", "SourceUnit", "sourceUnit", ",", "Reader", "reader", ",", "SourceBuffer", "sourceBuffer", ")", "throws", "CompilationFailedException", "{", "super", ".", "ast", "=", "null", ";", "setController", "(", "sourceUnit", ")", ";", "UnicodeEscapingReader", "unicodeReader", "=", "new", "UnicodeEscapingReader", "(", "reader", ",", "sourceBuffer", ")", ";", "GroovyLexer", "lexer", "=", "new", "GroovyLexer", "(", "new", "UnicodeLexerSharedInputState", "(", "unicodeReader", ")", ")", ";", "unicodeReader", ".", "setLexer", "(", "lexer", ")", ";", "GroovyRecognizer", "parser", "=", "GroovyRecognizer", ".", "make", "(", "lexer", ")", ";", "parser", ".", "setSourceBuffer", "(", "sourceBuffer", ")", ";", "super", ".", "tokenNames", "=", "parser", ".", "getTokenNames", "(", ")", ";", "parser", ".", "setFilename", "(", "sourceUnit", ".", "getName", "(", ")", ")", ";", "try", "{", "parser", ".", "compilationUnit", "(", ")", ";", "configureLocationSupport", "(", "sourceBuffer", ")", ";", "}", "catch", "(", "TokenStreamRecognitionException", "tsre", ")", "{", "configureLocationSupport", "(", "sourceBuffer", ")", ";", "RecognitionException", "e", "=", "tsre", ".", "recog", ";", "SyntaxException", "se", "=", "new", "SyntaxException", "(", "e", ".", "getMessage", "(", ")", ",", "e", ",", "e", ".", "getLine", "(", ")", ",", "e", ".", "getColumn", "(", ")", ")", ";", "se", ".", "setFatal", "(", "true", ")", ";", "sourceUnit", ".", "addError", "(", "se", ")", ";", "}", "catch", "(", "RecognitionException", "e", ")", "{", "configureLocationSupport", "(", "sourceBuffer", ")", ";", "int", "origLine", "=", "e", ".", "getLine", "(", ")", ";", "int", "origColumn", "=", "e", ".", "getColumn", "(", ")", ";", "int", "[", "]", "newInts", "=", "fixLineColumn", "(", "origLine", ",", "origColumn", ")", ";", "int", "newLine", "=", "newInts", "[", "0", "]", ";", "int", "newColumn", "=", "newInts", "[", "1", "]", ";", "SyntaxException", "se", "=", "new", "SyntaxException", "(", "e", ".", "getMessage", "(", ")", ",", "e", ",", "newLine", ",", "newColumn", ")", ";", "se", ".", "setFatal", "(", "true", ")", ";", "sourceUnit", ".", "addError", "(", "se", ")", ";", "}", "catch", "(", "TokenStreamException", "e", ")", "{", "configureLocationSupport", "(", "sourceBuffer", ")", ";", "boolean", "handled", "=", "false", ";", "if", "(", "e", "instanceof", "TokenStreamIOException", ")", "{", "TokenStreamIOException", "tsioe", "=", "(", "TokenStreamIOException", ")", "e", ";", "String", "m", "=", "e", ".", "getMessage", "(", ")", ";", "if", "(", "m", "!=", "null", "&&", "m", ".", "startsWith", "(", "\"\"", ")", ")", "{", "try", "{", "int", "linepos", "=", "m", ".", "indexOf", "(", "\"line:\"", ")", ";", "int", "colpos", "=", "m", ".", "indexOf", "(", "\"col:\"", ")", ";", "int", "line", "=", "Integer", ".", "valueOf", "(", "m", ".", "substring", "(", "linepos", "+", "5", ",", "colpos", ")", ".", "trim", "(", ")", ")", ";", "int", "col", "=", "Integer", ".", "valueOf", "(", "m", ".", "substring", "(", "colpos", "+", "4", ")", ".", "trim", "(", ")", ")", ";", "SyntaxException", "se", "=", "new", "SyntaxException", "(", "e", ".", "getMessage", "(", ")", ",", "e", ",", "line", ",", "col", ")", ";", "se", ".", "setFatal", "(", "true", ")", ";", "sourceUnit", ".", "addError", "(", "se", ")", ";", "handled", "=", "true", ";", "}", "catch", "(", "Throwable", "t", ")", "{", "System", ".", "err", ".", "println", "(", "m", ")", ";", "t", ".", "printStackTrace", "(", "System", ".", "err", ")", ";", "}", "}", "}", "if", "(", "!", "handled", ")", "{", "sourceUnit", ".", "addException", "(", "e", ")", ";", "}", "}", "super", ".", "ast", "=", "parser", ".", "getAST", "(", ")", ";", "sourceUnit", ".", "setComments", "(", "parser", ".", "getComments", "(", ")", ")", ";", "reportCST", "(", "sourceUnit", ",", "parser", ")", ";", "}", "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "private", "void", "reportCST", "(", "final", "SourceUnit", "sourceUnit", ",", "final", "GroovyRecognizer", "parser", ")", "{", "final", "List", "errorList", "=", "parser", ".", "getErrorList", "(", ")", ";", "final", "GroovySourceAST", "cst", "=", "(", "GroovySourceAST", ")", "parser", ".", "getAST", "(", ")", ";", "if", "(", "reporter", "!=", "null", ")", "{", "if", "(", "cst", "!=", "null", ")", "reporter", ".", "generatedCST", "(", "sourceUnit", ".", "getName", "(", ")", ",", "cst", ")", ";", "if", "(", "errorList", ".", "size", "(", ")", "!=", "0", ")", "reporter", ".", "reportErrors", "(", "sourceUnit", ".", "getName", "(", ")", ",", "Collections", ".", "unmodifiableList", "(", "errorList", ")", ")", ";", "}", "else", "{", "for", "(", "Map", "<", "String", ",", "Object", ">", "error", ":", "(", "List", "<", "Map", "<", "String", ",", "Object", ">", ">", ")", "errorList", ")", "{", "int", "origLine", "=", "(", "(", "Integer", ")", "error", ".", "get", "(", "\"line\"", ")", ")", ".", "intValue", "(", ")", ";", "int", "origColumn", "=", "(", "(", "Integer", ")", "error", ".", "get", "(", "\"column\"", ")", ")", ".", "intValue", "(", ")", ";", "int", "[", "]", "newInts", "=", "fixLineColumn", "(", "origLine", ",", "origColumn", ")", ";", "int", "newLine", "=", "newInts", "[", "0", "]", ";", "int", "newColumn", "=", "newInts", "[", "1", "]", ";", "SyntaxException", "se", "=", "new", "SyntaxException", "(", "(", "String", ")", "error", ".", "get", "(", "\"error\"", ")", ",", "newLine", ",", "newColumn", ")", ";", "sourceUnit", ".", "addError", "(", "se", ")", ";", "}", "}", "}", "private", "int", "[", "]", "fixLineColumn", "(", "int", "origLine", ",", "int", "origColumn", ")", "{", "if", "(", "locations", ".", "isPopulated", "(", ")", ")", "{", "int", "offset", "=", "locations", ".", "findOffset", "(", "origLine", ",", "origColumn", ")", ";", "if", "(", "offset", ">=", "locations", ".", "getEnd", "(", ")", "-", "1", ")", "{", "return", "locations", ".", "getRowCol", "(", "locations", ".", "getEnd", "(", ")", "-", "1", ")", ";", "}", "}", "return", "new", "int", "[", "]", "{", "origLine", ",", "origColumn", "}", ";", "}", "}", "</s>" ]
6,625
[ "<s>", "package", "org", ".", "codehaus", ".", "groovy", ".", "antlr", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "control", ".", "ParserPlugin", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "control", ".", "ParserPluginFactory", ";", "public", "class", "CSTParserPluginFactory", "extends", "ParserPluginFactory", "{", "private", "ICSTReporter", "cstReporter", ";", "public", "CSTParserPluginFactory", "(", "ICSTReporter", "cstReporter", ")", "{", "this", ".", "cstReporter", "=", "cstReporter", ";", "}", "public", "ParserPlugin", "createParserPlugin", "(", ")", "{", "return", "new", "CSTParserPlugin", "(", "cstReporter", ")", ";", "}", "}", "</s>" ]
6,626
[ "<s>", "package", "org", ".", "codehaus", ".", "groovy", ".", "classgen", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "GroovyBugError", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "*", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "Variable", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "expr", ".", "*", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "stmt", ".", "BlockStatement", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "stmt", ".", "CatchStatement", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "stmt", ".", "ForStatement", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "stmt", ".", "Statement", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "control", ".", "SourceUnit", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "syntax", ".", "Types", ";", "import", "java", ".", "util", ".", "Iterator", ";", "import", "java", ".", "util", ".", "LinkedList", ";", "import", "java", ".", "util", ".", "List", ";", "import", "java", ".", "util", ".", "Map", ";", "import", "static", "java", ".", "lang", ".", "reflect", ".", "Modifier", ".", "isFinal", ";", "public", "class", "VariableScopeVisitor", "extends", "ClassCodeVisitorSupport", "{", "private", "VariableScope", "currentScope", "=", "null", ";", "private", "VariableScope", "headScope", "=", "new", "VariableScope", "(", ")", ";", "private", "ClassNode", "currentClass", "=", "null", ";", "private", "SourceUnit", "source", ";", "private", "boolean", "inPropertyExpression", "=", "false", ";", "private", "boolean", "isSpecialConstructorCall", "=", "false", ";", "private", "boolean", "inConstructor", "=", "false", ";", "private", "LinkedList", "stateStack", "=", "new", "LinkedList", "(", ")", ";", "private", "class", "StateStackElement", "{", "VariableScope", "scope", ";", "ClassNode", "clazz", ";", "boolean", "inConstructor", ";", "StateStackElement", "(", ")", "{", "scope", "=", "VariableScopeVisitor", ".", "this", ".", "currentScope", ";", "clazz", "=", "VariableScopeVisitor", ".", "this", ".", "currentClass", ";", "inConstructor", "=", "VariableScopeVisitor", ".", "this", ".", "inConstructor", ";", "}", "}", "public", "VariableScopeVisitor", "(", "SourceUnit", "source", ")", "{", "this", ".", "source", "=", "source", ";", "currentScope", "=", "headScope", ";", "}", "private", "void", "pushState", "(", "boolean", "isStatic", ")", "{", "stateStack", ".", "add", "(", "new", "StateStackElement", "(", ")", ")", ";", "currentScope", "=", "new", "VariableScope", "(", "currentScope", ")", ";", "currentScope", ".", "setInStaticContext", "(", "isStatic", ")", ";", "}", "private", "void", "pushState", "(", ")", "{", "pushState", "(", "currentScope", ".", "isInStaticContext", "(", ")", ")", ";", "}", "private", "void", "popState", "(", ")", "{", "StateStackElement", "element", "=", "(", "StateStackElement", ")", "stateStack", ".", "removeLast", "(", ")", ";", "currentScope", "=", "element", ".", "scope", ";", "currentClass", "=", "element", ".", "clazz", ";", "inConstructor", "=", "element", ".", "inConstructor", ";", "}", "private", "void", "declare", "(", "Parameter", "[", "]", "parameters", ",", "ASTNode", "node", ")", "{", "for", "(", "Parameter", "parameter", ":", "parameters", ")", "{", "if", "(", "parameter", ".", "hasInitialExpression", "(", ")", ")", "{", "parameter", ".", "getInitialExpression", "(", ")", ".", "visit", "(", "this", ")", ";", "}", "declare", "(", "parameter", ",", "node", ")", ";", "}", "}", "private", "void", "declare", "(", "VariableExpression", "vex", ")", "{", "vex", ".", "setInStaticContext", "(", "currentScope", ".", "isInStaticContext", "(", ")", ")", ";", "declare", "(", "vex", ",", "vex", ")", ";", "vex", ".", "setAccessedVariable", "(", "vex", ")", ";", "}", "private", "void", "declare", "(", "Variable", "var", ",", "ASTNode", "expr", ")", "{", "String", "scopeType", "=", "\"scope\"", ";", "String", "variableType", "=", "\"variable\"", ";", "if", "(", "expr", ".", "getClass", "(", ")", "==", "FieldNode", ".", "class", ")", "{", "scopeType", "=", "\"class\"", ";", "variableType", "=", "\"field\"", ";", "}", "else", "if", "(", "expr", ".", "getClass", "(", ")", "==", "PropertyNode", ".", "class", ")", "{", "scopeType", "=", "\"class\"", ";", "variableType", "=", "\"property\"", ";", "}", "StringBuilder", "msg", "=", "new", "StringBuilder", "(", ")", ";", "msg", ".", "append", "(", "\"The", "current", "\"", ")", ".", "append", "(", "scopeType", ")", ";", "msg", ".", "append", "(", "\"\"", ")", ".", "append", "(", "variableType", ")", ";", "msg", ".", "append", "(", "\"\"", ")", ".", "append", "(", "var", ".", "getName", "(", ")", ")", ";", "if", "(", "currentScope", ".", "getDeclaredVariable", "(", "var", ".", "getName", "(", ")", ")", "!=", "null", ")", "{", "addError", "(", "msg", ".", "toString", "(", ")", ",", "expr", ")", ";", "return", ";", "}", "for", "(", "VariableScope", "scope", "=", "currentScope", ".", "getParent", "(", ")", ";", "scope", "!=", "null", ";", "scope", "=", "scope", ".", "getParent", "(", ")", ")", "{", "if", "(", "scope", ".", "getClassScope", "(", ")", "!=", "null", ")", "break", ";", "if", "(", "scope", ".", "getDeclaredVariable", "(", "var", ".", "getName", "(", ")", ")", "!=", "null", ")", "{", "addError", "(", "msg", ".", "toString", "(", ")", ",", "expr", ")", ";", "break", ";", "}", "}", "currentScope", ".", "putDeclaredVariable", "(", "var", ")", ";", "}", "protected", "SourceUnit", "getSourceUnit", "(", ")", "{", "return", "source", ";", "}", "private", "Variable", "findClassMember", "(", "ClassNode", "cn", ",", "String", "name", ")", "{", "if", "(", "cn", "==", "null", ")", "return", "null", ";", "if", "(", "cn", ".", "isScript", "(", ")", ")", "{", "return", "new", "DynamicVariable", "(", "name", ",", "false", ")", ";", "}", "for", "(", "FieldNode", "fn", ":", "cn", ".", "getFields", "(", ")", ")", "{", "if", "(", "fn", ".", "getName", "(", ")", ".", "equals", "(", "name", ")", ")", "return", "fn", ";", "}", "for", "(", "MethodNode", "mn", ":", "cn", ".", "getMethods", "(", ")", ")", "{", "String", "pName", "=", "getPropertyName", "(", "mn", ")", ";", "if", "(", "pName", "!=", "null", "&&", "pName", ".", "equals", "(", "name", ")", ")", "{", "PropertyNode", "property", "=", "new", "PropertyNode", "(", "pName", ",", "mn", ".", "getModifiers", "(", ")", ",", "getPropertyType", "(", "mn", ")", ",", "cn", ",", "null", ",", "null", ",", "null", ")", ";", "property", ".", "setDeclaringClass", "(", "cn", ")", ";", "property", ".", "getField", "(", ")", ".", "setDeclaringClass", "(", "cn", ")", ";", "return", "property", ";", "}", "}", "for", "(", "PropertyNode", "pn", ":", "cn", ".", "getProperties", "(", ")", ")", "{", "if", "(", "pn", ".", "getName", "(", ")", ".", "equals", "(", "name", ")", ")", "return", "pn", ";", "}", "Variable", "ret", "=", "findClassMember", "(", "cn", ".", "getSuperClass", "(", ")", ",", "name", ")", ";", "if", "(", "ret", "!=", "null", ")", "return", "ret", ";", "return", "findClassMember", "(", "cn", ".", "getOuterClass", "(", ")", ",", "name", ")", ";", "}", "private", "ClassNode", "getPropertyType", "(", "MethodNode", "m", ")", "{", "if", "(", "m", ".", "getReturnType", "(", ")", "!=", "ClassHelper", ".", "VOID_TYPE", ")", "{", "return", "m", ".", "getReturnType", "(", ")", ";", "}", "return", "m", ".", "getParameters", "(", ")", "[", "0", "]", ".", "getType", "(", ")", ";", "}", "private", "String", "getPropertyName", "(", "MethodNode", "m", ")", "{", "String", "name", "=", "m", ".", "getName", "(", ")", ";", "if", "(", "!", "(", "name", ".", "startsWith", "(", "\"set\"", ")", "||", "name", ".", "startsWith", "(", "\"get\"", ")", ")", ")", "return", "null", ";", "String", "pname", "=", "name", ".", "substring", "(", "3", ")", ";", "if", "(", "pname", ".", "length", "(", ")", "==", "0", ")", "return", "null", ";", "pname", "=", "java", ".", "beans", ".", "Introspector", ".", "decapitalize", "(", "pname", ")", ";", "if", "(", "name", ".", "startsWith", "(", "\"get\"", ")", "&&", "(", "m", ".", "getReturnType", "(", ")", "==", "ClassHelper", ".", "VOID_TYPE", "||", "m", ".", "getParameters", "(", ")", ".", "length", "!=", "0", ")", ")", "{", "return", "null", ";", "}", "if", "(", "name", ".", "startsWith", "(", "\"set\"", ")", "&&", "m", ".", "getParameters", "(", ")", ".", "length", "!=", "1", ")", "{", "return", "null", ";", "}", "return", "pname", ";", "}", "private", "Variable", "checkVariableNameForDeclaration", "(", "String", "name", ",", "Expression", "expression", ")", "{", "if", "(", "\"super\"", ".", "equals", "(", "name", ")", "||", "\"this\"", ".", "equals", "(", "name", ")", ")", "return", "null", ";", "VariableScope", "scope", "=", "currentScope", ";", "Variable", "var", "=", "new", "DynamicVariable", "(", "name", ",", "currentScope", ".", "isInStaticContext", "(", ")", ")", ";", "while", "(", "true", ")", "{", "Variable", "var1", ";", "var1", "=", "scope", ".", "getDeclaredVariable", "(", "var", ".", "getName", "(", ")", ")", ";", "if", "(", "var1", "!=", "null", ")", "{", "var", "=", "var1", ";", "break", ";", "}", "var1", "=", "scope", ".", "getReferencedLocalVariable", "(", "var", ".", "getName", "(", ")", ")", ";", "if", "(", "var1", "!=", "null", ")", "{", "var", "=", "var1", ";", "break", ";", "}", "var1", "=", "scope", ".", "getReferencedClassVariable", "(", "var", ".", "getName", "(", ")", ")", ";", "if", "(", "var1", "!=", "null", ")", "{", "var", "=", "var1", ";", "break", ";", "}", "ClassNode", "classScope", "=", "scope", ".", "getClassScope", "(", ")", ";", "if", "(", "classScope", "!=", "null", ")", "{", "Variable", "member", "=", "findClassMember", "(", "classScope", ",", "var", ".", "getName", "(", ")", ")", ";", "if", "(", "member", "!=", "null", ")", "{", "boolean", "staticScope", "=", "currentScope", ".", "isInStaticContext", "(", ")", "||", "isSpecialConstructorCall", ";", "boolean", "staticMember", "=", "member", ".", "isInStaticContext", "(", ")", ";", "if", "(", "!", "(", "staticScope", "&&", "!", "staticMember", ")", ")", "var", "=", "member", ";", "}", "break", ";", "}", "scope", "=", "scope", ".", "getParent", "(", ")", ";", "}", "VariableScope", "end", "=", "scope", ";", "scope", "=", "currentScope", ";", "while", "(", "scope", "!=", "end", ")", "{", "if", "(", "end", ".", "isClassScope", "(", ")", "||", "(", "end", ".", "isReferencedClassVariable", "(", "name", ")", "&&", "end", ".", "getDeclaredVariable", "(", "name", ")", "==", "null", ")", ")", "{", "scope", ".", "putReferencedClassVariable", "(", "var", ")", ";", "}", "else", "{", "scope", ".", "putReferencedLocalVariable", "(", "var", ")", ";", "}", "scope", "=", "scope", ".", "getParent", "(", ")", ";", "}", "return", "var", ";", "}", "private", "void", "checkPropertyOnExplicitThis", "(", "PropertyExpression", "pe", ")", "{", "if", "(", "!", "currentScope", ".", "isInStaticContext", "(", ")", ")", "return", ";", "Expression", "object", "=", "pe", ".", "getObjectExpression", "(", ")", ";", "if", "(", "!", "(", "object", "instanceof", "VariableExpression", ")", ")", "return", ";", "VariableExpression", "ve", "=", "(", "VariableExpression", ")", "object", ";", "if", "(", "!", "ve", ".", "getName", "(", ")", ".", "equals", "(", "\"this\"", ")", ")", "return", ";", "String", "name", "=", "pe", ".", "getPropertyAsString", "(", ")", ";", "if", "(", "name", "==", "null", "||", "name", ".", "equals", "(", "\"class\"", ")", ")", "return", ";", "Variable", "member", "=", "findClassMember", "(", "currentClass", ",", "name", ")", ";", "if", "(", "member", "==", "null", ")", "return", ";", "checkVariableContextAccess", "(", "member", ",", "pe", ")", ";", "}", "private", "void", "checkVariableContextAccess", "(", "Variable", "v", ",", "Expression", "expr", ")", "{", "if", "(", "inPropertyExpression", "||", "v", ".", "isInStaticContext", "(", ")", "||", "!", "currentScope", ".", "isInStaticContext", "(", ")", ")", "return", ";", "String", "msg", "=", "v", ".", "getName", "(", ")", "+", "\"\"", "+", "\"\"", ";", "addError", "(", "msg", ",", "expr", ")", ";", "DynamicVariable", "v2", "=", "new", "DynamicVariable", "(", "v", ".", "getName", "(", ")", ",", "currentScope", ".", "isInStaticContext", "(", ")", ")", ";", "currentScope", ".", "putDeclaredVariable", "(", "v2", ")", ";", "}", "public", "void", "visitBlockStatement", "(", "BlockStatement", "block", ")", "{", "pushState", "(", ")", ";", "block", ".", "setVariableScope", "(", "currentScope", ")", ";", "super", ".", "visitBlockStatement", "(", "block", ")", ";", "popState", "(", ")", ";", "}", "public", "void", "visitForLoop", "(", "ForStatement", "forLoop", ")", "{", "pushState", "(", ")", ";", "forLoop", ".", "setVariableScope", "(", "currentScope", ")", ";", "Parameter", "p", "=", "forLoop", ".", "getVariable", "(", ")", ";", "p", ".", "setInStaticContext", "(", "currentScope", ".", "isInStaticContext", "(", ")", ")", ";", "if", "(", "p", "!=", "ForStatement", ".", "FOR_LOOP_DUMMY", ")", "declare", "(", "p", ",", "forLoop", ")", ";", "super", ".", "visitForLoop", "(", "forLoop", ")", ";", "popState", "(", ")", ";", "}", "public", "void", "visitDeclarationExpression", "(", "DeclarationExpression", "expression", ")", "{", "expression", ".", "getRightExpression", "(", ")", ".", "visit", "(", "this", ")", ";", "if", "(", "expression", ".", "isMultipleAssignmentDeclaration", "(", ")", ")", "{", "TupleExpression", "list", "=", "expression", ".", "getTupleExpression", "(", ")", ";", "for", "(", "Expression", "e", ":", "list", ".", "getExpressions", "(", ")", ")", "{", "declare", "(", "(", "VariableExpression", ")", "e", ")", ";", "}", "}", "else", "{", "declare", "(", "expression", ".", "getVariableExpression", "(", ")", ")", ";", "}", "}", "@", "Override", "public", "void", "visitBinaryExpression", "(", "BinaryExpression", "be", ")", "{", "super", ".", "visitBinaryExpression", "(", "be", ")", ";", "switch", "(", "be", ".", "getOperation", "(", ")", ".", "getType", "(", ")", ")", "{", "case", "Types", ".", "EQUAL", ":", "case", "Types", ".", "BITWISE_AND_EQUAL", ":", "case", "Types", ".", "BITWISE_OR_EQUAL", ":", "case", "Types", ".", "BITWISE_XOR_EQUAL", ":", "case", "Types", ".", "PLUS_EQUAL", ":", "case", "Types", ".", "MINUS_EQUAL", ":", "case", "Types", ".", "MULTIPLY_EQUAL", ":", "case", "Types", ".", "DIVIDE_EQUAL", ":", "case", "Types", ".", "INTDIV_EQUAL", ":", "case", "Types", ".", "MOD_EQUAL", ":", "case", "Types", ".", "POWER_EQUAL", ":", "case", "Types", ".", "LEFT_SHIFT_EQUAL", ":", "case", "Types", ".", "RIGHT_SHIFT_EQUAL", ":", "case", "Types", ".", "RIGHT_SHIFT_UNSIGNED_EQUAL", ":", "checkFinalFieldAccess", "(", "be", ".", "getLeftExpression", "(", ")", ")", ";", "break", ";", "default", ":", "break", ";", "}", "}", "private", "void", "checkFinalFieldAccess", "(", "Expression", "expression", ")", "{", "if", "(", "!", "(", "expression", "instanceof", "VariableExpression", ")", "&&", "!", "(", "expression", "instanceof", "TupleExpression", ")", ")", "return", ";", "if", "(", "expression", "instanceof", "TupleExpression", ")", "{", "TupleExpression", "list", "=", "(", "TupleExpression", ")", "expression", ";", "for", "(", "Expression", "e", ":", "list", ".", "getExpressions", "(", ")", ")", "{", "checkForFinal", "(", "expression", ",", "(", "VariableExpression", ")", "e", ")", ";", "}", "}", "else", "{", "checkForFinal", "(", "expression", ",", "(", "VariableExpression", ")", "expression", ")", ";", "}", "}", "private", "void", "checkForFinal", "(", "final", "Expression", "expression", ",", "VariableExpression", "ve", ")", "{", "Variable", "v", "=", "ve", ".", "getAccessedVariable", "(", ")", ";", "boolean", "isFinal", "=", "isFinal", "(", "v", ".", "getModifiers", "(", ")", ")", ";", "boolean", "isParameter", "=", "v", "instanceof", "Parameter", ";", "if", "(", "isFinal", "&&", "isParameter", ")", "{", "addError", "(", "\"\"", "+", "v", ".", "getName", "(", ")", "+", "\"'\"", ",", "expression", ")", ";", "}", "}", "public", "void", "visitVariableExpression", "(", "VariableExpression", "expression", ")", "{", "String", "name", "=", "expression", ".", "getName", "(", ")", ";", "Variable", "v", "=", "checkVariableNameForDeclaration", "(", "name", ",", "expression", ")", ";", "if", "(", "v", "==", "null", ")", "return", ";", "expression", ".", "setAccessedVariable", "(", "v", ")", ";", "checkVariableContextAccess", "(", "v", ",", "expression", ")", ";", "}", "public", "void", "visitPropertyExpression", "(", "PropertyExpression", "expression", ")", "{", "boolean", "ipe", "=", "inPropertyExpression", ";", "inPropertyExpression", "=", "true", ";", "expression", ".", "getObjectExpression", "(", ")", ".", "visit", "(", "this", ")", ";", "inPropertyExpression", "=", "false", ";", "expression", ".", "getProperty", "(", ")", ".", "visit", "(", "this", ")", ";", "checkPropertyOnExplicitThis", "(", "expression", ")", ";", "inPropertyExpression", "=", "ipe", ";", "}", "public", "void", "visitClosureExpression", "(", "ClosureExpression", "expression", ")", "{", "pushState", "(", ")", ";", "expression", ".", "setVariableScope", "(", "currentScope", ")", ";", "if", "(", "expression", ".", "isParameterSpecified", "(", ")", ")", "{", "Parameter", "[", "]", "parameters", "=", "expression", ".", "getParameters", "(", ")", ";", "for", "(", "Parameter", "parameter", ":", "parameters", ")", "{", "parameter", ".", "setInStaticContext", "(", "currentScope", ".", "isInStaticContext", "(", ")", ")", ";", "if", "(", "parameter", ".", "hasInitialExpression", "(", ")", ")", "{", "parameter", ".", "getInitialExpression", "(", ")", ".", "visit", "(", "this", ")", ";", "}", "declare", "(", "parameter", ",", "expression", ")", ";", "}", "}", "else", "if", "(", "expression", ".", "getParameters", "(", ")", "!=", "null", ")", "{", "Parameter", "var", "=", "new", "Parameter", "(", "ClassHelper", ".", "OBJECT_TYPE", ",", "\"it\"", ")", ";", "var", ".", "setInStaticContext", "(", "currentScope", ".", "isInStaticContext", "(", ")", ")", ";", "currentScope", ".", "putDeclaredVariable", "(", "var", ")", ";", "}", "super", ".", "visitClosureExpression", "(", "expression", ")", ";", "markClosureSharedVariables", "(", ")", ";", "popState", "(", ")", ";", "}", "private", "void", "markClosureSharedVariables", "(", ")", "{", "VariableScope", "scope", "=", "currentScope", ";", "for", "(", "Iterator", "<", "Variable", ">", "it", "=", "scope", ".", "getReferencedLocalVariablesIterator", "(", ")", ";", "it", ".", "hasNext", "(", ")", ";", ")", "{", "it", ".", "next", "(", ")", ".", "setClosureSharedVariable", "(", "true", ")", ";", "}", "}", "public", "void", "visitCatchStatement", "(", "CatchStatement", "statement", ")", "{", "pushState", "(", ")", ";", "Parameter", "p", "=", "statement", ".", "getVariable", "(", ")", ";", "p", ".", "setInStaticContext", "(", "currentScope", ".", "isInStaticContext", "(", ")", ")", ";", "declare", "(", "p", ",", "statement", ")", ";", "super", ".", "visitCatchStatement", "(", "statement", ")", ";", "popState", "(", ")", ";", "}", "public", "void", "visitFieldExpression", "(", "FieldExpression", "expression", ")", "{", "String", "name", "=", "expression", ".", "getFieldName", "(", ")", ";", "Variable", "v", "=", "checkVariableNameForDeclaration", "(", "name", ",", "expression", ")", ";", "checkVariableContextAccess", "(", "v", ",", "expression", ")", ";", "}", "public", "void", "visitClass", "(", "ClassNode", "node", ")", "{", "if", "(", "node", "instanceof", "InnerClassNode", ")", "{", "InnerClassNode", "in", "=", "(", "InnerClassNode", ")", "node", ";", "if", "(", "in", ".", "isAnonymous", "(", ")", ")", "return", ";", "}", "pushState", "(", ")", ";", "currentClass", "=", "node", ";", "currentScope", ".", "setClassScope", "(", "node", ")", ";", "super", ".", "visitClass", "(", "node", ")", ";", "popState", "(", ")", ";", "}", "protected", "void", "visitConstructorOrMethod", "(", "MethodNode", "node", ",", "boolean", "isConstructor", ")", "{", "pushState", "(", "node", ".", "isStatic", "(", ")", ")", ";", "inConstructor", "=", "isConstructor", ";", "node", ".", "setVariableScope", "(", "currentScope", ")", ";", "visitAnnotations", "(", "node", ")", ";", "Parameter", "[", "]", "parameters", "=", "node", ".", "getParameters", "(", ")", ";", "for", "(", "Parameter", "parameter", ":", "parameters", ")", "{", "visitAnnotations", "(", "parameter", ")", ";", "}", "declare", "(", "node", ".", "getParameters", "(", ")", ",", "node", ")", ";", "visitClassCodeContainer", "(", "node", ".", "getCode", "(", ")", ")", ";", "popState", "(", ")", ";", "}", "public", "void", "visitMethodCallExpression", "(", "MethodCallExpression", "call", ")", "{", "if", "(", "call", ".", "isImplicitThis", "(", ")", "&&", "call", ".", "getMethod", "(", ")", "instanceof", "ConstantExpression", ")", "{", "ConstantExpression", "methodNameConstant", "=", "(", "ConstantExpression", ")", "call", ".", "getMethod", "(", ")", ";", "Object", "value", "=", "methodNameConstant", ".", "getText", "(", ")", ";", "if", "(", "!", "(", "value", "instanceof", "String", ")", ")", "{", "throw", "new", "GroovyBugError", "(", "\"\"", ")", ";", "}", "String", "methodName", "=", "(", "String", ")", "value", ";", "Variable", "v", "=", "checkVariableNameForDeclaration", "(", "methodName", ",", "call", ")", ";", "if", "(", "v", "!=", "null", "&&", "!", "(", "v", "instanceof", "DynamicVariable", ")", ")", "{", "checkVariableContextAccess", "(", "v", ",", "call", ")", ";", "}", "if", "(", "v", "instanceof", "VariableExpression", "||", "v", "instanceof", "Parameter", ")", "{", "VariableExpression", "object", "=", "new", "VariableExpression", "(", "v", ")", ";", "object", ".", "setSourcePosition", "(", "methodNameConstant", ")", ";", "call", ".", "setObjectExpression", "(", "object", ")", ";", "ConstantExpression", "method", "=", "new", "ConstantExpression", "(", "\"call\"", ")", ";", "method", ".", "setSourcePosition", "(", "methodNameConstant", ")", ";", "call", ".", "setMethod", "(", "method", ")", ";", "}", "}", "super", ".", "visitMethodCallExpression", "(", "call", ")", ";", "}", "public", "void", "visitConstructorCallExpression", "(", "ConstructorCallExpression", "call", ")", "{", "isSpecialConstructorCall", "=", "call", ".", "isSpecialCall", "(", ")", ";", "super", ".", "visitConstructorCallExpression", "(", "call", ")", ";", "isSpecialConstructorCall", "=", "false", ";", "if", "(", "!", "call", ".", "isUsingAnonymousInnerClass", "(", ")", ")", "return", ";", "pushState", "(", ")", ";", "InnerClassNode", "innerClass", "=", "(", "InnerClassNode", ")", "call", ".", "getType", "(", ")", ";", "innerClass", ".", "setVariableScope", "(", "currentScope", ")", ";", "for", "(", "MethodNode", "method", ":", "innerClass", ".", "getMethods", "(", ")", ")", "{", "Parameter", "[", "]", "parameters", "=", "method", ".", "getParameters", "(", ")", ";", "if", "(", "parameters", ".", "length", "==", "0", ")", "parameters", "=", "null", ";", "ClosureExpression", "cl", "=", "new", "ClosureExpression", "(", "parameters", ",", "method", ".", "getCode", "(", ")", ")", ";", "visitClosureExpression", "(", "cl", ")", ";", "}", "for", "(", "FieldNode", "field", ":", "innerClass", ".", "getFields", "(", ")", ")", "{", "final", "Expression", "expression", "=", "field", ".", "getInitialExpression", "(", ")", ";", "if", "(", "expression", "!=", "null", ")", "{", "expression", ".", "visit", "(", "this", ")", ";", "}", "}", "for", "(", "Statement", "statement", ":", "innerClass", ".", "getObjectInitializerStatements", "(", ")", ")", "{", "statement", ".", "visit", "(", "this", ")", ";", "}", "markClosureSharedVariables", "(", ")", ";", "popState", "(", ")", ";", "}", "public", "void", "visitProperty", "(", "PropertyNode", "node", ")", "{", "pushState", "(", "node", ".", "isStatic", "(", ")", ")", ";", "super", ".", "visitProperty", "(", "node", ")", ";", "popState", "(", ")", ";", "}", "public", "void", "visitField", "(", "FieldNode", "node", ")", "{", "pushState", "(", "node", ".", "isStatic", "(", ")", ")", ";", "super", ".", "visitField", "(", "node", ")", ";", "popState", "(", ")", ";", "}", "public", "void", "visitAnnotations", "(", "AnnotatedNode", "node", ")", "{", "List", "<", "AnnotationNode", ">", "annotations", "=", "node", ".", "getAnnotations", "(", ")", ";", "if", "(", "annotations", ".", "isEmpty", "(", ")", ")", "return", ";", "for", "(", "AnnotationNode", "an", ":", "annotations", ")", "{", "if", "(", "an", ".", "isBuiltIn", "(", ")", ")", "continue", ";", "for", "(", "Map", ".", "Entry", "<", "String", ",", "Expression", ">", "member", ":", "an", ".", "getMembers", "(", ")", ".", "entrySet", "(", ")", ")", "{", "Expression", "annMemberValue", "=", "member", ".", "getValue", "(", ")", ";", "annMemberValue", ".", "visit", "(", "this", ")", ";", "}", "}", "}", "}", "</s>" ]
6,627
[ "<s>", "package", "org", ".", "codehaus", ".", "groovy", ".", "classgen", ";", "import", "java", ".", "util", ".", "*", ";", "import", "java", ".", "lang", ".", "reflect", ".", "Field", ";", "import", "java", ".", "lang", ".", "reflect", ".", "Modifier", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "*", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "stmt", ".", "ReturnStatement", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "expr", ".", "*", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "control", ".", "ErrorCollector", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "control", ".", "SourceUnit", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "control", ".", "messages", ".", "SyntaxErrorMessage", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "syntax", ".", "SyntaxException", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "vmplugin", ".", "VMPluginFactory", ";", "public", "class", "AnnotationVisitor", "{", "private", "SourceUnit", "source", ";", "private", "ErrorCollector", "errorCollector", ";", "private", "AnnotationNode", "annotation", ";", "private", "ClassNode", "reportClass", ";", "public", "AnnotationVisitor", "(", "SourceUnit", "source", ",", "ErrorCollector", "errorCollector", ")", "{", "this", ".", "source", "=", "source", ";", "this", ".", "errorCollector", "=", "errorCollector", ";", "}", "public", "void", "setReportClass", "(", "ClassNode", "cn", ")", "{", "reportClass", "=", "cn", ";", "}", "public", "AnnotationNode", "visit", "(", "AnnotationNode", "node", ")", "{", "this", ".", "annotation", "=", "node", ";", "this", ".", "reportClass", "=", "node", ".", "getClassNode", "(", ")", ";", "if", "(", "!", "isValidAnnotationClass", "(", "node", ".", "getClassNode", "(", ")", ")", ")", "{", "addError", "(", "\"class", "\"", "+", "node", ".", "getClassNode", "(", ")", ".", "getName", "(", ")", "+", "\"\"", ")", ";", "return", "node", ";", "}", "if", "(", "!", "checkIfMandatoryAnnotationValuesPassed", "(", "node", ")", ")", "{", "return", "node", ";", "}", "if", "(", "!", "checkIfValidEnumConstsAreUsed", "(", "node", ")", ")", "{", "return", "node", ";", "}", "Map", "<", "String", ",", "Expression", ">", "attributes", "=", "node", ".", "getMembers", "(", ")", ";", "for", "(", "Map", ".", "Entry", "<", "String", ",", "Expression", ">", "entry", ":", "attributes", ".", "entrySet", "(", ")", ")", "{", "String", "attrName", "=", "entry", ".", "getKey", "(", ")", ";", "Expression", "attrExpr", "=", "transformInlineConstants", "(", "entry", ".", "getValue", "(", ")", ")", ";", "entry", ".", "setValue", "(", "attrExpr", ")", ";", "ClassNode", "attrType", "=", "getAttributeType", "(", "node", ",", "attrName", ")", ";", "visitExpression", "(", "attrName", ",", "attrExpr", ",", "attrType", ")", ";", "}", "VMPluginFactory", ".", "getPlugin", "(", ")", ".", "configureAnnotation", "(", "node", ")", ";", "return", "this", ".", "annotation", ";", "}", "private", "boolean", "checkIfValidEnumConstsAreUsed", "(", "AnnotationNode", "node", ")", "{", "boolean", "ok", "=", "true", ";", "Map", "<", "String", ",", "Expression", ">", "attributes", "=", "node", ".", "getMembers", "(", ")", ";", "for", "(", "Map", ".", "Entry", "<", "String", ",", "Expression", ">", "entry", ":", "attributes", ".", "entrySet", "(", ")", ")", "{", "ok", "&=", "validateEnumConstant", "(", "entry", ".", "getValue", "(", ")", ")", ";", "}", "return", "ok", ";", "}", "private", "boolean", "validateEnumConstant", "(", "Expression", "exp", ")", "{", "if", "(", "exp", "instanceof", "PropertyExpression", ")", "{", "PropertyExpression", "pe", "=", "(", "PropertyExpression", ")", "exp", ";", "String", "name", "=", "pe", ".", "getPropertyAsString", "(", ")", ";", "if", "(", "pe", ".", "getObjectExpression", "(", ")", "instanceof", "ClassExpression", "&&", "name", "!=", "null", ")", "{", "ClassExpression", "ce", "=", "(", "ClassExpression", ")", "pe", ".", "getObjectExpression", "(", ")", ";", "ClassNode", "type", "=", "ce", ".", "getType", "(", ")", ";", "if", "(", "type", ".", "isEnum", "(", ")", ")", "{", "boolean", "ok", "=", "false", ";", "try", "{", "FieldNode", "enumField", "=", "type", ".", "getDeclaredField", "(", "name", ")", ";", "ok", "=", "enumField", "!=", "null", "&&", "enumField", ".", "getType", "(", ")", ".", "equals", "(", "type", ")", ";", "}", "catch", "(", "Exception", "ex", ")", "{", "}", "if", "(", "!", "ok", ")", "{", "addError", "(", "\"\"", "+", "type", ".", "getName", "(", ")", "+", "\".\"", "+", "name", ",", "pe", ")", ";", "return", "false", ";", "}", "}", "}", "}", "return", "true", ";", "}", "private", "Expression", "transformInlineConstants", "(", "Expression", "exp", ")", "{", "if", "(", "exp", "instanceof", "PropertyExpression", ")", "{", "PropertyExpression", "pe", "=", "(", "PropertyExpression", ")", "exp", ";", "if", "(", "pe", ".", "getObjectExpression", "(", ")", "instanceof", "ClassExpression", ")", "{", "ClassExpression", "ce", "=", "(", "ClassExpression", ")", "pe", ".", "getObjectExpression", "(", ")", ";", "ClassNode", "type", "=", "ce", ".", "getType", "(", ")", ";", "if", "(", "type", ".", "isEnum", "(", ")", "||", "!", "type", ".", "isResolved", "(", ")", ")", "return", "exp", ";", "try", "{", "type", ".", "getFields", "(", ")", ";", "if", "(", "type", ".", "hasClass", "(", ")", ")", "{", "Field", "field", "=", "type", ".", "getTypeClass", "(", ")", ".", "getField", "(", "pe", ".", "getPropertyAsString", "(", ")", ")", ";", "if", "(", "field", "!=", "null", "&&", "Modifier", ".", "isStatic", "(", "field", ".", "getModifiers", "(", ")", ")", "&&", "Modifier", ".", "isFinal", "(", "field", ".", "getModifiers", "(", ")", ")", ")", "{", "return", "new", "ConstantExpression", "(", "field", ".", "get", "(", "null", ")", ")", ";", "}", "}", "else", "{", "FieldNode", "fieldNode", "=", "type", ".", "getField", "(", "pe", ".", "getPropertyAsString", "(", ")", ")", ";", "if", "(", "fieldNode", "!=", "null", "&&", "Modifier", ".", "isStatic", "(", "fieldNode", ".", "getModifiers", "(", ")", ")", "&&", "Modifier", ".", "isFinal", "(", "fieldNode", ".", "getModifiers", "(", ")", ")", ")", "{", "Expression", "e", "=", "fieldNode", ".", "getInitialExpression", "(", ")", ";", "return", "(", "ConstantExpression", ")", "e", ";", "}", "}", "}", "catch", "(", "Exception", "e", ")", "{", "}", "}", "}", "else", "if", "(", "exp", "instanceof", "ListExpression", ")", "{", "ListExpression", "le", "=", "(", "ListExpression", ")", "exp", ";", "ListExpression", "result", "=", "new", "ListExpression", "(", ")", ";", "for", "(", "Expression", "e", ":", "le", ".", "getExpressions", "(", ")", ")", "{", "result", ".", "addExpression", "(", "transformInlineConstants", "(", "e", ")", ")", ";", "}", "return", "result", ";", "}", "return", "exp", ";", "}", "private", "boolean", "checkIfMandatoryAnnotationValuesPassed", "(", "AnnotationNode", "node", ")", "{", "boolean", "ok", "=", "true", ";", "Map", "attributes", "=", "node", ".", "getMembers", "(", ")", ";", "ClassNode", "classNode", "=", "node", ".", "getClassNode", "(", ")", ";", "for", "(", "MethodNode", "mn", ":", "classNode", ".", "getMethods", "(", ")", ")", "{", "String", "methodName", "=", "mn", ".", "getName", "(", ")", ";", "}", "return", "ok", ";", "}", "private", "ClassNode", "getAttributeType", "(", "AnnotationNode", "node", ",", "String", "attrName", ")", "{", "ClassNode", "classNode", "=", "node", ".", "getClassNode", "(", ")", ";", "List", "methods", "=", "classNode", ".", "getMethods", "(", "attrName", ")", ";", "if", "(", "methods", ".", "size", "(", ")", "==", "0", ")", "{", "addError", "(", "\"'\"", "+", "attrName", "+", "\"\"", "+", "classNode", ",", "node", ")", ";", "return", "ClassHelper", ".", "OBJECT_TYPE", ";", "}", "MethodNode", "method", "=", "(", "MethodNode", ")", "methods", ".", "get", "(", "0", ")", ";", "return", "method", ".", "getReturnType", "(", ")", ";", "}", "private", "boolean", "isValidAnnotationClass", "(", "ClassNode", "node", ")", "{", "return", "node", ".", "implementsInterface", "(", "ClassHelper", ".", "Annotation_TYPE", ")", ";", "}", "protected", "void", "visitExpression", "(", "String", "attrName", ",", "Expression", "attrExp", ",", "ClassNode", "attrType", ")", "{", "if", "(", "attrType", ".", "isArray", "(", ")", ")", "{", "if", "(", "attrExp", "instanceof", "ListExpression", ")", "{", "ListExpression", "le", "=", "(", "ListExpression", ")", "attrExp", ";", "visitListExpression", "(", "attrName", ",", "le", ",", "attrType", ".", "getComponentType", "(", ")", ")", ";", "}", "else", "if", "(", "attrExp", "instanceof", "ClosureExpression", ")", "{", "addError", "(", "\"\"", ",", "attrExp", ")", ";", "}", "else", "{", "ListExpression", "listExp", "=", "new", "ListExpression", "(", ")", ";", "listExp", ".", "addExpression", "(", "attrExp", ")", ";", "if", "(", "annotation", "!=", "null", ")", "{", "annotation", ".", "setMember", "(", "attrName", ",", "listExp", ")", ";", "}", "visitExpression", "(", "attrName", ",", "listExp", ",", "attrType", ")", ";", "}", "}", "else", "if", "(", "ClassHelper", ".", "isPrimitiveType", "(", "attrType", ")", ")", "{", "visitConstantExpression", "(", "attrName", ",", "getConstantExpression", "(", "attrExp", ",", "attrType", ")", ",", "ClassHelper", ".", "getWrapper", "(", "attrType", ")", ")", ";", "}", "else", "if", "(", "ClassHelper", ".", "STRING_TYPE", ".", "equals", "(", "attrType", ")", ")", "{", "visitConstantExpression", "(", "attrName", ",", "getConstantExpression", "(", "attrExp", ",", "attrType", ")", ",", "ClassHelper", ".", "STRING_TYPE", ")", ";", "}", "else", "if", "(", "ClassHelper", ".", "CLASS_Type", ".", "equals", "(", "attrType", ")", ")", "{", "if", "(", "!", "(", "attrExp", "instanceof", "ClassExpression", "||", "attrExp", "instanceof", "ClosureExpression", ")", ")", "{", "addError", "(", "\"\"", "+", "attrName", "+", "\"'\"", ",", "attrExp", ")", ";", "}", "}", "else", "if", "(", "attrType", ".", "isDerivedFrom", "(", "ClassHelper", ".", "Enum_Type", ")", ")", "{", "if", "(", "attrExp", "instanceof", "PropertyExpression", ")", "{", "visitEnumExpression", "(", "attrName", ",", "(", "PropertyExpression", ")", "attrExp", ",", "attrType", ")", ";", "}", "else", "{", "addError", "(", "\"\"", "+", "attrName", ",", "attrExp", ")", ";", "}", "}", "else", "if", "(", "isValidAnnotationClass", "(", "attrType", ")", ")", "{", "if", "(", "attrExp", "instanceof", "AnnotationConstantExpression", ")", "{", "visitAnnotationExpression", "(", "attrName", ",", "(", "AnnotationConstantExpression", ")", "attrExp", ",", "attrType", ")", ";", "}", "else", "{", "addError", "(", "\"\"", "+", "attrType", ".", "getName", "(", ")", "+", "\"\"", "+", "attrName", ",", "attrExp", ")", ";", "}", "}", "else", "{", "addError", "(", "\"\"", "+", "attrType", ".", "getName", "(", ")", ",", "attrExp", ")", ";", "}", "}", "public", "void", "checkReturnType", "(", "ClassNode", "attrType", ",", "ASTNode", "node", ")", "{", "if", "(", "attrType", ".", "isArray", "(", ")", ")", "{", "checkReturnType", "(", "attrType", ".", "getComponentType", "(", ")", ",", "node", ")", ";", "}", "else", "if", "(", "ClassHelper", ".", "isPrimitiveType", "(", "attrType", ")", ")", "{", "return", ";", "}", "else", "if", "(", "ClassHelper", ".", "STRING_TYPE", ".", "equals", "(", "attrType", ")", ")", "{", "return", ";", "}", "else", "if", "(", "ClassHelper", ".", "CLASS_Type", ".", "equals", "(", "attrType", ")", ")", "{", "return", ";", "}", "else", "if", "(", "attrType", ".", "isDerivedFrom", "(", "ClassHelper", ".", "Enum_Type", ")", ")", "{", "return", ";", "}", "else", "if", "(", "isValidAnnotationClass", "(", "attrType", ")", ")", "{", "return", ";", "}", "else", "{", "addError", "(", "\"\"", "+", "attrType", ".", "getName", "(", ")", ",", "node", ")", ";", "}", "}", "private", "ConstantExpression", "getConstantExpression", "(", "Expression", "exp", ",", "ClassNode", "attrType", ")", "{", "if", "(", "exp", "instanceof", "ConstantExpression", ")", "{", "return", "(", "ConstantExpression", ")", "exp", ";", "}", "else", "{", "String", "base", "=", "\"expected", "'\"", "+", "exp", ".", "getText", "(", ")", "+", "\"\"", "+", "attrType", ".", "getName", "(", ")", ";", "if", "(", "exp", "instanceof", "PropertyExpression", ")", "{", "addError", "(", "base", "+", "\"\"", ",", "exp", ")", ";", "}", "else", "if", "(", "exp", "instanceof", "VariableExpression", "&&", "(", "(", "VariableExpression", ")", "exp", ")", ".", "getAccessedVariable", "(", ")", "instanceof", "FieldNode", ")", "{", "addError", "(", "base", "+", "\"\"", ",", "exp", ")", ";", "}", "else", "{", "addError", "(", "base", ",", "exp", ")", ";", "}", "return", "ConstantExpression", ".", "EMPTY_EXPRESSION", ";", "}", "}", "protected", "void", "visitAnnotationExpression", "(", "String", "attrName", ",", "AnnotationConstantExpression", "expression", ",", "ClassNode", "attrType", ")", "{", "AnnotationNode", "annotationNode", "=", "(", "AnnotationNode", ")", "expression", ".", "getValue", "(", ")", ";", "AnnotationVisitor", "visitor", "=", "new", "AnnotationVisitor", "(", "this", ".", "source", ",", "this", ".", "errorCollector", ")", ";", "visitor", ".", "visit", "(", "annotationNode", ")", ";", "}", "protected", "void", "visitListExpression", "(", "String", "attrName", ",", "ListExpression", "listExpr", ",", "ClassNode", "elementType", ")", "{", "for", "(", "Expression", "expression", ":", "listExpr", ".", "getExpressions", "(", ")", ")", "{", "visitExpression", "(", "attrName", ",", "expression", ",", "elementType", ")", ";", "}", "}", "protected", "void", "visitConstantExpression", "(", "String", "attrName", ",", "ConstantExpression", "constExpr", ",", "ClassNode", "attrType", ")", "{", "ClassNode", "type", "=", "ClassHelper", ".", "getWrapper", "(", "constExpr", ".", "getType", "(", ")", ")", ";", "if", "(", "!", "type", ".", "isDerivedFrom", "(", "attrType", ")", ")", "{", "addError", "(", "\"Attribute", "'\"", "+", "attrName", "+", "\"\"", "+", "attrType", ".", "getName", "(", ")", "+", "\"';", "\"", "+", "\"\"", "+", "constExpr", ".", "getType", "(", ")", ".", "getName", "(", ")", "+", "\"'\"", ",", "constExpr", ")", ";", "}", "}", "protected", "void", "visitEnumExpression", "(", "String", "attrName", ",", "PropertyExpression", "propExpr", ",", "ClassNode", "attrType", ")", "{", "if", "(", "!", "propExpr", ".", "getObjectExpression", "(", ")", ".", "getType", "(", ")", ".", "isDerivedFrom", "(", "attrType", ")", ")", "{", "addError", "(", "\"Attribute", "'\"", "+", "attrName", "+", "\"\"", "+", "attrType", ".", "getName", "(", ")", "+", "\"\"", "+", "propExpr", ".", "getObjectExpression", "(", ")", ".", "getType", "(", ")", ".", "getName", "(", ")", ",", "propExpr", ")", ";", "}", "}", "protected", "void", "addError", "(", "String", "msg", ")", "{", "addError", "(", "msg", ",", "this", ".", "annotation", ")", ";", "}", "protected", "void", "addError", "(", "String", "msg", ",", "ASTNode", "expr", ")", "{", "this", ".", "errorCollector", ".", "addErrorAndContinue", "(", "new", "SyntaxErrorMessage", "(", "new", "SyntaxException", "(", "msg", "+", "\"", "in", "@\"", "+", "this", ".", "reportClass", ".", "getName", "(", ")", "+", "'\\n'", ",", "expr", ".", "getLineNumber", "(", ")", ",", "expr", ".", "getColumnNumber", "(", ")", ")", ",", "this", ".", "source", ")", ")", ";", "}", "public", "void", "checkCircularReference", "(", "ClassNode", "searchClass", ",", "ClassNode", "attrType", ",", "Expression", "startExp", ")", "{", "if", "(", "!", "isValidAnnotationClass", "(", "attrType", ")", ")", "return", ";", "if", "(", "!", "(", "startExp", "instanceof", "AnnotationConstantExpression", ")", ")", "{", "addError", "(", "\"Found", "'\"", "+", "startExp", ".", "getText", "(", ")", "+", "\"\"", ",", "startExp", ")", ";", "return", ";", "}", "AnnotationConstantExpression", "ace", "=", "(", "AnnotationConstantExpression", ")", "startExp", ";", "AnnotationNode", "annotationNode", "=", "(", "AnnotationNode", ")", "ace", ".", "getValue", "(", ")", ";", "if", "(", "annotationNode", ".", "getClassNode", "(", ")", ".", "equals", "(", "searchClass", ")", ")", "{", "addError", "(", "\"\"", "+", "searchClass", ".", "getName", "(", ")", ",", "startExp", ")", ";", "return", ";", "}", "ClassNode", "cn", "=", "annotationNode", ".", "getClassNode", "(", ")", ";", "for", "(", "MethodNode", "method", ":", "cn", ".", "getMethods", "(", ")", ")", "{", "if", "(", "method", ".", "getReturnType", "(", ")", ".", "equals", "(", "searchClass", ")", ")", "{", "addError", "(", "\"\"", "+", "cn", ".", "getName", "(", ")", ",", "startExp", ")", ";", "}", "ReturnStatement", "code", "=", "(", "ReturnStatement", ")", "method", ".", "getCode", "(", ")", ";", "if", "(", "code", "==", "null", ")", "continue", ";", "checkCircularReference", "(", "searchClass", ",", "method", ".", "getReturnType", "(", ")", ",", "code", ".", "getExpression", "(", ")", ")", ";", "}", "}", "}", "</s>" ]
6,628
[ "<s>", "package", "org", ".", "codehaus", ".", "groovy", ".", "classgen", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "*", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "expr", ".", "BinaryExpression", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "expr", ".", "ConstructorCallExpression", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "expr", ".", "Expression", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "expr", ".", "FieldExpression", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "expr", ".", "PropertyExpression", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "expr", ".", "TupleExpression", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "expr", ".", "VariableExpression", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "stmt", ".", "BlockStatement", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "stmt", ".", "ExpressionStatement", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "stmt", ".", "Statement", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "control", ".", "CompilationUnit", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "control", ".", "SourceUnit", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "syntax", ".", "Token", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "syntax", ".", "Types", ";", "import", "org", ".", "objectweb", ".", "asm", ".", "Opcodes", ";", "import", "java", ".", "util", ".", "ArrayList", ";", "import", "java", ".", "util", ".", "Iterator", ";", "import", "java", ".", "util", ".", "List", ";", "public", "class", "InnerClassVisitor", "extends", "InnerClassVisitorHelper", "implements", "Opcodes", "{", "private", "final", "SourceUnit", "sourceUnit", ";", "private", "ClassNode", "classNode", ";", "private", "static", "final", "int", "PUBLIC_SYNTHETIC", "=", "Opcodes", ".", "ACC_PUBLIC", "+", "Opcodes", ".", "ACC_SYNTHETIC", ";", "private", "FieldNode", "thisField", "=", "null", ";", "private", "MethodNode", "currentMethod", ";", "private", "FieldNode", "currentField", ";", "private", "boolean", "processingObjInitStatements", "=", "false", ";", "public", "InnerClassVisitor", "(", "CompilationUnit", "cu", ",", "SourceUnit", "su", ")", "{", "sourceUnit", "=", "su", ";", "}", "@", "Override", "protected", "SourceUnit", "getSourceUnit", "(", ")", "{", "return", "sourceUnit", ";", "}", "@", "Override", "public", "void", "visitClass", "(", "ClassNode", "node", ")", "{", "this", ".", "classNode", "=", "node", ";", "thisField", "=", "null", ";", "InnerClassNode", "innerClass", "=", "null", ";", "if", "(", "!", "node", ".", "isEnum", "(", ")", "&&", "!", "node", ".", "isInterface", "(", ")", "&&", "node", "instanceof", "InnerClassNode", ")", "{", "innerClass", "=", "(", "InnerClassNode", ")", "node", ";", "if", "(", "!", "isStatic", "(", "innerClass", ")", "&&", "innerClass", ".", "getVariableScope", "(", ")", "==", "null", ")", "{", "thisField", "=", "innerClass", ".", "addField", "(", "\"this$0\"", ",", "PUBLIC_SYNTHETIC", ",", "node", ".", "getOuterClass", "(", ")", ".", "getPlainNodeReference", "(", ")", ",", "null", ")", ";", "}", "if", "(", "innerClass", ".", "getVariableScope", "(", ")", "==", "null", "&&", "innerClass", ".", "getDeclaredConstructors", "(", ")", ".", "isEmpty", "(", ")", ")", "{", "innerClass", ".", "addConstructor", "(", "ACC_PUBLIC", ",", "new", "Parameter", "[", "0", "]", ",", "null", ",", "null", ")", ";", "}", "}", "super", ".", "visitClass", "(", "node", ")", ";", "if", "(", "node", ".", "isEnum", "(", ")", "||", "node", ".", "isInterface", "(", ")", ")", "return", ";", "if", "(", "innerClass", "==", "null", ")", "return", ";", "if", "(", "node", ".", "getSuperClass", "(", ")", ".", "isInterface", "(", ")", ")", "{", "node", ".", "addInterface", "(", "node", ".", "getUnresolvedSuperClass", "(", ")", ")", ";", "node", ".", "setUnresolvedSuperClass", "(", "ClassHelper", ".", "OBJECT_TYPE", ")", ";", "}", "}", "@", "Override", "protected", "void", "visitObjectInitializerStatements", "(", "ClassNode", "node", ")", "{", "processingObjInitStatements", "=", "true", ";", "super", ".", "visitObjectInitializerStatements", "(", "node", ")", ";", "processingObjInitStatements", "=", "false", ";", "}", "@", "Override", "public", "void", "visitConstructor", "(", "ConstructorNode", "node", ")", "{", "addThisReference", "(", "node", ")", ";", "super", ".", "visitConstructor", "(", "node", ")", ";", "}", "private", "boolean", "shouldHandleImplicitThisForInnerClass", "(", "ClassNode", "cn", ")", "{", "if", "(", "cn", ".", "isEnum", "(", ")", "||", "cn", ".", "isInterface", "(", ")", ")", "return", "false", ";", "if", "(", "(", "cn", ".", "getModifiers", "(", ")", "&", "Opcodes", ".", "ACC_STATIC", ")", "!=", "0", ")", "return", "false", ";", "if", "(", "!", "(", "cn", "instanceof", "InnerClassNode", ")", ")", "return", "false", ";", "InnerClassNode", "innerClass", "=", "(", "InnerClassNode", ")", "cn", ";", "if", "(", "innerClass", ".", "getVariableScope", "(", ")", "!=", "null", ")", "return", "false", ";", "if", "(", "(", "innerClass", ".", "getModifiers", "(", ")", "&", "ACC_STATIC", ")", "!=", "0", ")", "return", "false", ";", "return", "true", ";", "}", "private", "void", "addThisReference", "(", "ConstructorNode", "node", ")", "{", "if", "(", "!", "shouldHandleImplicitThisForInnerClass", "(", "classNode", ")", ")", "return", ";", "Statement", "code", "=", "node", ".", "getCode", "(", ")", ";", "Parameter", "[", "]", "params", "=", "node", ".", "getParameters", "(", ")", ";", "Parameter", "[", "]", "newParams", "=", "new", "Parameter", "[", "params", ".", "length", "+", "1", "]", ";", "System", ".", "arraycopy", "(", "params", ",", "0", ",", "newParams", ",", "1", ",", "params", ".", "length", ")", ";", "Parameter", "thisPara", "=", "new", "Parameter", "(", "classNode", ".", "getOuterClass", "(", ")", ".", "getPlainNodeReference", "(", ")", ",", "getUniqueName", "(", "params", ",", "node", ")", ")", ";", "newParams", "[", "0", "]", "=", "thisPara", ";", "node", ".", "setParameters", "(", "newParams", ")", ";", "BlockStatement", "block", "=", "null", ";", "if", "(", "code", "==", "null", ")", "{", "block", "=", "new", "BlockStatement", "(", ")", ";", "}", "else", "if", "(", "!", "(", "code", "instanceof", "BlockStatement", ")", ")", "{", "block", "=", "new", "BlockStatement", "(", ")", ";", "block", ".", "addStatement", "(", "code", ")", ";", "}", "else", "{", "block", "=", "(", "BlockStatement", ")", "code", ";", "}", "BlockStatement", "newCode", "=", "new", "BlockStatement", "(", ")", ";", "addFieldInit", "(", "thisPara", ",", "thisField", ",", "newCode", ")", ";", "ConstructorCallExpression", "cce", "=", "getFirstIfSpecialConstructorCall", "(", "block", ")", ";", "if", "(", "cce", "==", "null", ")", "{", "cce", "=", "new", "ConstructorCallExpression", "(", "ClassNode", ".", "SUPER", ",", "new", "TupleExpression", "(", ")", ")", ";", "block", ".", "getStatements", "(", ")", ".", "add", "(", "0", ",", "new", "ExpressionStatement", "(", "cce", ")", ")", ";", "}", "if", "(", "shouldImplicitlyPassThisPara", "(", "cce", ")", ")", "{", "TupleExpression", "args", "=", "(", "TupleExpression", ")", "cce", ".", "getArguments", "(", ")", ";", "List", "<", "Expression", ">", "expressions", "=", "args", ".", "getExpressions", "(", ")", ";", "VariableExpression", "ve", "=", "new", "VariableExpression", "(", "thisPara", ".", "getName", "(", ")", ")", ";", "ve", ".", "setAccessedVariable", "(", "thisPara", ")", ";", "expressions", ".", "add", "(", "0", ",", "ve", ")", ";", "}", "if", "(", "cce", ".", "isSuperCall", "(", ")", ")", "{", "block", ".", "getStatements", "(", ")", ".", "add", "(", "1", ",", "newCode", ")", ";", "}", "node", ".", "setCode", "(", "block", ")", ";", "}", "private", "boolean", "shouldImplicitlyPassThisPara", "(", "ConstructorCallExpression", "cce", ")", "{", "boolean", "pass", "=", "false", ";", "ClassNode", "superCN", "=", "classNode", ".", "getSuperClass", "(", ")", ";", "if", "(", "cce", ".", "isThisCall", "(", ")", ")", "{", "pass", "=", "true", ";", "}", "else", "if", "(", "cce", ".", "isSuperCall", "(", ")", ")", "{", "if", "(", "!", "superCN", ".", "isEnum", "(", ")", "&&", "!", "superCN", ".", "isInterface", "(", ")", "&&", "superCN", "instanceof", "InnerClassNode", ")", "{", "InnerClassNode", "superInnerCN", "=", "(", "InnerClassNode", ")", "superCN", ";", "if", "(", "!", "isStatic", "(", "superInnerCN", ")", "&&", "classNode", ".", "getOuterClass", "(", ")", ".", "isDerivedFrom", "(", "superCN", ".", "getOuterClass", "(", ")", ")", ")", "{", "pass", "=", "true", ";", "}", "}", "}", "return", "pass", ";", "}", "private", "String", "getUniqueName", "(", "Parameter", "[", "]", "params", ",", "ConstructorNode", "node", ")", "{", "String", "namePrefix", "=", "\"$p\"", ";", "outer", ":", "for", "(", "int", "i", "=", "0", ";", "i", "<", "100", ";", "i", "++", ")", "{", "namePrefix", "=", "namePrefix", "+", "\"$\"", ";", "for", "(", "Parameter", "p", ":", "params", ")", "{", "if", "(", "p", ".", "getName", "(", ")", ".", "equals", "(", "namePrefix", ")", ")", "continue", "outer", ";", "}", "return", "namePrefix", ";", "}", "addError", "(", "\"\"", ",", "node", ")", ";", "return", "namePrefix", ";", "}", "private", "ConstructorCallExpression", "getFirstIfSpecialConstructorCall", "(", "BlockStatement", "code", ")", "{", "if", "(", "code", "==", "null", ")", "return", "null", ";", "final", "List", "<", "Statement", ">", "statementList", "=", "code", ".", "getStatements", "(", ")", ";", "if", "(", "statementList", ".", "isEmpty", "(", ")", ")", "return", "null", ";", "final", "Statement", "statement", "=", "statementList", ".", "get", "(", "0", ")", ";", "if", "(", "!", "(", "statement", "instanceof", "ExpressionStatement", ")", ")", "return", "null", ";", "Expression", "expression", "=", "(", "(", "ExpressionStatement", ")", "statement", ")", ".", "getExpression", "(", ")", ";", "if", "(", "!", "(", "expression", "instanceof", "ConstructorCallExpression", ")", ")", "return", "null", ";", "ConstructorCallExpression", "cce", "=", "(", "ConstructorCallExpression", ")", "expression", ";", "if", "(", "cce", ".", "isSpecialCall", "(", ")", ")", "return", "cce", ";", "return", "null", ";", "}", "@", "Override", "protected", "void", "visitConstructorOrMethod", "(", "MethodNode", "node", ",", "boolean", "isConstructor", ")", "{", "this", ".", "currentMethod", "=", "node", ";", "super", ".", "visitConstructorOrMethod", "(", "node", ",", "isConstructor", ")", ";", "this", ".", "currentMethod", "=", "null", ";", "}", "@", "Override", "public", "void", "visitField", "(", "FieldNode", "node", ")", "{", "this", ".", "currentField", "=", "node", ";", "super", ".", "visitField", "(", "node", ")", ";", "this", ".", "currentField", "=", "null", ";", "}", "@", "Override", "public", "void", "visitProperty", "(", "PropertyNode", "node", ")", "{", "final", "FieldNode", "field", "=", "node", ".", "getField", "(", ")", ";", "final", "Expression", "init", "=", "field", ".", "getInitialExpression", "(", ")", ";", "field", ".", "setInitialValueExpression", "(", "null", ")", ";", "super", ".", "visitProperty", "(", "node", ")", ";", "field", ".", "setInitialValueExpression", "(", "init", ")", ";", "}", "@", "Override", "public", "void", "visitConstructorCallExpression", "(", "ConstructorCallExpression", "call", ")", "{", "super", ".", "visitConstructorCallExpression", "(", "call", ")", ";", "if", "(", "!", "call", ".", "isUsingAnonymousInnerClass", "(", ")", ")", "{", "passThisReference", "(", "call", ")", ";", "return", ";", "}", "InnerClassNode", "innerClass", "=", "(", "InnerClassNode", ")", "call", ".", "getType", "(", ")", ";", "if", "(", "!", "innerClass", ".", "getDeclaredConstructors", "(", ")", ".", "isEmpty", "(", ")", ")", "return", ";", "if", "(", "(", "innerClass", ".", "getModifiers", "(", ")", "&", "ACC_STATIC", ")", "!=", "0", ")", "return", ";", "VariableScope", "scope", "=", "innerClass", ".", "getVariableScope", "(", ")", ";", "if", "(", "scope", "==", "null", ")", "return", ";", "boolean", "isStatic", "=", "scope", ".", "isInStaticContext", "(", ")", ";", "List", "<", "Expression", ">", "expressions", "=", "(", "(", "TupleExpression", ")", "call", ".", "getArguments", "(", ")", ")", ".", "getExpressions", "(", ")", ";", "BlockStatement", "block", "=", "new", "BlockStatement", "(", ")", ";", "final", "int", "additionalParamCount", "=", "1", "+", "scope", ".", "getReferencedLocalVariablesCount", "(", ")", ";", "List", "<", "Parameter", ">", "parameters", "=", "new", "ArrayList", "<", "Parameter", ">", "(", "expressions", ".", "size", "(", ")", "+", "additionalParamCount", ")", ";", "List", "<", "Expression", ">", "superCallArguments", "=", "new", "ArrayList", "<", "Expression", ">", "(", "expressions", ".", "size", "(", ")", ")", ";", "int", "pCount", "=", "additionalParamCount", ";", "for", "(", "Expression", "expr", ":", "expressions", ")", "{", "pCount", "++", ";", "Parameter", "param", "=", "new", "Parameter", "(", "ClassHelper", ".", "OBJECT_TYPE", ",", "\"p\"", "+", "pCount", ")", ";", "parameters", ".", "add", "(", "param", ")", ";", "superCallArguments", ".", "add", "(", "new", "VariableExpression", "(", "param", ")", ")", ";", "}", "ConstructorCallExpression", "cce", "=", "new", "ConstructorCallExpression", "(", "ClassNode", ".", "SUPER", ",", "new", "TupleExpression", "(", "superCallArguments", ")", ")", ";", "block", ".", "addStatement", "(", "new", "ExpressionStatement", "(", "cce", ")", ")", ";", "pCount", "=", "0", ";", "expressions", ".", "add", "(", "pCount", ",", "VariableExpression", ".", "THIS_EXPRESSION", ")", ";", "ClassNode", "outerClassType", "=", "getClassNode", "(", "innerClass", ".", "getOuterClass", "(", ")", ",", "isStatic", ")", ".", "getPlainNodeReference", "(", ")", ";", "Parameter", "thisParameter", "=", "new", "Parameter", "(", "outerClassType", ",", "\"p\"", "+", "pCount", ")", ";", "parameters", ".", "add", "(", "pCount", ",", "thisParameter", ")", ";", "thisField", "=", "innerClass", ".", "addField", "(", "\"this$0\"", ",", "PUBLIC_SYNTHETIC", ",", "outerClassType", ",", "null", ")", ";", "addFieldInit", "(", "thisParameter", ",", "thisField", ",", "block", ")", ";", "for", "(", "Iterator", "it", "=", "scope", ".", "getReferencedLocalVariablesIterator", "(", ")", ";", "it", ".", "hasNext", "(", ")", ";", ")", "{", "pCount", "++", ";", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "Variable", "var", "=", "(", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "Variable", ")", "it", ".", "next", "(", ")", ";", "VariableExpression", "ve", "=", "new", "VariableExpression", "(", "var", ")", ";", "ve", ".", "setClosureSharedVariable", "(", "true", ")", ";", "ve", ".", "setUseReferenceDirectly", "(", "true", ")", ";", "expressions", ".", "add", "(", "pCount", ",", "ve", ")", ";", "ClassNode", "rawReferenceType", "=", "ClassHelper", ".", "REFERENCE_TYPE", ".", "getPlainNodeReference", "(", ")", ";", "Parameter", "p", "=", "new", "Parameter", "(", "rawReferenceType", ",", "\"p\"", "+", "pCount", ")", ";", "parameters", ".", "add", "(", "pCount", ",", "p", ")", ";", "p", ".", "setOriginType", "(", "var", ".", "getOriginType", "(", ")", ")", ";", "final", "VariableExpression", "initial", "=", "new", "VariableExpression", "(", "p", ")", ";", "initial", ".", "setUseReferenceDirectly", "(", "true", ")", ";", "final", "FieldNode", "pField", "=", "innerClass", ".", "addFieldFirst", "(", "ve", ".", "getName", "(", ")", ",", "PUBLIC_SYNTHETIC", ",", "rawReferenceType", ",", "initial", ")", ";", "pField", ".", "setHolder", "(", "true", ")", ";", "pField", ".", "setOriginType", "(", "ClassHelper", ".", "getWrapper", "(", "var", ".", "getOriginType", "(", ")", ")", ")", ";", "}", "innerClass", ".", "addConstructor", "(", "ACC_SYNTHETIC", ",", "parameters", ".", "toArray", "(", "new", "Parameter", "[", "0", "]", ")", ",", "ClassNode", ".", "EMPTY_ARRAY", ",", "block", ")", ";", "}", "private", "void", "passThisReference", "(", "ConstructorCallExpression", "call", ")", "{", "ClassNode", "cn", "=", "call", ".", "getType", "(", ")", ".", "redirect", "(", ")", ";", "if", "(", "!", "shouldHandleImplicitThisForInnerClass", "(", "cn", ")", ")", "return", ";", "boolean", "isInStaticContext", "=", "true", ";", "if", "(", "currentMethod", "!=", "null", ")", "isInStaticContext", "=", "currentMethod", ".", "getVariableScope", "(", ")", ".", "isInStaticContext", "(", ")", ";", "else", "if", "(", "currentField", "!=", "null", ")", "isInStaticContext", "=", "currentField", ".", "isStatic", "(", ")", ";", "else", "if", "(", "processingObjInitStatements", ")", "isInStaticContext", "=", "false", ";", "if", "(", "isInStaticContext", ")", "{", "Expression", "args", "=", "call", ".", "getArguments", "(", ")", ";", "if", "(", "args", "instanceof", "TupleExpression", "&&", "(", "(", "TupleExpression", ")", "args", ")", ".", "getExpressions", "(", ")", ".", "isEmpty", "(", ")", ")", "{", "addError", "(", "\"\"", ",", "call", ")", ";", "}", "return", ";", "}", "ClassNode", "parent", "=", "classNode", ";", "int", "level", "=", "0", ";", "for", "(", ";", "parent", "!=", "null", "&&", "parent", "!=", "cn", ".", "getOuterClass", "(", ")", ";", "parent", "=", "parent", ".", "getOuterClass", "(", ")", ")", "{", "level", "++", ";", "}", "if", "(", "parent", "==", "null", ")", "return", ";", "Expression", "argsExp", "=", "call", ".", "getArguments", "(", ")", ";", "if", "(", "argsExp", "instanceof", "TupleExpression", ")", "{", "TupleExpression", "argsListExp", "=", "(", "TupleExpression", ")", "argsExp", ";", "Expression", "this0", "=", "VariableExpression", ".", "THIS_EXPRESSION", ";", "for", "(", "int", "i", "=", "0", ";", "i", "!=", "level", ";", "++", "i", ")", "this0", "=", "new", "PropertyExpression", "(", "this0", ",", "\"this$0\"", ")", ";", "argsListExp", ".", "getExpressions", "(", ")", ".", "add", "(", "0", ",", "this0", ")", ";", "}", "}", "private", "static", "void", "addFieldInit", "(", "Parameter", "p", ",", "FieldNode", "fn", ",", "BlockStatement", "block", ")", "{", "VariableExpression", "ve", "=", "new", "VariableExpression", "(", "p", ")", ";", "FieldExpression", "fe", "=", "new", "FieldExpression", "(", "fn", ")", ";", "block", ".", "addStatement", "(", "new", "ExpressionStatement", "(", "new", "BinaryExpression", "(", "fe", ",", "Token", ".", "newSymbol", "(", "Types", ".", "ASSIGN", ",", "-", "1", ",", "-", "1", ")", ",", "ve", ")", ")", ")", ";", "}", "}", "</s>" ]
6,629
[ "<s>", "package", "org", ".", "codehaus", ".", "groovy", ".", "classgen", ".", "asm", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "*", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "reflection", ".", "ReflectionCache", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "runtime", ".", "typehandling", ".", "DefaultTypeTransformation", ";", "import", "org", ".", "objectweb", ".", "asm", ".", "Label", ";", "import", "org", ".", "objectweb", ".", "asm", ".", "MethodVisitor", ";", "import", "org", ".", "objectweb", ".", "asm", ".", "Opcodes", ";", "public", "class", "BytecodeHelper", "implements", "Opcodes", "{", "private", "static", "String", "DTT_CLASSNAME", "=", "BytecodeHelper", ".", "getClassInternalName", "(", "DefaultTypeTransformation", ".", "class", ".", "getName", "(", ")", ")", ";", "public", "static", "String", "getClassInternalName", "(", "ClassNode", "t", ")", "{", "if", "(", "t", ".", "isPrimaryClassNode", "(", ")", ")", "{", "if", "(", "t", ".", "isArray", "(", ")", ")", "return", "\"[L\"", "+", "getClassInternalName", "(", "t", ".", "getComponentType", "(", ")", ")", "+", "\";\"", ";", "return", "getClassInternalName", "(", "t", ".", "getName", "(", ")", ")", ";", "}", "String", "name", "=", "t", ".", "getClassInternalName", "(", ")", ";", "if", "(", "name", "==", "null", ")", "{", "if", "(", "t", ".", "hasClass", "(", ")", ")", "{", "name", "=", "getClassInternalName", "(", "t", ".", "getTypeClass", "(", ")", ")", ";", "}", "else", "{", "name", "=", "getClassInternalName", "(", "t", ".", "getName", "(", ")", ")", ";", "}", "}", "return", "name", ";", "}", "public", "static", "String", "getClassInternalName", "(", "Class", "t", ")", "{", "return", "org", ".", "objectweb", ".", "asm", ".", "Type", ".", "getInternalName", "(", "t", ")", ";", "}", "public", "static", "String", "getClassInternalName", "(", "String", "name", ")", "{", "return", "name", ".", "replace", "(", "'.'", ",", "'/'", ")", ";", "}", "public", "static", "String", "getMethodDescriptor", "(", "ClassNode", "returnType", ",", "Parameter", "[", "]", "parameters", ")", "{", "StringBuffer", "buffer", "=", "new", "StringBuffer", "(", "\"(\"", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "parameters", ".", "length", ";", "i", "++", ")", "{", "buffer", ".", "append", "(", "getTypeDescription", "(", "parameters", "[", "i", "]", ".", "getType", "(", ")", ")", ")", ";", "}", "buffer", ".", "append", "(", "\")\"", ")", ";", "buffer", ".", "append", "(", "getTypeDescription", "(", "returnType", ")", ")", ";", "return", "buffer", ".", "toString", "(", ")", ";", "}", "public", "static", "String", "getMethodDescriptor", "(", "Class", "returnType", ",", "Class", "[", "]", "paramTypes", ")", "{", "StringBuffer", "buffer", "=", "new", "StringBuffer", "(", "\"(\"", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "paramTypes", ".", "length", ";", "i", "++", ")", "{", "buffer", ".", "append", "(", "getTypeDescription", "(", "paramTypes", "[", "i", "]", ")", ")", ";", "}", "buffer", ".", "append", "(", "\")\"", ")", ";", "buffer", ".", "append", "(", "getTypeDescription", "(", "returnType", ")", ")", ";", "return", "buffer", ".", "toString", "(", ")", ";", "}", "public", "static", "String", "getTypeDescription", "(", "Class", "c", ")", "{", "return", "org", ".", "objectweb", ".", "asm", ".", "Type", ".", "getDescriptor", "(", "c", ")", ";", "}", "public", "static", "String", "getClassLoadingTypeDescription", "(", "ClassNode", "c", ")", "{", "StringBuffer", "buf", "=", "new", "StringBuffer", "(", ")", ";", "boolean", "array", "=", "false", ";", "while", "(", "true", ")", "{", "if", "(", "c", ".", "isArray", "(", ")", ")", "{", "buf", ".", "append", "(", "'['", ")", ";", "c", "=", "c", ".", "getComponentType", "(", ")", ";", "array", "=", "true", ";", "}", "else", "{", "if", "(", "ClassHelper", ".", "isPrimitiveType", "(", "c", ")", ")", "{", "buf", ".", "append", "(", "getTypeDescription", "(", "c", ")", ")", ";", "}", "else", "{", "if", "(", "array", ")", "buf", ".", "append", "(", "'L'", ")", ";", "buf", ".", "append", "(", "c", ".", "getName", "(", ")", ")", ";", "if", "(", "array", ")", "buf", ".", "append", "(", "';'", ")", ";", "}", "return", "buf", ".", "toString", "(", ")", ";", "}", "}", "}", "public", "static", "String", "getTypeDescription", "(", "ClassNode", "c", ")", "{", "return", "getTypeDescription", "(", "c", ",", "true", ")", ";", "}", "private", "static", "String", "getTypeDescription", "(", "ClassNode", "c", ",", "boolean", "end", ")", "{", "StringBuffer", "buf", "=", "new", "StringBuffer", "(", ")", ";", "ClassNode", "d", "=", "c", ";", "while", "(", "true", ")", "{", "if", "(", "ClassHelper", ".", "isPrimitiveType", "(", "d", ")", ")", "{", "char", "car", ";", "if", "(", "d", "==", "ClassHelper", ".", "int_TYPE", ")", "{", "car", "=", "'I'", ";", "}", "else", "if", "(", "d", "==", "ClassHelper", ".", "VOID_TYPE", ")", "{", "car", "=", "'V'", ";", "}", "else", "if", "(", "d", "==", "ClassHelper", ".", "boolean_TYPE", ")", "{", "car", "=", "'Z'", ";", "}", "else", "if", "(", "d", "==", "ClassHelper", ".", "byte_TYPE", ")", "{", "car", "=", "'B'", ";", "}", "else", "if", "(", "d", "==", "ClassHelper", ".", "char_TYPE", ")", "{", "car", "=", "'C'", ";", "}", "else", "if", "(", "d", "==", "ClassHelper", ".", "short_TYPE", ")", "{", "car", "=", "'S'", ";", "}", "else", "if", "(", "d", "==", "ClassHelper", ".", "double_TYPE", ")", "{", "car", "=", "'D'", ";", "}", "else", "if", "(", "d", "==", "ClassHelper", ".", "float_TYPE", ")", "{", "car", "=", "'F'", ";", "}", "else", "{", "car", "=", "'J'", ";", "}", "buf", ".", "append", "(", "car", ")", ";", "return", "buf", ".", "toString", "(", ")", ";", "}", "else", "if", "(", "d", ".", "isArray", "(", ")", ")", "{", "buf", ".", "append", "(", "'['", ")", ";", "d", "=", "d", ".", "getComponentType", "(", ")", ";", "}", "else", "{", "buf", ".", "append", "(", "'L'", ")", ";", "String", "name", "=", "d", ".", "getName", "(", ")", ";", "int", "len", "=", "name", ".", "length", "(", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "len", ";", "++", "i", ")", "{", "char", "car", "=", "name", ".", "charAt", "(", "i", ")", ";", "buf", ".", "append", "(", "car", "==", "'.'", "?", "'/'", ":", "car", ")", ";", "}", "if", "(", "end", ")", "buf", ".", "append", "(", "';'", ")", ";", "return", "buf", ".", "toString", "(", ")", ";", "}", "}", "}", "public", "static", "String", "[", "]", "getClassInternalNames", "(", "ClassNode", "[", "]", "names", ")", "{", "int", "size", "=", "names", ".", "length", ";", "String", "[", "]", "answer", "=", "new", "String", "[", "size", "]", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "size", ";", "i", "++", ")", "{", "answer", "[", "i", "]", "=", "getClassInternalName", "(", "names", "[", "i", "]", ")", ";", "}", "return", "answer", ";", "}", "public", "static", "void", "pushConstant", "(", "MethodVisitor", "mv", ",", "int", "value", ")", "{", "switch", "(", "value", ")", "{", "case", "0", ":", "mv", ".", "visitInsn", "(", "ICONST_0", ")", ";", "break", ";", "case", "1", ":", "mv", ".", "visitInsn", "(", "ICONST_1", ")", ";", "break", ";", "case", "2", ":", "mv", ".", "visitInsn", "(", "ICONST_2", ")", ";", "break", ";", "case", "3", ":", "mv", ".", "visitInsn", "(", "ICONST_3", ")", ";", "break", ";", "case", "4", ":", "mv", ".", "visitInsn", "(", "ICONST_4", ")", ";", "break", ";", "case", "5", ":", "mv", ".", "visitInsn", "(", "ICONST_5", ")", ";", "break", ";", "default", ":", "if", "(", "value", ">=", "Byte", ".", "MIN_VALUE", "&&", "value", "<=", "Byte", ".", "MAX_VALUE", ")", "{", "mv", ".", "visitIntInsn", "(", "BIPUSH", ",", "value", ")", ";", "}", "else", "if", "(", "value", ">=", "Short", ".", "MIN_VALUE", "&&", "value", "<=", "Short", ".", "MAX_VALUE", ")", "{", "mv", ".", "visitIntInsn", "(", "SIPUSH", ",", "value", ")", ";", "}", "else", "{", "mv", ".", "visitLdcInsn", "(", "Integer", ".", "valueOf", "(", "value", ")", ")", ";", "}", "}", "}", "public", "static", "void", "negateBoolean", "(", "MethodVisitor", "mv", ")", "{", "Label", "endLabel", "=", "new", "Label", "(", ")", ";", "Label", "falseLabel", "=", "new", "Label", "(", ")", ";", "mv", ".", "visitJumpInsn", "(", "IFNE", ",", "falseLabel", ")", ";", "mv", ".", "visitInsn", "(", "ICONST_1", ")", ";", "mv", ".", "visitJumpInsn", "(", "GOTO", ",", "endLabel", ")", ";", "mv", ".", "visitLabel", "(", "falseLabel", ")", ";", "mv", ".", "visitInsn", "(", "ICONST_0", ")", ";", "mv", ".", "visitLabel", "(", "endLabel", ")", ";", "}", "public", "static", "String", "formatNameForClassLoading", "(", "String", "name", ")", "{", "if", "(", "name", ".", "equals", "(", "\"int\"", ")", "||", "name", ".", "equals", "(", "\"long\"", ")", "||", "name", ".", "equals", "(", "\"short\"", ")", "||", "name", ".", "equals", "(", "\"float\"", ")", "||", "name", ".", "equals", "(", "\"double\"", ")", "||", "name", ".", "equals", "(", "\"byte\"", ")", "||", "name", ".", "equals", "(", "\"char\"", ")", "||", "name", ".", "equals", "(", "\"boolean\"", ")", "||", "name", ".", "equals", "(", "\"void\"", ")", ")", "{", "return", "name", ";", "}", "if", "(", "name", "==", "null", ")", "{", "return", "\"\"", ";", "}", "if", "(", "name", ".", "startsWith", "(", "\"[\"", ")", ")", "{", "return", "name", ".", "replace", "(", "'/'", ",", "'.'", ")", ";", "}", "if", "(", "name", ".", "startsWith", "(", "\"L\"", ")", ")", "{", "name", "=", "name", ".", "substring", "(", "1", ")", ";", "if", "(", "name", ".", "endsWith", "(", "\";\"", ")", ")", "{", "name", "=", "name", ".", "substring", "(", "0", ",", "name", ".", "length", "(", ")", "-", "1", ")", ";", "}", "return", "name", ".", "replace", "(", "'/'", ",", "'.'", ")", ";", "}", "String", "prefix", "=", "\"\"", ";", "if", "(", "name", ".", "endsWith", "(", "\"[]\"", ")", ")", "{", "prefix", "=", "\"[\"", ";", "name", "=", "name", ".", "substring", "(", "0", ",", "name", ".", "length", "(", ")", "-", "2", ")", ";", "if", "(", "name", ".", "equals", "(", "\"int\"", ")", ")", "{", "return", "prefix", "+", "\"I\"", ";", "}", "else", "if", "(", "name", ".", "equals", "(", "\"long\"", ")", ")", "{", "return", "prefix", "+", "\"J\"", ";", "}", "else", "if", "(", "name", ".", "equals", "(", "\"short\"", ")", ")", "{", "return", "prefix", "+", "\"S\"", ";", "}", "else", "if", "(", "name", ".", "equals", "(", "\"float\"", ")", ")", "{", "return", "prefix", "+", "\"F\"", ";", "}", "else", "if", "(", "name", ".", "equals", "(", "\"double\"", ")", ")", "{", "return", "prefix", "+", "\"D\"", ";", "}", "else", "if", "(", "name", ".", "equals", "(", "\"byte\"", ")", ")", "{", "return", "prefix", "+", "\"B\"", ";", "}", "else", "if", "(", "name", ".", "equals", "(", "\"char\"", ")", ")", "{", "return", "prefix", "+", "\"C\"", ";", "}", "else", "if", "(", "name", ".", "equals", "(", "\"boolean\"", ")", ")", "{", "return", "prefix", "+", "\"Z\"", ";", "}", "else", "{", "return", "prefix", "+", "\"L\"", "+", "name", ".", "replace", "(", "'/'", ",", "'.'", ")", "+", "\";\"", ";", "}", "}", "return", "name", ".", "replace", "(", "'/'", ",", "'.'", ")", ";", "}", "public", "static", "void", "doReturn", "(", "MethodVisitor", "mv", ",", "ClassNode", "returnType", ")", "{", "if", "(", "returnType", "==", "ClassHelper", ".", "double_TYPE", ")", "{", "mv", ".", "visitInsn", "(", "DRETURN", ")", ";", "}", "else", "if", "(", "returnType", "==", "ClassHelper", ".", "float_TYPE", ")", "{", "mv", ".", "visitInsn", "(", "FRETURN", ")", ";", "}", "else", "if", "(", "returnType", "==", "ClassHelper", ".", "long_TYPE", ")", "{", "mv", ".", "visitInsn", "(", "LRETURN", ")", ";", "}", "else", "if", "(", "returnType", "==", "ClassHelper", ".", "boolean_TYPE", "||", "returnType", "==", "ClassHelper", ".", "char_TYPE", "||", "returnType", "==", "ClassHelper", ".", "byte_TYPE", "||", "returnType", "==", "ClassHelper", ".", "int_TYPE", "||", "returnType", "==", "ClassHelper", ".", "short_TYPE", ")", "{", "mv", ".", "visitInsn", "(", "IRETURN", ")", ";", "}", "else", "if", "(", "returnType", "==", "ClassHelper", ".", "VOID_TYPE", ")", "{", "mv", ".", "visitInsn", "(", "RETURN", ")", ";", "}", "else", "{", "mv", ".", "visitInsn", "(", "ARETURN", ")", ";", "}", "}", "private", "static", "boolean", "hasGenerics", "(", "Parameter", "[", "]", "param", ")", "{", "if", "(", "param", ".", "length", "==", "0", ")", "return", "false", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "param", ".", "length", ";", "i", "++", ")", "{", "ClassNode", "type", "=", "param", "[", "i", "]", ".", "getType", "(", ")", ";", "if", "(", "hasGenerics", "(", "type", ")", ")", "return", "true", ";", "}", "return", "false", ";", "}", "private", "static", "boolean", "hasGenerics", "(", "ClassNode", "type", ")", "{", "return", "type", ".", "isArray", "(", ")", "?", "hasGenerics", "(", "type", ".", "getComponentType", "(", ")", ")", ":", "type", ".", "getGenericsTypes", "(", ")", "!=", "null", ";", "}", "public", "static", "String", "getGenericsMethodSignature", "(", "MethodNode", "node", ")", "{", "GenericsType", "[", "]", "generics", "=", "node", ".", "getGenericsTypes", "(", ")", ";", "Parameter", "[", "]", "param", "=", "node", ".", "getParameters", "(", ")", ";", "ClassNode", "returnType", "=", "node", ".", "getReturnType", "(", ")", ";", "if", "(", "generics", "==", "null", "&&", "!", "hasGenerics", "(", "param", ")", "&&", "!", "hasGenerics", "(", "returnType", ")", ")", "return", "null", ";", "StringBuffer", "ret", "=", "new", "StringBuffer", "(", "100", ")", ";", "getGenericsTypeSpec", "(", "ret", ",", "generics", ")", ";", "GenericsType", "[", "]", "paramTypes", "=", "new", "GenericsType", "[", "param", ".", "length", "]", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "param", ".", "length", ";", "i", "++", ")", "{", "ClassNode", "pType", "=", "param", "[", "i", "]", ".", "getType", "(", ")", ";", "if", "(", "pType", ".", "getGenericsTypes", "(", ")", "==", "null", "||", "!", "pType", ".", "isGenericsPlaceHolder", "(", ")", ")", "{", "paramTypes", "[", "i", "]", "=", "new", "GenericsType", "(", "pType", ")", ";", "}", "else", "{", "paramTypes", "[", "i", "]", "=", "pType", ".", "getGenericsTypes", "(", ")", "[", "0", "]", ";", "}", "}", "addSubTypes", "(", "ret", ",", "paramTypes", ",", "\"(\"", ",", "\")\"", ")", ";", "addSubTypes", "(", "ret", ",", "new", "GenericsType", "[", "]", "{", "new", "GenericsType", "(", "returnType", ")", "}", ",", "\"\"", ",", "\"\"", ")", ";", "return", "ret", ".", "toString", "(", ")", ";", "}", "private", "static", "boolean", "usesGenericsInClassSignature", "(", "ClassNode", "node", ")", "{", "if", "(", "!", "node", ".", "isUsingGenerics", "(", ")", ")", "return", "false", ";", "if", "(", "hasGenerics", "(", "node", ")", ")", "return", "true", ";", "ClassNode", "sclass", "=", "node", ".", "getUnresolvedSuperClass", "(", "false", ")", ";", "if", "(", "sclass", ".", "isUsingGenerics", "(", ")", ")", "return", "true", ";", "ClassNode", "[", "]", "interfaces", "=", "node", ".", "getInterfaces", "(", ")", ";", "if", "(", "interfaces", "!=", "null", ")", "{", "for", "(", "int", "i", "=", "0", ";", "i", "<", "interfaces", ".", "length", ";", "i", "++", ")", "{", "if", "(", "interfaces", "[", "i", "]", ".", "isUsingGenerics", "(", ")", ")", "return", "true", ";", "}", "}", "return", "false", ";", "}", "public", "static", "String", "getGenericsSignature", "(", "ClassNode", "node", ")", "{", "if", "(", "!", "usesGenericsInClassSignature", "(", "node", ")", ")", "return", "null", ";", "GenericsType", "[", "]", "genericsTypes", "=", "node", ".", "getGenericsTypes", "(", ")", ";", "StringBuffer", "ret", "=", "new", "StringBuffer", "(", "100", ")", ";", "getGenericsTypeSpec", "(", "ret", ",", "genericsTypes", ")", ";", "GenericsType", "extendsPart", "=", "new", "GenericsType", "(", "node", ".", "getUnresolvedSuperClass", "(", "false", ")", ")", ";", "writeGenericsBounds", "(", "ret", ",", "extendsPart", ",", "true", ")", ";", "ClassNode", "[", "]", "interfaces", "=", "node", ".", "getInterfaces", "(", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "interfaces", ".", "length", ";", "i", "++", ")", "{", "GenericsType", "interfacePart", "=", "new", "GenericsType", "(", "interfaces", "[", "i", "]", ")", ";", "writeGenericsBounds", "(", "ret", ",", "interfacePart", ",", "false", ")", ";", "}", "return", "ret", ".", "toString", "(", ")", ";", "}", "private", "static", "void", "getGenericsTypeSpec", "(", "StringBuffer", "ret", ",", "GenericsType", "[", "]", "genericsTypes", ")", "{", "if", "(", "genericsTypes", "==", "null", ")", "return", ";", "ret", ".", "append", "(", "'<'", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "genericsTypes", ".", "length", ";", "i", "++", ")", "{", "String", "name", "=", "genericsTypes", "[", "i", "]", ".", "getName", "(", ")", ";", "ret", ".", "append", "(", "name", ")", ";", "ret", ".", "append", "(", "':'", ")", ";", "writeGenericsBounds", "(", "ret", ",", "genericsTypes", "[", "i", "]", ",", "true", ")", ";", "}", "ret", ".", "append", "(", "'>'", ")", ";", "}", "public", "static", "String", "getGenericsBounds", "(", "ClassNode", "type", ")", "{", "GenericsType", "[", "]", "genericsTypes", "=", "type", ".", "getGenericsTypes", "(", ")", ";", "if", "(", "genericsTypes", "==", "null", ")", "return", "null", ";", "StringBuffer", "ret", "=", "new", "StringBuffer", "(", "100", ")", ";", "if", "(", "type", ".", "isGenericsPlaceHolder", "(", ")", ")", "{", "addSubTypes", "(", "ret", ",", "type", ".", "getGenericsTypes", "(", ")", ",", "\"\"", ",", "\"\"", ")", ";", "}", "else", "{", "GenericsType", "gt", "=", "new", "GenericsType", "(", "type", ")", ";", "writeGenericsBounds", "(", "ret", ",", "gt", ",", "false", ")", ";", "}", "return", "ret", ".", "toString", "(", ")", ";", "}", "private", "static", "void", "writeGenericsBoundType", "(", "StringBuffer", "ret", ",", "ClassNode", "printType", ",", "boolean", "writeInterfaceMarker", ")", "{", "if", "(", "writeInterfaceMarker", "&&", "printType", ".", "isInterface", "(", ")", ")", "ret", ".", "append", "(", "\":\"", ")", ";", "if", "(", "printType", ".", "equals", "(", "ClassHelper", ".", "OBJECT_TYPE", ")", "&&", "printType", ".", "getGenericsTypes", "(", ")", "!=", "null", ")", "{", "ret", ".", "append", "(", "\"T\"", ")", ";", "ret", ".", "append", "(", "printType", ".", "getGenericsTypes", "(", ")", "[", "0", "]", ".", "getName", "(", ")", ")", ";", "ret", ".", "append", "(", "\";\"", ")", ";", "}", "else", "{", "ret", ".", "append", "(", "getTypeDescription", "(", "printType", ",", "false", ")", ")", ";", "addSubTypes", "(", "ret", ",", "printType", ".", "getGenericsTypes", "(", ")", ",", "\"<\"", ",", "\">\"", ")", ";", "if", "(", "!", "ClassHelper", ".", "isPrimitiveType", "(", "printType", ")", ")", "ret", ".", "append", "(", "\";\"", ")", ";", "}", "}", "private", "static", "void", "writeGenericsBounds", "(", "StringBuffer", "ret", ",", "GenericsType", "type", ",", "boolean", "writeInterfaceMarker", ")", "{", "if", "(", "type", ".", "getUpperBounds", "(", ")", "!=", "null", ")", "{", "ClassNode", "[", "]", "bounds", "=", "type", ".", "getUpperBounds", "(", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "bounds", ".", "length", ";", "i", "++", ")", "{", "writeGenericsBoundType", "(", "ret", ",", "bounds", "[", "i", "]", ",", "writeInterfaceMarker", ")", ";", "}", "}", "else", "if", "(", "type", ".", "getLowerBound", "(", ")", "!=", "null", ")", "{", "writeGenericsBoundType", "(", "ret", ",", "type", ".", "getLowerBound", "(", ")", ",", "writeInterfaceMarker", ")", ";", "}", "else", "{", "writeGenericsBoundType", "(", "ret", ",", "type", ".", "getType", "(", ")", ",", "writeInterfaceMarker", ")", ";", "}", "}", "private", "static", "void", "addSubTypes", "(", "StringBuffer", "ret", ",", "GenericsType", "[", "]", "types", ",", "String", "start", ",", "String", "end", ")", "{", "if", "(", "types", "==", "null", ")", "return", ";", "ret", ".", "append", "(", "start", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "types", ".", "length", ";", "i", "++", ")", "{", "if", "(", "types", "[", "i", "]", ".", "getType", "(", ")", ".", "isArray", "(", ")", ")", "{", "ret", ".", "append", "(", "\"[\"", ")", ";", "addSubTypes", "(", "ret", ",", "new", "GenericsType", "[", "]", "{", "new", "GenericsType", "(", "types", "[", "i", "]", ".", "getType", "(", ")", ".", "getComponentType", "(", ")", ")", "}", ",", "\"\"", ",", "\"\"", ")", ";", "}", "else", "{", "if", "(", "types", "[", "i", "]", ".", "isPlaceholder", "(", ")", ")", "{", "ret", ".", "append", "(", "'T'", ")", ";", "String", "name", "=", "types", "[", "i", "]", ".", "getName", "(", ")", ";", "ret", ".", "append", "(", "name", ")", ";", "ret", ".", "append", "(", "';'", ")", ";", "}", "else", "if", "(", "types", "[", "i", "]", ".", "isWildcard", "(", ")", ")", "{", "if", "(", "types", "[", "i", "]", ".", "getUpperBounds", "(", ")", "!=", "null", ")", "{", "ret", ".", "append", "(", "'+'", ")", ";", "writeGenericsBounds", "(", "ret", ",", "types", "[", "i", "]", ",", "false", ")", ";", "}", "else", "if", "(", "types", "[", "i", "]", ".", "getLowerBound", "(", ")", "!=", "null", ")", "{", "ret", ".", "append", "(", "'-'", ")", ";", "writeGenericsBounds", "(", "ret", ",", "types", "[", "i", "]", ",", "false", ")", ";", "}", "else", "{", "ret", ".", "append", "(", "'*'", ")", ";", "}", "}", "else", "{", "writeGenericsBounds", "(", "ret", ",", "types", "[", "i", "]", ",", "false", ")", ";", "}", "}", "}", "ret", ".", "append", "(", "end", ")", ";", "}", "public", "static", "void", "load", "(", "MethodVisitor", "mv", ",", "ClassNode", "type", ",", "int", "idx", ")", "{", "if", "(", "type", "==", "ClassHelper", ".", "double_TYPE", ")", "{", "mv", ".", "visitVarInsn", "(", "DLOAD", ",", "idx", ")", ";", "}", "else", "if", "(", "type", "==", "ClassHelper", ".", "float_TYPE", ")", "{", "mv", ".", "visitVarInsn", "(", "FLOAD", ",", "idx", ")", ";", "}", "else", "if", "(", "type", "==", "ClassHelper", ".", "long_TYPE", ")", "{", "mv", ".", "visitVarInsn", "(", "LLOAD", ",", "idx", ")", ";", "}", "else", "if", "(", "type", "==", "ClassHelper", ".", "boolean_TYPE", "||", "type", "==", "ClassHelper", ".", "char_TYPE", "||", "type", "==", "ClassHelper", ".", "byte_TYPE", "||", "type", "==", "ClassHelper", ".", "int_TYPE", "||", "type", "==", "ClassHelper", ".", "short_TYPE", ")", "{", "mv", ".", "visitVarInsn", "(", "ILOAD", ",", "idx", ")", ";", "}", "else", "{", "mv", ".", "visitVarInsn", "(", "ALOAD", ",", "idx", ")", ";", "}", "}", "public", "static", "void", "doCast", "(", "MethodVisitor", "mv", ",", "ClassNode", "type", ")", "{", "if", "(", "type", "==", "ClassHelper", ".", "OBJECT_TYPE", ")", "return", ";", "if", "(", "ClassHelper", ".", "isPrimitiveType", "(", "type", ")", "&&", "type", "!=", "ClassHelper", ".", "VOID_TYPE", ")", "{", "unbox", "(", "mv", ",", "type", ")", ";", "}", "else", "{", "mv", ".", "visitTypeInsn", "(", "CHECKCAST", ",", "type", ".", "isArray", "(", ")", "?", "BytecodeHelper", ".", "getTypeDescription", "(", "type", ")", ":", "BytecodeHelper", ".", "getClassInternalName", "(", "type", ".", "getName", "(", ")", ")", ")", ";", "}", "}", "public", "static", "void", "doCastToPrimitive", "(", "MethodVisitor", "mv", ",", "ClassNode", "sourceType", ",", "ClassNode", "targetType", ")", "{", "mv", ".", "visitMethodInsn", "(", "INVOKEVIRTUAL", ",", "BytecodeHelper", ".", "getClassInternalName", "(", "sourceType", ")", ",", "targetType", ".", "getName", "(", ")", "+", "\"Value\"", ",", "\"()\"", "+", "BytecodeHelper", ".", "getTypeDescription", "(", "targetType", ")", ")", ";", "}", "public", "static", "void", "doCast", "(", "MethodVisitor", "mv", ",", "Class", "type", ")", "{", "if", "(", "type", "==", "Object", ".", "class", ")", "return", ";", "if", "(", "type", ".", "isPrimitive", "(", ")", "&&", "type", "!=", "Void", ".", "TYPE", ")", "{", "unbox", "(", "mv", ",", "type", ")", ";", "}", "else", "{", "mv", ".", "visitTypeInsn", "(", "CHECKCAST", ",", "type", ".", "isArray", "(", ")", "?", "BytecodeHelper", ".", "getTypeDescription", "(", "type", ")", ":", "BytecodeHelper", ".", "getClassInternalName", "(", "type", ".", "getName", "(", ")", ")", ")", ";", "}", "}", "public", "static", "void", "unbox", "(", "MethodVisitor", "mv", ",", "Class", "type", ")", "{", "if", "(", "type", ".", "isPrimitive", "(", ")", "&&", "type", "!=", "Void", ".", "TYPE", ")", "{", "String", "returnString", "=", "\"\"", "+", "BytecodeHelper", ".", "getTypeDescription", "(", "type", ")", ";", "mv", ".", "visitMethodInsn", "(", "INVOKESTATIC", ",", "DTT_CLASSNAME", ",", "type", ".", "getName", "(", ")", "+", "\"Unbox\"", ",", "returnString", ")", ";", "}", "}", "public", "static", "void", "unbox", "(", "MethodVisitor", "mv", ",", "ClassNode", "type", ")", "{", "if", "(", "type", ".", "isPrimaryClassNode", "(", ")", ")", "return", ";", "if", "(", "type", ".", "isPrimitive", "(", ")", ")", "unbox", "(", "mv", ",", "type", ".", "getTypeClass", "(", ")", ")", ";", "}", "public", "static", "boolean", "box", "(", "MethodVisitor", "mv", ",", "ClassNode", "type", ")", "{", "if", "(", "type", ".", "isPrimaryClassNode", "(", ")", ")", "return", "false", ";", "if", "(", "!", "type", ".", "isPrimitive", "(", ")", ")", "return", "false", ";", "return", "box", "(", "mv", ",", "type", ".", "getTypeClass", "(", ")", ")", ";", "}", "public", "static", "boolean", "box", "(", "MethodVisitor", "mv", ",", "Class", "type", ")", "{", "if", "(", "ReflectionCache", ".", "getCachedClass", "(", "type", ")", ".", "isPrimitive", "&&", "type", "!=", "void", ".", "class", ")", "{", "String", "returnString", "=", "\"(\"", "+", "BytecodeHelper", ".", "getTypeDescription", "(", "type", ")", "+", "\"\"", ";", "mv", ".", "visitMethodInsn", "(", "INVOKESTATIC", ",", "DTT_CLASSNAME", ",", "\"box\"", ",", "returnString", ")", ";", "return", "true", ";", "}", "return", "false", ";", "}", "}", "</s>" ]
6,630
[ "<s>", "package", "org", ".", "codehaus", ".", "groovy", ".", "classgen", ".", "asm", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "GroovyBugError", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "ClassHelper", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "ClassNode", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "Parameter", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "Variable", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "VariableScope", ";", "import", "org", ".", "objectweb", ".", "asm", ".", "Label", ";", "import", "org", ".", "objectweb", ".", "asm", ".", "MethodVisitor", ";", "import", "org", ".", "objectweb", ".", "asm", ".", "Opcodes", ";", "import", "java", ".", "util", ".", "*", ";", "public", "class", "CompileStack", "implements", "Opcodes", "{", "private", "boolean", "clear", "=", "true", ";", "private", "VariableScope", "scope", ";", "private", "Label", "continueLabel", ";", "private", "Label", "breakLabel", ";", "private", "Map", "stackVariables", "=", "new", "HashMap", "(", ")", ";", "private", "int", "currentVariableIndex", "=", "1", ";", "private", "int", "nextVariableIndex", "=", "1", ";", "private", "final", "LinkedList", "temporaryVariables", "=", "new", "LinkedList", "(", ")", ";", "private", "final", "LinkedList", "usedVariables", "=", "new", "LinkedList", "(", ")", ";", "private", "Map", "superBlockNamedLabels", "=", "new", "HashMap", "(", ")", ";", "private", "Map", "currentBlockNamedLabels", "=", "new", "HashMap", "(", ")", ";", "private", "LinkedList", "<", "BlockRecorder", ">", "finallyBlocks", "=", "new", "LinkedList", "<", "BlockRecorder", ">", "(", ")", ";", "private", "LinkedList", "<", "BlockRecorder", ">", "visitedBlocks", "=", "new", "LinkedList", "<", "BlockRecorder", ">", "(", ")", ";", "private", "Label", "thisStartLabel", ",", "thisEndLabel", ";", "private", "final", "LinkedList", "stateStack", "=", "new", "LinkedList", "(", ")", ";", "private", "LinkedList", "<", "Boolean", ">", "implicitThisStack", "=", "new", "LinkedList", "(", ")", ";", "private", "LinkedList", "<", "Boolean", ">", "lhsStack", "=", "new", "LinkedList", "(", ")", ";", "{", "implicitThisStack", ".", "add", "(", "false", ")", ";", "lhsStack", ".", "add", "(", "false", ")", ";", "}", "private", "int", "localVariableOffset", ";", "private", "final", "Map", "namedLoopBreakLabel", "=", "new", "HashMap", "(", ")", ";", "private", "final", "Map", "namedLoopContinueLabel", "=", "new", "HashMap", "(", ")", ";", "private", "String", "className", ";", "private", "LinkedList", "<", "ExceptionTableEntry", ">", "typedExceptions", "=", "new", "LinkedList", "<", "ExceptionTableEntry", ">", "(", ")", ";", "private", "LinkedList", "<", "ExceptionTableEntry", ">", "untypedExceptions", "=", "new", "LinkedList", "<", "ExceptionTableEntry", ">", "(", ")", ";", "private", "boolean", "lhs", ";", "private", "boolean", "implicitThis", ";", "private", "WriterController", "controller", ";", "private", "boolean", "inSpecialConstructallCall", ";", "protected", "static", "class", "LabelRange", "{", "public", "Label", "start", ";", "public", "Label", "end", ";", "}", "public", "static", "class", "BlockRecorder", "{", "private", "boolean", "isEmpty", "=", "true", ";", "public", "Runnable", "excludedStatement", ";", "public", "LinkedList", "<", "LabelRange", ">", "ranges", ";", "public", "BlockRecorder", "(", ")", "{", "ranges", "=", "new", "LinkedList", "<", "LabelRange", ">", "(", ")", ";", "}", "public", "BlockRecorder", "(", "Runnable", "excludedStatement", ")", "{", "this", "(", ")", ";", "this", ".", "excludedStatement", "=", "excludedStatement", ";", "}", "public", "void", "startRange", "(", "Label", "start", ")", "{", "LabelRange", "range", "=", "new", "LabelRange", "(", ")", ";", "range", ".", "start", "=", "start", ";", "ranges", ".", "add", "(", "range", ")", ";", "isEmpty", "=", "false", ";", "}", "public", "void", "closeRange", "(", "Label", "end", ")", "{", "ranges", ".", "getLast", "(", ")", ".", "end", "=", "end", ";", "}", "}", "private", "class", "ExceptionTableEntry", "{", "Label", "start", ",", "end", ",", "goal", ";", "String", "sig", ";", "}", "private", "class", "StateStackElement", "{", "final", "VariableScope", "scope", ";", "final", "Label", "continueLabel", ";", "final", "Label", "breakLabel", ";", "final", "Map", "stackVariables", ";", "final", "Map", "currentBlockNamedLabels", ";", "final", "LinkedList", "<", "BlockRecorder", ">", "finallyBlocks", ";", "final", "boolean", "inSpecialConstructallCall", ";", "StateStackElement", "(", ")", "{", "scope", "=", "CompileStack", ".", "this", ".", "scope", ";", "continueLabel", "=", "CompileStack", ".", "this", ".", "continueLabel", ";", "breakLabel", "=", "CompileStack", ".", "this", ".", "breakLabel", ";", "stackVariables", "=", "CompileStack", ".", "this", ".", "stackVariables", ";", "currentBlockNamedLabels", "=", "CompileStack", ".", "this", ".", "currentBlockNamedLabels", ";", "finallyBlocks", "=", "CompileStack", ".", "this", ".", "finallyBlocks", ";", "inSpecialConstructallCall", "=", "CompileStack", ".", "this", ".", "inSpecialConstructallCall", ";", "}", "}", "public", "CompileStack", "(", "WriterController", "wc", ")", "{", "this", ".", "controller", "=", "wc", ";", "}", "public", "void", "pushState", "(", ")", "{", "stateStack", ".", "add", "(", "new", "StateStackElement", "(", ")", ")", ";", "stackVariables", "=", "new", "HashMap", "(", "stackVariables", ")", ";", "finallyBlocks", "=", "new", "LinkedList", "(", "finallyBlocks", ")", ";", "}", "private", "void", "popState", "(", ")", "{", "if", "(", "stateStack", ".", "size", "(", ")", "==", "0", ")", "{", "throw", "new", "GroovyBugError", "(", "\"\"", ")", ";", "}", "StateStackElement", "element", "=", "(", "StateStackElement", ")", "stateStack", ".", "removeLast", "(", ")", ";", "scope", "=", "element", ".", "scope", ";", "continueLabel", "=", "element", ".", "continueLabel", ";", "breakLabel", "=", "element", ".", "breakLabel", ";", "stackVariables", "=", "element", ".", "stackVariables", ";", "finallyBlocks", "=", "element", ".", "finallyBlocks", ";", "inSpecialConstructallCall", "=", "element", ".", "inSpecialConstructallCall", ";", "}", "public", "Label", "getContinueLabel", "(", ")", "{", "return", "continueLabel", ";", "}", "public", "Label", "getBreakLabel", "(", ")", "{", "return", "breakLabel", ";", "}", "public", "void", "removeVar", "(", "int", "tempIndex", ")", "{", "final", "BytecodeVariable", "head", "=", "(", "BytecodeVariable", ")", "temporaryVariables", ".", "removeFirst", "(", ")", ";", "if", "(", "head", ".", "getIndex", "(", ")", "!=", "tempIndex", ")", "{", "temporaryVariables", ".", "addFirst", "(", "head", ")", ";", "throw", "new", "GroovyBugError", "(", "\"\"", "+", "\"\"", "+", "tempIndex", "+", "\"\"", "+", "\"\"", "+", "temporaryVariables", ")", ";", "}", "}", "private", "void", "setEndLabels", "(", ")", "{", "Label", "endLabel", "=", "new", "Label", "(", ")", ";", "controller", ".", "getMethodVisitor", "(", ")", ".", "visitLabel", "(", "endLabel", ")", ";", "for", "(", "Iterator", "iter", "=", "stackVariables", ".", "values", "(", ")", ".", "iterator", "(", ")", ";", "iter", ".", "hasNext", "(", ")", ";", ")", "{", "BytecodeVariable", "var", "=", "(", "BytecodeVariable", ")", "iter", ".", "next", "(", ")", ";", "var", ".", "setEndLabel", "(", "endLabel", ")", ";", "}", "thisEndLabel", "=", "endLabel", ";", "}", "public", "void", "pop", "(", ")", "{", "setEndLabels", "(", ")", ";", "popState", "(", ")", ";", "}", "public", "VariableScope", "getScope", "(", ")", "{", "return", "scope", ";", "}", "public", "int", "defineTemporaryVariable", "(", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "Variable", "var", ",", "boolean", "store", ")", "{", "return", "defineTemporaryVariable", "(", "var", ".", "getName", "(", ")", ",", "var", ".", "getType", "(", ")", ",", "store", ")", ";", "}", "public", "BytecodeVariable", "getVariable", "(", "String", "variableName", ")", "{", "return", "getVariable", "(", "variableName", ",", "true", ")", ";", "}", "public", "BytecodeVariable", "getVariable", "(", "String", "variableName", ",", "boolean", "mustExist", ")", "{", "if", "(", "variableName", ".", "equals", "(", "\"this\"", ")", ")", "return", "BytecodeVariable", ".", "THIS_VARIABLE", ";", "if", "(", "variableName", ".", "equals", "(", "\"super\"", ")", ")", "return", "BytecodeVariable", ".", "SUPER_VARIABLE", ";", "BytecodeVariable", "v", "=", "(", "BytecodeVariable", ")", "stackVariables", ".", "get", "(", "variableName", ")", ";", "if", "(", "v", "==", "null", "&&", "mustExist", ")", "throw", "new", "GroovyBugError", "(", "\"\"", "+", "variableName", "+", "\"\"", ")", ";", "return", "v", ";", "}", "public", "int", "defineTemporaryVariable", "(", "String", "name", ",", "boolean", "store", ")", "{", "return", "defineTemporaryVariable", "(", "name", ",", "ClassHelper", ".", "DYNAMIC_TYPE", ",", "store", ")", ";", "}", "public", "int", "defineTemporaryVariable", "(", "String", "name", ",", "ClassNode", "node", ",", "boolean", "store", ")", "{", "BytecodeVariable", "answer", "=", "defineVar", "(", "name", ",", "node", ",", "false", ",", "false", ")", ";", "temporaryVariables", ".", "addFirst", "(", "answer", ")", ";", "usedVariables", ".", "removeLast", "(", ")", ";", "if", "(", "store", ")", "controller", ".", "getOperandStack", "(", ")", ".", "storeVar", "(", "answer", ")", ";", "return", "answer", ".", "getIndex", "(", ")", ";", "}", "private", "void", "resetVariableIndex", "(", "boolean", "isStatic", ")", "{", "temporaryVariables", ".", "clear", "(", ")", ";", "if", "(", "!", "isStatic", ")", "{", "currentVariableIndex", "=", "1", ";", "nextVariableIndex", "=", "1", ";", "}", "else", "{", "currentVariableIndex", "=", "0", ";", "nextVariableIndex", "=", "0", ";", "}", "}", "public", "void", "clear", "(", ")", "{", "if", "(", "stateStack", ".", "size", "(", ")", ">", "1", ")", "{", "int", "size", "=", "stateStack", ".", "size", "(", ")", "-", "1", ";", "throw", "new", "GroovyBugError", "(", "\"\"", "+", "size", "+", "\"\"", "+", "(", "size", "==", "1", "?", "\"\"", ":", "\"s\"", ")", "+", "\"", "than", "pops.\"", ")", ";", "}", "if", "(", "lhsStack", ".", "size", "(", ")", ">", "1", ")", "{", "int", "size", "=", "lhsStack", ".", "size", "(", ")", "-", "1", ";", "throw", "new", "GroovyBugError", "(", "\"\"", "+", "size", "+", "\"\"", ")", ";", "}", "if", "(", "implicitThisStack", ".", "size", "(", ")", ">", "1", ")", "{", "int", "size", "=", "implicitThisStack", ".", "size", "(", ")", "-", "1", ";", "throw", "new", "GroovyBugError", "(", "\"\"", "+", "size", "+", "\"\"", ")", ";", "}", "clear", "=", "true", ";", "MethodVisitor", "mv", "=", "controller", ".", "getMethodVisitor", "(", ")", ";", "if", "(", "true", ")", "{", "if", "(", "thisEndLabel", "==", "null", ")", "setEndLabels", "(", ")", ";", "if", "(", "!", "scope", ".", "isInStaticContext", "(", ")", ")", "{", "mv", ".", "visitLocalVariable", "(", "\"this\"", ",", "className", ",", "null", ",", "thisStartLabel", ",", "thisEndLabel", ",", "0", ")", ";", "}", "for", "(", "Iterator", "iterator", "=", "usedVariables", ".", "iterator", "(", ")", ";", "iterator", ".", "hasNext", "(", ")", ";", ")", "{", "BytecodeVariable", "v", "=", "(", "BytecodeVariable", ")", "iterator", ".", "next", "(", ")", ";", "ClassNode", "t", "=", "v", ".", "getType", "(", ")", ";", "if", "(", "v", ".", "isHolder", "(", ")", ")", "t", "=", "ClassHelper", ".", "REFERENCE_TYPE", ";", "String", "type", "=", "BytecodeHelper", ".", "getTypeDescription", "(", "t", ")", ";", "Label", "start", "=", "v", ".", "getStartLabel", "(", ")", ";", "Label", "end", "=", "v", ".", "getEndLabel", "(", ")", ";", "if", "(", "start", "!=", "null", "&&", "end", "!=", "null", ")", "mv", ".", "visitLocalVariable", "(", "v", ".", "getName", "(", ")", ",", "type", ",", "null", ",", "start", ",", "end", ",", "v", ".", "getIndex", "(", ")", ")", ";", "}", "}", "for", "(", "ExceptionTableEntry", "ep", ":", "typedExceptions", ")", "{", "mv", ".", "visitTryCatchBlock", "(", "ep", ".", "start", ",", "ep", ".", "end", ",", "ep", ".", "goal", ",", "ep", ".", "sig", ")", ";", "}", "for", "(", "ExceptionTableEntry", "ep", ":", "untypedExceptions", ")", "{", "mv", ".", "visitTryCatchBlock", "(", "ep", ".", "start", ",", "ep", ".", "end", ",", "ep", ".", "goal", ",", "ep", ".", "sig", ")", ";", "}", "pop", "(", ")", ";", "typedExceptions", ".", "clear", "(", ")", ";", "untypedExceptions", ".", "clear", "(", ")", ";", "stackVariables", ".", "clear", "(", ")", ";", "usedVariables", ".", "clear", "(", ")", ";", "scope", "=", "null", ";", "finallyBlocks", ".", "clear", "(", ")", ";", "mv", "=", "null", ";", "resetVariableIndex", "(", "false", ")", ";", "superBlockNamedLabels", ".", "clear", "(", ")", ";", "currentBlockNamedLabels", ".", "clear", "(", ")", ";", "namedLoopBreakLabel", ".", "clear", "(", ")", ";", "namedLoopContinueLabel", ".", "clear", "(", ")", ";", "continueLabel", "=", "null", ";", "breakLabel", "=", "null", ";", "thisStartLabel", "=", "null", ";", "thisEndLabel", "=", "null", ";", "mv", "=", "null", ";", "}", "public", "void", "addExceptionBlock", "(", "Label", "start", ",", "Label", "end", ",", "Label", "goal", ",", "String", "sig", ")", "{", "ExceptionTableEntry", "ep", "=", "new", "ExceptionTableEntry", "(", ")", ";", "ep", ".", "start", "=", "start", ";", "ep", ".", "end", "=", "end", ";", "ep", ".", "sig", "=", "sig", ";", "ep", ".", "goal", "=", "goal", ";", "if", "(", "sig", "==", "null", ")", "{", "untypedExceptions", ".", "add", "(", "ep", ")", ";", "}", "else", "{", "typedExceptions", ".", "add", "(", "ep", ")", ";", "}", "}", "public", "void", "init", "(", "VariableScope", "el", ",", "Parameter", "[", "]", "parameters", ")", "{", "if", "(", "!", "clear", ")", "throw", "new", "GroovyBugError", "(", "\"\"", ")", ";", "clear", "=", "false", ";", "pushVariableScope", "(", "el", ")", ";", "defineMethodVariables", "(", "parameters", ",", "el", ".", "isInStaticContext", "(", ")", ")", ";", "this", ".", "className", "=", "BytecodeHelper", ".", "getTypeDescription", "(", "controller", ".", "getClassNode", "(", ")", ")", ";", "}", "public", "void", "pushVariableScope", "(", "VariableScope", "el", ")", "{", "pushState", "(", ")", ";", "scope", "=", "el", ";", "superBlockNamedLabels", "=", "new", "HashMap", "(", "superBlockNamedLabels", ")", ";", "superBlockNamedLabels", ".", "putAll", "(", "currentBlockNamedLabels", ")", ";", "currentBlockNamedLabels", "=", "new", "HashMap", "(", ")", ";", "}", "public", "void", "pushLoop", "(", "VariableScope", "el", ",", "String", "labelName", ")", "{", "pushVariableScope", "(", "el", ")", ";", "initLoopLabels", "(", "labelName", ")", ";", "}", "private", "void", "initLoopLabels", "(", "String", "labelName", ")", "{", "continueLabel", "=", "new", "Label", "(", ")", ";", "breakLabel", "=", "new", "Label", "(", ")", ";", "if", "(", "labelName", "!=", "null", ")", "{", "namedLoopBreakLabel", ".", "put", "(", "labelName", ",", "breakLabel", ")", ";", "namedLoopContinueLabel", ".", "put", "(", "labelName", ",", "continueLabel", ")", ";", "}", "}", "public", "void", "pushLoop", "(", "String", "labelName", ")", "{", "pushState", "(", ")", ";", "initLoopLabels", "(", "labelName", ")", ";", "}", "public", "Label", "getNamedBreakLabel", "(", "String", "name", ")", "{", "Label", "label", "=", "getBreakLabel", "(", ")", ";", "Label", "endLabel", "=", "null", ";", "if", "(", "name", "!=", "null", ")", "endLabel", "=", "(", "Label", ")", "namedLoopBreakLabel", ".", "get", "(", "name", ")", ";", "if", "(", "endLabel", "!=", "null", ")", "label", "=", "endLabel", ";", "return", "label", ";", "}", "public", "Label", "getNamedContinueLabel", "(", "String", "name", ")", "{", "Label", "label", "=", "getLabel", "(", "name", ")", ";", "Label", "endLabel", "=", "null", ";", "if", "(", "name", "!=", "null", ")", "endLabel", "=", "(", "Label", ")", "namedLoopContinueLabel", ".", "get", "(", "name", ")", ";", "if", "(", "endLabel", "!=", "null", ")", "label", "=", "endLabel", ";", "return", "label", ";", "}", "public", "Label", "pushSwitch", "(", ")", "{", "pushState", "(", ")", ";", "breakLabel", "=", "new", "Label", "(", ")", ";", "return", "breakLabel", ";", "}", "public", "void", "pushBooleanExpression", "(", ")", "{", "pushState", "(", ")", ";", "}", "private", "BytecodeVariable", "defineVar", "(", "String", "name", ",", "ClassNode", "type", ",", "boolean", "holder", ",", "boolean", "useReferenceDirectly", ")", "{", "int", "prevCurrent", "=", "currentVariableIndex", ";", "makeNextVariableID", "(", "type", ",", "useReferenceDirectly", ")", ";", "int", "index", "=", "currentVariableIndex", ";", "if", "(", "holder", "&&", "!", "useReferenceDirectly", ")", "index", "=", "localVariableOffset", "++", ";", "BytecodeVariable", "answer", "=", "new", "BytecodeVariable", "(", "index", ",", "type", ",", "name", ",", "prevCurrent", ")", ";", "usedVariables", ".", "add", "(", "answer", ")", ";", "answer", ".", "setHolder", "(", "holder", ")", ";", "return", "answer", ";", "}", "private", "void", "makeLocalVariablesOffset", "(", "Parameter", "[", "]", "paras", ",", "boolean", "isInStaticContext", ")", "{", "resetVariableIndex", "(", "isInStaticContext", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "paras", ".", "length", ";", "i", "++", ")", "{", "makeNextVariableID", "(", "paras", "[", "i", "]", ".", "getType", "(", ")", ",", "false", ")", ";", "}", "localVariableOffset", "=", "nextVariableIndex", ";", "resetVariableIndex", "(", "isInStaticContext", ")", ";", "}", "private", "void", "defineMethodVariables", "(", "Parameter", "[", "]", "paras", ",", "boolean", "isInStaticContext", ")", "{", "Label", "startLabel", "=", "new", "Label", "(", ")", ";", "thisStartLabel", "=", "startLabel", ";", "controller", ".", "getMethodVisitor", "(", ")", ".", "visitLabel", "(", "startLabel", ")", ";", "makeLocalVariablesOffset", "(", "paras", ",", "isInStaticContext", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "paras", ".", "length", ";", "i", "++", ")", "{", "String", "name", "=", "paras", "[", "i", "]", ".", "getName", "(", ")", ";", "BytecodeVariable", "answer", ";", "ClassNode", "type", "=", "paras", "[", "i", "]", ".", "getType", "(", ")", ";", "if", "(", "paras", "[", "i", "]", ".", "isClosureSharedVariable", "(", ")", ")", "{", "boolean", "useExistingReference", "=", "paras", "[", "i", "]", ".", "getNodeMetaData", "(", "ClosureWriter", ".", "UseExistingReference", ".", "class", ")", "!=", "null", ";", "answer", "=", "defineVar", "(", "name", ",", "paras", "[", "i", "]", ".", "getOriginType", "(", ")", ",", "true", ",", "useExistingReference", ")", ";", "answer", ".", "setStartLabel", "(", "startLabel", ")", ";", "if", "(", "!", "useExistingReference", ")", "{", "controller", ".", "getOperandStack", "(", ")", ".", "load", "(", "type", ",", "currentVariableIndex", ")", ";", "controller", ".", "getOperandStack", "(", ")", ".", "box", "(", ")", ";", "Label", "newStart", "=", "new", "Label", "(", ")", ";", "controller", ".", "getMethodVisitor", "(", ")", ".", "visitLabel", "(", "newStart", ")", ";", "BytecodeVariable", "var", "=", "new", "BytecodeVariable", "(", "currentVariableIndex", ",", "paras", "[", "i", "]", ".", "getOriginType", "(", ")", ",", "name", ",", "currentVariableIndex", ")", ";", "var", ".", "setStartLabel", "(", "startLabel", ")", ";", "var", ".", "setEndLabel", "(", "newStart", ")", ";", "usedVariables", ".", "add", "(", "var", ")", ";", "answer", ".", "setStartLabel", "(", "newStart", ")", ";", "createReference", "(", "answer", ")", ";", "}", "}", "else", "{", "answer", "=", "defineVar", "(", "name", ",", "type", ",", "false", ",", "false", ")", ";", "answer", ".", "setStartLabel", "(", "startLabel", ")", ";", "}", "stackVariables", ".", "put", "(", "name", ",", "answer", ")", ";", "}", "nextVariableIndex", "=", "localVariableOffset", ";", "}", "private", "void", "createReference", "(", "BytecodeVariable", "reference", ")", "{", "MethodVisitor", "mv", "=", "controller", ".", "getMethodVisitor", "(", ")", ";", "mv", ".", "visitTypeInsn", "(", "NEW", ",", "\"\"", ")", ";", "mv", ".", "visitInsn", "(", "DUP_X1", ")", ";", "mv", ".", "visitInsn", "(", "SWAP", ")", ";", "mv", ".", "visitMethodInsn", "(", "INVOKESPECIAL", ",", "\"\"", ",", "\"<init>\"", ",", "\"\"", ")", ";", "mv", ".", "visitVarInsn", "(", "ASTORE", ",", "reference", ".", "getIndex", "(", ")", ")", ";", "}", "private", "void", "pushInitValue", "(", "ClassNode", "type", ",", "MethodVisitor", "mv", ")", "{", "if", "(", "ClassHelper", ".", "isPrimitiveType", "(", "type", ")", ")", "{", "if", "(", "type", "==", "ClassHelper", ".", "long_TYPE", ")", "{", "mv", ".", "visitInsn", "(", "LCONST_0", ")", ";", "}", "else", "if", "(", "type", "==", "ClassHelper", ".", "double_TYPE", ")", "{", "mv", ".", "visitInsn", "(", "DCONST_0", ")", ";", "}", "else", "if", "(", "type", "==", "ClassHelper", ".", "float_TYPE", ")", "{", "mv", ".", "visitInsn", "(", "FCONST_0", ")", ";", "}", "else", "{", "mv", ".", "visitLdcInsn", "(", "0", ")", ";", "}", "}", "else", "{", "mv", ".", "visitInsn", "(", "ACONST_NULL", ")", ";", "}", "}", "public", "BytecodeVariable", "defineVariable", "(", "Variable", "v", ",", "boolean", "initFromStack", ")", "{", "return", "defineVariable", "(", "v", ",", "v", ".", "getOriginType", "(", ")", ",", "initFromStack", ")", ";", "}", "public", "BytecodeVariable", "defineVariable", "(", "Variable", "v", ",", "ClassNode", "variableType", ",", "boolean", "initFromStack", ")", "{", "String", "name", "=", "v", ".", "getName", "(", ")", ";", "BytecodeVariable", "answer", "=", "defineVar", "(", "name", ",", "variableType", ",", "v", ".", "isClosureSharedVariable", "(", ")", ",", "v", ".", "isClosureSharedVariable", "(", ")", ")", ";", "stackVariables", ".", "put", "(", "name", ",", "answer", ")", ";", "MethodVisitor", "mv", "=", "controller", ".", "getMethodVisitor", "(", ")", ";", "Label", "startLabel", "=", "new", "Label", "(", ")", ";", "answer", ".", "setStartLabel", "(", "startLabel", ")", ";", "ClassNode", "type", "=", "answer", ".", "getType", "(", ")", ".", "redirect", "(", ")", ";", "OperandStack", "operandStack", "=", "controller", ".", "getOperandStack", "(", ")", ";", "if", "(", "!", "initFromStack", ")", "pushInitValue", "(", "type", ",", "mv", ")", ";", "operandStack", ".", "push", "(", "answer", ".", "getType", "(", ")", ")", ";", "if", "(", "answer", ".", "isHolder", "(", ")", ")", "{", "operandStack", ".", "box", "(", ")", ";", "operandStack", ".", "remove", "(", "1", ")", ";", "createReference", "(", "answer", ")", ";", "}", "else", "{", "operandStack", ".", "storeVar", "(", "answer", ")", ";", "}", "mv", ".", "visitLabel", "(", "startLabel", ")", ";", "return", "answer", ";", "}", "public", "boolean", "containsVariable", "(", "String", "name", ")", "{", "return", "stackVariables", ".", "containsKey", "(", "name", ")", ";", "}", "private", "void", "makeNextVariableID", "(", "ClassNode", "type", ",", "boolean", "useReferenceDirectly", ")", "{", "currentVariableIndex", "=", "nextVariableIndex", ";", "if", "(", "(", "type", "==", "ClassHelper", ".", "long_TYPE", "||", "type", "==", "ClassHelper", ".", "double_TYPE", ")", "&&", "!", "useReferenceDirectly", ")", "{", "nextVariableIndex", "++", ";", "}", "nextVariableIndex", "++", ";", "}", "public", "Label", "getLabel", "(", "String", "name", ")", "{", "if", "(", "name", "==", "null", ")", "return", "null", ";", "Label", "l", "=", "(", "Label", ")", "superBlockNamedLabels", ".", "get", "(", "name", ")", ";", "if", "(", "l", "==", "null", ")", "l", "=", "createLocalLabel", "(", "name", ")", ";", "return", "l", ";", "}", "public", "Label", "createLocalLabel", "(", "String", "name", ")", "{", "Label", "l", "=", "(", "Label", ")", "currentBlockNamedLabels", ".", "get", "(", "name", ")", ";", "if", "(", "l", "==", "null", ")", "{", "l", "=", "new", "Label", "(", ")", ";", "currentBlockNamedLabels", ".", "put", "(", "name", ",", "l", ")", ";", "}", "return", "l", ";", "}", "public", "void", "applyFinallyBlocks", "(", "Label", "label", ",", "boolean", "isBreakLabel", ")", "{", "StateStackElement", "result", "=", "null", ";", "for", "(", "ListIterator", "iter", "=", "stateStack", ".", "listIterator", "(", "stateStack", ".", "size", "(", ")", ")", ";", "iter", ".", "hasPrevious", "(", ")", ";", ")", "{", "StateStackElement", "element", "=", "(", "StateStackElement", ")", "iter", ".", "previous", "(", ")", ";", "if", "(", "!", "element", ".", "currentBlockNamedLabels", ".", "values", "(", ")", ".", "contains", "(", "label", ")", ")", "{", "if", "(", "isBreakLabel", "&&", "element", ".", "breakLabel", "!=", "label", ")", "{", "result", "=", "element", ";", "break", ";", "}", "if", "(", "!", "isBreakLabel", "&&", "element", ".", "continueLabel", "!=", "label", ")", "{", "result", "=", "element", ";", "break", ";", "}", "}", "}", "List", "<", "BlockRecorder", ">", "blocksToRemove", ";", "if", "(", "result", "==", "null", ")", "{", "blocksToRemove", "=", "(", "List", "<", "BlockRecorder", ">", ")", "Collections", ".", "EMPTY_LIST", ";", "}", "else", "{", "blocksToRemove", "=", "result", ".", "finallyBlocks", ";", "}", "List", "<", "BlockRecorder", ">", "blocks", "=", "new", "LinkedList", "<", "BlockRecorder", ">", "(", "finallyBlocks", ")", ";", "blocks", ".", "removeAll", "(", "blocksToRemove", ")", ";", "applyBlockRecorder", "(", "blocks", ")", ";", "}", "private", "void", "applyBlockRecorder", "(", "List", "<", "BlockRecorder", ">", "blocks", ")", "{", "if", "(", "blocks", ".", "size", "(", ")", "==", "0", "||", "blocks", ".", "size", "(", ")", "==", "visitedBlocks", ".", "size", "(", ")", ")", "return", ";", "MethodVisitor", "mv", "=", "controller", ".", "getMethodVisitor", "(", ")", ";", "Label", "end", "=", "new", "Label", "(", ")", ";", "mv", ".", "visitInsn", "(", "NOP", ")", ";", "mv", ".", "visitLabel", "(", "end", ")", ";", "Label", "newStart", "=", "new", "Label", "(", ")", ";", "for", "(", "BlockRecorder", "fb", ":", "blocks", ")", "{", "if", "(", "visitedBlocks", ".", "contains", "(", "fb", ")", ")", "continue", ";", "fb", ".", "closeRange", "(", "end", ")", ";", "fb", ".", "excludedStatement", ".", "run", "(", ")", ";", "fb", ".", "startRange", "(", "newStart", ")", ";", "}", "mv", ".", "visitInsn", "(", "NOP", ")", ";", "mv", ".", "visitLabel", "(", "newStart", ")", ";", "}", "public", "void", "applyBlockRecorder", "(", ")", "{", "applyBlockRecorder", "(", "finallyBlocks", ")", ";", "}", "public", "boolean", "hasBlockRecorder", "(", ")", "{", "return", "!", "finallyBlocks", ".", "isEmpty", "(", ")", ";", "}", "public", "void", "pushBlockRecorder", "(", "BlockRecorder", "recorder", ")", "{", "pushState", "(", ")", ";", "finallyBlocks", ".", "addFirst", "(", "recorder", ")", ";", "}", "public", "void", "pushBlockRecorderVisit", "(", "BlockRecorder", "finallyBlock", ")", "{", "visitedBlocks", ".", "add", "(", "finallyBlock", ")", ";", "}", "public", "void", "popBlockRecorderVisit", "(", "BlockRecorder", "finallyBlock", ")", "{", "visitedBlocks", ".", "remove", "(", "finallyBlock", ")", ";", "}", "public", "void", "writeExceptionTable", "(", "BlockRecorder", "block", ",", "Label", "goal", ",", "String", "sig", ")", "{", "if", "(", "block", ".", "isEmpty", ")", "return", ";", "MethodVisitor", "mv", "=", "controller", ".", "getMethodVisitor", "(", ")", ";", "for", "(", "LabelRange", "range", ":", "block", ".", "ranges", ")", "{", "mv", ".", "visitTryCatchBlock", "(", "range", ".", "start", ",", "range", ".", "end", ",", "goal", ",", "sig", ")", ";", "}", "}", "public", "boolean", "isLHS", "(", ")", "{", "return", "lhs", ";", "}", "public", "void", "pushLHS", "(", "boolean", "lhs", ")", "{", "lhsStack", ".", "add", "(", "lhs", ")", ";", "this", ".", "lhs", "=", "lhs", ";", "}", "public", "void", "popLHS", "(", ")", "{", "lhsStack", ".", "removeLast", "(", ")", ";", "this", ".", "lhs", "=", "lhsStack", ".", "getLast", "(", ")", ";", "}", "public", "void", "pushImplicitThis", "(", "boolean", "implicitThis", ")", "{", "implicitThisStack", ".", "add", "(", "implicitThis", ")", ";", "this", ".", "implicitThis", "=", "implicitThis", ";", "}", "public", "boolean", "isImplicitThis", "(", ")", "{", "return", "implicitThis", ";", "}", "public", "void", "popImplicitThis", "(", ")", "{", "implicitThisStack", ".", "removeLast", "(", ")", ";", "this", ".", "implicitThis", "=", "implicitThisStack", ".", "getLast", "(", ")", ";", "}", "public", "boolean", "isInSpecialConstructorCall", "(", ")", "{", "return", "inSpecialConstructallCall", ";", "}", "public", "void", "pushInSpecialConstructorCall", "(", ")", "{", "pushState", "(", ")", ";", "inSpecialConstructallCall", "=", "true", ";", "}", "}", "</s>" ]
6,631
[ "<s>", "package", "org", ".", "codehaus", ".", "groovy", ".", "classgen", ".", "asm", ";", "import", "java", ".", "util", ".", "Iterator", ";", "import", "java", ".", "util", ".", "List", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "ClassHelper", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "ClassNode", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "Parameter", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "expr", ".", "ArgumentListExpression", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "expr", ".", "ClosureListExpression", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "expr", ".", "ConstantExpression", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "expr", ".", "EmptyExpression", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "expr", ".", "Expression", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "expr", ".", "MethodCallExpression", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "stmt", ".", "AssertStatement", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "stmt", ".", "BlockStatement", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "stmt", ".", "BreakStatement", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "stmt", ".", "CaseStatement", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "stmt", ".", "CatchStatement", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "stmt", ".", "ContinueStatement", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "stmt", ".", "DoWhileStatement", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "stmt", ".", "ExpressionStatement", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "stmt", ".", "ForStatement", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "stmt", ".", "IfStatement", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "stmt", ".", "ReturnStatement", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "stmt", ".", "Statement", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "stmt", ".", "SwitchStatement", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "stmt", ".", "SynchronizedStatement", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "stmt", ".", "ThrowStatement", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "stmt", ".", "TryCatchStatement", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "stmt", ".", "WhileStatement", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "classgen", ".", "asm", ".", "CompileStack", ".", "BlockRecorder", ";", "import", "org", ".", "objectweb", ".", "asm", ".", "Label", ";", "import", "org", ".", "objectweb", ".", "asm", ".", "MethodVisitor", ";", "import", "static", "org", ".", "objectweb", ".", "asm", ".", "Opcodes", ".", "*", ";", "public", "class", "StatementWriter", "{", "private", "static", "final", "MethodCaller", "iteratorNextMethod", "=", "MethodCaller", ".", "newInterface", "(", "Iterator", ".", "class", ",", "\"next\"", ")", ";", "private", "static", "final", "MethodCaller", "iteratorHasNextMethod", "=", "MethodCaller", ".", "newInterface", "(", "Iterator", ".", "class", ",", "\"hasNext\"", ")", ";", "private", "WriterController", "controller", ";", "public", "StatementWriter", "(", "WriterController", "controller", ")", "{", "this", ".", "controller", "=", "controller", ";", "}", "protected", "void", "writeStatementLabel", "(", "Statement", "statement", ")", "{", "String", "name", "=", "statement", ".", "getStatementLabel", "(", ")", ";", "if", "(", "name", "!=", "null", ")", "{", "Label", "label", "=", "controller", ".", "getCompileStack", "(", ")", ".", "createLocalLabel", "(", "name", ")", ";", "controller", ".", "getMethodVisitor", "(", ")", ".", "visitLabel", "(", "label", ")", ";", "}", "}", "public", "void", "writeBlockStatement", "(", "BlockStatement", "block", ")", "{", "CompileStack", "compileStack", "=", "controller", ".", "getCompileStack", "(", ")", ";", "writeStatementLabel", "(", "block", ")", ";", "int", "mark", "=", "controller", ".", "getOperandStack", "(", ")", ".", "getStackLength", "(", ")", ";", "compileStack", ".", "pushVariableScope", "(", "block", ".", "getVariableScope", "(", ")", ")", ";", "for", "(", "Statement", "statement", ":", "block", ".", "getStatements", "(", ")", ")", "{", "statement", ".", "visit", "(", "controller", ".", "getAcg", "(", ")", ")", ";", "}", "compileStack", ".", "pop", "(", ")", ";", "controller", ".", "getOperandStack", "(", ")", ".", "popDownTo", "(", "mark", ")", ";", "}", "public", "void", "writeForStatement", "(", "ForStatement", "loop", ")", "{", "Parameter", "loopVar", "=", "loop", ".", "getVariable", "(", ")", ";", "if", "(", "loopVar", "==", "ForStatement", ".", "FOR_LOOP_DUMMY", ")", "{", "writeForLoopWithClosureList", "(", "loop", ")", ";", "}", "else", "{", "writeForInLoop", "(", "loop", ")", ";", "}", "}", "protected", "void", "writeIteratorHasNext", "(", "MethodVisitor", "mv", ")", "{", "iteratorHasNextMethod", ".", "call", "(", "mv", ")", ";", "}", "protected", "void", "writeIteratorNext", "(", "MethodVisitor", "mv", ")", "{", "iteratorNextMethod", ".", "call", "(", "mv", ")", ";", "}", "protected", "void", "writeForInLoop", "(", "ForStatement", "loop", ")", "{", "controller", ".", "getAcg", "(", ")", ".", "onLineNumber", "(", "loop", ",", "\"visitForLoop\"", ")", ";", "writeStatementLabel", "(", "loop", ")", ";", "CompileStack", "compileStack", "=", "controller", ".", "getCompileStack", "(", ")", ";", "MethodVisitor", "mv", "=", "controller", ".", "getMethodVisitor", "(", ")", ";", "OperandStack", "operandStack", "=", "controller", ".", "getOperandStack", "(", ")", ";", "compileStack", ".", "pushLoop", "(", "loop", ".", "getVariableScope", "(", ")", ",", "loop", ".", "getStatementLabel", "(", ")", ")", ";", "BytecodeVariable", "variable", "=", "compileStack", ".", "defineVariable", "(", "loop", ".", "getVariable", "(", ")", ",", "false", ")", ";", "MethodCallExpression", "iterator", "=", "new", "MethodCallExpression", "(", "loop", ".", "getCollectionExpression", "(", ")", ",", "\"iterator\"", ",", "new", "ArgumentListExpression", "(", ")", ")", ";", "iterator", ".", "visit", "(", "controller", ".", "getAcg", "(", ")", ")", ";", "operandStack", ".", "doGroovyCast", "(", "ClassHelper", ".", "Iterator_TYPE", ")", ";", "final", "int", "iteratorIdx", "=", "compileStack", ".", "defineTemporaryVariable", "(", "\"iterator\"", ",", "ClassHelper", ".", "Iterator_TYPE", ",", "true", ")", ";", "Label", "continueLabel", "=", "compileStack", ".", "getContinueLabel", "(", ")", ";", "Label", "breakLabel", "=", "compileStack", ".", "getBreakLabel", "(", ")", ";", "mv", ".", "visitLabel", "(", "continueLabel", ")", ";", "mv", ".", "visitVarInsn", "(", "ALOAD", ",", "iteratorIdx", ")", ";", "writeIteratorHasNext", "(", "mv", ")", ";", "mv", ".", "visitJumpInsn", "(", "IFEQ", ",", "breakLabel", ")", ";", "mv", ".", "visitVarInsn", "(", "ALOAD", ",", "iteratorIdx", ")", ";", "writeIteratorNext", "(", "mv", ")", ";", "operandStack", ".", "push", "(", "ClassHelper", ".", "OBJECT_TYPE", ")", ";", "operandStack", ".", "storeVar", "(", "variable", ")", ";", "loop", ".", "getLoopBlock", "(", ")", ".", "visit", "(", "controller", ".", "getAcg", "(", ")", ")", ";", "mv", ".", "visitJumpInsn", "(", "GOTO", ",", "continueLabel", ")", ";", "mv", ".", "visitLabel", "(", "breakLabel", ")", ";", "compileStack", ".", "pop", "(", ")", ";", "}", "protected", "void", "writeForLoopWithClosureList", "(", "ForStatement", "loop", ")", "{", "controller", ".", "getAcg", "(", ")", ".", "onLineNumber", "(", "loop", ",", "\"visitForLoop\"", ")", ";", "writeStatementLabel", "(", "loop", ")", ";", "MethodVisitor", "mv", "=", "controller", ".", "getMethodVisitor", "(", ")", ";", "controller", ".", "getCompileStack", "(", ")", ".", "pushLoop", "(", "loop", ".", "getVariableScope", "(", ")", ",", "loop", ".", "getStatementLabel", "(", ")", ")", ";", "ClosureListExpression", "clExpr", "=", "(", "ClosureListExpression", ")", "loop", ".", "getCollectionExpression", "(", ")", ";", "controller", ".", "getCompileStack", "(", ")", ".", "pushVariableScope", "(", "clExpr", ".", "getVariableScope", "(", ")", ")", ";", "List", "expressions", "=", "clExpr", ".", "getExpressions", "(", ")", ";", "int", "size", "=", "expressions", ".", "size", "(", ")", ";", "int", "condIndex", "=", "(", "size", "-", "1", ")", "/", "2", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "condIndex", ";", "i", "++", ")", "{", "visitExpressionOrStatement", "(", "expressions", ".", "get", "(", "i", ")", ")", ";", "}", "Label", "continueLabel", "=", "controller", ".", "getCompileStack", "(", ")", ".", "getContinueLabel", "(", ")", ";", "Label", "breakLabel", "=", "controller", ".", "getCompileStack", "(", ")", ".", "getBreakLabel", "(", ")", ";", "Label", "cond", "=", "new", "Label", "(", ")", ";", "mv", ".", "visitLabel", "(", "cond", ")", ";", "{", "Expression", "condExpr", "=", "(", "Expression", ")", "expressions", ".", "get", "(", "condIndex", ")", ";", "int", "mark", "=", "controller", ".", "getOperandStack", "(", ")", ".", "getStackLength", "(", ")", ";", "condExpr", ".", "visit", "(", "controller", ".", "getAcg", "(", ")", ")", ";", "controller", ".", "getOperandStack", "(", ")", ".", "castToBool", "(", "mark", ",", "true", ")", ";", "}", "controller", ".", "getOperandStack", "(", ")", ".", "jump", "(", "IFEQ", ",", "breakLabel", ")", ";", "loop", ".", "getLoopBlock", "(", ")", ".", "visit", "(", "controller", ".", "getAcg", "(", ")", ")", ";", "mv", ".", "visitLabel", "(", "continueLabel", ")", ";", "controller", ".", "getAcg", "(", ")", ".", "onLineNumber", "(", "loop", ",", "\"\"", ")", ";", "for", "(", "int", "i", "=", "condIndex", "+", "1", ";", "i", "<", "size", ";", "i", "++", ")", "{", "visitExpressionOrStatement", "(", "expressions", ".", "get", "(", "i", ")", ")", ";", "}", "mv", ".", "visitJumpInsn", "(", "GOTO", ",", "cond", ")", ";", "mv", ".", "visitLabel", "(", "breakLabel", ")", ";", "controller", ".", "getCompileStack", "(", ")", ".", "pop", "(", ")", ";", "controller", ".", "getCompileStack", "(", ")", ".", "pop", "(", ")", ";", "}", "private", "void", "visitExpressionOrStatement", "(", "Object", "o", ")", "{", "if", "(", "o", "==", "EmptyExpression", ".", "INSTANCE", ")", "return", ";", "if", "(", "o", "instanceof", "Expression", ")", "{", "Expression", "expr", "=", "(", "Expression", ")", "o", ";", "int", "mark", "=", "controller", ".", "getOperandStack", "(", ")", ".", "getStackLength", "(", ")", ";", "expr", ".", "visit", "(", "controller", ".", "getAcg", "(", ")", ")", ";", "controller", ".", "getOperandStack", "(", ")", ".", "popDownTo", "(", "mark", ")", ";", "}", "else", "{", "(", "(", "Statement", ")", "o", ")", ".", "visit", "(", "controller", ".", "getAcg", "(", ")", ")", ";", "}", "}", "public", "void", "writeWhileLoop", "(", "WhileStatement", "loop", ")", "{", "controller", ".", "getAcg", "(", ")", ".", "onLineNumber", "(", "loop", ",", "\"\"", ")", ";", "writeStatementLabel", "(", "loop", ")", ";", "MethodVisitor", "mv", "=", "controller", ".", "getMethodVisitor", "(", ")", ";", "controller", ".", "getCompileStack", "(", ")", ".", "pushLoop", "(", "loop", ".", "getStatementLabel", "(", ")", ")", ";", "Label", "continueLabel", "=", "controller", ".", "getCompileStack", "(", ")", ".", "getContinueLabel", "(", ")", ";", "Label", "breakLabel", "=", "controller", ".", "getCompileStack", "(", ")", ".", "getBreakLabel", "(", ")", ";", "mv", ".", "visitLabel", "(", "continueLabel", ")", ";", "Expression", "bool", "=", "loop", ".", "getBooleanExpression", "(", ")", ";", "boolean", "boolHandled", "=", "false", ";", "if", "(", "bool", "instanceof", "ConstantExpression", ")", "{", "ConstantExpression", "constant", "=", "(", "ConstantExpression", ")", "bool", ";", "if", "(", "constant", ".", "getValue", "(", ")", "==", "Boolean", ".", "TRUE", ")", "{", "boolHandled", "=", "true", ";", "}", "else", "if", "(", "constant", ".", "getValue", "(", ")", "==", "Boolean", ".", "FALSE", ")", "{", "boolHandled", "=", "true", ";", "mv", ".", "visitJumpInsn", "(", "GOTO", ",", "breakLabel", ")", ";", "}", "}", "if", "(", "!", "boolHandled", ")", "{", "bool", ".", "visit", "(", "controller", ".", "getAcg", "(", ")", ")", ";", "controller", ".", "getOperandStack", "(", ")", ".", "jump", "(", "IFEQ", ",", "breakLabel", ")", ";", "}", "loop", ".", "getLoopBlock", "(", ")", ".", "visit", "(", "controller", ".", "getAcg", "(", ")", ")", ";", "mv", ".", "visitJumpInsn", "(", "GOTO", ",", "continueLabel", ")", ";", "mv", ".", "visitLabel", "(", "breakLabel", ")", ";", "controller", ".", "getCompileStack", "(", ")", ".", "pop", "(", ")", ";", "}", "public", "void", "writeDoWhileLoop", "(", "DoWhileStatement", "loop", ")", "{", "controller", ".", "getAcg", "(", ")", ".", "onLineNumber", "(", "loop", ",", "\"\"", ")", ";", "writeStatementLabel", "(", "loop", ")", ";", "MethodVisitor", "mv", "=", "controller", ".", "getMethodVisitor", "(", ")", ";", "controller", ".", "getCompileStack", "(", ")", ".", "pushLoop", "(", "loop", ".", "getStatementLabel", "(", ")", ")", ";", "Label", "breakLabel", "=", "controller", ".", "getCompileStack", "(", ")", ".", "getBreakLabel", "(", ")", ";", "Label", "continueLabel", "=", "controller", ".", "getCompileStack", "(", ")", ".", "getContinueLabel", "(", ")", ";", "mv", ".", "visitLabel", "(", "continueLabel", ")", ";", "loop", ".", "getLoopBlock", "(", ")", ".", "visit", "(", "controller", ".", "getAcg", "(", ")", ")", ";", "loop", ".", "getBooleanExpression", "(", ")", ".", "visit", "(", "controller", ".", "getAcg", "(", ")", ")", ";", "controller", ".", "getOperandStack", "(", ")", ".", "jump", "(", "IFEQ", ",", "continueLabel", ")", ";", "mv", ".", "visitLabel", "(", "breakLabel", ")", ";", "controller", ".", "getCompileStack", "(", ")", ".", "pop", "(", ")", ";", "}", "public", "void", "writeIfElse", "(", "IfStatement", "ifElse", ")", "{", "controller", ".", "getAcg", "(", ")", ".", "onLineNumber", "(", "ifElse", ",", "\"visitIfElse\"", ")", ";", "writeStatementLabel", "(", "ifElse", ")", ";", "MethodVisitor", "mv", "=", "controller", ".", "getMethodVisitor", "(", ")", ";", "ifElse", ".", "getBooleanExpression", "(", ")", ".", "visit", "(", "controller", ".", "getAcg", "(", ")", ")", ";", "Label", "l0", "=", "controller", ".", "getOperandStack", "(", ")", ".", "jump", "(", "IFEQ", ")", ";", "controller", ".", "getCompileStack", "(", ")", ".", "pushBooleanExpression", "(", ")", ";", "ifElse", ".", "getIfBlock", "(", ")", ".", "visit", "(", "controller", ".", "getAcg", "(", ")", ")", ";", "controller", ".", "getCompileStack", "(", ")", ".", "pop", "(", ")", ";", "Label", "l1", "=", "new", "Label", "(", ")", ";", "mv", ".", "visitJumpInsn", "(", "GOTO", ",", "l1", ")", ";", "mv", ".", "visitLabel", "(", "l0", ")", ";", "controller", ".", "getCompileStack", "(", ")", ".", "pushBooleanExpression", "(", ")", ";", "ifElse", ".", "getElseBlock", "(", ")", ".", "visit", "(", "controller", ".", "getAcg", "(", ")", ")", ";", "controller", ".", "getCompileStack", "(", ")", ".", "pop", "(", ")", ";", "mv", ".", "visitLabel", "(", "l1", ")", ";", "}", "public", "void", "writeTryCatchFinally", "(", "TryCatchStatement", "statement", ")", "{", "controller", ".", "getAcg", "(", ")", ".", "onLineNumber", "(", "statement", ",", "\"\"", ")", ";", "writeStatementLabel", "(", "statement", ")", ";", "MethodVisitor", "mv", "=", "controller", ".", "getMethodVisitor", "(", ")", ";", "CompileStack", "compileStack", "=", "controller", ".", "getCompileStack", "(", ")", ";", "OperandStack", "operandStack", "=", "controller", ".", "getOperandStack", "(", ")", ";", "Statement", "tryStatement", "=", "statement", ".", "getTryStatement", "(", ")", ";", "final", "Statement", "finallyStatement", "=", "statement", ".", "getFinallyStatement", "(", ")", ";", "Label", "tryStart", "=", "new", "Label", "(", ")", ";", "mv", ".", "visitLabel", "(", "tryStart", ")", ";", "BlockRecorder", "tryBlock", "=", "makeBlockRecorder", "(", "finallyStatement", ")", ";", "tryBlock", ".", "startRange", "(", "tryStart", ")", ";", "tryStatement", ".", "visit", "(", "controller", ".", "getAcg", "(", ")", ")", ";", "Label", "finallyStart", "=", "new", "Label", "(", ")", ";", "mv", ".", "visitJumpInsn", "(", "GOTO", ",", "finallyStart", ")", ";", "Label", "tryEnd", "=", "new", "Label", "(", ")", ";", "mv", ".", "visitLabel", "(", "tryEnd", ")", ";", "tryBlock", ".", "closeRange", "(", "tryEnd", ")", ";", "controller", ".", "getCompileStack", "(", ")", ".", "pop", "(", ")", ";", "BlockRecorder", "catches", "=", "makeBlockRecorder", "(", "finallyStatement", ")", ";", "for", "(", "CatchStatement", "catchStatement", ":", "statement", ".", "getCatchStatements", "(", ")", ")", "{", "ClassNode", "exceptionType", "=", "catchStatement", ".", "getExceptionType", "(", ")", ";", "String", "exceptionTypeInternalName", "=", "BytecodeHelper", ".", "getClassInternalName", "(", "exceptionType", ")", ";", "Label", "catchStart", "=", "new", "Label", "(", ")", ";", "mv", ".", "visitLabel", "(", "catchStart", ")", ";", "catches", ".", "startRange", "(", "catchStart", ")", ";", "Parameter", "exceptionVariable", "=", "catchStatement", ".", "getVariable", "(", ")", ";", "compileStack", ".", "pushState", "(", ")", ";", "compileStack", ".", "defineVariable", "(", "exceptionVariable", ",", "true", ")", ";", "catchStatement", ".", "visit", "(", "controller", ".", "getAcg", "(", ")", ")", ";", "mv", ".", "visitInsn", "(", "NOP", ")", ";", "controller", ".", "getCompileStack", "(", ")", ".", "pop", "(", ")", ";", "Label", "catchEnd", "=", "new", "Label", "(", ")", ";", "mv", ".", "visitLabel", "(", "catchEnd", ")", ";", "catches", ".", "closeRange", "(", "catchEnd", ")", ";", "mv", ".", "visitJumpInsn", "(", "GOTO", ",", "finallyStart", ")", ";", "compileStack", ".", "writeExceptionTable", "(", "tryBlock", ",", "catchStart", ",", "exceptionTypeInternalName", ")", ";", "}", "Label", "catchAny", "=", "new", "Label", "(", ")", ";", "compileStack", ".", "writeExceptionTable", "(", "tryBlock", ",", "catchAny", ",", "null", ")", ";", "compileStack", ".", "writeExceptionTable", "(", "catches", ",", "catchAny", ",", "null", ")", ";", "compileStack", ".", "pop", "(", ")", ";", "mv", ".", "visitLabel", "(", "finallyStart", ")", ";", "finallyStatement", ".", "visit", "(", "controller", ".", "getAcg", "(", ")", ")", ";", "mv", ".", "visitInsn", "(", "NOP", ")", ";", "Label", "skipCatchAll", "=", "new", "Label", "(", ")", ";", "mv", ".", "visitJumpInsn", "(", "GOTO", ",", "skipCatchAll", ")", ";", "mv", ".", "visitLabel", "(", "catchAny", ")", ";", "operandStack", ".", "push", "(", "ClassHelper", ".", "OBJECT_TYPE", ")", ";", "int", "anyExceptionIndex", "=", "compileStack", ".", "defineTemporaryVariable", "(", "\"exception\"", ",", "true", ")", ";", "finallyStatement", ".", "visit", "(", "controller", ".", "getAcg", "(", ")", ")", ";", "mv", ".", "visitVarInsn", "(", "ALOAD", ",", "anyExceptionIndex", ")", ";", "mv", ".", "visitInsn", "(", "ATHROW", ")", ";", "mv", ".", "visitLabel", "(", "skipCatchAll", ")", ";", "}", "private", "BlockRecorder", "makeBlockRecorder", "(", "final", "Statement", "finallyStatement", ")", "{", "final", "BlockRecorder", "block", "=", "new", "BlockRecorder", "(", ")", ";", "Runnable", "tryRunner", "=", "new", "Runnable", "(", ")", "{", "public", "void", "run", "(", ")", "{", "controller", ".", "getCompileStack", "(", ")", ".", "pushBlockRecorderVisit", "(", "block", ")", ";", "finallyStatement", ".", "visit", "(", "controller", ".", "getAcg", "(", ")", ")", ";", "controller", ".", "getCompileStack", "(", ")", ".", "popBlockRecorderVisit", "(", "block", ")", ";", "}", "}", ";", "block", ".", "excludedStatement", "=", "tryRunner", ";", "controller", ".", "getCompileStack", "(", ")", ".", "pushBlockRecorder", "(", "block", ")", ";", "return", "block", ";", "}", "public", "void", "writeSwitch", "(", "SwitchStatement", "statement", ")", "{", "controller", ".", "getAcg", "(", ")", ".", "onLineNumber", "(", "statement", ",", "\"visitSwitch\"", ")", ";", "writeStatementLabel", "(", "statement", ")", ";", "statement", ".", "getExpression", "(", ")", ".", "visit", "(", "controller", ".", "getAcg", "(", ")", ")", ";", "Label", "breakLabel", "=", "controller", ".", "getCompileStack", "(", ")", ".", "pushSwitch", "(", ")", ";", "int", "switchVariableIndex", "=", "controller", ".", "getCompileStack", "(", ")", ".", "defineTemporaryVariable", "(", "\"switch\"", ",", "true", ")", ";", "List", "caseStatements", "=", "statement", ".", "getCaseStatements", "(", ")", ";", "int", "caseCount", "=", "caseStatements", ".", "size", "(", ")", ";", "Label", "[", "]", "labels", "=", "new", "Label", "[", "caseCount", "+", "1", "]", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "caseCount", ";", "i", "++", ")", "{", "labels", "[", "i", "]", "=", "new", "Label", "(", ")", ";", "}", "int", "i", "=", "0", ";", "for", "(", "Iterator", "iter", "=", "caseStatements", ".", "iterator", "(", ")", ";", "iter", ".", "hasNext", "(", ")", ";", "i", "++", ")", "{", "CaseStatement", "caseStatement", "=", "(", "CaseStatement", ")", "iter", ".", "next", "(", ")", ";", "writeCaseStatement", "(", "caseStatement", ",", "switchVariableIndex", ",", "labels", "[", "i", "]", ",", "labels", "[", "i", "+", "1", "]", ")", ";", "}", "statement", ".", "getDefaultStatement", "(", ")", ".", "visit", "(", "controller", ".", "getAcg", "(", ")", ")", ";", "controller", ".", "getMethodVisitor", "(", ")", ".", "visitLabel", "(", "breakLabel", ")", ";", "controller", ".", "getCompileStack", "(", ")", ".", "pop", "(", ")", ";", "}", "protected", "void", "writeCaseStatement", "(", "CaseStatement", "statement", ",", "int", "switchVariableIndex", ",", "Label", "thisLabel", ",", "Label", "nextLabel", ")", "{", "controller", ".", "getAcg", "(", ")", ".", "onLineNumber", "(", "statement", ",", "\"\"", ")", ";", "MethodVisitor", "mv", "=", "controller", ".", "getMethodVisitor", "(", ")", ";", "OperandStack", "operandStack", "=", "controller", ".", "getOperandStack", "(", ")", ";", "mv", ".", "visitVarInsn", "(", "ALOAD", ",", "switchVariableIndex", ")", ";", "statement", ".", "getExpression", "(", ")", ".", "visit", "(", "controller", ".", "getAcg", "(", ")", ")", ";", "operandStack", ".", "box", "(", ")", ";", "controller", ".", "getBinaryExpHelper", "(", ")", ".", "getIsCaseMethod", "(", ")", ".", "call", "(", "mv", ")", ";", "operandStack", ".", "replace", "(", "ClassHelper", ".", "boolean_TYPE", ")", ";", "Label", "l0", "=", "controller", ".", "getOperandStack", "(", ")", ".", "jump", "(", "IFEQ", ")", ";", "mv", ".", "visitLabel", "(", "thisLabel", ")", ";", "statement", ".", "getCode", "(", ")", ".", "visit", "(", "controller", ".", "getAcg", "(", ")", ")", ";", "if", "(", "nextLabel", "!=", "null", ")", "{", "mv", ".", "visitJumpInsn", "(", "GOTO", ",", "nextLabel", ")", ";", "}", "mv", ".", "visitLabel", "(", "l0", ")", ";", "}", "public", "void", "writeBreak", "(", "BreakStatement", "statement", ")", "{", "controller", ".", "getAcg", "(", ")", ".", "onLineNumber", "(", "statement", ",", "\"\"", ")", ";", "writeStatementLabel", "(", "statement", ")", ";", "String", "name", "=", "statement", ".", "getLabel", "(", ")", ";", "Label", "breakLabel", "=", "controller", ".", "getCompileStack", "(", ")", ".", "getNamedBreakLabel", "(", "name", ")", ";", "controller", ".", "getCompileStack", "(", ")", ".", "applyFinallyBlocks", "(", "breakLabel", ",", "true", ")", ";", "controller", ".", "getMethodVisitor", "(", ")", ".", "visitJumpInsn", "(", "GOTO", ",", "breakLabel", ")", ";", "}", "public", "void", "writeContinue", "(", "ContinueStatement", "statement", ")", "{", "controller", ".", "getAcg", "(", ")", ".", "onLineNumber", "(", "statement", ",", "\"\"", ")", ";", "writeStatementLabel", "(", "statement", ")", ";", "String", "name", "=", "statement", ".", "getLabel", "(", ")", ";", "Label", "continueLabel", "=", "controller", ".", "getCompileStack", "(", ")", ".", "getContinueLabel", "(", ")", ";", "if", "(", "name", "!=", "null", ")", "continueLabel", "=", "controller", ".", "getCompileStack", "(", ")", ".", "getNamedContinueLabel", "(", "name", ")", ";", "controller", ".", "getCompileStack", "(", ")", ".", "applyFinallyBlocks", "(", "continueLabel", ",", "false", ")", ";", "controller", ".", "getMethodVisitor", "(", ")", ".", "visitJumpInsn", "(", "GOTO", ",", "continueLabel", ")", ";", "}", "public", "void", "writeSynchronized", "(", "SynchronizedStatement", "statement", ")", "{", "controller", ".", "getAcg", "(", ")", ".", "onLineNumber", "(", "statement", ",", "\"\"", ")", ";", "writeStatementLabel", "(", "statement", ")", ";", "final", "MethodVisitor", "mv", "=", "controller", ".", "getMethodVisitor", "(", ")", ";", "CompileStack", "compileStack", "=", "controller", ".", "getCompileStack", "(", ")", ";", "statement", ".", "getExpression", "(", ")", ".", "visit", "(", "controller", ".", "getAcg", "(", ")", ")", ";", "controller", ".", "getOperandStack", "(", ")", ".", "box", "(", ")", ";", "final", "int", "index", "=", "compileStack", ".", "defineTemporaryVariable", "(", "\"synchronized\"", ",", "ClassHelper", ".", "OBJECT_TYPE", ",", "true", ")", ";", "final", "Label", "synchronizedStart", "=", "new", "Label", "(", ")", ";", "final", "Label", "synchronizedEnd", "=", "new", "Label", "(", ")", ";", "final", "Label", "catchAll", "=", "new", "Label", "(", ")", ";", "mv", ".", "visitVarInsn", "(", "ALOAD", ",", "index", ")", ";", "mv", ".", "visitInsn", "(", "MONITORENTER", ")", ";", "mv", ".", "visitLabel", "(", "synchronizedStart", ")", ";", "mv", ".", "visitInsn", "(", "NOP", ")", ";", "Runnable", "finallyPart", "=", "new", "Runnable", "(", ")", "{", "public", "void", "run", "(", ")", "{", "mv", ".", "visitVarInsn", "(", "ALOAD", ",", "index", ")", ";", "mv", ".", "visitInsn", "(", "MONITOREXIT", ")", ";", "}", "}", ";", "BlockRecorder", "fb", "=", "new", "BlockRecorder", "(", "finallyPart", ")", ";", "fb", ".", "startRange", "(", "synchronizedStart", ")", ";", "compileStack", ".", "pushBlockRecorder", "(", "fb", ")", ";", "statement", ".", "getCode", "(", ")", ".", "visit", "(", "controller", ".", "getAcg", "(", ")", ")", ";", "fb", ".", "closeRange", "(", "catchAll", ")", ";", "compileStack", ".", "writeExceptionTable", "(", "fb", ",", "catchAll", ",", "null", ")", ";", "compileStack", ".", "pop", "(", ")", ";", "finallyPart", ".", "run", "(", ")", ";", "mv", ".", "visitJumpInsn", "(", "GOTO", ",", "synchronizedEnd", ")", ";", "mv", ".", "visitLabel", "(", "catchAll", ")", ";", "finallyPart", ".", "run", "(", ")", ";", "mv", ".", "visitInsn", "(", "ATHROW", ")", ";", "mv", ".", "visitLabel", "(", "synchronizedEnd", ")", ";", "}", "public", "void", "writeAssert", "(", "AssertStatement", "statement", ")", "{", "controller", ".", "getAcg", "(", ")", ".", "onLineNumber", "(", "statement", ",", "\"\"", ")", ";", "writeStatementLabel", "(", "statement", ")", ";", "controller", ".", "getAssertionWriter", "(", ")", ".", "writeAssertStatement", "(", "statement", ")", ";", "}", "public", "void", "writeThrow", "(", "ThrowStatement", "statement", ")", "{", "controller", ".", "getAcg", "(", ")", ".", "onLineNumber", "(", "statement", ",", "\"\"", ")", ";", "writeStatementLabel", "(", "statement", ")", ";", "MethodVisitor", "mv", "=", "controller", ".", "getMethodVisitor", "(", ")", ";", "statement", ".", "getExpression", "(", ")", ".", "visit", "(", "controller", ".", "getAcg", "(", ")", ")", ";", "mv", ".", "visitTypeInsn", "(", "CHECKCAST", ",", "\"\"", ")", ";", "mv", ".", "visitInsn", "(", "ATHROW", ")", ";", "controller", ".", "getOperandStack", "(", ")", ".", "remove", "(", "1", ")", ";", "}", "public", "void", "writeReturn", "(", "ReturnStatement", "statement", ")", "{", "controller", ".", "getAcg", "(", ")", ".", "onLineNumber", "(", "statement", ",", "\"\"", ")", ";", "writeStatementLabel", "(", "statement", ")", ";", "MethodVisitor", "mv", "=", "controller", ".", "getMethodVisitor", "(", ")", ";", "OperandStack", "operandStack", "=", "controller", ".", "getOperandStack", "(", ")", ";", "ClassNode", "returnType", "=", "controller", ".", "getReturnType", "(", ")", ";", "if", "(", "returnType", "==", "ClassHelper", ".", "VOID_TYPE", ")", "{", "if", "(", "!", "(", "statement", ".", "isReturningNullOrVoid", "(", ")", ")", ")", "{", "controller", ".", "getAcg", "(", ")", ".", "throwException", "(", "\"\"", ")", ";", "}", "controller", ".", "getCompileStack", "(", ")", ".", "applyBlockRecorder", "(", ")", ";", "mv", ".", "visitInsn", "(", "RETURN", ")", ";", "return", ";", "}", "Expression", "expression", "=", "statement", ".", "getExpression", "(", ")", ";", "expression", ".", "visit", "(", "controller", ".", "getAcg", "(", ")", ")", ";", "if", "(", "controller", ".", "getCompileStack", "(", ")", ".", "hasBlockRecorder", "(", ")", ")", "{", "ClassNode", "type", "=", "operandStack", ".", "getTopOperand", "(", ")", ";", "int", "returnValueIdx", "=", "controller", ".", "getCompileStack", "(", ")", ".", "defineTemporaryVariable", "(", "\"returnValue\"", ",", "type", ",", "true", ")", ";", "controller", ".", "getCompileStack", "(", ")", ".", "applyBlockRecorder", "(", ")", ";", "operandStack", ".", "load", "(", "type", ",", "returnValueIdx", ")", ";", "}", "operandStack", ".", "doGroovyCast", "(", "returnType", ")", ";", "BytecodeHelper", ".", "doReturn", "(", "mv", ",", "returnType", ")", ";", "operandStack", ".", "remove", "(", "1", ")", ";", "}", "public", "void", "writeExpressionStatement", "(", "ExpressionStatement", "statement", ")", "{", "controller", ".", "getAcg", "(", ")", ".", "onLineNumber", "(", "statement", ",", "\"\"", "+", "statement", ".", "getExpression", "(", ")", ".", "getClass", "(", ")", ".", "getName", "(", ")", ")", ";", "writeStatementLabel", "(", "statement", ")", ";", "Expression", "expression", "=", "statement", ".", "getExpression", "(", ")", ";", "int", "mark", "=", "controller", ".", "getOperandStack", "(", ")", ".", "getStackLength", "(", ")", ";", "expression", ".", "visit", "(", "controller", ".", "getAcg", "(", ")", ")", ";", "controller", ".", "getOperandStack", "(", ")", ".", "popDownTo", "(", "mark", ")", ";", "}", "}", "</s>" ]
6,632
[ "<s>", "package", "org", ".", "codehaus", ".", "groovy", ".", "classgen", ".", "asm", ";", "import", "java", ".", "util", ".", "Map", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "GroovyBugError", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "ClassHelper", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "ClassNode", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "ConstructorNode", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "InnerClassNode", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "InterfaceHelperClassNode", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "MethodNode", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "classgen", ".", "AsmClassGenerator", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "classgen", ".", "GeneratorContext", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "control", ".", "SourceUnit", ";", "import", "org", ".", "objectweb", ".", "asm", ".", "ClassVisitor", ";", "import", "org", ".", "objectweb", ".", "asm", ".", "MethodVisitor", ";", "public", "class", "WriterController", "{", "private", "AsmClassGenerator", "acg", ";", "private", "MethodVisitor", "methodVisitor", ";", "private", "CompileStack", "compileStack", ";", "private", "OperandStack", "operandStack", ";", "private", "ClassNode", "classNode", ";", "private", "CallSiteWriter", "callSiteWriter", ";", "private", "ClassVisitor", "cv", ";", "private", "ClosureWriter", "closureWriter", ";", "private", "String", "internalClassName", ";", "private", "InvocationWriter", "invocationWriter", ";", "private", "BinaryExpressionHelper", "binaryExpHelper", ",", "fastPathBinaryExpHelper", ";", "private", "AssertionWriter", "assertionWriter", ";", "private", "String", "internalBaseClassName", ";", "private", "ClassNode", "outermostClass", ";", "private", "MethodNode", "methodNode", ";", "private", "SourceUnit", "sourceUnit", ";", "private", "ConstructorNode", "constructorNode", ";", "private", "GeneratorContext", "context", ";", "private", "InterfaceHelperClassNode", "interfaceClassLoadingClass", ";", "public", "boolean", "optimizeForInt", "=", "true", ";", "private", "StatementWriter", "statementWriter", ";", "private", "boolean", "fastPath", "=", "false", ";", "private", "TypeChooser", "typeChooser", ";", "public", "void", "init", "(", "AsmClassGenerator", "asmClassGenerator", ",", "GeneratorContext", "gcon", ",", "ClassVisitor", "cv", ",", "ClassNode", "cn", ")", "{", "Map", "<", "String", ",", "Boolean", ">", "optOptions", "=", "cn", ".", "getCompileUnit", "(", ")", ".", "getConfig", "(", ")", ".", "getOptimizationOptions", "(", ")", ";", "if", "(", "optOptions", ".", "isEmpty", "(", ")", ")", "{", "}", "else", "if", "(", "optOptions", ".", "get", "(", "\"all\"", ")", "==", "Boolean", ".", "FALSE", ")", "{", "optimizeForInt", "=", "false", ";", "}", "else", "{", "if", "(", "optOptions", ".", "get", "(", "\"int\"", ")", "==", "Boolean", ".", "FALSE", ")", "optimizeForInt", "=", "false", ";", "}", "this", ".", "classNode", "=", "cn", ";", "this", ".", "outermostClass", "=", "null", ";", "this", ".", "internalClassName", "=", "BytecodeHelper", ".", "getClassInternalName", "(", "classNode", ")", ";", "this", ".", "callSiteWriter", "=", "new", "CallSiteWriter", "(", "this", ")", ";", "this", ".", "invocationWriter", "=", "new", "InvocationWriter", "(", "this", ")", ";", "this", ".", "binaryExpHelper", "=", "new", "BinaryExpressionHelper", "(", "this", ")", ";", "if", "(", "optimizeForInt", ")", "{", "this", ".", "fastPathBinaryExpHelper", "=", "new", "BinaryExpressionMultiTypeDispatcher", "(", "this", ")", ";", "}", "else", "{", "this", ".", "fastPathBinaryExpHelper", "=", "this", ".", "binaryExpHelper", ";", "}", "this", ".", "operandStack", "=", "new", "OperandStack", "(", "this", ")", ";", "this", ".", "assertionWriter", "=", "new", "AssertionWriter", "(", "this", ")", ";", "this", ".", "closureWriter", "=", "new", "ClosureWriter", "(", "this", ")", ";", "this", ".", "internalBaseClassName", "=", "BytecodeHelper", ".", "getClassInternalName", "(", "classNode", ".", "getSuperClass", "(", ")", ")", ";", "this", ".", "acg", "=", "asmClassGenerator", ";", "this", ".", "sourceUnit", "=", "acg", ".", "getSourceUnit", "(", ")", ";", "this", ".", "context", "=", "gcon", ";", "this", ".", "compileStack", "=", "new", "CompileStack", "(", "this", ")", ";", "this", ".", "cv", "=", "cv", ";", "if", "(", "optimizeForInt", "&&", "sourceUnit", "!=", "null", "&&", "!", "sourceUnit", ".", "isReconcile", ")", "{", "this", ".", "statementWriter", "=", "new", "OptimizingStatementWriter", "(", "this", ")", ";", "}", "else", "{", "this", ".", "statementWriter", "=", "new", "StatementWriter", "(", "this", ")", ";", "}", "this", ".", "typeChooser", "=", "new", "StatementMetaTypeChooser", "(", ")", ";", "}", "public", "AsmClassGenerator", "getAcg", "(", ")", "{", "return", "acg", ";", "}", "public", "void", "setMethodVisitor", "(", "MethodVisitor", "methodVisitor", ")", "{", "this", ".", "methodVisitor", "=", "methodVisitor", ";", "}", "public", "MethodVisitor", "getMethodVisitor", "(", ")", "{", "return", "methodVisitor", ";", "}", "public", "CompileStack", "getCompileStack", "(", ")", "{", "return", "compileStack", ";", "}", "public", "OperandStack", "getOperandStack", "(", ")", "{", "return", "operandStack", ";", "}", "public", "ClassNode", "getClassNode", "(", ")", "{", "return", "classNode", ";", "}", "public", "CallSiteWriter", "getCallSiteWriter", "(", ")", "{", "return", "callSiteWriter", ";", "}", "public", "ClassVisitor", "getClassVisitor", "(", ")", "{", "return", "cv", ";", "}", "public", "ClosureWriter", "getClosureWriter", "(", ")", "{", "return", "closureWriter", ";", "}", "public", "ClassVisitor", "getCv", "(", ")", "{", "return", "cv", ";", "}", "public", "String", "getInternalClassName", "(", ")", "{", "return", "internalClassName", ";", "}", "public", "InvocationWriter", "getInvocationWriter", "(", ")", "{", "return", "invocationWriter", ";", "}", "public", "BinaryExpressionHelper", "getBinaryExpHelper", "(", ")", "{", "if", "(", "fastPath", ")", "{", "return", "fastPathBinaryExpHelper", ";", "}", "else", "{", "return", "binaryExpHelper", ";", "}", "}", "public", "AssertionWriter", "getAssertionWriter", "(", ")", "{", "return", "assertionWriter", ";", "}", "public", "TypeChooser", "getTypeChooser", "(", ")", "{", "return", "typeChooser", ";", "}", "public", "String", "getInternalBaseClassName", "(", ")", "{", "return", "internalBaseClassName", ";", "}", "public", "MethodNode", "getMethodNode", "(", ")", "{", "return", "methodNode", ";", "}", "public", "void", "setMethodNode", "(", "MethodNode", "mn", ")", "{", "methodNode", "=", "mn", ";", "constructorNode", "=", "null", ";", "}", "public", "ConstructorNode", "getConstructorNode", "(", ")", "{", "return", "constructorNode", ";", "}", "public", "void", "setConstructorNode", "(", "ConstructorNode", "cn", ")", "{", "constructorNode", "=", "cn", ";", "methodNode", "=", "null", ";", "}", "public", "boolean", "isNotClinit", "(", ")", "{", "return", "methodNode", "==", "null", "||", "!", "methodNode", ".", "getName", "(", ")", ".", "equals", "(", "\"<clinit>\"", ")", ";", "}", "public", "SourceUnit", "getSourceUnit", "(", ")", "{", "return", "sourceUnit", ";", "}", "public", "boolean", "isStaticContext", "(", ")", "{", "if", "(", "compileStack", "!=", "null", "&&", "compileStack", ".", "getScope", "(", ")", "!=", "null", ")", "{", "return", "compileStack", ".", "getScope", "(", ")", ".", "isInStaticContext", "(", ")", ";", "}", "if", "(", "!", "isInClosure", "(", ")", ")", "return", "false", ";", "if", "(", "constructorNode", "!=", "null", ")", "return", "false", ";", "return", "classNode", ".", "isStaticClass", "(", ")", "||", "methodNode", ".", "isStatic", "(", ")", ";", "}", "public", "boolean", "isInClosure", "(", ")", "{", "return", "classNode", ".", "getOuterClass", "(", ")", "!=", "null", "&&", "classNode", ".", "getSuperClass", "(", ")", "==", "ClassHelper", ".", "CLOSURE_TYPE", ";", "}", "public", "boolean", "isInClosureConstructor", "(", ")", "{", "return", "constructorNode", "!=", "null", "&&", "classNode", ".", "getOuterClass", "(", ")", "!=", "null", "&&", "classNode", ".", "getSuperClass", "(", ")", "==", "ClassHelper", ".", "CLOSURE_TYPE", ";", "}", "public", "boolean", "isNotExplicitThisInClosure", "(", "boolean", "implicitThis", ")", "{", "return", "implicitThis", "||", "!", "isInClosure", "(", ")", ";", "}", "public", "boolean", "isStaticMethod", "(", ")", "{", "return", "methodNode", "!=", "null", "&&", "methodNode", ".", "isStatic", "(", ")", ";", "}", "public", "ClassNode", "getReturnType", "(", ")", "{", "if", "(", "methodNode", "!=", "null", ")", "{", "return", "methodNode", ".", "getReturnType", "(", ")", ";", "}", "else", "if", "(", "constructorNode", "!=", "null", ")", "{", "return", "constructorNode", ".", "getReturnType", "(", ")", ";", "}", "else", "{", "throw", "new", "GroovyBugError", "(", "\"\"", ")", ";", "}", "}", "public", "boolean", "isStaticConstructor", "(", ")", "{", "return", "methodNode", "!=", "null", "&&", "methodNode", ".", "getName", "(", ")", ".", "equals", "(", "\"<clinit>\"", ")", ";", "}", "public", "boolean", "isConstructor", "(", ")", "{", "return", "constructorNode", "!=", "null", ";", "}", "public", "boolean", "isInScriptBody", "(", ")", "{", "if", "(", "classNode", ".", "isScriptBody", "(", ")", ")", "{", "return", "true", ";", "}", "else", "{", "return", "classNode", ".", "isScript", "(", ")", "&&", "methodNode", "!=", "null", "&&", "methodNode", ".", "getName", "(", ")", ".", "equals", "(", "\"run\"", ")", ";", "}", "}", "public", "String", "getClassName", "(", ")", "{", "String", "className", ";", "if", "(", "!", "classNode", ".", "isInterface", "(", ")", "||", "interfaceClassLoadingClass", "==", "null", ")", "{", "className", "=", "internalClassName", ";", "}", "else", "{", "className", "=", "BytecodeHelper", ".", "getClassInternalName", "(", "interfaceClassLoadingClass", ")", ";", "}", "return", "className", ";", "}", "public", "ClassNode", "getOutermostClass", "(", ")", "{", "if", "(", "outermostClass", "==", "null", ")", "{", "outermostClass", "=", "classNode", ";", "while", "(", "outermostClass", "instanceof", "InnerClassNode", ")", "{", "outermostClass", "=", "outermostClass", ".", "getOuterClass", "(", ")", ";", "}", "}", "return", "outermostClass", ";", "}", "public", "GeneratorContext", "getContext", "(", ")", "{", "return", "context", ";", "}", "public", "void", "setInterfaceClassLoadingClass", "(", "InterfaceHelperClassNode", "ihc", ")", "{", "interfaceClassLoadingClass", "=", "ihc", ";", "}", "public", "InterfaceHelperClassNode", "getInterfaceClassLoadingClass", "(", ")", "{", "return", "interfaceClassLoadingClass", ";", "}", "public", "boolean", "shouldOptimizeForInt", "(", ")", "{", "return", "optimizeForInt", ";", "}", "public", "StatementWriter", "getStatementWriter", "(", ")", "{", "return", "statementWriter", ";", "}", "public", "void", "switchToFastPath", "(", ")", "{", "fastPath", "=", "true", ";", "}", "public", "void", "switchToSlowPath", "(", ")", "{", "fastPath", "=", "false", ";", "}", "public", "boolean", "isFastPath", "(", ")", "{", "return", "fastPath", ";", "}", "}", "</s>" ]
6,633
[ "<s>", "package", "org", ".", "codehaus", ".", "groovy", ".", "classgen", ";", "import", "java", ".", "lang", ".", "annotation", ".", "Target", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "*", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "stmt", ".", "ReturnStatement", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "control", ".", "CompilerConfiguration", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "control", ".", "ErrorCollector", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "control", ".", "SourceUnit", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "control", ".", "messages", ".", "SyntaxErrorMessage", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "syntax", ".", "PreciseSyntaxException", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "syntax", ".", "SyntaxException", ";", "import", "org", ".", "objectweb", ".", "asm", ".", "Opcodes", ";", "public", "class", "ExtendedVerifier", "implements", "GroovyClassVisitor", "{", "public", "static", "final", "String", "JVM_ERROR_MESSAGE", "=", "\"\"", ";", "private", "SourceUnit", "source", ";", "private", "ClassNode", "currentClass", ";", "public", "ExtendedVerifier", "(", "SourceUnit", "sourceUnit", ")", "{", "this", ".", "source", "=", "sourceUnit", ";", "}", "public", "void", "visitClass", "(", "ClassNode", "node", ")", "{", "this", ".", "currentClass", "=", "node", ";", "if", "(", "node", ".", "isAnnotationDefinition", "(", ")", ")", "{", "visitAnnotations", "(", "node", ",", "AnnotationNode", ".", "ANNOTATION_TARGET", ")", ";", "}", "else", "{", "visitAnnotations", "(", "node", ",", "AnnotationNode", ".", "TYPE_TARGET", ")", ";", "}", "PackageNode", "packageNode", "=", "node", ".", "getPackage", "(", ")", ";", "if", "(", "packageNode", "!=", "null", ")", "{", "visitAnnotations", "(", "packageNode", ",", "AnnotationNode", ".", "PACKAGE_TARGET", ")", ";", "}", "node", ".", "visitContents", "(", "this", ")", ";", "}", "public", "void", "visitField", "(", "FieldNode", "node", ")", "{", "visitAnnotations", "(", "node", ",", "AnnotationNode", ".", "FIELD_TARGET", ")", ";", "}", "public", "void", "visitConstructor", "(", "ConstructorNode", "node", ")", "{", "visitConstructorOrMethod", "(", "node", ",", "AnnotationNode", ".", "CONSTRUCTOR_TARGET", ")", ";", "}", "public", "void", "visitMethod", "(", "MethodNode", "node", ")", "{", "visitConstructorOrMethod", "(", "node", ",", "AnnotationNode", ".", "METHOD_TARGET", ")", ";", "}", "private", "void", "visitConstructorOrMethod", "(", "MethodNode", "node", ",", "int", "methodTarget", ")", "{", "visitAnnotations", "(", "node", ",", "methodTarget", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "node", ".", "getParameters", "(", ")", ".", "length", ";", "i", "++", ")", "{", "Parameter", "parameter", "=", "node", ".", "getParameters", "(", ")", "[", "i", "]", ";", "visitAnnotations", "(", "parameter", ",", "AnnotationNode", ".", "PARAMETER_TARGET", ")", ";", "}", "if", "(", "this", ".", "currentClass", ".", "isAnnotationDefinition", "(", ")", "&&", "!", "node", ".", "isStaticConstructor", "(", ")", ")", "{", "ErrorCollector", "errorCollector", "=", "new", "ErrorCollector", "(", "this", ".", "source", ".", "getConfiguration", "(", ")", ")", ";", "AnnotationVisitor", "visitor", "=", "new", "AnnotationVisitor", "(", "this", ".", "source", ",", "errorCollector", ")", ";", "visitor", ".", "setReportClass", "(", "currentClass", ")", ";", "visitor", ".", "checkReturnType", "(", "node", ".", "getReturnType", "(", ")", ",", "node", ")", ";", "if", "(", "node", ".", "getParameters", "(", ")", ".", "length", ">", "0", ")", "{", "addError", "(", "\"\"", ",", "node", ".", "getParameters", "(", ")", "[", "0", "]", ")", ";", "}", "if", "(", "node", ".", "getExceptions", "(", ")", ".", "length", ">", "0", ")", "{", "addError", "(", "\"\"", ",", "node", ".", "getExceptions", "(", ")", "[", "0", "]", ")", ";", "}", "ReturnStatement", "code", "=", "(", "ReturnStatement", ")", "node", ".", "getCode", "(", ")", ";", "if", "(", "code", "!=", "null", ")", "{", "visitor", ".", "visitExpression", "(", "node", ".", "getName", "(", ")", ",", "code", ".", "getExpression", "(", ")", ",", "node", ".", "getReturnType", "(", ")", ")", ";", "visitor", ".", "checkCircularReference", "(", "currentClass", ",", "node", ".", "getReturnType", "(", ")", ",", "code", ".", "getExpression", "(", ")", ")", ";", "}", "this", ".", "source", ".", "getErrorCollector", "(", ")", ".", "addCollectorContents", "(", "errorCollector", ")", ";", "}", "}", "public", "void", "visitProperty", "(", "PropertyNode", "node", ")", "{", "}", "protected", "void", "visitAnnotations", "(", "AnnotatedNode", "node", ",", "int", "target", ")", "{", "if", "(", "node", ".", "getAnnotations", "(", ")", ".", "isEmpty", "(", ")", ")", "{", "return", ";", "}", "this", ".", "currentClass", ".", "setAnnotated", "(", "true", ")", ";", "if", "(", "!", "isAnnotationCompatible", "(", ")", ")", "{", "addError", "(", "\"\"", "+", "JVM_ERROR_MESSAGE", ",", "node", ")", ";", "return", ";", "}", "for", "(", "AnnotationNode", "unvisited", ":", "node", ".", "getAnnotations", "(", ")", ")", "{", "AnnotationNode", "visited", "=", "visitAnnotation", "(", "unvisited", ")", ";", "boolean", "isTargetAnnotation", "=", "visited", ".", "getClassNode", "(", ")", ".", "isResolved", "(", ")", "&&", "visited", ".", "getClassNode", "(", ")", ".", "getName", "(", ")", ".", "equals", "(", "\"\"", ")", ";", "if", "(", "!", "isTargetAnnotation", "&&", "!", "visited", ".", "isTargetAllowed", "(", "target", ")", ")", "{", "addError", "(", "\"Annotation", "@\"", "+", "visited", ".", "getClassNode", "(", ")", ".", "getName", "(", ")", "+", "\"\"", "+", "AnnotationNode", ".", "targetToName", "(", "target", ")", ",", "visited", ")", ";", "}", "visitDeprecation", "(", "node", ",", "visited", ")", ";", "}", "}", "private", "void", "visitDeprecation", "(", "AnnotatedNode", "node", ",", "AnnotationNode", "visited", ")", "{", "if", "(", "visited", ".", "getClassNode", "(", ")", ".", "isResolved", "(", ")", "&&", "visited", ".", "getClassNode", "(", ")", ".", "getName", "(", ")", ".", "equals", "(", "\"\"", ")", ")", "{", "if", "(", "node", "instanceof", "MethodNode", ")", "{", "MethodNode", "mn", "=", "(", "MethodNode", ")", "node", ";", "mn", ".", "setModifiers", "(", "mn", ".", "getModifiers", "(", ")", "|", "Opcodes", ".", "ACC_DEPRECATED", ")", ";", "}", "else", "if", "(", "node", "instanceof", "FieldNode", ")", "{", "FieldNode", "fn", "=", "(", "FieldNode", ")", "node", ";", "fn", ".", "setModifiers", "(", "fn", ".", "getModifiers", "(", ")", "|", "Opcodes", ".", "ACC_DEPRECATED", ")", ";", "}", "else", "if", "(", "node", "instanceof", "ClassNode", ")", "{", "ClassNode", "cn", "=", "(", "ClassNode", ")", "node", ";", "cn", ".", "setModifiers", "(", "cn", ".", "getModifiers", "(", ")", "|", "Opcodes", ".", "ACC_DEPRECATED", ")", ";", "}", "}", "}", "private", "AnnotationNode", "visitAnnotation", "(", "AnnotationNode", "unvisited", ")", "{", "ErrorCollector", "errorCollector", "=", "new", "ErrorCollector", "(", "this", ".", "source", ".", "getConfiguration", "(", ")", ")", ";", "AnnotationVisitor", "visitor", "=", "new", "AnnotationVisitor", "(", "this", ".", "source", ",", "errorCollector", ")", ";", "AnnotationNode", "visited", "=", "visitor", ".", "visit", "(", "unvisited", ")", ";", "this", ".", "source", ".", "getErrorCollector", "(", ")", ".", "addCollectorContents", "(", "errorCollector", ")", ";", "return", "visited", ";", "}", "protected", "boolean", "isAnnotationCompatible", "(", ")", "{", "return", "CompilerConfiguration", ".", "POST_JDK5", ".", "equals", "(", "this", ".", "source", ".", "getConfiguration", "(", ")", ".", "getTargetBytecode", "(", ")", ")", ";", "}", "protected", "void", "addError", "(", "String", "msg", ",", "ASTNode", "expr", ")", "{", "if", "(", "expr", "instanceof", "AnnotationNode", ")", "{", "AnnotationNode", "aNode", "=", "(", "AnnotationNode", ")", "expr", ";", "this", ".", "source", ".", "getErrorCollector", "(", ")", ".", "addErrorAndContinue", "(", "new", "SyntaxErrorMessage", "(", "new", "PreciseSyntaxException", "(", "msg", "+", "'\\n'", ",", "expr", ".", "getLineNumber", "(", ")", ",", "expr", ".", "getColumnNumber", "(", ")", ",", "aNode", ".", "getStart", "(", ")", ",", "aNode", ".", "getEnd", "(", ")", ")", ",", "this", ".", "source", ")", ")", ";", "}", "else", "{", "this", ".", "source", ".", "getErrorCollector", "(", ")", ".", "addErrorAndContinue", "(", "new", "SyntaxErrorMessage", "(", "new", "SyntaxException", "(", "msg", "+", "'\\n'", ",", "expr", ".", "getLineNumber", "(", ")", ",", "expr", ".", "getColumnNumber", "(", ")", ")", ",", "this", ".", "source", ")", ")", ";", "}", "}", "public", "void", "visitGenericType", "(", "GenericsType", "genericsType", ")", "{", "}", "}", "</s>" ]
6,634
[ "<s>", "package", "org", ".", "codehaus", ".", "groovy", ".", "classgen", ";", "import", "groovy", ".", "lang", ".", "GroovyClassLoader", ";", "import", "groovy", ".", "lang", ".", "GroovyObject", ";", "import", "groovy", ".", "lang", ".", "MetaClass", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "*", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "expr", ".", "*", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "stmt", ".", "*", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "classgen", ".", "asm", ".", "BytecodeHelper", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "classgen", ".", "asm", ".", "MopWriter", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "classgen", ".", "asm", ".", "OptimizingStatementWriter", ".", "ClassNodeSkip", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "runtime", ".", "MetaClassHelper", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "syntax", ".", "RuntimeParserException", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "syntax", ".", "Token", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "syntax", ".", "Types", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "reflection", ".", "ClassInfo", ";", "import", "org", ".", "objectweb", ".", "asm", ".", "Label", ";", "import", "org", ".", "objectweb", ".", "asm", ".", "MethodVisitor", ";", "import", "org", ".", "objectweb", ".", "asm", ".", "Opcodes", ";", "import", "java", ".", "lang", ".", "reflect", ".", "Field", ";", "import", "java", ".", "lang", ".", "reflect", ".", "Modifier", ";", "import", "java", ".", "util", ".", "*", ";", "public", "class", "Verifier", "implements", "GroovyClassVisitor", ",", "Opcodes", "{", "public", "static", "final", "String", "STATIC_METACLASS_BOOL", "=", "\"__$stMC\"", ";", "public", "static", "final", "String", "SWAP_INIT", "=", "\"__$swapInit\"", ";", "public", "static", "final", "String", "__TIMESTAMP", "=", "\"__timeStamp\"", ";", "public", "static", "final", "String", "__TIMESTAMP__", "=", "\"\"", ";", "private", "static", "final", "Parameter", "[", "]", "INVOKE_METHOD_PARAMS", "=", "new", "Parameter", "[", "]", "{", "new", "Parameter", "(", "ClassHelper", ".", "STRING_TYPE", ",", "\"method\"", ")", ",", "new", "Parameter", "(", "ClassHelper", ".", "OBJECT_TYPE", ",", "\"arguments\"", ")", "}", ";", "private", "static", "final", "Parameter", "[", "]", "SET_PROPERTY_PARAMS", "=", "new", "Parameter", "[", "]", "{", "new", "Parameter", "(", "ClassHelper", ".", "STRING_TYPE", ",", "\"property\"", ")", ",", "new", "Parameter", "(", "ClassHelper", ".", "OBJECT_TYPE", ",", "\"value\"", ")", "}", ";", "private", "static", "final", "Parameter", "[", "]", "GET_PROPERTY_PARAMS", "=", "new", "Parameter", "[", "]", "{", "new", "Parameter", "(", "ClassHelper", ".", "STRING_TYPE", ",", "\"property\"", ")", "}", ";", "private", "static", "final", "Parameter", "[", "]", "SET_METACLASS_PARAMS", "=", "new", "Parameter", "[", "]", "{", "new", "Parameter", "(", "ClassHelper", ".", "METACLASS_TYPE", ",", "\"mc\"", ")", "}", ";", "private", "ClassNode", "classNode", ";", "private", "MethodNode", "methodNode", ";", "public", "boolean", "inlineStaticFieldInitializersIntoClinit", "=", "true", ";", "public", "boolean", "inlineFieldInitializersIntoInit", "=", "true", ";", "public", "ClassNode", "getClassNode", "(", ")", "{", "return", "classNode", ";", "}", "public", "MethodNode", "getMethodNode", "(", ")", "{", "return", "methodNode", ";", "}", "private", "FieldNode", "setMetaClassFieldIfNotExists", "(", "ClassNode", "node", ",", "FieldNode", "metaClassField", ")", "{", "if", "(", "metaClassField", "!=", "null", ")", "return", "metaClassField", ";", "final", "String", "classInternalName", "=", "BytecodeHelper", ".", "getClassInternalName", "(", "node", ")", ";", "metaClassField", "=", "node", ".", "addField", "(", "\"metaClass\"", ",", "ACC_PRIVATE", "|", "ACC_TRANSIENT", "|", "ACC_SYNTHETIC", ",", "ClassHelper", ".", "METACLASS_TYPE", ",", "new", "BytecodeExpression", "(", "ClassHelper", ".", "METACLASS_TYPE", ")", "{", "public", "void", "visit", "(", "MethodVisitor", "mv", ")", "{", "mv", ".", "visitVarInsn", "(", "ALOAD", ",", "0", ")", ";", "mv", ".", "visitMethodInsn", "(", "INVOKEVIRTUAL", ",", "classInternalName", ",", "\"\"", ",", "\"\"", ")", ";", "}", "}", ")", ";", "metaClassField", ".", "setSynthetic", "(", "true", ")", ";", "return", "metaClassField", ";", "}", "private", "FieldNode", "getMetaClassField", "(", "ClassNode", "node", ")", "{", "FieldNode", "ret", "=", "node", ".", "getDeclaredField", "(", "\"metaClass\"", ")", ";", "if", "(", "ret", "!=", "null", ")", "{", "ClassNode", "mcFieldType", "=", "ret", ".", "getType", "(", ")", ";", "if", "(", "!", "mcFieldType", ".", "equals", "(", "ClassHelper", ".", "METACLASS_TYPE", ")", ")", "{", "throw", "new", "RuntimeParserException", "(", "\"The", "class", "\"", "+", "node", ".", "getName", "(", ")", "+", "\"\"", "+", "mcFieldType", ".", "getName", "(", ")", "+", "\"\"", "+", "\"the", "type", "\"", "+", "ClassHelper", ".", "METACLASS_TYPE", ".", "getName", "(", ")", "+", "\"\"", ",", "ret", ")", ";", "}", "return", "ret", ";", "}", "ClassNode", "current", "=", "node", ".", "getSuperClass", "(", ")", ";", "while", "(", "current", "!=", "null", "&&", "!", "current", ".", "equals", "(", "ClassHelper", ".", "OBJECT_TYPE", ")", ")", "{", "ret", "=", "current", ".", "getDeclaredField", "(", "\"metaClass\"", ")", ";", "if", "(", "ret", "!=", "null", "&&", "!", "Modifier", ".", "isPrivate", "(", "ret", ".", "getModifiers", "(", ")", ")", ")", "return", "ret", ";", "current", "=", "current", ".", "getSuperClass", "(", ")", ";", "}", "return", "null", ";", "}", "public", "void", "visitClass", "(", "final", "ClassNode", "node", ")", "{", "this", ".", "classNode", "=", "node", ";", "if", "(", "(", "classNode", ".", "getModifiers", "(", ")", "&", "Opcodes", ".", "ACC_INTERFACE", ")", ">", "0", ")", "{", "ConstructorNode", "dummy", "=", "new", "ConstructorNode", "(", "0", ",", "null", ")", ";", "addInitialization", "(", "node", ",", "dummy", ")", ";", "node", ".", "visitContents", "(", "this", ")", ";", "if", "(", "classNode", ".", "getNodeMetaData", "(", "ClassNodeSkip", ".", "class", ")", "==", "null", ")", "{", "classNode", ".", "setNodeMetaData", "(", "ClassNodeSkip", ".", "class", ",", "true", ")", ";", "}", "return", ";", "}", "ClassNode", "[", "]", "classNodes", "=", "classNode", ".", "getInterfaces", "(", ")", ";", "List", "<", "String", ">", "interfaces", "=", "new", "ArrayList", "<", "String", ">", "(", ")", ";", "for", "(", "ClassNode", "classNode", ":", "classNodes", ")", "{", "interfaces", ".", "add", "(", "classNode", ".", "getName", "(", ")", ")", ";", "}", "Set", "<", "String", ">", "interfaceSet", "=", "new", "HashSet", "<", "String", ">", "(", "interfaces", ")", ";", "if", "(", "interfaceSet", ".", "size", "(", ")", "!=", "interfaces", ".", "size", "(", ")", ")", "{", "throw", "new", "RuntimeParserException", "(", "\"\"", "+", "interfaces", ",", "classNode", ")", ";", "}", "addDefaultParameterMethods", "(", "node", ")", ";", "addDefaultParameterConstructors", "(", "node", ")", ";", "final", "String", "classInternalName", "=", "BytecodeHelper", ".", "getClassInternalName", "(", "node", ")", ";", "addStaticMetaClassField", "(", "node", ",", "classInternalName", ")", ";", "boolean", "knownSpecialCase", "=", "node", ".", "isDerivedFrom", "(", "ClassHelper", ".", "GSTRING_TYPE", ")", "||", "node", ".", "isDerivedFrom", "(", "ClassHelper", ".", "GROOVY_OBJECT_SUPPORT_TYPE", ")", ";", "addFastPathHelperFieldsAndHelperMethod", "(", "node", ",", "classInternalName", ",", "knownSpecialCase", ")", ";", "if", "(", "!", "knownSpecialCase", ")", "addGroovyObjectInterfaceAndMethods", "(", "node", ",", "classInternalName", ")", ";", "addDefaultConstructor", "(", "node", ")", ";", "if", "(", "!", "(", "node", "instanceof", "InnerClassNode", ")", ")", "addTimeStamp", "(", "node", ")", ";", "addInitialization", "(", "node", ")", ";", "checkReturnInObjectInitializer", "(", "node", ".", "getObjectInitializerStatements", "(", ")", ")", ";", "node", ".", "getObjectInitializerStatements", "(", ")", ".", "clear", "(", ")", ";", "addCovariantMethods", "(", "node", ")", ";", "node", ".", "visitContents", "(", "this", ")", ";", "}", "private", "FieldNode", "checkFieldDoesNotExist", "(", "ClassNode", "node", ",", "String", "fieldName", ")", "{", "FieldNode", "ret", "=", "node", ".", "getDeclaredField", "(", "fieldName", ")", ";", "if", "(", "ret", "!=", "null", ")", "{", "if", "(", "Modifier", ".", "isPublic", "(", "ret", ".", "getModifiers", "(", ")", ")", "&&", "ret", ".", "getType", "(", ")", ".", "redirect", "(", ")", "==", "ClassHelper", ".", "boolean_TYPE", ")", "{", "return", "ret", ";", "}", "throw", "new", "RuntimeParserException", "(", "\"The", "class", "\"", "+", "node", ".", "getName", "(", ")", "+", "\"\"", "+", "fieldName", "+", "\"'", "as", "this\"", "+", "\"\"", ",", "ret", ")", ";", "}", "return", "null", ";", "}", "private", "void", "addFastPathHelperFieldsAndHelperMethod", "(", "ClassNode", "node", ",", "final", "String", "classInternalName", ",", "boolean", "knownSpecialCase", ")", "{", "if", "(", "node", ".", "getNodeMetaData", "(", "ClassNodeSkip", ".", "class", ")", "!=", "null", ")", "return", ";", "FieldNode", "stMCB", "=", "checkFieldDoesNotExist", "(", "node", ",", "STATIC_METACLASS_BOOL", ")", ";", "if", "(", "stMCB", "==", "null", ")", "{", "stMCB", "=", "node", ".", "addField", "(", "STATIC_METACLASS_BOOL", ",", "ACC_PUBLIC", "|", "ACC_STATIC", "|", "ACC_SYNTHETIC", "|", "ACC_TRANSIENT", ",", "ClassHelper", ".", "boolean_TYPE", ",", "null", ")", ";", "stMCB", ".", "setSynthetic", "(", "true", ")", ";", "}", "}", "protected", "void", "addDefaultConstructor", "(", "ClassNode", "node", ")", "{", "if", "(", "!", "node", ".", "getDeclaredConstructors", "(", ")", ".", "isEmpty", "(", ")", ")", "return", ";", "BlockStatement", "empty", "=", "new", "BlockStatement", "(", ")", ";", "ConstructorNode", "constructor", "=", "new", "ConstructorNode", "(", "ACC_PUBLIC", ",", "empty", ")", ";", "constructor", ".", "setHasNoRealSourcePosition", "(", "true", ")", ";", "node", ".", "addConstructor", "(", "constructor", ")", ";", "}", "private", "void", "addStaticMetaClassField", "(", "ClassNode", "node", ",", "final", "String", "classInternalName", ")", "{", "String", "_staticClassInfoFieldName", "=", "\"\"", ";", "while", "(", "node", ".", "getDeclaredField", "(", "_staticClassInfoFieldName", ")", "!=", "null", ")", "_staticClassInfoFieldName", "=", "_staticClassInfoFieldName", "+", "\"$\"", ";", "final", "String", "staticMetaClassFieldName", "=", "_staticClassInfoFieldName", ";", "FieldNode", "staticMetaClassField", "=", "node", ".", "addField", "(", "staticMetaClassFieldName", ",", "ACC_PRIVATE", "|", "ACC_STATIC", "|", "ACC_SYNTHETIC", ",", "ClassHelper", ".", "make", "(", "ClassInfo", ".", "class", ",", "false", ")", ",", "null", ")", ";", "staticMetaClassField", ".", "setSynthetic", "(", "true", ")", ";", "node", ".", "addSyntheticMethod", "(", "\"\"", ",", "ACC_PROTECTED", ",", "ClassHelper", ".", "make", "(", "MetaClass", ".", "class", ")", ",", "Parameter", ".", "EMPTY_ARRAY", ",", "ClassNode", ".", "EMPTY_ARRAY", ",", "new", "BytecodeSequence", "(", "new", "BytecodeInstruction", "(", ")", "{", "public", "void", "visit", "(", "MethodVisitor", "mv", ")", "{", "mv", ".", "visitVarInsn", "(", "ALOAD", ",", "0", ")", ";", "mv", ".", "visitMethodInsn", "(", "INVOKEVIRTUAL", ",", "\"\"", ",", "\"getClass\"", ",", "\"\"", ")", ";", "mv", ".", "visitMethodInsn", "(", "INVOKESTATIC", ",", "classInternalName", ",", "\"$get$$class$\"", "+", "classInternalName", ".", "replaceAll", "(", "\"\\\\/\"", ",", "\"\\\\$\"", ")", ",", "\"\"", ")", ";", "Label", "l1", "=", "new", "Label", "(", ")", ";", "mv", ".", "visitJumpInsn", "(", "IF_ACMPEQ", ",", "l1", ")", ";", "mv", ".", "visitVarInsn", "(", "ALOAD", ",", "0", ")", ";", "mv", ".", "visitMethodInsn", "(", "INVOKESTATIC", ",", "\"\"", ",", "\"\"", ",", "\"\"", ")", ";", "mv", ".", "visitInsn", "(", "ARETURN", ")", ";", "mv", ".", "visitLabel", "(", "l1", ")", ";", "mv", ".", "visitFieldInsn", "(", "GETSTATIC", ",", "classInternalName", ",", "staticMetaClassFieldName", ",", "\"\"", ")", ";", "mv", ".", "visitVarInsn", "(", "ASTORE", ",", "1", ")", ";", "mv", ".", "visitVarInsn", "(", "ALOAD", ",", "1", ")", ";", "Label", "l0", "=", "new", "Label", "(", ")", ";", "mv", ".", "visitJumpInsn", "(", "IFNONNULL", ",", "l0", ")", ";", "mv", ".", "visitVarInsn", "(", "ALOAD", ",", "0", ")", ";", "mv", ".", "visitMethodInsn", "(", "INVOKEVIRTUAL", ",", "\"\"", ",", "\"getClass\"", ",", "\"\"", ")", ";", "mv", ".", "visitMethodInsn", "(", "INVOKESTATIC", ",", "\"\"", ",", "\"getClassInfo\"", ",", "\"\"", ")", ";", "mv", ".", "visitInsn", "(", "DUP", ")", ";", "mv", ".", "visitVarInsn", "(", "ASTORE", ",", "1", ")", ";", "mv", ".", "visitFieldInsn", "(", "PUTSTATIC", ",", "classInternalName", ",", "staticMetaClassFieldName", ",", "\"\"", ")", ";", "mv", ".", "visitLabel", "(", "l0", ")", ";", "mv", ".", "visitVarInsn", "(", "ALOAD", ",", "1", ")", ";", "mv", ".", "visitMethodInsn", "(", "INVOKEVIRTUAL", ",", "\"\"", ",", "\"getMetaClass\"", ",", "\"\"", ")", ";", "mv", ".", "visitInsn", "(", "ARETURN", ")", ";", "}", "}", ")", ")", ";", "}", "protected", "void", "addGroovyObjectInterfaceAndMethods", "(", "ClassNode", "node", ",", "final", "String", "classInternalName", ")", "{", "if", "(", "!", "node", ".", "isDerivedFromGroovyObject", "(", ")", ")", "node", ".", "addInterface", "(", "ClassHelper", ".", "make", "(", "GroovyObject", ".", "class", ")", ")", ";", "FieldNode", "metaClassField", "=", "getMetaClassField", "(", "node", ")", ";", "if", "(", "!", "node", ".", "hasMethod", "(", "\"getMetaClass\"", ",", "Parameter", ".", "EMPTY_ARRAY", ")", ")", "{", "metaClassField", "=", "setMetaClassFieldIfNotExists", "(", "node", ",", "metaClassField", ")", ";", "addMethod", "(", "node", ",", "!", "Modifier", ".", "isAbstract", "(", "node", ".", "getModifiers", "(", ")", ")", ",", "\"getMetaClass\"", ",", "ACC_PUBLIC", ",", "ClassHelper", ".", "METACLASS_TYPE", ",", "Parameter", ".", "EMPTY_ARRAY", ",", "ClassNode", ".", "EMPTY_ARRAY", ",", "new", "BytecodeSequence", "(", "new", "BytecodeInstruction", "(", ")", "{", "public", "void", "visit", "(", "MethodVisitor", "mv", ")", "{", "Label", "nullLabel", "=", "new", "Label", "(", ")", ";", "mv", ".", "visitVarInsn", "(", "ALOAD", ",", "0", ")", ";", "mv", ".", "visitFieldInsn", "(", "GETFIELD", ",", "classInternalName", ",", "\"metaClass\"", ",", "\"\"", ")", ";", "mv", ".", "visitInsn", "(", "DUP", ")", ";", "mv", ".", "visitJumpInsn", "(", "IFNULL", ",", "nullLabel", ")", ";", "mv", ".", "visitInsn", "(", "ARETURN", ")", ";", "mv", ".", "visitLabel", "(", "nullLabel", ")", ";", "mv", ".", "visitInsn", "(", "POP", ")", ";", "mv", ".", "visitVarInsn", "(", "ALOAD", ",", "0", ")", ";", "mv", ".", "visitInsn", "(", "DUP", ")", ";", "mv", ".", "visitMethodInsn", "(", "INVOKEVIRTUAL", ",", "classInternalName", ",", "\"\"", ",", "\"\"", ")", ";", "mv", ".", "visitFieldInsn", "(", "PUTFIELD", ",", "classInternalName", ",", "\"metaClass\"", ",", "\"\"", ")", ";", "mv", ".", "visitVarInsn", "(", "ALOAD", ",", "0", ")", ";", "mv", ".", "visitFieldInsn", "(", "GETFIELD", ",", "classInternalName", ",", "\"metaClass\"", ",", "\"\"", ")", ";", "mv", ".", "visitInsn", "(", "ARETURN", ")", ";", "}", "}", ")", ")", ";", "}", "Parameter", "[", "]", "parameters", "=", "new", "Parameter", "[", "]", "{", "new", "Parameter", "(", "ClassHelper", ".", "METACLASS_TYPE", ",", "\"mc\"", ")", "}", ";", "if", "(", "!", "node", ".", "hasMethod", "(", "\"setMetaClass\"", ",", "parameters", ")", ")", "{", "metaClassField", "=", "setMetaClassFieldIfNotExists", "(", "node", ",", "metaClassField", ")", ";", "Statement", "setMetaClassCode", ";", "if", "(", "Modifier", ".", "isFinal", "(", "metaClassField", ".", "getModifiers", "(", ")", ")", ")", "{", "ConstantExpression", "text", "=", "new", "ConstantExpression", "(", "\"\"", ")", ";", "ConstructorCallExpression", "cce", "=", "new", "ConstructorCallExpression", "(", "ClassHelper", ".", "make", "(", "IllegalArgumentException", ".", "class", ")", ",", "text", ")", ";", "setMetaClassCode", "=", "new", "ExpressionStatement", "(", "cce", ")", ";", "}", "else", "{", "List", "list", "=", "new", "ArrayList", "(", ")", ";", "list", ".", "add", "(", "new", "BytecodeInstruction", "(", ")", "{", "public", "void", "visit", "(", "MethodVisitor", "mv", ")", "{", "mv", ".", "visitVarInsn", "(", "ALOAD", ",", "0", ")", ";", "mv", ".", "visitVarInsn", "(", "ALOAD", ",", "1", ")", ";", "mv", ".", "visitFieldInsn", "(", "PUTFIELD", ",", "classInternalName", ",", "\"metaClass\"", ",", "\"\"", ")", ";", "mv", ".", "visitInsn", "(", "RETURN", ")", ";", "}", "}", ")", ";", "setMetaClassCode", "=", "new", "BytecodeSequence", "(", "list", ")", ";", "}", "addMethod", "(", "node", ",", "!", "Modifier", ".", "isAbstract", "(", "node", ".", "getModifiers", "(", ")", ")", ",", "\"setMetaClass\"", ",", "ACC_PUBLIC", ",", "ClassHelper", ".", "VOID_TYPE", ",", "SET_METACLASS_PARAMS", ",", "ClassNode", ".", "EMPTY_ARRAY", ",", "setMetaClassCode", ")", ";", "}", "if", "(", "!", "node", ".", "hasMethod", "(", "\"invokeMethod\"", ",", "INVOKE_METHOD_PARAMS", ")", ")", "{", "VariableExpression", "vMethods", "=", "new", "VariableExpression", "(", "\"method\"", ")", ";", "VariableExpression", "vArguments", "=", "new", "VariableExpression", "(", "\"arguments\"", ")", ";", "VariableScope", "blockScope", "=", "new", "VariableScope", "(", ")", ";", "blockScope", ".", "putReferencedLocalVariable", "(", "vMethods", ")", ";", "blockScope", ".", "putReferencedLocalVariable", "(", "vArguments", ")", ";", "addMethod", "(", "node", ",", "!", "Modifier", ".", "isAbstract", "(", "node", ".", "getModifiers", "(", ")", ")", ",", "\"invokeMethod\"", ",", "ACC_PUBLIC", ",", "ClassHelper", ".", "OBJECT_TYPE", ",", "INVOKE_METHOD_PARAMS", ",", "ClassNode", ".", "EMPTY_ARRAY", ",", "new", "BytecodeSequence", "(", "new", "BytecodeInstruction", "(", ")", "{", "public", "void", "visit", "(", "MethodVisitor", "mv", ")", "{", "mv", ".", "visitVarInsn", "(", "ALOAD", ",", "0", ")", ";", "mv", ".", "visitMethodInsn", "(", "INVOKEVIRTUAL", ",", "classInternalName", ",", "\"getMetaClass\"", ",", "\"\"", ")", ";", "mv", ".", "visitVarInsn", "(", "ALOAD", ",", "0", ")", ";", "mv", ".", "visitVarInsn", "(", "ALOAD", ",", "1", ")", ";", "mv", ".", "visitVarInsn", "(", "ALOAD", ",", "2", ")", ";", "mv", ".", "visitMethodInsn", "(", "INVOKEINTERFACE", ",", "\"\"", ",", "\"invokeMethod\"", ",", "\"\"", ")", ";", "mv", ".", "visitInsn", "(", "ARETURN", ")", ";", "}", "}", ")", ")", ";", "}", "if", "(", "!", "node", ".", "hasMethod", "(", "\"getProperty\"", ",", "GET_PROPERTY_PARAMS", ")", ")", "{", "addMethod", "(", "node", ",", "!", "Modifier", ".", "isAbstract", "(", "node", ".", "getModifiers", "(", ")", ")", ",", "\"getProperty\"", ",", "ACC_PUBLIC", ",", "ClassHelper", ".", "OBJECT_TYPE", ",", "GET_PROPERTY_PARAMS", ",", "ClassNode", ".", "EMPTY_ARRAY", ",", "new", "BytecodeSequence", "(", "new", "BytecodeInstruction", "(", ")", "{", "public", "void", "visit", "(", "MethodVisitor", "mv", ")", "{", "mv", ".", "visitVarInsn", "(", "ALOAD", ",", "0", ")", ";", "mv", ".", "visitMethodInsn", "(", "INVOKEVIRTUAL", ",", "classInternalName", ",", "\"getMetaClass\"", ",", "\"\"", ")", ";", "mv", ".", "visitVarInsn", "(", "ALOAD", ",", "0", ")", ";", "mv", ".", "visitVarInsn", "(", "ALOAD", ",", "1", ")", ";", "mv", ".", "visitMethodInsn", "(", "INVOKEINTERFACE", ",", "\"\"", ",", "\"getProperty\"", ",", "\"\"", ")", ";", "mv", ".", "visitInsn", "(", "ARETURN", ")", ";", "}", "}", ")", ")", ";", "}", "if", "(", "!", "node", ".", "hasMethod", "(", "\"setProperty\"", ",", "SET_PROPERTY_PARAMS", ")", ")", "{", "addMethod", "(", "node", ",", "!", "Modifier", ".", "isAbstract", "(", "node", ".", "getModifiers", "(", ")", ")", ",", "\"setProperty\"", ",", "ACC_PUBLIC", ",", "ClassHelper", ".", "VOID_TYPE", ",", "SET_PROPERTY_PARAMS", ",", "ClassNode", ".", "EMPTY_ARRAY", ",", "new", "BytecodeSequence", "(", "new", "BytecodeInstruction", "(", ")", "{", "public", "void", "visit", "(", "MethodVisitor", "mv", ")", "{", "mv", ".", "visitVarInsn", "(", "ALOAD", ",", "0", ")", ";", "mv", ".", "visitMethodInsn", "(", "INVOKEVIRTUAL", ",", "classInternalName", ",", "\"getMetaClass\"", ",", "\"\"", ")", ";", "mv", ".", "visitVarInsn", "(", "ALOAD", ",", "0", ")", ";", "mv", ".", "visitVarInsn", "(", "ALOAD", ",", "1", ")", ";", "mv", ".", "visitVarInsn", "(", "ALOAD", ",", "2", ")", ";", "mv", ".", "visitMethodInsn", "(", "INVOKEINTERFACE", ",", "\"\"", ",", "\"setProperty\"", ",", "\"\"", ")", ";", "mv", ".", "visitInsn", "(", "RETURN", ")", ";", "}", "}", ")", ")", ";", "}", "}", "protected", "void", "addMethod", "(", "ClassNode", "node", ",", "boolean", "shouldBeSynthetic", ",", "String", "name", ",", "int", "modifiers", ",", "ClassNode", "returnType", ",", "Parameter", "[", "]", "parameters", ",", "ClassNode", "[", "]", "exceptions", ",", "Statement", "code", ")", "{", "if", "(", "shouldBeSynthetic", ")", "{", "node", ".", "addSyntheticMethod", "(", "name", ",", "modifiers", ",", "returnType", ",", "parameters", ",", "exceptions", ",", "code", ")", ";", "}", "else", "{", "node", ".", "addMethod", "(", "name", ",", "modifiers", "&", "~", "ACC_SYNTHETIC", ",", "returnType", ",", "parameters", ",", "exceptions", ",", "code", ")", ";", "}", "}", "protected", "void", "addTimeStamp", "(", "ClassNode", "node", ")", "{", "if", "(", "node", ".", "getDeclaredField", "(", "Verifier", ".", "__TIMESTAMP", ")", "==", "null", ")", "{", "}", "}", "private", "void", "checkReturnInObjectInitializer", "(", "List", "init", ")", "{", "CodeVisitorSupport", "cvs", "=", "new", "CodeVisitorSupport", "(", ")", "{", "@", "Override", "public", "void", "visitClosureExpression", "(", "ClosureExpression", "expression", ")", "{", "}", "public", "void", "visitReturnStatement", "(", "ReturnStatement", "statement", ")", "{", "throw", "new", "RuntimeParserException", "(", "\"\"", ",", "statement", ")", ";", "}", "}", ";", "for", "(", "Iterator", "iterator", "=", "init", ".", "iterator", "(", ")", ";", "iterator", ".", "hasNext", "(", ")", ";", ")", "{", "Statement", "stm", "=", "(", "Statement", ")", "iterator", ".", "next", "(", ")", ";", "stm", ".", "visit", "(", "cvs", ")", ";", "}", "}", "public", "void", "visitConstructor", "(", "ConstructorNode", "node", ")", "{", "CodeVisitorSupport", "checkSuper", "=", "new", "CodeVisitorSupport", "(", ")", "{", "boolean", "firstMethodCall", "=", "true", ";", "String", "type", "=", "null", ";", "public", "void", "visitMethodCallExpression", "(", "MethodCallExpression", "call", ")", "{", "if", "(", "!", "firstMethodCall", ")", "return", ";", "firstMethodCall", "=", "false", ";", "String", "name", "=", "call", ".", "getMethodAsString", "(", ")", ";", "if", "(", "name", "==", "null", ")", "return", ";", "if", "(", "!", "name", ".", "equals", "(", "\"super\"", ")", "&&", "!", "name", ".", "equals", "(", "\"this\"", ")", ")", "return", ";", "type", "=", "name", ";", "call", ".", "getArguments", "(", ")", ".", "visit", "(", "this", ")", ";", "type", "=", "null", ";", "}", "public", "void", "visitConstructorCallExpression", "(", "ConstructorCallExpression", "call", ")", "{", "if", "(", "!", "call", ".", "isSpecialCall", "(", ")", ")", "return", ";", "type", "=", "call", ".", "getText", "(", ")", ";", "call", ".", "getArguments", "(", ")", ".", "visit", "(", "this", ")", ";", "type", "=", "null", ";", "}", "public", "void", "visitVariableExpression", "(", "VariableExpression", "expression", ")", "{", "if", "(", "type", "==", "null", ")", "return", ";", "String", "name", "=", "expression", ".", "getName", "(", ")", ";", "if", "(", "!", "name", ".", "equals", "(", "\"this\"", ")", "&&", "!", "name", ".", "equals", "(", "\"super\"", ")", ")", "return", ";", "throw", "new", "RuntimeParserException", "(", "\"\"", "+", "name", "+", "\"", "inside", "of", "\"", "+", "type", "+", "\"\"", ",", "expression", ")", ";", "}", "}", ";", "Statement", "s", "=", "node", ".", "getCode", "(", ")", ";", "if", "(", "s", "==", "null", ")", "{", "return", ";", "}", "else", "{", "s", ".", "visit", "(", "new", "VerifierCodeVisitor", "(", "this", ")", ")", ";", "}", "s", ".", "visit", "(", "checkSuper", ")", ";", "}", "public", "void", "visitMethod", "(", "MethodNode", "node", ")", "{", "if", "(", "MopWriter", ".", "isMopMethod", "(", "node", ".", "getName", "(", ")", ")", ")", "{", "throw", "new", "RuntimeParserException", "(", "\"\"", "+", "classNode", ".", "getName", "(", ")", "+", "\"(\"", "+", "node", ".", "getName", "(", ")", "+", "\")\"", ",", "classNode", ")", ";", "}", "this", ".", "methodNode", "=", "node", ";", "adjustTypesIfStaticMainMethod", "(", "node", ")", ";", "addReturnIfNeeded", "(", "node", ")", ";", "Statement", "statement", ";", "statement", "=", "node", ".", "getCode", "(", ")", ";", "if", "(", "statement", "!=", "null", ")", "statement", ".", "visit", "(", "new", "VerifierCodeVisitor", "(", "this", ")", ")", ";", "}", "private", "void", "adjustTypesIfStaticMainMethod", "(", "MethodNode", "node", ")", "{", "if", "(", "node", ".", "getName", "(", ")", ".", "equals", "(", "\"main\"", ")", "&&", "node", ".", "isStatic", "(", ")", ")", "{", "Parameter", "[", "]", "params", "=", "node", ".", "getParameters", "(", ")", ";", "if", "(", "params", ".", "length", "==", "1", ")", "{", "Parameter", "param", "=", "params", "[", "0", "]", ";", "if", "(", "param", ".", "getType", "(", ")", "==", "null", "||", "param", ".", "getType", "(", ")", "==", "ClassHelper", ".", "OBJECT_TYPE", ")", "{", "param", ".", "setType", "(", "ClassHelper", ".", "STRING_TYPE", ".", "makeArray", "(", ")", ")", ";", "ClassNode", "returnType", "=", "node", ".", "getReturnType", "(", ")", ";", "if", "(", "returnType", "==", "ClassHelper", ".", "OBJECT_TYPE", ")", "{", "node", ".", "setReturnType", "(", "ClassHelper", ".", "VOID_TYPE", ")", ";", "}", "}", "}", "}", "}", "protected", "void", "addReturnIfNeeded", "(", "MethodNode", "node", ")", "{", "ReturnAdder", ".", "addReturnIfNeeded", "(", "node", ")", ";", "}", "public", "void", "visitField", "(", "FieldNode", "node", ")", "{", "}", "private", "boolean", "methodNeedsReplacement", "(", "MethodNode", "m", ")", "{", "if", "(", "m", "==", "null", ")", "return", "true", ";", "if", "(", "m", ".", "getDeclaringClass", "(", ")", "==", "this", ".", "getClassNode", "(", ")", ")", "return", "false", ";", "if", "(", "(", "m", ".", "getModifiers", "(", ")", "&", "ACC_FINAL", ")", "!=", "0", ")", "return", "false", ";", "return", "true", ";", "}", "public", "void", "visitProperty", "(", "PropertyNode", "node", ")", "{", "String", "name", "=", "node", ".", "getName", "(", ")", ";", "FieldNode", "field", "=", "node", ".", "getField", "(", ")", ";", "int", "propNodeModifiers", "=", "node", ".", "getModifiers", "(", ")", ";", "String", "getterName", "=", "\"get\"", "+", "capitalize", "(", "name", ")", ";", "String", "setterName", "=", "\"set\"", "+", "capitalize", "(", "name", ")", ";", "if", "(", "(", "propNodeModifiers", "&", "Modifier", ".", "VOLATILE", ")", "!=", "0", ")", "{", "propNodeModifiers", "=", "propNodeModifiers", "-", "Modifier", ".", "VOLATILE", ";", "}", "if", "(", "(", "propNodeModifiers", "&", "Modifier", ".", "TRANSIENT", ")", "!=", "0", ")", "{", "propNodeModifiers", "=", "propNodeModifiers", "-", "Modifier", ".", "TRANSIENT", ";", "}", "Statement", "getterBlock", "=", "node", ".", "getGetterBlock", "(", ")", ";", "if", "(", "getterBlock", "==", "null", ")", "{", "MethodNode", "getter", "=", "classNode", ".", "getGetterMethod", "(", "getterName", ")", ";", "if", "(", "getter", "==", "null", "&&", "ClassHelper", ".", "boolean_TYPE", "==", "node", ".", "getType", "(", ")", ")", "{", "String", "secondGetterName", "=", "\"is\"", "+", "capitalize", "(", "name", ")", ";", "getter", "=", "classNode", ".", "getGetterMethod", "(", "secondGetterName", ")", ";", "}", "if", "(", "!", "node", ".", "isPrivate", "(", ")", "&&", "methodNeedsReplacement", "(", "getter", ")", ")", "{", "getterBlock", "=", "createGetterBlock", "(", "node", ",", "field", ")", ";", "}", "}", "Statement", "setterBlock", "=", "node", ".", "getSetterBlock", "(", ")", ";", "if", "(", "setterBlock", "==", "null", ")", "{", "MethodNode", "setter", "=", "classNode", ".", "getSetterMethod", "(", "setterName", ",", "false", ")", ";", "if", "(", "!", "node", ".", "isPrivate", "(", ")", "&&", "(", "propNodeModifiers", "&", "ACC_FINAL", ")", "==", "0", "&&", "methodNeedsReplacement", "(", "setter", ")", ")", "{", "setterBlock", "=", "createSetterBlock", "(", "node", ",", "field", ")", ";", "}", "}", "if", "(", "getterBlock", "!=", "null", ")", "{", "MethodNode", "getter", "=", "new", "MethodNode", "(", "getterName", ",", "propNodeModifiers", ",", "node", ".", "getType", "(", ")", ",", "Parameter", ".", "EMPTY_ARRAY", ",", "ClassNode", ".", "EMPTY_ARRAY", ",", "getterBlock", ")", ";", "getter", ".", "setSynthetic", "(", "true", ")", ";", "addPropertyMethod", "(", "getter", ")", ";", "visitMethod", "(", "getter", ")", ";", "if", "(", "ClassHelper", ".", "boolean_TYPE", "==", "node", ".", "getType", "(", ")", "||", "ClassHelper", ".", "Boolean_TYPE", "==", "node", ".", "getType", "(", ")", ")", "{", "String", "secondGetterName", "=", "\"is\"", "+", "capitalize", "(", "name", ")", ";", "MethodNode", "secondGetter", "=", "new", "MethodNode", "(", "secondGetterName", ",", "propNodeModifiers", ",", "node", ".", "getType", "(", ")", ",", "Parameter", ".", "EMPTY_ARRAY", ",", "ClassNode", ".", "EMPTY_ARRAY", ",", "getterBlock", ")", ";", "secondGetter", ".", "setSynthetic", "(", "true", ")", ";", "addPropertyMethod", "(", "secondGetter", ")", ";", "visitMethod", "(", "secondGetter", ")", ";", "}", "}", "if", "(", "setterBlock", "!=", "null", ")", "{", "Parameter", "[", "]", "setterParameterTypes", "=", "{", "new", "Parameter", "(", "node", ".", "getType", "(", ")", ",", "\"value\"", ")", "}", ";", "MethodNode", "setter", "=", "new", "MethodNode", "(", "setterName", ",", "propNodeModifiers", ",", "ClassHelper", ".", "VOID_TYPE", ",", "setterParameterTypes", ",", "ClassNode", ".", "EMPTY_ARRAY", ",", "setterBlock", ")", ";", "setter", ".", "setSynthetic", "(", "true", ")", ";", "addPropertyMethod", "(", "setter", ")", ";", "visitMethod", "(", "setter", ")", ";", "}", "}", "protected", "void", "addPropertyMethod", "(", "MethodNode", "method", ")", "{", "classNode", ".", "addMethod", "(", "method", ")", ";", "List", "<", "MethodNode", ">", "abstractMethods", "=", "classNode", ".", "getAbstractMethods", "(", ")", ";", "if", "(", "abstractMethods", "==", "null", ")", "return", ";", "String", "methodName", "=", "method", ".", "getName", "(", ")", ";", "Parameter", "[", "]", "parameters", "=", "method", ".", "getParameters", "(", ")", ";", "ClassNode", "methodReturnType", "=", "method", ".", "getReturnType", "(", ")", ";", "for", "(", "MethodNode", "node", ":", "abstractMethods", ")", "{", "if", "(", "node", ".", "getName", "(", ")", ".", "equals", "(", "methodName", ")", "&&", "node", ".", "getParameters", "(", ")", ".", "length", "==", "parameters", ".", "length", ")", "{", "if", "(", "parameters", ".", "length", "==", "1", ")", "{", "ClassNode", "abstractMethodParameterType", "=", "node", ".", "getParameters", "(", ")", "[", "0", "]", ".", "getType", "(", ")", ";", "ClassNode", "methodParameterType", "=", "parameters", "[", "0", "]", ".", "getType", "(", ")", ";", "if", "(", "!", "methodParameterType", ".", "isDerivedFrom", "(", "abstractMethodParameterType", ")", "&&", "!", "methodParameterType", ".", "implementsInterface", "(", "abstractMethodParameterType", ")", ")", "{", "continue", ";", "}", "}", "ClassNode", "nodeReturnType", "=", "node", ".", "getReturnType", "(", ")", ";", "if", "(", "!", "methodReturnType", ".", "isDerivedFrom", "(", "nodeReturnType", ")", "&&", "!", "methodReturnType", ".", "implementsInterface", "(", "nodeReturnType", ")", ")", "{", "continue", ";", "}", "node", ".", "setModifiers", "(", "node", ".", "getModifiers", "(", ")", "^", "ACC_ABSTRACT", ")", ";", "node", ".", "setCode", "(", "method", ".", "getCode", "(", ")", ")", ";", "}", "}", "}", "public", "interface", "DefaultArgsAction", "{", "void", "call", "(", "ArgumentListExpression", "arguments", ",", "Parameter", "[", "]", "newParams", ",", "MethodNode", "method", ")", ";", "}", "protected", "void", "addDefaultParameterMethods", "(", "final", "ClassNode", "node", ")", "{", "List", "methods", "=", "new", "ArrayList", "(", "node", ".", "getMethods", "(", ")", ")", ";", "addDefaultParameters", "(", "methods", ",", "new", "DefaultArgsAction", "(", ")", "{", "public", "void", "call", "(", "ArgumentListExpression", "arguments", ",", "Parameter", "[", "]", "newParams", ",", "MethodNode", "method", ")", "{", "MethodCallExpression", "expression", "=", "new", "MethodCallExpression", "(", "VariableExpression", ".", "THIS_EXPRESSION", ",", "method", ".", "getName", "(", ")", ",", "arguments", ")", ";", "expression", ".", "setImplicitThis", "(", "true", ")", ";", "Statement", "code", "=", "null", ";", "if", "(", "method", ".", "isVoidMethod", "(", ")", ")", "{", "code", "=", "new", "ExpressionStatement", "(", "expression", ")", ";", "}", "else", "{", "code", "=", "new", "ReturnStatement", "(", "expression", ")", ";", "}", "MethodNode", "newMethod", "=", "new", "MethodNode", "(", "method", ".", "getName", "(", ")", ",", "method", ".", "getModifiers", "(", ")", ",", "method", ".", "getReturnType", "(", ")", ",", "newParams", ",", "method", ".", "getExceptions", "(", ")", ",", "code", ")", ";", "List", "<", "AnnotationNode", ">", "annotations", "=", "method", ".", "getAnnotations", "(", ")", ";", "if", "(", "annotations", "!=", "null", ")", "{", "newMethod", ".", "addAnnotations", "(", "annotations", ")", ";", "}", "MethodNode", "oldMethod", "=", "node", ".", "getDeclaredMethod", "(", "method", ".", "getName", "(", ")", ",", "newParams", ")", ";", "if", "(", "oldMethod", "!=", "null", ")", "{", "throw", "new", "RuntimeParserException", "(", "\"\"", "+", "method", ".", "getTypeDescriptor", "(", ")", "+", "\"\"", "+", "newMethod", ".", "getTypeDescriptor", "(", ")", "+", "\"\"", ",", "method", ")", ";", "}", "addPropertyMethod", "(", "newMethod", ")", ";", "newMethod", ".", "setSourcePosition", "(", "method", ")", ";", "newMethod", ".", "setNameStart", "(", "method", ".", "getNameStart", "(", ")", ")", ";", "newMethod", ".", "setNameEnd", "(", "method", ".", "getNameEnd", "(", ")", ")", ";", "newMethod", ".", "setOriginal", "(", "method", ")", ";", "newMethod", ".", "setGenericsTypes", "(", "method", ".", "getGenericsTypes", "(", ")", ")", ";", "}", "}", ")", ";", "}", "protected", "void", "addDefaultParameterConstructors", "(", "final", "ClassNode", "node", ")", "{", "List", "methods", "=", "new", "ArrayList", "(", "node", ".", "getDeclaredConstructors", "(", ")", ")", ";", "addDefaultParameters", "(", "methods", ",", "new", "DefaultArgsAction", "(", ")", "{", "public", "void", "call", "(", "ArgumentListExpression", "arguments", ",", "Parameter", "[", "]", "newParams", ",", "MethodNode", "method", ")", "{", "ConstructorNode", "ctor", "=", "(", "ConstructorNode", ")", "method", ";", "ConstructorCallExpression", "expression", "=", "new", "ConstructorCallExpression", "(", "ClassNode", ".", "THIS", ",", "arguments", ")", ";", "Statement", "code", "=", "new", "ExpressionStatement", "(", "expression", ")", ";", "addConstructor", "(", "newParams", ",", "ctor", ",", "code", ",", "node", ")", ";", "}", "}", ")", ";", "}", "protected", "void", "addConstructor", "(", "Parameter", "[", "]", "newParams", ",", "ConstructorNode", "ctor", ",", "Statement", "code", ",", "ClassNode", "node", ")", "{", "node", ".", "addConstructor", "(", "ctor", ".", "getModifiers", "(", ")", ",", "newParams", ",", "ctor", ".", "getExceptions", "(", ")", ",", "code", ")", ";", "}", "protected", "void", "addDefaultParameters", "(", "List", "methods", ",", "DefaultArgsAction", "action", ")", "{", "for", "(", "Iterator", "iter", "=", "methods", ".", "iterator", "(", ")", ";", "iter", ".", "hasNext", "(", ")", ";", ")", "{", "MethodNode", "method", "=", "(", "MethodNode", ")", "iter", ".", "next", "(", ")", ";", "if", "(", "method", ".", "hasDefaultValue", "(", ")", ")", "{", "addDefaultParameters", "(", "action", ",", "method", ")", ";", "}", "}", "}", "protected", "void", "addDefaultParameters", "(", "DefaultArgsAction", "action", ",", "MethodNode", "method", ")", "{", "Parameter", "[", "]", "parameters", "=", "method", ".", "getParameters", "(", ")", ";", "int", "counter", "=", "0", ";", "List", "paramValues", "=", "new", "ArrayList", "(", ")", ";", "int", "size", "=", "parameters", ".", "length", ";", "for", "(", "int", "i", "=", "size", "-", "1", ";", "i", ">=", "0", ";", "i", "--", ")", "{", "Parameter", "parameter", "=", "parameters", "[", "i", "]", ";", "if", "(", "parameter", "!=", "null", "&&", "parameter", ".", "hasInitialExpression", "(", ")", ")", "{", "paramValues", ".", "add", "(", "Integer", ".", "valueOf", "(", "i", ")", ")", ";", "paramValues", ".", "add", "(", "new", "CastExpression", "(", "parameter", ".", "getType", "(", ")", ",", "parameter", ".", "getInitialExpression", "(", ")", ")", ")", ";", "counter", "++", ";", "}", "}", "for", "(", "int", "j", "=", "1", ";", "j", "<=", "counter", ";", "j", "++", ")", "{", "Parameter", "[", "]", "newParams", "=", "new", "Parameter", "[", "parameters", ".", "length", "-", "j", "]", ";", "ArgumentListExpression", "arguments", "=", "new", "ArgumentListExpression", "(", ")", ";", "int", "index", "=", "0", ";", "int", "k", "=", "1", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "parameters", ".", "length", ";", "i", "++", ")", "{", "if", "(", "k", ">", "counter", "-", "j", "&&", "parameters", "[", "i", "]", "!=", "null", "&&", "parameters", "[", "i", "]", ".", "hasInitialExpression", "(", ")", ")", "{", "arguments", ".", "addExpression", "(", "new", "CastExpression", "(", "parameters", "[", "i", "]", ".", "getType", "(", ")", ",", "parameters", "[", "i", "]", ".", "getInitialExpression", "(", ")", ")", ")", ";", "k", "++", ";", "}", "else", "if", "(", "parameters", "[", "i", "]", "!=", "null", "&&", "parameters", "[", "i", "]", ".", "hasInitialExpression", "(", ")", ")", "{", "newParams", "[", "index", "++", "]", "=", "parameters", "[", "i", "]", ";", "arguments", ".", "addExpression", "(", "new", "CastExpression", "(", "parameters", "[", "i", "]", ".", "getType", "(", ")", ",", "new", "VariableExpression", "(", "parameters", "[", "i", "]", ".", "getName", "(", ")", ")", ")", ")", ";", "k", "++", ";", "}", "else", "{", "newParams", "[", "index", "++", "]", "=", "parameters", "[", "i", "]", ";", "arguments", ".", "addExpression", "(", "new", "CastExpression", "(", "parameters", "[", "i", "]", ".", "getType", "(", ")", ",", "new", "VariableExpression", "(", "parameters", "[", "i", "]", ".", "getName", "(", ")", ")", ")", ")", ";", "}", "}", "action", ".", "call", "(", "arguments", ",", "newParams", ",", "method", ")", ";", "}", "for", "(", "Parameter", "parameter", ":", "parameters", ")", "{", "parameter", ".", "setInitialExpression", "(", "null", ")", ";", "}", "}", "protected", "void", "addClosureCode", "(", "InnerClassNode", "node", ")", "{", "}", "protected", "void", "addInitialization", "(", "final", "ClassNode", "node", ")", "{", "boolean", "addSwapInit", "=", "moveOptimizedConstantsInitialization", "(", "node", ")", ";", "for", "(", "ConstructorNode", "cn", ":", "node", ".", "getDeclaredConstructors", "(", ")", ")", "{", "addInitialization", "(", "node", ",", "cn", ")", ";", "}", "if", "(", "addSwapInit", ")", "{", "BytecodeSequence", "seq", "=", "new", "BytecodeSequence", "(", "new", "BytecodeInstruction", "(", ")", "{", "@", "Override", "public", "void", "visit", "(", "MethodVisitor", "mv", ")", "{", "mv", ".", "visitMethodInsn", "(", "INVOKESTATIC", ",", "BytecodeHelper", ".", "getClassInternalName", "(", "node", ")", ",", "SWAP_INIT", ",", "\"()V\"", ")", ";", "}", "}", ")", ";", "List", "<", "Statement", ">", "swapCall", "=", "new", "ArrayList", "<", "Statement", ">", "(", "1", ")", ";", "swapCall", ".", "add", "(", "seq", ")", ";", "node", ".", "addStaticInitializerStatements", "(", "swapCall", ",", "true", ")", ";", "}", "}", "protected", "void", "addInitialization", "(", "ClassNode", "node", ",", "ConstructorNode", "constructorNode", ")", "{", "Statement", "firstStatement", "=", "constructorNode", ".", "getFirstStatement", "(", ")", ";", "if", "(", "firstStatement", "instanceof", "BytecodeSequence", ")", "return", ";", "ConstructorCallExpression", "first", "=", "getFirstIfSpecialConstructorCall", "(", "firstStatement", ")", ";", "if", "(", "first", "!=", "null", "&&", "(", "first", ".", "isThisCall", "(", ")", ")", ")", "return", ";", "List", "<", "Statement", ">", "statements", "=", "new", "ArrayList", "<", "Statement", ">", "(", ")", ";", "List", "<", "Statement", ">", "staticStatements", "=", "new", "ArrayList", "<", "Statement", ">", "(", ")", ";", "final", "boolean", "isEnum", "=", "node", ".", "isEnum", "(", ")", ";", "List", "<", "Statement", ">", "initStmtsAfterEnumValuesInit", "=", "new", "ArrayList", "<", "Statement", ">", "(", ")", ";", "Set", "<", "String", ">", "explicitStaticPropsInEnum", "=", "new", "HashSet", "<", "String", ">", "(", ")", ";", "if", "(", "isEnum", ")", "{", "for", "(", "PropertyNode", "propNode", ":", "node", ".", "getProperties", "(", ")", ")", "{", "if", "(", "!", "propNode", ".", "isSynthetic", "(", ")", "&&", "propNode", ".", "getField", "(", ")", ".", "isStatic", "(", ")", ")", "{", "explicitStaticPropsInEnum", ".", "add", "(", "propNode", ".", "getField", "(", ")", ".", "getName", "(", ")", ")", ";", "}", "}", "for", "(", "FieldNode", "fieldNode", ":", "node", ".", "getFields", "(", ")", ")", "{", "if", "(", "!", "fieldNode", ".", "isSynthetic", "(", ")", "&&", "fieldNode", ".", "isStatic", "(", ")", "&&", "fieldNode", ".", "getType", "(", ")", "!=", "node", ")", "{", "explicitStaticPropsInEnum", ".", "add", "(", "fieldNode", ".", "getName", "(", ")", ")", ";", "}", "}", "}", "if", "(", "inlineFieldInitializersIntoInit", ")", "{", "for", "(", "FieldNode", "fn", ":", "node", ".", "getFields", "(", ")", ")", "{", "addFieldInitialization", "(", "statements", ",", "staticStatements", ",", "fn", ",", "isEnum", ",", "initStmtsAfterEnumValuesInit", ",", "explicitStaticPropsInEnum", ")", ";", "}", "}", "statements", ".", "addAll", "(", "node", ".", "getObjectInitializerStatements", "(", ")", ")", ";", "Statement", "code", "=", "constructorNode", ".", "getCode", "(", ")", ";", "BlockStatement", "block", "=", "new", "BlockStatement", "(", ")", ";", "List", "<", "Statement", ">", "otherStatements", "=", "block", ".", "getStatements", "(", ")", ";", "if", "(", "code", "instanceof", "BlockStatement", ")", "{", "block", "=", "(", "BlockStatement", ")", "code", ";", "otherStatements", "=", "block", ".", "getStatements", "(", ")", ";", "}", "else", "if", "(", "code", "!=", "null", ")", "{", "otherStatements", ".", "add", "(", "code", ")", ";", "}", "if", "(", "!", "otherStatements", ".", "isEmpty", "(", ")", ")", "{", "if", "(", "first", "!=", "null", ")", "{", "otherStatements", ".", "remove", "(", "0", ")", ";", "statements", ".", "add", "(", "0", ",", "firstStatement", ")", ";", "}", "Statement", "stmtThis$0", "=", "getImplicitThis$0StmtIfInnerClass", "(", "otherStatements", ")", ";", "if", "(", "stmtThis$0", "!=", "null", ")", "{", "statements", ".", "add", "(", "0", ",", "stmtThis$0", ")", ";", "}", "statements", ".", "addAll", "(", "otherStatements", ")", ";", "}", "BlockStatement", "newBlock", "=", "new", "BlockStatement", "(", "statements", ",", "block", ".", "getVariableScope", "(", ")", ")", ";", "newBlock", ".", "setSourcePosition", "(", "block", ")", ";", "constructorNode", ".", "setCode", "(", "newBlock", ")", ";", "if", "(", "!", "staticStatements", ".", "isEmpty", "(", ")", ")", "{", "if", "(", "isEnum", ")", "{", "staticStatements", ".", "removeAll", "(", "initStmtsAfterEnumValuesInit", ")", ";", "node", ".", "addStaticInitializerStatements", "(", "staticStatements", ",", "true", ")", ";", "if", "(", "!", "initStmtsAfterEnumValuesInit", ".", "isEmpty", "(", ")", ")", "{", "node", ".", "positionStmtsAfterEnumInitStmts", "(", "initStmtsAfterEnumValuesInit", ")", ";", "}", "}", "else", "{", "node", ".", "addStaticInitializerStatements", "(", "staticStatements", ",", "true", ")", ";", "}", "}", "}", "private", "Statement", "getImplicitThis$0StmtIfInnerClass", "(", "List", "<", "Statement", ">", "otherStatements", ")", "{", "if", "(", "!", "(", "classNode", "instanceof", "InnerClassNode", ")", ")", "return", "null", ";", "for", "(", "Statement", "stmt", ":", "otherStatements", ")", "{", "if", "(", "stmt", "instanceof", "BlockStatement", ")", "{", "List", "<", "Statement", ">", "stmts", "=", "(", "(", "BlockStatement", ")", "stmt", ")", ".", "getStatements", "(", ")", ";", "for", "(", "Statement", "bstmt", ":", "stmts", ")", "{", "if", "(", "bstmt", "instanceof", "ExpressionStatement", ")", "{", "if", "(", "extractImplicitThis$0StmtIfInnerClassFromExpression", "(", "stmts", ",", "bstmt", ")", ")", "return", "bstmt", ";", "}", "}", "}", "else", "if", "(", "stmt", "instanceof", "ExpressionStatement", ")", "{", "if", "(", "extractImplicitThis$0StmtIfInnerClassFromExpression", "(", "otherStatements", ",", "stmt", ")", ")", "return", "stmt", ";", "}", "}", "return", "null", ";", "}", "private", "boolean", "extractImplicitThis$0StmtIfInnerClassFromExpression", "(", "final", "List", "<", "Statement", ">", "stmts", ",", "final", "Statement", "bstmt", ")", "{", "Expression", "expr", "=", "(", "(", "ExpressionStatement", ")", "bstmt", ")", ".", "getExpression", "(", ")", ";", "if", "(", "expr", "instanceof", "BinaryExpression", ")", "{", "Expression", "lExpr", "=", "(", "(", "BinaryExpression", ")", "expr", ")", ".", "getLeftExpression", "(", ")", ";", "if", "(", "lExpr", "instanceof", "FieldExpression", ")", "{", "if", "(", "\"this$0\"", ".", "equals", "(", "(", "(", "FieldExpression", ")", "lExpr", ")", ".", "getFieldName", "(", ")", ")", ")", "{", "stmts", ".", "remove", "(", "bstmt", ")", ";", "return", "true", ";", "}", "}", "}", "return", "false", ";", "}", "private", "ConstructorCallExpression", "getFirstIfSpecialConstructorCall", "(", "Statement", "code", ")", "{", "if", "(", "code", "==", "null", "||", "!", "(", "code", "instanceof", "ExpressionStatement", ")", ")", "return", "null", ";", "Expression", "expression", "=", "(", "(", "ExpressionStatement", ")", "code", ")", ".", "getExpression", "(", ")", ";", "if", "(", "!", "(", "expression", "instanceof", "ConstructorCallExpression", ")", ")", "return", "null", ";", "ConstructorCallExpression", "cce", "=", "(", "ConstructorCallExpression", ")", "expression", ";", "if", "(", "cce", ".", "isSpecialCall", "(", ")", ")", "return", "cce", ";", "return", "null", ";", "}", "protected", "void", "addFieldInitialization", "(", "List", "list", ",", "List", "staticList", ",", "FieldNode", "fieldNode", ",", "boolean", "isEnumClassNode", ",", "List", "initStmtsAfterEnumValuesInit", ",", "Set", "explicitStaticPropsInEnum", ")", "{", "Expression", "expression", "=", "fieldNode", ".", "getInitialExpression", "(", ")", ";", "if", "(", "expression", "!=", "null", ")", "{", "final", "FieldExpression", "fe", "=", "new", "FieldExpression", "(", "fieldNode", ")", ";", "if", "(", "fieldNode", ".", "getType", "(", ")", ".", "equals", "(", "ClassHelper", ".", "REFERENCE_TYPE", ")", "&&", "(", "(", "fieldNode", ".", "getModifiers", "(", ")", "&", "Opcodes", ".", "ACC_SYNTHETIC", ")", "!=", "0", ")", ")", "{", "fe", ".", "setUseReferenceDirectly", "(", "true", ")", ";", "}", "ExpressionStatement", "statement", "=", "new", "ExpressionStatement", "(", "new", "BinaryExpression", "(", "fe", ",", "Token", ".", "newSymbol", "(", "Types", ".", "EQUAL", ",", "fieldNode", ".", "getLineNumber", "(", ")", ",", "fieldNode", ".", "getColumnNumber", "(", ")", ")", ",", "expression", ")", ")", ";", "if", "(", "fieldNode", ".", "isStatic", "(", ")", ")", "{", "if", "(", "inlineStaticFieldInitializersIntoClinit", ")", "{", "Expression", "initialValueExpression", "=", "fieldNode", ".", "getInitialValueExpression", "(", ")", ";", "if", "(", "initialValueExpression", "instanceof", "ConstantExpression", ")", "{", "ConstantExpression", "cexp", "=", "(", "ConstantExpression", ")", "initialValueExpression", ";", "cexp", "=", "transformToPrimitiveConstantIfPossible", "(", "cexp", ")", ";", "if", "(", "fieldNode", ".", "isFinal", "(", ")", "&&", "ClassHelper", ".", "isStaticConstantInitializerType", "(", "cexp", ".", "getType", "(", ")", ")", "&&", "cexp", ".", "getType", "(", ")", ".", "equals", "(", "fieldNode", ".", "getType", "(", ")", ")", ")", "{", "return", ";", "}", "staticList", ".", "add", "(", "0", ",", "statement", ")", ";", "}", "else", "{", "staticList", ".", "add", "(", "statement", ")", ";", "}", "fieldNode", ".", "setInitialValueExpression", "(", "null", ")", ";", "}", "if", "(", "isEnumClassNode", "&&", "explicitStaticPropsInEnum", ".", "contains", "(", "fieldNode", ".", "getName", "(", ")", ")", ")", "{", "initStmtsAfterEnumValuesInit", ".", "add", "(", "statement", ")", ";", "}", "}", "else", "{", "list", ".", "add", "(", "statement", ")", ";", "}", "}", "}", "public", "static", "String", "capitalize", "(", "String", "name", ")", "{", "return", "MetaClassHelper", ".", "capitalize", "(", "name", ")", ";", "}", "protected", "Statement", "createGetterBlock", "(", "PropertyNode", "propertyNode", ",", "final", "FieldNode", "field", ")", "{", "return", "new", "BytecodeSequence", "(", "new", "BytecodeInstruction", "(", ")", "{", "public", "void", "visit", "(", "MethodVisitor", "mv", ")", "{", "if", "(", "field", ".", "isStatic", "(", ")", ")", "{", "mv", ".", "visitFieldInsn", "(", "GETSTATIC", ",", "BytecodeHelper", ".", "getClassInternalName", "(", "classNode", ")", ",", "field", ".", "getName", "(", ")", ",", "BytecodeHelper", ".", "getTypeDescription", "(", "field", ".", "getType", "(", ")", ")", ")", ";", "}", "else", "{", "mv", ".", "visitVarInsn", "(", "ALOAD", ",", "0", ")", ";", "mv", ".", "visitFieldInsn", "(", "GETFIELD", ",", "BytecodeHelper", ".", "getClassInternalName", "(", "classNode", ")", ",", "field", ".", "getName", "(", ")", ",", "BytecodeHelper", ".", "getTypeDescription", "(", "field", ".", "getType", "(", ")", ")", ")", ";", "}", "BytecodeHelper", ".", "doReturn", "(", "mv", ",", "field", ".", "getType", "(", ")", ")", ";", "}", "}", ")", ";", "}", "protected", "Statement", "createSetterBlock", "(", "PropertyNode", "propertyNode", ",", "final", "FieldNode", "field", ")", "{", "return", "new", "BytecodeSequence", "(", "new", "BytecodeInstruction", "(", ")", "{", "public", "void", "visit", "(", "MethodVisitor", "mv", ")", "{", "if", "(", "field", ".", "isStatic", "(", ")", ")", "{", "BytecodeHelper", ".", "load", "(", "mv", ",", "field", ".", "getType", "(", ")", ",", "0", ")", ";", "mv", ".", "visitFieldInsn", "(", "PUTSTATIC", ",", "BytecodeHelper", ".", "getClassInternalName", "(", "classNode", ")", ",", "field", ".", "getName", "(", ")", ",", "BytecodeHelper", ".", "getTypeDescription", "(", "field", ".", "getType", "(", ")", ")", ")", ";", "}", "else", "{", "mv", ".", "visitVarInsn", "(", "ALOAD", ",", "0", ")", ";", "BytecodeHelper", ".", "load", "(", "mv", ",", "field", ".", "getType", "(", ")", ",", "1", ")", ";", "mv", ".", "visitFieldInsn", "(", "PUTFIELD", ",", "BytecodeHelper", ".", "getClassInternalName", "(", "classNode", ")", ",", "field", ".", "getName", "(", ")", ",", "BytecodeHelper", ".", "getTypeDescription", "(", "field", ".", "getType", "(", ")", ")", ")", ";", "}", "mv", ".", "visitInsn", "(", "RETURN", ")", ";", "}", "}", ")", ";", "}", "public", "void", "visitGenericType", "(", "GenericsType", "genericsType", ")", "{", "}", "public", "static", "long", "getTimestamp", "(", "Class", "clazz", ")", "{", "if", "(", "clazz", ".", "getClassLoader", "(", ")", "instanceof", "GroovyClassLoader", ".", "InnerLoader", ")", "{", "GroovyClassLoader", ".", "InnerLoader", "innerLoader", "=", "(", "GroovyClassLoader", ".", "InnerLoader", ")", "clazz", ".", "getClassLoader", "(", ")", ";", "return", "innerLoader", ".", "getTimeStamp", "(", ")", ";", "}", "final", "Field", "[", "]", "fields", "=", "clazz", ".", "getFields", "(", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "!=", "fields", ".", "length", ";", "++", "i", ")", "{", "if", "(", "Modifier", ".", "isStatic", "(", "fields", "[", "i", "]", ".", "getModifiers", "(", ")", ")", ")", "{", "final", "String", "name", "=", "fields", "[", "i", "]", ".", "getName", "(", ")", ";", "if", "(", "name", ".", "startsWith", "(", "__TIMESTAMP__", ")", ")", "{", "try", "{", "return", "Long", ".", "decode", "(", "name", ".", "substring", "(", "__TIMESTAMP__", ".", "length", "(", ")", ")", ")", ".", "longValue", "(", ")", ";", "}", "catch", "(", "NumberFormatException", "e", ")", "{", "return", "Long", ".", "MAX_VALUE", ";", "}", "}", "}", "}", "return", "Long", ".", "MAX_VALUE", ";", "}", "protected", "void", "addCovariantMethods", "(", "ClassNode", "classNode", ")", "{", "Map", "methodsToAdd", "=", "new", "HashMap", "(", ")", ";", "Map", "genericsSpec", "=", "new", "HashMap", "(", ")", ";", "Map", "abstractMethods", "=", "new", "HashMap", "(", ")", ";", "Map", "<", "String", ",", "MethodNode", ">", "allInterfaceMethods", "=", "new", "HashMap", "<", "String", ",", "MethodNode", ">", "(", ")", ";", "ClassNode", "[", "]", "interfaces", "=", "classNode", ".", "getInterfaces", "(", ")", ";", "for", "(", "ClassNode", "iface", ":", "interfaces", ")", "{", "Map", "ifaceMethodsMap", "=", "iface", ".", "getDeclaredMethodsMap", "(", ")", ";", "abstractMethods", ".", "putAll", "(", "ifaceMethodsMap", ")", ";", "allInterfaceMethods", ".", "putAll", "(", "ifaceMethodsMap", ")", ";", "}", "collectSuperInterfaceMethods", "(", "classNode", ",", "allInterfaceMethods", ")", ";", "List", "<", "MethodNode", ">", "declaredMethods", "=", "new", "ArrayList", "<", "MethodNode", ">", "(", "classNode", ".", "getMethods", "(", ")", ")", ";", "for", "(", "Iterator", "methodsIterator", "=", "declaredMethods", ".", "iterator", "(", ")", ";", "methodsIterator", ".", "hasNext", "(", ")", ";", ")", "{", "MethodNode", "m", "=", "(", "MethodNode", ")", "methodsIterator", ".", "next", "(", ")", ";", "abstractMethods", ".", "remove", "(", "m", ".", "getTypeDescriptor", "(", ")", ")", ";", "if", "(", "m", ".", "isStatic", "(", ")", "||", "!", "(", "m", ".", "isPublic", "(", ")", "||", "m", ".", "isProtected", "(", ")", ")", ")", "{", "methodsIterator", ".", "remove", "(", ")", ";", "}", "MethodNode", "intfMethod", "=", "allInterfaceMethods", ".", "get", "(", "m", ".", "getTypeDescriptor", "(", ")", ")", ";", "if", "(", "intfMethod", "!=", "null", "&&", "(", "(", "m", ".", "getModifiers", "(", ")", "&", "ACC_SYNTHETIC", ")", "==", "0", ")", "&&", "!", "m", ".", "isPublic", "(", ")", "&&", "!", "m", ".", "isStaticConstructor", "(", ")", ")", "{", "throw", "new", "RuntimeParserException", "(", "\"The", "method", "\"", "+", "m", ".", "getName", "(", ")", "+", "\"\"", "+", "intfMethod", ".", "getDeclaringClass", "(", ")", ",", "m", ")", ";", "}", "}", "addCovariantMethods", "(", "classNode", ",", "declaredMethods", ",", "abstractMethods", ",", "methodsToAdd", ",", "genericsSpec", ")", ";", "Map", "<", "String", ",", "MethodNode", ">", "declaredMethodsMap", "=", "new", "HashMap", "<", "String", ",", "MethodNode", ">", "(", ")", ";", "if", "(", "methodsToAdd", ".", "size", "(", ")", ">", "0", ")", "{", "for", "(", "MethodNode", "mn", ":", "declaredMethods", ")", "{", "declaredMethodsMap", ".", "put", "(", "mn", ".", "getTypeDescriptor", "(", ")", ",", "mn", ")", ";", "}", "}", "for", "(", "Object", "o", ":", "methodsToAdd", ".", "entrySet", "(", ")", ")", "{", "Map", ".", "Entry", "entry", "=", "(", "Map", ".", "Entry", ")", "o", ";", "MethodNode", "method", "=", "(", "MethodNode", ")", "entry", ".", "getValue", "(", ")", ";", "MethodNode", "mn", "=", "declaredMethodsMap", ".", "get", "(", "entry", ".", "getKey", "(", ")", ")", ";", "if", "(", "mn", "!=", "null", "&&", "mn", ".", "getDeclaringClass", "(", ")", ".", "equals", "(", "classNode", ")", ")", "continue", ";", "addPropertyMethod", "(", "method", ")", ";", "}", "}", "private", "void", "collectSuperInterfaceMethods", "(", "ClassNode", "cn", ",", "Map", "<", "String", ",", "MethodNode", ">", "allInterfaceMethods", ")", "{", "List", "cnInterfaces", "=", "Arrays", ".", "asList", "(", "cn", ".", "getInterfaces", "(", ")", ")", ";", "ClassNode", "sn", "=", "cn", ".", "getSuperClass", "(", ")", ";", "while", "(", "sn", "!=", "null", "&&", "!", "sn", ".", "equals", "(", "ClassHelper", ".", "OBJECT_TYPE", ")", ")", "{", "ClassNode", "[", "]", "interfaces", "=", "sn", ".", "getInterfaces", "(", ")", ";", "for", "(", "ClassNode", "iface", ":", "interfaces", ")", "{", "if", "(", "!", "cnInterfaces", ".", "contains", "(", "iface", ")", ")", "{", "Map", "<", "String", ",", "MethodNode", ">", "ifaceMethodsMap", "=", "iface", ".", "getDeclaredMethodsMap", "(", ")", ";", "allInterfaceMethods", ".", "putAll", "(", "ifaceMethodsMap", ")", ";", "}", "}", "sn", "=", "sn", ".", "getSuperClass", "(", ")", ";", "}", "}", "private", "void", "addCovariantMethods", "(", "ClassNode", "classNode", ",", "List", "declaredMethods", ",", "Map", "abstractMethods", ",", "Map", "methodsToAdd", ",", "Map", "oldGenericsSpec", ")", "{", "ClassNode", "sn", "=", "classNode", ".", "getUnresolvedSuperClass", "(", "false", ")", ";", "if", "(", "sn", "!=", "null", ")", "{", "Map", "genericsSpec", "=", "createGenericsSpec", "(", "sn", ",", "oldGenericsSpec", ")", ";", "List", "<", "MethodNode", ">", "classMethods", "=", "sn", ".", "getMethods", "(", ")", ";", "for", "(", "Object", "declaredMethod", ":", "declaredMethods", ")", "{", "MethodNode", "method", "=", "(", "MethodNode", ")", "declaredMethod", ";", "if", "(", "method", ".", "isStatic", "(", ")", ")", "continue", ";", "storeMissingCovariantMethods", "(", "classMethods", ",", "method", ",", "methodsToAdd", ",", "genericsSpec", ")", ";", "}", "if", "(", "!", "abstractMethods", ".", "isEmpty", "(", ")", ")", "{", "for", "(", "Object", "classMethod", ":", "classMethods", ")", "{", "MethodNode", "method", "=", "(", "MethodNode", ")", "classMethod", ";", "if", "(", "method", ".", "isStatic", "(", ")", ")", "continue", ";", "storeMissingCovariantMethods", "(", "abstractMethods", ".", "values", "(", ")", ",", "method", ",", "methodsToAdd", ",", "Collections", ".", "EMPTY_MAP", ")", ";", "}", "}", "addCovariantMethods", "(", "sn", ".", "redirect", "(", ")", ",", "declaredMethods", ",", "abstractMethods", ",", "methodsToAdd", ",", "genericsSpec", ")", ";", "}", "ClassNode", "[", "]", "interfaces", "=", "classNode", ".", "getInterfaces", "(", ")", ";", "for", "(", "ClassNode", "anInterface", ":", "interfaces", ")", "{", "List", "interfacesMethods", "=", "anInterface", ".", "getMethods", "(", ")", ";", "Map", "genericsSpec", "=", "createGenericsSpec", "(", "anInterface", ",", "oldGenericsSpec", ")", ";", "for", "(", "Object", "declaredMethod", ":", "declaredMethods", ")", "{", "MethodNode", "method", "=", "(", "MethodNode", ")", "declaredMethod", ";", "if", "(", "method", ".", "isStatic", "(", ")", ")", "continue", ";", "storeMissingCovariantMethods", "(", "interfacesMethods", ",", "method", ",", "methodsToAdd", ",", "genericsSpec", ")", ";", "}", "addCovariantMethods", "(", "anInterface", ",", "declaredMethods", ",", "abstractMethods", ",", "methodsToAdd", ",", "genericsSpec", ")", ";", "}", "}", "private", "MethodNode", "getCovariantImplementation", "(", "final", "MethodNode", "oldMethod", ",", "final", "MethodNode", "overridingMethod", ",", "Map", "genericsSpec", ")", "{", "if", "(", "!", "oldMethod", ".", "getName", "(", ")", ".", "equals", "(", "overridingMethod", ".", "getName", "(", ")", ")", ")", "return", "null", ";", "if", "(", "(", "overridingMethod", ".", "getModifiers", "(", ")", "&", "ACC_BRIDGE", ")", "!=", "0", ")", "return", "null", ";", "boolean", "normalEqualParameters", "=", "equalParametersNormal", "(", "overridingMethod", ",", "oldMethod", ")", ";", "boolean", "genericEqualParameters", "=", "equalParametersWithGenerics", "(", "overridingMethod", ",", "oldMethod", ",", "genericsSpec", ")", ";", "if", "(", "!", "normalEqualParameters", "&&", "!", "genericEqualParameters", ")", "return", "null", ";", "ClassNode", "mr", "=", "overridingMethod", ".", "getReturnType", "(", ")", ";", "ClassNode", "omr", "=", "oldMethod", ".", "getReturnType", "(", ")", ";", "boolean", "equalReturnType", "=", "mr", ".", "equals", "(", "omr", ")", ";", "if", "(", "equalReturnType", "&&", "normalEqualParameters", ")", "return", "null", ";", "ClassNode", "testmr", "=", "correctToGenericsSpec", "(", "genericsSpec", ",", "omr", ")", ";", "if", "(", "!", "isAssignable", "(", "mr", ",", "testmr", ")", ")", "{", "throw", "new", "RuntimeParserException", "(", "\"\"", "+", "overridingMethod", ".", "getTypeDescriptor", "(", ")", "+", "\"", "in", "\"", "+", "overridingMethod", ".", "getDeclaringClass", "(", ")", ".", "getName", "(", ")", "+", "\"\"", "+", "oldMethod", ".", "getTypeDescriptor", "(", ")", "+", "\"", "in", "\"", "+", "oldMethod", ".", "getDeclaringClass", "(", ")", ".", "getName", "(", ")", ",", "overridingMethod", ")", ";", "}", "if", "(", "(", "oldMethod", ".", "getModifiers", "(", ")", "&", "ACC_FINAL", ")", "!=", "0", ")", "{", "throw", "new", "RuntimeParserException", "(", "\"\"", "+", "oldMethod", ".", "getTypeDescriptor", "(", ")", "+", "\"", "in", "\"", "+", "oldMethod", ".", "getDeclaringClass", "(", ")", ".", "getName", "(", ")", ",", "overridingMethod", ")", ";", "}", "if", "(", "oldMethod", ".", "isStatic", "(", ")", "!=", "overridingMethod", ".", "isStatic", "(", ")", ")", "{", "throw", "new", "RuntimeParserException", "(", "\"\"", "+", "oldMethod", ".", "getTypeDescriptor", "(", ")", "+", "\"", "in", "\"", "+", "oldMethod", ".", "getDeclaringClass", "(", ")", ".", "getName", "(", ")", "+", "\"\"", ",", "overridingMethod", ")", ";", "}", "if", "(", "!", "equalReturnType", ")", "{", "boolean", "oldM", "=", "ClassHelper", ".", "isPrimitiveType", "(", "oldMethod", ".", "getReturnType", "(", ")", ")", ";", "boolean", "newM", "=", "ClassHelper", ".", "isPrimitiveType", "(", "overridingMethod", ".", "getReturnType", "(", ")", ")", ";", "if", "(", "oldM", "||", "newM", ")", "{", "String", "message", "=", "\"\"", ";", "if", "(", "oldM", "&&", "newM", ")", "{", "message", "=", "\"\"", ";", "}", "else", "if", "(", "newM", ")", "{", "message", "=", "\"\"", ";", "}", "else", "if", "(", "oldM", ")", "{", "message", "=", "\"\"", ";", "}", "throw", "new", "RuntimeParserException", "(", "\"\"", "+", "oldMethod", ".", "getTypeDescriptor", "(", ")", "+", "\"", "in", "\"", "+", "oldMethod", ".", "getDeclaringClass", "(", ")", ".", "getName", "(", ")", "+", "message", ",", "overridingMethod", ")", ";", "}", "}", "MethodNode", "newMethod", "=", "new", "MethodNode", "(", "oldMethod", ".", "getName", "(", ")", ",", "overridingMethod", ".", "getModifiers", "(", ")", "|", "ACC_SYNTHETIC", "|", "ACC_BRIDGE", ",", "oldMethod", ".", "getReturnType", "(", ")", ".", "getPlainNodeReference", "(", ")", ",", "cleanParameters", "(", "oldMethod", ".", "getParameters", "(", ")", ")", ",", "oldMethod", ".", "getExceptions", "(", ")", ",", "null", ")", ";", "List", "instructions", "=", "new", "ArrayList", "(", "1", ")", ";", "instructions", ".", "add", "(", "new", "BytecodeInstruction", "(", ")", "{", "public", "void", "visit", "(", "MethodVisitor", "mv", ")", "{", "mv", ".", "visitVarInsn", "(", "ALOAD", ",", "0", ")", ";", "Parameter", "[", "]", "para", "=", "oldMethod", ".", "getParameters", "(", ")", ";", "Parameter", "[", "]", "goal", "=", "overridingMethod", ".", "getParameters", "(", ")", ";", "int", "doubleSlotOffset", "=", "0", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "para", ".", "length", ";", "i", "++", ")", "{", "ClassNode", "type", "=", "para", "[", "i", "]", ".", "getType", "(", ")", ";", "BytecodeHelper", ".", "load", "(", "mv", ",", "type", ",", "i", "+", "1", "+", "doubleSlotOffset", ")", ";", "if", "(", "type", ".", "redirect", "(", ")", "==", "ClassHelper", ".", "double_TYPE", "||", "type", ".", "redirect", "(", ")", "==", "ClassHelper", ".", "long_TYPE", ")", "{", "doubleSlotOffset", "++", ";", "}", "if", "(", "!", "type", ".", "equals", "(", "goal", "[", "i", "]", ".", "getType", "(", ")", ")", ")", "{", "BytecodeHelper", ".", "doCast", "(", "mv", ",", "goal", "[", "i", "]", ".", "getType", "(", ")", ")", ";", "}", "}", "mv", ".", "visitMethodInsn", "(", "INVOKEVIRTUAL", ",", "BytecodeHelper", ".", "getClassInternalName", "(", "classNode", ")", ",", "overridingMethod", ".", "getName", "(", ")", ",", "BytecodeHelper", ".", "getMethodDescriptor", "(", "overridingMethod", ".", "getReturnType", "(", ")", ",", "overridingMethod", ".", "getParameters", "(", ")", ")", ")", ";", "BytecodeHelper", ".", "doReturn", "(", "mv", ",", "oldMethod", ".", "getReturnType", "(", ")", ")", ";", "}", "}", ")", ";", "newMethod", ".", "setCode", "(", "new", "BytecodeSequence", "(", "instructions", ")", ")", ";", "return", "newMethod", ";", "}", "private", "boolean", "isAssignable", "(", "ClassNode", "node", ",", "ClassNode", "testNode", ")", "{", "if", "(", "testNode", ".", "isInterface", "(", ")", ")", "{", "if", "(", "node", ".", "isInterface", "(", ")", ")", "{", "if", "(", "node", ".", "isDerivedFrom", "(", "testNode", ")", ")", "return", "true", ";", "}", "else", "{", "if", "(", "node", ".", "implementsInterface", "(", "testNode", ")", ")", "return", "true", ";", "}", "}", "else", "{", "if", "(", "node", ".", "isDerivedFrom", "(", "testNode", ")", ")", "return", "true", ";", "}", "return", "false", ";", "}", "private", "Parameter", "[", "]", "cleanParameters", "(", "Parameter", "[", "]", "parameters", ")", "{", "Parameter", "[", "]", "params", "=", "new", "Parameter", "[", "parameters", ".", "length", "]", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "params", ".", "length", ";", "i", "++", ")", "{", "params", "[", "i", "]", "=", "new", "Parameter", "(", "parameters", "[", "i", "]", ".", "getType", "(", ")", ".", "getPlainNodeReference", "(", ")", ",", "parameters", "[", "i", "]", ".", "getName", "(", ")", ")", ";", "}", "return", "params", ";", "}", "private", "void", "storeMissingCovariantMethods", "(", "Collection", "methods", ",", "MethodNode", "method", ",", "Map", "methodsToAdd", ",", "Map", "genericsSpec", ")", "{", "for", "(", "Object", "method1", ":", "methods", ")", "{", "MethodNode", "toOverride", "=", "(", "MethodNode", ")", "method1", ";", "MethodNode", "bridgeMethod", "=", "getCovariantImplementation", "(", "toOverride", ",", "method", ",", "genericsSpec", ")", ";", "if", "(", "bridgeMethod", "==", "null", ")", "continue", ";", "methodsToAdd", ".", "put", "(", "bridgeMethod", ".", "getTypeDescriptor", "(", ")", ",", "bridgeMethod", ")", ";", "return", ";", "}", "}", "private", "ClassNode", "correctToGenericsSpec", "(", "Map", "genericsSpec", ",", "GenericsType", "type", ")", "{", "ClassNode", "ret", "=", "null", ";", "if", "(", "type", ".", "isPlaceholder", "(", ")", ")", "{", "String", "name", "=", "type", ".", "getName", "(", ")", ";", "ret", "=", "(", "ClassNode", ")", "genericsSpec", ".", "get", "(", "name", ")", ";", "}", "if", "(", "ret", "==", "null", ")", "ret", "=", "type", ".", "getType", "(", ")", ";", "return", "ret", ";", "}", "private", "ClassNode", "correctToGenericsSpec", "(", "Map", "genericsSpec", ",", "ClassNode", "type", ")", "{", "if", "(", "type", ".", "isGenericsPlaceHolder", "(", ")", ")", "{", "String", "name", "=", "type", ".", "getGenericsTypes", "(", ")", "[", "0", "]", ".", "getName", "(", ")", ";", "type", "=", "(", "ClassNode", ")", "genericsSpec", ".", "get", "(", "name", ")", ";", "}", "if", "(", "type", "==", "null", ")", "type", "=", "ClassHelper", ".", "OBJECT_TYPE", ";", "return", "type", ";", "}", "private", "boolean", "equalParametersNormal", "(", "MethodNode", "m1", ",", "MethodNode", "m2", ")", "{", "Parameter", "[", "]", "p1", "=", "m1", ".", "getParameters", "(", ")", ";", "Parameter", "[", "]", "p2", "=", "m2", ".", "getParameters", "(", ")", ";", "if", "(", "p1", ".", "length", "!=", "p2", ".", "length", ")", "return", "false", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "p2", ".", "length", ";", "i", "++", ")", "{", "ClassNode", "type", "=", "p2", "[", "i", "]", ".", "getType", "(", ")", ";", "ClassNode", "parameterType", "=", "p1", "[", "i", "]", ".", "getType", "(", ")", ";", "if", "(", "!", "parameterType", ".", "equals", "(", "type", ")", ")", "return", "false", ";", "}", "return", "true", ";", "}", "private", "boolean", "equalParametersWithGenerics", "(", "MethodNode", "m1", ",", "MethodNode", "m2", ",", "Map", "genericsSpec", ")", "{", "Parameter", "[", "]", "p1", "=", "m1", ".", "getParameters", "(", ")", ";", "Parameter", "[", "]", "p2", "=", "m2", ".", "getParameters", "(", ")", ";", "if", "(", "p1", ".", "length", "!=", "p2", ".", "length", ")", "return", "false", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "p2", ".", "length", ";", "i", "++", ")", "{", "ClassNode", "type", "=", "p2", "[", "i", "]", ".", "getType", "(", ")", ";", "ClassNode", "genericsType", "=", "correctToGenericsSpec", "(", "genericsSpec", ",", "type", ")", ";", "ClassNode", "parameterType", "=", "p1", "[", "i", "]", ".", "getType", "(", ")", ";", "if", "(", "!", "parameterType", ".", "equals", "(", "genericsType", ")", ")", "return", "false", ";", "}", "return", "true", ";", "}", "private", "Map", "createGenericsSpec", "(", "ClassNode", "current", ",", "Map", "oldSpec", ")", "{", "Map", "ret", "=", "new", "HashMap", "(", "oldSpec", ")", ";", "GenericsType", "[", "]", "sgts", "=", "current", ".", "getGenericsTypes", "(", ")", ";", "if", "(", "sgts", "!=", "null", ")", "{", "ClassNode", "[", "]", "spec", "=", "new", "ClassNode", "[", "sgts", ".", "length", "]", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "spec", ".", "length", ";", "i", "++", ")", "{", "spec", "[", "i", "]", "=", "correctToGenericsSpec", "(", "ret", ",", "sgts", "[", "i", "]", ")", ";", "}", "GenericsType", "[", "]", "newGts", "=", "current", ".", "redirect", "(", ")", ".", "getGenericsTypes", "(", ")", ";", "if", "(", "newGts", "==", "null", ")", "return", "ret", ";", "ret", ".", "clear", "(", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "spec", ".", "length", ";", "i", "++", ")", "{", "ret", ".", "put", "(", "newGts", "[", "i", "]", ".", "getName", "(", ")", ",", "spec", "[", "i", "]", ")", ";", "}", "}", "return", "ret", ";", "}", "private", "boolean", "moveOptimizedConstantsInitialization", "(", "final", "ClassNode", "node", ")", "{", "if", "(", "node", ".", "isInterface", "(", ")", ")", "return", "false", ";", "final", "int", "mods", "=", "Opcodes", ".", "ACC_STATIC", "|", "Opcodes", ".", "ACC_SYNTHETIC", "|", "Opcodes", ".", "ACC_PUBLIC", ";", "String", "name", "=", "SWAP_INIT", ";", "BlockStatement", "methodCode", "=", "new", "BlockStatement", "(", ")", ";", "node", ".", "addSyntheticMethod", "(", "name", ",", "mods", ",", "ClassHelper", ".", "VOID_TYPE", ",", "Parameter", ".", "EMPTY_ARRAY", ",", "ClassNode", ".", "EMPTY_ARRAY", ",", "methodCode", ")", ";", "methodCode", ".", "addStatement", "(", "new", "BytecodeSequence", "(", "new", "BytecodeInstruction", "(", ")", "{", "@", "Override", "public", "void", "visit", "(", "MethodVisitor", "mv", ")", "{", "final", "String", "classInternalName", "=", "BytecodeHelper", ".", "getClassInternalName", "(", "node", ")", ";", "mv", ".", "visitInsn", "(", "ACONST_NULL", ")", ";", "mv", ".", "visitFieldInsn", "(", "PUTSTATIC", ",", "classInternalName", ",", "\"\"", ",", "\"\"", ")", ";", "}", "}", ")", ")", ";", "for", "(", "FieldNode", "fn", ":", "node", ".", "getFields", "(", ")", ")", "{", "if", "(", "!", "fn", ".", "isStatic", "(", ")", "||", "!", "fn", ".", "isSynthetic", "(", ")", "||", "!", "fn", ".", "getName", "(", ")", ".", "startsWith", "(", "\"$const$\"", ")", ")", "continue", ";", "if", "(", "fn", ".", "getInitialExpression", "(", ")", "==", "null", ")", "continue", ";", "final", "FieldExpression", "fe", "=", "new", "FieldExpression", "(", "fn", ")", ";", "if", "(", "fn", ".", "getType", "(", ")", ".", "equals", "(", "ClassHelper", ".", "REFERENCE_TYPE", ")", ")", "fe", ".", "setUseReferenceDirectly", "(", "true", ")", ";", "ConstantExpression", "init", "=", "(", "ConstantExpression", ")", "fn", ".", "getInitialExpression", "(", ")", ";", "ExpressionStatement", "statement", "=", "new", "ExpressionStatement", "(", "new", "BinaryExpression", "(", "fe", ",", "Token", ".", "newSymbol", "(", "Types", ".", "EQUAL", ",", "fn", ".", "getLineNumber", "(", ")", ",", "fn", ".", "getColumnNumber", "(", ")", ")", ",", "init", ")", ")", ";", "fn", ".", "setInitialValueExpression", "(", "null", ")", ";", "init", ".", "setConstantName", "(", "null", ")", ";", "methodCode", ".", "addStatement", "(", "statement", ")", ";", "}", "return", "true", ";", "}", "public", "static", "ConstantExpression", "transformToPrimitiveConstantIfPossible", "(", "ConstantExpression", "constantExpression", ")", "{", "Object", "value", "=", "constantExpression", ".", "getValue", "(", ")", ";", "if", "(", "value", "==", "null", ")", "return", "constantExpression", ";", "ConstantExpression", "result", ";", "ClassNode", "type", "=", "constantExpression", ".", "getType", "(", ")", ";", "if", "(", "ClassHelper", ".", "isPrimitiveType", "(", "type", ")", ")", "return", "constantExpression", ";", "if", "(", "value", "instanceof", "String", "&&", "(", "(", "String", ")", "value", ")", ".", "length", "(", ")", "==", "1", ")", "{", "result", "=", "new", "ConstantExpression", "(", "(", "(", "String", ")", "value", ")", ".", "charAt", "(", "0", ")", ")", ";", "result", ".", "setType", "(", "ClassHelper", ".", "char_TYPE", ")", ";", "}", "else", "{", "type", "=", "ClassHelper", ".", "getUnwrapper", "(", "type", ")", ";", "result", "=", "new", "ConstantExpression", "(", "value", ",", "true", ")", ";", "result", ".", "setType", "(", "type", ")", ";", "}", "return", "result", ";", "}", "}", "</s>" ]
6,635
[ "<s>", "package", "org", ".", "codehaus", ".", "groovy", ".", "classgen", ";", "import", "static", "java", ".", "lang", ".", "reflect", ".", "Modifier", ".", "isAbstract", ";", "import", "static", "java", ".", "lang", ".", "reflect", ".", "Modifier", ".", "isFinal", ";", "import", "static", "java", ".", "lang", ".", "reflect", ".", "Modifier", ".", "isNative", ";", "import", "static", "java", ".", "lang", ".", "reflect", ".", "Modifier", ".", "isStatic", ";", "import", "static", "java", ".", "lang", ".", "reflect", ".", "Modifier", ".", "isStrict", ";", "import", "static", "java", ".", "lang", ".", "reflect", ".", "Modifier", ".", "isSynchronized", ";", "import", "static", "java", ".", "lang", ".", "reflect", ".", "Modifier", ".", "isTransient", ";", "import", "static", "java", ".", "lang", ".", "reflect", ".", "Modifier", ".", "isVolatile", ";", "import", "java", ".", "util", ".", "List", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "ASTNode", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "ClassCodeVisitorSupport", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "ClassHelper", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "ClassNode", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "ConstructorNode", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "FieldNode", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "InnerClassNode", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "MethodNode", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "Parameter", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "PropertyNode", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "Variable", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "expr", ".", "BinaryExpression", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "expr", ".", "ConstantExpression", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "expr", ".", "DeclarationExpression", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "expr", ".", "Expression", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "expr", ".", "GStringExpression", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "expr", ".", "MapEntryExpression", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "expr", ".", "MethodCallExpression", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "expr", ".", "PropertyExpression", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "expr", ".", "TupleExpression", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "expr", ".", "VariableExpression", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "stmt", ".", "CatchStatement", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "control", ".", "SourceUnit", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "runtime", ".", "MetaClassHelper", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "syntax", ".", "Types", ";", "import", "org", ".", "objectweb", ".", "asm", ".", "Opcodes", ";", "public", "class", "ClassCompletionVerifier", "extends", "ClassCodeVisitorSupport", "implements", "Opcodes", "{", "private", "ClassNode", "currentClass", ";", "private", "SourceUnit", "source", ";", "private", "boolean", "inConstructor", "=", "false", ";", "private", "boolean", "inStaticConstructor", "=", "false", ";", "public", "ClassCompletionVerifier", "(", "SourceUnit", "source", ")", "{", "this", ".", "source", "=", "source", ";", "}", "public", "ClassNode", "getClassNode", "(", ")", "{", "return", "currentClass", ";", "}", "public", "void", "visitClass", "(", "ClassNode", "node", ")", "{", "ClassNode", "oldClass", "=", "currentClass", ";", "currentClass", "=", "node", ";", "checkImplementsAndExtends", "(", "node", ")", ";", "if", "(", "source", "!=", "null", "&&", "!", "source", ".", "getErrorCollector", "(", ")", ".", "hasErrors", "(", ")", ")", "{", "checkClassForIncorrectModifiers", "(", "node", ")", ";", "checkInterfaceMethodVisibility", "(", "node", ")", ";", "checkClassForOverwritingFinal", "(", "node", ")", ";", "checkMethodsForIncorrectModifiers", "(", "node", ")", ";", "checkMethodsForWeakerAccess", "(", "node", ")", ";", "checkMethodsForOverridingFinal", "(", "node", ")", ";", "checkNoAbstractMethodsNonabstractClass", "(", "node", ")", ";", "checkGenericsUsage", "(", "node", ",", "node", ".", "getUnresolvedInterfaces", "(", ")", ")", ";", "checkGenericsUsage", "(", "node", ",", "node", ".", "getUnresolvedSuperClass", "(", ")", ")", ";", "}", "super", ".", "visitClass", "(", "node", ")", ";", "currentClass", "=", "oldClass", ";", "}", "private", "void", "checkInterfaceMethodVisibility", "(", "ClassNode", "node", ")", "{", "if", "(", "!", "node", ".", "isInterface", "(", ")", ")", "return", ";", "for", "(", "MethodNode", "method", ":", "node", ".", "getMethods", "(", ")", ")", "{", "if", "(", "method", ".", "isPrivate", "(", ")", ")", "{", "addError", "(", "\"Method", "'\"", "+", "method", ".", "getName", "(", ")", "+", "\"\"", "+", "getDescription", "(", "currentClass", ")", "+", "\".\"", ",", "method", ")", ";", "}", "else", "if", "(", "method", ".", "isProtected", "(", ")", ")", "{", "addError", "(", "\"Method", "'\"", "+", "method", ".", "getName", "(", ")", "+", "\"\"", "+", "getDescription", "(", "currentClass", ")", "+", "\".\"", ",", "method", ")", ";", "}", "}", "}", "private", "void", "checkNoAbstractMethodsNonabstractClass", "(", "ClassNode", "node", ")", "{", "if", "(", "isAbstract", "(", "node", ".", "getModifiers", "(", ")", ")", ")", "return", ";", "List", "<", "MethodNode", ">", "abstractMethods", "=", "node", ".", "getAbstractMethods", "(", ")", ";", "if", "(", "abstractMethods", "==", "null", ")", "return", ";", "for", "(", "MethodNode", "method", ":", "abstractMethods", ")", "{", "addTypeError", "(", "\"\"", "+", "\"", "The", "\"", "+", "getDescription", "(", "node", ")", "+", "\"\"", "+", "\"", "the", "\"", "+", "getDescription", "(", "method", ")", "+", "\"\"", ",", "node", ")", ";", "}", "}", "private", "void", "checkClassForIncorrectModifiers", "(", "ClassNode", "node", ")", "{", "checkClassForAbstractAndFinal", "(", "node", ")", ";", "checkClassForOtherModifiers", "(", "node", ")", ";", "}", "private", "void", "checkClassForAbstractAndFinal", "(", "ClassNode", "node", ")", "{", "if", "(", "!", "isAbstract", "(", "node", ".", "getModifiers", "(", ")", ")", ")", "return", ";", "if", "(", "!", "isFinal", "(", "node", ".", "getModifiers", "(", ")", ")", ")", "return", ";", "if", "(", "node", ".", "isInterface", "(", ")", ")", "{", "addError", "(", "\"The", "\"", "+", "getDescription", "(", "node", ")", "+", "\"\"", ",", "node", ")", ";", "}", "else", "{", "addError", "(", "\"The", "\"", "+", "getDescription", "(", "node", ")", "+", "\"\"", ",", "node", ")", ";", "}", "}", "private", "void", "checkClassForOtherModifiers", "(", "ClassNode", "node", ")", "{", "checkClassForModifier", "(", "node", ",", "isTransient", "(", "node", ".", "getModifiers", "(", ")", ")", ",", "\"transient\"", ")", ";", "checkClassForModifier", "(", "node", ",", "isVolatile", "(", "node", ".", "getModifiers", "(", ")", ")", ",", "\"volatile\"", ")", ";", "checkClassForModifier", "(", "node", ",", "isNative", "(", "node", ".", "getModifiers", "(", ")", ")", ",", "\"native\"", ")", ";", "if", "(", "!", "(", "node", "instanceof", "InnerClassNode", ")", ")", "{", "checkClassForModifier", "(", "node", ",", "isStatic", "(", "node", ".", "getModifiers", "(", ")", ")", ",", "\"static\"", ")", ";", "}", "}", "private", "void", "checkMethodForModifier", "(", "MethodNode", "node", ",", "boolean", "condition", ",", "String", "modifierName", ")", "{", "if", "(", "!", "condition", ")", "return", ";", "addError", "(", "\"The", "\"", "+", "getDescription", "(", "node", ")", "+", "\"\"", "+", "modifierName", "+", "\".\"", ",", "node", ")", ";", "}", "private", "void", "checkClassForModifier", "(", "ClassNode", "node", ",", "boolean", "condition", ",", "String", "modifierName", ")", "{", "if", "(", "!", "condition", ")", "return", ";", "addError", "(", "\"The", "\"", "+", "getDescription", "(", "node", ")", "+", "\"\"", "+", "modifierName", "+", "\".\"", ",", "node", ")", ";", "}", "private", "String", "getDescription", "(", "ClassNode", "node", ")", "{", "return", "(", "node", ".", "isInterface", "(", ")", "?", "\"interface\"", ":", "\"class\"", ")", "+", "\"", "'\"", "+", "node", ".", "getName", "(", ")", "+", "\"'\"", ";", "}", "private", "String", "getDescription", "(", "MethodNode", "node", ")", "{", "return", "\"method", "'\"", "+", "node", ".", "getTypeDescriptor", "(", ")", "+", "\"'\"", ";", "}", "private", "String", "getDescription", "(", "FieldNode", "node", ")", "{", "return", "\"field", "'\"", "+", "node", ".", "getName", "(", ")", "+", "\"'\"", ";", "}", "private", "void", "checkAbstractDeclaration", "(", "MethodNode", "methodNode", ")", "{", "if", "(", "!", "methodNode", ".", "isAbstract", "(", ")", ")", "return", ";", "if", "(", "isAbstract", "(", "currentClass", ".", "getModifiers", "(", ")", ")", ")", "return", ";", "addError", "(", "\"\"", "+", "\"", "The", "\"", "+", "getDescription", "(", "currentClass", ")", "+", "\"\"", "+", "methodNode", ".", "getTypeDescriptor", "(", ")", "+", "\"\"", ",", "methodNode", ")", ";", "}", "private", "void", "checkClassForOverwritingFinal", "(", "ClassNode", "cn", ")", "{", "ClassNode", "superCN", "=", "cn", ".", "getSuperClass", "(", ")", ";", "if", "(", "superCN", "==", "null", ")", "return", ";", "if", "(", "!", "isFinal", "(", "superCN", ".", "getModifiers", "(", ")", ")", ")", "return", ";", "StringBuilder", "msg", "=", "new", "StringBuilder", "(", ")", ";", "msg", ".", "append", "(", "\"\"", ")", ";", "msg", ".", "append", "(", "getDescription", "(", "superCN", ")", ")", ";", "msg", ".", "append", "(", "\".\"", ")", ";", "addError", "(", "msg", ".", "toString", "(", ")", ",", "cn", ")", ";", "}", "private", "void", "checkImplementsAndExtends", "(", "ClassNode", "node", ")", "{", "ClassNode", "cn", "=", "node", ".", "getSuperClass", "(", ")", ";", "if", "(", "cn", ".", "isInterface", "(", ")", "&&", "!", "node", ".", "isInterface", "(", ")", ")", "{", "addTypeError", "(", "\"\"", "+", "getDescription", "(", "cn", ")", "+", "\"\"", ",", "node", ")", ";", "}", "for", "(", "ClassNode", "anInterface", ":", "node", ".", "getInterfaces", "(", ")", ")", "{", "cn", "=", "anInterface", ";", "if", "(", "!", "cn", ".", "isInterface", "(", ")", ")", "{", "addTypeError", "(", "\"\"", "+", "getDescription", "(", "cn", ")", "+", "\"\"", ",", "node", ")", ";", "}", "}", "}", "private", "void", "checkMethodsForIncorrectModifiers", "(", "ClassNode", "cn", ")", "{", "if", "(", "!", "cn", ".", "isInterface", "(", ")", ")", "return", ";", "for", "(", "MethodNode", "method", ":", "cn", ".", "getMethods", "(", ")", ")", "{", "if", "(", "isFinal", "(", "method", ".", "getModifiers", "(", ")", ")", ")", "{", "addError", "(", "\"The", "\"", "+", "getDescription", "(", "method", ")", "+", "\"", "from", "\"", "+", "getDescription", "(", "cn", ")", "+", "\"\"", ",", "method", ")", ";", "}", "if", "(", "method", ".", "isStatic", "(", ")", "&&", "!", "isConstructor", "(", "method", ")", ")", "{", "addError", "(", "\"The", "\"", "+", "getDescription", "(", "method", ")", "+", "\"", "from", "\"", "+", "getDescription", "(", "cn", ")", "+", "\"\"", ",", "method", ")", ";", "}", "}", "}", "private", "void", "checkMethodsForWeakerAccess", "(", "ClassNode", "cn", ")", "{", "for", "(", "MethodNode", "method", ":", "cn", ".", "getMethods", "(", ")", ")", "{", "checkMethodForWeakerAccessPrivileges", "(", "method", ",", "cn", ")", ";", "}", "}", "private", "boolean", "isConstructor", "(", "MethodNode", "method", ")", "{", "return", "method", ".", "getName", "(", ")", ".", "equals", "(", "\"<clinit>\"", ")", ";", "}", "private", "void", "checkMethodsForOverridingFinal", "(", "ClassNode", "cn", ")", "{", "for", "(", "MethodNode", "method", ":", "cn", ".", "getMethods", "(", ")", ")", "{", "Parameter", "[", "]", "params", "=", "method", ".", "getParameters", "(", ")", ";", "for", "(", "MethodNode", "superMethod", ":", "cn", ".", "getSuperClass", "(", ")", ".", "getMethods", "(", "method", ".", "getName", "(", ")", ")", ")", "{", "Parameter", "[", "]", "superParams", "=", "superMethod", ".", "getParameters", "(", ")", ";", "if", "(", "!", "hasEqualParameterTypes", "(", "params", ",", "superParams", ")", ")", "continue", ";", "if", "(", "!", "isFinal", "(", "superMethod", ".", "getModifiers", "(", ")", ")", ")", "break", ";", "addInvalidUseOfFinalError", "(", "method", ",", "params", ",", "superMethod", ".", "getDeclaringClass", "(", ")", ")", ";", "return", ";", "}", "}", "}", "private", "void", "addInvalidUseOfFinalError", "(", "MethodNode", "method", ",", "Parameter", "[", "]", "parameters", ",", "ClassNode", "superCN", ")", "{", "StringBuilder", "msg", "=", "new", "StringBuilder", "(", ")", ";", "msg", ".", "append", "(", "\"\"", ")", ".", "append", "(", "method", ".", "getName", "(", ")", ")", ";", "msg", ".", "append", "(", "\"(\"", ")", ";", "boolean", "needsComma", "=", "false", ";", "for", "(", "Parameter", "parameter", ":", "parameters", ")", "{", "if", "(", "needsComma", ")", "{", "msg", ".", "append", "(", "\",\"", ")", ";", "}", "else", "{", "needsComma", "=", "true", ";", "}", "msg", ".", "append", "(", "parameter", ".", "getType", "(", ")", ")", ";", "}", "msg", ".", "append", "(", "\")", "from", "\"", ")", ".", "append", "(", "getDescription", "(", "superCN", ")", ")", ";", "msg", ".", "append", "(", "\".\"", ")", ";", "addError", "(", "msg", ".", "toString", "(", ")", ",", "method", ")", ";", "}", "private", "void", "addWeakerAccessError", "(", "ClassNode", "cn", ",", "MethodNode", "method", ",", "Parameter", "[", "]", "parameters", ",", "MethodNode", "superMethod", ")", "{", "StringBuilder", "msg", "=", "new", "StringBuilder", "(", ")", ";", "msg", ".", "append", "(", "method", ".", "getName", "(", ")", ")", ";", "msg", ".", "append", "(", "\"(\"", ")", ";", "boolean", "needsComma", "=", "false", ";", "for", "(", "Parameter", "parameter", ":", "parameters", ")", "{", "if", "(", "needsComma", ")", "{", "msg", ".", "append", "(", "\",\"", ")", ";", "}", "else", "{", "needsComma", "=", "true", ";", "}", "msg", ".", "append", "(", "parameter", ".", "getType", "(", ")", ")", ";", "}", "msg", ".", "append", "(", "\")", "in", "\"", ")", ";", "msg", ".", "append", "(", "cn", ".", "getName", "(", ")", ")", ";", "msg", ".", "append", "(", "\"\"", ")", ";", "msg", ".", "append", "(", "superMethod", ".", "getName", "(", ")", ")", ";", "msg", ".", "append", "(", "\"", "in", "\"", ")", ";", "msg", ".", "append", "(", "superMethod", ".", "getDeclaringClass", "(", ")", ".", "getName", "(", ")", ")", ";", "msg", ".", "append", "(", "\"\"", ")", ";", "msg", ".", "append", "(", "superMethod", ".", "isPublic", "(", ")", "?", "\"public\"", ":", "\"protected\"", ")", ";", "addError", "(", "msg", ".", "toString", "(", ")", ",", "method", ")", ";", "}", "private", "boolean", "hasEqualParameterTypes", "(", "Parameter", "[", "]", "first", ",", "Parameter", "[", "]", "second", ")", "{", "if", "(", "first", ".", "length", "!=", "second", ".", "length", ")", "return", "false", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "first", ".", "length", ";", "i", "++", ")", "{", "String", "ft", "=", "first", "[", "i", "]", ".", "getType", "(", ")", ".", "getName", "(", ")", ";", "String", "st", "=", "second", "[", "i", "]", ".", "getType", "(", ")", ".", "getName", "(", ")", ";", "if", "(", "ft", ".", "equals", "(", "st", ")", ")", "continue", ";", "return", "false", ";", "}", "return", "true", ";", "}", "protected", "SourceUnit", "getSourceUnit", "(", ")", "{", "return", "source", ";", "}", "public", "void", "visitMethod", "(", "MethodNode", "node", ")", "{", "inConstructor", "=", "false", ";", "inStaticConstructor", "=", "node", ".", "isStaticConstructor", "(", ")", ";", "checkAbstractDeclaration", "(", "node", ")", ";", "checkRepetitiveMethod", "(", "node", ")", ";", "checkOverloadingPrivateAndPublic", "(", "node", ")", ";", "checkMethodModifiers", "(", "node", ")", ";", "checkGenericsUsage", "(", "node", ",", "node", ".", "getParameters", "(", ")", ")", ";", "checkGenericsUsage", "(", "node", ",", "node", ".", "getReturnType", "(", ")", ")", ";", "super", ".", "visitMethod", "(", "node", ")", ";", "}", "private", "void", "checkMethodModifiers", "(", "MethodNode", "node", ")", "{", "if", "(", "(", "this", ".", "currentClass", ".", "getModifiers", "(", ")", "&", "ACC_INTERFACE", ")", "!=", "0", ")", "{", "checkMethodForModifier", "(", "node", ",", "isStrict", "(", "node", ".", "getModifiers", "(", ")", ")", ",", "\"strictfp\"", ")", ";", "checkMethodForModifier", "(", "node", ",", "isSynchronized", "(", "node", ".", "getModifiers", "(", ")", ")", ",", "\"synchronized\"", ")", ";", "checkMethodForModifier", "(", "node", ",", "isNative", "(", "node", ".", "getModifiers", "(", ")", ")", ",", "\"native\"", ")", ";", "}", "}", "private", "void", "checkMethodForWeakerAccessPrivileges", "(", "MethodNode", "mn", ",", "ClassNode", "cn", ")", "{", "Parameter", "[", "]", "params", "=", "mn", ".", "getParameters", "(", ")", ";", "for", "(", "MethodNode", "superMethod", ":", "cn", ".", "getSuperClass", "(", ")", ".", "getMethods", "(", "mn", ".", "getName", "(", ")", ")", ")", "{", "Parameter", "[", "]", "superParams", "=", "superMethod", ".", "getParameters", "(", ")", ";", "if", "(", "!", "hasEqualParameterTypes", "(", "params", ",", "superParams", ")", ")", "continue", ";", "if", "(", "(", "mn", ".", "isPrivate", "(", ")", "&&", "!", "superMethod", ".", "isPrivate", "(", ")", ")", "||", "(", "mn", ".", "isProtected", "(", ")", "&&", "superMethod", ".", "isPublic", "(", ")", ")", ")", "{", "addWeakerAccessError", "(", "cn", ",", "mn", ",", "params", ",", "superMethod", ")", ";", "return", ";", "}", "}", "}", "private", "void", "checkOverloadingPrivateAndPublic", "(", "MethodNode", "node", ")", "{", "if", "(", "isConstructor", "(", "node", ")", ")", "return", ";", "boolean", "hasPrivate", "=", "false", ";", "boolean", "hasPublic", "=", "false", ";", "for", "(", "MethodNode", "method", ":", "currentClass", ".", "getMethods", "(", "node", ".", "getName", "(", ")", ")", ")", "{", "if", "(", "method", "==", "node", ")", "continue", ";", "if", "(", "!", "method", ".", "getDeclaringClass", "(", ")", ".", "equals", "(", "node", ".", "getDeclaringClass", "(", ")", ")", ")", "continue", ";", "if", "(", "method", ".", "isPublic", "(", ")", "||", "method", ".", "isProtected", "(", ")", ")", "{", "hasPublic", "=", "true", ";", "}", "else", "{", "hasPrivate", "=", "true", ";", "}", "}", "if", "(", "hasPrivate", "&&", "hasPublic", ")", "{", "addError", "(", "\"\"", ",", "node", ")", ";", "}", "}", "private", "void", "checkRepetitiveMethod", "(", "MethodNode", "node", ")", "{", "if", "(", "isConstructor", "(", "node", ")", ")", "return", ";", "for", "(", "MethodNode", "method", ":", "currentClass", ".", "getMethods", "(", "node", ".", "getName", "(", ")", ")", ")", "{", "if", "(", "method", "==", "node", ")", "continue", ";", "if", "(", "!", "method", ".", "getDeclaringClass", "(", ")", ".", "equals", "(", "node", ".", "getDeclaringClass", "(", ")", ")", ")", "continue", ";", "Parameter", "[", "]", "p1", "=", "node", ".", "getParameters", "(", ")", ";", "Parameter", "[", "]", "p2", "=", "method", ".", "getParameters", "(", ")", ";", "if", "(", "p1", ".", "length", "!=", "p2", ".", "length", ")", "continue", ";", "addErrorIfParamsAndReturnTypeEqual", "(", "p2", ",", "p1", ",", "node", ",", "method", ")", ";", "}", "}", "private", "void", "addErrorIfParamsAndReturnTypeEqual", "(", "Parameter", "[", "]", "p2", ",", "Parameter", "[", "]", "p1", ",", "MethodNode", "node", ",", "MethodNode", "element", ")", "{", "boolean", "isEqual", "=", "true", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "p2", ".", "length", ";", "i", "++", ")", "{", "isEqual", "&=", "p1", "[", "i", "]", ".", "getType", "(", ")", ".", "equals", "(", "p2", "[", "i", "]", ".", "getType", "(", ")", ")", ";", "}", "isEqual", "&=", "node", ".", "getReturnType", "(", ")", ".", "equals", "(", "element", ".", "getReturnType", "(", ")", ")", ";", "if", "(", "isEqual", ")", "{", "addError", "(", "\"\"", "+", "getDescription", "(", "node", ")", "+", "\"", "in", "\"", "+", "getDescription", "(", "currentClass", ")", "+", "\".\"", ",", "node", ")", ";", "}", "}", "public", "void", "visitField", "(", "FieldNode", "node", ")", "{", "if", "(", "currentClass", ".", "getDeclaredField", "(", "node", ".", "getName", "(", ")", ")", "!=", "node", ")", "{", "addError", "(", "\"The", "\"", "+", "getDescription", "(", "node", ")", "+", "\"\"", ",", "node", ")", ";", "}", "checkInterfaceFieldModifiers", "(", "node", ")", ";", "checkGenericsUsage", "(", "node", ",", "node", ".", "getType", "(", ")", ")", ";", "super", ".", "visitField", "(", "node", ")", ";", "}", "public", "void", "visitProperty", "(", "PropertyNode", "node", ")", "{", "checkDuplicateProperties", "(", "node", ")", ";", "checkGenericsUsage", "(", "node", ",", "node", ".", "getType", "(", ")", ")", ";", "super", ".", "visitProperty", "(", "node", ")", ";", "}", "private", "void", "checkDuplicateProperties", "(", "PropertyNode", "node", ")", "{", "ClassNode", "cn", "=", "node", ".", "getDeclaringClass", "(", ")", ";", "String", "name", "=", "node", ".", "getName", "(", ")", ";", "String", "getterName", "=", "\"get\"", "+", "MetaClassHelper", ".", "capitalize", "(", "name", ")", ";", "if", "(", "Character", ".", "isUpperCase", "(", "name", ".", "charAt", "(", "0", ")", ")", ")", "{", "for", "(", "PropertyNode", "propNode", ":", "cn", ".", "getProperties", "(", ")", ")", "{", "String", "otherName", "=", "propNode", ".", "getField", "(", ")", ".", "getName", "(", ")", ";", "String", "otherGetterName", "=", "\"get\"", "+", "MetaClassHelper", ".", "capitalize", "(", "otherName", ")", ";", "if", "(", "node", "!=", "propNode", "&&", "getterName", ".", "equals", "(", "otherGetterName", ")", ")", "{", "String", "msg", "=", "\"The", "field", "\"", "+", "name", "+", "\"", "and", "\"", "+", "otherName", "+", "\"\"", "+", "cn", ".", "getName", "(", ")", "+", "\"\"", ";", "addError", "(", "msg", ",", "node", ")", ";", "}", "}", "}", "}", "private", "void", "checkInterfaceFieldModifiers", "(", "FieldNode", "node", ")", "{", "if", "(", "!", "currentClass", ".", "isInterface", "(", ")", ")", "return", ";", "if", "(", "(", "node", ".", "getModifiers", "(", ")", "&", "(", "ACC_PUBLIC", "|", "ACC_STATIC", "|", "ACC_FINAL", ")", ")", "==", "0", "||", "(", "node", ".", "getModifiers", "(", ")", "&", "(", "ACC_PRIVATE", "|", "ACC_PROTECTED", ")", ")", "!=", "0", ")", "{", "addError", "(", "\"The", "\"", "+", "getDescription", "(", "node", ")", "+", "\"\"", "+", "getDescription", "(", "currentClass", ")", "+", "\".\"", ",", "node", ")", ";", "}", "}", "public", "void", "visitBinaryExpression", "(", "BinaryExpression", "expression", ")", "{", "if", "(", "expression", ".", "getOperation", "(", ")", ".", "getType", "(", ")", "==", "Types", ".", "LEFT_SQUARE_BRACKET", "&&", "expression", ".", "getRightExpression", "(", ")", "instanceof", "MapEntryExpression", ")", "{", "addError", "(", "\"\"", "+", "\"\"", ",", "expression", ".", "getRightExpression", "(", ")", ")", ";", "}", "super", ".", "visitBinaryExpression", "(", "expression", ")", ";", "switch", "(", "expression", ".", "getOperation", "(", ")", ".", "getType", "(", ")", ")", "{", "case", "Types", ".", "EQUAL", ":", "case", "Types", ".", "BITWISE_AND_EQUAL", ":", "case", "Types", ".", "BITWISE_OR_EQUAL", ":", "case", "Types", ".", "BITWISE_XOR_EQUAL", ":", "case", "Types", ".", "PLUS_EQUAL", ":", "case", "Types", ".", "MINUS_EQUAL", ":", "case", "Types", ".", "MULTIPLY_EQUAL", ":", "case", "Types", ".", "DIVIDE_EQUAL", ":", "case", "Types", ".", "INTDIV_EQUAL", ":", "case", "Types", ".", "MOD_EQUAL", ":", "case", "Types", ".", "POWER_EQUAL", ":", "case", "Types", ".", "LEFT_SHIFT_EQUAL", ":", "case", "Types", ".", "RIGHT_SHIFT_EQUAL", ":", "case", "Types", ".", "RIGHT_SHIFT_UNSIGNED_EQUAL", ":", "checkFinalFieldAccess", "(", "expression", ".", "getLeftExpression", "(", ")", ")", ";", "break", ";", "default", ":", "break", ";", "}", "}", "private", "void", "checkFinalFieldAccess", "(", "Expression", "expression", ")", "{", "if", "(", "!", "(", "expression", "instanceof", "VariableExpression", ")", "&&", "!", "(", "expression", "instanceof", "PropertyExpression", ")", ")", "return", ";", "Variable", "v", "=", "null", ";", "if", "(", "expression", "instanceof", "VariableExpression", ")", "{", "VariableExpression", "ve", "=", "(", "VariableExpression", ")", "expression", ";", "v", "=", "ve", ".", "getAccessedVariable", "(", ")", ";", "}", "else", "{", "PropertyExpression", "propExp", "=", "(", "(", "PropertyExpression", ")", "expression", ")", ";", "Expression", "objectExpression", "=", "propExp", ".", "getObjectExpression", "(", ")", ";", "if", "(", "objectExpression", "instanceof", "VariableExpression", ")", "{", "VariableExpression", "varExp", "=", "(", "VariableExpression", ")", "objectExpression", ";", "if", "(", "varExp", ".", "isThisExpression", "(", ")", ")", "{", "v", "=", "currentClass", ".", "getDeclaredField", "(", "propExp", ".", "getPropertyAsString", "(", ")", ")", ";", "}", "}", "}", "if", "(", "v", "instanceof", "FieldNode", ")", "{", "FieldNode", "fn", "=", "(", "FieldNode", ")", "v", ";", "boolean", "isFinal", "=", "fn", ".", "isFinal", "(", ")", ";", "boolean", "isStatic", "=", "fn", ".", "isStatic", "(", ")", ";", "boolean", "error", "=", "isFinal", "&&", "(", "(", "isStatic", "&&", "!", "inStaticConstructor", ")", "||", "(", "!", "isStatic", "&&", "!", "inConstructor", ")", ")", ";", "if", "(", "error", ")", "addError", "(", "\"\"", "+", "(", "isStatic", "?", "\"", "static\"", ":", "\"\"", ")", "+", "\"\"", "+", "fn", ".", "getName", "(", ")", "+", "\"\"", "+", "(", "isStatic", "?", "\"\"", ":", "\"constructor.\"", ")", ",", "expression", ")", ";", "}", "}", "public", "void", "visitConstructor", "(", "ConstructorNode", "node", ")", "{", "inConstructor", "=", "true", ";", "inStaticConstructor", "=", "node", ".", "isStaticConstructor", "(", ")", ";", "checkGenericsUsage", "(", "node", ",", "node", ".", "getParameters", "(", ")", ")", ";", "super", ".", "visitConstructor", "(", "node", ")", ";", "}", "public", "void", "visitCatchStatement", "(", "CatchStatement", "cs", ")", "{", "if", "(", "!", "(", "cs", ".", "getExceptionType", "(", ")", ".", "isDerivedFrom", "(", "ClassHelper", ".", "make", "(", "Throwable", ".", "class", ")", ")", ")", ")", "{", "addError", "(", "\"\"", ",", "cs", ")", ";", "}", "super", ".", "visitCatchStatement", "(", "cs", ")", ";", "}", "public", "void", "visitMethodCallExpression", "(", "MethodCallExpression", "mce", ")", "{", "super", ".", "visitMethodCallExpression", "(", "mce", ")", ";", "Expression", "aexp", "=", "mce", ".", "getArguments", "(", ")", ";", "if", "(", "aexp", "instanceof", "TupleExpression", ")", "{", "TupleExpression", "arguments", "=", "(", "TupleExpression", ")", "aexp", ";", "for", "(", "Expression", "e", ":", "arguments", ".", "getExpressions", "(", ")", ")", "{", "checkForInvalidDeclaration", "(", "e", ")", ";", "}", "}", "else", "{", "checkForInvalidDeclaration", "(", "aexp", ")", ";", "}", "}", "@", "Override", "public", "void", "visitDeclarationExpression", "(", "DeclarationExpression", "expression", ")", "{", "super", ".", "visitDeclarationExpression", "(", "expression", ")", ";", "if", "(", "expression", ".", "isMultipleAssignmentDeclaration", "(", ")", ")", "return", ";", "checkInvalidDeclarationModifier", "(", "expression", ",", "ACC_ABSTRACT", ",", "\"abstract\"", ")", ";", "checkInvalidDeclarationModifier", "(", "expression", ",", "ACC_NATIVE", ",", "\"native\"", ")", ";", "checkInvalidDeclarationModifier", "(", "expression", ",", "ACC_PRIVATE", ",", "\"private\"", ")", ";", "checkInvalidDeclarationModifier", "(", "expression", ",", "ACC_PROTECTED", ",", "\"protected\"", ")", ";", "checkInvalidDeclarationModifier", "(", "expression", ",", "ACC_PUBLIC", ",", "\"public\"", ")", ";", "checkInvalidDeclarationModifier", "(", "expression", ",", "ACC_STATIC", ",", "\"static\"", ")", ";", "checkInvalidDeclarationModifier", "(", "expression", ",", "ACC_STRICT", ",", "\"strictfp\"", ")", ";", "checkInvalidDeclarationModifier", "(", "expression", ",", "ACC_SYNCHRONIZED", ",", "\"synchronized\"", ")", ";", "checkInvalidDeclarationModifier", "(", "expression", ",", "ACC_TRANSIENT", ",", "\"transient\"", ")", ";", "checkInvalidDeclarationModifier", "(", "expression", ",", "ACC_VOLATILE", ",", "\"volatile\"", ")", ";", "}", "private", "void", "checkInvalidDeclarationModifier", "(", "DeclarationExpression", "expression", ",", "int", "modifier", ",", "String", "modName", ")", "{", "if", "(", "(", "expression", ".", "getVariableExpression", "(", ")", ".", "getModifiers", "(", ")", "&", "modifier", ")", "!=", "0", ")", "{", "addError", "(", "\"Modifier", "'\"", "+", "modName", "+", "\"\"", ",", "expression", ")", ";", "}", "}", "private", "void", "checkForInvalidDeclaration", "(", "Expression", "exp", ")", "{", "if", "(", "!", "(", "exp", "instanceof", "DeclarationExpression", ")", ")", "return", ";", "addError", "(", "\"\"", ",", "exp", ")", ";", "}", "public", "void", "visitConstantExpression", "(", "ConstantExpression", "expression", ")", "{", "super", ".", "visitConstantExpression", "(", "expression", ")", ";", "checkStringExceedingMaximumLength", "(", "expression", ")", ";", "}", "public", "void", "visitGStringExpression", "(", "GStringExpression", "expression", ")", "{", "super", ".", "visitGStringExpression", "(", "expression", ")", ";", "for", "(", "ConstantExpression", "ce", ":", "expression", ".", "getStrings", "(", ")", ")", "{", "checkStringExceedingMaximumLength", "(", "ce", ")", ";", "}", "}", "private", "void", "checkStringExceedingMaximumLength", "(", "ConstantExpression", "expression", ")", "{", "Object", "value", "=", "expression", ".", "getValue", "(", ")", ";", "if", "(", "value", "instanceof", "String", ")", "{", "String", "s", "=", "(", "String", ")", "value", ";", "if", "(", "s", ".", "length", "(", ")", ">", "65535", ")", "{", "addError", "(", "\"\"", "+", "s", ".", "length", "(", ")", "+", "\"\"", ",", "expression", ")", ";", "}", "}", "}", "private", "void", "checkGenericsUsage", "(", "ASTNode", "ref", ",", "ClassNode", "[", "]", "nodes", ")", "{", "for", "(", "ClassNode", "node", ":", "nodes", ")", "{", "checkGenericsUsage", "(", "ref", ",", "node", ")", ";", "}", "}", "private", "void", "checkGenericsUsage", "(", "ASTNode", "ref", ",", "Parameter", "[", "]", "params", ")", "{", "for", "(", "Parameter", "p", ":", "params", ")", "{", "checkGenericsUsage", "(", "ref", ",", "p", ".", "getType", "(", ")", ")", ";", "}", "}", "private", "void", "checkGenericsUsage", "(", "ASTNode", "ref", ",", "ClassNode", "node", ")", "{", "if", "(", "node", ".", "isArray", "(", ")", ")", "{", "checkGenericsUsage", "(", "ref", ",", "node", ".", "getComponentType", "(", ")", ")", ";", "}", "else", "if", "(", "!", "node", ".", "isRedirectNode", "(", ")", "&&", "node", ".", "isUsingGenerics", "(", ")", ")", "{", "addError", "(", "\"\"", "+", "node", "+", "\"", "\"", "+", "\"for", "\"", "+", "getRefDescriptor", "(", "ref", ")", "+", "\"\"", "+", "\"\"", "+", "\"\"", "+", "\"\"", "+", "\"\"", "+", "\"\"", "+", "\"transform.\"", ",", "ref", ")", ";", "}", "}", "private", "String", "getRefDescriptor", "(", "ASTNode", "ref", ")", "{", "if", "(", "ref", "instanceof", "FieldNode", ")", "{", "FieldNode", "f", "=", "(", "FieldNode", ")", "ref", ";", "return", "\"the", "field", "\"", "+", "f", ".", "getName", "(", ")", "+", "\"", "\"", ";", "}", "else", "if", "(", "ref", "instanceof", "PropertyNode", ")", "{", "PropertyNode", "p", "=", "(", "PropertyNode", ")", "ref", ";", "return", "\"\"", "+", "p", ".", "getName", "(", ")", "+", "\"", "\"", ";", "}", "else", "if", "(", "ref", "instanceof", "ConstructorNode", ")", "{", "return", "\"\"", "+", "ref", ".", "getText", "(", ")", "+", "\"", "\"", ";", "}", "else", "if", "(", "ref", "instanceof", "MethodNode", ")", "{", "return", "\"the", "method", "\"", "+", "ref", ".", "getText", "(", ")", "+", "\"", "\"", ";", "}", "else", "if", "(", "ref", "instanceof", "ClassNode", ")", "{", "return", "\"\"", "+", "ref", "+", "\"", "\"", ";", "}", "return", "\"\"", "+", "ref", ".", "getClass", "(", ")", "+", "\">", "\"", ";", "}", "}", "</s>" ]
6,636
[ "<s>", "package", "org", ".", "codehaus", ".", "groovy", ".", "classgen", ";", "import", "groovy", ".", "lang", ".", "GroovyRuntimeException", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "GroovyBugError", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "*", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "expr", ".", "*", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "stmt", ".", "*", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "classgen", ".", "asm", ".", "*", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "control", ".", "SourceUnit", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "runtime", ".", "MetaClassHelper", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "runtime", ".", "ScriptBytecodeAdapter", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "syntax", ".", "RuntimeParserException", ";", "import", "org", ".", "objectweb", ".", "asm", ".", "AnnotationVisitor", ";", "import", "org", ".", "objectweb", ".", "asm", ".", "*", ";", "import", "java", ".", "lang", ".", "reflect", ".", "Modifier", ";", "import", "java", ".", "util", ".", "*", ";", "public", "class", "AsmClassGenerator", "extends", "ClassGenerator", "{", "private", "final", "ClassVisitor", "cv", ";", "private", "GeneratorContext", "context", ";", "private", "String", "sourceFile", ";", "static", "final", "MethodCallerMultiAdapter", "setField", "=", "MethodCallerMultiAdapter", ".", "newStatic", "(", "ScriptBytecodeAdapter", ".", "class", ",", "\"setField\"", ",", "false", ",", "false", ")", ";", "static", "final", "MethodCallerMultiAdapter", "getField", "=", "MethodCallerMultiAdapter", ".", "newStatic", "(", "ScriptBytecodeAdapter", ".", "class", ",", "\"getField\"", ",", "false", ",", "false", ")", ";", "static", "final", "MethodCallerMultiAdapter", "setGroovyObjectField", "=", "MethodCallerMultiAdapter", ".", "newStatic", "(", "ScriptBytecodeAdapter", ".", "class", ",", "\"\"", ",", "false", ",", "false", ")", ";", "static", "final", "MethodCallerMultiAdapter", "getGroovyObjectField", "=", "MethodCallerMultiAdapter", ".", "newStatic", "(", "ScriptBytecodeAdapter", ".", "class", ",", "\"\"", ",", "false", ",", "false", ")", ";", "static", "final", "MethodCallerMultiAdapter", "setFieldOnSuper", "=", "MethodCallerMultiAdapter", ".", "newStatic", "(", "ScriptBytecodeAdapter", ".", "class", ",", "\"\"", ",", "false", ",", "false", ")", ";", "static", "final", "MethodCallerMultiAdapter", "getFieldOnSuper", "=", "MethodCallerMultiAdapter", ".", "newStatic", "(", "ScriptBytecodeAdapter", ".", "class", ",", "\"\"", ",", "false", ",", "false", ")", ";", "public", "static", "final", "MethodCallerMultiAdapter", "setProperty", "=", "MethodCallerMultiAdapter", ".", "newStatic", "(", "ScriptBytecodeAdapter", ".", "class", ",", "\"setProperty\"", ",", "false", ",", "false", ")", ";", "static", "final", "MethodCallerMultiAdapter", "getProperty", "=", "MethodCallerMultiAdapter", ".", "newStatic", "(", "ScriptBytecodeAdapter", ".", "class", ",", "\"getProperty\"", ",", "false", ",", "false", ")", ";", "static", "final", "MethodCallerMultiAdapter", "setGroovyObjectProperty", "=", "MethodCallerMultiAdapter", ".", "newStatic", "(", "ScriptBytecodeAdapter", ".", "class", ",", "\"\"", ",", "false", ",", "false", ")", ";", "static", "final", "MethodCallerMultiAdapter", "getGroovyObjectProperty", "=", "MethodCallerMultiAdapter", ".", "newStatic", "(", "ScriptBytecodeAdapter", ".", "class", ",", "\"\"", ",", "false", ",", "false", ")", ";", "static", "final", "MethodCallerMultiAdapter", "setPropertyOnSuper", "=", "MethodCallerMultiAdapter", ".", "newStatic", "(", "ScriptBytecodeAdapter", ".", "class", ",", "\"\"", ",", "false", ",", "false", ")", ";", "static", "final", "MethodCallerMultiAdapter", "getPropertyOnSuper", "=", "MethodCallerMultiAdapter", ".", "newStatic", "(", "ScriptBytecodeAdapter", ".", "class", ",", "\"\"", ",", "false", ",", "false", ")", ";", "static", "final", "MethodCaller", "spreadMap", "=", "MethodCaller", ".", "newStatic", "(", "ScriptBytecodeAdapter", ".", "class", ",", "\"spreadMap\"", ")", ";", "static", "final", "MethodCaller", "despreadList", "=", "MethodCaller", ".", "newStatic", "(", "ScriptBytecodeAdapter", ".", "class", ",", "\"despreadList\"", ")", ";", "static", "final", "MethodCaller", "getMethodPointer", "=", "MethodCaller", ".", "newStatic", "(", "ScriptBytecodeAdapter", ".", "class", ",", "\"\"", ")", ";", "static", "final", "MethodCaller", "unaryPlus", "=", "MethodCaller", ".", "newStatic", "(", "ScriptBytecodeAdapter", ".", "class", ",", "\"unaryPlus\"", ")", ";", "static", "final", "MethodCaller", "unaryMinus", "=", "MethodCaller", ".", "newStatic", "(", "ScriptBytecodeAdapter", ".", "class", ",", "\"unaryMinus\"", ")", ";", "static", "final", "MethodCaller", "bitwiseNegate", "=", "MethodCaller", ".", "newStatic", "(", "ScriptBytecodeAdapter", ".", "class", ",", "\"\"", ")", ";", "static", "final", "MethodCaller", "createListMethod", "=", "MethodCaller", ".", "newStatic", "(", "ScriptBytecodeAdapter", ".", "class", ",", "\"createList\"", ")", ";", "static", "final", "MethodCaller", "createMapMethod", "=", "MethodCaller", ".", "newStatic", "(", "ScriptBytecodeAdapter", ".", "class", ",", "\"createMap\"", ")", ";", "static", "final", "MethodCaller", "createRangeMethod", "=", "MethodCaller", ".", "newStatic", "(", "ScriptBytecodeAdapter", ".", "class", ",", "\"createRange\"", ")", ";", "static", "final", "MethodCaller", "createPojoWrapperMethod", "=", "MethodCaller", ".", "newStatic", "(", "ScriptBytecodeAdapter", ".", "class", ",", "\"\"", ")", ";", "static", "final", "MethodCaller", "createGroovyObjectWrapperMethod", "=", "MethodCaller", ".", "newStatic", "(", "ScriptBytecodeAdapter", ".", "class", ",", "\"\"", ")", ";", "static", "final", "MethodCaller", "selectConstructorAndTransformArguments", "=", "MethodCaller", ".", "newStatic", "(", "ScriptBytecodeAdapter", ".", "class", ",", "\"\"", ")", ";", "private", "Map", "<", "String", ",", "ClassNode", ">", "referencedClasses", "=", "new", "HashMap", "<", "String", ",", "ClassNode", ">", "(", ")", ";", "private", "boolean", "passingParams", ";", "public", "static", "final", "boolean", "CREATE_DEBUG_INFO", "=", "true", ";", "public", "static", "final", "boolean", "CREATE_LINE_NUMBER_INFO", "=", "true", ";", "public", "static", "final", "boolean", "ASM_DEBUG", "=", "false", ";", "private", "int", "lineNumber", "=", "-", "1", ";", "private", "ASTNode", "currentASTNode", "=", "null", ";", "private", "Map", "genericParameterNames", "=", "null", ";", "private", "SourceUnit", "source", ";", "private", "WriterController", "controller", ";", "public", "AsmClassGenerator", "(", "SourceUnit", "source", ",", "GeneratorContext", "context", ",", "ClassVisitor", "classVisitor", ",", "String", "sourceFile", ")", "{", "this", ".", "source", "=", "source", ";", "this", ".", "context", "=", "context", ";", "this", ".", "cv", "=", "classVisitor", ";", "this", ".", "sourceFile", "=", "sourceFile", ";", "genericParameterNames", "=", "new", "HashMap", "(", ")", ";", "}", "public", "SourceUnit", "getSourceUnit", "(", ")", "{", "return", "source", ";", "}", "public", "void", "visitClass", "(", "ClassNode", "classNode", ")", "{", "referencedClasses", ".", "clear", "(", ")", ";", "this", ".", "controller", "=", "new", "WriterController", "(", ")", ";", "this", ".", "controller", ".", "init", "(", "this", ",", "context", ",", "cv", ",", "classNode", ")", ";", "if", "(", "controller", ".", "shouldOptimizeForInt", "(", ")", ")", "{", "OptimizingStatementWriter", ".", "setNodeMeta", "(", "controller", ".", "getTypeChooser", "(", ")", ",", "classNode", ")", ";", "}", "try", "{", "cv", ".", "visit", "(", "getBytecodeVersion", "(", ")", ",", "adjustedClassModifiers", "(", "classNode", ".", "getModifiers", "(", ")", ")", ",", "controller", ".", "getInternalClassName", "(", ")", ",", "BytecodeHelper", ".", "getGenericsSignature", "(", "classNode", ")", ",", "controller", ".", "getInternalBaseClassName", "(", ")", ",", "BytecodeHelper", ".", "getClassInternalNames", "(", "classNode", ".", "getInterfaces", "(", ")", ")", ")", ";", "cv", ".", "visitSource", "(", "sourceFile", ",", "null", ")", ";", "if", "(", "classNode", ".", "getName", "(", ")", ".", "endsWith", "(", "\"package-info\"", ")", ")", "{", "PackageNode", "packageNode", "=", "classNode", ".", "getPackage", "(", ")", ";", "if", "(", "packageNode", "!=", "null", ")", "{", "for", "(", "AnnotationNode", "an", ":", "packageNode", ".", "getAnnotations", "(", ")", ")", "{", "if", "(", "an", ".", "isBuiltIn", "(", ")", ")", "continue", ";", "if", "(", "an", ".", "hasSourceRetention", "(", ")", ")", "continue", ";", "AnnotationVisitor", "av", "=", "getAnnotationVisitor", "(", "classNode", ",", "an", ",", "cv", ")", ";", "visitAnnotationAttributes", "(", "an", ",", "av", ")", ";", "av", ".", "visitEnd", "(", ")", ";", "}", "}", "cv", ".", "visitEnd", "(", ")", ";", "return", ";", "}", "else", "{", "visitAnnotations", "(", "classNode", ",", "cv", ")", ";", "}", "if", "(", "classNode", ".", "isInterface", "(", ")", ")", "{", "ClassNode", "owner", "=", "classNode", ";", "if", "(", "owner", "instanceof", "InnerClassNode", ")", "{", "owner", "=", "owner", ".", "getOuterClass", "(", ")", ";", "}", "String", "outerClassName", "=", "classNode", ".", "getName", "(", ")", ";", "String", "name", "=", "outerClassName", "+", "\"$\"", "+", "context", ".", "getNextInnerClassIdx", "(", ")", ";", "controller", ".", "setInterfaceClassLoadingClass", "(", "new", "InterfaceHelperClassNode", "(", "owner", ",", "name", ",", "4128", ",", "ClassHelper", ".", "OBJECT_TYPE", ",", "controller", ".", "getCallSiteWriter", "(", ")", ".", "getCallSites", "(", ")", ")", ")", ";", "super", ".", "visitClass", "(", "classNode", ")", ";", "createInterfaceSyntheticStaticFields", "(", ")", ";", "}", "else", "{", "super", ".", "visitClass", "(", "classNode", ")", ";", "MopWriter", "mopWriter", "=", "new", "MopWriter", "(", "controller", ")", ";", "mopWriter", ".", "createMopMethods", "(", ")", ";", "controller", ".", "getCallSiteWriter", "(", ")", ".", "generateCallSiteArray", "(", ")", ";", "createSyntheticStaticFields", "(", ")", ";", "}", "for", "(", "Iterator", "<", "InnerClassNode", ">", "iter", "=", "classNode", ".", "getInnerClasses", "(", ")", ";", "iter", ".", "hasNext", "(", ")", ";", ")", "{", "InnerClassNode", "innerClass", "=", "iter", ".", "next", "(", ")", ";", "makeInnerClassEntry", "(", "innerClass", ")", ";", "}", "makeInnerClassEntry", "(", "classNode", ")", ";", "cv", ".", "visitEnd", "(", ")", ";", "}", "catch", "(", "GroovyRuntimeException", "e", ")", "{", "e", ".", "setModule", "(", "classNode", ".", "getModule", "(", ")", ")", ";", "throw", "e", ";", "}", "catch", "(", "NullPointerException", "npe", ")", "{", "throw", "new", "GroovyRuntimeException", "(", "\"\"", "+", "sourceFile", ",", "npe", ")", ";", "}", "}", "private", "void", "makeInnerClassEntry", "(", "ClassNode", "cn", ")", "{", "if", "(", "!", "(", "cn", "instanceof", "InnerClassNode", ")", ")", "return", ";", "InnerClassNode", "innerClass", "=", "(", "InnerClassNode", ")", "cn", ";", "String", "innerClassName", "=", "innerClass", ".", "getName", "(", ")", ";", "String", "innerClassInternalName", "=", "BytecodeHelper", ".", "getClassInternalName", "(", "innerClassName", ")", ";", "{", "int", "index", "=", "innerClassName", ".", "lastIndexOf", "(", "'$'", ")", ";", "if", "(", "index", ">=", "0", ")", "innerClassName", "=", "innerClassName", ".", "substring", "(", "index", "+", "1", ")", ";", "}", "String", "outerClassName", "=", "BytecodeHelper", ".", "getClassInternalName", "(", "innerClass", ".", "getOuterClass", "(", ")", ".", "getName", "(", ")", ")", ";", "MethodNode", "enclosingMethod", "=", "innerClass", ".", "getEnclosingMethod", "(", ")", ";", "if", "(", "enclosingMethod", "!=", "null", ")", "{", "outerClassName", "=", "null", ";", "innerClassName", "=", "null", ";", "}", "int", "mods", "=", "innerClass", ".", "getModifiers", "(", ")", ";", "cv", ".", "visitInnerClass", "(", "innerClassInternalName", ",", "outerClassName", ",", "innerClassName", ",", "mods", ")", ";", "}", "private", "int", "adjustedClassModifiers", "(", "int", "modifiers", ")", "{", "boolean", "needsSuper", "=", "(", "modifiers", "&", "ACC_INTERFACE", ")", "==", "0", ";", "modifiers", "=", "needsSuper", "?", "modifiers", "|", "ACC_SUPER", ":", "modifiers", ";", "modifiers", "=", "modifiers", "&", "~", "ACC_STATIC", ";", "return", "modifiers", ";", "}", "public", "void", "visitGenericType", "(", "GenericsType", "genericsType", ")", "{", "ClassNode", "type", "=", "genericsType", ".", "getType", "(", ")", ";", "genericParameterNames", ".", "put", "(", "type", ".", "getName", "(", ")", ",", "genericsType", ")", ";", "}", "private", "String", "[", "]", "buildExceptions", "(", "ClassNode", "[", "]", "exceptions", ")", "{", "if", "(", "exceptions", "==", "null", ")", "return", "null", ";", "String", "[", "]", "ret", "=", "new", "String", "[", "exceptions", ".", "length", "]", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "exceptions", ".", "length", ";", "i", "++", ")", "{", "ret", "[", "i", "]", "=", "BytecodeHelper", ".", "getClassInternalName", "(", "exceptions", "[", "i", "]", ")", ";", "}", "return", "ret", ";", "}", "protected", "void", "visitConstructorOrMethod", "(", "MethodNode", "node", ",", "boolean", "isConstructor", ")", "{", "lineNumber", "=", "-", "1", ";", "Parameter", "[", "]", "parameters", "=", "node", ".", "getParameters", "(", ")", ";", "String", "methodType", "=", "BytecodeHelper", ".", "getMethodDescriptor", "(", "node", ".", "getReturnType", "(", ")", ",", "parameters", ")", ";", "String", "signature", "=", "BytecodeHelper", ".", "getGenericsMethodSignature", "(", "node", ")", ";", "int", "modifiers", "=", "node", ".", "getModifiers", "(", ")", ";", "if", "(", "isVargs", "(", "node", ".", "getParameters", "(", ")", ")", ")", "modifiers", "|=", "Opcodes", ".", "ACC_VARARGS", ";", "MethodVisitor", "mv", "=", "cv", ".", "visitMethod", "(", "modifiers", ",", "node", ".", "getName", "(", ")", ",", "methodType", ",", "signature", ",", "buildExceptions", "(", "node", ".", "getExceptions", "(", ")", ")", ")", ";", "controller", ".", "setMethodVisitor", "(", "mv", ")", ";", "visitAnnotations", "(", "node", ",", "mv", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "parameters", ".", "length", ";", "i", "++", ")", "{", "visitParameterAnnotations", "(", "parameters", "[", "i", "]", ",", "i", ",", "mv", ")", ";", "}", "if", "(", "controller", ".", "getClassNode", "(", ")", ".", "isAnnotationDefinition", "(", ")", "&&", "!", "node", ".", "isStaticConstructor", "(", ")", ")", "{", "visitAnnotationDefault", "(", "node", ",", "mv", ")", ";", "}", "else", "if", "(", "!", "node", ".", "isAbstract", "(", ")", ")", "{", "Statement", "code", "=", "node", ".", "getCode", "(", ")", ";", "mv", ".", "visitCode", "(", ")", ";", "if", "(", "code", "instanceof", "BytecodeSequence", "&&", "(", "(", "BytecodeSequence", ")", "code", ")", ".", "getInstructions", "(", ")", ".", "size", "(", ")", "==", "1", "&&", "(", "(", "BytecodeSequence", ")", "code", ")", ".", "getInstructions", "(", ")", ".", "get", "(", "0", ")", "instanceof", "BytecodeInstruction", ")", "{", "(", "(", "BytecodeInstruction", ")", "(", "(", "BytecodeSequence", ")", "code", ")", ".", "getInstructions", "(", ")", ".", "get", "(", "0", ")", ")", ".", "visit", "(", "mv", ")", ";", "}", "else", "{", "visitStdMethod", "(", "node", ",", "isConstructor", ",", "parameters", ",", "code", ")", ";", "}", "mv", ".", "visitMaxs", "(", "0", ",", "0", ")", ";", "}", "mv", ".", "visitEnd", "(", ")", ";", "}", "private", "void", "visitStdMethod", "(", "MethodNode", "node", ",", "boolean", "isConstructor", ",", "Parameter", "[", "]", "parameters", ",", "Statement", "code", ")", "{", "MethodVisitor", "mv", "=", "controller", ".", "getMethodVisitor", "(", ")", ";", "final", "ClassNode", "superClass", "=", "controller", ".", "getClassNode", "(", ")", ".", "getSuperClass", "(", ")", ";", "if", "(", "isConstructor", "&&", "(", "code", "==", "null", "||", "!", "(", "(", "ConstructorNode", ")", "node", ")", ".", "firstStatementIsSpecialConstructorCall", "(", ")", ")", ")", "{", "boolean", "hasCallToSuper", "=", "false", ";", "if", "(", "code", "!=", "null", "&&", "controller", ".", "getClassNode", "(", ")", "instanceof", "InnerClassNode", ")", "{", "if", "(", "code", "instanceof", "BlockStatement", ")", "{", "for", "(", "Statement", "statement", ":", "(", "(", "BlockStatement", ")", "code", ")", ".", "getStatements", "(", ")", ")", "{", "if", "(", "statement", "instanceof", "ExpressionStatement", ")", "{", "final", "Expression", "expression", "=", "(", "(", "ExpressionStatement", ")", "statement", ")", ".", "getExpression", "(", ")", ";", "if", "(", "expression", "instanceof", "ConstructorCallExpression", ")", "{", "ConstructorCallExpression", "call", "=", "(", "ConstructorCallExpression", ")", "expression", ";", "if", "(", "call", ".", "isSuperCall", "(", ")", ")", "{", "hasCallToSuper", "=", "true", ";", "break", ";", "}", "}", "}", "}", "}", "}", "if", "(", "!", "hasCallToSuper", ")", "{", "mv", ".", "visitVarInsn", "(", "ALOAD", ",", "0", ")", ";", "mv", ".", "visitMethodInsn", "(", "INVOKESPECIAL", ",", "BytecodeHelper", ".", "getClassInternalName", "(", "superClass", ")", ",", "\"<init>\"", ",", "\"()V\"", ")", ";", "}", "}", "controller", ".", "getCompileStack", "(", ")", ".", "init", "(", "node", ".", "getVariableScope", "(", ")", ",", "parameters", ")", ";", "controller", ".", "getCallSiteWriter", "(", ")", ".", "makeSiteEntry", "(", ")", ";", "super", ".", "visitConstructorOrMethod", "(", "node", ",", "isConstructor", ")", ";", "controller", ".", "getCompileStack", "(", ")", ".", "clear", "(", ")", ";", "if", "(", "node", ".", "isVoidMethod", "(", ")", ")", "{", "mv", ".", "visitInsn", "(", "RETURN", ")", ";", "}", "else", "{", "ClassNode", "type", "=", "node", ".", "getReturnType", "(", ")", ".", "redirect", "(", ")", ";", "if", "(", "ClassHelper", ".", "isPrimitiveType", "(", "type", ")", ")", "{", "mv", ".", "visitLdcInsn", "(", "0", ")", ";", "controller", ".", "getOperandStack", "(", ")", ".", "push", "(", "ClassHelper", ".", "int_TYPE", ")", ";", "controller", ".", "getOperandStack", "(", ")", ".", "doGroovyCast", "(", "type", ")", ";", "BytecodeHelper", ".", "doReturn", "(", "mv", ",", "type", ")", ";", "controller", ".", "getOperandStack", "(", ")", ".", "remove", "(", "1", ")", ";", "}", "else", "{", "mv", ".", "visitInsn", "(", "ACONST_NULL", ")", ";", "BytecodeHelper", ".", "doReturn", "(", "mv", ",", "type", ")", ";", "}", "}", "}", "void", "visitAnnotationDefaultExpression", "(", "AnnotationVisitor", "av", ",", "ClassNode", "type", ",", "Expression", "exp", ")", "{", "if", "(", "exp", "instanceof", "ClosureExpression", ")", "{", "ClassNode", "closureClass", "=", "controller", ".", "getClosureWriter", "(", ")", ".", "getOrAddClosureClass", "(", "(", "ClosureExpression", ")", "exp", ",", "ACC_PUBLIC", ")", ";", "Type", "t", "=", "Type", ".", "getType", "(", "BytecodeHelper", ".", "getTypeDescription", "(", "closureClass", ")", ")", ";", "av", ".", "visit", "(", "null", ",", "t", ")", ";", "}", "else", "if", "(", "type", ".", "isArray", "(", ")", ")", "{", "ListExpression", "list", "=", "(", "ListExpression", ")", "exp", ";", "AnnotationVisitor", "avl", "=", "av", ".", "visitArray", "(", "null", ")", ";", "ClassNode", "componentType", "=", "type", ".", "getComponentType", "(", ")", ";", "for", "(", "Expression", "lExp", ":", "list", ".", "getExpressions", "(", ")", ")", "{", "visitAnnotationDefaultExpression", "(", "avl", ",", "componentType", ",", "lExp", ")", ";", "}", "}", "else", "if", "(", "ClassHelper", ".", "isPrimitiveType", "(", "type", ")", "||", "type", ".", "equals", "(", "ClassHelper", ".", "STRING_TYPE", ")", ")", "{", "ConstantExpression", "constExp", "=", "(", "ConstantExpression", ")", "exp", ";", "av", ".", "visit", "(", "null", ",", "constExp", ".", "getValue", "(", ")", ")", ";", "}", "else", "if", "(", "ClassHelper", ".", "CLASS_Type", ".", "equals", "(", "type", ")", ")", "{", "ClassNode", "clazz", "=", "exp", ".", "getType", "(", ")", ";", "Type", "t", "=", "Type", ".", "getType", "(", "BytecodeHelper", ".", "getTypeDescription", "(", "clazz", ")", ")", ";", "av", ".", "visit", "(", "null", ",", "t", ")", ";", "}", "else", "if", "(", "type", ".", "isDerivedFrom", "(", "ClassHelper", ".", "Enum_Type", ")", ")", "{", "PropertyExpression", "pExp", "=", "(", "PropertyExpression", ")", "exp", ";", "ClassExpression", "cExp", "=", "(", "ClassExpression", ")", "pExp", ".", "getObjectExpression", "(", ")", ";", "String", "desc", "=", "BytecodeHelper", ".", "getTypeDescription", "(", "cExp", ".", "getType", "(", ")", ")", ";", "String", "name", "=", "pExp", ".", "getPropertyAsString", "(", ")", ";", "av", ".", "visitEnum", "(", "null", ",", "desc", ",", "name", ")", ";", "}", "else", "if", "(", "type", ".", "implementsInterface", "(", "ClassHelper", ".", "Annotation_TYPE", ")", ")", "{", "AnnotationConstantExpression", "avExp", "=", "(", "AnnotationConstantExpression", ")", "exp", ";", "AnnotationNode", "value", "=", "(", "AnnotationNode", ")", "avExp", ".", "getValue", "(", ")", ";", "AnnotationVisitor", "avc", "=", "av", ".", "visitAnnotation", "(", "null", ",", "BytecodeHelper", ".", "getTypeDescription", "(", "avExp", ".", "getType", "(", ")", ")", ")", ";", "visitAnnotationAttributes", "(", "value", ",", "avc", ")", ";", "}", "else", "{", "throw", "new", "GroovyBugError", "(", "\"\"", "+", "type", ".", "getName", "(", ")", ")", ";", "}", "av", ".", "visitEnd", "(", ")", ";", "}", "private", "void", "visitAnnotationDefault", "(", "MethodNode", "node", ",", "MethodVisitor", "mv", ")", "{", "if", "(", "!", "node", ".", "hasAnnotationDefault", "(", ")", ")", "return", ";", "Expression", "exp", "=", "(", "(", "ReturnStatement", ")", "node", ".", "getCode", "(", ")", ")", ".", "getExpression", "(", ")", ";", "AnnotationVisitor", "av", "=", "mv", ".", "visitAnnotationDefault", "(", ")", ";", "visitAnnotationDefaultExpression", "(", "av", ",", "node", ".", "getReturnType", "(", ")", ",", "exp", ")", ";", "}", "private", "static", "boolean", "isVargs", "(", "Parameter", "[", "]", "p", ")", "{", "if", "(", "p", ".", "length", "==", "0", ")", "return", "false", ";", "ClassNode", "clazz", "=", "p", "[", "p", ".", "length", "-", "1", "]", ".", "getType", "(", ")", ";", "return", "(", "clazz", ".", "isArray", "(", ")", ")", ";", "}", "public", "void", "visitConstructor", "(", "ConstructorNode", "node", ")", "{", "controller", ".", "setConstructorNode", "(", "node", ")", ";", "super", ".", "visitConstructor", "(", "node", ")", ";", "}", "public", "void", "visitMethod", "(", "MethodNode", "node", ")", "{", "controller", ".", "setMethodNode", "(", "node", ")", ";", "super", ".", "visitMethod", "(", "node", ")", ";", "}", "public", "void", "visitField", "(", "FieldNode", "fieldNode", ")", "{", "onLineNumber", "(", "fieldNode", ",", "\"visitField:", "\"", "+", "fieldNode", ".", "getName", "(", ")", ")", ";", "ClassNode", "t", "=", "fieldNode", ".", "getType", "(", ")", ";", "String", "signature", "=", "BytecodeHelper", ".", "getGenericsBounds", "(", "t", ")", ";", "Expression", "initialValueExpression", "=", "fieldNode", ".", "getInitialValueExpression", "(", ")", ";", "ConstantExpression", "cexp", "=", "initialValueExpression", "instanceof", "ConstantExpression", "?", "(", "ConstantExpression", ")", "initialValueExpression", ":", "null", ";", "if", "(", "cexp", "!=", "null", ")", "{", "cexp", "=", "Verifier", ".", "transformToPrimitiveConstantIfPossible", "(", "cexp", ")", ";", "}", "Object", "value", "=", "cexp", "!=", "null", "&&", "ClassHelper", ".", "isStaticConstantInitializerType", "(", "cexp", ".", "getType", "(", ")", ")", "&&", "cexp", ".", "getType", "(", ")", ".", "equals", "(", "t", ")", "&&", "fieldNode", ".", "isStatic", "(", ")", "&&", "fieldNode", ".", "isFinal", "(", ")", "?", "cexp", ".", "getValue", "(", ")", ":", "null", ";", "if", "(", "value", "!=", "null", ")", "{", "if", "(", "ClassHelper", ".", "byte_TYPE", ".", "equals", "(", "t", ")", "||", "ClassHelper", ".", "short_TYPE", ".", "equals", "(", "t", ")", ")", "{", "value", "=", "(", "(", "Number", ")", "value", ")", ".", "intValue", "(", ")", ";", "}", "else", "if", "(", "ClassHelper", ".", "char_TYPE", ".", "equals", "(", "t", ")", ")", "{", "value", "=", "Integer", ".", "valueOf", "(", "(", "Character", ")", "value", ")", ";", "}", "}", "FieldVisitor", "fv", "=", "cv", ".", "visitField", "(", "fieldNode", ".", "getModifiers", "(", ")", ",", "fieldNode", ".", "getName", "(", ")", ",", "BytecodeHelper", ".", "getTypeDescription", "(", "t", ")", ",", "signature", ",", "value", ")", ";", "visitAnnotations", "(", "fieldNode", ",", "fv", ")", ";", "fv", ".", "visitEnd", "(", ")", ";", "}", "public", "void", "visitProperty", "(", "PropertyNode", "statement", ")", "{", "onLineNumber", "(", "statement", ",", "\"\"", "+", "statement", ".", "getField", "(", ")", ".", "getName", "(", ")", ")", ";", "controller", ".", "setMethodNode", "(", "null", ")", ";", "}", "protected", "void", "visitStatement", "(", "Statement", "statement", ")", "{", "throw", "new", "GroovyBugError", "(", "\"\"", ")", ";", "}", "@", "Override", "public", "void", "visitCatchStatement", "(", "CatchStatement", "statement", ")", "{", "statement", ".", "getCode", "(", ")", ".", "visit", "(", "this", ")", ";", "}", "public", "void", "visitBlockStatement", "(", "BlockStatement", "block", ")", "{", "controller", ".", "getStatementWriter", "(", ")", ".", "writeBlockStatement", "(", "block", ")", ";", "}", "public", "void", "visitForLoop", "(", "ForStatement", "loop", ")", "{", "controller", ".", "getStatementWriter", "(", ")", ".", "writeForStatement", "(", "loop", ")", ";", "}", "public", "void", "visitWhileLoop", "(", "WhileStatement", "loop", ")", "{", "controller", ".", "getStatementWriter", "(", ")", ".", "writeWhileLoop", "(", "loop", ")", ";", "}", "public", "void", "visitDoWhileLoop", "(", "DoWhileStatement", "loop", ")", "{", "controller", ".", "getStatementWriter", "(", ")", ".", "writeDoWhileLoop", "(", "loop", ")", ";", "}", "public", "void", "visitIfElse", "(", "IfStatement", "ifElse", ")", "{", "controller", ".", "getStatementWriter", "(", ")", ".", "writeIfElse", "(", "ifElse", ")", ";", "}", "public", "void", "visitAssertStatement", "(", "AssertStatement", "statement", ")", "{", "controller", ".", "getStatementWriter", "(", ")", ".", "writeAssert", "(", "statement", ")", ";", "}", "public", "void", "visitTryCatchFinally", "(", "TryCatchStatement", "statement", ")", "{", "controller", ".", "getStatementWriter", "(", ")", ".", "writeTryCatchFinally", "(", "statement", ")", ";", "}", "public", "void", "visitSwitch", "(", "SwitchStatement", "statement", ")", "{", "controller", ".", "getStatementWriter", "(", ")", ".", "writeSwitch", "(", "statement", ")", ";", "}", "public", "void", "visitCaseStatement", "(", "CaseStatement", "statement", ")", "{", "}", "public", "void", "visitBreakStatement", "(", "BreakStatement", "statement", ")", "{", "controller", ".", "getStatementWriter", "(", ")", ".", "writeBreak", "(", "statement", ")", ";", "}", "public", "void", "visitContinueStatement", "(", "ContinueStatement", "statement", ")", "{", "controller", ".", "getStatementWriter", "(", ")", ".", "writeContinue", "(", "statement", ")", ";", "}", "public", "void", "visitSynchronizedStatement", "(", "SynchronizedStatement", "statement", ")", "{", "controller", ".", "getStatementWriter", "(", ")", ".", "writeSynchronized", "(", "statement", ")", ";", "}", "public", "void", "visitThrowStatement", "(", "ThrowStatement", "statement", ")", "{", "controller", ".", "getStatementWriter", "(", ")", ".", "writeThrow", "(", "statement", ")", ";", "}", "public", "void", "visitReturnStatement", "(", "ReturnStatement", "statement", ")", "{", "controller", ".", "getStatementWriter", "(", ")", ".", "writeReturn", "(", "statement", ")", ";", "}", "public", "void", "visitExpressionStatement", "(", "ExpressionStatement", "statement", ")", "{", "controller", ".", "getStatementWriter", "(", ")", ".", "writeExpressionStatement", "(", "statement", ")", ";", "}", "public", "void", "visitTernaryExpression", "(", "TernaryExpression", "expression", ")", "{", "onLineNumber", "(", "expression", ",", "\"\"", ")", ";", "controller", ".", "getBinaryExpHelper", "(", ")", ".", "evaluateTernary", "(", "expression", ")", ";", "}", "public", "void", "visitDeclarationExpression", "(", "DeclarationExpression", "expression", ")", "{", "onLineNumber", "(", "expression", ",", "\"\"", "+", "expression", ".", "getText", "(", ")", "+", "\"\\\"\"", ")", ";", "controller", ".", "getBinaryExpHelper", "(", ")", ".", "evaluateEqual", "(", "expression", ",", "true", ")", ";", "}", "public", "void", "visitBinaryExpression", "(", "BinaryExpression", "expression", ")", "{", "onLineNumber", "(", "expression", ",", "\"\"", "+", "expression", ".", "getOperation", "(", ")", ".", "getText", "(", ")", "+", "\"\\\"", "\"", ")", ";", "controller", ".", "getBinaryExpHelper", "(", ")", ".", "eval", "(", "expression", ")", ";", "controller", ".", "getAssertionWriter", "(", ")", ".", "record", "(", "expression", ".", "getOperation", "(", ")", ")", ";", "}", "public", "void", "visitPostfixExpression", "(", "PostfixExpression", "expression", ")", "{", "controller", ".", "getBinaryExpHelper", "(", ")", ".", "evaluatePostfixMethod", "(", "expression", ")", ";", "controller", ".", "getAssertionWriter", "(", ")", ".", "record", "(", "expression", ")", ";", "}", "public", "void", "throwException", "(", "String", "s", ")", "{", "throw", "new", "RuntimeParserException", "(", "s", ",", "currentASTNode", ")", ";", "}", "public", "void", "visitPrefixExpression", "(", "PrefixExpression", "expression", ")", "{", "controller", ".", "getBinaryExpHelper", "(", ")", ".", "evaluatePrefixMethod", "(", "expression", ")", ";", "controller", ".", "getAssertionWriter", "(", ")", ".", "record", "(", "expression", ")", ";", "}", "public", "void", "visitClosureExpression", "(", "ClosureExpression", "expression", ")", "{", "controller", ".", "getClosureWriter", "(", ")", ".", "writeClosure", "(", "expression", ")", ";", "}", "protected", "void", "loadThisOrOwner", "(", ")", "{", "if", "(", "isInnerClass", "(", ")", ")", "{", "visitFieldExpression", "(", "new", "FieldExpression", "(", "controller", ".", "getClassNode", "(", ")", ".", "getDeclaredField", "(", "\"owner\"", ")", ")", ")", ";", "}", "else", "{", "loadThis", "(", ")", ";", "}", "}", "public", "void", "visitConstantExpression", "(", "ConstantExpression", "expression", ")", "{", "final", "String", "constantName", "=", "expression", ".", "getConstantName", "(", ")", ";", "if", "(", "controller", ".", "isStaticConstructor", "(", ")", "||", "constantName", "==", "null", ")", "{", "controller", ".", "getOperandStack", "(", ")", ".", "pushConstant", "(", "expression", ")", ";", "}", "else", "{", "controller", ".", "getMethodVisitor", "(", ")", ".", "visitFieldInsn", "(", "GETSTATIC", ",", "controller", ".", "getInternalClassName", "(", ")", ",", "constantName", ",", "BytecodeHelper", ".", "getTypeDescription", "(", "expression", ".", "getType", "(", ")", ")", ")", ";", "controller", ".", "getOperandStack", "(", ")", ".", "push", "(", "expression", ".", "getType", "(", ")", ")", ";", "}", "}", "public", "void", "visitSpreadExpression", "(", "SpreadExpression", "expression", ")", "{", "throw", "new", "GroovyBugError", "(", "\"\"", ")", ";", "}", "public", "void", "visitSpreadMapExpression", "(", "SpreadMapExpression", "expression", ")", "{", "Expression", "subExpression", "=", "expression", ".", "getExpression", "(", ")", ";", "controller", ".", "getAssertionWriter", "(", ")", ".", "disableTracker", "(", ")", ";", "subExpression", ".", "visit", "(", "this", ")", ";", "controller", ".", "getOperandStack", "(", ")", ".", "box", "(", ")", ";", "spreadMap", ".", "call", "(", "controller", ".", "getMethodVisitor", "(", ")", ")", ";", "controller", ".", "getAssertionWriter", "(", ")", ".", "reenableTracker", "(", ")", ";", "controller", ".", "getOperandStack", "(", ")", ".", "replace", "(", "ClassHelper", ".", "OBJECT_TYPE", ")", ";", "}", "public", "void", "visitMethodPointerExpression", "(", "MethodPointerExpression", "expression", ")", "{", "Expression", "subExpression", "=", "expression", ".", "getExpression", "(", ")", ";", "subExpression", ".", "visit", "(", "this", ")", ";", "controller", ".", "getOperandStack", "(", ")", ".", "box", "(", ")", ";", "controller", ".", "getOperandStack", "(", ")", ".", "pushDynamicName", "(", "expression", ".", "getMethodName", "(", ")", ")", ";", "getMethodPointer", ".", "call", "(", "controller", ".", "getMethodVisitor", "(", ")", ")", ";", "controller", ".", "getOperandStack", "(", ")", ".", "replace", "(", "ClassHelper", ".", "CLOSURE_TYPE", ",", "2", ")", ";", "}", "public", "void", "visitUnaryMinusExpression", "(", "UnaryMinusExpression", "expression", ")", "{", "Expression", "subExpression", "=", "expression", ".", "getExpression", "(", ")", ";", "subExpression", ".", "visit", "(", "this", ")", ";", "controller", ".", "getOperandStack", "(", ")", ".", "box", "(", ")", ";", "unaryMinus", ".", "call", "(", "controller", ".", "getMethodVisitor", "(", ")", ")", ";", "controller", ".", "getOperandStack", "(", ")", ".", "replace", "(", "ClassHelper", ".", "OBJECT_TYPE", ")", ";", "controller", ".", "getAssertionWriter", "(", ")", ".", "record", "(", "expression", ")", ";", "}", "public", "void", "visitUnaryPlusExpression", "(", "UnaryPlusExpression", "expression", ")", "{", "Expression", "subExpression", "=", "expression", ".", "getExpression", "(", ")", ";", "subExpression", ".", "visit", "(", "this", ")", ";", "controller", ".", "getOperandStack", "(", ")", ".", "box", "(", ")", ";", "unaryPlus", ".", "call", "(", "controller", ".", "getMethodVisitor", "(", ")", ")", ";", "controller", ".", "getOperandStack", "(", ")", ".", "replace", "(", "ClassHelper", ".", "OBJECT_TYPE", ")", ";", "controller", ".", "getAssertionWriter", "(", ")", ".", "record", "(", "expression", ")", ";", "}", "public", "void", "visitBitwiseNegationExpression", "(", "BitwiseNegationExpression", "expression", ")", "{", "Expression", "subExpression", "=", "expression", ".", "getExpression", "(", ")", ";", "subExpression", ".", "visit", "(", "this", ")", ";", "controller", ".", "getOperandStack", "(", ")", ".", "box", "(", ")", ";", "bitwiseNegate", ".", "call", "(", "controller", ".", "getMethodVisitor", "(", ")", ")", ";", "controller", ".", "getOperandStack", "(", ")", ".", "replace", "(", "ClassHelper", ".", "OBJECT_TYPE", ")", ";", "controller", ".", "getAssertionWriter", "(", ")", ".", "record", "(", "expression", ")", ";", "}", "public", "void", "visitCastExpression", "(", "CastExpression", "castExpression", ")", "{", "ClassNode", "type", "=", "castExpression", ".", "getType", "(", ")", ";", "castExpression", ".", "getExpression", "(", ")", ".", "visit", "(", "this", ")", ";", "if", "(", "castExpression", ".", "isCoerce", "(", ")", ")", "{", "controller", ".", "getOperandStack", "(", ")", ".", "doAsType", "(", "type", ")", ";", "}", "else", "{", "controller", ".", "getOperandStack", "(", ")", ".", "doGroovyCast", "(", "type", ")", ";", "}", "}", "public", "void", "visitNotExpression", "(", "NotExpression", "expression", ")", "{", "Expression", "subExpression", "=", "expression", ".", "getExpression", "(", ")", ";", "int", "mark", "=", "controller", ".", "getOperandStack", "(", ")", ".", "getStackLength", "(", ")", ";", "subExpression", ".", "visit", "(", "this", ")", ";", "controller", ".", "getOperandStack", "(", ")", ".", "castToBool", "(", "mark", ",", "true", ")", ";", "BytecodeHelper", ".", "negateBoolean", "(", "controller", ".", "getMethodVisitor", "(", ")", ")", ";", "controller", ".", "getAssertionWriter", "(", ")", ".", "record", "(", "expression", ")", ";", "}", "public", "void", "visitBooleanExpression", "(", "BooleanExpression", "expression", ")", "{", "controller", ".", "getCompileStack", "(", ")", ".", "pushBooleanExpression", "(", ")", ";", "int", "mark", "=", "controller", ".", "getOperandStack", "(", ")", ".", "getStackLength", "(", ")", ";", "Expression", "inner", "=", "expression", ".", "getExpression", "(", ")", ";", "inner", ".", "visit", "(", "this", ")", ";", "controller", ".", "getOperandStack", "(", ")", ".", "castToBool", "(", "mark", ",", "true", ")", ";", "controller", ".", "getCompileStack", "(", ")", ".", "pop", "(", ")", ";", "}", "public", "void", "visitMethodCallExpression", "(", "MethodCallExpression", "call", ")", "{", "onLineNumber", "(", "call", ",", "\"\"", "+", "call", ".", "getMethod", "(", ")", "+", "\"\\\":\"", ")", ";", "controller", ".", "getInvocationWriter", "(", ")", ".", "writeInvokeMethod", "(", "call", ")", ";", "controller", ".", "getAssertionWriter", "(", ")", ".", "record", "(", "call", ".", "getMethod", "(", ")", ")", ";", "}", "protected", "boolean", "emptyArguments", "(", "Expression", "arguments", ")", "{", "return", "argumentSize", "(", "arguments", ")", "==", "0", ";", "}", "public", "static", "boolean", "containsSpreadExpression", "(", "Expression", "arguments", ")", "{", "List", "args", "=", "null", ";", "if", "(", "arguments", "instanceof", "TupleExpression", ")", "{", "TupleExpression", "tupleExpression", "=", "(", "TupleExpression", ")", "arguments", ";", "args", "=", "tupleExpression", ".", "getExpressions", "(", ")", ";", "}", "else", "if", "(", "arguments", "instanceof", "ListExpression", ")", "{", "ListExpression", "le", "=", "(", "ListExpression", ")", "arguments", ";", "args", "=", "le", ".", "getExpressions", "(", ")", ";", "}", "else", "{", "return", "arguments", "instanceof", "SpreadExpression", ";", "}", "for", "(", "Iterator", "iter", "=", "args", ".", "iterator", "(", ")", ";", "iter", ".", "hasNext", "(", ")", ";", ")", "{", "if", "(", "iter", ".", "next", "(", ")", "instanceof", "SpreadExpression", ")", "return", "true", ";", "}", "return", "false", ";", "}", "public", "static", "int", "argumentSize", "(", "Expression", "arguments", ")", "{", "if", "(", "arguments", "instanceof", "TupleExpression", ")", "{", "TupleExpression", "tupleExpression", "=", "(", "TupleExpression", ")", "arguments", ";", "int", "size", "=", "tupleExpression", ".", "getExpressions", "(", ")", ".", "size", "(", ")", ";", "return", "size", ";", "}", "return", "1", ";", "}", "public", "void", "visitStaticMethodCallExpression", "(", "StaticMethodCallExpression", "call", ")", "{", "onLineNumber", "(", "call", ",", "\"\"", "+", "call", ".", "getMethod", "(", ")", "+", "\"\\\":\"", ")", ";", "controller", ".", "getInvocationWriter", "(", ")", ".", "writeInvokeStaticMethod", "(", "call", ")", ";", "controller", ".", "getAssertionWriter", "(", ")", ".", "record", "(", "call", ")", ";", "}", "private", "void", "visitSpecialConstructorCall", "(", "ConstructorCallExpression", "call", ")", "{", "if", "(", "controller", ".", "getClosureWriter", "(", ")", ".", "addGeneratedClosureConstructorCall", "(", "call", ")", ")", "return", ";", "ClassNode", "callNode", "=", "controller", ".", "getClassNode", "(", ")", ";", "if", "(", "call", ".", "isSuperCall", "(", ")", ")", "callNode", "=", "callNode", ".", "getSuperClass", "(", ")", ";", "List", "<", "ConstructorNode", ">", "constructors", "=", "sortConstructors", "(", "call", ",", "callNode", ")", ";", "if", "(", "!", "makeDirectConstructorCall", "(", "constructors", ",", "call", ",", "callNode", ")", ")", "{", "makeMOPBasedConstructorCall", "(", "constructors", ",", "call", ",", "callNode", ")", ";", "}", "}", "private", "static", "ConstructorNode", "getMatchingConstructor", "(", "List", "<", "ConstructorNode", ">", "constructors", ",", "List", "<", "Expression", ">", "argumentList", ")", "{", "ConstructorNode", "lastMatch", "=", "null", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "constructors", ".", "size", "(", ")", ";", "i", "++", ")", "{", "ConstructorNode", "cn", "=", "constructors", ".", "get", "(", "i", ")", ";", "Parameter", "[", "]", "params", "=", "cn", ".", "getParameters", "(", ")", ";", "if", "(", "argumentList", ".", "size", "(", ")", "!=", "params", ".", "length", ")", "continue", ";", "if", "(", "lastMatch", "==", "null", ")", "{", "lastMatch", "=", "cn", ";", "}", "else", "{", "return", "null", ";", "}", "}", "return", "lastMatch", ";", "}", "private", "boolean", "makeDirectConstructorCall", "(", "List", "<", "ConstructorNode", ">", "constructors", ",", "ConstructorCallExpression", "call", ",", "ClassNode", "callNode", ")", "{", "if", "(", "!", "controller", ".", "isConstructor", "(", ")", ")", "return", "false", ";", "Expression", "arguments", "=", "call", ".", "getArguments", "(", ")", ";", "List", "<", "Expression", ">", "argumentList", ";", "if", "(", "arguments", "instanceof", "TupleExpression", ")", "{", "argumentList", "=", "(", "(", "TupleExpression", ")", "arguments", ")", ".", "getExpressions", "(", ")", ";", "}", "else", "{", "argumentList", "=", "new", "ArrayList", "(", ")", ";", "argumentList", ".", "add", "(", "arguments", ")", ";", "}", "for", "(", "Expression", "expression", ":", "argumentList", ")", "{", "if", "(", "expression", "instanceof", "SpreadExpression", ")", "return", "false", ";", "}", "ConstructorNode", "cn", "=", "getMatchingConstructor", "(", "constructors", ",", "argumentList", ")", ";", "if", "(", "cn", "==", "null", ")", "return", "false", ";", "MethodVisitor", "mv", "=", "controller", ".", "getMethodVisitor", "(", ")", ";", "OperandStack", "operandStack", "=", "controller", ".", "getOperandStack", "(", ")", ";", "Parameter", "[", "]", "params", "=", "cn", ".", "getParameters", "(", ")", ";", "mv", ".", "visitVarInsn", "(", "ALOAD", ",", "0", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "params", ".", "length", ";", "i", "++", ")", "{", "argumentList", ".", "get", "(", "i", ")", ".", "visit", "(", "this", ")", ";", "operandStack", ".", "doGroovyCast", "(", "params", "[", "i", "]", ".", "getType", "(", ")", ")", ";", "operandStack", ".", "remove", "(", "1", ")", ";", "}", "String", "descriptor", "=", "BytecodeHelper", ".", "getMethodDescriptor", "(", "ClassHelper", ".", "VOID_TYPE", ",", "params", ")", ";", "mv", ".", "visitMethodInsn", "(", "INVOKESPECIAL", ",", "BytecodeHelper", ".", "getClassInternalName", "(", "callNode", ")", ",", "\"<init>\"", ",", "descriptor", ")", ";", "return", "true", ";", "}", "private", "void", "makeMOPBasedConstructorCall", "(", "List", "<", "ConstructorNode", ">", "constructors", ",", "ConstructorCallExpression", "call", ",", "ClassNode", "callNode", ")", "{", "MethodVisitor", "mv", "=", "controller", ".", "getMethodVisitor", "(", ")", ";", "OperandStack", "operandStack", "=", "controller", ".", "getOperandStack", "(", ")", ";", "call", ".", "getArguments", "(", ")", ".", "visit", "(", "this", ")", ";", "mv", ".", "visitInsn", "(", "DUP", ")", ";", "BytecodeHelper", ".", "pushConstant", "(", "mv", ",", "constructors", ".", "size", "(", ")", ")", ";", "visitClassExpression", "(", "new", "ClassExpression", "(", "callNode", ")", ")", ";", "operandStack", ".", "remove", "(", "1", ")", ";", "selectConstructorAndTransformArguments", ".", "call", "(", "mv", ")", ";", "mv", ".", "visitInsn", "(", "DUP_X1", ")", ";", "mv", ".", "visitInsn", "(", "ICONST_1", ")", ";", "mv", ".", "visitInsn", "(", "IAND", ")", ";", "Label", "afterIf", "=", "new", "Label", "(", ")", ";", "mv", ".", "visitJumpInsn", "(", "IFEQ", ",", "afterIf", ")", ";", "mv", ".", "visitInsn", "(", "ICONST_0", ")", ";", "mv", ".", "visitInsn", "(", "AALOAD", ")", ";", "mv", ".", "visitTypeInsn", "(", "CHECKCAST", ",", "\"\"", ")", ";", "mv", ".", "visitLabel", "(", "afterIf", ")", ";", "mv", ".", "visitInsn", "(", "SWAP", ")", ";", "if", "(", "controller", ".", "isConstructor", "(", ")", ")", "{", "mv", ".", "visitVarInsn", "(", "ALOAD", ",", "0", ")", ";", "}", "else", "{", "mv", ".", "visitTypeInsn", "(", "NEW", ",", "BytecodeHelper", ".", "getClassInternalName", "(", "callNode", ")", ")", ";", "}", "mv", ".", "visitInsn", "(", "SWAP", ")", ";", "mv", ".", "visitIntInsn", "(", "BIPUSH", ",", "8", ")", ";", "mv", ".", "visitInsn", "(", "ISHR", ")", ";", "Label", "[", "]", "targets", "=", "new", "Label", "[", "constructors", ".", "size", "(", ")", "]", ";", "int", "[", "]", "indices", "=", "new", "int", "[", "constructors", ".", "size", "(", ")", "]", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "targets", ".", "length", ";", "i", "++", ")", "{", "targets", "[", "i", "]", "=", "new", "Label", "(", ")", ";", "indices", "[", "i", "]", "=", "i", ";", "}", "Label", "defaultLabel", "=", "new", "Label", "(", ")", ";", "Label", "afterSwitch", "=", "new", "Label", "(", ")", ";", "mv", ".", "visitLookupSwitchInsn", "(", "defaultLabel", ",", "indices", ",", "targets", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "targets", ".", "length", ";", "i", "++", ")", "{", "mv", ".", "visitLabel", "(", "targets", "[", "i", "]", ")", ";", "if", "(", "controller", ".", "isConstructor", "(", ")", ")", "{", "mv", ".", "visitInsn", "(", "SWAP", ")", ";", "mv", ".", "visitInsn", "(", "DUP_X1", ")", ";", "}", "else", "{", "mv", ".", "visitInsn", "(", "DUP_X1", ")", ";", "mv", ".", "visitInsn", "(", "DUP2_X1", ")", ";", "mv", ".", "visitInsn", "(", "POP", ")", ";", "}", "ConstructorNode", "cn", "=", "constructors", ".", "get", "(", "i", ")", ";", "String", "descriptor", "=", "BytecodeHelper", ".", "getMethodDescriptor", "(", "ClassHelper", ".", "VOID_TYPE", ",", "cn", ".", "getParameters", "(", ")", ")", ";", "Parameter", "[", "]", "parameters", "=", "cn", ".", "getParameters", "(", ")", ";", "for", "(", "int", "p", "=", "0", ";", "p", "<", "parameters", ".", "length", ";", "p", "++", ")", "{", "operandStack", ".", "push", "(", "ClassHelper", ".", "OBJECT_TYPE", ")", ";", "mv", ".", "visitInsn", "(", "DUP", ")", ";", "BytecodeHelper", ".", "pushConstant", "(", "mv", ",", "p", ")", ";", "mv", ".", "visitInsn", "(", "AALOAD", ")", ";", "operandStack", ".", "push", "(", "ClassHelper", ".", "OBJECT_TYPE", ")", ";", "ClassNode", "type", "=", "parameters", "[", "p", "]", ".", "getType", "(", ")", ";", "operandStack", ".", "doGroovyCast", "(", "type", ")", ";", "operandStack", ".", "swap", "(", ")", ";", "operandStack", ".", "remove", "(", "2", ")", ";", "}", "mv", ".", "visitInsn", "(", "POP", ")", ";", "mv", ".", "visitMethodInsn", "(", "INVOKESPECIAL", ",", "BytecodeHelper", ".", "getClassInternalName", "(", "callNode", ")", ",", "\"<init>\"", ",", "descriptor", ")", ";", "mv", ".", "visitJumpInsn", "(", "GOTO", ",", "afterSwitch", ")", ";", "}", "mv", ".", "visitLabel", "(", "defaultLabel", ")", ";", "mv", ".", "visitTypeInsn", "(", "NEW", ",", "\"\"", ")", ";", "mv", ".", "visitInsn", "(", "DUP", ")", ";", "mv", ".", "visitLdcInsn", "(", "\"\"", ")", ";", "mv", ".", "visitMethodInsn", "(", "INVOKESPECIAL", ",", "\"\"", ",", "\"<init>\"", ",", "\"\"", ")", ";", "mv", ".", "visitInsn", "(", "ATHROW", ")", ";", "mv", ".", "visitLabel", "(", "afterSwitch", ")", ";", "if", "(", "!", "controller", ".", "isConstructor", "(", ")", ")", "{", "mv", ".", "visitInsn", "(", "SWAP", ")", ";", "operandStack", ".", "push", "(", "callNode", ")", ";", "}", "mv", ".", "visitInsn", "(", "POP", ")", ";", "}", "private", "List", "<", "ConstructorNode", ">", "sortConstructors", "(", "ConstructorCallExpression", "call", ",", "ClassNode", "callNode", ")", "{", "List", "<", "ConstructorNode", ">", "constructors", "=", "new", "ArrayList", "<", "ConstructorNode", ">", "(", "callNode", ".", "getDeclaredConstructors", "(", ")", ")", ";", "Comparator", "comp", "=", "new", "Comparator", "(", ")", "{", "public", "int", "compare", "(", "Object", "arg0", ",", "Object", "arg1", ")", "{", "ConstructorNode", "c0", "=", "(", "ConstructorNode", ")", "arg0", ";", "ConstructorNode", "c1", "=", "(", "ConstructorNode", ")", "arg1", ";", "String", "descriptor0", "=", "BytecodeHelper", ".", "getMethodDescriptor", "(", "ClassHelper", ".", "VOID_TYPE", ",", "c0", ".", "getParameters", "(", ")", ")", ";", "String", "descriptor1", "=", "BytecodeHelper", ".", "getMethodDescriptor", "(", "ClassHelper", ".", "VOID_TYPE", ",", "c1", ".", "getParameters", "(", ")", ")", ";", "return", "descriptor0", ".", "compareTo", "(", "descriptor1", ")", ";", "}", "}", ";", "Collections", ".", "sort", "(", "constructors", ",", "comp", ")", ";", "return", "constructors", ";", "}", "public", "void", "visitConstructorCallExpression", "(", "ConstructorCallExpression", "call", ")", "{", "onLineNumber", "(", "call", ",", "\"\"", "+", "call", ".", "getType", "(", ")", ".", "getName", "(", ")", "+", "\"\\\":\"", ")", ";", "if", "(", "call", ".", "isSpecialCall", "(", ")", ")", "{", "controller", ".", "getCompileStack", "(", ")", ".", "pushInSpecialConstructorCall", "(", ")", ";", "visitSpecialConstructorCall", "(", "call", ")", ";", "controller", ".", "getCompileStack", "(", ")", ".", "pop", "(", ")", ";", "return", ";", "}", "controller", ".", "getInvocationWriter", "(", ")", ".", "writeInvokeConstructor", "(", "call", ")", ";", "controller", ".", "getAssertionWriter", "(", ")", ".", "record", "(", "call", ")", ";", "}", "private", "static", "String", "makeFieldClassName", "(", "ClassNode", "type", ")", "{", "String", "internalName", "=", "BytecodeHelper", ".", "getClassInternalName", "(", "type", ")", ";", "StringBuffer", "ret", "=", "new", "StringBuffer", "(", "internalName", ".", "length", "(", ")", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "internalName", ".", "length", "(", ")", ";", "i", "++", ")", "{", "char", "c", "=", "internalName", ".", "charAt", "(", "i", ")", ";", "if", "(", "c", "==", "'/'", ")", "{", "ret", ".", "append", "(", "'$'", ")", ";", "}", "else", "if", "(", "c", "==", "';'", ")", "{", "}", "else", "{", "ret", ".", "append", "(", "c", ")", ";", "}", "}", "return", "ret", ".", "toString", "(", ")", ";", "}", "private", "static", "String", "getStaticFieldName", "(", "ClassNode", "type", ")", "{", "ClassNode", "componentType", "=", "type", ";", "String", "prefix", "=", "\"\"", ";", "for", "(", ";", "componentType", ".", "isArray", "(", ")", ";", "componentType", "=", "componentType", ".", "getComponentType", "(", ")", ")", "{", "prefix", "+=", "\"$\"", ";", "}", "if", "(", "prefix", ".", "length", "(", ")", "!=", "0", ")", "prefix", "=", "\"array\"", "+", "prefix", ";", "String", "name", "=", "prefix", "+", "\"$class$\"", "+", "makeFieldClassName", "(", "componentType", ")", ";", "return", "name", ";", "}", "private", "void", "visitAttributeOrProperty", "(", "PropertyExpression", "expression", ",", "MethodCallerMultiAdapter", "adapter", ")", "{", "MethodVisitor", "mv", "=", "controller", ".", "getMethodVisitor", "(", ")", ";", "Expression", "objectExpression", "=", "expression", ".", "getObjectExpression", "(", ")", ";", "ClassNode", "classNode", "=", "controller", ".", "getClassNode", "(", ")", ";", "if", "(", "isThisOrSuper", "(", "objectExpression", ")", ")", "{", "String", "name", "=", "expression", ".", "getPropertyAsString", "(", ")", ";", "if", "(", "name", "!=", "null", ")", "{", "FieldNode", "field", "=", "null", ";", "boolean", "privateSuperField", "=", "false", ";", "if", "(", "isSuperExpression", "(", "objectExpression", ")", ")", "{", "field", "=", "classNode", ".", "getSuperClass", "(", ")", ".", "getDeclaredField", "(", "name", ")", ";", "if", "(", "field", "!=", "null", "&&", "(", "(", "field", ".", "getModifiers", "(", ")", "&", "ACC_PRIVATE", ")", "!=", "0", ")", ")", "{", "privateSuperField", "=", "true", ";", "}", "}", "else", "{", "if", "(", "controller", ".", "isNotExplicitThisInClosure", "(", "expression", ".", "isImplicitThis", "(", ")", ")", ")", "{", "field", "=", "classNode", ".", "getDeclaredField", "(", "name", ")", ";", "if", "(", "field", "==", "null", "&&", "classNode", "instanceof", "InnerClassNode", ")", "{", "ClassNode", "outer", "=", "classNode", ".", "getOuterClass", "(", ")", ";", "FieldNode", "outerClassField", ";", "while", "(", "outer", "!=", "null", ")", "{", "outerClassField", "=", "outer", ".", "getDeclaredField", "(", "name", ")", ";", "if", "(", "outerClassField", "!=", "null", "&&", "outerClassField", ".", "isStatic", "(", ")", "&&", "outerClassField", ".", "isFinal", "(", ")", ")", "{", "if", "(", "outer", "!=", "classNode", ".", "getOuterClass", "(", ")", "&&", "Modifier", ".", "isPrivate", "(", "outerClassField", ".", "getModifiers", "(", ")", ")", ")", "{", "throw", "new", "GroovyBugError", "(", "\"\"", "+", "outerClassField", ".", "getDeclaringClass", "(", ")", "+", "\"#\"", "+", "outerClassField", ".", "getName", "(", ")", "+", "\"\"", ")", ";", "}", "PropertyExpression", "pexp", "=", "new", "PropertyExpression", "(", "new", "ClassExpression", "(", "outer", ")", ",", "expression", ".", "getProperty", "(", ")", ")", ";", "pexp", ".", "visit", "(", "controller", ".", "getAcg", "(", ")", ")", ";", "return", ";", "}", "outer", "=", "outer", ".", "getSuperClass", "(", ")", ";", "}", "}", "}", "}", "if", "(", "field", "!=", "null", "&&", "!", "privateSuperField", ")", "{", "visitFieldExpression", "(", "new", "FieldExpression", "(", "field", ")", ")", ";", "return", ";", "}", "}", "if", "(", "isSuperExpression", "(", "objectExpression", ")", ")", "{", "String", "prefix", ";", "if", "(", "controller", ".", "getCompileStack", "(", ")", ".", "isLHS", "(", ")", ")", "{", "prefix", "=", "\"set\"", ";", "}", "else", "{", "prefix", "=", "\"get\"", ";", "}", "String", "propName", "=", "prefix", "+", "MetaClassHelper", ".", "capitalize", "(", "name", ")", ";", "visitMethodCallExpression", "(", "new", "MethodCallExpression", "(", "objectExpression", ",", "propName", ",", "MethodCallExpression", ".", "NO_ARGUMENTS", ")", ")", ";", "return", ";", "}", "}", "final", "String", "propName", "=", "expression", ".", "getPropertyAsString", "(", ")", ";", "if", "(", "expression", ".", "getObjectExpression", "(", ")", "instanceof", "ClassExpression", "&&", "propName", "!=", "null", "&&", "propName", ".", "equals", "(", "\"this\"", ")", ")", "{", "ClassNode", "type", "=", "objectExpression", ".", "getType", "(", ")", ";", "ClassNode", "iterType", "=", "classNode", ";", "mv", ".", "visitVarInsn", "(", "ALOAD", ",", "0", ")", ";", "while", "(", "!", "iterType", ".", "equals", "(", "type", ")", ")", "{", "String", "ownerName", "=", "BytecodeHelper", ".", "getClassInternalName", "(", "iterType", ")", ";", "iterType", "=", "iterType", ".", "getOuterClass", "(", ")", ";", "String", "typeName", "=", "BytecodeHelper", ".", "getTypeDescription", "(", "iterType", ")", ";", "mv", ".", "visitFieldInsn", "(", "GETFIELD", ",", "ownerName", ",", "\"this$0\"", ",", "typeName", ")", ";", "}", "controller", ".", "getOperandStack", "(", ")", ".", "push", "(", "type", ")", ";", "return", ";", "}", "if", "(", "adapter", "==", "getProperty", "&&", "!", "expression", ".", "isSpreadSafe", "(", ")", "&&", "propName", "!=", "null", ")", "{", "controller", ".", "getCallSiteWriter", "(", ")", ".", "makeGetPropertySite", "(", "objectExpression", ",", "propName", ",", "expression", ".", "isSafe", "(", ")", ",", "expression", ".", "isImplicitThis", "(", ")", ")", ";", "}", "else", "if", "(", "adapter", "==", "getGroovyObjectProperty", "&&", "!", "expression", ".", "isSpreadSafe", "(", ")", "&&", "propName", "!=", "null", ")", "{", "controller", ".", "getCallSiteWriter", "(", ")", ".", "makeGroovyObjectGetPropertySite", "(", "objectExpression", ",", "propName", ",", "expression", ".", "isSafe", "(", ")", ",", "expression", ".", "isImplicitThis", "(", ")", ")", ";", "}", "else", "{", "if", "(", "controller", ".", "getCompileStack", "(", ")", ".", "isLHS", "(", ")", ")", "controller", ".", "getOperandStack", "(", ")", ".", "box", "(", ")", ";", "controller", ".", "getInvocationWriter", "(", ")", ".", "makeCall", "(", "expression", ",", "objectExpression", ",", "new", "CastExpression", "(", "ClassHelper", ".", "STRING_TYPE", ",", "expression", ".", "getProperty", "(", ")", ")", ",", "MethodCallExpression", ".", "NO_ARGUMENTS", ",", "adapter", ",", "expression", ".", "isSafe", "(", ")", ",", "expression", ".", "isSpreadSafe", "(", ")", ",", "expression", ".", "isImplicitThis", "(", ")", ")", ";", "}", "}", "public", "void", "visitPropertyExpression", "(", "PropertyExpression", "expression", ")", "{", "Expression", "objectExpression", "=", "expression", ".", "getObjectExpression", "(", ")", ";", "OperandStack", "operandStack", "=", "controller", ".", "getOperandStack", "(", ")", ";", "int", "mark", "=", "operandStack", ".", "getStackLength", "(", ")", "-", "1", ";", "MethodCallerMultiAdapter", "adapter", ";", "if", "(", "controller", ".", "getCompileStack", "(", ")", ".", "isLHS", "(", ")", ")", "{", "adapter", "=", "setProperty", ";", "if", "(", "isGroovyObject", "(", "objectExpression", ")", ")", "adapter", "=", "setGroovyObjectProperty", ";", "if", "(", "controller", ".", "isStaticContext", "(", ")", "&&", "isThisOrSuper", "(", "objectExpression", ")", ")", "adapter", "=", "setProperty", ";", "}", "else", "{", "adapter", "=", "getProperty", ";", "if", "(", "isGroovyObject", "(", "objectExpression", ")", ")", "adapter", "=", "getGroovyObjectProperty", ";", "if", "(", "controller", ".", "isStaticContext", "(", ")", "&&", "isThisOrSuper", "(", "objectExpression", ")", ")", "adapter", "=", "getProperty", ";", "}", "visitAttributeOrProperty", "(", "expression", ",", "adapter", ")", ";", "if", "(", "controller", ".", "getCompileStack", "(", ")", ".", "isLHS", "(", ")", ")", "{", "operandStack", ".", "remove", "(", "operandStack", ".", "getStackLength", "(", ")", "-", "mark", ")", ";", "}", "else", "{", "controller", ".", "getAssertionWriter", "(", ")", ".", "record", "(", "expression", ".", "getProperty", "(", ")", ")", ";", "}", "}", "public", "void", "visitAttributeExpression", "(", "AttributeExpression", "expression", ")", "{", "Expression", "objectExpression", "=", "expression", ".", "getObjectExpression", "(", ")", ";", "MethodCallerMultiAdapter", "adapter", ";", "if", "(", "controller", ".", "getCompileStack", "(", ")", ".", "isLHS", "(", ")", ")", "{", "adapter", "=", "setField", ";", "if", "(", "isGroovyObject", "(", "objectExpression", ")", ")", "adapter", "=", "setGroovyObjectField", ";", "if", "(", "usesSuper", "(", "expression", ")", ")", "adapter", "=", "setFieldOnSuper", ";", "}", "else", "{", "adapter", "=", "getField", ";", "if", "(", "isGroovyObject", "(", "objectExpression", ")", ")", "adapter", "=", "getGroovyObjectField", ";", "if", "(", "usesSuper", "(", "expression", ")", ")", "adapter", "=", "getFieldOnSuper", ";", "}", "visitAttributeOrProperty", "(", "expression", ",", "adapter", ")", ";", "if", "(", "!", "controller", ".", "getCompileStack", "(", ")", ".", "isLHS", "(", ")", ")", "{", "controller", ".", "getAssertionWriter", "(", ")", ".", "record", "(", "expression", ".", "getProperty", "(", ")", ")", ";", "}", "else", "{", "controller", ".", "getOperandStack", "(", ")", ".", "remove", "(", "2", ")", ";", "}", "}", "private", "static", "boolean", "usesSuper", "(", "PropertyExpression", "pe", ")", "{", "Expression", "expression", "=", "pe", ".", "getObjectExpression", "(", ")", ";", "if", "(", "expression", "instanceof", "VariableExpression", ")", "{", "VariableExpression", "varExp", "=", "(", "VariableExpression", ")", "expression", ";", "String", "variable", "=", "varExp", ".", "getName", "(", ")", ";", "return", "variable", ".", "equals", "(", "\"super\"", ")", ";", "}", "return", "false", ";", "}", "private", "static", "boolean", "isGroovyObject", "(", "Expression", "objectExpression", ")", "{", "return", "isThisExpression", "(", "objectExpression", ")", "||", "objectExpression", ".", "getType", "(", ")", ".", "isDerivedFromGroovyObject", "(", ")", "&&", "!", "(", "objectExpression", "instanceof", "ClassExpression", ")", ";", "}", "public", "void", "visitFieldExpression", "(", "FieldExpression", "expression", ")", "{", "FieldNode", "field", "=", "expression", ".", "getField", "(", ")", ";", "if", "(", "field", ".", "isStatic", "(", ")", ")", "{", "if", "(", "controller", ".", "getCompileStack", "(", ")", ".", "isLHS", "(", ")", ")", "{", "storeStaticField", "(", "expression", ")", ";", "}", "else", "{", "loadStaticField", "(", "expression", ")", ";", "}", "}", "else", "{", "if", "(", "controller", ".", "getCompileStack", "(", ")", ".", "isLHS", "(", ")", ")", "{", "storeThisInstanceField", "(", "expression", ")", ";", "}", "else", "{", "loadInstanceField", "(", "expression", ")", ";", "}", "}", "if", "(", "controller", ".", "getCompileStack", "(", ")", ".", "isLHS", "(", ")", ")", "controller", ".", "getAssertionWriter", "(", ")", ".", "record", "(", "expression", ")", ";", "}", "public", "void", "loadStaticField", "(", "FieldExpression", "fldExp", ")", "{", "MethodVisitor", "mv", "=", "controller", ".", "getMethodVisitor", "(", ")", ";", "FieldNode", "field", "=", "fldExp", ".", "getField", "(", ")", ";", "boolean", "holder", "=", "field", ".", "isHolder", "(", ")", "&&", "!", "controller", ".", "isInClosureConstructor", "(", ")", ";", "ClassNode", "type", "=", "field", ".", "getType", "(", ")", ";", "String", "ownerName", "=", "(", "field", ".", "getOwner", "(", ")", ".", "equals", "(", "controller", ".", "getClassNode", "(", ")", ")", ")", "?", "controller", ".", "getInternalClassName", "(", ")", ":", "BytecodeHelper", ".", "getClassInternalName", "(", "field", ".", "getOwner", "(", ")", ")", ";", "if", "(", "holder", ")", "{", "mv", ".", "visitFieldInsn", "(", "GETSTATIC", ",", "ownerName", ",", "fldExp", ".", "getFieldName", "(", ")", ",", "BytecodeHelper", ".", "getTypeDescription", "(", "type", ")", ")", ";", "mv", ".", "visitMethodInsn", "(", "INVOKEVIRTUAL", ",", "\"\"", ",", "\"get\"", ",", "\"\"", ")", ";", "controller", ".", "getOperandStack", "(", ")", ".", "push", "(", "ClassHelper", ".", "OBJECT_TYPE", ")", ";", "}", "else", "{", "mv", ".", "visitFieldInsn", "(", "GETSTATIC", ",", "ownerName", ",", "fldExp", ".", "getFieldName", "(", ")", ",", "BytecodeHelper", ".", "getTypeDescription", "(", "type", ")", ")", ";", "controller", ".", "getOperandStack", "(", ")", ".", "push", "(", "field", ".", "getType", "(", ")", ")", ";", "}", "}", "public", "void", "loadInstanceField", "(", "FieldExpression", "fldExp", ")", "{", "MethodVisitor", "mv", "=", "controller", ".", "getMethodVisitor", "(", ")", ";", "FieldNode", "field", "=", "fldExp", ".", "getField", "(", ")", ";", "boolean", "holder", "=", "field", ".", "isHolder", "(", ")", "&&", "!", "controller", ".", "isInClosureConstructor", "(", ")", ";", "ClassNode", "type", "=", "field", ".", "getType", "(", ")", ";", "String", "ownerName", "=", "(", "field", ".", "getOwner", "(", ")", ".", "equals", "(", "controller", ".", "getClassNode", "(", ")", ")", ")", "?", "controller", ".", "getInternalClassName", "(", ")", ":", "BytecodeHelper", ".", "getClassInternalName", "(", "field", ".", "getOwner", "(", ")", ")", ";", "mv", ".", "visitVarInsn", "(", "ALOAD", ",", "0", ")", ";", "mv", ".", "visitFieldInsn", "(", "GETFIELD", ",", "ownerName", ",", "fldExp", ".", "getFieldName", "(", ")", ",", "BytecodeHelper", ".", "getTypeDescription", "(", "type", ")", ")", ";", "if", "(", "holder", ")", "{", "mv", ".", "visitMethodInsn", "(", "INVOKEVIRTUAL", ",", "\"\"", ",", "\"get\"", ",", "\"\"", ")", ";", "controller", ".", "getOperandStack", "(", ")", ".", "push", "(", "ClassHelper", ".", "OBJECT_TYPE", ")", ";", "}", "else", "{", "controller", ".", "getOperandStack", "(", ")", ".", "push", "(", "field", ".", "getType", "(", ")", ")", ";", "}", "}", "private", "void", "storeThisInstanceField", "(", "FieldExpression", "expression", ")", "{", "MethodVisitor", "mv", "=", "controller", ".", "getMethodVisitor", "(", ")", ";", "FieldNode", "field", "=", "expression", ".", "getField", "(", ")", ";", "boolean", "setReferenceFromReference", "=", "field", ".", "isHolder", "(", ")", "&&", "expression", ".", "isUseReferenceDirectly", "(", ")", ";", "String", "ownerName", "=", "(", "field", ".", "getOwner", "(", ")", ".", "equals", "(", "controller", ".", "getClassNode", "(", ")", ")", ")", "?", "controller", ".", "getInternalClassName", "(", ")", ":", "BytecodeHelper", ".", "getClassInternalName", "(", "field", ".", "getOwner", "(", ")", ")", ";", "OperandStack", "operandStack", "=", "controller", ".", "getOperandStack", "(", ")", ";", "if", "(", "setReferenceFromReference", ")", "{", "mv", ".", "visitVarInsn", "(", "ALOAD", ",", "0", ")", ";", "operandStack", ".", "push", "(", "controller", ".", "getClassNode", "(", ")", ")", ";", "operandStack", ".", "swap", "(", ")", ";", "mv", ".", "visitFieldInsn", "(", "PUTFIELD", ",", "ownerName", ",", "field", ".", "getName", "(", ")", ",", "BytecodeHelper", ".", "getTypeDescription", "(", "field", ".", "getType", "(", ")", ")", ")", ";", "}", "else", "if", "(", "field", ".", "isHolder", "(", ")", ")", "{", "operandStack", ".", "doGroovyCast", "(", "field", ".", "getOriginType", "(", ")", ")", ";", "operandStack", ".", "box", "(", ")", ";", "mv", ".", "visitVarInsn", "(", "ALOAD", ",", "0", ")", ";", "mv", ".", "visitFieldInsn", "(", "GETFIELD", ",", "ownerName", ",", "expression", ".", "getFieldName", "(", ")", ",", "BytecodeHelper", ".", "getTypeDescription", "(", "field", ".", "getType", "(", ")", ")", ")", ";", "mv", ".", "visitInsn", "(", "SWAP", ")", ";", "mv", ".", "visitMethodInsn", "(", "INVOKEVIRTUAL", ",", "\"\"", ",", "\"set\"", ",", "\"\"", ")", ";", "}", "else", "{", "operandStack", ".", "doGroovyCast", "(", "field", ".", "getOriginType", "(", ")", ")", ";", "mv", ".", "visitVarInsn", "(", "ALOAD", ",", "0", ")", ";", "operandStack", ".", "push", "(", "controller", ".", "getClassNode", "(", ")", ")", ";", "operandStack", ".", "swap", "(", ")", ";", "mv", ".", "visitFieldInsn", "(", "PUTFIELD", ",", "ownerName", ",", "field", ".", "getName", "(", ")", ",", "BytecodeHelper", ".", "getTypeDescription", "(", "field", ".", "getType", "(", ")", ")", ")", ";", "}", "}", "private", "void", "storeStaticField", "(", "FieldExpression", "expression", ")", "{", "MethodVisitor", "mv", "=", "controller", ".", "getMethodVisitor", "(", ")", ";", "FieldNode", "field", "=", "expression", ".", "getField", "(", ")", ";", "boolean", "holder", "=", "field", ".", "isHolder", "(", ")", "&&", "!", "controller", ".", "isInClosureConstructor", "(", ")", ";", "controller", ".", "getOperandStack", "(", ")", ".", "doGroovyCast", "(", "field", ")", ";", "String", "ownerName", "=", "(", "field", ".", "getOwner", "(", ")", ".", "equals", "(", "controller", ".", "getClassNode", "(", ")", ")", ")", "?", "controller", ".", "getInternalClassName", "(", ")", ":", "BytecodeHelper", ".", "getClassInternalName", "(", "field", ".", "getOwner", "(", ")", ")", ";", "if", "(", "holder", ")", "{", "controller", ".", "getOperandStack", "(", ")", ".", "box", "(", ")", ";", "mv", ".", "visitFieldInsn", "(", "GETSTATIC", ",", "ownerName", ",", "expression", ".", "getFieldName", "(", ")", ",", "BytecodeHelper", ".", "getTypeDescription", "(", "field", ".", "getType", "(", ")", ")", ")", ";", "mv", ".", "visitInsn", "(", "SWAP", ")", ";", "mv", ".", "visitMethodInsn", "(", "INVOKEVIRTUAL", ",", "\"\"", ",", "\"set\"", ",", "\"\"", ")", ";", "}", "else", "{", "mv", ".", "visitFieldInsn", "(", "PUTSTATIC", ",", "ownerName", ",", "expression", ".", "getFieldName", "(", ")", ",", "BytecodeHelper", ".", "getTypeDescription", "(", "field", ".", "getType", "(", ")", ")", ")", ";", "}", "controller", ".", "getOperandStack", "(", ")", ".", "remove", "(", "1", ")", ";", "}", "public", "void", "visitVariableExpression", "(", "VariableExpression", "expression", ")", "{", "String", "variableName", "=", "expression", ".", "getName", "(", ")", ";", "ClassNode", "classNode", "=", "controller", ".", "getClassNode", "(", ")", ";", "if", "(", "variableName", ".", "equals", "(", "\"this\"", ")", ")", "{", "if", "(", "controller", ".", "isStaticMethod", "(", ")", "||", "(", "!", "controller", ".", "getCompileStack", "(", ")", ".", "isImplicitThis", "(", ")", "&&", "controller", ".", "isStaticContext", "(", ")", ")", ")", "{", "if", "(", "controller", ".", "isInClosure", "(", ")", ")", "classNode", "=", "controller", ".", "getOutermostClass", "(", ")", ";", "visitClassExpression", "(", "new", "ClassExpression", "(", "classNode", ")", ")", ";", "}", "else", "{", "loadThis", "(", ")", ";", "}", "return", ";", "}", "if", "(", "variableName", ".", "equals", "(", "\"super\"", ")", ")", "{", "if", "(", "controller", ".", "isStaticMethod", "(", ")", ")", "{", "visitClassExpression", "(", "new", "ClassExpression", "(", "classNode", ".", "getSuperClass", "(", ")", ")", ")", ";", "}", "else", "{", "loadThis", "(", ")", ";", "}", "return", ";", "}", "BytecodeVariable", "variable", "=", "controller", ".", "getCompileStack", "(", ")", ".", "getVariable", "(", "variableName", ",", "false", ")", ";", "if", "(", "variable", "==", "null", ")", "{", "processClassVariable", "(", "variableName", ")", ";", "}", "else", "{", "controller", ".", "getOperandStack", "(", ")", ".", "loadOrStoreVariable", "(", "variable", ",", "expression", ".", "isUseReferenceDirectly", "(", ")", ")", ";", "}", "if", "(", "!", "controller", ".", "getCompileStack", "(", ")", ".", "isLHS", "(", ")", ")", "controller", ".", "getAssertionWriter", "(", ")", ".", "record", "(", "expression", ")", ";", "}", "private", "void", "loadThis", "(", ")", "{", "MethodVisitor", "mv", "=", "controller", ".", "getMethodVisitor", "(", ")", ";", "mv", ".", "visitVarInsn", "(", "ALOAD", ",", "0", ")", ";", "if", "(", "controller", ".", "isInClosure", "(", ")", "&&", "!", "controller", ".", "getCompileStack", "(", ")", ".", "isImplicitThis", "(", ")", ")", "{", "mv", ".", "visitMethodInsn", "(", "INVOKEVIRTUAL", ",", "\"\"", ",", "\"\"", ",", "\"\"", ")", ";", "controller", ".", "getOperandStack", "(", ")", ".", "push", "(", "ClassHelper", ".", "OBJECT_TYPE", ")", ";", "}", "else", "{", "controller", ".", "getOperandStack", "(", ")", ".", "push", "(", "controller", ".", "getClassNode", "(", ")", ")", ";", "}", "}", "private", "void", "processClassVariable", "(", "String", "name", ")", "{", "if", "(", "passingParams", "&&", "controller", ".", "isInScriptBody", "(", ")", ")", "{", "MethodVisitor", "mv", "=", "controller", ".", "getMethodVisitor", "(", ")", ";", "mv", ".", "visitTypeInsn", "(", "NEW", ",", "\"\"", ")", ";", "mv", ".", "visitInsn", "(", "DUP", ")", ";", "loadThisOrOwner", "(", ")", ";", "mv", ".", "visitLdcInsn", "(", "name", ")", ";", "mv", ".", "visitMethodInsn", "(", "INVOKESPECIAL", ",", "\"\"", ",", "\"<init>\"", ",", "\"\"", ")", ";", "}", "else", "{", "PropertyExpression", "pexp", "=", "new", "PropertyExpression", "(", "VariableExpression", ".", "THIS_EXPRESSION", ",", "name", ")", ";", "pexp", ".", "setImplicitThis", "(", "true", ")", ";", "visitPropertyExpression", "(", "pexp", ")", ";", "}", "}", "protected", "void", "createInterfaceSyntheticStaticFields", "(", ")", "{", "if", "(", "referencedClasses", ".", "isEmpty", "(", ")", ")", "{", "controller", ".", "getClassNode", "(", ")", ".", "forgetInnerClass", "(", "controller", ".", "getInterfaceClassLoadingClass", "(", ")", ")", ";", "return", ";", "}", "ClassNode", "icl", "=", "controller", ".", "getInterfaceClassLoadingClass", "(", ")", ";", "addInnerClass", "(", "icl", ")", ";", "for", "(", "String", "staticFieldName", ":", "referencedClasses", ".", "keySet", "(", ")", ")", "{", "icl", ".", "addField", "(", "staticFieldName", ",", "ACC_STATIC", "+", "ACC_SYNTHETIC", ",", "ClassHelper", ".", "CLASS_Type", ".", "getPlainNodeReference", "(", ")", ",", "new", "ClassExpression", "(", "referencedClasses", ".", "get", "(", "staticFieldName", ")", ")", ")", ";", "}", "}", "protected", "void", "createSyntheticStaticFields", "(", ")", "{", "MethodVisitor", "mv", "=", "controller", ".", "getMethodVisitor", "(", ")", ";", "for", "(", "String", "staticFieldName", ":", "referencedClasses", ".", "keySet", "(", ")", ")", "{", "FieldNode", "fn", "=", "controller", ".", "getClassNode", "(", ")", ".", "getDeclaredField", "(", "staticFieldName", ")", ";", "if", "(", "fn", "!=", "null", ")", "{", "boolean", "type", "=", "fn", ".", "getType", "(", ")", ".", "redirect", "(", ")", "==", "ClassHelper", ".", "CLASS_Type", ";", "boolean", "modifiers", "=", "fn", ".", "getModifiers", "(", ")", "==", "ACC_STATIC", "+", "ACC_SYNTHETIC", ";", "if", "(", "!", "type", "||", "!", "modifiers", ")", "{", "String", "text", "=", "\"\"", ";", "if", "(", "!", "type", ")", "text", "=", "\"\"", "+", "fn", ".", "getType", "(", ")", "+", "\"\"", ";", "if", "(", "!", "modifiers", ")", "text", "=", "\"\"", "+", "fn", ".", "getModifiers", "(", ")", "+", "\"", "(\"", "+", "(", "ACC_STATIC", "+", "ACC_SYNTHETIC", ")", "+", "\"", "needed)\"", ";", "throwException", "(", "\"\"", "+", "staticFieldName", "+", "\"", "in", "\"", "+", "controller", ".", "getClassNode", "(", ")", ".", "getName", "(", ")", "+", "\"\"", "+", "\"", "name", "\"", "+", "text", ")", ";", "}", "}", "else", "{", "cv", ".", "visitField", "(", "ACC_PRIVATE", "+", "ACC_STATIC", "+", "ACC_SYNTHETIC", ",", "staticFieldName", ",", "\"\"", ",", "null", ",", "null", ")", ";", "}", "mv", "=", "cv", ".", "visitMethod", "(", "ACC_PRIVATE", "+", "ACC_STATIC", "+", "ACC_SYNTHETIC", ",", "\"$get$\"", "+", "staticFieldName", ",", "\"\"", ",", "null", ",", "null", ")", ";", "mv", ".", "visitCode", "(", ")", ";", "mv", ".", "visitFieldInsn", "(", "GETSTATIC", ",", "controller", ".", "getInternalClassName", "(", ")", ",", "staticFieldName", ",", "\"\"", ")", ";", "mv", ".", "visitInsn", "(", "DUP", ")", ";", "Label", "l0", "=", "new", "Label", "(", ")", ";", "mv", ".", "visitJumpInsn", "(", "IFNONNULL", ",", "l0", ")", ";", "mv", ".", "visitInsn", "(", "POP", ")", ";", "mv", ".", "visitLdcInsn", "(", "BytecodeHelper", ".", "getClassLoadingTypeDescription", "(", "referencedClasses", ".", "get", "(", "staticFieldName", ")", ")", ")", ";", "mv", ".", "visitMethodInsn", "(", "INVOKESTATIC", ",", "controller", ".", "getInternalClassName", "(", ")", ",", "\"class$\"", ",", "\"\"", ")", ";", "mv", ".", "visitInsn", "(", "DUP", ")", ";", "mv", ".", "visitFieldInsn", "(", "PUTSTATIC", ",", "controller", ".", "getInternalClassName", "(", ")", ",", "staticFieldName", ",", "\"\"", ")", ";", "mv", ".", "visitLabel", "(", "l0", ")", ";", "mv", ".", "visitInsn", "(", "ARETURN", ")", ";", "mv", ".", "visitMaxs", "(", "0", ",", "0", ")", ";", "mv", ".", "visitEnd", "(", ")", ";", "}", "mv", "=", "cv", ".", "visitMethod", "(", "ACC_STATIC", "+", "ACC_SYNTHETIC", ",", "\"class$\"", ",", "\"\"", ",", "null", ",", "null", ")", ";", "Label", "l0", "=", "new", "Label", "(", ")", ";", "mv", ".", "visitLabel", "(", "l0", ")", ";", "mv", ".", "visitVarInsn", "(", "ALOAD", ",", "0", ")", ";", "mv", ".", "visitMethodInsn", "(", "INVOKESTATIC", ",", "\"\"", ",", "\"forName\"", ",", "\"\"", ")", ";", "Label", "l1", "=", "new", "Label", "(", ")", ";", "mv", ".", "visitLabel", "(", "l1", ")", ";", "mv", ".", "visitInsn", "(", "ARETURN", ")", ";", "Label", "l2", "=", "new", "Label", "(", ")", ";", "mv", ".", "visitLabel", "(", "l2", ")", ";", "mv", ".", "visitVarInsn", "(", "ASTORE", ",", "1", ")", ";", "mv", ".", "visitTypeInsn", "(", "NEW", ",", "\"\"", ")", ";", "mv", ".", "visitInsn", "(", "DUP", ")", ";", "mv", ".", "visitVarInsn", "(", "ALOAD", ",", "1", ")", ";", "mv", ".", "visitMethodInsn", "(", "INVOKEVIRTUAL", ",", "\"\"", ",", "\"getMessage\"", ",", "\"\"", ")", ";", "mv", ".", "visitMethodInsn", "(", "INVOKESPECIAL", ",", "\"\"", ",", "\"<init>\"", ",", "\"\"", ")", ";", "mv", ".", "visitInsn", "(", "ATHROW", ")", ";", "mv", ".", "visitTryCatchBlock", "(", "l0", ",", "l2", ",", "l2", ",", "\"\"", ")", ";", "mv", ".", "visitMaxs", "(", "3", ",", "2", ")", ";", "}", "public", "void", "visitClassExpression", "(", "ClassExpression", "expression", ")", "{", "ClassNode", "type", "=", "expression", ".", "getType", "(", ")", ";", "MethodVisitor", "mv", "=", "controller", ".", "getMethodVisitor", "(", ")", ";", "if", "(", "ClassHelper", ".", "isPrimitiveType", "(", "type", ")", ")", "{", "ClassNode", "objectType", "=", "ClassHelper", ".", "getWrapper", "(", "type", ")", ";", "mv", ".", "visitFieldInsn", "(", "GETSTATIC", ",", "BytecodeHelper", ".", "getClassInternalName", "(", "objectType", ")", ",", "\"TYPE\"", ",", "\"\"", ")", ";", "}", "else", "{", "String", "staticFieldName", "=", "getStaticFieldName", "(", "type", ")", ";", "referencedClasses", ".", "put", "(", "staticFieldName", ",", "type", ")", ";", "String", "internalClassName", "=", "controller", ".", "getInternalClassName", "(", ")", ";", "if", "(", "controller", ".", "getClassNode", "(", ")", ".", "isInterface", "(", ")", ")", "{", "internalClassName", "=", "BytecodeHelper", ".", "getClassInternalName", "(", "controller", ".", "getInterfaceClassLoadingClass", "(", ")", ")", ";", "mv", ".", "visitFieldInsn", "(", "GETSTATIC", ",", "internalClassName", ",", "staticFieldName", ",", "\"\"", ")", ";", "}", "else", "{", "mv", ".", "visitMethodInsn", "(", "INVOKESTATIC", ",", "internalClassName", ",", "\"$get$\"", "+", "staticFieldName", ",", "\"\"", ")", ";", "}", "}", "controller", ".", "getOperandStack", "(", ")", ".", "push", "(", "ClassHelper", ".", "CLASS_Type", ")", ";", "}", "public", "void", "visitRangeExpression", "(", "RangeExpression", "expression", ")", "{", "OperandStack", "operandStack", "=", "controller", ".", "getOperandStack", "(", ")", ";", "expression", ".", "getFrom", "(", ")", ".", "visit", "(", "this", ")", ";", "operandStack", ".", "box", "(", ")", ";", "expression", ".", "getTo", "(", ")", ".", "visit", "(", "this", ")", ";", "operandStack", ".", "box", "(", ")", ";", "operandStack", ".", "pushBool", "(", "expression", ".", "isInclusive", "(", ")", ")", ";", "createRangeMethod", ".", "call", "(", "controller", ".", "getMethodVisitor", "(", ")", ")", ";", "operandStack", ".", "replace", "(", "ClassHelper", ".", "RANGE_TYPE", ",", "3", ")", ";", "}", "public", "void", "visitMapEntryExpression", "(", "MapEntryExpression", "expression", ")", "{", "throw", "new", "GroovyBugError", "(", "\"\"", ")", ";", "}", "public", "void", "visitMapExpression", "(", "MapExpression", "expression", ")", "{", "MethodVisitor", "mv", "=", "controller", ".", "getMethodVisitor", "(", ")", ";", "List", "entries", "=", "expression", ".", "getMapEntryExpressions", "(", ")", ";", "int", "size", "=", "entries", ".", "size", "(", ")", ";", "BytecodeHelper", ".", "pushConstant", "(", "mv", ",", "size", "*", "2", ")", ";", "mv", ".", "visitTypeInsn", "(", "ANEWARRAY", ",", "\"\"", ")", ";", "int", "i", "=", "0", ";", "for", "(", "Iterator", "iter", "=", "entries", ".", "iterator", "(", ")", ";", "iter", ".", "hasNext", "(", ")", ";", ")", "{", "Object", "object", "=", "iter", ".", "next", "(", ")", ";", "MapEntryExpression", "entry", "=", "(", "MapEntryExpression", ")", "object", ";", "mv", ".", "visitInsn", "(", "DUP", ")", ";", "BytecodeHelper", ".", "pushConstant", "(", "mv", ",", "i", "++", ")", ";", "entry", ".", "getKeyExpression", "(", ")", ".", "visit", "(", "this", ")", ";", "controller", ".", "getOperandStack", "(", ")", ".", "box", "(", ")", ";", "mv", ".", "visitInsn", "(", "AASTORE", ")", ";", "mv", ".", "visitInsn", "(", "DUP", ")", ";", "BytecodeHelper", ".", "pushConstant", "(", "mv", ",", "i", "++", ")", ";", "entry", ".", "getValueExpression", "(", ")", ".", "visit", "(", "this", ")", ";", "controller", ".", "getOperandStack", "(", ")", ".", "box", "(", ")", ";", "mv", ".", "visitInsn", "(", "AASTORE", ")", ";", "controller", ".", "getOperandStack", "(", ")", ".", "remove", "(", "2", ")", ";", "}", "createMapMethod", ".", "call", "(", "mv", ")", ";", "controller", ".", "getOperandStack", "(", ")", ".", "push", "(", "ClassHelper", ".", "MAP_TYPE", ")", ";", "}", "public", "void", "visitArgumentlistExpression", "(", "ArgumentListExpression", "ale", ")", "{", "if", "(", "containsSpreadExpression", "(", "ale", ")", ")", "{", "despreadList", "(", "ale", ".", "getExpressions", "(", ")", ",", "true", ")", ";", "}", "else", "{", "visitTupleExpression", "(", "ale", ",", "true", ")", ";", "}", "}", "public", "void", "despreadList", "(", "List", "expressions", ",", "boolean", "wrap", ")", "{", "ArrayList", "spreadIndexes", "=", "new", "ArrayList", "(", ")", ";", "ArrayList", "spreadExpressions", "=", "new", "ArrayList", "(", ")", ";", "ArrayList", "normalArguments", "=", "new", "ArrayList", "(", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "expressions", ".", "size", "(", ")", ";", "i", "++", ")", "{", "Object", "expr", "=", "expressions", ".", "get", "(", "i", ")", ";", "if", "(", "!", "(", "expr", "instanceof", "SpreadExpression", ")", ")", "{", "normalArguments", ".", "add", "(", "expr", ")", ";", "}", "else", "{", "spreadIndexes", ".", "add", "(", "new", "ConstantExpression", "(", "Integer", ".", "valueOf", "(", "i", "-", "spreadExpressions", ".", "size", "(", ")", ")", ",", "true", ")", ")", ";", "spreadExpressions", ".", "add", "(", "(", "(", "SpreadExpression", ")", "expr", ")", ".", "getExpression", "(", ")", ")", ";", "}", "}", "visitTupleExpression", "(", "new", "ArgumentListExpression", "(", "normalArguments", ")", ",", "wrap", ")", ";", "(", "new", "TupleExpression", "(", "spreadExpressions", ")", ")", ".", "visit", "(", "this", ")", ";", "(", "new", "ArrayExpression", "(", "ClassHelper", ".", "int_TYPE", ",", "spreadIndexes", ",", "null", ")", ")", ".", "visit", "(", "this", ")", ";", "controller", ".", "getOperandStack", "(", ")", ".", "remove", "(", "1", ")", ";", "despreadList", ".", "call", "(", "controller", ".", "getMethodVisitor", "(", ")", ")", ";", "}", "public", "void", "visitTupleExpression", "(", "TupleExpression", "expression", ")", "{", "visitTupleExpression", "(", "expression", ",", "false", ")", ";", "}", "void", "visitTupleExpression", "(", "TupleExpression", "expression", ",", "boolean", "useWrapper", ")", "{", "MethodVisitor", "mv", "=", "controller", ".", "getMethodVisitor", "(", ")", ";", "int", "size", "=", "expression", ".", "getExpressions", "(", ")", ".", "size", "(", ")", ";", "BytecodeHelper", ".", "pushConstant", "(", "mv", ",", "size", ")", ";", "mv", ".", "visitTypeInsn", "(", "ANEWARRAY", ",", "\"\"", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "size", ";", "i", "++", ")", "{", "mv", ".", "visitInsn", "(", "DUP", ")", ";", "BytecodeHelper", ".", "pushConstant", "(", "mv", ",", "i", ")", ";", "Expression", "argument", "=", "expression", ".", "getExpression", "(", "i", ")", ";", "argument", ".", "visit", "(", "this", ")", ";", "controller", ".", "getOperandStack", "(", ")", ".", "box", "(", ")", ";", "if", "(", "useWrapper", "&&", "argument", "instanceof", "CastExpression", ")", "loadWrapper", "(", "argument", ")", ";", "mv", ".", "visitInsn", "(", "AASTORE", ")", ";", "controller", ".", "getOperandStack", "(", ")", ".", "remove", "(", "1", ")", ";", "}", "}", "public", "void", "loadWrapper", "(", "Expression", "argument", ")", "{", "MethodVisitor", "mv", "=", "controller", ".", "getMethodVisitor", "(", ")", ";", "ClassNode", "goalClass", "=", "argument", ".", "getType", "(", ")", ";", "visitClassExpression", "(", "new", "ClassExpression", "(", "goalClass", ")", ")", ";", "if", "(", "goalClass", ".", "isDerivedFromGroovyObject", "(", ")", ")", "{", "createGroovyObjectWrapperMethod", ".", "call", "(", "mv", ")", ";", "}", "else", "{", "createPojoWrapperMethod", ".", "call", "(", "mv", ")", ";", "}", "controller", ".", "getOperandStack", "(", ")", ".", "remove", "(", "1", ")", ";", "}", "public", "void", "visitArrayExpression", "(", "ArrayExpression", "expression", ")", "{", "MethodVisitor", "mv", "=", "controller", ".", "getMethodVisitor", "(", ")", ";", "ClassNode", "elementType", "=", "expression", ".", "getElementType", "(", ")", ";", "String", "arrayTypeName", "=", "BytecodeHelper", ".", "getClassInternalName", "(", "elementType", ")", ";", "List", "sizeExpression", "=", "expression", ".", "getSizeExpression", "(", ")", ";", "int", "size", "=", "0", ";", "int", "dimensions", "=", "0", ";", "if", "(", "sizeExpression", "!=", "null", ")", "{", "for", "(", "Iterator", "iter", "=", "sizeExpression", ".", "iterator", "(", ")", ";", "iter", ".", "hasNext", "(", ")", ";", ")", "{", "Expression", "element", "=", "(", "Expression", ")", "iter", ".", "next", "(", ")", ";", "if", "(", "element", "==", "ConstantExpression", ".", "EMPTY_EXPRESSION", ")", "break", ";", "dimensions", "++", ";", "element", ".", "visit", "(", "this", ")", ";", "controller", ".", "getOperandStack", "(", ")", ".", "doGroovyCast", "(", "ClassHelper", ".", "int_TYPE", ")", ";", "}", "controller", ".", "getOperandStack", "(", ")", ".", "remove", "(", "dimensions", ")", ";", "}", "else", "{", "size", "=", "expression", ".", "getExpressions", "(", ")", ".", "size", "(", ")", ";", "BytecodeHelper", ".", "pushConstant", "(", "mv", ",", "size", ")", ";", "}", "int", "storeIns", "=", "AASTORE", ";", "if", "(", "sizeExpression", "!=", "null", ")", "{", "arrayTypeName", "=", "BytecodeHelper", ".", "getTypeDescription", "(", "expression", ".", "getType", "(", ")", ")", ";", "mv", ".", "visitMultiANewArrayInsn", "(", "arrayTypeName", ",", "dimensions", ")", ";", "}", "else", "if", "(", "ClassHelper", ".", "isPrimitiveType", "(", "elementType", ")", ")", "{", "int", "primType", "=", "0", ";", "if", "(", "elementType", "==", "ClassHelper", ".", "boolean_TYPE", ")", "{", "primType", "=", "T_BOOLEAN", ";", "storeIns", "=", "BASTORE", ";", "}", "else", "if", "(", "elementType", "==", "ClassHelper", ".", "char_TYPE", ")", "{", "primType", "=", "T_CHAR", ";", "storeIns", "=", "CASTORE", ";", "}", "else", "if", "(", "elementType", "==", "ClassHelper", ".", "float_TYPE", ")", "{", "primType", "=", "T_FLOAT", ";", "storeIns", "=", "FASTORE", ";", "}", "else", "if", "(", "elementType", "==", "ClassHelper", ".", "double_TYPE", ")", "{", "primType", "=", "T_DOUBLE", ";", "storeIns", "=", "DASTORE", ";", "}", "else", "if", "(", "elementType", "==", "ClassHelper", ".", "byte_TYPE", ")", "{", "primType", "=", "T_BYTE", ";", "storeIns", "=", "BASTORE", ";", "}", "else", "if", "(", "elementType", "==", "ClassHelper", ".", "short_TYPE", ")", "{", "primType", "=", "T_SHORT", ";", "storeIns", "=", "SASTORE", ";", "}", "else", "if", "(", "elementType", "==", "ClassHelper", ".", "int_TYPE", ")", "{", "primType", "=", "T_INT", ";", "storeIns", "=", "IASTORE", ";", "}", "else", "if", "(", "elementType", "==", "ClassHelper", ".", "long_TYPE", ")", "{", "primType", "=", "T_LONG", ";", "storeIns", "=", "LASTORE", ";", "}", "mv", ".", "visitIntInsn", "(", "NEWARRAY", ",", "primType", ")", ";", "}", "else", "{", "mv", ".", "visitTypeInsn", "(", "ANEWARRAY", ",", "arrayTypeName", ")", ";", "}", "for", "(", "int", "i", "=", "0", ";", "i", "<", "size", ";", "i", "++", ")", "{", "mv", ".", "visitInsn", "(", "DUP", ")", ";", "BytecodeHelper", ".", "pushConstant", "(", "mv", ",", "i", ")", ";", "Expression", "elementExpression", "=", "expression", ".", "getExpression", "(", "i", ")", ";", "if", "(", "elementExpression", "==", "null", ")", "{", "ConstantExpression", ".", "NULL", ".", "visit", "(", "this", ")", ";", "}", "else", "{", "if", "(", "!", "elementType", ".", "equals", "(", "elementExpression", ".", "getType", "(", ")", ")", ")", "{", "visitCastExpression", "(", "new", "CastExpression", "(", "elementType", ",", "elementExpression", ",", "true", ")", ")", ";", "}", "else", "{", "elementExpression", ".", "visit", "(", "this", ")", ";", "}", "}", "mv", ".", "visitInsn", "(", "storeIns", ")", ";", "controller", ".", "getOperandStack", "(", ")", ".", "remove", "(", "1", ")", ";", "}", "controller", ".", "getOperandStack", "(", ")", ".", "push", "(", "expression", ".", "getType", "(", ")", ")", ";", "}", "public", "void", "visitClosureListExpression", "(", "ClosureListExpression", "expression", ")", "{", "MethodVisitor", "mv", "=", "controller", ".", "getMethodVisitor", "(", ")", ";", "controller", ".", "getCompileStack", "(", ")", ".", "pushVariableScope", "(", "expression", ".", "getVariableScope", "(", ")", ")", ";", "List", "<", "Expression", ">", "expressions", "=", "expression", ".", "getExpressions", "(", ")", ";", "final", "int", "size", "=", "expressions", ".", "size", "(", ")", ";", "LinkedList", "<", "DeclarationExpression", ">", "declarations", "=", "new", "LinkedList", "<", "DeclarationExpression", ">", "(", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "size", ";", "i", "++", ")", "{", "Expression", "expr", "=", "expressions", ".", "get", "(", "i", ")", ";", "if", "(", "expr", "instanceof", "DeclarationExpression", ")", "{", "declarations", ".", "add", "(", "(", "DeclarationExpression", ")", "expr", ")", ";", "DeclarationExpression", "de", "=", "(", "DeclarationExpression", ")", "expr", ";", "BinaryExpression", "be", "=", "new", "BinaryExpression", "(", "de", ".", "getLeftExpression", "(", ")", ",", "de", ".", "getOperation", "(", ")", ",", "de", ".", "getRightExpression", "(", ")", ")", ";", "expressions", ".", "set", "(", "i", ",", "be", ")", ";", "de", ".", "setRightExpression", "(", "ConstantExpression", ".", "NULL", ")", ";", "visitDeclarationExpression", "(", "de", ")", ";", "}", "}", "LinkedList", "instructions", "=", "new", "LinkedList", "(", ")", ";", "BytecodeSequence", "seq", "=", "new", "BytecodeSequence", "(", "instructions", ")", ";", "BlockStatement", "bs", "=", "new", "BlockStatement", "(", ")", ";", "bs", ".", "addStatement", "(", "seq", ")", ";", "Parameter", "closureIndex", "=", "new", "Parameter", "(", "ClassHelper", ".", "int_TYPE", ",", "\"\"", ")", ";", "ClosureExpression", "ce", "=", "new", "ClosureExpression", "(", "new", "Parameter", "[", "]", "{", "closureIndex", "}", ",", "bs", ")", ";", "ce", ".", "setVariableScope", "(", "expression", ".", "getVariableScope", "(", ")", ")", ";", "instructions", ".", "add", "(", "ConstantExpression", ".", "NULL", ")", ";", "final", "Label", "dflt", "=", "new", "Label", "(", ")", ";", "final", "Label", "tableEnd", "=", "new", "Label", "(", ")", ";", "final", "Label", "[", "]", "labels", "=", "new", "Label", "[", "size", "]", ";", "instructions", ".", "add", "(", "new", "BytecodeInstruction", "(", ")", "{", "public", "void", "visit", "(", "MethodVisitor", "mv", ")", "{", "mv", ".", "visitVarInsn", "(", "ILOAD", ",", "1", ")", ";", "mv", ".", "visitTableSwitchInsn", "(", "0", ",", "size", "-", "1", ",", "dflt", ",", "labels", ")", ";", "}", "}", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "size", ";", "i", "++", ")", "{", "final", "Label", "label", "=", "new", "Label", "(", ")", ";", "Object", "expr", "=", "expressions", ".", "get", "(", "i", ")", ";", "final", "boolean", "isStatement", "=", "expr", "instanceof", "Statement", ";", "labels", "[", "i", "]", "=", "label", ";", "instructions", ".", "add", "(", "new", "BytecodeInstruction", "(", ")", "{", "public", "void", "visit", "(", "MethodVisitor", "mv", ")", "{", "mv", ".", "visitLabel", "(", "label", ")", ";", "if", "(", "!", "isStatement", ")", "mv", ".", "visitInsn", "(", "POP", ")", ";", "}", "}", ")", ";", "instructions", ".", "add", "(", "expr", ")", ";", "instructions", ".", "add", "(", "new", "BytecodeInstruction", "(", ")", "{", "public", "void", "visit", "(", "MethodVisitor", "mv", ")", "{", "mv", ".", "visitJumpInsn", "(", "GOTO", ",", "tableEnd", ")", ";", "}", "}", ")", ";", "}", "{", "instructions", ".", "add", "(", "new", "BytecodeInstruction", "(", ")", "{", "public", "void", "visit", "(", "MethodVisitor", "mv", ")", "{", "mv", ".", "visitLabel", "(", "dflt", ")", ";", "}", "}", ")", ";", "ConstantExpression", "text", "=", "new", "ConstantExpression", "(", "\"\"", ")", ";", "ConstructorCallExpression", "cce", "=", "new", "ConstructorCallExpression", "(", "ClassHelper", ".", "make", "(", "IllegalArgumentException", ".", "class", ")", ",", "text", ")", ";", "ThrowStatement", "ts", "=", "new", "ThrowStatement", "(", "cce", ")", ";", "instructions", ".", "add", "(", "ts", ")", ";", "}", "instructions", ".", "add", "(", "new", "BytecodeInstruction", "(", ")", "{", "public", "void", "visit", "(", "MethodVisitor", "mv", ")", "{", "mv", ".", "visitLabel", "(", "tableEnd", ")", ";", "mv", ".", "visitInsn", "(", "ARETURN", ")", ";", "}", "}", ")", ";", "visitClosureExpression", "(", "ce", ")", ";", "BytecodeHelper", ".", "pushConstant", "(", "mv", ",", "size", ")", ";", "mv", ".", "visitTypeInsn", "(", "ANEWARRAY", ",", "\"\"", ")", ";", "int", "listArrayVar", "=", "controller", ".", "getCompileStack", "(", ")", ".", "defineTemporaryVariable", "(", "\"\"", ",", "true", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "size", ";", "i", "++", ")", "{", "mv", ".", "visitTypeInsn", "(", "NEW", ",", "\"\"", ")", ";", "mv", ".", "visitInsn", "(", "DUP2", ")", ";", "mv", ".", "visitInsn", "(", "SWAP", ")", ";", "mv", ".", "visitInsn", "(", "ICONST_1", ")", ";", "mv", ".", "visitTypeInsn", "(", "ANEWARRAY", ",", "\"\"", ")", ";", "mv", ".", "visitInsn", "(", "DUP", ")", ";", "mv", ".", "visitInsn", "(", "ICONST_0", ")", ";", "mv", ".", "visitLdcInsn", "(", "i", ")", ";", "mv", ".", "visitMethodInsn", "(", "INVOKESTATIC", ",", "\"\"", ",", "\"valueOf\"", ",", "\"\"", ")", ";", "mv", ".", "visitInsn", "(", "AASTORE", ")", ";", "mv", ".", "visitMethodInsn", "(", "INVOKESPECIAL", ",", "\"\"", ",", "\"<init>\"", ",", "\"\"", ")", ";", "mv", ".", "visitVarInsn", "(", "ALOAD", ",", "listArrayVar", ")", ";", "mv", ".", "visitInsn", "(", "SWAP", ")", ";", "BytecodeHelper", ".", "pushConstant", "(", "mv", ",", "i", ")", ";", "mv", ".", "visitInsn", "(", "SWAP", ")", ";", "mv", ".", "visitInsn", "(", "AASTORE", ")", ";", "}", "mv", ".", "visitInsn", "(", "POP", ")", ";", "mv", ".", "visitVarInsn", "(", "ALOAD", ",", "listArrayVar", ")", ";", "createListMethod", ".", "call", "(", "mv", ")", ";", "controller", ".", "getCompileStack", "(", ")", ".", "removeVar", "(", "listArrayVar", ")", ";", "controller", ".", "getOperandStack", "(", ")", ".", "pop", "(", ")", ";", "}", "public", "void", "visitBytecodeSequence", "(", "BytecodeSequence", "bytecodeSequence", ")", "{", "MethodVisitor", "mv", "=", "controller", ".", "getMethodVisitor", "(", ")", ";", "List", "instructions", "=", "bytecodeSequence", ".", "getInstructions", "(", ")", ";", "int", "mark", "=", "controller", ".", "getOperandStack", "(", ")", ".", "getStackLength", "(", ")", ";", "for", "(", "Iterator", "iterator", "=", "instructions", ".", "iterator", "(", ")", ";", "iterator", ".", "hasNext", "(", ")", ";", ")", "{", "Object", "part", "=", "iterator", ".", "next", "(", ")", ";", "if", "(", "part", "==", "EmptyExpression", ".", "INSTANCE", ")", "{", "mv", ".", "visitInsn", "(", "ACONST_NULL", ")", ";", "}", "else", "if", "(", "part", "instanceof", "Expression", ")", "{", "(", "(", "Expression", ")", "part", ")", ".", "visit", "(", "this", ")", ";", "}", "else", "if", "(", "part", "instanceof", "Statement", ")", "{", "Statement", "stm", "=", "(", "Statement", ")", "part", ";", "stm", ".", "visit", "(", "this", ")", ";", "mv", ".", "visitInsn", "(", "ACONST_NULL", ")", ";", "}", "else", "{", "BytecodeInstruction", "runner", "=", "(", "BytecodeInstruction", ")", "part", ";", "runner", ".", "visit", "(", "mv", ")", ";", "}", "}", "controller", ".", "getOperandStack", "(", ")", ".", "remove", "(", "mark", "-", "controller", ".", "getOperandStack", "(", ")", ".", "getStackLength", "(", ")", ")", ";", "}", "public", "void", "visitListExpression", "(", "ListExpression", "expression", ")", "{", "onLineNumber", "(", "expression", ",", "\"\"", ")", ";", "int", "size", "=", "expression", ".", "getExpressions", "(", ")", ".", "size", "(", ")", ";", "boolean", "containsSpreadExpression", "=", "containsSpreadExpression", "(", "expression", ")", ";", "boolean", "containsOnlyConstants", "=", "!", "containsSpreadExpression", "&&", "containsOnlyConstants", "(", "expression", ")", ";", "OperandStack", "operandStack", "=", "controller", ".", "getOperandStack", "(", ")", ";", "if", "(", "!", "containsSpreadExpression", ")", "{", "MethodVisitor", "mv", "=", "controller", ".", "getMethodVisitor", "(", ")", ";", "BytecodeHelper", ".", "pushConstant", "(", "mv", ",", "size", ")", ";", "mv", ".", "visitTypeInsn", "(", "ANEWARRAY", ",", "\"\"", ")", ";", "int", "maxInit", "=", "1000", ";", "if", "(", "size", "<", "maxInit", "||", "!", "containsOnlyConstants", ")", "{", "for", "(", "int", "i", "=", "0", ";", "i", "<", "size", ";", "i", "++", ")", "{", "mv", ".", "visitInsn", "(", "DUP", ")", ";", "BytecodeHelper", ".", "pushConstant", "(", "mv", ",", "i", ")", ";", "expression", ".", "getExpression", "(", "i", ")", ".", "visit", "(", "this", ")", ";", "operandStack", ".", "box", "(", ")", ";", "mv", ".", "visitInsn", "(", "AASTORE", ")", ";", "}", "controller", ".", "getOperandStack", "(", ")", ".", "remove", "(", "size", ")", ";", "}", "else", "{", "List", "<", "Expression", ">", "expressions", "=", "expression", ".", "getExpressions", "(", ")", ";", "List", "<", "String", ">", "methods", "=", "new", "ArrayList", "(", ")", ";", "MethodVisitor", "oldMv", "=", "mv", ";", "int", "index", "=", "0", ";", "int", "methodIndex", "=", "0", ";", "while", "(", "index", "<", "size", ")", "{", "methodIndex", "++", ";", "String", "methodName", "=", "\"\"", "+", "methodIndex", ";", "methods", ".", "add", "(", "methodName", ")", ";", "mv", "=", "controller", ".", "getClassVisitor", "(", ")", ".", "visitMethod", "(", "ACC_PRIVATE", "+", "ACC_STATIC", "+", "ACC_SYNTHETIC", ",", "methodName", ",", "\"\"", ",", "null", ",", "null", ")", ";", "controller", ".", "setMethodVisitor", "(", "mv", ")", ";", "mv", ".", "visitCode", "(", ")", ";", "int", "methodBlockSize", "=", "Math", ".", "min", "(", "size", "-", "index", ",", "maxInit", ")", ";", "int", "methodBlockEnd", "=", "index", "+", "methodBlockSize", ";", "for", "(", ";", "index", "<", "methodBlockEnd", ";", "index", "++", ")", "{", "mv", ".", "visitVarInsn", "(", "ALOAD", ",", "0", ")", ";", "mv", ".", "visitLdcInsn", "(", "index", ")", ";", "expressions", ".", "get", "(", "index", ")", ".", "visit", "(", "this", ")", ";", "operandStack", ".", "box", "(", ")", ";", "mv", ".", "visitInsn", "(", "AASTORE", ")", ";", "}", "operandStack", ".", "remove", "(", "methodBlockSize", ")", ";", "mv", ".", "visitInsn", "(", "RETURN", ")", ";", "mv", ".", "visitMaxs", "(", "0", ",", "0", ")", ";", "mv", ".", "visitEnd", "(", ")", ";", "}", "mv", "=", "oldMv", ";", "controller", ".", "setMethodVisitor", "(", "mv", ")", ";", "for", "(", "String", "methodName", ":", "methods", ")", "{", "mv", ".", "visitInsn", "(", "DUP", ")", ";", "mv", ".", "visitMethodInsn", "(", "INVOKESTATIC", ",", "controller", ".", "getInternalClassName", "(", ")", ",", "methodName", ",", "\"\"", ")", ";", "}", "}", "}", "else", "{", "despreadList", "(", "expression", ".", "getExpressions", "(", ")", ",", "false", ")", ";", "}", "createListMethod", ".", "call", "(", "controller", ".", "getMethodVisitor", "(", ")", ")", ";", "operandStack", ".", "push", "(", "ClassHelper", ".", "LIST_TYPE", ")", ";", "}", "private", "boolean", "containsOnlyConstants", "(", "ListExpression", "list", ")", "{", "for", "(", "Expression", "exp", ":", "list", ".", "getExpressions", "(", ")", ")", "{", "if", "(", "exp", "instanceof", "ConstantExpression", ")", "continue", ";", "return", "false", ";", "}", "return", "true", ";", "}", "public", "void", "visitGStringExpression", "(", "GStringExpression", "expression", ")", "{", "MethodVisitor", "mv", "=", "controller", ".", "getMethodVisitor", "(", ")", ";", "mv", ".", "visitTypeInsn", "(", "NEW", ",", "\"\"", ")", ";", "mv", ".", "visitInsn", "(", "DUP", ")", ";", "int", "size", "=", "expression", ".", "getValues", "(", ")", ".", "size", "(", ")", ";", "BytecodeHelper", ".", "pushConstant", "(", "mv", ",", "size", ")", ";", "mv", ".", "visitTypeInsn", "(", "ANEWARRAY", ",", "\"\"", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "size", ";", "i", "++", ")", "{", "mv", ".", "visitInsn", "(", "DUP", ")", ";", "BytecodeHelper", ".", "pushConstant", "(", "mv", ",", "i", ")", ";", "expression", ".", "getValue", "(", "i", ")", ".", "visit", "(", "this", ")", ";", "controller", ".", "getOperandStack", "(", ")", ".", "box", "(", ")", ";", "mv", ".", "visitInsn", "(", "AASTORE", ")", ";", "}", "controller", ".", "getOperandStack", "(", ")", ".", "remove", "(", "size", ")", ";", "List", "strings", "=", "expression", ".", "getStrings", "(", ")", ";", "size", "=", "strings", ".", "size", "(", ")", ";", "BytecodeHelper", ".", "pushConstant", "(", "mv", ",", "size", ")", ";", "mv", ".", "visitTypeInsn", "(", "ANEWARRAY", ",", "\"\"", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "size", ";", "i", "++", ")", "{", "mv", ".", "visitInsn", "(", "DUP", ")", ";", "BytecodeHelper", ".", "pushConstant", "(", "mv", ",", "i", ")", ";", "controller", ".", "getOperandStack", "(", ")", ".", "pushConstant", "(", "(", "ConstantExpression", ")", "strings", ".", "get", "(", "i", ")", ")", ";", "controller", ".", "getOperandStack", "(", ")", ".", "box", "(", ")", ";", "mv", ".", "visitInsn", "(", "AASTORE", ")", ";", "}", "controller", ".", "getOperandStack", "(", ")", ".", "remove", "(", "size", ")", ";", "mv", ".", "visitMethodInsn", "(", "INVOKESPECIAL", ",", "\"\"", ",", "\"<init>\"", ",", "\"\"", ")", ";", "controller", ".", "getOperandStack", "(", ")", ".", "push", "(", "ClassHelper", ".", "GSTRING_TYPE", ")", ";", "}", "public", "void", "visitAnnotations", "(", "AnnotatedNode", "node", ")", "{", "}", "private", "void", "visitAnnotations", "(", "AnnotatedNode", "targetNode", ",", "Object", "visitor", ")", "{", "for", "(", "AnnotationNode", "an", ":", "targetNode", ".", "getAnnotations", "(", ")", ")", "{", "if", "(", "an", ".", "isBuiltIn", "(", ")", ")", "continue", ";", "if", "(", "an", ".", "hasSourceRetention", "(", ")", ")", "continue", ";", "AnnotationVisitor", "av", "=", "getAnnotationVisitor", "(", "targetNode", ",", "an", ",", "visitor", ")", ";", "visitAnnotationAttributes", "(", "an", ",", "av", ")", ";", "av", ".", "visitEnd", "(", ")", ";", "}", "}", "private", "void", "visitParameterAnnotations", "(", "Parameter", "parameter", ",", "int", "paramNumber", ",", "MethodVisitor", "mv", ")", "{", "for", "(", "AnnotationNode", "an", ":", "parameter", ".", "getAnnotations", "(", ")", ")", "{", "if", "(", "an", ".", "isBuiltIn", "(", ")", ")", "continue", ";", "if", "(", "an", ".", "hasSourceRetention", "(", ")", ")", "continue", ";", "final", "String", "annotationDescriptor", "=", "BytecodeHelper", ".", "getTypeDescription", "(", "an", ".", "getClassNode", "(", ")", ")", ";", "AnnotationVisitor", "av", "=", "mv", ".", "visitParameterAnnotation", "(", "paramNumber", ",", "annotationDescriptor", ",", "an", ".", "hasRuntimeRetention", "(", ")", ")", ";", "visitAnnotationAttributes", "(", "an", ",", "av", ")", ";", "av", ".", "visitEnd", "(", ")", ";", "}", "}", "private", "AnnotationVisitor", "getAnnotationVisitor", "(", "AnnotatedNode", "targetNode", ",", "AnnotationNode", "an", ",", "Object", "visitor", ")", "{", "final", "String", "annotationDescriptor", "=", "BytecodeHelper", ".", "getTypeDescription", "(", "an", ".", "getClassNode", "(", ")", ")", ";", "if", "(", "targetNode", "instanceof", "MethodNode", ")", "{", "return", "(", "(", "MethodVisitor", ")", "visitor", ")", ".", "visitAnnotation", "(", "annotationDescriptor", ",", "an", ".", "hasRuntimeRetention", "(", ")", ")", ";", "}", "else", "if", "(", "targetNode", "instanceof", "FieldNode", ")", "{", "return", "(", "(", "FieldVisitor", ")", "visitor", ")", ".", "visitAnnotation", "(", "annotationDescriptor", ",", "an", ".", "hasRuntimeRetention", "(", ")", ")", ";", "}", "else", "if", "(", "targetNode", "instanceof", "ClassNode", ")", "{", "return", "(", "(", "ClassVisitor", ")", "visitor", ")", ".", "visitAnnotation", "(", "annotationDescriptor", ",", "an", ".", "hasRuntimeRetention", "(", ")", ")", ";", "}", "throwException", "(", "\"\"", ")", ";", "return", "null", ";", "}", "private", "void", "visitAnnotationAttributes", "(", "AnnotationNode", "an", ",", "AnnotationVisitor", "av", ")", "{", "Map", "<", "String", ",", "Object", ">", "constantAttrs", "=", "new", "HashMap", "<", "String", ",", "Object", ">", "(", ")", ";", "Map", "<", "String", ",", "PropertyExpression", ">", "enumAttrs", "=", "new", "HashMap", "<", "String", ",", "PropertyExpression", ">", "(", ")", ";", "Map", "<", "String", ",", "Object", ">", "atAttrs", "=", "new", "HashMap", "<", "String", ",", "Object", ">", "(", ")", ";", "Map", "<", "String", ",", "ListExpression", ">", "arrayAttrs", "=", "new", "HashMap", "<", "String", ",", "ListExpression", ">", "(", ")", ";", "for", "(", "String", "name", ":", "an", ".", "getMembers", "(", ")", ".", "keySet", "(", ")", ")", "{", "Expression", "expr", "=", "an", ".", "getMember", "(", "name", ")", ";", "if", "(", "expr", "instanceof", "AnnotationConstantExpression", ")", "{", "atAttrs", ".", "put", "(", "name", ",", "(", "(", "AnnotationConstantExpression", ")", "expr", ")", ".", "getValue", "(", ")", ")", ";", "}", "else", "if", "(", "expr", "instanceof", "ConstantExpression", ")", "{", "constantAttrs", ".", "put", "(", "name", ",", "(", "(", "ConstantExpression", ")", "expr", ")", ".", "getValue", "(", ")", ")", ";", "}", "else", "if", "(", "expr", "instanceof", "ClassExpression", ")", "{", "constantAttrs", ".", "put", "(", "name", ",", "Type", ".", "getType", "(", "BytecodeHelper", ".", "getTypeDescription", "(", "(", "expr", ".", "getType", "(", ")", ")", ")", ")", ")", ";", "}", "else", "if", "(", "expr", "instanceof", "PropertyExpression", ")", "{", "enumAttrs", ".", "put", "(", "name", ",", "(", "PropertyExpression", ")", "expr", ")", ";", "}", "else", "if", "(", "expr", "instanceof", "ListExpression", ")", "{", "arrayAttrs", ".", "put", "(", "name", ",", "(", "ListExpression", ")", "expr", ")", ";", "}", "else", "if", "(", "expr", "instanceof", "ClosureExpression", ")", "{", "ClassNode", "closureClass", "=", "controller", ".", "getClosureWriter", "(", ")", ".", "getOrAddClosureClass", "(", "(", "ClosureExpression", ")", "expr", ",", "ACC_PUBLIC", ")", ";", "constantAttrs", ".", "put", "(", "name", ",", "Type", ".", "getType", "(", "BytecodeHelper", ".", "getTypeDescription", "(", "closureClass", ")", ")", ")", ";", "}", "}", "for", "(", "Map", ".", "Entry", "entry", ":", "constantAttrs", ".", "entrySet", "(", ")", ")", "{", "av", ".", "visit", "(", "(", "String", ")", "entry", ".", "getKey", "(", ")", ",", "entry", ".", "getValue", "(", ")", ")", ";", "}", "for", "(", "Map", ".", "Entry", "entry", ":", "enumAttrs", ".", "entrySet", "(", ")", ")", "{", "PropertyExpression", "propExp", "=", "(", "PropertyExpression", ")", "entry", ".", "getValue", "(", ")", ";", "av", ".", "visitEnum", "(", "(", "String", ")", "entry", ".", "getKey", "(", ")", ",", "BytecodeHelper", ".", "getTypeDescription", "(", "propExp", ".", "getObjectExpression", "(", ")", ".", "getType", "(", ")", ")", ",", "String", ".", "valueOf", "(", "(", "(", "ConstantExpression", ")", "propExp", ".", "getProperty", "(", ")", ")", ".", "getValue", "(", ")", ")", ")", ";", "}", "for", "(", "Map", ".", "Entry", "entry", ":", "atAttrs", ".", "entrySet", "(", ")", ")", "{", "AnnotationNode", "atNode", "=", "(", "AnnotationNode", ")", "entry", ".", "getValue", "(", ")", ";", "AnnotationVisitor", "av2", "=", "av", ".", "visitAnnotation", "(", "(", "String", ")", "entry", ".", "getKey", "(", ")", ",", "BytecodeHelper", ".", "getTypeDescription", "(", "atNode", ".", "getClassNode", "(", ")", ")", ")", ";", "visitAnnotationAttributes", "(", "atNode", ",", "av2", ")", ";", "av2", ".", "visitEnd", "(", ")", ";", "}", "visitArrayAttributes", "(", "an", ",", "arrayAttrs", ",", "av", ")", ";", "}", "private", "void", "visitArrayAttributes", "(", "AnnotationNode", "an", ",", "Map", "<", "String", ",", "ListExpression", ">", "arrayAttr", ",", "AnnotationVisitor", "av", ")", "{", "if", "(", "arrayAttr", ".", "isEmpty", "(", ")", ")", "return", ";", "for", "(", "Map", ".", "Entry", "entry", ":", "arrayAttr", ".", "entrySet", "(", ")", ")", "{", "AnnotationVisitor", "av2", "=", "av", ".", "visitArray", "(", "(", "String", ")", "entry", ".", "getKey", "(", ")", ")", ";", "List", "<", "Expression", ">", "values", "=", "(", "(", "ListExpression", ")", "entry", ".", "getValue", "(", ")", ")", ".", "getExpressions", "(", ")", ";", "if", "(", "!", "values", ".", "isEmpty", "(", ")", ")", "{", "int", "arrayElementType", "=", "determineCommonArrayType", "(", "values", ")", ";", "for", "(", "Expression", "exprChild", ":", "values", ")", "{", "visitAnnotationArrayElement", "(", "exprChild", ",", "arrayElementType", ",", "av2", ")", ";", "}", "}", "av2", ".", "visitEnd", "(", ")", ";", "}", "}", "private", "int", "determineCommonArrayType", "(", "List", "values", ")", "{", "Expression", "expr", "=", "(", "Expression", ")", "values", ".", "get", "(", "0", ")", ";", "int", "arrayElementType", "=", "-", "1", ";", "if", "(", "expr", "instanceof", "AnnotationConstantExpression", ")", "{", "arrayElementType", "=", "1", ";", "}", "else", "if", "(", "expr", "instanceof", "ConstantExpression", ")", "{", "arrayElementType", "=", "2", ";", "}", "else", "if", "(", "expr", "instanceof", "ClassExpression", ")", "{", "arrayElementType", "=", "3", ";", "}", "else", "if", "(", "expr", "instanceof", "PropertyExpression", ")", "{", "arrayElementType", "=", "4", ";", "}", "return", "arrayElementType", ";", "}", "private", "void", "visitAnnotationArrayElement", "(", "Expression", "expr", ",", "int", "arrayElementType", ",", "AnnotationVisitor", "av", ")", "{", "switch", "(", "arrayElementType", ")", "{", "case", "1", ":", "AnnotationNode", "atAttr", "=", "(", "AnnotationNode", ")", "(", "(", "AnnotationConstantExpression", ")", "expr", ")", ".", "getValue", "(", ")", ";", "AnnotationVisitor", "av2", "=", "av", ".", "visitAnnotation", "(", "null", ",", "BytecodeHelper", ".", "getTypeDescription", "(", "atAttr", ".", "getClassNode", "(", ")", ")", ")", ";", "visitAnnotationAttributes", "(", "atAttr", ",", "av2", ")", ";", "av2", ".", "visitEnd", "(", ")", ";", "break", ";", "case", "2", ":", "av", ".", "visit", "(", "null", ",", "(", "(", "ConstantExpression", ")", "expr", ")", ".", "getValue", "(", ")", ")", ";", "break", ";", "case", "3", ":", "av", ".", "visit", "(", "null", ",", "Type", ".", "getType", "(", "BytecodeHelper", ".", "getTypeDescription", "(", "expr", ".", "getType", "(", ")", ")", ")", ")", ";", "break", ";", "case", "4", ":", "PropertyExpression", "propExpr", "=", "(", "PropertyExpression", ")", "expr", ";", "av", ".", "visitEnum", "(", "null", ",", "BytecodeHelper", ".", "getTypeDescription", "(", "propExpr", ".", "getObjectExpression", "(", ")", ".", "getType", "(", ")", ")", ",", "String", ".", "valueOf", "(", "(", "(", "ConstantExpression", ")", "propExpr", ".", "getProperty", "(", ")", ")", ".", "getValue", "(", ")", ")", ")", ";", "break", ";", "}", "}", "public", "void", "visitBytecodeExpression", "(", "BytecodeExpression", "cle", ")", "{", "cle", ".", "visit", "(", "controller", ".", "getMethodVisitor", "(", ")", ")", ";", "controller", ".", "getOperandStack", "(", ")", ".", "push", "(", "cle", ".", "getType", "(", ")", ")", ";", "}", "public", "static", "boolean", "isThisExpression", "(", "Expression", "expression", ")", "{", "if", "(", "expression", "instanceof", "VariableExpression", ")", "{", "VariableExpression", "varExp", "=", "(", "VariableExpression", ")", "expression", ";", "return", "varExp", ".", "getName", "(", ")", ".", "equals", "(", "\"this\"", ")", ";", "}", "return", "false", ";", "}", "private", "static", "boolean", "isSuperExpression", "(", "Expression", "expression", ")", "{", "if", "(", "expression", "instanceof", "VariableExpression", ")", "{", "VariableExpression", "varExp", "=", "(", "VariableExpression", ")", "expression", ";", "return", "varExp", ".", "getName", "(", ")", ".", "equals", "(", "\"super\"", ")", ";", "}", "return", "false", ";", "}", "private", "static", "boolean", "isThisOrSuper", "(", "Expression", "expression", ")", "{", "return", "isThisExpression", "(", "expression", ")", "||", "isSuperExpression", "(", "expression", ")", ";", "}", "public", "void", "onLineNumber", "(", "ASTNode", "statement", ",", "String", "message", ")", "{", "MethodVisitor", "mv", "=", "controller", ".", "getMethodVisitor", "(", ")", ";", "if", "(", "statement", "==", "null", ")", "return", ";", "int", "line", "=", "statement", ".", "getLineNumber", "(", ")", ";", "this", ".", "currentASTNode", "=", "statement", ";", "if", "(", "line", "<", "0", ")", "return", ";", "if", "(", "!", "ASM_DEBUG", "&&", "line", "==", "lineNumber", ")", "return", ";", "lineNumber", "=", "line", ";", "if", "(", "mv", "!=", "null", ")", "{", "Label", "l", "=", "new", "Label", "(", ")", ";", "mv", ".", "visitLabel", "(", "l", ")", ";", "mv", ".", "visitLineNumber", "(", "line", ",", "l", ")", ";", "}", "}", "private", "boolean", "isInnerClass", "(", ")", "{", "return", "controller", ".", "getClassNode", "(", ")", "instanceof", "InnerClassNode", ";", "}", "protected", "CompileUnit", "getCompileUnit", "(", ")", "{", "CompileUnit", "answer", "=", "controller", ".", "getClassNode", "(", ")", ".", "getCompileUnit", "(", ")", ";", "if", "(", "answer", "==", "null", ")", "{", "answer", "=", "context", ".", "getCompileUnit", "(", ")", ";", "}", "return", "answer", ";", "}", "protected", "int", "getBytecodeVersion", "(", ")", "{", "return", "Opcodes", ".", "V1_5", ";", "}", "public", "boolean", "addInnerClass", "(", "ClassNode", "innerClass", ")", "{", "innerClass", ".", "setModule", "(", "controller", ".", "getClassNode", "(", ")", ".", "getModule", "(", ")", ")", ";", "return", "innerClasses", ".", "add", "(", "innerClass", ")", ";", "}", "}", "</s>" ]
6,637
[ "<s>", "package", "org", ".", "codehaus", ".", "groovy", ".", "syntax", ";", "@", "SuppressWarnings", "(", "\"serial\"", ")", "public", "class", "PreciseSyntaxException", "extends", "SyntaxException", "{", "private", "int", "startOffset", ";", "private", "int", "endOffset", ";", "public", "PreciseSyntaxException", "(", "String", "message", ",", "int", "line", ",", "int", "col", ",", "int", "startOffset", ",", "int", "endOffset", ")", "{", "super", "(", "message", ",", "line", ",", "col", ")", ";", "this", ".", "startOffset", "=", "startOffset", ";", "this", ".", "endOffset", "=", "endOffset", ";", "}", "public", "int", "getStartOffset", "(", ")", "{", "return", "startOffset", ";", "}", "public", "int", "getEndOffset", "(", ")", "{", "return", "endOffset", ";", "}", "}", "</s>" ]
6,638
[ "<s>", "package", "org", ".", "codehaus", ".", "groovy", ".", "ast", ";", "import", "groovy", ".", "lang", ".", "GroovyClassLoader", ";", "import", "java", ".", "security", ".", "CodeSource", ";", "import", "java", ".", "util", ".", "ArrayList", ";", "import", "java", ".", "util", ".", "HashMap", ";", "import", "java", ".", "util", ".", "Iterator", ";", "import", "java", ".", "util", ".", "List", ";", "import", "java", ".", "util", ".", "Map", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "control", ".", "CompilerConfiguration", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "control", ".", "SourceUnit", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "control", ".", "messages", ".", "SyntaxErrorMessage", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "syntax", ".", "SyntaxException", ";", "public", "class", "CompileUnit", "{", "private", "final", "List", "<", "ModuleNode", ">", "modules", "=", "new", "ArrayList", "<", "ModuleNode", ">", "(", ")", ";", "private", "List", "<", "ModuleNode", ">", "sortedModules", ";", "private", "Map", "<", "String", ",", "ClassNode", ">", "classes", "=", "new", "HashMap", "<", "String", ",", "ClassNode", ">", "(", ")", ";", "private", "CompilerConfiguration", "config", ";", "private", "GroovyClassLoader", "classLoader", ";", "private", "CodeSource", "codeSource", ";", "private", "Map", "<", "String", ",", "ClassNode", ">", "classesToCompile", "=", "new", "HashMap", "<", "String", ",", "ClassNode", ">", "(", ")", ";", "private", "Map", "<", "String", ",", "SourceUnit", ">", "classNameToSource", "=", "new", "HashMap", "<", "String", ",", "SourceUnit", ">", "(", ")", ";", "public", "CompileUnit", "(", "GroovyClassLoader", "classLoader", ",", "CompilerConfiguration", "config", ")", "{", "this", "(", "classLoader", ",", "null", ",", "config", ")", ";", "}", "public", "CompileUnit", "(", "GroovyClassLoader", "classLoader", ",", "CodeSource", "codeSource", ",", "CompilerConfiguration", "config", ")", "{", "this", ".", "classLoader", "=", "classLoader", ";", "this", ".", "config", "=", "config", ";", "this", ".", "codeSource", "=", "codeSource", ";", "}", "public", "List", "<", "ModuleNode", ">", "getModules", "(", ")", "{", "return", "modules", ";", "}", "public", "void", "addModule", "(", "ModuleNode", "node", ")", "{", "if", "(", "node", "==", "null", ")", "return", ";", "modules", ".", "add", "(", "node", ")", ";", "this", ".", "sortedModules", "=", "null", ";", "node", ".", "setUnit", "(", "this", ")", ";", "addClasses", "(", "node", ".", "getClasses", "(", ")", ")", ";", "}", "public", "ClassNode", "getClass", "(", "String", "name", ")", "{", "ClassNode", "cn", "=", "classes", ".", "get", "(", "name", ")", ";", "if", "(", "cn", "!=", "null", ")", "return", "cn", ";", "return", "classesToCompile", ".", "get", "(", "name", ")", ";", "}", "public", "List", "getClasses", "(", ")", "{", "List", "<", "ClassNode", ">", "answer", "=", "new", "ArrayList", "<", "ClassNode", ">", "(", ")", ";", "for", "(", "ModuleNode", "module", ":", "modules", ")", "{", "answer", ".", "addAll", "(", "module", ".", "getClasses", "(", ")", ")", ";", "}", "return", "answer", ";", "}", "public", "CompilerConfiguration", "getConfig", "(", ")", "{", "return", "config", ";", "}", "public", "GroovyClassLoader", "getClassLoader", "(", ")", "{", "return", "classLoader", ";", "}", "public", "CodeSource", "getCodeSource", "(", ")", "{", "return", "codeSource", ";", "}", "void", "addClasses", "(", "List", "<", "ClassNode", ">", "classList", ")", "{", "for", "(", "ClassNode", "node", ":", "classList", ")", "{", "addClass", "(", "node", ")", ";", "}", "}", "public", "void", "addClass", "(", "ClassNode", "node", ")", "{", "node", "=", "node", ".", "redirect", "(", ")", ";", "String", "name", "=", "node", ".", "getName", "(", ")", ";", "ClassNode", "stored", "=", "classes", ".", "get", "(", "name", ")", ";", "if", "(", "stored", "!=", "null", "&&", "stored", "!=", "node", ")", "{", "SourceUnit", "nodeSource", "=", "node", ".", "getModule", "(", ")", ".", "getContext", "(", ")", ";", "SourceUnit", "storedSource", "=", "stored", ".", "getModule", "(", ")", ".", "getContext", "(", ")", ";", "String", "txt", "=", "\"\"", "+", "node", ".", "getName", "(", ")", "+", "\"", ":", "\"", ";", "if", "(", "nodeSource", "==", "storedSource", ")", "{", "txt", "+=", "\"The", "source", "\"", "+", "nodeSource", ".", "getName", "(", ")", "+", "\"\"", "+", "node", ".", "getName", "(", ")", "+", "\".n\"", ";", "if", "(", "node", ".", "isScriptBody", "(", ")", "||", "stored", ".", "isScriptBody", "(", ")", ")", "{", "txt", "+=", "\"\"", "+", "\"\"", ";", "}", "}", "else", "{", "txt", "+=", "\"The", "sources", "\"", "+", "nodeSource", ".", "getName", "(", ")", "+", "\"", "and", "\"", "+", "storedSource", ".", "getName", "(", ")", "+", "\"\"", "+", "node", ".", "getName", "(", ")", "+", "\".n\"", ";", "}", "nodeSource", ".", "getErrorCollector", "(", ")", ".", "addErrorAndContinue", "(", "new", "SyntaxErrorMessage", "(", "new", "SyntaxException", "(", "txt", ",", "node", ".", "getLineNumber", "(", ")", ",", "node", ".", "getColumnNumber", "(", ")", ")", ",", "nodeSource", ")", ")", ";", "}", "classes", ".", "put", "(", "name", ",", "node", ")", ";", "if", "(", "classesToCompile", ".", "containsKey", "(", "name", ")", ")", "{", "ClassNode", "cn", "=", "classesToCompile", ".", "get", "(", "name", ")", ";", "cn", ".", "setRedirect", "(", "node", ")", ";", "classesToCompile", ".", "remove", "(", "name", ")", ";", "}", "}", "public", "void", "addClassNodeToCompile", "(", "ClassNode", "node", ",", "SourceUnit", "location", ")", "{", "classesToCompile", ".", "put", "(", "node", ".", "getName", "(", ")", ",", "node", ")", ";", "classNameToSource", ".", "put", "(", "node", ".", "getName", "(", ")", ",", "location", ")", ";", "}", "public", "SourceUnit", "getScriptSourceLocation", "(", "String", "className", ")", "{", "return", "classNameToSource", ".", "get", "(", "className", ")", ";", "}", "public", "boolean", "hasClassNodeToCompile", "(", ")", "{", "return", "!", "classesToCompile", ".", "isEmpty", "(", ")", ";", "}", "public", "Iterator", "<", "String", ">", "iterateClassNodeToCompile", "(", ")", "{", "return", "classesToCompile", ".", "keySet", "(", ")", ".", "iterator", "(", ")", ";", "}", "public", "List", "<", "ModuleNode", ">", "getSortedModules", "(", ")", "{", "return", "this", ".", "sortedModules", ";", "}", "public", "void", "setSortedModules", "(", "List", "<", "ModuleNode", ">", "sortedModules", ")", "{", "this", ".", "sortedModules", "=", "sortedModules", ";", "}", "}", "</s>" ]
6,639
[ "<s>", "package", "org", ".", "codehaus", ".", "groovy", ".", "ast", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "GroovyBugError", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "util", ".", "ListHashMap", ";", "public", "class", "ASTNode", "{", "private", "int", "lineNumber", "=", "-", "1", ";", "private", "int", "columnNumber", "=", "-", "1", ";", "private", "int", "lastLineNumber", "=", "-", "1", ";", "private", "int", "lastColumnNumber", "=", "-", "1", ";", "private", "ListHashMap", "metaDataMap", "=", "new", "ListHashMap", "(", ")", ";", "private", "int", "start", "=", "0", ";", "private", "int", "end", "=", "0", ";", "public", "void", "visit", "(", "GroovyCodeVisitor", "visitor", ")", "{", "throw", "new", "RuntimeException", "(", "\"\"", "+", "getClass", "(", ")", ".", "getName", "(", ")", ")", ";", "}", "public", "String", "getText", "(", ")", "{", "return", "\"\"", "+", "getClass", "(", ")", ".", "getName", "(", ")", "+", "\">\"", ";", "}", "public", "int", "getLineNumber", "(", ")", "{", "return", "lineNumber", ";", "}", "public", "void", "setLineNumber", "(", "int", "lineNumber", ")", "{", "this", ".", "lineNumber", "=", "lineNumber", ";", "}", "public", "int", "getColumnNumber", "(", ")", "{", "return", "columnNumber", ";", "}", "public", "void", "setColumnNumber", "(", "int", "columnNumber", ")", "{", "this", ".", "columnNumber", "=", "columnNumber", ";", "}", "public", "int", "getLastLineNumber", "(", ")", "{", "return", "lastLineNumber", ";", "}", "public", "void", "setLastLineNumber", "(", "int", "lastLineNumber", ")", "{", "this", ".", "lastLineNumber", "=", "lastLineNumber", ";", "}", "public", "int", "getLastColumnNumber", "(", ")", "{", "return", "lastColumnNumber", ";", "}", "public", "void", "setLastColumnNumber", "(", "int", "lastColumnNumber", ")", "{", "this", ".", "lastColumnNumber", "=", "lastColumnNumber", ";", "}", "public", "int", "getStart", "(", ")", "{", "return", "start", ";", "}", "public", "void", "setStart", "(", "int", "start", ")", "{", "this", ".", "start", "=", "start", ";", "}", "public", "int", "getEnd", "(", ")", "{", "return", "end", ";", "}", "public", "void", "setEnd", "(", "int", "end", ")", "{", "this", ".", "end", "=", "end", ";", "}", "public", "int", "getLength", "(", ")", "{", "return", "end", ">=", "0", "&&", "start", ">=", "0", "?", "end", "-", "start", ":", "-", "1", ";", "}", "public", "void", "setSourcePosition", "(", "ASTNode", "node", ")", "{", "this", ".", "columnNumber", "=", "node", ".", "getColumnNumber", "(", ")", ";", "this", ".", "lastLineNumber", "=", "node", ".", "getLastLineNumber", "(", ")", ";", "this", ".", "lastColumnNumber", "=", "node", ".", "getLastColumnNumber", "(", ")", ";", "this", ".", "lineNumber", "=", "node", ".", "getLineNumber", "(", ")", ";", "this", ".", "start", "=", "node", ".", "getStart", "(", ")", ";", "this", ".", "end", "=", "node", ".", "getEnd", "(", ")", ";", "}", "public", "Object", "getNodeMetaData", "(", "Object", "key", ")", "{", "return", "metaDataMap", ".", "get", "(", "key", ")", ";", "}", "public", "void", "copyNodeMetaData", "(", "ASTNode", "other", ")", "{", "metaDataMap", ".", "putAll", "(", "other", ".", "metaDataMap", ")", ";", "}", "public", "void", "setNodeMetaData", "(", "Object", "key", ",", "Object", "value", ")", "{", "if", "(", "key", "==", "null", ")", "throw", "new", "GroovyBugError", "(", "\"\"", "+", "this", "+", "\".\"", ")", ";", "Object", "old", "=", "metaDataMap", ".", "put", "(", "key", ",", "value", ")", ";", "if", "(", "old", "!=", "null", ")", "throw", "new", "GroovyBugError", "(", "\"\"", "+", "this", "+", "\".\"", ")", ";", "}", "public", "Object", "putNodeMetaData", "(", "Object", "key", ",", "Object", "value", ")", "{", "if", "(", "key", "==", "null", ")", "throw", "new", "GroovyBugError", "(", "\"\"", "+", "this", "+", "\".\"", ")", ";", "return", "metaDataMap", ".", "put", "(", "key", ",", "value", ")", ";", "}", "public", "void", "removeNodeMetaData", "(", "Object", "key", ")", "{", "if", "(", "key", "==", "null", ")", "throw", "new", "GroovyBugError", "(", "\"\"", "+", "this", "+", "\".\"", ")", ";", "metaDataMap", ".", "remove", "(", "key", ")", ";", "}", "}", "</s>" ]
6,640
[ "<s>", "package", "org", ".", "codehaus", ".", "groovy", ".", "ast", ";", "import", "java", ".", "util", ".", "ArrayList", ";", "import", "java", ".", "util", ".", "Collections", ";", "import", "java", ".", "util", ".", "List", ";", "public", "abstract", "class", "Comment", "{", "protected", "static", "final", "boolean", "debug", "=", "false", ";", "protected", "static", "final", "int", "BLOCK", "=", "0", ";", "protected", "static", "final", "int", "LINE", "=", "1", ";", "protected", "static", "final", "int", "JAVADOC", "=", "2", ";", "protected", "String", "comment", ";", "private", "int", "kind", ";", "public", "boolean", "usedUp", "=", "false", ";", "public", "int", "sline", ",", "scol", ",", "eline", ",", "ecol", ";", "public", "Comment", "(", "int", "kind", ",", "int", "sline", ",", "int", "scol", ",", "int", "eline", ",", "int", "ecol", ",", "String", "string", ")", "{", "this", ".", "kind", "=", "kind", ";", "this", ".", "sline", "=", "sline", ";", "this", ".", "scol", "=", "scol", ";", "this", ".", "eline", "=", "eline", ";", "this", ".", "ecol", "=", "ecol", ";", "this", ".", "comment", "=", "string", ";", "}", "public", "int", "getLastLine", "(", ")", "{", "return", "eline", ";", "}", "public", "static", "Comment", "makeSingleLineComment", "(", "int", "sline", ",", "int", "scol", ",", "int", "eline", ",", "int", "ecol", ",", "String", "string", ")", "{", "return", "new", "SingleLineComment", "(", "sline", ",", "scol", ",", "eline", ",", "ecol", ",", "string", ")", ";", "}", "public", "static", "Comment", "makeMultiLineComment", "(", "int", "sline", ",", "int", "scol", ",", "int", "eline", ",", "int", "ecol", ",", "String", "string", ")", "{", "return", "new", "MultiLineComment", "(", "sline", ",", "scol", ",", "eline", ",", "ecol", ",", "string", ")", ";", "}", "public", "abstract", "List", "<", "TaskEntry", ">", "getPositionsOf", "(", "String", "taskTag", ",", "String", "taskPriority", ",", "int", "[", "]", "lineseps", ",", "boolean", "caseSensitive", ")", ";", "public", "int", "[", "]", "getPositions", "(", "int", "[", "]", "lineseps", ")", "{", "int", "offsetToStartLine", "=", "(", "sline", "==", "1", "?", "0", ":", "lineseps", "[", "sline", "-", "2", "]", "+", "1", ")", ";", "int", "start", "=", "offsetToStartLine", "+", "(", "scol", "-", "1", ")", ";", "int", "offsetToEndLine", "=", "(", "eline", "==", "1", "?", "0", ":", "lineseps", "[", "eline", "-", "2", "]", "+", "1", ")", ";", "int", "end", "=", "offsetToEndLine", "+", "(", "ecol", "-", "1", ")", ";", "if", "(", "kind", "==", "LINE", ")", "{", "return", "new", "int", "[", "]", "{", "-", "start", ",", "-", "end", "}", ";", "}", "else", "if", "(", "kind", "==", "BLOCK", ")", "{", "return", "new", "int", "[", "]", "{", "start", ",", "-", "end", "}", ";", "}", "else", "{", "return", "new", "int", "[", "]", "{", "start", ",", "end", "}", ";", "}", "}", "public", "String", "toString", "(", ")", "{", "return", "comment", ";", "}", "protected", "boolean", "isValidStartLocationForTask", "(", "String", "text", ",", "int", "index", ",", "String", "taskTag", ")", "{", "int", "tagLen", "=", "taskTag", ".", "length", "(", ")", ";", "if", "(", "comment", ".", "charAt", "(", "index", "-", "1", ")", "==", "'@'", ")", "{", "return", "false", ";", "}", "if", "(", "Character", ".", "isJavaIdentifierStart", "(", "comment", ".", "charAt", "(", "index", ")", ")", ")", "{", "if", "(", "Character", ".", "isJavaIdentifierPart", "(", "comment", ".", "charAt", "(", "index", "-", "1", ")", ")", ")", "{", "return", "false", ";", "}", "}", "if", "(", "(", "index", "+", "tagLen", ")", "<", "comment", ".", "length", "(", ")", "&&", "Character", ".", "isJavaIdentifierStart", "(", "comment", ".", "charAt", "(", "index", "+", "tagLen", "-", "1", ")", ")", ")", "{", "if", "(", "Character", ".", "isJavaIdentifierPart", "(", "comment", ".", "charAt", "(", "index", "+", "tagLen", ")", ")", ")", "{", "return", "false", ";", "}", "}", "return", "true", ";", "}", "protected", "int", "findTaskTag", "(", "String", "text", ",", "String", "tag", ",", "boolean", "caseSensitive", ",", "int", "fromIndex", ")", "{", "if", "(", "caseSensitive", ")", "{", "return", "text", ".", "indexOf", "(", "tag", ",", "fromIndex", ")", ";", "}", "else", "{", "int", "taglen", "=", "tag", ".", "length", "(", ")", ";", "String", "lcTag", "=", "tag", ".", "toLowerCase", "(", ")", ";", "char", "firstChar", "=", "lcTag", ".", "charAt", "(", "0", ")", ";", "for", "(", "int", "p", "=", "fromIndex", ",", "max", "=", "text", ".", "length", "(", ")", "-", "tag", ".", "length", "(", ")", "+", "1", ";", "p", "<", "max", ";", "p", "++", ")", "{", "if", "(", "Character", ".", "toLowerCase", "(", "text", ".", "charAt", "(", "p", ")", ")", "==", "firstChar", ")", "{", "boolean", "matched", "=", "true", ";", "for", "(", "int", "t", "=", "1", ";", "t", "<", "taglen", ";", "t", "++", ")", "{", "if", "(", "Character", ".", "toLowerCase", "(", "text", ".", "charAt", "(", "p", "+", "t", ")", ")", "!=", "lcTag", ".", "charAt", "(", "t", ")", ")", "{", "matched", "=", "false", ";", "break", ";", "}", "}", "if", "(", "matched", ")", "{", "return", "p", ";", "}", "}", "}", "return", "-", "1", ";", "}", "}", "public", "boolean", "isJavadoc", "(", ")", "{", "return", "kind", "==", "JAVADOC", ";", "}", "}", "class", "SingleLineComment", "extends", "Comment", "{", "public", "SingleLineComment", "(", "int", "sline", ",", "int", "scol", ",", "int", "eline", ",", "int", "ecol", ",", "String", "string", ")", "{", "super", "(", "LINE", ",", "sline", ",", "scol", ",", "eline", ",", "ecol", ",", "string", ")", ";", "if", "(", "debug", ")", "{", "System", ".", "out", ".", "println", "(", "\"\"", "+", "string", "+", "\"]", "at", "L\"", "+", "sline", "+", "\"C\"", "+", "scol", "+", "\">L\"", "+", "eline", "+", "\"C\"", "+", "ecol", ")", ";", "}", "}", "public", "List", "<", "TaskEntry", ">", "getPositionsOf", "(", "String", "taskTag", ",", "String", "taskPriority", ",", "int", "[", "]", "lineseps", ",", "boolean", "caseSensitive", ")", "{", "int", "i", "=", "findTaskTag", "(", "comment", ",", "taskTag", ",", "caseSensitive", ",", "0", ")", ";", "if", "(", "debug", ")", "{", "System", ".", "out", ".", "println", "(", "\"\"", "+", "comment", "+", "\"]", "for", "'\"", "+", "taskTag", "+", "\"'", "\"", "+", "i", ")", ";", "}", "if", "(", "i", "==", "-", "1", ")", "{", "return", "Collections", ".", "emptyList", "(", ")", ";", "}", "List", "<", "TaskEntry", ">", "tasks", "=", "new", "ArrayList", "<", "TaskEntry", ">", "(", ")", ";", "while", "(", "i", "!=", "-", "1", ")", "{", "if", "(", "isValidStartLocationForTask", "(", "comment", ",", "i", ",", "taskTag", ")", ")", "{", "int", "offsetToLineStart", "=", "(", "sline", "==", "1", "?", "0", ":", "lineseps", "[", "sline", "-", "2", "]", "+", "1", ")", ";", "int", "taskTagStart", "=", "offsetToLineStart", "+", "(", "scol", "-", "1", ")", "+", "i", ";", "int", "taskEnd", "=", "offsetToLineStart", "+", "ecol", "-", "2", ";", "TaskEntry", "taskEntry", "=", "new", "TaskEntry", "(", "taskTagStart", ",", "taskEnd", ",", "taskTag", ",", "taskPriority", ",", "comment", ",", "offsetToLineStart", "+", "scol", "-", "1", ")", ";", "if", "(", "debug", ")", "{", "System", ".", "out", ".", "println", "(", "\"\"", "+", "taskEntry", ".", "toString", "(", ")", ")", ";", "}", "tasks", ".", "add", "(", "taskEntry", ")", ";", "}", "i", "=", "findTaskTag", "(", "comment", ",", "taskTag", ",", "caseSensitive", ",", "i", "+", "taskTag", ".", "length", "(", ")", ")", ";", "}", "return", "tasks", ";", "}", "}", "class", "MultiLineComment", "extends", "Comment", "{", "public", "MultiLineComment", "(", "int", "sline", ",", "int", "scol", ",", "int", "eline", ",", "int", "ecol", ",", "String", "string", ")", "{", "super", "(", "string", ".", "charAt", "(", "2", ")", "==", "'*'", "?", "JAVADOC", ":", "BLOCK", ",", "sline", ",", "scol", ",", "eline", ",", "ecol", ",", "string", ")", ";", "if", "(", "debug", ")", "{", "System", ".", "out", ".", "println", "(", "\"\"", "+", "string", "+", "\"]", "at", "L\"", "+", "sline", "+", "\"C\"", "+", "scol", "+", "\">L\"", "+", "eline", "+", "\"C\"", "+", "ecol", ")", ";", "}", "}", "@", "Override", "public", "List", "<", "TaskEntry", ">", "getPositionsOf", "(", "String", "taskTag", ",", "String", "taskPriority", ",", "int", "[", "]", "lineseps", ",", "boolean", "caseSensitive", ")", "{", "int", "i", "=", "findTaskTag", "(", "comment", ",", "taskTag", ",", "caseSensitive", ",", "0", ")", ";", "if", "(", "debug", ")", "{", "System", ".", "out", ".", "println", "(", "\"\"", "+", "comment", "+", "\"]", "for", "'\"", "+", "taskTag", "+", "\"'", "\"", "+", "i", ")", ";", "}", "if", "(", "i", "==", "-", "1", ")", "{", "return", "Collections", ".", "emptyList", "(", ")", ";", "}", "List", "<", "TaskEntry", ">", "taskPositions", "=", "new", "ArrayList", "<", "TaskEntry", ">", "(", ")", ";", "while", "(", "i", "!=", "-", "1", ")", "{", "if", "(", "isValidStartLocationForTask", "(", "comment", ",", "i", ",", "taskTag", ")", ")", "{", "int", "offsetToCommentStart", "=", "(", "sline", "==", "1", "?", "0", ":", "lineseps", "[", "sline", "-", "2", "]", "+", "1", ")", "+", "scol", "-", "1", ";", "int", "taskTagStart", "=", "offsetToCommentStart", "+", "i", ";", "int", "taskEnd", "=", "taskTagStart", ";", "while", "(", "true", ")", "{", "int", "pos", "=", "taskEnd", "-", "offsetToCommentStart", ";", "char", "ch", "=", "comment", ".", "charAt", "(", "pos", ")", ";", "if", "(", "ch", "==", "'\\n'", "||", "ch", "==", "'\\r'", ")", "{", "break", ";", "}", "if", "(", "(", "pos", "+", "2", ")", ">", "comment", ".", "length", "(", ")", ")", "{", "taskEnd", "--", ";", "break", ";", "}", "taskEnd", "++", ";", "}", "TaskEntry", "taskEntry", "=", "new", "TaskEntry", "(", "taskTagStart", ",", "taskEnd", "-", "1", ",", "taskTag", ",", "taskPriority", ",", "comment", ",", "offsetToCommentStart", ")", ";", "if", "(", "debug", ")", "{", "System", ".", "out", ".", "println", "(", "\"\"", "+", "taskEntry", ".", "toString", "(", ")", ")", ";", "}", "taskPositions", ".", "add", "(", "taskEntry", ")", ";", "}", "i", "=", "findTaskTag", "(", "comment", ",", "taskTag", ",", "caseSensitive", ",", "i", "+", "taskTag", ".", "length", "(", ")", ")", ";", "}", "return", "taskPositions", ";", "}", "}", "</s>" ]
6,641
[ "<s>", "package", "org", ".", "codehaus", ".", "groovy", ".", "ast", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "expr", ".", "*", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "stmt", ".", "*", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "classgen", ".", "BytecodeExpression", ";", "import", "java", ".", "util", ".", "List", ";", "public", "abstract", "class", "CodeVisitorSupport", "implements", "GroovyCodeVisitor", "{", "public", "void", "visitBlockStatement", "(", "BlockStatement", "block", ")", "{", "for", "(", "Statement", "statement", ":", "block", ".", "getStatements", "(", ")", ")", "{", "statement", ".", "visit", "(", "this", ")", ";", "}", "}", "public", "void", "visitForLoop", "(", "ForStatement", "forLoop", ")", "{", "forLoop", ".", "getCollectionExpression", "(", ")", ".", "visit", "(", "this", ")", ";", "forLoop", ".", "getLoopBlock", "(", ")", ".", "visit", "(", "this", ")", ";", "}", "public", "void", "visitWhileLoop", "(", "WhileStatement", "loop", ")", "{", "loop", ".", "getBooleanExpression", "(", ")", ".", "visit", "(", "this", ")", ";", "loop", ".", "getLoopBlock", "(", ")", ".", "visit", "(", "this", ")", ";", "}", "public", "void", "visitDoWhileLoop", "(", "DoWhileStatement", "loop", ")", "{", "loop", ".", "getLoopBlock", "(", ")", ".", "visit", "(", "this", ")", ";", "loop", ".", "getBooleanExpression", "(", ")", ".", "visit", "(", "this", ")", ";", "}", "public", "void", "visitIfElse", "(", "IfStatement", "ifElse", ")", "{", "ifElse", ".", "getBooleanExpression", "(", ")", ".", "visit", "(", "this", ")", ";", "ifElse", ".", "getIfBlock", "(", ")", ".", "visit", "(", "this", ")", ";", "Statement", "elseBlock", "=", "ifElse", ".", "getElseBlock", "(", ")", ";", "if", "(", "elseBlock", "instanceof", "EmptyStatement", ")", "{", "visitEmptyStatement", "(", "(", "EmptyStatement", ")", "elseBlock", ")", ";", "}", "else", "{", "elseBlock", ".", "visit", "(", "this", ")", ";", "}", "}", "public", "void", "visitExpressionStatement", "(", "ExpressionStatement", "statement", ")", "{", "statement", ".", "getExpression", "(", ")", ".", "visit", "(", "this", ")", ";", "}", "public", "void", "visitReturnStatement", "(", "ReturnStatement", "statement", ")", "{", "statement", ".", "getExpression", "(", ")", ".", "visit", "(", "this", ")", ";", "}", "public", "void", "visitAssertStatement", "(", "AssertStatement", "statement", ")", "{", "statement", ".", "getBooleanExpression", "(", ")", ".", "visit", "(", "this", ")", ";", "statement", ".", "getMessageExpression", "(", ")", ".", "visit", "(", "this", ")", ";", "}", "public", "void", "visitTryCatchFinally", "(", "TryCatchStatement", "statement", ")", "{", "statement", ".", "getTryStatement", "(", ")", ".", "visit", "(", "this", ")", ";", "for", "(", "CatchStatement", "catchStatement", ":", "statement", ".", "getCatchStatements", "(", ")", ")", "{", "catchStatement", ".", "visit", "(", "this", ")", ";", "}", "Statement", "finallyStatement", "=", "statement", ".", "getFinallyStatement", "(", ")", ";", "if", "(", "finallyStatement", "instanceof", "EmptyStatement", ")", "{", "visitEmptyStatement", "(", "(", "EmptyStatement", ")", "finallyStatement", ")", ";", "}", "else", "{", "finallyStatement", ".", "visit", "(", "this", ")", ";", "}", "}", "protected", "void", "visitEmptyStatement", "(", "EmptyStatement", "statement", ")", "{", "}", "public", "void", "visitSwitch", "(", "SwitchStatement", "statement", ")", "{", "statement", ".", "getExpression", "(", ")", ".", "visit", "(", "this", ")", ";", "for", "(", "CaseStatement", "caseStatement", ":", "statement", ".", "getCaseStatements", "(", ")", ")", "{", "caseStatement", ".", "visit", "(", "this", ")", ";", "}", "statement", ".", "getDefaultStatement", "(", ")", ".", "visit", "(", "this", ")", ";", "}", "public", "void", "visitCaseStatement", "(", "CaseStatement", "statement", ")", "{", "statement", ".", "getExpression", "(", ")", ".", "visit", "(", "this", ")", ";", "statement", ".", "getCode", "(", ")", ".", "visit", "(", "this", ")", ";", "}", "public", "void", "visitBreakStatement", "(", "BreakStatement", "statement", ")", "{", "}", "public", "void", "visitContinueStatement", "(", "ContinueStatement", "statement", ")", "{", "}", "public", "void", "visitSynchronizedStatement", "(", "SynchronizedStatement", "statement", ")", "{", "statement", ".", "getExpression", "(", ")", ".", "visit", "(", "this", ")", ";", "statement", ".", "getCode", "(", ")", ".", "visit", "(", "this", ")", ";", "}", "public", "void", "visitThrowStatement", "(", "ThrowStatement", "statement", ")", "{", "statement", ".", "getExpression", "(", ")", ".", "visit", "(", "this", ")", ";", "}", "public", "void", "visitMethodCallExpression", "(", "MethodCallExpression", "call", ")", "{", "call", ".", "getObjectExpression", "(", ")", ".", "visit", "(", "this", ")", ";", "call", ".", "getMethod", "(", ")", ".", "visit", "(", "this", ")", ";", "call", ".", "getArguments", "(", ")", ".", "visit", "(", "this", ")", ";", "}", "public", "void", "visitStaticMethodCallExpression", "(", "StaticMethodCallExpression", "call", ")", "{", "call", ".", "getArguments", "(", ")", ".", "visit", "(", "this", ")", ";", "}", "public", "void", "visitConstructorCallExpression", "(", "ConstructorCallExpression", "call", ")", "{", "call", ".", "getArguments", "(", ")", ".", "visit", "(", "this", ")", ";", "}", "public", "void", "visitBinaryExpression", "(", "BinaryExpression", "expression", ")", "{", "expression", ".", "getLeftExpression", "(", ")", ".", "visit", "(", "this", ")", ";", "expression", ".", "getRightExpression", "(", ")", ".", "visit", "(", "this", ")", ";", "}", "public", "void", "visitTernaryExpression", "(", "TernaryExpression", "expression", ")", "{", "expression", ".", "getBooleanExpression", "(", ")", ".", "visit", "(", "this", ")", ";", "expression", ".", "getTrueExpression", "(", ")", ".", "visit", "(", "this", ")", ";", "expression", ".", "getFalseExpression", "(", ")", ".", "visit", "(", "this", ")", ";", "}", "public", "void", "visitShortTernaryExpression", "(", "ElvisOperatorExpression", "expression", ")", "{", "visitTernaryExpression", "(", "expression", ")", ";", "}", "public", "void", "visitPostfixExpression", "(", "PostfixExpression", "expression", ")", "{", "expression", ".", "getExpression", "(", ")", ".", "visit", "(", "this", ")", ";", "}", "public", "void", "visitPrefixExpression", "(", "PrefixExpression", "expression", ")", "{", "expression", ".", "getExpression", "(", ")", ".", "visit", "(", "this", ")", ";", "}", "public", "void", "visitBooleanExpression", "(", "BooleanExpression", "expression", ")", "{", "expression", ".", "getExpression", "(", ")", ".", "visit", "(", "this", ")", ";", "}", "public", "void", "visitNotExpression", "(", "NotExpression", "expression", ")", "{", "expression", ".", "getExpression", "(", ")", ".", "visit", "(", "this", ")", ";", "}", "public", "void", "visitClosureExpression", "(", "ClosureExpression", "expression", ")", "{", "expression", ".", "getCode", "(", ")", ".", "visit", "(", "this", ")", ";", "}", "public", "void", "visitTupleExpression", "(", "TupleExpression", "expression", ")", "{", "visitListOfExpressions", "(", "expression", ".", "getExpressions", "(", ")", ")", ";", "}", "public", "void", "visitListExpression", "(", "ListExpression", "expression", ")", "{", "visitListOfExpressions", "(", "expression", ".", "getExpressions", "(", ")", ")", ";", "}", "public", "void", "visitArrayExpression", "(", "ArrayExpression", "expression", ")", "{", "visitListOfExpressions", "(", "expression", ".", "getExpressions", "(", ")", ")", ";", "visitListOfExpressions", "(", "expression", ".", "getSizeExpression", "(", ")", ")", ";", "}", "public", "void", "visitMapExpression", "(", "MapExpression", "expression", ")", "{", "visitListOfExpressions", "(", "expression", ".", "getMapEntryExpressions", "(", ")", ")", ";", "}", "public", "void", "visitMapEntryExpression", "(", "MapEntryExpression", "expression", ")", "{", "expression", ".", "getKeyExpression", "(", ")", ".", "visit", "(", "this", ")", ";", "expression", ".", "getValueExpression", "(", ")", ".", "visit", "(", "this", ")", ";", "}", "public", "void", "visitRangeExpression", "(", "RangeExpression", "expression", ")", "{", "expression", ".", "getFrom", "(", ")", ".", "visit", "(", "this", ")", ";", "expression", ".", "getTo", "(", ")", ".", "visit", "(", "this", ")", ";", "}", "public", "void", "visitSpreadExpression", "(", "SpreadExpression", "expression", ")", "{", "expression", ".", "getExpression", "(", ")", ".", "visit", "(", "this", ")", ";", "}", "public", "void", "visitSpreadMapExpression", "(", "SpreadMapExpression", "expression", ")", "{", "expression", ".", "getExpression", "(", ")", ".", "visit", "(", "this", ")", ";", "}", "public", "void", "visitMethodPointerExpression", "(", "MethodPointerExpression", "expression", ")", "{", "expression", ".", "getExpression", "(", ")", ".", "visit", "(", "this", ")", ";", "expression", ".", "getMethodName", "(", ")", ".", "visit", "(", "this", ")", ";", "}", "public", "void", "visitUnaryMinusExpression", "(", "UnaryMinusExpression", "expression", ")", "{", "expression", ".", "getExpression", "(", ")", ".", "visit", "(", "this", ")", ";", "}", "public", "void", "visitUnaryPlusExpression", "(", "UnaryPlusExpression", "expression", ")", "{", "expression", ".", "getExpression", "(", ")", ".", "visit", "(", "this", ")", ";", "}", "public", "void", "visitBitwiseNegationExpression", "(", "BitwiseNegationExpression", "expression", ")", "{", "expression", ".", "getExpression", "(", ")", ".", "visit", "(", "this", ")", ";", "}", "public", "void", "visitCastExpression", "(", "CastExpression", "expression", ")", "{", "expression", ".", "getExpression", "(", ")", ".", "visit", "(", "this", ")", ";", "}", "public", "void", "visitConstantExpression", "(", "ConstantExpression", "expression", ")", "{", "}", "public", "void", "visitClassExpression", "(", "ClassExpression", "expression", ")", "{", "}", "public", "void", "visitVariableExpression", "(", "VariableExpression", "expression", ")", "{", "}", "public", "void", "visitDeclarationExpression", "(", "DeclarationExpression", "expression", ")", "{", "visitBinaryExpression", "(", "expression", ")", ";", "}", "public", "void", "visitPropertyExpression", "(", "PropertyExpression", "expression", ")", "{", "expression", ".", "getObjectExpression", "(", ")", ".", "visit", "(", "this", ")", ";", "expression", ".", "getProperty", "(", ")", ".", "visit", "(", "this", ")", ";", "}", "public", "void", "visitAttributeExpression", "(", "AttributeExpression", "expression", ")", "{", "expression", ".", "getObjectExpression", "(", ")", ".", "visit", "(", "this", ")", ";", "expression", ".", "getProperty", "(", ")", ".", "visit", "(", "this", ")", ";", "}", "public", "void", "visitFieldExpression", "(", "FieldExpression", "expression", ")", "{", "}", "public", "void", "visitGStringExpression", "(", "GStringExpression", "expression", ")", "{", "visitListOfExpressions", "(", "expression", ".", "getStrings", "(", ")", ")", ";", "visitListOfExpressions", "(", "expression", ".", "getValues", "(", ")", ")", ";", "}", "protected", "void", "visitListOfExpressions", "(", "List", "<", "?", "extends", "Expression", ">", "list", ")", "{", "if", "(", "list", "==", "null", ")", "return", ";", "for", "(", "Expression", "expression", ":", "list", ")", "{", "if", "(", "expression", "instanceof", "SpreadExpression", ")", "{", "Expression", "spread", "=", "(", "(", "SpreadExpression", ")", "expression", ")", ".", "getExpression", "(", ")", ";", "spread", ".", "visit", "(", "this", ")", ";", "}", "else", "{", "if", "(", "expression", "!=", "null", ")", "expression", ".", "visit", "(", "this", ")", ";", "}", "}", "}", "public", "void", "visitCatchStatement", "(", "CatchStatement", "statement", ")", "{", "statement", ".", "getCode", "(", ")", ".", "visit", "(", "this", ")", ";", "}", "public", "void", "visitArgumentlistExpression", "(", "ArgumentListExpression", "ale", ")", "{", "visitTupleExpression", "(", "ale", ")", ";", "}", "public", "void", "visitClosureListExpression", "(", "ClosureListExpression", "cle", ")", "{", "visitListOfExpressions", "(", "cle", ".", "getExpressions", "(", ")", ")", ";", "}", "public", "void", "visitBytecodeExpression", "(", "BytecodeExpression", "cle", ")", "{", "}", "public", "void", "visitEmptyExpression", "(", "EmptyExpression", "expression", ")", "{", "}", "}", "</s>" ]
6,642
[ "<s>", "package", "org", ".", "codehaus", ".", "groovy", ".", "ast", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "expr", ".", "ConstantExpression", ";", "import", "org", ".", "objectweb", ".", "asm", ".", "Opcodes", ";", "public", "class", "ImportNode", "extends", "AnnotatedNode", "implements", "Opcodes", "{", "private", "final", "ClassNode", "type", ";", "private", "final", "String", "alias", ";", "private", "final", "String", "fieldName", ";", "private", "final", "String", "packageName", ";", "private", "final", "boolean", "isStar", ";", "private", "final", "boolean", "isStatic", ";", "public", "ImportNode", "(", "ClassNode", "type", ",", "String", "alias", ")", "{", "this", ".", "type", "=", "type", ";", "this", ".", "alias", "=", "alias", ";", "this", ".", "isStar", "=", "false", ";", "this", ".", "isStatic", "=", "false", ";", "this", ".", "packageName", "=", "null", ";", "this", ".", "fieldName", "=", "null", ";", "}", "public", "ImportNode", "(", "String", "packageName", ")", "{", "this", ".", "type", "=", "null", ";", "this", ".", "alias", "=", "null", ";", "this", ".", "isStar", "=", "true", ";", "this", ".", "isStatic", "=", "false", ";", "this", ".", "packageName", "=", "packageName", ";", "this", ".", "fieldName", "=", "null", ";", "}", "public", "ImportNode", "(", "ClassNode", "type", ")", "{", "this", ".", "type", "=", "type", ";", "this", ".", "alias", "=", "null", ";", "this", ".", "isStar", "=", "true", ";", "this", ".", "isStatic", "=", "true", ";", "this", ".", "packageName", "=", "null", ";", "this", ".", "fieldName", "=", "null", ";", "}", "public", "ImportNode", "(", "ClassNode", "type", ",", "String", "fieldName", ",", "String", "alias", ")", "{", "this", ".", "type", "=", "type", ";", "this", ".", "alias", "=", "alias", ";", "this", ".", "isStar", "=", "false", ";", "this", ".", "isStatic", "=", "true", ";", "this", ".", "packageName", "=", "null", ";", "this", ".", "fieldName", "=", "fieldName", ";", "}", "public", "String", "getText", "(", ")", "{", "String", "typeName", "=", "getClassName", "(", ")", ";", "if", "(", "isStar", "&&", "!", "isStatic", ")", "{", "return", "\"import", "\"", "+", "packageName", "+", "\"*\"", ";", "}", "if", "(", "isStar", ")", "{", "return", "\"\"", "+", "typeName", "+", "\".*\"", ";", "}", "if", "(", "isStatic", ")", "{", "if", "(", "alias", "!=", "null", "&&", "alias", ".", "length", "(", ")", "!=", "0", "&&", "!", "alias", ".", "equals", "(", "fieldName", ")", ")", "{", "return", "\"\"", "+", "typeName", "+", "\".\"", "+", "fieldName", "+", "\"", "as", "\"", "+", "alias", ";", "}", "return", "\"\"", "+", "typeName", "+", "\".\"", "+", "fieldName", ";", "}", "if", "(", "alias", "==", "null", "||", "alias", ".", "length", "(", ")", "==", "0", ")", "{", "return", "\"import", "\"", "+", "typeName", ";", "}", "return", "\"import", "\"", "+", "typeName", "+", "\"", "as", "\"", "+", "alias", ";", "}", "public", "String", "getPackageName", "(", ")", "{", "return", "packageName", ";", "}", "public", "String", "getFieldName", "(", ")", "{", "return", "fieldName", ";", "}", "public", "boolean", "isStar", "(", ")", "{", "return", "isStar", ";", "}", "public", "boolean", "isStatic", "(", ")", "{", "return", "isStatic", ";", "}", "public", "String", "getAlias", "(", ")", "{", "return", "alias", ";", "}", "public", "ClassNode", "getType", "(", ")", "{", "return", "type", ";", "}", "public", "String", "getClassName", "(", ")", "{", "return", "type", "==", "null", "?", "null", ":", "type", ".", "getName", "(", ")", ";", "}", "public", "void", "visit", "(", "GroovyCodeVisitor", "visitor", ")", "{", "}", "private", "boolean", "unresolvable", "=", "false", ";", "private", "ConstantExpression", "aliasExpr", ";", "private", "ConstantExpression", "fieldNameExpr", ";", "public", "ConstantExpression", "getFieldNameExpr", "(", ")", "{", "return", "fieldNameExpr", ";", "}", "public", "void", "setFieldNameExpr", "(", "ConstantExpression", "fieldNameExpr", ")", "{", "this", ".", "fieldNameExpr", "=", "fieldNameExpr", ";", "}", "public", "ConstantExpression", "getAliasExpr", "(", ")", "{", "return", "aliasExpr", ";", "}", "public", "void", "setAliasExpr", "(", "ConstantExpression", "aliasExpr", ")", "{", "this", ".", "aliasExpr", "=", "aliasExpr", ";", "}", "public", "void", "markAsUnresolvable", "(", ")", "{", "unresolvable", "=", "true", ";", "}", "public", "boolean", "isUnresolvable", "(", ")", "{", "return", "unresolvable", ";", "}", "public", "boolean", "isStaticStar", "(", ")", "{", "return", "type", "!=", "null", "&&", "alias", "==", "null", ";", "}", "}", "</s>" ]
6,643
[ "<s>", "package", "org", ".", "codehaus", ".", "groovy", ".", "ast", ";", "import", "java", ".", "util", ".", "HashSet", ";", "import", "java", ".", "util", ".", "Set", ";", "public", "class", "GenericsType", "extends", "ASTNode", "{", "protected", "ClassNode", "[", "]", "upperBounds", ";", "protected", "ClassNode", "lowerBound", ";", "protected", "ClassNode", "type", ";", "protected", "String", "name", ";", "protected", "boolean", "placeholder", ";", "private", "boolean", "resolved", ";", "private", "boolean", "wildcard", ";", "public", "GenericsType", "(", "ClassNode", "type", ",", "ClassNode", "[", "]", "upperBounds", ",", "ClassNode", "lowerBound", ")", "{", "this", ".", "type", "=", "type", ";", "this", ".", "name", "=", "type", ".", "isGenericsPlaceHolder", "(", ")", "?", "type", ".", "getUnresolvedName", "(", ")", ":", "type", ".", "getName", "(", ")", ";", "this", ".", "upperBounds", "=", "upperBounds", ";", "this", ".", "lowerBound", "=", "lowerBound", ";", "placeholder", "=", "type", ".", "isGenericsPlaceHolder", "(", ")", ";", "resolved", "=", "false", ";", "}", "public", "GenericsType", "(", ")", "{", "}", "public", "String", "toDetailsString", "(", ")", "{", "StringBuilder", "s", "=", "new", "StringBuilder", "(", ")", ";", "s", ".", "append", "(", "\"\"", ")", ".", "append", "(", "name", ")", ".", "append", "(", "\"\"", ")", ".", "append", "(", "placeholder", ")", ";", "s", ".", "append", "(", "\",resolved=\"", ")", ".", "append", "(", "resolved", ")", ".", "append", "(", "\",wildcard=\"", ")", ".", "append", "(", "wildcard", ")", ";", "s", ".", "append", "(", "\",type=\"", ")", ".", "append", "(", "type", ")", ";", "if", "(", "lowerBound", "!=", "null", ")", "{", "s", ".", "append", "(", "\",lowerBound=\"", ")", ".", "append", "(", "lowerBound", ")", ";", "}", "if", "(", "upperBounds", "!=", "null", ")", "{", "s", ".", "append", "(", "\"\"", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "upperBounds", ".", "length", ";", "i", "++", ")", "{", "if", "(", "i", ">", "0", ")", "{", "s", ".", "append", "(", "\",\"", ")", ";", "}", "s", ".", "append", "(", "upperBounds", "[", "i", "]", ")", ";", "}", "}", "s", ".", "append", "(", "\"]]\"", ")", ";", "s", ".", "append", "(", "this", ".", "getClass", "(", ")", ".", "getName", "(", ")", ")", ";", "return", "s", ".", "toString", "(", ")", ";", "}", "public", "GenericsType", "(", "ClassNode", "basicType", ")", "{", "this", "(", "basicType", ",", "null", ",", "null", ")", ";", "}", "public", "ClassNode", "getType", "(", ")", "{", "return", "type", ";", "}", "public", "void", "setType", "(", "ClassNode", "type", ")", "{", "this", ".", "type", "=", "type", ";", "}", "public", "String", "toString", "(", ")", "{", "Set", "<", "String", ">", "visited", "=", "new", "HashSet", "<", "String", ">", "(", ")", ";", "return", "toString", "(", "visited", ")", ";", "}", "private", "String", "toString", "(", "Set", "<", "String", ">", "visited", ")", "{", "if", "(", "placeholder", ")", "visited", ".", "add", "(", "name", ")", ";", "String", "ret", "=", "(", "type", "==", "null", "||", "placeholder", "||", "wildcard", ")", "?", "name", ":", "genericsBounds", "(", "type", ",", "visited", ")", ";", "if", "(", "upperBounds", "!=", "null", ")", "{", "ret", "+=", "\"", "extends", "\"", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "upperBounds", ".", "length", ";", "i", "++", ")", "{", "ret", "+=", "genericsBounds", "(", "upperBounds", "[", "i", "]", ",", "visited", ")", ";", "if", "(", "i", "+", "1", "<", "upperBounds", ".", "length", ")", "ret", "+=", "\"", "&", "\"", ";", "}", "}", "else", "if", "(", "lowerBound", "!=", "null", ")", "{", "ret", "+=", "\"", "super", "\"", "+", "genericsBounds", "(", "lowerBound", ",", "visited", ")", ";", "}", "return", "ret", ";", "}", "private", "String", "genericsBounds", "(", "ClassNode", "theType", ",", "Set", "<", "String", ">", "visited", ")", "{", "String", "ret", "=", "theType", ".", "isArray", "(", ")", "?", "theType", ".", "getComponentType", "(", ")", ".", "getName", "(", ")", "+", "\"[]\"", ":", "theType", ".", "getName", "(", ")", ";", "GenericsType", "[", "]", "genericsTypes", "=", "theType", ".", "getGenericsTypes", "(", ")", ";", "if", "(", "genericsTypes", "==", "null", "||", "genericsTypes", ".", "length", "==", "0", ")", "return", "ret", ";", "if", "(", "genericsTypes", ".", "length", "==", "1", "&&", "genericsTypes", "[", "0", "]", ".", "isPlaceholder", "(", ")", "&&", "theType", ".", "getName", "(", ")", ".", "equals", "(", "\"\"", ")", ")", "{", "return", "genericsTypes", "[", "0", "]", ".", "getName", "(", ")", ";", "}", "ret", "+=", "\"<\"", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "genericsTypes", ".", "length", ";", "i", "++", ")", "{", "if", "(", "i", "!=", "0", ")", "ret", "+=", "\",", "\"", ";", "GenericsType", "type", "=", "genericsTypes", "[", "i", "]", ";", "if", "(", "type", ".", "isPlaceholder", "(", ")", "&&", "visited", ".", "contains", "(", "type", ".", "getName", "(", ")", ")", ")", "{", "ret", "+=", "type", ".", "getName", "(", ")", ";", "}", "else", "{", "ret", "+=", "type", ".", "toString", "(", "visited", ")", ";", "}", "}", "ret", "+=", "\">\"", ";", "return", "ret", ";", "}", "public", "ClassNode", "[", "]", "getUpperBounds", "(", ")", "{", "return", "upperBounds", ";", "}", "public", "String", "getName", "(", ")", "{", "return", "name", ";", "}", "public", "boolean", "isPlaceholder", "(", ")", "{", "return", "placeholder", ";", "}", "public", "void", "setPlaceholder", "(", "boolean", "placeholder", ")", "{", "this", ".", "placeholder", "=", "placeholder", ";", "type", ".", "setGenericsPlaceHolder", "(", "placeholder", ")", ";", "}", "public", "boolean", "isResolved", "(", ")", "{", "return", "resolved", "||", "placeholder", ";", "}", "public", "void", "setResolved", "(", "boolean", "res", ")", "{", "resolved", "=", "res", ";", "}", "public", "void", "setName", "(", "String", "name", ")", "{", "this", ".", "name", "=", "name", ";", "}", "public", "boolean", "isWildcard", "(", ")", "{", "return", "wildcard", ";", "}", "public", "void", "setWildcard", "(", "boolean", "wildcard", ")", "{", "this", ".", "wildcard", "=", "wildcard", ";", "}", "public", "ClassNode", "getLowerBound", "(", ")", "{", "return", "lowerBound", ";", "}", "public", "void", "setUpperBounds", "(", "ClassNode", "[", "]", "bounds", ")", "{", "this", ".", "upperBounds", "=", "bounds", ";", "}", "public", "void", "setLowerBound", "(", "ClassNode", "bound", ")", "{", "this", ".", "lowerBound", "=", "bound", ";", "}", "}", "</s>" ]
6,644
[ "<s>", "package", "org", ".", "codehaus", ".", "groovy", ".", "ast", ";", "import", "java", ".", "util", ".", "Comparator", ";", "import", "java", ".", "util", ".", "List", ";", "import", "java", ".", "util", ".", "Map", ";", "import", "java", ".", "util", ".", "SortedSet", ";", "import", "java", ".", "util", ".", "TreeSet", ";", "public", "class", "ImportNodeCompatibilityWrapper", "{", "private", "class", "ImportNodeComparator", "implements", "Comparator", "<", "ImportNode", ">", "{", "public", "int", "compare", "(", "ImportNode", "i1", ",", "ImportNode", "i2", ")", "{", "int", "start1", "=", "i1", ".", "getStart", "(", ")", ";", "if", "(", "start1", "<=", "0", "&&", "i1", ".", "getType", "(", ")", "!=", "null", ")", "{", "start1", "=", "i1", ".", "getType", "(", ")", ".", "getStart", "(", ")", ";", "}", "int", "start2", "=", "i2", ".", "getStart", "(", ")", ";", "if", "(", "start2", "<=", "0", "&&", "i2", ".", "getType", "(", ")", "!=", "null", ")", "{", "start2", "=", "i2", ".", "getType", "(", ")", ".", "getStart", "(", ")", ";", "}", "return", "start1", "-", "start2", ";", "}", "}", "private", "SortedSet", "<", "ImportNode", ">", "sortedImports", ";", "private", "ModuleNode", "module", ";", "public", "ImportNodeCompatibilityWrapper", "(", "ModuleNode", "module", ")", "{", "if", "(", "module", "==", "null", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\"\"", ")", ";", "}", "this", ".", "module", "=", "module", ";", "}", "public", "SortedSet", "<", "ImportNode", ">", "getAllImportNodes", "(", ")", "{", "if", "(", "sortedImports", "==", "null", ")", "{", "initialize", "(", ")", ";", "}", "return", "sortedImports", ";", "}", "private", "void", "initialize", "(", ")", "{", "sortedImports", "=", "new", "TreeSet", "<", "ImportNode", ">", "(", "new", "ImportNodeComparator", "(", ")", ")", ";", "sortedImports", ".", "addAll", "(", "module", ".", "getImports", "(", ")", ")", ";", "sortedImports", ".", "addAll", "(", "module", ".", "getStarImports", "(", ")", ")", ";", "sortedImports", ".", "addAll", "(", "module", ".", "getStaticStarImports", "(", ")", ".", "values", "(", ")", ")", ";", "sortedImports", ".", "addAll", "(", "module", ".", "getStaticImports", "(", ")", ".", "values", "(", ")", ")", ";", "}", "public", "static", "String", "getFieldName", "(", "ImportNode", "node", ")", "{", "return", "node", ".", "getFieldName", "(", ")", ";", "}", "public", "static", "Map", "<", "String", ",", "ImportNode", ">", "getStaticImports", "(", "ModuleNode", "node", ")", "{", "return", "node", ".", "getStaticImports", "(", ")", ";", "}", "public", "static", "Map", "<", "String", ",", "ImportNode", ">", "getStaticStarImports", "(", "ModuleNode", "node", ")", "{", "return", "node", ".", "getStaticStarImports", "(", ")", ";", "}", "public", "static", "List", "<", "ImportNode", ">", "getStarImports", "(", "ModuleNode", "node", ")", "{", "return", "node", ".", "getStarImports", "(", ")", ";", "}", "}", "</s>" ]
6,645
[ "<s>", "package", "org", ".", "codehaus", ".", "groovy", ".", "ast", ";", "public", "class", "TaskEntry", "{", "public", "int", "start", ";", "private", "int", "end", ";", "public", "String", "taskTag", ";", "public", "String", "taskPriority", ";", "public", "TaskEntry", "isAdjacentTo", ";", "private", "String", "commentText", ";", "private", "int", "offsetToStartOfCommentTextInFile", ";", "public", "TaskEntry", "(", "int", "startOffset", ",", "int", "endOffset", ",", "String", "taskTag", ",", "String", "taskPriority", ",", "String", "commentText", ",", "int", "offsetToStartOfCommentTextInFile", ")", "{", "this", ".", "start", "=", "startOffset", ";", "this", ".", "end", "=", "endOffset", ";", "this", ".", "taskTag", "=", "taskTag", ";", "this", ".", "taskPriority", "=", "taskPriority", ";", "this", ".", "commentText", "=", "commentText", ";", "this", ".", "offsetToStartOfCommentTextInFile", "=", "offsetToStartOfCommentTextInFile", ";", "}", "public", "int", "getEnd", "(", ")", "{", "if", "(", "isAdjacentTo", "!=", "null", ")", "{", "return", "isAdjacentTo", ".", "getEnd", "(", ")", ";", "}", "return", "end", ";", "}", "public", "void", "setEnd", "(", "int", "end", ")", "{", "this", ".", "end", "=", "end", ";", "}", "public", "String", "getText", "(", ")", "{", "if", "(", "isAdjacentTo", "!=", "null", ")", "{", "return", "isAdjacentTo", ".", "getText", "(", ")", ";", "}", "else", "{", "int", "commentStartIndex", "=", "start", "-", "offsetToStartOfCommentTextInFile", "+", "taskTag", ".", "length", "(", ")", ";", "int", "commentEndIndex", "=", "end", "-", "offsetToStartOfCommentTextInFile", "+", "1", ";", "return", "commentText", ".", "substring", "(", "commentStartIndex", ",", "commentEndIndex", ")", ".", "trim", "(", ")", ";", "}", "}", "public", "String", "toString", "(", ")", "{", "StringBuffer", "task", "=", "new", "StringBuffer", "(", ")", ";", "task", ".", "append", "(", "\"Task:\"", "+", "taskTag", "+", "\"[\"", "+", "getText", "(", ")", "+", "\"]", "\"", "+", "start", "+", "\"", ">", "\"", "+", "end", "+", "\"(\"", "+", "getEnd", "(", ")", "+", "\")\"", ")", ";", "return", "task", ".", "toString", "(", ")", ";", "}", "}", "</s>" ]
6,646
[ "<s>", "package", "org", ".", "codehaus", ".", "groovy", ".", "ast", ";", "import", "groovy", ".", "lang", ".", "*", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "runtime", ".", "GeneratedClosure", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "vmplugin", ".", "VMPluginFactory", ";", "import", "org", ".", "objectweb", ".", "asm", ".", "Opcodes", ";", "import", "java", ".", "math", ".", "BigDecimal", ";", "import", "java", ".", "math", ".", "BigInteger", ";", "import", "java", ".", "util", ".", "Iterator", ";", "import", "java", ".", "util", ".", "List", ";", "import", "java", ".", "util", ".", "Map", ";", "import", "java", ".", "util", ".", "WeakHashMap", ";", "import", "java", ".", "util", ".", "regex", ".", "Pattern", ";", "import", "java", ".", "lang", ".", "ref", ".", "SoftReference", ";", "public", "class", "ClassHelper", "{", "public", "static", "final", "Class", "[", "]", "classes", "=", "new", "Class", "[", "]", "{", "Object", ".", "class", ",", "Boolean", ".", "TYPE", ",", "Character", ".", "TYPE", ",", "Byte", ".", "TYPE", ",", "Short", ".", "TYPE", ",", "Integer", ".", "TYPE", ",", "Long", ".", "TYPE", ",", "Double", ".", "TYPE", ",", "Float", ".", "TYPE", ",", "Void", ".", "TYPE", ",", "Closure", ".", "class", ",", "GString", ".", "class", ",", "List", ".", "class", ",", "Map", ".", "class", ",", "Range", ".", "class", ",", "Pattern", ".", "class", ",", "Script", ".", "class", ",", "String", ".", "class", ",", "Boolean", ".", "class", ",", "Character", ".", "class", ",", "Byte", ".", "class", ",", "Short", ".", "class", ",", "Integer", ".", "class", ",", "Long", ".", "class", ",", "Double", ".", "class", ",", "Float", ".", "class", ",", "BigDecimal", ".", "class", ",", "BigInteger", ".", "class", ",", "Number", ".", "class", ",", "Void", ".", "class", ",", "Reference", ".", "class", ",", "Class", ".", "class", ",", "MetaClass", ".", "class", ",", "Iterator", ".", "class", ",", "GeneratedClosure", ".", "class", ",", "GroovyObjectSupport", ".", "class", "}", ";", "private", "static", "final", "String", "[", "]", "primitiveClassNames", "=", "new", "String", "[", "]", "{", "\"\"", ",", "\"boolean\"", ",", "\"char\"", ",", "\"byte\"", ",", "\"short\"", ",", "\"int\"", ",", "\"long\"", ",", "\"double\"", ",", "\"float\"", ",", "\"void\"", "}", ";", "public", "static", "final", "ClassNode", "DYNAMIC_TYPE", "=", "makeCached", "(", "Object", ".", "class", ")", ",", "OBJECT_TYPE", "=", "DYNAMIC_TYPE", ",", "VOID_TYPE", "=", "makeCached", "(", "Void", ".", "TYPE", ")", ",", "CLOSURE_TYPE", "=", "makeCached", "(", "Closure", ".", "class", ")", ",", "GSTRING_TYPE", "=", "makeCached", "(", "GString", ".", "class", ")", ",", "LIST_TYPE", "=", "makeWithoutCaching", "(", "List", ".", "class", ")", ",", "MAP_TYPE", "=", "makeWithoutCaching", "(", "Map", ".", "class", ")", ",", "RANGE_TYPE", "=", "makeCached", "(", "Range", ".", "class", ")", ",", "PATTERN_TYPE", "=", "makeCached", "(", "Pattern", ".", "class", ")", ",", "STRING_TYPE", "=", "makeCached", "(", "String", ".", "class", ")", ",", "SCRIPT_TYPE", "=", "makeCached", "(", "Script", ".", "class", ")", ",", "REFERENCE_TYPE", "=", "makeWithoutCaching", "(", "Reference", ".", "class", ")", ",", "boolean_TYPE", "=", "makeCached", "(", "boolean", ".", "class", ")", ",", "char_TYPE", "=", "makeCached", "(", "char", ".", "class", ")", ",", "byte_TYPE", "=", "makeCached", "(", "byte", ".", "class", ")", ",", "int_TYPE", "=", "makeCached", "(", "int", ".", "class", ")", ",", "long_TYPE", "=", "makeCached", "(", "long", ".", "class", ")", ",", "short_TYPE", "=", "makeCached", "(", "short", ".", "class", ")", ",", "double_TYPE", "=", "makeCached", "(", "double", ".", "class", ")", ",", "float_TYPE", "=", "makeCached", "(", "float", ".", "class", ")", ",", "Byte_TYPE", "=", "makeCached", "(", "Byte", ".", "class", ")", ",", "Short_TYPE", "=", "makeCached", "(", "Short", ".", "class", ")", ",", "Integer_TYPE", "=", "makeCached", "(", "Integer", ".", "class", ")", ",", "Long_TYPE", "=", "makeCached", "(", "Long", ".", "class", ")", ",", "Character_TYPE", "=", "makeCached", "(", "Character", ".", "class", ")", ",", "Float_TYPE", "=", "makeCached", "(", "Float", ".", "class", ")", ",", "Double_TYPE", "=", "makeCached", "(", "Double", ".", "class", ")", ",", "Boolean_TYPE", "=", "makeCached", "(", "Boolean", ".", "class", ")", ",", "BigInteger_TYPE", "=", "makeCached", "(", "java", ".", "math", ".", "BigInteger", ".", "class", ")", ",", "BigDecimal_TYPE", "=", "makeCached", "(", "java", ".", "math", ".", "BigDecimal", ".", "class", ")", ",", "Number_TYPE", "=", "makeCached", "(", "Number", ".", "class", ")", ",", "void_WRAPPER_TYPE", "=", "makeCached", "(", "Void", ".", "class", ")", ",", "METACLASS_TYPE", "=", "makeCached", "(", "MetaClass", ".", "class", ")", ",", "Iterator_TYPE", "=", "makeCached", "(", "Iterator", ".", "class", ")", ",", "CLASS_Type", "=", "makeWithoutCaching", "(", "Class", ".", "class", ")", ",", "COMPARABLE_TYPE", "=", "makeWithoutCaching", "(", "Comparable", ".", "class", ")", ",", "GENERATED_CLOSURE_Type", "=", "makeWithoutCaching", "(", "GeneratedClosure", ".", "class", ")", ",", "GROOVY_OBJECT_SUPPORT_TYPE", "=", "makeWithoutCaching", "(", "GroovyObjectSupport", ".", "class", ")", ",", "GROOVY_OBJECT_TYPE", "=", "makeWithoutCaching", "(", "GroovyObject", ".", "class", ")", ",", "GROOVY_INTERCEPTABLE_TYPE", "=", "makeWithoutCaching", "(", "GroovyInterceptable", ".", "class", ")", ",", "Enum_Type", "=", "new", "ClassNode", "(", "\"\"", ",", "0", ",", "OBJECT_TYPE", ")", ",", "Annotation_TYPE", "=", "new", "ClassNode", "(", "\"\"", ",", "0", ",", "OBJECT_TYPE", ")", ",", "ELEMENT_TYPE_TYPE", "=", "new", "ClassNode", "(", "\"\"", ",", "0", ",", "Enum_Type", ")", ";", "static", "{", "Enum_Type", ".", "isPrimaryNode", "=", "false", ";", "Annotation_TYPE", ".", "isPrimaryNode", "=", "false", ";", "}", "private", "static", "ClassNode", "[", "]", "types", "=", "new", "ClassNode", "[", "]", "{", "OBJECT_TYPE", ",", "boolean_TYPE", ",", "char_TYPE", ",", "byte_TYPE", ",", "short_TYPE", ",", "int_TYPE", ",", "long_TYPE", ",", "double_TYPE", ",", "float_TYPE", ",", "VOID_TYPE", ",", "CLOSURE_TYPE", ",", "GSTRING_TYPE", ",", "LIST_TYPE", ",", "MAP_TYPE", ",", "RANGE_TYPE", ",", "PATTERN_TYPE", ",", "SCRIPT_TYPE", ",", "STRING_TYPE", ",", "Boolean_TYPE", ",", "Character_TYPE", ",", "Byte_TYPE", ",", "Short_TYPE", ",", "Integer_TYPE", ",", "Long_TYPE", ",", "Double_TYPE", ",", "Float_TYPE", ",", "BigDecimal_TYPE", ",", "BigInteger_TYPE", ",", "Number_TYPE", ",", "void_WRAPPER_TYPE", ",", "REFERENCE_TYPE", ",", "CLASS_Type", ",", "METACLASS_TYPE", ",", "Iterator_TYPE", ",", "GENERATED_CLOSURE_Type", ",", "GROOVY_OBJECT_SUPPORT_TYPE", ",", "GROOVY_OBJECT_TYPE", ",", "GROOVY_INTERCEPTABLE_TYPE", ",", "Enum_Type", ",", "Annotation_TYPE", "}", ";", "private", "static", "ClassNode", "[", "]", "numbers", "=", "new", "ClassNode", "[", "]", "{", "char_TYPE", ",", "byte_TYPE", ",", "short_TYPE", ",", "int_TYPE", ",", "long_TYPE", ",", "double_TYPE", ",", "float_TYPE", ",", "Short_TYPE", ",", "Byte_TYPE", ",", "Character_TYPE", ",", "Integer_TYPE", ",", "Float_TYPE", ",", "Long_TYPE", ",", "Double_TYPE", ",", "BigInteger_TYPE", ",", "BigDecimal_TYPE", "}", ";", "protected", "static", "final", "ClassNode", "[", "]", "EMPTY_TYPE_ARRAY", "=", "{", "}", ";", "public", "static", "final", "String", "OBJECT", "=", "\"\"", ";", "public", "static", "ClassNode", "makeCached", "(", "Class", "c", ")", "{", "final", "SoftReference", "<", "ClassNode", ">", "classNodeSoftReference", "=", "ClassHelperCache", ".", "classCache", ".", "get", "(", "c", ")", ";", "ClassNode", "classNode", ";", "if", "(", "classNodeSoftReference", "==", "null", "||", "(", "classNode", "=", "classNodeSoftReference", ".", "get", "(", ")", ")", "==", "null", ")", "{", "classNode", "=", "new", "ImmutableClassNode", "(", "c", ")", ";", "ClassHelperCache", ".", "classCache", ".", "put", "(", "c", ",", "new", "SoftReference", "<", "ClassNode", ">", "(", "classNode", ")", ")", ";", "VMPluginFactory", ".", "getPlugin", "(", ")", ".", "setAdditionalClassInformation", "(", "classNode", ")", ";", "}", "return", "classNode", ";", "}", "public", "static", "ClassNode", "[", "]", "make", "(", "Class", "[", "]", "classes", ")", "{", "ClassNode", "[", "]", "cns", "=", "new", "ClassNode", "[", "classes", ".", "length", "]", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "cns", ".", "length", ";", "i", "++", ")", "{", "cns", "[", "i", "]", "=", "make", "(", "classes", "[", "i", "]", ")", ";", "}", "return", "cns", ";", "}", "public", "static", "ClassNode", "make", "(", "Class", "c", ")", "{", "return", "make", "(", "c", ",", "true", ")", ";", "}", "public", "static", "ClassNode", "make", "(", "Class", "c", ",", "boolean", "includeGenerics", ")", "{", "for", "(", "int", "i", "=", "0", ";", "i", "<", "classes", ".", "length", ";", "i", "++", ")", "{", "if", "(", "c", "==", "classes", "[", "i", "]", ")", "return", "types", "[", "i", "]", ";", "}", "if", "(", "c", ".", "isArray", "(", ")", ")", "{", "ClassNode", "cn", "=", "make", "(", "c", ".", "getComponentType", "(", ")", ",", "includeGenerics", ")", ";", "return", "cn", ".", "makeArray", "(", ")", ";", "}", "return", "makeWithoutCaching", "(", "c", ",", "includeGenerics", ")", ";", "}", "public", "static", "ClassNode", "makeWithoutCaching", "(", "Class", "c", ")", "{", "return", "makeWithoutCaching", "(", "c", ",", "true", ")", ";", "}", "public", "static", "ClassNode", "makeWithoutCaching", "(", "Class", "c", ",", "boolean", "includeGenerics", ")", "{", "if", "(", "c", ".", "isArray", "(", ")", ")", "{", "ClassNode", "cn", "=", "makeWithoutCaching", "(", "c", ".", "getComponentType", "(", ")", ",", "includeGenerics", ")", ";", "return", "cn", ".", "makeArray", "(", ")", ";", "}", "final", "ClassNode", "cached", "=", "makeCached", "(", "c", ")", ";", "if", "(", "includeGenerics", ")", "{", "return", "cached", ";", "}", "else", "{", "ClassNode", "t", "=", "makeWithoutCaching", "(", "c", ".", "getName", "(", ")", ")", ";", "t", ".", "setRedirect", "(", "cached", ")", ";", "return", "t", ";", "}", "}", "public", "static", "ClassNode", "makeWithoutCaching", "(", "String", "name", ")", "{", "ClassNode", "cn", "=", "new", "ClassNode", "(", "name", ",", "Opcodes", ".", "ACC_PUBLIC", ",", "OBJECT_TYPE", ")", ";", "cn", ".", "isPrimaryNode", "=", "false", ";", "return", "cn", ";", "}", "public", "static", "ClassNode", "make", "(", "String", "name", ")", "{", "if", "(", "name", "==", "null", "||", "name", ".", "length", "(", ")", "==", "0", ")", "return", "DYNAMIC_TYPE", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "primitiveClassNames", ".", "length", ";", "i", "++", ")", "{", "if", "(", "primitiveClassNames", "[", "i", "]", ".", "equals", "(", "name", ")", ")", "return", "types", "[", "i", "]", ";", "}", "for", "(", "int", "i", "=", "0", ";", "i", "<", "classes", ".", "length", ";", "i", "++", ")", "{", "String", "cname", "=", "classes", "[", "i", "]", ".", "getName", "(", ")", ";", "if", "(", "name", ".", "equals", "(", "cname", ")", ")", "return", "types", "[", "i", "]", ";", "}", "return", "makeWithoutCaching", "(", "name", ")", ";", "}", "public", "static", "ClassNode", "getWrapper", "(", "ClassNode", "cn", ")", "{", "cn", "=", "cn", ".", "redirect", "(", ")", ";", "if", "(", "!", "isPrimitiveType", "(", "cn", ")", ")", "return", "cn", ";", "if", "(", "cn", "==", "boolean_TYPE", ")", "{", "return", "Boolean_TYPE", ";", "}", "else", "if", "(", "cn", "==", "byte_TYPE", ")", "{", "return", "Byte_TYPE", ";", "}", "else", "if", "(", "cn", "==", "char_TYPE", ")", "{", "return", "Character_TYPE", ";", "}", "else", "if", "(", "cn", "==", "short_TYPE", ")", "{", "return", "Short_TYPE", ";", "}", "else", "if", "(", "cn", "==", "int_TYPE", ")", "{", "return", "Integer_TYPE", ";", "}", "else", "if", "(", "cn", "==", "long_TYPE", ")", "{", "return", "Long_TYPE", ";", "}", "else", "if", "(", "cn", "==", "float_TYPE", ")", "{", "return", "Float_TYPE", ";", "}", "else", "if", "(", "cn", "==", "double_TYPE", ")", "{", "return", "Double_TYPE", ";", "}", "else", "if", "(", "cn", "==", "VOID_TYPE", ")", "{", "return", "void_WRAPPER_TYPE", ";", "}", "else", "{", "return", "cn", ";", "}", "}", "public", "static", "ClassNode", "getUnwrapper", "(", "ClassNode", "cn", ")", "{", "cn", "=", "cn", ".", "redirect", "(", ")", ";", "if", "(", "isPrimitiveType", "(", "cn", ")", ")", "return", "cn", ";", "if", "(", "cn", "==", "Boolean_TYPE", ")", "{", "return", "boolean_TYPE", ";", "}", "else", "if", "(", "cn", "==", "Byte_TYPE", ")", "{", "return", "byte_TYPE", ";", "}", "else", "if", "(", "cn", "==", "Character_TYPE", ")", "{", "return", "char_TYPE", ";", "}", "else", "if", "(", "cn", "==", "Short_TYPE", ")", "{", "return", "short_TYPE", ";", "}", "else", "if", "(", "cn", "==", "Integer_TYPE", ")", "{", "return", "int_TYPE", ";", "}", "else", "if", "(", "cn", "==", "Long_TYPE", ")", "{", "return", "long_TYPE", ";", "}", "else", "if", "(", "cn", "==", "Float_TYPE", ")", "{", "return", "float_TYPE", ";", "}", "else", "if", "(", "cn", "==", "Double_TYPE", ")", "{", "return", "double_TYPE", ";", "}", "else", "{", "return", "cn", ";", "}", "}", "public", "static", "boolean", "isPrimitiveType", "(", "ClassNode", "cn", ")", "{", "return", "cn", "==", "boolean_TYPE", "||", "cn", "==", "char_TYPE", "||", "cn", "==", "byte_TYPE", "||", "cn", "==", "short_TYPE", "||", "cn", "==", "int_TYPE", "||", "cn", "==", "long_TYPE", "||", "cn", "==", "float_TYPE", "||", "cn", "==", "double_TYPE", "||", "cn", "==", "VOID_TYPE", ";", "}", "public", "static", "boolean", "isStaticConstantInitializerType", "(", "ClassNode", "cn", ")", "{", "return", "cn", "==", "int_TYPE", "||", "cn", "==", "float_TYPE", "||", "cn", "==", "long_TYPE", "||", "cn", "==", "double_TYPE", "||", "cn", "==", "STRING_TYPE", "||", "cn", "==", "byte_TYPE", "||", "cn", "==", "char_TYPE", "||", "cn", "==", "short_TYPE", ";", "}", "public", "static", "boolean", "isNumberType", "(", "ClassNode", "cn", ")", "{", "return", "cn", "==", "Byte_TYPE", "||", "cn", "==", "Short_TYPE", "||", "cn", "==", "Integer_TYPE", "||", "cn", "==", "Long_TYPE", "||", "cn", "==", "Float_TYPE", "||", "cn", "==", "Double_TYPE", "||", "cn", "==", "byte_TYPE", "||", "cn", "==", "short_TYPE", "||", "cn", "==", "int_TYPE", "||", "cn", "==", "long_TYPE", "||", "cn", "==", "float_TYPE", "||", "cn", "==", "double_TYPE", ";", "}", "public", "static", "ClassNode", "makeReference", "(", ")", "{", "return", "REFERENCE_TYPE", ".", "getPlainNodeReference", "(", ")", ";", "}", "public", "static", "boolean", "isCachedType", "(", "ClassNode", "type", ")", "{", "for", "(", "ClassNode", "cachedType", ":", "types", ")", "{", "if", "(", "cachedType", "==", "type", ")", "return", "true", ";", "}", "return", "false", ";", "}", "static", "class", "ClassHelperCache", "{", "static", "Map", "<", "Class", ",", "SoftReference", "<", "ClassNode", ">", ">", "classCache", "=", "new", "WeakHashMap", "<", "Class", ",", "SoftReference", "<", "ClassNode", ">", ">", "(", ")", ";", "}", "}", "</s>" ]
6,647
[ "<s>", "package", "org", ".", "codehaus", ".", "groovy", ".", "ast", ";", "import", "groovy", ".", "lang", ".", "Binding", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "expr", ".", "ArgumentListExpression", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "expr", ".", "ClassExpression", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "expr", ".", "MethodCallExpression", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "expr", ".", "VariableExpression", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "stmt", ".", "BlockStatement", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "stmt", ".", "ExpressionStatement", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "stmt", ".", "Statement", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "control", ".", "SourceUnit", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "runtime", ".", "InvokerHelper", ";", "import", "org", ".", "objectweb", ".", "asm", ".", "Opcodes", ";", "import", "java", ".", "io", ".", "File", ";", "import", "java", ".", "util", ".", "*", ";", "public", "class", "ModuleNode", "extends", "ASTNode", "implements", "Opcodes", "{", "private", "BlockStatement", "statementBlock", "=", "new", "BlockStatement", "(", ")", ";", "List", "<", "ClassNode", ">", "classes", "=", "new", "LinkedList", "<", "ClassNode", ">", "(", ")", ";", "private", "List", "<", "MethodNode", ">", "methods", "=", "new", "ArrayList", "<", "MethodNode", ">", "(", ")", ";", "private", "Map", "<", "String", ",", "ImportNode", ">", "imports", "=", "new", "HashMap", "<", "String", ",", "ImportNode", ">", "(", ")", ";", "private", "List", "<", "ImportNode", ">", "starImports", "=", "new", "ArrayList", "<", "ImportNode", ">", "(", ")", ";", "private", "Map", "<", "String", ",", "ImportNode", ">", "staticImports", "=", "new", "LinkedHashMap", "<", "String", ",", "ImportNode", ">", "(", ")", ";", "private", "Map", "<", "String", ",", "ImportNode", ">", "staticStarImports", "=", "new", "LinkedHashMap", "<", "String", ",", "ImportNode", ">", "(", ")", ";", "private", "CompileUnit", "unit", ";", "private", "PackageNode", "packageNode", ";", "private", "String", "description", ";", "private", "boolean", "createClassForStatements", "=", "true", ";", "private", "transient", "SourceUnit", "context", ";", "private", "boolean", "importsResolved", "=", "false", ";", "private", "ClassNode", "scriptDummy", ";", "private", "String", "mainClassName", "=", "null", ";", "public", "ModuleNode", "(", "SourceUnit", "context", ")", "{", "this", ".", "context", "=", "context", ";", "}", "public", "ModuleNode", "(", "CompileUnit", "unit", ")", "{", "this", ".", "unit", "=", "unit", ";", "}", "public", "BlockStatement", "getStatementBlock", "(", ")", "{", "return", "statementBlock", ";", "}", "public", "List", "<", "MethodNode", ">", "getMethods", "(", ")", "{", "return", "methods", ";", "}", "public", "List", "<", "ClassNode", ">", "getClasses", "(", ")", "{", "if", "(", "createClassForStatements", "&&", "(", "!", "statementBlock", ".", "isEmpty", "(", ")", "||", "!", "methods", ".", "isEmpty", "(", ")", "||", "isPackageInfo", "(", ")", ")", ")", "{", "ClassNode", "mainClass", "=", "createStatementsClass", "(", ")", ";", "mainClassName", "=", "mainClass", ".", "getName", "(", ")", ";", "createClassForStatements", "=", "false", ";", "classes", ".", "add", "(", "0", ",", "mainClass", ")", ";", "mainClass", ".", "setModule", "(", "this", ")", ";", "addToCompileUnit", "(", "mainClass", ")", ";", "}", "return", "classes", ";", "}", "private", "int", "knowIfPackageInfo", "=", "0", ";", "private", "boolean", "encounteredUnrecoverableError", ";", "public", "void", "setEncounteredUnrecoverableError", "(", "boolean", "b", ")", "{", "encounteredUnrecoverableError", "=", "b", ";", "}", "public", "boolean", "encounteredUnrecoverableError", "(", ")", "{", "return", "encounteredUnrecoverableError", ";", "}", "private", "boolean", "isPackageInfo", "(", ")", "{", "if", "(", "knowIfPackageInfo", "==", "0", ")", "{", "if", "(", "context", "!=", "null", "&&", "context", ".", "getName", "(", ")", "!=", "null", "&&", "context", ".", "getName", "(", ")", ".", "endsWith", "(", "\"\"", ")", ")", "{", "knowIfPackageInfo", "=", "1", ";", "}", "else", "{", "knowIfPackageInfo", "=", "2", ";", "}", "}", "return", "knowIfPackageInfo", "==", "1", ";", "}", "public", "List", "<", "ImportNode", ">", "getImports", "(", ")", "{", "return", "new", "ArrayList", "<", "ImportNode", ">", "(", "imports", ".", "values", "(", ")", ")", ";", "}", "public", "List", "<", "ImportNode", ">", "getStarImports", "(", ")", "{", "return", "starImports", ";", "}", "public", "ClassNode", "getImportType", "(", "String", "alias", ")", "{", "ImportNode", "importNode", "=", "imports", ".", "get", "(", "alias", ")", ";", "return", "importNode", "==", "null", "?", "null", ":", "importNode", ".", "getType", "(", ")", ";", "}", "public", "ImportNode", "getImport", "(", "String", "alias", ")", "{", "return", "imports", ".", "get", "(", "alias", ")", ";", "}", "public", "void", "addImport", "(", "String", "alias", ",", "ClassNode", "type", ")", "{", "addImport", "(", "alias", ",", "type", ",", "new", "ArrayList", "<", "AnnotationNode", ">", "(", ")", ")", ";", "}", "public", "void", "addImport", "(", "String", "alias", ",", "ClassNode", "type", ",", "List", "<", "AnnotationNode", ">", "annotations", ")", "{", "ImportNode", "importNode", "=", "new", "ImportNode", "(", "type", ",", "alias", ")", ";", "if", "(", "type", "!=", "null", ")", "{", "importNode", ".", "setSourcePosition", "(", "type", ")", ";", "importNode", ".", "setColumnNumber", "(", "1", ")", ";", "importNode", ".", "setStart", "(", "type", ".", "getStart", "(", ")", "-", "type", ".", "getColumnNumber", "(", ")", "+", "1", ")", ";", "}", "imports", ".", "put", "(", "alias", ",", "importNode", ")", ";", "importNode", ".", "addAnnotations", "(", "annotations", ")", ";", "}", "public", "void", "addStarImport", "(", "String", "packageName", ")", "{", "addStarImport", "(", "packageName", ",", "new", "ArrayList", "<", "AnnotationNode", ">", "(", ")", ")", ";", "}", "public", "void", "addStarImport", "(", "String", "packageName", ",", "List", "<", "AnnotationNode", ">", "annotations", ")", "{", "ImportNode", "importNode", "=", "new", "ImportNode", "(", "packageName", ")", ";", "importNode", ".", "addAnnotations", "(", "annotations", ")", ";", "starImports", ".", "add", "(", "importNode", ")", ";", "}", "public", "void", "addStatement", "(", "Statement", "node", ")", "{", "statementBlock", ".", "addStatement", "(", "node", ")", ";", "}", "public", "void", "addClass", "(", "ClassNode", "node", ")", "{", "if", "(", "classes", ".", "isEmpty", "(", ")", ")", "mainClassName", "=", "node", ".", "getName", "(", ")", ";", "classes", ".", "add", "(", "node", ")", ";", "node", ".", "setModule", "(", "this", ")", ";", "addToCompileUnit", "(", "node", ")", ";", "}", "private", "void", "addToCompileUnit", "(", "ClassNode", "node", ")", "{", "if", "(", "unit", "!=", "null", ")", "{", "unit", ".", "addClass", "(", "node", ")", ";", "}", "}", "public", "void", "addMethod", "(", "MethodNode", "node", ")", "{", "methods", ".", "add", "(", "node", ")", ";", "}", "public", "void", "visit", "(", "GroovyCodeVisitor", "visitor", ")", "{", "}", "public", "String", "getPackageName", "(", ")", "{", "return", "packageNode", "==", "null", "?", "null", ":", "packageNode", ".", "getName", "(", ")", ";", "}", "public", "PackageNode", "getPackage", "(", ")", "{", "return", "packageNode", ";", "}", "public", "void", "setPackage", "(", "PackageNode", "packageNode", ")", "{", "this", ".", "packageNode", "=", "packageNode", ";", "}", "public", "void", "setPackageName", "(", "String", "packageName", ")", "{", "this", ".", "packageNode", "=", "new", "PackageNode", "(", "packageName", ")", ";", "}", "public", "boolean", "hasPackageName", "(", ")", "{", "return", "packageNode", "!=", "null", "&&", "packageNode", ".", "getName", "(", ")", "!=", "null", ";", "}", "public", "boolean", "hasPackage", "(", ")", "{", "return", "this", ".", "packageNode", "!=", "null", ";", "}", "public", "SourceUnit", "getContext", "(", ")", "{", "return", "context", ";", "}", "public", "String", "getDescription", "(", ")", "{", "if", "(", "context", "!=", "null", ")", "{", "return", "context", ".", "getName", "(", ")", ";", "}", "else", "{", "return", "this", ".", "description", ";", "}", "}", "public", "void", "setDescription", "(", "String", "description", ")", "{", "this", ".", "description", "=", "description", ";", "}", "public", "CompileUnit", "getUnit", "(", ")", "{", "return", "unit", ";", "}", "void", "setUnit", "(", "CompileUnit", "unit", ")", "{", "this", ".", "unit", "=", "unit", ";", "}", "public", "ClassNode", "getScriptClassDummy", "(", ")", "{", "if", "(", "scriptDummy", "!=", "null", ")", "{", "setScriptBaseClassFromConfig", "(", "scriptDummy", ")", ";", "return", "scriptDummy", ";", "}", "String", "name", "=", "getPackageName", "(", ")", ";", "if", "(", "name", "==", "null", ")", "{", "name", "=", "\"\"", ";", "}", "if", "(", "getDescription", "(", ")", "==", "null", ")", "{", "throw", "new", "RuntimeException", "(", "\"\"", ")", ";", "}", "name", "+=", "extractClassFromFileDescription", "(", ")", ";", "ClassNode", "classNode", ";", "if", "(", "isPackageInfo", "(", ")", ")", "{", "classNode", "=", "new", "ClassNode", "(", "name", ",", "ACC_ABSTRACT", "|", "ACC_INTERFACE", ",", "ClassHelper", ".", "OBJECT_TYPE", ")", ";", "}", "else", "{", "classNode", "=", "new", "ClassNode", "(", "name", ",", "ACC_PUBLIC", ",", "ClassHelper", ".", "SCRIPT_TYPE", ")", ";", "setScriptBaseClassFromConfig", "(", "classNode", ")", ";", "classNode", ".", "setScript", "(", "true", ")", ";", "classNode", ".", "setScriptBody", "(", "true", ")", ";", "}", "scriptDummy", "=", "classNode", ";", "return", "classNode", ";", "}", "private", "void", "setScriptBaseClassFromConfig", "(", "ClassNode", "cn", ")", "{", "if", "(", "unit", "!=", "null", ")", "{", "String", "baseClassName", "=", "unit", ".", "getConfig", "(", ")", ".", "getScriptBaseClass", "(", ")", ";", "if", "(", "baseClassName", "!=", "null", ")", "{", "if", "(", "!", "cn", ".", "getSuperClass", "(", ")", ".", "getName", "(", ")", ".", "equals", "(", "baseClassName", ")", ")", "{", "cn", ".", "setSuperClass", "(", "ClassHelper", ".", "make", "(", "baseClassName", ")", ")", ";", "}", "}", "}", "}", "protected", "ClassNode", "createStatementsClass", "(", ")", "{", "ClassNode", "classNode", "=", "getScriptClassDummy", "(", ")", ";", "if", "(", "classNode", ".", "getName", "(", ")", ".", "endsWith", "(", "\"package-info\"", ")", ")", "{", "return", "classNode", ";", "}", "handleMainMethodIfPresent", "(", "methods", ")", ";", "classNode", ".", "addMethod", "(", "new", "MethodNode", "(", "\"main\"", ",", "ACC_PUBLIC", "|", "ACC_STATIC", ",", "ClassHelper", ".", "VOID_TYPE", ",", "new", "Parameter", "[", "]", "{", "new", "Parameter", "(", "ClassHelper", ".", "STRING_TYPE", ".", "makeArray", "(", ")", ",", "\"args\"", ")", "}", ",", "ClassNode", ".", "EMPTY_ARRAY", ",", "new", "ExpressionStatement", "(", "new", "MethodCallExpression", "(", "new", "ClassExpression", "(", "ClassHelper", ".", "make", "(", "InvokerHelper", ".", "class", ")", ")", ",", "\"runScript\"", ",", "new", "ArgumentListExpression", "(", "new", "ClassExpression", "(", "classNode", ")", ",", "new", "VariableExpression", "(", "\"args\"", ")", ")", ")", ")", ")", ")", ";", "classNode", ".", "addMethod", "(", "new", "MethodNode", "(", "\"run\"", ",", "ACC_PUBLIC", ",", "ClassHelper", ".", "OBJECT_TYPE", ",", "Parameter", ".", "EMPTY_ARRAY", ",", "ClassNode", ".", "EMPTY_ARRAY", ",", "statementBlock", ")", ")", ";", "classNode", ".", "addConstructor", "(", "ACC_PUBLIC", ",", "Parameter", ".", "EMPTY_ARRAY", ",", "ClassNode", ".", "EMPTY_ARRAY", ",", "new", "BlockStatement", "(", ")", ")", ";", "Statement", "stmt", "=", "new", "ExpressionStatement", "(", "new", "MethodCallExpression", "(", "new", "VariableExpression", "(", "\"super\"", ")", ",", "\"setBinding\"", ",", "new", "ArgumentListExpression", "(", "new", "VariableExpression", "(", "\"context\"", ")", ")", ")", ")", ";", "classNode", ".", "addConstructor", "(", "ACC_PUBLIC", ",", "new", "Parameter", "[", "]", "{", "new", "Parameter", "(", "ClassHelper", ".", "make", "(", "Binding", ".", "class", ")", ",", "\"context\"", ")", "}", ",", "ClassNode", ".", "EMPTY_ARRAY", ",", "stmt", ")", ";", "for", "(", "MethodNode", "node", ":", "methods", ")", "{", "int", "modifiers", "=", "node", ".", "getModifiers", "(", ")", ";", "if", "(", "(", "modifiers", "&", "ACC_ABSTRACT", ")", "!=", "0", ")", "{", "throw", "new", "RuntimeException", "(", "\"\"", "+", "node", ".", "getName", "(", ")", ")", ";", "}", "node", ".", "setModifiers", "(", "modifiers", ")", ";", "classNode", ".", "addMethod", "(", "node", ")", ";", "}", "return", "classNode", ";", "}", "private", "void", "handleMainMethodIfPresent", "(", "List", "methods", ")", "{", "boolean", "found", "=", "false", ";", "for", "(", "Iterator", "iter", "=", "methods", ".", "iterator", "(", ")", ";", "iter", ".", "hasNext", "(", ")", ";", ")", "{", "MethodNode", "node", "=", "(", "MethodNode", ")", "iter", ".", "next", "(", ")", ";", "if", "(", "node", ".", "getName", "(", ")", ".", "equals", "(", "\"main\"", ")", ")", "{", "int", "modifiers", "=", "node", ".", "getModifiers", "(", ")", ";", "if", "(", "node", ".", "isStatic", "(", ")", "&&", "node", ".", "getParameters", "(", ")", ".", "length", "==", "1", ")", "{", "boolean", "retTypeMatches", ",", "argTypeMatches", ";", "ClassNode", "argType", "=", "node", ".", "getParameters", "(", ")", "[", "0", "]", ".", "getType", "(", ")", ";", "ClassNode", "retType", "=", "node", ".", "getReturnType", "(", ")", ";", "argTypeMatches", "=", "(", "argType", ".", "equals", "(", "ClassHelper", ".", "OBJECT_TYPE", ")", "||", "argType", ".", "getName", "(", ")", ".", "contains", "(", "\"String[]\"", ")", ")", ";", "retTypeMatches", "=", "(", "retType", "==", "ClassHelper", ".", "VOID_TYPE", "||", "retType", "==", "ClassHelper", ".", "OBJECT_TYPE", ")", ";", "if", "(", "retTypeMatches", "&&", "argTypeMatches", ")", "{", "if", "(", "found", ")", "{", "throw", "new", "RuntimeException", "(", "\"\"", ")", ";", "}", "else", "{", "found", "=", "true", ";", "}", "if", "(", "statementBlock", ".", "isEmpty", "(", ")", ")", "{", "addStatement", "(", "node", ".", "getCode", "(", ")", ")", ";", "}", "iter", ".", "remove", "(", ")", ";", "}", "}", "}", "}", "}", "protected", "String", "extractClassFromFileDescription", "(", ")", "{", "String", "answer", "=", "getDescription", "(", ")", ";", "int", "slashIdx", "=", "answer", ".", "lastIndexOf", "(", "'/'", ")", ";", "int", "separatorIdx", "=", "answer", ".", "lastIndexOf", "(", "File", ".", "separatorChar", ")", ";", "int", "dotIdx", "=", "answer", ".", "lastIndexOf", "(", "'.'", ")", ";", "if", "(", "dotIdx", ">", "0", "&&", "dotIdx", ">", "Math", ".", "max", "(", "slashIdx", ",", "separatorIdx", ")", ")", "{", "answer", "=", "answer", ".", "substring", "(", "0", ",", "dotIdx", ")", ";", "}", "if", "(", "slashIdx", ">=", "0", ")", "{", "answer", "=", "answer", ".", "substring", "(", "slashIdx", "+", "1", ")", ";", "}", "separatorIdx", "=", "answer", ".", "lastIndexOf", "(", "File", ".", "separatorChar", ")", ";", "if", "(", "separatorIdx", ">=", "0", ")", "{", "answer", "=", "answer", ".", "substring", "(", "separatorIdx", "+", "1", ")", ";", "}", "return", "answer", ";", "}", "public", "boolean", "isEmpty", "(", ")", "{", "return", "classes", ".", "isEmpty", "(", ")", "&&", "statementBlock", ".", "getStatements", "(", ")", ".", "isEmpty", "(", ")", ";", "}", "public", "void", "sortClasses", "(", ")", "{", "if", "(", "isEmpty", "(", ")", ")", "return", ";", "List", "<", "ClassNode", ">", "classes", "=", "getClasses", "(", ")", ";", "LinkedList", "<", "ClassNode", ">", "sorted", "=", "new", "LinkedList", "<", "ClassNode", ">", "(", ")", ";", "int", "level", "=", "1", ";", "while", "(", "!", "classes", ".", "isEmpty", "(", ")", ")", "{", "for", "(", "Iterator", "<", "ClassNode", ">", "cni", "=", "classes", ".", "iterator", "(", ")", ";", "cni", ".", "hasNext", "(", ")", ";", ")", "{", "ClassNode", "cn", "=", "cni", ".", "next", "(", ")", ";", "ClassNode", "sn", "=", "cn", ";", "for", "(", "int", "i", "=", "0", ";", "sn", "!=", "null", "&&", "i", "<", "level", ";", "i", "++", ")", "sn", "=", "sn", ".", "getSuperClass", "(", ")", ";", "if", "(", "sn", "!=", "null", "&&", "sn", ".", "isPrimaryClassNode", "(", ")", ")", "continue", ";", "cni", ".", "remove", "(", ")", ";", "sorted", ".", "addLast", "(", "cn", ")", ";", "}", "level", "++", ";", "}", "this", ".", "classes", "=", "sorted", ";", "}", "public", "boolean", "hasImportsResolved", "(", ")", "{", "return", "importsResolved", ";", "}", "public", "void", "setImportsResolved", "(", "boolean", "importsResolved", ")", "{", "this", ".", "importsResolved", "=", "importsResolved", ";", "}", "public", "Map", "<", "String", ",", "ImportNode", ">", "getStaticImports", "(", ")", "{", "return", "staticImports", ";", "}", "public", "Map", "<", "String", ",", "ImportNode", ">", "getStaticStarImports", "(", ")", "{", "return", "staticStarImports", ";", "}", "public", "void", "addStaticImport", "(", "ClassNode", "type", ",", "String", "fieldName", ",", "String", "alias", ")", "{", "addStaticImport", "(", "type", ",", "fieldName", ",", "alias", ",", "new", "ArrayList", "<", "AnnotationNode", ">", "(", ")", ")", ";", "}", "public", "void", "addStaticImport", "(", "ClassNode", "type", ",", "String", "fieldName", ",", "String", "alias", ",", "List", "<", "AnnotationNode", ">", "annotations", ")", "{", "ImportNode", "node", "=", "new", "ImportNode", "(", "type", ",", "fieldName", ",", "alias", ")", ";", "node", ".", "addAnnotations", "(", "annotations", ")", ";", "staticImports", ".", "put", "(", "alias", ",", "node", ")", ";", "}", "public", "void", "addStaticStarImport", "(", "String", "name", ",", "ClassNode", "type", ")", "{", "addStaticStarImport", "(", "name", ",", "type", ",", "new", "ArrayList", "<", "AnnotationNode", ">", "(", ")", ")", ";", "}", "public", "void", "addStaticStarImport", "(", "String", "name", ",", "ClassNode", "type", ",", "List", "<", "AnnotationNode", ">", "annotations", ")", "{", "ImportNode", "node", "=", "new", "ImportNode", "(", "type", ")", ";", "node", ".", "addAnnotations", "(", "annotations", ")", ";", "staticStarImports", ".", "put", "(", "name", ",", "node", ")", ";", "}", "public", "String", "getMainClassName", "(", ")", "{", "return", "mainClassName", ";", "}", "}", "</s>" ]
6,648
[ "<s>", "package", "org", ".", "codehaus", ".", "groovy", ".", "ast", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "stmt", ".", "BlockStatement", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "stmt", ".", "Statement", ";", "import", "org", ".", "objectweb", ".", "asm", ".", "Opcodes", ";", "import", "java", ".", "lang", ".", "reflect", ".", "Modifier", ";", "import", "java", ".", "util", ".", "List", ";", "public", "class", "MethodNode", "extends", "AnnotatedNode", "implements", "Opcodes", "{", "private", "final", "String", "name", ";", "private", "int", "modifiers", ";", "private", "boolean", "syntheticPublic", ";", "private", "ClassNode", "returnType", ";", "private", "Parameter", "[", "]", "parameters", ";", "private", "boolean", "hasDefaultValue", "=", "false", ";", "private", "Statement", "code", ";", "private", "boolean", "dynamicReturnType", ";", "private", "VariableScope", "variableScope", ";", "private", "final", "ClassNode", "[", "]", "exceptions", ";", "private", "final", "boolean", "staticConstructor", ";", "private", "GenericsType", "[", "]", "genericsTypes", "=", "null", ";", "private", "boolean", "hasDefault", ";", "String", "typeDescriptor", ";", "public", "MethodNode", "(", "String", "name", ",", "int", "modifiers", ",", "ClassNode", "returnType", ",", "Parameter", "[", "]", "parameters", ",", "ClassNode", "[", "]", "exceptions", ",", "Statement", "code", ")", "{", "this", ".", "name", "=", "name", ";", "this", ".", "modifiers", "=", "modifiers", ";", "this", ".", "code", "=", "code", ";", "setReturnType", "(", "returnType", ")", ";", "VariableScope", "scope", "=", "new", "VariableScope", "(", ")", ";", "setVariableScope", "(", "scope", ")", ";", "setParameters", "(", "parameters", ")", ";", "this", ".", "hasDefault", "=", "false", ";", "this", ".", "exceptions", "=", "exceptions", ";", "this", ".", "staticConstructor", "=", "(", "name", "!=", "null", "&&", "name", ".", "equals", "(", "\"<clinit>\"", ")", ")", ";", "}", "public", "String", "getTypeDescriptor", "(", ")", "{", "if", "(", "typeDescriptor", "==", "null", ")", "{", "StringBuffer", "buf", "=", "new", "StringBuffer", "(", "name", ".", "length", "(", ")", "+", "parameters", ".", "length", "*", "10", ")", ";", "buf", ".", "append", "(", "returnType", ".", "getName", "(", ")", ")", ";", "buf", ".", "append", "(", "'", "'", ")", ";", "buf", ".", "append", "(", "name", ")", ";", "buf", ".", "append", "(", "'('", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "parameters", ".", "length", ";", "i", "++", ")", "{", "if", "(", "i", ">", "0", ")", "{", "buf", ".", "append", "(", "\",", "\"", ")", ";", "}", "Parameter", "param", "=", "parameters", "[", "i", "]", ";", "buf", ".", "append", "(", "param", ".", "getType", "(", ")", ".", "getName", "(", ")", ")", ";", "}", "buf", ".", "append", "(", "')'", ")", ";", "typeDescriptor", "=", "buf", ".", "toString", "(", ")", ";", "}", "return", "typeDescriptor", ";", "}", "private", "void", "invalidateCachedData", "(", ")", "{", "typeDescriptor", "=", "null", ";", "}", "public", "boolean", "isVoidMethod", "(", ")", "{", "return", "returnType", "==", "ClassHelper", ".", "VOID_TYPE", ";", "}", "public", "Statement", "getCode", "(", ")", "{", "return", "code", ";", "}", "public", "void", "setCode", "(", "Statement", "code", ")", "{", "this", ".", "code", "=", "code", ";", "}", "public", "int", "getModifiers", "(", ")", "{", "return", "modifiers", ";", "}", "public", "void", "setModifiers", "(", "int", "modifiers", ")", "{", "invalidateCachedData", "(", ")", ";", "this", ".", "modifiers", "=", "modifiers", ";", "}", "public", "String", "getName", "(", ")", "{", "return", "name", ";", "}", "public", "Parameter", "[", "]", "getParameters", "(", ")", "{", "return", "parameters", ";", "}", "public", "void", "setParameters", "(", "Parameter", "[", "]", "parameters", ")", "{", "invalidateCachedData", "(", ")", ";", "VariableScope", "scope", "=", "new", "VariableScope", "(", ")", ";", "this", ".", "parameters", "=", "parameters", ";", "if", "(", "parameters", "!=", "null", "&&", "parameters", ".", "length", ">", "0", ")", "{", "for", "(", "Parameter", "para", ":", "parameters", ")", "{", "if", "(", "para", ".", "hasInitialExpression", "(", ")", ")", "{", "this", ".", "hasDefaultValue", "=", "true", ";", "}", "para", ".", "setInStaticContext", "(", "isStatic", "(", ")", ")", ";", "scope", ".", "putDeclaredVariable", "(", "para", ")", ";", "}", "}", "setVariableScope", "(", "scope", ")", ";", "}", "public", "ClassNode", "getReturnType", "(", ")", "{", "return", "returnType", ";", "}", "public", "VariableScope", "getVariableScope", "(", ")", "{", "return", "variableScope", ";", "}", "public", "void", "setVariableScope", "(", "VariableScope", "variableScope", ")", "{", "this", ".", "variableScope", "=", "variableScope", ";", "variableScope", ".", "setInStaticContext", "(", "isStatic", "(", ")", ")", ";", "}", "public", "boolean", "isDynamicReturnType", "(", ")", "{", "return", "dynamicReturnType", ";", "}", "public", "boolean", "isAbstract", "(", ")", "{", "return", "(", "modifiers", "&", "ACC_ABSTRACT", ")", "!=", "0", ";", "}", "public", "boolean", "isStatic", "(", ")", "{", "return", "(", "modifiers", "&", "ACC_STATIC", ")", "!=", "0", ";", "}", "public", "boolean", "isPublic", "(", ")", "{", "return", "(", "modifiers", "&", "ACC_PUBLIC", ")", "!=", "0", ";", "}", "public", "boolean", "isPrivate", "(", ")", "{", "return", "(", "modifiers", "&", "ACC_PRIVATE", ")", "!=", "0", ";", "}", "public", "boolean", "isProtected", "(", ")", "{", "return", "(", "modifiers", "&", "ACC_PROTECTED", ")", "!=", "0", ";", "}", "public", "boolean", "hasDefaultValue", "(", ")", "{", "return", "this", ".", "hasDefaultValue", ";", "}", "public", "boolean", "isScriptBody", "(", ")", "{", "return", "getDeclaringClass", "(", ")", "!=", "null", "&&", "getDeclaringClass", "(", ")", ".", "isScript", "(", ")", "&&", "getName", "(", ")", ".", "equals", "(", "\"run\"", ")", "&&", "(", "parameters", "==", "null", "||", "parameters", ".", "length", "==", "0", ")", "&&", "(", "returnType", "!=", "null", "&&", "returnType", ".", "getName", "(", ")", ".", "equals", "(", "\"\"", ")", ")", ";", "}", "public", "String", "toString", "(", ")", "{", "return", "\"MethodNode@\"", "+", "hashCode", "(", ")", "+", "\"[\"", "+", "getTypeDescriptor", "(", ")", "+", "\"]\"", ";", "}", "public", "void", "setReturnType", "(", "ClassNode", "returnType", ")", "{", "invalidateCachedData", "(", ")", ";", "dynamicReturnType", "|=", "ClassHelper", ".", "DYNAMIC_TYPE", "==", "returnType", ";", "this", ".", "returnType", "=", "returnType", ";", "if", "(", "returnType", "==", "null", ")", "this", ".", "returnType", "=", "ClassHelper", ".", "OBJECT_TYPE", ";", "}", "public", "ClassNode", "[", "]", "getExceptions", "(", ")", "{", "return", "exceptions", ";", "}", "public", "Statement", "getFirstStatement", "(", ")", "{", "if", "(", "code", "==", "null", ")", "return", "null", ";", "Statement", "first", "=", "code", ";", "while", "(", "first", "instanceof", "BlockStatement", ")", "{", "List", "<", "Statement", ">", "list", "=", "(", "(", "BlockStatement", ")", "first", ")", ".", "getStatements", "(", ")", ";", "if", "(", "list", ".", "isEmpty", "(", ")", ")", "{", "first", "=", "null", ";", "}", "else", "{", "first", "=", "list", ".", "get", "(", "0", ")", ";", "}", "}", "return", "first", ";", "}", "public", "GenericsType", "[", "]", "getGenericsTypes", "(", ")", "{", "return", "genericsTypes", ";", "}", "public", "void", "setGenericsTypes", "(", "GenericsType", "[", "]", "genericsTypes", ")", "{", "invalidateCachedData", "(", ")", ";", "this", ".", "genericsTypes", "=", "genericsTypes", ";", "}", "public", "void", "setAnnotationDefault", "(", "boolean", "b", ")", "{", "this", ".", "hasDefault", "=", "b", ";", "}", "public", "boolean", "hasAnnotationDefault", "(", ")", "{", "return", "hasDefault", ";", "}", "public", "boolean", "isStaticConstructor", "(", ")", "{", "return", "staticConstructor", ";", "}", "public", "boolean", "isSyntheticPublic", "(", ")", "{", "return", "syntheticPublic", ";", "}", "public", "void", "setSyntheticPublic", "(", "boolean", "syntheticPublic", ")", "{", "this", ".", "syntheticPublic", "=", "syntheticPublic", ";", "}", "@", "Override", "public", "String", "getText", "(", ")", "{", "String", "retType", "=", "AstToTextHelper", ".", "getClassText", "(", "returnType", ")", ";", "String", "exceptionTypes", "=", "AstToTextHelper", ".", "getThrowsClauseText", "(", "exceptions", ")", ";", "String", "parms", "=", "AstToTextHelper", ".", "getParametersText", "(", "parameters", ")", ";", "return", "AstToTextHelper", ".", "getModifiersText", "(", "modifiers", ")", "+", "\"", "\"", "+", "retType", "+", "\"", "\"", "+", "name", "+", "\"(\"", "+", "parms", "+", "\")", "\"", "+", "exceptionTypes", "+", "\"", "{", "...", "}\"", ";", "}", "private", "MethodNode", "original", "=", "this", ";", "public", "MethodNode", "getOriginal", "(", ")", "{", "return", "original", ";", "}", "public", "void", "setOriginal", "(", "MethodNode", "original", ")", "{", "this", ".", "original", "=", "original", ";", "}", "}", "</s>" ]
6,649
[ "<s>", "package", "org", ".", "codehaus", ".", "groovy", ".", "ast", ";", "import", "java", ".", "util", ".", "Collections", ";", "import", "java", ".", "util", ".", "HashMap", ";", "import", "java", ".", "util", ".", "Iterator", ";", "import", "java", ".", "util", ".", "Map", ";", "public", "class", "VariableScope", "{", "private", "Map", "<", "String", ",", "Variable", ">", "declaredVariables", "=", "Collections", ".", "emptyMap", "(", ")", ";", "private", "Map", "<", "String", ",", "Variable", ">", "referencedLocalVariables", "=", "Collections", ".", "emptyMap", "(", ")", ";", "private", "Map", "<", "String", ",", "Variable", ">", "referencedClassVariables", "=", "Collections", ".", "emptyMap", "(", ")", ";", "private", "boolean", "inStaticContext", "=", "false", ";", "private", "boolean", "resolvesDynamic", "=", "false", ";", "private", "ClassNode", "clazzScope", ";", "private", "VariableScope", "parent", ";", "public", "VariableScope", "(", ")", "{", "}", "public", "VariableScope", "(", "VariableScope", "parent", ")", "{", "this", ".", "parent", "=", "parent", ";", "}", "public", "Variable", "getDeclaredVariable", "(", "String", "name", ")", "{", "return", "declaredVariables", ".", "get", "(", "name", ")", ";", "}", "public", "Iterator", "<", "Variable", ">", "getDeclaredVariablesIterator", "(", ")", "{", "return", "declaredVariables", ".", "values", "(", ")", ".", "iterator", "(", ")", ";", "}", "public", "boolean", "isReferencedLocalVariable", "(", "String", "name", ")", "{", "return", "referencedLocalVariables", ".", "containsKey", "(", "name", ")", ";", "}", "public", "boolean", "isReferencedClassVariable", "(", "String", "name", ")", "{", "return", "referencedClassVariables", ".", "containsKey", "(", "name", ")", ";", "}", "public", "VariableScope", "getParent", "(", ")", "{", "return", "parent", ";", "}", "public", "boolean", "isInStaticContext", "(", ")", "{", "return", "inStaticContext", ";", "}", "public", "void", "setInStaticContext", "(", "boolean", "inStaticContext", ")", "{", "this", ".", "inStaticContext", "=", "inStaticContext", ";", "}", "@", "Deprecated", "public", "boolean", "isResolvingDynamic", "(", ")", "{", "return", "resolvesDynamic", ";", "}", "@", "Deprecated", "public", "void", "setDynamicResolving", "(", "boolean", "resolvesDynamic", ")", "{", "this", ".", "resolvesDynamic", "=", "resolvesDynamic", ";", "}", "public", "void", "setClassScope", "(", "ClassNode", "node", ")", "{", "this", ".", "clazzScope", "=", "node", ";", "}", "public", "ClassNode", "getClassScope", "(", ")", "{", "return", "clazzScope", ";", "}", "public", "boolean", "isClassScope", "(", ")", "{", "return", "clazzScope", "!=", "null", ";", "}", "public", "boolean", "isRoot", "(", ")", "{", "return", "parent", "==", "null", ";", "}", "public", "VariableScope", "copy", "(", ")", "{", "VariableScope", "copy", "=", "new", "VariableScope", "(", ")", ";", "copy", ".", "clazzScope", "=", "clazzScope", ";", "if", "(", "declaredVariables", ".", "size", "(", ")", ">", "0", ")", "{", "copy", ".", "declaredVariables", "=", "new", "HashMap", "<", "String", ",", "Variable", ">", "(", ")", ";", "copy", ".", "declaredVariables", ".", "putAll", "(", "declaredVariables", ")", ";", "}", "copy", ".", "inStaticContext", "=", "inStaticContext", ";", "copy", ".", "parent", "=", "parent", ";", "if", "(", "referencedClassVariables", ".", "size", "(", ")", ">", "0", ")", "{", "copy", ".", "referencedClassVariables", "=", "new", "HashMap", "<", "String", ",", "Variable", ">", "(", ")", ";", "copy", ".", "referencedClassVariables", ".", "putAll", "(", "referencedClassVariables", ")", ";", "}", "if", "(", "referencedLocalVariables", ".", "size", "(", ")", ">", "0", ")", "{", "copy", ".", "referencedLocalVariables", "=", "new", "HashMap", "<", "String", ",", "Variable", ">", "(", ")", ";", "copy", ".", "referencedLocalVariables", ".", "putAll", "(", "referencedLocalVariables", ")", ";", "}", "copy", ".", "resolvesDynamic", "=", "resolvesDynamic", ";", "return", "copy", ";", "}", "public", "void", "putDeclaredVariable", "(", "Variable", "var", ")", "{", "if", "(", "declaredVariables", "==", "Collections", ".", "EMPTY_MAP", ")", "declaredVariables", "=", "new", "HashMap", "<", "String", ",", "Variable", ">", "(", ")", ";", "declaredVariables", ".", "put", "(", "var", ".", "getName", "(", ")", ",", "var", ")", ";", "}", "public", "Iterator", "<", "Variable", ">", "getReferencedLocalVariablesIterator", "(", ")", "{", "return", "referencedLocalVariables", ".", "values", "(", ")", ".", "iterator", "(", ")", ";", "}", "public", "int", "getReferencedLocalVariablesCount", "(", ")", "{", "return", "referencedLocalVariables", ".", "size", "(", ")", ";", "}", "public", "Variable", "getReferencedLocalVariable", "(", "String", "name", ")", "{", "return", "referencedLocalVariables", ".", "get", "(", "name", ")", ";", "}", "public", "void", "putReferencedLocalVariable", "(", "Variable", "var", ")", "{", "if", "(", "referencedLocalVariables", "==", "Collections", ".", "EMPTY_MAP", ")", "referencedLocalVariables", "=", "new", "HashMap", "<", "String", ",", "Variable", ">", "(", ")", ";", "referencedLocalVariables", ".", "put", "(", "var", ".", "getName", "(", ")", ",", "var", ")", ";", "}", "public", "void", "putReferencedClassVariable", "(", "Variable", "var", ")", "{", "if", "(", "referencedClassVariables", "==", "Collections", ".", "EMPTY_MAP", ")", "referencedClassVariables", "=", "new", "HashMap", "<", "String", ",", "Variable", ">", "(", ")", ";", "referencedClassVariables", ".", "put", "(", "var", ".", "getName", "(", ")", ",", "var", ")", ";", "}", "public", "Variable", "getReferencedClassVariable", "(", "String", "name", ")", "{", "return", "referencedClassVariables", ".", "get", "(", "name", ")", ";", "}", "public", "Object", "removeReferencedClassVariable", "(", "String", "name", ")", "{", "if", "(", "referencedClassVariables", "==", "Collections", ".", "EMPTY_MAP", ")", "return", "null", ";", "else", "return", "referencedClassVariables", ".", "remove", "(", "name", ")", ";", "}", "public", "Map", "<", "String", ",", "Variable", ">", "getReferencedClassVariables", "(", ")", "{", "if", "(", "referencedClassVariables", "==", "Collections", ".", "EMPTY_MAP", ")", "{", "return", "referencedClassVariables", ";", "}", "else", "{", "return", "Collections", ".", "unmodifiableMap", "(", "referencedClassVariables", ")", ";", "}", "}", "public", "Iterator", "<", "Variable", ">", "getReferencedClassVariablesIterator", "(", ")", "{", "return", "getReferencedClassVariables", "(", ")", ".", "values", "(", ")", ".", "iterator", "(", ")", ";", "}", "}", "</s>" ]
6,650
[ "<s>", "package", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "expr", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "CodeVisitorSupport", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "GroovyCodeVisitor", ";", "public", "class", "EmptyExpression", "extends", "Expression", "{", "public", "static", "final", "EmptyExpression", "INSTANCE", "=", "new", "EmptyExpression", "(", ")", ";", "public", "Expression", "transformExpression", "(", "ExpressionTransformer", "transformer", ")", "{", "return", "this", ";", "}", "public", "void", "visit", "(", "GroovyCodeVisitor", "visitor", ")", "{", "if", "(", "visitor", "instanceof", "CodeVisitorSupport", ")", "{", "(", "(", "CodeVisitorSupport", ")", "visitor", ")", ".", "visitEmptyExpression", "(", "this", ")", ";", "}", "return", ";", "}", "}", "</s>" ]
6,651
[ "<s>", "package", "org", ".", "codehaus", ".", "groovy", ".", "ast", ";", "import", "java", ".", "util", ".", "Collections", ";", "import", "java", ".", "util", ".", "Iterator", ";", "import", "java", ".", "util", ".", "List", ";", "import", "org", ".", "objectweb", ".", "asm", ".", "Opcodes", ";", "public", "class", "ASTNodeCompatibilityWrapper", "{", "private", "ASTNodeCompatibilityWrapper", "(", ")", "{", "}", "public", "static", "ClassNode", "getScriptClassDummy", "(", "ModuleNode", "module", ")", "{", "return", "module", ".", "getScriptClassDummy", "(", ")", ";", "}", "public", "static", "Iterator", "<", "InnerClassNode", ">", "getInnerClasses", "(", "ClassNode", "clazz", ")", "{", "return", "clazz", ".", "getInnerClasses", "(", ")", ";", "}", "}", "</s>" ]
6,652
[ "<s>", "package", "org", ".", "codehaus", ".", "groovy", ".", "ast", ";", "import", "java", ".", "lang", ".", "reflect", ".", "Array", ";", "import", "java", ".", "util", ".", "ArrayList", ";", "import", "java", ".", "util", ".", "Collections", ";", "import", "java", ".", "util", ".", "EnumMap", ";", "import", "java", ".", "util", ".", "HashMap", ";", "import", "java", ".", "util", ".", "HashSet", ";", "import", "java", ".", "util", ".", "Iterator", ";", "import", "java", ".", "util", ".", "LinkedHashSet", ";", "import", "java", ".", "util", ".", "LinkedList", ";", "import", "java", ".", "util", ".", "List", ";", "import", "java", ".", "util", ".", "ListIterator", ";", "import", "java", ".", "util", ".", "Map", ";", "import", "java", ".", "util", ".", "Set", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "GroovyBugError", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "expr", ".", "BinaryExpression", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "expr", ".", "Expression", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "expr", ".", "FieldExpression", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "expr", ".", "MapExpression", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "expr", ".", "TupleExpression", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "stmt", ".", "BlockStatement", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "stmt", ".", "ExpressionStatement", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "stmt", ".", "Statement", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "control", ".", "CompilePhase", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "transform", ".", "ASTTransformation", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "transform", ".", "GroovyASTTransformation", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "vmplugin", ".", "VMPluginFactory", ";", "import", "org", ".", "objectweb", ".", "asm", ".", "Opcodes", ";", "public", "class", "ClassNode", "extends", "AnnotatedNode", "implements", "Opcodes", "{", "private", "static", "class", "MapOfLists", "{", "private", "Map", "<", "Object", ",", "List", "<", "MethodNode", ">", ">", "map", "=", "new", "HashMap", "<", "Object", ",", "List", "<", "MethodNode", ">", ">", "(", ")", ";", "public", "List", "<", "MethodNode", ">", "get", "(", "Object", "key", ")", "{", "return", "map", ".", "get", "(", "key", ")", ";", "}", "public", "List", "<", "MethodNode", ">", "getNotNull", "(", "Object", "key", ")", "{", "List", "<", "MethodNode", ">", "ret", "=", "get", "(", "key", ")", ";", "if", "(", "ret", "==", "null", ")", "ret", "=", "Collections", ".", "emptyList", "(", ")", ";", "return", "ret", ";", "}", "public", "void", "put", "(", "Object", "key", ",", "MethodNode", "value", ")", "{", "if", "(", "map", ".", "containsKey", "(", "key", ")", ")", "{", "get", "(", "key", ")", ".", "add", "(", "value", ")", ";", "}", "else", "{", "ArrayList", "<", "MethodNode", ">", "list", "=", "new", "ArrayList", "<", "MethodNode", ">", "(", "2", ")", ";", "list", ".", "add", "(", "value", ")", ";", "map", ".", "put", "(", "key", ",", "list", ")", ";", "}", "}", "}", "public", "static", "final", "ClassNode", "[", "]", "EMPTY_ARRAY", "=", "new", "ClassNode", "[", "0", "]", ";", "public", "static", "final", "ClassNode", "THIS", "=", "new", "ClassNode", "(", "Object", ".", "class", ")", ";", "public", "static", "final", "ClassNode", "SUPER", "=", "new", "ClassNode", "(", "Object", ".", "class", ")", ";", "private", "String", "name", ";", "private", "int", "modifiers", ";", "private", "boolean", "syntheticPublic", ";", "private", "ClassNode", "[", "]", "interfaces", ";", "private", "MixinNode", "[", "]", "mixins", ";", "private", "List", "<", "ConstructorNode", ">", "constructors", ";", "private", "List", "<", "Statement", ">", "objectInitializers", ";", "private", "MapOfLists", "methods", ";", "private", "List", "<", "MethodNode", ">", "methodsList", ";", "private", "LinkedList", "<", "FieldNode", ">", "fields", ";", "private", "List", "<", "PropertyNode", ">", "properties", ";", "private", "Map", "<", "String", ",", "FieldNode", ">", "fieldIndex", ";", "private", "ModuleNode", "module", ";", "private", "CompileUnit", "compileUnit", ";", "private", "boolean", "staticClass", "=", "false", ";", "private", "boolean", "scriptBody", "=", "false", ";", "private", "boolean", "script", ";", "private", "ClassNode", "superClass", ";", "protected", "boolean", "isPrimaryNode", ";", "protected", "List", "<", "InnerClassNode", ">", "innerClasses", ";", "private", "int", "bitflags", "=", "0x0000", ";", "private", "static", "final", "int", "BIT_INCONSISTENT_HIERARCHY", "=", "0x0001", ";", "public", "boolean", "hasInconsistentHierarchy", "(", ")", "{", "return", "(", "(", "redirect", "(", ")", ".", "bitflags", ")", "&", "BIT_INCONSISTENT_HIERARCHY", ")", "!=", "0", ";", "}", "public", "void", "setHasInconsistentHierarchy", "(", "boolean", "b", ")", "{", "ClassNode", "redirect", "=", "redirect", "(", ")", ";", "if", "(", "b", ")", "{", "redirect", ".", "bitflags", "|=", "BIT_INCONSISTENT_HIERARCHY", ";", "}", "else", "{", "redirect", ".", "bitflags", "&=", "~", "BIT_INCONSISTENT_HIERARCHY", ";", "}", "}", "private", "Map", "<", "CompilePhase", ",", "Map", "<", "Class", "<", "?", "extends", "ASTTransformation", ">", ",", "Set", "<", "ASTNode", ">", ">", ">", "transformInstances", ";", "protected", "Object", "lazyInitLock", "=", "new", "Object", "(", ")", ";", "protected", "Class", "clazz", ";", "protected", "boolean", "lazyInitDone", "=", "true", ";", "protected", "ClassNode", "componentType", "=", "null", ";", "protected", "ClassNode", "redirect", "=", "null", ";", "private", "boolean", "annotated", ";", "private", "GenericsType", "[", "]", "genericsTypes", "=", "null", ";", "private", "boolean", "usesGenerics", "=", "false", ";", "private", "boolean", "placeholder", ";", "public", "ClassNode", "redirect", "(", ")", "{", "if", "(", "redirect", "==", "null", ")", "return", "this", ";", "return", "redirect", ".", "redirect", "(", ")", ";", "}", "public", "void", "setRedirect", "(", "ClassNode", "cn", ")", "{", "if", "(", "isPrimaryNode", ")", "throw", "new", "GroovyBugError", "(", "\"\"", "+", "getName", "(", ")", "+", "\"->\"", "+", "cn", ".", "getName", "(", ")", "+", "\").\"", ")", ";", "if", "(", "cn", "!=", "null", ")", "cn", "=", "cn", ".", "redirect", "(", ")", ";", "if", "(", "cn", "==", "this", ")", "return", ";", "redirect", "=", "cn", ";", "}", "public", "ClassNode", "makeArray", "(", ")", "{", "if", "(", "redirect", "!=", "null", ")", "{", "ClassNode", "res", "=", "redirect", "(", ")", ".", "makeArray", "(", ")", ";", "res", ".", "componentType", "=", "this", ";", "return", "res", ";", "}", "ClassNode", "cn", ";", "if", "(", "clazz", "!=", "null", ")", "{", "Class", "ret", "=", "Array", ".", "newInstance", "(", "clazz", ",", "0", ")", ".", "getClass", "(", ")", ";", "cn", "=", "new", "ClassNode", "(", "ret", ",", "this", ")", ";", "}", "else", "{", "cn", "=", "new", "ClassNode", "(", "this", ")", ";", "}", "return", "cn", ";", "}", "public", "boolean", "isPrimaryClassNode", "(", ")", "{", "return", "redirect", "(", ")", ".", "isPrimaryNode", "||", "(", "componentType", "!=", "null", "&&", "componentType", ".", "isPrimaryClassNode", "(", ")", ")", ";", "}", "public", "ClassNode", "(", "ClassNode", "componentType", ")", "{", "this", "(", "computeArrayName", "(", "componentType", ")", ",", "ACC_PUBLIC", ",", "ClassHelper", ".", "OBJECT_TYPE", ")", ";", "this", ".", "componentType", "=", "componentType", ".", "redirect", "(", ")", ";", "isPrimaryNode", "=", "false", ";", "}", "public", "static", "String", "computeArrayName", "(", "ClassNode", "componentType", ")", "{", "String", "n", "=", "componentType", ".", "getName", "(", ")", ";", "if", "(", "componentType", ".", "isPrimitive", "(", ")", ")", "{", "int", "len", "=", "n", ".", "length", "(", ")", ";", "if", "(", "len", "==", "7", ")", "{", "return", "\"[Z\"", ";", "}", "else", "if", "(", "len", "==", "6", ")", "{", "return", "\"[D\"", ";", "}", "else", "if", "(", "len", "==", "5", ")", "{", "if", "(", "n", ".", "charAt", "(", "0", ")", "==", "'f'", ")", "{", "return", "\"[F\"", ";", "}", "else", "{", "return", "\"[S\"", ";", "}", "}", "else", "if", "(", "len", "==", "4", ")", "{", "switch", "(", "n", ".", "charAt", "(", "0", ")", ")", "{", "case", "'b'", ":", "return", "\"[B\"", ";", "case", "'c'", ":", "return", "\"[C\"", ";", "default", ":", "return", "\"[J\"", ";", "}", "}", "else", "{", "return", "\"[I\"", ";", "}", "}", "else", "if", "(", "componentType", ".", "isArray", "(", ")", ")", "{", "if", "(", "n", ".", "charAt", "(", "0", ")", "==", "'['", ")", "{", "return", "new", "StringBuilder", "(", "\"[\"", ")", ".", "append", "(", "n", ")", ".", "toString", "(", ")", ";", "}", "else", "{", "return", "new", "StringBuilder", "(", "n", ")", ".", "append", "(", "\"[]\"", ")", ".", "toString", "(", ")", ";", "}", "}", "else", "{", "return", "new", "StringBuilder", "(", "\"[L\"", ")", ".", "append", "(", "componentType", ".", "getName", "(", ")", ")", ".", "append", "(", "\";\"", ")", ".", "toString", "(", ")", ";", "}", "}", "public", "ClassNode", "(", "Class", "c", ",", "ClassNode", "componentType", ")", "{", "this", "(", "c", ")", ";", "this", ".", "componentType", "=", "componentType", ";", "isPrimaryNode", "=", "false", ";", "}", "public", "ClassNode", "(", "Class", "c", ")", "{", "this", "(", "c", ".", "getName", "(", ")", ",", "c", ".", "getModifiers", "(", ")", ",", "null", ",", "null", ",", "MixinNode", ".", "EMPTY_ARRAY", ")", ";", "clazz", "=", "c", ";", "lazyInitDone", "=", "false", ";", "CompileUnit", "cu", "=", "getCompileUnit", "(", ")", ";", "if", "(", "cu", "!=", "null", ")", "cu", ".", "addClass", "(", "this", ")", ";", "isPrimaryNode", "=", "false", ";", "}", "public", "void", "lazyClassInit", "(", ")", "{", "synchronized", "(", "lazyInitLock", ")", "{", "if", "(", "redirect", "!=", "null", ")", "{", "throw", "new", "GroovyBugError", "(", "\"\"", "+", "\"\"", ")", ";", "}", "if", "(", "lazyInitDone", ")", "return", ";", "VMPluginFactory", ".", "getPlugin", "(", ")", ".", "configureClassNode", "(", "compileUnit", ",", "this", ")", ";", "lazyInitDone", "=", "true", ";", "}", "}", "private", "MethodNode", "enclosingMethod", "=", "null", ";", "public", "MethodNode", "getEnclosingMethod", "(", ")", "{", "return", "redirect", "(", ")", ".", "enclosingMethod", ";", "}", "public", "void", "setEnclosingMethod", "(", "MethodNode", "enclosingMethod", ")", "{", "redirect", "(", ")", ".", "enclosingMethod", "=", "enclosingMethod", ";", "}", "public", "boolean", "isSyntheticPublic", "(", ")", "{", "return", "syntheticPublic", ";", "}", "public", "void", "setSyntheticPublic", "(", "boolean", "syntheticPublic", ")", "{", "this", ".", "syntheticPublic", "=", "syntheticPublic", ";", "}", "public", "ClassNode", "(", "String", "name", ",", "int", "modifiers", ",", "ClassNode", "superClass", ")", "{", "this", "(", "name", ",", "modifiers", ",", "superClass", ",", "EMPTY_ARRAY", ",", "MixinNode", ".", "EMPTY_ARRAY", ")", ";", "}", "public", "ClassNode", "(", "String", "name", ",", "int", "modifiers", ",", "ClassNode", "superClass", ",", "ClassNode", "[", "]", "interfaces", ",", "MixinNode", "[", "]", "mixins", ")", "{", "this", ".", "name", "=", "name", ";", "this", ".", "modifiers", "=", "modifiers", ";", "this", ".", "superClass", "=", "superClass", ";", "this", ".", "interfaces", "=", "interfaces", ";", "this", ".", "mixins", "=", "mixins", ";", "isPrimaryNode", "=", "true", ";", "if", "(", "superClass", "!=", "null", ")", "{", "usesGenerics", "=", "superClass", ".", "isUsingGenerics", "(", ")", ";", "}", "if", "(", "!", "usesGenerics", "&&", "interfaces", "!=", "null", ")", "{", "for", "(", "ClassNode", "anInterface", ":", "interfaces", ")", "{", "usesGenerics", "=", "usesGenerics", "||", "anInterface", ".", "isUsingGenerics", "(", ")", ";", "}", "}", "this", ".", "methods", "=", "new", "MapOfLists", "(", ")", ";", "this", ".", "methodsList", "=", "new", "ArrayList", "<", "MethodNode", ">", "(", ")", ";", "}", "public", "void", "setSuperClass", "(", "ClassNode", "superClass", ")", "{", "redirect", "(", ")", ".", "superClass", "=", "superClass", ";", "}", "public", "List", "<", "FieldNode", ">", "getFields", "(", ")", "{", "if", "(", "!", "redirect", "(", ")", ".", "lazyInitDone", ")", "redirect", "(", ")", ".", "lazyClassInit", "(", ")", ";", "if", "(", "redirect", "!=", "null", ")", "return", "redirect", "(", ")", ".", "getFields", "(", ")", ";", "if", "(", "fields", "==", "null", ")", "fields", "=", "new", "LinkedList", "<", "FieldNode", ">", "(", ")", ";", "return", "fields", ";", "}", "public", "ClassNode", "[", "]", "getInterfaces", "(", ")", "{", "if", "(", "!", "redirect", "(", ")", ".", "lazyInitDone", ")", "redirect", "(", ")", ".", "lazyClassInit", "(", ")", ";", "if", "(", "hasInconsistentHierarchy", "(", ")", ")", "{", "return", "EMPTY_ARRAY", ";", "}", "if", "(", "redirect", "!=", "null", ")", "return", "redirect", "(", ")", ".", "getInterfaces", "(", ")", ";", "return", "interfaces", ";", "}", "public", "void", "setInterfaces", "(", "ClassNode", "[", "]", "interfaces", ")", "{", "if", "(", "redirect", "!=", "null", ")", "{", "redirect", "(", ")", ".", "setInterfaces", "(", "interfaces", ")", ";", "}", "else", "{", "this", ".", "interfaces", "=", "interfaces", ";", "}", "}", "public", "MixinNode", "[", "]", "getMixins", "(", ")", "{", "return", "redirect", "(", ")", ".", "mixins", ";", "}", "public", "List", "<", "MethodNode", ">", "getMethods", "(", ")", "{", "if", "(", "!", "redirect", "(", ")", ".", "lazyInitDone", ")", "redirect", "(", ")", ".", "lazyClassInit", "(", ")", ";", "if", "(", "redirect", "!=", "null", ")", "return", "redirect", "(", ")", ".", "getMethods", "(", ")", ";", "return", "methodsList", ";", "}", "public", "List", "<", "MethodNode", ">", "getAbstractMethods", "(", ")", "{", "List", "<", "MethodNode", ">", "result", "=", "new", "ArrayList", "<", "MethodNode", ">", "(", "3", ")", ";", "for", "(", "MethodNode", "method", ":", "getDeclaredMethodsMap", "(", ")", ".", "values", "(", ")", ")", "{", "if", "(", "method", ".", "isAbstract", "(", ")", ")", "{", "result", ".", "add", "(", "method", ")", ";", "}", "}", "if", "(", "result", ".", "isEmpty", "(", ")", ")", "{", "return", "null", ";", "}", "else", "{", "return", "result", ";", "}", "}", "public", "List", "<", "MethodNode", ">", "getAllDeclaredMethods", "(", ")", "{", "return", "new", "ArrayList", "<", "MethodNode", ">", "(", "getDeclaredMethodsMap", "(", ")", ".", "values", "(", ")", ")", ";", "}", "public", "Set", "<", "ClassNode", ">", "getAllInterfaces", "(", ")", "{", "Set", "<", "ClassNode", ">", "res", "=", "new", "HashSet", "<", "ClassNode", ">", "(", ")", ";", "getAllInterfaces", "(", "res", ")", ";", "return", "res", ";", "}", "private", "void", "getAllInterfaces", "(", "Set", "<", "ClassNode", ">", "res", ")", "{", "if", "(", "isInterface", "(", ")", ")", "res", ".", "add", "(", "this", ")", ";", "for", "(", "ClassNode", "anInterface", ":", "getInterfaces", "(", ")", ")", "{", "res", ".", "add", "(", "anInterface", ")", ";", "anInterface", ".", "getAllInterfaces", "(", "res", ")", ";", "}", "}", "public", "Map", "<", "String", ",", "MethodNode", ">", "getDeclaredMethodsMap", "(", ")", "{", "ClassNode", "parent", "=", "getSuperClass", "(", ")", ";", "Map", "<", "String", ",", "MethodNode", ">", "result", "=", "null", ";", "if", "(", "parent", "!=", "null", ")", "{", "result", "=", "parent", ".", "getDeclaredMethodsMap", "(", ")", ";", "}", "else", "{", "result", "=", "new", "HashMap", "<", "String", ",", "MethodNode", ">", "(", ")", ";", "}", "for", "(", "ClassNode", "iface", ":", "getInterfaces", "(", ")", ")", "{", "Map", "<", "String", ",", "MethodNode", ">", "ifaceMethodsMap", "=", "iface", ".", "getDeclaredMethodsMap", "(", ")", ";", "for", "(", "String", "methSig", ":", "ifaceMethodsMap", ".", "keySet", "(", ")", ")", "{", "if", "(", "!", "result", ".", "containsKey", "(", "methSig", ")", ")", "{", "MethodNode", "methNode", "=", "ifaceMethodsMap", ".", "get", "(", "methSig", ")", ";", "result", ".", "put", "(", "methSig", ",", "methNode", ")", ";", "}", "}", "}", "for", "(", "MethodNode", "method", ":", "getMethods", "(", ")", ")", "{", "String", "sig", "=", "method", ".", "getTypeDescriptor", "(", ")", ";", "result", ".", "put", "(", "sig", ",", "method", ")", ";", "}", "return", "result", ";", "}", "public", "String", "getName", "(", ")", "{", "return", "redirect", "(", ")", ".", "name", ";", "}", "public", "String", "getUnresolvedName", "(", ")", "{", "return", "name", ";", "}", "public", "String", "setName", "(", "String", "name", ")", "{", "return", "redirect", "(", ")", ".", "name", "=", "name", ";", "}", "public", "int", "getModifiers", "(", ")", "{", "return", "redirect", "(", ")", ".", "modifiers", ";", "}", "public", "void", "setModifiers", "(", "int", "modifiers", ")", "{", "redirect", "(", ")", ".", "modifiers", "=", "modifiers", ";", "}", "protected", "void", "ensurePropertiesInitialized", "(", ")", "{", "}", "public", "List", "<", "PropertyNode", ">", "getProperties", "(", ")", "{", "redirect", "(", ")", ".", "ensurePropertiesInitialized", "(", ")", ";", "final", "ClassNode", "r", "=", "redirect", "(", ")", ";", "if", "(", "r", ".", "properties", "==", "null", ")", "r", ".", "properties", "=", "new", "ArrayList", "<", "PropertyNode", ">", "(", ")", ";", "return", "r", ".", "properties", ";", "}", "public", "List", "<", "ConstructorNode", ">", "getDeclaredConstructors", "(", ")", "{", "if", "(", "!", "redirect", "(", ")", ".", "lazyInitDone", ")", "redirect", "(", ")", ".", "lazyClassInit", "(", ")", ";", "final", "ClassNode", "r", "=", "redirect", "(", ")", ";", "if", "(", "r", ".", "constructors", "==", "null", ")", "r", ".", "constructors", "=", "new", "ArrayList", "<", "ConstructorNode", ">", "(", ")", ";", "return", "r", ".", "constructors", ";", "}", "public", "ModuleNode", "getModule", "(", ")", "{", "return", "redirect", "(", ")", ".", "module", ";", "}", "public", "PackageNode", "getPackage", "(", ")", "{", "return", "getModule", "(", ")", "==", "null", "?", "null", ":", "getModule", "(", ")", ".", "getPackage", "(", ")", ";", "}", "public", "void", "setModule", "(", "ModuleNode", "module", ")", "{", "redirect", "(", ")", ".", "module", "=", "module", ";", "if", "(", "module", "!=", "null", ")", "{", "redirect", "(", ")", ".", "compileUnit", "=", "module", ".", "getUnit", "(", ")", ";", "}", "}", "public", "void", "addField", "(", "FieldNode", "node", ")", "{", "final", "ClassNode", "r", "=", "redirect", "(", ")", ";", "node", ".", "setDeclaringClass", "(", "r", ")", ";", "node", ".", "setOwner", "(", "r", ")", ";", "if", "(", "r", ".", "fields", "==", "null", ")", "r", ".", "fields", "=", "new", "LinkedList", "<", "FieldNode", ">", "(", ")", ";", "if", "(", "r", ".", "fieldIndex", "==", "null", ")", "r", ".", "fieldIndex", "=", "new", "HashMap", "<", "String", ",", "FieldNode", ">", "(", ")", ";", "r", ".", "fields", ".", "add", "(", "node", ")", ";", "r", ".", "fieldIndex", ".", "put", "(", "node", ".", "getName", "(", ")", ",", "node", ")", ";", "}", "public", "void", "addFieldFirst", "(", "FieldNode", "node", ")", "{", "final", "ClassNode", "r", "=", "redirect", "(", ")", ";", "node", ".", "setDeclaringClass", "(", "r", ")", ";", "node", ".", "setOwner", "(", "r", ")", ";", "if", "(", "r", ".", "fields", "==", "null", ")", "r", ".", "fields", "=", "new", "LinkedList", "<", "FieldNode", ">", "(", ")", ";", "if", "(", "r", ".", "fieldIndex", "==", "null", ")", "r", ".", "fieldIndex", "=", "new", "HashMap", "<", "String", ",", "FieldNode", ">", "(", ")", ";", "r", ".", "fields", ".", "addFirst", "(", "node", ")", ";", "r", ".", "fieldIndex", ".", "put", "(", "node", ".", "getName", "(", ")", ",", "node", ")", ";", "}", "public", "void", "addPropertyWithoutField", "(", "PropertyNode", "node", ")", "{", "node", ".", "setDeclaringClass", "(", "redirect", "(", ")", ")", ";", "final", "ClassNode", "r", "=", "redirect", "(", ")", ";", "if", "(", "r", ".", "properties", "==", "null", ")", "r", ".", "properties", "=", "new", "ArrayList", "<", "PropertyNode", ">", "(", ")", ";", "r", ".", "properties", ".", "add", "(", "node", ")", ";", "}", "public", "void", "addProperty", "(", "PropertyNode", "node", ")", "{", "node", ".", "setDeclaringClass", "(", "redirect", "(", ")", ")", ";", "FieldNode", "field", "=", "node", ".", "getField", "(", ")", ";", "addField", "(", "field", ")", ";", "final", "ClassNode", "r", "=", "redirect", "(", ")", ";", "if", "(", "r", ".", "properties", "==", "null", ")", "r", ".", "properties", "=", "new", "ArrayList", "<", "PropertyNode", ">", "(", ")", ";", "r", ".", "properties", ".", "add", "(", "node", ")", ";", "}", "public", "PropertyNode", "addProperty", "(", "String", "name", ",", "int", "modifiers", ",", "ClassNode", "type", ",", "Expression", "initialValueExpression", ",", "Statement", "getterBlock", ",", "Statement", "setterBlock", ")", "{", "for", "(", "PropertyNode", "pn", ":", "getProperties", "(", ")", ")", "{", "if", "(", "pn", ".", "getName", "(", ")", ".", "equals", "(", "name", ")", ")", "{", "if", "(", "pn", ".", "getInitialExpression", "(", ")", "==", "null", "&&", "initialValueExpression", "!=", "null", ")", "pn", ".", "getField", "(", ")", ".", "setInitialValueExpression", "(", "initialValueExpression", ")", ";", "if", "(", "pn", ".", "getGetterBlock", "(", ")", "==", "null", "&&", "getterBlock", "!=", "null", ")", "pn", ".", "setGetterBlock", "(", "getterBlock", ")", ";", "if", "(", "pn", ".", "getSetterBlock", "(", ")", "==", "null", "&&", "setterBlock", "!=", "null", ")", "pn", ".", "setSetterBlock", "(", "setterBlock", ")", ";", "return", "pn", ";", "}", "}", "PropertyNode", "node", "=", "new", "PropertyNode", "(", "name", ",", "modifiers", ",", "type", ",", "redirect", "(", ")", ",", "initialValueExpression", ",", "getterBlock", ",", "setterBlock", ")", ";", "addProperty", "(", "node", ")", ";", "return", "node", ";", "}", "public", "boolean", "hasProperty", "(", "String", "name", ")", "{", "return", "getProperty", "(", "name", ")", "!=", "null", ";", "}", "public", "PropertyNode", "getProperty", "(", "String", "name", ")", "{", "try", "{", "for", "(", "PropertyNode", "pn", ":", "getProperties", "(", ")", ")", "{", "String", "pname", "=", "pn", ".", "getName", "(", ")", ";", "if", "(", "pname", ".", "equals", "(", "name", ")", ")", "return", "pn", ";", "}", "}", "catch", "(", "NullPointerException", "npe", ")", "{", "throw", "new", "RuntimeException", "(", "\"\"", "+", "this", ".", "getName", "(", ")", "+", "\"", "props", "are", "\"", "+", "getProperties", "(", ")", ",", "npe", ")", ";", "}", "return", "null", ";", "}", "public", "void", "addConstructor", "(", "ConstructorNode", "node", ")", "{", "node", ".", "setDeclaringClass", "(", "this", ")", ";", "final", "ClassNode", "r", "=", "redirect", "(", ")", ";", "if", "(", "r", ".", "constructors", "==", "null", ")", "r", ".", "constructors", "=", "new", "ArrayList", "<", "ConstructorNode", ">", "(", ")", ";", "r", ".", "constructors", ".", "add", "(", "node", ")", ";", "}", "public", "ConstructorNode", "addConstructor", "(", "int", "modifiers", ",", "Parameter", "[", "]", "parameters", ",", "ClassNode", "[", "]", "exceptions", ",", "Statement", "code", ")", "{", "ConstructorNode", "node", "=", "new", "ConstructorNode", "(", "modifiers", ",", "parameters", ",", "exceptions", ",", "code", ")", ";", "addConstructor", "(", "node", ")", ";", "return", "node", ";", "}", "public", "void", "addMethod", "(", "MethodNode", "node", ")", "{", "node", ".", "setDeclaringClass", "(", "this", ")", ";", "ClassNode", "redirect", "=", "redirect", "(", ")", ";", "redirect", ".", "methodsList", ".", "add", "(", "node", ")", ";", "redirect", ".", "methods", ".", "put", "(", "node", ".", "getName", "(", ")", ",", "node", ")", ";", "}", "public", "MethodNode", "addMethod", "(", "String", "name", ",", "int", "modifiers", ",", "ClassNode", "returnType", ",", "Parameter", "[", "]", "parameters", ",", "ClassNode", "[", "]", "exceptions", ",", "Statement", "code", ")", "{", "MethodNode", "other", "=", "getDeclaredMethod", "(", "name", ",", "parameters", ")", ";", "if", "(", "other", "!=", "null", ")", "{", "return", "other", ";", "}", "MethodNode", "node", "=", "new", "MethodNode", "(", "name", ",", "modifiers", ",", "returnType", ",", "parameters", ",", "exceptions", ",", "code", ")", ";", "addMethod", "(", "node", ")", ";", "return", "node", ";", "}", "public", "boolean", "hasDeclaredMethod", "(", "String", "name", ",", "Parameter", "[", "]", "parameters", ")", "{", "MethodNode", "other", "=", "getDeclaredMethod", "(", "name", ",", "parameters", ")", ";", "return", "other", "!=", "null", ";", "}", "public", "boolean", "hasMethod", "(", "String", "name", ",", "Parameter", "[", "]", "parameters", ")", "{", "MethodNode", "other", "=", "getMethod", "(", "name", ",", "parameters", ")", ";", "return", "other", "!=", "null", ";", "}", "public", "MethodNode", "addSyntheticMethod", "(", "String", "name", ",", "int", "modifiers", ",", "ClassNode", "returnType", ",", "Parameter", "[", "]", "parameters", ",", "ClassNode", "[", "]", "exceptions", ",", "Statement", "code", ")", "{", "MethodNode", "answer", "=", "addMethod", "(", "name", ",", "modifiers", "|", "ACC_SYNTHETIC", ",", "returnType", ",", "parameters", ",", "exceptions", ",", "code", ")", ";", "answer", ".", "setSynthetic", "(", "true", ")", ";", "return", "answer", ";", "}", "public", "FieldNode", "addField", "(", "String", "name", ",", "int", "modifiers", ",", "ClassNode", "type", ",", "Expression", "initialValue", ")", "{", "FieldNode", "node", "=", "new", "FieldNode", "(", "name", ",", "modifiers", ",", "type", ",", "redirect", "(", ")", ",", "initialValue", ")", ";", "addField", "(", "node", ")", ";", "return", "node", ";", "}", "public", "FieldNode", "addFieldFirst", "(", "String", "name", ",", "int", "modifiers", ",", "ClassNode", "type", ",", "Expression", "initialValue", ")", "{", "FieldNode", "node", "=", "new", "FieldNode", "(", "name", ",", "modifiers", ",", "type", ",", "redirect", "(", ")", ",", "initialValue", ")", ";", "addFieldFirst", "(", "node", ")", ";", "return", "node", ";", "}", "public", "void", "addInterface", "(", "ClassNode", "type", ")", "{", "boolean", "skip", "=", "false", ";", "ClassNode", "[", "]", "interfaces", "=", "redirect", "(", ")", ".", "interfaces", ";", "for", "(", "ClassNode", "existing", ":", "interfaces", ")", "{", "if", "(", "type", ".", "equals", "(", "existing", ")", ")", "{", "skip", "=", "true", ";", "}", "}", "if", "(", "!", "skip", ")", "{", "ClassNode", "[", "]", "newInterfaces", "=", "new", "ClassNode", "[", "interfaces", ".", "length", "+", "1", "]", ";", "System", ".", "arraycopy", "(", "interfaces", ",", "0", ",", "newInterfaces", ",", "0", ",", "interfaces", ".", "length", ")", ";", "newInterfaces", "[", "interfaces", ".", "length", "]", "=", "type", ";", "redirect", "(", ")", ".", "interfaces", "=", "newInterfaces", ";", "}", "}", "public", "boolean", "equals", "(", "Object", "o", ")", "{", "if", "(", "redirect", "!=", "null", ")", "return", "redirect", "(", ")", ".", "equals", "(", "o", ")", ";", "if", "(", "!", "(", "o", "instanceof", "ClassNode", ")", ")", "return", "false", ";", "ClassNode", "cn", "=", "(", "ClassNode", ")", "o", ";", "return", "(", "cn", ".", "getName", "(", ")", ".", "equals", "(", "getName", "(", ")", ")", ")", ";", "}", "public", "int", "hashCode", "(", ")", "{", "if", "(", "redirect", "!=", "null", ")", "return", "redirect", "(", ")", ".", "hashCode", "(", ")", ";", "return", "getName", "(", ")", ".", "hashCode", "(", ")", ";", "}", "public", "void", "addMixin", "(", "MixinNode", "mixin", ")", "{", "MixinNode", "[", "]", "mixins", "=", "redirect", "(", ")", ".", "mixins", ";", "boolean", "skip", "=", "false", ";", "for", "(", "MixinNode", "existing", ":", "mixins", ")", "{", "if", "(", "mixin", ".", "equals", "(", "existing", ")", ")", "{", "skip", "=", "true", ";", "}", "}", "if", "(", "!", "skip", ")", "{", "MixinNode", "[", "]", "newMixins", "=", "new", "MixinNode", "[", "mixins", ".", "length", "+", "1", "]", ";", "System", ".", "arraycopy", "(", "mixins", ",", "0", ",", "newMixins", ",", "0", ",", "mixins", ".", "length", ")", ";", "newMixins", "[", "mixins", ".", "length", "]", "=", "mixin", ";", "redirect", "(", ")", ".", "mixins", "=", "newMixins", ";", "}", "}", "public", "FieldNode", "getDeclaredField", "(", "String", "name", ")", "{", "if", "(", "!", "redirect", "(", ")", ".", "lazyInitDone", ")", "redirect", "(", ")", ".", "lazyClassInit", "(", ")", ";", "ClassNode", "r", "=", "redirect", "(", ")", ";", "if", "(", "r", ".", "fieldIndex", "==", "null", ")", "r", ".", "fieldIndex", "=", "new", "HashMap", "<", "String", ",", "FieldNode", ">", "(", ")", ";", "return", "r", ".", "fieldIndex", ".", "get", "(", "name", ")", ";", "}", "public", "FieldNode", "getField", "(", "String", "name", ")", "{", "ClassNode", "node", "=", "this", ";", "while", "(", "node", "!=", "null", ")", "{", "FieldNode", "fn", "=", "node", ".", "getDeclaredField", "(", "name", ")", ";", "if", "(", "fn", "!=", "null", ")", "return", "fn", ";", "node", "=", "node", ".", "getSuperClass", "(", ")", ";", "}", "return", "null", ";", "}", "public", "FieldNode", "getOuterField", "(", "String", "name", ")", "{", "return", "null", ";", "}", "public", "ClassNode", "getOuterClass", "(", ")", "{", "return", "null", ";", "}", "public", "void", "addObjectInitializerStatements", "(", "Statement", "statements", ")", "{", "getObjectInitializerStatements", "(", ")", ".", "add", "(", "statements", ")", ";", "}", "public", "List", "<", "Statement", ">", "getObjectInitializerStatements", "(", ")", "{", "if", "(", "objectInitializers", "==", "null", ")", "objectInitializers", "=", "new", "ArrayList", "<", "Statement", ">", "(", ")", ";", "return", "objectInitializers", ";", "}", "private", "MethodNode", "getOrAddStaticConstructorNode", "(", ")", "{", "MethodNode", "method", "=", "null", ";", "List", "declaredMethods", "=", "getDeclaredMethods", "(", "\"<clinit>\"", ")", ";", "if", "(", "declaredMethods", ".", "isEmpty", "(", ")", ")", "{", "method", "=", "addMethod", "(", "\"<clinit>\"", ",", "ACC_STATIC", ",", "ClassHelper", ".", "VOID_TYPE", ",", "Parameter", ".", "EMPTY_ARRAY", ",", "ClassNode", ".", "EMPTY_ARRAY", ",", "new", "BlockStatement", "(", ")", ")", ";", "method", ".", "setSynthetic", "(", "true", ")", ";", "}", "else", "{", "method", "=", "(", "MethodNode", ")", "declaredMethods", ".", "get", "(", "0", ")", ";", "}", "return", "method", ";", "}", "public", "void", "addStaticInitializerStatements", "(", "List", "<", "Statement", ">", "staticStatements", ",", "boolean", "fieldInit", ")", "{", "MethodNode", "method", "=", "getOrAddStaticConstructorNode", "(", ")", ";", "BlockStatement", "block", "=", "null", ";", "Statement", "statement", "=", "method", ".", "getCode", "(", ")", ";", "if", "(", "statement", "==", "null", ")", "{", "block", "=", "new", "BlockStatement", "(", ")", ";", "}", "else", "if", "(", "statement", "instanceof", "BlockStatement", ")", "{", "block", "=", "(", "BlockStatement", ")", "statement", ";", "}", "else", "{", "block", "=", "new", "BlockStatement", "(", ")", ";", "block", ".", "addStatement", "(", "statement", ")", ";", "}", "if", "(", "!", "fieldInit", ")", "{", "block", ".", "addStatements", "(", "staticStatements", ")", ";", "}", "else", "{", "List", "<", "Statement", ">", "blockStatements", "=", "block", ".", "getStatements", "(", ")", ";", "staticStatements", ".", "addAll", "(", "blockStatements", ")", ";", "blockStatements", ".", "clear", "(", ")", ";", "blockStatements", ".", "addAll", "(", "staticStatements", ")", ";", "}", "}", "public", "void", "positionStmtsAfterEnumInitStmts", "(", "List", "<", "Statement", ">", "staticFieldStatements", ")", "{", "MethodNode", "method", "=", "getOrAddStaticConstructorNode", "(", ")", ";", "Statement", "statement", "=", "method", ".", "getCode", "(", ")", ";", "if", "(", "statement", "instanceof", "BlockStatement", ")", "{", "BlockStatement", "block", "=", "(", "BlockStatement", ")", "statement", ";", "List", "<", "Statement", ">", "blockStatements", "=", "block", ".", "getStatements", "(", ")", ";", "ListIterator", "<", "Statement", ">", "litr", "=", "blockStatements", ".", "listIterator", "(", ")", ";", "while", "(", "litr", ".", "hasNext", "(", ")", ")", "{", "Statement", "stmt", "=", "litr", ".", "next", "(", ")", ";", "if", "(", "stmt", "instanceof", "ExpressionStatement", "&&", "(", "(", "ExpressionStatement", ")", "stmt", ")", ".", "getExpression", "(", ")", "instanceof", "BinaryExpression", ")", "{", "BinaryExpression", "bExp", "=", "(", "BinaryExpression", ")", "(", "(", "ExpressionStatement", ")", "stmt", ")", ".", "getExpression", "(", ")", ";", "if", "(", "bExp", ".", "getLeftExpression", "(", ")", "instanceof", "FieldExpression", ")", "{", "FieldExpression", "fExp", "=", "(", "FieldExpression", ")", "bExp", ".", "getLeftExpression", "(", ")", ";", "if", "(", "fExp", ".", "getFieldName", "(", ")", ".", "equals", "(", "\"$VALUES\"", ")", ")", "{", "for", "(", "Statement", "tmpStmt", ":", "staticFieldStatements", ")", "{", "litr", ".", "add", "(", "tmpStmt", ")", ";", "}", "}", "}", "}", "}", "}", "}", "public", "List", "<", "MethodNode", ">", "getDeclaredMethods", "(", "String", "name", ")", "{", "if", "(", "!", "redirect", "(", ")", ".", "lazyInitDone", ")", "redirect", "(", ")", ".", "lazyClassInit", "(", ")", ";", "if", "(", "redirect", "!=", "null", ")", "return", "redirect", "(", ")", ".", "getDeclaredMethods", "(", "name", ")", ";", "return", "methods", ".", "getNotNull", "(", "name", ")", ";", "}", "public", "List", "<", "MethodNode", ">", "getMethods", "(", "String", "name", ")", "{", "List", "<", "MethodNode", ">", "answer", "=", "new", "ArrayList", "<", "MethodNode", ">", "(", ")", ";", "ClassNode", "node", "=", "this", ";", "while", "(", "node", "!=", "null", ")", "{", "answer", ".", "addAll", "(", "node", ".", "getDeclaredMethods", "(", "name", ")", ")", ";", "node", "=", "node", ".", "getSuperClass", "(", ")", ";", "}", "return", "answer", ";", "}", "public", "MethodNode", "getDeclaredMethod", "(", "String", "name", ",", "Parameter", "[", "]", "parameters", ")", "{", "for", "(", "MethodNode", "method", ":", "getDeclaredMethods", "(", "name", ")", ")", "{", "if", "(", "parametersEqual", "(", "method", ".", "getParameters", "(", ")", ",", "parameters", ")", ")", "{", "return", "method", ";", "}", "}", "return", "null", ";", "}", "public", "MethodNode", "getMethod", "(", "String", "name", ",", "Parameter", "[", "]", "parameters", ")", "{", "for", "(", "MethodNode", "method", ":", "getMethods", "(", "name", ")", ")", "{", "if", "(", "parametersEqual", "(", "method", ".", "getParameters", "(", ")", ",", "parameters", ")", ")", "{", "return", "method", ";", "}", "}", "return", "null", ";", "}", "public", "boolean", "isDerivedFrom", "(", "ClassNode", "type", ")", "{", "if", "(", "this", ".", "equals", "(", "ClassHelper", ".", "VOID_TYPE", ")", ")", "{", "return", "type", ".", "equals", "(", "ClassHelper", ".", "VOID_TYPE", ")", ";", "}", "if", "(", "type", ".", "equals", "(", "ClassHelper", ".", "OBJECT_TYPE", ")", ")", "return", "true", ";", "ClassNode", "node", "=", "this", ";", "while", "(", "node", "!=", "null", ")", "{", "if", "(", "type", ".", "equals", "(", "node", ")", ")", "{", "return", "true", ";", "}", "node", "=", "node", ".", "getSuperClass", "(", ")", ";", "}", "return", "false", ";", "}", "public", "boolean", "isDerivedFromGroovyObject", "(", ")", "{", "return", "implementsInterface", "(", "ClassHelper", ".", "GROOVY_OBJECT_TYPE", ")", ";", "}", "public", "boolean", "implementsInterface", "(", "ClassNode", "classNode", ")", "{", "ClassNode", "node", "=", "redirect", "(", ")", ";", "do", "{", "if", "(", "node", ".", "declaresInterface", "(", "classNode", ")", ")", "{", "return", "true", ";", "}", "node", "=", "node", ".", "getSuperClass", "(", ")", ";", "}", "while", "(", "node", "!=", "null", ")", ";", "return", "false", ";", "}", "public", "boolean", "declaresInterface", "(", "ClassNode", "classNode", ")", "{", "ClassNode", "[", "]", "interfaces", "=", "redirect", "(", ")", ".", "getInterfaces", "(", ")", ";", "for", "(", "ClassNode", "cn", ":", "interfaces", ")", "{", "if", "(", "cn", ".", "equals", "(", "classNode", ")", ")", "return", "true", ";", "}", "for", "(", "ClassNode", "cn", ":", "interfaces", ")", "{", "if", "(", "cn", ".", "declaresInterface", "(", "classNode", ")", ")", "return", "true", ";", "}", "return", "false", ";", "}", "public", "ClassNode", "getSuperClass", "(", ")", "{", "if", "(", "!", "lazyInitDone", "&&", "!", "isResolved", "(", ")", ")", "{", "throw", "new", "GroovyBugError", "(", "\"\"", "+", "getName", "(", ")", "+", "\"\"", ")", ";", "}", "if", "(", "hasInconsistentHierarchy", "(", ")", ")", "{", "return", "ClassHelper", ".", "OBJECT_TYPE", ";", "}", "ClassNode", "sn", "=", "redirect", "(", ")", ".", "getUnresolvedSuperClass", "(", ")", ";", "if", "(", "sn", "!=", "null", ")", "sn", "=", "sn", ".", "redirect", "(", ")", ";", "return", "sn", ";", "}", "public", "ClassNode", "getUnresolvedSuperClass", "(", ")", "{", "return", "getUnresolvedSuperClass", "(", "true", ")", ";", "}", "public", "ClassNode", "getUnresolvedSuperClass", "(", "boolean", "useRedirect", ")", "{", "if", "(", "hasInconsistentHierarchy", "(", ")", ")", "{", "return", "ClassHelper", ".", "OBJECT_TYPE", ";", "}", "if", "(", "!", "useRedirect", ")", "return", "superClass", ";", "if", "(", "!", "redirect", "(", ")", ".", "lazyInitDone", ")", "redirect", "(", ")", ".", "lazyClassInit", "(", ")", ";", "return", "redirect", "(", ")", ".", "superClass", ";", "}", "public", "void", "setUnresolvedSuperClass", "(", "ClassNode", "sn", ")", "{", "superClass", "=", "sn", ";", "}", "public", "ClassNode", "[", "]", "getUnresolvedInterfaces", "(", ")", "{", "return", "getUnresolvedInterfaces", "(", "true", ")", ";", "}", "public", "ClassNode", "[", "]", "getUnresolvedInterfaces", "(", "boolean", "useRedirect", ")", "{", "if", "(", "hasInconsistentHierarchy", "(", ")", ")", "{", "return", "EMPTY_ARRAY", ";", "}", "if", "(", "!", "useRedirect", ")", "return", "interfaces", ";", "if", "(", "!", "redirect", "(", ")", ".", "lazyInitDone", ")", "redirect", "(", ")", ".", "lazyClassInit", "(", ")", ";", "return", "redirect", "(", ")", ".", "interfaces", ";", "}", "public", "CompileUnit", "getCompileUnit", "(", ")", "{", "if", "(", "redirect", "!=", "null", ")", "return", "redirect", "(", ")", ".", "getCompileUnit", "(", ")", ";", "if", "(", "compileUnit", "==", "null", "&&", "module", "!=", "null", ")", "{", "compileUnit", "=", "module", ".", "getUnit", "(", ")", ";", "}", "return", "compileUnit", ";", "}", "protected", "void", "setCompileUnit", "(", "CompileUnit", "cu", ")", "{", "if", "(", "redirect", "!=", "null", ")", "redirect", "(", ")", ".", "setCompileUnit", "(", "cu", ")", ";", "if", "(", "compileUnit", "!=", "null", ")", "compileUnit", "=", "cu", ";", "}", "protected", "boolean", "parametersEqual", "(", "Parameter", "[", "]", "a", ",", "Parameter", "[", "]", "b", ")", "{", "if", "(", "a", ".", "length", "==", "b", ".", "length", ")", "{", "boolean", "answer", "=", "true", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "a", ".", "length", ";", "i", "++", ")", "{", "if", "(", "!", "a", "[", "i", "]", ".", "getType", "(", ")", ".", "equals", "(", "b", "[", "i", "]", ".", "getType", "(", ")", ")", ")", "{", "answer", "=", "false", ";", "break", ";", "}", "}", "return", "answer", ";", "}", "return", "false", ";", "}", "public", "String", "getPackageName", "(", ")", "{", "int", "idx", "=", "getName", "(", ")", ".", "lastIndexOf", "(", "'.'", ")", ";", "if", "(", "idx", ">", "0", ")", "{", "return", "getName", "(", ")", ".", "substring", "(", "0", ",", "idx", ")", ";", "}", "return", "null", ";", "}", "public", "String", "getNameWithoutPackage", "(", ")", "{", "int", "idx", "=", "getName", "(", ")", ".", "lastIndexOf", "(", "'.'", ")", ";", "if", "(", "idx", ">", "0", ")", "{", "return", "getName", "(", ")", ".", "substring", "(", "idx", "+", "1", ")", ";", "}", "return", "getName", "(", ")", ";", "}", "public", "void", "visitContents", "(", "GroovyClassVisitor", "visitor", ")", "{", "for", "(", "PropertyNode", "pn", ":", "getProperties", "(", ")", ")", "{", "visitor", ".", "visitProperty", "(", "pn", ")", ";", "}", "for", "(", "FieldNode", "fn", ":", "getFields", "(", ")", ")", "{", "visitor", ".", "visitField", "(", "fn", ")", ";", "}", "for", "(", "ConstructorNode", "cn", ":", "getDeclaredConstructors", "(", ")", ")", "{", "visitor", ".", "visitConstructor", "(", "cn", ")", ";", "}", "for", "(", "MethodNode", "mn", ":", "getMethods", "(", ")", ")", "{", "visitor", ".", "visitMethod", "(", "mn", ")", ";", "}", "}", "public", "MethodNode", "getGetterMethod", "(", "String", "getterName", ")", "{", "for", "(", "MethodNode", "method", ":", "getDeclaredMethods", "(", "getterName", ")", ")", "{", "if", "(", "getterName", ".", "equals", "(", "method", ".", "getName", "(", ")", ")", "&&", "ClassHelper", ".", "VOID_TYPE", "!=", "method", ".", "getReturnType", "(", ")", "&&", "method", ".", "getParameters", "(", ")", ".", "length", "==", "0", ")", "{", "return", "method", ";", "}", "}", "ClassNode", "parent", "=", "getSuperClass", "(", ")", ";", "if", "(", "parent", "!=", "null", ")", "return", "parent", ".", "getGetterMethod", "(", "getterName", ")", ";", "return", "null", ";", "}", "public", "MethodNode", "getSetterMethod", "(", "String", "setterName", ")", "{", "return", "getSetterMethod", "(", "setterName", ",", "true", ")", ";", "}", "public", "MethodNode", "getSetterMethod", "(", "String", "setterName", ",", "boolean", "voidOnly", ")", "{", "for", "(", "MethodNode", "method", ":", "getDeclaredMethods", "(", "setterName", ")", ")", "{", "if", "(", "setterName", ".", "equals", "(", "method", ".", "getName", "(", ")", ")", "&&", "(", "!", "voidOnly", "||", "ClassHelper", ".", "VOID_TYPE", "==", "method", ".", "getReturnType", "(", ")", ")", "&&", "method", ".", "getParameters", "(", ")", ".", "length", "==", "1", ")", "{", "return", "method", ";", "}", "}", "ClassNode", "parent", "=", "getSuperClass", "(", ")", ";", "if", "(", "parent", "!=", "null", ")", "return", "parent", ".", "getSetterMethod", "(", "setterName", ",", "voidOnly", ")", ";", "return", "null", ";", "}", "public", "boolean", "isStaticClass", "(", ")", "{", "return", "redirect", "(", ")", ".", "staticClass", ";", "}", "public", "void", "setStaticClass", "(", "boolean", "staticClass", ")", "{", "redirect", "(", ")", ".", "staticClass", "=", "staticClass", ";", "}", "public", "boolean", "isScriptBody", "(", ")", "{", "return", "redirect", "(", ")", ".", "scriptBody", ";", "}", "public", "void", "setScriptBody", "(", "boolean", "scriptBody", ")", "{", "redirect", "(", ")", ".", "scriptBody", "=", "scriptBody", ";", "}", "public", "boolean", "isScript", "(", ")", "{", "return", "redirect", "(", ")", ".", "script", "||", "isDerivedFrom", "(", "ClassHelper", ".", "SCRIPT_TYPE", ")", ";", "}", "public", "void", "setScript", "(", "boolean", "script", ")", "{", "redirect", "(", ")", ".", "script", "=", "script", ";", "}", "public", "String", "toString", "(", ")", "{", "String", "ret", "=", "getName", "(", ")", ";", "Set", "<", "ClassNode", ">", "alreadySeen", "=", "new", "HashSet", "<", "ClassNode", ">", "(", ")", ";", "if", "(", "genericsTypes", "!=", "null", ")", "{", "ret", "+=", "\"", "<\"", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "genericsTypes", ".", "length", ";", "i", "++", ")", "{", "if", "(", "i", "!=", "0", ")", "ret", "+=", "\",", "\"", ";", "GenericsType", "genericsType", "=", "genericsTypes", "[", "i", "]", ";", "ret", "+=", "genericTypeAsString", "(", "genericsType", ",", "alreadySeen", ")", ";", "}", "ret", "+=", "\">\"", ";", "}", "if", "(", "redirect", "!=", "null", ")", "{", "ret", "+=", "\"", "->", "\"", "+", "redirect", "(", ")", ".", "toString", "(", "alreadySeen", ")", ";", "}", "return", "ret", ";", "}", "private", "String", "toString", "(", "Set", "<", "ClassNode", ">", "alreadySeen", ")", "{", "String", "ret", "=", "getName", "(", ")", ";", "if", "(", "genericsTypes", "!=", "null", ")", "{", "ret", "+=", "\"", "<\"", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "genericsTypes", ".", "length", ";", "i", "++", ")", "{", "if", "(", "i", "!=", "0", ")", "ret", "+=", "\",", "\"", ";", "GenericsType", "genericsType", "=", "genericsTypes", "[", "i", "]", ";", "ret", "+=", "genericTypeAsString", "(", "genericsType", ",", "alreadySeen", ")", ";", "}", "ret", "+=", "\">\"", ";", "}", "if", "(", "redirect", "!=", "null", ")", "{", "ret", "+=", "\"", "->", "\"", "+", "redirect", "(", ")", ".", "toString", "(", "alreadySeen", ")", ";", "}", "return", "ret", ";", "}", "private", "String", "genericTypeAsString", "(", "GenericsType", "genericsType", ",", "Set", "<", "ClassNode", ">", "alreadySeen", ")", "{", "String", "ret", "=", "genericsType", ".", "getName", "(", ")", ";", "if", "(", "genericsType", ".", "getUpperBounds", "(", ")", "!=", "null", ")", "{", "ret", "+=", "\"", "extends", "\"", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "genericsType", ".", "getUpperBounds", "(", ")", ".", "length", ";", "i", "++", ")", "{", "ClassNode", "classNode", "=", "genericsType", ".", "getUpperBounds", "(", ")", "[", "i", "]", ";", "if", "(", "classNode", ".", "equals", "(", "this", ")", ")", "{", "ret", "+=", "classNode", ".", "getName", "(", ")", ";", "}", "else", "{", "if", "(", "alreadySeen", ".", "contains", "(", "classNode", ")", ")", "{", "ret", "+=", "classNode", ".", "getName", "(", ")", ";", "}", "else", "{", "alreadySeen", ".", "add", "(", "classNode", ")", ";", "ret", "+=", "classNode", ".", "toString", "(", "alreadySeen", ")", ";", "}", "}", "if", "(", "i", "+", "1", "<", "genericsType", ".", "getUpperBounds", "(", ")", ".", "length", ")", "ret", "+=", "\"", "&", "\"", ";", "}", "}", "else", "if", "(", "genericsType", ".", "getLowerBound", "(", ")", "!=", "null", ")", "{", "ClassNode", "classNode", "=", "genericsType", ".", "getLowerBound", "(", ")", ";", "if", "(", "classNode", ".", "equals", "(", "this", ")", ")", "{", "ret", "+=", "\"", "super", "\"", "+", "classNode", ".", "getName", "(", ")", ";", "}", "else", "{", "ret", "+=", "\"", "super", "\"", "+", "classNode", ";", "}", "}", "return", "ret", ";", "}", "public", "boolean", "hasPossibleMethod", "(", "String", "name", ",", "Expression", "arguments", ")", "{", "int", "count", "=", "0", ";", "if", "(", "arguments", "instanceof", "TupleExpression", ")", "{", "TupleExpression", "tuple", "=", "(", "TupleExpression", ")", "arguments", ";", "count", "=", "tuple", ".", "getExpressions", "(", ")", ".", "size", "(", ")", ";", "}", "ClassNode", "node", "=", "this", ";", "do", "{", "for", "(", "MethodNode", "method", ":", "getMethods", "(", "name", ")", ")", "{", "if", "(", "method", ".", "getParameters", "(", ")", ".", "length", "==", "count", "&&", "!", "method", ".", "isStatic", "(", ")", ")", "{", "return", "true", ";", "}", "}", "node", "=", "node", ".", "getSuperClass", "(", ")", ";", "}", "while", "(", "node", "!=", "null", ")", ";", "return", "false", ";", "}", "public", "MethodNode", "tryFindPossibleMethod", "(", "String", "name", ",", "Expression", "arguments", ")", "{", "int", "count", "=", "0", ";", "if", "(", "arguments", "instanceof", "TupleExpression", ")", "{", "TupleExpression", "tuple", "=", "(", "TupleExpression", ")", "arguments", ";", "count", "=", "tuple", ".", "getExpressions", "(", ")", ".", "size", "(", ")", ";", "}", "else", "return", "null", ";", "MethodNode", "res", "=", "null", ";", "ClassNode", "node", "=", "this", ";", "TupleExpression", "args", "=", "(", "TupleExpression", ")", "arguments", ";", "do", "{", "for", "(", "MethodNode", "method", ":", "node", ".", "getMethods", "(", "name", ")", ")", "{", "if", "(", "method", ".", "getParameters", "(", ")", ".", "length", "==", "count", ")", "{", "boolean", "match", "=", "true", ";", "for", "(", "int", "i", "=", "0", ";", "i", "!=", "count", ";", "++", "i", ")", "if", "(", "!", "args", ".", "getType", "(", ")", ".", "isDerivedFrom", "(", "method", ".", "getParameters", "(", ")", "[", "i", "]", ".", "getType", "(", ")", ")", ")", "{", "match", "=", "false", ";", "break", ";", "}", "if", "(", "match", ")", "{", "if", "(", "res", "==", "null", ")", "res", "=", "method", ";", "else", "{", "if", "(", "res", ".", "getParameters", "(", ")", ".", "length", "!=", "count", ")", "return", "null", ";", "if", "(", "node", ".", "equals", "(", "this", ")", ")", "return", "null", ";", "match", "=", "true", ";", "for", "(", "int", "i", "=", "0", ";", "i", "!=", "count", ";", "++", "i", ")", "if", "(", "!", "res", ".", "getParameters", "(", ")", "[", "i", "]", ".", "getType", "(", ")", ".", "equals", "(", "method", ".", "getParameters", "(", ")", "[", "i", "]", ".", "getType", "(", ")", ")", ")", "{", "match", "=", "false", ";", "break", ";", "}", "if", "(", "!", "match", ")", "return", "null", ";", "}", "}", "}", "}", "node", "=", "node", ".", "getSuperClass", "(", ")", ";", "}", "while", "(", "node", "!=", "null", ")", ";", "return", "res", ";", "}", "public", "boolean", "hasPossibleStaticMethod", "(", "String", "name", ",", "Expression", "arguments", ")", "{", "int", "count", "=", "0", ";", "if", "(", "arguments", "instanceof", "TupleExpression", ")", "{", "TupleExpression", "tuple", "=", "(", "TupleExpression", ")", "arguments", ";", "count", "=", "tuple", ".", "getExpressions", "(", ")", ".", "size", "(", ")", ";", "}", "else", "if", "(", "arguments", "instanceof", "MapExpression", ")", "{", "count", "=", "1", ";", "}", "for", "(", "MethodNode", "method", ":", "getMethods", "(", "name", ")", ")", "{", "if", "(", "method", ".", "isStatic", "(", ")", ")", "{", "Parameter", "[", "]", "parameters", "=", "method", ".", "getParameters", "(", ")", ";", "if", "(", "parameters", ".", "length", "==", "count", ")", "return", "true", ";", "if", "(", "parameters", ".", "length", ">", "0", "&&", "parameters", "[", "parameters", ".", "length", "-", "1", "]", ".", "getType", "(", ")", ".", "isArray", "(", ")", ")", "{", "if", "(", "count", ">=", "parameters", ".", "length", "-", "1", ")", "return", "true", ";", "}", "int", "nonDefaultParameters", "=", "0", ";", "for", "(", "Parameter", "parameter", ":", "parameters", ")", "{", "if", "(", "!", "parameter", ".", "hasInitialExpression", "(", ")", ")", "{", "nonDefaultParameters", "++", ";", "}", "}", "if", "(", "count", "<", "parameters", ".", "length", "&&", "nonDefaultParameters", "<=", "count", ")", "{", "return", "true", ";", "}", "}", "}", "return", "false", ";", "}", "public", "boolean", "isInterface", "(", ")", "{", "return", "(", "getModifiers", "(", ")", "&", "Opcodes", ".", "ACC_INTERFACE", ")", ">", "0", ";", "}", "public", "boolean", "isResolved", "(", ")", "{", "return", "redirect", "(", ")", ".", "isReallyResolved", "(", ")", "||", "redirect", "(", ")", ".", "clazz", "!=", "null", "||", "(", "componentType", "!=", "null", "&&", "componentType", ".", "isResolved", "(", ")", ")", ";", "}", "public", "boolean", "isReallyResolved", "(", ")", "{", "return", "false", ";", "}", "public", "boolean", "isArray", "(", ")", "{", "return", "componentType", "!=", "null", ";", "}", "public", "ClassNode", "getComponentType", "(", ")", "{", "return", "componentType", ";", "}", "public", "boolean", "hasClass", "(", ")", "{", "return", "redirect", "(", ")", ".", "clazz", "!=", "null", ";", "}", "public", "Class", "getTypeClass", "(", ")", "{", "Class", "c", "=", "redirect", "(", ")", ".", "clazz", ";", "if", "(", "c", "!=", "null", ")", "return", "c", ";", "ClassNode", "component", "=", "redirect", "(", ")", ".", "componentType", ";", "if", "(", "component", "!=", "null", "&&", "component", ".", "isResolved", "(", ")", ")", "{", "ClassNode", "cn", "=", "component", ".", "makeArray", "(", ")", ";", "setRedirect", "(", "cn", ")", ";", "return", "redirect", "(", ")", ".", "clazz", ";", "}", "if", "(", "redirect", "(", ")", ".", "getClass", "(", ")", ".", "getName", "(", ")", ".", "endsWith", "(", "\"JDTClassNode\"", ")", ")", "{", "return", "redirect", "(", ")", ".", "getTypeClass", "(", ")", ";", "}", "throw", "new", "GroovyBugError", "(", "\"\"", "+", "getName", "(", ")", "+", "\"\"", ")", ";", "}", "public", "boolean", "hasPackageName", "(", ")", "{", "return", "redirect", "(", ")", ".", "name", ".", "indexOf", "(", "'.'", ")", ">", "0", ";", "}", "public", "void", "setAnnotated", "(", "boolean", "flag", ")", "{", "this", ".", "annotated", "=", "flag", ";", "}", "public", "boolean", "isAnnotated", "(", ")", "{", "return", "this", ".", "annotated", ";", "}", "public", "GenericsType", "[", "]", "getGenericsTypes", "(", ")", "{", "return", "genericsTypes", ";", "}", "public", "void", "setGenericsTypes", "(", "GenericsType", "[", "]", "genericsTypes", ")", "{", "usesGenerics", "=", "usesGenerics", "||", "genericsTypes", "!=", "null", ";", "this", ".", "genericsTypes", "=", "genericsTypes", ";", "}", "public", "void", "setGenericsPlaceHolder", "(", "boolean", "b", ")", "{", "usesGenerics", "=", "usesGenerics", "||", "b", ";", "placeholder", "=", "b", ";", "}", "public", "boolean", "isGenericsPlaceHolder", "(", ")", "{", "return", "placeholder", ";", "}", "public", "boolean", "isUsingGenerics", "(", ")", "{", "return", "usesGenerics", ";", "}", "public", "void", "setUsingGenerics", "(", "boolean", "b", ")", "{", "usesGenerics", "=", "b", ";", "}", "public", "ClassNode", "getPlainNodeReference", "(", ")", "{", "if", "(", "ClassHelper", ".", "isPrimitiveType", "(", "this", ")", ")", "return", "this", ";", "ClassNode", "n", "=", "new", "ClassNode", "(", "getName", "(", ")", ",", "getModifiers", "(", ")", ",", "getSuperClass", "(", ")", ",", "getPlainNodeReferencesFor", "(", "getInterfaces", "(", ")", ")", ",", "null", ")", ";", "n", ".", "isPrimaryNode", "=", "false", ";", "n", ".", "setRedirect", "(", "redirect", "(", ")", ")", ";", "n", ".", "componentType", "=", "redirect", "(", ")", ".", "getComponentType", "(", ")", ";", "return", "n", ";", "}", "public", "ClassNode", "[", "]", "getPlainNodeReferencesFor", "(", "ClassNode", "[", "]", "classNodes", ")", "{", "if", "(", "classNodes", "==", "null", ")", "{", "return", "null", ";", "}", "if", "(", "classNodes", ".", "length", "==", "0", ")", "{", "return", "ClassNode", ".", "EMPTY_ARRAY", ";", "}", "ClassNode", "[", "]", "result", "=", "new", "ClassNode", "[", "classNodes", ".", "length", "]", ";", "for", "(", "int", "count", "=", "0", ";", "count", "<", "classNodes", ".", "length", ";", "count", "++", ")", "{", "ClassNode", "cn", "=", "classNodes", "[", "count", "]", ";", "if", "(", "cn", ".", "usesGenerics", ")", "{", "result", "[", "count", "]", "=", "cn", ".", "getPlainNodeReference", "(", ")", ";", "}", "else", "{", "result", "[", "count", "]", "=", "cn", ";", "}", "}", "return", "result", ";", "}", "public", "boolean", "isAnnotationDefinition", "(", ")", "{", "return", "redirect", "(", ")", ".", "isPrimaryNode", "&&", "isInterface", "(", ")", "&&", "(", "getModifiers", "(", ")", "&", "Opcodes", ".", "ACC_ANNOTATION", ")", "!=", "0", ";", "}", "public", "List", "<", "AnnotationNode", ">", "getAnnotations", "(", ")", "{", "if", "(", "redirect", "!=", "null", ")", "return", "redirect", ".", "getAnnotations", "(", ")", ";", "lazyClassInit", "(", ")", ";", "return", "super", ".", "getAnnotations", "(", ")", ";", "}", "public", "List", "<", "AnnotationNode", ">", "getAnnotations", "(", "ClassNode", "type", ")", "{", "if", "(", "redirect", "!=", "null", ")", "return", "redirect", ".", "getAnnotations", "(", "type", ")", ";", "lazyClassInit", "(", ")", ";", "return", "super", ".", "getAnnotations", "(", "type", ")", ";", "}", "public", "void", "addTransform", "(", "Class", "<", "?", "extends", "ASTTransformation", ">", "transform", ",", "ASTNode", "node", ")", "{", "GroovyASTTransformation", "annotation", "=", "transform", ".", "getAnnotation", "(", "GroovyASTTransformation", ".", "class", ")", ";", "Set", "<", "ASTNode", ">", "nodes", "=", "getTransformInstances", "(", ")", ".", "get", "(", "annotation", ".", "phase", "(", ")", ")", ".", "get", "(", "transform", ")", ";", "if", "(", "nodes", "==", "null", ")", "{", "nodes", "=", "new", "LinkedHashSet", "<", "ASTNode", ">", "(", ")", ";", "getTransformInstances", "(", ")", ".", "get", "(", "annotation", ".", "phase", "(", ")", ")", ".", "put", "(", "transform", ",", "nodes", ")", ";", "}", "nodes", ".", "add", "(", "node", ")", ";", "}", "public", "Map", "<", "Class", "<", "?", "extends", "ASTTransformation", ">", ",", "Set", "<", "ASTNode", ">", ">", "getTransforms", "(", "CompilePhase", "phase", ")", "{", "return", "getTransformInstances", "(", ")", ".", "get", "(", "phase", ")", ";", "}", "public", "void", "renameField", "(", "String", "oldName", ",", "String", "newName", ")", "{", "ClassNode", "r", "=", "redirect", "(", ")", ";", "if", "(", "r", ".", "fieldIndex", "==", "null", ")", "r", ".", "fieldIndex", "=", "new", "HashMap", "<", "String", ",", "FieldNode", ">", "(", ")", ";", "final", "Map", "<", "String", ",", "FieldNode", ">", "index", "=", "r", ".", "fieldIndex", ";", "index", ".", "put", "(", "newName", ",", "index", ".", "remove", "(", "oldName", ")", ")", ";", "}", "public", "void", "removeField", "(", "String", "oldName", ")", "{", "ClassNode", "r", "=", "redirect", "(", ")", ";", "if", "(", "r", ".", "fieldIndex", "==", "null", ")", "r", ".", "fieldIndex", "=", "new", "HashMap", "<", "String", ",", "FieldNode", ">", "(", ")", ";", "final", "Map", "<", "String", ",", "FieldNode", ">", "index", "=", "r", ".", "fieldIndex", ";", "r", ".", "fields", ".", "remove", "(", "index", ".", "get", "(", "oldName", ")", ")", ";", "index", ".", "remove", "(", "oldName", ")", ";", "}", "public", "boolean", "isEnum", "(", ")", "{", "return", "(", "getModifiers", "(", ")", "&", "Opcodes", ".", "ACC_ENUM", ")", "!=", "0", ";", "}", "public", "Iterator", "<", "InnerClassNode", ">", "getInnerClasses", "(", ")", "{", "return", "(", "innerClasses", "==", "null", "?", "Collections", ".", "<", "InnerClassNode", ">", "emptyList", "(", ")", ":", "innerClasses", ")", ".", "iterator", "(", ")", ";", "}", "public", "void", "forgetInnerClass", "(", "InnerClassNode", "icn", ")", "{", "if", "(", "innerClasses", "!=", "null", ")", "{", "innerClasses", ".", "remove", "(", "icn", ")", ";", "}", "}", "private", "Map", "<", "CompilePhase", ",", "Map", "<", "Class", "<", "?", "extends", "ASTTransformation", ">", ",", "Set", "<", "ASTNode", ">", ">", ">", "getTransformInstances", "(", ")", "{", "if", "(", "transformInstances", "==", "null", ")", "{", "transformInstances", "=", "new", "EnumMap", "<", "CompilePhase", ",", "Map", "<", "Class", "<", "?", "extends", "ASTTransformation", ">", ",", "Set", "<", "ASTNode", ">", ">", ">", "(", "CompilePhase", ".", "class", ")", ";", "for", "(", "CompilePhase", "phase", ":", "CompilePhase", ".", "values", "(", ")", ")", "{", "transformInstances", ".", "put", "(", "phase", ",", "new", "HashMap", "<", "Class", "<", "?", "extends", "ASTTransformation", ">", ",", "Set", "<", "ASTNode", ">", ">", "(", ")", ")", ";", "}", "}", "return", "transformInstances", ";", "}", "public", "boolean", "isRedirectNode", "(", ")", "{", "return", "redirect", "!=", "null", ";", "}", "public", "String", "getClassInternalName", "(", ")", "{", "if", "(", "redirect", "!=", "null", ")", "return", "redirect", "(", ")", ".", "getClassInternalName", "(", ")", ";", "return", "null", ";", "}", "public", "boolean", "isPrimitive", "(", ")", "{", "if", "(", "clazz", "!=", "null", ")", "{", "return", "clazz", ".", "isPrimitive", "(", ")", ";", "}", "return", "false", ";", "}", "public", "boolean", "mightHaveInners", "(", ")", "{", "ClassNode", "redirect", "=", "redirect", "(", ")", ";", "if", "(", "redirect", ".", "hasClass", "(", ")", ")", "{", "return", "true", ";", "}", "boolean", "b", "=", "redirect", ".", "innerClasses", "!=", "null", "&&", "redirect", ".", "innerClasses", ".", "size", "(", ")", ">", "0", ";", "return", "b", ";", "}", "}", "</s>" ]
6,653
[ "<s>", "package", "org", ".", "codehaus", ".", "groovy", ".", "ast", ";", "import", "java", ".", "util", ".", "List", ";", "import", "java", ".", "util", ".", "Map", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "expr", ".", "DeclarationExpression", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "expr", ".", "Expression", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "stmt", ".", "AssertStatement", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "stmt", ".", "BlockStatement", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "stmt", ".", "BreakStatement", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "stmt", ".", "CaseStatement", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "stmt", ".", "CatchStatement", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "stmt", ".", "ContinueStatement", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "stmt", ".", "DoWhileStatement", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "stmt", ".", "ExpressionStatement", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "stmt", ".", "ForStatement", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "stmt", ".", "IfStatement", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "stmt", ".", "ReturnStatement", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "stmt", ".", "Statement", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "stmt", ".", "SwitchStatement", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "stmt", ".", "SynchronizedStatement", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "stmt", ".", "ThrowStatement", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "stmt", ".", "TryCatchStatement", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "stmt", ".", "WhileStatement", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "control", ".", "SourceUnit", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "control", ".", "messages", ".", "SyntaxErrorMessage", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "syntax", ".", "SyntaxException", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "syntax", ".", "PreciseSyntaxException", ";", "public", "abstract", "class", "ClassCodeVisitorSupport", "extends", "CodeVisitorSupport", "implements", "GroovyClassVisitor", "{", "public", "void", "visitClass", "(", "ClassNode", "node", ")", "{", "visitAnnotations", "(", "node", ")", ";", "visitPackage", "(", "node", ".", "getPackage", "(", ")", ")", ";", "visitImports", "(", "node", ".", "getModule", "(", ")", ")", ";", "node", ".", "visitContents", "(", "this", ")", ";", "visitObjectInitializerStatements", "(", "node", ")", ";", "}", "protected", "void", "visitObjectInitializerStatements", "(", "ClassNode", "node", ")", "{", "for", "(", "Statement", "element", ":", "node", ".", "getObjectInitializerStatements", "(", ")", ")", "{", "element", ".", "visit", "(", "this", ")", ";", "}", "}", "public", "void", "visitPackage", "(", "PackageNode", "node", ")", "{", "if", "(", "node", "!=", "null", ")", "{", "visitAnnotations", "(", "node", ")", ";", "node", ".", "visit", "(", "this", ")", ";", "}", "}", "public", "void", "visitImports", "(", "ModuleNode", "node", ")", "{", "if", "(", "node", "!=", "null", ")", "{", "for", "(", "ImportNode", "importNode", ":", "node", ".", "getImports", "(", ")", ")", "{", "visitAnnotations", "(", "importNode", ")", ";", "importNode", ".", "visit", "(", "this", ")", ";", "}", "for", "(", "ImportNode", "importStarNode", ":", "node", ".", "getStarImports", "(", ")", ")", "{", "visitAnnotations", "(", "importStarNode", ")", ";", "importStarNode", ".", "visit", "(", "this", ")", ";", "}", "for", "(", "ImportNode", "importStaticNode", ":", "node", ".", "getStaticImports", "(", ")", ".", "values", "(", ")", ")", "{", "visitAnnotations", "(", "importStaticNode", ")", ";", "importStaticNode", ".", "visit", "(", "this", ")", ";", "}", "for", "(", "ImportNode", "importStaticStarNode", ":", "node", ".", "getStaticStarImports", "(", ")", ".", "values", "(", ")", ")", "{", "visitAnnotations", "(", "importStaticStarNode", ")", ";", "importStaticStarNode", ".", "visit", "(", "this", ")", ";", "}", "}", "}", "public", "void", "visitAnnotations", "(", "AnnotatedNode", "node", ")", "{", "List", "<", "AnnotationNode", ">", "annotations", "=", "node", ".", "getAnnotations", "(", ")", ";", "if", "(", "annotations", ".", "isEmpty", "(", ")", ")", "return", ";", "for", "(", "AnnotationNode", "an", ":", "annotations", ")", "{", "if", "(", "an", ".", "isBuiltIn", "(", ")", ")", "continue", ";", "for", "(", "Map", ".", "Entry", "<", "String", ",", "Expression", ">", "member", ":", "an", ".", "getMembers", "(", ")", ".", "entrySet", "(", ")", ")", "{", "member", ".", "getValue", "(", ")", ".", "visit", "(", "this", ")", ";", "}", "}", "}", "protected", "void", "visitClassCodeContainer", "(", "Statement", "code", ")", "{", "if", "(", "code", "!=", "null", ")", "code", ".", "visit", "(", "this", ")", ";", "}", "@", "Override", "public", "void", "visitDeclarationExpression", "(", "DeclarationExpression", "expression", ")", "{", "visitAnnotations", "(", "expression", ")", ";", "super", ".", "visitDeclarationExpression", "(", "expression", ")", ";", "}", "protected", "void", "visitConstructorOrMethod", "(", "MethodNode", "node", ",", "boolean", "isConstructor", ")", "{", "visitAnnotations", "(", "node", ")", ";", "visitClassCodeContainer", "(", "node", ".", "getCode", "(", ")", ")", ";", "for", "(", "Parameter", "param", ":", "node", ".", "getParameters", "(", ")", ")", "{", "visitAnnotations", "(", "param", ")", ";", "}", "}", "public", "void", "visitConstructor", "(", "ConstructorNode", "node", ")", "{", "visitConstructorOrMethod", "(", "node", ",", "true", ")", ";", "}", "public", "void", "visitMethod", "(", "MethodNode", "node", ")", "{", "visitConstructorOrMethod", "(", "node", ",", "false", ")", ";", "}", "public", "void", "visitField", "(", "FieldNode", "node", ")", "{", "visitAnnotations", "(", "node", ")", ";", "Expression", "init", "=", "node", ".", "getInitialExpression", "(", ")", ";", "if", "(", "init", "!=", "null", ")", "init", ".", "visit", "(", "this", ")", ";", "}", "public", "void", "visitProperty", "(", "PropertyNode", "node", ")", "{", "visitAnnotations", "(", "node", ")", ";", "Statement", "statement", "=", "node", ".", "getGetterBlock", "(", ")", ";", "visitClassCodeContainer", "(", "statement", ")", ";", "statement", "=", "node", ".", "getSetterBlock", "(", ")", ";", "visitClassCodeContainer", "(", "statement", ")", ";", "Expression", "init", "=", "node", ".", "getInitialExpression", "(", ")", ";", "if", "(", "init", "!=", "null", ")", "init", ".", "visit", "(", "this", ")", ";", "}", "protected", "void", "addError", "(", "String", "msg", ",", "ASTNode", "expr", ")", "{", "int", "line", "=", "expr", ".", "getLineNumber", "(", ")", ";", "int", "col", "=", "expr", ".", "getColumnNumber", "(", ")", ";", "SourceUnit", "source", "=", "getSourceUnit", "(", ")", ";", "source", ".", "getErrorCollector", "(", ")", ".", "addErrorAndContinue", "(", "new", "SyntaxErrorMessage", "(", "new", "SyntaxException", "(", "msg", "+", "'\\n'", ",", "line", ",", "col", ")", ",", "source", ")", ")", ";", "}", "protected", "void", "addTypeError", "(", "String", "msg", ",", "ClassNode", "expr", ")", "{", "int", "line", "=", "expr", ".", "getLineNumber", "(", ")", ";", "int", "col", "=", "expr", ".", "getColumnNumber", "(", ")", ";", "SourceUnit", "source", "=", "getSourceUnit", "(", ")", ";", "source", ".", "getErrorCollector", "(", ")", ".", "addErrorAndContinue", "(", "new", "SyntaxErrorMessage", "(", "new", "PreciseSyntaxException", "(", "msg", "+", "'\\n'", ",", "line", ",", "col", ",", "expr", ".", "getNameStart", "(", ")", ",", "expr", ".", "getNameEnd", "(", ")", ")", ",", "source", ")", ")", ";", "}", "protected", "abstract", "SourceUnit", "getSourceUnit", "(", ")", ";", "protected", "void", "visitStatement", "(", "Statement", "statement", ")", "{", "}", "public", "void", "visitAssertStatement", "(", "AssertStatement", "statement", ")", "{", "visitStatement", "(", "statement", ")", ";", "super", ".", "visitAssertStatement", "(", "statement", ")", ";", "}", "public", "void", "visitBlockStatement", "(", "BlockStatement", "block", ")", "{", "visitStatement", "(", "block", ")", ";", "super", ".", "visitBlockStatement", "(", "block", ")", ";", "}", "public", "void", "visitBreakStatement", "(", "BreakStatement", "statement", ")", "{", "visitStatement", "(", "statement", ")", ";", "super", ".", "visitBreakStatement", "(", "statement", ")", ";", "}", "public", "void", "visitCaseStatement", "(", "CaseStatement", "statement", ")", "{", "visitStatement", "(", "statement", ")", ";", "super", ".", "visitCaseStatement", "(", "statement", ")", ";", "}", "public", "void", "visitCatchStatement", "(", "CatchStatement", "statement", ")", "{", "visitStatement", "(", "statement", ")", ";", "super", ".", "visitCatchStatement", "(", "statement", ")", ";", "}", "public", "void", "visitContinueStatement", "(", "ContinueStatement", "statement", ")", "{", "visitStatement", "(", "statement", ")", ";", "super", ".", "visitContinueStatement", "(", "statement", ")", ";", "}", "public", "void", "visitDoWhileLoop", "(", "DoWhileStatement", "loop", ")", "{", "visitStatement", "(", "loop", ")", ";", "super", ".", "visitDoWhileLoop", "(", "loop", ")", ";", "}", "public", "void", "visitExpressionStatement", "(", "ExpressionStatement", "statement", ")", "{", "visitStatement", "(", "statement", ")", ";", "super", ".", "visitExpressionStatement", "(", "statement", ")", ";", "}", "public", "void", "visitForLoop", "(", "ForStatement", "forLoop", ")", "{", "visitStatement", "(", "forLoop", ")", ";", "super", ".", "visitForLoop", "(", "forLoop", ")", ";", "}", "public", "void", "visitIfElse", "(", "IfStatement", "ifElse", ")", "{", "visitStatement", "(", "ifElse", ")", ";", "super", ".", "visitIfElse", "(", "ifElse", ")", ";", "}", "public", "void", "visitReturnStatement", "(", "ReturnStatement", "statement", ")", "{", "visitStatement", "(", "statement", ")", ";", "super", ".", "visitReturnStatement", "(", "statement", ")", ";", "}", "public", "void", "visitSwitch", "(", "SwitchStatement", "statement", ")", "{", "visitStatement", "(", "statement", ")", ";", "super", ".", "visitSwitch", "(", "statement", ")", ";", "}", "public", "void", "visitSynchronizedStatement", "(", "SynchronizedStatement", "statement", ")", "{", "visitStatement", "(", "statement", ")", ";", "super", ".", "visitSynchronizedStatement", "(", "statement", ")", ";", "}", "public", "void", "visitThrowStatement", "(", "ThrowStatement", "statement", ")", "{", "visitStatement", "(", "statement", ")", ";", "super", ".", "visitThrowStatement", "(", "statement", ")", ";", "}", "public", "void", "visitTryCatchFinally", "(", "TryCatchStatement", "statement", ")", "{", "visitStatement", "(", "statement", ")", ";", "super", ".", "visitTryCatchFinally", "(", "statement", ")", ";", "}", "public", "void", "visitWhileLoop", "(", "WhileStatement", "loop", ")", "{", "visitStatement", "(", "loop", ")", ";", "super", ".", "visitWhileLoop", "(", "loop", ")", ";", "}", "}", "</s>" ]
6,654
[ "<s>", "package", "org", ".", "codehaus", ".", "groovy", ".", "ast", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "GroovyBugError", ";", "class", "ImmutableClassNode", "extends", "ClassNode", "{", "class", "ImmutableGenericsType", "extends", "GenericsType", "{", "ImmutableGenericsType", "(", "GenericsType", "delegate", ")", "{", "super", ".", "setType", "(", "delegate", ".", "getType", "(", ")", ")", ";", "super", ".", "setPlaceholder", "(", "delegate", ".", "isPlaceholder", "(", ")", ")", ";", "super", ".", "setResolved", "(", "delegate", ".", "isResolved", "(", ")", ")", ";", "super", ".", "setName", "(", "delegate", ".", "getName", "(", ")", ")", ";", "super", ".", "setWildcard", "(", "delegate", ".", "isWildcard", "(", ")", ")", ";", "super", ".", "setUpperBounds", "(", "delegate", ".", "getUpperBounds", "(", ")", ")", ";", "super", ".", "setLowerBound", "(", "delegate", ".", "getLowerBound", "(", ")", ")", ";", "}", "@", "Override", "public", "void", "setType", "(", "ClassNode", "type", ")", "{", "throw", "new", "GroovyBugError", "(", "\"\"", "+", "ImmutableClassNode", ".", "this", ".", "getName", "(", ")", ")", ";", "}", "@", "Override", "public", "void", "setPlaceholder", "(", "boolean", "placeholder", ")", "{", "throw", "new", "GroovyBugError", "(", "\"\"", "+", "ImmutableClassNode", ".", "this", ".", "getName", "(", ")", ")", ";", "}", "@", "Override", "public", "void", "setResolved", "(", "boolean", "res", ")", "{", "throw", "new", "GroovyBugError", "(", "\"\"", "+", "ImmutableClassNode", ".", "this", ".", "getName", "(", ")", ")", ";", "}", "@", "Override", "public", "void", "setName", "(", "String", "name", ")", "{", "throw", "new", "GroovyBugError", "(", "\"\"", "+", "ImmutableClassNode", ".", "this", ".", "getName", "(", ")", ")", ";", "}", "@", "Override", "public", "void", "setWildcard", "(", "boolean", "wildcard", ")", "{", "throw", "new", "GroovyBugError", "(", "\"\"", "+", "ImmutableClassNode", ".", "this", ".", "getName", "(", ")", ")", ";", "}", "@", "Override", "public", "void", "setUpperBounds", "(", "ClassNode", "[", "]", "bounds", ")", "{", "throw", "new", "GroovyBugError", "(", "\"\"", "+", "ImmutableClassNode", ".", "this", ".", "getName", "(", ")", ")", ";", "}", "@", "Override", "public", "void", "setLowerBound", "(", "ClassNode", "bound", ")", "{", "throw", "new", "GroovyBugError", "(", "\"\"", "+", "ImmutableClassNode", ".", "this", ".", "getName", "(", ")", ")", ";", "}", "}", "private", "boolean", "genericsInitialized", "=", "false", ";", "public", "ImmutableClassNode", "(", "Class", "c", ")", "{", "super", "(", "c", ")", ";", "}", "@", "Override", "public", "void", "setGenericsTypes", "(", "GenericsType", "[", "]", "genericsTypes", ")", "{", "if", "(", "genericsInitialized", ")", "{", "throw", "new", "GroovyBugError", "(", "\"\"", "+", "this", ".", "getName", "(", ")", ")", ";", "}", "if", "(", "genericsTypes", "!=", "null", ")", "{", "GenericsType", "[", "]", "immutable", "=", "new", "GenericsType", "[", "genericsTypes", ".", "length", "]", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "genericsTypes", ".", "length", ";", "i", "++", ")", "{", "immutable", "[", "i", "]", "=", "new", "ImmutableGenericsType", "(", "genericsTypes", "[", "i", "]", ")", ";", "}", "genericsTypes", "=", "immutable", ";", "}", "super", ".", "setGenericsTypes", "(", "genericsTypes", ")", ";", "genericsInitialized", "=", "true", ";", "}", "}", "</s>" ]
6,655
[ "<s>", "package", "org", ".", "codehaus", ".", "groovy", ".", "ast", ";", "import", "java", ".", "util", ".", "*", ";", "public", "class", "AnnotatedNode", "extends", "ASTNode", "{", "private", "List", "<", "AnnotationNode", ">", "annotations", "=", "Collections", ".", "emptyList", "(", ")", ";", "private", "boolean", "synthetic", ";", "ClassNode", "declaringClass", ";", "private", "boolean", "hasNoRealSourcePositionFlag", ";", "private", "int", "nameEnd", ";", "private", "int", "nameStart", ";", "public", "AnnotatedNode", "(", ")", "{", "}", "public", "List", "<", "AnnotationNode", ">", "getAnnotations", "(", ")", "{", "return", "annotations", ";", "}", "public", "List", "<", "AnnotationNode", ">", "getAnnotations", "(", "ClassNode", "type", ")", "{", "List", "<", "AnnotationNode", ">", "ret", "=", "new", "ArrayList", "<", "AnnotationNode", ">", "(", "annotations", ".", "size", "(", ")", ")", ";", "for", "(", "AnnotationNode", "node", ":", "annotations", ")", "{", "if", "(", "type", ".", "equals", "(", "node", ".", "getClassNode", "(", ")", ")", ")", "ret", ".", "add", "(", "node", ")", ";", "}", "return", "ret", ";", "}", "public", "void", "addAnnotation", "(", "AnnotationNode", "value", ")", "{", "checkInit", "(", ")", ";", "annotations", ".", "add", "(", "value", ")", ";", "}", "private", "void", "checkInit", "(", ")", "{", "if", "(", "annotations", "==", "Collections", ".", "EMPTY_LIST", ")", "annotations", "=", "new", "ArrayList", "<", "AnnotationNode", ">", "(", "3", ")", ";", "}", "public", "void", "addAnnotations", "(", "List", "<", "AnnotationNode", ">", "annotations", ")", "{", "for", "(", "AnnotationNode", "node", ":", "annotations", ")", "{", "addAnnotation", "(", "node", ")", ";", "}", "}", "public", "boolean", "isSynthetic", "(", ")", "{", "return", "synthetic", ";", "}", "public", "void", "setSynthetic", "(", "boolean", "synthetic", ")", "{", "this", ".", "synthetic", "=", "synthetic", ";", "}", "public", "ClassNode", "getDeclaringClass", "(", ")", "{", "return", "declaringClass", ";", "}", "public", "void", "setDeclaringClass", "(", "ClassNode", "declaringClass", ")", "{", "this", ".", "declaringClass", "=", "declaringClass", ";", "}", "public", "boolean", "hasNoRealSourcePosition", "(", ")", "{", "return", "hasNoRealSourcePositionFlag", ";", "}", "public", "void", "setHasNoRealSourcePosition", "(", "boolean", "value", ")", "{", "this", ".", "hasNoRealSourcePositionFlag", "=", "value", ";", "}", "public", "int", "getNameStart", "(", ")", "{", "return", "nameStart", ";", "}", "public", "void", "setNameStart", "(", "int", "nameStart", ")", "{", "this", ".", "nameStart", "=", "nameStart", ";", "}", "public", "int", "getNameEnd", "(", ")", "{", "return", "nameEnd", ";", "}", "public", "void", "setNameEnd", "(", "int", "nameEnd", ")", "{", "this", ".", "nameEnd", "=", "nameEnd", ";", "}", "@", "Override", "public", "void", "setSourcePosition", "(", "ASTNode", "node", ")", "{", "super", ".", "setSourcePosition", "(", "node", ")", ";", "if", "(", "node", "instanceof", "AnnotatedNode", ")", "{", "AnnotatedNode", "aNode", "=", "(", "AnnotatedNode", ")", "node", ";", "setNameStart", "(", "aNode", ".", "getNameStart", "(", ")", ")", ";", "setNameEnd", "(", "aNode", ".", "getNameEnd", "(", ")", ")", ";", "}", "}", "}", "</s>" ]
6,656
[ "<s>", "package", "org", ".", "codehaus", ".", "groovy", ".", "ast", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "expr", ".", "*", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "stmt", ".", "*", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "classgen", ".", "BytecodeExpression", ";", "public", "interface", "GroovyCodeVisitor", "{", "void", "visitBlockStatement", "(", "BlockStatement", "statement", ")", ";", "void", "visitForLoop", "(", "ForStatement", "forLoop", ")", ";", "void", "visitWhileLoop", "(", "WhileStatement", "loop", ")", ";", "void", "visitDoWhileLoop", "(", "DoWhileStatement", "loop", ")", ";", "void", "visitIfElse", "(", "IfStatement", "ifElse", ")", ";", "void", "visitExpressionStatement", "(", "ExpressionStatement", "statement", ")", ";", "void", "visitReturnStatement", "(", "ReturnStatement", "statement", ")", ";", "void", "visitAssertStatement", "(", "AssertStatement", "statement", ")", ";", "void", "visitTryCatchFinally", "(", "TryCatchStatement", "finally1", ")", ";", "void", "visitSwitch", "(", "SwitchStatement", "statement", ")", ";", "void", "visitCaseStatement", "(", "CaseStatement", "statement", ")", ";", "void", "visitBreakStatement", "(", "BreakStatement", "statement", ")", ";", "void", "visitContinueStatement", "(", "ContinueStatement", "statement", ")", ";", "void", "visitThrowStatement", "(", "ThrowStatement", "statement", ")", ";", "void", "visitSynchronizedStatement", "(", "SynchronizedStatement", "statement", ")", ";", "void", "visitCatchStatement", "(", "CatchStatement", "statement", ")", ";", "void", "visitMethodCallExpression", "(", "MethodCallExpression", "call", ")", ";", "void", "visitStaticMethodCallExpression", "(", "StaticMethodCallExpression", "expression", ")", ";", "void", "visitConstructorCallExpression", "(", "ConstructorCallExpression", "expression", ")", ";", "void", "visitTernaryExpression", "(", "TernaryExpression", "expression", ")", ";", "void", "visitShortTernaryExpression", "(", "ElvisOperatorExpression", "expression", ")", ";", "void", "visitBinaryExpression", "(", "BinaryExpression", "expression", ")", ";", "void", "visitPrefixExpression", "(", "PrefixExpression", "expression", ")", ";", "void", "visitPostfixExpression", "(", "PostfixExpression", "expression", ")", ";", "void", "visitBooleanExpression", "(", "BooleanExpression", "expression", ")", ";", "void", "visitClosureExpression", "(", "ClosureExpression", "expression", ")", ";", "void", "visitTupleExpression", "(", "TupleExpression", "expression", ")", ";", "void", "visitMapExpression", "(", "MapExpression", "expression", ")", ";", "void", "visitMapEntryExpression", "(", "MapEntryExpression", "expression", ")", ";", "void", "visitListExpression", "(", "ListExpression", "expression", ")", ";", "void", "visitRangeExpression", "(", "RangeExpression", "expression", ")", ";", "void", "visitPropertyExpression", "(", "PropertyExpression", "expression", ")", ";", "void", "visitAttributeExpression", "(", "AttributeExpression", "attributeExpression", ")", ";", "void", "visitFieldExpression", "(", "FieldExpression", "expression", ")", ";", "void", "visitMethodPointerExpression", "(", "MethodPointerExpression", "expression", ")", ";", "void", "visitConstantExpression", "(", "ConstantExpression", "expression", ")", ";", "void", "visitClassExpression", "(", "ClassExpression", "expression", ")", ";", "void", "visitVariableExpression", "(", "VariableExpression", "expression", ")", ";", "void", "visitDeclarationExpression", "(", "DeclarationExpression", "expression", ")", ";", "void", "visitGStringExpression", "(", "GStringExpression", "expression", ")", ";", "void", "visitArrayExpression", "(", "ArrayExpression", "expression", ")", ";", "void", "visitSpreadExpression", "(", "SpreadExpression", "expression", ")", ";", "void", "visitSpreadMapExpression", "(", "SpreadMapExpression", "expression", ")", ";", "void", "visitNotExpression", "(", "NotExpression", "expression", ")", ";", "void", "visitUnaryMinusExpression", "(", "UnaryMinusExpression", "expression", ")", ";", "void", "visitUnaryPlusExpression", "(", "UnaryPlusExpression", "expression", ")", ";", "void", "visitBitwiseNegationExpression", "(", "BitwiseNegationExpression", "expression", ")", ";", "void", "visitCastExpression", "(", "CastExpression", "expression", ")", ";", "void", "visitArgumentlistExpression", "(", "ArgumentListExpression", "expression", ")", ";", "void", "visitClosureListExpression", "(", "ClosureListExpression", "closureListExpression", ")", ";", "void", "visitBytecodeExpression", "(", "BytecodeExpression", "expression", ")", ";", "}", "</s>" ]
6,657
[ "<s>", "package", "org", ".", "codehaus", ".", "groovy", ".", "transform", ";", "import", "groovy", ".", "lang", ".", "MetaClass", ";", "import", "groovy", ".", "lang", ".", "MissingPropertyException", ";", "import", "groovy", ".", "lang", ".", "ReadOnlyPropertyException", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "ASTNode", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "AnnotatedNode", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "AnnotationNode", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "ClassHelper", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "ClassNode", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "ConstructorNode", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "FieldNode", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "InnerClassNode", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "Parameter", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "PropertyNode", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "expr", ".", "*", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "stmt", ".", "BlockStatement", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "stmt", ".", "EmptyStatement", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "stmt", ".", "ExpressionStatement", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "stmt", ".", "IfStatement", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "stmt", ".", "Statement", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "stmt", ".", "ThrowStatement", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "control", ".", "CompilePhase", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "control", ".", "SourceUnit", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "runtime", ".", "DefaultGroovyMethods", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "runtime", ".", "InvokerHelper", ";", "import", "java", ".", "lang", ".", "reflect", ".", "Modifier", ";", "import", "java", ".", "util", ".", "*", ";", "import", "static", "org", ".", "codehaus", ".", "groovy", ".", "transform", ".", "AbstractASTTransformUtil", ".", "*", ";", "import", "static", "org", ".", "codehaus", ".", "groovy", ".", "transform", ".", "EqualsAndHashCodeASTTransformation", ".", "createEquals", ";", "import", "static", "org", ".", "codehaus", ".", "groovy", ".", "transform", ".", "EqualsAndHashCodeASTTransformation", ".", "createHashCode", ";", "import", "static", "org", ".", "codehaus", ".", "groovy", ".", "transform", ".", "ToStringASTTransformation", ".", "createToString", ";", "@", "GroovyASTTransformation", "(", "phase", "=", "CompilePhase", ".", "CANONICALIZATION", ")", "public", "class", "ImmutableASTTransformation", "extends", "AbstractASTTransformation", "{", "private", "static", "List", "<", "String", ">", "immutableList", "=", "Arrays", ".", "asList", "(", "\"\"", ",", "\"\"", ",", "\"\"", ",", "\"\"", ",", "\"\"", ",", "\"\"", ",", "\"\"", ",", "\"\"", ",", "\"\"", ",", "\"\"", ",", "\"\"", ",", "\"\"", ",", "\"java.net.URI\"", ",", "\"\"", ")", ";", "private", "static", "final", "Class", "MY_CLASS", "=", "groovy", ".", "transform", ".", "Immutable", ".", "class", ";", "static", "final", "ClassNode", "MY_TYPE", "=", "ClassHelper", ".", "make", "(", "MY_CLASS", ")", ";", "static", "final", "String", "MY_TYPE_NAME", "=", "\"@\"", "+", "MY_TYPE", ".", "getNameWithoutPackage", "(", ")", ";", "private", "static", "final", "ClassNode", "DATE_TYPE", "=", "ClassHelper", ".", "make", "(", "Date", ".", "class", ")", ";", "private", "static", "final", "ClassNode", "CLONEABLE_TYPE", "=", "ClassHelper", ".", "make", "(", "Cloneable", ".", "class", ")", ";", "private", "static", "final", "ClassNode", "COLLECTION_TYPE", "=", "ClassHelper", ".", "makeWithoutCaching", "(", "Collection", ".", "class", ",", "false", ")", ";", "private", "static", "final", "ClassNode", "READONLYEXCEPTION_TYPE", "=", "ClassHelper", ".", "make", "(", "ReadOnlyPropertyException", ".", "class", ")", ";", "private", "static", "final", "ClassNode", "DGM_TYPE", "=", "ClassHelper", ".", "make", "(", "DefaultGroovyMethods", ".", "class", ")", ";", "private", "static", "final", "ClassNode", "SELF_TYPE", "=", "ClassHelper", ".", "make", "(", "ImmutableASTTransformation", ".", "class", ")", ";", "private", "static", "final", "ClassNode", "HASHMAP_TYPE", "=", "ClassHelper", ".", "makeWithoutCaching", "(", "HashMap", ".", "class", ",", "false", ")", ";", "private", "static", "final", "ClassNode", "MAP_TYPE", "=", "ClassHelper", ".", "makeWithoutCaching", "(", "Map", ".", "class", ",", "false", ")", ";", "public", "void", "visit", "(", "ASTNode", "[", "]", "nodes", ",", "SourceUnit", "source", ")", "{", "init", "(", "nodes", ",", "source", ")", ";", "AnnotatedNode", "parent", "=", "(", "AnnotatedNode", ")", "nodes", "[", "1", "]", ";", "AnnotationNode", "node", "=", "(", "AnnotationNode", ")", "nodes", "[", "0", "]", ";", "if", "(", "!", "node", ".", "getClassNode", "(", ")", ".", "getName", "(", ")", ".", "endsWith", "(", "\".Immutable\"", ")", ")", "return", ";", "List", "<", "PropertyNode", ">", "newProperties", "=", "new", "ArrayList", "<", "PropertyNode", ">", "(", ")", ";", "if", "(", "parent", "instanceof", "ClassNode", ")", "{", "ClassNode", "cNode", "=", "(", "ClassNode", ")", "parent", ";", "String", "cName", "=", "cNode", ".", "getName", "(", ")", ";", "checkNotInterface", "(", "cNode", ",", "MY_TYPE_NAME", ")", ";", "makeClassFinal", "(", "cNode", ")", ";", "final", "List", "<", "PropertyNode", ">", "pList", "=", "getInstanceProperties", "(", "cNode", ")", ";", "for", "(", "PropertyNode", "pNode", ":", "pList", ")", "{", "adjustPropertyForImmutability", "(", "pNode", ",", "newProperties", ")", ";", "}", "for", "(", "PropertyNode", "pNode", ":", "newProperties", ")", "{", "cNode", ".", "getProperties", "(", ")", ".", "remove", "(", "pNode", ")", ";", "addProperty", "(", "cNode", ",", "pNode", ")", ";", "}", "final", "List", "<", "FieldNode", ">", "fList", "=", "cNode", ".", "getFields", "(", ")", ";", "for", "(", "FieldNode", "fNode", ":", "fList", ")", "{", "ensureNotPublic", "(", "cName", ",", "fNode", ")", ";", "}", "createConstructors", "(", "cNode", ")", ";", "createHashCode", "(", "cNode", ",", "true", ",", "false", ",", "false", ",", "null", ",", "null", ")", ";", "createEquals", "(", "cNode", ",", "false", ",", "false", ",", "false", ",", "null", ",", "null", ")", ";", "if", "(", "!", "hasAnnotation", "(", "cNode", ",", "ToStringASTTransformation", ".", "MY_TYPE", ")", ")", "{", "createToString", "(", "cNode", ",", "false", ",", "false", ",", "null", ",", "null", ",", "false", ")", ";", "}", "}", "}", "private", "void", "makeClassFinal", "(", "ClassNode", "cNode", ")", "{", "if", "(", "(", "cNode", ".", "getModifiers", "(", ")", "&", "ACC_FINAL", ")", "==", "0", ")", "{", "cNode", ".", "setModifiers", "(", "cNode", ".", "getModifiers", "(", ")", "|", "ACC_FINAL", ")", ";", "}", "}", "private", "void", "createConstructors", "(", "ClassNode", "cNode", ")", "{", "if", "(", "!", "validateConstructors", "(", "cNode", ")", ")", "return", ";", "List", "<", "PropertyNode", ">", "list", "=", "getInstanceProperties", "(", "cNode", ")", ";", "boolean", "specialHashMapCase", "=", "list", ".", "size", "(", ")", "==", "1", "&&", "list", ".", "get", "(", "0", ")", ".", "getField", "(", ")", ".", "getType", "(", ")", ".", "equals", "(", "HASHMAP_TYPE", ")", ";", "if", "(", "specialHashMapCase", ")", "{", "createConstructorMapSpecial", "(", "cNode", ",", "list", ")", ";", "}", "else", "{", "createConstructorMap", "(", "cNode", ",", "list", ")", ";", "createConstructorOrdered", "(", "cNode", ",", "list", ")", ";", "}", "}", "private", "void", "createConstructorOrdered", "(", "ClassNode", "cNode", ",", "List", "<", "PropertyNode", ">", "list", ")", "{", "final", "MapExpression", "argMap", "=", "new", "MapExpression", "(", ")", ";", "final", "Parameter", "[", "]", "orderedParams", "=", "new", "Parameter", "[", "list", ".", "size", "(", ")", "]", ";", "int", "index", "=", "0", ";", "for", "(", "PropertyNode", "pNode", ":", "list", ")", "{", "Parameter", "param", "=", "new", "Parameter", "(", "pNode", ".", "getField", "(", ")", ".", "getType", "(", ")", ",", "pNode", ".", "getField", "(", ")", ".", "getName", "(", ")", ")", ";", "orderedParams", "[", "index", "++", "]", "=", "param", ";", "argMap", ".", "addMapEntryExpression", "(", "new", "ConstantExpression", "(", "pNode", ".", "getName", "(", ")", ")", ",", "new", "VariableExpression", "(", "pNode", ".", "getName", "(", ")", ")", ")", ";", "}", "final", "BlockStatement", "orderedBody", "=", "new", "BlockStatement", "(", ")", ";", "orderedBody", ".", "addStatement", "(", "new", "ExpressionStatement", "(", "new", "ConstructorCallExpression", "(", "ClassNode", ".", "THIS", ",", "new", "ArgumentListExpression", "(", "new", "CastExpression", "(", "HASHMAP_TYPE", ",", "argMap", ")", ")", ")", ")", ")", ";", "cNode", ".", "addConstructor", "(", "new", "ConstructorNode", "(", "ACC_PUBLIC", ",", "orderedParams", ",", "ClassNode", ".", "EMPTY_ARRAY", ",", "orderedBody", ")", ")", ";", "}", "private", "Statement", "createGetterBodyDefault", "(", "FieldNode", "fNode", ")", "{", "final", "Expression", "fieldExpr", "=", "new", "VariableExpression", "(", "fNode", ")", ";", "return", "new", "ExpressionStatement", "(", "fieldExpr", ")", ";", "}", "private", "Expression", "cloneCollectionExpr", "(", "Expression", "fieldExpr", ")", "{", "return", "new", "StaticMethodCallExpression", "(", "DGM_TYPE", ",", "\"asImmutable\"", ",", "fieldExpr", ")", ";", "}", "private", "Expression", "cloneArrayOrCloneableExpr", "(", "Expression", "fieldExpr", ")", "{", "return", "new", "MethodCallExpression", "(", "fieldExpr", ",", "\"clone\"", ",", "MethodCallExpression", ".", "NO_ARGUMENTS", ")", ";", "}", "private", "void", "createConstructorMapSpecial", "(", "ClassNode", "cNode", ",", "List", "<", "PropertyNode", ">", "list", ")", "{", "final", "BlockStatement", "body", "=", "new", "BlockStatement", "(", ")", ";", "body", ".", "addStatement", "(", "createConstructorStatementMapSpecial", "(", "list", ".", "get", "(", "0", ")", ".", "getField", "(", ")", ")", ")", ";", "createConstructorMapCommon", "(", "cNode", ",", "body", ")", ";", "}", "private", "void", "createConstructorMap", "(", "ClassNode", "cNode", ",", "List", "<", "PropertyNode", ">", "list", ")", "{", "final", "BlockStatement", "body", "=", "new", "BlockStatement", "(", ")", ";", "for", "(", "PropertyNode", "pNode", ":", "list", ")", "{", "body", ".", "addStatement", "(", "createConstructorStatement", "(", "cNode", ",", "pNode", ")", ")", ";", "}", "Expression", "checkArgs", "=", "new", "ArgumentListExpression", "(", "new", "VariableExpression", "(", "\"this\"", ")", ",", "new", "VariableExpression", "(", "\"args\"", ")", ")", ";", "body", ".", "addStatement", "(", "new", "ExpressionStatement", "(", "new", "StaticMethodCallExpression", "(", "SELF_TYPE", ",", "\"\"", ",", "checkArgs", ")", ")", ")", ";", "createConstructorMapCommon", "(", "cNode", ",", "body", ")", ";", "}", "private", "void", "createConstructorMapCommon", "(", "ClassNode", "cNode", ",", "BlockStatement", "body", ")", "{", "final", "List", "<", "FieldNode", ">", "fList", "=", "cNode", ".", "getFields", "(", ")", ";", "for", "(", "FieldNode", "fNode", ":", "fList", ")", "{", "if", "(", "fNode", ".", "isPublic", "(", ")", ")", "continue", ";", "if", "(", "cNode", ".", "getProperty", "(", "fNode", ".", "getName", "(", ")", ")", "!=", "null", ")", "continue", ";", "if", "(", "fNode", ".", "isFinal", "(", ")", "&&", "fNode", ".", "isStatic", "(", ")", ")", "continue", ";", "if", "(", "fNode", ".", "getName", "(", ")", ".", "contains", "(", "\"$\"", ")", ")", "continue", ";", "if", "(", "fNode", ".", "isFinal", "(", ")", "&&", "fNode", ".", "getInitialExpression", "(", ")", "!=", "null", ")", "body", ".", "addStatement", "(", "checkFinalArgNotOverridden", "(", "cNode", ",", "fNode", ")", ")", ";", "body", ".", "addStatement", "(", "createConstructorStatementDefault", "(", "fNode", ")", ")", ";", "}", "final", "Parameter", "[", "]", "params", "=", "new", "Parameter", "[", "]", "{", "new", "Parameter", "(", "HASHMAP_TYPE", ",", "\"args\"", ")", "}", ";", "cNode", ".", "addConstructor", "(", "new", "ConstructorNode", "(", "ACC_PUBLIC", ",", "params", ",", "ClassNode", ".", "EMPTY_ARRAY", ",", "new", "IfStatement", "(", "equalsNullExpr", "(", "new", "VariableExpression", "(", "\"args\"", ")", ")", ",", "new", "EmptyStatement", "(", ")", ",", "body", ")", ")", ")", ";", "}", "private", "Statement", "checkFinalArgNotOverridden", "(", "ClassNode", "cNode", ",", "FieldNode", "fNode", ")", "{", "final", "String", "name", "=", "fNode", ".", "getName", "(", ")", ";", "Expression", "value", "=", "findArg", "(", "name", ")", ";", "return", "new", "IfStatement", "(", "equalsNullExpr", "(", "value", ")", ",", "new", "EmptyStatement", "(", ")", ",", "new", "ThrowStatement", "(", "new", "ConstructorCallExpression", "(", "READONLYEXCEPTION_TYPE", ",", "new", "ArgumentListExpression", "(", "new", "ConstantExpression", "(", "name", ")", ",", "new", "ConstantExpression", "(", "cNode", ".", "getName", "(", ")", ")", ")", ")", ")", ")", ";", "}", "private", "Statement", "createConstructorStatementMapSpecial", "(", "FieldNode", "fNode", ")", "{", "final", "Expression", "fieldExpr", "=", "new", "VariableExpression", "(", "fNode", ")", ";", "Expression", "initExpr", "=", "fNode", ".", "getInitialValueExpression", "(", ")", ";", "if", "(", "initExpr", "==", "null", ")", "initExpr", "=", "ConstantExpression", ".", "NULL", ";", "Expression", "namedArgs", "=", "findArg", "(", "fNode", ".", "getName", "(", ")", ")", ";", "Expression", "baseArgs", "=", "new", "VariableExpression", "(", "\"args\"", ")", ";", "return", "new", "IfStatement", "(", "equalsNullExpr", "(", "baseArgs", ")", ",", "new", "IfStatement", "(", "equalsNullExpr", "(", "initExpr", ")", ",", "new", "EmptyStatement", "(", ")", ",", "assignStatement", "(", "fieldExpr", ",", "cloneCollectionExpr", "(", "initExpr", ")", ")", ")", ",", "new", "IfStatement", "(", "equalsNullExpr", "(", "namedArgs", ")", ",", "new", "IfStatement", "(", "isTrueExpr", "(", "new", "MethodCallExpression", "(", "baseArgs", ",", "\"containsKey\"", ",", "new", "ConstantExpression", "(", "fNode", ".", "getName", "(", ")", ")", ")", ")", ",", "assignStatement", "(", "fieldExpr", ",", "namedArgs", ")", ",", "assignStatement", "(", "fieldExpr", ",", "cloneCollectionExpr", "(", "baseArgs", ")", ")", ")", ",", "new", "IfStatement", "(", "isOneExpr", "(", "new", "MethodCallExpression", "(", "baseArgs", ",", "\"size\"", ",", "MethodCallExpression", ".", "NO_ARGUMENTS", ")", ")", ",", "assignStatement", "(", "fieldExpr", ",", "cloneCollectionExpr", "(", "namedArgs", ")", ")", ",", "assignStatement", "(", "fieldExpr", ",", "cloneCollectionExpr", "(", "baseArgs", ")", ")", ")", ")", ")", ";", "}", "private", "void", "ensureNotPublic", "(", "String", "cNode", ",", "FieldNode", "fNode", ")", "{", "String", "fName", "=", "fNode", ".", "getName", "(", ")", ";", "if", "(", "fNode", ".", "isPublic", "(", ")", "&&", "!", "fName", ".", "contains", "(", "\"$\"", ")", "&&", "!", "(", "fNode", ".", "isStatic", "(", ")", "&&", "fNode", ".", "isFinal", "(", ")", ")", ")", "{", "addError", "(", "\"\"", "+", "fName", "+", "\"\"", "+", "MY_TYPE_NAME", "+", "\"", "class", "'\"", "+", "cNode", "+", "\"'.\"", ",", "fNode", ")", ";", "}", "}", "private", "void", "addProperty", "(", "ClassNode", "cNode", ",", "PropertyNode", "pNode", ")", "{", "final", "FieldNode", "fn", "=", "pNode", ".", "getField", "(", ")", ";", "cNode", ".", "getFields", "(", ")", ".", "remove", "(", "fn", ")", ";", "cNode", ".", "addProperty", "(", "pNode", ".", "getName", "(", ")", ",", "pNode", ".", "getModifiers", "(", ")", "|", "ACC_FINAL", ",", "pNode", ".", "getType", "(", ")", ",", "pNode", ".", "getInitialExpression", "(", ")", ",", "pNode", ".", "getGetterBlock", "(", ")", ",", "pNode", ".", "getSetterBlock", "(", ")", ")", ";", "final", "FieldNode", "newfn", "=", "cNode", ".", "getField", "(", "fn", ".", "getName", "(", ")", ")", ";", "cNode", ".", "getFields", "(", ")", ".", "remove", "(", "newfn", ")", ";", "cNode", ".", "addField", "(", "fn", ")", ";", "}", "private", "boolean", "validateConstructors", "(", "ClassNode", "cNode", ")", "{", "if", "(", "cNode", "instanceof", "InnerClassNode", "&&", "Modifier", ".", "isStatic", "(", "cNode", ".", "getModifiers", "(", ")", ")", ")", "{", "List", "<", "ConstructorNode", ">", "constructors", "=", "cNode", ".", "getDeclaredConstructors", "(", ")", ";", "if", "(", "constructors", ".", "size", "(", ")", "==", "1", "&&", "constructors", ".", "get", "(", "0", ")", ".", "getCode", "(", ")", "==", "null", ")", "{", "constructors", ".", "remove", "(", "0", ")", ";", "}", "}", "if", "(", "cNode", ".", "getDeclaredConstructors", "(", ")", ".", "size", "(", ")", "!=", "0", ")", "{", "addError", "(", "\"\"", "+", "ImmutableASTTransformation", ".", "MY_TYPE_NAME", "+", "\"", "class:", "\"", "+", "cNode", ".", "getNameWithoutPackage", "(", ")", ",", "cNode", ".", "getDeclaredConstructors", "(", ")", ".", "get", "(", "0", ")", ")", ";", "}", "return", "true", ";", "}", "private", "Statement", "createConstructorStatement", "(", "ClassNode", "cNode", ",", "PropertyNode", "pNode", ")", "{", "FieldNode", "fNode", "=", "pNode", ".", "getField", "(", ")", ";", "final", "ClassNode", "fieldType", "=", "fNode", ".", "getType", "(", ")", ";", "Statement", "statement", "=", "null", ";", "if", "(", "fieldType", ".", "isArray", "(", ")", "||", "fieldType", ".", "implementsInterface", "(", "CLONEABLE_TYPE", ")", ")", "{", "statement", "=", "createConstructorStatementArrayOrCloneable", "(", "fNode", ")", ";", "}", "else", "if", "(", "fieldType", ".", "isDerivedFrom", "(", "DATE_TYPE", ")", ")", "{", "statement", "=", "createConstructorStatementDate", "(", "fNode", ")", ";", "}", "else", "if", "(", "isOrImplements", "(", "fieldType", ",", "COLLECTION_TYPE", ")", "||", "fieldType", ".", "isDerivedFrom", "(", "COLLECTION_TYPE", ")", "||", "isOrImplements", "(", "fieldType", ",", "MAP_TYPE", ")", "||", "fieldType", ".", "isDerivedFrom", "(", "MAP_TYPE", ")", ")", "{", "statement", "=", "createConstructorStatementCollection", "(", "fNode", ")", ";", "}", "else", "if", "(", "isKnownImmutable", "(", "fieldType", ")", ")", "{", "statement", "=", "createConstructorStatementDefault", "(", "fNode", ")", ";", "}", "else", "if", "(", "fieldType", ".", "isResolved", "(", ")", ")", "{", "addError", "(", "createErrorMessage", "(", "cNode", ".", "getName", "(", ")", ",", "fNode", ".", "getName", "(", ")", ",", "fieldType", ".", "getName", "(", ")", ",", "\"compiling\"", ")", ",", "fNode", ")", ";", "}", "else", "{", "statement", "=", "createConstructorStatementGuarded", "(", "cNode", ",", "fNode", ")", ";", "}", "return", "statement", ";", "}", "private", "Statement", "createConstructorStatementGuarded", "(", "ClassNode", "cNode", ",", "FieldNode", "fNode", ")", "{", "final", "Expression", "fieldExpr", "=", "new", "VariableExpression", "(", "fNode", ")", ";", "Expression", "initExpr", "=", "fNode", ".", "getInitialValueExpression", "(", ")", ";", "if", "(", "initExpr", "==", "null", ")", "initExpr", "=", "ConstantExpression", ".", "NULL", ";", "Expression", "unknown", "=", "findArg", "(", "fNode", ".", "getName", "(", ")", ")", ";", "return", "new", "IfStatement", "(", "equalsNullExpr", "(", "unknown", ")", ",", "new", "IfStatement", "(", "equalsNullExpr", "(", "initExpr", ")", ",", "new", "EmptyStatement", "(", ")", ",", "assignStatement", "(", "fieldExpr", ",", "checkUnresolved", "(", "cNode", ",", "fNode", ",", "initExpr", ")", ")", ")", ",", "assignStatement", "(", "fieldExpr", ",", "checkUnresolved", "(", "cNode", ",", "fNode", ",", "unknown", ")", ")", ")", ";", "}", "private", "Expression", "checkUnresolved", "(", "ClassNode", "cNode", ",", "FieldNode", "fNode", ",", "Expression", "value", ")", "{", "Expression", "args", "=", "new", "TupleExpression", "(", "new", "ConstantExpression", "(", "cNode", ".", "getName", "(", ")", ")", ",", "new", "ConstantExpression", "(", "fNode", ".", "getName", "(", ")", ")", ",", "value", ")", ";", "return", "new", "StaticMethodCallExpression", "(", "SELF_TYPE", ",", "\"\"", ",", "args", ")", ";", "}", "private", "Statement", "createConstructorStatementCollection", "(", "FieldNode", "fNode", ")", "{", "final", "Expression", "fieldExpr", "=", "new", "VariableExpression", "(", "fNode", ")", ";", "Expression", "initExpr", "=", "fNode", ".", "getInitialValueExpression", "(", ")", ";", "if", "(", "initExpr", "==", "null", ")", "initExpr", "=", "ConstantExpression", ".", "NULL", ";", "Expression", "collection", "=", "findArg", "(", "fNode", ".", "getName", "(", ")", ")", ";", "return", "new", "IfStatement", "(", "equalsNullExpr", "(", "collection", ")", ",", "new", "IfStatement", "(", "equalsNullExpr", "(", "initExpr", ")", ",", "new", "EmptyStatement", "(", ")", ",", "assignStatement", "(", "fieldExpr", ",", "cloneCollectionExpr", "(", "initExpr", ")", ")", ")", ",", "new", "IfStatement", "(", "isInstanceOf", "(", "collection", ",", "CLONEABLE_TYPE", ")", ",", "assignStatement", "(", "fieldExpr", ",", "cloneCollectionExpr", "(", "cloneArrayOrCloneableExpr", "(", "collection", ")", ")", ")", ",", "assignStatement", "(", "fieldExpr", ",", "cloneCollectionExpr", "(", "collection", ")", ")", ")", ")", ";", "}", "private", "boolean", "isKnownImmutable", "(", "ClassNode", "fieldType", ")", "{", "if", "(", "!", "fieldType", ".", "isResolved", "(", ")", ")", "return", "false", ";", "String", "s", "=", "fieldType", ".", "getName", "(", ")", ";", "return", "fieldType", ".", "isPrimitive", "(", ")", "||", "fieldType", ".", "isEnum", "(", ")", "||", "inImmutableList", "(", "fieldType", ".", "getName", "(", ")", ")", ";", "}", "private", "static", "boolean", "inImmutableList", "(", "String", "typeName", ")", "{", "return", "immutableList", ".", "contains", "(", "typeName", ")", ";", "}", "private", "Statement", "createConstructorStatementArrayOrCloneable", "(", "FieldNode", "fNode", ")", "{", "final", "Expression", "fieldExpr", "=", "new", "VariableExpression", "(", "fNode", ")", ";", "Expression", "initExpr", "=", "fNode", ".", "getInitialValueExpression", "(", ")", ";", "if", "(", "initExpr", "==", "null", ")", "initExpr", "=", "ConstantExpression", ".", "NULL", ";", "final", "Expression", "array", "=", "findArg", "(", "fNode", ".", "getName", "(", ")", ")", ";", "return", "new", "IfStatement", "(", "equalsNullExpr", "(", "array", ")", ",", "new", "IfStatement", "(", "equalsNullExpr", "(", "initExpr", ")", ",", "assignStatement", "(", "fieldExpr", ",", "ConstantExpression", ".", "NULL", ")", ",", "assignStatement", "(", "fieldExpr", ",", "cloneArrayOrCloneableExpr", "(", "initExpr", ")", ")", ")", ",", "assignStatement", "(", "fieldExpr", ",", "cloneArrayOrCloneableExpr", "(", "array", ")", ")", ")", ";", "}", "private", "Statement", "createConstructorStatementDate", "(", "FieldNode", "fNode", ")", "{", "final", "Expression", "fieldExpr", "=", "new", "VariableExpression", "(", "fNode", ")", ";", "Expression", "initExpr", "=", "fNode", ".", "getInitialValueExpression", "(", ")", ";", "if", "(", "initExpr", "==", "null", ")", "initExpr", "=", "ConstantExpression", ".", "NULL", ";", "final", "Expression", "date", "=", "findArg", "(", "fNode", ".", "getName", "(", ")", ")", ";", "return", "new", "IfStatement", "(", "equalsNullExpr", "(", "date", ")", ",", "new", "IfStatement", "(", "equalsNullExpr", "(", "initExpr", ")", ",", "assignStatement", "(", "fieldExpr", ",", "ConstantExpression", ".", "NULL", ")", ",", "assignStatement", "(", "fieldExpr", ",", "cloneDateExpr", "(", "initExpr", ")", ")", ")", ",", "assignStatement", "(", "fieldExpr", ",", "cloneDateExpr", "(", "date", ")", ")", ")", ";", "}", "private", "Expression", "cloneDateExpr", "(", "Expression", "origDate", ")", "{", "return", "new", "ConstructorCallExpression", "(", "DATE_TYPE", ",", "new", "MethodCallExpression", "(", "origDate", ",", "\"getTime\"", ",", "MethodCallExpression", ".", "NO_ARGUMENTS", ")", ")", ";", "}", "private", "void", "adjustPropertyForImmutability", "(", "PropertyNode", "pNode", ",", "List", "<", "PropertyNode", ">", "newNodes", ")", "{", "final", "FieldNode", "fNode", "=", "pNode", ".", "getField", "(", ")", ";", "fNode", ".", "setModifiers", "(", "(", "pNode", ".", "getModifiers", "(", ")", "&", "(", "~", "ACC_PUBLIC", ")", ")", "|", "ACC_FINAL", "|", "ACC_PRIVATE", ")", ";", "adjustPropertyNode", "(", "pNode", ",", "createGetterBody", "(", "fNode", ")", ")", ";", "newNodes", ".", "add", "(", "pNode", ")", ";", "}", "private", "void", "adjustPropertyNode", "(", "PropertyNode", "pNode", ",", "Statement", "getterBody", ")", "{", "pNode", ".", "setSetterBlock", "(", "null", ")", ";", "pNode", ".", "setGetterBlock", "(", "getterBody", ")", ";", "}", "private", "Statement", "createGetterBody", "(", "FieldNode", "fNode", ")", "{", "BlockStatement", "body", "=", "new", "BlockStatement", "(", ")", ";", "final", "ClassNode", "fieldType", "=", "fNode", ".", "getType", "(", ")", ";", "final", "Statement", "statement", ";", "if", "(", "fieldType", ".", "isArray", "(", ")", "||", "fieldType", ".", "implementsInterface", "(", "CLONEABLE_TYPE", ")", ")", "{", "statement", "=", "createGetterBodyArrayOrCloneable", "(", "fNode", ")", ";", "}", "else", "if", "(", "fieldType", ".", "isDerivedFrom", "(", "DATE_TYPE", ")", ")", "{", "statement", "=", "createGetterBodyDate", "(", "fNode", ")", ";", "}", "else", "{", "statement", "=", "createGetterBodyDefault", "(", "fNode", ")", ";", "}", "body", ".", "addStatement", "(", "statement", ")", ";", "return", "body", ";", "}", "private", "static", "String", "createErrorMessage", "(", "String", "className", ",", "String", "fieldName", ",", "String", "typeName", ",", "String", "mode", ")", "{", "return", "MY_TYPE_NAME", "+", "\"\"", "+", "fieldName", "+", "\"'", "of", "type", "'\"", "+", "prettyTypeName", "(", "typeName", ")", "+", "\"'", "while", "\"", "+", "mode", "+", "\"", "class", "\"", "+", "className", "+", "\".n\"", "+", "MY_TYPE_NAME", "+", "\"\"", "+", "\"\"", "+", "\"-", "other", "\"", "+", "MY_TYPE_NAME", "+", "\"\"", "+", "\"\"", "+", "\"\"", "+", "MY_TYPE_NAME", "+", "\"\"", ";", "}", "private", "static", "String", "prettyTypeName", "(", "String", "name", ")", "{", "return", "name", ".", "equals", "(", "\"\"", ")", "?", "name", "+", "\"", "or", "def\"", ":", "name", ";", "}", "private", "Statement", "createGetterBodyArrayOrCloneable", "(", "FieldNode", "fNode", ")", "{", "final", "Expression", "fieldExpr", "=", "new", "VariableExpression", "(", "fNode", ")", ";", "final", "Expression", "expression", "=", "cloneArrayOrCloneableExpr", "(", "fieldExpr", ")", ";", "return", "safeExpression", "(", "fieldExpr", ",", "expression", ")", ";", "}", "private", "Statement", "createGetterBodyDate", "(", "FieldNode", "fNode", ")", "{", "final", "Expression", "fieldExpr", "=", "new", "VariableExpression", "(", "fNode", ")", ";", "final", "Expression", "expression", "=", "cloneDateExpr", "(", "fieldExpr", ")", ";", "return", "safeExpression", "(", "fieldExpr", ",", "expression", ")", ";", "}", "@", "SuppressWarnings", "(", "\"Unchecked\"", ")", "public", "static", "Object", "checkImmutable", "(", "String", "className", ",", "String", "fieldName", ",", "Object", "field", ")", "{", "if", "(", "field", "==", "null", "||", "field", "instanceof", "Enum", "||", "inImmutableList", "(", "field", ".", "getClass", "(", ")", ".", "getName", "(", ")", ")", ")", "return", "field", ";", "if", "(", "field", "instanceof", "Collection", ")", "return", "DefaultGroovyMethods", ".", "asImmutable", "(", "(", "Collection", ")", "field", ")", ";", "if", "(", "field", ".", "getClass", "(", ")", ".", "getAnnotation", "(", "MY_CLASS", ")", "!=", "null", ")", "return", "field", ";", "final", "String", "typeName", "=", "field", ".", "getClass", "(", ")", ".", "getName", "(", ")", ";", "throw", "new", "RuntimeException", "(", "createErrorMessage", "(", "className", ",", "fieldName", ",", "typeName", ",", "\"constructing\"", ")", ")", ";", "}", "public", "static", "void", "checkPropNames", "(", "Object", "instance", ",", "Map", "<", "String", ",", "Object", ">", "args", ")", "{", "final", "MetaClass", "metaClass", "=", "InvokerHelper", ".", "getMetaClass", "(", "instance", ")", ";", "for", "(", "String", "k", ":", "args", ".", "keySet", "(", ")", ")", "{", "if", "(", "metaClass", ".", "hasProperty", "(", "instance", ",", "k", ")", "==", "null", ")", "throw", "new", "MissingPropertyException", "(", "k", ",", "instance", ".", "getClass", "(", ")", ")", ";", "}", "}", "}", "</s>" ]
6,658
[ "<s>", "package", "org", ".", "codehaus", ".", "groovy", ".", "transform", ";", "import", "groovy", ".", "lang", ".", "GroovyObject", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "GroovyBugError", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "*", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "expr", ".", "*", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "stmt", ".", "ExpressionStatement", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "stmt", ".", "ReturnStatement", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "classgen", ".", "Verifier", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "control", ".", "CompilePhase", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "control", ".", "SourceUnit", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "control", ".", "messages", ".", "SyntaxErrorMessage", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "syntax", ".", "SyntaxException", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "syntax", ".", "Token", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "syntax", ".", "Types", ";", "import", "org", ".", "objectweb", ".", "asm", ".", "Opcodes", ";", "import", "java", ".", "lang", ".", "reflect", ".", "Modifier", ";", "import", "java", ".", "util", ".", "ArrayList", ";", "import", "java", ".", "util", ".", "Arrays", ";", "import", "java", ".", "util", ".", "List", ";", "import", "java", ".", "util", ".", "Set", ";", "@", "GroovyASTTransformation", "(", "phase", "=", "CompilePhase", ".", "CANONICALIZATION", ")", "public", "class", "DelegateASTTransformation", "implements", "ASTTransformation", ",", "Opcodes", "{", "private", "static", "final", "ClassNode", "DEPRECATED_TYPE", "=", "ClassHelper", ".", "make", "(", "Deprecated", ".", "class", ")", ";", "private", "static", "final", "ClassNode", "GROOVYOBJECT_TYPE", "=", "ClassHelper", ".", "make", "(", "GroovyObject", ".", "class", ")", ";", "public", "void", "visit", "(", "ASTNode", "[", "]", "nodes", ",", "SourceUnit", "source", ")", "{", "if", "(", "nodes", ".", "length", "!=", "2", "||", "!", "(", "nodes", "[", "0", "]", "instanceof", "AnnotationNode", ")", "||", "!", "(", "nodes", "[", "1", "]", "instanceof", "AnnotatedNode", ")", ")", "{", "throw", "new", "GroovyBugError", "(", "\"\"", "+", "Arrays", ".", "asList", "(", "nodes", ")", ")", ";", "}", "AnnotatedNode", "parent", "=", "(", "AnnotatedNode", ")", "nodes", "[", "1", "]", ";", "AnnotationNode", "node", "=", "(", "AnnotationNode", ")", "nodes", "[", "0", "]", ";", "if", "(", "parent", "instanceof", "FieldNode", ")", "{", "FieldNode", "fieldNode", "=", "(", "FieldNode", ")", "parent", ";", "final", "ClassNode", "type", "=", "fieldNode", ".", "getType", "(", ")", ";", "final", "ClassNode", "owner", "=", "fieldNode", ".", "getOwner", "(", ")", ";", "if", "(", "type", ".", "equals", "(", "ClassHelper", ".", "OBJECT_TYPE", ")", "||", "type", ".", "equals", "(", "GROOVYOBJECT_TYPE", ")", ")", "{", "addError", "(", "\"\"", "+", "fieldNode", ".", "getName", "(", ")", "+", "\"\"", "+", "type", ".", "getName", "(", ")", "+", "\"\"", ",", "parent", ",", "source", ")", ";", "return", ";", "}", "if", "(", "type", ".", "equals", "(", "owner", ")", ")", "{", "addError", "(", "\"\"", "+", "fieldNode", ".", "getName", "(", ")", "+", "\"\"", "+", "type", ".", "getName", "(", ")", "+", "\"\"", ",", "parent", ",", "source", ")", ";", "return", ";", "}", "final", "List", "<", "MethodNode", ">", "fieldMethods", "=", "getAllMethods", "(", "type", ")", ";", "for", "(", "ClassNode", "next", ":", "type", ".", "getAllInterfaces", "(", ")", ")", "{", "fieldMethods", ".", "addAll", "(", "getAllMethods", "(", "next", ")", ")", ";", "}", "final", "Expression", "deprecatedElement", "=", "node", ".", "getMember", "(", "\"deprecated\"", ")", ";", "final", "boolean", "deprecated", "=", "hasBooleanValue", "(", "deprecatedElement", ",", "true", ")", ";", "final", "List", "<", "MethodNode", ">", "ownerMethods", "=", "getAllMethods", "(", "owner", ")", ";", "for", "(", "MethodNode", "mn", ":", "fieldMethods", ")", "{", "addDelegateMethod", "(", "fieldNode", ",", "owner", ",", "ownerMethods", ",", "mn", ",", "deprecated", ")", ";", "}", "for", "(", "PropertyNode", "prop", ":", "type", ".", "getProperties", "(", ")", ")", "{", "if", "(", "prop", ".", "isStatic", "(", ")", "||", "!", "prop", ".", "isPublic", "(", ")", ")", "continue", ";", "String", "name", "=", "prop", ".", "getName", "(", ")", ";", "addGetterIfNeeded", "(", "fieldNode", ",", "owner", ",", "prop", ",", "name", ")", ";", "addSetterIfNeeded", "(", "fieldNode", ",", "owner", ",", "prop", ",", "name", ")", ";", "}", "final", "Expression", "interfacesElement", "=", "node", ".", "getMember", "(", "\"interfaces\"", ")", ";", "if", "(", "hasBooleanValue", "(", "interfacesElement", ",", "false", ")", ")", "return", ";", "final", "Set", "<", "ClassNode", ">", "allInterfaces", "=", "type", ".", "getAllInterfaces", "(", ")", ";", "final", "Set", "<", "ClassNode", ">", "ownerIfaces", "=", "owner", ".", "getAllInterfaces", "(", ")", ";", "for", "(", "ClassNode", "iface", ":", "allInterfaces", ")", "{", "if", "(", "Modifier", ".", "isPublic", "(", "iface", ".", "getModifiers", "(", ")", ")", "&&", "!", "ownerIfaces", ".", "contains", "(", "iface", ")", ")", "{", "final", "ClassNode", "[", "]", "ifaces", "=", "owner", ".", "getInterfaces", "(", ")", ";", "final", "ClassNode", "[", "]", "newIfaces", "=", "new", "ClassNode", "[", "ifaces", ".", "length", "+", "1", "]", ";", "System", ".", "arraycopy", "(", "ifaces", ",", "0", ",", "newIfaces", ",", "0", ",", "ifaces", ".", "length", ")", ";", "newIfaces", "[", "ifaces", ".", "length", "]", "=", "iface", ";", "owner", ".", "setInterfaces", "(", "newIfaces", ")", ";", "}", "}", "}", "}", "private", "List", "<", "MethodNode", ">", "getAllMethods", "(", "ClassNode", "type", ")", "{", "ClassNode", "node", "=", "type", ";", "List", "<", "MethodNode", ">", "result", "=", "new", "ArrayList", "<", "MethodNode", ">", "(", ")", ";", "while", "(", "node", "!=", "null", ")", "{", "result", ".", "addAll", "(", "node", ".", "getMethods", "(", ")", ")", ";", "node", "=", "node", ".", "getSuperClass", "(", ")", ";", "}", "return", "result", ";", "}", "private", "boolean", "hasBooleanValue", "(", "Expression", "expression", ",", "boolean", "bool", ")", "{", "return", "expression", "instanceof", "ConstantExpression", "&&", "(", "(", "ConstantExpression", ")", "expression", ")", ".", "getValue", "(", ")", ".", "equals", "(", "bool", ")", ";", "}", "private", "void", "addSetterIfNeeded", "(", "FieldNode", "fieldNode", ",", "ClassNode", "owner", ",", "PropertyNode", "prop", ",", "String", "name", ")", "{", "String", "setterName", "=", "\"set\"", "+", "Verifier", ".", "capitalize", "(", "name", ")", ";", "if", "(", "(", "prop", ".", "getModifiers", "(", ")", "&", "ACC_FINAL", ")", "==", "0", "&&", "owner", ".", "getSetterMethod", "(", "setterName", ")", "==", "null", ")", "{", "owner", ".", "addMethod", "(", "setterName", ",", "ACC_PUBLIC", ",", "ClassHelper", ".", "VOID_TYPE", ",", "new", "Parameter", "[", "]", "{", "new", "Parameter", "(", "nonGeneric", "(", "prop", ".", "getType", "(", ")", ")", ",", "\"value\"", ")", "}", ",", "null", ",", "new", "ExpressionStatement", "(", "new", "BinaryExpression", "(", "new", "PropertyExpression", "(", "new", "VariableExpression", "(", "fieldNode", ")", ",", "name", ")", ",", "Token", ".", "newSymbol", "(", "Types", ".", "EQUAL", ",", "-", "1", ",", "-", "1", ")", ",", "new", "VariableExpression", "(", "\"value\"", ")", ")", ")", ")", ";", "}", "}", "private", "void", "addGetterIfNeeded", "(", "FieldNode", "fieldNode", ",", "ClassNode", "owner", ",", "PropertyNode", "prop", ",", "String", "name", ")", "{", "String", "getterName", "=", "\"get\"", "+", "Verifier", ".", "capitalize", "(", "name", ")", ";", "if", "(", "owner", ".", "getGetterMethod", "(", "getterName", ")", "==", "null", ")", "{", "owner", ".", "addMethod", "(", "getterName", ",", "ACC_PUBLIC", ",", "nonGeneric", "(", "prop", ".", "getType", "(", ")", ")", ",", "Parameter", ".", "EMPTY_ARRAY", ",", "null", ",", "new", "ReturnStatement", "(", "new", "PropertyExpression", "(", "new", "VariableExpression", "(", "fieldNode", ")", ",", "name", ")", ")", ")", ";", "}", "}", "private", "void", "addDelegateMethod", "(", "FieldNode", "fieldNode", ",", "ClassNode", "owner", ",", "List", "<", "MethodNode", ">", "ownMethods", ",", "MethodNode", "candidate", ",", "boolean", "deprecated", ")", "{", "if", "(", "!", "candidate", ".", "isPublic", "(", ")", "||", "candidate", ".", "isStatic", "(", ")", "||", "0", "!=", "(", "candidate", ".", "getModifiers", "(", ")", "&", "Opcodes", ".", "ACC_SYNTHETIC", ")", ")", "return", ";", "if", "(", "!", "candidate", ".", "getAnnotations", "(", "DEPRECATED_TYPE", ")", ".", "isEmpty", "(", ")", "&&", "!", "deprecated", ")", "return", ";", "for", "(", "MethodNode", "mn", ":", "GROOVYOBJECT_TYPE", ".", "getMethods", "(", ")", ")", "{", "if", "(", "mn", ".", "getTypeDescriptor", "(", ")", ".", "equals", "(", "candidate", ".", "getTypeDescriptor", "(", ")", ")", ")", "{", "return", ";", "}", "}", "for", "(", "MethodNode", "mn", ":", "owner", ".", "getMethods", "(", ")", ")", "{", "if", "(", "mn", ".", "getTypeDescriptor", "(", ")", ".", "equals", "(", "candidate", ".", "getTypeDescriptor", "(", ")", ")", ")", "{", "return", ";", "}", "}", "MethodNode", "existingNode", "=", "null", ";", "for", "(", "MethodNode", "mn", ":", "ownMethods", ")", "{", "if", "(", "mn", ".", "getTypeDescriptor", "(", ")", ".", "equals", "(", "candidate", ".", "getTypeDescriptor", "(", ")", ")", "&&", "!", "mn", ".", "isAbstract", "(", ")", "&&", "!", "mn", ".", "isStatic", "(", ")", ")", "{", "existingNode", "=", "mn", ";", "break", ";", "}", "}", "if", "(", "existingNode", "==", "null", "||", "existingNode", ".", "getCode", "(", ")", "==", "null", ")", "{", "final", "ArgumentListExpression", "args", "=", "new", "ArgumentListExpression", "(", ")", ";", "final", "Parameter", "[", "]", "params", "=", "candidate", ".", "getParameters", "(", ")", ";", "final", "Parameter", "[", "]", "newParams", "=", "new", "Parameter", "[", "params", ".", "length", "]", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "newParams", ".", "length", ";", "i", "++", ")", "{", "Parameter", "newParam", "=", "new", "Parameter", "(", "nonGeneric", "(", "params", "[", "i", "]", ".", "getType", "(", ")", ")", ",", "params", "[", "i", "]", ".", "getName", "(", ")", ")", ";", "newParam", ".", "setInitialExpression", "(", "params", "[", "i", "]", ".", "getInitialExpression", "(", ")", ")", ";", "newParams", "[", "i", "]", "=", "newParam", ";", "args", ".", "addExpression", "(", "new", "VariableExpression", "(", "newParam", ")", ")", ";", "}", "MethodNode", "newMethod", "=", "owner", ".", "addMethod", "(", "candidate", ".", "getName", "(", ")", ",", "candidate", ".", "getModifiers", "(", ")", "&", "(", "~", "ACC_ABSTRACT", ")", "&", "(", "~", "ACC_NATIVE", ")", ",", "nonGeneric", "(", "candidate", ".", "getReturnType", "(", ")", ")", ",", "newParams", ",", "candidate", ".", "getExceptions", "(", ")", ",", "new", "ExpressionStatement", "(", "new", "MethodCallExpression", "(", "new", "VariableExpression", "(", "fieldNode", ")", ",", "candidate", ".", "getName", "(", ")", ",", "args", ")", ")", ")", ";", "newMethod", ".", "setGenericsTypes", "(", "candidate", ".", "getGenericsTypes", "(", ")", ")", ";", "}", "}", "private", "ClassNode", "nonGeneric", "(", "ClassNode", "type", ")", "{", "if", "(", "type", ".", "isUsingGenerics", "(", ")", ")", "{", "final", "ClassNode", "nonGen", "=", "ClassHelper", ".", "makeWithoutCaching", "(", "type", ".", "getName", "(", ")", ")", ";", "nonGen", ".", "setRedirect", "(", "type", ")", ";", "nonGen", ".", "setGenericsTypes", "(", "null", ")", ";", "nonGen", ".", "setUsingGenerics", "(", "false", ")", ";", "return", "nonGen", ";", "}", "else", "if", "(", "type", ".", "isArray", "(", ")", "&&", "type", ".", "getComponentType", "(", ")", ".", "isUsingGenerics", "(", ")", ")", "{", "return", "type", ".", "getComponentType", "(", ")", ".", "getPlainNodeReference", "(", ")", ".", "makeArray", "(", ")", ";", "}", "else", "{", "return", "type", ";", "}", "}", "public", "void", "addError", "(", "String", "msg", ",", "ASTNode", "expr", ",", "SourceUnit", "source", ")", "{", "int", "line", "=", "expr", ".", "getLineNumber", "(", ")", ";", "int", "col", "=", "expr", ".", "getColumnNumber", "(", ")", ";", "source", ".", "getErrorCollector", "(", ")", ".", "addErrorAndContinue", "(", "new", "SyntaxErrorMessage", "(", "new", "SyntaxException", "(", "msg", "+", "'\\n'", ",", "line", ",", "col", ")", ",", "source", ")", ")", ";", "}", "}", "</s>" ]
6,659
[ "<s>", "package", "org", ".", "codehaus", ".", "groovy", ".", "transform", ";", "import", "groovy", ".", "lang", ".", "GroovyClassLoader", ";", "import", "java", ".", "io", ".", "BufferedReader", ";", "import", "java", ".", "io", ".", "IOException", ";", "import", "java", ".", "io", ".", "InputStream", ";", "import", "java", ".", "io", ".", "InputStreamReader", ";", "import", "java", ".", "net", ".", "URL", ";", "import", "java", ".", "util", ".", "ArrayList", ";", "import", "java", ".", "util", ".", "Collection", ";", "import", "java", ".", "util", ".", "Enumeration", ";", "import", "java", ".", "util", ".", "HashMap", ";", "import", "java", ".", "util", ".", "HashSet", ";", "import", "java", ".", "util", ".", "Iterator", ";", "import", "java", ".", "util", ".", "LinkedHashMap", ";", "import", "java", ".", "util", ".", "LinkedList", ";", "import", "java", ".", "util", ".", "List", ";", "import", "java", ".", "util", ".", "Map", ";", "import", "java", ".", "util", ".", "Set", ";", "import", "java", ".", "util", ".", "StringTokenizer", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "GroovyException", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "ASTNode", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "AnnotatedNode", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "AnnotationNode", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "ClassCodeVisitorSupport", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "ClassNode", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "classgen", ".", "GeneratorContext", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "control", ".", "CompilationFailedException", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "control", ".", "CompilationUnit", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "control", ".", "CompilePhase", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "control", ".", "Phases", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "control", ".", "SourceUnit", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "control", ".", "messages", ".", "SimpleMessage", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "control", ".", "messages", ".", "SyntaxErrorMessage", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "control", ".", "messages", ".", "WarningMessage", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "GroovyLogManager", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "TraceCategory", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "syntax", ".", "SyntaxException", ";", "public", "final", "class", "ASTTransformationVisitor", "extends", "ClassCodeVisitorSupport", "{", "private", "CompilePhase", "phase", ";", "private", "SourceUnit", "source", ";", "private", "List", "<", "ASTNode", "[", "]", ">", "targetNodes", ";", "private", "Map", "<", "ASTNode", ",", "List", "<", "ASTTransformation", ">", ">", "transforms", ";", "private", "Map", "<", "Class", "<", "?", "extends", "ASTTransformation", ">", ",", "ASTTransformation", ">", "transformInstances", ";", "private", "static", "CompilationUnit", "compUnit", ";", "private", "static", "Set", "<", "String", ">", "globalTransformNames", "=", "new", "HashSet", "<", "String", ">", "(", ")", ";", "private", "ASTTransformationVisitor", "(", "CompilePhase", "phase", ")", "{", "this", ".", "phase", "=", "phase", ";", "}", "protected", "SourceUnit", "getSourceUnit", "(", ")", "{", "return", "source", ";", "}", "public", "void", "visitClass", "(", "ClassNode", "classNode", ")", "{", "Map", "<", "Class", "<", "?", "extends", "ASTTransformation", ">", ",", "Set", "<", "ASTNode", ">", ">", "baseTransforms", "=", "classNode", ".", "getTransforms", "(", "phase", ")", ";", "if", "(", "!", "baseTransforms", ".", "isEmpty", "(", ")", ")", "{", "transformInstances", "=", "new", "HashMap", "<", "Class", "<", "?", "extends", "ASTTransformation", ">", ",", "ASTTransformation", ">", "(", ")", ";", "for", "(", "Class", "<", "?", "extends", "ASTTransformation", ">", "transformClass", ":", "baseTransforms", ".", "keySet", "(", ")", ")", "{", "try", "{", "transformInstances", ".", "put", "(", "transformClass", ",", "transformClass", ".", "newInstance", "(", ")", ")", ";", "}", "catch", "(", "InstantiationException", "e", ")", "{", "source", ".", "getErrorCollector", "(", ")", ".", "addError", "(", "new", "SimpleMessage", "(", "\"\"", "+", "transformClass", ",", "source", ")", ")", ";", "}", "catch", "(", "IllegalAccessException", "e", ")", "{", "source", ".", "getErrorCollector", "(", ")", ".", "addError", "(", "new", "SimpleMessage", "(", "\"\"", "+", "transformClass", ",", "source", ")", ")", ";", "}", "}", "transforms", "=", "new", "HashMap", "<", "ASTNode", ",", "List", "<", "ASTTransformation", ">", ">", "(", ")", ";", "for", "(", "Map", ".", "Entry", "<", "Class", "<", "?", "extends", "ASTTransformation", ">", ",", "Set", "<", "ASTNode", ">", ">", "entry", ":", "baseTransforms", ".", "entrySet", "(", ")", ")", "{", "for", "(", "ASTNode", "node", ":", "entry", ".", "getValue", "(", ")", ")", "{", "List", "<", "ASTTransformation", ">", "list", "=", "transforms", ".", "get", "(", "node", ")", ";", "if", "(", "list", "==", "null", ")", "{", "list", "=", "new", "ArrayList", "<", "ASTTransformation", ">", "(", ")", ";", "transforms", ".", "put", "(", "node", ",", "list", ")", ";", "}", "list", ".", "add", "(", "transformInstances", ".", "get", "(", "entry", ".", "getKey", "(", ")", ")", ")", ";", "}", "}", "targetNodes", "=", "new", "LinkedList", "<", "ASTNode", "[", "]", ">", "(", ")", ";", "super", ".", "visitClass", "(", "classNode", ")", ";", "for", "(", "ASTNode", "[", "]", "node", ":", "targetNodes", ")", "{", "for", "(", "ASTTransformation", "snt", ":", "transforms", ".", "get", "(", "node", "[", "0", "]", ")", ")", "{", "try", "{", "long", "stime", "=", "System", ".", "nanoTime", "(", ")", ";", "boolean", "okToSet", "=", "source", "!=", "null", "&&", "source", ".", "getErrorCollector", "(", ")", "!=", "null", ";", "try", "{", "if", "(", "okToSet", ")", "{", "source", ".", "getErrorCollector", "(", ")", ".", "transformActive", "=", "true", ";", "}", "snt", ".", "visit", "(", "node", ",", "source", ")", ";", "}", "finally", "{", "if", "(", "okToSet", ")", "{", "source", ".", "getErrorCollector", "(", ")", ".", "transformActive", "=", "false", ";", "}", "}", "long", "etime", "=", "System", ".", "nanoTime", "(", ")", ";", "if", "(", "GroovyLogManager", ".", "manager", ".", "hasLoggers", "(", ")", ")", "{", "try", "{", "GroovyLogManager", ".", "manager", ".", "log", "(", "TraceCategory", ".", "AST_TRANSFORM", ",", "\"\"", "+", "snt", ".", "getClass", "(", ")", ".", "getName", "(", ")", "+", "\"", "on", "\"", "+", "classNode", ".", "getName", "(", ")", "+", "\":\"", "+", "node", "[", "1", "]", "+", "\"", "=", "\"", "+", "(", "(", "etime", "-", "stime", ")", "/", "1000000", ")", "+", "\"ms\"", ")", ";", "}", "catch", "(", "Throwable", "t", ")", "{", "t", ".", "printStackTrace", "(", ")", ";", "}", "}", "}", "catch", "(", "NoClassDefFoundError", "ncdfe", ")", "{", "String", "transformName", "=", "snt", ".", "getClass", "(", ")", ".", "getName", "(", ")", ";", "StringBuilder", "sb", "=", "new", "StringBuilder", "(", ")", ";", "sb", ".", "append", "(", "\"\"", "+", "transformName", "+", "\"\"", "+", "ncdfe", ".", "getMessage", "(", ")", ")", ";", "sb", ".", "append", "(", "\"\"", ")", ";", "source", ".", "addError", "(", "new", "SyntaxException", "(", "sb", ".", "toString", "(", ")", ",", "ncdfe", ",", "0", ",", "0", ")", ")", ";", "}", "}", "}", "}", "}", "public", "void", "visitAnnotations", "(", "AnnotatedNode", "node", ")", "{", "super", ".", "visitAnnotations", "(", "node", ")", ";", "for", "(", "AnnotationNode", "annotation", ":", "node", ".", "getAnnotations", "(", ")", ")", "{", "if", "(", "transforms", ".", "containsKey", "(", "annotation", ")", ")", "{", "targetNodes", ".", "add", "(", "new", "ASTNode", "[", "]", "{", "annotation", ",", "node", "}", ")", ";", "}", "}", "}", "public", "static", "void", "addPhaseOperations", "(", "final", "CompilationUnit", "compilationUnit", ")", "{", "addGlobalTransforms", "(", "compilationUnit", ")", ";", "if", "(", "!", "compilationUnit", ".", "allowTransforms", "&&", "compilationUnit", ".", "localTransformsToRunOnReconcile", ".", "size", "(", ")", "==", "0", ")", "{", "return", ";", "}", "compilationUnit", ".", "addPhaseOperation", "(", "new", "CompilationUnit", ".", "PrimaryClassNodeOperation", "(", ")", "{", "public", "void", "call", "(", "SourceUnit", "source", ",", "GeneratorContext", "context", ",", "ClassNode", "classNode", ")", "throws", "CompilationFailedException", "{", "ASTTransformationCollectorCodeVisitor", "collector", "=", "new", "ASTTransformationCollectorCodeVisitor", "(", "source", ",", "compilationUnit", ".", "getTransformLoader", "(", ")", ",", "compilationUnit", ".", "allowTransforms", ",", "compilationUnit", ".", "localTransformsToRunOnReconcile", ")", ";", "collector", ".", "visitClass", "(", "classNode", ")", ";", "}", "}", ",", "Phases", ".", "SEMANTIC_ANALYSIS", ")", ";", "for", "(", "CompilePhase", "phase", ":", "CompilePhase", ".", "values", "(", ")", ")", "{", "final", "ASTTransformationVisitor", "visitor", "=", "new", "ASTTransformationVisitor", "(", "phase", ")", ";", "switch", "(", "phase", ")", "{", "case", "INITIALIZATION", ":", "case", "PARSING", ":", "case", "CONVERSION", ":", "break", ";", "default", ":", "compilationUnit", ".", "addPhaseOperation", "(", "new", "CompilationUnit", ".", "PrimaryClassNodeOperation", "(", ")", "{", "public", "void", "call", "(", "SourceUnit", "source", ",", "GeneratorContext", "context", ",", "ClassNode", "classNode", ")", "throws", "CompilationFailedException", "{", "visitor", ".", "source", "=", "source", ";", "visitor", ".", "visitClass", "(", "classNode", ")", ";", "}", "}", ",", "phase", ".", "getPhaseNumber", "(", ")", ")", ";", "break", ";", "}", "}", "}", "public", "static", "void", "addGlobalTransformsAfterGrab", "(", ")", "{", "doAddGlobalTransforms", "(", "compUnit", ",", "false", ")", ";", "}", "public", "static", "void", "addGlobalTransforms", "(", "CompilationUnit", "compilationUnit", ")", "{", "compUnit", "=", "compilationUnit", ";", "doAddGlobalTransforms", "(", "compilationUnit", ",", "true", ")", ";", "}", "private", "static", "void", "doAddGlobalTransforms", "(", "CompilationUnit", "compilationUnit", ",", "boolean", "isFirstScan", ")", "{", "ensurelobalTransformsAllowedInReconcileInitialized", "(", ")", ";", "GroovyClassLoader", "transformLoader", "=", "compilationUnit", ".", "getTransformLoader", "(", ")", ";", "Map", "<", "String", ",", "URL", ">", "transformNames", "=", "new", "LinkedHashMap", "<", "String", ",", "URL", ">", "(", ")", ";", "try", "{", "Enumeration", "<", "URL", ">", "globalServices", "=", "transformLoader", ".", "getResources", "(", "\"\"", ")", ";", "while", "(", "globalServices", ".", "hasMoreElements", "(", ")", ")", "{", "URL", "service", "=", "globalServices", ".", "nextElement", "(", ")", ";", "String", "className", ";", "InputStream", "is", "=", "service", ".", "openStream", "(", ")", ";", "BufferedReader", "svcIn", "=", "new", "BufferedReader", "(", "new", "InputStreamReader", "(", "is", ")", ")", ";", "try", "{", "className", "=", "svcIn", ".", "readLine", "(", ")", ";", "}", "catch", "(", "IOException", "ioe", ")", "{", "compilationUnit", ".", "getErrorCollector", "(", ")", ".", "addError", "(", "new", "SimpleMessage", "(", "\"\"", "+", "service", ".", "toExternalForm", "(", ")", "+", "\"\"", "+", "ioe", ".", "toString", "(", ")", ",", "null", ")", ")", ";", "continue", ";", "}", "while", "(", "className", "!=", "null", ")", "{", "if", "(", "!", "className", ".", "startsWith", "(", "\"#\"", ")", "&&", "className", ".", "length", "(", ")", ">", "0", ")", "{", "if", "(", "transformNames", ".", "containsKey", "(", "className", ")", ")", "{", "if", "(", "!", "service", ".", "equals", "(", "transformNames", ".", "get", "(", "className", ")", ")", ")", "{", "compilationUnit", ".", "getErrorCollector", "(", ")", ".", "addWarning", "(", "WarningMessage", ".", "POSSIBLE_ERRORS", ",", "\"\"", "+", "className", "+", "\"\"", "+", "transformNames", ".", "get", "(", "className", ")", ".", "toExternalForm", "(", ")", "+", "\"", "and", "\"", "+", "service", ".", "toExternalForm", "(", ")", "+", "\"\"", ",", "null", ",", "null", ")", ";", "}", "}", "else", "{", "if", "(", "compilationUnit", ".", "allowTransforms", "||", "globalTransformsAllowedInReconcile", ".", "contains", "(", "className", ")", ")", "{", "transformNames", ".", "put", "(", "className", ",", "service", ")", ";", "}", "}", "}", "try", "{", "className", "=", "svcIn", ".", "readLine", "(", ")", ";", "}", "catch", "(", "IOException", "ioe", ")", "{", "compilationUnit", ".", "getErrorCollector", "(", ")", ".", "addError", "(", "new", "SimpleMessage", "(", "\"\"", "+", "service", ".", "toExternalForm", "(", ")", "+", "\"\"", "+", "ioe", ".", "toString", "(", ")", ",", "null", ")", ")", ";", "continue", ";", "}", "}", "is", ".", "close", "(", ")", ";", "}", "}", "catch", "(", "IOException", "e", ")", "{", "compilationUnit", ".", "getErrorCollector", "(", ")", ".", "addError", "(", "new", "SimpleMessage", "(", "\"\"", "+", "e", ".", "getMessage", "(", ")", ",", "null", ")", ")", ";", "}", "try", "{", "Class", ".", "forName", "(", "\"\"", ")", ";", "}", "catch", "(", "Exception", "e", ")", "{", "StringBuffer", "sb", "=", "new", "StringBuffer", "(", ")", ";", "sb", ".", "append", "(", "\"\"", ")", ";", "sb", ".", "append", "(", "\"\"", ")", ";", "for", "(", "Map", ".", "Entry", "<", "String", ",", "URL", ">", "entry", ":", "transformNames", ".", "entrySet", "(", ")", ")", "{", "sb", ".", "append", "(", "'\\t'", ")", ";", "sb", ".", "append", "(", "entry", ".", "getKey", "(", ")", ")", ";", "sb", ".", "append", "(", "'\\n'", ")", ";", "}", "compilationUnit", ".", "getErrorCollector", "(", ")", ".", "addWarning", "(", "new", "WarningMessage", "(", "WarningMessage", ".", "POSSIBLE_ERRORS", ",", "sb", ".", "toString", "(", ")", ",", "null", ",", "null", ")", ")", ";", "return", ";", "}", "if", "(", "isFirstScan", ")", "{", "for", "(", "Map", ".", "Entry", "<", "String", ",", "URL", ">", "entry", ":", "transformNames", ".", "entrySet", "(", ")", ")", "{", "globalTransformNames", ".", "add", "(", "entry", ".", "getKey", "(", ")", ")", ";", "}", "addPhaseOperationsForGlobalTransforms", "(", "compilationUnit", ",", "transformNames", ",", "isFirstScan", ")", ";", "}", "else", "{", "Iterator", "<", "Map", ".", "Entry", "<", "String", ",", "URL", ">", ">", "it", "=", "transformNames", ".", "entrySet", "(", ")", ".", "iterator", "(", ")", ";", "while", "(", "it", ".", "hasNext", "(", ")", ")", "{", "Map", ".", "Entry", "<", "String", ",", "URL", ">", "entry", "=", "it", ".", "next", "(", ")", ";", "if", "(", "!", "globalTransformNames", ".", "add", "(", "entry", ".", "getKey", "(", ")", ")", ")", "{", "it", ".", "remove", "(", ")", ";", "}", "}", "addPhaseOperationsForGlobalTransforms", "(", "compilationUnit", ",", "transformNames", ",", "isFirstScan", ")", ";", "}", "}", "private", "static", "List", "<", "String", ">", "globalTransformsAllowedInReconcile", "=", "null", ";", "private", "static", "void", "ensurelobalTransformsAllowedInReconcileInitialized", "(", ")", "{", "if", "(", "globalTransformsAllowedInReconcile", "==", "null", ")", "{", "globalTransformsAllowedInReconcile", "=", "new", "ArrayList", "<", "String", ">", "(", ")", ";", "try", "{", "String", "s", "=", "System", ".", "getProperty", "(", "\"\"", ",", "\"\"", ")", ";", "StringTokenizer", "st", "=", "new", "StringTokenizer", "(", "s", ",", "\",\"", ")", ";", "while", "(", "st", ".", "hasMoreElements", "(", ")", ")", "{", "String", "classname", "=", "st", ".", "nextToken", "(", ")", ";", "globalTransformsAllowedInReconcile", ".", "add", "(", "classname", ")", ";", "}", "}", "catch", "(", "Exception", "e", ")", "{", "}", "globalTransformsAllowedInReconcile", ".", "add", "(", "\"\"", ")", ";", "}", "}", "private", "static", "void", "addPhaseOperationsForGlobalTransforms", "(", "CompilationUnit", "compilationUnit", ",", "Map", "<", "String", ",", "URL", ">", "transformNames", ",", "boolean", "isFirstScan", ")", "{", "GroovyClassLoader", "transformLoader", "=", "compilationUnit", ".", "getTransformLoader", "(", ")", ";", "for", "(", "Map", ".", "Entry", "<", "String", ",", "URL", ">", "entry", ":", "transformNames", ".", "entrySet", "(", ")", ")", "{", "try", "{", "Class", "gTransClass", "=", "transformLoader", ".", "loadClass", "(", "entry", ".", "getKey", "(", ")", ",", "false", ",", "true", ",", "false", ")", ";", "GroovyASTTransformation", "transformAnnotation", "=", "(", "GroovyASTTransformation", ")", "gTransClass", ".", "getAnnotation", "(", "GroovyASTTransformation", ".", "class", ")", ";", "if", "(", "transformAnnotation", "==", "null", ")", "{", "compilationUnit", ".", "getErrorCollector", "(", ")", ".", "addWarning", "(", "new", "WarningMessage", "(", "WarningMessage", ".", "POSSIBLE_ERRORS", ",", "\"\"", "+", "entry", ".", "getKey", "(", ")", "+", "\"\"", "+", "entry", ".", "getValue", "(", ")", ".", "toExternalForm", "(", ")", "+", "\"\"", "+", "GroovyASTTransformation", ".", "class", ".", "getName", "(", ")", "+", "\"\"", ",", "null", ",", "null", ")", ")", ";", "continue", ";", "}", "if", "(", "ASTTransformation", ".", "class", ".", "isAssignableFrom", "(", "gTransClass", ")", ")", "{", "try", "{", "final", "ASTTransformation", "instance", "=", "(", "ASTTransformation", ")", "gTransClass", ".", "newInstance", "(", ")", ";", "CompilationUnit", ".", "SourceUnitOperation", "suOp", "=", "new", "CompilationUnit", ".", "SourceUnitOperation", "(", ")", "{", "private", "boolean", "isBuggered", "=", "false", ";", "public", "void", "call", "(", "SourceUnit", "source", ")", "throws", "CompilationFailedException", "{", "if", "(", "isBuggered", ")", "return", ";", "try", "{", "long", "stime", "=", "System", ".", "nanoTime", "(", ")", ";", "boolean", "okToSet", "=", "source", "!=", "null", "&&", "source", ".", "getErrorCollector", "(", ")", "!=", "null", ";", "try", "{", "if", "(", "okToSet", ")", "{", "source", ".", "getErrorCollector", "(", ")", ".", "transformActive", "=", "true", ";", "}", "instance", ".", "visit", "(", "new", "ASTNode", "[", "]", "{", "source", ".", "getAST", "(", ")", "}", ",", "source", ")", ";", "}", "finally", "{", "if", "(", "okToSet", ")", "{", "source", ".", "getErrorCollector", "(", ")", ".", "transformActive", "=", "false", ";", "}", "}", "long", "etime", "=", "System", ".", "nanoTime", "(", ")", ";", "if", "(", "GroovyLogManager", ".", "manager", ".", "hasLoggers", "(", ")", ")", "{", "long", "timetaken", "=", "(", "etime", "-", "stime", ")", "/", "1000000", ";", "if", "(", "timetaken", ">", "0", ")", "{", "try", "{", "GroovyLogManager", ".", "manager", ".", "log", "(", "TraceCategory", ".", "AST_TRANSFORM", ",", "\"\"", "+", "instance", ".", "getClass", "(", ")", ".", "getName", "(", ")", "+", "\"", "on", "\"", "+", "source", ".", "getName", "(", ")", "+", "\"", "=", "\"", "+", "timetaken", "+", "\"ms\"", ")", ";", "}", "catch", "(", "Throwable", "t", ")", "{", "t", ".", "printStackTrace", "(", ")", ";", "}", "}", "}", "}", "catch", "(", "NoClassDefFoundError", "ncdfe", ")", "{", "new", "RuntimeException", "(", "\"Transform", "\"", "+", "instance", ".", "toString", "(", ")", "+", "\"\"", ",", "ncdfe", ")", ".", "printStackTrace", "(", ")", ";", "source", ".", "addException", "(", "new", "GroovyException", "(", "\"Transform", "\"", "+", "instance", ".", "toString", "(", ")", "+", "\"\"", ",", "ncdfe", ")", ")", ";", "isBuggered", "=", "true", ";", "}", "}", "}", ";", "if", "(", "isFirstScan", ")", "{", "compilationUnit", ".", "addPhaseOperation", "(", "suOp", ",", "transformAnnotation", ".", "phase", "(", ")", ".", "getPhaseNumber", "(", ")", ")", ";", "}", "else", "{", "compilationUnit", ".", "addNewPhaseOperation", "(", "suOp", ",", "transformAnnotation", ".", "phase", "(", ")", ".", "getPhaseNumber", "(", ")", ")", ";", "}", "}", "catch", "(", "Throwable", "t", ")", "{", "compilationUnit", ".", "getErrorCollector", "(", ")", ".", "addError", "(", "new", "SimpleMessage", "(", "\"\"", "+", "t", ".", "getMessage", "(", ")", ",", "null", ")", ")", ";", "t", ".", "printStackTrace", "(", ")", ";", "}", "}", "else", "{", "compilationUnit", ".", "getErrorCollector", "(", ")", ".", "addError", "(", "new", "SimpleMessage", "(", "\"\"", "+", "entry", ".", "getKey", "(", ")", "+", "\"\"", "+", "entry", ".", "getValue", "(", ")", ".", "toExternalForm", "(", ")", "+", "\"\"", ",", "null", ")", ")", ";", "}", "}", "catch", "(", "Exception", "e", ")", "{", "compilationUnit", ".", "getErrorCollector", "(", ")", ".", "addError", "(", "new", "SimpleMessage", "(", "\"\"", "+", "entry", ".", "getKey", "(", ")", "+", "\"\"", "+", "entry", ".", "getValue", "(", ")", ".", "toExternalForm", "(", ")", "+", "\"\"", "+", "e", ".", "toString", "(", ")", ",", "null", ")", ")", ";", "}", "}", "}", "}", "</s>" ]
6,660
[ "<s>", "package", "org", ".", "codehaus", ".", "groovy", ".", "transform", ";", "import", "groovy", ".", "lang", ".", "GroovyClassLoader", ";", "import", "java", ".", "lang", ".", "annotation", ".", "Annotation", ";", "import", "java", ".", "lang", ".", "reflect", ".", "Method", ";", "import", "java", ".", "util", ".", "ArrayList", ";", "import", "java", ".", "util", ".", "Collections", ";", "import", "java", ".", "util", ".", "List", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "AnnotatedNode", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "AnnotationNode", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "ClassCodeVisitorSupport", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "ClassNode", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "expr", ".", "ClassExpression", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "expr", ".", "ConstantExpression", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "expr", ".", "Expression", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "expr", ".", "ListExpression", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "control", ".", "CompilePhase", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "control", ".", "SourceUnit", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "control", ".", "messages", ".", "SimpleMessage", ";", "public", "class", "ASTTransformationCollectorCodeVisitor", "extends", "ClassCodeVisitorSupport", "{", "private", "SourceUnit", "source", ";", "private", "ClassNode", "classNode", ";", "private", "GroovyClassLoader", "transformLoader", ";", "private", "boolean", "allowTransforms", ";", "private", "List", "<", "String", ">", "localTransformsAllowed", ";", "public", "ASTTransformationCollectorCodeVisitor", "(", "SourceUnit", "source", ",", "GroovyClassLoader", "transformLoader", ",", "boolean", "allowTransforms", ",", "List", "<", "String", ">", "localTransformsAllowed", ")", "{", "this", "(", "source", ",", "transformLoader", ")", ";", "this", ".", "allowTransforms", "=", "allowTransforms", ";", "this", ".", "localTransformsAllowed", "=", "localTransformsAllowed", ";", "}", "public", "ASTTransformationCollectorCodeVisitor", "(", "SourceUnit", "source", ",", "GroovyClassLoader", "transformLoader", ")", "{", "this", ".", "source", "=", "source", ";", "this", ".", "transformLoader", "=", "transformLoader", ";", "}", "protected", "SourceUnit", "getSourceUnit", "(", ")", "{", "return", "source", ";", "}", "public", "void", "visitClass", "(", "ClassNode", "klassNode", ")", "{", "ClassNode", "oldClass", "=", "classNode", ";", "classNode", "=", "klassNode", ";", "super", ".", "visitClass", "(", "classNode", ")", ";", "classNode", "=", "oldClass", ";", "}", "private", "final", "static", "String", "[", "]", "NONE", "=", "new", "String", "[", "0", "]", ";", "private", "final", "static", "Class", "[", "]", "NO_CLASSES", "=", "new", "Class", "[", "0", "]", ";", "private", "String", "[", "]", "getTransformClassNames", "(", "ClassNode", "cn", ")", "{", "if", "(", "!", "cn", ".", "hasClass", "(", ")", ")", "{", "List", "<", "AnnotationNode", ">", "annotations", "=", "cn", ".", "getAnnotations", "(", ")", ";", "AnnotationNode", "transformAnnotation", "=", "null", ";", "for", "(", "AnnotationNode", "anno", ":", "annotations", ")", "{", "if", "(", "anno", ".", "getClassNode", "(", ")", ".", "getName", "(", ")", ".", "equals", "(", "GroovyASTTransformationClass", ".", "class", ".", "getName", "(", ")", ")", ")", "{", "transformAnnotation", "=", "anno", ";", "break", ";", "}", "}", "if", "(", "transformAnnotation", "!=", "null", ")", "{", "Expression", "expr2", "=", "transformAnnotation", ".", "getMember", "(", "\"value\"", ")", ";", "String", "[", "]", "values", "=", "null", ";", "if", "(", "expr2", "==", "null", ")", "{", "return", "NONE", ";", "}", "if", "(", "expr2", "instanceof", "ListExpression", ")", "{", "ListExpression", "expression", "=", "(", "ListExpression", ")", "expr2", ";", "List", "<", "Expression", ">", "expressions", "=", "expression", ".", "getExpressions", "(", ")", ";", "values", "=", "new", "String", "[", "expressions", ".", "size", "(", ")", "]", ";", "int", "e", "=", "0", ";", "for", "(", "Expression", "expr", ":", "expressions", ")", "{", "values", "[", "e", "++", "]", "=", "(", "(", "ConstantExpression", ")", "expr", ")", ".", "getText", "(", ")", ";", "}", "}", "else", "if", "(", "expr2", "instanceof", "ConstantExpression", ")", "{", "values", "=", "new", "String", "[", "1", "]", ";", "values", "[", "0", "]", "=", "(", "(", "ConstantExpression", ")", "expr2", ")", ".", "getText", "(", ")", ";", "}", "else", "{", "throw", "new", "IllegalStateException", "(", "\"\"", "+", "expr2", "+", "\"", "(class=\"", "+", "expr2", ".", "getClass", "(", ")", ".", "getName", "(", ")", "+", "\")\"", ")", ";", "}", "return", "values", ";", "}", "return", "null", ";", "}", "else", "{", "Annotation", "transformClassAnnotation", "=", "getTransformClassAnnotation", "(", "cn", ")", ";", "if", "(", "transformClassAnnotation", "==", "null", ")", "{", "return", "null", ";", "}", "return", "getTransformClassNames", "(", "transformClassAnnotation", ")", ";", "}", "}", "private", "Class", "[", "]", "getTransformClasses", "(", "ClassNode", "classNode", ")", "{", "if", "(", "!", "classNode", ".", "hasClass", "(", ")", ")", "{", "List", "<", "AnnotationNode", ">", "annotations", "=", "classNode", ".", "getAnnotations", "(", ")", ";", "AnnotationNode", "transformAnnotation", "=", "null", ";", "for", "(", "AnnotationNode", "anno", ":", "annotations", ")", "{", "if", "(", "anno", ".", "getClassNode", "(", ")", ".", "getName", "(", ")", ".", "equals", "(", "GroovyASTTransformationClass", ".", "class", ".", "getName", "(", ")", ")", ")", "{", "transformAnnotation", "=", "anno", ";", "break", ";", "}", "}", "if", "(", "transformAnnotation", "!=", "null", ")", "{", "Expression", "expr", "=", "(", "Expression", ")", "transformAnnotation", ".", "getMember", "(", "\"classes\"", ")", ";", "if", "(", "expr", "==", "null", ")", "{", "return", "NO_CLASSES", ";", "}", "Class", "<", "?", ">", "[", "]", "values", "=", "NO_CLASSES", ";", "if", "(", "expr", "instanceof", "ListExpression", ")", "{", "List", "<", "Class", "<", "?", ">", ">", "loadedClasses", "=", "new", "ArrayList", "<", "Class", "<", "?", ">", ">", "(", ")", ";", "ListExpression", "expression", "=", "(", "ListExpression", ")", "expr", ";", "List", "<", "Expression", ">", "expressions", "=", "expression", ".", "getExpressions", "(", ")", ";", "for", "(", "Expression", "oneExpr", ":", "expressions", ")", "{", "String", "classname", "=", "(", "(", "ClassExpression", ")", "oneExpr", ")", ".", "getType", "(", ")", ".", "getName", "(", ")", ";", "try", "{", "Class", "<", "?", ">", "clazz", "=", "Class", ".", "forName", "(", "classname", ",", "false", ",", "transformLoader", ")", ";", "loadedClasses", ".", "add", "(", "clazz", ")", ";", "}", "catch", "(", "ClassNotFoundException", "cnfe", ")", "{", "source", ".", "getErrorCollector", "(", ")", ".", "addError", "(", "new", "SimpleMessage", "(", "\"\"", "+", "classname", ",", "source", ")", ")", ";", "}", "}", "if", "(", "loadedClasses", ".", "size", "(", ")", "!=", "0", ")", "{", "values", "=", "loadedClasses", ".", "toArray", "(", "new", "Class", "<", "?", ">", "[", "loadedClasses", ".", "size", "(", ")", "]", ")", ";", "}", "return", "values", ";", "}", "else", "{", "}", "throw", "new", "RuntimeException", "(", "\"\"", "+", "expr", "+", "\"", "(class=\"", "+", "expr", ".", "getClass", "(", ")", "+", "\")\"", ")", ";", "}", "return", "null", ";", "}", "else", "{", "Annotation", "transformClassAnnotation", "=", "getTransformClassAnnotation", "(", "classNode", ")", ";", "if", "(", "transformClassAnnotation", "==", "null", ")", "{", "return", "null", ";", "}", "return", "getTransformClasses", "(", "transformClassAnnotation", ")", ";", "}", "}", "public", "void", "visitAnnotations", "(", "AnnotatedNode", "node", ")", "{", "super", ".", "visitAnnotations", "(", "node", ")", ";", "for", "(", "AnnotationNode", "annotation", ":", "node", ".", "getAnnotations", "(", ")", ")", "{", "String", "[", "]", "transformClassNames", "=", "getTransformClassNames", "(", "annotation", ".", "getClassNode", "(", ")", ")", ";", "Class", "[", "]", "transformClasses", "=", "getTransformClasses", "(", "annotation", ".", "getClassNode", "(", ")", ")", ";", "if", "(", "!", "this", ".", "allowTransforms", ")", "{", "transformClassNames", "=", "trimTransformNames", "(", "transformClassNames", ")", ";", "transformClasses", "=", "trimTransformClasses", "(", "transformClasses", ")", ";", "}", "if", "(", "transformClassNames", "==", "null", "&&", "transformClasses", "==", "null", ")", "{", "continue", ";", "}", "if", "(", "transformClassNames", "==", "null", ")", "{", "transformClassNames", "=", "NONE", ";", "}", "if", "(", "transformClasses", "==", "null", ")", "{", "transformClasses", "=", "NO_CLASSES", ";", "}", "addTransformsToClassNode", "(", "annotation", ",", "transformClassNames", ",", "transformClasses", ")", ";", "}", "}", "private", "String", "[", "]", "trimTransformNames", "(", "String", "[", "]", "names", ")", "{", "if", "(", "this", ".", "localTransformsAllowed", ".", "size", "(", ")", "==", "0", ")", "{", "return", "names", ";", "}", "if", "(", "names", "==", "null", ")", "{", "return", "NONE", ";", "}", "List", "<", "String", ">", "newnames", "=", "new", "ArrayList", "<", "String", ">", "(", ")", ";", "for", "(", "String", "name", ":", "names", ")", "{", "if", "(", "isAllowed", "(", "name", ")", ")", "{", "newnames", ".", "add", "(", "name", ")", ";", "}", "}", "if", "(", "newnames", ".", "size", "(", ")", "==", "names", ".", "length", ")", "{", "return", "names", ";", "}", "return", "newnames", ".", "toArray", "(", "new", "String", "[", "newnames", ".", "size", "(", ")", "]", ")", ";", "}", "private", "Class", "<", "?", ">", "[", "]", "trimTransformClasses", "(", "Class", "<", "?", ">", "[", "]", "names", ")", "{", "if", "(", "this", ".", "localTransformsAllowed", ".", "size", "(", ")", "==", "0", ")", "{", "return", "names", ";", "}", "if", "(", "names", "==", "null", ")", "{", "return", "NO_CLASSES", ";", "}", "List", "<", "Class", "<", "?", ">", ">", "newnames", "=", "new", "ArrayList", "<", "Class", "<", "?", ">", ">", "(", ")", ";", "for", "(", "Class", "<", "?", ">", "clazz", ":", "names", ")", "{", "String", "name", "=", "clazz", ".", "getSimpleName", "(", ")", ";", "if", "(", "isAllowed", "(", "name", ")", ")", "{", "newnames", ".", "add", "(", "clazz", ")", ";", "}", "}", "if", "(", "newnames", ".", "size", "(", ")", "==", "names", ".", "length", ")", "{", "return", "names", ";", "}", "return", "newnames", ".", "toArray", "(", "new", "Class", "[", "newnames", ".", "size", "(", ")", "]", ")", ";", "}", "private", "boolean", "isAllowed", "(", "String", "transformName", ")", "{", "for", "(", "String", "localTransformAllowed", ":", "localTransformsAllowed", ")", "{", "if", "(", "localTransformAllowed", ".", "equals", "(", "\"*\"", ")", ")", "{", "return", "true", ";", "}", "else", "if", "(", "localTransformAllowed", ".", "endsWith", "(", "\"$\"", ")", ")", "{", "if", "(", "transformName", ".", "endsWith", "(", "localTransformAllowed", ".", "substring", "(", "0", ",", "localTransformAllowed", ".", "length", "(", ")", "-", "1", ")", ")", ")", "{", "return", "true", ";", "}", "}", "else", "{", "boolean", "b", "=", "transformName", ".", "indexOf", "(", "localTransformAllowed", ")", "!=", "-", "1", ";", "if", "(", "b", ")", "{", "return", "true", ";", "}", "}", "}", "return", "false", ";", "}", "private", "void", "addTransformsToClassNode", "(", "AnnotationNode", "annotation", ",", "Annotation", "transformClassAnnotation", ")", "{", "String", "[", "]", "transformClassNames", "=", "getTransformClassNames", "(", "annotation", ".", "getClassNode", "(", ")", ")", ";", "Class", "[", "]", "transformClasses", "=", "getTransformClasses", "(", "transformClassAnnotation", ")", ";", "addTransformsToClassNode", "(", "annotation", ",", "transformClassNames", ",", "transformClasses", ")", ";", "}", "private", "void", "addTransformsToClassNode", "(", "AnnotationNode", "annotation", ",", "String", "[", "]", "transformClassNames", ",", "Class", "[", "]", "transformClasses", ")", "{", "if", "(", "transformClassNames", ".", "length", "==", "0", "&&", "transformClasses", ".", "length", "==", "0", ")", "{", "source", ".", "getErrorCollector", "(", ")", ".", "addError", "(", "new", "SimpleMessage", "(", "\"\"", "+", "annotation", ".", "getClassNode", "(", ")", ".", "getName", "(", ")", "+", "\"\"", ",", "source", ")", ")", ";", "}", "if", "(", "transformClassNames", ".", "length", ">", "0", "&&", "transformClasses", ".", "length", ">", "0", ")", "{", "source", ".", "getErrorCollector", "(", ")", ".", "addError", "(", "new", "SimpleMessage", "(", "\"\"", "+", "annotation", ".", "getClassNode", "(", ")", ".", "getName", "(", ")", "+", "\"\"", ",", "source", ")", ")", ";", "}", "for", "(", "String", "transformClass", ":", "transformClassNames", ")", "{", "try", "{", "Class", "klass", "=", "transformLoader", ".", "loadClass", "(", "transformClass", ",", "false", ",", "true", ",", "false", ")", ";", "verifyClassAndAddTransform", "(", "annotation", ",", "klass", ")", ";", "}", "catch", "(", "ClassNotFoundException", "e", ")", "{", "source", ".", "getErrorCollector", "(", ")", ".", "addErrorAndContinue", "(", "new", "SimpleMessage", "(", "\"\"", "+", "transformClass", "+", "\"\"", "+", "annotation", ".", "getClassNode", "(", ")", ".", "getName", "(", ")", ",", "source", ")", ")", ";", "}", "}", "for", "(", "Class", "klass", ":", "transformClasses", ")", "{", "verifyClassAndAddTransform", "(", "annotation", ",", "klass", ")", ";", "}", "}", "private", "void", "verifyClassAndAddTransform", "(", "AnnotationNode", "annotation", ",", "Class", "klass", ")", "{", "if", "(", "ASTTransformation", ".", "class", ".", "isAssignableFrom", "(", "klass", ")", ")", "{", "classNode", ".", "addTransform", "(", "klass", ",", "annotation", ")", ";", "}", "else", "{", "SimpleMessage", "sm", "=", "new", "SimpleMessage", "(", "\"\"", "+", "klass", ".", "getName", "(", ")", "+", "\"\"", "+", "annotation", ".", "getClassNode", "(", ")", ".", "getName", "(", ")", "+", "\":", "klass=\"", "+", "klass", "+", "\"\"", "+", "(", "klass", "==", "null", "?", "null", ":", "klass", ".", "getClassLoader", "(", ")", ")", "+", "\"\"", "+", "ASTTransformation", ".", "class", ".", "getClassLoader", "(", ")", ",", "source", ")", ";", "source", ".", "getErrorCollector", "(", ")", ".", "addError", "(", "sm", ")", ";", "}", "}", "private", "static", "Annotation", "getTransformClassAnnotation", "(", "ClassNode", "annotatedType", ")", "{", "if", "(", "!", "annotatedType", ".", "isResolved", "(", ")", ")", "return", "null", ";", "for", "(", "Annotation", "ann", ":", "annotatedType", ".", "getTypeClass", "(", ")", ".", "getAnnotations", "(", ")", ")", "{", "if", "(", "ann", ".", "annotationType", "(", ")", ".", "getName", "(", ")", ".", "equals", "(", "GroovyASTTransformationClass", ".", "class", ".", "getName", "(", ")", ")", ")", "{", "return", "ann", ";", "}", "}", "return", "null", ";", "}", "private", "String", "[", "]", "getTransformClassNames", "(", "Annotation", "transformClassAnnotation", ")", "{", "try", "{", "Method", "valueMethod", "=", "transformClassAnnotation", ".", "getClass", "(", ")", ".", "getMethod", "(", "\"value\"", ")", ";", "return", "(", "String", "[", "]", ")", "valueMethod", ".", "invoke", "(", "transformClassAnnotation", ")", ";", "}", "catch", "(", "Exception", "e", ")", "{", "source", ".", "addException", "(", "e", ")", ";", "return", "new", "String", "[", "0", "]", ";", "}", "}", "private", "Class", "[", "]", "getTransformClasses", "(", "Annotation", "transformClassAnnotation", ")", "{", "try", "{", "Method", "classesMethod", "=", "transformClassAnnotation", ".", "getClass", "(", ")", ".", "getMethod", "(", "\"classes\"", ")", ";", "return", "(", "Class", "[", "]", ")", "classesMethod", ".", "invoke", "(", "transformClassAnnotation", ")", ";", "}", "catch", "(", "Exception", "e", ")", "{", "source", ".", "addException", "(", "e", ")", ";", "return", "new", "Class", "[", "0", "]", ";", "}", "}", "}", "</s>" ]
6,661
[ "<s>", "package", "org", ".", "codehaus", ".", "groovy", ".", "vmplugin", ".", "v5", ";", "import", "java", ".", "lang", ".", "reflect", ".", "*", ";", "import", "java", ".", "lang", ".", "annotation", ".", "*", ";", "import", "java", ".", "util", ".", "List", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "GroovyBugError", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "vmplugin", ".", "VMPlugin", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "*", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "expr", ".", "*", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "stmt", ".", "ReturnStatement", ";", "public", "class", "Java5", "implements", "VMPlugin", "{", "private", "static", "Class", "[", "]", "EMPTY_CLASS_ARRAY", "=", "new", "Class", "[", "0", "]", ";", "private", "static", "final", "Class", "[", "]", "PLUGIN_DGM", "=", "{", "PluginDefaultGroovyMethods", ".", "class", "}", ";", "public", "void", "setAdditionalClassInformation", "(", "ClassNode", "cn", ")", "{", "setGenericsTypes", "(", "cn", ")", ";", "}", "private", "void", "setGenericsTypes", "(", "ClassNode", "cn", ")", "{", "TypeVariable", "[", "]", "tvs", "=", "cn", ".", "getTypeClass", "(", ")", ".", "getTypeParameters", "(", ")", ";", "GenericsType", "[", "]", "gts", "=", "configureTypeVariable", "(", "tvs", ")", ";", "cn", ".", "setGenericsTypes", "(", "gts", ")", ";", "}", "private", "GenericsType", "[", "]", "configureTypeVariable", "(", "TypeVariable", "[", "]", "tvs", ")", "{", "if", "(", "tvs", ".", "length", "==", "0", ")", "return", "null", ";", "GenericsType", "[", "]", "gts", "=", "new", "GenericsType", "[", "tvs", ".", "length", "]", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "tvs", ".", "length", ";", "i", "++", ")", "{", "gts", "[", "i", "]", "=", "configureTypeVariableDefinition", "(", "tvs", "[", "i", "]", ")", ";", "}", "return", "gts", ";", "}", "private", "GenericsType", "configureTypeVariableDefinition", "(", "TypeVariable", "tv", ")", "{", "ClassNode", "base", "=", "configureTypeVariableReference", "(", "tv", ")", ";", "ClassNode", "redirect", "=", "base", ".", "redirect", "(", ")", ";", "base", ".", "setRedirect", "(", "null", ")", ";", "Type", "[", "]", "tBounds", "=", "tv", ".", "getBounds", "(", ")", ";", "GenericsType", "gt", ";", "if", "(", "tBounds", ".", "length", "==", "0", ")", "{", "gt", "=", "new", "GenericsType", "(", "base", ")", ";", "}", "else", "{", "ClassNode", "[", "]", "cBounds", "=", "configureTypes", "(", "tBounds", ")", ";", "gt", "=", "new", "GenericsType", "(", "base", ",", "cBounds", ",", "null", ")", ";", "gt", ".", "setName", "(", "base", ".", "getName", "(", ")", ")", ";", "gt", ".", "setPlaceholder", "(", "true", ")", ";", "}", "base", ".", "setRedirect", "(", "redirect", ")", ";", "return", "gt", ";", "}", "private", "ClassNode", "[", "]", "configureTypes", "(", "Type", "[", "]", "types", ")", "{", "if", "(", "types", ".", "length", "==", "0", ")", "return", "null", ";", "ClassNode", "[", "]", "nodes", "=", "new", "ClassNode", "[", "types", ".", "length", "]", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "types", ".", "length", ";", "i", "++", ")", "{", "nodes", "[", "i", "]", "=", "configureType", "(", "types", "[", "i", "]", ")", ";", "}", "return", "nodes", ";", "}", "private", "ClassNode", "configureType", "(", "Type", "type", ")", "{", "if", "(", "type", "instanceof", "WildcardType", ")", "{", "return", "configureWildcardType", "(", "(", "WildcardType", ")", "type", ")", ";", "}", "else", "if", "(", "type", "instanceof", "ParameterizedType", ")", "{", "return", "configureParameterizedType", "(", "(", "ParameterizedType", ")", "type", ")", ";", "}", "else", "if", "(", "type", "instanceof", "GenericArrayType", ")", "{", "return", "configureGenericArray", "(", "(", "GenericArrayType", ")", "type", ")", ";", "}", "else", "if", "(", "type", "instanceof", "TypeVariable", ")", "{", "return", "configureTypeVariableReference", "(", "(", "TypeVariable", ")", "type", ")", ";", "}", "else", "if", "(", "type", "instanceof", "Class", ")", "{", "return", "configureClass", "(", "(", "Class", ")", "type", ")", ";", "}", "else", "if", "(", "type", "==", "null", ")", "{", "throw", "new", "GroovyBugError", "(", "\"\"", ")", ";", "}", "else", "{", "throw", "new", "GroovyBugError", "(", "\"\"", "+", "type", "+", "\"", ":=", "\"", "+", "type", ".", "getClass", "(", ")", ")", ";", "}", "}", "private", "ClassNode", "configureClass", "(", "Class", "c", ")", "{", "if", "(", "c", ".", "isPrimitive", "(", ")", ")", "{", "return", "ClassHelper", ".", "make", "(", "c", ")", ";", "}", "else", "{", "return", "ClassHelper", ".", "makeWithoutCaching", "(", "c", ",", "false", ")", ";", "}", "}", "private", "ClassNode", "configureGenericArray", "(", "GenericArrayType", "genericArrayType", ")", "{", "Type", "component", "=", "genericArrayType", ".", "getGenericComponentType", "(", ")", ";", "ClassNode", "node", "=", "configureType", "(", "component", ")", ";", "return", "node", ".", "makeArray", "(", ")", ";", "}", "private", "ClassNode", "configureWildcardType", "(", "WildcardType", "wildcardType", ")", "{", "ClassNode", "base", "=", "ClassHelper", ".", "makeWithoutCaching", "(", "\"?\"", ")", ";", "base", ".", "setRedirect", "(", "ClassHelper", ".", "OBJECT_TYPE", ")", ";", "ClassNode", "[", "]", "lowers", "=", "configureTypes", "(", "wildcardType", ".", "getLowerBounds", "(", ")", ")", ";", "ClassNode", "lower", "=", "null", ";", "if", "(", "lower", "!=", "null", ")", "lower", "=", "lowers", "[", "0", "]", ";", "ClassNode", "[", "]", "upper", "=", "configureTypes", "(", "wildcardType", ".", "getUpperBounds", "(", ")", ")", ";", "GenericsType", "t", "=", "new", "GenericsType", "(", "base", ",", "upper", ",", "lower", ")", ";", "t", ".", "setWildcard", "(", "true", ")", ";", "ClassNode", "ref", "=", "ClassHelper", ".", "makeWithoutCaching", "(", "Object", ".", "class", ",", "false", ")", ";", "ref", ".", "setGenericsTypes", "(", "new", "GenericsType", "[", "]", "{", "t", "}", ")", ";", "return", "ref", ";", "}", "private", "ClassNode", "configureParameterizedType", "(", "ParameterizedType", "parameterizedType", ")", "{", "ClassNode", "base", "=", "configureType", "(", "parameterizedType", ".", "getRawType", "(", ")", ")", ";", "GenericsType", "[", "]", "gts", "=", "configureTypeArguments", "(", "parameterizedType", ".", "getActualTypeArguments", "(", ")", ")", ";", "base", ".", "setGenericsTypes", "(", "gts", ")", ";", "return", "base", ";", "}", "private", "ClassNode", "configureTypeVariableReference", "(", "TypeVariable", "tv", ")", "{", "ClassNode", "cn", "=", "ClassHelper", ".", "makeWithoutCaching", "(", "tv", ".", "getName", "(", ")", ")", ";", "cn", ".", "setGenericsPlaceHolder", "(", "true", ")", ";", "ClassNode", "cn2", "=", "ClassHelper", ".", "makeWithoutCaching", "(", "tv", ".", "getName", "(", ")", ")", ";", "cn2", ".", "setGenericsPlaceHolder", "(", "true", ")", ";", "GenericsType", "[", "]", "gts", "=", "new", "GenericsType", "[", "]", "{", "new", "GenericsType", "(", "cn2", ")", "}", ";", "cn", ".", "setGenericsTypes", "(", "gts", ")", ";", "cn", ".", "setRedirect", "(", "ClassHelper", ".", "OBJECT_TYPE", ")", ";", "return", "cn", ";", "}", "private", "GenericsType", "[", "]", "configureTypeArguments", "(", "Type", "[", "]", "ta", ")", "{", "if", "(", "ta", ".", "length", "==", "0", ")", "return", "null", ";", "GenericsType", "[", "]", "gts", "=", "new", "GenericsType", "[", "ta", ".", "length", "]", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "ta", ".", "length", ";", "i", "++", ")", "{", "ClassNode", "t", "=", "configureType", "(", "ta", "[", "i", "]", ")", ";", "if", "(", "ta", "[", "i", "]", "instanceof", "WildcardType", ")", "{", "GenericsType", "[", "]", "gen", "=", "t", ".", "getGenericsTypes", "(", ")", ";", "gts", "[", "i", "]", "=", "gen", "[", "0", "]", ";", "}", "else", "{", "gts", "[", "i", "]", "=", "new", "GenericsType", "(", "t", ")", ";", "}", "}", "return", "gts", ";", "}", "public", "Class", "[", "]", "getPluginDefaultGroovyMethods", "(", ")", "{", "return", "PLUGIN_DGM", ";", "}", "public", "Class", "[", "]", "getPluginStaticGroovyMethods", "(", ")", "{", "return", "EMPTY_CLASS_ARRAY", ";", "}", "private", "void", "setAnnotationMetaData", "(", "Annotation", "[", "]", "annotations", ",", "AnnotatedNode", "an", ")", "{", "for", "(", "Annotation", "annotation", ":", "annotations", ")", "{", "AnnotationNode", "node", "=", "new", "AnnotationNode", "(", "ClassHelper", ".", "make", "(", "annotation", ".", "annotationType", "(", ")", ")", ")", ";", "configureAnnotation", "(", "node", ",", "annotation", ")", ";", "an", ".", "addAnnotation", "(", "node", ")", ";", "}", "}", "private", "void", "configureAnnotationFromDefinition", "(", "AnnotationNode", "definition", ",", "AnnotationNode", "root", ")", "{", "ClassNode", "type", "=", "definition", ".", "getClassNode", "(", ")", ";", "if", "(", "!", "type", ".", "isResolved", "(", ")", ")", "return", ";", "if", "(", "type", ".", "hasClass", "(", ")", ")", "{", "Class", "clazz", "=", "type", ".", "getTypeClass", "(", ")", ";", "if", "(", "clazz", "==", "Retention", ".", "class", ")", "{", "Expression", "exp", "=", "definition", ".", "getMember", "(", "\"value\"", ")", ";", "if", "(", "!", "(", "exp", "instanceof", "PropertyExpression", ")", ")", "return", ";", "PropertyExpression", "pe", "=", "(", "PropertyExpression", ")", "exp", ";", "String", "name", "=", "pe", ".", "getPropertyAsString", "(", ")", ";", "RetentionPolicy", "policy", "=", "RetentionPolicy", ".", "valueOf", "(", "name", ")", ";", "setRetentionPolicy", "(", "policy", ",", "root", ")", ";", "}", "else", "if", "(", "clazz", "==", "Target", ".", "class", ")", "{", "Expression", "exp", "=", "definition", ".", "getMember", "(", "\"value\"", ")", ";", "if", "(", "!", "(", "exp", "instanceof", "ListExpression", ")", ")", "return", ";", "ListExpression", "le", "=", "(", "ListExpression", ")", "exp", ";", "int", "bitmap", "=", "0", ";", "for", "(", "Expression", "e", ":", "le", ".", "getExpressions", "(", ")", ")", "{", "PropertyExpression", "element", "=", "(", "PropertyExpression", ")", "e", ";", "String", "name", "=", "element", ".", "getPropertyAsString", "(", ")", ";", "ElementType", "value", "=", "ElementType", ".", "valueOf", "(", "name", ")", ";", "bitmap", "|=", "getElementCode", "(", "value", ")", ";", "}", "root", ".", "setAllowedTargets", "(", "bitmap", ")", ";", "}", "}", "else", "{", "String", "typename", "=", "type", ".", "getName", "(", ")", ";", "if", "(", "typename", ".", "equals", "(", "\"\"", ")", ")", "{", "Expression", "exp", "=", "definition", ".", "getMember", "(", "\"value\"", ")", ";", "if", "(", "!", "(", "exp", "instanceof", "PropertyExpression", ")", ")", "return", ";", "PropertyExpression", "pe", "=", "(", "PropertyExpression", ")", "exp", ";", "String", "name", "=", "pe", ".", "getPropertyAsString", "(", ")", ";", "RetentionPolicy", "policy", "=", "RetentionPolicy", ".", "valueOf", "(", "name", ")", ";", "setRetentionPolicy", "(", "policy", ",", "root", ")", ";", "}", "else", "if", "(", "typename", ".", "equals", "(", "\"\"", ")", ")", "{", "Expression", "exp", "=", "definition", ".", "getMember", "(", "\"value\"", ")", ";", "if", "(", "!", "(", "exp", "instanceof", "ListExpression", ")", ")", "return", ";", "ListExpression", "le", "=", "(", "ListExpression", ")", "exp", ";", "int", "bitmap", "=", "0", ";", "for", "(", "Expression", "expression", ":", "le", ".", "getExpressions", "(", ")", ")", "{", "PropertyExpression", "element", "=", "(", "PropertyExpression", ")", "expression", ";", "String", "name", "=", "element", ".", "getPropertyAsString", "(", ")", ";", "ElementType", "value", "=", "ElementType", ".", "valueOf", "(", "name", ")", ";", "bitmap", "|=", "getElementCode", "(", "value", ")", ";", "}", "root", ".", "setAllowedTargets", "(", "bitmap", ")", ";", "}", "}", "}", "public", "void", "configureAnnotation", "(", "AnnotationNode", "node", ")", "{", "ClassNode", "type", "=", "node", ".", "getClassNode", "(", ")", ";", "List", "<", "AnnotationNode", ">", "annotations", "=", "type", ".", "getAnnotations", "(", ")", ";", "for", "(", "AnnotationNode", "an", ":", "annotations", ")", "{", "configureAnnotationFromDefinition", "(", "an", ",", "node", ")", ";", "}", "configureAnnotationFromDefinition", "(", "node", ",", "node", ")", ";", "}", "private", "void", "configureAnnotation", "(", "AnnotationNode", "node", ",", "Annotation", "annotation", ")", "{", "Class", "type", "=", "annotation", ".", "annotationType", "(", ")", ";", "if", "(", "type", "==", "Retention", ".", "class", ")", "{", "Retention", "r", "=", "(", "Retention", ")", "annotation", ";", "RetentionPolicy", "value", "=", "r", ".", "value", "(", ")", ";", "setRetentionPolicy", "(", "value", ",", "node", ")", ";", "node", ".", "setMember", "(", "\"value\"", ",", "new", "PropertyExpression", "(", "new", "ClassExpression", "(", "ClassHelper", ".", "makeWithoutCaching", "(", "RetentionPolicy", ".", "class", ",", "false", ")", ")", ",", "value", ".", "toString", "(", ")", ")", ")", ";", "}", "else", "if", "(", "type", "==", "Target", ".", "class", ")", "{", "Target", "t", "=", "(", "Target", ")", "annotation", ";", "ElementType", "[", "]", "elements", "=", "t", ".", "value", "(", ")", ";", "ListExpression", "elementExprs", "=", "new", "ListExpression", "(", ")", ";", "for", "(", "ElementType", "element", ":", "elements", ")", "{", "elementExprs", ".", "addExpression", "(", "new", "PropertyExpression", "(", "new", "ClassExpression", "(", "ClassHelper", ".", "ELEMENT_TYPE_TYPE", ")", ",", "element", ".", "name", "(", ")", ")", ")", ";", "}", "node", ".", "setMember", "(", "\"value\"", ",", "elementExprs", ")", ";", "}", "else", "{", "Method", "[", "]", "declaredMethods", "=", "type", ".", "getDeclaredMethods", "(", ")", ";", "for", "(", "Method", "declaredMethod", ":", "declaredMethods", ")", "{", "try", "{", "Object", "value", "=", "declaredMethod", ".", "invoke", "(", "annotation", ")", ";", "Expression", "valueExpression", "=", "annotationValueToExpression", "(", "value", ")", ";", "if", "(", "valueExpression", "==", "null", ")", "continue", ";", "node", ".", "setMember", "(", "declaredMethod", ".", "getName", "(", ")", ",", "valueExpression", ")", ";", "}", "catch", "(", "IllegalAccessException", "e", ")", "{", "}", "catch", "(", "InvocationTargetException", "e", ")", "{", "}", "}", "}", "}", "private", "Expression", "annotationValueToExpression", "(", "Object", "value", ")", "{", "if", "(", "value", "==", "null", "||", "value", "instanceof", "String", "||", "value", "instanceof", "Number", "||", "value", "instanceof", "Character", "||", "value", "instanceof", "Boolean", ")", "return", "new", "ConstantExpression", "(", "value", ")", ";", "if", "(", "value", "instanceof", "Class", ")", "return", "new", "ClassExpression", "(", "ClassHelper", ".", "makeWithoutCaching", "(", "(", "Class", ")", "value", ")", ")", ";", "if", "(", "value", ".", "getClass", "(", ")", ".", "isArray", "(", ")", ")", "{", "ListExpression", "elementExprs", "=", "new", "ListExpression", "(", ")", ";", "int", "len", "=", "Array", ".", "getLength", "(", "value", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "!=", "len", ";", "++", "i", ")", "elementExprs", ".", "addExpression", "(", "annotationValueToExpression", "(", "Array", ".", "get", "(", "value", ",", "i", ")", ")", ")", ";", "return", "elementExprs", ";", "}", "return", "null", ";", "}", "private", "void", "setRetentionPolicy", "(", "RetentionPolicy", "value", ",", "AnnotationNode", "node", ")", "{", "switch", "(", "value", ")", "{", "case", "RUNTIME", ":", "node", ".", "setRuntimeRetention", "(", "true", ")", ";", "break", ";", "case", "SOURCE", ":", "node", ".", "setSourceRetention", "(", "true", ")", ";", "break", ";", "case", "CLASS", ":", "node", ".", "setClassRetention", "(", "true", ")", ";", "break", ";", "default", ":", "throw", "new", "GroovyBugError", "(", "\"\"", "+", "value", ")", ";", "}", "}", "private", "int", "getElementCode", "(", "ElementType", "value", ")", "{", "switch", "(", "value", ")", "{", "case", "TYPE", ":", "return", "AnnotationNode", ".", "TYPE_TARGET", ";", "case", "CONSTRUCTOR", ":", "return", "AnnotationNode", ".", "CONSTRUCTOR_TARGET", ";", "case", "METHOD", ":", "return", "AnnotationNode", ".", "METHOD_TARGET", ";", "case", "FIELD", ":", "return", "AnnotationNode", ".", "FIELD_TARGET", ";", "case", "PARAMETER", ":", "return", "AnnotationNode", ".", "PARAMETER_TARGET", ";", "case", "LOCAL_VARIABLE", ":", "return", "AnnotationNode", ".", "LOCAL_VARIABLE_TARGET", ";", "case", "ANNOTATION_TYPE", ":", "return", "AnnotationNode", ".", "ANNOTATION_TARGET", ";", "case", "PACKAGE", ":", "return", "AnnotationNode", ".", "PACKAGE_TARGET", ";", "default", ":", "throw", "new", "GroovyBugError", "(", "\"\"", "+", "value", ")", ";", "}", "}", "private", "void", "setMethodDefaultValue", "(", "MethodNode", "mn", ",", "Method", "m", ")", "{", "Object", "defaultValue", "=", "m", ".", "getDefaultValue", "(", ")", ";", "ConstantExpression", "cExp", "=", "ConstantExpression", ".", "NULL", ";", "if", "(", "defaultValue", "!=", "null", ")", "cExp", "=", "new", "ConstantExpression", "(", "defaultValue", ")", ";", "mn", ".", "setCode", "(", "new", "ReturnStatement", "(", "cExp", ")", ")", ";", "mn", ".", "setAnnotationDefault", "(", "true", ")", ";", "}", "public", "void", "configureClassNode", "(", "CompileUnit", "compileUnit", ",", "ClassNode", "classNode", ")", "{", "Class", "clazz", "=", "classNode", ".", "getTypeClass", "(", ")", ";", "Field", "[", "]", "fields", "=", "clazz", ".", "getDeclaredFields", "(", ")", ";", "for", "(", "Field", "f", ":", "fields", ")", "{", "ClassNode", "ret", "=", "makeClassNode", "(", "compileUnit", ",", "f", ".", "getGenericType", "(", ")", ",", "f", ".", "getType", "(", ")", ")", ";", "FieldNode", "fn", "=", "new", "FieldNode", "(", "f", ".", "getName", "(", ")", ",", "f", ".", "getModifiers", "(", ")", ",", "ret", ",", "classNode", ",", "null", ")", ";", "setAnnotationMetaData", "(", "f", ".", "getAnnotations", "(", ")", ",", "fn", ")", ";", "classNode", ".", "addField", "(", "fn", ")", ";", "}", "Method", "[", "]", "methods", "=", "clazz", ".", "getDeclaredMethods", "(", ")", ";", "for", "(", "Method", "m", ":", "methods", ")", "{", "ClassNode", "ret", "=", "makeClassNode", "(", "compileUnit", ",", "m", ".", "getGenericReturnType", "(", ")", ",", "m", ".", "getReturnType", "(", ")", ")", ";", "Parameter", "[", "]", "params", "=", "makeParameters", "(", "compileUnit", ",", "m", ".", "getGenericParameterTypes", "(", ")", ",", "m", ".", "getParameterTypes", "(", ")", ",", "m", ".", "getParameterAnnotations", "(", ")", ")", ";", "ClassNode", "[", "]", "exceptions", "=", "makeClassNodes", "(", "compileUnit", ",", "m", ".", "getGenericExceptionTypes", "(", ")", ",", "m", ".", "getExceptionTypes", "(", ")", ")", ";", "MethodNode", "mn", "=", "new", "MethodNode", "(", "m", ".", "getName", "(", ")", ",", "m", ".", "getModifiers", "(", ")", ",", "ret", ",", "params", ",", "exceptions", ",", "null", ")", ";", "setMethodDefaultValue", "(", "mn", ",", "m", ")", ";", "setAnnotationMetaData", "(", "m", ".", "getAnnotations", "(", ")", ",", "mn", ")", ";", "mn", ".", "setGenericsTypes", "(", "configureTypeVariable", "(", "m", ".", "getTypeParameters", "(", ")", ")", ")", ";", "classNode", ".", "addMethod", "(", "mn", ")", ";", "}", "Constructor", "[", "]", "constructors", "=", "clazz", ".", "getDeclaredConstructors", "(", ")", ";", "for", "(", "Constructor", "ctor", ":", "constructors", ")", "{", "Parameter", "[", "]", "params", "=", "makeParameters", "(", "compileUnit", ",", "ctor", ".", "getGenericParameterTypes", "(", ")", ",", "ctor", ".", "getParameterTypes", "(", ")", ",", "ctor", ".", "getParameterAnnotations", "(", ")", ")", ";", "ClassNode", "[", "]", "exceptions", "=", "makeClassNodes", "(", "compileUnit", ",", "ctor", ".", "getGenericExceptionTypes", "(", ")", ",", "ctor", ".", "getExceptionTypes", "(", ")", ")", ";", "classNode", ".", "addConstructor", "(", "ctor", ".", "getModifiers", "(", ")", ",", "params", ",", "exceptions", ",", "null", ")", ";", "}", "Class", "sc", "=", "clazz", ".", "getSuperclass", "(", ")", ";", "if", "(", "sc", "!=", "null", ")", "classNode", ".", "setUnresolvedSuperClass", "(", "makeClassNode", "(", "compileUnit", ",", "clazz", ".", "getGenericSuperclass", "(", ")", ",", "sc", ")", ")", ";", "makeInterfaceTypes", "(", "compileUnit", ",", "classNode", ",", "clazz", ")", ";", "setAnnotationMetaData", "(", "classNode", ".", "getTypeClass", "(", ")", ".", "getAnnotations", "(", ")", ",", "classNode", ")", ";", "PackageNode", "packageNode", "=", "classNode", ".", "getPackage", "(", ")", ";", "if", "(", "packageNode", "!=", "null", ")", "{", "setAnnotationMetaData", "(", "classNode", ".", "getTypeClass", "(", ")", ".", "getPackage", "(", ")", ".", "getAnnotations", "(", ")", ",", "packageNode", ")", ";", "}", "}", "private", "void", "makeInterfaceTypes", "(", "CompileUnit", "cu", ",", "ClassNode", "classNode", ",", "Class", "clazz", ")", "{", "Type", "[", "]", "interfaceTypes", "=", "clazz", ".", "getGenericInterfaces", "(", ")", ";", "if", "(", "interfaceTypes", ".", "length", "==", "0", ")", "{", "classNode", ".", "setInterfaces", "(", "ClassNode", ".", "EMPTY_ARRAY", ")", ";", "}", "else", "{", "Class", "[", "]", "interfaceClasses", "=", "clazz", ".", "getInterfaces", "(", ")", ";", "ClassNode", "[", "]", "ret", "=", "new", "ClassNode", "[", "interfaceTypes", ".", "length", "]", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "interfaceTypes", ".", "length", ";", "i", "++", ")", "{", "ret", "[", "i", "]", "=", "makeClassNode", "(", "cu", ",", "interfaceTypes", "[", "i", "]", ",", "interfaceClasses", "[", "i", "]", ")", ";", "}", "classNode", ".", "setInterfaces", "(", "ret", ")", ";", "}", "}", "private", "ClassNode", "[", "]", "makeClassNodes", "(", "CompileUnit", "cu", ",", "Type", "[", "]", "types", ",", "Class", "[", "]", "cls", ")", "{", "ClassNode", "[", "]", "nodes", "=", "new", "ClassNode", "[", "types", ".", "length", "]", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "nodes", ".", "length", ";", "i", "++", ")", "{", "nodes", "[", "i", "]", "=", "makeClassNode", "(", "cu", ",", "types", "[", "i", "]", ",", "cls", "[", "i", "]", ")", ";", "}", "return", "nodes", ";", "}", "private", "ClassNode", "makeClassNode", "(", "CompileUnit", "cu", ",", "Type", "t", ",", "Class", "c", ")", "{", "ClassNode", "back", "=", "null", ";", "if", "(", "cu", "!=", "null", ")", "back", "=", "cu", ".", "getClass", "(", "c", ".", "getName", "(", ")", ")", ";", "if", "(", "back", "==", "null", ")", "back", "=", "ClassHelper", ".", "make", "(", "c", ")", ";", "if", "(", "!", "(", "t", "instanceof", "Class", ")", ")", "{", "ClassNode", "front", "=", "configureType", "(", "t", ")", ";", "front", ".", "setRedirect", "(", "back", ")", ";", "return", "front", ";", "}", "return", "back", ";", "}", "private", "Parameter", "[", "]", "makeParameters", "(", "CompileUnit", "cu", ",", "Type", "[", "]", "types", ",", "Class", "[", "]", "cls", ",", "Annotation", "[", "]", "[", "]", "parameterAnnotations", ")", "{", "Parameter", "[", "]", "params", "=", "Parameter", ".", "EMPTY_ARRAY", ";", "if", "(", "types", ".", "length", ">", "0", ")", "{", "params", "=", "new", "Parameter", "[", "types", ".", "length", "]", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "params", ".", "length", ";", "i", "++", ")", "{", "params", "[", "i", "]", "=", "makeParameter", "(", "cu", ",", "types", "[", "i", "]", ",", "cls", "[", "i", "]", ",", "parameterAnnotations", "[", "i", "]", ",", "i", ")", ";", "}", "}", "return", "params", ";", "}", "private", "Parameter", "makeParameter", "(", "CompileUnit", "cu", ",", "Type", "type", ",", "Class", "cl", ",", "Annotation", "[", "]", "annotations", ",", "int", "idx", ")", "{", "ClassNode", "cn", "=", "makeClassNode", "(", "cu", ",", "type", ",", "cl", ")", ";", "Parameter", "parameter", "=", "new", "Parameter", "(", "cn", ",", "\"param\"", "+", "idx", ")", ";", "setAnnotationMetaData", "(", "annotations", ",", "parameter", ")", ";", "return", "parameter", ";", "}", "}", "</s>" ]
6,662
[ "<s>", "package", "org", ".", "codehaus", ".", "groovy", ".", "activator", ";", "import", "java", ".", "net", ".", "URL", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "FileLocator", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "IStatus", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "Plugin", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "Status", ";", "import", "org", ".", "osgi", ".", "framework", ".", "BundleContext", ";", "public", "class", "GroovyActivator", "extends", "Plugin", "{", "public", "static", "final", "String", "PLUGIN_ID", "=", "\"\"", ";", "public", "static", "final", "String", "GROOVY_ALL_JAR", "=", "\"\"", ";", "public", "static", "final", "String", "GROOVY_JAR", "=", "\"\"", ";", "public", "static", "final", "String", "ASM_JAR", "=", "\"\"", ";", "public", "static", "URL", "GROOVY_JAR_URL", ";", "public", "static", "URL", "GROOVY_GPP_URL", ";", "public", "static", "URL", "GROOVY_ALL_JAR_URL", ";", "public", "static", "URL", "ASM_JAR_URL", ";", "private", "static", "GroovyActivator", "DEFAULT", ";", "public", "GroovyActivator", "(", ")", "{", "DEFAULT", "=", "this", ";", "}", "public", "static", "GroovyActivator", "getDefault", "(", ")", "{", "return", "DEFAULT", ";", "}", "@", "Override", "public", "void", "start", "(", "BundleContext", "context", ")", "throws", "Exception", "{", "super", ".", "start", "(", "context", ")", ";", "try", "{", "GROOVY_JAR_URL", "=", "FileLocator", ".", "resolve", "(", "context", ".", "getBundle", "(", ")", ".", "getEntry", "(", "GroovyActivator", ".", "GROOVY_JAR", ")", ")", ";", "GROOVY_ALL_JAR_URL", "=", "FileLocator", ".", "resolve", "(", "context", ".", "getBundle", "(", ")", ".", "getEntry", "(", "GroovyActivator", ".", "GROOVY_ALL_JAR", ")", ")", ";", "ASM_JAR_URL", "=", "FileLocator", ".", "resolve", "(", "context", ".", "getBundle", "(", ")", ".", "getEntry", "(", "GroovyActivator", ".", "ASM_JAR", ")", ")", ";", "}", "catch", "(", "Exception", "e", ")", "{", "getLog", "(", ")", ".", "log", "(", "new", "Status", "(", "IStatus", ".", "ERROR", ",", "PLUGIN_ID", ",", "\"\"", ",", "e", ")", ")", ";", "}", "}", "@", "Override", "public", "void", "stop", "(", "BundleContext", "context", ")", "throws", "Exception", "{", "super", ".", "stop", "(", "context", ")", ";", "}", "}", "</s>" ]
6,663
[ "<s>", "package", "org", ".", "codehaus", ".", "groovy", ".", "tools", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "ClassNode", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "control", ".", "SourceUnit", ";", "public", "class", "GroovyClass", "{", "public", "static", "final", "GroovyClass", "[", "]", "EMPTY_ARRAY", "=", "new", "GroovyClass", "[", "0", "]", ";", "private", "String", "name", ";", "private", "byte", "[", "]", "bytes", ";", "private", "ClassNode", "classNode", ";", "private", "SourceUnit", "source", ";", "public", "GroovyClass", "(", "String", "name", ",", "byte", "[", "]", "bytes", ",", "ClassNode", "classNode", ",", "SourceUnit", "source", ")", "{", "this", ".", "name", "=", "name", ";", "this", ".", "bytes", "=", "bytes", ";", "this", ".", "classNode", "=", "classNode", ";", "this", ".", "source", "=", "source", ";", "}", "public", "String", "getName", "(", ")", "{", "return", "this", ".", "name", ";", "}", "public", "byte", "[", "]", "getBytes", "(", ")", "{", "return", "this", ".", "bytes", ";", "}", "public", "SourceUnit", "getSourceUnit", "(", ")", "{", "return", "source", ";", "}", "public", "ClassNode", "getClassNode", "(", ")", "{", "return", "classNode", ";", "}", "}", "</s>" ]
6,664
[ "<s>", "package", "org", ".", "codehaus", ".", "groovy", ".", "bsf", ";", "import", "groovy", ".", "lang", ".", "Closure", ";", "import", "groovy", ".", "lang", ".", "GroovyShell", ";", "import", "org", ".", "apache", ".", "bsf", ".", "BSFDeclaredBean", ";", "import", "org", ".", "apache", ".", "bsf", ".", "BSFException", ";", "import", "org", ".", "apache", ".", "bsf", ".", "BSFManager", ";", "import", "org", ".", "apache", ".", "bsf", ".", "util", ".", "BSFEngineImpl", ";", "import", "org", ".", "apache", ".", "bsf", ".", "util", ".", "BSFFunctions", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "runtime", ".", "InvokerHelper", ";", "import", "java", ".", "util", ".", "Vector", ";", "public", "class", "GroovyEngine", "extends", "BSFEngineImpl", "{", "protected", "GroovyShell", "shell", ";", "private", "String", "convertToValidJavaClassname", "(", "String", "inName", ")", "{", "if", "(", "inName", "==", "null", "||", "inName", ".", "equals", "(", "\"\"", ")", ")", "{", "return", "\"_\"", ";", "}", "if", "(", "inName", ".", "startsWith", "(", "\"scriptdef_\"", ")", ")", "{", "inName", "=", "inName", ".", "substring", "(", "\"scriptdef_\"", ".", "length", "(", ")", ")", ";", "}", "StringBuffer", "output", "=", "new", "StringBuffer", "(", "inName", ".", "length", "(", ")", ")", ";", "boolean", "firstChar", "=", "true", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "inName", ".", "length", "(", ")", ";", "++", "i", ")", "{", "char", "ch", "=", "inName", ".", "charAt", "(", "i", ")", ";", "if", "(", "firstChar", "&&", "!", "Character", ".", "isJavaIdentifierStart", "(", "ch", ")", ")", "{", "ch", "=", "'_'", ";", "}", "else", "if", "(", "!", "firstChar", "&&", "!", "(", "Character", ".", "isJavaIdentifierPart", "(", "ch", ")", "||", "ch", "==", "'.'", ")", ")", "{", "ch", "=", "'_'", ";", "}", "firstChar", "=", "(", "ch", "==", "'.'", ")", ";", "output", ".", "append", "(", "ch", ")", ";", "}", "return", "output", ".", "toString", "(", ")", ";", "}", "public", "Object", "apply", "(", "String", "source", ",", "int", "lineNo", ",", "int", "columnNo", ",", "Object", "funcBody", ",", "Vector", "paramNames", ",", "Vector", "arguments", ")", "throws", "BSFException", "{", "Object", "object", "=", "eval", "(", "source", ",", "lineNo", ",", "columnNo", ",", "funcBody", ")", ";", "if", "(", "object", "instanceof", "Closure", ")", "{", "Closure", "closure", "=", "(", "Closure", ")", "object", ";", "return", "closure", ".", "call", "(", "arguments", ".", "toArray", "(", ")", ")", ";", "}", "return", "object", ";", "}", "public", "Object", "call", "(", "Object", "object", ",", "String", "method", ",", "Object", "[", "]", "args", ")", "throws", "BSFException", "{", "return", "InvokerHelper", ".", "invokeMethod", "(", "object", ",", "method", ",", "args", ")", ";", "}", "public", "Object", "eval", "(", "String", "source", ",", "int", "lineNo", ",", "int", "columnNo", ",", "Object", "script", ")", "throws", "BSFException", "{", "try", "{", "source", "=", "convertToValidJavaClassname", "(", "source", ")", ";", "return", "getEvalShell", "(", ")", ".", "evaluate", "(", "script", ".", "toString", "(", ")", ",", "source", ")", ";", "}", "catch", "(", "Exception", "e", ")", "{", "throw", "new", "BSFException", "(", "BSFException", ".", "REASON_EXECUTION_ERROR", ",", "\"\"", "+", "e", ",", "e", ")", ";", "}", "}", "public", "void", "exec", "(", "String", "source", ",", "int", "lineNo", ",", "int", "columnNo", ",", "Object", "script", ")", "throws", "BSFException", "{", "try", "{", "source", "=", "convertToValidJavaClassname", "(", "source", ")", ";", "getEvalShell", "(", ")", ".", "evaluate", "(", "script", ".", "toString", "(", ")", ",", "source", ")", ";", "}", "catch", "(", "Exception", "e", ")", "{", "throw", "new", "BSFException", "(", "BSFException", ".", "REASON_EXECUTION_ERROR", ",", "\"\"", "+", "e", ",", "e", ")", ";", "}", "}", "public", "void", "initialize", "(", "BSFManager", "mgr", ",", "String", "lang", ",", "Vector", "declaredBeans", ")", "throws", "BSFException", "{", "super", ".", "initialize", "(", "mgr", ",", "lang", ",", "declaredBeans", ")", ";", "shell", "=", "new", "GroovyShell", "(", "mgr", ".", "getClassLoader", "(", ")", ")", ";", "shell", ".", "setVariable", "(", "\"bsf\"", ",", "new", "BSFFunctions", "(", "mgr", ",", "this", ")", ")", ";", "int", "size", "=", "declaredBeans", ".", "size", "(", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "size", ";", "i", "++", ")", "{", "declareBean", "(", "(", "BSFDeclaredBean", ")", "declaredBeans", ".", "elementAt", "(", "i", ")", ")", ";", "}", "}", "public", "void", "declareBean", "(", "BSFDeclaredBean", "bean", ")", "throws", "BSFException", "{", "shell", ".", "setVariable", "(", "bean", ".", "name", ",", "bean", ".", "bean", ")", ";", "}", "public", "void", "undeclareBean", "(", "BSFDeclaredBean", "bean", ")", "throws", "BSFException", "{", "shell", ".", "setVariable", "(", "bean", ".", "name", ",", "null", ")", ";", "}", "protected", "GroovyShell", "getEvalShell", "(", ")", "{", "return", "new", "GroovyShell", "(", "shell", ")", ";", "}", "}", "</s>" ]
6,665
[ "<s>", "package", "org", ".", "codehaus", ".", "groovy", ".", "control", ";", "import", "static", "org", ".", "codehaus", ".", "groovy", ".", "runtime", ".", "MetaClassHelper", ".", "capitalize", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "*", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "expr", ".", "*", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "stmt", ".", "Statement", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "syntax", ".", "Types", ";", "import", "java", ".", "util", ".", "*", ";", "public", "class", "StaticImportVisitor", "extends", "ClassCodeExpressionTransformer", "{", "private", "ClassNode", "currentClass", ";", "private", "MethodNode", "currentMethod", ";", "private", "SourceUnit", "source", ";", "private", "boolean", "inSpecialConstructorCall", ";", "private", "boolean", "inClosure", ";", "private", "boolean", "inPropertyExpression", ";", "private", "Expression", "foundConstant", ";", "private", "Expression", "foundArgs", ";", "private", "boolean", "inAnnotation", ";", "private", "boolean", "inLeftExpression", ";", "boolean", "isReconcile", "=", "false", ";", "public", "void", "visitClass", "(", "ClassNode", "node", ",", "SourceUnit", "source", ")", "{", "this", ".", "currentClass", "=", "node", ";", "this", ".", "source", "=", "source", ";", "super", ".", "visitClass", "(", "node", ")", ";", "}", "@", "Override", "protected", "void", "visitConstructorOrMethod", "(", "MethodNode", "node", ",", "boolean", "isConstructor", ")", "{", "this", ".", "currentMethod", "=", "node", ";", "super", ".", "visitConstructorOrMethod", "(", "node", ",", "isConstructor", ")", ";", "this", ".", "currentMethod", "=", "null", ";", "}", "@", "Override", "public", "void", "visitAnnotations", "(", "AnnotatedNode", "node", ")", "{", "boolean", "oldInAnnotation", "=", "inAnnotation", ";", "inAnnotation", "=", "true", ";", "super", ".", "visitAnnotations", "(", "node", ")", ";", "inAnnotation", "=", "oldInAnnotation", ";", "}", "public", "Expression", "transform", "(", "Expression", "exp", ")", "{", "if", "(", "exp", "==", "null", ")", "return", "null", ";", "if", "(", "exp", ".", "getClass", "(", ")", "==", "VariableExpression", ".", "class", ")", "{", "return", "transformVariableExpression", "(", "(", "VariableExpression", ")", "exp", ")", ";", "}", "if", "(", "exp", ".", "getClass", "(", ")", "==", "BinaryExpression", ".", "class", ")", "{", "return", "transformBinaryExpression", "(", "(", "BinaryExpression", ")", "exp", ")", ";", "}", "if", "(", "exp", ".", "getClass", "(", ")", "==", "PropertyExpression", ".", "class", ")", "{", "return", "transformPropertyExpression", "(", "(", "PropertyExpression", ")", "exp", ")", ";", "}", "if", "(", "exp", ".", "getClass", "(", ")", "==", "MethodCallExpression", ".", "class", ")", "{", "return", "transformMethodCallExpression", "(", "(", "MethodCallExpression", ")", "exp", ")", ";", "}", "if", "(", "exp", ".", "getClass", "(", ")", "==", "ClosureExpression", ".", "class", ")", "{", "return", "transformClosureExpression", "(", "(", "ClosureExpression", ")", "exp", ")", ";", "}", "if", "(", "exp", ".", "getClass", "(", ")", "==", "ConstructorCallExpression", ".", "class", ")", "{", "return", "transformConstructorCallExpression", "(", "(", "ConstructorCallExpression", ")", "exp", ")", ";", "}", "if", "(", "exp", ".", "getClass", "(", ")", "==", "ArgumentListExpression", ".", "class", ")", "{", "Expression", "result", "=", "exp", ".", "transformExpression", "(", "this", ")", ";", "if", "(", "inPropertyExpression", ")", "{", "foundArgs", "=", "result", ";", "}", "return", "result", ";", "}", "if", "(", "exp", "instanceof", "ConstantExpression", ")", "{", "Expression", "result", "=", "exp", ".", "transformExpression", "(", "this", ")", ";", "if", "(", "inPropertyExpression", ")", "{", "foundConstant", "=", "result", ";", "}", "if", "(", "inAnnotation", "&&", "exp", "instanceof", "AnnotationConstantExpression", ")", "{", "ConstantExpression", "ce", "=", "(", "ConstantExpression", ")", "result", ";", "if", "(", "ce", ".", "getValue", "(", ")", "instanceof", "AnnotationNode", ")", "{", "AnnotationNode", "an", "=", "(", "AnnotationNode", ")", "ce", ".", "getValue", "(", ")", ";", "Map", "<", "String", ",", "Expression", ">", "attributes", "=", "an", ".", "getMembers", "(", ")", ";", "for", "(", "Map", ".", "Entry", "<", "String", ",", "Expression", ">", "entry", ":", "attributes", ".", "entrySet", "(", ")", ")", "{", "Expression", "attrExpr", "=", "transform", "(", "entry", ".", "getValue", "(", ")", ")", ";", "entry", ".", "setValue", "(", "attrExpr", ")", ";", "}", "}", "}", "return", "result", ";", "}", "return", "exp", ".", "transformExpression", "(", "this", ")", ";", "}", "private", "Expression", "transformMapEntryExpression", "(", "MapEntryExpression", "me", ",", "ClassNode", "constructorCallType", ")", "{", "Expression", "key", "=", "me", ".", "getKeyExpression", "(", ")", ";", "Expression", "value", "=", "me", ".", "getValueExpression", "(", ")", ";", "ModuleNode", "module", "=", "currentClass", ".", "getModule", "(", ")", ";", "if", "(", "module", "!=", "null", "&&", "key", "instanceof", "ConstantExpression", ")", "{", "Map", "<", "String", ",", "ImportNode", ">", "importNodes", "=", "module", ".", "getStaticImports", "(", ")", ";", "if", "(", "importNodes", ".", "containsKey", "(", "key", ".", "getText", "(", ")", ")", ")", "{", "ImportNode", "importNode", "=", "importNodes", ".", "get", "(", "key", ".", "getText", "(", ")", ")", ";", "if", "(", "importNode", ".", "getType", "(", ")", ".", "equals", "(", "constructorCallType", ")", ")", "{", "String", "newKey", "=", "importNode", ".", "getFieldName", "(", ")", ";", "return", "new", "MapEntryExpression", "(", "new", "ConstantExpression", "(", "newKey", ")", ",", "value", ".", "transformExpression", "(", "this", ")", ")", ";", "}", "}", "}", "return", "me", ";", "}", "protected", "Expression", "transformBinaryExpression", "(", "BinaryExpression", "be", ")", "{", "int", "type", "=", "be", ".", "getOperation", "(", ")", ".", "getType", "(", ")", ";", "boolean", "oldInLeftExpression", ";", "Expression", "right", "=", "transform", "(", "be", ".", "getRightExpression", "(", ")", ")", ";", "be", ".", "setRightExpression", "(", "right", ")", ";", "Expression", "left", ";", "if", "(", "type", "==", "Types", ".", "EQUAL", ")", "{", "oldInLeftExpression", "=", "inLeftExpression", ";", "inLeftExpression", "=", "true", ";", "left", "=", "transform", "(", "be", ".", "getLeftExpression", "(", ")", ")", ";", "inLeftExpression", "=", "oldInLeftExpression", ";", "if", "(", "left", "instanceof", "StaticMethodCallExpression", ")", "{", "StaticMethodCallExpression", "smce", "=", "(", "StaticMethodCallExpression", ")", "left", ";", "StaticMethodCallExpression", "result", "=", "new", "StaticMethodCallExpression", "(", "smce", ".", "getOwnerType", "(", ")", ",", "smce", ".", "getMethod", "(", ")", ",", "right", ")", ";", "setSourcePosition", "(", "result", ",", "be", ")", ";", "return", "result", ";", "}", "}", "else", "{", "left", "=", "transform", "(", "be", ".", "getLeftExpression", "(", ")", ")", ";", "}", "be", ".", "setLeftExpression", "(", "left", ")", ";", "return", "be", ";", "}", "protected", "Expression", "transformVariableExpression", "(", "VariableExpression", "ve", ")", "{", "Variable", "v", "=", "ve", ".", "getAccessedVariable", "(", ")", ";", "if", "(", "v", "!=", "null", "&&", "v", "instanceof", "DynamicVariable", ")", "{", "Expression", "result", "=", "findStaticFieldOrPropAccessorImportFromModule", "(", "v", ".", "getName", "(", ")", ")", ";", "if", "(", "result", "!=", "null", ")", "{", "setSourcePosition", "(", "result", ",", "ve", ")", ";", "if", "(", "inAnnotation", ")", "{", "result", "=", "transformInlineConstants", "(", "result", ")", ";", "}", "return", "result", ";", "}", "}", "return", "ve", ";", "}", "private", "void", "setSourcePosition", "(", "Expression", "toSet", ",", "Expression", "origNode", ")", "{", "toSet", ".", "setSourcePosition", "(", "origNode", ")", ";", "if", "(", "toSet", "instanceof", "PropertyExpression", ")", "{", "(", "(", "PropertyExpression", ")", "toSet", ")", ".", "getProperty", "(", ")", ".", "setSourcePosition", "(", "origNode", ")", ";", "}", "}", "private", "Expression", "transformInlineConstants", "(", "Expression", "exp", ")", "{", "if", "(", "exp", "instanceof", "PropertyExpression", ")", "{", "PropertyExpression", "pe", "=", "(", "PropertyExpression", ")", "exp", ";", "if", "(", "pe", ".", "getObjectExpression", "(", ")", "instanceof", "ClassExpression", ")", "{", "ClassExpression", "ce", "=", "(", "ClassExpression", ")", "pe", ".", "getObjectExpression", "(", ")", ";", "ClassNode", "type", "=", "ce", ".", "getType", "(", ")", ";", "if", "(", "type", ".", "isEnum", "(", ")", ")", "return", "exp", ";", "Expression", "constant", "=", "findConstant", "(", "type", ".", "getField", "(", "pe", ".", "getPropertyAsString", "(", ")", ")", ")", ";", "if", "(", "constant", "!=", "null", ")", "return", "constant", ";", "}", "}", "else", "if", "(", "exp", "instanceof", "ListExpression", ")", "{", "ListExpression", "le", "=", "(", "ListExpression", ")", "exp", ";", "ListExpression", "result", "=", "new", "ListExpression", "(", ")", ";", "for", "(", "Expression", "e", ":", "le", ".", "getExpressions", "(", ")", ")", "{", "result", ".", "addExpression", "(", "transformInlineConstants", "(", "e", ")", ")", ";", "}", "return", "result", ";", "}", "return", "exp", ";", "}", "private", "Expression", "findConstant", "(", "FieldNode", "fn", ")", "{", "if", "(", "fn", "!=", "null", "&&", "!", "fn", ".", "isEnum", "(", ")", "&&", "fn", ".", "isStatic", "(", ")", "&&", "fn", ".", "isFinal", "(", ")", ")", "{", "if", "(", "fn", ".", "getInitialValueExpression", "(", ")", "instanceof", "ConstantExpression", ")", "{", "return", "fn", ".", "getInitialValueExpression", "(", ")", ";", "}", "}", "return", "null", ";", "}", "protected", "Expression", "transformMethodCallExpression", "(", "MethodCallExpression", "mce", ")", "{", "Expression", "args", "=", "transform", "(", "mce", ".", "getArguments", "(", ")", ")", ";", "Expression", "method", "=", "transform", "(", "mce", ".", "getMethod", "(", ")", ")", ";", "Expression", "object", "=", "transform", "(", "mce", ".", "getObjectExpression", "(", ")", ")", ";", "boolean", "isExplicitThisOrSuper", "=", "false", ";", "if", "(", "object", "instanceof", "VariableExpression", ")", "{", "VariableExpression", "ve", "=", "(", "VariableExpression", ")", "object", ";", "isExplicitThisOrSuper", "=", "!", "mce", ".", "isImplicitThis", "(", ")", "&&", "(", "ve", ".", "getName", "(", ")", ".", "equals", "(", "\"this\"", ")", "||", "ve", ".", "getName", "(", ")", ".", "equals", "(", "\"super\"", ")", ")", ";", "}", "if", "(", "mce", ".", "isImplicitThis", "(", ")", "||", "isExplicitThisOrSuper", ")", "{", "if", "(", "mce", ".", "isImplicitThis", "(", ")", ")", "{", "Expression", "ret", "=", "findStaticMethodImportFromModule", "(", "method", ",", "args", ")", ";", "if", "(", "ret", "!=", "null", ")", "{", "setSourcePosition", "(", "ret", ",", "mce", ")", ";", "return", "ret", ";", "}", "if", "(", "method", "instanceof", "ConstantExpression", "&&", "!", "inLeftExpression", ")", "{", "String", "methodName", "=", "(", "String", ")", "(", "(", "ConstantExpression", ")", "method", ")", ".", "getValue", "(", ")", ";", "ret", "=", "findStaticFieldOrPropAccessorImportFromModule", "(", "methodName", ")", ";", "if", "(", "ret", "!=", "null", ")", "{", "ret", "=", "new", "MethodCallExpression", "(", "ret", ",", "\"call\"", ",", "args", ")", ";", "setSourcePosition", "(", "ret", ",", "mce", ")", ";", "return", "ret", ";", "}", "}", "}", "if", "(", "method", "instanceof", "ConstantExpression", ")", "{", "ConstantExpression", "ce", "=", "(", "ConstantExpression", ")", "method", ";", "Object", "value", "=", "ce", ".", "getValue", "(", ")", ";", "if", "(", "value", "instanceof", "String", ")", "{", "String", "methodName", "=", "(", "String", ")", "value", ";", "boolean", "lookForPossibleStaticMethod", "=", "!", "methodName", ".", "equals", "(", "\"call\"", ")", ";", "if", "(", "currentMethod", "!=", "null", "&&", "!", "currentMethod", ".", "isStatic", "(", ")", ")", "{", "if", "(", "currentClass", ".", "hasPossibleMethod", "(", "methodName", ",", "args", ")", ")", "{", "lookForPossibleStaticMethod", "=", "false", ";", "}", "}", "if", "(", "inSpecialConstructorCall", "||", "(", "lookForPossibleStaticMethod", "&&", "currentClass", ".", "hasPossibleStaticMethod", "(", "methodName", ",", "args", ")", ")", ")", "{", "StaticMethodCallExpression", "smce", "=", "new", "StaticMethodCallExpression", "(", "currentClass", ",", "methodName", ",", "args", ")", ";", "setSourcePosition", "(", "smce", ",", "mce", ")", ";", "return", "smce", ";", "}", "}", "}", "}", "MethodCallExpression", "result", "=", "new", "MethodCallExpression", "(", "object", ",", "method", ",", "args", ")", ";", "result", ".", "setSafe", "(", "mce", ".", "isSafe", "(", ")", ")", ";", "result", ".", "setImplicitThis", "(", "mce", ".", "isImplicitThis", "(", ")", ")", ";", "result", ".", "setSpreadSafe", "(", "mce", ".", "isSpreadSafe", "(", ")", ")", ";", "result", ".", "setMethodTarget", "(", "mce", ".", "getMethodTarget", "(", ")", ")", ";", "setSourcePosition", "(", "result", ",", "mce", ")", ";", "return", "result", ";", "}", "protected", "Expression", "transformConstructorCallExpression", "(", "ConstructorCallExpression", "cce", ")", "{", "inSpecialConstructorCall", "=", "cce", ".", "isSpecialCall", "(", ")", ";", "Expression", "expression", "=", "cce", ".", "getArguments", "(", ")", ";", "if", "(", "expression", "instanceof", "TupleExpression", ")", "{", "TupleExpression", "tuple", "=", "(", "TupleExpression", ")", "expression", ";", "if", "(", "tuple", ".", "getExpressions", "(", ")", ".", "size", "(", ")", "==", "1", ")", "{", "expression", "=", "tuple", ".", "getExpression", "(", "0", ")", ";", "if", "(", "expression", "instanceof", "NamedArgumentListExpression", ")", "{", "NamedArgumentListExpression", "namedArgs", "=", "(", "NamedArgumentListExpression", ")", "expression", ";", "List", "<", "MapEntryExpression", ">", "entryExpressions", "=", "namedArgs", ".", "getMapEntryExpressions", "(", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "entryExpressions", ".", "size", "(", ")", ";", "i", "++", ")", "{", "entryExpressions", ".", "set", "(", "i", ",", "(", "MapEntryExpression", ")", "transformMapEntryExpression", "(", "entryExpressions", ".", "get", "(", "i", ")", ",", "cce", ".", "getType", "(", ")", ")", ")", ";", "}", "}", "}", "}", "Expression", "ret", "=", "cce", ".", "transformExpression", "(", "this", ")", ";", "inSpecialConstructorCall", "=", "false", ";", "return", "ret", ";", "}", "protected", "Expression", "transformClosureExpression", "(", "ClosureExpression", "ce", ")", "{", "boolean", "oldInClosure", "=", "inClosure", ";", "inClosure", "=", "true", ";", "Statement", "code", "=", "ce", ".", "getCode", "(", ")", ";", "if", "(", "code", "!=", "null", ")", "code", ".", "visit", "(", "this", ")", ";", "inClosure", "=", "oldInClosure", ";", "return", "ce", ";", "}", "protected", "Expression", "transformPropertyExpression", "(", "PropertyExpression", "pe", ")", "{", "boolean", "oldInPropertyExpression", "=", "inPropertyExpression", ";", "Expression", "oldFoundArgs", "=", "foundArgs", ";", "Expression", "oldFoundConstant", "=", "foundConstant", ";", "inPropertyExpression", "=", "true", ";", "foundArgs", "=", "null", ";", "foundConstant", "=", "null", ";", "Expression", "objectExpression", "=", "transform", "(", "pe", ".", "getObjectExpression", "(", ")", ")", ";", "boolean", "candidate", "=", "false", ";", "if", "(", "objectExpression", "instanceof", "MethodCallExpression", ")", "{", "candidate", "=", "(", "(", "MethodCallExpression", ")", "objectExpression", ")", ".", "isImplicitThis", "(", ")", ";", "}", "if", "(", "foundArgs", "!=", "null", "&&", "foundConstant", "!=", "null", "&&", "candidate", ")", "{", "Expression", "result", "=", "findStaticMethodImportFromModule", "(", "foundConstant", ",", "foundArgs", ")", ";", "if", "(", "result", "!=", "null", ")", "{", "objectExpression", "=", "result", ";", "objectExpression", ".", "setSourcePosition", "(", "pe", ")", ";", "}", "}", "inPropertyExpression", "=", "oldInPropertyExpression", ";", "foundArgs", "=", "oldFoundArgs", ";", "foundConstant", "=", "oldFoundConstant", ";", "pe", ".", "setObjectExpression", "(", "objectExpression", ")", ";", "return", "pe", ";", "}", "private", "Expression", "findStaticFieldOrPropAccessorImportFromModule", "(", "String", "name", ")", "{", "ModuleNode", "module", "=", "currentClass", ".", "getModule", "(", ")", ";", "if", "(", "module", "==", "null", ")", "return", "null", ";", "Map", "<", "String", ",", "ImportNode", ">", "importNodes", "=", "module", ".", "getStaticImports", "(", ")", ";", "Expression", "expression", ";", "String", "accessorName", "=", "getAccessorName", "(", "name", ")", ";", "if", "(", "importNodes", ".", "containsKey", "(", "accessorName", ")", ")", "{", "ImportNode", "importNode", "=", "importNodes", ".", "get", "(", "accessorName", ")", ";", "expression", "=", "findStaticPropertyAccessorByFullName", "(", "importNode", ".", "getType", "(", ")", ",", "importNode", ".", "getFieldName", "(", ")", ")", ";", "if", "(", "expression", "!=", "null", ")", "return", "expression", ";", "expression", "=", "findStaticPropertyAccessor", "(", "importNode", ".", "getType", "(", ")", ",", "getPropNameForAccessor", "(", "importNode", ".", "getFieldName", "(", ")", ")", ")", ";", "if", "(", "expression", "!=", "null", ")", "return", "expression", ";", "}", "if", "(", "accessorName", ".", "startsWith", "(", "\"get\"", ")", ")", "{", "accessorName", "=", "\"is\"", "+", "accessorName", ".", "substring", "(", "3", ")", ";", "if", "(", "importNodes", ".", "containsKey", "(", "accessorName", ")", ")", "{", "ImportNode", "importNode", "=", "importNodes", ".", "get", "(", "accessorName", ")", ";", "expression", "=", "findStaticPropertyAccessorByFullName", "(", "importNode", ".", "getType", "(", ")", ",", "importNode", ".", "getFieldName", "(", ")", ")", ";", "if", "(", "expression", "!=", "null", ")", "return", "expression", ";", "expression", "=", "findStaticPropertyAccessor", "(", "importNode", ".", "getType", "(", ")", ",", "getPropNameForAccessor", "(", "importNode", ".", "getFieldName", "(", ")", ")", ")", ";", "if", "(", "expression", "!=", "null", ")", "return", "expression", ";", "}", "}", "if", "(", "importNodes", ".", "containsKey", "(", "name", ")", ")", "{", "ImportNode", "importNode", "=", "importNodes", ".", "get", "(", "name", ")", ";", "if", "(", "!", "isReconcile", ")", "{", "expression", "=", "findStaticPropertyAccessor", "(", "importNode", ".", "getType", "(", ")", ",", "importNode", ".", "getFieldName", "(", ")", ")", ";", "if", "(", "expression", "!=", "null", ")", "return", "expression", ";", "}", "expression", "=", "findStaticField", "(", "importNode", ".", "getType", "(", ")", ",", "importNode", ".", "getFieldName", "(", ")", ")", ";", "if", "(", "expression", "!=", "null", ")", "return", "expression", ";", "}", "for", "(", "ImportNode", "importNode", ":", "module", ".", "getStaticStarImports", "(", ")", ".", "values", "(", ")", ")", "{", "ClassNode", "node", "=", "importNode", ".", "getType", "(", ")", ";", "expression", "=", "findStaticPropertyAccessor", "(", "node", ",", "name", ")", ";", "if", "(", "expression", "!=", "null", ")", "return", "expression", ";", "expression", "=", "findStaticField", "(", "node", ",", "name", ")", ";", "if", "(", "expression", "!=", "null", ")", "return", "expression", ";", "}", "return", "null", ";", "}", "private", "Expression", "findStaticMethodImportFromModule", "(", "Expression", "method", ",", "Expression", "args", ")", "{", "ModuleNode", "module", "=", "currentClass", ".", "getModule", "(", ")", ";", "if", "(", "module", "==", "null", "||", "!", "(", "method", "instanceof", "ConstantExpression", ")", ")", "return", "null", ";", "Map", "<", "String", ",", "ImportNode", ">", "importNodes", "=", "module", ".", "getStaticImports", "(", ")", ";", "ConstantExpression", "ce", "=", "(", "ConstantExpression", ")", "method", ";", "Expression", "expression", ";", "Object", "value", "=", "ce", ".", "getValue", "(", ")", ";", "if", "(", "!", "(", "value", "instanceof", "String", ")", ")", "return", "null", ";", "final", "String", "name", "=", "(", "String", ")", "value", ";", "if", "(", "importNodes", ".", "containsKey", "(", "name", ")", ")", "{", "ImportNode", "importNode", "=", "importNodes", ".", "get", "(", "name", ")", ";", "expression", "=", "findStaticMethod", "(", "importNode", ".", "getType", "(", ")", ",", "importNode", ".", "getFieldName", "(", ")", ",", "args", ")", ";", "if", "(", "expression", "!=", "null", ")", "return", "expression", ";", "expression", "=", "findStaticPropertyAccessorGivenArgs", "(", "importNode", ".", "getType", "(", ")", ",", "getPropNameForAccessor", "(", "importNode", ".", "getFieldName", "(", ")", ")", ",", "args", ")", ";", "if", "(", "expression", "!=", "null", ")", "{", "return", "new", "StaticMethodCallExpression", "(", "importNode", ".", "getType", "(", ")", ",", "importNode", ".", "getFieldName", "(", ")", ",", "args", ")", ";", "}", "}", "if", "(", "validPropName", "(", "name", ")", ")", "{", "String", "propName", "=", "getPropNameForAccessor", "(", "name", ")", ";", "if", "(", "importNodes", ".", "containsKey", "(", "propName", ")", ")", "{", "ImportNode", "importNode", "=", "importNodes", ".", "get", "(", "propName", ")", ";", "expression", "=", "findStaticMethod", "(", "importNode", ".", "getType", "(", ")", ",", "prefix", "(", "name", ")", "+", "capitalize", "(", "importNode", ".", "getFieldName", "(", ")", ")", ",", "args", ")", ";", "if", "(", "expression", "!=", "null", ")", "return", "expression", ";", "expression", "=", "findStaticPropertyAccessorGivenArgs", "(", "importNode", ".", "getType", "(", ")", ",", "importNode", ".", "getFieldName", "(", ")", ",", "args", ")", ";", "if", "(", "expression", "!=", "null", ")", "{", "return", "new", "StaticMethodCallExpression", "(", "importNode", ".", "getType", "(", ")", ",", "prefix", "(", "name", ")", "+", "capitalize", "(", "importNode", ".", "getFieldName", "(", ")", ")", ",", "args", ")", ";", "}", "}", "}", "Map", "<", "String", ",", "ImportNode", ">", "starImports", "=", "module", ".", "getStaticStarImports", "(", ")", ";", "ClassNode", "starImportType", ";", "if", "(", "currentClass", ".", "isEnum", "(", ")", "&&", "starImports", ".", "containsKey", "(", "currentClass", ".", "getName", "(", ")", ")", ")", "{", "ImportNode", "importNode", "=", "starImports", ".", "get", "(", "currentClass", ".", "getName", "(", ")", ")", ";", "starImportType", "=", "importNode", "==", "null", "?", "null", ":", "importNode", ".", "getType", "(", ")", ";", "expression", "=", "findStaticMethod", "(", "starImportType", ",", "name", ",", "args", ")", ";", "if", "(", "expression", "!=", "null", ")", "return", "expression", ";", "}", "else", "{", "for", "(", "ImportNode", "importNode", ":", "starImports", ".", "values", "(", ")", ")", "{", "starImportType", "=", "importNode", "==", "null", "?", "null", ":", "importNode", ".", "getType", "(", ")", ";", "expression", "=", "findStaticMethod", "(", "starImportType", ",", "name", ",", "args", ")", ";", "if", "(", "expression", "!=", "null", ")", "return", "expression", ";", "expression", "=", "findStaticPropertyAccessorGivenArgs", "(", "starImportType", ",", "getPropNameForAccessor", "(", "name", ")", ",", "args", ")", ";", "if", "(", "expression", "!=", "null", ")", "{", "return", "new", "StaticMethodCallExpression", "(", "starImportType", ",", "name", ",", "args", ")", ";", "}", "}", "}", "return", "null", ";", "}", "private", "String", "prefix", "(", "String", "name", ")", "{", "return", "name", ".", "startsWith", "(", "\"is\"", ")", "?", "\"is\"", ":", "name", ".", "substring", "(", "0", ",", "3", ")", ";", "}", "private", "String", "getPropNameForAccessor", "(", "String", "fieldName", ")", "{", "int", "prefixLength", "=", "fieldName", ".", "startsWith", "(", "\"is\"", ")", "?", "2", ":", "3", ";", "if", "(", "fieldName", ".", "length", "(", ")", "<", "prefixLength", "+", "1", ")", "return", "fieldName", ";", "if", "(", "!", "validPropName", "(", "fieldName", ")", ")", "return", "fieldName", ";", "return", "String", ".", "valueOf", "(", "fieldName", ".", "charAt", "(", "prefixLength", ")", ")", ".", "toLowerCase", "(", ")", "+", "fieldName", ".", "substring", "(", "prefixLength", "+", "1", ")", ";", "}", "private", "boolean", "validPropName", "(", "String", "propName", ")", "{", "return", "propName", ".", "startsWith", "(", "\"get\"", ")", "||", "propName", ".", "startsWith", "(", "\"is\"", ")", "||", "propName", ".", "startsWith", "(", "\"set\"", ")", ";", "}", "private", "String", "getAccessorName", "(", "String", "name", ")", "{", "return", "(", "inLeftExpression", "?", "\"set\"", ":", "\"get\"", ")", "+", "capitalize", "(", "name", ")", ";", "}", "private", "Expression", "findStaticPropertyAccessorGivenArgs", "(", "ClassNode", "staticImportType", ",", "String", "propName", ",", "Expression", "args", ")", "{", "return", "findStaticPropertyAccessor", "(", "staticImportType", ",", "propName", ")", ";", "}", "private", "Expression", "findStaticPropertyAccessor", "(", "ClassNode", "staticImportType", ",", "String", "propName", ")", "{", "String", "accessorName", "=", "getAccessorName", "(", "propName", ")", ";", "Expression", "accessor", "=", "findStaticPropertyAccessorByFullName", "(", "staticImportType", ",", "accessorName", ")", ";", "if", "(", "accessor", "==", "null", "&&", "accessorName", ".", "startsWith", "(", "\"get\"", ")", ")", "{", "accessor", "=", "findStaticPropertyAccessorByFullName", "(", "staticImportType", ",", "\"is\"", "+", "accessorName", ".", "substring", "(", "3", ")", ")", ";", "}", "if", "(", "accessor", "==", "null", "&&", "hasStaticProperty", "(", "staticImportType", ",", "propName", ")", ")", "{", "if", "(", "inLeftExpression", ")", "accessor", "=", "new", "StaticMethodCallExpression", "(", "staticImportType", ",", "accessorName", ",", "ArgumentListExpression", ".", "EMPTY_ARGUMENTS", ")", ";", "else", "accessor", "=", "new", "PropertyExpression", "(", "new", "ClassExpression", "(", "staticImportType", ")", ",", "propName", ")", ";", "}", "return", "accessor", ";", "}", "private", "boolean", "hasStaticProperty", "(", "ClassNode", "staticImportType", ",", "String", "propName", ")", "{", "ClassNode", "classNode", "=", "staticImportType", ";", "while", "(", "classNode", "!=", "null", ")", "{", "for", "(", "PropertyNode", "pn", ":", "classNode", ".", "getProperties", "(", ")", ")", "{", "if", "(", "pn", ".", "getName", "(", ")", ".", "equals", "(", "propName", ")", "&&", "pn", ".", "isStatic", "(", ")", ")", "return", "true", ";", "}", "classNode", "=", "classNode", ".", "getSuperClass", "(", ")", ";", "}", "return", "false", ";", "}", "private", "Expression", "findStaticPropertyAccessorByFullName", "(", "ClassNode", "staticImportType", ",", "String", "accessorMethodName", ")", "{", "ArgumentListExpression", "dummyArgs", "=", "new", "ArgumentListExpression", "(", ")", ";", "dummyArgs", ".", "addExpression", "(", "new", "EmptyExpression", "(", ")", ")", ";", "return", "findStaticMethod", "(", "staticImportType", ",", "accessorMethodName", ",", "(", "inLeftExpression", "?", "dummyArgs", ":", "ArgumentListExpression", ".", "EMPTY_ARGUMENTS", ")", ")", ";", "}", "private", "Expression", "findStaticField", "(", "ClassNode", "staticImportType", ",", "String", "fieldName", ")", "{", "if", "(", "staticImportType", ".", "isPrimaryClassNode", "(", ")", "||", "staticImportType", ".", "isResolved", "(", ")", ")", "{", "FieldNode", "field", "=", "staticImportType", ".", "getField", "(", "fieldName", ")", ";", "if", "(", "field", "!=", "null", "&&", "field", ".", "isStatic", "(", ")", ")", "return", "new", "PropertyExpression", "(", "new", "ClassExpression", "(", "staticImportType", ")", ",", "fieldName", ")", ";", "}", "return", "null", ";", "}", "private", "Expression", "findStaticMethod", "(", "ClassNode", "staticImportType", ",", "String", "methodName", ",", "Expression", "args", ")", "{", "if", "(", "staticImportType", ".", "isPrimaryClassNode", "(", ")", "||", "staticImportType", ".", "isResolved", "(", ")", ")", "{", "if", "(", "staticImportType", ".", "hasPossibleStaticMethod", "(", "methodName", ",", "args", ")", ")", "{", "return", "new", "StaticMethodCallExpression", "(", "staticImportType", ",", "methodName", ",", "args", ")", ";", "}", "}", "return", "null", ";", "}", "protected", "SourceUnit", "getSourceUnit", "(", ")", "{", "return", "source", ";", "}", "}", "</s>" ]
6,666
[ "<s>", "package", "org", ".", "codehaus", ".", "groovy", ".", "control", ";", "import", "groovy", ".", "lang", ".", "GroovyClassLoader", ";", "import", "groovy", ".", "lang", ".", "GroovyRuntimeException", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "GroovyBugError", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "ASTNode", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "ClassNode", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "CompileUnit", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "InnerClassNode", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "ModuleNode", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "classgen", ".", "*", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "control", ".", "customizers", ".", "CompilationCustomizer", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "control", ".", "io", ".", "InputStreamReaderSource", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "control", ".", "io", ".", "ReaderSource", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "control", ".", "messages", ".", "ExceptionMessage", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "control", ".", "messages", ".", "Message", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "control", ".", "messages", ".", "SimpleMessage", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "syntax", ".", "SyntaxException", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "tools", ".", "GroovyClass", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "transform", ".", "ASTTransformationVisitor", ";", "import", "org", ".", "objectweb", ".", "asm", ".", "ClassVisitor", ";", "import", "org", ".", "objectweb", ".", "asm", ".", "ClassWriter", ";", "import", "java", ".", "io", ".", "File", ";", "import", "java", ".", "io", ".", "FileOutputStream", ";", "import", "java", ".", "io", ".", "IOException", ";", "import", "java", ".", "io", ".", "InputStream", ";", "import", "java", ".", "net", ".", "URL", ";", "import", "java", ".", "security", ".", "CodeSource", ";", "import", "java", ".", "util", ".", "*", ";", "public", "class", "CompilationUnit", "extends", "ProcessingUnit", "{", "private", "GroovyClassLoader", "transformLoader", ";", "protected", "Map", "<", "String", ",", "SourceUnit", ">", "sources", ";", "protected", "Map", "summariesBySourceName", ";", "protected", "Map", "summariesByPublicClassName", ";", "protected", "Map", "classSourcesByPublicClassName", ";", "protected", "List", "<", "String", ">", "names", ";", "protected", "LinkedList", "<", "SourceUnit", ">", "queuedSources", ";", "protected", "CompileUnit", "ast", ";", "protected", "List", "<", "GroovyClass", ">", "generatedClasses", ";", "protected", "Verifier", "verifier", ";", "protected", "boolean", "debug", ";", "protected", "boolean", "configured", ";", "protected", "ClassgenCallback", "classgenCallback", ";", "protected", "ProgressCallback", "progressCallback", ";", "protected", "ResolveVisitor", "resolveVisitor", ";", "protected", "StaticImportVisitor", "staticImportVisitor", ";", "protected", "OptimizerVisitor", "optimizer", ";", "LinkedList", "[", "]", "phaseOperations", ";", "LinkedList", "[", "]", "newPhaseOperations", ";", "public", "CompilationUnit", "(", ")", "{", "this", "(", "null", ",", "null", ",", "null", ")", ";", "}", "public", "CompilationUnit", "(", "GroovyClassLoader", "loader", ")", "{", "this", "(", "null", ",", "null", ",", "loader", ")", ";", "}", "public", "CompilationUnit", "(", "CompilerConfiguration", "configuration", ")", "{", "this", "(", "configuration", ",", "null", ",", "null", ")", ";", "}", "public", "CompilationUnit", "(", "CompilerConfiguration", "configuration", ",", "CodeSource", "security", ",", "GroovyClassLoader", "loader", ")", "{", "this", "(", "configuration", ",", "security", ",", "loader", ",", "null", ",", "true", ",", "null", ")", ";", "}", "public", "CompilationUnit", "(", "CompilerConfiguration", "configuration", ",", "CodeSource", "security", ",", "GroovyClassLoader", "loader", ",", "GroovyClassLoader", "transformLoader", ",", "boolean", "allowTransforms", ",", "String", "localTransformsToRunOnReconcile", ")", "{", "super", "(", "configuration", ",", "loader", ",", "null", ")", ";", "this", ".", "allowTransforms", "=", "allowTransforms", ";", "this", ".", "transformLoader", "=", "transformLoader", ";", "this", ".", "names", "=", "new", "ArrayList", "<", "String", ">", "(", ")", ";", "this", ".", "queuedSources", "=", "new", "LinkedList", "<", "SourceUnit", ">", "(", ")", ";", "this", ".", "sources", "=", "new", "HashMap", "<", "String", ",", "SourceUnit", ">", "(", ")", ";", "this", ".", "summariesBySourceName", "=", "new", "HashMap", "(", ")", ";", "this", ".", "summariesByPublicClassName", "=", "new", "HashMap", "(", ")", ";", "this", ".", "classSourcesByPublicClassName", "=", "new", "HashMap", "(", ")", ";", "this", ".", "ast", "=", "new", "CompileUnit", "(", "this", ".", "classLoader", ",", "security", ",", "this", ".", "configuration", ")", ";", "this", ".", "generatedClasses", "=", "new", "ArrayList", "<", "GroovyClass", ">", "(", ")", ";", "this", ".", "verifier", "=", "new", "Verifier", "(", ")", ";", "this", ".", "resolveVisitor", "=", "new", "ResolveVisitor", "(", "this", ")", ";", "this", ".", "staticImportVisitor", "=", "new", "StaticImportVisitor", "(", ")", ";", "this", ".", "optimizer", "=", "new", "OptimizerVisitor", "(", "this", ")", ";", "if", "(", "localTransformsToRunOnReconcile", "==", "null", ")", "{", "this", ".", "localTransformsToRunOnReconcile", "=", "Collections", ".", "emptyList", "(", ")", ";", "}", "else", "{", "this", ".", "localTransformsToRunOnReconcile", "=", "new", "ArrayList", "<", "String", ">", "(", ")", ";", "try", "{", "StringTokenizer", "st", "=", "new", "StringTokenizer", "(", "localTransformsToRunOnReconcile", ",", "\",\"", ")", ";", "while", "(", "st", ".", "hasMoreElements", "(", ")", ")", "{", "String", "classname", "=", "st", ".", "nextToken", "(", ")", ";", "this", ".", "localTransformsToRunOnReconcile", ".", "add", "(", "classname", ")", ";", "}", "}", "catch", "(", "Exception", "e", ")", "{", "}", "}", "phaseOperations", "=", "new", "LinkedList", "[", "Phases", ".", "ALL", "+", "1", "]", ";", "newPhaseOperations", "=", "new", "LinkedList", "[", "Phases", ".", "ALL", "+", "1", "]", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "phaseOperations", ".", "length", ";", "i", "++", ")", "{", "phaseOperations", "[", "i", "]", "=", "new", "LinkedList", "(", ")", ";", "newPhaseOperations", "[", "i", "]", "=", "new", "LinkedList", "(", ")", ";", "}", "addPhaseOperation", "(", "new", "SourceUnitOperation", "(", ")", "{", "public", "void", "call", "(", "SourceUnit", "source", ")", "throws", "CompilationFailedException", "{", "source", ".", "parse", "(", ")", ";", "}", "}", ",", "Phases", ".", "PARSING", ")", ";", "addPhaseOperation", "(", "convert", ",", "Phases", ".", "CONVERSION", ")", ";", "addPhaseOperation", "(", "new", "PrimaryClassNodeOperation", "(", ")", "{", "public", "void", "call", "(", "SourceUnit", "source", ",", "GeneratorContext", "context", ",", "ClassNode", "classNode", ")", "throws", "CompilationFailedException", "{", "EnumVisitor", "ev", "=", "new", "EnumVisitor", "(", "CompilationUnit", ".", "this", ",", "source", ")", ";", "ev", ".", "visitClass", "(", "classNode", ")", ";", "}", "}", ",", "Phases", ".", "CONVERSION", ")", ";", "addPhaseOperation", "(", "resolve", ",", "Phases", ".", "SEMANTIC_ANALYSIS", ")", ";", "addPhaseOperation", "(", "staticImport", ",", "Phases", ".", "SEMANTIC_ANALYSIS", ")", ";", "addPhaseOperation", "(", "new", "PrimaryClassNodeOperation", "(", ")", "{", "@", "Override", "public", "void", "call", "(", "SourceUnit", "source", ",", "GeneratorContext", "context", ",", "ClassNode", "classNode", ")", "throws", "CompilationFailedException", "{", "InnerClassVisitor", "iv", "=", "new", "InnerClassVisitor", "(", "CompilationUnit", ".", "this", ",", "source", ")", ";", "iv", ".", "visitClass", "(", "classNode", ")", ";", "}", "}", ",", "Phases", ".", "SEMANTIC_ANALYSIS", ")", ";", "addPhaseOperation", "(", "compileCompleteCheck", ",", "Phases", ".", "CANONICALIZATION", ")", ";", "addPhaseOperation", "(", "classgen", ",", "Phases", ".", "CLASS_GENERATION", ")", ";", "ASTTransformationVisitor", ".", "addPhaseOperations", "(", "this", ")", ";", "addPhaseOperation", "(", "new", "PrimaryClassNodeOperation", "(", ")", "{", "@", "Override", "public", "void", "call", "(", "SourceUnit", "source", ",", "GeneratorContext", "context", ",", "ClassNode", "classNode", ")", "throws", "CompilationFailedException", "{", "StaticVerifier", "sv", "=", "new", "StaticVerifier", "(", ")", ";", "sv", ".", "visitClass", "(", "classNode", ",", "source", ")", ";", "}", "}", ",", "Phases", ".", "SEMANTIC_ANALYSIS", ")", ";", "addPhaseOperation", "(", "new", "PrimaryClassNodeOperation", "(", ")", "{", "@", "Override", "public", "void", "call", "(", "SourceUnit", "source", ",", "GeneratorContext", "context", ",", "ClassNode", "classNode", ")", "throws", "CompilationFailedException", "{", "InnerClassCompletionVisitor", "iv", "=", "new", "InnerClassCompletionVisitor", "(", ")", ";", "iv", ".", "visitClass", "(", "classNode", ")", ";", "}", "}", ",", "Phases", ".", "CANONICALIZATION", ")", ";", "addPhaseOperation", "(", "new", "PrimaryClassNodeOperation", "(", ")", "{", "public", "void", "call", "(", "SourceUnit", "source", ",", "GeneratorContext", "context", ",", "ClassNode", "classNode", ")", "throws", "CompilationFailedException", "{", "EnumCompletionVisitor", "ecv", "=", "new", "EnumCompletionVisitor", "(", "CompilationUnit", ".", "this", ",", "source", ")", ";", "ecv", ".", "visitClass", "(", "classNode", ")", ";", "}", "}", ",", "Phases", ".", "CANONICALIZATION", ")", ";", "if", "(", "configuration", "!=", "null", ")", "{", "final", "List", "<", "CompilationCustomizer", ">", "customizers", "=", "configuration", ".", "getCompilationCustomizers", "(", ")", ";", "for", "(", "CompilationCustomizer", "customizer", ":", "customizers", ")", "{", "addPhaseOperation", "(", "customizer", ",", "customizer", ".", "getPhase", "(", ")", ".", "getPhaseNumber", "(", ")", ")", ";", "}", "}", "this", ".", "classgenCallback", "=", "null", ";", "}", "public", "void", "ensureASTTransformVisitorAdded", "(", ")", "{", "ASTTransformationVisitor", ".", "addPhaseOperations", "(", "this", ")", ";", "}", "public", "GroovyClassLoader", "getTransformLoader", "(", ")", "{", "return", "transformLoader", "==", "null", "?", "getClassLoader", "(", ")", ":", "transformLoader", ";", "}", "public", "void", "addPhaseOperation", "(", "SourceUnitOperation", "op", ",", "int", "phase", ")", "{", "if", "(", "phase", "<", "0", "||", "phase", ">", "Phases", ".", "ALL", ")", "throw", "new", "IllegalArgumentException", "(", "\"phase", "\"", "+", "phase", "+", "\"", "is", "unknown\"", ")", ";", "phaseOperations", "[", "phase", "]", ".", "add", "(", "op", ")", ";", "}", "public", "void", "addPhaseOperation", "(", "PrimaryClassNodeOperation", "op", ",", "int", "phase", ")", "{", "if", "(", "phase", "<", "0", "||", "phase", ">", "Phases", ".", "ALL", ")", "throw", "new", "IllegalArgumentException", "(", "\"phase", "\"", "+", "phase", "+", "\"", "is", "unknown\"", ")", ";", "phaseOperations", "[", "phase", "]", ".", "add", "(", "op", ")", ";", "}", "public", "void", "addPhaseOperation", "(", "GroovyClassOperation", "op", ")", "{", "phaseOperations", "[", "Phases", ".", "OUTPUT", "]", ".", "addFirst", "(", "op", ")", ";", "}", "public", "void", "addNewPhaseOperation", "(", "SourceUnitOperation", "op", ",", "int", "phase", ")", "{", "if", "(", "phase", "<", "0", "||", "phase", ">", "Phases", ".", "ALL", ")", "throw", "new", "IllegalArgumentException", "(", "\"phase", "\"", "+", "phase", "+", "\"", "is", "unknown\"", ")", ";", "newPhaseOperations", "[", "phase", "]", ".", "add", "(", "op", ")", ";", "}", "public", "boolean", "removeOutputPhaseOperation", "(", ")", "{", "return", "phaseOperations", "[", "Phases", ".", "OUTPUT", "]", ".", "remove", "(", "output", ")", ";", "}", "public", "void", "configure", "(", "CompilerConfiguration", "configuration", ")", "{", "super", ".", "configure", "(", "configuration", ")", ";", "this", ".", "debug", "=", "configuration", ".", "getDebug", "(", ")", ";", "if", "(", "!", "this", ".", "configured", "&&", "this", ".", "classLoader", "instanceof", "GroovyClassLoader", ")", "{", "appendCompilerConfigurationClasspathToClassLoader", "(", "configuration", ",", "(", "GroovyClassLoader", ")", "this", ".", "classLoader", ")", ";", "}", "this", ".", "configured", "=", "true", ";", "}", "private", "void", "appendCompilerConfigurationClasspathToClassLoader", "(", "CompilerConfiguration", "configuration", ",", "GroovyClassLoader", "classLoader", ")", "{", "}", "public", "CompileUnit", "getAST", "(", ")", "{", "return", "this", ".", "ast", ";", "}", "public", "Map", "getSummariesBySourceName", "(", ")", "{", "return", "summariesBySourceName", ";", "}", "public", "Map", "getSummariesByPublicClassName", "(", ")", "{", "return", "summariesByPublicClassName", ";", "}", "public", "Map", "getClassSourcesByPublicClassName", "(", ")", "{", "return", "classSourcesByPublicClassName", ";", "}", "public", "boolean", "isPublicClass", "(", "String", "className", ")", "{", "return", "summariesByPublicClassName", ".", "containsKey", "(", "className", ")", ";", "}", "public", "List", "getClasses", "(", ")", "{", "return", "generatedClasses", ";", "}", "public", "ClassNode", "getFirstClassNode", "(", ")", "{", "return", "this", ".", "ast", ".", "getModules", "(", ")", ".", "get", "(", "0", ")", ".", "getClasses", "(", ")", ".", "get", "(", "0", ")", ";", "}", "public", "ClassNode", "getClassNode", "(", "final", "String", "name", ")", "{", "final", "ClassNode", "[", "]", "result", "=", "new", "ClassNode", "[", "]", "{", "null", "}", ";", "PrimaryClassNodeOperation", "handler", "=", "new", "PrimaryClassNodeOperation", "(", ")", "{", "public", "void", "call", "(", "SourceUnit", "source", ",", "GeneratorContext", "context", ",", "ClassNode", "classNode", ")", "{", "if", "(", "classNode", ".", "getName", "(", ")", ".", "equals", "(", "name", ")", ")", "{", "result", "[", "0", "]", "=", "classNode", ";", "}", "}", "}", ";", "try", "{", "applyToPrimaryClassNodes", "(", "handler", ")", ";", "}", "catch", "(", "CompilationFailedException", "e", ")", "{", "if", "(", "debug", ")", "e", ".", "printStackTrace", "(", ")", ";", "}", "return", "result", "[", "0", "]", ";", "}", "public", "void", "addSources", "(", "String", "[", "]", "paths", ")", "{", "for", "(", "String", "path", ":", "paths", ")", "{", "addSource", "(", "new", "File", "(", "path", ")", ")", ";", "}", "}", "public", "void", "addSources", "(", "File", "[", "]", "files", ")", "{", "for", "(", "File", "file", ":", "files", ")", "{", "addSource", "(", "file", ")", ";", "}", "}", "public", "SourceUnit", "addSource", "(", "File", "file", ")", "{", "return", "addSource", "(", "new", "SourceUnit", "(", "file", ",", "configuration", ",", "classLoader", ",", "getErrorCollector", "(", ")", ")", ")", ";", "}", "public", "SourceUnit", "addSource", "(", "URL", "url", ")", "{", "return", "addSource", "(", "new", "SourceUnit", "(", "url", ",", "configuration", ",", "classLoader", ",", "getErrorCollector", "(", ")", ")", ")", ";", "}", "public", "SourceUnit", "addSource", "(", "String", "name", ",", "InputStream", "stream", ")", "{", "ReaderSource", "source", "=", "new", "InputStreamReaderSource", "(", "stream", ",", "configuration", ")", ";", "return", "addSource", "(", "new", "SourceUnit", "(", "name", ",", "source", ",", "configuration", ",", "classLoader", ",", "getErrorCollector", "(", ")", ")", ")", ";", "}", "public", "SourceUnit", "addSource", "(", "String", "name", ",", "String", "scriptText", ")", "{", "return", "addSource", "(", "new", "SourceUnit", "(", "name", ",", "scriptText", ",", "configuration", ",", "classLoader", ",", "getErrorCollector", "(", ")", ")", ")", ";", "}", "public", "SourceUnit", "addSource", "(", "SourceUnit", "source", ")", "{", "String", "name", "=", "source", ".", "getName", "(", ")", ";", "source", ".", "setClassLoader", "(", "this", ".", "classLoader", ")", ";", "for", "(", "SourceUnit", "su", ":", "queuedSources", ")", "{", "if", "(", "name", ".", "equals", "(", "su", ".", "getName", "(", ")", ")", ")", "return", "su", ";", "}", "if", "(", "iterating", ")", "{", "GroovyBugError", "gbe", "=", "new", "GroovyBugError", "(", "\"\"", "+", "source", ".", "getName", "(", ")", "+", "\"'\"", ")", ";", "gbe", ".", "printStackTrace", "(", ")", ";", "throw", "gbe", ";", "}", "queuedSources", ".", "add", "(", "source", ")", ";", "return", "source", ";", "}", "public", "Iterator", "<", "SourceUnit", ">", "iterator", "(", ")", "{", "return", "new", "Iterator", "<", "SourceUnit", ">", "(", ")", "{", "Iterator", "<", "String", ">", "nameIterator", "=", "names", ".", "iterator", "(", ")", ";", "public", "boolean", "hasNext", "(", ")", "{", "return", "nameIterator", ".", "hasNext", "(", ")", ";", "}", "public", "SourceUnit", "next", "(", ")", "{", "String", "name", "=", "nameIterator", ".", "next", "(", ")", ";", "return", "sources", ".", "get", "(", "name", ")", ";", "}", "public", "void", "remove", "(", ")", "{", "throw", "new", "UnsupportedOperationException", "(", ")", ";", "}", "}", ";", "}", "public", "void", "addClassNode", "(", "ClassNode", "node", ")", "{", "ModuleNode", "module", "=", "new", "ModuleNode", "(", "this", ".", "ast", ")", ";", "this", ".", "ast", ".", "addModule", "(", "module", ")", ";", "module", ".", "addClass", "(", "node", ")", ";", "}", "public", "abstract", "static", "class", "ClassgenCallback", "{", "public", "abstract", "void", "call", "(", "ClassVisitor", "writer", ",", "ClassNode", "node", ")", "throws", "CompilationFailedException", ";", "}", "public", "void", "setClassgenCallback", "(", "ClassgenCallback", "visitor", ")", "{", "this", ".", "classgenCallback", "=", "visitor", ";", "}", "public", "abstract", "static", "class", "ProgressCallback", "{", "public", "abstract", "void", "call", "(", "ProcessingUnit", "context", ",", "int", "phase", ")", "throws", "CompilationFailedException", ";", "}", "public", "interface", "ProgressListener", "{", "void", "parseComplete", "(", "int", "phase", ",", "String", "sourceUnitName", ")", ";", "void", "generateComplete", "(", "int", "phase", ",", "ClassNode", "classNode", ")", ";", "}", "private", "ProgressListener", "getProgressListener", "(", ")", "{", "return", "this", ".", "listener", ";", "}", "public", "void", "setProgressListener", "(", "ProgressListener", "listener", ")", "{", "this", ".", "listener", "=", "listener", ";", "}", "private", "ProgressListener", "listener", ";", "public", "void", "setProgressCallback", "(", "ProgressCallback", "callback", ")", "{", "this", ".", "progressCallback", "=", "callback", ";", "}", "public", "void", "compile", "(", ")", "throws", "CompilationFailedException", "{", "compile", "(", "Phases", ".", "ALL", ")", ";", "}", "public", "void", "compile", "(", "int", "throughPhase", ")", "throws", "CompilationFailedException", "{", "gotoPhase", "(", "Phases", ".", "INITIALIZATION", ")", ";", "throughPhase", "=", "Math", ".", "min", "(", "throughPhase", ",", "Phases", ".", "ALL", ")", ";", "while", "(", "throughPhase", ">=", "phase", "&&", "phase", "<=", "Phases", ".", "ALL", ")", "{", "if", "(", "phase", "==", "Phases", ".", "SEMANTIC_ANALYSIS", ")", "{", "doPhaseOperation", "(", "resolve", ")", ";", "if", "(", "dequeued", "(", ")", ")", "continue", ";", "}", "processPhaseOperations", "(", "phase", ")", ";", "processNewPhaseOperations", "(", "phase", ")", ";", "if", "(", "progressCallback", "!=", "null", ")", "progressCallback", ".", "call", "(", "this", ",", "phase", ")", ";", "completePhase", "(", ")", ";", "applyToSourceUnits", "(", "mark", ")", ";", "if", "(", "dequeued", "(", ")", ")", "continue", ";", "gotoPhase", "(", "phase", "+", "1", ")", ";", "if", "(", "phase", "==", "Phases", ".", "CLASS_GENERATION", ")", "{", "sortClasses", "(", ")", ";", "}", "}", "errorCollector", ".", "failIfErrors", "(", ")", ";", "}", "private", "void", "processPhaseOperations", "(", "int", "ph", ")", "{", "LinkedList", "ops", "=", "phaseOperations", "[", "ph", "]", ";", "for", "(", "Object", "next", ":", "ops", ")", "{", "doPhaseOperation", "(", "next", ")", ";", "}", "}", "private", "void", "processNewPhaseOperations", "(", "int", "currPhase", ")", "{", "recordPhaseOpsInAllOtherPhases", "(", "currPhase", ")", ";", "LinkedList", "currentPhaseNewOps", "=", "newPhaseOperations", "[", "currPhase", "]", ";", "while", "(", "!", "currentPhaseNewOps", ".", "isEmpty", "(", ")", ")", "{", "Object", "operation", "=", "currentPhaseNewOps", ".", "removeFirst", "(", ")", ";", "phaseOperations", "[", "currPhase", "]", ".", "add", "(", "operation", ")", ";", "doPhaseOperation", "(", "operation", ")", ";", "recordPhaseOpsInAllOtherPhases", "(", "currPhase", ")", ";", "currentPhaseNewOps", "=", "newPhaseOperations", "[", "currPhase", "]", ";", "}", "}", "private", "void", "doPhaseOperation", "(", "Object", "operation", ")", "{", "if", "(", "operation", "instanceof", "PrimaryClassNodeOperation", ")", "{", "applyToPrimaryClassNodes", "(", "(", "PrimaryClassNodeOperation", ")", "operation", ")", ";", "}", "else", "if", "(", "operation", "instanceof", "SourceUnitOperation", ")", "{", "applyToSourceUnits", "(", "(", "SourceUnitOperation", ")", "operation", ")", ";", "}", "else", "{", "applyToGeneratedGroovyClasses", "(", "(", "GroovyClassOperation", ")", "operation", ")", ";", "}", "}", "private", "void", "recordPhaseOpsInAllOtherPhases", "(", "int", "currPhase", ")", "{", "for", "(", "int", "ph", "=", "Phases", ".", "INITIALIZATION", ";", "ph", "<=", "Phases", ".", "ALL", ";", "ph", "++", ")", "{", "if", "(", "ph", "!=", "currPhase", "&&", "!", "newPhaseOperations", "[", "ph", "]", ".", "isEmpty", "(", ")", ")", "{", "phaseOperations", "[", "ph", "]", ".", "addAll", "(", "newPhaseOperations", "[", "ph", "]", ")", ";", "newPhaseOperations", "[", "ph", "]", ".", "clear", "(", ")", ";", "}", "}", "}", "private", "void", "sortClasses", "(", ")", "throws", "CompilationFailedException", "{", "for", "(", "ModuleNode", "module", ":", "this", ".", "ast", ".", "getModules", "(", ")", ")", "{", "module", ".", "sortClasses", "(", ")", ";", "}", "}", "protected", "boolean", "dequeued", "(", ")", "throws", "CompilationFailedException", "{", "boolean", "dequeue", "=", "!", "queuedSources", ".", "isEmpty", "(", ")", ";", "while", "(", "!", "queuedSources", ".", "isEmpty", "(", ")", ")", "{", "SourceUnit", "su", "=", "queuedSources", ".", "removeFirst", "(", ")", ";", "String", "name", "=", "su", ".", "getName", "(", ")", ";", "if", "(", "iterating", ")", "{", "GroovyBugError", "gbe", "=", "new", "GroovyBugError", "(", "\"\"", "+", "su", ".", "getName", "(", ")", "+", "\"'\"", ")", ";", "gbe", ".", "printStackTrace", "(", ")", ";", "throw", "gbe", ";", "}", "names", ".", "add", "(", "name", ")", ";", "sources", ".", "put", "(", "name", ",", "su", ")", ";", "}", "if", "(", "dequeue", ")", "{", "gotoPhase", "(", "Phases", ".", "INITIALIZATION", ")", ";", "}", "return", "dequeue", ";", "}", "private", "final", "SourceUnitOperation", "resolve", "=", "new", "SourceUnitOperation", "(", ")", "{", "public", "void", "call", "(", "SourceUnit", "source", ")", "throws", "CompilationFailedException", "{", "List", "<", "ClassNode", ">", "classes", "=", "source", ".", "ast", ".", "getClasses", "(", ")", ";", "for", "(", "ClassNode", "node", ":", "classes", ")", "{", "VariableScopeVisitor", "scopeVisitor", "=", "new", "VariableScopeVisitor", "(", "source", ")", ";", "scopeVisitor", ".", "visitClass", "(", "node", ")", ";", "resolveVisitor", ".", "startResolving", "(", "node", ",", "source", ")", ";", "}", "}", "}", ";", "private", "PrimaryClassNodeOperation", "staticImport", "=", "new", "PrimaryClassNodeOperation", "(", ")", "{", "public", "void", "call", "(", "SourceUnit", "source", ",", "GeneratorContext", "context", ",", "ClassNode", "classNode", ")", "throws", "CompilationFailedException", "{", "if", "(", "staticImportVisitor", "!=", "null", ")", "{", "staticImportVisitor", ".", "visitClass", "(", "classNode", ",", "source", ")", ";", "}", "}", "}", ";", "private", "SourceUnitOperation", "convert", "=", "new", "SourceUnitOperation", "(", ")", "{", "public", "void", "call", "(", "SourceUnit", "source", ")", "throws", "CompilationFailedException", "{", "source", ".", "convert", "(", ")", ";", "CompilationUnit", ".", "this", ".", "ast", ".", "addModule", "(", "source", ".", "getAST", "(", ")", ")", ";", "if", "(", "CompilationUnit", ".", "this", ".", "progressCallback", "!=", "null", ")", "{", "CompilationUnit", ".", "this", ".", "progressCallback", ".", "call", "(", "source", ",", "CompilationUnit", ".", "this", ".", "phase", ")", ";", "}", "}", "}", ";", "private", "GroovyClassOperation", "output", "=", "new", "GroovyClassOperation", "(", ")", "{", "public", "void", "call", "(", "GroovyClass", "gclass", ")", "throws", "CompilationFailedException", "{", "String", "name", "=", "gclass", ".", "getName", "(", ")", ".", "replace", "(", "'.'", ",", "File", ".", "separatorChar", ")", "+", "\".class\"", ";", "File", "path", "=", "new", "File", "(", "configuration", ".", "getTargetDirectory", "(", ")", ",", "name", ")", ";", "File", "directory", "=", "path", ".", "getParentFile", "(", ")", ";", "if", "(", "directory", "!=", "null", "&&", "!", "directory", ".", "exists", "(", ")", ")", "{", "directory", ".", "mkdirs", "(", ")", ";", "}", "byte", "[", "]", "bytes", "=", "gclass", ".", "getBytes", "(", ")", ";", "FileOutputStream", "stream", "=", "null", ";", "try", "{", "stream", "=", "new", "FileOutputStream", "(", "path", ")", ";", "stream", ".", "write", "(", "bytes", ",", "0", ",", "bytes", ".", "length", ")", ";", "}", "catch", "(", "IOException", "e", ")", "{", "getErrorCollector", "(", ")", ".", "addError", "(", "Message", ".", "create", "(", "e", ".", "getMessage", "(", ")", ",", "CompilationUnit", ".", "this", ")", ")", ";", "}", "finally", "{", "if", "(", "stream", "!=", "null", ")", "{", "try", "{", "stream", ".", "close", "(", ")", ";", "}", "catch", "(", "Exception", "e", ")", "{", "}", "}", "}", "}", "}", ";", "private", "SourceUnitOperation", "compileCompleteCheck", "=", "new", "SourceUnitOperation", "(", ")", "{", "public", "void", "call", "(", "SourceUnit", "source", ")", "throws", "CompilationFailedException", "{", "List", "<", "ClassNode", ">", "classes", "=", "source", ".", "ast", ".", "getClasses", "(", ")", ";", "for", "(", "ClassNode", "node", ":", "classes", ")", "{", "CompileUnit", "cu", "=", "node", ".", "getCompileUnit", "(", ")", ";", "for", "(", "Iterator", "iter", "=", "cu", ".", "iterateClassNodeToCompile", "(", ")", ";", "iter", ".", "hasNext", "(", ")", ";", ")", "{", "String", "name", "=", "(", "String", ")", "iter", ".", "next", "(", ")", ";", "SourceUnit", "su", "=", "ast", ".", "getScriptSourceLocation", "(", "name", ")", ";", "List", "<", "ClassNode", ">", "classesInSourceUnit", "=", "su", ".", "ast", ".", "getClasses", "(", ")", ";", "StringBuffer", "message", "=", "new", "StringBuffer", "(", ")", ";", "message", ".", "append", "(", "\"\"", ")", ".", "append", "(", "name", ")", ".", "append", "(", "\"", "in", "\"", ")", ".", "append", "(", "su", ".", "getName", "(", ")", ")", ";", "if", "(", "classesInSourceUnit", ".", "isEmpty", "(", ")", ")", "{", "message", ".", "append", "(", "\"\"", ")", ";", "}", "else", "{", "message", ".", "append", "(", "\"\"", ")", ";", "boolean", "first", "=", "true", ";", "for", "(", "ClassNode", "cn", ":", "classesInSourceUnit", ")", "{", "if", "(", "!", "first", ")", "{", "message", ".", "append", "(", "\",", "\"", ")", ";", "}", "else", "{", "first", "=", "false", ";", "}", "message", ".", "append", "(", "cn", ".", "getName", "(", ")", ")", ";", "}", "}", "getErrorCollector", "(", ")", ".", "addErrorAndContinue", "(", "new", "SimpleMessage", "(", "message", ".", "toString", "(", ")", ",", "CompilationUnit", ".", "this", ")", ")", ";", "iter", ".", "remove", "(", ")", ";", "}", "}", "}", "}", ";", "private", "PrimaryClassNodeOperation", "classgen", "=", "new", "PrimaryClassNodeOperation", "(", ")", "{", "public", "boolean", "needSortedInput", "(", ")", "{", "return", "true", ";", "}", "public", "void", "call", "(", "SourceUnit", "source", ",", "GeneratorContext", "context", ",", "ClassNode", "classNode", ")", "throws", "CompilationFailedException", "{", "optimizer", ".", "visitClass", "(", "classNode", ",", "source", ")", ";", "if", "(", "!", "classNode", ".", "isSynthetic", "(", ")", ")", "{", "GenericsVisitor", "genericsVisitor", "=", "new", "GenericsVisitor", "(", "source", ")", ";", "genericsVisitor", ".", "visitClass", "(", "classNode", ")", ";", "}", "try", "{", "verifier", ".", "visitClass", "(", "classNode", ")", ";", "}", "catch", "(", "GroovyRuntimeException", "rpe", ")", "{", "ASTNode", "node", "=", "rpe", ".", "getNode", "(", ")", ";", "getErrorCollector", "(", ")", ".", "addError", "(", "new", "SyntaxException", "(", "rpe", ".", "getMessage", "(", ")", ",", "null", ",", "node", ".", "getLineNumber", "(", ")", ",", "node", ".", "getColumnNumber", "(", ")", ")", ",", "source", ")", ";", "}", "LabelVerifier", "lv", "=", "new", "LabelVerifier", "(", "source", ")", ";", "lv", ".", "visitClass", "(", "classNode", ")", ";", "ClassCompletionVerifier", "completionVerifier", "=", "new", "ClassCompletionVerifier", "(", "source", ")", ";", "completionVerifier", ".", "visitClass", "(", "classNode", ")", ";", "ExtendedVerifier", "xverifier", "=", "new", "ExtendedVerifier", "(", "source", ")", ";", "xverifier", ".", "visitClass", "(", "classNode", ")", ";", "getErrorCollector", "(", ")", ".", "failIfErrors", "(", ")", ";", "ClassVisitor", "visitor", "=", "createClassVisitor", "(", ")", ";", "String", "sourceName", "=", "(", "source", "==", "null", "?", "classNode", ".", "getModule", "(", ")", ".", "getDescription", "(", ")", ":", "source", ".", "getName", "(", ")", ")", ";", "if", "(", "sourceName", "!=", "null", ")", "sourceName", "=", "sourceName", ".", "substring", "(", "Math", ".", "max", "(", "sourceName", ".", "lastIndexOf", "(", "'\\\\'", ")", ",", "sourceName", ".", "lastIndexOf", "(", "'/'", ")", ")", "+", "1", ")", ";", "ClassGenerator", "generator", "=", "new", "AsmClassGenerator", "(", "source", ",", "context", ",", "visitor", ",", "sourceName", ")", ";", "if", "(", "!", "source", ".", "getErrorCollector", "(", ")", ".", "hasErrors", "(", ")", ")", "{", "generator", ".", "visitClass", "(", "classNode", ")", ";", "byte", "[", "]", "bytes", "=", "(", "(", "ClassWriter", ")", "visitor", ")", ".", "toByteArray", "(", ")", ";", "generatedClasses", ".", "add", "(", "new", "GroovyClass", "(", "classNode", ".", "getName", "(", ")", ",", "bytes", ",", "classNode", ",", "source", ")", ")", ";", "if", "(", "CompilationUnit", ".", "this", ".", "classgenCallback", "!=", "null", ")", "{", "classgenCallback", ".", "call", "(", "visitor", ",", "classNode", ")", ";", "}", "LinkedList", "innerClasses", "=", "generator", ".", "getInnerClasses", "(", ")", ";", "while", "(", "!", "innerClasses", ".", "isEmpty", "(", ")", ")", "{", "classgen", ".", "call", "(", "source", ",", "context", ",", "(", "ClassNode", ")", "innerClasses", ".", "removeFirst", "(", ")", ")", ";", "}", "}", "}", "}", ";", "protected", "ClassVisitor", "createClassVisitor", "(", ")", "{", "return", "new", "ClassWriter", "(", "ClassWriter", ".", "COMPUTE_MAXS", ")", ";", "}", "protected", "void", "mark", "(", ")", "throws", "CompilationFailedException", "{", "applyToSourceUnits", "(", "mark", ")", ";", "}", "private", "SourceUnitOperation", "mark", "=", "new", "SourceUnitOperation", "(", ")", "{", "public", "void", "call", "(", "SourceUnit", "source", ")", "throws", "CompilationFailedException", "{", "if", "(", "source", ".", "phase", "<", "phase", ")", "{", "source", ".", "gotoPhase", "(", "phase", ")", ";", "}", "if", "(", "source", ".", "phase", "==", "phase", "&&", "phaseComplete", "&&", "!", "source", ".", "phaseComplete", ")", "{", "source", ".", "completePhase", "(", ")", ";", "}", "}", "}", ";", "public", "abstract", "static", "class", "SourceUnitOperation", "{", "public", "abstract", "void", "call", "(", "SourceUnit", "source", ")", "throws", "CompilationFailedException", ";", "}", "private", "boolean", "iterating", "=", "false", ";", "public", "void", "applyToSourceUnits", "(", "SourceUnitOperation", "body", ")", "throws", "CompilationFailedException", "{", "try", "{", "iterating", "=", "true", ";", "for", "(", "String", "name", ":", "names", ")", "{", "SourceUnit", "source", "=", "sources", ".", "get", "(", "name", ")", ";", "if", "(", "(", "source", ".", "phase", "<", "phase", ")", "||", "(", "source", ".", "phase", "==", "phase", "&&", "!", "source", ".", "phaseComplete", ")", ")", "{", "try", "{", "body", ".", "call", "(", "source", ")", ";", "if", "(", "phase", "==", "Phases", ".", "CONVERSION", "&&", "getProgressListener", "(", ")", "!=", "null", "&&", "body", "==", "phaseOperations", "[", "phase", "]", ".", "getLast", "(", ")", ")", "{", "getProgressListener", "(", ")", ".", "parseComplete", "(", "phase", ",", "name", ")", ";", "}", "}", "catch", "(", "CompilationFailedException", "e", ")", "{", "throw", "e", ";", "}", "catch", "(", "Exception", "e", ")", "{", "GroovyBugError", "gbe", "=", "new", "GroovyBugError", "(", "e", ")", ";", "changeBugText", "(", "gbe", ",", "source", ")", ";", "throw", "gbe", ";", "}", "catch", "(", "GroovyBugError", "e", ")", "{", "changeBugText", "(", "e", ",", "source", ")", ";", "throw", "e", ";", "}", "}", "}", "}", "finally", "{", "iterating", "=", "false", ";", "}", "getErrorCollector", "(", ")", ".", "failIfErrors", "(", ")", ";", "}", "public", "abstract", "static", "class", "PrimaryClassNodeOperation", "{", "public", "abstract", "void", "call", "(", "SourceUnit", "source", ",", "GeneratorContext", "context", ",", "ClassNode", "classNode", ")", "throws", "CompilationFailedException", ";", "public", "boolean", "needSortedInput", "(", ")", "{", "return", "false", ";", "}", "}", "public", "abstract", "static", "class", "GroovyClassOperation", "{", "public", "abstract", "void", "call", "(", "GroovyClass", "gclass", ")", "throws", "CompilationFailedException", ";", "}", "private", "int", "getSuperClassCount", "(", "ClassNode", "element", ")", "{", "int", "count", "=", "0", ";", "while", "(", "element", "!=", "null", ")", "{", "count", "++", ";", "element", "=", "element", ".", "getSuperClass", "(", ")", ";", "}", "return", "count", ";", "}", "private", "int", "getSuperInterfaceCount", "(", "ClassNode", "element", ")", "{", "int", "count", "=", "1", ";", "ClassNode", "[", "]", "interfaces", "=", "element", ".", "getInterfaces", "(", ")", ";", "for", "(", "ClassNode", "anInterface", ":", "interfaces", ")", "{", "count", "=", "Math", ".", "max", "(", "count", ",", "getSuperInterfaceCount", "(", "anInterface", ")", "+", "1", ")", ";", "}", "return", "count", ";", "}", "private", "List", "getPrimaryClassNodes", "(", "boolean", "sort", ")", "{", "if", "(", "sort", "==", "true", ")", "{", "List", "<", "ModuleNode", ">", "sortedModules", "=", "this", ".", "ast", ".", "getSortedModules", "(", ")", ";", "if", "(", "sortedModules", "!=", "null", ")", "{", "return", "sortedModules", ";", "}", "}", "List", "<", "ClassNode", ">", "unsorted", "=", "new", "ArrayList", "<", "ClassNode", ">", "(", ")", ";", "for", "(", "ModuleNode", "module", ":", "this", ".", "ast", ".", "getModules", "(", ")", ")", "{", "unsorted", ".", "addAll", "(", "module", ".", "getClasses", "(", ")", ")", ";", "}", "if", "(", "!", "sort", ")", "return", "unsorted", ";", "List", "<", "Integer", ">", "countIndexPairs", "=", "new", "ArrayList", "<", "Integer", ">", "(", ")", ";", "{", "int", "i", "=", "0", ";", "for", "(", "Iterator", "iter", "=", "unsorted", ".", "iterator", "(", ")", ";", "iter", ".", "hasNext", "(", ")", ";", "i", "++", ")", "{", "ClassNode", "node", "=", "(", "ClassNode", ")", "iter", ".", "next", "(", ")", ";", "if", "(", "node", ".", "isInterface", "(", ")", ")", "{", "countIndexPairs", ".", "add", "(", "(", "getSuperInterfaceCount", "(", "node", ")", "<<", "16", ")", "+", "i", ")", ";", "}", "else", "{", "countIndexPairs", ".", "add", "(", "(", "(", "getSuperClassCount", "(", "node", ")", "+", "2000", ")", "<<", "16", ")", "+", "i", ")", ";", "}", "}", "}", "Collections", ".", "sort", "(", "countIndexPairs", ")", ";", "List", "sorted", "=", "new", "ArrayList", "(", ")", ";", "for", "(", "int", "i", ":", "countIndexPairs", ")", "{", "sorted", ".", "add", "(", "unsorted", ".", "get", "(", "i", "&", "0xffff", ")", ")", ";", "}", "this", ".", "ast", ".", "setSortedModules", "(", "sorted", ")", ";", "return", "sorted", ";", "}", "private", "List", "<", "ClassNode", ">", "getSorted", "(", "int", "[", "]", "index", ",", "List", "<", "ClassNode", ">", "unsorted", ")", "{", "List", "<", "ClassNode", ">", "sorted", "=", "new", "ArrayList", "<", "ClassNode", ">", "(", "unsorted", ".", "size", "(", ")", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "unsorted", ".", "size", "(", ")", ";", "i", "++", ")", "{", "int", "min", "=", "-", "1", ";", "for", "(", "int", "j", "=", "0", ";", "j", "<", "unsorted", ".", "size", "(", ")", ";", "j", "++", ")", "{", "if", "(", "index", "[", "j", "]", "==", "-", "1", ")", "continue", ";", "if", "(", "min", "==", "-", "1", ")", "{", "min", "=", "j", ";", "}", "else", "if", "(", "index", "[", "j", "]", "<", "index", "[", "min", "]", ")", "{", "min", "=", "j", ";", "}", "}", "if", "(", "min", "==", "-", "1", ")", "break", ";", "sorted", ".", "add", "(", "unsorted", ".", "get", "(", "min", ")", ")", ";", "index", "[", "min", "]", "=", "-", "1", ";", "}", "return", "sorted", ";", "}", "public", "void", "applyToPrimaryClassNodes", "(", "PrimaryClassNodeOperation", "body", ")", "throws", "CompilationFailedException", "{", "List", "primaryClassNodes", "=", "getPrimaryClassNodes", "(", "body", ".", "needSortedInput", "(", ")", ")", ";", "Iterator", "classNodes", "=", "primaryClassNodes", ".", "iterator", "(", ")", ";", "while", "(", "classNodes", ".", "hasNext", "(", ")", ")", "{", "SourceUnit", "context", "=", "null", ";", "try", "{", "ClassNode", "classNode", "=", "(", "ClassNode", ")", "classNodes", ".", "next", "(", ")", ";", "context", "=", "classNode", ".", "getModule", "(", ")", ".", "getContext", "(", ")", ";", "if", "(", "context", "==", "null", "||", "context", ".", "phase", "<", "phase", "||", "(", "context", ".", "phase", "==", "phase", "&&", "!", "context", ".", "phaseComplete", ")", ")", "{", "int", "offset", "=", "1", ";", "Iterator", "<", "InnerClassNode", ">", "iterator", "=", "classNode", ".", "getInnerClasses", "(", ")", ";", "while", "(", "iterator", ".", "hasNext", "(", ")", ")", "{", "iterator", ".", "next", "(", ")", ";", "offset", "++", ";", "}", "body", ".", "call", "(", "context", ",", "new", "GeneratorContext", "(", "this", ".", "ast", ",", "offset", ")", ",", "classNode", ")", ";", "}", "}", "catch", "(", "CompilationFailedException", "e", ")", "{", "}", "catch", "(", "NullPointerException", "npe", ")", "{", "throw", "npe", ";", "}", "catch", "(", "GroovyBugError", "e", ")", "{", "changeBugText", "(", "e", ",", "context", ")", ";", "throw", "e", ";", "}", "catch", "(", "Exception", "e", ")", "{", "ErrorCollector", "nestedCollector", "=", "null", ";", "for", "(", "Throwable", "next", "=", "e", ".", "getCause", "(", ")", ";", "next", "!=", "e", "&&", "next", "!=", "null", ";", "next", "=", "next", ".", "getCause", "(", ")", ")", "{", "if", "(", "!", "(", "next", "instanceof", "MultipleCompilationErrorsException", ")", ")", "continue", ";", "MultipleCompilationErrorsException", "mcee", "=", "(", "MultipleCompilationErrorsException", ")", "next", ";", "nestedCollector", "=", "mcee", ".", "collector", ";", "break", ";", "}", "if", "(", "nestedCollector", "!=", "null", ")", "{", "getErrorCollector", "(", ")", ".", "addCollectorContents", "(", "nestedCollector", ")", ";", "}", "else", "{", "getErrorCollector", "(", ")", ".", "addError", "(", "new", "ExceptionMessage", "(", "e", ",", "configuration", ".", "getDebug", "(", ")", ",", "this", ")", ")", ";", "}", "}", "}", "getErrorCollector", "(", ")", ".", "failIfErrors", "(", ")", ";", "}", "public", "void", "applyToGeneratedGroovyClasses", "(", "GroovyClassOperation", "body", ")", "throws", "CompilationFailedException", "{", "if", "(", "this", ".", "phase", "!=", "Phases", ".", "OUTPUT", "&&", "!", "(", "this", ".", "phase", "==", "Phases", ".", "CLASS_GENERATION", "&&", "this", ".", "phaseComplete", ")", ")", "{", "throw", "new", "GroovyBugError", "(", "\"\"", "+", "getPhaseDescription", "(", ")", ")", ";", "}", "for", "(", "GroovyClass", "gclass", ":", "this", ".", "generatedClasses", ")", "{", "try", "{", "body", ".", "call", "(", "gclass", ")", ";", "}", "catch", "(", "CompilationFailedException", "e", ")", "{", "}", "catch", "(", "NullPointerException", "npe", ")", "{", "throw", "npe", ";", "}", "catch", "(", "GroovyBugError", "e", ")", "{", "changeBugText", "(", "e", ",", "null", ")", ";", "throw", "e", ";", "}", "catch", "(", "Exception", "e", ")", "{", "throw", "new", "GroovyBugError", "(", "e", ")", ";", "}", "}", "getErrorCollector", "(", ")", ".", "failIfErrors", "(", ")", ";", "}", "private", "void", "changeBugText", "(", "GroovyBugError", "e", ",", "SourceUnit", "context", ")", "{", "e", ".", "setBugText", "(", "\"\"", "+", "getPhaseDescription", "(", ")", "+", "\"\"", "+", "(", "(", "context", "!=", "null", ")", "?", "context", ".", "getName", "(", ")", ":", "\"?\"", ")", "+", "\"'", "\"", "+", "e", ".", "getBugText", "(", ")", ")", ";", "}", "public", "void", "setResolveVisitor", "(", "ResolveVisitor", "resolveVisitor2", ")", "{", "this", ".", "resolveVisitor", "=", "resolveVisitor2", ";", "}", "public", "ResolveVisitor", "getResolveVisitor", "(", ")", "{", "return", "this", ".", "resolveVisitor", ";", "}", "public", "String", "toString", "(", ")", "{", "if", "(", "sources", "==", "null", "||", "sources", ".", "isEmpty", "(", ")", ")", "return", "super", ".", "toString", "(", ")", ";", "Set", "s", "=", "sources", ".", "keySet", "(", ")", ";", "for", "(", "Object", "o", ":", "s", ")", "{", "return", "\"\"", "+", "o", ".", "toString", "(", ")", ";", "}", "return", "\"\"", ";", "}", "public", "boolean", "allowTransforms", "=", "true", ";", "public", "boolean", "isReconcile", "=", "false", ";", "public", "List", "<", "String", ">", "localTransformsToRunOnReconcile", "=", "null", ";", "public", "void", "tweak", "(", "boolean", "isReconcile", ")", "{", "if", "(", "isReconcile", ")", "{", "verifier", ".", "inlineStaticFieldInitializersIntoClinit", "=", "false", ";", "staticImportVisitor", ".", "isReconcile", "=", "true", ";", "}", "else", "{", "verifier", ".", "inlineStaticFieldInitializersIntoClinit", "=", "true", ";", "}", "this", ".", "isReconcile", "=", "isReconcile", ";", "}", "}", "</s>" ]
6,667
[ "<s>", "package", "org", ".", "codehaus", ".", "groovy", ".", "control", ";", "import", "groovy", ".", "lang", ".", "GroovyClassLoader", ";", "import", "java", ".", "io", ".", "File", ";", "import", "java", ".", "io", ".", "IOException", ";", "import", "java", ".", "lang", ".", "reflect", ".", "Modifier", ";", "import", "java", ".", "net", ".", "URL", ";", "import", "java", ".", "net", ".", "URLConnection", ";", "import", "java", ".", "util", ".", "HashMap", ";", "import", "java", ".", "util", ".", "HashSet", ";", "import", "java", ".", "util", ".", "LinkedHashMap", ";", "import", "java", ".", "util", ".", "LinkedList", ";", "import", "java", ".", "util", ".", "List", ";", "import", "java", ".", "util", ".", "Map", ";", "import", "java", ".", "util", ".", "Set", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "GroovyBugError", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "ASTNode", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "AnnotatedNode", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "AnnotationNode", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "ClassCodeExpressionTransformer", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "ClassHelper", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "ClassNode", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "CompileUnit", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "DynamicVariable", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "FieldNode", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "GenericsType", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "ImportNode", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "InnerClassNode", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "MethodNode", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "ModuleNode", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "Parameter", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "PropertyNode", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "Variable", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "VariableScope", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "expr", ".", "AnnotationConstantExpression", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "expr", ".", "BinaryExpression", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "expr", ".", "CastExpression", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "expr", ".", "ClassExpression", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "expr", ".", "ClosureExpression", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "expr", ".", "ConstantExpression", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "expr", ".", "ConstructorCallExpression", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "expr", ".", "DeclarationExpression", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "expr", ".", "Expression", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "expr", ".", "ListExpression", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "expr", ".", "MapEntryExpression", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "expr", ".", "MapExpression", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "expr", ".", "MethodCallExpression", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "expr", ".", "PropertyExpression", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "expr", ".", "VariableExpression", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "stmt", ".", "BlockStatement", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "stmt", ".", "CatchStatement", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "stmt", ".", "ForStatement", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "stmt", ".", "Statement", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "classgen", ".", "Verifier", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "control", ".", "messages", ".", "ExceptionMessage", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "syntax", ".", "Types", ";", "import", "org", ".", "objectweb", ".", "asm", ".", "Opcodes", ";", "public", "class", "ResolveVisitor", "extends", "ClassCodeExpressionTransformer", "{", "public", "ClassNode", "currentClass", ";", "public", "static", "final", "String", "[", "]", "DEFAULT_IMPORTS", "=", "{", "\"java.lang.\"", ",", "\"java.io.\"", ",", "\"java.net.\"", ",", "\"java.util.\"", ",", "\"groovy.lang.\"", ",", "\"groovy.util.\"", "}", ";", "public", "CompilationUnit", "compilationUnit", ";", "private", "Map", "cachedClasses", "=", "new", "HashMap", "(", ")", ";", "private", "static", "final", "Object", "NO_CLASS", "=", "new", "Object", "(", ")", ";", "private", "SourceUnit", "source", ";", "private", "VariableScope", "currentScope", ";", "private", "boolean", "isTopLevelProperty", "=", "true", ";", "private", "boolean", "inPropertyExpression", "=", "false", ";", "private", "boolean", "inClosure", "=", "false", ";", "private", "Map", "<", "String", ",", "GenericsType", ">", "genericParameterNames", "=", "new", "HashMap", "<", "String", ",", "GenericsType", ">", "(", ")", ";", "private", "Set", "<", "FieldNode", ">", "fieldTypesChecked", "=", "new", "HashSet", "<", "FieldNode", ">", "(", ")", ";", "private", "boolean", "checkingVariableTypeInDeclaration", "=", "false", ";", "private", "ImportNode", "currImportNode", "=", "null", ";", "private", "MethodNode", "currentMethod", ";", "public", "static", "class", "ConstructedClassWithPackage", "extends", "ClassNode", "{", "String", "prefix", ";", "String", "className", ";", "public", "ConstructedClassWithPackage", "(", "String", "pkg", ",", "String", "name", ")", "{", "super", "(", "pkg", "+", "name", ",", "Opcodes", ".", "ACC_PUBLIC", ",", "ClassHelper", ".", "OBJECT_TYPE", ")", ";", "isPrimaryNode", "=", "false", ";", "this", ".", "prefix", "=", "pkg", ";", "this", ".", "className", "=", "name", ";", "}", "public", "String", "getName", "(", ")", "{", "if", "(", "redirect", "(", ")", "!=", "this", ")", "return", "super", ".", "getName", "(", ")", ";", "return", "prefix", "+", "className", ";", "}", "public", "boolean", "hasPackageName", "(", ")", "{", "if", "(", "redirect", "(", ")", "!=", "this", ")", "return", "super", ".", "hasPackageName", "(", ")", ";", "return", "className", ".", "indexOf", "(", "'.'", ")", "!=", "-", "1", ";", "}", "public", "String", "setName", "(", "String", "name", ")", "{", "if", "(", "redirect", "(", ")", "!=", "this", ")", "{", "return", "super", ".", "setName", "(", "name", ")", ";", "}", "else", "{", "throw", "new", "GroovyBugError", "(", "\"\"", ")", ";", "}", "}", "}", "public", "static", "class", "LowerCaseClass", "extends", "ClassNode", "{", "String", "className", ";", "public", "LowerCaseClass", "(", "String", "name", ")", "{", "super", "(", "name", ",", "Opcodes", ".", "ACC_PUBLIC", ",", "ClassHelper", ".", "OBJECT_TYPE", ")", ";", "isPrimaryNode", "=", "false", ";", "this", ".", "className", "=", "name", ";", "}", "public", "String", "getName", "(", ")", "{", "if", "(", "redirect", "(", ")", "!=", "this", ")", "return", "super", ".", "getName", "(", ")", ";", "return", "className", ";", "}", "public", "boolean", "hasPackageName", "(", ")", "{", "if", "(", "redirect", "(", ")", "!=", "this", ")", "return", "super", ".", "hasPackageName", "(", ")", ";", "return", "false", ";", "}", "public", "String", "setName", "(", "String", "name", ")", "{", "if", "(", "redirect", "(", ")", "!=", "this", ")", "{", "return", "super", ".", "setName", "(", "name", ")", ";", "}", "else", "{", "throw", "new", "GroovyBugError", "(", "\"\"", ")", ";", "}", "}", "}", "public", "ResolveVisitor", "(", "CompilationUnit", "cu", ")", "{", "compilationUnit", "=", "cu", ";", "}", "public", "void", "startResolving", "(", "ClassNode", "node", ",", "SourceUnit", "source", ")", "{", "this", ".", "source", "=", "source", ";", "visitClass", "(", "node", ")", ";", "}", "protected", "void", "visitConstructorOrMethod", "(", "MethodNode", "node", ",", "boolean", "isConstructor", ")", "{", "VariableScope", "oldScope", "=", "currentScope", ";", "currentScope", "=", "node", ".", "getVariableScope", "(", ")", ";", "Map", "<", "String", ",", "GenericsType", ">", "oldPNames", "=", "genericParameterNames", ";", "genericParameterNames", "=", "new", "HashMap", "<", "String", ",", "GenericsType", ">", "(", "genericParameterNames", ")", ";", "resolveGenericsHeader", "(", "node", ".", "getGenericsTypes", "(", ")", ")", ";", "Parameter", "[", "]", "paras", "=", "node", ".", "getParameters", "(", ")", ";", "for", "(", "Parameter", "p", ":", "paras", ")", "{", "p", ".", "setInitialExpression", "(", "transform", "(", "p", ".", "getInitialExpression", "(", ")", ")", ")", ";", "resolveOrFail", "(", "p", ".", "getType", "(", ")", ",", "p", ".", "getType", "(", ")", ")", ";", "visitAnnotations", "(", "p", ")", ";", "}", "ClassNode", "[", "]", "exceptions", "=", "node", ".", "getExceptions", "(", ")", ";", "for", "(", "ClassNode", "t", ":", "exceptions", ")", "{", "resolveOrFail", "(", "t", ",", "node", ")", ";", "}", "resolveOrFail", "(", "node", ".", "getReturnType", "(", ")", ",", "node", ")", ";", "MethodNode", "oldCurrentMethod", "=", "currentMethod", ";", "currentMethod", "=", "node", ";", "super", ".", "visitConstructorOrMethod", "(", "node", ",", "isConstructor", ")", ";", "currentMethod", "=", "oldCurrentMethod", ";", "genericParameterNames", "=", "oldPNames", ";", "currentScope", "=", "oldScope", ";", "}", "public", "void", "visitField", "(", "FieldNode", "node", ")", "{", "ClassNode", "t", "=", "node", ".", "getType", "(", ")", ";", "if", "(", "!", "fieldTypesChecked", ".", "contains", "(", "node", ")", ")", "{", "resolveOrFail", "(", "t", ",", "node", ")", ";", "}", "super", ".", "visitField", "(", "node", ")", ";", "}", "public", "void", "visitProperty", "(", "PropertyNode", "node", ")", "{", "ClassNode", "t", "=", "node", ".", "getType", "(", ")", ";", "resolveOrFail", "(", "t", ",", "node", ")", ";", "super", ".", "visitProperty", "(", "node", ")", ";", "fieldTypesChecked", ".", "add", "(", "node", ".", "getField", "(", ")", ")", ";", "}", "protected", "boolean", "resolveToInner", "(", "ClassNode", "type", ")", "{", "if", "(", "type", "instanceof", "ConstructedClassWithPackage", ")", "return", "false", ";", "String", "name", "=", "type", ".", "getName", "(", ")", ";", "String", "saved", "=", "name", ";", "while", "(", "true", ")", "{", "int", "len", "=", "name", ".", "lastIndexOf", "(", "'.'", ")", ";", "if", "(", "len", "==", "-", "1", ")", "break", ";", "name", "=", "name", ".", "substring", "(", "0", ",", "len", ")", "+", "\"$\"", "+", "name", ".", "substring", "(", "len", "+", "1", ")", ";", "type", ".", "setName", "(", "name", ")", ";", "if", "(", "resolve", "(", "type", ")", ")", "return", "true", ";", "}", "if", "(", "resolveToInnerEnum", "(", "type", ")", ")", "return", "true", ";", "type", ".", "setName", "(", "saved", ")", ";", "return", "false", ";", "}", "protected", "boolean", "resolveToInnerEnum", "(", "ClassNode", "type", ")", "{", "String", "name", "=", "type", ".", "getName", "(", ")", ";", "if", "(", "currentClass", "!=", "type", "&&", "!", "name", ".", "contains", "(", "\".\"", ")", "&&", "type", ".", "getClass", "(", ")", ".", "equals", "(", "ClassNode", ".", "class", ")", ")", "{", "type", ".", "setName", "(", "currentClass", ".", "getName", "(", ")", "+", "\"$\"", "+", "name", ")", ";", "if", "(", "resolve", "(", "type", ")", ")", "return", "true", ";", "}", "return", "false", ";", "}", "private", "void", "resolveOrFail", "(", "ClassNode", "type", ",", "String", "msg", ",", "ASTNode", "node", ")", "{", "if", "(", "resolve", "(", "type", ")", ")", "return", ";", "if", "(", "resolveToInner", "(", "type", ")", ")", "return", ";", "addError", "(", "\"\"", "+", "toNiceName", "(", "type", ")", "+", "\"", "\"", "+", "msg", ",", "node", ")", ";", "}", "private", "String", "toNiceName", "(", "ClassNode", "node", ")", "{", "if", "(", "node", ".", "isArray", "(", ")", ")", "{", "StringBuilder", "sb", "=", "new", "StringBuilder", "(", ")", ";", "sb", ".", "append", "(", "toNiceName", "(", "node", ".", "getComponentType", "(", ")", ")", ")", ";", "sb", ".", "append", "(", "\"[]\"", ")", ";", "return", "sb", ".", "toString", "(", ")", ";", "}", "return", "node", ".", "getName", "(", ")", ";", "}", "private", "void", "resolveOrFail", "(", "ClassNode", "type", ",", "ASTNode", "node", ",", "boolean", "prefereImports", ")", "{", "resolveGenericsTypes", "(", "type", ".", "getGenericsTypes", "(", ")", ")", ";", "if", "(", "prefereImports", "&&", "resolveAliasFromModule", "(", "type", ")", ")", "return", ";", "resolveOrFail", "(", "type", ",", "node", ")", ";", "}", "private", "void", "resolveOrFail", "(", "ClassNode", "type", ",", "ASTNode", "node", ")", "{", "resolveOrFail", "(", "type", ",", "\"\"", ",", "node", ")", ";", "}", "protected", "boolean", "resolve", "(", "ClassNode", "type", ")", "{", "return", "resolve", "(", "type", ",", "true", ",", "true", ",", "true", ")", ";", "}", "protected", "boolean", "resolve", "(", "ClassNode", "type", ",", "boolean", "testModuleImports", ",", "boolean", "testDefaultImports", ",", "boolean", "testStaticInnerClasses", ")", "{", "resolveGenericsTypes", "(", "type", ".", "getGenericsTypes", "(", ")", ")", ";", "if", "(", "type", ".", "isResolved", "(", ")", "||", "type", ".", "isPrimaryClassNode", "(", ")", ")", "return", "true", ";", "if", "(", "type", ".", "isArray", "(", ")", ")", "{", "ClassNode", "element", "=", "type", ".", "getComponentType", "(", ")", ";", "boolean", "resolved", "=", "resolve", "(", "element", ",", "testModuleImports", ",", "testDefaultImports", ",", "testStaticInnerClasses", ")", ";", "if", "(", "resolved", ")", "{", "ClassNode", "cn", "=", "element", ".", "makeArray", "(", ")", ";", "type", ".", "setRedirect", "(", "cn", ")", ";", "}", "return", "resolved", ";", "}", "if", "(", "currentClass", "==", "type", ")", "return", "true", ";", "if", "(", "genericParameterNames", ".", "get", "(", "type", ".", "getName", "(", ")", ")", "!=", "null", ")", "{", "GenericsType", "gt", "=", "genericParameterNames", ".", "get", "(", "type", ".", "getName", "(", ")", ")", ";", "type", ".", "setRedirect", "(", "gt", ".", "getType", "(", ")", ")", ";", "type", ".", "setGenericsTypes", "(", "new", "GenericsType", "[", "]", "{", "gt", "}", ")", ";", "type", ".", "setGenericsPlaceHolder", "(", "true", ")", ";", "return", "true", ";", "}", "if", "(", "currentClass", ".", "getNameWithoutPackage", "(", ")", ".", "equals", "(", "type", ".", "getName", "(", ")", ")", ")", "{", "type", ".", "setRedirect", "(", "currentClass", ")", ";", "return", "true", ";", "}", "return", "resolveNestedClass", "(", "type", ")", "||", "resolveFromModule", "(", "type", ",", "testModuleImports", ")", "||", "resolveFromCompileUnit", "(", "type", ")", "||", "resolveFromDefaultImports", "(", "type", ",", "testDefaultImports", ")", "||", "resolveFromStaticInnerClasses", "(", "type", ",", "testStaticInnerClasses", ")", "||", "resolveToClass", "(", "type", ")", ";", "}", "private", "boolean", "resolveNestedClass", "(", "ClassNode", "type", ")", "{", "Map", "<", "String", ",", "ClassNode", ">", "hierClasses", "=", "new", "LinkedHashMap", "<", "String", ",", "ClassNode", ">", "(", ")", ";", "ClassNode", "val", ";", "String", "name", ";", "for", "(", "ClassNode", "classToCheck", "=", "currentClass", ";", "classToCheck", "!=", "ClassHelper", ".", "OBJECT_TYPE", ";", "classToCheck", "=", "classToCheck", ".", "getSuperClass", "(", ")", ")", "{", "if", "(", "classToCheck", "==", "null", "||", "hierClasses", ".", "containsKey", "(", "classToCheck", ".", "getName", "(", ")", ")", ")", "break", ";", "hierClasses", ".", "put", "(", "classToCheck", ".", "getName", "(", ")", ",", "classToCheck", ")", ";", "}", "for", "(", "ClassNode", "classToCheck", ":", "hierClasses", ".", "values", "(", ")", ")", "{", "if", "(", "classToCheck", ".", "mightHaveInners", "(", ")", ")", "{", "name", "=", "classToCheck", ".", "getName", "(", ")", "+", "\"$\"", "+", "type", ".", "getName", "(", ")", ";", "val", "=", "ClassHelper", ".", "make", "(", "name", ")", ";", "if", "(", "resolveFromCompileUnit", "(", "val", ")", ")", "{", "type", ".", "setRedirect", "(", "val", ")", ";", "return", "true", ";", "}", "}", "}", "if", "(", "!", "(", "currentClass", "instanceof", "InnerClassNode", ")", ")", "return", "false", ";", "LinkedList", "<", "ClassNode", ">", "outerClasses", "=", "new", "LinkedList", "<", "ClassNode", ">", "(", ")", ";", "ClassNode", "outer", "=", "currentClass", ".", "getOuterClass", "(", ")", ";", "while", "(", "outer", "!=", "null", ")", "{", "outerClasses", ".", "addFirst", "(", "outer", ")", ";", "outer", "=", "outer", ".", "getOuterClass", "(", ")", ";", "}", "for", "(", "ClassNode", "testNode", ":", "outerClasses", ")", "{", "name", "=", "testNode", ".", "getName", "(", ")", "+", "\"$\"", "+", "type", ".", "getName", "(", ")", ";", "val", "=", "ClassHelper", ".", "make", "(", "name", ")", ";", "if", "(", "resolveFromCompileUnit", "(", "val", ")", ")", "{", "type", ".", "setRedirect", "(", "val", ")", ";", "return", "true", ";", "}", "}", "return", "false", ";", "}", "protected", "boolean", "resolveFromClassCache", "(", "ClassNode", "type", ")", "{", "String", "name", "=", "type", ".", "getName", "(", ")", ";", "Object", "val", "=", "cachedClasses", ".", "get", "(", "name", ")", ";", "if", "(", "val", "==", "null", "||", "val", "==", "NO_CLASS", ")", "{", "return", "false", ";", "}", "else", "{", "type", ".", "setRedirect", "(", "(", "ClassNode", ")", "val", ")", ";", "return", "true", ";", "}", "}", "private", "long", "getTimeStamp", "(", "Class", "cls", ")", "{", "return", "Verifier", ".", "getTimestamp", "(", "cls", ")", ";", "}", "private", "boolean", "isSourceNewer", "(", "URL", "source", ",", "Class", "cls", ")", "{", "try", "{", "long", "lastMod", ";", "if", "(", "source", ".", "getProtocol", "(", ")", ".", "equals", "(", "\"file\"", ")", ")", "{", "String", "path", "=", "source", ".", "getPath", "(", ")", ".", "replace", "(", "'/'", ",", "File", ".", "separatorChar", ")", ".", "replace", "(", "'|'", ",", "':'", ")", ";", "File", "file", "=", "new", "File", "(", "path", ")", ";", "lastMod", "=", "file", ".", "lastModified", "(", ")", ";", "}", "else", "{", "URLConnection", "conn", "=", "source", ".", "openConnection", "(", ")", ";", "lastMod", "=", "conn", ".", "getLastModified", "(", ")", ";", "conn", ".", "getInputStream", "(", ")", ".", "close", "(", ")", ";", "}", "return", "lastMod", ">", "getTimeStamp", "(", "cls", ")", ";", "}", "catch", "(", "IOException", "e", ")", "{", "return", "false", ";", "}", "}", "protected", "boolean", "resolveToScript", "(", "ClassNode", "type", ")", "{", "String", "name", "=", "type", ".", "getName", "(", ")", ";", "if", "(", "name", ".", "startsWith", "(", "\"java.\"", ")", ")", "return", "type", ".", "isResolved", "(", ")", ";", "if", "(", "name", ".", "indexOf", "(", "'$'", ")", "!=", "-", "1", ")", "return", "type", ".", "isResolved", "(", ")", ";", "ModuleNode", "module", "=", "currentClass", ".", "getModule", "(", ")", ";", "if", "(", "module", ".", "hasPackageName", "(", ")", "&&", "name", ".", "indexOf", "(", "'.'", ")", "==", "-", "1", ")", "return", "type", ".", "isResolved", "(", ")", ";", "GroovyClassLoader", "gcl", "=", "compilationUnit", ".", "getClassLoader", "(", ")", ";", "URL", "url", "=", "null", ";", "return", "type", ".", "isResolved", "(", ")", ";", "}", "private", "String", "replaceLastPoint", "(", "String", "name", ")", "{", "int", "lastPoint", "=", "name", ".", "lastIndexOf", "(", "'.'", ")", ";", "name", "=", "new", "StringBuffer", "(", ")", ".", "append", "(", "name", ".", "substring", "(", "0", ",", "lastPoint", ")", ")", ".", "append", "(", "\"$\"", ")", ".", "append", "(", "name", ".", "substring", "(", "lastPoint", "+", "1", ")", ")", ".", "toString", "(", ")", ";", "return", "name", ";", "}", "protected", "boolean", "resolveFromStaticInnerClasses", "(", "ClassNode", "type", ",", "boolean", "testStaticInnerClasses", ")", "{", "if", "(", "type", "instanceof", "LowerCaseClass", ")", "return", "false", ";", "testStaticInnerClasses", "&=", "type", ".", "hasPackageName", "(", ")", ";", "if", "(", "testStaticInnerClasses", ")", "{", "if", "(", "type", "instanceof", "ConstructedClassWithPackage", ")", "{", "ConstructedClassWithPackage", "tmp", "=", "(", "ConstructedClassWithPackage", ")", "type", ";", "String", "savedName", "=", "tmp", ".", "className", ";", "tmp", ".", "className", "=", "replaceLastPoint", "(", "savedName", ")", ";", "if", "(", "resolve", "(", "tmp", ",", "false", ",", "true", ",", "true", ")", ")", "{", "type", ".", "setRedirect", "(", "tmp", ".", "redirect", "(", ")", ")", ";", "return", "true", ";", "}", "tmp", ".", "className", "=", "savedName", ";", "}", "else", "{", "return", "resolveStaticInner", "(", "type", ")", ";", "}", "}", "return", "false", ";", "}", "protected", "boolean", "resolveStaticInner", "(", "ClassNode", "type", ")", "{", "String", "name", "=", "type", ".", "getName", "(", ")", ";", "String", "replacedPointType", "=", "replaceLastPoint", "(", "name", ")", ";", "type", ".", "setName", "(", "replacedPointType", ")", ";", "if", "(", "resolve", "(", "type", ",", "false", ",", "true", ",", "true", ")", ")", "return", "true", ";", "type", ".", "setName", "(", "name", ")", ";", "return", "false", ";", "}", "protected", "boolean", "resolveFromDefaultImports", "(", "ClassNode", "type", ",", "boolean", "testDefaultImports", ")", "{", "testDefaultImports", "&=", "!", "type", ".", "hasPackageName", "(", ")", ";", "testDefaultImports", "&=", "!", "(", "type", "instanceof", "LowerCaseClass", ")", ";", "if", "(", "testDefaultImports", ")", "{", "for", "(", "int", "i", "=", "0", ",", "size", "=", "DEFAULT_IMPORTS", ".", "length", ";", "i", "<", "size", ";", "i", "++", ")", "{", "String", "packagePrefix", "=", "DEFAULT_IMPORTS", "[", "i", "]", ";", "String", "name", "=", "type", ".", "getName", "(", ")", ";", "ConstructedClassWithPackage", "tmp", "=", "new", "ConstructedClassWithPackage", "(", "packagePrefix", ",", "name", ")", ";", "if", "(", "resolve", "(", "tmp", ",", "false", ",", "false", ",", "false", ")", ")", "{", "type", ".", "setRedirect", "(", "tmp", ".", "redirect", "(", ")", ")", ";", "return", "true", ";", "}", "}", "String", "name", "=", "type", ".", "getName", "(", ")", ";", "if", "(", "name", ".", "equals", "(", "\"BigInteger\"", ")", ")", "{", "type", ".", "setRedirect", "(", "ClassHelper", ".", "BigInteger_TYPE", ")", ";", "return", "true", ";", "}", "else", "if", "(", "name", ".", "equals", "(", "\"BigDecimal\"", ")", ")", "{", "type", ".", "setRedirect", "(", "ClassHelper", ".", "BigDecimal_TYPE", ")", ";", "return", "true", ";", "}", "}", "return", "false", ";", "}", "protected", "boolean", "resolveFromCompileUnit", "(", "ClassNode", "type", ")", "{", "CompileUnit", "compileUnit", "=", "currentClass", ".", "getCompileUnit", "(", ")", ";", "if", "(", "compileUnit", "==", "null", ")", "return", "false", ";", "ClassNode", "cuClass", "=", "compileUnit", ".", "getClass", "(", "type", ".", "getName", "(", ")", ")", ";", "if", "(", "cuClass", "!=", "null", ")", "{", "if", "(", "type", "!=", "cuClass", ")", "type", ".", "setRedirect", "(", "cuClass", ")", ";", "return", "true", ";", "}", "return", "false", ";", "}", "private", "void", "ambiguousClass", "(", "ClassNode", "type", ",", "ClassNode", "iType", ",", "String", "name", ")", "{", "if", "(", "type", ".", "getName", "(", ")", ".", "equals", "(", "iType", ".", "getName", "(", ")", ")", ")", "{", "addError", "(", "\"\"", "+", "name", "+", "\"\"", "+", "type", ".", "getName", "(", ")", "+", "\"", "and", "\"", "+", "iType", ".", "getName", "(", ")", "+", "\"", "match\"", ",", "type", ")", ";", "}", "else", "{", "type", ".", "setRedirect", "(", "iType", ")", ";", "}", "}", "private", "boolean", "resolveAliasFromModule", "(", "ClassNode", "type", ")", "{", "if", "(", "type", "instanceof", "ConstructedClassWithPackage", ")", "return", "false", ";", "ModuleNode", "module", "=", "currentClass", ".", "getModule", "(", ")", ";", "if", "(", "module", "==", "null", ")", "return", "false", ";", "String", "name", "=", "type", ".", "getName", "(", ")", ";", "String", "pname", "=", "name", ";", "int", "index", "=", "name", ".", "length", "(", ")", ";", "while", "(", "true", ")", "{", "pname", "=", "name", ".", "substring", "(", "0", ",", "index", ")", ";", "ClassNode", "aliasedNode", "=", "null", ";", "ImportNode", "importNode", "=", "module", ".", "getImport", "(", "pname", ")", ";", "if", "(", "importNode", "!=", "null", "&&", "importNode", "!=", "currImportNode", ")", "{", "aliasedNode", "=", "importNode", ".", "getType", "(", ")", ";", "}", "if", "(", "aliasedNode", "==", "null", ")", "{", "importNode", "=", "module", ".", "getStaticImports", "(", ")", ".", "get", "(", "pname", ")", ";", "if", "(", "importNode", "!=", "null", "&&", "importNode", "!=", "currImportNode", ")", "{", "ClassNode", "tmp", "=", "ClassHelper", ".", "make", "(", "importNode", ".", "getType", "(", ")", ".", "getName", "(", ")", "+", "\"$\"", "+", "importNode", ".", "getFieldName", "(", ")", ")", ";", "if", "(", "resolve", "(", "tmp", ",", "false", ",", "false", ",", "true", ")", ")", "{", "if", "(", "(", "tmp", ".", "getModifiers", "(", ")", "&", "Opcodes", ".", "ACC_STATIC", ")", "!=", "0", ")", "{", "type", ".", "setRedirect", "(", "tmp", ".", "redirect", "(", ")", ")", ";", "return", "true", ";", "}", "}", "}", "}", "if", "(", "aliasedNode", "!=", "null", ")", "{", "if", "(", "pname", ".", "length", "(", ")", "==", "name", ".", "length", "(", ")", ")", "{", "type", ".", "setRedirect", "(", "aliasedNode", ")", ";", "return", "true", ";", "}", "else", "{", "String", "className", "=", "aliasedNode", ".", "getNameWithoutPackage", "(", ")", "+", "'$'", "+", "name", ".", "substring", "(", "pname", ".", "length", "(", ")", "+", "1", ")", ".", "replace", "(", "'.'", ",", "'$'", ")", ";", "ConstructedClassWithPackage", "tmp", "=", "new", "ConstructedClassWithPackage", "(", "aliasedNode", ".", "getPackageName", "(", ")", "+", "\".\"", ",", "className", ")", ";", "if", "(", "resolve", "(", "tmp", ",", "true", ",", "true", ",", "false", ")", ")", "{", "type", ".", "setRedirect", "(", "tmp", ".", "redirect", "(", ")", ")", ";", "return", "true", ";", "}", "}", "}", "index", "=", "pname", ".", "lastIndexOf", "(", "'.'", ")", ";", "if", "(", "index", "==", "-", "1", ")", "break", ";", "}", "return", "false", ";", "}", "protected", "boolean", "resolveFromModule", "(", "ClassNode", "type", ",", "boolean", "testModuleImports", ")", "{", "if", "(", "type", "instanceof", "LowerCaseClass", ")", "{", "return", "resolveAliasFromModule", "(", "type", ")", ";", "}", "String", "name", "=", "type", ".", "getName", "(", ")", ";", "ModuleNode", "module", "=", "currentClass", ".", "getModule", "(", ")", ";", "if", "(", "module", "==", "null", ")", "return", "false", ";", "boolean", "newNameUsed", "=", "false", ";", "if", "(", "!", "type", ".", "hasPackageName", "(", ")", "&&", "module", ".", "hasPackageName", "(", ")", "&&", "!", "(", "type", "instanceof", "ConstructedClassWithPackage", ")", ")", "{", "type", ".", "setName", "(", "module", ".", "getPackageName", "(", ")", "+", "name", ")", ";", "newNameUsed", "=", "true", ";", "}", "List", "<", "ClassNode", ">", "moduleClasses", "=", "module", ".", "getClasses", "(", ")", ";", "for", "(", "ClassNode", "mClass", ":", "moduleClasses", ")", "{", "if", "(", "mClass", ".", "getName", "(", ")", ".", "equals", "(", "type", ".", "getName", "(", ")", ")", ")", "{", "if", "(", "mClass", "!=", "type", ")", "type", ".", "setRedirect", "(", "mClass", ")", ";", "return", "true", ";", "}", "}", "if", "(", "newNameUsed", ")", "type", ".", "setName", "(", "name", ")", ";", "if", "(", "testModuleImports", ")", "{", "if", "(", "resolveAliasFromModule", "(", "type", ")", ")", "return", "true", ";", "if", "(", "module", ".", "hasPackageName", "(", ")", ")", "{", "ConstructedClassWithPackage", "tmp", "=", "new", "ConstructedClassWithPackage", "(", "module", ".", "getPackageName", "(", ")", ",", "name", ")", ";", "if", "(", "resolve", "(", "tmp", ",", "false", ",", "false", ",", "false", ")", ")", "{", "ambiguousClass", "(", "type", ",", "tmp", ",", "name", ")", ";", "type", ".", "setRedirect", "(", "tmp", ".", "redirect", "(", ")", ")", ";", "return", "true", ";", "}", "}", "for", "(", "ImportNode", "importNode", ":", "module", ".", "getStaticImports", "(", ")", ".", "values", "(", ")", ")", "{", "if", "(", "importNode", ".", "getFieldName", "(", ")", ".", "equals", "(", "name", ")", ")", "{", "ClassNode", "tmp", "=", "ClassHelper", ".", "make", "(", "importNode", ".", "getType", "(", ")", ".", "getName", "(", ")", "+", "\"$\"", "+", "name", ")", ";", "if", "(", "resolve", "(", "tmp", ",", "false", ",", "false", ",", "true", ")", ")", "{", "if", "(", "(", "tmp", ".", "getModifiers", "(", ")", "&", "Opcodes", ".", "ACC_STATIC", ")", "!=", "0", ")", "{", "type", ".", "setRedirect", "(", "tmp", ".", "redirect", "(", ")", ")", ";", "return", "true", ";", "}", "}", "}", "}", "for", "(", "ImportNode", "importNode", ":", "module", ".", "getStarImports", "(", ")", ")", "{", "String", "packagePrefix", "=", "importNode", ".", "getPackageName", "(", ")", ";", "ConstructedClassWithPackage", "tmp", "=", "new", "ConstructedClassWithPackage", "(", "packagePrefix", ",", "name", ")", ";", "if", "(", "resolve", "(", "tmp", ",", "false", ",", "false", ",", "true", ")", ")", "{", "ambiguousClass", "(", "type", ",", "tmp", ",", "name", ")", ";", "type", ".", "setRedirect", "(", "tmp", ".", "redirect", "(", ")", ")", ";", "return", "true", ";", "}", "}", "for", "(", "ImportNode", "importNode", ":", "module", ".", "getStaticStarImports", "(", ")", ".", "values", "(", ")", ")", "{", "if", "(", "!", "importNode", ".", "isUnresolvable", "(", ")", ")", "{", "ClassNode", "tmp", "=", "ClassHelper", ".", "make", "(", "importNode", ".", "getClassName", "(", ")", "+", "\"$\"", "+", "name", ")", ";", "if", "(", "resolve", "(", "tmp", ",", "false", ",", "false", ",", "true", ")", ")", "{", "if", "(", "(", "tmp", ".", "getModifiers", "(", ")", "&", "Opcodes", ".", "ACC_STATIC", ")", "!=", "0", ")", "{", "ambiguousClass", "(", "type", ",", "tmp", ",", "name", ")", ";", "type", ".", "setRedirect", "(", "tmp", ".", "redirect", "(", ")", ")", ";", "return", "true", ";", "}", "}", "}", "}", "}", "return", "false", ";", "}", "protected", "ClassNode", "resolveNewName", "(", "String", "fullname", ")", "{", "return", "null", ";", "}", "protected", "boolean", "resolveToClass", "(", "ClassNode", "type", ")", "{", "String", "name", "=", "type", ".", "getName", "(", ")", ";", "Object", "cached", "=", "cachedClasses", ".", "get", "(", "name", ")", ";", "if", "(", "cached", "==", "NO_CLASS", ")", "return", "false", ";", "if", "(", "cached", "!=", "null", ")", "{", "type", ".", "setRedirect", "(", "(", "ClassNode", ")", "cached", ")", ";", "return", "true", ";", "}", "if", "(", "type", "instanceof", "LowerCaseClass", ")", "{", "cachedClasses", ".", "put", "(", "name", ",", "NO_CLASS", ")", ";", "return", "false", ";", "}", "if", "(", "currentClass", ".", "getModule", "(", ")", ".", "hasPackageName", "(", ")", "&&", "name", ".", "indexOf", "(", "'.'", ")", "==", "-", "1", ")", "return", "false", ";", "GroovyClassLoader", "loader", "=", "compilationUnit", ".", "getClassLoader", "(", ")", ";", "Class", "cls", ";", "try", "{", "cls", "=", "loader", ".", "loadClass", "(", "name", ",", "false", ",", "true", ")", ";", "}", "catch", "(", "ClassNotFoundException", "cnfe", ")", "{", "cachedClasses", ".", "put", "(", "name", ",", "NO_CLASS", ")", ";", "return", "resolveToScript", "(", "type", ")", ";", "}", "catch", "(", "CompilationFailedException", "cfe", ")", "{", "compilationUnit", ".", "getErrorCollector", "(", ")", ".", "addErrorAndContinue", "(", "new", "ExceptionMessage", "(", "cfe", ",", "true", ",", "source", ")", ")", ";", "return", "resolveToScript", "(", "type", ")", ";", "}", "if", "(", "cls", "==", "null", ")", "return", "false", ";", "ClassNode", "cn", "=", "ClassHelper", ".", "make", "(", "cls", ")", ";", "cachedClasses", ".", "put", "(", "name", ",", "cn", ")", ";", "type", ".", "setRedirect", "(", "cn", ")", ";", "return", "cls", ".", "getClassLoader", "(", ")", "==", "loader", "||", "resolveToScript", "(", "type", ")", ";", "}", "public", "Expression", "transform", "(", "Expression", "exp", ")", "{", "if", "(", "exp", "==", "null", ")", "return", "null", ";", "Expression", "ret", "=", "null", ";", "if", "(", "exp", "instanceof", "VariableExpression", ")", "{", "ret", "=", "transformVariableExpression", "(", "(", "VariableExpression", ")", "exp", ")", ";", "}", "else", "if", "(", "exp", ".", "getClass", "(", ")", "==", "PropertyExpression", ".", "class", ")", "{", "ret", "=", "transformPropertyExpression", "(", "(", "PropertyExpression", ")", "exp", ")", ";", "}", "else", "if", "(", "exp", "instanceof", "DeclarationExpression", ")", "{", "ret", "=", "transformDeclarationExpression", "(", "(", "DeclarationExpression", ")", "exp", ")", ";", "}", "else", "if", "(", "exp", "instanceof", "BinaryExpression", ")", "{", "ret", "=", "transformBinaryExpression", "(", "(", "BinaryExpression", ")", "exp", ")", ";", "}", "else", "if", "(", "exp", "instanceof", "MethodCallExpression", ")", "{", "ret", "=", "transformMethodCallExpression", "(", "(", "MethodCallExpression", ")", "exp", ")", ";", "}", "else", "if", "(", "exp", "instanceof", "ClosureExpression", ")", "{", "ret", "=", "transformClosureExpression", "(", "(", "ClosureExpression", ")", "exp", ")", ";", "}", "else", "if", "(", "exp", "instanceof", "ConstructorCallExpression", ")", "{", "ret", "=", "transformConstructorCallExpression", "(", "(", "ConstructorCallExpression", ")", "exp", ")", ";", "}", "else", "if", "(", "exp", "instanceof", "AnnotationConstantExpression", ")", "{", "ret", "=", "transformAnnotationConstantExpression", "(", "(", "AnnotationConstantExpression", ")", "exp", ")", ";", "}", "else", "{", "resolveOrFail", "(", "exp", ".", "getType", "(", ")", ",", "exp", ")", ";", "ret", "=", "exp", ".", "transformExpression", "(", "this", ")", ";", "}", "if", "(", "ret", "!=", "null", "&&", "ret", "!=", "exp", ")", "ret", ".", "setSourcePosition", "(", "exp", ")", ";", "return", "ret", ";", "}", "private", "String", "lookupClassName", "(", "PropertyExpression", "pe", ")", "{", "boolean", "doInitialClassTest", "=", "true", ";", "String", "name", "=", "\"\"", ";", "for", "(", "Expression", "it", "=", "pe", ";", "it", "!=", "null", ";", "it", "=", "(", "(", "PropertyExpression", ")", "it", ")", ".", "getObjectExpression", "(", ")", ")", "{", "if", "(", "it", "instanceof", "VariableExpression", ")", "{", "VariableExpression", "ve", "=", "(", "VariableExpression", ")", "it", ";", "if", "(", "ve", ".", "isSuperExpression", "(", ")", "||", "ve", ".", "isThisExpression", "(", ")", ")", "{", "return", "null", ";", "}", "String", "varName", "=", "ve", ".", "getName", "(", ")", ";", "if", "(", "doInitialClassTest", ")", "{", "if", "(", "!", "testVanillaNameForClass", "(", "varName", ")", ")", "return", "null", ";", "doInitialClassTest", "=", "false", ";", "name", "=", "varName", ";", "}", "else", "{", "name", "=", "varName", "+", "\".\"", "+", "name", ";", "}", "break", ";", "}", "else", "if", "(", "it", ".", "getClass", "(", ")", "!=", "PropertyExpression", ".", "class", ")", "{", "return", "null", ";", "}", "else", "{", "PropertyExpression", "current", "=", "(", "PropertyExpression", ")", "it", ";", "String", "propertyPart", "=", "current", ".", "getPropertyAsString", "(", ")", ";", "if", "(", "propertyPart", "==", "null", "||", "propertyPart", ".", "equals", "(", "\"class\"", ")", ")", "{", "return", "null", ";", "}", "if", "(", "doInitialClassTest", ")", "{", "if", "(", "!", "testVanillaNameForClass", "(", "propertyPart", ")", ")", "return", "null", ";", "doInitialClassTest", "=", "false", ";", "name", "=", "propertyPart", ";", "}", "else", "{", "name", "=", "propertyPart", "+", "\".\"", "+", "name", ";", "}", "}", "}", "if", "(", "name", ".", "length", "(", ")", "==", "0", ")", "return", "null", ";", "return", "name", ";", "}", "private", "Expression", "correctClassClassChain", "(", "PropertyExpression", "pe", ")", "{", "LinkedList", "<", "Expression", ">", "stack", "=", "new", "LinkedList", "<", "Expression", ">", "(", ")", ";", "ClassExpression", "found", "=", "null", ";", "for", "(", "Expression", "it", "=", "pe", ";", "it", "!=", "null", ";", "it", "=", "(", "(", "PropertyExpression", ")", "it", ")", ".", "getObjectExpression", "(", ")", ")", "{", "if", "(", "it", "instanceof", "ClassExpression", ")", "{", "found", "=", "(", "ClassExpression", ")", "it", ";", "break", ";", "}", "else", "if", "(", "!", "(", "it", ".", "getClass", "(", ")", "==", "PropertyExpression", ".", "class", ")", ")", "{", "return", "pe", ";", "}", "stack", ".", "addFirst", "(", "it", ")", ";", "}", "if", "(", "found", "==", "null", ")", "return", "pe", ";", "if", "(", "stack", ".", "isEmpty", "(", ")", ")", "return", "pe", ";", "Object", "stackElement", "=", "stack", ".", "removeFirst", "(", ")", ";", "if", "(", "!", "(", "stackElement", ".", "getClass", "(", ")", "==", "PropertyExpression", ".", "class", ")", ")", "return", "pe", ";", "PropertyExpression", "classPropertyExpression", "=", "(", "PropertyExpression", ")", "stackElement", ";", "String", "propertyNamePart", "=", "classPropertyExpression", ".", "getPropertyAsString", "(", ")", ";", "if", "(", "propertyNamePart", "==", "null", "||", "!", "propertyNamePart", ".", "equals", "(", "\"class\"", ")", ")", "return", "pe", ";", "found", ".", "setSourcePosition", "(", "classPropertyExpression", ")", ";", "if", "(", "stack", ".", "isEmpty", "(", ")", ")", "return", "found", ";", "stackElement", "=", "stack", ".", "removeFirst", "(", ")", ";", "if", "(", "!", "(", "stackElement", ".", "getClass", "(", ")", "==", "PropertyExpression", ".", "class", ")", ")", "return", "pe", ";", "PropertyExpression", "classPropertyExpressionContainer", "=", "(", "PropertyExpression", ")", "stackElement", ";", "classPropertyExpressionContainer", ".", "setObjectExpression", "(", "found", ")", ";", "return", "pe", ";", "}", "protected", "Expression", "transformPropertyExpression", "(", "PropertyExpression", "pe", ")", "{", "boolean", "itlp", "=", "isTopLevelProperty", ";", "boolean", "ipe", "=", "inPropertyExpression", ";", "Expression", "objectExpression", "=", "pe", ".", "getObjectExpression", "(", ")", ";", "inPropertyExpression", "=", "true", ";", "isTopLevelProperty", "=", "(", "objectExpression", ".", "getClass", "(", ")", "!=", "PropertyExpression", ".", "class", ")", ";", "objectExpression", "=", "transform", "(", "objectExpression", ")", ";", "inPropertyExpression", "=", "false", ";", "Expression", "property", "=", "transform", "(", "pe", ".", "getProperty", "(", ")", ")", ";", "isTopLevelProperty", "=", "itlp", ";", "inPropertyExpression", "=", "ipe", ";", "boolean", "spreadSafe", "=", "pe", ".", "isSpreadSafe", "(", ")", ";", "PropertyExpression", "old", "=", "pe", ";", "pe", "=", "new", "PropertyExpression", "(", "objectExpression", ",", "property", ",", "pe", ".", "isSafe", "(", ")", ")", ";", "pe", ".", "setSpreadSafe", "(", "spreadSafe", ")", ";", "pe", ".", "setSourcePosition", "(", "old", ")", ";", "String", "className", "=", "lookupClassName", "(", "pe", ")", ";", "if", "(", "className", "!=", "null", ")", "{", "ClassNode", "type", "=", "ClassHelper", ".", "make", "(", "className", ")", ";", "if", "(", "resolve", "(", "type", ")", ")", "{", "Expression", "ret", "=", "new", "ClassExpression", "(", "type", ")", ";", "ret", ".", "setSourcePosition", "(", "pe", ")", ";", "return", "ret", ";", "}", "}", "if", "(", "objectExpression", "instanceof", "ClassExpression", "&&", "pe", ".", "getPropertyAsString", "(", ")", "!=", "null", ")", "{", "ClassExpression", "ce", "=", "(", "ClassExpression", ")", "objectExpression", ";", "ClassNode", "type", "=", "ClassHelper", ".", "make", "(", "ce", ".", "getType", "(", ")", ".", "getName", "(", ")", "+", "\"$\"", "+", "pe", ".", "getPropertyAsString", "(", ")", ")", ";", "if", "(", "resolve", "(", "type", ",", "false", ",", "false", ",", "false", ")", ")", "{", "Expression", "ret", "=", "new", "ClassExpression", "(", "type", ")", ";", "ret", ".", "setSourcePosition", "(", "ce", ")", ";", "return", "ret", ";", "}", "}", "Expression", "ret", "=", "pe", ";", "checkThisAndSuperAsPropertyAccess", "(", "pe", ")", ";", "if", "(", "isTopLevelProperty", ")", "ret", "=", "correctClassClassChain", "(", "pe", ")", ";", "return", "ret", ";", "}", "private", "void", "checkThisAndSuperAsPropertyAccess", "(", "PropertyExpression", "expression", ")", "{", "if", "(", "expression", ".", "isImplicitThis", "(", ")", ")", "return", ";", "String", "prop", "=", "expression", ".", "getPropertyAsString", "(", ")", ";", "if", "(", "prop", "==", "null", ")", "return", ";", "if", "(", "!", "prop", ".", "equals", "(", "\"this\"", ")", "&&", "!", "prop", ".", "equals", "(", "\"super\"", ")", ")", "return", ";", "if", "(", "expression", ".", "getObjectExpression", "(", ")", "instanceof", "ClassExpression", ")", "{", "if", "(", "!", "(", "currentClass", "instanceof", "InnerClassNode", ")", ")", "{", "addError", "(", "\"\"", ",", "expression", ")", ";", "return", ";", "}", "ClassNode", "type", "=", "expression", ".", "getObjectExpression", "(", ")", ".", "getType", "(", ")", ";", "ClassNode", "iterType", "=", "currentClass", ";", "while", "(", "iterType", "!=", "null", ")", "{", "if", "(", "iterType", ".", "equals", "(", "type", ")", ")", "break", ";", "iterType", "=", "iterType", ".", "getOuterClass", "(", ")", ";", "}", "if", "(", "iterType", "==", "null", ")", "{", "addError", "(", "\"The", "class", "'\"", "+", "type", ".", "getName", "(", ")", "+", "\"\"", "+", "currentClass", ".", "getName", "(", ")", "+", "\"\"", ",", "expression", ")", ";", "}", "if", "(", "(", "currentClass", ".", "getModifiers", "(", ")", "&", "Opcodes", ".", "ACC_STATIC", ")", "==", "0", ")", "return", ";", "if", "(", "!", "currentScope", ".", "isInStaticContext", "(", ")", ")", "return", ";", "addError", "(", "\"\"", "+", "currentClass", ".", "getName", "(", ")", "+", "\"\"", ",", "expression", ")", ";", "}", "}", "protected", "Expression", "transformVariableExpression", "(", "VariableExpression", "ve", ")", "{", "visitAnnotations", "(", "ve", ")", ";", "Variable", "v", "=", "ve", ".", "getAccessedVariable", "(", ")", ";", "if", "(", "!", "(", "v", "instanceof", "DynamicVariable", ")", "&&", "!", "checkingVariableTypeInDeclaration", ")", "{", "return", "ve", ";", "}", "if", "(", "v", "instanceof", "DynamicVariable", ")", "{", "String", "name", "=", "ve", ".", "getName", "(", ")", ";", "ClassNode", "t", "=", "ClassHelper", ".", "make", "(", "name", ")", ";", "boolean", "isClass", "=", "t", ".", "isResolved", "(", ")", ";", "if", "(", "!", "isClass", ")", "{", "if", "(", "Character", ".", "isLowerCase", "(", "name", ".", "charAt", "(", "0", ")", ")", ")", "{", "t", "=", "new", "LowerCaseClass", "(", "name", ")", ";", "}", "isClass", "=", "resolve", "(", "t", ")", ";", "if", "(", "!", "isClass", ")", "isClass", "=", "resolveToInnerEnum", "(", "t", ")", ";", "}", "if", "(", "isClass", ")", "{", "for", "(", "VariableScope", "scope", "=", "currentScope", ";", "scope", "!=", "null", "&&", "!", "scope", ".", "isRoot", "(", ")", ";", "scope", "=", "scope", ".", "getParent", "(", ")", ")", "{", "if", "(", "scope", ".", "isRoot", "(", ")", ")", "break", ";", "if", "(", "scope", ".", "removeReferencedClassVariable", "(", "ve", ".", "getName", "(", ")", ")", "==", "null", ")", "break", ";", "}", "ClassExpression", "ce", "=", "new", "ClassExpression", "(", "t", ")", ";", "ce", ".", "setSourcePosition", "(", "ve", ")", ";", "return", "ce", ";", "}", "}", "resolveOrFail", "(", "ve", ".", "getType", "(", ")", ",", "ve", ")", ";", "return", "ve", ";", "}", "private", "boolean", "testVanillaNameForClass", "(", "String", "name", ")", "{", "if", "(", "name", "==", "null", "||", "name", ".", "length", "(", ")", "==", "0", ")", "return", "false", ";", "return", "!", "Character", ".", "isLowerCase", "(", "name", ".", "charAt", "(", "0", ")", ")", ";", "}", "protected", "Expression", "transformBinaryExpression", "(", "BinaryExpression", "be", ")", "{", "Expression", "left", "=", "transform", "(", "be", ".", "getLeftExpression", "(", ")", ")", ";", "int", "type", "=", "be", ".", "getOperation", "(", ")", ".", "getType", "(", ")", ";", "if", "(", "(", "type", "==", "Types", ".", "ASSIGNMENT_OPERATOR", "||", "type", "==", "Types", ".", "EQUAL", ")", "&&", "left", "instanceof", "ClassExpression", ")", "{", "ClassExpression", "ce", "=", "(", "ClassExpression", ")", "left", ";", "String", "error", "=", "\"\"", "+", "ce", ".", "getType", "(", ")", ".", "getName", "(", ")", "+", "\"'\"", ";", "if", "(", "ce", ".", "getType", "(", ")", ".", "isScript", "(", ")", ")", "{", "error", "+=", "\"\"", ";", "}", "addError", "(", "error", ",", "be", ".", "getLeftExpression", "(", ")", ")", ";", "return", "be", ";", "}", "if", "(", "left", "instanceof", "ClassExpression", ")", "{", "if", "(", "be", ".", "getRightExpression", "(", ")", "instanceof", "ListExpression", ")", "{", "ListExpression", "list", "=", "(", "ListExpression", ")", "be", ".", "getRightExpression", "(", ")", ";", "if", "(", "list", ".", "getExpressions", "(", ")", ".", "isEmpty", "(", ")", ")", "{", "final", "ClassExpression", "ce", "=", "new", "ClassExpression", "(", "left", ".", "getType", "(", ")", ".", "makeArray", "(", ")", ")", ";", "ce", ".", "setSourcePosition", "(", "be", ")", ";", "return", "ce", ";", "}", "else", "{", "boolean", "map", "=", "true", ";", "for", "(", "Expression", "expression", ":", "list", ".", "getExpressions", "(", ")", ")", "{", "if", "(", "!", "(", "expression", "instanceof", "MapEntryExpression", ")", ")", "{", "map", "=", "false", ";", "break", ";", "}", "}", "if", "(", "map", ")", "{", "final", "MapExpression", "me", "=", "new", "MapExpression", "(", ")", ";", "for", "(", "Expression", "expression", ":", "list", ".", "getExpressions", "(", ")", ")", "{", "me", ".", "addMapEntryExpression", "(", "(", "MapEntryExpression", ")", "transform", "(", "expression", ")", ")", ";", "}", "me", ".", "setSourcePosition", "(", "list", ")", ";", "final", "CastExpression", "ce", "=", "new", "CastExpression", "(", "left", ".", "getType", "(", ")", ",", "me", ")", ";", "ce", ".", "setSourcePosition", "(", "be", ")", ";", "return", "ce", ";", "}", "}", "}", "if", "(", "be", ".", "getRightExpression", "(", ")", "instanceof", "MapEntryExpression", ")", "{", "final", "MapExpression", "me", "=", "new", "MapExpression", "(", ")", ";", "me", ".", "addMapEntryExpression", "(", "(", "MapEntryExpression", ")", "transform", "(", "be", ".", "getRightExpression", "(", ")", ")", ")", ";", "me", ".", "setSourcePosition", "(", "be", ".", "getRightExpression", "(", ")", ")", ";", "final", "CastExpression", "ce", "=", "new", "CastExpression", "(", "left", ".", "getType", "(", ")", ",", "me", ")", ";", "ce", ".", "setSourcePosition", "(", "be", ")", ";", "return", "ce", ";", "}", "}", "Expression", "right", "=", "transform", "(", "be", ".", "getRightExpression", "(", ")", ")", ";", "be", ".", "setLeftExpression", "(", "left", ")", ";", "be", ".", "setRightExpression", "(", "right", ")", ";", "return", "be", ";", "}", "protected", "Expression", "transformClosureExpression", "(", "ClosureExpression", "ce", ")", "{", "boolean", "oldInClosure", "=", "inClosure", ";", "inClosure", "=", "true", ";", "Parameter", "[", "]", "paras", "=", "ce", ".", "getParameters", "(", ")", ";", "if", "(", "paras", "!=", "null", ")", "{", "for", "(", "Parameter", "para", ":", "paras", ")", "{", "ClassNode", "t", "=", "para", ".", "getType", "(", ")", ";", "resolveOrFail", "(", "t", ",", "ce", ")", ";", "visitAnnotations", "(", "para", ")", ";", "if", "(", "para", ".", "hasInitialExpression", "(", ")", ")", "{", "Object", "initialVal", "=", "para", ".", "getInitialExpression", "(", ")", ";", "if", "(", "initialVal", "instanceof", "Expression", ")", "{", "para", ".", "setInitialExpression", "(", "transform", "(", "(", "Expression", ")", "initialVal", ")", ")", ";", "}", "}", "visitAnnotations", "(", "para", ")", ";", "}", "}", "Statement", "code", "=", "ce", ".", "getCode", "(", ")", ";", "if", "(", "code", "!=", "null", ")", "code", ".", "visit", "(", "this", ")", ";", "inClosure", "=", "oldInClosure", ";", "return", "ce", ";", "}", "protected", "Expression", "transformConstructorCallExpression", "(", "ConstructorCallExpression", "cce", ")", "{", "ClassNode", "type", "=", "cce", ".", "getType", "(", ")", ";", "resolveOrFail", "(", "type", ",", "cce", ")", ";", "if", "(", "Modifier", ".", "isAbstract", "(", "type", ".", "getModifiers", "(", ")", ")", ")", "{", "addError", "(", "\"\"", "+", "getDescription", "(", "type", ")", "+", "\".\"", ",", "cce", ")", ";", "}", "Expression", "ret", "=", "cce", ".", "transformExpression", "(", "this", ")", ";", "return", "ret", ";", "}", "private", "String", "getDescription", "(", "ClassNode", "node", ")", "{", "return", "(", "node", ".", "isInterface", "(", ")", "?", "\"interface\"", ":", "\"class\"", ")", "+", "\"", "'\"", "+", "node", ".", "getName", "(", ")", "+", "\"'\"", ";", "}", "protected", "Expression", "transformMethodCallExpression", "(", "MethodCallExpression", "mce", ")", "{", "Expression", "args", "=", "transform", "(", "mce", ".", "getArguments", "(", ")", ")", ";", "Expression", "method", "=", "transform", "(", "mce", ".", "getMethod", "(", ")", ")", ";", "Expression", "object", "=", "transform", "(", "mce", ".", "getObjectExpression", "(", ")", ")", ";", "resolveGenericsTypes", "(", "mce", ".", "getGenericsTypes", "(", ")", ")", ";", "MethodCallExpression", "result", "=", "new", "MethodCallExpression", "(", "object", ",", "method", ",", "args", ")", ";", "result", ".", "setSafe", "(", "mce", ".", "isSafe", "(", ")", ")", ";", "result", ".", "setImplicitThis", "(", "mce", ".", "isImplicitThis", "(", ")", ")", ";", "result", ".", "setSpreadSafe", "(", "mce", ".", "isSpreadSafe", "(", ")", ")", ";", "result", ".", "setSourcePosition", "(", "mce", ")", ";", "result", ".", "setGenericsTypes", "(", "mce", ".", "getGenericsTypes", "(", ")", ")", ";", "result", ".", "setMethodTarget", "(", "mce", ".", "getMethodTarget", "(", ")", ")", ";", "return", "result", ";", "}", "protected", "Expression", "transformDeclarationExpression", "(", "DeclarationExpression", "de", ")", "{", "visitAnnotations", "(", "de", ")", ";", "Expression", "oldLeft", "=", "de", ".", "getLeftExpression", "(", ")", ";", "checkingVariableTypeInDeclaration", "=", "true", ";", "Expression", "left", "=", "transform", "(", "oldLeft", ")", ";", "checkingVariableTypeInDeclaration", "=", "false", ";", "if", "(", "left", "instanceof", "ClassExpression", ")", "{", "ClassExpression", "ce", "=", "(", "ClassExpression", ")", "left", ";", "addError", "(", "\"\"", "+", "ce", ".", "getType", "(", ")", ".", "getName", "(", ")", ",", "oldLeft", ")", ";", "return", "de", ";", "}", "Expression", "right", "=", "transform", "(", "de", ".", "getRightExpression", "(", ")", ")", ";", "if", "(", "right", "==", "de", ".", "getRightExpression", "(", ")", ")", "{", "fixDeclaringClass", "(", "de", ")", ";", "return", "de", ";", "}", "DeclarationExpression", "newDeclExpr", "=", "new", "DeclarationExpression", "(", "left", ",", "de", ".", "getOperation", "(", ")", ",", "right", ")", ";", "newDeclExpr", ".", "setDeclaringClass", "(", "de", ".", "getDeclaringClass", "(", ")", ")", ";", "fixDeclaringClass", "(", "newDeclExpr", ")", ";", "newDeclExpr", ".", "setSourcePosition", "(", "de", ")", ";", "newDeclExpr", ".", "addAnnotations", "(", "de", ".", "getAnnotations", "(", ")", ")", ";", "return", "newDeclExpr", ";", "}", "private", "void", "fixDeclaringClass", "(", "DeclarationExpression", "newDeclExpr", ")", "{", "if", "(", "newDeclExpr", ".", "getDeclaringClass", "(", ")", "==", "null", "&&", "currentMethod", "!=", "null", ")", "{", "newDeclExpr", ".", "setDeclaringClass", "(", "currentMethod", ".", "getDeclaringClass", "(", ")", ")", ";", "}", "}", "protected", "Expression", "transformAnnotationConstantExpression", "(", "AnnotationConstantExpression", "ace", ")", "{", "AnnotationNode", "an", "=", "(", "AnnotationNode", ")", "ace", ".", "getValue", "(", ")", ";", "ClassNode", "type", "=", "an", ".", "getClassNode", "(", ")", ";", "resolveOrFail", "(", "type", ",", "\"\"", ",", "an", ")", ";", "for", "(", "Map", ".", "Entry", "<", "String", ",", "Expression", ">", "member", ":", "an", ".", "getMembers", "(", ")", ".", "entrySet", "(", ")", ")", "{", "member", ".", "setValue", "(", "transform", "(", "member", ".", "getValue", "(", ")", ")", ")", ";", "}", "return", "ace", ";", "}", "public", "void", "visitAnnotations", "(", "AnnotatedNode", "node", ")", "{", "List", "<", "AnnotationNode", ">", "annotations", "=", "node", ".", "getAnnotations", "(", ")", ";", "if", "(", "annotations", ".", "isEmpty", "(", ")", ")", "return", ";", "Map", "<", "String", ",", "AnnotationNode", ">", "tmpAnnotations", "=", "new", "HashMap", "<", "String", ",", "AnnotationNode", ">", "(", ")", ";", "ClassNode", "annType", ";", "for", "(", "AnnotationNode", "an", ":", "annotations", ")", "{", "if", "(", "an", ".", "isBuiltIn", "(", ")", ")", "continue", ";", "annType", "=", "an", ".", "getClassNode", "(", ")", ";", "resolveOrFail", "(", "annType", ",", "\"\"", ",", "an", ")", ";", "for", "(", "Map", ".", "Entry", "<", "String", ",", "Expression", ">", "member", ":", "an", ".", "getMembers", "(", ")", ".", "entrySet", "(", ")", ")", "{", "Expression", "newValue", "=", "transform", "(", "member", ".", "getValue", "(", ")", ")", ";", "newValue", "=", "transformInlineConstants", "(", "newValue", ")", ";", "member", ".", "setValue", "(", "newValue", ")", ";", "checkAnnotationMemberValue", "(", "newValue", ")", ";", "}", "}", "}", "private", "Expression", "transformInlineConstants", "(", "Expression", "exp", ")", "{", "if", "(", "exp", "instanceof", "PropertyExpression", ")", "{", "PropertyExpression", "pe", "=", "(", "PropertyExpression", ")", "exp", ";", "if", "(", "pe", ".", "getObjectExpression", "(", ")", "instanceof", "ClassExpression", ")", "{", "ClassExpression", "ce", "=", "(", "ClassExpression", ")", "pe", ".", "getObjectExpression", "(", ")", ";", "ClassNode", "type", "=", "ce", ".", "getType", "(", ")", ";", "if", "(", "type", ".", "isEnum", "(", ")", ")", "return", "exp", ";", "FieldNode", "fn", "=", "type", ".", "getField", "(", "pe", ".", "getPropertyAsString", "(", ")", ")", ";", "if", "(", "fn", "!=", "null", "&&", "!", "fn", ".", "isEnum", "(", ")", "&&", "fn", ".", "isStatic", "(", ")", "&&", "fn", ".", "isFinal", "(", ")", ")", "{", "if", "(", "fn", ".", "getInitialValueExpression", "(", ")", "instanceof", "ConstantExpression", ")", "{", "return", "fn", ".", "getInitialValueExpression", "(", ")", ";", "}", "}", "}", "}", "else", "if", "(", "exp", "instanceof", "ListExpression", ")", "{", "ListExpression", "le", "=", "(", "ListExpression", ")", "exp", ";", "ListExpression", "result", "=", "new", "ListExpression", "(", ")", ";", "for", "(", "Expression", "e", ":", "le", ".", "getExpressions", "(", ")", ")", "{", "result", ".", "addExpression", "(", "transformInlineConstants", "(", "e", ")", ")", ";", "}", "return", "result", ";", "}", "else", "if", "(", "exp", "instanceof", "AnnotationConstantExpression", ")", "{", "ConstantExpression", "ce", "=", "(", "ConstantExpression", ")", "exp", ";", "if", "(", "ce", ".", "getValue", "(", ")", "instanceof", "AnnotationNode", ")", "{", "AnnotationNode", "an", "=", "(", "AnnotationNode", ")", "ce", ".", "getValue", "(", ")", ";", "for", "(", "Map", ".", "Entry", "<", "String", ",", "Expression", ">", "member", ":", "an", ".", "getMembers", "(", ")", ".", "entrySet", "(", ")", ")", "{", "member", ".", "setValue", "(", "transformInlineConstants", "(", "member", ".", "getValue", "(", ")", ")", ")", ";", "}", "}", "}", "return", "exp", ";", "}", "protected", "boolean", "commencingResolution", "(", ")", "{", "return", "true", ";", "}", "protected", "void", "finishedResolution", "(", ")", "{", "}", "private", "void", "checkAnnotationMemberValue", "(", "Expression", "newValue", ")", "{", "if", "(", "newValue", "instanceof", "PropertyExpression", ")", "{", "PropertyExpression", "pe", "=", "(", "PropertyExpression", ")", "newValue", ";", "if", "(", "!", "(", "pe", ".", "getObjectExpression", "(", ")", "instanceof", "ClassExpression", ")", ")", "{", "addError", "(", "\"\"", "+", "pe", ".", "getText", "(", ")", "+", "\"\"", ",", "pe", ".", "getObjectExpression", "(", ")", ")", ";", "}", "}", "else", "if", "(", "newValue", "instanceof", "ListExpression", ")", "{", "ListExpression", "le", "=", "(", "ListExpression", ")", "newValue", ";", "for", "(", "Expression", "e", ":", "le", ".", "getExpressions", "(", ")", ")", "{", "checkAnnotationMemberValue", "(", "e", ")", ";", "}", "}", "}", "public", "void", "visitClass", "(", "ClassNode", "node", ")", "{", "ClassNode", "oldNode", "=", "currentClass", ";", "if", "(", "node", "instanceof", "InnerClassNode", ")", "{", "if", "(", "Modifier", ".", "isStatic", "(", "node", ".", "getModifiers", "(", ")", ")", ")", "{", "genericParameterNames", "=", "new", "HashMap", "<", "String", ",", "GenericsType", ">", "(", ")", ";", "}", "}", "else", "{", "genericParameterNames", "=", "new", "HashMap", "<", "String", ",", "GenericsType", ">", "(", ")", ";", "}", "currentClass", "=", "node", ";", "if", "(", "!", "commencingResolution", "(", ")", ")", "{", "return", ";", "}", "resolveGenericsHeader", "(", "node", ".", "getGenericsTypes", "(", ")", ")", ";", "ModuleNode", "module", "=", "node", ".", "getModule", "(", ")", ";", "if", "(", "!", "module", ".", "hasImportsResolved", "(", ")", ")", "{", "for", "(", "ImportNode", "importNode", ":", "module", ".", "getImports", "(", ")", ")", "{", "currImportNode", "=", "importNode", ";", "ClassNode", "type", "=", "importNode", ".", "getType", "(", ")", ";", "if", "(", "resolve", "(", "type", ",", "false", ",", "false", ",", "true", ")", ")", "{", "currImportNode", "=", "null", ";", "continue", ";", "}", "currImportNode", "=", "null", ";", "addError", "(", "\"\"", "+", "type", ".", "getName", "(", ")", ",", "type", ")", ";", "}", "for", "(", "ImportNode", "importNode", ":", "module", ".", "getStaticStarImports", "(", ")", ".", "values", "(", ")", ")", "{", "ClassNode", "type", "=", "importNode", ".", "getType", "(", ")", ";", "if", "(", "resolve", "(", "type", ",", "false", ",", "false", ",", "true", ")", ")", "continue", ";", "if", "(", "type", ".", "getPackageName", "(", ")", "==", "null", "&&", "node", ".", "getPackageName", "(", ")", "!=", "null", ")", "{", "String", "oldTypeName", "=", "type", ".", "getName", "(", ")", ";", "type", ".", "setName", "(", "node", ".", "getPackageName", "(", ")", "+", "\".\"", "+", "oldTypeName", ")", ";", "if", "(", "resolve", "(", "type", ",", "false", ",", "false", ",", "true", ")", ")", "continue", ";", "type", ".", "setName", "(", "oldTypeName", ")", ";", "}", "addError", "(", "\"\"", "+", "type", ".", "getName", "(", ")", ",", "type", ")", ";", "importNode", ".", "markAsUnresolvable", "(", ")", ";", "}", "for", "(", "ImportNode", "importNode", ":", "module", ".", "getStaticImports", "(", ")", ".", "values", "(", ")", ")", "{", "ClassNode", "type", "=", "importNode", ".", "getType", "(", ")", ";", "if", "(", "resolve", "(", "type", ",", "true", ",", "true", ",", "true", ")", ")", "continue", ";", "addError", "(", "\"\"", "+", "type", ".", "getName", "(", ")", ",", "type", ")", ";", "}", "for", "(", "ImportNode", "importNode", ":", "module", ".", "getStaticStarImports", "(", ")", ".", "values", "(", ")", ")", "{", "ClassNode", "type", "=", "importNode", ".", "getType", "(", ")", ";", "if", "(", "resolve", "(", "type", ",", "true", ",", "true", ",", "true", ")", ")", "continue", ";", "if", "(", "!", "importNode", ".", "isUnresolvable", "(", ")", ")", "{", "addError", "(", "\"\"", "+", "type", ".", "getName", "(", ")", ",", "type", ")", ";", "}", "}", "module", ".", "setImportsResolved", "(", "true", ")", ";", "}", "ClassNode", "sn", "=", "node", ".", "getUnresolvedSuperClass", "(", ")", ";", "if", "(", "sn", "!=", "null", ")", "resolveOrFail", "(", "sn", ",", "node", ",", "true", ")", ";", "for", "(", "ClassNode", "anInterface", ":", "node", ".", "getInterfaces", "(", ")", ")", "{", "resolveOrFail", "(", "anInterface", ",", "node", ",", "true", ")", ";", "}", "checkCyclicInheritence", "(", "node", ",", "node", ".", "getUnresolvedSuperClass", "(", ")", ",", "node", ".", "getInterfaces", "(", ")", ")", ";", "super", ".", "visitClass", "(", "node", ")", ";", "finishedResolution", "(", ")", ";", "currentClass", "=", "oldNode", ";", "}", "private", "void", "checkCyclicInheritence", "(", "ClassNode", "originalNode", ",", "ClassNode", "parentToCompare", ",", "ClassNode", "[", "]", "interfacesToCompare", ")", "{", "if", "(", "!", "originalNode", ".", "isInterface", "(", ")", ")", "{", "if", "(", "parentToCompare", "==", "null", ")", "return", ";", "if", "(", "originalNode", "==", "parentToCompare", ".", "redirect", "(", ")", ")", "{", "addError", "(", "\"\"", "+", "parentToCompare", ".", "getName", "(", ")", "+", "\"", "in", "class", "\"", "+", "originalNode", ".", "getName", "(", ")", ",", "originalNode", ")", ";", "originalNode", ".", "redirect", "(", ")", ".", "setHasInconsistentHierarchy", "(", "true", ")", ";", "return", ";", "}", "if", "(", "interfacesToCompare", "!=", "null", "&&", "interfacesToCompare", ".", "length", ">", "0", ")", "{", "for", "(", "ClassNode", "intfToCompare", ":", "interfacesToCompare", ")", "{", "if", "(", "originalNode", "==", "intfToCompare", ".", "redirect", "(", ")", ")", "{", "addError", "(", "\"\"", "+", "originalNode", ".", "getName", "(", ")", "+", "\"\"", ",", "originalNode", ")", ";", "originalNode", ".", "redirect", "(", ")", ".", "setHasInconsistentHierarchy", "(", "true", ")", ";", "return", ";", "}", "}", "}", "if", "(", "parentToCompare", "==", "ClassHelper", ".", "OBJECT_TYPE", ")", "return", ";", "checkCyclicInheritence", "(", "originalNode", ",", "parentToCompare", ".", "getUnresolvedSuperClass", "(", ")", ",", "null", ")", ";", "}", "else", "{", "if", "(", "interfacesToCompare", "!=", "null", "&&", "interfacesToCompare", ".", "length", ">", "0", ")", "{", "for", "(", "ClassNode", "intfToCompare", ":", "interfacesToCompare", ")", "{", "if", "(", "originalNode", "==", "intfToCompare", ".", "redirect", "(", ")", ")", "{", "addError", "(", "\"\"", "+", "intfToCompare", ".", "getName", "(", ")", "+", "\"\"", "+", "originalNode", ".", "getName", "(", ")", ",", "originalNode", ")", ";", "originalNode", ".", "redirect", "(", ")", ".", "setHasInconsistentHierarchy", "(", "true", ")", ";", "return", ";", "}", "}", "for", "(", "ClassNode", "intf", ":", "interfacesToCompare", ")", "{", "checkCyclicInheritence", "(", "originalNode", ",", "null", ",", "intf", ".", "getInterfaces", "(", ")", ")", ";", "}", "}", "else", "{", "return", ";", "}", "}", "}", "public", "void", "visitCatchStatement", "(", "CatchStatement", "cs", ")", "{", "resolveOrFail", "(", "cs", ".", "getExceptionType", "(", ")", ",", "cs", ")", ";", "if", "(", "cs", ".", "getExceptionType", "(", ")", "==", "ClassHelper", ".", "DYNAMIC_TYPE", ")", "{", "cs", ".", "getVariable", "(", ")", ".", "setType", "(", "ClassHelper", ".", "make", "(", "Exception", ".", "class", ")", ")", ";", "}", "super", ".", "visitCatchStatement", "(", "cs", ")", ";", "}", "public", "void", "visitForLoop", "(", "ForStatement", "forLoop", ")", "{", "resolveOrFail", "(", "forLoop", ".", "getVariableType", "(", ")", ",", "forLoop", ")", ";", "super", ".", "visitForLoop", "(", "forLoop", ")", ";", "}", "public", "void", "visitBlockStatement", "(", "BlockStatement", "block", ")", "{", "VariableScope", "oldScope", "=", "currentScope", ";", "currentScope", "=", "block", ".", "getVariableScope", "(", ")", ";", "super", ".", "visitBlockStatement", "(", "block", ")", ";", "currentScope", "=", "oldScope", ";", "}", "protected", "SourceUnit", "getSourceUnit", "(", ")", "{", "return", "source", ";", "}", "private", "void", "resolveGenericsTypes", "(", "GenericsType", "[", "]", "types", ")", "{", "if", "(", "types", "==", "null", ")", "return", ";", "currentClass", ".", "setUsingGenerics", "(", "true", ")", ";", "for", "(", "GenericsType", "type", ":", "types", ")", "{", "resolveGenericsType", "(", "type", ")", ";", "}", "}", "private", "void", "resolveGenericsHeader", "(", "GenericsType", "[", "]", "types", ")", "{", "if", "(", "types", "==", "null", ")", "return", ";", "currentClass", ".", "setUsingGenerics", "(", "true", ")", ";", "for", "(", "GenericsType", "type", ":", "types", ")", "{", "ClassNode", "classNode", "=", "type", ".", "getType", "(", ")", ";", "String", "name", "=", "type", ".", "getName", "(", ")", ";", "ClassNode", "[", "]", "bounds", "=", "type", ".", "getUpperBounds", "(", ")", ";", "if", "(", "bounds", "!=", "null", ")", "{", "boolean", "nameAdded", "=", "false", ";", "for", "(", "ClassNode", "upperBound", ":", "bounds", ")", "{", "if", "(", "!", "nameAdded", "&&", "upperBound", "!=", "null", "||", "!", "resolve", "(", "classNode", ")", ")", "{", "genericParameterNames", ".", "put", "(", "name", ",", "type", ")", ";", "type", ".", "setPlaceholder", "(", "true", ")", ";", "classNode", ".", "setRedirect", "(", "upperBound", ")", ";", "nameAdded", "=", "true", ";", "}", "resolveOrFail", "(", "upperBound", ",", "classNode", ")", ";", "}", "}", "else", "{", "genericParameterNames", ".", "put", "(", "name", ",", "type", ")", ";", "classNode", ".", "setRedirect", "(", "ClassHelper", ".", "OBJECT_TYPE", ")", ";", "type", ".", "setPlaceholder", "(", "true", ")", ";", "}", "}", "}", "private", "void", "resolveGenericsType", "(", "GenericsType", "genericsType", ")", "{", "if", "(", "genericsType", ".", "isResolved", "(", ")", ")", "return", ";", "currentClass", ".", "setUsingGenerics", "(", "true", ")", ";", "ClassNode", "type", "=", "genericsType", ".", "getType", "(", ")", ";", "String", "name", "=", "type", ".", "getName", "(", ")", ";", "ClassNode", "[", "]", "bounds", "=", "genericsType", ".", "getUpperBounds", "(", ")", ";", "if", "(", "!", "genericParameterNames", ".", "containsKey", "(", "name", ")", ")", "{", "if", "(", "bounds", "!=", "null", ")", "{", "for", "(", "ClassNode", "upperBound", ":", "bounds", ")", "{", "resolveOrFail", "(", "upperBound", ",", "genericsType", ")", ";", "type", ".", "setRedirect", "(", "upperBound", ")", ";", "resolveGenericsTypes", "(", "upperBound", ".", "getGenericsTypes", "(", ")", ")", ";", "}", "}", "else", "if", "(", "genericsType", ".", "isWildcard", "(", ")", ")", "{", "type", ".", "setRedirect", "(", "ClassHelper", ".", "OBJECT_TYPE", ")", ";", "}", "else", "{", "resolveOrFail", "(", "type", ",", "genericsType", ")", ";", "}", "}", "else", "{", "GenericsType", "gt", "=", "genericParameterNames", ".", "get", "(", "name", ")", ";", "type", ".", "setRedirect", "(", "gt", ".", "getType", "(", ")", ")", ";", "genericsType", ".", "setPlaceholder", "(", "true", ")", ";", "}", "if", "(", "genericsType", ".", "getLowerBound", "(", ")", "!=", "null", ")", "{", "resolveOrFail", "(", "genericsType", ".", "getLowerBound", "(", ")", ",", "genericsType", ")", ";", "}", "resolveGenericsTypes", "(", "type", ".", "getGenericsTypes", "(", ")", ")", ";", "genericsType", ".", "setResolved", "(", "genericsType", ".", "getType", "(", ")", ".", "isResolved", "(", ")", ")", ";", "}", "}", "</s>" ]
6,668
[ "<s>", "package", "org", ".", "codehaus", ".", "groovy", ".", "control", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "antlr", ".", "AntlrParserPluginFactory", ";", "public", "abstract", "class", "ParserPluginFactory", "{", "public", "static", "ParserPluginFactory", "newInstance", "(", "boolean", "useNewParser", ")", "{", "if", "(", "useNewParser", ")", "{", "Class", "type", "=", "null", ";", "String", "name", "=", "\"\"", ";", "try", "{", "type", "=", "Class", ".", "forName", "(", "name", ")", ";", "}", "catch", "(", "ClassNotFoundException", "e", ")", "{", "try", "{", "type", "=", "ParserPluginFactory", ".", "class", ".", "getClassLoader", "(", ")", ".", "loadClass", "(", "name", ")", ";", "}", "catch", "(", "ClassNotFoundException", "e1", ")", "{", "ClassLoader", "contextClassLoader", "=", "Thread", ".", "currentThread", "(", ")", ".", "getContextClassLoader", "(", ")", ";", "if", "(", "contextClassLoader", "!=", "null", ")", "{", "try", "{", "type", "=", "contextClassLoader", ".", "loadClass", "(", "name", ")", ";", "}", "catch", "(", "ClassNotFoundException", "e2", ")", "{", "}", "}", "}", "}", "if", "(", "type", "!=", "null", ")", "{", "try", "{", "return", "(", "ParserPluginFactory", ")", "type", ".", "newInstance", "(", ")", ";", "}", "catch", "(", "Exception", "e", ")", "{", "throw", "new", "RuntimeException", "(", "\"\"", "+", "e", ",", "e", ")", ";", "}", "}", "}", "return", "new", "AntlrParserPluginFactory", "(", ")", ";", "}", "public", "abstract", "ParserPlugin", "createParserPlugin", "(", ")", ";", "}", "</s>" ]
6,669
[ "<s>", "package", "org", ".", "codehaus", ".", "groovy", ".", "control", ";", "import", "groovy", ".", "lang", ".", "GroovyClassLoader", ";", "import", "java", ".", "io", ".", "File", ";", "import", "java", ".", "io", ".", "FileWriter", ";", "import", "java", ".", "io", ".", "IOException", ";", "import", "java", ".", "io", ".", "Reader", ";", "import", "java", ".", "net", ".", "URL", ";", "import", "java", ".", "security", ".", "AccessController", ";", "import", "java", ".", "security", ".", "PrivilegedAction", ";", "import", "java", ".", "util", ".", "HashMap", ";", "import", "java", ".", "util", ".", "List", ";", "import", "java", ".", "util", ".", "Map", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "GroovyBugError", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "ClassNode", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "Comment", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "GenericsType", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "ModuleNode", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "control", ".", "io", ".", "FileReaderSource", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "control", ".", "io", ".", "ReaderSource", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "control", ".", "io", ".", "StringReaderSource", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "control", ".", "io", ".", "URLReaderSource", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "control", ".", "messages", ".", "Message", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "control", ".", "messages", ".", "SimpleMessage", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "control", ".", "messages", ".", "SyntaxErrorMessage", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "syntax", ".", "*", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "tools", ".", "Utilities", ";", "import", "antlr", ".", "CharScanner", ";", "import", "antlr", ".", "MismatchedTokenException", ";", "import", "antlr", ".", "MismatchedCharException", ";", "import", "antlr", ".", "NoViableAltException", ";", "import", "antlr", ".", "NoViableAltForCharException", ";", "public", "class", "SourceUnit", "extends", "ProcessingUnit", "{", "private", "List", "<", "Comment", ">", "comments", ";", "private", "ParserPlugin", "parserPlugin", ";", "protected", "ReaderSource", "source", ";", "protected", "String", "name", ";", "protected", "Reduction", "cst", ";", "protected", "ModuleNode", "ast", ";", "public", "boolean", "isReconcile", ";", "public", "SourceUnit", "(", "String", "name", ",", "ReaderSource", "source", ",", "CompilerConfiguration", "flags", ",", "GroovyClassLoader", "loader", ",", "ErrorCollector", "er", ")", "{", "super", "(", "flags", ",", "loader", ",", "er", ")", ";", "this", ".", "name", "=", "name", ";", "this", ".", "source", "=", "source", ";", "}", "public", "SourceUnit", "(", "File", "source", ",", "CompilerConfiguration", "configuration", ",", "GroovyClassLoader", "loader", ",", "ErrorCollector", "er", ")", "{", "this", "(", "source", ".", "getPath", "(", ")", ",", "new", "FileReaderSource", "(", "source", ",", "configuration", ")", ",", "configuration", ",", "loader", ",", "er", ")", ";", "}", "public", "SourceUnit", "(", "URL", "source", ",", "CompilerConfiguration", "configuration", ",", "GroovyClassLoader", "loader", ",", "ErrorCollector", "er", ")", "{", "this", "(", "source", ".", "getPath", "(", ")", ",", "new", "URLReaderSource", "(", "source", ",", "configuration", ")", ",", "configuration", ",", "loader", ",", "er", ")", ";", "}", "public", "SourceUnit", "(", "String", "name", ",", "String", "source", ",", "CompilerConfiguration", "configuration", ",", "GroovyClassLoader", "loader", ",", "ErrorCollector", "er", ")", "{", "this", "(", "name", ",", "new", "StringReaderSource", "(", "source", ",", "configuration", ")", ",", "configuration", ",", "loader", ",", "er", ")", ";", "}", "public", "String", "getName", "(", ")", "{", "return", "name", ";", "}", "public", "Reduction", "getCST", "(", ")", "{", "return", "this", ".", "cst", ";", "}", "public", "ModuleNode", "getAST", "(", ")", "{", "return", "this", ".", "ast", ";", "}", "public", "boolean", "failedWithUnexpectedEOF", "(", ")", "{", "if", "(", "getErrorCollector", "(", ")", ".", "hasErrors", "(", ")", ")", "{", "Message", "last", "=", "(", "Message", ")", "getErrorCollector", "(", ")", ".", "getLastError", "(", ")", ";", "Throwable", "cause", "=", "null", ";", "if", "(", "last", "instanceof", "SyntaxErrorMessage", ")", "{", "cause", "=", "(", "(", "SyntaxErrorMessage", ")", "last", ")", ".", "getCause", "(", ")", ".", "getCause", "(", ")", ";", "}", "if", "(", "cause", "!=", "null", ")", "{", "if", "(", "cause", "instanceof", "NoViableAltException", ")", "{", "return", "isEofToken", "(", "(", "(", "NoViableAltException", ")", "cause", ")", ".", "token", ")", ";", "}", "else", "if", "(", "cause", "instanceof", "NoViableAltForCharException", ")", "{", "char", "badChar", "=", "(", "(", "NoViableAltForCharException", ")", "cause", ")", ".", "foundChar", ";", "return", "badChar", "==", "CharScanner", ".", "EOF_CHAR", ";", "}", "else", "if", "(", "cause", "instanceof", "MismatchedCharException", ")", "{", "char", "badChar", "=", "(", "char", ")", "(", "(", "MismatchedCharException", ")", "cause", ")", ".", "foundChar", ";", "return", "badChar", "==", "CharScanner", ".", "EOF_CHAR", ";", "}", "else", "if", "(", "cause", "instanceof", "MismatchedTokenException", ")", "{", "return", "isEofToken", "(", "(", "(", "MismatchedTokenException", ")", "cause", ")", ".", "token", ")", ";", "}", "}", "}", "return", "false", ";", "}", "protected", "boolean", "isEofToken", "(", "antlr", ".", "Token", "token", ")", "{", "return", "token", ".", "getType", "(", ")", "==", "antlr", ".", "Token", ".", "EOF_TYPE", ";", "}", "public", "static", "SourceUnit", "create", "(", "String", "name", ",", "String", "source", ")", "{", "CompilerConfiguration", "configuration", "=", "new", "CompilerConfiguration", "(", ")", ";", "configuration", ".", "setTolerance", "(", "1", ")", ";", "return", "new", "SourceUnit", "(", "name", ",", "source", ",", "configuration", ",", "null", ",", "new", "ErrorCollector", "(", "configuration", ")", ")", ";", "}", "public", "static", "SourceUnit", "create", "(", "String", "name", ",", "String", "source", ",", "int", "tolerance", ")", "{", "CompilerConfiguration", "configuration", "=", "new", "CompilerConfiguration", "(", ")", ";", "configuration", ".", "setTolerance", "(", "tolerance", ")", ";", "return", "new", "SourceUnit", "(", "name", ",", "source", ",", "configuration", ",", "null", ",", "new", "ErrorCollector", "(", "configuration", ")", ")", ";", "}", "public", "void", "parse", "(", ")", "throws", "CompilationFailedException", "{", "if", "(", "this", ".", "phase", ">", "Phases", ".", "PARSING", ")", "{", "throw", "new", "GroovyBugError", "(", "\"\"", ")", ";", "}", "if", "(", "this", ".", "phase", "==", "Phases", ".", "INITIALIZATION", ")", "{", "nextPhase", "(", ")", ";", "}", "Reader", "reader", "=", "null", ";", "try", "{", "reader", "=", "source", ".", "getReader", "(", ")", ";", "parserPlugin", "=", "getConfiguration", "(", ")", ".", "getPluginFactory", "(", ")", ".", "createParserPlugin", "(", ")", ";", "cst", "=", "parserPlugin", ".", "parseCST", "(", "this", ",", "reader", ")", ";", "reader", ".", "close", "(", ")", ";", "}", "catch", "(", "IOException", "e", ")", "{", "getErrorCollector", "(", ")", ".", "addFatalError", "(", "new", "SimpleMessage", "(", "e", ".", "getMessage", "(", ")", ",", "this", ")", ")", ";", "}", "finally", "{", "if", "(", "reader", "!=", "null", ")", "{", "try", "{", "reader", ".", "close", "(", ")", ";", "}", "catch", "(", "IOException", "e", ")", "{", "}", "}", "}", "}", "public", "void", "convert", "(", ")", "throws", "CompilationFailedException", "{", "if", "(", "this", ".", "phase", "==", "Phases", ".", "PARSING", "&&", "this", ".", "phaseComplete", ")", "{", "gotoPhase", "(", "Phases", ".", "CONVERSION", ")", ";", "}", "if", "(", "this", ".", "phase", "!=", "Phases", ".", "CONVERSION", ")", "{", "throw", "new", "GroovyBugError", "(", "\"\"", ")", ";", "}", "try", "{", "this", ".", "ast", "=", "parserPlugin", ".", "buildAST", "(", "this", ",", "this", ".", "classLoader", ",", "this", ".", "cst", ")", ";", "this", ".", "ast", ".", "setDescription", "(", "this", ".", "name", ")", ";", "}", "catch", "(", "SyntaxException", "e", ")", "{", "if", "(", "this", ".", "ast", "==", "null", ")", "{", "this", ".", "ast", "=", "new", "ModuleNode", "(", "this", ")", ";", "}", "getErrorCollector", "(", ")", ".", "addError", "(", "new", "SyntaxErrorMessage", "(", "e", ",", "this", ")", ")", ";", "}", "String", "property", "=", "(", "String", ")", "AccessController", ".", "doPrivileged", "(", "new", "PrivilegedAction", "(", ")", "{", "public", "Object", "run", "(", ")", "{", "return", "System", ".", "getProperty", "(", "\"groovy.ast\"", ")", ";", "}", "}", ")", ";", "if", "(", "\"xml\"", ".", "equals", "(", "property", ")", ")", "{", "saveAsXML", "(", "name", ",", "ast", ")", ";", "}", "}", "private", "void", "saveAsXML", "(", "String", "name", ",", "ModuleNode", "ast", ")", "{", "}", "public", "String", "getSample", "(", "int", "line", ",", "int", "column", ",", "Janitor", "janitor", ")", "{", "String", "sample", "=", "null", ";", "String", "text", "=", "source", ".", "getLine", "(", "line", ",", "janitor", ")", ";", "if", "(", "text", "!=", "null", ")", "{", "if", "(", "column", ">", "0", ")", "{", "String", "marker", "=", "Utilities", ".", "repeatString", "(", "\"", "\"", ",", "column", "-", "1", ")", "+", "\"^\"", ";", "if", "(", "column", ">", "40", ")", "{", "int", "start", "=", "column", "-", "30", "-", "1", ";", "int", "end", "=", "(", "column", "+", "10", ">", "text", ".", "length", "(", ")", "?", "text", ".", "length", "(", ")", ":", "column", "+", "10", "-", "1", ")", ";", "sample", "=", "\"", "\"", "+", "text", ".", "substring", "(", "start", ",", "end", ")", "+", "Utilities", ".", "eol", "(", ")", "+", "\"", "\"", "+", "marker", ".", "substring", "(", "start", ",", "marker", ".", "length", "(", ")", ")", ";", "}", "else", "{", "sample", "=", "\"", "\"", "+", "text", "+", "Utilities", ".", "eol", "(", ")", "+", "\"", "\"", "+", "marker", ";", "}", "}", "else", "{", "sample", "=", "text", ";", "}", "}", "return", "sample", ";", "}", "public", "void", "addException", "(", "Exception", "e", ")", "throws", "CompilationFailedException", "{", "getErrorCollector", "(", ")", ".", "addException", "(", "e", ",", "this", ")", ";", "}", "public", "void", "addError", "(", "SyntaxException", "se", ")", "throws", "CompilationFailedException", "{", "getErrorCollector", "(", ")", ".", "addError", "(", "se", ",", "this", ")", ";", "}", "public", "ReaderSource", "getSource", "(", ")", "{", "return", "source", ";", "}", "public", "List", "<", "Comment", ">", "getComments", "(", ")", "{", "return", "comments", ";", "}", "public", "void", "setComments", "(", "List", "<", "Comment", ">", "comments", ")", "{", "this", ".", "comments", "=", "comments", ";", "}", "}", "</s>" ]
6,670
[ "<s>", "package", "org", ".", "codehaus", ".", "groovy", ".", "control", ".", "messages", ";", "import", "java", ".", "io", ".", "PrintWriter", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "control", ".", "Janitor", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "control", ".", "SourceUnit", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "syntax", ".", "CSTNode", ";", "public", "class", "LocatedMessage", "extends", "SimpleMessage", "{", "protected", "CSTNode", "context", ";", "public", "LocatedMessage", "(", "String", "message", ",", "CSTNode", "context", ",", "SourceUnit", "source", ")", "{", "super", "(", "message", ",", "source", ")", ";", "this", ".", "context", "=", "context", ";", "}", "public", "LocatedMessage", "(", "String", "message", ",", "Object", "data", ",", "CSTNode", "context", ",", "SourceUnit", "source", ")", "{", "super", "(", "message", ",", "data", ",", "source", ")", ";", "this", ".", "context", "=", "context", ";", "}", "public", "CSTNode", "getContext", "(", ")", "{", "return", "context", ";", "}", "public", "void", "write", "(", "PrintWriter", "writer", ",", "Janitor", "janitor", ")", "{", "if", "(", "owner", "instanceof", "SourceUnit", ")", "{", "SourceUnit", "source", "=", "(", "SourceUnit", ")", "owner", ";", "String", "name", "=", "source", ".", "getName", "(", ")", ";", "int", "line", "=", "context", ".", "getStartLine", "(", ")", ";", "int", "column", "=", "context", ".", "getStartColumn", "(", ")", ";", "String", "sample", "=", "source", ".", "getSample", "(", "line", ",", "column", ",", "janitor", ")", ";", "if", "(", "sample", "!=", "null", ")", "{", "writer", ".", "println", "(", "source", ".", "getSample", "(", "line", ",", "column", ",", "janitor", ")", ")", ";", "}", "writer", ".", "println", "(", "name", "+", "\":", "\"", "+", "line", "+", "\":", "\"", "+", "this", ".", "message", ")", ";", "writer", ".", "println", "(", "\"\"", ")", ";", "}", "else", "{", "writer", ".", "println", "(", "\"\"", "+", "this", ".", "message", ")", ";", "writer", ".", "println", "(", "\"\"", ")", ";", "}", "}", "}", "</s>" ]
6,671
[ "<s>", "package", "org", ".", "codehaus", ".", "groovy", ".", "control", ";", "import", "groovy", ".", "lang", ".", "GroovyClassLoader", ";", "public", "abstract", "class", "ProcessingUnit", "{", "protected", "int", "phase", ";", "protected", "boolean", "phaseComplete", ";", "protected", "int", "erroredAtPhase", "=", "-", "1", ";", "protected", "CompilerConfiguration", "configuration", ";", "protected", "GroovyClassLoader", "classLoader", ";", "protected", "ErrorCollector", "errorCollector", ";", "public", "ProcessingUnit", "(", "CompilerConfiguration", "configuration", ",", "GroovyClassLoader", "classLoader", ",", "ErrorCollector", "er", ")", "{", "this", ".", "phase", "=", "Phases", ".", "INITIALIZATION", ";", "this", ".", "configuration", "=", "configuration", ";", "this", ".", "setClassLoader", "(", "classLoader", ")", ";", "configure", "(", "(", "configuration", "==", "null", "?", "new", "CompilerConfiguration", "(", ")", ":", "configuration", ")", ")", ";", "if", "(", "er", "==", "null", ")", "er", "=", "new", "ErrorCollector", "(", "getConfiguration", "(", ")", ")", ";", "this", ".", "errorCollector", "=", "er", ";", "}", "public", "void", "configure", "(", "CompilerConfiguration", "configuration", ")", "{", "this", ".", "configuration", "=", "configuration", ";", "}", "public", "CompilerConfiguration", "getConfiguration", "(", ")", "{", "return", "configuration", ";", "}", "public", "void", "setConfiguration", "(", "CompilerConfiguration", "configuration", ")", "{", "this", ".", "configuration", "=", "configuration", ";", "}", "public", "GroovyClassLoader", "getClassLoader", "(", ")", "{", "return", "classLoader", ";", "}", "public", "void", "setClassLoader", "(", "GroovyClassLoader", "loader", ")", "{", "ClassLoader", "parent", "=", "Thread", ".", "currentThread", "(", ")", ".", "getContextClassLoader", "(", ")", ";", "if", "(", "parent", "==", "null", ")", "parent", "=", "ProcessingUnit", ".", "class", ".", "getClassLoader", "(", ")", ";", "this", ".", "classLoader", "=", "(", "loader", "==", "null", "?", "new", "GroovyClassLoader", "(", "parent", ",", "configuration", ")", ":", "loader", ")", ";", "}", "public", "int", "getPhase", "(", ")", "{", "return", "this", ".", "phase", ";", "}", "public", "String", "getPhaseDescription", "(", ")", "{", "return", "Phases", ".", "getDescription", "(", "this", ".", "phase", ")", ";", "}", "public", "ErrorCollector", "getErrorCollector", "(", ")", "{", "return", "errorCollector", ";", "}", "public", "void", "completePhase", "(", ")", "throws", "CompilationFailedException", "{", "if", "(", "errorCollector", ".", "hasErrors", "(", ")", ")", "{", "erroredAtPhase", "=", "phase", ";", "}", "phaseComplete", "=", "true", ";", "}", "public", "void", "nextPhase", "(", ")", "throws", "CompilationFailedException", "{", "gotoPhase", "(", "this", ".", "phase", "+", "1", ")", ";", "}", "public", "void", "gotoPhase", "(", "int", "phase", ")", "throws", "CompilationFailedException", "{", "if", "(", "!", "this", ".", "phaseComplete", ")", "{", "completePhase", "(", ")", ";", "}", "this", ".", "phase", "=", "phase", ";", "this", ".", "phaseComplete", "=", "false", ";", "}", "}", "</s>" ]
6,672
[ "<s>", "package", "org", ".", "codehaus", ".", "groovy", ".", "control", ";", "import", "java", ".", "io", ".", "PrintWriter", ";", "import", "java", ".", "util", ".", "Iterator", ";", "import", "java", ".", "util", ".", "LinkedList", ";", "import", "java", ".", "util", ".", "List", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "control", ".", "messages", ".", "ExceptionMessage", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "control", ".", "messages", ".", "LocatedMessage", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "control", ".", "messages", ".", "Message", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "control", ".", "messages", ".", "SyntaxErrorMessage", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "control", ".", "messages", ".", "WarningMessage", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "syntax", ".", "CSTNode", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "syntax", ".", "SyntaxException", ";", "public", "class", "ErrorCollector", "{", "public", "boolean", "transformActive", "=", "false", ";", "protected", "LinkedList", "warnings", ";", "protected", "LinkedList", "errors", ";", "protected", "CompilerConfiguration", "configuration", ";", "public", "ErrorCollector", "(", "CompilerConfiguration", "configuration", ")", "{", "this", ".", "warnings", "=", "null", ";", "this", ".", "errors", "=", "null", ";", "this", ".", "configuration", "=", "configuration", ";", "}", "public", "void", "addCollectorContents", "(", "ErrorCollector", "er", ")", "{", "if", "(", "er", ".", "errors", "!=", "null", ")", "{", "if", "(", "errors", "==", "null", ")", "{", "errors", "=", "er", ".", "errors", ";", "}", "else", "{", "errors", ".", "addAll", "(", "er", ".", "errors", ")", ";", "}", "}", "if", "(", "er", ".", "warnings", "!=", "null", ")", "{", "if", "(", "warnings", "==", "null", ")", "{", "warnings", "=", "er", ".", "warnings", ";", "}", "else", "{", "warnings", ".", "addAll", "(", "er", ".", "warnings", ")", ";", "}", "}", "}", "public", "void", "addErrorAndContinue", "(", "Message", "message", ")", "{", "if", "(", "this", ".", "errors", "==", "null", ")", "{", "this", ".", "errors", "=", "new", "LinkedList", "(", ")", ";", "}", "this", ".", "errors", ".", "add", "(", "message", ")", ";", "}", "public", "void", "addError", "(", "Message", "message", ")", "throws", "CompilationFailedException", "{", "addErrorAndContinue", "(", "message", ")", ";", "if", "(", "errors", "!=", "null", "&&", "this", ".", "errors", ".", "size", "(", ")", ">=", "configuration", ".", "getTolerance", "(", ")", ")", "{", "failIfErrors", "(", ")", ";", "}", "}", "public", "void", "addError", "(", "Message", "message", ",", "boolean", "fatal", ")", "throws", "CompilationFailedException", "{", "if", "(", "fatal", ")", "{", "addFatalError", "(", "message", ")", ";", "}", "else", "{", "addError", "(", "message", ")", ";", "}", "}", "public", "void", "addError", "(", "SyntaxException", "error", ",", "SourceUnit", "source", ")", "throws", "CompilationFailedException", "{", "addError", "(", "Message", ".", "create", "(", "error", ",", "source", ")", ",", "error", ".", "isFatal", "(", ")", ")", ";", "}", "public", "void", "addError", "(", "String", "text", ",", "CSTNode", "context", ",", "SourceUnit", "source", ")", "throws", "CompilationFailedException", "{", "addError", "(", "new", "LocatedMessage", "(", "text", ",", "context", ",", "source", ")", ")", ";", "}", "public", "void", "addFatalError", "(", "Message", "message", ")", "throws", "CompilationFailedException", "{", "addError", "(", "message", ")", ";", "failIfErrors", "(", ")", ";", "}", "public", "void", "addException", "(", "Exception", "cause", ",", "SourceUnit", "source", ")", "throws", "CompilationFailedException", "{", "addError", "(", "new", "ExceptionMessage", "(", "cause", ",", "configuration", ".", "getDebug", "(", ")", ",", "source", ")", ")", ";", "failIfErrors", "(", ")", ";", "}", "public", "boolean", "hasErrors", "(", ")", "{", "return", "this", ".", "errors", "!=", "null", ";", "}", "public", "boolean", "hasWarnings", "(", ")", "{", "return", "this", ".", "warnings", "!=", "null", ";", "}", "public", "List", "getWarnings", "(", ")", "{", "return", "this", ".", "warnings", ";", "}", "public", "List", "getErrors", "(", ")", "{", "return", "this", ".", "errors", ";", "}", "public", "int", "getWarningCount", "(", ")", "{", "return", "(", "(", "this", ".", "warnings", "==", "null", ")", "?", "0", ":", "this", ".", "warnings", ".", "size", "(", ")", ")", ";", "}", "public", "int", "getErrorCount", "(", ")", "{", "return", "(", "(", "this", ".", "errors", "==", "null", ")", "?", "0", ":", "this", ".", "errors", ".", "size", "(", ")", ")", ";", "}", "public", "WarningMessage", "getWarning", "(", "int", "index", ")", "{", "if", "(", "index", "<", "getWarningCount", "(", ")", ")", "{", "return", "(", "WarningMessage", ")", "this", ".", "warnings", ".", "get", "(", "index", ")", ";", "}", "return", "null", ";", "}", "public", "Message", "getError", "(", "int", "index", ")", "{", "if", "(", "index", "<", "getErrorCount", "(", ")", ")", "{", "return", "(", "Message", ")", "this", ".", "errors", ".", "get", "(", "index", ")", ";", "}", "return", "null", ";", "}", "public", "Message", "getLastError", "(", ")", "{", "return", "(", "Message", ")", "this", ".", "errors", ".", "getLast", "(", ")", ";", "}", "public", "SyntaxException", "getSyntaxError", "(", "int", "index", ")", "{", "SyntaxException", "exception", "=", "null", ";", "Message", "message", "=", "getError", "(", "index", ")", ";", "if", "(", "message", "!=", "null", "&&", "message", "instanceof", "SyntaxErrorMessage", ")", "{", "exception", "=", "(", "(", "SyntaxErrorMessage", ")", "message", ")", ".", "getCause", "(", ")", ";", "}", "return", "exception", ";", "}", "public", "Exception", "getException", "(", "int", "index", ")", "{", "Exception", "exception", "=", "null", ";", "Message", "message", "=", "getError", "(", "index", ")", ";", "if", "(", "message", "!=", "null", ")", "{", "if", "(", "message", "instanceof", "ExceptionMessage", ")", "{", "exception", "=", "(", "(", "ExceptionMessage", ")", "message", ")", ".", "getCause", "(", ")", ";", "}", "else", "if", "(", "message", "instanceof", "SyntaxErrorMessage", ")", "{", "exception", "=", "(", "(", "SyntaxErrorMessage", ")", "message", ")", ".", "getCause", "(", ")", ";", "}", "}", "return", "exception", ";", "}", "public", "void", "addWarning", "(", "WarningMessage", "message", ")", "{", "if", "(", "message", ".", "isRelevant", "(", "configuration", ".", "getWarningLevel", "(", ")", ")", ")", "{", "if", "(", "this", ".", "warnings", "==", "null", ")", "{", "this", ".", "warnings", "=", "new", "LinkedList", "(", ")", ";", "}", "this", ".", "warnings", ".", "add", "(", "message", ")", ";", "}", "}", "public", "void", "addWarning", "(", "int", "importance", ",", "String", "text", ",", "CSTNode", "context", ",", "SourceUnit", "source", ")", "{", "if", "(", "WarningMessage", ".", "isRelevant", "(", "importance", ",", "configuration", ".", "getWarningLevel", "(", ")", ")", ")", "{", "addWarning", "(", "new", "WarningMessage", "(", "importance", ",", "text", ",", "context", ",", "source", ")", ")", ";", "}", "}", "public", "void", "addWarning", "(", "int", "importance", ",", "String", "text", ",", "Object", "data", ",", "CSTNode", "context", ",", "SourceUnit", "source", ")", "{", "if", "(", "WarningMessage", ".", "isRelevant", "(", "importance", ",", "configuration", ".", "getWarningLevel", "(", ")", ")", ")", "{", "addWarning", "(", "new", "WarningMessage", "(", "importance", ",", "text", ",", "data", ",", "context", ",", "source", ")", ")", ";", "}", "}", "protected", "void", "failIfErrors", "(", ")", "throws", "CompilationFailedException", "{", "if", "(", "hasErrors", "(", ")", ")", "{", "throw", "new", "MultipleCompilationErrorsException", "(", "this", ")", ";", "}", "}", "private", "void", "write", "(", "PrintWriter", "writer", ",", "Janitor", "janitor", ",", "List", "messages", ",", "String", "txt", ")", "{", "if", "(", "messages", "==", "null", "||", "messages", ".", "size", "(", ")", "==", "0", ")", "return", ";", "Iterator", "iterator", "=", "messages", ".", "iterator", "(", ")", ";", "while", "(", "iterator", ".", "hasNext", "(", ")", ")", "{", "Message", "message", "=", "(", "Message", ")", "iterator", ".", "next", "(", ")", ";", "message", ".", "write", "(", "writer", ",", "janitor", ")", ";", "if", "(", "configuration", ".", "getDebug", "(", ")", "&&", "(", "message", "instanceof", "SyntaxErrorMessage", ")", ")", "{", "SyntaxErrorMessage", "sem", "=", "(", "SyntaxErrorMessage", ")", "message", ";", "sem", ".", "getCause", "(", ")", ".", "printStackTrace", "(", "writer", ")", ";", "}", "writer", ".", "println", "(", ")", ";", "}", "writer", ".", "print", "(", "messages", ".", "size", "(", ")", ")", ";", "writer", ".", "print", "(", "\"", "\"", "+", "txt", ")", ";", "if", "(", "messages", ".", "size", "(", ")", ">", "1", ")", "writer", ".", "print", "(", "\"s\"", ")", ";", "writer", ".", "println", "(", ")", ";", "}", "public", "void", "write", "(", "PrintWriter", "writer", ",", "Janitor", "janitor", ")", "{", "write", "(", "writer", ",", "janitor", ",", "warnings", ",", "\"warning\"", ")", ";", "write", "(", "writer", ",", "janitor", ",", "errors", ",", "\"error\"", ")", ";", "}", "}", "</s>" ]
6,673
[ "<s>", "package", "groovy", ".", "grape", ";", "import", "groovy", ".", "lang", ".", "Grab", ";", "import", "groovy", ".", "lang", ".", "GrabResolver", ";", "import", "groovy", ".", "lang", ".", "Grapes", ";", "import", "groovy", ".", "lang", ".", "GrabExclude", ";", "import", "groovy", ".", "lang", ".", "GrabConfig", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "*", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "expr", ".", "*", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "stmt", ".", "ExpressionStatement", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "stmt", ".", "Statement", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "control", ".", "CompilePhase", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "control", ".", "SourceUnit", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "transform", ".", "ASTTransformation", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "transform", ".", "ASTTransformationVisitor", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "transform", ".", "GroovyASTTransformation", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "runtime", ".", "DefaultGroovyMethods", ";", "import", "java", ".", "util", ".", "*", ";", "import", "java", ".", "util", ".", "regex", ".", "Pattern", ";", "import", "java", ".", "util", ".", "regex", ".", "Matcher", ";", "@", "GroovyASTTransformation", "(", "phase", "=", "CompilePhase", ".", "CONVERSION", ")", "public", "class", "GrabAnnotationTransformation", "extends", "ClassCodeVisitorSupport", "implements", "ASTTransformation", "{", "private", "static", "final", "String", "GRAB_CLASS_NAME", "=", "Grab", ".", "class", ".", "getName", "(", ")", ";", "private", "static", "final", "String", "GRAB_DOT_NAME", "=", "GRAB_CLASS_NAME", ".", "substring", "(", "GRAB_CLASS_NAME", ".", "lastIndexOf", "(", "\".\"", ")", ")", ";", "private", "static", "final", "String", "GRAB_SHORT_NAME", "=", "GRAB_DOT_NAME", ".", "substring", "(", "1", ")", ";", "private", "static", "final", "String", "GRABEXCLUDE_CLASS_NAME", "=", "GrabExclude", ".", "class", ".", "getName", "(", ")", ";", "private", "static", "final", "String", "GRABEXCLUDE_DOT_NAME", "=", "dotName", "(", "GRABEXCLUDE_CLASS_NAME", ")", ";", "private", "static", "final", "String", "GRABEXCLUDE_SHORT_NAME", "=", "shortName", "(", "GRABEXCLUDE_DOT_NAME", ")", ";", "private", "static", "final", "String", "GRABCONFIG_CLASS_NAME", "=", "GrabConfig", ".", "class", ".", "getName", "(", ")", ";", "private", "static", "final", "String", "GRABCONFIG_DOT_NAME", "=", "dotName", "(", "GRABCONFIG_CLASS_NAME", ")", ";", "private", "static", "final", "String", "GRABCONFIG_SHORT_NAME", "=", "shortName", "(", "GRABCONFIG_DOT_NAME", ")", ";", "private", "static", "final", "String", "GRAPES_CLASS_NAME", "=", "Grapes", ".", "class", ".", "getName", "(", ")", ";", "private", "static", "final", "String", "GRAPES_DOT_NAME", "=", "dotName", "(", "GRAPES_CLASS_NAME", ")", ";", "private", "static", "final", "String", "GRAPES_SHORT_NAME", "=", "shortName", "(", "GRAPES_DOT_NAME", ")", ";", "private", "static", "final", "String", "GRABRESOLVER_CLASS_NAME", "=", "GrabResolver", ".", "class", ".", "getName", "(", ")", ";", "private", "static", "final", "String", "GRAPERESOLVER_DOT_NAME", "=", "dotName", "(", "GRABRESOLVER_CLASS_NAME", ")", ";", "private", "static", "final", "String", "GRABRESOLVER_SHORT_NAME", "=", "shortName", "(", "GRAPERESOLVER_DOT_NAME", ")", ";", "private", "static", "final", "ClassNode", "THREAD_CLASSNODE", "=", "new", "ClassNode", "(", "Thread", ".", "class", ")", ";", "private", "static", "final", "List", "<", "String", ">", "GRABEXCLUDE_REQUIRED", "=", "Arrays", ".", "asList", "(", "\"group\"", ",", "\"module\"", ")", ";", "private", "static", "final", "List", "<", "String", ">", "GRAPERESOLVER_REQUIRED", "=", "Arrays", ".", "asList", "(", "\"name\"", ",", "\"root\"", ")", ";", "private", "static", "final", "List", "<", "String", ">", "GRAB_REQUIRED", "=", "Arrays", ".", "asList", "(", "\"group\"", ",", "\"module\"", ",", "\"version\"", ")", ";", "private", "static", "final", "List", "<", "String", ">", "GRAB_OPTIONAL", "=", "Arrays", ".", "asList", "(", "\"classifier\"", ",", "\"transitive\"", ",", "\"conf\"", ",", "\"ext\"", ")", ";", "private", "static", "final", "Collection", "<", "String", ">", "GRAB_ALL", "=", "DefaultGroovyMethods", ".", "plus", "(", "GRAB_REQUIRED", ",", "GRAB_OPTIONAL", ")", ";", "private", "static", "final", "Pattern", "IVY_PATTERN", "=", "Pattern", ".", "compile", "(", "\"\"", ")", ";", "private", "static", "String", "dotName", "(", "String", "className", ")", "{", "return", "className", ".", "substring", "(", "className", ".", "lastIndexOf", "(", "\".\"", ")", ")", ";", "}", "private", "static", "String", "shortName", "(", "String", "className", ")", "{", "return", "className", ".", "substring", "(", "1", ")", ";", "}", "boolean", "allowShortGrab", ";", "Set", "<", "String", ">", "grabAliases", ";", "List", "<", "AnnotationNode", ">", "grabAnnotations", ";", "boolean", "allowShortGrabExcludes", ";", "Set", "<", "String", ">", "grabExcludeAliases", ";", "List", "<", "AnnotationNode", ">", "grabExcludeAnnotations", ";", "boolean", "allowShortGrabConfig", ";", "Set", "<", "String", ">", "grabConfigAliases", ";", "List", "<", "AnnotationNode", ">", "grabConfigAnnotations", ";", "boolean", "allowShortGrapes", ";", "Set", "<", "String", ">", "grapesAliases", ";", "List", "<", "AnnotationNode", ">", "grapesAnnotations", ";", "boolean", "allowShortGrabResolver", ";", "Set", "<", "String", ">", "grabResolverAliases", ";", "List", "<", "AnnotationNode", ">", "grabResolverAnnotations", ";", "SourceUnit", "sourceUnit", ";", "ClassLoader", "loader", ";", "boolean", "initContextClassLoader", ";", "public", "SourceUnit", "getSourceUnit", "(", ")", "{", "return", "sourceUnit", ";", "}", "public", "void", "visit", "(", "ASTNode", "[", "]", "nodes", ",", "SourceUnit", "source", ")", "{", "sourceUnit", "=", "source", ";", "loader", "=", "null", ";", "initContextClassLoader", "=", "false", ";", "ModuleNode", "mn", "=", "(", "ModuleNode", ")", "nodes", "[", "0", "]", ";", "if", "(", "mn", "==", "null", ")", "{", "return", ";", "}", "allowShortGrab", "=", "true", ";", "allowShortGrabExcludes", "=", "true", ";", "allowShortGrabConfig", "=", "true", ";", "allowShortGrapes", "=", "true", ";", "allowShortGrabResolver", "=", "true", ";", "grabAliases", "=", "new", "HashSet", "<", "String", ">", "(", ")", ";", "grabExcludeAliases", "=", "new", "HashSet", "<", "String", ">", "(", ")", ";", "grabConfigAliases", "=", "new", "HashSet", "<", "String", ">", "(", ")", ";", "grapesAliases", "=", "new", "HashSet", "<", "String", ">", "(", ")", ";", "grabResolverAliases", "=", "new", "HashSet", "<", "String", ">", "(", ")", ";", "for", "(", "ImportNode", "im", ":", "mn", ".", "getImports", "(", ")", ")", "{", "String", "alias", "=", "im", ".", "getAlias", "(", ")", ";", "String", "className", "=", "im", ".", "getClassName", "(", ")", ";", "if", "(", "(", "className", ".", "endsWith", "(", "GRAB_DOT_NAME", ")", "&&", "(", "(", "alias", "==", "null", ")", "||", "(", "alias", ".", "length", "(", ")", "==", "0", ")", ")", ")", "||", "(", "GRAB_CLASS_NAME", ".", "equals", "(", "alias", ")", ")", ")", "{", "allowShortGrab", "=", "false", ";", "}", "else", "if", "(", "GRAB_CLASS_NAME", ".", "equals", "(", "className", ")", ")", "{", "grabAliases", ".", "add", "(", "im", ".", "getAlias", "(", ")", ")", ";", "}", "if", "(", "(", "className", ".", "endsWith", "(", "GRAPES_DOT_NAME", ")", "&&", "(", "(", "alias", "==", "null", ")", "||", "(", "alias", ".", "length", "(", ")", "==", "0", ")", ")", ")", "||", "(", "GRAPES_CLASS_NAME", ".", "equals", "(", "alias", ")", ")", ")", "{", "allowShortGrapes", "=", "false", ";", "}", "else", "if", "(", "GRAPES_CLASS_NAME", ".", "equals", "(", "className", ")", ")", "{", "grapesAliases", ".", "add", "(", "im", ".", "getAlias", "(", ")", ")", ";", "}", "if", "(", "(", "className", ".", "endsWith", "(", "GRAPERESOLVER_DOT_NAME", ")", "&&", "(", "(", "alias", "==", "null", ")", "||", "(", "alias", ".", "length", "(", ")", "==", "0", ")", ")", ")", "||", "(", "GRABRESOLVER_CLASS_NAME", ".", "equals", "(", "alias", ")", ")", ")", "{", "allowShortGrabResolver", "=", "false", ";", "}", "else", "if", "(", "GRABRESOLVER_CLASS_NAME", ".", "equals", "(", "className", ")", ")", "{", "grabResolverAliases", ".", "add", "(", "im", ".", "getAlias", "(", ")", ")", ";", "}", "}", "List", "<", "Map", "<", "String", ",", "Object", ">", ">", "grabMaps", "=", "new", "ArrayList", "<", "Map", "<", "String", ",", "Object", ">", ">", "(", ")", ";", "List", "<", "Map", "<", "String", ",", "Object", ">", ">", "grabExcludeMaps", "=", "new", "ArrayList", "<", "Map", "<", "String", ",", "Object", ">", ">", "(", ")", ";", "for", "(", "ClassNode", "classNode", ":", "sourceUnit", ".", "getAST", "(", ")", ".", "getClasses", "(", ")", ")", "{", "grabAnnotations", "=", "new", "ArrayList", "<", "AnnotationNode", ">", "(", ")", ";", "grabExcludeAnnotations", "=", "new", "ArrayList", "<", "AnnotationNode", ">", "(", ")", ";", "grabConfigAnnotations", "=", "new", "ArrayList", "<", "AnnotationNode", ">", "(", ")", ";", "grapesAnnotations", "=", "new", "ArrayList", "<", "AnnotationNode", ">", "(", ")", ";", "grabResolverAnnotations", "=", "new", "ArrayList", "<", "AnnotationNode", ">", "(", ")", ";", "visitClass", "(", "classNode", ")", ";", "ClassNode", "grapeClassNode", "=", "new", "ClassNode", "(", "Grape", ".", "class", ")", ";", "if", "(", "!", "grabResolverAnnotations", ".", "isEmpty", "(", ")", ")", "{", "grabResolverAnnotationLoop", ":", "for", "(", "AnnotationNode", "node", ":", "grabResolverAnnotations", ")", "{", "Map", "<", "String", ",", "Object", ">", "grapeResolverMap", "=", "new", "HashMap", "<", "String", ",", "Object", ">", "(", ")", ";", "Expression", "value", "=", "node", ".", "getMember", "(", "\"value\"", ")", ";", "ConstantExpression", "ce", "=", "null", ";", "if", "(", "value", "!=", "null", "&&", "value", "instanceof", "ConstantExpression", ")", "{", "ce", "=", "(", "ConstantExpression", ")", "value", ";", "}", "String", "sval", "=", "null", ";", "if", "(", "ce", "!=", "null", "&&", "ce", ".", "getValue", "(", ")", "instanceof", "String", ")", "{", "sval", "=", "(", "String", ")", "ce", ".", "getValue", "(", ")", ";", "}", "if", "(", "sval", "!=", "null", "&&", "sval", ".", "length", "(", ")", ">", "0", ")", "{", "for", "(", "String", "s", ":", "GRAPERESOLVER_REQUIRED", ")", "{", "Expression", "member", "=", "node", ".", "getMember", "(", "s", ")", ";", "if", "(", "member", "!=", "null", ")", "{", "addError", "(", "\"\"", "+", "s", "+", "\"\"", "+", "node", ".", "getClassNode", "(", ")", ".", "getNameWithoutPackage", "(", ")", "+", "\"", "annotations\"", ",", "node", ")", ";", "continue", "grabResolverAnnotationLoop", ";", "}", "}", "grapeResolverMap", ".", "put", "(", "\"name\"", ",", "sval", ")", ";", "grapeResolverMap", ".", "put", "(", "\"root\"", ",", "sval", ")", ";", "}", "else", "{", "for", "(", "String", "s", ":", "GRAPERESOLVER_REQUIRED", ")", "{", "Expression", "member", "=", "node", ".", "getMember", "(", "s", ")", ";", "if", "(", "member", "==", "null", ")", "{", "addError", "(", "\"\"", "+", "s", "+", "\"\"", "+", "node", ".", "getClassNode", "(", ")", ".", "getNameWithoutPackage", "(", ")", "+", "\"", "annotations\"", ",", "node", ")", ";", "continue", "grabResolverAnnotationLoop", ";", "}", "else", "if", "(", "member", "!=", "null", "&&", "!", "(", "member", "instanceof", "ConstantExpression", ")", ")", "{", "addError", "(", "\"Attribute", "\\\"\"", "+", "s", "+", "\"\\\"", "has", "value", "\"", "+", "member", ".", "getText", "(", ")", "+", "\"\"", "+", "node", ".", "getClassNode", "(", ")", ".", "getNameWithoutPackage", "(", ")", "+", "\"", "annotations\"", ",", "node", ")", ";", "continue", "grabResolverAnnotationLoop", ";", "}", "grapeResolverMap", ".", "put", "(", "s", ",", "(", "(", "ConstantExpression", ")", "member", ")", ".", "getValue", "(", ")", ")", ";", "}", "}", "Grape", ".", "addResolver", "(", "grapeResolverMap", ")", ";", "}", "}", "if", "(", "!", "grapesAnnotations", ".", "isEmpty", "(", ")", ")", "{", "for", "(", "AnnotationNode", "node", ":", "grapesAnnotations", ")", "{", "Expression", "init", "=", "node", ".", "getMember", "(", "\"initClass\"", ")", ";", "Expression", "value", "=", "node", ".", "getMember", "(", "\"value\"", ")", ";", "if", "(", "value", "instanceof", "ListExpression", ")", "{", "for", "(", "Object", "o", ":", "(", "(", "ListExpression", ")", "value", ")", ".", "getExpressions", "(", ")", ")", "{", "if", "(", "o", "instanceof", "ConstantExpression", ")", "{", "extractGrab", "(", "init", ",", "(", "ConstantExpression", ")", "o", ")", ";", "}", "}", "}", "else", "if", "(", "value", "instanceof", "ConstantExpression", ")", "{", "extractGrab", "(", "init", ",", "(", "ConstantExpression", ")", "value", ")", ";", "}", "}", "}", "if", "(", "!", "grabConfigAnnotations", ".", "isEmpty", "(", ")", ")", "{", "for", "(", "AnnotationNode", "node", ":", "grabConfigAnnotations", ")", "{", "checkForClassLoader", "(", "node", ")", ";", "checkForInitContextClassLoader", "(", "node", ")", ";", "}", "addInitContextClassLoaderIfNeeded", "(", "classNode", ")", ";", "}", "if", "(", "!", "grabExcludeAnnotations", ".", "isEmpty", "(", ")", ")", "{", "grabExcludeAnnotationLoop", ":", "for", "(", "AnnotationNode", "node", ":", "grabExcludeAnnotations", ")", "{", "Map", "<", "String", ",", "Object", ">", "grabExcludeMap", "=", "new", "HashMap", "<", "String", ",", "Object", ">", "(", ")", ";", "checkForConvenienceForm", "(", "node", ",", "true", ")", ";", "for", "(", "String", "s", ":", "GRABEXCLUDE_REQUIRED", ")", "{", "Expression", "member", "=", "node", ".", "getMember", "(", "s", ")", ";", "if", "(", "member", "==", "null", ")", "{", "addError", "(", "\"\"", "+", "s", "+", "\"\"", "+", "node", ".", "getClassNode", "(", ")", ".", "getNameWithoutPackage", "(", ")", "+", "\"", "annotations\"", ",", "node", ")", ";", "continue", "grabExcludeAnnotationLoop", ";", "}", "else", "if", "(", "member", "!=", "null", "&&", "!", "(", "member", "instanceof", "ConstantExpression", ")", ")", "{", "addError", "(", "\"Attribute", "\\\"\"", "+", "s", "+", "\"\\\"", "has", "value", "\"", "+", "member", ".", "getText", "(", ")", "+", "\"\"", "+", "node", ".", "getClassNode", "(", ")", ".", "getNameWithoutPackage", "(", ")", "+", "\"", "annotations\"", ",", "node", ")", ";", "continue", "grabExcludeAnnotationLoop", ";", "}", "grabExcludeMap", ".", "put", "(", "s", ",", "(", "(", "ConstantExpression", ")", "member", ")", ".", "getValue", "(", ")", ")", ";", "}", "grabExcludeMaps", ".", "add", "(", "grabExcludeMap", ")", ";", "}", "}", "if", "(", "!", "grabAnnotations", ".", "isEmpty", "(", ")", ")", "{", "grabAnnotationLoop", ":", "for", "(", "AnnotationNode", "node", ":", "grabAnnotations", ")", "{", "Map", "<", "String", ",", "Object", ">", "grabMap", "=", "new", "HashMap", "<", "String", ",", "Object", ">", "(", ")", ";", "checkForConvenienceForm", "(", "node", ",", "false", ")", ";", "for", "(", "String", "s", ":", "GRAB_ALL", ")", "{", "Expression", "member", "=", "node", ".", "getMember", "(", "s", ")", ";", "if", "(", "member", "==", "null", "&&", "!", "GRAB_OPTIONAL", ".", "contains", "(", "s", ")", ")", "{", "addError", "(", "\"\"", "+", "s", "+", "\"\"", "+", "node", ".", "getClassNode", "(", ")", ".", "getNameWithoutPackage", "(", ")", "+", "\"", "annotations\"", ",", "node", ")", ";", "continue", "grabAnnotationLoop", ";", "}", "else", "if", "(", "member", "!=", "null", "&&", "!", "(", "member", "instanceof", "ConstantExpression", ")", ")", "{", "addError", "(", "\"Attribute", "\\\"\"", "+", "s", "+", "\"\\\"", "has", "value", "\"", "+", "member", ".", "getText", "(", ")", "+", "\"\"", "+", "node", ".", "getClassNode", "(", ")", ".", "getNameWithoutPackage", "(", ")", "+", "\"", "annotations\"", ",", "node", ")", ";", "continue", "grabAnnotationLoop", ";", "}", "if", "(", "node", ".", "getMember", "(", "s", ")", "!=", "null", ")", "grabMap", ".", "put", "(", "s", ",", "(", "(", "ConstantExpression", ")", "member", ")", ".", "getValue", "(", ")", ")", ";", "}", "grabMaps", ".", "add", "(", "grabMap", ")", ";", "callGrabAsStaticInitIfNeeded", "(", "classNode", ",", "grapeClassNode", ",", "node", ",", "grabExcludeMaps", ")", ";", "}", "}", "}", "if", "(", "!", "grabMaps", ".", "isEmpty", "(", ")", ")", "{", "Map", "<", "String", ",", "Object", ">", "basicArgs", "=", "new", "HashMap", "<", "String", ",", "Object", ">", "(", ")", ";", "basicArgs", ".", "put", "(", "\"classLoader\"", ",", "loader", "!=", "null", "?", "loader", ":", "sourceUnit", ".", "getClassLoader", "(", ")", ")", ";", "if", "(", "!", "grabExcludeMaps", ".", "isEmpty", "(", ")", ")", "basicArgs", ".", "put", "(", "\"excludes\"", ",", "grabExcludeMaps", ")", ";", "try", "{", "Grape", ".", "grab", "(", "basicArgs", ",", "grabMaps", ".", "toArray", "(", "new", "Map", "[", "grabMaps", ".", "size", "(", ")", "]", ")", ")", ";", "ASTTransformationVisitor", ".", "addGlobalTransformsAfterGrab", "(", ")", ";", "}", "catch", "(", "RuntimeException", "re", ")", "{", "source", ".", "addException", "(", "re", ")", ";", "}", "}", "}", "private", "void", "callGrabAsStaticInitIfNeeded", "(", "ClassNode", "classNode", ",", "ClassNode", "grapeClassNode", ",", "AnnotationNode", "node", ",", "List", "<", "Map", "<", "String", ",", "Object", ">", ">", "grabExcludeMaps", ")", "{", "if", "(", "(", "node", ".", "getMember", "(", "\"initClass\"", ")", "==", "null", ")", "||", "(", "node", ".", "getMember", "(", "\"initClass\"", ")", "==", "ConstantExpression", ".", "TRUE", ")", ")", "{", "List", "<", "Statement", ">", "grabInitializers", "=", "new", "ArrayList", "<", "Statement", ">", "(", ")", ";", "MapExpression", "me", "=", "new", "MapExpression", "(", ")", ";", "for", "(", "String", "s", ":", "GRAB_REQUIRED", ")", "{", "me", ".", "addMapEntryExpression", "(", "new", "ConstantExpression", "(", "s", ")", ",", "node", ".", "getMember", "(", "s", ")", ")", ";", "}", "for", "(", "String", "s", ":", "GRAB_OPTIONAL", ")", "{", "if", "(", "node", ".", "getMember", "(", "s", ")", "!=", "null", ")", "me", ".", "addMapEntryExpression", "(", "new", "ConstantExpression", "(", "s", ")", ",", "node", ".", "getMember", "(", "s", ")", ")", ";", "}", "ArgumentListExpression", "grabArgs", ";", "if", "(", "grabExcludeMaps", ".", "isEmpty", "(", ")", ")", "{", "grabArgs", "=", "new", "ArgumentListExpression", "(", "me", ")", ";", "}", "else", "{", "MapExpression", "args", "=", "new", "MapExpression", "(", ")", ";", "ListExpression", "list", "=", "new", "ListExpression", "(", ")", ";", "for", "(", "Map", "<", "String", ",", "Object", ">", "map", ":", "grabExcludeMaps", ")", "{", "Set", "<", "Map", ".", "Entry", "<", "String", ",", "Object", ">", ">", "entries", "=", "map", ".", "entrySet", "(", ")", ";", "MapExpression", "inner", "=", "new", "MapExpression", "(", ")", ";", "for", "(", "Map", ".", "Entry", "<", "String", ",", "Object", ">", "entry", ":", "entries", ")", "{", "inner", ".", "addMapEntryExpression", "(", "new", "ConstantExpression", "(", "entry", ".", "getKey", "(", ")", ")", ",", "new", "ConstantExpression", "(", "entry", ".", "getValue", "(", ")", ")", ")", ";", "}", "list", ".", "addExpression", "(", "inner", ")", ";", "}", "args", ".", "addMapEntryExpression", "(", "new", "ConstantExpression", "(", "\"excludes\"", ")", ",", "list", ")", ";", "grabArgs", "=", "new", "ArgumentListExpression", "(", "args", ",", "me", ")", ";", "}", "grabInitializers", ".", "add", "(", "new", "ExpressionStatement", "(", "new", "StaticMethodCallExpression", "(", "grapeClassNode", ",", "\"grab\"", ",", "grabArgs", ")", ")", ")", ";", "classNode", ".", "addStaticInitializerStatements", "(", "grabInitializers", ",", "true", ")", ";", "}", "}", "private", "void", "addInitContextClassLoaderIfNeeded", "(", "ClassNode", "classNode", ")", "{", "if", "(", "initContextClassLoader", ")", "{", "Statement", "initStatement", "=", "new", "ExpressionStatement", "(", "new", "MethodCallExpression", "(", "new", "StaticMethodCallExpression", "(", "THREAD_CLASSNODE", ",", "\"\"", ",", "ArgumentListExpression", ".", "EMPTY_ARGUMENTS", ")", ",", "\"\"", ",", "new", "MethodCallExpression", "(", "new", "MethodCallExpression", "(", "VariableExpression", ".", "THIS_EXPRESSION", ",", "\"getClass\"", ",", "MethodCallExpression", ".", "NO_ARGUMENTS", ")", ",", "\"\"", ",", "ArgumentListExpression", ".", "EMPTY_ARGUMENTS", ")", ")", ")", ";", "classNode", ".", "addObjectInitializerStatements", "(", "initStatement", ")", ";", "}", "}", "private", "void", "checkForClassLoader", "(", "AnnotationNode", "node", ")", "{", "Object", "val", "=", "node", ".", "getMember", "(", "\"\"", ")", ";", "if", "(", "val", "==", "null", "||", "!", "(", "val", "instanceof", "ConstantExpression", ")", ")", "return", ";", "Object", "systemClassLoaderObject", "=", "(", "(", "ConstantExpression", ")", "val", ")", ".", "getValue", "(", ")", ";", "if", "(", "!", "(", "systemClassLoaderObject", "instanceof", "Boolean", ")", ")", "return", ";", "Boolean", "systemClassLoader", "=", "(", "Boolean", ")", "systemClassLoaderObject", ";", "if", "(", "systemClassLoader", ")", "loader", "=", "ClassLoader", ".", "getSystemClassLoader", "(", ")", ";", "}", "private", "void", "checkForInitContextClassLoader", "(", "AnnotationNode", "node", ")", "{", "Object", "val", "=", "node", ".", "getMember", "(", "\"\"", ")", ";", "if", "(", "val", "==", "null", "||", "!", "(", "val", "instanceof", "ConstantExpression", ")", ")", "return", ";", "Object", "initContextClassLoaderObject", "=", "(", "(", "ConstantExpression", ")", "val", ")", ".", "getValue", "(", ")", ";", "if", "(", "!", "(", "initContextClassLoaderObject", "instanceof", "Boolean", ")", ")", "return", ";", "initContextClassLoader", "=", "(", "Boolean", ")", "initContextClassLoaderObject", ";", "}", "private", "void", "checkForConvenienceForm", "(", "AnnotationNode", "node", ",", "boolean", "exclude", ")", "{", "Object", "val", "=", "node", ".", "getMember", "(", "\"value\"", ")", ";", "if", "(", "val", "==", "null", "||", "!", "(", "val", "instanceof", "ConstantExpression", ")", ")", "return", ";", "Object", "allParts", "=", "(", "(", "ConstantExpression", ")", "val", ")", ".", "getValue", "(", ")", ";", "if", "(", "!", "(", "allParts", "instanceof", "String", ")", ")", "return", ";", "String", "allstr", "=", "(", "String", ")", "allParts", ";", "if", "(", "allstr", ".", "contains", "(", "\"#\"", ")", ")", "{", "Matcher", "m", "=", "IVY_PATTERN", ".", "matcher", "(", "allstr", ")", ";", "if", "(", "!", "m", ".", "find", "(", ")", ")", "return", ";", "if", "(", "m", ".", "group", "(", "1", ")", "==", "null", "||", "m", ".", "group", "(", "2", ")", "==", "null", ")", "return", ";", "node", ".", "addMember", "(", "\"module\"", ",", "new", "ConstantExpression", "(", "m", ".", "group", "(", "2", ")", ")", ")", ";", "node", ".", "addMember", "(", "\"group\"", ",", "new", "ConstantExpression", "(", "m", ".", "group", "(", "1", ")", ")", ")", ";", "if", "(", "m", ".", "group", "(", "6", ")", "!=", "null", ")", "node", ".", "addMember", "(", "\"conf\"", ",", "new", "ConstantExpression", "(", "m", ".", "group", "(", "6", ")", ")", ")", ";", "if", "(", "m", ".", "group", "(", "4", ")", "!=", "null", ")", "node", ".", "addMember", "(", "\"version\"", ",", "new", "ConstantExpression", "(", "m", ".", "group", "(", "4", ")", ")", ")", ";", "else", "if", "(", "!", "exclude", ")", "node", ".", "addMember", "(", "\"version\"", ",", "new", "ConstantExpression", "(", "\"*\"", ")", ")", ";", "node", ".", "getMembers", "(", ")", ".", "remove", "(", "\"value\"", ")", ";", "}", "else", "if", "(", "allstr", ".", "contains", "(", "\":\"", ")", ")", "{", "String", "ext", "=", "\"\"", ";", "String", "[", "]", "parts", ";", "if", "(", "allstr", ".", "contains", "(", "\"@\"", ")", ")", "{", "parts", "=", "allstr", ".", "split", "(", "\"@\"", ")", ";", "if", "(", "parts", ".", "length", ">", "2", ")", "return", ";", "allstr", "=", "parts", "[", "0", "]", ";", "ext", "=", "parts", "[", "1", "]", ";", "}", "parts", "=", "allstr", ".", "split", "(", "\":\"", ")", ";", "if", "(", "parts", ".", "length", ">", "4", ")", "return", ";", "if", "(", "parts", ".", "length", ">", "3", ")", "node", ".", "addMember", "(", "\"classifier\"", ",", "new", "ConstantExpression", "(", "parts", "[", "3", "]", ")", ")", ";", "if", "(", "parts", ".", "length", ">", "2", ")", "node", ".", "addMember", "(", "\"version\"", ",", "new", "ConstantExpression", "(", "parts", "[", "2", "]", ")", ")", ";", "else", "if", "(", "!", "exclude", ")", "node", ".", "addMember", "(", "\"version\"", ",", "new", "ConstantExpression", "(", "\"*\"", ")", ")", ";", "if", "(", "ext", ".", "length", "(", ")", ">", "0", ")", "node", ".", "addMember", "(", "\"ext\"", ",", "new", "ConstantExpression", "(", "ext", ")", ")", ";", "node", ".", "addMember", "(", "\"module\"", ",", "new", "ConstantExpression", "(", "parts", "[", "1", "]", ")", ")", ";", "node", ".", "addMember", "(", "\"group\"", ",", "new", "ConstantExpression", "(", "parts", "[", "0", "]", ")", ")", ";", "node", ".", "getMembers", "(", ")", ".", "remove", "(", "\"value\"", ")", ";", "}", "}", "private", "void", "extractGrab", "(", "Expression", "init", ",", "ConstantExpression", "ce", ")", "{", "if", "(", "ce", ".", "getValue", "(", ")", "instanceof", "AnnotationNode", ")", "{", "AnnotationNode", "annotation", "=", "(", "AnnotationNode", ")", "ce", ".", "getValue", "(", ")", ";", "if", "(", "(", "init", "!=", "null", ")", "&&", "(", "annotation", ".", "getMember", "(", "\"initClass\"", ")", "!=", "null", ")", ")", "{", "annotation", ".", "setMember", "(", "\"initClass\"", ",", "init", ")", ";", "}", "String", "name", "=", "annotation", ".", "getClassNode", "(", ")", ".", "getName", "(", ")", ";", "if", "(", "(", "GRAB_CLASS_NAME", ".", "equals", "(", "name", ")", ")", "||", "(", "allowShortGrab", "&&", "GRAB_SHORT_NAME", ".", "equals", "(", "name", ")", ")", "||", "(", "grabAliases", ".", "contains", "(", "name", ")", ")", ")", "{", "grabAnnotations", ".", "add", "(", "annotation", ")", ";", "}", "if", "(", "(", "GRABEXCLUDE_CLASS_NAME", ".", "equals", "(", "name", ")", ")", "||", "(", "allowShortGrabExcludes", "&&", "GRABEXCLUDE_SHORT_NAME", ".", "equals", "(", "name", ")", ")", "||", "(", "grabExcludeAliases", ".", "contains", "(", "name", ")", ")", ")", "{", "grabExcludeAnnotations", ".", "add", "(", "annotation", ")", ";", "}", "if", "(", "(", "GRABCONFIG_CLASS_NAME", ".", "equals", "(", "name", ")", ")", "||", "(", "allowShortGrabConfig", "&&", "GRABCONFIG_SHORT_NAME", ".", "equals", "(", "name", ")", ")", "||", "(", "grabConfigAliases", ".", "contains", "(", "name", ")", ")", ")", "{", "grabConfigAnnotations", ".", "add", "(", "annotation", ")", ";", "}", "if", "(", "(", "GRABRESOLVER_CLASS_NAME", ".", "equals", "(", "name", ")", ")", "||", "(", "allowShortGrabResolver", "&&", "GRABRESOLVER_SHORT_NAME", ".", "equals", "(", "name", ")", ")", "||", "(", "grabResolverAliases", ".", "contains", "(", "name", ")", ")", ")", "{", "grabResolverAnnotations", ".", "add", "(", "annotation", ")", ";", "}", "}", "}", "public", "void", "visitAnnotations", "(", "AnnotatedNode", "node", ")", "{", "super", ".", "visitAnnotations", "(", "node", ")", ";", "for", "(", "AnnotationNode", "an", ":", "node", ".", "getAnnotations", "(", ")", ")", "{", "String", "name", "=", "an", ".", "getClassNode", "(", ")", ".", "getName", "(", ")", ";", "if", "(", "(", "GRAB_CLASS_NAME", ".", "equals", "(", "name", ")", ")", "||", "(", "allowShortGrab", "&&", "GRAB_SHORT_NAME", ".", "equals", "(", "name", ")", ")", "||", "(", "grabAliases", ".", "contains", "(", "name", ")", ")", ")", "{", "grabAnnotations", ".", "add", "(", "an", ")", ";", "}", "if", "(", "(", "GRABEXCLUDE_CLASS_NAME", ".", "equals", "(", "name", ")", ")", "||", "(", "allowShortGrabExcludes", "&&", "GRABEXCLUDE_SHORT_NAME", ".", "equals", "(", "name", ")", ")", "||", "(", "grabExcludeAliases", ".", "contains", "(", "name", ")", ")", ")", "{", "grabExcludeAnnotations", ".", "add", "(", "an", ")", ";", "}", "if", "(", "(", "GRABCONFIG_CLASS_NAME", ".", "equals", "(", "name", ")", ")", "||", "(", "allowShortGrabConfig", "&&", "GRABCONFIG_SHORT_NAME", ".", "equals", "(", "name", ")", ")", "||", "(", "grabConfigAliases", ".", "contains", "(", "name", ")", ")", ")", "{", "grabConfigAnnotations", ".", "add", "(", "an", ")", ";", "}", "if", "(", "(", "GRAPES_CLASS_NAME", ".", "equals", "(", "name", ")", ")", "||", "(", "allowShortGrapes", "&&", "GRAPES_SHORT_NAME", ".", "equals", "(", "name", ")", ")", "||", "(", "grapesAliases", ".", "contains", "(", "name", ")", ")", ")", "{", "grapesAnnotations", ".", "add", "(", "an", ")", ";", "}", "if", "(", "(", "GRABRESOLVER_CLASS_NAME", ".", "equals", "(", "name", ")", ")", "||", "(", "allowShortGrabResolver", "&&", "GRABRESOLVER_SHORT_NAME", ".", "equals", "(", "name", ")", ")", "||", "(", "grabResolverAliases", ".", "contains", "(", "name", ")", ")", ")", "{", "grabResolverAnnotations", ".", "add", "(", "an", ")", ";", "}", "}", "}", "}", "</s>" ]
6,674
[ "<s>", "package", "org", ".", "codehaus", ".", "groovy", ".", "activator", ";", "import", "java", ".", "net", ".", "URL", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "FileLocator", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "IStatus", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "Plugin", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "Status", ";", "import", "org", ".", "osgi", ".", "framework", ".", "BundleContext", ";", "public", "class", "GroovyActivator", "extends", "Plugin", "{", "public", "static", "final", "String", "PLUGIN_ID", "=", "\"\"", ";", "public", "static", "final", "String", "GROOVY_ALL_JAR", "=", "\"\"", ";", "public", "static", "final", "String", "GROOVY_JAR", "=", "\"\"", ";", "public", "static", "final", "String", "ASM_JAR", "=", "\"\"", ";", "public", "static", "final", "int", "GROOVY_LEVEL", "=", "17", ";", "public", "static", "URL", "GROOVY_JAR_URL", ";", "public", "static", "URL", "GROOVY_GPP_URL", ";", "public", "static", "URL", "GROOVY_ALL_JAR_URL", ";", "public", "static", "URL", "ASM_JAR_URL", ";", "private", "static", "GroovyActivator", "DEFAULT", ";", "public", "GroovyActivator", "(", ")", "{", "DEFAULT", "=", "this", ";", "}", "public", "static", "GroovyActivator", "getDefault", "(", ")", "{", "return", "DEFAULT", ";", "}", "@", "Override", "public", "void", "start", "(", "BundleContext", "context", ")", "throws", "Exception", "{", "super", ".", "start", "(", "context", ")", ";", "try", "{", "GROOVY_JAR_URL", "=", "FileLocator", ".", "resolve", "(", "context", ".", "getBundle", "(", ")", ".", "getEntry", "(", "GroovyActivator", ".", "GROOVY_JAR", ")", ")", ";", "GROOVY_ALL_JAR_URL", "=", "FileLocator", ".", "resolve", "(", "context", ".", "getBundle", "(", ")", ".", "getEntry", "(", "GroovyActivator", ".", "GROOVY_ALL_JAR", ")", ")", ";", "ASM_JAR_URL", "=", "FileLocator", ".", "resolve", "(", "context", ".", "getBundle", "(", ")", ".", "getEntry", "(", "GroovyActivator", ".", "ASM_JAR", ")", ")", ";", "}", "catch", "(", "Exception", "e", ")", "{", "getLog", "(", ")", ".", "log", "(", "new", "Status", "(", "IStatus", ".", "ERROR", ",", "PLUGIN_ID", ",", "\"\"", ",", "e", ")", ")", ";", "}", "}", "@", "Override", "public", "void", "stop", "(", "BundleContext", "context", ")", "throws", "Exception", "{", "super", ".", "stop", "(", "context", ")", ";", "}", "}", "</s>" ]
6,675
[ "<s>", "package", "org", ".", "codehaus", ".", "groovy", ".", "vmplugin", ".", "v5", ";", "import", "java", ".", "lang", ".", "reflect", ".", "*", ";", "import", "java", ".", "lang", ".", "annotation", ".", "*", ";", "import", "java", ".", "util", ".", "List", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "GroovyBugError", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "vmplugin", ".", "VMPlugin", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "*", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "expr", ".", "*", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "stmt", ".", "ReturnStatement", ";", "public", "class", "Java5", "implements", "VMPlugin", "{", "private", "static", "final", "Class", "[", "]", "PLUGIN_DGM", "=", "{", "PluginDefaultGroovyMethods", ".", "class", "}", ";", "public", "void", "setAdditionalClassInformation", "(", "ClassNode", "cn", ")", "{", "setGenericsTypes", "(", "cn", ")", ";", "}", "private", "void", "setGenericsTypes", "(", "ClassNode", "cn", ")", "{", "TypeVariable", "[", "]", "tvs", "=", "cn", ".", "getTypeClass", "(", ")", ".", "getTypeParameters", "(", ")", ";", "GenericsType", "[", "]", "gts", "=", "configureTypeVariable", "(", "tvs", ")", ";", "cn", ".", "setGenericsTypes", "(", "gts", ")", ";", "}", "private", "GenericsType", "[", "]", "configureTypeVariable", "(", "TypeVariable", "[", "]", "tvs", ")", "{", "if", "(", "tvs", ".", "length", "==", "0", ")", "return", "null", ";", "GenericsType", "[", "]", "gts", "=", "new", "GenericsType", "[", "tvs", ".", "length", "]", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "tvs", ".", "length", ";", "i", "++", ")", "{", "gts", "[", "i", "]", "=", "configureTypeVariableDefinition", "(", "tvs", "[", "i", "]", ")", ";", "}", "return", "gts", ";", "}", "private", "GenericsType", "configureTypeVariableDefinition", "(", "TypeVariable", "tv", ")", "{", "ClassNode", "base", "=", "configureTypeVariableReference", "(", "tv", ")", ";", "ClassNode", "redirect", "=", "base", ".", "redirect", "(", ")", ";", "base", ".", "setRedirect", "(", "null", ")", ";", "Type", "[", "]", "tBounds", "=", "tv", ".", "getBounds", "(", ")", ";", "GenericsType", "gt", ";", "if", "(", "tBounds", ".", "length", "==", "0", ")", "{", "gt", "=", "new", "GenericsType", "(", "base", ")", ";", "}", "else", "{", "ClassNode", "[", "]", "cBounds", "=", "configureTypes", "(", "tBounds", ")", ";", "gt", "=", "new", "GenericsType", "(", "base", ",", "cBounds", ",", "null", ")", ";", "gt", ".", "setName", "(", "base", ".", "getName", "(", ")", ")", ";", "gt", ".", "setPlaceholder", "(", "true", ")", ";", "}", "base", ".", "setRedirect", "(", "redirect", ")", ";", "return", "gt", ";", "}", "private", "ClassNode", "[", "]", "configureTypes", "(", "Type", "[", "]", "types", ")", "{", "if", "(", "types", ".", "length", "==", "0", ")", "return", "null", ";", "ClassNode", "[", "]", "nodes", "=", "new", "ClassNode", "[", "types", ".", "length", "]", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "types", ".", "length", ";", "i", "++", ")", "{", "nodes", "[", "i", "]", "=", "configureType", "(", "types", "[", "i", "]", ")", ";", "}", "return", "nodes", ";", "}", "private", "ClassNode", "configureType", "(", "Type", "type", ")", "{", "if", "(", "type", "instanceof", "WildcardType", ")", "{", "return", "configureWildcardType", "(", "(", "WildcardType", ")", "type", ")", ";", "}", "else", "if", "(", "type", "instanceof", "ParameterizedType", ")", "{", "return", "configureParameterizedType", "(", "(", "ParameterizedType", ")", "type", ")", ";", "}", "else", "if", "(", "type", "instanceof", "GenericArrayType", ")", "{", "return", "configureGenericArray", "(", "(", "GenericArrayType", ")", "type", ")", ";", "}", "else", "if", "(", "type", "instanceof", "TypeVariable", ")", "{", "return", "configureTypeVariableReference", "(", "(", "TypeVariable", ")", "type", ")", ";", "}", "else", "if", "(", "type", "instanceof", "Class", ")", "{", "return", "configureClass", "(", "(", "Class", ")", "type", ")", ";", "}", "else", "{", "throw", "new", "GroovyBugError", "(", "\"\"", "+", "type", "+", "\"", ":=", "\"", "+", "type", ".", "getClass", "(", ")", ")", ";", "}", "}", "private", "ClassNode", "configureClass", "(", "Class", "c", ")", "{", "if", "(", "c", ".", "isPrimitive", "(", ")", ")", "{", "return", "ClassHelper", ".", "make", "(", "c", ")", ";", "}", "else", "{", "return", "ClassHelper", ".", "makeWithoutCaching", "(", "c", ",", "false", ")", ";", "}", "}", "private", "ClassNode", "configureGenericArray", "(", "GenericArrayType", "genericArrayType", ")", "{", "Type", "component", "=", "genericArrayType", ".", "getGenericComponentType", "(", ")", ";", "ClassNode", "node", "=", "configureType", "(", "component", ")", ";", "return", "node", ".", "makeArray", "(", ")", ";", "}", "private", "ClassNode", "configureWildcardType", "(", "WildcardType", "wildcardType", ")", "{", "ClassNode", "base", "=", "ClassHelper", ".", "makeWithoutCaching", "(", "\"?\"", ")", ";", "base", ".", "setRedirect", "(", "ClassHelper", ".", "OBJECT_TYPE", ")", ";", "ClassNode", "[", "]", "lowers", "=", "configureTypes", "(", "wildcardType", ".", "getLowerBounds", "(", ")", ")", ";", "ClassNode", "lower", "=", "null", ";", "if", "(", "lower", "!=", "null", ")", "lower", "=", "lowers", "[", "0", "]", ";", "ClassNode", "[", "]", "upper", "=", "configureTypes", "(", "wildcardType", ".", "getUpperBounds", "(", ")", ")", ";", "GenericsType", "t", "=", "new", "GenericsType", "(", "base", ",", "upper", ",", "lower", ")", ";", "t", ".", "setWildcard", "(", "true", ")", ";", "ClassNode", "ref", "=", "ClassHelper", ".", "makeWithoutCaching", "(", "Object", ".", "class", ",", "false", ")", ";", "ref", ".", "setGenericsTypes", "(", "new", "GenericsType", "[", "]", "{", "t", "}", ")", ";", "return", "ref", ";", "}", "private", "ClassNode", "configureParameterizedType", "(", "ParameterizedType", "parameterizedType", ")", "{", "ClassNode", "base", "=", "configureType", "(", "parameterizedType", ".", "getRawType", "(", ")", ")", ";", "GenericsType", "[", "]", "gts", "=", "configureTypeArguments", "(", "parameterizedType", ".", "getActualTypeArguments", "(", ")", ")", ";", "base", ".", "setGenericsTypes", "(", "gts", ")", ";", "return", "base", ";", "}", "private", "ClassNode", "configureTypeVariableReference", "(", "TypeVariable", "tv", ")", "{", "ClassNode", "cn", "=", "ClassHelper", ".", "makeWithoutCaching", "(", "tv", ".", "getName", "(", ")", ")", ";", "cn", ".", "setGenericsPlaceHolder", "(", "true", ")", ";", "ClassNode", "cn2", "=", "ClassHelper", ".", "makeWithoutCaching", "(", "tv", ".", "getName", "(", ")", ")", ";", "cn2", ".", "setGenericsPlaceHolder", "(", "true", ")", ";", "GenericsType", "[", "]", "gts", "=", "new", "GenericsType", "[", "]", "{", "new", "GenericsType", "(", "cn2", ")", "}", ";", "cn", ".", "setGenericsTypes", "(", "gts", ")", ";", "cn", ".", "setRedirect", "(", "ClassHelper", ".", "OBJECT_TYPE", ")", ";", "return", "cn", ";", "}", "private", "GenericsType", "[", "]", "configureTypeArguments", "(", "Type", "[", "]", "ta", ")", "{", "if", "(", "ta", ".", "length", "==", "0", ")", "return", "null", ";", "GenericsType", "[", "]", "gts", "=", "new", "GenericsType", "[", "ta", ".", "length", "]", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "ta", ".", "length", ";", "i", "++", ")", "{", "ClassNode", "t", "=", "configureType", "(", "ta", "[", "i", "]", ")", ";", "if", "(", "ta", "[", "i", "]", "instanceof", "WildcardType", ")", "{", "GenericsType", "[", "]", "gen", "=", "t", ".", "getGenericsTypes", "(", ")", ";", "gts", "[", "i", "]", "=", "gen", "[", "0", "]", ";", "}", "else", "{", "gts", "[", "i", "]", "=", "new", "GenericsType", "(", "t", ")", ";", "}", "}", "return", "gts", ";", "}", "public", "Class", "[", "]", "getPluginDefaultGroovyMethods", "(", ")", "{", "return", "PLUGIN_DGM", ";", "}", "private", "void", "setAnnotationMetaData", "(", "Annotation", "[", "]", "annotations", ",", "AnnotatedNode", "an", ")", "{", "for", "(", "Annotation", "annotation", ":", "annotations", ")", "{", "AnnotationNode", "node", "=", "new", "AnnotationNode", "(", "ClassHelper", ".", "make", "(", "annotation", ".", "annotationType", "(", ")", ")", ")", ";", "configureAnnotation", "(", "node", ",", "annotation", ")", ";", "an", ".", "addAnnotation", "(", "node", ")", ";", "}", "}", "private", "void", "configureAnnotationFromDefinition", "(", "AnnotationNode", "definition", ",", "AnnotationNode", "root", ")", "{", "ClassNode", "type", "=", "definition", ".", "getClassNode", "(", ")", ";", "if", "(", "!", "type", ".", "isResolved", "(", ")", ")", "return", ";", "if", "(", "type", ".", "hasClass", "(", ")", ")", "{", "Class", "clazz", "=", "type", ".", "getTypeClass", "(", ")", ";", "if", "(", "clazz", "==", "Retention", ".", "class", ")", "{", "Expression", "exp", "=", "definition", ".", "getMember", "(", "\"value\"", ")", ";", "if", "(", "!", "(", "exp", "instanceof", "PropertyExpression", ")", ")", "return", ";", "PropertyExpression", "pe", "=", "(", "PropertyExpression", ")", "exp", ";", "String", "name", "=", "pe", ".", "getPropertyAsString", "(", ")", ";", "RetentionPolicy", "policy", "=", "RetentionPolicy", ".", "valueOf", "(", "name", ")", ";", "setRetentionPolicy", "(", "policy", ",", "root", ")", ";", "}", "else", "if", "(", "clazz", "==", "Target", ".", "class", ")", "{", "Expression", "exp", "=", "definition", ".", "getMember", "(", "\"value\"", ")", ";", "if", "(", "!", "(", "exp", "instanceof", "ListExpression", ")", ")", "return", ";", "ListExpression", "le", "=", "(", "ListExpression", ")", "exp", ";", "int", "bitmap", "=", "0", ";", "for", "(", "Expression", "e", ":", "le", ".", "getExpressions", "(", ")", ")", "{", "PropertyExpression", "element", "=", "(", "PropertyExpression", ")", "e", ";", "String", "name", "=", "element", ".", "getPropertyAsString", "(", ")", ";", "ElementType", "value", "=", "ElementType", ".", "valueOf", "(", "name", ")", ";", "bitmap", "|=", "getElementCode", "(", "value", ")", ";", "}", "root", ".", "setAllowedTargets", "(", "bitmap", ")", ";", "}", "}", "else", "{", "String", "typename", "=", "type", ".", "getName", "(", ")", ";", "if", "(", "typename", ".", "equals", "(", "\"\"", ")", ")", "{", "Expression", "exp", "=", "definition", ".", "getMember", "(", "\"value\"", ")", ";", "if", "(", "!", "(", "exp", "instanceof", "PropertyExpression", ")", ")", "return", ";", "PropertyExpression", "pe", "=", "(", "PropertyExpression", ")", "exp", ";", "String", "name", "=", "pe", ".", "getPropertyAsString", "(", ")", ";", "RetentionPolicy", "policy", "=", "RetentionPolicy", ".", "valueOf", "(", "name", ")", ";", "setRetentionPolicy", "(", "policy", ",", "root", ")", ";", "}", "else", "if", "(", "typename", ".", "equals", "(", "\"\"", ")", ")", "{", "Expression", "exp", "=", "definition", ".", "getMember", "(", "\"value\"", ")", ";", "if", "(", "!", "(", "exp", "instanceof", "ListExpression", ")", ")", "return", ";", "ListExpression", "le", "=", "(", "ListExpression", ")", "exp", ";", "int", "bitmap", "=", "0", ";", "for", "(", "Expression", "expression", ":", "le", ".", "getExpressions", "(", ")", ")", "{", "PropertyExpression", "element", "=", "(", "PropertyExpression", ")", "expression", ";", "String", "name", "=", "element", ".", "getPropertyAsString", "(", ")", ";", "ElementType", "value", "=", "ElementType", ".", "valueOf", "(", "name", ")", ";", "bitmap", "|=", "getElementCode", "(", "value", ")", ";", "}", "root", ".", "setAllowedTargets", "(", "bitmap", ")", ";", "}", "}", "}", "public", "void", "configureAnnotation", "(", "AnnotationNode", "node", ")", "{", "ClassNode", "type", "=", "node", ".", "getClassNode", "(", ")", ";", "List", "<", "AnnotationNode", ">", "annotations", "=", "type", ".", "getAnnotations", "(", ")", ";", "for", "(", "AnnotationNode", "an", ":", "annotations", ")", "{", "configureAnnotationFromDefinition", "(", "an", ",", "node", ")", ";", "}", "configureAnnotationFromDefinition", "(", "node", ",", "node", ")", ";", "}", "private", "void", "configureAnnotation", "(", "AnnotationNode", "node", ",", "Annotation", "annotation", ")", "{", "Class", "type", "=", "annotation", ".", "annotationType", "(", ")", ";", "if", "(", "type", "==", "Retention", ".", "class", ")", "{", "Retention", "r", "=", "(", "Retention", ")", "annotation", ";", "RetentionPolicy", "value", "=", "r", ".", "value", "(", ")", ";", "setRetentionPolicy", "(", "value", ",", "node", ")", ";", "node", ".", "setMember", "(", "\"value\"", ",", "new", "PropertyExpression", "(", "new", "ClassExpression", "(", "ClassHelper", ".", "makeWithoutCaching", "(", "RetentionPolicy", ".", "class", ",", "false", ")", ")", ",", "value", ".", "toString", "(", ")", ")", ")", ";", "}", "else", "if", "(", "type", "==", "Target", ".", "class", ")", "{", "Target", "t", "=", "(", "Target", ")", "annotation", ";", "ElementType", "[", "]", "elements", "=", "t", ".", "value", "(", ")", ";", "ListExpression", "elementExprs", "=", "new", "ListExpression", "(", ")", ";", "for", "(", "ElementType", "element", ":", "elements", ")", "{", "elementExprs", ".", "addExpression", "(", "new", "PropertyExpression", "(", "new", "ClassExpression", "(", "ClassHelper", ".", "ELEMENT_TYPE_TYPE", ")", ",", "element", ".", "name", "(", ")", ")", ")", ";", "}", "node", ".", "setMember", "(", "\"value\"", ",", "elementExprs", ")", ";", "}", "else", "{", "Method", "[", "]", "declaredMethods", "=", "type", ".", "getDeclaredMethods", "(", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "declaredMethods", ".", "length", ";", "i", "++", ")", "{", "Method", "declaredMethod", "=", "declaredMethods", "[", "i", "]", ";", "try", "{", "Object", "value", "=", "declaredMethod", ".", "invoke", "(", "annotation", ")", ";", "Expression", "valueExpression", "=", "annotationValueToExpression", "(", "value", ")", ";", "if", "(", "valueExpression", "==", "null", ")", "continue", ";", "node", ".", "setMember", "(", "declaredMethod", ".", "getName", "(", ")", ",", "valueExpression", ")", ";", "}", "catch", "(", "IllegalAccessException", "e", ")", "{", "}", "catch", "(", "InvocationTargetException", "e", ")", "{", "}", "}", "}", "}", "private", "Expression", "annotationValueToExpression", "(", "Object", "value", ")", "{", "if", "(", "value", "==", "null", "||", "value", "instanceof", "String", "||", "value", "instanceof", "Number", "||", "value", "instanceof", "Character", "||", "value", "instanceof", "Boolean", ")", "return", "new", "ConstantExpression", "(", "value", ")", ";", "if", "(", "value", "instanceof", "Class", ")", "return", "new", "ClassExpression", "(", "ClassHelper", ".", "makeWithoutCaching", "(", "(", "Class", ")", "value", ")", ")", ";", "if", "(", "value", ".", "getClass", "(", ")", ".", "isArray", "(", ")", ")", "{", "ListExpression", "elementExprs", "=", "new", "ListExpression", "(", ")", ";", "int", "len", "=", "Array", ".", "getLength", "(", "value", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "!=", "len", ";", "++", "i", ")", "elementExprs", ".", "addExpression", "(", "annotationValueToExpression", "(", "Array", ".", "get", "(", "value", ",", "i", ")", ")", ")", ";", "return", "elementExprs", ";", "}", "return", "null", ";", "}", "private", "void", "setRetentionPolicy", "(", "RetentionPolicy", "value", ",", "AnnotationNode", "node", ")", "{", "switch", "(", "value", ")", "{", "case", "RUNTIME", ":", "node", ".", "setRuntimeRetention", "(", "true", ")", ";", "break", ";", "case", "SOURCE", ":", "node", ".", "setSourceRetention", "(", "true", ")", ";", "break", ";", "case", "CLASS", ":", "node", ".", "setClassRetention", "(", "true", ")", ";", "break", ";", "default", ":", "throw", "new", "GroovyBugError", "(", "\"\"", "+", "value", ")", ";", "}", "}", "private", "int", "getElementCode", "(", "ElementType", "value", ")", "{", "switch", "(", "value", ")", "{", "case", "TYPE", ":", "return", "AnnotationNode", ".", "TYPE_TARGET", ";", "case", "CONSTRUCTOR", ":", "return", "AnnotationNode", ".", "CONSTRUCTOR_TARGET", ";", "case", "METHOD", ":", "return", "AnnotationNode", ".", "METHOD_TARGET", ";", "case", "FIELD", ":", "return", "AnnotationNode", ".", "FIELD_TARGET", ";", "case", "PARAMETER", ":", "return", "AnnotationNode", ".", "PARAMETER_TARGET", ";", "case", "LOCAL_VARIABLE", ":", "return", "AnnotationNode", ".", "LOCAL_VARIABLE_TARGET", ";", "case", "ANNOTATION_TYPE", ":", "return", "AnnotationNode", ".", "ANNOTATION_TARGET", ";", "case", "PACKAGE", ":", "return", "AnnotationNode", ".", "PACKAGE_TARGET", ";", "default", ":", "throw", "new", "GroovyBugError", "(", "\"\"", "+", "value", ")", ";", "}", "}", "private", "void", "setMethodDefaultValue", "(", "MethodNode", "mn", ",", "Method", "m", ")", "{", "Object", "defaultValue", "=", "m", ".", "getDefaultValue", "(", ")", ";", "mn", ".", "setCode", "(", "new", "ReturnStatement", "(", "new", "ConstantExpression", "(", "defaultValue", ")", ")", ")", ";", "mn", ".", "setAnnotationDefault", "(", "true", ")", ";", "}", "public", "void", "configureClassNode", "(", "CompileUnit", "compileUnit", ",", "ClassNode", "classNode", ")", "{", "Class", "clazz", "=", "classNode", ".", "getTypeClass", "(", ")", ";", "Field", "[", "]", "fields", "=", "clazz", ".", "getDeclaredFields", "(", ")", ";", "for", "(", "Field", "f", ":", "fields", ")", "{", "ClassNode", "ret", "=", "makeClassNode", "(", "compileUnit", ",", "f", ".", "getGenericType", "(", ")", ",", "f", ".", "getType", "(", ")", ")", ";", "classNode", ".", "addField", "(", "f", ".", "getName", "(", ")", ",", "f", ".", "getModifiers", "(", ")", ",", "ret", ",", "null", ")", ";", "}", "Method", "[", "]", "methods", "=", "clazz", ".", "getDeclaredMethods", "(", ")", ";", "for", "(", "Method", "m", ":", "methods", ")", "{", "ClassNode", "ret", "=", "makeClassNode", "(", "compileUnit", ",", "m", ".", "getGenericReturnType", "(", ")", ",", "m", ".", "getReturnType", "(", ")", ")", ";", "Parameter", "[", "]", "params", "=", "makeParameters", "(", "compileUnit", ",", "m", ".", "getGenericParameterTypes", "(", ")", ",", "m", ".", "getParameterTypes", "(", ")", ")", ";", "ClassNode", "[", "]", "exceptions", "=", "makeClassNodes", "(", "compileUnit", ",", "m", ".", "getGenericExceptionTypes", "(", ")", ",", "m", ".", "getExceptionTypes", "(", ")", ")", ";", "MethodNode", "mn", "=", "new", "MethodNode", "(", "m", ".", "getName", "(", ")", ",", "m", ".", "getModifiers", "(", ")", ",", "ret", ",", "params", ",", "exceptions", ",", "null", ")", ";", "setMethodDefaultValue", "(", "mn", ",", "m", ")", ";", "setAnnotationMetaData", "(", "m", ".", "getAnnotations", "(", ")", ",", "mn", ")", ";", "mn", ".", "setGenericsTypes", "(", "configureTypeVariable", "(", "m", ".", "getTypeParameters", "(", ")", ")", ")", ";", "classNode", ".", "addMethod", "(", "mn", ")", ";", "}", "Constructor", "[", "]", "constructors", "=", "clazz", ".", "getDeclaredConstructors", "(", ")", ";", "for", "(", "Constructor", "ctor", ":", "constructors", ")", "{", "Parameter", "[", "]", "params", "=", "makeParameters", "(", "compileUnit", ",", "ctor", ".", "getGenericParameterTypes", "(", ")", ",", "ctor", ".", "getParameterTypes", "(", ")", ")", ";", "ClassNode", "[", "]", "exceptions", "=", "makeClassNodes", "(", "compileUnit", ",", "ctor", ".", "getGenericExceptionTypes", "(", ")", ",", "ctor", ".", "getExceptionTypes", "(", ")", ")", ";", "classNode", ".", "addConstructor", "(", "ctor", ".", "getModifiers", "(", ")", ",", "params", ",", "exceptions", ",", "null", ")", ";", "}", "Class", "sc", "=", "clazz", ".", "getSuperclass", "(", ")", ";", "if", "(", "sc", "!=", "null", ")", "classNode", ".", "setUnresolvedSuperClass", "(", "makeClassNode", "(", "compileUnit", ",", "clazz", ".", "getGenericSuperclass", "(", ")", ",", "sc", ")", ")", ";", "makeInterfaceTypes", "(", "compileUnit", ",", "classNode", ",", "clazz", ")", ";", "setAnnotationMetaData", "(", "classNode", ".", "getTypeClass", "(", ")", ".", "getAnnotations", "(", ")", ",", "classNode", ")", ";", "PackageNode", "packageNode", "=", "classNode", ".", "getPackage", "(", ")", ";", "if", "(", "packageNode", "!=", "null", ")", "{", "setAnnotationMetaData", "(", "classNode", ".", "getTypeClass", "(", ")", ".", "getPackage", "(", ")", ".", "getAnnotations", "(", ")", ",", "packageNode", ")", ";", "}", "}", "private", "void", "makeInterfaceTypes", "(", "CompileUnit", "cu", ",", "ClassNode", "classNode", ",", "Class", "clazz", ")", "{", "Type", "[", "]", "interfaceTypes", "=", "clazz", ".", "getGenericInterfaces", "(", ")", ";", "if", "(", "interfaceTypes", ".", "length", "==", "0", ")", "{", "classNode", ".", "setInterfaces", "(", "ClassNode", ".", "EMPTY_ARRAY", ")", ";", "}", "else", "{", "Class", "[", "]", "interfaceClasses", "=", "clazz", ".", "getInterfaces", "(", ")", ";", "ClassNode", "[", "]", "ret", "=", "new", "ClassNode", "[", "interfaceTypes", ".", "length", "]", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "interfaceTypes", ".", "length", ";", "i", "++", ")", "{", "ret", "[", "i", "]", "=", "makeClassNode", "(", "cu", ",", "interfaceTypes", "[", "i", "]", ",", "interfaceClasses", "[", "i", "]", ")", ";", "}", "classNode", ".", "setInterfaces", "(", "ret", ")", ";", "}", "}", "private", "ClassNode", "[", "]", "makeClassNodes", "(", "CompileUnit", "cu", ",", "Type", "[", "]", "types", ",", "Class", "[", "]", "cls", ")", "{", "ClassNode", "[", "]", "nodes", "=", "new", "ClassNode", "[", "types", ".", "length", "]", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "nodes", ".", "length", ";", "i", "++", ")", "{", "nodes", "[", "i", "]", "=", "makeClassNode", "(", "cu", ",", "types", "[", "i", "]", ",", "cls", "[", "i", "]", ")", ";", "}", "return", "nodes", ";", "}", "private", "ClassNode", "makeClassNode", "(", "CompileUnit", "cu", ",", "Type", "t", ",", "Class", "c", ")", "{", "ClassNode", "back", "=", "null", ";", "if", "(", "cu", "!=", "null", ")", "back", "=", "cu", ".", "getClass", "(", "c", ".", "getName", "(", ")", ")", ";", "if", "(", "back", "==", "null", ")", "back", "=", "ClassHelper", ".", "make", "(", "c", ")", ";", "if", "(", "!", "(", "t", "instanceof", "Class", ")", ")", "{", "ClassNode", "front", "=", "configureType", "(", "t", ")", ";", "front", ".", "setRedirect", "(", "back", ")", ";", "return", "front", ";", "}", "return", "back", ";", "}", "private", "Parameter", "[", "]", "makeParameters", "(", "CompileUnit", "cu", ",", "Type", "[", "]", "types", ",", "Class", "[", "]", "cls", ")", "{", "Parameter", "[", "]", "params", "=", "Parameter", ".", "EMPTY_ARRAY", ";", "if", "(", "types", ".", "length", ">", "0", ")", "{", "params", "=", "new", "Parameter", "[", "types", ".", "length", "]", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "params", ".", "length", ";", "i", "++", ")", "{", "params", "[", "i", "]", "=", "makeParameter", "(", "cu", ",", "types", "[", "i", "]", ",", "cls", "[", "i", "]", ",", "i", ")", ";", "}", "}", "return", "params", ";", "}", "private", "Parameter", "makeParameter", "(", "CompileUnit", "cu", ",", "Type", "type", ",", "Class", "cl", ",", "int", "idx", ")", "{", "ClassNode", "cn", "=", "makeClassNode", "(", "cu", ",", "type", ",", "cl", ")", ";", "return", "new", "Parameter", "(", "cn", ",", "\"param\"", "+", "idx", ")", ";", "}", "}", "</s>" ]
6,676
[ "<s>", "package", "org", ".", "codehaus", ".", "groovy", ".", "transform", ";", "import", "groovy", ".", "lang", ".", "Immutable", ";", "import", "groovy", ".", "lang", ".", "MetaClass", ";", "import", "groovy", ".", "lang", ".", "MissingPropertyException", ";", "import", "groovy", ".", "lang", ".", "ReadOnlyPropertyException", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "*", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "expr", ".", "*", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "stmt", ".", "*", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "control", ".", "CompilePhase", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "control", ".", "SourceUnit", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "runtime", ".", "DefaultGroovyMethods", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "runtime", ".", "InvokerHelper", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "syntax", ".", "Token", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "syntax", ".", "Types", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "util", ".", "HashCodeHelper", ";", "import", "org", ".", "objectweb", ".", "asm", ".", "Opcodes", ";", "import", "java", ".", "util", ".", "*", ";", "@", "GroovyASTTransformation", "(", "phase", "=", "CompilePhase", ".", "CANONICALIZATION", ")", "public", "class", "ImmutableASTTransformation", "implements", "ASTTransformation", ",", "Opcodes", "{", "private", "static", "List", "<", "String", ">", "immutableList", "=", "Arrays", ".", "asList", "(", "\"\"", ",", "\"\"", ",", "\"\"", ",", "\"\"", ",", "\"\"", ",", "\"\"", ",", "\"\"", ",", "\"\"", ",", "\"\"", ",", "\"\"", ",", "\"\"", ",", "\"\"", ",", "\"java.net.URI\"", ")", ";", "private", "static", "final", "Class", "MY_CLASS", "=", "Immutable", ".", "class", ";", "private", "static", "final", "ClassNode", "MY_TYPE", "=", "new", "ClassNode", "(", "MY_CLASS", ")", ";", "private", "static", "final", "String", "MY_TYPE_NAME", "=", "\"@\"", "+", "MY_TYPE", ".", "getNameWithoutPackage", "(", ")", ";", "private", "static", "final", "ClassNode", "OBJECT_TYPE", "=", "new", "ClassNode", "(", "Object", ".", "class", ")", ";", "private", "static", "final", "ClassNode", "HASHMAP_TYPE", "=", "new", "ClassNode", "(", "HashMap", ".", "class", ")", ";", "private", "static", "final", "ClassNode", "MAP_TYPE", "=", "new", "ClassNode", "(", "Map", ".", "class", ")", ";", "private", "static", "final", "ClassNode", "DATE_TYPE", "=", "new", "ClassNode", "(", "Date", ".", "class", ")", ";", "private", "static", "final", "ClassNode", "CLONEABLE_TYPE", "=", "new", "ClassNode", "(", "Cloneable", ".", "class", ")", ";", "private", "static", "final", "ClassNode", "COLLECTION_TYPE", "=", "new", "ClassNode", "(", "Collection", ".", "class", ")", ";", "private", "static", "final", "ClassNode", "HASHUTIL_TYPE", "=", "new", "ClassNode", "(", "HashCodeHelper", ".", "class", ")", ";", "private", "static", "final", "ClassNode", "STRINGBUFFER_TYPE", "=", "new", "ClassNode", "(", "StringBuffer", ".", "class", ")", ";", "private", "static", "final", "ClassNode", "READONLYEXCEPTION_TYPE", "=", "new", "ClassNode", "(", "ReadOnlyPropertyException", ".", "class", ")", ";", "private", "static", "final", "ClassNode", "DGM_TYPE", "=", "new", "ClassNode", "(", "DefaultGroovyMethods", ".", "class", ")", ";", "private", "static", "final", "ClassNode", "INVOKER_TYPE", "=", "new", "ClassNode", "(", "InvokerHelper", ".", "class", ")", ";", "private", "static", "final", "ClassNode", "SELF_TYPE", "=", "new", "ClassNode", "(", "ImmutableASTTransformation", ".", "class", ")", ";", "private", "static", "final", "Token", "COMPARE_EQUAL", "=", "Token", ".", "newSymbol", "(", "Types", ".", "COMPARE_EQUAL", ",", "-", "1", ",", "-", "1", ")", ";", "private", "static", "final", "Token", "COMPARE_NOT_EQUAL", "=", "Token", ".", "newSymbol", "(", "Types", ".", "COMPARE_NOT_EQUAL", ",", "-", "1", ",", "-", "1", ")", ";", "private", "static", "final", "Token", "ASSIGN", "=", "Token", ".", "newSymbol", "(", "Types", ".", "ASSIGN", ",", "-", "1", ",", "-", "1", ")", ";", "public", "void", "visit", "(", "ASTNode", "[", "]", "nodes", ",", "SourceUnit", "source", ")", "{", "if", "(", "nodes", ".", "length", "!=", "2", "||", "!", "(", "nodes", "[", "0", "]", "instanceof", "AnnotationNode", ")", "||", "!", "(", "nodes", "[", "1", "]", "instanceof", "AnnotatedNode", ")", ")", "{", "throw", "new", "RuntimeException", "(", "\"\"", "+", "Arrays", ".", "asList", "(", "nodes", ")", ")", ";", "}", "AnnotatedNode", "parent", "=", "(", "AnnotatedNode", ")", "nodes", "[", "1", "]", ";", "AnnotationNode", "node", "=", "(", "AnnotationNode", ")", "nodes", "[", "0", "]", ";", "if", "(", "!", "MY_TYPE", ".", "equals", "(", "node", ".", "getClassNode", "(", ")", ")", ")", "return", ";", "List", "<", "PropertyNode", ">", "newNodes", "=", "new", "ArrayList", "<", "PropertyNode", ">", "(", ")", ";", "if", "(", "parent", "instanceof", "ClassNode", ")", "{", "ClassNode", "cNode", "=", "(", "ClassNode", ")", "parent", ";", "String", "cName", "=", "cNode", ".", "getName", "(", ")", ";", "if", "(", "cNode", ".", "isInterface", "(", ")", ")", "{", "throw", "new", "RuntimeException", "(", "\"\"", "+", "cName", "+", "\"'.", "\"", "+", "MY_TYPE_NAME", "+", "\"\"", ")", ";", "}", "if", "(", "(", "cNode", ".", "getModifiers", "(", ")", "&", "ACC_FINAL", ")", "==", "0", ")", "{", "cNode", ".", "setModifiers", "(", "cNode", ".", "getModifiers", "(", ")", "|", "ACC_FINAL", ")", ";", "}", "final", "List", "<", "PropertyNode", ">", "pList", "=", "getInstanceProperties", "(", "cNode", ")", ";", "for", "(", "PropertyNode", "pNode", ":", "pList", ")", "{", "adjustPropertyForImmutability", "(", "pNode", ",", "newNodes", ")", ";", "}", "for", "(", "PropertyNode", "pNode", ":", "newNodes", ")", "{", "cNode", ".", "getProperties", "(", ")", ".", "remove", "(", "pNode", ")", ";", "addProperty", "(", "cNode", ",", "pNode", ")", ";", "}", "final", "List", "<", "FieldNode", ">", "fList", "=", "cNode", ".", "getFields", "(", ")", ";", "for", "(", "FieldNode", "fNode", ":", "fList", ")", "{", "ensureNotPublic", "(", "cName", ",", "fNode", ")", ";", "}", "createConstructor", "(", "cNode", ")", ";", "createHashCode", "(", "cNode", ")", ";", "createEquals", "(", "cNode", ")", ";", "createToString", "(", "cNode", ")", ";", "}", "}", "private", "boolean", "hasDeclaredMethod", "(", "ClassNode", "cNode", ",", "String", "name", ",", "int", "argsCount", ")", "{", "List", "<", "MethodNode", ">", "ms", "=", "cNode", ".", "getDeclaredMethods", "(", "name", ")", ";", "for", "(", "MethodNode", "m", ":", "ms", ")", "{", "Parameter", "[", "]", "paras", "=", "m", ".", "getParameters", "(", ")", ";", "if", "(", "paras", "!=", "null", "&&", "paras", ".", "length", "==", "argsCount", ")", "{", "return", "true", ";", "}", "}", "return", "false", ";", "}", "private", "void", "ensureNotPublic", "(", "String", "cNode", ",", "FieldNode", "fNode", ")", "{", "String", "fName", "=", "fNode", ".", "getName", "(", ")", ";", "if", "(", "fNode", ".", "isPublic", "(", ")", "&&", "!", "fName", ".", "contains", "(", "\"$\"", ")", ")", "{", "throw", "new", "RuntimeException", "(", "\"\"", "+", "fName", "+", "\"\"", "+", "MY_TYPE_NAME", "+", "\"", "class", "'\"", "+", "cNode", "+", "\"'.\"", ")", ";", "}", "}", "private", "void", "createHashCode", "(", "ClassNode", "cNode", ")", "{", "boolean", "hasExistingHashCode", "=", "hasDeclaredMethod", "(", "cNode", ",", "\"hashCode\"", ",", "0", ")", ";", "if", "(", "hasExistingHashCode", "&&", "hasDeclaredMethod", "(", "cNode", ",", "\"_hashCode\"", ",", "0", ")", ")", "return", ";", "final", "FieldNode", "hashField", "=", "cNode", ".", "addField", "(", "\"$hash$code\"", ",", "ACC_PRIVATE", "|", "ACC_SYNTHETIC", ",", "ClassHelper", ".", "int_TYPE", ",", "null", ")", ";", "final", "BlockStatement", "body", "=", "new", "BlockStatement", "(", ")", ";", "final", "Expression", "hash", "=", "new", "VariableExpression", "(", "hashField", ")", ";", "final", "List", "<", "PropertyNode", ">", "list", "=", "getInstanceProperties", "(", "cNode", ")", ";", "body", ".", "addStatement", "(", "new", "IfStatement", "(", "isZeroExpr", "(", "hash", ")", ",", "calculateHashStatements", "(", "hash", ",", "list", ")", ",", "new", "EmptyStatement", "(", ")", ")", ")", ";", "body", ".", "addStatement", "(", "new", "ReturnStatement", "(", "hash", ")", ")", ";", "cNode", ".", "addMethod", "(", "new", "MethodNode", "(", "hasExistingHashCode", "?", "\"_hashCode\"", ":", "\"hashCode\"", ",", "hasExistingHashCode", "?", "ACC_PRIVATE", ":", "ACC_PUBLIC", ",", "ClassHelper", ".", "int_TYPE", ",", "Parameter", ".", "EMPTY_ARRAY", ",", "ClassNode", ".", "EMPTY_ARRAY", ",", "body", ")", ")", ";", "}", "private", "void", "createToString", "(", "ClassNode", "cNode", ")", "{", "boolean", "hasExistingToString", "=", "hasDeclaredMethod", "(", "cNode", ",", "\"toString\"", ",", "0", ")", ";", "if", "(", "hasExistingToString", "&&", "hasDeclaredMethod", "(", "cNode", ",", "\"_toString\"", ",", "0", ")", ")", "return", ";", "final", "BlockStatement", "body", "=", "new", "BlockStatement", "(", ")", ";", "final", "List", "<", "PropertyNode", ">", "list", "=", "getInstanceProperties", "(", "cNode", ")", ";", "final", "Expression", "result", "=", "new", "VariableExpression", "(", "\"_result\"", ")", ";", "final", "Expression", "init", "=", "new", "ConstructorCallExpression", "(", "STRINGBUFFER_TYPE", ",", "MethodCallExpression", ".", "NO_ARGUMENTS", ")", ";", "body", ".", "addStatement", "(", "new", "ExpressionStatement", "(", "new", "DeclarationExpression", "(", "result", ",", "ASSIGN", ",", "init", ")", ")", ")", ";", "body", ".", "addStatement", "(", "append", "(", "result", ",", "new", "ConstantExpression", "(", "cNode", ".", "getName", "(", ")", ")", ")", ")", ";", "body", ".", "addStatement", "(", "append", "(", "result", ",", "new", "ConstantExpression", "(", "\"(\"", ")", ")", ")", ";", "boolean", "first", "=", "true", ";", "for", "(", "PropertyNode", "pNode", ":", "list", ")", "{", "if", "(", "first", ")", "{", "first", "=", "false", ";", "}", "else", "{", "body", ".", "addStatement", "(", "append", "(", "result", ",", "new", "ConstantExpression", "(", "\",", "\"", ")", ")", ")", ";", "}", "body", ".", "addStatement", "(", "new", "IfStatement", "(", "new", "BooleanExpression", "(", "new", "VariableExpression", "(", "cNode", ".", "getField", "(", "\"\"", ")", ")", ")", ",", "toStringPropertyName", "(", "result", ",", "pNode", ".", "getName", "(", ")", ")", ",", "new", "EmptyStatement", "(", ")", ")", ")", ";", "final", "Expression", "fieldExpr", "=", "new", "VariableExpression", "(", "pNode", ".", "getField", "(", ")", ")", ";", "body", ".", "addStatement", "(", "append", "(", "result", ",", "new", "StaticMethodCallExpression", "(", "INVOKER_TYPE", ",", "\"toString\"", ",", "fieldExpr", ")", ")", ")", ";", "}", "body", ".", "addStatement", "(", "append", "(", "result", ",", "new", "ConstantExpression", "(", "\")\"", ")", ")", ")", ";", "body", ".", "addStatement", "(", "new", "ReturnStatement", "(", "new", "MethodCallExpression", "(", "result", ",", "\"toString\"", ",", "MethodCallExpression", ".", "NO_ARGUMENTS", ")", ")", ")", ";", "cNode", ".", "addMethod", "(", "new", "MethodNode", "(", "hasExistingToString", "?", "\"_toString\"", ":", "\"toString\"", ",", "hasExistingToString", "?", "ACC_PRIVATE", ":", "ACC_PUBLIC", ",", "ClassHelper", ".", "STRING_TYPE", ",", "Parameter", ".", "EMPTY_ARRAY", ",", "ClassNode", ".", "EMPTY_ARRAY", ",", "body", ")", ")", ";", "}", "private", "Statement", "toStringPropertyName", "(", "Expression", "result", ",", "String", "fName", ")", "{", "final", "BlockStatement", "body", "=", "new", "BlockStatement", "(", ")", ";", "body", ".", "addStatement", "(", "append", "(", "result", ",", "new", "ConstantExpression", "(", "fName", ")", ")", ")", ";", "body", ".", "addStatement", "(", "append", "(", "result", ",", "new", "ConstantExpression", "(", "\":\"", ")", ")", ")", ";", "return", "body", ";", "}", "private", "ExpressionStatement", "append", "(", "Expression", "result", ",", "Expression", "expr", ")", "{", "return", "new", "ExpressionStatement", "(", "new", "MethodCallExpression", "(", "result", ",", "\"append\"", ",", "expr", ")", ")", ";", "}", "private", "Statement", "calculateHashStatements", "(", "Expression", "hash", ",", "List", "<", "PropertyNode", ">", "list", ")", "{", "final", "BlockStatement", "body", "=", "new", "BlockStatement", "(", ")", ";", "final", "Expression", "result", "=", "new", "VariableExpression", "(", "\"_result\"", ")", ";", "final", "Expression", "init", "=", "new", "StaticMethodCallExpression", "(", "HASHUTIL_TYPE", ",", "\"initHash\"", ",", "MethodCallExpression", ".", "NO_ARGUMENTS", ")", ";", "body", ".", "addStatement", "(", "new", "ExpressionStatement", "(", "new", "DeclarationExpression", "(", "result", ",", "ASSIGN", ",", "init", ")", ")", ")", ";", "for", "(", "PropertyNode", "pNode", ":", "list", ")", "{", "final", "Expression", "fieldExpr", "=", "new", "VariableExpression", "(", "pNode", ".", "getField", "(", ")", ")", ";", "final", "Expression", "args", "=", "new", "TupleExpression", "(", "result", ",", "fieldExpr", ")", ";", "final", "Expression", "current", "=", "new", "StaticMethodCallExpression", "(", "HASHUTIL_TYPE", ",", "\"updateHash\"", ",", "args", ")", ";", "body", ".", "addStatement", "(", "assignStatement", "(", "result", ",", "current", ")", ")", ";", "}", "body", ".", "addStatement", "(", "assignStatement", "(", "hash", ",", "result", ")", ")", ";", "return", "body", ";", "}", "private", "void", "createEquals", "(", "ClassNode", "cNode", ")", "{", "boolean", "hasExistingEquals", "=", "hasDeclaredMethod", "(", "cNode", ",", "\"equals\"", ",", "1", ")", ";", "if", "(", "hasExistingEquals", "&&", "hasDeclaredMethod", "(", "cNode", ",", "\"_equals\"", ",", "1", ")", ")", "return", ";", "final", "BlockStatement", "body", "=", "new", "BlockStatement", "(", ")", ";", "Expression", "other", "=", "new", "VariableExpression", "(", "\"other\"", ")", ";", "body", ".", "addStatement", "(", "returnFalseIfNull", "(", "other", ")", ")", ";", "body", ".", "addStatement", "(", "returnFalseIfWrongType", "(", "cNode", ",", "other", ")", ")", ";", "body", ".", "addStatement", "(", "returnTrueIfIdentical", "(", "VariableExpression", ".", "THIS_EXPRESSION", ",", "other", ")", ")", ";", "body", ".", "addStatement", "(", "new", "ExpressionStatement", "(", "new", "BinaryExpression", "(", "other", ",", "ASSIGN", ",", "new", "CastExpression", "(", "cNode", ",", "other", ")", ")", ")", ")", ";", "final", "List", "<", "PropertyNode", ">", "list", "=", "getInstanceProperties", "(", "cNode", ")", ";", "for", "(", "PropertyNode", "pNode", ":", "list", ")", "{", "body", ".", "addStatement", "(", "returnFalseIfPropertyNotEqual", "(", "pNode", ",", "other", ")", ")", ";", "}", "body", ".", "addStatement", "(", "new", "ReturnStatement", "(", "ConstantExpression", ".", "TRUE", ")", ")", ";", "Parameter", "[", "]", "params", "=", "{", "new", "Parameter", "(", "OBJECT_TYPE", ",", "\"other\"", ")", "}", ";", "cNode", ".", "addMethod", "(", "new", "MethodNode", "(", "hasExistingEquals", "?", "\"_equals\"", ":", "\"equals\"", ",", "hasExistingEquals", "?", "ACC_PRIVATE", ":", "ACC_PUBLIC", ",", "ClassHelper", ".", "boolean_TYPE", ",", "params", ",", "ClassNode", ".", "EMPTY_ARRAY", ",", "body", ")", ")", ";", "}", "private", "Statement", "returnFalseIfWrongType", "(", "ClassNode", "cNode", ",", "Expression", "other", ")", "{", "return", "new", "IfStatement", "(", "notEqualClasses", "(", "cNode", ",", "other", ")", ",", "new", "ReturnStatement", "(", "ConstantExpression", ".", "FALSE", ")", ",", "new", "EmptyStatement", "(", ")", ")", ";", "}", "private", "IfStatement", "returnFalseIfNull", "(", "Expression", "other", ")", "{", "return", "new", "IfStatement", "(", "equalsNullExpr", "(", "other", ")", ",", "new", "ReturnStatement", "(", "ConstantExpression", ".", "FALSE", ")", ",", "new", "EmptyStatement", "(", ")", ")", ";", "}", "private", "IfStatement", "returnTrueIfIdentical", "(", "Expression", "self", ",", "Expression", "other", ")", "{", "return", "new", "IfStatement", "(", "identicalExpr", "(", "self", ",", "other", ")", ",", "new", "ReturnStatement", "(", "ConstantExpression", ".", "TRUE", ")", ",", "new", "EmptyStatement", "(", ")", ")", ";", "}", "private", "Statement", "returnFalseIfPropertyNotEqual", "(", "PropertyNode", "pNode", ",", "Expression", "other", ")", "{", "return", "new", "IfStatement", "(", "notEqualsExpr", "(", "pNode", ",", "other", ")", ",", "new", "ReturnStatement", "(", "ConstantExpression", ".", "FALSE", ")", ",", "new", "EmptyStatement", "(", ")", ")", ";", "}", "private", "void", "addProperty", "(", "ClassNode", "cNode", ",", "PropertyNode", "pNode", ")", "{", "final", "FieldNode", "fn", "=", "pNode", ".", "getField", "(", ")", ";", "cNode", ".", "getFields", "(", ")", ".", "remove", "(", "fn", ")", ";", "cNode", ".", "addProperty", "(", "pNode", ".", "getName", "(", ")", ",", "pNode", ".", "getModifiers", "(", ")", "|", "ACC_FINAL", ",", "pNode", ".", "getType", "(", ")", ",", "pNode", ".", "getInitialExpression", "(", ")", ",", "pNode", ".", "getGetterBlock", "(", ")", ",", "pNode", ".", "getSetterBlock", "(", ")", ")", ";", "final", "FieldNode", "newfn", "=", "cNode", ".", "getField", "(", "fn", ".", "getName", "(", ")", ")", ";", "cNode", ".", "getFields", "(", ")", ".", "remove", "(", "newfn", ")", ";", "cNode", ".", "addField", "(", "fn", ")", ";", "}", "private", "void", "createConstructor", "(", "ClassNode", "cNode", ")", "{", "final", "FieldNode", "constructorField", "=", "cNode", ".", "addField", "(", "\"\"", ",", "ACC_PRIVATE", "|", "ACC_SYNTHETIC", ",", "ClassHelper", ".", "boolean_TYPE", ",", "null", ")", ";", "final", "Expression", "constructorStyle", "=", "new", "VariableExpression", "(", "constructorField", ")", ";", "if", "(", "cNode", ".", "getDeclaredConstructors", "(", ")", ".", "size", "(", ")", "!=", "0", ")", "{", "throw", "new", "RuntimeException", "(", "\"\"", "+", "MY_TYPE_NAME", "+", "\"", "class:", "\"", "+", "cNode", ".", "getNameWithoutPackage", "(", ")", ")", ";", "}", "List", "<", "PropertyNode", ">", "list", "=", "getInstanceProperties", "(", "cNode", ")", ";", "boolean", "specialHashMapCase", "=", "list", ".", "size", "(", ")", "==", "1", "&&", "list", ".", "get", "(", "0", ")", ".", "getField", "(", ")", ".", "getType", "(", ")", ".", "equals", "(", "HASHMAP_TYPE", ")", ";", "if", "(", "specialHashMapCase", ")", "{", "createConstructorMapSpecial", "(", "cNode", ",", "constructorStyle", ",", "list", ")", ";", "}", "else", "{", "createConstructorMap", "(", "cNode", ",", "constructorStyle", ",", "list", ")", ";", "createConstructorOrdered", "(", "cNode", ",", "constructorStyle", ",", "list", ")", ";", "}", "}", "private", "List", "<", "PropertyNode", ">", "getInstanceProperties", "(", "ClassNode", "cNode", ")", "{", "final", "List", "<", "PropertyNode", ">", "result", "=", "new", "ArrayList", "<", "PropertyNode", ">", "(", ")", ";", "for", "(", "PropertyNode", "pNode", ":", "cNode", ".", "getProperties", "(", ")", ")", "{", "if", "(", "!", "pNode", ".", "isStatic", "(", ")", ")", "{", "result", ".", "add", "(", "pNode", ")", ";", "}", "}", "return", "result", ";", "}", "private", "void", "createConstructorMapSpecial", "(", "ClassNode", "cNode", ",", "Expression", "constructorStyle", ",", "List", "<", "PropertyNode", ">", "list", ")", "{", "final", "BlockStatement", "body", "=", "new", "BlockStatement", "(", ")", ";", "body", ".", "addStatement", "(", "createConstructorStatementMapSpecial", "(", "list", ".", "get", "(", "0", ")", ".", "getField", "(", ")", ")", ")", ";", "createConstructorMapCommon", "(", "cNode", ",", "constructorStyle", ",", "body", ")", ";", "}", "private", "void", "createConstructorMap", "(", "ClassNode", "cNode", ",", "Expression", "constructorStyle", ",", "List", "<", "PropertyNode", ">", "list", ")", "{", "final", "BlockStatement", "body", "=", "new", "BlockStatement", "(", ")", ";", "for", "(", "PropertyNode", "pNode", ":", "list", ")", "{", "body", ".", "addStatement", "(", "createConstructorStatement", "(", "cNode", ",", "pNode", ")", ")", ";", "}", "Expression", "checkArgs", "=", "new", "ArgumentListExpression", "(", "new", "VariableExpression", "(", "\"this\"", ")", ",", "new", "VariableExpression", "(", "\"args\"", ")", ")", ";", "body", ".", "addStatement", "(", "new", "ExpressionStatement", "(", "new", "StaticMethodCallExpression", "(", "SELF_TYPE", ",", "\"\"", ",", "checkArgs", ")", ")", ")", ";", "createConstructorMapCommon", "(", "cNode", ",", "constructorStyle", ",", "body", ")", ";", "}", "private", "void", "createConstructorMapCommon", "(", "ClassNode", "cNode", ",", "Expression", "constructorStyle", ",", "BlockStatement", "body", ")", "{", "final", "List", "<", "FieldNode", ">", "fList", "=", "cNode", ".", "getFields", "(", ")", ";", "for", "(", "FieldNode", "fNode", ":", "fList", ")", "{", "if", "(", "fNode", ".", "isPublic", "(", ")", ")", "continue", ";", "if", "(", "cNode", ".", "getProperty", "(", "fNode", ".", "getName", "(", ")", ")", "!=", "null", ")", "continue", ";", "if", "(", "fNode", ".", "isFinal", "(", ")", "&&", "fNode", ".", "isStatic", "(", ")", ")", "continue", ";", "if", "(", "fNode", ".", "getName", "(", ")", ".", "contains", "(", "\"$\"", ")", ")", "continue", ";", "if", "(", "fNode", ".", "isFinal", "(", ")", "&&", "fNode", ".", "getInitialExpression", "(", ")", "!=", "null", ")", "body", ".", "addStatement", "(", "checkFinalArgNotOverridden", "(", "cNode", ",", "fNode", ")", ")", ";", "body", ".", "addStatement", "(", "createConstructorStatementDefault", "(", "fNode", ")", ")", ";", "}", "body", ".", "addStatement", "(", "assignStatement", "(", "constructorStyle", ",", "ConstantExpression", ".", "TRUE", ")", ")", ";", "final", "Parameter", "[", "]", "params", "=", "new", "Parameter", "[", "]", "{", "new", "Parameter", "(", "HASHMAP_TYPE", ",", "\"args\"", ")", "}", ";", "cNode", ".", "addConstructor", "(", "new", "ConstructorNode", "(", "ACC_PUBLIC", ",", "params", ",", "ClassNode", ".", "EMPTY_ARRAY", ",", "new", "IfStatement", "(", "equalsNullExpr", "(", "new", "VariableExpression", "(", "\"args\"", ")", ")", ",", "new", "EmptyStatement", "(", ")", ",", "body", ")", ")", ")", ";", "}", "private", "Statement", "checkFinalArgNotOverridden", "(", "ClassNode", "cNode", ",", "FieldNode", "fNode", ")", "{", "final", "String", "name", "=", "fNode", ".", "getName", "(", ")", ";", "Expression", "value", "=", "findArg", "(", "name", ")", ";", "return", "new", "IfStatement", "(", "equalsNullExpr", "(", "value", ")", ",", "new", "EmptyStatement", "(", ")", ",", "new", "ThrowStatement", "(", "new", "ConstructorCallExpression", "(", "READONLYEXCEPTION_TYPE", ",", "new", "ArgumentListExpression", "(", "new", "ConstantExpression", "(", "name", ")", ",", "new", "ConstantExpression", "(", "cNode", ".", "getName", "(", ")", ")", ")", ")", ")", ")", ";", "}", "private", "void", "createConstructorOrdered", "(", "ClassNode", "cNode", ",", "Expression", "constructorStyle", ",", "List", "<", "PropertyNode", ">", "list", ")", "{", "final", "MapExpression", "argMap", "=", "new", "MapExpression", "(", ")", ";", "final", "Parameter", "[", "]", "orderedParams", "=", "new", "Parameter", "[", "list", ".", "size", "(", ")", "]", ";", "int", "index", "=", "0", ";", "for", "(", "PropertyNode", "pNode", ":", "list", ")", "{", "orderedParams", "[", "index", "++", "]", "=", "new", "Parameter", "(", "pNode", ".", "getField", "(", ")", ".", "getType", "(", ")", ",", "pNode", ".", "getField", "(", ")", ".", "getName", "(", ")", ")", ";", "argMap", ".", "addMapEntryExpression", "(", "new", "ConstantExpression", "(", "pNode", ".", "getName", "(", ")", ")", ",", "new", "VariableExpression", "(", "pNode", ".", "getName", "(", ")", ")", ")", ";", "}", "final", "BlockStatement", "orderedBody", "=", "new", "BlockStatement", "(", ")", ";", "orderedBody", ".", "addStatement", "(", "new", "ExpressionStatement", "(", "new", "ConstructorCallExpression", "(", "ClassNode", ".", "THIS", ",", "new", "ArgumentListExpression", "(", "new", "CastExpression", "(", "HASHMAP_TYPE", ",", "argMap", ")", ")", ")", ")", ")", ";", "orderedBody", ".", "addStatement", "(", "assignStatement", "(", "constructorStyle", ",", "ConstantExpression", ".", "FALSE", ")", ")", ";", "cNode", ".", "addConstructor", "(", "new", "ConstructorNode", "(", "ACC_PUBLIC", ",", "orderedParams", ",", "ClassNode", ".", "EMPTY_ARRAY", ",", "orderedBody", ")", ")", ";", "}", "private", "Statement", "createConstructorStatement", "(", "ClassNode", "cNode", ",", "PropertyNode", "pNode", ")", "{", "FieldNode", "fNode", "=", "pNode", ".", "getField", "(", ")", ";", "final", "ClassNode", "fieldType", "=", "fNode", ".", "getType", "(", ")", ";", "final", "Statement", "statement", ";", "if", "(", "fieldType", ".", "isArray", "(", ")", "||", "fieldType", ".", "implementsInterface", "(", "CLONEABLE_TYPE", ")", ")", "{", "statement", "=", "createConstructorStatementArrayOrCloneable", "(", "fNode", ")", ";", "}", "else", "if", "(", "fieldType", ".", "isDerivedFrom", "(", "DATE_TYPE", ")", ")", "{", "statement", "=", "createConstructorStatementDate", "(", "fNode", ")", ";", "}", "else", "if", "(", "isOrImplements", "(", "fieldType", ",", "COLLECTION_TYPE", ")", "||", "isOrImplements", "(", "fieldType", ",", "MAP_TYPE", ")", ")", "{", "statement", "=", "createConstructorStatementCollection", "(", "fNode", ")", ";", "}", "else", "if", "(", "isKnownImmutable", "(", "fieldType", ")", ")", "{", "statement", "=", "createConstructorStatementDefault", "(", "fNode", ")", ";", "}", "else", "if", "(", "fieldType", ".", "isResolved", "(", ")", ")", "{", "throw", "new", "RuntimeException", "(", "createErrorMessage", "(", "cNode", ".", "getName", "(", ")", ",", "fNode", ".", "getName", "(", ")", ",", "fieldType", ".", "getName", "(", ")", ",", "\"compiling\"", ")", ")", ";", "}", "else", "{", "statement", "=", "createConstructorStatementGuarded", "(", "cNode", ",", "fNode", ")", ";", "}", "return", "statement", ";", "}", "private", "boolean", "isOrImplements", "(", "ClassNode", "fieldType", ",", "ClassNode", "interfaceType", ")", "{", "return", "fieldType", ".", "equals", "(", "interfaceType", ")", "||", "fieldType", ".", "implementsInterface", "(", "interfaceType", ")", ";", "}", "private", "Statement", "createConstructorStatementGuarded", "(", "ClassNode", "cNode", ",", "FieldNode", "fNode", ")", "{", "final", "Expression", "fieldExpr", "=", "new", "VariableExpression", "(", "fNode", ")", ";", "Expression", "initExpr", "=", "fNode", ".", "getInitialValueExpression", "(", ")", ";", "if", "(", "initExpr", "==", "null", ")", "initExpr", "=", "ConstantExpression", ".", "NULL", ";", "Expression", "unknown", "=", "findArg", "(", "fNode", ".", "getName", "(", ")", ")", ";", "return", "new", "IfStatement", "(", "equalsNullExpr", "(", "unknown", ")", ",", "new", "IfStatement", "(", "equalsNullExpr", "(", "initExpr", ")", ",", "new", "EmptyStatement", "(", ")", ",", "assignStatement", "(", "fieldExpr", ",", "checkUnresolved", "(", "cNode", ",", "fNode", ",", "initExpr", ")", ")", ")", ",", "assignStatement", "(", "fieldExpr", ",", "checkUnresolved", "(", "cNode", ",", "fNode", ",", "unknown", ")", ")", ")", ";", "}", "private", "Expression", "checkUnresolved", "(", "ClassNode", "cNode", ",", "FieldNode", "fNode", ",", "Expression", "value", ")", "{", "Expression", "args", "=", "new", "TupleExpression", "(", "new", "ConstantExpression", "(", "cNode", ".", "getName", "(", ")", ")", ",", "new", "ConstantExpression", "(", "fNode", ".", "getName", "(", ")", ")", ",", "value", ")", ";", "return", "new", "StaticMethodCallExpression", "(", "SELF_TYPE", ",", "\"\"", ",", "args", ")", ";", "}", "private", "Statement", "createConstructorStatementCollection", "(", "FieldNode", "fNode", ")", "{", "final", "Expression", "fieldExpr", "=", "new", "VariableExpression", "(", "fNode", ")", ";", "Expression", "initExpr", "=", "fNode", ".", "getInitialValueExpression", "(", ")", ";", "if", "(", "initExpr", "==", "null", ")", "initExpr", "=", "ConstantExpression", ".", "NULL", ";", "Expression", "collection", "=", "findArg", "(", "fNode", ".", "getName", "(", ")", ")", ";", "return", "new", "IfStatement", "(", "equalsNullExpr", "(", "collection", ")", ",", "new", "IfStatement", "(", "equalsNullExpr", "(", "initExpr", ")", ",", "new", "EmptyStatement", "(", ")", ",", "assignStatement", "(", "fieldExpr", ",", "cloneCollectionExpr", "(", "initExpr", ")", ")", ")", ",", "assignStatement", "(", "fieldExpr", ",", "cloneCollectionExpr", "(", "collection", ")", ")", ")", ";", "}", "private", "Statement", "createConstructorStatementMapSpecial", "(", "FieldNode", "fNode", ")", "{", "final", "Expression", "fieldExpr", "=", "new", "VariableExpression", "(", "fNode", ")", ";", "Expression", "initExpr", "=", "fNode", ".", "getInitialValueExpression", "(", ")", ";", "if", "(", "initExpr", "==", "null", ")", "initExpr", "=", "ConstantExpression", ".", "NULL", ";", "Expression", "namedArgs", "=", "findArg", "(", "fNode", ".", "getName", "(", ")", ")", ";", "Expression", "baseArgs", "=", "new", "VariableExpression", "(", "\"args\"", ")", ";", "return", "new", "IfStatement", "(", "equalsNullExpr", "(", "baseArgs", ")", ",", "new", "IfStatement", "(", "equalsNullExpr", "(", "initExpr", ")", ",", "new", "EmptyStatement", "(", ")", ",", "assignStatement", "(", "fieldExpr", ",", "cloneCollectionExpr", "(", "initExpr", ")", ")", ")", ",", "new", "IfStatement", "(", "equalsNullExpr", "(", "namedArgs", ")", ",", "new", "IfStatement", "(", "isTrueExpr", "(", "new", "MethodCallExpression", "(", "baseArgs", ",", "\"containsKey\"", ",", "new", "ConstantExpression", "(", "fNode", ".", "getName", "(", ")", ")", ")", ")", ",", "assignStatement", "(", "fieldExpr", ",", "namedArgs", ")", ",", "assignStatement", "(", "fieldExpr", ",", "cloneCollectionExpr", "(", "baseArgs", ")", ")", ")", ",", "new", "IfStatement", "(", "isOneExpr", "(", "new", "MethodCallExpression", "(", "baseArgs", ",", "\"size\"", ",", "MethodCallExpression", ".", "NO_ARGUMENTS", ")", ")", ",", "assignStatement", "(", "fieldExpr", ",", "cloneCollectionExpr", "(", "namedArgs", ")", ")", ",", "assignStatement", "(", "fieldExpr", ",", "cloneCollectionExpr", "(", "baseArgs", ")", ")", ")", ")", ")", ";", "}", "private", "boolean", "isKnownImmutable", "(", "ClassNode", "fieldType", ")", "{", "if", "(", "!", "fieldType", ".", "isResolved", "(", ")", ")", "return", "false", ";", "String", "s", "=", "fieldType", ".", "getName", "(", ")", ";", "return", "fieldType", ".", "isPrimitive", "(", ")", "||", "fieldType", ".", "isEnum", "(", ")", "||", "inImmutableList", "(", "fieldType", ".", "getName", "(", ")", ")", ";", "}", "private", "static", "boolean", "inImmutableList", "(", "String", "typeName", ")", "{", "return", "immutableList", ".", "contains", "(", "typeName", ")", ";", "}", "private", "Statement", "createConstructorStatementDefault", "(", "FieldNode", "fNode", ")", "{", "final", "String", "name", "=", "fNode", ".", "getName", "(", ")", ";", "final", "Expression", "fieldExpr", "=", "new", "PropertyExpression", "(", "VariableExpression", ".", "THIS_EXPRESSION", ",", "name", ")", ";", "Expression", "initExpr", "=", "fNode", ".", "getInitialValueExpression", "(", ")", ";", "if", "(", "initExpr", "==", "null", ")", "initExpr", "=", "ConstantExpression", ".", "NULL", ";", "final", "Expression", "value", "=", "findArg", "(", "fNode", ".", "getName", "(", ")", ")", ";", "return", "new", "IfStatement", "(", "equalsNullExpr", "(", "value", ")", ",", "new", "IfStatement", "(", "equalsNullExpr", "(", "initExpr", ")", ",", "new", "EmptyStatement", "(", ")", ",", "assignStatement", "(", "fieldExpr", ",", "initExpr", ")", ")", ",", "assignStatement", "(", "fieldExpr", ",", "value", ")", ")", ";", "}", "private", "Statement", "createConstructorStatementArrayOrCloneable", "(", "FieldNode", "fNode", ")", "{", "final", "Expression", "fieldExpr", "=", "new", "VariableExpression", "(", "fNode", ")", ";", "Expression", "initExpr", "=", "fNode", ".", "getInitialValueExpression", "(", ")", ";", "if", "(", "initExpr", "==", "null", ")", "initExpr", "=", "ConstantExpression", ".", "NULL", ";", "final", "Expression", "array", "=", "findArg", "(", "fNode", ".", "getName", "(", ")", ")", ";", "return", "new", "IfStatement", "(", "equalsNullExpr", "(", "array", ")", ",", "new", "IfStatement", "(", "equalsNullExpr", "(", "initExpr", ")", ",", "assignStatement", "(", "fieldExpr", ",", "ConstantExpression", ".", "NULL", ")", ",", "assignStatement", "(", "fieldExpr", ",", "cloneArrayOrCloneableExpr", "(", "initExpr", ")", ")", ")", ",", "assignStatement", "(", "fieldExpr", ",", "cloneArrayOrCloneableExpr", "(", "array", ")", ")", ")", ";", "}", "private", "Statement", "createConstructorStatementDate", "(", "FieldNode", "fNode", ")", "{", "final", "Expression", "fieldExpr", "=", "new", "VariableExpression", "(", "fNode", ")", ";", "Expression", "initExpr", "=", "fNode", ".", "getInitialValueExpression", "(", ")", ";", "if", "(", "initExpr", "==", "null", ")", "initExpr", "=", "ConstantExpression", ".", "NULL", ";", "final", "Expression", "date", "=", "findArg", "(", "fNode", ".", "getName", "(", ")", ")", ";", "return", "new", "IfStatement", "(", "equalsNullExpr", "(", "date", ")", ",", "new", "IfStatement", "(", "equalsNullExpr", "(", "initExpr", ")", ",", "assignStatement", "(", "fieldExpr", ",", "ConstantExpression", ".", "NULL", ")", ",", "assignStatement", "(", "fieldExpr", ",", "cloneDateExpr", "(", "initExpr", ")", ")", ")", ",", "assignStatement", "(", "fieldExpr", ",", "cloneDateExpr", "(", "date", ")", ")", ")", ";", "}", "private", "Expression", "cloneDateExpr", "(", "Expression", "origDate", ")", "{", "return", "new", "ConstructorCallExpression", "(", "DATE_TYPE", ",", "new", "MethodCallExpression", "(", "origDate", ",", "\"getTime\"", ",", "MethodCallExpression", ".", "NO_ARGUMENTS", ")", ")", ";", "}", "private", "Statement", "assignStatement", "(", "Expression", "fieldExpr", ",", "Expression", "value", ")", "{", "return", "new", "ExpressionStatement", "(", "assignExpr", "(", "fieldExpr", ",", "value", ")", ")", ";", "}", "private", "Expression", "assignExpr", "(", "Expression", "fieldExpr", ",", "Expression", "value", ")", "{", "return", "new", "BinaryExpression", "(", "fieldExpr", ",", "ASSIGN", ",", "value", ")", ";", "}", "private", "BooleanExpression", "equalsNullExpr", "(", "Expression", "argExpr", ")", "{", "return", "new", "BooleanExpression", "(", "new", "BinaryExpression", "(", "argExpr", ",", "COMPARE_EQUAL", ",", "ConstantExpression", ".", "NULL", ")", ")", ";", "}", "private", "BooleanExpression", "isTrueExpr", "(", "Expression", "argExpr", ")", "{", "return", "new", "BooleanExpression", "(", "new", "BinaryExpression", "(", "argExpr", ",", "COMPARE_EQUAL", ",", "ConstantExpression", ".", "TRUE", ")", ")", ";", "}", "private", "BooleanExpression", "isZeroExpr", "(", "Expression", "expr", ")", "{", "return", "new", "BooleanExpression", "(", "new", "BinaryExpression", "(", "expr", ",", "COMPARE_EQUAL", ",", "new", "ConstantExpression", "(", "0", ")", ")", ")", ";", "}", "private", "BooleanExpression", "isOneExpr", "(", "Expression", "expr", ")", "{", "return", "new", "BooleanExpression", "(", "new", "BinaryExpression", "(", "expr", ",", "COMPARE_EQUAL", ",", "new", "ConstantExpression", "(", "1", ")", ")", ")", ";", "}", "private", "BooleanExpression", "notEqualsExpr", "(", "PropertyNode", "pNode", ",", "Expression", "other", ")", "{", "final", "Expression", "fieldExpr", "=", "new", "VariableExpression", "(", "pNode", ".", "getField", "(", ")", ")", ";", "final", "Expression", "otherExpr", "=", "new", "PropertyExpression", "(", "other", ",", "pNode", ".", "getField", "(", ")", ".", "getName", "(", ")", ")", ";", "return", "new", "BooleanExpression", "(", "new", "BinaryExpression", "(", "fieldExpr", ",", "COMPARE_NOT_EQUAL", ",", "otherExpr", ")", ")", ";", "}", "private", "BooleanExpression", "identicalExpr", "(", "Expression", "self", ",", "Expression", "other", ")", "{", "return", "new", "BooleanExpression", "(", "new", "MethodCallExpression", "(", "self", ",", "\"is\"", ",", "new", "ArgumentListExpression", "(", "other", ")", ")", ")", ";", "}", "private", "BooleanExpression", "notEqualClasses", "(", "ClassNode", "cNode", ",", "Expression", "other", ")", "{", "return", "new", "BooleanExpression", "(", "new", "BinaryExpression", "(", "new", "ClassExpression", "(", "cNode", ")", ",", "COMPARE_NOT_EQUAL", ",", "new", "MethodCallExpression", "(", "other", ",", "\"getClass\"", ",", "MethodCallExpression", ".", "NO_ARGUMENTS", ")", ")", ")", ";", "}", "private", "Expression", "findArg", "(", "String", "fName", ")", "{", "return", "new", "PropertyExpression", "(", "new", "VariableExpression", "(", "\"args\"", ")", ",", "fName", ")", ";", "}", "private", "void", "adjustPropertyForImmutability", "(", "PropertyNode", "pNode", ",", "List", "<", "PropertyNode", ">", "newNodes", ")", "{", "final", "FieldNode", "fNode", "=", "pNode", ".", "getField", "(", ")", ";", "fNode", ".", "setModifiers", "(", "(", "pNode", ".", "getModifiers", "(", ")", "&", "(", "~", "ACC_PUBLIC", ")", ")", "|", "ACC_FINAL", "|", "ACC_PRIVATE", ")", ";", "adjustPropertyNode", "(", "pNode", ",", "createGetterBody", "(", "fNode", ")", ")", ";", "newNodes", ".", "add", "(", "pNode", ")", ";", "}", "private", "void", "adjustPropertyNode", "(", "PropertyNode", "pNode", ",", "Statement", "getterBody", ")", "{", "pNode", ".", "setSetterBlock", "(", "null", ")", ";", "pNode", ".", "setGetterBlock", "(", "getterBody", ")", ";", "}", "private", "Statement", "createGetterBody", "(", "FieldNode", "fNode", ")", "{", "BlockStatement", "body", "=", "new", "BlockStatement", "(", ")", ";", "final", "ClassNode", "fieldType", "=", "fNode", ".", "getType", "(", ")", ";", "final", "Statement", "statement", ";", "if", "(", "fieldType", ".", "isArray", "(", ")", "||", "fieldType", ".", "implementsInterface", "(", "CLONEABLE_TYPE", ")", ")", "{", "statement", "=", "createGetterBodyArrayOrCloneable", "(", "fNode", ")", ";", "}", "else", "if", "(", "fieldType", ".", "isDerivedFrom", "(", "DATE_TYPE", ")", ")", "{", "statement", "=", "createGetterBodyDate", "(", "fNode", ")", ";", "}", "else", "{", "statement", "=", "createGetterBodyDefault", "(", "fNode", ")", ";", "}", "body", ".", "addStatement", "(", "statement", ")", ";", "return", "body", ";", "}", "private", "Statement", "createGetterBodyDefault", "(", "FieldNode", "fNode", ")", "{", "final", "Expression", "fieldExpr", "=", "new", "VariableExpression", "(", "fNode", ")", ";", "return", "new", "ExpressionStatement", "(", "fieldExpr", ")", ";", "}", "private", "static", "String", "createErrorMessage", "(", "String", "className", ",", "String", "fieldName", ",", "String", "typeName", ",", "String", "mode", ")", "{", "return", "MY_TYPE_NAME", "+", "\"\"", "+", "fieldName", "+", "\"'", "of", "type", "'\"", "+", "prettyTypeName", "(", "typeName", ")", "+", "\"'", "while", "\"", "+", "mode", "+", "\"", "class", "\"", "+", "className", "+", "\".n\"", "+", "MY_TYPE_NAME", "+", "\"\"", "+", "\"\"", "+", "\"\"", "+", "\"-", "other", "\"", "+", "MY_TYPE_NAME", "+", "\"\"", "+", "\"\"", "+", "\"\"", "+", "MY_TYPE_NAME", "+", "\"\"", ";", "}", "private", "static", "String", "prettyTypeName", "(", "String", "name", ")", "{", "return", "name", ".", "equals", "(", "\"\"", ")", "?", "name", "+", "\"", "or", "def\"", ":", "name", ";", "}", "private", "Statement", "createGetterBodyArrayOrCloneable", "(", "FieldNode", "fNode", ")", "{", "final", "Expression", "fieldExpr", "=", "new", "VariableExpression", "(", "fNode", ")", ";", "final", "Expression", "expression", "=", "cloneArrayOrCloneableExpr", "(", "fieldExpr", ")", ";", "return", "safeExpression", "(", "fieldExpr", ",", "expression", ")", ";", "}", "private", "Expression", "cloneArrayOrCloneableExpr", "(", "Expression", "fieldExpr", ")", "{", "return", "new", "MethodCallExpression", "(", "fieldExpr", ",", "\"clone\"", ",", "MethodCallExpression", ".", "NO_ARGUMENTS", ")", ";", "}", "private", "Expression", "cloneCollectionExpr", "(", "Expression", "fieldExpr", ")", "{", "return", "new", "StaticMethodCallExpression", "(", "DGM_TYPE", ",", "\"asImmutable\"", ",", "fieldExpr", ")", ";", "}", "private", "Statement", "createGetterBodyDate", "(", "FieldNode", "fNode", ")", "{", "final", "Expression", "fieldExpr", "=", "new", "VariableExpression", "(", "fNode", ")", ";", "final", "Expression", "expression", "=", "cloneDateExpr", "(", "fieldExpr", ")", ";", "return", "safeExpression", "(", "fieldExpr", ",", "expression", ")", ";", "}", "private", "Statement", "safeExpression", "(", "Expression", "fieldExpr", ",", "Expression", "expression", ")", "{", "return", "new", "IfStatement", "(", "equalsNullExpr", "(", "fieldExpr", ")", ",", "new", "ExpressionStatement", "(", "fieldExpr", ")", ",", "new", "ExpressionStatement", "(", "expression", ")", ")", ";", "}", "public", "static", "Object", "checkImmutable", "(", "String", "className", ",", "String", "fieldName", ",", "Object", "field", ")", "{", "if", "(", "field", "==", "null", "||", "field", "instanceof", "Enum", "||", "inImmutableList", "(", "field", ".", "getClass", "(", ")", ".", "getName", "(", ")", ")", ")", "return", "field", ";", "if", "(", "field", "instanceof", "Collection", ")", "return", "DefaultGroovyMethods", ".", "asImmutable", "(", "(", "Collection", ")", "field", ")", ";", "if", "(", "field", ".", "getClass", "(", ")", ".", "getAnnotation", "(", "MY_CLASS", ")", "!=", "null", ")", "return", "field", ";", "final", "String", "typeName", "=", "field", ".", "getClass", "(", ")", ".", "getName", "(", ")", ";", "throw", "new", "RuntimeException", "(", "createErrorMessage", "(", "className", ",", "fieldName", ",", "typeName", ",", "\"constructing\"", ")", ")", ";", "}", "public", "static", "void", "checkPropNames", "(", "Object", "instance", ",", "Map", "<", "String", ",", "Object", ">", "args", ")", "{", "final", "MetaClass", "metaClass", "=", "InvokerHelper", ".", "getMetaClass", "(", "instance", ")", ";", "for", "(", "String", "k", ":", "args", ".", "keySet", "(", ")", ")", "{", "if", "(", "metaClass", ".", "hasProperty", "(", "instance", ",", "k", ")", "==", "null", ")", "throw", "new", "MissingPropertyException", "(", "k", ",", "instance", ".", "getClass", "(", ")", ")", ";", "}", "}", "}", "</s>" ]
6,677
[ "<s>", "package", "org", ".", "codehaus", ".", "groovy", ".", "transform", ";", "import", "groovy", ".", "lang", ".", "GroovyClassLoader", ";", "import", "java", ".", "io", ".", "BufferedReader", ";", "import", "java", ".", "io", ".", "IOException", ";", "import", "java", ".", "io", ".", "InputStream", ";", "import", "java", ".", "io", ".", "InputStreamReader", ";", "import", "java", ".", "net", ".", "URL", ";", "import", "java", ".", "util", ".", "ArrayList", ";", "import", "java", ".", "util", ".", "Collection", ";", "import", "java", ".", "util", ".", "Enumeration", ";", "import", "java", ".", "util", ".", "HashMap", ";", "import", "java", ".", "util", ".", "HashSet", ";", "import", "java", ".", "util", ".", "Iterator", ";", "import", "java", ".", "util", ".", "LinkedHashMap", ";", "import", "java", ".", "util", ".", "LinkedList", ";", "import", "java", ".", "util", ".", "List", ";", "import", "java", ".", "util", ".", "Map", ";", "import", "java", ".", "util", ".", "Set", ";", "import", "java", ".", "util", ".", "StringTokenizer", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "GroovyException", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "ASTNode", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "AnnotatedNode", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "AnnotationNode", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "ClassCodeVisitorSupport", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "ClassNode", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "classgen", ".", "GeneratorContext", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "control", ".", "CompilationFailedException", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "control", ".", "CompilationUnit", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "control", ".", "CompilePhase", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "control", ".", "Phases", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "control", ".", "SourceUnit", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "control", ".", "messages", ".", "SimpleMessage", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "control", ".", "messages", ".", "WarningMessage", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "GroovyLogManager", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "TraceCategory", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "syntax", ".", "SyntaxException", ";", "public", "final", "class", "ASTTransformationVisitor", "extends", "ClassCodeVisitorSupport", "{", "private", "CompilePhase", "phase", ";", "private", "SourceUnit", "source", ";", "private", "List", "<", "ASTNode", "[", "]", ">", "targetNodes", ";", "private", "Map", "<", "ASTNode", ",", "List", "<", "ASTTransformation", ">", ">", "transforms", ";", "private", "Map", "<", "Class", "<", "?", "extends", "ASTTransformation", ">", ",", "ASTTransformation", ">", "transformInstances", ";", "private", "static", "CompilationUnit", "compUnit", ";", "private", "static", "Set", "<", "String", ">", "globalTransformNames", "=", "new", "HashSet", "<", "String", ">", "(", ")", ";", "private", "ASTTransformationVisitor", "(", "CompilePhase", "phase", ")", "{", "this", ".", "phase", "=", "phase", ";", "}", "protected", "SourceUnit", "getSourceUnit", "(", ")", "{", "return", "source", ";", "}", "public", "void", "visitClass", "(", "ClassNode", "classNode", ")", "{", "Map", "<", "Class", "<", "?", "extends", "ASTTransformation", ">", ",", "Set", "<", "ASTNode", ">", ">", "baseTransforms", "=", "classNode", ".", "getTransforms", "(", "phase", ")", ";", "if", "(", "!", "baseTransforms", ".", "isEmpty", "(", ")", ")", "{", "transformInstances", "=", "new", "HashMap", "<", "Class", "<", "?", "extends", "ASTTransformation", ">", ",", "ASTTransformation", ">", "(", ")", ";", "for", "(", "Class", "<", "?", "extends", "ASTTransformation", ">", "transformClass", ":", "baseTransforms", ".", "keySet", "(", ")", ")", "{", "try", "{", "transformInstances", ".", "put", "(", "transformClass", ",", "transformClass", ".", "newInstance", "(", ")", ")", ";", "}", "catch", "(", "InstantiationException", "e", ")", "{", "source", ".", "getErrorCollector", "(", ")", ".", "addError", "(", "new", "SimpleMessage", "(", "\"\"", "+", "transformClass", ",", "source", ")", ")", ";", "}", "catch", "(", "IllegalAccessException", "e", ")", "{", "source", ".", "getErrorCollector", "(", ")", ".", "addError", "(", "new", "SimpleMessage", "(", "\"\"", "+", "transformClass", ",", "source", ")", ")", ";", "}", "}", "transforms", "=", "new", "HashMap", "<", "ASTNode", ",", "List", "<", "ASTTransformation", ">", ">", "(", ")", ";", "for", "(", "Map", ".", "Entry", "<", "Class", "<", "?", "extends", "ASTTransformation", ">", ",", "Set", "<", "ASTNode", ">", ">", "entry", ":", "baseTransforms", ".", "entrySet", "(", ")", ")", "{", "for", "(", "ASTNode", "node", ":", "entry", ".", "getValue", "(", ")", ")", "{", "List", "<", "ASTTransformation", ">", "list", "=", "transforms", ".", "get", "(", "node", ")", ";", "if", "(", "list", "==", "null", ")", "{", "list", "=", "new", "ArrayList", "<", "ASTTransformation", ">", "(", ")", ";", "transforms", ".", "put", "(", "node", ",", "list", ")", ";", "}", "list", ".", "add", "(", "transformInstances", ".", "get", "(", "entry", ".", "getKey", "(", ")", ")", ")", ";", "}", "}", "targetNodes", "=", "new", "LinkedList", "<", "ASTNode", "[", "]", ">", "(", ")", ";", "super", ".", "visitClass", "(", "classNode", ")", ";", "for", "(", "ASTNode", "[", "]", "node", ":", "targetNodes", ")", "{", "for", "(", "ASTTransformation", "snt", ":", "transforms", ".", "get", "(", "node", "[", "0", "]", ")", ")", "{", "try", "{", "long", "stime", "=", "System", ".", "nanoTime", "(", ")", ";", "boolean", "okToSet", "=", "source", "!=", "null", "&&", "source", ".", "getErrorCollector", "(", ")", "!=", "null", ";", "try", "{", "if", "(", "okToSet", ")", "{", "source", ".", "getErrorCollector", "(", ")", ".", "transformActive", "=", "true", ";", "}", "snt", ".", "visit", "(", "node", ",", "source", ")", ";", "}", "finally", "{", "if", "(", "okToSet", ")", "{", "source", ".", "getErrorCollector", "(", ")", ".", "transformActive", "=", "false", ";", "}", "}", "long", "etime", "=", "System", ".", "nanoTime", "(", ")", ";", "if", "(", "GroovyLogManager", ".", "manager", ".", "hasLoggers", "(", ")", ")", "{", "try", "{", "GroovyLogManager", ".", "manager", ".", "log", "(", "TraceCategory", ".", "AST_TRANSFORM", ",", "\"\"", "+", "snt", ".", "getClass", "(", ")", ".", "getName", "(", ")", "+", "\"", "on", "\"", "+", "classNode", ".", "getName", "(", ")", "+", "\":\"", "+", "node", "[", "1", "]", "+", "\"", "=", "\"", "+", "(", "(", "etime", "-", "stime", ")", "/", "1000000", ")", "+", "\"ms\"", ")", ";", "}", "catch", "(", "Throwable", "t", ")", "{", "t", ".", "printStackTrace", "(", ")", ";", "}", "}", "}", "catch", "(", "NoClassDefFoundError", "ncdfe", ")", "{", "String", "transformName", "=", "snt", ".", "getClass", "(", ")", ".", "getName", "(", ")", ";", "StringBuilder", "sb", "=", "new", "StringBuilder", "(", ")", ";", "sb", ".", "append", "(", "\"\"", "+", "transformName", "+", "\"\"", "+", "ncdfe", ".", "getMessage", "(", ")", ")", ";", "sb", ".", "append", "(", "\"\"", ")", ";", "source", ".", "addError", "(", "new", "SyntaxException", "(", "sb", ".", "toString", "(", ")", ",", "ncdfe", ",", "0", ",", "0", ")", ")", ";", "}", "}", "}", "}", "}", "public", "void", "visitAnnotations", "(", "AnnotatedNode", "node", ")", "{", "super", ".", "visitAnnotations", "(", "node", ")", ";", "for", "(", "AnnotationNode", "annotation", ":", "node", ".", "getAnnotations", "(", ")", ")", "{", "if", "(", "transforms", ".", "containsKey", "(", "annotation", ")", ")", "{", "targetNodes", ".", "add", "(", "new", "ASTNode", "[", "]", "{", "annotation", ",", "node", "}", ")", ";", "}", "}", "}", "public", "static", "void", "addPhaseOperations", "(", "final", "CompilationUnit", "compilationUnit", ")", "{", "addGlobalTransforms", "(", "compilationUnit", ")", ";", "if", "(", "!", "compilationUnit", ".", "allowTransforms", ")", "{", "return", ";", "}", "compilationUnit", ".", "addPhaseOperation", "(", "new", "CompilationUnit", ".", "PrimaryClassNodeOperation", "(", ")", "{", "public", "void", "call", "(", "SourceUnit", "source", ",", "GeneratorContext", "context", ",", "ClassNode", "classNode", ")", "throws", "CompilationFailedException", "{", "ASTTransformationCollectorCodeVisitor", "collector", "=", "new", "ASTTransformationCollectorCodeVisitor", "(", "source", ",", "compilationUnit", ".", "getTransformLoader", "(", ")", ")", ";", "collector", ".", "visitClass", "(", "classNode", ")", ";", "}", "}", ",", "Phases", ".", "SEMANTIC_ANALYSIS", ")", ";", "for", "(", "CompilePhase", "phase", ":", "CompilePhase", ".", "values", "(", ")", ")", "{", "final", "ASTTransformationVisitor", "visitor", "=", "new", "ASTTransformationVisitor", "(", "phase", ")", ";", "switch", "(", "phase", ")", "{", "case", "INITIALIZATION", ":", "case", "PARSING", ":", "case", "CONVERSION", ":", "break", ";", "default", ":", "compilationUnit", ".", "addPhaseOperation", "(", "new", "CompilationUnit", ".", "PrimaryClassNodeOperation", "(", ")", "{", "public", "void", "call", "(", "SourceUnit", "source", ",", "GeneratorContext", "context", ",", "ClassNode", "classNode", ")", "throws", "CompilationFailedException", "{", "visitor", ".", "source", "=", "source", ";", "visitor", ".", "visitClass", "(", "classNode", ")", ";", "}", "}", ",", "phase", ".", "getPhaseNumber", "(", ")", ")", ";", "break", ";", "}", "}", "}", "public", "static", "void", "addGlobalTransformsAfterGrab", "(", ")", "{", "doAddGlobalTransforms", "(", "compUnit", ",", "false", ")", ";", "}", "public", "static", "void", "addGlobalTransforms", "(", "CompilationUnit", "compilationUnit", ")", "{", "compUnit", "=", "compilationUnit", ";", "doAddGlobalTransforms", "(", "compilationUnit", ",", "true", ")", ";", "}", "private", "static", "void", "doAddGlobalTransforms", "(", "CompilationUnit", "compilationUnit", ",", "boolean", "isFirstScan", ")", "{", "GroovyClassLoader", "transformLoader", "=", "compilationUnit", ".", "getTransformLoader", "(", ")", ";", "Map", "<", "String", ",", "URL", ">", "transformNames", "=", "new", "LinkedHashMap", "<", "String", ",", "URL", ">", "(", ")", ";", "try", "{", "Enumeration", "<", "URL", ">", "globalServices", "=", "transformLoader", ".", "getResources", "(", "\"\"", ")", ";", "while", "(", "globalServices", ".", "hasMoreElements", "(", ")", ")", "{", "URL", "service", "=", "globalServices", ".", "nextElement", "(", ")", ";", "String", "className", ";", "InputStream", "is", "=", "service", ".", "openStream", "(", ")", ";", "BufferedReader", "svcIn", "=", "new", "BufferedReader", "(", "new", "InputStreamReader", "(", "is", ")", ")", ";", "try", "{", "className", "=", "svcIn", ".", "readLine", "(", ")", ";", "}", "catch", "(", "IOException", "ioe", ")", "{", "compilationUnit", ".", "getErrorCollector", "(", ")", ".", "addError", "(", "new", "SimpleMessage", "(", "\"\"", "+", "service", ".", "toExternalForm", "(", ")", "+", "\"\"", "+", "ioe", ".", "toString", "(", ")", ",", "null", ")", ")", ";", "continue", ";", "}", "while", "(", "className", "!=", "null", ")", "{", "if", "(", "!", "className", ".", "startsWith", "(", "\"#\"", ")", "&&", "className", ".", "length", "(", ")", ">", "0", ")", "{", "if", "(", "transformNames", ".", "containsKey", "(", "className", ")", ")", "{", "if", "(", "!", "service", ".", "equals", "(", "transformNames", ".", "get", "(", "className", ")", ")", ")", "{", "compilationUnit", ".", "getErrorCollector", "(", ")", ".", "addWarning", "(", "WarningMessage", ".", "POSSIBLE_ERRORS", ",", "\"\"", "+", "className", "+", "\"\"", "+", "transformNames", ".", "get", "(", "className", ")", ".", "toExternalForm", "(", ")", "+", "\"", "and", "\"", "+", "service", ".", "toExternalForm", "(", ")", "+", "\"\"", ",", "null", ",", "null", ")", ";", "}", "}", "else", "{", "if", "(", "compilationUnit", ".", "allowTransforms", "||", "globalTransformsAllowedInReconcile", ".", "contains", "(", "className", ")", ")", "{", "transformNames", ".", "put", "(", "className", ",", "service", ")", ";", "}", "}", "}", "try", "{", "className", "=", "svcIn", ".", "readLine", "(", ")", ";", "}", "catch", "(", "IOException", "ioe", ")", "{", "compilationUnit", ".", "getErrorCollector", "(", ")", ".", "addError", "(", "new", "SimpleMessage", "(", "\"\"", "+", "service", ".", "toExternalForm", "(", ")", "+", "\"\"", "+", "ioe", ".", "toString", "(", ")", ",", "null", ")", ")", ";", "continue", ";", "}", "}", "is", ".", "close", "(", ")", ";", "}", "}", "catch", "(", "IOException", "e", ")", "{", "compilationUnit", ".", "getErrorCollector", "(", ")", ".", "addError", "(", "new", "SimpleMessage", "(", "\"\"", "+", "e", ".", "getMessage", "(", ")", ",", "null", ")", ")", ";", "}", "try", "{", "Class", ".", "forName", "(", "\"\"", ")", ";", "}", "catch", "(", "Exception", "e", ")", "{", "StringBuffer", "sb", "=", "new", "StringBuffer", "(", ")", ";", "sb", ".", "append", "(", "\"\"", ")", ";", "sb", ".", "append", "(", "\"\"", ")", ";", "for", "(", "Map", ".", "Entry", "<", "String", ",", "URL", ">", "entry", ":", "transformNames", ".", "entrySet", "(", ")", ")", "{", "sb", ".", "append", "(", "'\\t'", ")", ";", "sb", ".", "append", "(", "entry", ".", "getKey", "(", ")", ")", ";", "sb", ".", "append", "(", "'\\n'", ")", ";", "}", "compilationUnit", ".", "getErrorCollector", "(", ")", ".", "addWarning", "(", "new", "WarningMessage", "(", "WarningMessage", ".", "POSSIBLE_ERRORS", ",", "sb", ".", "toString", "(", ")", ",", "null", ",", "null", ")", ")", ";", "return", ";", "}", "if", "(", "isFirstScan", ")", "{", "for", "(", "Map", ".", "Entry", "<", "String", ",", "URL", ">", "entry", ":", "transformNames", ".", "entrySet", "(", ")", ")", "{", "globalTransformNames", ".", "add", "(", "entry", ".", "getKey", "(", ")", ")", ";", "}", "addPhaseOperationsForGlobalTransforms", "(", "compilationUnit", ",", "transformNames", ",", "isFirstScan", ")", ";", "}", "else", "{", "Iterator", "<", "Map", ".", "Entry", "<", "String", ",", "URL", ">", ">", "it", "=", "transformNames", ".", "entrySet", "(", ")", ".", "iterator", "(", ")", ";", "while", "(", "it", ".", "hasNext", "(", ")", ")", "{", "Map", ".", "Entry", "<", "String", ",", "URL", ">", "entry", "=", "it", ".", "next", "(", ")", ";", "if", "(", "!", "globalTransformNames", ".", "add", "(", "entry", ".", "getKey", "(", ")", ")", ")", "{", "it", ".", "remove", "(", ")", ";", "}", "}", "addPhaseOperationsForGlobalTransforms", "(", "compilationUnit", ",", "transformNames", ",", "isFirstScan", ")", ";", "}", "}", "private", "static", "List", "<", "String", ">", "globalTransformsAllowedInReconcile", "=", "new", "ArrayList", "<", "String", ">", "(", ")", ";", "{", "try", "{", "String", "s", "=", "System", ".", "getProperty", "(", "\"\"", ",", "\"\"", ")", ";", "StringTokenizer", "st", "=", "new", "StringTokenizer", "(", "s", ",", "\",\"", ")", ";", "while", "(", "st", ".", "hasMoreElements", "(", ")", ")", "{", "String", "classname", "=", "st", ".", "nextToken", "(", ")", ";", "globalTransformNames", ".", "add", "(", "classname", ")", ";", "}", "}", "catch", "(", "Exception", "e", ")", "{", "}", "globalTransformNames", ".", "add", "(", "\"\"", ")", ";", "}", "private", "static", "void", "addPhaseOperationsForGlobalTransforms", "(", "CompilationUnit", "compilationUnit", ",", "Map", "<", "String", ",", "URL", ">", "transformNames", ",", "boolean", "isFirstScan", ")", "{", "GroovyClassLoader", "transformLoader", "=", "compilationUnit", ".", "getTransformLoader", "(", ")", ";", "for", "(", "Map", ".", "Entry", "<", "String", ",", "URL", ">", "entry", ":", "transformNames", ".", "entrySet", "(", ")", ")", "{", "try", "{", "Class", "gTransClass", "=", "transformLoader", ".", "loadClass", "(", "entry", ".", "getKey", "(", ")", ",", "false", ",", "true", ",", "false", ")", ";", "GroovyASTTransformation", "transformAnnotation", "=", "(", "GroovyASTTransformation", ")", "gTransClass", ".", "getAnnotation", "(", "GroovyASTTransformation", ".", "class", ")", ";", "if", "(", "transformAnnotation", "==", "null", ")", "{", "compilationUnit", ".", "getErrorCollector", "(", ")", ".", "addWarning", "(", "new", "WarningMessage", "(", "WarningMessage", ".", "POSSIBLE_ERRORS", ",", "\"\"", "+", "entry", ".", "getKey", "(", ")", "+", "\"\"", "+", "entry", ".", "getValue", "(", ")", ".", "toExternalForm", "(", ")", "+", "\"\"", "+", "GroovyASTTransformation", ".", "class", ".", "getName", "(", ")", "+", "\"\"", ",", "null", ",", "null", ")", ")", ";", "continue", ";", "}", "if", "(", "ASTTransformation", ".", "class", ".", "isAssignableFrom", "(", "gTransClass", ")", ")", "{", "try", "{", "final", "ASTTransformation", "instance", "=", "(", "ASTTransformation", ")", "gTransClass", ".", "newInstance", "(", ")", ";", "CompilationUnit", ".", "SourceUnitOperation", "suOp", "=", "new", "CompilationUnit", ".", "SourceUnitOperation", "(", ")", "{", "private", "boolean", "isBuggered", "=", "false", ";", "public", "void", "call", "(", "SourceUnit", "source", ")", "throws", "CompilationFailedException", "{", "if", "(", "isBuggered", ")", "return", ";", "try", "{", "long", "stime", "=", "System", ".", "nanoTime", "(", ")", ";", "boolean", "okToSet", "=", "source", "!=", "null", "&&", "source", ".", "getErrorCollector", "(", ")", "!=", "null", ";", "try", "{", "if", "(", "okToSet", ")", "{", "source", ".", "getErrorCollector", "(", ")", ".", "transformActive", "=", "true", ";", "}", "instance", ".", "visit", "(", "new", "ASTNode", "[", "]", "{", "source", ".", "getAST", "(", ")", "}", ",", "source", ")", ";", "}", "finally", "{", "if", "(", "okToSet", ")", "{", "source", ".", "getErrorCollector", "(", ")", ".", "transformActive", "=", "false", ";", "}", "}", "long", "etime", "=", "System", ".", "nanoTime", "(", ")", ";", "if", "(", "GroovyLogManager", ".", "manager", ".", "hasLoggers", "(", ")", ")", "{", "long", "timetaken", "=", "(", "etime", "-", "stime", ")", "/", "1000000", ";", "if", "(", "timetaken", ">", "0", ")", "{", "try", "{", "GroovyLogManager", ".", "manager", ".", "log", "(", "TraceCategory", ".", "AST_TRANSFORM", ",", "\"\"", "+", "instance", ".", "getClass", "(", ")", ".", "getName", "(", ")", "+", "\"", "on", "\"", "+", "source", ".", "getName", "(", ")", "+", "\"", "=", "\"", "+", "timetaken", "+", "\"ms\"", ")", ";", "}", "catch", "(", "Throwable", "t", ")", "{", "t", ".", "printStackTrace", "(", ")", ";", "}", "}", "}", "}", "catch", "(", "NoClassDefFoundError", "ncdfe", ")", "{", "new", "RuntimeException", "(", "\"Transform", "\"", "+", "instance", ".", "toString", "(", ")", "+", "\"\"", ",", "ncdfe", ")", ".", "printStackTrace", "(", ")", ";", "source", ".", "addException", "(", "new", "GroovyException", "(", "\"Transform", "\"", "+", "instance", ".", "toString", "(", ")", "+", "\"\"", ",", "ncdfe", ")", ")", ";", "isBuggered", "=", "true", ";", "}", "}", "}", ";", "if", "(", "isFirstScan", ")", "{", "compilationUnit", ".", "addPhaseOperation", "(", "suOp", ",", "transformAnnotation", ".", "phase", "(", ")", ".", "getPhaseNumber", "(", ")", ")", ";", "}", "else", "{", "compilationUnit", ".", "addNewPhaseOperation", "(", "suOp", ",", "transformAnnotation", ".", "phase", "(", ")", ".", "getPhaseNumber", "(", ")", ")", ";", "}", "}", "catch", "(", "Throwable", "t", ")", "{", "compilationUnit", ".", "getErrorCollector", "(", ")", ".", "addError", "(", "new", "SimpleMessage", "(", "\"\"", "+", "t", ".", "getMessage", "(", ")", ",", "null", ")", ")", ";", "t", ".", "printStackTrace", "(", ")", ";", "}", "}", "else", "{", "compilationUnit", ".", "getErrorCollector", "(", ")", ".", "addError", "(", "new", "SimpleMessage", "(", "\"\"", "+", "entry", ".", "getKey", "(", ")", "+", "\"\"", "+", "entry", ".", "getValue", "(", ")", ".", "toExternalForm", "(", ")", "+", "\"\"", ",", "null", ")", ")", ";", "}", "}", "catch", "(", "Exception", "e", ")", "{", "compilationUnit", ".", "getErrorCollector", "(", ")", ".", "addError", "(", "new", "SimpleMessage", "(", "\"\"", "+", "entry", ".", "getKey", "(", ")", "+", "\"\"", "+", "entry", ".", "getValue", "(", ")", ".", "toExternalForm", "(", ")", "+", "\"\"", "+", "e", ".", "toString", "(", ")", ",", "null", ")", ")", ";", "}", "}", "}", "}", "</s>" ]
6,678
[ "<s>", "package", "org", ".", "codehaus", ".", "groovy", ".", "transform", ";", "import", "groovy", ".", "lang", ".", "GroovyClassLoader", ";", "import", "java", ".", "lang", ".", "annotation", ".", "Annotation", ";", "import", "java", ".", "lang", ".", "reflect", ".", "Method", ";", "import", "java", ".", "util", ".", "List", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "AnnotatedNode", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "AnnotationNode", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "ClassCodeVisitorSupport", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "ClassNode", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "expr", ".", "ClassExpression", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "expr", ".", "ConstantExpression", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "expr", ".", "Expression", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "expr", ".", "ListExpression", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "control", ".", "SourceUnit", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "control", ".", "messages", ".", "SimpleMessage", ";", "public", "class", "ASTTransformationCollectorCodeVisitor", "extends", "ClassCodeVisitorSupport", "{", "private", "SourceUnit", "source", ";", "private", "ClassNode", "classNode", ";", "private", "GroovyClassLoader", "transformLoader", ";", "public", "ASTTransformationCollectorCodeVisitor", "(", "SourceUnit", "source", ",", "GroovyClassLoader", "transformLoader", ")", "{", "this", ".", "source", "=", "source", ";", "this", ".", "transformLoader", "=", "transformLoader", ";", "}", "protected", "SourceUnit", "getSourceUnit", "(", ")", "{", "return", "source", ";", "}", "public", "void", "visitClass", "(", "ClassNode", "klassNode", ")", "{", "ClassNode", "oldClass", "=", "classNode", ";", "classNode", "=", "klassNode", ";", "super", ".", "visitClass", "(", "classNode", ")", ";", "classNode", "=", "oldClass", ";", "}", "private", "final", "static", "String", "[", "]", "NONE", "=", "new", "String", "[", "0", "]", ";", "private", "final", "static", "Class", "[", "]", "NO_CLASSES", "=", "new", "Class", "[", "0", "]", ";", "private", "String", "[", "]", "getTransformClassNames", "(", "ClassNode", "cn", ")", "{", "if", "(", "!", "cn", ".", "hasClass", "(", ")", ")", "{", "List", "<", "AnnotationNode", ">", "annotations", "=", "cn", ".", "getAnnotations", "(", ")", ";", "AnnotationNode", "transformAnnotation", "=", "null", ";", "for", "(", "AnnotationNode", "anno", ":", "annotations", ")", "{", "if", "(", "anno", ".", "getClassNode", "(", ")", ".", "getName", "(", ")", ".", "equals", "(", "GroovyASTTransformationClass", ".", "class", ".", "getName", "(", ")", ")", ")", "{", "transformAnnotation", "=", "anno", ";", "break", ";", "}", "}", "if", "(", "transformAnnotation", "!=", "null", ")", "{", "Expression", "expr2", "=", "transformAnnotation", ".", "getMember", "(", "\"value\"", ")", ";", "String", "[", "]", "values", "=", "null", ";", "if", "(", "expr2", "==", "null", ")", "{", "return", "NONE", ";", "}", "if", "(", "expr2", "instanceof", "ListExpression", ")", "{", "ListExpression", "expression", "=", "(", "ListExpression", ")", "expr2", ";", "List", "<", "Expression", ">", "expressions", "=", "expression", ".", "getExpressions", "(", ")", ";", "values", "=", "new", "String", "[", "expressions", ".", "size", "(", ")", "]", ";", "int", "e", "=", "0", ";", "for", "(", "Expression", "expr", ":", "expressions", ")", "{", "values", "[", "e", "++", "]", "=", "(", "(", "ConstantExpression", ")", "expr", ")", ".", "getText", "(", ")", ";", "}", "}", "else", "if", "(", "expr2", "instanceof", "ConstantExpression", ")", "{", "values", "=", "new", "String", "[", "1", "]", ";", "values", "[", "0", "]", "=", "(", "(", "ConstantExpression", ")", "expr2", ")", ".", "getText", "(", ")", ";", "}", "else", "{", "throw", "new", "IllegalStateException", "(", "\"\"", "+", "expr2", "+", "\"", "(class=\"", "+", "expr2", ".", "getClass", "(", ")", ".", "getName", "(", ")", "+", "\")\"", ")", ";", "}", "return", "values", ";", "}", "return", "null", ";", "}", "else", "{", "Annotation", "transformClassAnnotation", "=", "getTransformClassAnnotation", "(", "cn", ")", ";", "if", "(", "transformClassAnnotation", "==", "null", ")", "{", "return", "null", ";", "}", "return", "getTransformClassNames", "(", "transformClassAnnotation", ")", ";", "}", "}", "private", "Class", "[", "]", "getTransformClasses", "(", "ClassNode", "classNode", ")", "{", "if", "(", "!", "classNode", ".", "hasClass", "(", ")", ")", "{", "List", "<", "AnnotationNode", ">", "annotations", "=", "classNode", ".", "getAnnotations", "(", ")", ";", "AnnotationNode", "transformAnnotation", "=", "null", ";", "for", "(", "AnnotationNode", "anno", ":", "annotations", ")", "{", "if", "(", "anno", ".", "getClassNode", "(", ")", ".", "getName", "(", ")", ".", "equals", "(", "GroovyASTTransformationClass", ".", "class", ".", "getName", "(", ")", ")", ")", "{", "transformAnnotation", "=", "anno", ";", "break", ";", "}", "}", "if", "(", "transformAnnotation", "!=", "null", ")", "{", "Expression", "expr", "=", "(", "Expression", ")", "transformAnnotation", ".", "getMember", "(", "\"classes\"", ")", ";", "if", "(", "expr", "==", "null", ")", "{", "return", "NO_CLASSES", ";", "}", "Class", "[", "]", "values", "=", "NO_CLASSES", ";", "if", "(", "expr", "instanceof", "ListExpression", ")", "{", "ListExpression", "expression", "=", "(", "ListExpression", ")", "expr", ";", "List", "<", "Expression", ">", "expressions", "=", "expression", ".", "getExpressions", "(", ")", ";", "values", "=", "new", "Class", "[", "expressions", ".", "size", "(", ")", "]", ";", "int", "e", "=", "0", ";", "for", "(", "Expression", "oneExpr", ":", "expressions", ")", "{", "String", "classname", "=", "(", "(", "ClassExpression", ")", "oneExpr", ")", ".", "getType", "(", ")", ".", "getName", "(", ")", ";", "try", "{", "values", "[", "e", "++", "]", "=", "Class", ".", "forName", "(", "classname", ",", "false", ",", "transformLoader", ")", ";", "}", "catch", "(", "ClassNotFoundException", "cnfe", ")", "{", "source", ".", "getErrorCollector", "(", ")", ".", "addError", "(", "new", "SimpleMessage", "(", "\"\"", "+", "classname", ",", "source", ")", ")", ";", "}", "}", "return", "values", ";", "}", "else", "{", "}", "throw", "new", "RuntimeException", "(", "\"\"", "+", "expr", "+", "\"", "(class=\"", "+", "expr", ".", "getClass", "(", ")", "+", "\")\"", ")", ";", "}", "return", "null", ";", "}", "else", "{", "Annotation", "transformClassAnnotation", "=", "getTransformClassAnnotation", "(", "classNode", ")", ";", "if", "(", "transformClassAnnotation", "==", "null", ")", "{", "return", "null", ";", "}", "return", "getTransformClasses", "(", "transformClassAnnotation", ")", ";", "}", "}", "public", "void", "visitAnnotations", "(", "AnnotatedNode", "node", ")", "{", "super", ".", "visitAnnotations", "(", "node", ")", ";", "for", "(", "AnnotationNode", "annotation", ":", "node", ".", "getAnnotations", "(", ")", ")", "{", "String", "[", "]", "transformClassNames", "=", "getTransformClassNames", "(", "annotation", ".", "getClassNode", "(", ")", ")", ";", "Class", "[", "]", "transformClasses", "=", "getTransformClasses", "(", "annotation", ".", "getClassNode", "(", ")", ")", ";", "if", "(", "transformClassNames", "==", "null", "&&", "transformClasses", "==", "null", ")", "{", "continue", ";", "}", "if", "(", "transformClassNames", "==", "null", ")", "{", "transformClassNames", "=", "NONE", ";", "}", "if", "(", "transformClasses", "==", "null", ")", "{", "transformClasses", "=", "NO_CLASSES", ";", "}", "addTransformsToClassNode", "(", "annotation", ",", "transformClassNames", ",", "transformClasses", ")", ";", "}", "}", "private", "void", "addTransformsToClassNode", "(", "AnnotationNode", "annotation", ",", "Annotation", "transformClassAnnotation", ")", "{", "String", "[", "]", "transformClassNames", "=", "getTransformClassNames", "(", "annotation", ".", "getClassNode", "(", ")", ")", ";", "Class", "[", "]", "transformClasses", "=", "getTransformClasses", "(", "transformClassAnnotation", ")", ";", "addTransformsToClassNode", "(", "annotation", ",", "transformClassNames", ",", "transformClasses", ")", ";", "}", "private", "void", "addTransformsToClassNode", "(", "AnnotationNode", "annotation", ",", "String", "[", "]", "transformClassNames", ",", "Class", "[", "]", "transformClasses", ")", "{", "if", "(", "transformClassNames", ".", "length", "==", "0", "&&", "transformClasses", ".", "length", "==", "0", ")", "{", "source", ".", "getErrorCollector", "(", ")", ".", "addError", "(", "new", "SimpleMessage", "(", "\"\"", "+", "annotation", ".", "getClassNode", "(", ")", ".", "getName", "(", ")", "+", "\"\"", ",", "source", ")", ")", ";", "}", "if", "(", "transformClassNames", ".", "length", ">", "0", "&&", "transformClasses", ".", "length", ">", "0", ")", "{", "source", ".", "getErrorCollector", "(", ")", ".", "addError", "(", "new", "SimpleMessage", "(", "\"\"", "+", "annotation", ".", "getClassNode", "(", ")", ".", "getName", "(", ")", "+", "\"\"", ",", "source", ")", ")", ";", "}", "for", "(", "String", "transformClass", ":", "transformClassNames", ")", "{", "try", "{", "Class", "klass", "=", "transformLoader", ".", "loadClass", "(", "transformClass", ",", "false", ",", "true", ",", "false", ")", ";", "verifyClassAndAddTransform", "(", "annotation", ",", "klass", ")", ";", "}", "catch", "(", "ClassNotFoundException", "e", ")", "{", "source", ".", "getErrorCollector", "(", ")", ".", "addErrorAndContinue", "(", "new", "SimpleMessage", "(", "\"\"", "+", "transformClass", "+", "\"\"", "+", "annotation", ".", "getClassNode", "(", ")", ".", "getName", "(", ")", ",", "source", ")", ")", ";", "}", "}", "for", "(", "Class", "klass", ":", "transformClasses", ")", "{", "verifyClassAndAddTransform", "(", "annotation", ",", "klass", ")", ";", "}", "}", "private", "void", "verifyClassAndAddTransform", "(", "AnnotationNode", "annotation", ",", "Class", "klass", ")", "{", "if", "(", "ASTTransformation", ".", "class", ".", "isAssignableFrom", "(", "klass", ")", ")", "{", "classNode", ".", "addTransform", "(", "klass", ",", "annotation", ")", ";", "}", "else", "{", "source", ".", "getErrorCollector", "(", ")", ".", "addError", "(", "new", "SimpleMessage", "(", "\"\"", "+", "klass", ".", "getName", "(", ")", "+", "\"\"", "+", "annotation", ".", "getClassNode", "(", ")", ".", "getName", "(", ")", ",", "source", ")", ")", ";", "}", "}", "private", "static", "Annotation", "getTransformClassAnnotation", "(", "ClassNode", "annotatedType", ")", "{", "if", "(", "!", "annotatedType", ".", "isResolved", "(", ")", ")", "return", "null", ";", "for", "(", "Annotation", "ann", ":", "annotatedType", ".", "getTypeClass", "(", ")", ".", "getAnnotations", "(", ")", ")", "{", "if", "(", "ann", ".", "annotationType", "(", ")", ".", "getName", "(", ")", ".", "equals", "(", "GroovyASTTransformationClass", ".", "class", ".", "getName", "(", ")", ")", ")", "{", "return", "ann", ";", "}", "}", "return", "null", ";", "}", "private", "String", "[", "]", "getTransformClassNames", "(", "Annotation", "transformClassAnnotation", ")", "{", "try", "{", "Method", "valueMethod", "=", "transformClassAnnotation", ".", "getClass", "(", ")", ".", "getMethod", "(", "\"value\"", ")", ";", "return", "(", "String", "[", "]", ")", "valueMethod", ".", "invoke", "(", "transformClassAnnotation", ")", ";", "}", "catch", "(", "Exception", "e", ")", "{", "source", ".", "addException", "(", "e", ")", ";", "return", "new", "String", "[", "0", "]", ";", "}", "}", "private", "Class", "[", "]", "getTransformClasses", "(", "Annotation", "transformClassAnnotation", ")", "{", "try", "{", "Method", "classesMethod", "=", "transformClassAnnotation", ".", "getClass", "(", ")", ".", "getMethod", "(", "\"classes\"", ")", ";", "return", "(", "Class", "[", "]", ")", "classesMethod", ".", "invoke", "(", "transformClassAnnotation", ")", ";", "}", "catch", "(", "Exception", "e", ")", "{", "source", ".", "addException", "(", "e", ")", ";", "return", "new", "Class", "[", "0", "]", ";", "}", "}", "}", "</s>" ]
6,679
[ "<s>", "package", "org", ".", "codehaus", ".", "groovy", ".", "tools", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "ClassNode", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "control", ".", "SourceUnit", ";", "public", "class", "GroovyClass", "{", "public", "static", "final", "GroovyClass", "[", "]", "EMPTY_ARRAY", "=", "new", "GroovyClass", "[", "0", "]", ";", "private", "String", "name", ";", "private", "byte", "[", "]", "bytes", ";", "private", "ClassNode", "classNode", ";", "private", "SourceUnit", "source", ";", "public", "GroovyClass", "(", "String", "name", ",", "byte", "[", "]", "bytes", ",", "ClassNode", "classNode", ",", "SourceUnit", "source", ")", "{", "this", ".", "name", "=", "name", ";", "this", ".", "bytes", "=", "bytes", ";", "this", ".", "classNode", "=", "classNode", ";", "this", ".", "source", "=", "source", ";", "}", "public", "String", "getName", "(", ")", "{", "return", "this", ".", "name", ";", "}", "public", "byte", "[", "]", "getBytes", "(", ")", "{", "return", "this", ".", "bytes", ";", "}", "public", "SourceUnit", "getSourceUnit", "(", ")", "{", "return", "source", ";", "}", "public", "ClassNode", "getClassNode", "(", ")", "{", "return", "classNode", ";", "}", "}", "</s>" ]
6,680
[ "<s>", "package", "org", ".", "codehaus", ".", "groovy", ".", "control", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "antlr", ".", "AntlrParserPluginFactory", ";", "public", "abstract", "class", "ParserPluginFactory", "{", "public", "static", "ParserPluginFactory", "newInstance", "(", "boolean", "useNewParser", ")", "{", "if", "(", "useNewParser", ")", "{", "Class", "type", "=", "null", ";", "String", "name", "=", "\"\"", ";", "try", "{", "type", "=", "Class", ".", "forName", "(", "name", ")", ";", "}", "catch", "(", "ClassNotFoundException", "e", ")", "{", "try", "{", "type", "=", "ParserPluginFactory", ".", "class", ".", "getClassLoader", "(", ")", ".", "loadClass", "(", "name", ")", ";", "}", "catch", "(", "ClassNotFoundException", "e1", ")", "{", "ClassLoader", "contextClassLoader", "=", "Thread", ".", "currentThread", "(", ")", ".", "getContextClassLoader", "(", ")", ";", "if", "(", "contextClassLoader", "!=", "null", ")", "{", "try", "{", "type", "=", "contextClassLoader", ".", "loadClass", "(", "name", ")", ";", "}", "catch", "(", "ClassNotFoundException", "e2", ")", "{", "}", "}", "}", "}", "if", "(", "type", "!=", "null", ")", "{", "try", "{", "return", "(", "ParserPluginFactory", ")", "type", ".", "newInstance", "(", ")", ";", "}", "catch", "(", "Exception", "e", ")", "{", "throw", "new", "RuntimeException", "(", "\"\"", "+", "e", ",", "e", ")", ";", "}", "}", "}", "return", "new", "AntlrParserPluginFactory", "(", ")", ";", "}", "public", "abstract", "ParserPlugin", "createParserPlugin", "(", ")", ";", "}", "</s>" ]
6,681
[ "<s>", "package", "org", ".", "codehaus", ".", "groovy", ".", "control", ".", "customizers", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "ClassNode", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "classgen", ".", "GeneratorContext", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "control", ".", "CompilationFailedException", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "control", ".", "SourceUnit", ";", "public", "class", "ImportCustomizer", "extends", "CompilationCustomizer", "{", "public", "ImportCustomizer", "(", ")", "{", "super", "(", "null", ")", ";", "}", "@", "Override", "public", "void", "call", "(", "final", "SourceUnit", "source", ",", "final", "GeneratorContext", "context", ",", "final", "ClassNode", "classNode", ")", "throws", "CompilationFailedException", "{", "throw", "new", "IllegalStateException", "(", "\"\"", ")", ";", "}", "public", "ImportCustomizer", "addImport", "(", "final", "String", "alias", ",", "final", "String", "className", ")", "{", "throw", "new", "IllegalStateException", "(", "\"\"", ")", ";", "}", "public", "ImportCustomizer", "addStaticImport", "(", "final", "String", "className", ",", "final", "String", "fieldName", ")", "{", "throw", "new", "IllegalStateException", "(", "\"\"", ")", ";", "}", "public", "ImportCustomizer", "addStaticStars", "(", "final", "String", "...", "classNames", ")", "{", "throw", "new", "IllegalStateException", "(", "\"\"", ")", ";", "}", "public", "ImportCustomizer", "addStaticImport", "(", "final", "String", "alias", ",", "final", "String", "className", ",", "final", "String", "fieldName", ")", "{", "throw", "new", "IllegalStateException", "(", "\"\"", ")", ";", "}", "public", "ImportCustomizer", "addImports", "(", "final", "String", "...", "imports", ")", "{", "throw", "new", "IllegalStateException", "(", "\"\"", ")", ";", "}", "public", "ImportCustomizer", "addStarImports", "(", "final", "String", "...", "packageNames", ")", "{", "throw", "new", "IllegalStateException", "(", "\"\"", ")", ";", "}", "}", "</s>" ]
6,682
[ "<s>", "package", "org", ".", "codehaus", ".", "groovy", ".", "control", ".", "customizers", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "control", ".", "CompilationUnit", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "control", ".", "CompilePhase", ";", "public", "abstract", "class", "CompilationCustomizer", "extends", "CompilationUnit", ".", "PrimaryClassNodeOperation", "{", "public", "CompilationCustomizer", "(", "CompilePhase", "phase", ")", "{", "throw", "new", "IllegalStateException", "(", "\"\"", ")", ";", "}", "public", "CompilePhase", "getPhase", "(", ")", "{", "throw", "new", "IllegalStateException", "(", "\"\"", ")", ";", "}", "}", "</s>" ]
6,683
[ "<s>", "package", "org", ".", "codehaus", ".", "groovy", ".", "control", ".", "customizers", ";", "import", "java", ".", "lang", ".", "annotation", ".", "Annotation", ";", "import", "java", ".", "util", ".", "Map", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "ClassNode", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "classgen", ".", "GeneratorContext", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "control", ".", "SourceUnit", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "transform", ".", "ASTTransformation", ";", "@", "SuppressWarnings", "(", "\"rawtypes\"", ")", "public", "class", "ASTTransformationCustomizer", "extends", "CompilationCustomizer", "{", "public", "ASTTransformationCustomizer", "(", "final", "Class", "<", "?", "extends", "Annotation", ">", "transformationAnnotation", ")", "{", "super", "(", "null", ")", ";", "throw", "new", "IllegalStateException", "(", "\"\"", ")", ";", "}", "public", "ASTTransformationCustomizer", "(", "final", "ASTTransformation", "transformation", ")", "{", "super", "(", "null", ")", ";", "throw", "new", "IllegalStateException", "(", "\"\"", ")", ";", "}", "ASTTransformationCustomizer", "(", "final", "Map", "annotationParams", ",", "final", "Class", "<", "?", "extends", "Annotation", ">", "transformationAnnotation", ")", "{", "super", "(", "null", ")", ";", "throw", "new", "IllegalStateException", "(", "\"\"", ")", ";", "}", "ASTTransformationCustomizer", "(", "final", "Map", "annotationParams", ",", "final", "ASTTransformation", "transformation", ")", "{", "super", "(", "null", ")", ";", "throw", "new", "IllegalStateException", "(", "\"\"", ")", ";", "}", "public", "void", "setAnnotationParameters", "(", "Map", "<", "String", ",", "Object", ">", "params", ")", "{", "throw", "new", "IllegalStateException", "(", "\"\"", ")", ";", "}", "@", "Override", "public", "void", "call", "(", "SourceUnit", "source", ",", "GeneratorContext", "context", ",", "ClassNode", "classNode", ")", "{", "throw", "new", "IllegalStateException", "(", "\"\"", ")", ";", "}", "}", "</s>" ]
6,684
[ "<s>", "package", "org", ".", "codehaus", ".", "groovy", ".", "control", ";", "import", "groovy", ".", "lang", ".", "GroovyClassLoader", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "*", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "expr", ".", "*", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "stmt", ".", "BlockStatement", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "stmt", ".", "CatchStatement", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "stmt", ".", "ForStatement", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "stmt", ".", "Statement", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "classgen", ".", "Verifier", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "control", ".", "messages", ".", "ExceptionMessage", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "syntax", ".", "Types", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "GroovyBugError", ";", "import", "org", ".", "objectweb", ".", "asm", ".", "Opcodes", ";", "import", "java", ".", "io", ".", "File", ";", "import", "java", ".", "io", ".", "IOException", ";", "import", "java", ".", "lang", ".", "annotation", ".", "Retention", ";", "import", "java", ".", "lang", ".", "annotation", ".", "RetentionPolicy", ";", "import", "java", ".", "lang", ".", "reflect", ".", "Modifier", ";", "import", "java", ".", "net", ".", "MalformedURLException", ";", "import", "java", ".", "net", ".", "URL", ";", "import", "java", ".", "net", ".", "URLConnection", ";", "import", "java", ".", "util", ".", "*", ";", "public", "class", "ResolveVisitor", "extends", "ClassCodeExpressionTransformer", "{", "public", "ClassNode", "currentClass", ";", "public", "static", "final", "String", "[", "]", "DEFAULT_IMPORTS", "=", "{", "\"java.lang.\"", ",", "\"java.io.\"", ",", "\"java.net.\"", ",", "\"java.util.\"", ",", "\"groovy.lang.\"", ",", "\"groovy.util.\"", "}", ";", "public", "CompilationUnit", "compilationUnit", ";", "private", "Map", "cachedClasses", "=", "new", "HashMap", "(", ")", ";", "private", "static", "final", "Object", "NO_CLASS", "=", "new", "Object", "(", ")", ";", "private", "SourceUnit", "source", ";", "private", "VariableScope", "currentScope", ";", "private", "boolean", "isTopLevelProperty", "=", "true", ";", "private", "boolean", "inPropertyExpression", "=", "false", ";", "private", "boolean", "inClosure", "=", "false", ";", "private", "boolean", "isSpecialConstructorCall", "=", "false", ";", "private", "Map", "<", "String", ",", "GenericsType", ">", "genericParameterNames", "=", "new", "HashMap", "<", "String", ",", "GenericsType", ">", "(", ")", ";", "private", "Set", "<", "FieldNode", ">", "fieldTypesChecked", "=", "new", "HashSet", "<", "FieldNode", ">", "(", ")", ";", "private", "boolean", "checkingVariableTypeInDeclaration", "=", "false", ";", "private", "ImportNode", "currImportNode", "=", "null", ";", "public", "static", "class", "ConstructedClassWithPackage", "extends", "ClassNode", "{", "String", "prefix", ";", "String", "className", ";", "public", "ConstructedClassWithPackage", "(", "String", "pkg", ",", "String", "name", ")", "{", "super", "(", "pkg", "+", "name", ",", "Opcodes", ".", "ACC_PUBLIC", ",", "ClassHelper", ".", "OBJECT_TYPE", ")", ";", "isPrimaryNode", "=", "false", ";", "this", ".", "prefix", "=", "pkg", ";", "this", ".", "className", "=", "name", ";", "}", "public", "String", "getName", "(", ")", "{", "if", "(", "redirect", "(", ")", "!=", "this", ")", "return", "super", ".", "getName", "(", ")", ";", "return", "prefix", "+", "className", ";", "}", "public", "boolean", "hasPackageName", "(", ")", "{", "if", "(", "redirect", "(", ")", "!=", "this", ")", "return", "super", ".", "hasPackageName", "(", ")", ";", "return", "className", ".", "indexOf", "(", "'.'", ")", "!=", "-", "1", ";", "}", "public", "String", "setName", "(", "String", "name", ")", "{", "if", "(", "redirect", "(", ")", "!=", "this", ")", "{", "return", "super", ".", "setName", "(", "name", ")", ";", "}", "else", "{", "throw", "new", "GroovyBugError", "(", "\"\"", ")", ";", "}", "}", "}", "public", "static", "class", "LowerCaseClass", "extends", "ClassNode", "{", "String", "className", ";", "public", "LowerCaseClass", "(", "String", "name", ")", "{", "super", "(", "name", ",", "Opcodes", ".", "ACC_PUBLIC", ",", "ClassHelper", ".", "OBJECT_TYPE", ")", ";", "isPrimaryNode", "=", "false", ";", "this", ".", "className", "=", "name", ";", "}", "public", "String", "getName", "(", ")", "{", "if", "(", "redirect", "(", ")", "!=", "this", ")", "return", "super", ".", "getName", "(", ")", ";", "return", "className", ";", "}", "public", "boolean", "hasPackageName", "(", ")", "{", "if", "(", "redirect", "(", ")", "!=", "this", ")", "return", "super", ".", "hasPackageName", "(", ")", ";", "return", "false", ";", "}", "public", "String", "setName", "(", "String", "name", ")", "{", "if", "(", "redirect", "(", ")", "!=", "this", ")", "{", "return", "super", ".", "setName", "(", "name", ")", ";", "}", "else", "{", "throw", "new", "GroovyBugError", "(", "\"\"", ")", ";", "}", "}", "}", "public", "ResolveVisitor", "(", "CompilationUnit", "cu", ")", "{", "compilationUnit", "=", "cu", ";", "}", "public", "void", "startResolving", "(", "ClassNode", "node", ",", "SourceUnit", "source", ")", "{", "this", ".", "source", "=", "source", ";", "visitClass", "(", "node", ")", ";", "}", "protected", "void", "visitConstructorOrMethod", "(", "MethodNode", "node", ",", "boolean", "isConstructor", ")", "{", "VariableScope", "oldScope", "=", "currentScope", ";", "currentScope", "=", "node", ".", "getVariableScope", "(", ")", ";", "Map", "<", "String", ",", "GenericsType", ">", "oldPNames", "=", "genericParameterNames", ";", "genericParameterNames", "=", "new", "HashMap", "<", "String", ",", "GenericsType", ">", "(", "genericParameterNames", ")", ";", "resolveGenericsHeader", "(", "node", ".", "getGenericsTypes", "(", ")", ")", ";", "Parameter", "[", "]", "paras", "=", "node", ".", "getParameters", "(", ")", ";", "for", "(", "Parameter", "p", ":", "paras", ")", "{", "p", ".", "setInitialExpression", "(", "transform", "(", "p", ".", "getInitialExpression", "(", ")", ")", ")", ";", "resolveOrFail", "(", "p", ".", "getType", "(", ")", ",", "p", ".", "getType", "(", ")", ")", ";", "visitAnnotations", "(", "p", ")", ";", "}", "ClassNode", "[", "]", "exceptions", "=", "node", ".", "getExceptions", "(", ")", ";", "for", "(", "ClassNode", "t", ":", "exceptions", ")", "{", "resolveOrFail", "(", "t", ",", "node", ")", ";", "}", "resolveOrFail", "(", "node", ".", "getReturnType", "(", ")", ",", "node", ")", ";", "super", ".", "visitConstructorOrMethod", "(", "node", ",", "isConstructor", ")", ";", "genericParameterNames", "=", "oldPNames", ";", "currentScope", "=", "oldScope", ";", "}", "public", "void", "visitField", "(", "FieldNode", "node", ")", "{", "ClassNode", "t", "=", "node", ".", "getType", "(", ")", ";", "if", "(", "!", "fieldTypesChecked", ".", "contains", "(", "node", ")", ")", "{", "resolveOrFail", "(", "t", ",", "node", ")", ";", "}", "super", ".", "visitField", "(", "node", ")", ";", "}", "public", "void", "visitProperty", "(", "PropertyNode", "node", ")", "{", "ClassNode", "t", "=", "node", ".", "getType", "(", ")", ";", "resolveOrFail", "(", "t", ",", "node", ")", ";", "super", ".", "visitProperty", "(", "node", ")", ";", "fieldTypesChecked", ".", "add", "(", "node", ".", "getField", "(", ")", ")", ";", "}", "protected", "boolean", "resolveToInner", "(", "ClassNode", "type", ")", "{", "if", "(", "type", "instanceof", "ConstructedClassWithPackage", ")", "return", "false", ";", "String", "name", "=", "type", ".", "getName", "(", ")", ";", "String", "saved", "=", "name", ";", "while", "(", "true", ")", "{", "int", "len", "=", "name", ".", "lastIndexOf", "(", "'.'", ")", ";", "if", "(", "len", "==", "-", "1", ")", "break", ";", "name", "=", "name", ".", "substring", "(", "0", ",", "len", ")", "+", "\"$\"", "+", "name", ".", "substring", "(", "len", "+", "1", ")", ";", "type", ".", "setName", "(", "name", ")", ";", "if", "(", "resolve", "(", "type", ")", ")", "return", "true", ";", "}", "if", "(", "resolveToInnerEnum", "(", "type", ")", ")", "return", "true", ";", "type", ".", "setName", "(", "saved", ")", ";", "return", "false", ";", "}", "protected", "boolean", "resolveToInnerEnum", "(", "ClassNode", "type", ")", "{", "String", "name", "=", "type", ".", "getName", "(", ")", ";", "if", "(", "currentClass", "!=", "type", "&&", "!", "name", ".", "contains", "(", "\".\"", ")", "&&", "type", ".", "getClass", "(", ")", ".", "equals", "(", "ClassNode", ".", "class", ")", ")", "{", "type", ".", "setName", "(", "currentClass", ".", "getName", "(", ")", "+", "\"$\"", "+", "name", ")", ";", "if", "(", "resolve", "(", "type", ")", ")", "return", "true", ";", "}", "return", "false", ";", "}", "private", "void", "resolveOrFail", "(", "ClassNode", "type", ",", "String", "msg", ",", "ASTNode", "node", ")", "{", "if", "(", "resolve", "(", "type", ")", ")", "return", ";", "if", "(", "resolveToInner", "(", "type", ")", ")", "return", ";", "addError", "(", "\"\"", "+", "type", ".", "getName", "(", ")", "+", "\"", "\"", "+", "msg", ",", "node", ")", ";", "}", "private", "void", "resolveOrFail", "(", "ClassNode", "type", ",", "ASTNode", "node", ",", "boolean", "prefereImports", ")", "{", "resolveGenericsTypes", "(", "type", ".", "getGenericsTypes", "(", ")", ")", ";", "if", "(", "prefereImports", "&&", "resolveAliasFromModule", "(", "type", ")", ")", "return", ";", "resolveOrFail", "(", "type", ",", "node", ")", ";", "}", "private", "void", "resolveOrFail", "(", "ClassNode", "type", ",", "ASTNode", "node", ")", "{", "resolveOrFail", "(", "type", ",", "\"\"", ",", "node", ")", ";", "}", "protected", "boolean", "resolve", "(", "ClassNode", "type", ")", "{", "return", "resolve", "(", "type", ",", "true", ",", "true", ",", "true", ")", ";", "}", "protected", "boolean", "resolve", "(", "ClassNode", "type", ",", "boolean", "testModuleImports", ",", "boolean", "testDefaultImports", ",", "boolean", "testStaticInnerClasses", ")", "{", "resolveGenericsTypes", "(", "type", ".", "getGenericsTypes", "(", ")", ")", ";", "if", "(", "type", ".", "isResolved", "(", ")", "||", "type", ".", "isPrimaryClassNode", "(", ")", ")", "return", "true", ";", "if", "(", "type", ".", "isArray", "(", ")", ")", "{", "ClassNode", "element", "=", "type", ".", "getComponentType", "(", ")", ";", "boolean", "resolved", "=", "resolve", "(", "element", ",", "testModuleImports", ",", "testDefaultImports", ",", "testStaticInnerClasses", ")", ";", "if", "(", "resolved", ")", "{", "ClassNode", "cn", "=", "element", ".", "makeArray", "(", ")", ";", "type", ".", "setRedirect", "(", "cn", ")", ";", "}", "return", "resolved", ";", "}", "if", "(", "currentClass", "==", "type", ")", "return", "true", ";", "if", "(", "genericParameterNames", ".", "get", "(", "type", ".", "getName", "(", ")", ")", "!=", "null", ")", "{", "GenericsType", "gt", "=", "genericParameterNames", ".", "get", "(", "type", ".", "getName", "(", ")", ")", ";", "type", ".", "setRedirect", "(", "gt", ".", "getType", "(", ")", ")", ";", "type", ".", "setGenericsTypes", "(", "new", "GenericsType", "[", "]", "{", "gt", "}", ")", ";", "type", ".", "setGenericsPlaceHolder", "(", "true", ")", ";", "return", "true", ";", "}", "if", "(", "currentClass", ".", "getNameWithoutPackage", "(", ")", ".", "equals", "(", "type", ".", "getName", "(", ")", ")", ")", "{", "type", ".", "setRedirect", "(", "currentClass", ")", ";", "return", "true", ";", "}", "return", "resolveNestedClass", "(", "type", ")", "||", "resolveFromModule", "(", "type", ",", "testModuleImports", ")", "||", "resolveFromCompileUnit", "(", "type", ")", "||", "resolveFromDefaultImports", "(", "type", ",", "testDefaultImports", ")", "||", "resolveFromStaticInnerClasses", "(", "type", ",", "testStaticInnerClasses", ")", "||", "resolveToClass", "(", "type", ")", ";", "}", "private", "boolean", "resolveNestedClass", "(", "ClassNode", "type", ")", "{", "Map", "<", "String", ",", "ClassNode", ">", "hierClasses", "=", "new", "LinkedHashMap", "<", "String", ",", "ClassNode", ">", "(", ")", ";", "ClassNode", "val", ";", "String", "name", ";", "for", "(", "ClassNode", "classToCheck", "=", "currentClass", ";", "classToCheck", "!=", "ClassHelper", ".", "OBJECT_TYPE", ";", "classToCheck", "=", "classToCheck", ".", "getSuperClass", "(", ")", ")", "{", "if", "(", "classToCheck", "==", "null", "||", "hierClasses", ".", "containsKey", "(", "classToCheck", ".", "getName", "(", ")", ")", ")", "break", ";", "hierClasses", ".", "put", "(", "classToCheck", ".", "getName", "(", ")", ",", "classToCheck", ")", ";", "}", "for", "(", "ClassNode", "classToCheck", ":", "hierClasses", ".", "values", "(", ")", ")", "{", "if", "(", "classToCheck", ".", "mightHaveInners", "(", ")", ")", "{", "name", "=", "classToCheck", ".", "getName", "(", ")", "+", "\"$\"", "+", "type", ".", "getName", "(", ")", ";", "val", "=", "ClassHelper", ".", "make", "(", "name", ")", ";", "if", "(", "resolveFromCompileUnit", "(", "val", ")", ")", "{", "type", ".", "setRedirect", "(", "val", ")", ";", "return", "true", ";", "}", "}", "}", "if", "(", "!", "(", "currentClass", "instanceof", "InnerClassNode", ")", ")", "return", "false", ";", "LinkedList", "<", "ClassNode", ">", "outerClasses", "=", "new", "LinkedList", "<", "ClassNode", ">", "(", ")", ";", "ClassNode", "outer", "=", "currentClass", ".", "getOuterClass", "(", ")", ";", "while", "(", "outer", "!=", "null", ")", "{", "outerClasses", ".", "addFirst", "(", "outer", ")", ";", "outer", "=", "outer", ".", "getOuterClass", "(", ")", ";", "}", "for", "(", "ClassNode", "testNode", ":", "outerClasses", ")", "{", "name", "=", "testNode", ".", "getName", "(", ")", "+", "\"$\"", "+", "type", ".", "getName", "(", ")", ";", "val", "=", "ClassHelper", ".", "make", "(", "name", ")", ";", "if", "(", "resolveFromCompileUnit", "(", "val", ")", ")", "{", "type", ".", "setRedirect", "(", "val", ")", ";", "return", "true", ";", "}", "}", "return", "false", ";", "}", "protected", "boolean", "resolveFromClassCache", "(", "ClassNode", "type", ")", "{", "String", "name", "=", "type", ".", "getName", "(", ")", ";", "Object", "val", "=", "cachedClasses", ".", "get", "(", "name", ")", ";", "if", "(", "val", "==", "null", "||", "val", "==", "NO_CLASS", ")", "{", "return", "false", ";", "}", "else", "{", "type", ".", "setRedirect", "(", "(", "ClassNode", ")", "val", ")", ";", "return", "true", ";", "}", "}", "private", "long", "getTimeStamp", "(", "Class", "cls", ")", "{", "return", "Verifier", ".", "getTimestamp", "(", "cls", ")", ";", "}", "private", "boolean", "isSourceNewer", "(", "URL", "source", ",", "Class", "cls", ")", "{", "try", "{", "long", "lastMod", ";", "if", "(", "source", ".", "getProtocol", "(", ")", ".", "equals", "(", "\"file\"", ")", ")", "{", "String", "path", "=", "source", ".", "getPath", "(", ")", ".", "replace", "(", "'/'", ",", "File", ".", "separatorChar", ")", ".", "replace", "(", "'|'", ",", "':'", ")", ";", "File", "file", "=", "new", "File", "(", "path", ")", ";", "lastMod", "=", "file", ".", "lastModified", "(", ")", ";", "}", "else", "{", "URLConnection", "conn", "=", "source", ".", "openConnection", "(", ")", ";", "lastMod", "=", "conn", ".", "getLastModified", "(", ")", ";", "conn", ".", "getInputStream", "(", ")", ".", "close", "(", ")", ";", "}", "return", "lastMod", ">", "getTimeStamp", "(", "cls", ")", ";", "}", "catch", "(", "IOException", "e", ")", "{", "return", "false", ";", "}", "}", "protected", "boolean", "resolveToScript", "(", "ClassNode", "type", ")", "{", "String", "name", "=", "type", ".", "getName", "(", ")", ";", "if", "(", "name", ".", "startsWith", "(", "\"java.\"", ")", ")", "return", "type", ".", "isResolved", "(", ")", ";", "if", "(", "name", ".", "indexOf", "(", "'$'", ")", "!=", "-", "1", ")", "return", "type", ".", "isResolved", "(", ")", ";", "ModuleNode", "module", "=", "currentClass", ".", "getModule", "(", ")", ";", "if", "(", "module", ".", "hasPackageName", "(", ")", "&&", "name", ".", "indexOf", "(", "'.'", ")", "==", "-", "1", ")", "return", "type", ".", "isResolved", "(", ")", ";", "GroovyClassLoader", "gcl", "=", "compilationUnit", ".", "getClassLoader", "(", ")", ";", "URL", "url", "=", "null", ";", "return", "type", ".", "isResolved", "(", ")", ";", "}", "private", "String", "replaceLastPoint", "(", "String", "name", ")", "{", "int", "lastPoint", "=", "name", ".", "lastIndexOf", "(", "'.'", ")", ";", "name", "=", "new", "StringBuffer", "(", ")", ".", "append", "(", "name", ".", "substring", "(", "0", ",", "lastPoint", ")", ")", ".", "append", "(", "\"$\"", ")", ".", "append", "(", "name", ".", "substring", "(", "lastPoint", "+", "1", ")", ")", ".", "toString", "(", ")", ";", "return", "name", ";", "}", "protected", "boolean", "resolveFromStaticInnerClasses", "(", "ClassNode", "type", ",", "boolean", "testStaticInnerClasses", ")", "{", "if", "(", "type", "instanceof", "LowerCaseClass", ")", "return", "false", ";", "testStaticInnerClasses", "&=", "type", ".", "hasPackageName", "(", ")", ";", "if", "(", "testStaticInnerClasses", ")", "{", "if", "(", "type", "instanceof", "ConstructedClassWithPackage", ")", "{", "ConstructedClassWithPackage", "tmp", "=", "(", "ConstructedClassWithPackage", ")", "type", ";", "String", "savedName", "=", "tmp", ".", "className", ";", "tmp", ".", "className", "=", "replaceLastPoint", "(", "savedName", ")", ";", "if", "(", "resolve", "(", "tmp", ",", "false", ",", "true", ",", "true", ")", ")", "{", "type", ".", "setRedirect", "(", "tmp", ".", "redirect", "(", ")", ")", ";", "return", "true", ";", "}", "tmp", ".", "className", "=", "savedName", ";", "}", "else", "{", "return", "resolveStaticInner", "(", "type", ")", ";", "}", "}", "return", "false", ";", "}", "protected", "boolean", "resolveStaticInner", "(", "ClassNode", "type", ")", "{", "String", "name", "=", "type", ".", "getName", "(", ")", ";", "String", "replacedPointType", "=", "replaceLastPoint", "(", "name", ")", ";", "type", ".", "setName", "(", "replacedPointType", ")", ";", "if", "(", "resolve", "(", "type", ",", "false", ",", "true", ",", "true", ")", ")", "return", "true", ";", "type", ".", "setName", "(", "name", ")", ";", "return", "false", ";", "}", "protected", "boolean", "resolveFromDefaultImports", "(", "ClassNode", "type", ",", "boolean", "testDefaultImports", ")", "{", "testDefaultImports", "&=", "!", "type", ".", "hasPackageName", "(", ")", ";", "testDefaultImports", "&=", "!", "(", "type", "instanceof", "LowerCaseClass", ")", ";", "if", "(", "testDefaultImports", ")", "{", "for", "(", "int", "i", "=", "0", ",", "size", "=", "DEFAULT_IMPORTS", ".", "length", ";", "i", "<", "size", ";", "i", "++", ")", "{", "String", "packagePrefix", "=", "DEFAULT_IMPORTS", "[", "i", "]", ";", "String", "name", "=", "type", ".", "getName", "(", ")", ";", "ConstructedClassWithPackage", "tmp", "=", "new", "ConstructedClassWithPackage", "(", "packagePrefix", ",", "name", ")", ";", "if", "(", "resolve", "(", "tmp", ",", "false", ",", "false", ",", "false", ")", ")", "{", "type", ".", "setRedirect", "(", "tmp", ".", "redirect", "(", ")", ")", ";", "return", "true", ";", "}", "}", "String", "name", "=", "type", ".", "getName", "(", ")", ";", "if", "(", "name", ".", "equals", "(", "\"BigInteger\"", ")", ")", "{", "type", ".", "setRedirect", "(", "ClassHelper", ".", "BigInteger_TYPE", ")", ";", "return", "true", ";", "}", "else", "if", "(", "name", ".", "equals", "(", "\"BigDecimal\"", ")", ")", "{", "type", ".", "setRedirect", "(", "ClassHelper", ".", "BigDecimal_TYPE", ")", ";", "return", "true", ";", "}", "}", "return", "false", ";", "}", "protected", "boolean", "resolveFromCompileUnit", "(", "ClassNode", "type", ")", "{", "CompileUnit", "compileUnit", "=", "currentClass", ".", "getCompileUnit", "(", ")", ";", "if", "(", "compileUnit", "==", "null", ")", "return", "false", ";", "ClassNode", "cuClass", "=", "compileUnit", ".", "getClass", "(", "type", ".", "getName", "(", ")", ")", ";", "if", "(", "cuClass", "!=", "null", ")", "{", "if", "(", "type", "!=", "cuClass", ")", "type", ".", "setRedirect", "(", "cuClass", ")", ";", "return", "true", ";", "}", "return", "false", ";", "}", "private", "void", "ambiguousClass", "(", "ClassNode", "type", ",", "ClassNode", "iType", ",", "String", "name", ")", "{", "if", "(", "type", ".", "getName", "(", ")", ".", "equals", "(", "iType", ".", "getName", "(", ")", ")", ")", "{", "addError", "(", "\"\"", "+", "name", "+", "\"\"", "+", "type", ".", "getName", "(", ")", "+", "\"", "and", "\"", "+", "iType", ".", "getName", "(", ")", "+", "\"", "match\"", ",", "type", ")", ";", "}", "else", "{", "type", ".", "setRedirect", "(", "iType", ")", ";", "}", "}", "private", "boolean", "resolveAliasFromModule", "(", "ClassNode", "type", ")", "{", "if", "(", "type", "instanceof", "ConstructedClassWithPackage", ")", "return", "false", ";", "ModuleNode", "module", "=", "currentClass", ".", "getModule", "(", ")", ";", "if", "(", "module", "==", "null", ")", "return", "false", ";", "String", "name", "=", "type", ".", "getName", "(", ")", ";", "String", "pname", "=", "name", ";", "int", "index", "=", "name", ".", "length", "(", ")", ";", "while", "(", "true", ")", "{", "pname", "=", "name", ".", "substring", "(", "0", ",", "index", ")", ";", "ClassNode", "aliasedNode", "=", "null", ";", "ImportNode", "importNode", "=", "module", ".", "getImport", "(", "pname", ")", ";", "if", "(", "importNode", "!=", "null", "&&", "importNode", "!=", "currImportNode", ")", "{", "aliasedNode", "=", "importNode", ".", "getType", "(", ")", ";", "}", "if", "(", "aliasedNode", "==", "null", ")", "{", "importNode", "=", "module", ".", "getStaticImports", "(", ")", ".", "get", "(", "pname", ")", ";", "if", "(", "importNode", "!=", "null", "&&", "importNode", "!=", "currImportNode", ")", "{", "ClassNode", "tmp", "=", "ClassHelper", ".", "make", "(", "importNode", ".", "getType", "(", ")", ".", "getName", "(", ")", "+", "\"$\"", "+", "importNode", ".", "getFieldName", "(", ")", ")", ";", "if", "(", "resolve", "(", "tmp", ",", "false", ",", "false", ",", "true", ")", ")", "{", "if", "(", "(", "tmp", ".", "getModifiers", "(", ")", "&", "Opcodes", ".", "ACC_STATIC", ")", "!=", "0", ")", "{", "type", ".", "setRedirect", "(", "tmp", ".", "redirect", "(", ")", ")", ";", "return", "true", ";", "}", "}", "}", "}", "if", "(", "aliasedNode", "!=", "null", ")", "{", "if", "(", "pname", ".", "length", "(", ")", "==", "name", ".", "length", "(", ")", ")", "{", "type", ".", "setRedirect", "(", "aliasedNode", ")", ";", "return", "true", ";", "}", "else", "{", "String", "className", "=", "aliasedNode", ".", "getNameWithoutPackage", "(", ")", "+", "'$'", "+", "name", ".", "substring", "(", "pname", ".", "length", "(", ")", "+", "1", ")", ".", "replace", "(", "'.'", ",", "'$'", ")", ";", "ConstructedClassWithPackage", "tmp", "=", "new", "ConstructedClassWithPackage", "(", "aliasedNode", ".", "getPackageName", "(", ")", "+", "\".\"", ",", "className", ")", ";", "if", "(", "resolve", "(", "tmp", ",", "true", ",", "true", ",", "false", ")", ")", "{", "type", ".", "setRedirect", "(", "tmp", ".", "redirect", "(", ")", ")", ";", "return", "true", ";", "}", "}", "}", "index", "=", "pname", ".", "lastIndexOf", "(", "'.'", ")", ";", "if", "(", "index", "==", "-", "1", ")", "break", ";", "}", "return", "false", ";", "}", "protected", "boolean", "resolveFromModule", "(", "ClassNode", "type", ",", "boolean", "testModuleImports", ")", "{", "if", "(", "type", "instanceof", "LowerCaseClass", ")", "{", "return", "resolveAliasFromModule", "(", "type", ")", ";", "}", "String", "name", "=", "type", ".", "getName", "(", ")", ";", "ModuleNode", "module", "=", "currentClass", ".", "getModule", "(", ")", ";", "if", "(", "module", "==", "null", ")", "return", "false", ";", "boolean", "newNameUsed", "=", "false", ";", "if", "(", "!", "type", ".", "hasPackageName", "(", ")", "&&", "module", ".", "hasPackageName", "(", ")", "&&", "!", "(", "type", "instanceof", "ConstructedClassWithPackage", ")", ")", "{", "type", ".", "setName", "(", "module", ".", "getPackageName", "(", ")", "+", "name", ")", ";", "newNameUsed", "=", "true", ";", "}", "List", "<", "ClassNode", ">", "moduleClasses", "=", "module", ".", "getClasses", "(", ")", ";", "for", "(", "ClassNode", "mClass", ":", "moduleClasses", ")", "{", "if", "(", "mClass", ".", "getName", "(", ")", ".", "equals", "(", "type", ".", "getName", "(", ")", ")", ")", "{", "if", "(", "mClass", "!=", "type", ")", "type", ".", "setRedirect", "(", "mClass", ")", ";", "return", "true", ";", "}", "}", "if", "(", "newNameUsed", ")", "type", ".", "setName", "(", "name", ")", ";", "if", "(", "testModuleImports", ")", "{", "if", "(", "resolveAliasFromModule", "(", "type", ")", ")", "return", "true", ";", "if", "(", "module", ".", "hasPackageName", "(", ")", ")", "{", "ConstructedClassWithPackage", "tmp", "=", "new", "ConstructedClassWithPackage", "(", "module", ".", "getPackageName", "(", ")", ",", "name", ")", ";", "if", "(", "resolve", "(", "tmp", ",", "false", ",", "false", ",", "false", ")", ")", "{", "ambiguousClass", "(", "type", ",", "tmp", ",", "name", ")", ";", "type", ".", "setRedirect", "(", "tmp", ".", "redirect", "(", ")", ")", ";", "return", "true", ";", "}", "}", "for", "(", "ImportNode", "importNode", ":", "module", ".", "getStaticImports", "(", ")", ".", "values", "(", ")", ")", "{", "if", "(", "importNode", ".", "getFieldName", "(", ")", ".", "equals", "(", "name", ")", ")", "{", "ClassNode", "tmp", "=", "ClassHelper", ".", "make", "(", "importNode", ".", "getType", "(", ")", ".", "getName", "(", ")", "+", "\"$\"", "+", "name", ")", ";", "if", "(", "resolve", "(", "tmp", ",", "false", ",", "false", ",", "true", ")", ")", "{", "if", "(", "(", "tmp", ".", "getModifiers", "(", ")", "&", "Opcodes", ".", "ACC_STATIC", ")", "!=", "0", ")", "{", "type", ".", "setRedirect", "(", "tmp", ".", "redirect", "(", ")", ")", ";", "return", "true", ";", "}", "}", "}", "}", "for", "(", "ImportNode", "importNode", ":", "module", ".", "getStarImports", "(", ")", ")", "{", "String", "packagePrefix", "=", "importNode", ".", "getPackageName", "(", ")", ";", "ConstructedClassWithPackage", "tmp", "=", "new", "ConstructedClassWithPackage", "(", "packagePrefix", ",", "name", ")", ";", "if", "(", "resolve", "(", "tmp", ",", "false", ",", "false", ",", "true", ")", ")", "{", "ambiguousClass", "(", "type", ",", "tmp", ",", "name", ")", ";", "type", ".", "setRedirect", "(", "tmp", ".", "redirect", "(", ")", ")", ";", "return", "true", ";", "}", "}", "for", "(", "ImportNode", "importNode", ":", "module", ".", "getStaticStarImports", "(", ")", ".", "values", "(", ")", ")", "{", "if", "(", "!", "importNode", ".", "isUnresolvable", "(", ")", ")", "{", "ClassNode", "tmp", "=", "ClassHelper", ".", "make", "(", "importNode", ".", "getClassName", "(", ")", "+", "\"$\"", "+", "name", ")", ";", "if", "(", "resolve", "(", "tmp", ",", "false", ",", "false", ",", "true", ")", ")", "{", "if", "(", "(", "tmp", ".", "getModifiers", "(", ")", "&", "Opcodes", ".", "ACC_STATIC", ")", "!=", "0", ")", "{", "ambiguousClass", "(", "type", ",", "tmp", ",", "name", ")", ";", "type", ".", "setRedirect", "(", "tmp", ".", "redirect", "(", ")", ")", ";", "return", "true", ";", "}", "}", "}", "}", "}", "return", "false", ";", "}", "protected", "ClassNode", "resolveNewName", "(", "String", "fullname", ")", "{", "return", "null", ";", "}", "protected", "boolean", "resolveToClass", "(", "ClassNode", "type", ")", "{", "String", "name", "=", "type", ".", "getName", "(", ")", ";", "Object", "cached", "=", "cachedClasses", ".", "get", "(", "name", ")", ";", "if", "(", "cached", "==", "NO_CLASS", ")", "return", "false", ";", "if", "(", "cached", "!=", "null", ")", "{", "type", ".", "setRedirect", "(", "(", "ClassNode", ")", "cached", ")", ";", "return", "true", ";", "}", "if", "(", "type", "instanceof", "LowerCaseClass", ")", "{", "cachedClasses", ".", "put", "(", "name", ",", "NO_CLASS", ")", ";", "return", "false", ";", "}", "if", "(", "currentClass", ".", "getModule", "(", ")", ".", "hasPackageName", "(", ")", "&&", "name", ".", "indexOf", "(", "'.'", ")", "==", "-", "1", ")", "return", "false", ";", "GroovyClassLoader", "loader", "=", "compilationUnit", ".", "getClassLoader", "(", ")", ";", "Class", "cls", ";", "try", "{", "cls", "=", "loader", ".", "loadClass", "(", "name", ",", "false", ",", "true", ")", ";", "}", "catch", "(", "ClassNotFoundException", "cnfe", ")", "{", "cachedClasses", ".", "put", "(", "name", ",", "NO_CLASS", ")", ";", "return", "resolveToScript", "(", "type", ")", ";", "}", "catch", "(", "CompilationFailedException", "cfe", ")", "{", "compilationUnit", ".", "getErrorCollector", "(", ")", ".", "addErrorAndContinue", "(", "new", "ExceptionMessage", "(", "cfe", ",", "true", ",", "source", ")", ")", ";", "return", "resolveToScript", "(", "type", ")", ";", "}", "if", "(", "cls", "==", "null", ")", "return", "false", ";", "ClassNode", "cn", "=", "ClassHelper", ".", "make", "(", "cls", ")", ";", "cachedClasses", ".", "put", "(", "name", ",", "cn", ")", ";", "type", ".", "setRedirect", "(", "cn", ")", ";", "return", "cls", ".", "getClassLoader", "(", ")", "==", "loader", "||", "resolveToScript", "(", "type", ")", ";", "}", "public", "Expression", "transform", "(", "Expression", "exp", ")", "{", "if", "(", "exp", "==", "null", ")", "return", "null", ";", "Expression", "ret", "=", "null", ";", "if", "(", "exp", "instanceof", "VariableExpression", ")", "{", "ret", "=", "transformVariableExpression", "(", "(", "VariableExpression", ")", "exp", ")", ";", "}", "else", "if", "(", "exp", ".", "getClass", "(", ")", "==", "PropertyExpression", ".", "class", ")", "{", "ret", "=", "transformPropertyExpression", "(", "(", "PropertyExpression", ")", "exp", ")", ";", "}", "else", "if", "(", "exp", "instanceof", "DeclarationExpression", ")", "{", "ret", "=", "transformDeclarationExpression", "(", "(", "DeclarationExpression", ")", "exp", ")", ";", "}", "else", "if", "(", "exp", "instanceof", "BinaryExpression", ")", "{", "ret", "=", "transformBinaryExpression", "(", "(", "BinaryExpression", ")", "exp", ")", ";", "}", "else", "if", "(", "exp", "instanceof", "MethodCallExpression", ")", "{", "ret", "=", "transformMethodCallExpression", "(", "(", "MethodCallExpression", ")", "exp", ")", ";", "}", "else", "if", "(", "exp", "instanceof", "ClosureExpression", ")", "{", "ret", "=", "transformClosureExpression", "(", "(", "ClosureExpression", ")", "exp", ")", ";", "}", "else", "if", "(", "exp", "instanceof", "ConstructorCallExpression", ")", "{", "ret", "=", "transformConstructorCallExpression", "(", "(", "ConstructorCallExpression", ")", "exp", ")", ";", "}", "else", "if", "(", "exp", "instanceof", "AnnotationConstantExpression", ")", "{", "ret", "=", "transformAnnotationConstantExpression", "(", "(", "AnnotationConstantExpression", ")", "exp", ")", ";", "}", "else", "{", "resolveOrFail", "(", "exp", ".", "getType", "(", ")", ",", "exp", ")", ";", "ret", "=", "exp", ".", "transformExpression", "(", "this", ")", ";", "}", "if", "(", "ret", "!=", "null", "&&", "ret", "!=", "exp", ")", "ret", ".", "setSourcePosition", "(", "exp", ")", ";", "return", "ret", ";", "}", "private", "String", "lookupClassName", "(", "PropertyExpression", "pe", ")", "{", "boolean", "doInitialClassTest", "=", "true", ";", "String", "name", "=", "\"\"", ";", "for", "(", "Expression", "it", "=", "pe", ";", "it", "!=", "null", ";", "it", "=", "(", "(", "PropertyExpression", ")", "it", ")", ".", "getObjectExpression", "(", ")", ")", "{", "if", "(", "it", "instanceof", "VariableExpression", ")", "{", "VariableExpression", "ve", "=", "(", "VariableExpression", ")", "it", ";", "if", "(", "ve", ".", "isSuperExpression", "(", ")", "||", "ve", ".", "isThisExpression", "(", ")", ")", "{", "return", "null", ";", "}", "String", "varName", "=", "ve", ".", "getName", "(", ")", ";", "if", "(", "doInitialClassTest", ")", "{", "if", "(", "!", "testVanillaNameForClass", "(", "varName", ")", ")", "return", "null", ";", "doInitialClassTest", "=", "false", ";", "name", "=", "varName", ";", "}", "else", "{", "name", "=", "varName", "+", "\".\"", "+", "name", ";", "}", "break", ";", "}", "else", "if", "(", "it", ".", "getClass", "(", ")", "!=", "PropertyExpression", ".", "class", ")", "{", "return", "null", ";", "}", "else", "{", "PropertyExpression", "current", "=", "(", "PropertyExpression", ")", "it", ";", "String", "propertyPart", "=", "current", ".", "getPropertyAsString", "(", ")", ";", "if", "(", "propertyPart", "==", "null", "||", "propertyPart", ".", "equals", "(", "\"class\"", ")", ")", "{", "return", "null", ";", "}", "if", "(", "doInitialClassTest", ")", "{", "if", "(", "!", "testVanillaNameForClass", "(", "propertyPart", ")", ")", "return", "null", ";", "doInitialClassTest", "=", "false", ";", "name", "=", "propertyPart", ";", "}", "else", "{", "name", "=", "propertyPart", "+", "\".\"", "+", "name", ";", "}", "}", "}", "if", "(", "name", ".", "length", "(", ")", "==", "0", ")", "return", "null", ";", "return", "name", ";", "}", "private", "Expression", "correctClassClassChain", "(", "PropertyExpression", "pe", ")", "{", "LinkedList", "<", "Expression", ">", "stack", "=", "new", "LinkedList", "<", "Expression", ">", "(", ")", ";", "ClassExpression", "found", "=", "null", ";", "for", "(", "Expression", "it", "=", "pe", ";", "it", "!=", "null", ";", "it", "=", "(", "(", "PropertyExpression", ")", "it", ")", ".", "getObjectExpression", "(", ")", ")", "{", "if", "(", "it", "instanceof", "ClassExpression", ")", "{", "found", "=", "(", "ClassExpression", ")", "it", ";", "break", ";", "}", "else", "if", "(", "!", "(", "it", ".", "getClass", "(", ")", "==", "PropertyExpression", ".", "class", ")", ")", "{", "return", "pe", ";", "}", "stack", ".", "addFirst", "(", "it", ")", ";", "}", "if", "(", "found", "==", "null", ")", "return", "pe", ";", "if", "(", "stack", ".", "isEmpty", "(", ")", ")", "return", "pe", ";", "Object", "stackElement", "=", "stack", ".", "removeFirst", "(", ")", ";", "if", "(", "!", "(", "stackElement", ".", "getClass", "(", ")", "==", "PropertyExpression", ".", "class", ")", ")", "return", "pe", ";", "PropertyExpression", "classPropertyExpression", "=", "(", "PropertyExpression", ")", "stackElement", ";", "String", "propertyNamePart", "=", "classPropertyExpression", ".", "getPropertyAsString", "(", ")", ";", "if", "(", "propertyNamePart", "==", "null", "||", "!", "propertyNamePart", ".", "equals", "(", "\"class\"", ")", ")", "return", "pe", ";", "found", ".", "setSourcePosition", "(", "classPropertyExpression", ")", ";", "if", "(", "stack", ".", "isEmpty", "(", ")", ")", "return", "found", ";", "stackElement", "=", "stack", ".", "removeFirst", "(", ")", ";", "if", "(", "!", "(", "stackElement", ".", "getClass", "(", ")", "==", "PropertyExpression", ".", "class", ")", ")", "return", "pe", ";", "PropertyExpression", "classPropertyExpressionContainer", "=", "(", "PropertyExpression", ")", "stackElement", ";", "classPropertyExpressionContainer", ".", "setObjectExpression", "(", "found", ")", ";", "return", "pe", ";", "}", "protected", "Expression", "transformPropertyExpression", "(", "PropertyExpression", "pe", ")", "{", "boolean", "itlp", "=", "isTopLevelProperty", ";", "boolean", "ipe", "=", "inPropertyExpression", ";", "Expression", "objectExpression", "=", "pe", ".", "getObjectExpression", "(", ")", ";", "inPropertyExpression", "=", "true", ";", "isTopLevelProperty", "=", "(", "objectExpression", ".", "getClass", "(", ")", "!=", "PropertyExpression", ".", "class", ")", ";", "objectExpression", "=", "transform", "(", "objectExpression", ")", ";", "inPropertyExpression", "=", "false", ";", "Expression", "property", "=", "transform", "(", "pe", ".", "getProperty", "(", ")", ")", ";", "isTopLevelProperty", "=", "itlp", ";", "inPropertyExpression", "=", "ipe", ";", "boolean", "spreadSafe", "=", "pe", ".", "isSpreadSafe", "(", ")", ";", "PropertyExpression", "old", "=", "pe", ";", "pe", "=", "new", "PropertyExpression", "(", "objectExpression", ",", "property", ",", "pe", ".", "isSafe", "(", ")", ")", ";", "pe", ".", "setSpreadSafe", "(", "spreadSafe", ")", ";", "pe", ".", "setSourcePosition", "(", "old", ")", ";", "String", "className", "=", "lookupClassName", "(", "pe", ")", ";", "if", "(", "className", "!=", "null", ")", "{", "ClassNode", "type", "=", "ClassHelper", ".", "make", "(", "className", ")", ";", "if", "(", "resolve", "(", "type", ")", ")", "{", "Expression", "ret", "=", "new", "ClassExpression", "(", "type", ")", ";", "ret", ".", "setSourcePosition", "(", "pe", ")", ";", "return", "ret", ";", "}", "}", "if", "(", "objectExpression", "instanceof", "ClassExpression", "&&", "pe", ".", "getPropertyAsString", "(", ")", "!=", "null", ")", "{", "ClassExpression", "ce", "=", "(", "ClassExpression", ")", "objectExpression", ";", "ClassNode", "type", "=", "ClassHelper", ".", "make", "(", "ce", ".", "getType", "(", ")", ".", "getName", "(", ")", "+", "\"$\"", "+", "pe", ".", "getPropertyAsString", "(", ")", ")", ";", "if", "(", "resolve", "(", "type", ",", "false", ",", "false", ",", "false", ")", ")", "{", "Expression", "ret", "=", "new", "ClassExpression", "(", "type", ")", ";", "ret", ".", "setSourcePosition", "(", "ce", ")", ";", "return", "ret", ";", "}", "}", "Expression", "ret", "=", "pe", ";", "checkThisAndSuperAsPropertyAccess", "(", "pe", ")", ";", "if", "(", "isTopLevelProperty", ")", "ret", "=", "correctClassClassChain", "(", "pe", ")", ";", "return", "ret", ";", "}", "private", "void", "checkThisAndSuperAsPropertyAccess", "(", "PropertyExpression", "expression", ")", "{", "if", "(", "expression", ".", "isImplicitThis", "(", ")", ")", "return", ";", "String", "prop", "=", "expression", ".", "getPropertyAsString", "(", ")", ";", "if", "(", "prop", "==", "null", ")", "return", ";", "if", "(", "!", "prop", ".", "equals", "(", "\"this\"", ")", "&&", "!", "prop", ".", "equals", "(", "\"super\"", ")", ")", "return", ";", "if", "(", "prop", ".", "equals", "(", "\"super\"", ")", ")", "{", "addError", "(", "\"\"", ",", "expression", ")", ";", "}", "if", "(", "!", "(", "expression", ".", "getObjectExpression", "(", ")", "instanceof", "ClassExpression", ")", ")", "{", "addError", "(", "\"\"", ",", "expression", ")", ";", "return", ";", "}", "if", "(", "!", "(", "currentClass", "instanceof", "InnerClassNode", ")", ")", "{", "addError", "(", "\"\"", ",", "expression", ")", ";", "return", ";", "}", "ClassNode", "type", "=", "expression", ".", "getObjectExpression", "(", ")", ".", "getType", "(", ")", ";", "ClassNode", "iterType", "=", "currentClass", ";", "while", "(", "iterType", "!=", "null", ")", "{", "if", "(", "iterType", ".", "equals", "(", "type", ")", ")", "break", ";", "iterType", "=", "iterType", ".", "getOuterClass", "(", ")", ";", "}", "if", "(", "iterType", "==", "null", ")", "{", "addError", "(", "\"The", "class", "'\"", "+", "type", ".", "getName", "(", ")", "+", "\"\"", "+", "\"\"", "+", "currentClass", ".", "getName", "(", ")", "+", "\"'.\"", ",", "expression", ")", ";", "}", "if", "(", "(", "currentClass", ".", "getModifiers", "(", ")", "&", "Opcodes", ".", "ACC_STATIC", ")", "==", "0", ")", "return", ";", "if", "(", "!", "currentScope", ".", "isInStaticContext", "(", ")", ")", "return", ";", "addError", "(", "\"\"", ",", "expression", ")", ";", "}", "protected", "Expression", "transformVariableExpression", "(", "VariableExpression", "ve", ")", "{", "visitAnnotations", "(", "ve", ")", ";", "Variable", "v", "=", "ve", ".", "getAccessedVariable", "(", ")", ";", "if", "(", "!", "(", "v", "instanceof", "DynamicVariable", ")", "&&", "!", "checkingVariableTypeInDeclaration", ")", "{", "return", "ve", ";", "}", "if", "(", "v", "instanceof", "DynamicVariable", ")", "{", "String", "name", "=", "ve", ".", "getName", "(", ")", ";", "ClassNode", "t", "=", "ClassHelper", ".", "make", "(", "name", ")", ";", "boolean", "isClass", "=", "t", ".", "isResolved", "(", ")", ";", "if", "(", "!", "isClass", ")", "{", "if", "(", "Character", ".", "isLowerCase", "(", "name", ".", "charAt", "(", "0", ")", ")", ")", "{", "t", "=", "new", "LowerCaseClass", "(", "name", ")", ";", "}", "isClass", "=", "resolve", "(", "t", ")", ";", "if", "(", "!", "isClass", ")", "isClass", "=", "resolveToInnerEnum", "(", "t", ")", ";", "}", "if", "(", "isClass", ")", "{", "for", "(", "VariableScope", "scope", "=", "currentScope", ";", "scope", "!=", "null", "&&", "!", "scope", ".", "isRoot", "(", ")", ";", "scope", "=", "scope", ".", "getParent", "(", ")", ")", "{", "if", "(", "scope", ".", "isRoot", "(", ")", ")", "break", ";", "if", "(", "scope", ".", "removeReferencedClassVariable", "(", "ve", ".", "getName", "(", ")", ")", "==", "null", ")", "break", ";", "}", "ClassExpression", "ce", "=", "new", "ClassExpression", "(", "t", ")", ";", "ce", ".", "setSourcePosition", "(", "ve", ")", ";", "return", "ce", ";", "}", "}", "resolveOrFail", "(", "ve", ".", "getType", "(", ")", ",", "ve", ")", ";", "return", "ve", ";", "}", "private", "boolean", "testVanillaNameForClass", "(", "String", "name", ")", "{", "if", "(", "name", "==", "null", "||", "name", ".", "length", "(", ")", "==", "0", ")", "return", "false", ";", "return", "!", "Character", ".", "isLowerCase", "(", "name", ".", "charAt", "(", "0", ")", ")", ";", "}", "protected", "Expression", "transformBinaryExpression", "(", "BinaryExpression", "be", ")", "{", "Expression", "left", "=", "transform", "(", "be", ".", "getLeftExpression", "(", ")", ")", ";", "int", "type", "=", "be", ".", "getOperation", "(", ")", ".", "getType", "(", ")", ";", "if", "(", "(", "type", "==", "Types", ".", "ASSIGNMENT_OPERATOR", "||", "type", "==", "Types", ".", "EQUAL", ")", "&&", "left", "instanceof", "ClassExpression", ")", "{", "ClassExpression", "ce", "=", "(", "ClassExpression", ")", "left", ";", "String", "error", "=", "\"\"", "+", "ce", ".", "getType", "(", ")", ".", "getName", "(", ")", "+", "\"'\"", ";", "if", "(", "ce", ".", "getType", "(", ")", ".", "isScript", "(", ")", ")", "{", "error", "+=", "\"\"", ";", "}", "addError", "(", "error", ",", "be", ".", "getLeftExpression", "(", ")", ")", ";", "return", "be", ";", "}", "if", "(", "left", "instanceof", "ClassExpression", ")", "{", "if", "(", "be", ".", "getRightExpression", "(", ")", "instanceof", "ListExpression", ")", "{", "ListExpression", "list", "=", "(", "ListExpression", ")", "be", ".", "getRightExpression", "(", ")", ";", "if", "(", "list", ".", "getExpressions", "(", ")", ".", "isEmpty", "(", ")", ")", "{", "final", "ClassExpression", "ce", "=", "new", "ClassExpression", "(", "left", ".", "getType", "(", ")", ".", "makeArray", "(", ")", ")", ";", "ce", ".", "setSourcePosition", "(", "be", ")", ";", "return", "ce", ";", "}", "else", "{", "boolean", "map", "=", "true", ";", "for", "(", "Expression", "expression", ":", "list", ".", "getExpressions", "(", ")", ")", "{", "if", "(", "!", "(", "expression", "instanceof", "MapEntryExpression", ")", ")", "{", "map", "=", "false", ";", "break", ";", "}", "}", "if", "(", "map", ")", "{", "final", "MapExpression", "me", "=", "new", "MapExpression", "(", ")", ";", "for", "(", "Expression", "expression", ":", "list", ".", "getExpressions", "(", ")", ")", "{", "me", ".", "addMapEntryExpression", "(", "(", "MapEntryExpression", ")", "expression", ")", ";", "}", "me", ".", "setSourcePosition", "(", "list", ")", ";", "final", "CastExpression", "ce", "=", "new", "CastExpression", "(", "left", ".", "getType", "(", ")", ",", "me", ")", ";", "ce", ".", "setSourcePosition", "(", "be", ")", ";", "return", "ce", ";", "}", "}", "}", "if", "(", "be", ".", "getRightExpression", "(", ")", "instanceof", "MapEntryExpression", ")", "{", "final", "MapExpression", "me", "=", "new", "MapExpression", "(", ")", ";", "me", ".", "addMapEntryExpression", "(", "(", "MapEntryExpression", ")", "be", ".", "getRightExpression", "(", ")", ")", ";", "me", ".", "setSourcePosition", "(", "be", ".", "getRightExpression", "(", ")", ")", ";", "final", "CastExpression", "ce", "=", "new", "CastExpression", "(", "left", ".", "getType", "(", ")", ",", "me", ")", ";", "ce", ".", "setSourcePosition", "(", "be", ")", ";", "return", "ce", ";", "}", "}", "Expression", "right", "=", "transform", "(", "be", ".", "getRightExpression", "(", ")", ")", ";", "be", ".", "setLeftExpression", "(", "left", ")", ";", "be", ".", "setRightExpression", "(", "right", ")", ";", "return", "be", ";", "}", "protected", "Expression", "transformClosureExpression", "(", "ClosureExpression", "ce", ")", "{", "boolean", "oldInClosure", "=", "inClosure", ";", "inClosure", "=", "true", ";", "Parameter", "[", "]", "paras", "=", "ce", ".", "getParameters", "(", ")", ";", "if", "(", "paras", "!=", "null", ")", "{", "for", "(", "Parameter", "para", ":", "paras", ")", "{", "ClassNode", "t", "=", "para", ".", "getType", "(", ")", ";", "resolveOrFail", "(", "t", ",", "ce", ")", ";", "if", "(", "para", ".", "hasInitialExpression", "(", ")", ")", "{", "Object", "initialVal", "=", "para", ".", "getInitialExpression", "(", ")", ";", "if", "(", "initialVal", "instanceof", "Expression", ")", "{", "para", ".", "setInitialExpression", "(", "transform", "(", "(", "Expression", ")", "initialVal", ")", ")", ";", "}", "}", "visitAnnotations", "(", "para", ")", ";", "}", "}", "Statement", "code", "=", "ce", ".", "getCode", "(", ")", ";", "if", "(", "code", "!=", "null", ")", "code", ".", "visit", "(", "this", ")", ";", "inClosure", "=", "oldInClosure", ";", "return", "ce", ";", "}", "protected", "Expression", "transformConstructorCallExpression", "(", "ConstructorCallExpression", "cce", ")", "{", "ClassNode", "type", "=", "cce", ".", "getType", "(", ")", ";", "resolveOrFail", "(", "type", ",", "cce", ")", ";", "if", "(", "Modifier", ".", "isAbstract", "(", "type", ".", "getModifiers", "(", ")", ")", ")", "{", "addError", "(", "\"\"", "+", "getDescription", "(", "type", ")", "+", "\".\"", ",", "cce", ")", ";", "}", "isSpecialConstructorCall", "=", "cce", ".", "isSpecialCall", "(", ")", ";", "Expression", "ret", "=", "cce", ".", "transformExpression", "(", "this", ")", ";", "isSpecialConstructorCall", "=", "false", ";", "return", "ret", ";", "}", "private", "String", "getDescription", "(", "ClassNode", "node", ")", "{", "return", "(", "node", ".", "isInterface", "(", ")", "?", "\"interface\"", ":", "\"class\"", ")", "+", "\"", "'\"", "+", "node", ".", "getName", "(", ")", "+", "\"'\"", ";", "}", "protected", "Expression", "transformMethodCallExpression", "(", "MethodCallExpression", "mce", ")", "{", "Expression", "args", "=", "transform", "(", "mce", ".", "getArguments", "(", ")", ")", ";", "Expression", "method", "=", "transform", "(", "mce", ".", "getMethod", "(", ")", ")", ";", "Expression", "object", "=", "transform", "(", "mce", ".", "getObjectExpression", "(", ")", ")", ";", "resolveGenericsTypes", "(", "mce", ".", "getGenericsTypes", "(", ")", ")", ";", "MethodCallExpression", "result", "=", "new", "MethodCallExpression", "(", "object", ",", "method", ",", "args", ")", ";", "result", ".", "setSafe", "(", "mce", ".", "isSafe", "(", ")", ")", ";", "result", ".", "setImplicitThis", "(", "mce", ".", "isImplicitThis", "(", ")", ")", ";", "result", ".", "setSpreadSafe", "(", "mce", ".", "isSpreadSafe", "(", ")", ")", ";", "result", ".", "setSourcePosition", "(", "mce", ")", ";", "result", ".", "setGenericsTypes", "(", "mce", ".", "getGenericsTypes", "(", ")", ")", ";", "return", "result", ";", "}", "protected", "Expression", "transformDeclarationExpression", "(", "DeclarationExpression", "de", ")", "{", "Expression", "oldLeft", "=", "de", ".", "getLeftExpression", "(", ")", ";", "checkingVariableTypeInDeclaration", "=", "true", ";", "Expression", "left", "=", "transform", "(", "oldLeft", ")", ";", "checkingVariableTypeInDeclaration", "=", "false", ";", "if", "(", "left", "instanceof", "ClassExpression", ")", "{", "ClassExpression", "ce", "=", "(", "ClassExpression", ")", "left", ";", "addError", "(", "\"\"", "+", "ce", ".", "getType", "(", ")", ".", "getName", "(", ")", ",", "oldLeft", ")", ";", "return", "de", ";", "}", "Expression", "right", "=", "transform", "(", "de", ".", "getRightExpression", "(", ")", ")", ";", "if", "(", "right", "==", "de", ".", "getRightExpression", "(", ")", ")", "return", "de", ";", "DeclarationExpression", "newDeclExpr", "=", "new", "DeclarationExpression", "(", "left", ",", "de", ".", "getOperation", "(", ")", ",", "right", ")", ";", "newDeclExpr", ".", "setSourcePosition", "(", "de", ")", ";", "return", "newDeclExpr", ";", "}", "protected", "Expression", "transformAnnotationConstantExpression", "(", "AnnotationConstantExpression", "ace", ")", "{", "AnnotationNode", "an", "=", "(", "AnnotationNode", ")", "ace", ".", "getValue", "(", ")", ";", "ClassNode", "type", "=", "an", ".", "getClassNode", "(", ")", ";", "resolveOrFail", "(", "type", ",", "\"\"", ",", "an", ")", ";", "for", "(", "Map", ".", "Entry", "<", "String", ",", "Expression", ">", "member", ":", "an", ".", "getMembers", "(", ")", ".", "entrySet", "(", ")", ")", "{", "member", ".", "setValue", "(", "transform", "(", "member", ".", "getValue", "(", ")", ")", ")", ";", "}", "return", "ace", ";", "}", "public", "void", "visitAnnotations", "(", "AnnotatedNode", "node", ")", "{", "List", "<", "AnnotationNode", ">", "annotations", "=", "node", ".", "getAnnotations", "(", ")", ";", "if", "(", "annotations", ".", "isEmpty", "(", ")", ")", "return", ";", "Map", "<", "String", ",", "AnnotationNode", ">", "tmpAnnotations", "=", "new", "HashMap", "<", "String", ",", "AnnotationNode", ">", "(", ")", ";", "ClassNode", "annType", ";", "for", "(", "AnnotationNode", "an", ":", "annotations", ")", "{", "if", "(", "an", ".", "isBuiltIn", "(", ")", ")", "continue", ";", "annType", "=", "an", ".", "getClassNode", "(", ")", ";", "resolveOrFail", "(", "annType", ",", "\"\"", ",", "an", ")", ";", "for", "(", "Map", ".", "Entry", "<", "String", ",", "Expression", ">", "member", ":", "an", ".", "getMembers", "(", ")", ".", "entrySet", "(", ")", ")", "{", "Expression", "newValue", "=", "transform", "(", "member", ".", "getValue", "(", ")", ")", ";", "newValue", "=", "transformInlineConstants", "(", "newValue", ")", ";", "member", ".", "setValue", "(", "newValue", ")", ";", "checkAnnotationMemberValue", "(", "newValue", ")", ";", "}", "}", "}", "private", "Expression", "transformInlineConstants", "(", "Expression", "exp", ")", "{", "if", "(", "exp", "instanceof", "PropertyExpression", ")", "{", "PropertyExpression", "pe", "=", "(", "PropertyExpression", ")", "exp", ";", "if", "(", "pe", ".", "getObjectExpression", "(", ")", "instanceof", "ClassExpression", ")", "{", "ClassExpression", "ce", "=", "(", "ClassExpression", ")", "pe", ".", "getObjectExpression", "(", ")", ";", "ClassNode", "type", "=", "ce", ".", "getType", "(", ")", ";", "if", "(", "type", ".", "isEnum", "(", ")", ")", "return", "exp", ";", "FieldNode", "fn", "=", "type", ".", "getField", "(", "pe", ".", "getPropertyAsString", "(", ")", ")", ";", "if", "(", "fn", "!=", "null", "&&", "!", "fn", ".", "isEnum", "(", ")", "&&", "fn", ".", "isStatic", "(", ")", "&&", "fn", ".", "isFinal", "(", ")", ")", "{", "if", "(", "fn", ".", "getInitialValueExpression", "(", ")", "instanceof", "ConstantExpression", ")", "{", "return", "fn", ".", "getInitialValueExpression", "(", ")", ";", "}", "}", "}", "}", "else", "if", "(", "exp", "instanceof", "ListExpression", ")", "{", "ListExpression", "le", "=", "(", "ListExpression", ")", "exp", ";", "ListExpression", "result", "=", "new", "ListExpression", "(", ")", ";", "for", "(", "Expression", "e", ":", "le", ".", "getExpressions", "(", ")", ")", "{", "result", ".", "addExpression", "(", "transformInlineConstants", "(", "e", ")", ")", ";", "}", "return", "result", ";", "}", "else", "if", "(", "exp", "instanceof", "AnnotationConstantExpression", ")", "{", "ConstantExpression", "ce", "=", "(", "ConstantExpression", ")", "exp", ";", "if", "(", "ce", ".", "getValue", "(", ")", "instanceof", "AnnotationNode", ")", "{", "AnnotationNode", "an", "=", "(", "AnnotationNode", ")", "ce", ".", "getValue", "(", ")", ";", "for", "(", "Map", ".", "Entry", "<", "String", ",", "Expression", ">", "member", ":", "an", ".", "getMembers", "(", ")", ".", "entrySet", "(", ")", ")", "{", "member", ".", "setValue", "(", "transformInlineConstants", "(", "member", ".", "getValue", "(", ")", ")", ")", ";", "}", "}", "}", "return", "exp", ";", "}", "protected", "boolean", "commencingResolution", "(", ")", "{", "return", "true", ";", "}", "protected", "void", "finishedResolution", "(", ")", "{", "}", "private", "void", "checkAnnotationMemberValue", "(", "Expression", "newValue", ")", "{", "if", "(", "newValue", "instanceof", "PropertyExpression", ")", "{", "PropertyExpression", "pe", "=", "(", "PropertyExpression", ")", "newValue", ";", "if", "(", "!", "(", "pe", ".", "getObjectExpression", "(", ")", "instanceof", "ClassExpression", ")", ")", "{", "addError", "(", "\"\"", "+", "pe", ".", "getText", "(", ")", "+", "\"\"", ",", "pe", ".", "getObjectExpression", "(", ")", ")", ";", "}", "}", "else", "if", "(", "newValue", "instanceof", "ListExpression", ")", "{", "ListExpression", "le", "=", "(", "ListExpression", ")", "newValue", ";", "for", "(", "Expression", "e", ":", "le", ".", "getExpressions", "(", ")", ")", "{", "checkAnnotationMemberValue", "(", "e", ")", ";", "}", "}", "}", "public", "void", "visitClass", "(", "ClassNode", "node", ")", "{", "ClassNode", "oldNode", "=", "currentClass", ";", "Map", "<", "String", ",", "GenericsType", ">", "oldPNames", "=", "genericParameterNames", ";", "genericParameterNames", "=", "new", "HashMap", "<", "String", ",", "GenericsType", ">", "(", "genericParameterNames", ")", ";", "currentClass", "=", "node", ";", "if", "(", "!", "commencingResolution", "(", ")", ")", "{", "return", ";", "}", "resolveGenericsHeader", "(", "node", ".", "getGenericsTypes", "(", ")", ")", ";", "ModuleNode", "module", "=", "node", ".", "getModule", "(", ")", ";", "if", "(", "!", "module", ".", "hasImportsResolved", "(", ")", ")", "{", "List", "l", "=", "module", ".", "getImports", "(", ")", ";", "for", "(", "ImportNode", "importNode", ":", "module", ".", "getImports", "(", ")", ")", "{", "currImportNode", "=", "importNode", ";", "ClassNode", "type", "=", "importNode", ".", "getType", "(", ")", ";", "if", "(", "resolve", "(", "type", ",", "false", ",", "false", ",", "true", ")", ")", "{", "currImportNode", "=", "null", ";", "continue", ";", "}", "currImportNode", "=", "null", ";", "addError", "(", "\"\"", "+", "type", ".", "getName", "(", ")", ",", "type", ")", ";", "}", "for", "(", "ImportNode", "importNode", ":", "module", ".", "getStaticStarImports", "(", ")", ".", "values", "(", ")", ")", "{", "ClassNode", "type", "=", "importNode", ".", "getType", "(", ")", ";", "if", "(", "resolve", "(", "type", ",", "false", ",", "false", ",", "true", ")", ")", "continue", ";", "if", "(", "type", ".", "getPackageName", "(", ")", "==", "null", "&&", "node", ".", "getPackageName", "(", ")", "!=", "null", ")", "{", "String", "oldTypeName", "=", "type", ".", "getName", "(", ")", ";", "type", ".", "setName", "(", "node", ".", "getPackageName", "(", ")", "+", "\".\"", "+", "oldTypeName", ")", ";", "if", "(", "resolve", "(", "type", ",", "false", ",", "false", ",", "true", ")", ")", "continue", ";", "type", ".", "setName", "(", "oldTypeName", ")", ";", "}", "addError", "(", "\"\"", "+", "type", ".", "getName", "(", ")", ",", "type", ")", ";", "importNode", ".", "markAsUnresolvable", "(", ")", ";", "}", "for", "(", "ImportNode", "importNode", ":", "module", ".", "getStaticImports", "(", ")", ".", "values", "(", ")", ")", "{", "ClassNode", "type", "=", "importNode", ".", "getType", "(", ")", ";", "if", "(", "resolve", "(", "type", ",", "true", ",", "true", ",", "true", ")", ")", "continue", ";", "addError", "(", "\"\"", "+", "type", ".", "getName", "(", ")", ",", "type", ")", ";", "}", "for", "(", "ImportNode", "importNode", ":", "module", ".", "getStaticStarImports", "(", ")", ".", "values", "(", ")", ")", "{", "ClassNode", "type", "=", "importNode", ".", "getType", "(", ")", ";", "if", "(", "resolve", "(", "type", ",", "true", ",", "true", ",", "true", ")", ")", "continue", ";", "if", "(", "!", "importNode", ".", "isUnresolvable", "(", ")", ")", "{", "addError", "(", "\"\"", "+", "type", ".", "getName", "(", ")", ",", "type", ")", ";", "}", "}", "module", ".", "setImportsResolved", "(", "true", ")", ";", "}", "ClassNode", "sn", "=", "node", ".", "getUnresolvedSuperClass", "(", ")", ";", "if", "(", "sn", "!=", "null", ")", "resolveOrFail", "(", "sn", ",", "node", ",", "true", ")", ";", "for", "(", "ClassNode", "anInterface", ":", "node", ".", "getInterfaces", "(", ")", ")", "{", "resolveOrFail", "(", "anInterface", ",", "node", ",", "true", ")", ";", "}", "checkCyclicInheritence", "(", "node", ",", "node", ".", "getUnresolvedSuperClass", "(", ")", ",", "node", ".", "getInterfaces", "(", ")", ")", ";", "super", ".", "visitClass", "(", "node", ")", ";", "genericParameterNames", "=", "oldPNames", ";", "finishedResolution", "(", ")", ";", "currentClass", "=", "oldNode", ";", "}", "private", "void", "checkCyclicInheritence", "(", "ClassNode", "originalNode", ",", "ClassNode", "parentToCompare", ",", "ClassNode", "[", "]", "interfacesToCompare", ")", "{", "if", "(", "!", "originalNode", ".", "isInterface", "(", ")", ")", "{", "if", "(", "parentToCompare", "==", "null", ")", "return", ";", "if", "(", "originalNode", "==", "parentToCompare", ".", "redirect", "(", ")", ")", "{", "addError", "(", "\"\"", "+", "parentToCompare", ".", "getName", "(", ")", "+", "\"", "in", "class", "\"", "+", "originalNode", ".", "getName", "(", ")", ",", "originalNode", ")", ";", "originalNode", ".", "redirect", "(", ")", ".", "setHasInconsistentHierarchy", "(", "true", ")", ";", "return", ";", "}", "if", "(", "interfacesToCompare", "!=", "null", "&&", "interfacesToCompare", ".", "length", ">", "0", ")", "{", "for", "(", "ClassNode", "intfToCompare", ":", "interfacesToCompare", ")", "{", "if", "(", "originalNode", "==", "intfToCompare", ".", "redirect", "(", ")", ")", "{", "addError", "(", "\"\"", "+", "originalNode", ".", "getName", "(", ")", "+", "\"\"", ",", "originalNode", ")", ";", "originalNode", ".", "redirect", "(", ")", ".", "setHasInconsistentHierarchy", "(", "true", ")", ";", "return", ";", "}", "}", "}", "if", "(", "parentToCompare", "==", "ClassHelper", ".", "OBJECT_TYPE", ")", "return", ";", "checkCyclicInheritence", "(", "originalNode", ",", "parentToCompare", ".", "getUnresolvedSuperClass", "(", ")", ",", "null", ")", ";", "}", "else", "{", "if", "(", "interfacesToCompare", "!=", "null", "&&", "interfacesToCompare", ".", "length", ">", "0", ")", "{", "for", "(", "ClassNode", "intfToCompare", ":", "interfacesToCompare", ")", "{", "if", "(", "originalNode", "==", "intfToCompare", ".", "redirect", "(", ")", ")", "{", "addError", "(", "\"\"", "+", "intfToCompare", ".", "getName", "(", ")", "+", "\"\"", "+", "originalNode", ".", "getName", "(", ")", ",", "originalNode", ")", ";", "originalNode", ".", "redirect", "(", ")", ".", "setHasInconsistentHierarchy", "(", "true", ")", ";", "return", ";", "}", "}", "for", "(", "ClassNode", "intf", ":", "interfacesToCompare", ")", "{", "checkCyclicInheritence", "(", "originalNode", ",", "null", ",", "intf", ".", "getInterfaces", "(", ")", ")", ";", "}", "}", "else", "{", "return", ";", "}", "}", "}", "public", "void", "visitCatchStatement", "(", "CatchStatement", "cs", ")", "{", "resolveOrFail", "(", "cs", ".", "getExceptionType", "(", ")", ",", "cs", ")", ";", "if", "(", "cs", ".", "getExceptionType", "(", ")", "==", "ClassHelper", ".", "DYNAMIC_TYPE", ")", "{", "cs", ".", "getVariable", "(", ")", ".", "setType", "(", "ClassHelper", ".", "make", "(", "Exception", ".", "class", ")", ")", ";", "}", "super", ".", "visitCatchStatement", "(", "cs", ")", ";", "}", "public", "void", "visitForLoop", "(", "ForStatement", "forLoop", ")", "{", "resolveOrFail", "(", "forLoop", ".", "getVariableType", "(", ")", ",", "forLoop", ")", ";", "super", ".", "visitForLoop", "(", "forLoop", ")", ";", "}", "public", "void", "visitBlockStatement", "(", "BlockStatement", "block", ")", "{", "VariableScope", "oldScope", "=", "currentScope", ";", "currentScope", "=", "block", ".", "getVariableScope", "(", ")", ";", "super", ".", "visitBlockStatement", "(", "block", ")", ";", "currentScope", "=", "oldScope", ";", "}", "protected", "SourceUnit", "getSourceUnit", "(", ")", "{", "return", "source", ";", "}", "private", "void", "resolveGenericsTypes", "(", "GenericsType", "[", "]", "types", ")", "{", "if", "(", "types", "==", "null", ")", "return", ";", "currentClass", ".", "setUsingGenerics", "(", "true", ")", ";", "for", "(", "GenericsType", "type", ":", "types", ")", "{", "resolveGenericsType", "(", "type", ")", ";", "}", "}", "private", "void", "resolveGenericsHeader", "(", "GenericsType", "[", "]", "types", ")", "{", "if", "(", "types", "==", "null", ")", "return", ";", "currentClass", ".", "setUsingGenerics", "(", "true", ")", ";", "for", "(", "GenericsType", "type", ":", "types", ")", "{", "ClassNode", "classNode", "=", "type", ".", "getType", "(", ")", ";", "String", "name", "=", "type", ".", "getName", "(", ")", ";", "ClassNode", "[", "]", "bounds", "=", "type", ".", "getUpperBounds", "(", ")", ";", "if", "(", "bounds", "!=", "null", ")", "{", "boolean", "nameAdded", "=", "false", ";", "for", "(", "ClassNode", "upperBound", ":", "bounds", ")", "{", "if", "(", "!", "nameAdded", "&&", "upperBound", "!=", "null", "||", "!", "resolve", "(", "classNode", ")", ")", "{", "genericParameterNames", ".", "put", "(", "name", ",", "type", ")", ";", "type", ".", "setPlaceholder", "(", "true", ")", ";", "classNode", ".", "setRedirect", "(", "upperBound", ")", ";", "nameAdded", "=", "true", ";", "}", "resolveOrFail", "(", "upperBound", ",", "classNode", ")", ";", "}", "}", "else", "{", "genericParameterNames", ".", "put", "(", "name", ",", "type", ")", ";", "classNode", ".", "setRedirect", "(", "ClassHelper", ".", "OBJECT_TYPE", ")", ";", "type", ".", "setPlaceholder", "(", "true", ")", ";", "}", "}", "}", "private", "void", "resolveGenericsType", "(", "GenericsType", "genericsType", ")", "{", "if", "(", "genericsType", ".", "isResolved", "(", ")", ")", "return", ";", "currentClass", ".", "setUsingGenerics", "(", "true", ")", ";", "ClassNode", "type", "=", "genericsType", ".", "getType", "(", ")", ";", "String", "name", "=", "type", ".", "getName", "(", ")", ";", "ClassNode", "[", "]", "bounds", "=", "genericsType", ".", "getUpperBounds", "(", ")", ";", "if", "(", "!", "genericParameterNames", ".", "containsKey", "(", "name", ")", ")", "{", "if", "(", "bounds", "!=", "null", ")", "{", "for", "(", "ClassNode", "upperBound", ":", "bounds", ")", "{", "resolveOrFail", "(", "upperBound", ",", "genericsType", ")", ";", "type", ".", "setRedirect", "(", "upperBound", ")", ";", "resolveGenericsTypes", "(", "upperBound", ".", "getGenericsTypes", "(", ")", ")", ";", "}", "}", "else", "if", "(", "genericsType", ".", "isWildcard", "(", ")", ")", "{", "type", ".", "setRedirect", "(", "ClassHelper", ".", "OBJECT_TYPE", ")", ";", "}", "else", "{", "resolveOrFail", "(", "type", ",", "genericsType", ")", ";", "}", "}", "else", "{", "GenericsType", "gt", "=", "genericParameterNames", ".", "get", "(", "name", ")", ";", "type", ".", "setRedirect", "(", "gt", ".", "getType", "(", ")", ")", ";", "genericsType", ".", "setPlaceholder", "(", "true", ")", ";", "}", "if", "(", "genericsType", ".", "getLowerBound", "(", ")", "!=", "null", ")", "{", "resolveOrFail", "(", "genericsType", ".", "getLowerBound", "(", ")", ",", "genericsType", ")", ";", "}", "resolveGenericsTypes", "(", "type", ".", "getGenericsTypes", "(", ")", ")", ";", "genericsType", ".", "setResolved", "(", "genericsType", ".", "getType", "(", ")", ".", "isResolved", "(", ")", ")", ";", "}", "}", "</s>" ]
6,685
[ "<s>", "package", "org", ".", "codehaus", ".", "groovy", ".", "control", ";", "import", "groovy", ".", "lang", ".", "GroovyClassLoader", ";", "import", "java", ".", "io", ".", "File", ";", "import", "java", ".", "io", ".", "FileWriter", ";", "import", "java", ".", "io", ".", "IOException", ";", "import", "java", ".", "io", ".", "Reader", ";", "import", "java", ".", "net", ".", "URL", ";", "import", "java", ".", "security", ".", "AccessController", ";", "import", "java", ".", "security", ".", "PrivilegedAction", ";", "import", "java", ".", "util", ".", "HashMap", ";", "import", "java", ".", "util", ".", "List", ";", "import", "java", ".", "util", ".", "Map", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "GroovyBugError", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "ClassNode", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "Comment", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "GenericsType", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "ModuleNode", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "control", ".", "io", ".", "FileReaderSource", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "control", ".", "io", ".", "ReaderSource", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "control", ".", "io", ".", "StringReaderSource", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "control", ".", "io", ".", "URLReaderSource", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "control", ".", "messages", ".", "Message", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "control", ".", "messages", ".", "SimpleMessage", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "control", ".", "messages", ".", "SyntaxErrorMessage", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "syntax", ".", "*", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "tools", ".", "Utilities", ";", "import", "antlr", ".", "CharScanner", ";", "import", "antlr", ".", "MismatchedTokenException", ";", "import", "antlr", ".", "MismatchedCharException", ";", "import", "antlr", ".", "NoViableAltException", ";", "import", "antlr", ".", "NoViableAltForCharException", ";", "public", "class", "SourceUnit", "extends", "ProcessingUnit", "{", "private", "List", "<", "Comment", ">", "comments", ";", "private", "ParserPlugin", "parserPlugin", ";", "protected", "ReaderSource", "source", ";", "protected", "String", "name", ";", "protected", "Reduction", "cst", ";", "protected", "ModuleNode", "ast", ";", "public", "boolean", "isReconcile", ";", "public", "SourceUnit", "(", "String", "name", ",", "ReaderSource", "source", ",", "CompilerConfiguration", "flags", ",", "GroovyClassLoader", "loader", ",", "ErrorCollector", "er", ")", "{", "super", "(", "flags", ",", "loader", ",", "er", ")", ";", "this", ".", "name", "=", "name", ";", "this", ".", "source", "=", "source", ";", "}", "public", "SourceUnit", "(", "File", "source", ",", "CompilerConfiguration", "configuration", ",", "GroovyClassLoader", "loader", ",", "ErrorCollector", "er", ")", "{", "this", "(", "source", ".", "getPath", "(", ")", ",", "new", "FileReaderSource", "(", "source", ",", "configuration", ")", ",", "configuration", ",", "loader", ",", "er", ")", ";", "}", "public", "SourceUnit", "(", "URL", "source", ",", "CompilerConfiguration", "configuration", ",", "GroovyClassLoader", "loader", ",", "ErrorCollector", "er", ")", "{", "this", "(", "source", ".", "getPath", "(", ")", ",", "new", "URLReaderSource", "(", "source", ",", "configuration", ")", ",", "configuration", ",", "loader", ",", "er", ")", ";", "}", "public", "SourceUnit", "(", "String", "name", ",", "String", "source", ",", "CompilerConfiguration", "configuration", ",", "GroovyClassLoader", "loader", ",", "ErrorCollector", "er", ")", "{", "this", "(", "name", ",", "new", "StringReaderSource", "(", "source", ",", "configuration", ")", ",", "configuration", ",", "loader", ",", "er", ")", ";", "}", "public", "String", "getName", "(", ")", "{", "return", "name", ";", "}", "public", "Reduction", "getCST", "(", ")", "{", "return", "this", ".", "cst", ";", "}", "public", "ModuleNode", "getAST", "(", ")", "{", "return", "this", ".", "ast", ";", "}", "public", "boolean", "failedWithUnexpectedEOF", "(", ")", "{", "if", "(", "getErrorCollector", "(", ")", ".", "hasErrors", "(", ")", ")", "{", "Message", "last", "=", "(", "Message", ")", "getErrorCollector", "(", ")", ".", "getLastError", "(", ")", ";", "Throwable", "cause", "=", "null", ";", "if", "(", "last", "instanceof", "SyntaxErrorMessage", ")", "{", "cause", "=", "(", "(", "SyntaxErrorMessage", ")", "last", ")", ".", "getCause", "(", ")", ".", "getCause", "(", ")", ";", "}", "if", "(", "cause", "!=", "null", ")", "{", "if", "(", "cause", "instanceof", "NoViableAltException", ")", "{", "return", "isEofToken", "(", "(", "(", "NoViableAltException", ")", "cause", ")", ".", "token", ")", ";", "}", "else", "if", "(", "cause", "instanceof", "NoViableAltForCharException", ")", "{", "char", "badChar", "=", "(", "(", "NoViableAltForCharException", ")", "cause", ")", ".", "foundChar", ";", "return", "badChar", "==", "CharScanner", ".", "EOF_CHAR", ";", "}", "else", "if", "(", "cause", "instanceof", "MismatchedCharException", ")", "{", "char", "badChar", "=", "(", "char", ")", "(", "(", "MismatchedCharException", ")", "cause", ")", ".", "foundChar", ";", "return", "badChar", "==", "CharScanner", ".", "EOF_CHAR", ";", "}", "else", "if", "(", "cause", "instanceof", "MismatchedTokenException", ")", "{", "return", "isEofToken", "(", "(", "(", "MismatchedTokenException", ")", "cause", ")", ".", "token", ")", ";", "}", "}", "}", "return", "false", ";", "}", "protected", "boolean", "isEofToken", "(", "antlr", ".", "Token", "token", ")", "{", "return", "token", ".", "getType", "(", ")", "==", "antlr", ".", "Token", ".", "EOF_TYPE", ";", "}", "public", "static", "SourceUnit", "create", "(", "String", "name", ",", "String", "source", ")", "{", "CompilerConfiguration", "configuration", "=", "new", "CompilerConfiguration", "(", ")", ";", "configuration", ".", "setTolerance", "(", "1", ")", ";", "return", "new", "SourceUnit", "(", "name", ",", "source", ",", "configuration", ",", "null", ",", "new", "ErrorCollector", "(", "configuration", ")", ")", ";", "}", "public", "static", "SourceUnit", "create", "(", "String", "name", ",", "String", "source", ",", "int", "tolerance", ")", "{", "CompilerConfiguration", "configuration", "=", "new", "CompilerConfiguration", "(", ")", ";", "configuration", ".", "setTolerance", "(", "tolerance", ")", ";", "return", "new", "SourceUnit", "(", "name", ",", "source", ",", "configuration", ",", "null", ",", "new", "ErrorCollector", "(", "configuration", ")", ")", ";", "}", "public", "void", "parse", "(", ")", "throws", "CompilationFailedException", "{", "if", "(", "this", ".", "phase", ">", "Phases", ".", "PARSING", ")", "{", "throw", "new", "GroovyBugError", "(", "\"\"", ")", ";", "}", "if", "(", "this", ".", "phase", "==", "Phases", ".", "INITIALIZATION", ")", "{", "nextPhase", "(", ")", ";", "}", "Reader", "reader", "=", "null", ";", "try", "{", "reader", "=", "source", ".", "getReader", "(", ")", ";", "parserPlugin", "=", "getConfiguration", "(", ")", ".", "getPluginFactory", "(", ")", ".", "createParserPlugin", "(", ")", ";", "cst", "=", "parserPlugin", ".", "parseCST", "(", "this", ",", "reader", ")", ";", "reader", ".", "close", "(", ")", ";", "}", "catch", "(", "IOException", "e", ")", "{", "getErrorCollector", "(", ")", ".", "addFatalError", "(", "new", "SimpleMessage", "(", "e", ".", "getMessage", "(", ")", ",", "this", ")", ")", ";", "}", "finally", "{", "if", "(", "reader", "!=", "null", ")", "{", "try", "{", "reader", ".", "close", "(", ")", ";", "}", "catch", "(", "IOException", "e", ")", "{", "}", "}", "}", "}", "public", "void", "convert", "(", ")", "throws", "CompilationFailedException", "{", "if", "(", "this", ".", "phase", "==", "Phases", ".", "PARSING", "&&", "this", ".", "phaseComplete", ")", "{", "gotoPhase", "(", "Phases", ".", "CONVERSION", ")", ";", "}", "if", "(", "this", ".", "phase", "!=", "Phases", ".", "CONVERSION", ")", "{", "throw", "new", "GroovyBugError", "(", "\"\"", ")", ";", "}", "try", "{", "this", ".", "ast", "=", "parserPlugin", ".", "buildAST", "(", "this", ",", "this", ".", "classLoader", ",", "this", ".", "cst", ")", ";", "this", ".", "ast", ".", "setDescription", "(", "this", ".", "name", ")", ";", "}", "catch", "(", "SyntaxException", "e", ")", "{", "getErrorCollector", "(", ")", ".", "addError", "(", "new", "SyntaxErrorMessage", "(", "e", ",", "this", ")", ")", ";", "}", "String", "property", "=", "(", "String", ")", "AccessController", ".", "doPrivileged", "(", "new", "PrivilegedAction", "(", ")", "{", "public", "Object", "run", "(", ")", "{", "return", "System", ".", "getProperty", "(", "\"groovy.ast\"", ")", ";", "}", "}", ")", ";", "if", "(", "\"xml\"", ".", "equals", "(", "property", ")", ")", "{", "saveAsXML", "(", "name", ",", "ast", ")", ";", "}", "}", "private", "void", "saveAsXML", "(", "String", "name", ",", "ModuleNode", "ast", ")", "{", "}", "public", "String", "getSample", "(", "int", "line", ",", "int", "column", ",", "Janitor", "janitor", ")", "{", "String", "sample", "=", "null", ";", "String", "text", "=", "source", ".", "getLine", "(", "line", ",", "janitor", ")", ";", "if", "(", "text", "!=", "null", ")", "{", "if", "(", "column", ">", "0", ")", "{", "String", "marker", "=", "Utilities", ".", "repeatString", "(", "\"", "\"", ",", "column", "-", "1", ")", "+", "\"^\"", ";", "if", "(", "column", ">", "40", ")", "{", "int", "start", "=", "column", "-", "30", "-", "1", ";", "int", "end", "=", "(", "column", "+", "10", ">", "text", ".", "length", "(", ")", "?", "text", ".", "length", "(", ")", ":", "column", "+", "10", "-", "1", ")", ";", "sample", "=", "\"", "\"", "+", "text", ".", "substring", "(", "start", ",", "end", ")", "+", "Utilities", ".", "eol", "(", ")", "+", "\"", "\"", "+", "marker", ".", "substring", "(", "start", ",", "marker", ".", "length", "(", ")", ")", ";", "}", "else", "{", "sample", "=", "\"", "\"", "+", "text", "+", "Utilities", ".", "eol", "(", ")", "+", "\"", "\"", "+", "marker", ";", "}", "}", "else", "{", "sample", "=", "text", ";", "}", "}", "return", "sample", ";", "}", "public", "void", "addException", "(", "Exception", "e", ")", "throws", "CompilationFailedException", "{", "getErrorCollector", "(", ")", ".", "addException", "(", "e", ",", "this", ")", ";", "}", "public", "void", "addError", "(", "SyntaxException", "se", ")", "throws", "CompilationFailedException", "{", "getErrorCollector", "(", ")", ".", "addError", "(", "se", ",", "this", ")", ";", "}", "public", "ReaderSource", "getSource", "(", ")", "{", "return", "source", ";", "}", "public", "List", "<", "Comment", ">", "getComments", "(", ")", "{", "return", "comments", ";", "}", "public", "void", "setComments", "(", "List", "<", "Comment", ">", "comments", ")", "{", "this", ".", "comments", "=", "comments", ";", "}", "}", "</s>" ]
6,686
[ "<s>", "package", "org", ".", "codehaus", ".", "groovy", ".", "control", ".", "messages", ";", "import", "java", ".", "io", ".", "PrintWriter", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "control", ".", "Janitor", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "control", ".", "SourceUnit", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "syntax", ".", "CSTNode", ";", "public", "class", "LocatedMessage", "extends", "SimpleMessage", "{", "protected", "CSTNode", "context", ";", "public", "LocatedMessage", "(", "String", "message", ",", "CSTNode", "context", ",", "SourceUnit", "source", ")", "{", "super", "(", "message", ",", "source", ")", ";", "this", ".", "context", "=", "context", ";", "}", "public", "CSTNode", "getContext", "(", ")", "{", "return", "context", ";", "}", "public", "LocatedMessage", "(", "String", "message", ",", "Object", "data", ",", "CSTNode", "context", ",", "SourceUnit", "source", ")", "{", "super", "(", "message", ",", "data", ",", "source", ")", ";", "this", ".", "context", "=", "context", ";", "}", "public", "void", "write", "(", "PrintWriter", "writer", ",", "Janitor", "janitor", ")", "{", "if", "(", "owner", "instanceof", "SourceUnit", ")", "{", "SourceUnit", "source", "=", "(", "SourceUnit", ")", "owner", ";", "String", "name", "=", "source", ".", "getName", "(", ")", ";", "int", "line", "=", "context", ".", "getStartLine", "(", ")", ";", "int", "column", "=", "context", ".", "getStartColumn", "(", ")", ";", "String", "sample", "=", "source", ".", "getSample", "(", "line", ",", "column", ",", "janitor", ")", ";", "if", "(", "sample", "!=", "null", ")", "{", "writer", ".", "println", "(", "source", ".", "getSample", "(", "line", ",", "column", ",", "janitor", ")", ")", ";", "}", "writer", ".", "println", "(", "name", "+", "\":", "\"", "+", "line", "+", "\":", "\"", "+", "this", ".", "message", ")", ";", "writer", ".", "println", "(", "\"\"", ")", ";", "}", "else", "{", "writer", ".", "println", "(", "\"\"", "+", "this", ".", "message", ")", ";", "writer", ".", "println", "(", "\"\"", ")", ";", "}", "}", "}", "</s>" ]
6,687
[ "<s>", "package", "org", ".", "codehaus", ".", "groovy", ".", "control", ";", "import", "java", ".", "io", ".", "PrintWriter", ";", "import", "java", ".", "util", ".", "Iterator", ";", "import", "java", ".", "util", ".", "LinkedList", ";", "import", "java", ".", "util", ".", "List", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "control", ".", "messages", ".", "ExceptionMessage", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "control", ".", "messages", ".", "LocatedMessage", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "control", ".", "messages", ".", "Message", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "control", ".", "messages", ".", "SyntaxErrorMessage", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "control", ".", "messages", ".", "WarningMessage", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "syntax", ".", "CSTNode", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "syntax", ".", "SyntaxException", ";", "public", "class", "ErrorCollector", "{", "public", "boolean", "transformActive", "=", "false", ";", "protected", "LinkedList", "warnings", ";", "protected", "LinkedList", "errors", ";", "protected", "CompilerConfiguration", "configuration", ";", "public", "ErrorCollector", "(", "CompilerConfiguration", "configuration", ")", "{", "this", ".", "warnings", "=", "null", ";", "this", ".", "errors", "=", "null", ";", "this", ".", "configuration", "=", "configuration", ";", "}", "public", "void", "addCollectorContents", "(", "ErrorCollector", "er", ")", "{", "if", "(", "er", ".", "errors", "!=", "null", ")", "{", "if", "(", "errors", "==", "null", ")", "{", "errors", "=", "er", ".", "errors", ";", "}", "else", "{", "errors", ".", "addAll", "(", "er", ".", "errors", ")", ";", "}", "}", "if", "(", "er", ".", "warnings", "!=", "null", ")", "{", "if", "(", "warnings", "==", "null", ")", "{", "warnings", "=", "er", ".", "warnings", ";", "}", "else", "{", "warnings", ".", "addAll", "(", "er", ".", "warnings", ")", ";", "}", "}", "}", "public", "void", "addErrorAndContinue", "(", "Message", "message", ")", "{", "if", "(", "this", ".", "errors", "==", "null", ")", "{", "this", ".", "errors", "=", "new", "LinkedList", "(", ")", ";", "}", "this", ".", "errors", ".", "add", "(", "message", ")", ";", "}", "public", "void", "addError", "(", "Message", "message", ")", "throws", "CompilationFailedException", "{", "addErrorAndContinue", "(", "message", ")", ";", "if", "(", "errors", "!=", "null", "&&", "this", ".", "errors", ".", "size", "(", ")", ">=", "configuration", ".", "getTolerance", "(", ")", ")", "{", "failIfErrors", "(", ")", ";", "}", "}", "public", "void", "addError", "(", "Message", "message", ",", "boolean", "fatal", ")", "throws", "CompilationFailedException", "{", "if", "(", "fatal", ")", "{", "addFatalError", "(", "message", ")", ";", "}", "else", "{", "addError", "(", "message", ")", ";", "}", "}", "public", "void", "addError", "(", "SyntaxException", "error", ",", "SourceUnit", "source", ")", "throws", "CompilationFailedException", "{", "addError", "(", "Message", ".", "create", "(", "error", ",", "source", ")", ",", "error", ".", "isFatal", "(", ")", ")", ";", "}", "public", "void", "addError", "(", "String", "text", ",", "CSTNode", "context", ",", "SourceUnit", "source", ")", "throws", "CompilationFailedException", "{", "addError", "(", "new", "LocatedMessage", "(", "text", ",", "context", ",", "source", ")", ")", ";", "}", "public", "void", "addFatalError", "(", "Message", "message", ")", "throws", "CompilationFailedException", "{", "addError", "(", "message", ")", ";", "failIfErrors", "(", ")", ";", "}", "public", "void", "addException", "(", "Exception", "cause", ",", "SourceUnit", "source", ")", "throws", "CompilationFailedException", "{", "addError", "(", "new", "ExceptionMessage", "(", "cause", ",", "configuration", ".", "getDebug", "(", ")", ",", "source", ")", ")", ";", "failIfErrors", "(", ")", ";", "}", "public", "boolean", "hasErrors", "(", ")", "{", "return", "this", ".", "errors", "!=", "null", ";", "}", "public", "boolean", "hasWarnings", "(", ")", "{", "return", "this", ".", "warnings", "!=", "null", ";", "}", "public", "List", "getWarnings", "(", ")", "{", "return", "this", ".", "warnings", ";", "}", "public", "List", "getErrors", "(", ")", "{", "return", "this", ".", "errors", ";", "}", "public", "int", "getWarningCount", "(", ")", "{", "return", "(", "(", "this", ".", "warnings", "==", "null", ")", "?", "0", ":", "this", ".", "warnings", ".", "size", "(", ")", ")", ";", "}", "public", "int", "getErrorCount", "(", ")", "{", "return", "(", "(", "this", ".", "errors", "==", "null", ")", "?", "0", ":", "this", ".", "errors", ".", "size", "(", ")", ")", ";", "}", "public", "WarningMessage", "getWarning", "(", "int", "index", ")", "{", "if", "(", "index", "<", "getWarningCount", "(", ")", ")", "{", "return", "(", "WarningMessage", ")", "this", ".", "warnings", ".", "get", "(", "index", ")", ";", "}", "return", "null", ";", "}", "public", "Message", "getError", "(", "int", "index", ")", "{", "if", "(", "index", "<", "getErrorCount", "(", ")", ")", "{", "return", "(", "Message", ")", "this", ".", "errors", ".", "get", "(", "index", ")", ";", "}", "return", "null", ";", "}", "public", "Message", "getLastError", "(", ")", "{", "return", "(", "Message", ")", "this", ".", "errors", ".", "getLast", "(", ")", ";", "}", "public", "SyntaxException", "getSyntaxError", "(", "int", "index", ")", "{", "SyntaxException", "exception", "=", "null", ";", "Message", "message", "=", "getError", "(", "index", ")", ";", "if", "(", "message", "!=", "null", "&&", "message", "instanceof", "SyntaxErrorMessage", ")", "{", "exception", "=", "(", "(", "SyntaxErrorMessage", ")", "message", ")", ".", "getCause", "(", ")", ";", "}", "return", "exception", ";", "}", "public", "Exception", "getException", "(", "int", "index", ")", "{", "Exception", "exception", "=", "null", ";", "Message", "message", "=", "getError", "(", "index", ")", ";", "if", "(", "message", "!=", "null", ")", "{", "if", "(", "message", "instanceof", "ExceptionMessage", ")", "{", "exception", "=", "(", "(", "ExceptionMessage", ")", "message", ")", ".", "getCause", "(", ")", ";", "}", "else", "if", "(", "message", "instanceof", "SyntaxErrorMessage", ")", "{", "exception", "=", "(", "(", "SyntaxErrorMessage", ")", "message", ")", ".", "getCause", "(", ")", ";", "}", "}", "return", "exception", ";", "}", "public", "void", "addWarning", "(", "WarningMessage", "message", ")", "{", "if", "(", "message", ".", "isRelevant", "(", "configuration", ".", "getWarningLevel", "(", ")", ")", ")", "{", "if", "(", "this", ".", "warnings", "==", "null", ")", "{", "this", ".", "warnings", "=", "new", "LinkedList", "(", ")", ";", "}", "this", ".", "warnings", ".", "add", "(", "message", ")", ";", "}", "}", "public", "void", "addWarning", "(", "int", "importance", ",", "String", "text", ",", "CSTNode", "context", ",", "SourceUnit", "source", ")", "{", "if", "(", "WarningMessage", ".", "isRelevant", "(", "importance", ",", "configuration", ".", "getWarningLevel", "(", ")", ")", ")", "{", "addWarning", "(", "new", "WarningMessage", "(", "importance", ",", "text", ",", "context", ",", "source", ")", ")", ";", "}", "}", "public", "void", "addWarning", "(", "int", "importance", ",", "String", "text", ",", "Object", "data", ",", "CSTNode", "context", ",", "SourceUnit", "source", ")", "{", "if", "(", "WarningMessage", ".", "isRelevant", "(", "importance", ",", "configuration", ".", "getWarningLevel", "(", ")", ")", ")", "{", "addWarning", "(", "new", "WarningMessage", "(", "importance", ",", "text", ",", "data", ",", "context", ",", "source", ")", ")", ";", "}", "}", "protected", "void", "failIfErrors", "(", ")", "throws", "CompilationFailedException", "{", "if", "(", "hasErrors", "(", ")", ")", "{", "throw", "new", "MultipleCompilationErrorsException", "(", "this", ")", ";", "}", "}", "private", "void", "write", "(", "PrintWriter", "writer", ",", "Janitor", "janitor", ",", "List", "messages", ",", "String", "txt", ")", "{", "if", "(", "messages", "==", "null", "||", "messages", ".", "size", "(", ")", "==", "0", ")", "return", ";", "Iterator", "iterator", "=", "messages", ".", "iterator", "(", ")", ";", "while", "(", "iterator", ".", "hasNext", "(", ")", ")", "{", "Message", "message", "=", "(", "Message", ")", "iterator", ".", "next", "(", ")", ";", "message", ".", "write", "(", "writer", ",", "janitor", ")", ";", "if", "(", "configuration", ".", "getDebug", "(", ")", "&&", "(", "message", "instanceof", "SyntaxErrorMessage", ")", ")", "{", "SyntaxErrorMessage", "sem", "=", "(", "SyntaxErrorMessage", ")", "message", ";", "sem", ".", "getCause", "(", ")", ".", "printStackTrace", "(", "writer", ")", ";", "}", "writer", ".", "println", "(", ")", ";", "}", "writer", ".", "print", "(", "messages", ".", "size", "(", ")", ")", ";", "writer", ".", "print", "(", "\"", "\"", "+", "txt", ")", ";", "if", "(", "messages", ".", "size", "(", ")", ">", "1", ")", "writer", ".", "print", "(", "\"s\"", ")", ";", "writer", ".", "println", "(", ")", ";", "}", "public", "void", "write", "(", "PrintWriter", "writer", ",", "Janitor", "janitor", ")", "{", "write", "(", "writer", ",", "janitor", ",", "warnings", ",", "\"warning\"", ")", ";", "write", "(", "writer", ",", "janitor", ",", "errors", ",", "\"error\"", ")", ";", "}", "}", "</s>" ]
6,688
[ "<s>", "package", "org", ".", "codehaus", ".", "groovy", ".", "control", ";", "import", "groovy", ".", "lang", ".", "GroovyClassLoader", ";", "public", "abstract", "class", "ProcessingUnit", "{", "protected", "int", "phase", ";", "protected", "boolean", "phaseComplete", ";", "protected", "int", "erroredAtPhase", "=", "-", "1", ";", "protected", "CompilerConfiguration", "configuration", ";", "protected", "GroovyClassLoader", "classLoader", ";", "protected", "ErrorCollector", "errorCollector", ";", "public", "ProcessingUnit", "(", "CompilerConfiguration", "configuration", ",", "GroovyClassLoader", "classLoader", ",", "ErrorCollector", "er", ")", "{", "this", ".", "phase", "=", "Phases", ".", "INITIALIZATION", ";", "this", ".", "configuration", "=", "configuration", ";", "this", ".", "setClassLoader", "(", "classLoader", ")", ";", "configure", "(", "(", "configuration", "==", "null", "?", "new", "CompilerConfiguration", "(", ")", ":", "configuration", ")", ")", ";", "if", "(", "er", "==", "null", ")", "er", "=", "new", "ErrorCollector", "(", "getConfiguration", "(", ")", ")", ";", "this", ".", "errorCollector", "=", "er", ";", "}", "public", "void", "configure", "(", "CompilerConfiguration", "configuration", ")", "{", "this", ".", "configuration", "=", "configuration", ";", "}", "public", "CompilerConfiguration", "getConfiguration", "(", ")", "{", "return", "configuration", ";", "}", "public", "void", "setConfiguration", "(", "CompilerConfiguration", "configuration", ")", "{", "this", ".", "configuration", "=", "configuration", ";", "}", "public", "GroovyClassLoader", "getClassLoader", "(", ")", "{", "return", "classLoader", ";", "}", "public", "void", "setClassLoader", "(", "GroovyClassLoader", "loader", ")", "{", "ClassLoader", "parent", "=", "Thread", ".", "currentThread", "(", ")", ".", "getContextClassLoader", "(", ")", ";", "if", "(", "parent", "==", "null", ")", "parent", "=", "ProcessingUnit", ".", "class", ".", "getClassLoader", "(", ")", ";", "this", ".", "classLoader", "=", "(", "loader", "==", "null", "?", "new", "GroovyClassLoader", "(", "parent", ",", "configuration", ")", ":", "loader", ")", ";", "}", "public", "int", "getPhase", "(", ")", "{", "return", "this", ".", "phase", ";", "}", "public", "String", "getPhaseDescription", "(", ")", "{", "return", "Phases", ".", "getDescription", "(", "this", ".", "phase", ")", ";", "}", "public", "ErrorCollector", "getErrorCollector", "(", ")", "{", "return", "errorCollector", ";", "}", "public", "void", "completePhase", "(", ")", "throws", "CompilationFailedException", "{", "if", "(", "errorCollector", ".", "hasErrors", "(", ")", ")", "{", "erroredAtPhase", "=", "phase", ";", "}", "phaseComplete", "=", "true", ";", "}", "public", "void", "nextPhase", "(", ")", "throws", "CompilationFailedException", "{", "gotoPhase", "(", "this", ".", "phase", "+", "1", ")", ";", "}", "public", "void", "gotoPhase", "(", "int", "phase", ")", "throws", "CompilationFailedException", "{", "if", "(", "!", "this", ".", "phaseComplete", ")", "{", "completePhase", "(", ")", ";", "}", "this", ".", "phase", "=", "phase", ";", "this", ".", "phaseComplete", "=", "false", ";", "}", "}", "</s>" ]
6,689
[ "<s>", "package", "org", ".", "codehaus", ".", "groovy", ".", "control", ";", "import", "groovy", ".", "lang", ".", "GroovyClassLoader", ";", "import", "groovy", ".", "lang", ".", "GroovyRuntimeException", ";", "import", "java", ".", "io", ".", "File", ";", "import", "java", ".", "io", ".", "FileOutputStream", ";", "import", "java", ".", "io", ".", "IOException", ";", "import", "java", ".", "io", ".", "InputStream", ";", "import", "java", ".", "net", ".", "URL", ";", "import", "java", ".", "security", ".", "CodeSource", ";", "import", "java", ".", "util", ".", "ArrayList", ";", "import", "java", ".", "util", ".", "Collections", ";", "import", "java", ".", "util", ".", "HashMap", ";", "import", "java", ".", "util", ".", "Iterator", ";", "import", "java", ".", "util", ".", "LinkedList", ";", "import", "java", ".", "util", ".", "List", ";", "import", "java", ".", "util", ".", "Map", ";", "import", "java", ".", "util", ".", "Set", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "GroovyBugError", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "ASTNode", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "ClassNode", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "CompileUnit", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "ModuleNode", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "classgen", ".", "AsmClassGenerator", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "classgen", ".", "ClassCompletionVerifier", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "classgen", ".", "ClassGenerator", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "classgen", ".", "EnumVisitor", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "classgen", ".", "ExtendedVerifier", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "classgen", ".", "GeneratorContext", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "classgen", ".", "InnerClassCompletionVisitor", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "classgen", ".", "InnerClassVisitor", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "classgen", ".", "VariableScopeVisitor", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "classgen", ".", "Verifier", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "control", ".", "io", ".", "InputStreamReaderSource", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "control", ".", "io", ".", "ReaderSource", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "control", ".", "messages", ".", "ExceptionMessage", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "control", ".", "messages", ".", "Message", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "control", ".", "messages", ".", "SimpleMessage", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "syntax", ".", "SyntaxException", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "tools", ".", "GroovyClass", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "transform", ".", "ASTTransformationVisitor", ";", "import", "org", ".", "objectweb", ".", "asm", ".", "ClassVisitor", ";", "import", "org", ".", "objectweb", ".", "asm", ".", "ClassWriter", ";", "public", "class", "CompilationUnit", "extends", "ProcessingUnit", "{", "private", "GroovyClassLoader", "transformLoader", ";", "protected", "Map", "<", "String", ",", "SourceUnit", ">", "sources", ";", "protected", "Map", "summariesBySourceName", ";", "protected", "Map", "summariesByPublicClassName", ";", "protected", "Map", "classSourcesByPublicClassName", ";", "protected", "List", "<", "String", ">", "names", ";", "protected", "LinkedList", "<", "SourceUnit", ">", "queuedSources", ";", "protected", "CompileUnit", "ast", ";", "protected", "List", "<", "GroovyClass", ">", "generatedClasses", ";", "protected", "Verifier", "verifier", ";", "protected", "boolean", "debug", ";", "protected", "boolean", "configured", ";", "protected", "ClassgenCallback", "classgenCallback", ";", "protected", "ProgressCallback", "progressCallback", ";", "protected", "ResolveVisitor", "resolveVisitor", ";", "protected", "StaticImportVisitor", "staticImportVisitor", ";", "protected", "OptimizerVisitor", "optimizer", ";", "LinkedList", "[", "]", "phaseOperations", ";", "LinkedList", "[", "]", "newPhaseOperations", ";", "public", "CompilationUnit", "(", ")", "{", "this", "(", "null", ",", "null", ",", "null", ")", ";", "}", "public", "CompilationUnit", "(", "GroovyClassLoader", "loader", ")", "{", "this", "(", "null", ",", "null", ",", "loader", ")", ";", "}", "public", "CompilationUnit", "(", "CompilerConfiguration", "configuration", ")", "{", "this", "(", "configuration", ",", "null", ",", "null", ")", ";", "}", "public", "CompilationUnit", "(", "CompilerConfiguration", "configuration", ",", "CodeSource", "security", ",", "GroovyClassLoader", "loader", ")", "{", "this", "(", "configuration", ",", "security", ",", "loader", ",", "null", ",", "true", ",", "null", ")", ";", "}", "public", "CompilationUnit", "(", "CompilerConfiguration", "configuration", ",", "CodeSource", "security", ",", "GroovyClassLoader", "loader", ",", "GroovyClassLoader", "transformLoader", ",", "boolean", "allowTransforms", ",", "String", "groovyTransformsToRunOnReconcile", ")", "{", "super", "(", "configuration", ",", "loader", ",", "null", ")", ";", "this", ".", "allowTransforms", "=", "allowTransforms", ";", "this", ".", "transformLoader", "=", "transformLoader", ";", "this", ".", "names", "=", "new", "ArrayList", "<", "String", ">", "(", ")", ";", "this", ".", "queuedSources", "=", "new", "LinkedList", "<", "SourceUnit", ">", "(", ")", ";", "this", ".", "sources", "=", "new", "HashMap", "<", "String", ",", "SourceUnit", ">", "(", ")", ";", "this", ".", "summariesBySourceName", "=", "new", "HashMap", "(", ")", ";", "this", ".", "summariesByPublicClassName", "=", "new", "HashMap", "(", ")", ";", "this", ".", "classSourcesByPublicClassName", "=", "new", "HashMap", "(", ")", ";", "this", ".", "ast", "=", "new", "CompileUnit", "(", "this", ".", "classLoader", ",", "security", ",", "this", ".", "configuration", ")", ";", "this", ".", "generatedClasses", "=", "new", "ArrayList", "<", "GroovyClass", ">", "(", ")", ";", "this", ".", "verifier", "=", "new", "Verifier", "(", ")", ";", "this", ".", "resolveVisitor", "=", "new", "ResolveVisitor", "(", "this", ")", ";", "this", ".", "staticImportVisitor", "=", "new", "StaticImportVisitor", "(", "this", ")", ";", "this", ".", "optimizer", "=", "new", "OptimizerVisitor", "(", "this", ")", ";", "phaseOperations", "=", "new", "LinkedList", "[", "Phases", ".", "ALL", "+", "1", "]", ";", "newPhaseOperations", "=", "new", "LinkedList", "[", "Phases", ".", "ALL", "+", "1", "]", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "phaseOperations", ".", "length", ";", "i", "++", ")", "{", "phaseOperations", "[", "i", "]", "=", "new", "LinkedList", "(", ")", ";", "newPhaseOperations", "[", "i", "]", "=", "new", "LinkedList", "(", ")", ";", "}", "addPhaseOperation", "(", "new", "SourceUnitOperation", "(", ")", "{", "public", "void", "call", "(", "SourceUnit", "source", ")", "throws", "CompilationFailedException", "{", "source", ".", "parse", "(", ")", ";", "}", "}", ",", "Phases", ".", "PARSING", ")", ";", "addPhaseOperation", "(", "convert", ",", "Phases", ".", "CONVERSION", ")", ";", "addPhaseOperation", "(", "new", "PrimaryClassNodeOperation", "(", ")", "{", "public", "void", "call", "(", "SourceUnit", "source", ",", "GeneratorContext", "context", ",", "ClassNode", "classNode", ")", "throws", "CompilationFailedException", "{", "EnumVisitor", "ev", "=", "new", "EnumVisitor", "(", "CompilationUnit", ".", "this", ",", "source", ")", ";", "ev", ".", "visitClass", "(", "classNode", ")", ";", "}", "}", ",", "Phases", ".", "CONVERSION", ")", ";", "addPhaseOperation", "(", "resolve", ",", "Phases", ".", "SEMANTIC_ANALYSIS", ")", ";", "addPhaseOperation", "(", "staticImport", ",", "Phases", ".", "SEMANTIC_ANALYSIS", ")", ";", "addPhaseOperation", "(", "new", "PrimaryClassNodeOperation", "(", ")", "{", "public", "void", "call", "(", "SourceUnit", "source", ",", "GeneratorContext", "context", ",", "ClassNode", "classNode", ")", "throws", "CompilationFailedException", "{", "InnerClassVisitor", "iv", "=", "new", "InnerClassVisitor", "(", "CompilationUnit", ".", "this", ",", "source", ")", ";", "iv", ".", "visitClass", "(", "classNode", ")", ";", "}", "}", ",", "Phases", ".", "SEMANTIC_ANALYSIS", ")", ";", "addPhaseOperation", "(", "compileCompleteCheck", ",", "Phases", ".", "CANONICALIZATION", ")", ";", "addPhaseOperation", "(", "classgen", ",", "Phases", ".", "CLASS_GENERATION", ")", ";", "ASTTransformationVisitor", ".", "addPhaseOperations", "(", "this", ")", ";", "addPhaseOperation", "(", "new", "PrimaryClassNodeOperation", "(", ")", "{", "public", "void", "call", "(", "SourceUnit", "source", ",", "GeneratorContext", "context", ",", "ClassNode", "classNode", ")", "throws", "CompilationFailedException", "{", "InnerClassCompletionVisitor", "iv", "=", "new", "InnerClassCompletionVisitor", "(", "CompilationUnit", ".", "this", ",", "source", ")", ";", "iv", ".", "visitClass", "(", "classNode", ")", ";", "}", "}", ",", "Phases", ".", "CANONICALIZATION", ")", ";", "this", ".", "classgenCallback", "=", "null", ";", "}", "public", "void", "ensureASTTransformVisitorAdded", "(", ")", "{", "ASTTransformationVisitor", ".", "addPhaseOperations", "(", "this", ")", ";", "}", "public", "GroovyClassLoader", "getTransformLoader", "(", ")", "{", "return", "transformLoader", "==", "null", "?", "getClassLoader", "(", ")", ":", "transformLoader", ";", "}", "public", "void", "addPhaseOperation", "(", "SourceUnitOperation", "op", ",", "int", "phase", ")", "{", "if", "(", "phase", "<", "0", "||", "phase", ">", "Phases", ".", "ALL", ")", "throw", "new", "IllegalArgumentException", "(", "\"phase", "\"", "+", "phase", "+", "\"", "is", "unknown\"", ")", ";", "phaseOperations", "[", "phase", "]", ".", "add", "(", "op", ")", ";", "}", "public", "void", "addPhaseOperation", "(", "PrimaryClassNodeOperation", "op", ",", "int", "phase", ")", "{", "if", "(", "phase", "<", "0", "||", "phase", ">", "Phases", ".", "ALL", ")", "throw", "new", "IllegalArgumentException", "(", "\"phase", "\"", "+", "phase", "+", "\"", "is", "unknown\"", ")", ";", "phaseOperations", "[", "phase", "]", ".", "add", "(", "op", ")", ";", "}", "public", "void", "addPhaseOperation", "(", "GroovyClassOperation", "op", ")", "{", "phaseOperations", "[", "Phases", ".", "OUTPUT", "]", ".", "addFirst", "(", "op", ")", ";", "}", "public", "void", "addNewPhaseOperation", "(", "SourceUnitOperation", "op", ",", "int", "phase", ")", "{", "if", "(", "phase", "<", "0", "||", "phase", ">", "Phases", ".", "ALL", ")", "throw", "new", "IllegalArgumentException", "(", "\"phase", "\"", "+", "phase", "+", "\"", "is", "unknown\"", ")", ";", "newPhaseOperations", "[", "phase", "]", ".", "add", "(", "op", ")", ";", "}", "public", "boolean", "removeOutputPhaseOperation", "(", ")", "{", "return", "phaseOperations", "[", "Phases", ".", "OUTPUT", "]", ".", "remove", "(", "output", ")", ";", "}", "public", "void", "configure", "(", "CompilerConfiguration", "configuration", ")", "{", "super", ".", "configure", "(", "configuration", ")", ";", "this", ".", "debug", "=", "configuration", ".", "getDebug", "(", ")", ";", "if", "(", "!", "this", ".", "configured", "&&", "this", ".", "classLoader", "instanceof", "GroovyClassLoader", ")", "{", "appendCompilerConfigurationClasspathToClassLoader", "(", "configuration", ",", "(", "GroovyClassLoader", ")", "this", ".", "classLoader", ")", ";", "}", "this", ".", "configured", "=", "true", ";", "}", "private", "void", "appendCompilerConfigurationClasspathToClassLoader", "(", "CompilerConfiguration", "configuration", ",", "GroovyClassLoader", "classLoader", ")", "{", "}", "public", "CompileUnit", "getAST", "(", ")", "{", "return", "this", ".", "ast", ";", "}", "public", "Map", "getSummariesBySourceName", "(", ")", "{", "return", "summariesBySourceName", ";", "}", "public", "Map", "getSummariesByPublicClassName", "(", ")", "{", "return", "summariesByPublicClassName", ";", "}", "public", "Map", "getClassSourcesByPublicClassName", "(", ")", "{", "return", "classSourcesByPublicClassName", ";", "}", "public", "boolean", "isPublicClass", "(", "String", "className", ")", "{", "return", "summariesByPublicClassName", ".", "containsKey", "(", "className", ")", ";", "}", "public", "List", "getClasses", "(", ")", "{", "return", "generatedClasses", ";", "}", "public", "ClassNode", "getFirstClassNode", "(", ")", "{", "return", "this", ".", "ast", ".", "getModules", "(", ")", ".", "get", "(", "0", ")", ".", "getClasses", "(", ")", ".", "get", "(", "0", ")", ";", "}", "public", "ClassNode", "getClassNode", "(", "final", "String", "name", ")", "{", "final", "ClassNode", "[", "]", "result", "=", "new", "ClassNode", "[", "]", "{", "null", "}", ";", "PrimaryClassNodeOperation", "handler", "=", "new", "PrimaryClassNodeOperation", "(", ")", "{", "public", "void", "call", "(", "SourceUnit", "source", ",", "GeneratorContext", "context", ",", "ClassNode", "classNode", ")", "{", "if", "(", "classNode", ".", "getName", "(", ")", ".", "equals", "(", "name", ")", ")", "{", "result", "[", "0", "]", "=", "classNode", ";", "}", "}", "}", ";", "try", "{", "applyToPrimaryClassNodes", "(", "handler", ")", ";", "}", "catch", "(", "CompilationFailedException", "e", ")", "{", "if", "(", "debug", ")", "e", ".", "printStackTrace", "(", ")", ";", "}", "return", "result", "[", "0", "]", ";", "}", "public", "void", "addSources", "(", "String", "[", "]", "paths", ")", "{", "for", "(", "String", "path", ":", "paths", ")", "{", "addSource", "(", "new", "File", "(", "path", ")", ")", ";", "}", "}", "public", "void", "addSources", "(", "File", "[", "]", "files", ")", "{", "for", "(", "File", "file", ":", "files", ")", "{", "addSource", "(", "file", ")", ";", "}", "}", "public", "SourceUnit", "addSource", "(", "File", "file", ")", "{", "return", "addSource", "(", "new", "SourceUnit", "(", "file", ",", "configuration", ",", "classLoader", ",", "getErrorCollector", "(", ")", ")", ")", ";", "}", "public", "SourceUnit", "addSource", "(", "URL", "url", ")", "{", "return", "addSource", "(", "new", "SourceUnit", "(", "url", ",", "configuration", ",", "classLoader", ",", "getErrorCollector", "(", ")", ")", ")", ";", "}", "public", "SourceUnit", "addSource", "(", "String", "name", ",", "InputStream", "stream", ")", "{", "ReaderSource", "source", "=", "new", "InputStreamReaderSource", "(", "stream", ",", "configuration", ")", ";", "return", "addSource", "(", "new", "SourceUnit", "(", "name", ",", "source", ",", "configuration", ",", "classLoader", ",", "getErrorCollector", "(", ")", ")", ")", ";", "}", "public", "SourceUnit", "addSource", "(", "String", "name", ",", "String", "scriptText", ")", "{", "return", "addSource", "(", "new", "SourceUnit", "(", "name", ",", "scriptText", ",", "configuration", ",", "classLoader", ",", "getErrorCollector", "(", ")", ")", ")", ";", "}", "public", "SourceUnit", "addSource", "(", "SourceUnit", "source", ")", "{", "String", "name", "=", "source", ".", "getName", "(", ")", ";", "source", ".", "setClassLoader", "(", "this", ".", "classLoader", ")", ";", "for", "(", "SourceUnit", "su", ":", "queuedSources", ")", "{", "if", "(", "name", ".", "equals", "(", "su", ".", "getName", "(", ")", ")", ")", "return", "su", ";", "}", "if", "(", "iterating", ")", "{", "GroovyBugError", "gbe", "=", "new", "GroovyBugError", "(", "\"\"", "+", "source", ".", "getName", "(", ")", "+", "\"'\"", ")", ";", "gbe", ".", "printStackTrace", "(", ")", ";", "throw", "gbe", ";", "}", "queuedSources", ".", "add", "(", "source", ")", ";", "return", "source", ";", "}", "public", "Iterator", "<", "SourceUnit", ">", "iterator", "(", ")", "{", "return", "new", "Iterator", "<", "SourceUnit", ">", "(", ")", "{", "Iterator", "<", "String", ">", "nameIterator", "=", "names", ".", "iterator", "(", ")", ";", "public", "boolean", "hasNext", "(", ")", "{", "return", "nameIterator", ".", "hasNext", "(", ")", ";", "}", "public", "SourceUnit", "next", "(", ")", "{", "String", "name", "=", "nameIterator", ".", "next", "(", ")", ";", "return", "sources", ".", "get", "(", "name", ")", ";", "}", "public", "void", "remove", "(", ")", "{", "throw", "new", "UnsupportedOperationException", "(", ")", ";", "}", "}", ";", "}", "public", "void", "addClassNode", "(", "ClassNode", "node", ")", "{", "ModuleNode", "module", "=", "new", "ModuleNode", "(", "this", ".", "ast", ")", ";", "this", ".", "ast", ".", "addModule", "(", "module", ")", ";", "module", ".", "addClass", "(", "node", ")", ";", "}", "public", "abstract", "static", "class", "ClassgenCallback", "{", "public", "abstract", "void", "call", "(", "ClassVisitor", "writer", ",", "ClassNode", "node", ")", "throws", "CompilationFailedException", ";", "}", "public", "void", "setClassgenCallback", "(", "ClassgenCallback", "visitor", ")", "{", "this", ".", "classgenCallback", "=", "visitor", ";", "}", "public", "abstract", "static", "class", "ProgressCallback", "{", "public", "abstract", "void", "call", "(", "ProcessingUnit", "context", ",", "int", "phase", ")", "throws", "CompilationFailedException", ";", "}", "public", "interface", "ProgressListener", "{", "void", "parseComplete", "(", "int", "phase", ",", "String", "sourceUnitName", ")", ";", "void", "generateComplete", "(", "int", "phase", ",", "ClassNode", "classNode", ")", ";", "}", "private", "ProgressListener", "getProgressListener", "(", ")", "{", "return", "this", ".", "listener", ";", "}", "public", "void", "setProgressListener", "(", "ProgressListener", "listener", ")", "{", "this", ".", "listener", "=", "listener", ";", "}", "private", "ProgressListener", "listener", ";", "public", "void", "setProgressCallback", "(", "ProgressCallback", "callback", ")", "{", "this", ".", "progressCallback", "=", "callback", ";", "}", "public", "void", "compile", "(", ")", "throws", "CompilationFailedException", "{", "compile", "(", "Phases", ".", "ALL", ")", ";", "}", "public", "void", "compile", "(", "int", "throughPhase", ")", "throws", "CompilationFailedException", "{", "gotoPhase", "(", "Phases", ".", "INITIALIZATION", ")", ";", "throughPhase", "=", "Math", ".", "min", "(", "throughPhase", ",", "Phases", ".", "ALL", ")", ";", "while", "(", "throughPhase", ">=", "phase", "&&", "phase", "<=", "Phases", ".", "ALL", ")", "{", "if", "(", "phase", "==", "Phases", ".", "SEMANTIC_ANALYSIS", ")", "{", "doPhaseOperation", "(", "resolve", ")", ";", "if", "(", "dequeued", "(", ")", ")", "continue", ";", "}", "processPhaseOperations", "(", "phase", ")", ";", "processNewPhaseOperations", "(", "phase", ")", ";", "if", "(", "progressCallback", "!=", "null", ")", "progressCallback", ".", "call", "(", "this", ",", "phase", ")", ";", "completePhase", "(", ")", ";", "applyToSourceUnits", "(", "mark", ")", ";", "if", "(", "dequeued", "(", ")", ")", "continue", ";", "gotoPhase", "(", "phase", "+", "1", ")", ";", "if", "(", "phase", "==", "Phases", ".", "CLASS_GENERATION", ")", "{", "sortClasses", "(", ")", ";", "}", "}", "errorCollector", ".", "failIfErrors", "(", ")", ";", "}", "private", "void", "processPhaseOperations", "(", "int", "ph", ")", "{", "LinkedList", "ops", "=", "phaseOperations", "[", "ph", "]", ";", "for", "(", "Object", "next", ":", "ops", ")", "{", "doPhaseOperation", "(", "next", ")", ";", "}", "}", "private", "void", "processNewPhaseOperations", "(", "int", "currPhase", ")", "{", "recordPhaseOpsInAllOtherPhases", "(", "currPhase", ")", ";", "LinkedList", "currentPhaseNewOps", "=", "newPhaseOperations", "[", "currPhase", "]", ";", "while", "(", "!", "currentPhaseNewOps", ".", "isEmpty", "(", ")", ")", "{", "Object", "operation", "=", "currentPhaseNewOps", ".", "removeFirst", "(", ")", ";", "phaseOperations", "[", "currPhase", "]", ".", "add", "(", "operation", ")", ";", "doPhaseOperation", "(", "operation", ")", ";", "recordPhaseOpsInAllOtherPhases", "(", "currPhase", ")", ";", "currentPhaseNewOps", "=", "newPhaseOperations", "[", "currPhase", "]", ";", "}", "}", "private", "void", "doPhaseOperation", "(", "Object", "operation", ")", "{", "if", "(", "operation", "instanceof", "PrimaryClassNodeOperation", ")", "{", "applyToPrimaryClassNodes", "(", "(", "PrimaryClassNodeOperation", ")", "operation", ")", ";", "}", "else", "if", "(", "operation", "instanceof", "SourceUnitOperation", ")", "{", "applyToSourceUnits", "(", "(", "SourceUnitOperation", ")", "operation", ")", ";", "}", "else", "{", "applyToGeneratedGroovyClasses", "(", "(", "GroovyClassOperation", ")", "operation", ")", ";", "}", "}", "private", "void", "recordPhaseOpsInAllOtherPhases", "(", "int", "currPhase", ")", "{", "for", "(", "int", "ph", "=", "Phases", ".", "INITIALIZATION", ";", "ph", "<=", "Phases", ".", "ALL", ";", "ph", "++", ")", "{", "if", "(", "ph", "!=", "currPhase", "&&", "!", "newPhaseOperations", "[", "ph", "]", ".", "isEmpty", "(", ")", ")", "{", "phaseOperations", "[", "ph", "]", ".", "addAll", "(", "newPhaseOperations", "[", "ph", "]", ")", ";", "newPhaseOperations", "[", "ph", "]", ".", "clear", "(", ")", ";", "}", "}", "}", "public", "void", "continueThrough", "(", "int", "throughPhase", ")", "throws", "CompilationFailedException", "{", "throughPhase", "=", "Math", ".", "min", "(", "throughPhase", ",", "Phases", ".", "ALL", ")", ";", "while", "(", "throughPhase", ">=", "phase", "&&", "phase", "<=", "Phases", ".", "ALL", ")", "{", "for", "(", "Iterator", "it", "=", "phaseOperations", "[", "phase", "]", ".", "iterator", "(", ")", ";", "it", ".", "hasNext", "(", ")", ";", ")", "{", "Object", "operation", "=", "it", ".", "next", "(", ")", ";", "if", "(", "operation", "instanceof", "PrimaryClassNodeOperation", ")", "{", "applyToPrimaryClassNodes", "(", "(", "PrimaryClassNodeOperation", ")", "operation", ")", ";", "}", "else", "if", "(", "operation", "instanceof", "SourceUnitOperation", ")", "{", "applyToSourceUnits", "(", "(", "SourceUnitOperation", ")", "operation", ")", ";", "}", "else", "{", "applyToGeneratedGroovyClasses", "(", "(", "GroovyClassOperation", ")", "operation", ")", ";", "}", "}", "if", "(", "progressCallback", "!=", "null", ")", "progressCallback", ".", "call", "(", "this", ",", "phase", ")", ";", "completePhase", "(", ")", ";", "applyToSourceUnits", "(", "mark", ")", ";", "if", "(", "dequeued", "(", ")", ")", "continue", ";", "gotoPhase", "(", "phase", "+", "1", ")", ";", "if", "(", "phase", "==", "Phases", ".", "CLASS_GENERATION", ")", "{", "sortClasses", "(", ")", ";", "}", "}", "errorCollector", ".", "failIfErrors", "(", ")", ";", "}", "private", "void", "sortClasses", "(", ")", "throws", "CompilationFailedException", "{", "for", "(", "ModuleNode", "module", ":", "this", ".", "ast", ".", "getModules", "(", ")", ")", "{", "module", ".", "sortClasses", "(", ")", ";", "}", "}", "protected", "boolean", "dequeued", "(", ")", "throws", "CompilationFailedException", "{", "boolean", "dequeue", "=", "!", "queuedSources", ".", "isEmpty", "(", ")", ";", "while", "(", "!", "queuedSources", ".", "isEmpty", "(", ")", ")", "{", "SourceUnit", "su", "=", "queuedSources", ".", "removeFirst", "(", ")", ";", "String", "name", "=", "su", ".", "getName", "(", ")", ";", "if", "(", "iterating", ")", "{", "GroovyBugError", "gbe", "=", "new", "GroovyBugError", "(", "\"\"", "+", "su", ".", "getName", "(", ")", "+", "\"'\"", ")", ";", "gbe", ".", "printStackTrace", "(", ")", ";", "throw", "gbe", ";", "}", "names", ".", "add", "(", "name", ")", ";", "sources", ".", "put", "(", "name", ",", "su", ")", ";", "}", "if", "(", "dequeue", ")", "{", "gotoPhase", "(", "Phases", ".", "INITIALIZATION", ")", ";", "}", "return", "dequeue", ";", "}", "private", "final", "SourceUnitOperation", "resolve", "=", "new", "SourceUnitOperation", "(", ")", "{", "public", "void", "call", "(", "SourceUnit", "source", ")", "throws", "CompilationFailedException", "{", "List", "<", "ClassNode", ">", "classes", "=", "source", ".", "ast", ".", "getClasses", "(", ")", ";", "for", "(", "ClassNode", "node", ":", "classes", ")", "{", "VariableScopeVisitor", "scopeVisitor", "=", "new", "VariableScopeVisitor", "(", "source", ")", ";", "scopeVisitor", ".", "visitClass", "(", "node", ")", ";", "resolveVisitor", ".", "startResolving", "(", "node", ",", "source", ")", ";", "}", "}", "}", ";", "private", "PrimaryClassNodeOperation", "staticImport", "=", "new", "PrimaryClassNodeOperation", "(", ")", "{", "public", "void", "call", "(", "SourceUnit", "source", ",", "GeneratorContext", "context", ",", "ClassNode", "classNode", ")", "throws", "CompilationFailedException", "{", "if", "(", "staticImportVisitor", "!=", "null", ")", "{", "staticImportVisitor", ".", "visitClass", "(", "classNode", ",", "source", ")", ";", "}", "}", "}", ";", "private", "SourceUnitOperation", "convert", "=", "new", "SourceUnitOperation", "(", ")", "{", "public", "void", "call", "(", "SourceUnit", "source", ")", "throws", "CompilationFailedException", "{", "source", ".", "convert", "(", ")", ";", "CompilationUnit", ".", "this", ".", "ast", ".", "addModule", "(", "source", ".", "getAST", "(", ")", ")", ";", "if", "(", "CompilationUnit", ".", "this", ".", "progressCallback", "!=", "null", ")", "{", "CompilationUnit", ".", "this", ".", "progressCallback", ".", "call", "(", "source", ",", "CompilationUnit", ".", "this", ".", "phase", ")", ";", "}", "}", "}", ";", "private", "GroovyClassOperation", "output", "=", "new", "GroovyClassOperation", "(", ")", "{", "public", "void", "call", "(", "GroovyClass", "gclass", ")", "throws", "CompilationFailedException", "{", "boolean", "failures", "=", "false", ";", "String", "name", "=", "gclass", ".", "getName", "(", ")", ".", "replace", "(", "'.'", ",", "File", ".", "separatorChar", ")", "+", "\".class\"", ";", "File", "path", "=", "new", "File", "(", "configuration", ".", "getTargetDirectory", "(", ")", ",", "name", ")", ";", "File", "directory", "=", "path", ".", "getParentFile", "(", ")", ";", "if", "(", "directory", "!=", "null", "&&", "!", "directory", ".", "exists", "(", ")", ")", "{", "directory", ".", "mkdirs", "(", ")", ";", "}", "byte", "[", "]", "bytes", "=", "gclass", ".", "getBytes", "(", ")", ";", "FileOutputStream", "stream", "=", "null", ";", "try", "{", "stream", "=", "new", "FileOutputStream", "(", "path", ")", ";", "stream", ".", "write", "(", "bytes", ",", "0", ",", "bytes", ".", "length", ")", ";", "}", "catch", "(", "IOException", "e", ")", "{", "getErrorCollector", "(", ")", ".", "addError", "(", "Message", ".", "create", "(", "e", ".", "getMessage", "(", ")", ",", "CompilationUnit", ".", "this", ")", ")", ";", "failures", "=", "true", ";", "}", "finally", "{", "if", "(", "stream", "!=", "null", ")", "{", "try", "{", "stream", ".", "close", "(", ")", ";", "}", "catch", "(", "Exception", "e", ")", "{", "}", "}", "}", "}", "}", ";", "private", "SourceUnitOperation", "compileCompleteCheck", "=", "new", "SourceUnitOperation", "(", ")", "{", "public", "void", "call", "(", "SourceUnit", "source", ")", "throws", "CompilationFailedException", "{", "List", "<", "ClassNode", ">", "classes", "=", "source", ".", "ast", ".", "getClasses", "(", ")", ";", "for", "(", "ClassNode", "node", ":", "classes", ")", "{", "CompileUnit", "cu", "=", "node", ".", "getCompileUnit", "(", ")", ";", "for", "(", "Iterator", "iter", "=", "cu", ".", "iterateClassNodeToCompile", "(", ")", ";", "iter", ".", "hasNext", "(", ")", ";", ")", "{", "String", "name", "=", "(", "String", ")", "iter", ".", "next", "(", ")", ";", "SourceUnit", "su", "=", "ast", ".", "getScriptSourceLocation", "(", "name", ")", ";", "List", "<", "ClassNode", ">", "classesInSourceUnit", "=", "su", ".", "ast", ".", "getClasses", "(", ")", ";", "StringBuffer", "message", "=", "new", "StringBuffer", "(", ")", ";", "message", ".", "append", "(", "\"\"", ")", ".", "append", "(", "name", ")", ".", "append", "(", "\"", "in", "\"", ")", ".", "append", "(", "su", ".", "getName", "(", ")", ")", ";", "if", "(", "classesInSourceUnit", ".", "isEmpty", "(", ")", ")", "{", "message", ".", "append", "(", "\"\"", ")", ";", "}", "else", "{", "message", ".", "append", "(", "\"\"", ")", ";", "boolean", "first", "=", "true", ";", "for", "(", "ClassNode", "cn", ":", "classesInSourceUnit", ")", "{", "if", "(", "!", "first", ")", "{", "message", ".", "append", "(", "\",", "\"", ")", ";", "}", "else", "{", "first", "=", "false", ";", "}", "message", ".", "append", "(", "cn", ".", "getName", "(", ")", ")", ";", "}", "}", "getErrorCollector", "(", ")", ".", "addErrorAndContinue", "(", "new", "SimpleMessage", "(", "message", ".", "toString", "(", ")", ",", "CompilationUnit", ".", "this", ")", ")", ";", "iter", ".", "remove", "(", ")", ";", "}", "}", "}", "}", ";", "private", "PrimaryClassNodeOperation", "classgen", "=", "new", "PrimaryClassNodeOperation", "(", ")", "{", "public", "boolean", "needSortedInput", "(", ")", "{", "return", "true", ";", "}", "public", "void", "call", "(", "SourceUnit", "source", ",", "GeneratorContext", "context", ",", "ClassNode", "classNode", ")", "throws", "CompilationFailedException", "{", "optimizer", ".", "visitClass", "(", "classNode", ",", "source", ")", ";", "if", "(", "!", "classNode", ".", "isSynthetic", "(", ")", ")", "{", "GenericsVisitor", "genericsVisitor", "=", "new", "GenericsVisitor", "(", "source", ")", ";", "genericsVisitor", ".", "visitClass", "(", "classNode", ")", ";", "}", "try", "{", "verifier", ".", "visitClass", "(", "classNode", ")", ";", "}", "catch", "(", "GroovyRuntimeException", "rpe", ")", "{", "ASTNode", "node", "=", "rpe", ".", "getNode", "(", ")", ";", "getErrorCollector", "(", ")", ".", "addError", "(", "new", "SyntaxException", "(", "rpe", ".", "getMessage", "(", ")", ",", "null", ",", "node", ".", "getLineNumber", "(", ")", ",", "node", ".", "getColumnNumber", "(", ")", ")", ",", "source", ")", ";", "}", "LabelVerifier", "lv", "=", "new", "LabelVerifier", "(", "source", ")", ";", "lv", ".", "visitClass", "(", "classNode", ")", ";", "ClassCompletionVerifier", "completionVerifier", "=", "new", "ClassCompletionVerifier", "(", "source", ")", ";", "completionVerifier", ".", "visitClass", "(", "classNode", ")", ";", "ExtendedVerifier", "xverifier", "=", "new", "ExtendedVerifier", "(", "source", ")", ";", "xverifier", ".", "visitClass", "(", "classNode", ")", ";", "getErrorCollector", "(", ")", ".", "failIfErrors", "(", ")", ";", "ClassVisitor", "visitor", "=", "createClassVisitor", "(", ")", ";", "String", "sourceName", "=", "(", "source", "==", "null", "?", "classNode", ".", "getModule", "(", ")", ".", "getDescription", "(", ")", ":", "source", ".", "getName", "(", ")", ")", ";", "if", "(", "sourceName", "!=", "null", ")", "sourceName", "=", "sourceName", ".", "substring", "(", "Math", ".", "max", "(", "sourceName", ".", "lastIndexOf", "(", "'\\\\'", ")", ",", "sourceName", ".", "lastIndexOf", "(", "'/'", ")", ")", "+", "1", ")", ";", "ClassGenerator", "generator", "=", "new", "AsmClassGenerator", "(", "source", ",", "context", ",", "visitor", ",", "classLoader", ",", "sourceName", ")", ";", "if", "(", "!", "source", ".", "getErrorCollector", "(", ")", ".", "hasErrors", "(", ")", ")", "{", "generator", ".", "visitClass", "(", "classNode", ")", ";", "byte", "[", "]", "bytes", "=", "(", "(", "ClassWriter", ")", "visitor", ")", ".", "toByteArray", "(", ")", ";", "generatedClasses", ".", "add", "(", "new", "GroovyClass", "(", "classNode", ".", "getName", "(", ")", ",", "bytes", ",", "classNode", ",", "source", ")", ")", ";", "if", "(", "CompilationUnit", ".", "this", ".", "classgenCallback", "!=", "null", ")", "{", "classgenCallback", ".", "call", "(", "visitor", ",", "classNode", ")", ";", "}", "LinkedList", "innerClasses", "=", "generator", ".", "getInnerClasses", "(", ")", ";", "while", "(", "!", "innerClasses", ".", "isEmpty", "(", ")", ")", "{", "classgen", ".", "call", "(", "source", ",", "context", ",", "(", "ClassNode", ")", "innerClasses", ".", "removeFirst", "(", ")", ")", ";", "}", "}", "}", "}", ";", "protected", "ClassVisitor", "createClassVisitor", "(", ")", "{", "return", "new", "ClassWriter", "(", "ClassWriter", ".", "COMPUTE_MAXS", ")", ";", "}", "protected", "void", "mark", "(", ")", "throws", "CompilationFailedException", "{", "applyToSourceUnits", "(", "mark", ")", ";", "}", "private", "SourceUnitOperation", "mark", "=", "new", "SourceUnitOperation", "(", ")", "{", "public", "void", "call", "(", "SourceUnit", "source", ")", "throws", "CompilationFailedException", "{", "if", "(", "source", ".", "phase", "<", "phase", ")", "{", "source", ".", "gotoPhase", "(", "phase", ")", ";", "}", "if", "(", "source", ".", "phase", "==", "phase", "&&", "phaseComplete", "&&", "!", "source", ".", "phaseComplete", ")", "{", "source", ".", "completePhase", "(", ")", ";", "}", "}", "}", ";", "public", "abstract", "static", "class", "SourceUnitOperation", "{", "public", "abstract", "void", "call", "(", "SourceUnit", "source", ")", "throws", "CompilationFailedException", ";", "}", "private", "boolean", "iterating", "=", "false", ";", "public", "void", "applyToSourceUnits", "(", "SourceUnitOperation", "body", ")", "throws", "CompilationFailedException", "{", "try", "{", "iterating", "=", "true", ";", "for", "(", "String", "name", ":", "names", ")", "{", "SourceUnit", "source", "=", "sources", ".", "get", "(", "name", ")", ";", "if", "(", "(", "source", ".", "phase", "<", "phase", ")", "||", "(", "source", ".", "phase", "==", "phase", "&&", "!", "source", ".", "phaseComplete", ")", ")", "{", "try", "{", "body", ".", "call", "(", "source", ")", ";", "if", "(", "phase", "==", "Phases", ".", "CONVERSION", "&&", "getProgressListener", "(", ")", "!=", "null", "&&", "body", "==", "phaseOperations", "[", "phase", "]", ".", "getLast", "(", ")", ")", "{", "getProgressListener", "(", ")", ".", "parseComplete", "(", "phase", ",", "name", ")", ";", "}", "}", "catch", "(", "CompilationFailedException", "e", ")", "{", "throw", "e", ";", "}", "catch", "(", "Exception", "e", ")", "{", "GroovyBugError", "gbe", "=", "new", "GroovyBugError", "(", "e", ")", ";", "changeBugText", "(", "gbe", ",", "source", ")", ";", "throw", "gbe", ";", "}", "catch", "(", "GroovyBugError", "e", ")", "{", "changeBugText", "(", "e", ",", "source", ")", ";", "throw", "e", ";", "}", "}", "}", "}", "finally", "{", "iterating", "=", "false", ";", "}", "getErrorCollector", "(", ")", ".", "failIfErrors", "(", ")", ";", "}", "public", "abstract", "static", "class", "PrimaryClassNodeOperation", "{", "public", "abstract", "void", "call", "(", "SourceUnit", "source", ",", "GeneratorContext", "context", ",", "ClassNode", "classNode", ")", "throws", "CompilationFailedException", ";", "public", "boolean", "needSortedInput", "(", ")", "{", "return", "false", ";", "}", "}", "public", "abstract", "static", "class", "GroovyClassOperation", "{", "public", "abstract", "void", "call", "(", "GroovyClass", "gclass", ")", "throws", "CompilationFailedException", ";", "}", "private", "int", "getSuperClassCount", "(", "ClassNode", "element", ")", "{", "int", "count", "=", "0", ";", "while", "(", "element", "!=", "null", ")", "{", "count", "++", ";", "element", "=", "element", ".", "getSuperClass", "(", ")", ";", "}", "return", "count", ";", "}", "private", "int", "getSuperInterfaceCount", "(", "ClassNode", "element", ")", "{", "int", "count", "=", "1", ";", "ClassNode", "[", "]", "interfaces", "=", "element", ".", "getInterfaces", "(", ")", ";", "for", "(", "ClassNode", "anInterface", ":", "interfaces", ")", "{", "count", "=", "Math", ".", "max", "(", "count", ",", "getSuperInterfaceCount", "(", "anInterface", ")", "+", "1", ")", ";", "}", "return", "count", ";", "}", "private", "List", "getPrimaryClassNodes", "(", "boolean", "sort", ")", "{", "if", "(", "sort", "==", "true", ")", "{", "List", "<", "ModuleNode", ">", "sortedModules", "=", "this", ".", "ast", ".", "getSortedModules", "(", ")", ";", "if", "(", "sortedModules", "!=", "null", ")", "{", "return", "sortedModules", ";", "}", "}", "List", "<", "ClassNode", ">", "unsorted", "=", "new", "ArrayList", "<", "ClassNode", ">", "(", ")", ";", "for", "(", "ModuleNode", "module", ":", "this", ".", "ast", ".", "getModules", "(", ")", ")", "{", "unsorted", ".", "addAll", "(", "module", ".", "getClasses", "(", ")", ")", ";", "}", "if", "(", "!", "sort", ")", "return", "unsorted", ";", "List", "<", "Integer", ">", "countIndexPairs", "=", "new", "ArrayList", "<", "Integer", ">", "(", ")", ";", "{", "int", "i", "=", "0", ";", "for", "(", "Iterator", "iter", "=", "unsorted", ".", "iterator", "(", ")", ";", "iter", ".", "hasNext", "(", ")", ";", "i", "++", ")", "{", "ClassNode", "node", "=", "(", "ClassNode", ")", "iter", ".", "next", "(", ")", ";", "if", "(", "node", ".", "isInterface", "(", ")", ")", "{", "countIndexPairs", ".", "add", "(", "(", "getSuperInterfaceCount", "(", "node", ")", "<<", "16", ")", "+", "i", ")", ";", "}", "else", "{", "countIndexPairs", ".", "add", "(", "(", "(", "getSuperClassCount", "(", "node", ")", "+", "2000", ")", "<<", "16", ")", "+", "i", ")", ";", "}", "}", "}", "Collections", ".", "sort", "(", "countIndexPairs", ")", ";", "List", "sorted", "=", "new", "ArrayList", "(", ")", ";", "for", "(", "int", "i", ":", "countIndexPairs", ")", "{", "sorted", ".", "add", "(", "unsorted", ".", "get", "(", "i", "&", "0xffff", ")", ")", ";", "}", "this", ".", "ast", ".", "setSortedModules", "(", "sorted", ")", ";", "return", "sorted", ";", "}", "private", "List", "<", "ClassNode", ">", "getSorted", "(", "int", "[", "]", "index", ",", "List", "<", "ClassNode", ">", "unsorted", ")", "{", "List", "<", "ClassNode", ">", "sorted", "=", "new", "ArrayList", "<", "ClassNode", ">", "(", "unsorted", ".", "size", "(", ")", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "unsorted", ".", "size", "(", ")", ";", "i", "++", ")", "{", "int", "min", "=", "-", "1", ";", "for", "(", "int", "j", "=", "0", ";", "j", "<", "unsorted", ".", "size", "(", ")", ";", "j", "++", ")", "{", "if", "(", "index", "[", "j", "]", "==", "-", "1", ")", "continue", ";", "if", "(", "min", "==", "-", "1", ")", "{", "min", "=", "j", ";", "}", "else", "if", "(", "index", "[", "j", "]", "<", "index", "[", "min", "]", ")", "{", "min", "=", "j", ";", "}", "}", "if", "(", "min", "==", "-", "1", ")", "break", ";", "sorted", ".", "add", "(", "unsorted", ".", "get", "(", "min", ")", ")", ";", "index", "[", "min", "]", "=", "-", "1", ";", "}", "return", "sorted", ";", "}", "public", "void", "applyToPrimaryClassNodes", "(", "PrimaryClassNodeOperation", "body", ")", "throws", "CompilationFailedException", "{", "List", "primaryClassNodes", "=", "getPrimaryClassNodes", "(", "body", ".", "needSortedInput", "(", ")", ")", ";", "Iterator", "classNodes", "=", "primaryClassNodes", ".", "iterator", "(", ")", ";", "while", "(", "classNodes", ".", "hasNext", "(", ")", ")", "{", "SourceUnit", "context", "=", "null", ";", "try", "{", "ClassNode", "classNode", "=", "(", "ClassNode", ")", "classNodes", ".", "next", "(", ")", ";", "context", "=", "classNode", ".", "getModule", "(", ")", ".", "getContext", "(", ")", ";", "if", "(", "context", "==", "null", "||", "context", ".", "phase", "<", "phase", "||", "(", "context", ".", "phase", "==", "phase", "&&", "!", "context", ".", "phaseComplete", ")", ")", "{", "body", ".", "call", "(", "context", ",", "new", "GeneratorContext", "(", "this", ".", "ast", ")", ",", "classNode", ")", ";", "if", "(", "phase", "==", "Phases", ".", "CLASS_GENERATION", "&&", "getProgressListener", "(", ")", "!=", "null", "&&", "body", "==", "phaseOperations", "[", "phase", "]", ".", "getLast", "(", ")", ")", "{", "getProgressListener", "(", ")", ".", "generateComplete", "(", "phase", ",", "classNode", ")", ";", "}", "}", "}", "catch", "(", "CompilationFailedException", "e", ")", "{", "}", "catch", "(", "NullPointerException", "npe", ")", "{", "throw", "npe", ";", "}", "catch", "(", "GroovyBugError", "e", ")", "{", "changeBugText", "(", "e", ",", "context", ")", ";", "throw", "e", ";", "}", "catch", "(", "Exception", "e", ")", "{", "ErrorCollector", "nestedCollector", "=", "null", ";", "for", "(", "Throwable", "next", "=", "e", ".", "getCause", "(", ")", ";", "next", "!=", "e", "&&", "next", "!=", "null", ";", "next", "=", "next", ".", "getCause", "(", ")", ")", "{", "if", "(", "!", "(", "next", "instanceof", "MultipleCompilationErrorsException", ")", ")", "continue", ";", "MultipleCompilationErrorsException", "mcee", "=", "(", "MultipleCompilationErrorsException", ")", "next", ";", "nestedCollector", "=", "mcee", ".", "collector", ";", "break", ";", "}", "if", "(", "nestedCollector", "!=", "null", ")", "{", "getErrorCollector", "(", ")", ".", "addCollectorContents", "(", "nestedCollector", ")", ";", "}", "else", "{", "getErrorCollector", "(", ")", ".", "addError", "(", "new", "ExceptionMessage", "(", "e", ",", "configuration", ".", "getDebug", "(", ")", ",", "this", ")", ")", ";", "}", "}", "}", "getErrorCollector", "(", ")", ".", "failIfErrors", "(", ")", ";", "}", "public", "void", "applyToGeneratedGroovyClasses", "(", "GroovyClassOperation", "body", ")", "throws", "CompilationFailedException", "{", "if", "(", "this", ".", "phase", "!=", "Phases", ".", "OUTPUT", "&&", "!", "(", "this", ".", "phase", "==", "Phases", ".", "CLASS_GENERATION", "&&", "this", ".", "phaseComplete", ")", ")", "{", "throw", "new", "GroovyBugError", "(", "\"\"", "+", "getPhaseDescription", "(", ")", ")", ";", "}", "for", "(", "GroovyClass", "gclass", ":", "this", ".", "generatedClasses", ")", "{", "try", "{", "body", ".", "call", "(", "gclass", ")", ";", "}", "catch", "(", "CompilationFailedException", "e", ")", "{", "}", "catch", "(", "NullPointerException", "npe", ")", "{", "throw", "npe", ";", "}", "catch", "(", "GroovyBugError", "e", ")", "{", "changeBugText", "(", "e", ",", "null", ")", ";", "throw", "e", ";", "}", "catch", "(", "Exception", "e", ")", "{", "throw", "new", "GroovyBugError", "(", "e", ")", ";", "}", "}", "getErrorCollector", "(", ")", ".", "failIfErrors", "(", ")", ";", "}", "private", "void", "changeBugText", "(", "GroovyBugError", "e", ",", "SourceUnit", "context", ")", "{", "e", ".", "setBugText", "(", "\"\"", "+", "getPhaseDescription", "(", ")", "+", "\"\"", "+", "(", "(", "context", "!=", "null", ")", "?", "context", ".", "getName", "(", ")", ":", "\"?\"", ")", "+", "\"'", "\"", "+", "e", ".", "getBugText", "(", ")", ")", ";", "}", "public", "void", "setResolveVisitor", "(", "ResolveVisitor", "resolveVisitor2", ")", "{", "this", ".", "resolveVisitor", "=", "resolveVisitor2", ";", "}", "public", "ResolveVisitor", "getResolveVisitor", "(", ")", "{", "return", "this", ".", "resolveVisitor", ";", "}", "public", "String", "toString", "(", ")", "{", "if", "(", "sources", "==", "null", "||", "sources", ".", "isEmpty", "(", ")", ")", "return", "super", ".", "toString", "(", ")", ";", "Set", "s", "=", "sources", ".", "keySet", "(", ")", ";", "for", "(", "Object", "o", ":", "s", ")", "{", "return", "\"\"", "+", "o", ".", "toString", "(", ")", ";", "}", "return", "\"\"", ";", "}", "public", "boolean", "allowTransforms", "=", "true", ";", "public", "boolean", "isReconcile", "=", "false", ";", "public", "void", "tweak", "(", "boolean", "isReconcile", ")", "{", "if", "(", "isReconcile", ")", "{", "verifier", ".", "inlineStaticFieldInitializersIntoClinit", "=", "false", ";", "this", ".", "staticImportVisitor", "=", "null", ";", "}", "else", "{", "verifier", ".", "inlineStaticFieldInitializersIntoClinit", "=", "true", ";", "this", ".", "staticImportVisitor", "=", "new", "StaticImportVisitor", "(", "this", ")", ";", "}", "this", ".", "isReconcile", "=", "isReconcile", ";", "}", "}", "</s>" ]
6,690
[ "<s>", "package", "org", ".", "codehaus", ".", "groovy", ".", "control", ";", "import", "static", "org", ".", "codehaus", ".", "groovy", ".", "runtime", ".", "MetaClassHelper", ".", "capitalize", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "*", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "expr", ".", "*", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "stmt", ".", "Statement", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "syntax", ".", "Types", ";", "import", "org", ".", "objectweb", ".", "asm", ".", "Opcodes", ";", "import", "java", ".", "util", ".", "*", ";", "public", "class", "StaticImportVisitor", "extends", "ClassCodeExpressionTransformer", "{", "private", "ClassNode", "currentClass", ";", "private", "MethodNode", "currentMethod", ";", "private", "SourceUnit", "source", ";", "private", "CompilationUnit", "compilationUnit", ";", "private", "boolean", "stillResolving", ";", "private", "boolean", "inSpecialConstructorCall", ";", "private", "boolean", "inClosure", ";", "private", "boolean", "inPropertyExpression", ";", "private", "Expression", "foundConstant", ";", "private", "Expression", "foundArgs", ";", "private", "boolean", "inAnnotation", ";", "private", "boolean", "inLeftExpression", ";", "public", "StaticImportVisitor", "(", "CompilationUnit", "cu", ")", "{", "compilationUnit", "=", "cu", ";", "}", "public", "void", "visitClass", "(", "ClassNode", "node", ",", "SourceUnit", "source", ")", "{", "this", ".", "currentClass", "=", "node", ";", "this", ".", "source", "=", "source", ";", "super", ".", "visitClass", "(", "node", ")", ";", "}", "@", "Override", "protected", "void", "visitConstructorOrMethod", "(", "MethodNode", "node", ",", "boolean", "isConstructor", ")", "{", "this", ".", "currentMethod", "=", "node", ";", "super", ".", "visitConstructorOrMethod", "(", "node", ",", "isConstructor", ")", ";", "this", ".", "currentMethod", "=", "null", ";", "}", "@", "Override", "public", "void", "visitAnnotations", "(", "AnnotatedNode", "node", ")", "{", "boolean", "oldInAnnotation", "=", "inAnnotation", ";", "inAnnotation", "=", "true", ";", "super", ".", "visitAnnotations", "(", "node", ")", ";", "inAnnotation", "=", "oldInAnnotation", ";", "}", "public", "Expression", "transform", "(", "Expression", "exp", ")", "{", "if", "(", "exp", "==", "null", ")", "return", "null", ";", "if", "(", "exp", ".", "getClass", "(", ")", "==", "VariableExpression", ".", "class", ")", "{", "return", "transformVariableExpression", "(", "(", "VariableExpression", ")", "exp", ")", ";", "}", "if", "(", "exp", ".", "getClass", "(", ")", "==", "BinaryExpression", ".", "class", ")", "{", "return", "transformBinaryExpression", "(", "(", "BinaryExpression", ")", "exp", ")", ";", "}", "if", "(", "exp", ".", "getClass", "(", ")", "==", "PropertyExpression", ".", "class", ")", "{", "return", "transformPropertyExpression", "(", "(", "PropertyExpression", ")", "exp", ")", ";", "}", "if", "(", "exp", ".", "getClass", "(", ")", "==", "MethodCallExpression", ".", "class", ")", "{", "return", "transformMethodCallExpression", "(", "(", "MethodCallExpression", ")", "exp", ")", ";", "}", "if", "(", "exp", ".", "getClass", "(", ")", "==", "ClosureExpression", ".", "class", ")", "{", "return", "transformClosureExpression", "(", "(", "ClosureExpression", ")", "exp", ")", ";", "}", "if", "(", "exp", ".", "getClass", "(", ")", "==", "ConstructorCallExpression", ".", "class", ")", "{", "return", "transformConstructorCallExpression", "(", "(", "ConstructorCallExpression", ")", "exp", ")", ";", "}", "if", "(", "exp", ".", "getClass", "(", ")", "==", "ArgumentListExpression", ".", "class", ")", "{", "Expression", "result", "=", "exp", ".", "transformExpression", "(", "this", ")", ";", "if", "(", "inPropertyExpression", ")", "{", "foundArgs", "=", "result", ";", "}", "return", "result", ";", "}", "if", "(", "exp", "instanceof", "ConstantExpression", ")", "{", "Expression", "result", "=", "exp", ".", "transformExpression", "(", "this", ")", ";", "if", "(", "inPropertyExpression", ")", "{", "foundConstant", "=", "result", ";", "}", "if", "(", "inAnnotation", "&&", "exp", "instanceof", "AnnotationConstantExpression", ")", "{", "ConstantExpression", "ce", "=", "(", "ConstantExpression", ")", "result", ";", "if", "(", "ce", ".", "getValue", "(", ")", "instanceof", "AnnotationNode", ")", "{", "AnnotationNode", "an", "=", "(", "AnnotationNode", ")", "ce", ".", "getValue", "(", ")", ";", "Map", "<", "String", ",", "Expression", ">", "attributes", "=", "an", ".", "getMembers", "(", ")", ";", "for", "(", "Map", ".", "Entry", "entry", ":", "attributes", ".", "entrySet", "(", ")", ")", "{", "Expression", "attrExpr", "=", "transform", "(", "(", "Expression", ")", "entry", ".", "getValue", "(", ")", ")", ";", "entry", ".", "setValue", "(", "attrExpr", ")", ";", "}", "}", "}", "return", "result", ";", "}", "return", "exp", ".", "transformExpression", "(", "this", ")", ";", "}", "private", "Expression", "transformMapEntryExpression", "(", "MapEntryExpression", "me", ",", "ClassNode", "constructorCallType", ")", "{", "Expression", "key", "=", "me", ".", "getKeyExpression", "(", ")", ";", "Expression", "value", "=", "me", ".", "getValueExpression", "(", ")", ";", "ModuleNode", "module", "=", "currentClass", ".", "getModule", "(", ")", ";", "if", "(", "module", "!=", "null", "&&", "key", "instanceof", "ConstantExpression", ")", "{", "Map", "<", "String", ",", "ImportNode", ">", "importNodes", "=", "module", ".", "getStaticImports", "(", ")", ";", "if", "(", "importNodes", ".", "containsKey", "(", "key", ".", "getText", "(", ")", ")", ")", "{", "ImportNode", "importNode", "=", "importNodes", ".", "get", "(", "key", ".", "getText", "(", ")", ")", ";", "if", "(", "importNode", ".", "getType", "(", ")", ".", "equals", "(", "constructorCallType", ")", ")", "{", "String", "newKey", "=", "importNode", ".", "getFieldName", "(", ")", ";", "return", "new", "MapEntryExpression", "(", "new", "ConstantExpression", "(", "newKey", ")", ",", "value", ".", "transformExpression", "(", "this", ")", ")", ";", "}", "}", "}", "return", "me", ";", "}", "protected", "Expression", "transformBinaryExpression", "(", "BinaryExpression", "be", ")", "{", "int", "type", "=", "be", ".", "getOperation", "(", ")", ".", "getType", "(", ")", ";", "boolean", "oldInLeftExpression", ";", "Expression", "right", "=", "transform", "(", "be", ".", "getRightExpression", "(", ")", ")", ";", "be", ".", "setRightExpression", "(", "right", ")", ";", "Expression", "left", ";", "if", "(", "type", "==", "Types", ".", "EQUAL", ")", "{", "oldInLeftExpression", "=", "inLeftExpression", ";", "inLeftExpression", "=", "true", ";", "left", "=", "transform", "(", "be", ".", "getLeftExpression", "(", ")", ")", ";", "inLeftExpression", "=", "oldInLeftExpression", ";", "if", "(", "left", "instanceof", "StaticMethodCallExpression", ")", "{", "StaticMethodCallExpression", "smce", "=", "(", "StaticMethodCallExpression", ")", "left", ";", "StaticMethodCallExpression", "result", "=", "new", "StaticMethodCallExpression", "(", "smce", ".", "getOwnerType", "(", ")", ",", "smce", ".", "getMethod", "(", ")", ",", "right", ")", ";", "setSourcePosition", "(", "result", ",", "be", ")", ";", "return", "result", ";", "}", "}", "else", "{", "left", "=", "transform", "(", "be", ".", "getLeftExpression", "(", ")", ")", ";", "}", "be", ".", "setLeftExpression", "(", "left", ")", ";", "return", "be", ";", "}", "protected", "Expression", "transformVariableExpression", "(", "VariableExpression", "ve", ")", "{", "Variable", "v", "=", "ve", ".", "getAccessedVariable", "(", ")", ";", "if", "(", "v", "!=", "null", "&&", "v", "instanceof", "DynamicVariable", ")", "{", "Expression", "result", "=", "findStaticFieldOrPropAccessorImportFromModule", "(", "v", ".", "getName", "(", ")", ")", ";", "if", "(", "result", "!=", "null", ")", "{", "setSourcePosition", "(", "result", ",", "ve", ")", ";", "if", "(", "inAnnotation", ")", "{", "result", "=", "transformInlineConstants", "(", "result", ")", ";", "}", "return", "result", ";", "}", "if", "(", "!", "inPropertyExpression", "||", "inSpecialConstructorCall", ")", "addStaticVariableError", "(", "ve", ")", ";", "}", "return", "ve", ";", "}", "private", "void", "setSourcePosition", "(", "Expression", "toSet", ",", "Expression", "origNode", ")", "{", "toSet", ".", "setSourcePosition", "(", "origNode", ")", ";", "if", "(", "toSet", "instanceof", "PropertyExpression", ")", "{", "(", "(", "PropertyExpression", ")", "toSet", ")", ".", "getProperty", "(", ")", ".", "setSourcePosition", "(", "origNode", ")", ";", "}", "}", "private", "Expression", "transformInlineConstants", "(", "Expression", "exp", ")", "{", "if", "(", "exp", "instanceof", "PropertyExpression", ")", "{", "PropertyExpression", "pe", "=", "(", "PropertyExpression", ")", "exp", ";", "if", "(", "pe", ".", "getObjectExpression", "(", ")", "instanceof", "ClassExpression", ")", "{", "ClassExpression", "ce", "=", "(", "ClassExpression", ")", "pe", ".", "getObjectExpression", "(", ")", ";", "ClassNode", "type", "=", "ce", ".", "getType", "(", ")", ";", "if", "(", "type", ".", "isEnum", "(", ")", ")", "return", "exp", ";", "Expression", "constant", "=", "findConstant", "(", "type", ".", "getField", "(", "pe", ".", "getPropertyAsString", "(", ")", ")", ")", ";", "if", "(", "constant", "!=", "null", ")", "return", "constant", ";", "}", "}", "else", "if", "(", "exp", "instanceof", "ListExpression", ")", "{", "ListExpression", "le", "=", "(", "ListExpression", ")", "exp", ";", "ListExpression", "result", "=", "new", "ListExpression", "(", ")", ";", "for", "(", "Expression", "e", ":", "le", ".", "getExpressions", "(", ")", ")", "{", "result", ".", "addExpression", "(", "transformInlineConstants", "(", "e", ")", ")", ";", "}", "return", "result", ";", "}", "return", "exp", ";", "}", "private", "Expression", "findConstant", "(", "FieldNode", "fn", ")", "{", "if", "(", "fn", "!=", "null", "&&", "!", "fn", ".", "isEnum", "(", ")", "&&", "fn", ".", "isStatic", "(", ")", "&&", "fn", ".", "isFinal", "(", ")", ")", "{", "if", "(", "fn", ".", "getInitialValueExpression", "(", ")", "instanceof", "ConstantExpression", ")", "{", "return", "fn", ".", "getInitialValueExpression", "(", ")", ";", "}", "}", "return", "null", ";", "}", "protected", "Expression", "transformMethodCallExpression", "(", "MethodCallExpression", "mce", ")", "{", "Expression", "args", "=", "transform", "(", "mce", ".", "getArguments", "(", ")", ")", ";", "Expression", "method", "=", "transform", "(", "mce", ".", "getMethod", "(", ")", ")", ";", "Expression", "object", "=", "transform", "(", "mce", ".", "getObjectExpression", "(", ")", ")", ";", "boolean", "isExplicitThisOrSuper", "=", "false", ";", "boolean", "isExplicitSuper", ";", "if", "(", "object", "instanceof", "VariableExpression", ")", "{", "VariableExpression", "ve", "=", "(", "VariableExpression", ")", "object", ";", "isExplicitThisOrSuper", "=", "!", "mce", ".", "isImplicitThis", "(", ")", "&&", "(", "ve", ".", "getName", "(", ")", ".", "equals", "(", "\"this\"", ")", "||", "ve", ".", "getName", "(", ")", ".", "equals", "(", "\"super\"", ")", ")", ";", "isExplicitSuper", "=", "ve", ".", "getName", "(", ")", ".", "equals", "(", "\"super\"", ")", ";", "if", "(", "isExplicitSuper", "&&", "currentMethod", "!=", "null", "&&", "currentMethod", ".", "isStatic", "(", ")", ")", "{", "addError", "(", "\"\"", ",", "mce", ")", ";", "return", "mce", ";", "}", "}", "if", "(", "mce", ".", "isImplicitThis", "(", ")", "||", "isExplicitThisOrSuper", ")", "{", "if", "(", "mce", ".", "isImplicitThis", "(", ")", ")", "{", "Expression", "ret", "=", "findStaticMethodImportFromModule", "(", "method", ",", "args", ")", ";", "if", "(", "ret", "!=", "null", ")", "{", "setSourcePosition", "(", "ret", ",", "mce", ")", ";", "return", "ret", ";", "}", "if", "(", "method", "instanceof", "ConstantExpression", "&&", "!", "inLeftExpression", ")", "{", "String", "methodName", "=", "(", "String", ")", "(", "(", "ConstantExpression", ")", "method", ")", ".", "getValue", "(", ")", ";", "ret", "=", "findStaticFieldOrPropAccessorImportFromModule", "(", "methodName", ")", ";", "if", "(", "ret", "!=", "null", ")", "{", "ret", "=", "new", "MethodCallExpression", "(", "ret", ",", "\"call\"", ",", "args", ")", ";", "setSourcePosition", "(", "ret", ",", "mce", ")", ";", "return", "ret", ";", "}", "}", "}", "if", "(", "method", "instanceof", "ConstantExpression", ")", "{", "ConstantExpression", "ce", "=", "(", "ConstantExpression", ")", "method", ";", "Object", "value", "=", "ce", ".", "getValue", "(", ")", ";", "if", "(", "value", "instanceof", "String", ")", "{", "String", "methodName", "=", "(", "String", ")", "value", ";", "boolean", "lookForPossibleStaticMethod", "=", "!", "methodName", ".", "equals", "(", "\"call\"", ")", ";", "if", "(", "currentMethod", "!=", "null", "&&", "!", "currentMethod", ".", "isStatic", "(", ")", ")", "{", "if", "(", "currentClass", ".", "hasPossibleMethod", "(", "methodName", ",", "args", ")", ")", "{", "lookForPossibleStaticMethod", "=", "false", ";", "}", "}", "if", "(", "inSpecialConstructorCall", "||", "(", "lookForPossibleStaticMethod", "&&", "currentClass", ".", "hasPossibleStaticMethod", "(", "methodName", ",", "args", ")", ")", ")", "{", "StaticMethodCallExpression", "smce", "=", "new", "StaticMethodCallExpression", "(", "currentClass", ",", "methodName", ",", "args", ")", ";", "setSourcePosition", "(", "smce", ",", "mce", ")", ";", "return", "smce", ";", "}", "}", "}", "}", "MethodCallExpression", "result", "=", "new", "MethodCallExpression", "(", "object", ",", "method", ",", "args", ")", ";", "result", ".", "setSafe", "(", "mce", ".", "isSafe", "(", ")", ")", ";", "result", ".", "setImplicitThis", "(", "mce", ".", "isImplicitThis", "(", ")", ")", ";", "result", ".", "setSpreadSafe", "(", "mce", ".", "isSpreadSafe", "(", ")", ")", ";", "setSourcePosition", "(", "result", ",", "mce", ")", ";", "return", "result", ";", "}", "protected", "Expression", "transformConstructorCallExpression", "(", "ConstructorCallExpression", "cce", ")", "{", "inSpecialConstructorCall", "=", "cce", ".", "isSpecialCall", "(", ")", ";", "Expression", "expression", "=", "cce", ".", "getArguments", "(", ")", ";", "if", "(", "expression", "instanceof", "TupleExpression", ")", "{", "TupleExpression", "tuple", "=", "(", "TupleExpression", ")", "expression", ";", "if", "(", "tuple", ".", "getExpressions", "(", ")", ".", "size", "(", ")", "==", "1", ")", "{", "expression", "=", "tuple", ".", "getExpression", "(", "0", ")", ";", "if", "(", "expression", "instanceof", "NamedArgumentListExpression", ")", "{", "NamedArgumentListExpression", "namedArgs", "=", "(", "NamedArgumentListExpression", ")", "expression", ";", "List", "<", "MapEntryExpression", ">", "entryExpressions", "=", "namedArgs", ".", "getMapEntryExpressions", "(", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "entryExpressions", ".", "size", "(", ")", ";", "i", "++", ")", "{", "entryExpressions", ".", "set", "(", "i", ",", "(", "MapEntryExpression", ")", "transformMapEntryExpression", "(", "entryExpressions", ".", "get", "(", "i", ")", ",", "cce", ".", "getType", "(", ")", ")", ")", ";", "}", "}", "}", "}", "Expression", "ret", "=", "cce", ".", "transformExpression", "(", "this", ")", ";", "inSpecialConstructorCall", "=", "false", ";", "return", "ret", ";", "}", "protected", "Expression", "transformClosureExpression", "(", "ClosureExpression", "ce", ")", "{", "boolean", "oldInClosure", "=", "inClosure", ";", "inClosure", "=", "true", ";", "Statement", "code", "=", "ce", ".", "getCode", "(", ")", ";", "if", "(", "code", "!=", "null", ")", "code", ".", "visit", "(", "this", ")", ";", "inClosure", "=", "oldInClosure", ";", "return", "ce", ";", "}", "protected", "Expression", "transformPropertyExpression", "(", "PropertyExpression", "pe", ")", "{", "boolean", "oldInPropertyExpression", "=", "inPropertyExpression", ";", "Expression", "oldFoundArgs", "=", "foundArgs", ";", "Expression", "oldFoundConstant", "=", "foundConstant", ";", "inPropertyExpression", "=", "true", ";", "foundArgs", "=", "null", ";", "foundConstant", "=", "null", ";", "Expression", "objectExpression", "=", "transform", "(", "pe", ".", "getObjectExpression", "(", ")", ")", ";", "if", "(", "objectExpression", "instanceof", "VariableExpression", ")", "{", "VariableExpression", "ve", "=", "(", "VariableExpression", ")", "objectExpression", ";", "boolean", "isExplicitSuper", "=", "ve", ".", "getName", "(", ")", ".", "equals", "(", "\"super\"", ")", ";", "if", "(", "isExplicitSuper", "&&", "currentMethod", "!=", "null", "&&", "currentMethod", ".", "isStatic", "(", ")", ")", "{", "addError", "(", "\"\"", ",", "pe", ")", ";", "return", "null", ";", "}", "}", "if", "(", "foundArgs", "!=", "null", "&&", "foundConstant", "!=", "null", ")", "{", "Expression", "result", "=", "findStaticMethodImportFromModule", "(", "foundConstant", ",", "foundArgs", ")", ";", "if", "(", "result", "!=", "null", ")", "{", "objectExpression", "=", "result", ";", "}", "}", "inPropertyExpression", "=", "oldInPropertyExpression", ";", "foundArgs", "=", "oldFoundArgs", ";", "foundConstant", "=", "oldFoundConstant", ";", "pe", ".", "setObjectExpression", "(", "objectExpression", ")", ";", "if", "(", "!", "inSpecialConstructorCall", ")", "checkStaticScope", "(", "pe", ")", ";", "return", "pe", ";", "}", "private", "void", "checkStaticScope", "(", "PropertyExpression", "pe", ")", "{", "if", "(", "inClosure", ")", "return", ";", "for", "(", "Expression", "it", "=", "pe", ";", "it", "!=", "null", ";", "it", "=", "(", "(", "PropertyExpression", ")", "it", ")", ".", "getObjectExpression", "(", ")", ")", "{", "if", "(", "it", "instanceof", "PropertyExpression", ")", "continue", ";", "if", "(", "it", "instanceof", "VariableExpression", ")", "{", "addStaticVariableError", "(", "(", "VariableExpression", ")", "it", ")", ";", "}", "return", ";", "}", "}", "private", "void", "addStaticVariableError", "(", "VariableExpression", "ve", ")", "{", "if", "(", "!", "inSpecialConstructorCall", "&&", "(", "inClosure", "||", "!", "ve", ".", "isInStaticContext", "(", ")", ")", ")", "return", ";", "if", "(", "stillResolving", ")", "return", ";", "if", "(", "ve", ".", "isThisExpression", "(", ")", "||", "ve", ".", "isSuperExpression", "(", ")", ")", "return", ";", "if", "(", "currentMethod", "!=", "null", "&&", "currentMethod", ".", "isStatic", "(", ")", ")", "{", "FieldNode", "fieldNode", "=", "currentMethod", ".", "getDeclaringClass", "(", ")", ".", "getField", "(", "ve", ".", "getName", "(", ")", ")", ";", "if", "(", "fieldNode", "!=", "null", "&&", "fieldNode", ".", "isStatic", "(", ")", ")", "return", ";", "}", "Variable", "v", "=", "ve", ".", "getAccessedVariable", "(", ")", ";", "if", "(", "v", "!=", "null", "&&", "!", "(", "v", "instanceof", "DynamicVariable", ")", "&&", "v", ".", "isInStaticContext", "(", ")", ")", "return", ";", "addError", "(", "\"\"", "+", "ve", ".", "getName", "(", ")", "+", "\"\"", "+", "\"\"", "+", "\"\"", "+", "\"\"", "+", "\"\"", "+", "ve", ".", "getName", "(", ")", "+", "\"\"", ",", "ve", ")", ";", "}", "private", "Expression", "findStaticFieldOrPropAccessorImportFromModule", "(", "String", "name", ")", "{", "ModuleNode", "module", "=", "currentClass", ".", "getModule", "(", ")", ";", "if", "(", "module", "==", "null", ")", "return", "null", ";", "Map", "<", "String", ",", "ImportNode", ">", "importNodes", "=", "module", ".", "getStaticImports", "(", ")", ";", "stillResolving", "=", "false", ";", "Expression", "expression", ";", "String", "accessorName", "=", "getAccessorName", "(", "name", ")", ";", "if", "(", "importNodes", ".", "containsKey", "(", "accessorName", ")", ")", "{", "ImportNode", "importNode", "=", "importNodes", ".", "get", "(", "accessorName", ")", ";", "expression", "=", "findStaticPropertyAccessorByFullName", "(", "importNode", ".", "getType", "(", ")", ",", "importNode", ".", "getFieldName", "(", ")", ")", ";", "if", "(", "expression", "!=", "null", ")", "return", "expression", ";", "expression", "=", "findStaticPropertyAccessor", "(", "importNode", ".", "getType", "(", ")", ",", "getPropNameForAccessor", "(", "importNode", ".", "getFieldName", "(", ")", ")", ")", ";", "if", "(", "expression", "!=", "null", ")", "return", "expression", ";", "}", "if", "(", "accessorName", ".", "startsWith", "(", "\"get\"", ")", ")", "{", "accessorName", "=", "\"is\"", "+", "accessorName", ".", "substring", "(", "3", ")", ";", "if", "(", "importNodes", ".", "containsKey", "(", "accessorName", ")", ")", "{", "ImportNode", "importNode", "=", "importNodes", ".", "get", "(", "accessorName", ")", ";", "expression", "=", "findStaticPropertyAccessorByFullName", "(", "importNode", ".", "getType", "(", ")", ",", "importNode", ".", "getFieldName", "(", ")", ")", ";", "if", "(", "expression", "!=", "null", ")", "return", "expression", ";", "expression", "=", "findStaticPropertyAccessor", "(", "importNode", ".", "getType", "(", ")", ",", "getPropNameForAccessor", "(", "importNode", ".", "getFieldName", "(", ")", ")", ")", ";", "if", "(", "expression", "!=", "null", ")", "return", "expression", ";", "}", "}", "if", "(", "importNodes", ".", "containsKey", "(", "name", ")", ")", "{", "ImportNode", "importNode", "=", "importNodes", ".", "get", "(", "name", ")", ";", "expression", "=", "findStaticPropertyAccessor", "(", "importNode", ".", "getType", "(", ")", ",", "importNode", ".", "getFieldName", "(", ")", ")", ";", "if", "(", "expression", "!=", "null", ")", "return", "expression", ";", "expression", "=", "findStaticField", "(", "importNode", ".", "getType", "(", ")", ",", "importNode", ".", "getFieldName", "(", ")", ")", ";", "if", "(", "expression", "!=", "null", ")", "return", "expression", ";", "}", "for", "(", "ImportNode", "importNode", ":", "module", ".", "getStaticStarImports", "(", ")", ".", "values", "(", ")", ")", "{", "ClassNode", "node", "=", "importNode", ".", "getType", "(", ")", ";", "expression", "=", "findStaticPropertyAccessor", "(", "node", ",", "name", ")", ";", "if", "(", "expression", "!=", "null", ")", "return", "expression", ";", "expression", "=", "findStaticField", "(", "node", ",", "name", ")", ";", "if", "(", "expression", "!=", "null", ")", "return", "expression", ";", "}", "return", "null", ";", "}", "private", "Expression", "findStaticMethodImportFromModule", "(", "Expression", "method", ",", "Expression", "args", ")", "{", "ModuleNode", "module", "=", "currentClass", ".", "getModule", "(", ")", ";", "if", "(", "module", "==", "null", "||", "!", "(", "method", "instanceof", "ConstantExpression", ")", ")", "return", "null", ";", "Map", "<", "String", ",", "ImportNode", ">", "importNodes", "=", "module", ".", "getStaticImports", "(", ")", ";", "ConstantExpression", "ce", "=", "(", "ConstantExpression", ")", "method", ";", "Expression", "expression", ";", "Object", "value", "=", "ce", ".", "getValue", "(", ")", ";", "if", "(", "!", "(", "value", "instanceof", "String", ")", ")", "return", "null", ";", "final", "String", "name", "=", "(", "String", ")", "value", ";", "if", "(", "importNodes", ".", "containsKey", "(", "name", ")", ")", "{", "ImportNode", "importNode", "=", "importNodes", ".", "get", "(", "name", ")", ";", "expression", "=", "findStaticMethod", "(", "importNode", ".", "getType", "(", ")", ",", "importNode", ".", "getFieldName", "(", ")", ",", "args", ")", ";", "if", "(", "expression", "!=", "null", ")", "return", "expression", ";", "expression", "=", "findStaticPropertyAccessorGivenArgs", "(", "importNode", ".", "getType", "(", ")", ",", "getPropNameForAccessor", "(", "importNode", ".", "getFieldName", "(", ")", ")", ",", "args", ")", ";", "if", "(", "expression", "!=", "null", ")", "{", "return", "new", "StaticMethodCallExpression", "(", "importNode", ".", "getType", "(", ")", ",", "importNode", ".", "getFieldName", "(", ")", ",", "args", ")", ";", "}", "}", "if", "(", "validPropName", "(", "name", ")", ")", "{", "String", "propName", "=", "getPropNameForAccessor", "(", "name", ")", ";", "if", "(", "importNodes", ".", "containsKey", "(", "propName", ")", ")", "{", "ImportNode", "importNode", "=", "importNodes", ".", "get", "(", "propName", ")", ";", "expression", "=", "findStaticMethod", "(", "importNode", ".", "getType", "(", ")", ",", "prefix", "(", "name", ")", "+", "capitalize", "(", "importNode", ".", "getFieldName", "(", ")", ")", ",", "args", ")", ";", "if", "(", "expression", "!=", "null", ")", "return", "expression", ";", "expression", "=", "findStaticPropertyAccessorGivenArgs", "(", "importNode", ".", "getType", "(", ")", ",", "importNode", ".", "getFieldName", "(", ")", ",", "args", ")", ";", "if", "(", "expression", "!=", "null", ")", "{", "return", "new", "StaticMethodCallExpression", "(", "importNode", ".", "getType", "(", ")", ",", "prefix", "(", "name", ")", "+", "capitalize", "(", "importNode", ".", "getFieldName", "(", ")", ")", ",", "args", ")", ";", "}", "}", "}", "Map", "<", "String", ",", "ImportNode", ">", "starImports", "=", "module", ".", "getStaticStarImports", "(", ")", ";", "ClassNode", "starImportType", ";", "if", "(", "isEnum", "(", "currentClass", ")", "&&", "starImports", ".", "containsKey", "(", "currentClass", ".", "getName", "(", ")", ")", ")", "{", "ImportNode", "importNode", "=", "starImports", ".", "get", "(", "currentClass", ".", "getName", "(", ")", ")", ";", "starImportType", "=", "importNode", "==", "null", "?", "null", ":", "importNode", ".", "getType", "(", ")", ";", "expression", "=", "findStaticMethod", "(", "starImportType", ",", "name", ",", "args", ")", ";", "if", "(", "expression", "!=", "null", ")", "return", "expression", ";", "}", "else", "{", "for", "(", "ImportNode", "importNode", ":", "starImports", ".", "values", "(", ")", ")", "{", "starImportType", "=", "importNode", "==", "null", "?", "null", ":", "importNode", ".", "getType", "(", ")", ";", "expression", "=", "findStaticMethod", "(", "starImportType", ",", "name", ",", "args", ")", ";", "if", "(", "expression", "!=", "null", ")", "return", "expression", ";", "expression", "=", "findStaticPropertyAccessorGivenArgs", "(", "starImportType", ",", "getPropNameForAccessor", "(", "name", ")", ",", "args", ")", ";", "if", "(", "expression", "!=", "null", ")", "{", "return", "new", "StaticMethodCallExpression", "(", "starImportType", ",", "name", ",", "args", ")", ";", "}", "}", "}", "return", "null", ";", "}", "private", "String", "prefix", "(", "String", "name", ")", "{", "return", "name", ".", "startsWith", "(", "\"is\"", ")", "?", "\"is\"", ":", "name", ".", "substring", "(", "0", ",", "3", ")", ";", "}", "private", "String", "getPropNameForAccessor", "(", "String", "fieldName", ")", "{", "int", "prefixLength", "=", "fieldName", ".", "startsWith", "(", "\"is\"", ")", "?", "2", ":", "3", ";", "if", "(", "fieldName", ".", "length", "(", ")", "<", "prefixLength", "+", "1", ")", "return", "fieldName", ";", "if", "(", "!", "validPropName", "(", "fieldName", ")", ")", "return", "fieldName", ";", "return", "String", ".", "valueOf", "(", "fieldName", ".", "charAt", "(", "prefixLength", ")", ")", ".", "toLowerCase", "(", ")", "+", "fieldName", ".", "substring", "(", "prefixLength", "+", "1", ")", ";", "}", "private", "boolean", "validPropName", "(", "String", "propName", ")", "{", "return", "propName", ".", "startsWith", "(", "\"get\"", ")", "||", "propName", ".", "startsWith", "(", "\"is\"", ")", "||", "propName", ".", "startsWith", "(", "\"set\"", ")", ";", "}", "private", "String", "getAccessorName", "(", "String", "name", ")", "{", "return", "(", "inLeftExpression", "?", "\"set\"", ":", "\"get\"", ")", "+", "capitalize", "(", "name", ")", ";", "}", "private", "Expression", "findStaticPropertyAccessorGivenArgs", "(", "ClassNode", "staticImportType", ",", "String", "propName", ",", "Expression", "args", ")", "{", "return", "findStaticPropertyAccessor", "(", "staticImportType", ",", "propName", ")", ";", "}", "private", "Expression", "findStaticPropertyAccessor", "(", "ClassNode", "staticImportType", ",", "String", "propName", ")", "{", "String", "accessorName", "=", "getAccessorName", "(", "propName", ")", ";", "Expression", "accessor", "=", "findStaticPropertyAccessorByFullName", "(", "staticImportType", ",", "accessorName", ")", ";", "if", "(", "accessor", "==", "null", "&&", "accessorName", ".", "startsWith", "(", "\"get\"", ")", ")", "{", "accessor", "=", "findStaticPropertyAccessorByFullName", "(", "staticImportType", ",", "\"is\"", "+", "accessorName", ".", "substring", "(", "3", ")", ")", ";", "}", "if", "(", "accessor", "==", "null", "&&", "hasStaticProperty", "(", "staticImportType", ",", "propName", ")", ")", "{", "if", "(", "inLeftExpression", ")", "accessor", "=", "new", "StaticMethodCallExpression", "(", "staticImportType", ",", "accessorName", ",", "ArgumentListExpression", ".", "EMPTY_ARGUMENTS", ")", ";", "else", "accessor", "=", "new", "PropertyExpression", "(", "new", "ClassExpression", "(", "staticImportType", ")", ",", "propName", ")", ";", "}", "return", "accessor", ";", "}", "private", "boolean", "hasStaticProperty", "(", "ClassNode", "staticImportType", ",", "String", "propName", ")", "{", "ClassNode", "classNode", "=", "staticImportType", ";", "while", "(", "classNode", "!=", "null", ")", "{", "for", "(", "PropertyNode", "pn", ":", "classNode", ".", "getProperties", "(", ")", ")", "{", "if", "(", "pn", ".", "getName", "(", ")", ".", "equals", "(", "propName", ")", "&&", "pn", ".", "isStatic", "(", ")", ")", "return", "true", ";", "}", "classNode", "=", "classNode", ".", "getSuperClass", "(", ")", ";", "}", "return", "false", ";", "}", "private", "Expression", "findStaticPropertyAccessorByFullName", "(", "ClassNode", "staticImportType", ",", "String", "accessorMethodName", ")", "{", "ArgumentListExpression", "dummyArgs", "=", "new", "ArgumentListExpression", "(", ")", ";", "dummyArgs", ".", "addExpression", "(", "new", "EmptyExpression", "(", ")", ")", ";", "return", "findStaticMethod", "(", "staticImportType", ",", "accessorMethodName", ",", "(", "inLeftExpression", "?", "dummyArgs", ":", "ArgumentListExpression", ".", "EMPTY_ARGUMENTS", ")", ")", ";", "}", "private", "Expression", "findStaticField", "(", "ClassNode", "staticImportType", ",", "String", "fieldName", ")", "{", "if", "(", "staticImportType", ".", "isPrimaryClassNode", "(", ")", "||", "staticImportType", ".", "isResolved", "(", ")", ")", "{", "staticImportType", ".", "getFields", "(", ")", ";", "FieldNode", "field", "=", "staticImportType", ".", "getField", "(", "fieldName", ")", ";", "if", "(", "field", "!=", "null", "&&", "field", ".", "isStatic", "(", ")", ")", "return", "new", "PropertyExpression", "(", "new", "ClassExpression", "(", "staticImportType", ")", ",", "fieldName", ")", ";", "}", "else", "{", "stillResolving", "=", "true", ";", "}", "return", "null", ";", "}", "private", "Expression", "findStaticMethod", "(", "ClassNode", "staticImportType", ",", "String", "methodName", ",", "Expression", "args", ")", "{", "if", "(", "staticImportType", ".", "isPrimaryClassNode", "(", ")", "||", "staticImportType", ".", "isResolved", "(", ")", ")", "{", "if", "(", "staticImportType", ".", "hasPossibleStaticMethod", "(", "methodName", ",", "args", ")", ")", "{", "return", "new", "StaticMethodCallExpression", "(", "staticImportType", ",", "methodName", ",", "args", ")", ";", "}", "}", "return", "null", ";", "}", "protected", "SourceUnit", "getSourceUnit", "(", ")", "{", "return", "source", ";", "}", "private", "boolean", "isEnum", "(", "ClassNode", "node", ")", "{", "return", "(", "node", ".", "getModifiers", "(", ")", "&", "Opcodes", ".", "ACC_ENUM", ")", "!=", "0", ";", "}", "}", "</s>" ]
6,691
[ "<s>", "package", "org", ".", "codehaus", ".", "groovy", ".", "syntax", ";", "@", "SuppressWarnings", "(", "\"serial\"", ")", "public", "class", "PreciseSyntaxException", "extends", "SyntaxException", "{", "private", "int", "startOffset", ";", "private", "int", "endOffset", ";", "public", "PreciseSyntaxException", "(", "String", "message", ",", "int", "line", ",", "int", "col", ",", "int", "startOffset", ",", "int", "endOffset", ")", "{", "super", "(", "message", ",", "line", ",", "col", ")", ";", "this", ".", "startOffset", "=", "startOffset", ";", "this", ".", "endOffset", "=", "endOffset", ";", "}", "public", "int", "getStartOffset", "(", ")", "{", "return", "startOffset", ";", "}", "public", "int", "getEndOffset", "(", ")", "{", "return", "endOffset", ";", "}", "}", "</s>" ]
6,692
[ "<s>", "package", "org", ".", "codehaus", ".", "groovy", ".", "classgen", ";", "import", "java", ".", "math", ".", "BigDecimal", ";", "import", "java", ".", "math", ".", "BigInteger", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "ClassHelper", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "ClassNode", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "FieldNode", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "GenericsType", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "MethodNode", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "Parameter", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "reflection", ".", "ReflectionCache", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "runtime", ".", "typehandling", ".", "DefaultTypeTransformation", ";", "import", "org", ".", "objectweb", ".", "asm", ".", "Label", ";", "import", "org", ".", "objectweb", ".", "asm", ".", "MethodVisitor", ";", "import", "org", ".", "objectweb", ".", "asm", ".", "Opcodes", ";", "public", "class", "BytecodeHelper", "implements", "Opcodes", "{", "private", "MethodVisitor", "mv", ";", "public", "MethodVisitor", "getMethodVisitor", "(", ")", "{", "return", "mv", ";", "}", "public", "BytecodeHelper", "(", "MethodVisitor", "mv", ")", "{", "this", ".", "mv", "=", "mv", ";", "}", "public", "void", "quickBoxIfNecessary", "(", "ClassNode", "type", ")", "{", "String", "descr", "=", "getTypeDescription", "(", "type", ")", ";", "if", "(", "type", "==", "ClassHelper", ".", "boolean_TYPE", ")", "{", "boxBoolean", "(", ")", ";", "}", "else", "if", "(", "ClassHelper", ".", "isPrimitiveType", "(", "type", ")", "&&", "type", "!=", "ClassHelper", ".", "VOID_TYPE", ")", "{", "ClassNode", "wrapper", "=", "ClassHelper", ".", "getWrapper", "(", "type", ")", ";", "String", "internName", "=", "getClassInternalName", "(", "wrapper", ")", ";", "mv", ".", "visitTypeInsn", "(", "NEW", ",", "internName", ")", ";", "mv", ".", "visitInsn", "(", "DUP", ")", ";", "if", "(", "type", "==", "ClassHelper", ".", "double_TYPE", "||", "type", "==", "ClassHelper", ".", "long_TYPE", ")", "{", "mv", ".", "visitInsn", "(", "DUP2_X2", ")", ";", "mv", ".", "visitInsn", "(", "POP2", ")", ";", "}", "else", "{", "mv", ".", "visitInsn", "(", "DUP2_X1", ")", ";", "mv", ".", "visitInsn", "(", "POP2", ")", ";", "}", "mv", ".", "visitMethodInsn", "(", "INVOKESPECIAL", ",", "internName", ",", "\"<init>\"", ",", "\"(\"", "+", "descr", "+", "\")V\"", ")", ";", "}", "}", "public", "void", "quickUnboxIfNecessary", "(", "ClassNode", "type", ")", "{", "if", "(", "ClassHelper", ".", "isPrimitiveType", "(", "type", ")", "&&", "type", "!=", "ClassHelper", ".", "VOID_TYPE", ")", "{", "ClassNode", "wrapper", "=", "ClassHelper", ".", "getWrapper", "(", "type", ")", ";", "String", "internName", "=", "getClassInternalName", "(", "wrapper", ")", ";", "if", "(", "type", "==", "ClassHelper", ".", "boolean_TYPE", ")", "{", "mv", ".", "visitTypeInsn", "(", "CHECKCAST", ",", "internName", ")", ";", "mv", ".", "visitMethodInsn", "(", "INVOKEVIRTUAL", ",", "internName", ",", "type", ".", "getName", "(", ")", "+", "\"Value\"", ",", "\"()\"", "+", "getTypeDescription", "(", "type", ")", ")", ";", "}", "else", "{", "mv", ".", "visitTypeInsn", "(", "CHECKCAST", ",", "\"\"", ")", ";", "mv", ".", "visitMethodInsn", "(", "INVOKEVIRTUAL", ",", "\"\"", ",", "type", ".", "getName", "(", ")", "+", "\"Value\"", ",", "\"()\"", "+", "getTypeDescription", "(", "type", ")", ")", ";", "}", "}", "}", "public", "void", "box", "(", "Class", "type", ")", "{", "if", "(", "ReflectionCache", ".", "getCachedClass", "(", "type", ")", ".", "isPrimitive", "&&", "type", "!=", "void", ".", "class", ")", "{", "String", "returnString", "=", "\"(\"", "+", "getTypeDescription", "(", "type", ")", "+", "\"\"", ";", "mv", ".", "visitMethodInsn", "(", "INVOKESTATIC", ",", "getClassInternalName", "(", "DefaultTypeTransformation", ".", "class", ".", "getName", "(", ")", ")", ",", "\"box\"", ",", "returnString", ")", ";", "}", "}", "public", "void", "box", "(", "ClassNode", "type", ")", "{", "if", "(", "type", ".", "isPrimaryClassNode", "(", ")", ")", "return", ";", "if", "(", "type", ".", "isPrimitive", "(", ")", ")", "box", "(", "type", ".", "getTypeClass", "(", ")", ")", ";", "}", "public", "void", "unbox", "(", "Class", "type", ")", "{", "if", "(", "type", ".", "isPrimitive", "(", ")", "&&", "type", "!=", "Void", ".", "TYPE", ")", "{", "String", "returnString", "=", "\"\"", "+", "getTypeDescription", "(", "type", ")", ";", "mv", ".", "visitMethodInsn", "(", "INVOKESTATIC", ",", "getClassInternalName", "(", "DefaultTypeTransformation", ".", "class", ".", "getName", "(", ")", ")", ",", "type", ".", "getName", "(", ")", "+", "\"Unbox\"", ",", "returnString", ")", ";", "}", "}", "public", "void", "unbox", "(", "ClassNode", "type", ")", "{", "if", "(", "type", ".", "isPrimaryClassNode", "(", ")", ")", "return", ";", "if", "(", "type", ".", "isPrimitive", "(", ")", ")", "unbox", "(", "type", ".", "getTypeClass", "(", ")", ")", ";", "}", "public", "static", "String", "getClassInternalName", "(", "ClassNode", "t", ")", "{", "if", "(", "t", ".", "isPrimaryClassNode", "(", ")", ")", "{", "return", "getClassInternalName", "(", "t", ".", "getName", "(", ")", ")", ";", "}", "String", "name", "=", "t", ".", "getClassInternalName", "(", ")", ";", "if", "(", "name", "==", "null", ")", "{", "if", "(", "t", ".", "hasClass", "(", ")", ")", "{", "name", "=", "getClassInternalName", "(", "t", ".", "getTypeClass", "(", ")", ")", ";", "}", "else", "{", "name", "=", "getClassInternalName", "(", "t", ".", "getName", "(", ")", ")", ";", "}", "}", "return", "name", ";", "}", "public", "static", "String", "getClassInternalName", "(", "Class", "t", ")", "{", "return", "org", ".", "objectweb", ".", "asm", ".", "Type", ".", "getInternalName", "(", "t", ")", ";", "}", "public", "static", "String", "getClassInternalName", "(", "String", "name", ")", "{", "return", "name", ".", "replace", "(", "'.'", ",", "'/'", ")", ";", "}", "public", "static", "String", "getMethodDescriptor", "(", "ClassNode", "returnType", ",", "Parameter", "[", "]", "parameters", ")", "{", "StringBuffer", "buffer", "=", "new", "StringBuffer", "(", "\"(\"", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "parameters", ".", "length", ";", "i", "++", ")", "{", "buffer", ".", "append", "(", "getTypeDescription", "(", "parameters", "[", "i", "]", ".", "getType", "(", ")", ")", ")", ";", "}", "buffer", ".", "append", "(", "\")\"", ")", ";", "buffer", ".", "append", "(", "getTypeDescription", "(", "returnType", ")", ")", ";", "return", "buffer", ".", "toString", "(", ")", ";", "}", "public", "static", "String", "getMethodDescriptor", "(", "Class", "returnType", ",", "Class", "[", "]", "paramTypes", ")", "{", "StringBuffer", "buffer", "=", "new", "StringBuffer", "(", "\"(\"", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "paramTypes", ".", "length", ";", "i", "++", ")", "{", "buffer", ".", "append", "(", "getTypeDescription", "(", "paramTypes", "[", "i", "]", ")", ")", ";", "}", "buffer", ".", "append", "(", "\")\"", ")", ";", "buffer", ".", "append", "(", "getTypeDescription", "(", "returnType", ")", ")", ";", "return", "buffer", ".", "toString", "(", ")", ";", "}", "public", "static", "String", "getTypeDescription", "(", "Class", "c", ")", "{", "return", "org", ".", "objectweb", ".", "asm", ".", "Type", ".", "getDescriptor", "(", "c", ")", ";", "}", "public", "static", "String", "getClassLoadingTypeDescription", "(", "ClassNode", "c", ")", "{", "StringBuffer", "buf", "=", "new", "StringBuffer", "(", ")", ";", "boolean", "array", "=", "false", ";", "while", "(", "true", ")", "{", "if", "(", "c", ".", "isArray", "(", ")", ")", "{", "buf", ".", "append", "(", "'['", ")", ";", "c", "=", "c", ".", "getComponentType", "(", ")", ";", "array", "=", "true", ";", "}", "else", "{", "if", "(", "ClassHelper", ".", "isPrimitiveType", "(", "c", ")", ")", "{", "buf", ".", "append", "(", "getTypeDescription", "(", "c", ")", ")", ";", "}", "else", "{", "if", "(", "array", ")", "buf", ".", "append", "(", "'L'", ")", ";", "buf", ".", "append", "(", "c", ".", "getName", "(", ")", ")", ";", "if", "(", "array", ")", "buf", ".", "append", "(", "';'", ")", ";", "}", "return", "buf", ".", "toString", "(", ")", ";", "}", "}", "}", "public", "static", "String", "getTypeDescription", "(", "ClassNode", "c", ")", "{", "return", "getTypeDescription", "(", "c", ",", "true", ")", ";", "}", "private", "static", "String", "getTypeDescription", "(", "ClassNode", "c", ",", "boolean", "end", ")", "{", "StringBuffer", "buf", "=", "new", "StringBuffer", "(", ")", ";", "ClassNode", "d", "=", "c", ";", "while", "(", "true", ")", "{", "if", "(", "ClassHelper", ".", "isPrimitiveType", "(", "d", ")", ")", "{", "char", "car", ";", "if", "(", "d", "==", "ClassHelper", ".", "int_TYPE", ")", "{", "car", "=", "'I'", ";", "}", "else", "if", "(", "d", "==", "ClassHelper", ".", "VOID_TYPE", ")", "{", "car", "=", "'V'", ";", "}", "else", "if", "(", "d", "==", "ClassHelper", ".", "boolean_TYPE", ")", "{", "car", "=", "'Z'", ";", "}", "else", "if", "(", "d", "==", "ClassHelper", ".", "byte_TYPE", ")", "{", "car", "=", "'B'", ";", "}", "else", "if", "(", "d", "==", "ClassHelper", ".", "char_TYPE", ")", "{", "car", "=", "'C'", ";", "}", "else", "if", "(", "d", "==", "ClassHelper", ".", "short_TYPE", ")", "{", "car", "=", "'S'", ";", "}", "else", "if", "(", "d", "==", "ClassHelper", ".", "double_TYPE", ")", "{", "car", "=", "'D'", ";", "}", "else", "if", "(", "d", "==", "ClassHelper", ".", "float_TYPE", ")", "{", "car", "=", "'F'", ";", "}", "else", "{", "car", "=", "'J'", ";", "}", "buf", ".", "append", "(", "car", ")", ";", "return", "buf", ".", "toString", "(", ")", ";", "}", "else", "if", "(", "d", ".", "isArray", "(", ")", ")", "{", "buf", ".", "append", "(", "'['", ")", ";", "d", "=", "d", ".", "getComponentType", "(", ")", ";", "}", "else", "{", "buf", ".", "append", "(", "'L'", ")", ";", "String", "name", "=", "d", ".", "getName", "(", ")", ";", "int", "len", "=", "name", ".", "length", "(", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "len", ";", "++", "i", ")", "{", "char", "car", "=", "name", ".", "charAt", "(", "i", ")", ";", "buf", ".", "append", "(", "car", "==", "'.'", "?", "'/'", ":", "car", ")", ";", "}", "if", "(", "end", ")", "buf", ".", "append", "(", "';'", ")", ";", "return", "buf", ".", "toString", "(", ")", ";", "}", "}", "}", "public", "static", "String", "[", "]", "getClassInternalNames", "(", "ClassNode", "[", "]", "names", ")", "{", "int", "size", "=", "names", ".", "length", ";", "String", "[", "]", "answer", "=", "new", "String", "[", "size", "]", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "size", ";", "i", "++", ")", "{", "answer", "[", "i", "]", "=", "getClassInternalName", "(", "names", "[", "i", "]", ")", ";", "}", "return", "answer", ";", "}", "protected", "void", "pushConstant", "(", "boolean", "value", ")", "{", "if", "(", "value", ")", "{", "mv", ".", "visitInsn", "(", "ICONST_1", ")", ";", "}", "else", "{", "mv", ".", "visitInsn", "(", "ICONST_0", ")", ";", "}", "}", "public", "void", "pushConstant", "(", "int", "value", ")", "{", "switch", "(", "value", ")", "{", "case", "0", ":", "mv", ".", "visitInsn", "(", "ICONST_0", ")", ";", "break", ";", "case", "1", ":", "mv", ".", "visitInsn", "(", "ICONST_1", ")", ";", "break", ";", "case", "2", ":", "mv", ".", "visitInsn", "(", "ICONST_2", ")", ";", "break", ";", "case", "3", ":", "mv", ".", "visitInsn", "(", "ICONST_3", ")", ";", "break", ";", "case", "4", ":", "mv", ".", "visitInsn", "(", "ICONST_4", ")", ";", "break", ";", "case", "5", ":", "mv", ".", "visitInsn", "(", "ICONST_5", ")", ";", "break", ";", "default", ":", "if", "(", "value", ">=", "Byte", ".", "MIN_VALUE", "&&", "value", "<=", "Byte", ".", "MAX_VALUE", ")", "{", "mv", ".", "visitIntInsn", "(", "BIPUSH", ",", "value", ")", ";", "}", "else", "if", "(", "value", ">=", "Short", ".", "MIN_VALUE", "&&", "value", "<=", "Short", ".", "MAX_VALUE", ")", "{", "mv", ".", "visitIntInsn", "(", "SIPUSH", ",", "value", ")", ";", "}", "else", "{", "mv", ".", "visitLdcInsn", "(", "Integer", ".", "valueOf", "(", "value", ")", ")", ";", "}", "}", "}", "public", "void", "doCast", "(", "Class", "type", ")", "{", "if", "(", "type", "!=", "Object", ".", "class", ")", "{", "if", "(", "type", ".", "isPrimitive", "(", ")", "&&", "type", "!=", "Void", ".", "TYPE", ")", "{", "unbox", "(", "type", ")", ";", "}", "else", "{", "mv", ".", "visitTypeInsn", "(", "CHECKCAST", ",", "type", ".", "isArray", "(", ")", "?", "getTypeDescription", "(", "type", ")", ":", "getClassInternalName", "(", "type", ".", "getName", "(", ")", ")", ")", ";", "}", "}", "}", "public", "void", "doCast", "(", "ClassNode", "type", ")", "{", "if", "(", "type", "==", "ClassHelper", ".", "OBJECT_TYPE", ")", "return", ";", "if", "(", "ClassHelper", ".", "isPrimitiveType", "(", "type", ")", "&&", "type", "!=", "ClassHelper", ".", "VOID_TYPE", ")", "{", "unbox", "(", "type", ")", ";", "}", "else", "{", "mv", ".", "visitTypeInsn", "(", "CHECKCAST", ",", "type", ".", "isArray", "(", ")", "?", "getTypeDescription", "(", "type", ")", ":", "getClassInternalName", "(", "type", ")", ")", ";", "}", "}", "public", "void", "load", "(", "ClassNode", "type", ",", "int", "idx", ")", "{", "if", "(", "type", "==", "ClassHelper", ".", "double_TYPE", ")", "{", "mv", ".", "visitVarInsn", "(", "DLOAD", ",", "idx", ")", ";", "}", "else", "if", "(", "type", "==", "ClassHelper", ".", "float_TYPE", ")", "{", "mv", ".", "visitVarInsn", "(", "FLOAD", ",", "idx", ")", ";", "}", "else", "if", "(", "type", "==", "ClassHelper", ".", "long_TYPE", ")", "{", "mv", ".", "visitVarInsn", "(", "LLOAD", ",", "idx", ")", ";", "}", "else", "if", "(", "type", "==", "ClassHelper", ".", "boolean_TYPE", "||", "type", "==", "ClassHelper", ".", "char_TYPE", "||", "type", "==", "ClassHelper", ".", "byte_TYPE", "||", "type", "==", "ClassHelper", ".", "int_TYPE", "||", "type", "==", "ClassHelper", ".", "short_TYPE", ")", "{", "mv", ".", "visitVarInsn", "(", "ILOAD", ",", "idx", ")", ";", "}", "else", "{", "mv", ".", "visitVarInsn", "(", "ALOAD", ",", "idx", ")", ";", "}", "}", "public", "void", "load", "(", "Variable", "v", ")", "{", "load", "(", "v", ".", "getType", "(", ")", ",", "v", ".", "getIndex", "(", ")", ")", ";", "}", "public", "void", "store", "(", "Variable", "v", ",", "boolean", "markStart", ")", "{", "ClassNode", "type", "=", "v", ".", "getType", "(", ")", ";", "unbox", "(", "type", ")", ";", "int", "idx", "=", "v", ".", "getIndex", "(", ")", ";", "if", "(", "type", "==", "ClassHelper", ".", "double_TYPE", ")", "{", "mv", ".", "visitVarInsn", "(", "DSTORE", ",", "idx", ")", ";", "}", "else", "if", "(", "type", "==", "ClassHelper", ".", "float_TYPE", ")", "{", "mv", ".", "visitVarInsn", "(", "FSTORE", ",", "idx", ")", ";", "}", "else", "if", "(", "type", "==", "ClassHelper", ".", "long_TYPE", ")", "{", "mv", ".", "visitVarInsn", "(", "LSTORE", ",", "idx", ")", ";", "}", "else", "if", "(", "type", "==", "ClassHelper", ".", "boolean_TYPE", "||", "type", "==", "ClassHelper", ".", "char_TYPE", "||", "type", "==", "ClassHelper", ".", "byte_TYPE", "||", "type", "==", "ClassHelper", ".", "int_TYPE", "||", "type", "==", "ClassHelper", ".", "short_TYPE", ")", "{", "mv", ".", "visitVarInsn", "(", "ISTORE", ",", "idx", ")", ";", "}", "else", "{", "mv", ".", "visitVarInsn", "(", "ASTORE", ",", "idx", ")", ";", "}", "}", "public", "void", "store", "(", "Variable", "v", ")", "{", "store", "(", "v", ",", "false", ")", ";", "}", "void", "loadConstant", "(", "Object", "value", ")", "{", "if", "(", "value", "==", "null", ")", "{", "mv", ".", "visitInsn", "(", "ACONST_NULL", ")", ";", "}", "else", "if", "(", "value", "instanceof", "String", ")", "{", "mv", ".", "visitLdcInsn", "(", "value", ")", ";", "}", "else", "if", "(", "value", "instanceof", "Character", ")", "{", "String", "className", "=", "\"\"", ";", "mv", ".", "visitTypeInsn", "(", "NEW", ",", "className", ")", ";", "mv", ".", "visitInsn", "(", "DUP", ")", ";", "mv", ".", "visitLdcInsn", "(", "value", ")", ";", "String", "methodType", "=", "\"(C)V\"", ";", "mv", ".", "visitMethodInsn", "(", "INVOKESPECIAL", ",", "className", ",", "\"<init>\"", ",", "methodType", ")", ";", "}", "else", "if", "(", "value", "instanceof", "Number", ")", "{", "Number", "n", "=", "(", "Number", ")", "value", ";", "String", "className", "=", "BytecodeHelper", ".", "getClassInternalName", "(", "value", ".", "getClass", "(", ")", ".", "getName", "(", ")", ")", ";", "String", "methodType", ";", "if", "(", "n", "instanceof", "BigDecimal", "||", "n", "instanceof", "BigInteger", ")", "{", "mv", ".", "visitTypeInsn", "(", "NEW", ",", "className", ")", ";", "mv", ".", "visitInsn", "(", "DUP", ")", ";", "mv", ".", "visitLdcInsn", "(", "n", ".", "toString", "(", ")", ")", ";", "mv", ".", "visitMethodInsn", "(", "INVOKESPECIAL", ",", "className", ",", "\"<init>\"", ",", "\"\"", ")", ";", "}", "else", "{", "if", "(", "n", "instanceof", "Integer", ")", "{", "mv", ".", "visitLdcInsn", "(", "n", ")", ";", "methodType", "=", "\"\"", ";", "}", "else", "if", "(", "n", "instanceof", "Double", ")", "{", "mv", ".", "visitLdcInsn", "(", "n", ")", ";", "methodType", "=", "\"\"", ";", "}", "else", "if", "(", "n", "instanceof", "Float", ")", "{", "mv", ".", "visitLdcInsn", "(", "n", ")", ";", "methodType", "=", "\"\"", ";", "}", "else", "if", "(", "n", "instanceof", "Long", ")", "{", "mv", ".", "visitLdcInsn", "(", "n", ")", ";", "methodType", "=", "\"\"", ";", "}", "else", "if", "(", "n", "instanceof", "Short", ")", "{", "mv", ".", "visitLdcInsn", "(", "n", ")", ";", "methodType", "=", "\"\"", ";", "}", "else", "if", "(", "n", "instanceof", "Byte", ")", "{", "mv", ".", "visitLdcInsn", "(", "n", ")", ";", "methodType", "=", "\"\"", ";", "}", "else", "{", "throw", "new", "ClassGeneratorException", "(", "\"\"", "+", "value", "+", "\"", "of", "type:", "\"", "+", "value", ".", "getClass", "(", ")", ".", "getName", "(", ")", "+", "\"\"", ")", ";", "}", "mv", ".", "visitMethodInsn", "(", "INVOKESTATIC", ",", "className", ",", "\"valueOf\"", ",", "methodType", ")", ";", "}", "}", "else", "if", "(", "value", "instanceof", "Boolean", ")", "{", "Boolean", "bool", "=", "(", "Boolean", ")", "value", ";", "String", "text", "=", "(", "bool", ".", "booleanValue", "(", ")", ")", "?", "\"TRUE\"", ":", "\"FALSE\"", ";", "mv", ".", "visitFieldInsn", "(", "GETSTATIC", ",", "\"\"", ",", "text", ",", "\"\"", ")", ";", "}", "else", "if", "(", "value", "instanceof", "Class", ")", "{", "Class", "vc", "=", "(", "Class", ")", "value", ";", "if", "(", "vc", ".", "getName", "(", ")", ".", "equals", "(", "\"\"", ")", ")", "{", "}", "else", "{", "throw", "new", "ClassGeneratorException", "(", "\"\"", "+", "value", "+", "\"", "of", "type:", "\"", "+", "value", ".", "getClass", "(", ")", ".", "getName", "(", ")", ")", ";", "}", "}", "else", "{", "throw", "new", "ClassGeneratorException", "(", "\"\"", "+", "value", "+", "\"", "of", "type:", "\"", "+", "value", ".", "getClass", "(", ")", ".", "getName", "(", ")", ")", ";", "}", "}", "public", "void", "loadVar", "(", "Variable", "variable", ")", "{", "int", "index", "=", "variable", ".", "getIndex", "(", ")", ";", "if", "(", "variable", ".", "isHolder", "(", ")", ")", "{", "mv", ".", "visitVarInsn", "(", "ALOAD", ",", "index", ")", ";", "mv", ".", "visitMethodInsn", "(", "INVOKEVIRTUAL", ",", "\"\"", ",", "\"get\"", ",", "\"\"", ")", ";", "}", "else", "{", "load", "(", "variable", ")", ";", "if", "(", "variable", "!=", "Variable", ".", "THIS_VARIABLE", "&&", "variable", "!=", "Variable", ".", "SUPER_VARIABLE", ")", "{", "box", "(", "variable", ".", "getType", "(", ")", ")", ";", "}", "}", "}", "public", "void", "loadVar", "(", "Variable", "variable", ",", "boolean", "useReferenceDirectly", ")", "{", "int", "index", "=", "variable", ".", "getIndex", "(", ")", ";", "if", "(", "variable", ".", "isHolder", "(", ")", ")", "{", "mv", ".", "visitVarInsn", "(", "ALOAD", ",", "index", ")", ";", "if", "(", "!", "useReferenceDirectly", ")", "{", "mv", ".", "visitMethodInsn", "(", "INVOKEVIRTUAL", ",", "\"\"", ",", "\"get\"", ",", "\"\"", ")", ";", "}", "}", "else", "{", "load", "(", "variable", ")", ";", "if", "(", "variable", "!=", "Variable", ".", "THIS_VARIABLE", "&&", "variable", "!=", "Variable", ".", "SUPER_VARIABLE", ")", "{", "box", "(", "variable", ".", "getType", "(", ")", ")", ";", "}", "}", "}", "public", "void", "storeVar", "(", "Variable", "variable", ")", "{", "int", "index", "=", "variable", ".", "getIndex", "(", ")", ";", "if", "(", "variable", ".", "isHolder", "(", ")", ")", "{", "mv", ".", "visitVarInsn", "(", "ALOAD", ",", "index", ")", ";", "mv", ".", "visitInsn", "(", "SWAP", ")", ";", "mv", ".", "visitMethodInsn", "(", "INVOKEVIRTUAL", ",", "\"\"", ",", "\"set\"", ",", "\"\"", ")", ";", "}", "else", "{", "store", "(", "variable", ",", "false", ")", ";", "}", "}", "public", "void", "putField", "(", "FieldNode", "fld", ")", "{", "putField", "(", "fld", ",", "getClassInternalName", "(", "fld", ".", "getOwner", "(", ")", ")", ")", ";", "}", "public", "void", "putField", "(", "FieldNode", "fld", ",", "String", "ownerName", ")", "{", "mv", ".", "visitFieldInsn", "(", "PUTFIELD", ",", "ownerName", ",", "fld", ".", "getName", "(", ")", ",", "getTypeDescription", "(", "fld", ".", "getType", "(", ")", ")", ")", ";", "}", "public", "void", "swapObjectWith", "(", "ClassNode", "type", ")", "{", "if", "(", "type", "==", "ClassHelper", ".", "long_TYPE", "||", "type", "==", "ClassHelper", ".", "double_TYPE", ")", "{", "mv", ".", "visitInsn", "(", "DUP_X2", ")", ";", "mv", ".", "visitInsn", "(", "POP", ")", ";", "}", "else", "{", "mv", ".", "visitInsn", "(", "SWAP", ")", ";", "}", "}", "public", "void", "swapWithObject", "(", "ClassNode", "type", ")", "{", "if", "(", "type", "==", "ClassHelper", ".", "long_TYPE", "||", "type", "==", "ClassHelper", ".", "double_TYPE", ")", "{", "mv", ".", "visitInsn", "(", "DUP2_X1", ")", ";", "mv", ".", "visitInsn", "(", "POP2", ")", ";", "}", "else", "{", "mv", ".", "visitInsn", "(", "SWAP", ")", ";", "}", "}", "public", "static", "ClassNode", "boxOnPrimitive", "(", "ClassNode", "type", ")", "{", "if", "(", "!", "type", ".", "isArray", "(", ")", ")", "return", "ClassHelper", ".", "getWrapper", "(", "type", ")", ";", "return", "boxOnPrimitive", "(", "type", ".", "getComponentType", "(", ")", ")", ".", "makeArray", "(", ")", ";", "}", "public", "void", "boxBoolean", "(", ")", "{", "Label", "l0", "=", "new", "Label", "(", ")", ";", "mv", ".", "visitJumpInsn", "(", "IFEQ", ",", "l0", ")", ";", "mv", ".", "visitFieldInsn", "(", "GETSTATIC", ",", "\"\"", ",", "\"TRUE\"", ",", "\"\"", ")", ";", "Label", "l1", "=", "new", "Label", "(", ")", ";", "mv", ".", "visitJumpInsn", "(", "GOTO", ",", "l1", ")", ";", "mv", ".", "visitLabel", "(", "l0", ")", ";", "mv", ".", "visitFieldInsn", "(", "GETSTATIC", ",", "\"\"", ",", "\"FALSE\"", ",", "\"\"", ")", ";", "mv", ".", "visitLabel", "(", "l1", ")", ";", "}", "public", "void", "negateBoolean", "(", ")", "{", "Label", "endLabel", "=", "new", "Label", "(", ")", ";", "Label", "falseLabel", "=", "new", "Label", "(", ")", ";", "mv", ".", "visitJumpInsn", "(", "IFNE", ",", "falseLabel", ")", ";", "mv", ".", "visitInsn", "(", "ICONST_1", ")", ";", "mv", ".", "visitJumpInsn", "(", "GOTO", ",", "endLabel", ")", ";", "mv", ".", "visitLabel", "(", "falseLabel", ")", ";", "mv", ".", "visitInsn", "(", "ICONST_0", ")", ";", "mv", ".", "visitLabel", "(", "endLabel", ")", ";", "}", "public", "void", "mark", "(", "String", "msg", ")", "{", "mv", ".", "visitLdcInsn", "(", "msg", ")", ";", "mv", ".", "visitInsn", "(", "POP", ")", ";", "}", "public", "static", "String", "formatNameForClassLoading", "(", "String", "name", ")", "{", "if", "(", "name", ".", "equals", "(", "\"int\"", ")", "||", "name", ".", "equals", "(", "\"long\"", ")", "||", "name", ".", "equals", "(", "\"short\"", ")", "||", "name", ".", "equals", "(", "\"float\"", ")", "||", "name", ".", "equals", "(", "\"double\"", ")", "||", "name", ".", "equals", "(", "\"byte\"", ")", "||", "name", ".", "equals", "(", "\"char\"", ")", "||", "name", ".", "equals", "(", "\"boolean\"", ")", "||", "name", ".", "equals", "(", "\"void\"", ")", ")", "{", "return", "name", ";", "}", "if", "(", "name", "==", "null", ")", "{", "return", "\"\"", ";", "}", "if", "(", "name", ".", "startsWith", "(", "\"[\"", ")", ")", "{", "return", "name", ".", "replace", "(", "'/'", ",", "'.'", ")", ";", "}", "if", "(", "name", ".", "startsWith", "(", "\"L\"", ")", ")", "{", "name", "=", "name", ".", "substring", "(", "1", ")", ";", "if", "(", "name", ".", "endsWith", "(", "\";\"", ")", ")", "{", "name", "=", "name", ".", "substring", "(", "0", ",", "name", ".", "length", "(", ")", "-", "1", ")", ";", "}", "return", "name", ".", "replace", "(", "'/'", ",", "'.'", ")", ";", "}", "String", "prefix", "=", "\"\"", ";", "if", "(", "name", ".", "endsWith", "(", "\"[]\"", ")", ")", "{", "prefix", "=", "\"[\"", ";", "name", "=", "name", ".", "substring", "(", "0", ",", "name", ".", "length", "(", ")", "-", "2", ")", ";", "if", "(", "name", ".", "equals", "(", "\"int\"", ")", ")", "{", "return", "prefix", "+", "\"I\"", ";", "}", "else", "if", "(", "name", ".", "equals", "(", "\"long\"", ")", ")", "{", "return", "prefix", "+", "\"J\"", ";", "}", "else", "if", "(", "name", ".", "equals", "(", "\"short\"", ")", ")", "{", "return", "prefix", "+", "\"S\"", ";", "}", "else", "if", "(", "name", ".", "equals", "(", "\"float\"", ")", ")", "{", "return", "prefix", "+", "\"F\"", ";", "}", "else", "if", "(", "name", ".", "equals", "(", "\"double\"", ")", ")", "{", "return", "prefix", "+", "\"D\"", ";", "}", "else", "if", "(", "name", ".", "equals", "(", "\"byte\"", ")", ")", "{", "return", "prefix", "+", "\"B\"", ";", "}", "else", "if", "(", "name", ".", "equals", "(", "\"char\"", ")", ")", "{", "return", "prefix", "+", "\"C\"", ";", "}", "else", "if", "(", "name", ".", "equals", "(", "\"boolean\"", ")", ")", "{", "return", "prefix", "+", "\"Z\"", ";", "}", "else", "{", "return", "prefix", "+", "\"L\"", "+", "name", ".", "replace", "(", "'/'", ",", "'.'", ")", "+", "\";\"", ";", "}", "}", "return", "name", ".", "replace", "(", "'/'", ",", "'.'", ")", ";", "}", "public", "void", "dup", "(", ")", "{", "mv", ".", "visitInsn", "(", "DUP", ")", ";", "}", "public", "void", "doReturn", "(", "ClassNode", "returnType", ")", "{", "if", "(", "returnType", "==", "ClassHelper", ".", "double_TYPE", ")", "{", "mv", ".", "visitInsn", "(", "DRETURN", ")", ";", "}", "else", "if", "(", "returnType", "==", "ClassHelper", ".", "float_TYPE", ")", "{", "mv", ".", "visitInsn", "(", "FRETURN", ")", ";", "}", "else", "if", "(", "returnType", "==", "ClassHelper", ".", "long_TYPE", ")", "{", "mv", ".", "visitInsn", "(", "LRETURN", ")", ";", "}", "else", "if", "(", "returnType", "==", "ClassHelper", ".", "boolean_TYPE", "||", "returnType", "==", "ClassHelper", ".", "char_TYPE", "||", "returnType", "==", "ClassHelper", ".", "byte_TYPE", "||", "returnType", "==", "ClassHelper", ".", "int_TYPE", "||", "returnType", "==", "ClassHelper", ".", "short_TYPE", ")", "{", "mv", ".", "visitInsn", "(", "IRETURN", ")", ";", "}", "else", "if", "(", "returnType", "==", "ClassHelper", ".", "VOID_TYPE", ")", "{", "mv", ".", "visitInsn", "(", "RETURN", ")", ";", "}", "else", "{", "mv", ".", "visitInsn", "(", "ARETURN", ")", ";", "}", "}", "private", "static", "boolean", "hasGenerics", "(", "Parameter", "[", "]", "param", ")", "{", "if", "(", "param", ".", "length", "==", "0", ")", "return", "false", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "param", ".", "length", ";", "i", "++", ")", "{", "ClassNode", "type", "=", "param", "[", "i", "]", ".", "getType", "(", ")", ";", "if", "(", "hasGenerics", "(", "type", ")", ")", "return", "true", ";", "}", "return", "false", ";", "}", "private", "static", "boolean", "hasGenerics", "(", "ClassNode", "type", ")", "{", "return", "type", ".", "isArray", "(", ")", "?", "hasGenerics", "(", "type", ".", "getComponentType", "(", ")", ")", ":", "type", ".", "getGenericsTypes", "(", ")", "!=", "null", ";", "}", "public", "static", "String", "getGenericsMethodSignature", "(", "MethodNode", "node", ")", "{", "GenericsType", "[", "]", "generics", "=", "node", ".", "getGenericsTypes", "(", ")", ";", "Parameter", "[", "]", "param", "=", "node", ".", "getParameters", "(", ")", ";", "ClassNode", "returnType", "=", "node", ".", "getReturnType", "(", ")", ";", "if", "(", "generics", "==", "null", "&&", "!", "hasGenerics", "(", "param", ")", "&&", "!", "hasGenerics", "(", "returnType", ")", ")", "return", "null", ";", "StringBuffer", "ret", "=", "new", "StringBuffer", "(", "100", ")", ";", "getGenericsTypeSpec", "(", "ret", ",", "generics", ")", ";", "GenericsType", "[", "]", "paramTypes", "=", "new", "GenericsType", "[", "param", ".", "length", "]", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "param", ".", "length", ";", "i", "++", ")", "{", "ClassNode", "pType", "=", "param", "[", "i", "]", ".", "getType", "(", ")", ";", "if", "(", "pType", ".", "getGenericsTypes", "(", ")", "==", "null", "||", "!", "pType", ".", "isGenericsPlaceHolder", "(", ")", ")", "{", "paramTypes", "[", "i", "]", "=", "new", "GenericsType", "(", "pType", ")", ";", "}", "else", "{", "paramTypes", "[", "i", "]", "=", "pType", ".", "getGenericsTypes", "(", ")", "[", "0", "]", ";", "}", "}", "addSubTypes", "(", "ret", ",", "paramTypes", ",", "\"(\"", ",", "\")\"", ")", ";", "addSubTypes", "(", "ret", ",", "new", "GenericsType", "[", "]", "{", "new", "GenericsType", "(", "returnType", ")", "}", ",", "\"\"", ",", "\"\"", ")", ";", "return", "ret", ".", "toString", "(", ")", ";", "}", "private", "static", "boolean", "usesGenericsInClassSignature", "(", "ClassNode", "node", ")", "{", "if", "(", "!", "node", ".", "isUsingGenerics", "(", ")", ")", "return", "false", ";", "if", "(", "hasGenerics", "(", "node", ")", ")", "return", "true", ";", "ClassNode", "sclass", "=", "node", ".", "getUnresolvedSuperClass", "(", "false", ")", ";", "if", "(", "sclass", ".", "isUsingGenerics", "(", ")", ")", "return", "true", ";", "ClassNode", "[", "]", "interfaces", "=", "node", ".", "getInterfaces", "(", ")", ";", "if", "(", "interfaces", "!=", "null", ")", "{", "for", "(", "int", "i", "=", "0", ";", "i", "<", "interfaces", ".", "length", ";", "i", "++", ")", "{", "if", "(", "interfaces", "[", "i", "]", ".", "isUsingGenerics", "(", ")", ")", "return", "true", ";", "}", "}", "return", "false", ";", "}", "public", "static", "String", "getGenericsSignature", "(", "ClassNode", "node", ")", "{", "if", "(", "!", "usesGenericsInClassSignature", "(", "node", ")", ")", "return", "null", ";", "GenericsType", "[", "]", "genericsTypes", "=", "node", ".", "getGenericsTypes", "(", ")", ";", "StringBuffer", "ret", "=", "new", "StringBuffer", "(", "100", ")", ";", "getGenericsTypeSpec", "(", "ret", ",", "genericsTypes", ")", ";", "GenericsType", "extendsPart", "=", "new", "GenericsType", "(", "node", ".", "getUnresolvedSuperClass", "(", "false", ")", ")", ";", "writeGenericsBounds", "(", "ret", ",", "extendsPart", ",", "true", ")", ";", "ClassNode", "[", "]", "interfaces", "=", "node", ".", "getInterfaces", "(", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "interfaces", ".", "length", ";", "i", "++", ")", "{", "GenericsType", "interfacePart", "=", "new", "GenericsType", "(", "interfaces", "[", "i", "]", ")", ";", "writeGenericsBounds", "(", "ret", ",", "interfacePart", ",", "false", ")", ";", "}", "return", "ret", ".", "toString", "(", ")", ";", "}", "private", "static", "void", "getGenericsTypeSpec", "(", "StringBuffer", "ret", ",", "GenericsType", "[", "]", "genericsTypes", ")", "{", "if", "(", "genericsTypes", "==", "null", ")", "return", ";", "ret", ".", "append", "(", "'<'", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "genericsTypes", ".", "length", ";", "i", "++", ")", "{", "String", "name", "=", "genericsTypes", "[", "i", "]", ".", "getName", "(", ")", ";", "ret", ".", "append", "(", "name", ")", ";", "ret", ".", "append", "(", "':'", ")", ";", "writeGenericsBounds", "(", "ret", ",", "genericsTypes", "[", "i", "]", ",", "true", ")", ";", "}", "ret", ".", "append", "(", "'>'", ")", ";", "}", "public", "static", "String", "getGenericsBounds", "(", "ClassNode", "type", ")", "{", "GenericsType", "[", "]", "genericsTypes", "=", "type", ".", "getGenericsTypes", "(", ")", ";", "if", "(", "genericsTypes", "==", "null", ")", "return", "null", ";", "StringBuffer", "ret", "=", "new", "StringBuffer", "(", "100", ")", ";", "if", "(", "type", ".", "isGenericsPlaceHolder", "(", ")", ")", "{", "addSubTypes", "(", "ret", ",", "type", ".", "getGenericsTypes", "(", ")", ",", "\"\"", ",", "\"\"", ")", ";", "}", "else", "{", "GenericsType", "gt", "=", "new", "GenericsType", "(", "type", ")", ";", "writeGenericsBounds", "(", "ret", ",", "gt", ",", "false", ")", ";", "}", "return", "ret", ".", "toString", "(", ")", ";", "}", "private", "static", "void", "writeGenericsBoundType", "(", "StringBuffer", "ret", ",", "ClassNode", "printType", ",", "boolean", "writeInterfaceMarker", ")", "{", "if", "(", "writeInterfaceMarker", "&&", "printType", ".", "isInterface", "(", ")", ")", "ret", ".", "append", "(", "\":\"", ")", ";", "if", "(", "printType", ".", "equals", "(", "ClassHelper", ".", "OBJECT_TYPE", ")", "&&", "printType", ".", "getGenericsTypes", "(", ")", "!=", "null", ")", "{", "ret", ".", "append", "(", "\"T\"", ")", ";", "ret", ".", "append", "(", "printType", ".", "getGenericsTypes", "(", ")", "[", "0", "]", ".", "getName", "(", ")", ")", ";", "ret", ".", "append", "(", "\";\"", ")", ";", "}", "else", "{", "ret", ".", "append", "(", "getTypeDescription", "(", "printType", ",", "false", ")", ")", ";", "addSubTypes", "(", "ret", ",", "printType", ".", "getGenericsTypes", "(", ")", ",", "\"<\"", ",", "\">\"", ")", ";", "if", "(", "!", "ClassHelper", ".", "isPrimitiveType", "(", "printType", ")", ")", "ret", ".", "append", "(", "\";\"", ")", ";", "}", "}", "private", "static", "void", "writeGenericsBounds", "(", "StringBuffer", "ret", ",", "GenericsType", "type", ",", "boolean", "writeInterfaceMarker", ")", "{", "if", "(", "type", ".", "getUpperBounds", "(", ")", "!=", "null", ")", "{", "ClassNode", "[", "]", "bounds", "=", "type", ".", "getUpperBounds", "(", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "bounds", ".", "length", ";", "i", "++", ")", "{", "writeGenericsBoundType", "(", "ret", ",", "bounds", "[", "i", "]", ",", "writeInterfaceMarker", ")", ";", "}", "}", "else", "if", "(", "type", ".", "getLowerBound", "(", ")", "!=", "null", ")", "{", "writeGenericsBoundType", "(", "ret", ",", "type", ".", "getLowerBound", "(", ")", ",", "writeInterfaceMarker", ")", ";", "}", "else", "{", "writeGenericsBoundType", "(", "ret", ",", "type", ".", "getType", "(", ")", ",", "writeInterfaceMarker", ")", ";", "}", "}", "private", "static", "void", "addSubTypes", "(", "StringBuffer", "ret", ",", "GenericsType", "[", "]", "types", ",", "String", "start", ",", "String", "end", ")", "{", "if", "(", "types", "==", "null", ")", "return", ";", "ret", ".", "append", "(", "start", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "types", ".", "length", ";", "i", "++", ")", "{", "if", "(", "types", "[", "i", "]", ".", "getType", "(", ")", ".", "isArray", "(", ")", ")", "{", "ret", ".", "append", "(", "\"[\"", ")", ";", "addSubTypes", "(", "ret", ",", "new", "GenericsType", "[", "]", "{", "new", "GenericsType", "(", "types", "[", "i", "]", ".", "getType", "(", ")", ".", "getComponentType", "(", ")", ")", "}", ",", "\"\"", ",", "\"\"", ")", ";", "}", "else", "{", "if", "(", "types", "[", "i", "]", ".", "isPlaceholder", "(", ")", ")", "{", "ret", ".", "append", "(", "'T'", ")", ";", "String", "name", "=", "types", "[", "i", "]", ".", "getName", "(", ")", ";", "ret", ".", "append", "(", "name", ")", ";", "ret", ".", "append", "(", "';'", ")", ";", "}", "else", "if", "(", "types", "[", "i", "]", ".", "isWildcard", "(", ")", ")", "{", "if", "(", "types", "[", "i", "]", ".", "getUpperBounds", "(", ")", "!=", "null", ")", "{", "ret", ".", "append", "(", "'+'", ")", ";", "writeGenericsBounds", "(", "ret", ",", "types", "[", "i", "]", ",", "false", ")", ";", "}", "else", "if", "(", "types", "[", "i", "]", ".", "getLowerBound", "(", ")", "!=", "null", ")", "{", "ret", ".", "append", "(", "'-'", ")", ";", "writeGenericsBounds", "(", "ret", ",", "types", "[", "i", "]", ",", "false", ")", ";", "}", "else", "{", "ret", ".", "append", "(", "'*'", ")", ";", "}", "}", "else", "{", "writeGenericsBounds", "(", "ret", ",", "types", "[", "i", "]", ",", "false", ")", ";", "}", "}", "}", "ret", ".", "append", "(", "end", ")", ";", "}", "}", "</s>" ]
6,693
[ "<s>", "package", "org", ".", "codehaus", ".", "groovy", ".", "classgen", ";", "import", "java", ".", "lang", ".", "reflect", ".", "Field", ";", "import", "java", ".", "lang", ".", "reflect", ".", "Modifier", ";", "import", "java", ".", "util", ".", "List", ";", "import", "java", ".", "util", ".", "Map", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "ASTNode", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "AnnotationNode", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "ClassHelper", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "ClassNode", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "FieldNode", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "MethodNode", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "expr", ".", "AnnotationConstantExpression", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "expr", ".", "ClassExpression", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "expr", ".", "ClosureExpression", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "expr", ".", "ConstantExpression", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "expr", ".", "Expression", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "expr", ".", "ListExpression", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "expr", ".", "PropertyExpression", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "expr", ".", "VariableExpression", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "stmt", ".", "ReturnStatement", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "control", ".", "ErrorCollector", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "control", ".", "SourceUnit", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "control", ".", "messages", ".", "SyntaxErrorMessage", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "syntax", ".", "SyntaxException", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "vmplugin", ".", "VMPluginFactory", ";", "public", "class", "AnnotationVisitor", "{", "private", "SourceUnit", "source", ";", "private", "ErrorCollector", "errorCollector", ";", "private", "AnnotationNode", "annotation", ";", "private", "ClassNode", "reportClass", ";", "public", "AnnotationVisitor", "(", "SourceUnit", "source", ",", "ErrorCollector", "errorCollector", ")", "{", "this", ".", "source", "=", "source", ";", "this", ".", "errorCollector", "=", "errorCollector", ";", "}", "public", "void", "setReportClass", "(", "ClassNode", "cn", ")", "{", "reportClass", "=", "cn", ";", "}", "public", "AnnotationNode", "visit", "(", "AnnotationNode", "node", ")", "{", "this", ".", "annotation", "=", "node", ";", "this", ".", "reportClass", "=", "node", ".", "getClassNode", "(", ")", ";", "if", "(", "!", "isValidAnnotationClass", "(", "node", ".", "getClassNode", "(", ")", ")", ")", "{", "addError", "(", "\"class", "\"", "+", "node", ".", "getClassNode", "(", ")", ".", "getName", "(", ")", "+", "\"\"", ")", ";", "return", "node", ";", "}", "if", "(", "!", "checkIfMandatoryAnnotationValuesPassed", "(", "node", ")", ")", "{", "return", "node", ";", "}", "if", "(", "!", "checkIfValidEnumConstsAreUsed", "(", "node", ")", ")", "{", "return", "node", ";", "}", "Map", "<", "String", ",", "Expression", ">", "attributes", "=", "node", ".", "getMembers", "(", ")", ";", "for", "(", "Map", ".", "Entry", "<", "String", ",", "Expression", ">", "entry", ":", "attributes", ".", "entrySet", "(", ")", ")", "{", "String", "attrName", "=", "entry", ".", "getKey", "(", ")", ";", "Expression", "attrExpr", "=", "transformInlineConstants", "(", "entry", ".", "getValue", "(", ")", ")", ";", "entry", ".", "setValue", "(", "attrExpr", ")", ";", "ClassNode", "attrType", "=", "getAttributeType", "(", "node", ",", "attrName", ")", ";", "visitExpression", "(", "attrName", ",", "attrExpr", ",", "attrType", ")", ";", "}", "VMPluginFactory", ".", "getPlugin", "(", ")", ".", "configureAnnotation", "(", "node", ")", ";", "return", "this", ".", "annotation", ";", "}", "private", "boolean", "checkIfValidEnumConstsAreUsed", "(", "AnnotationNode", "node", ")", "{", "boolean", "ok", "=", "true", ";", "Map", "<", "String", ",", "Expression", ">", "attributes", "=", "node", ".", "getMembers", "(", ")", ";", "for", "(", "Map", ".", "Entry", "<", "String", ",", "Expression", ">", "entry", ":", "attributes", ".", "entrySet", "(", ")", ")", "{", "ok", "&=", "validateEnumConstant", "(", "entry", ".", "getValue", "(", ")", ")", ";", "}", "return", "ok", ";", "}", "private", "boolean", "validateEnumConstant", "(", "Expression", "exp", ")", "{", "if", "(", "exp", "instanceof", "PropertyExpression", ")", "{", "PropertyExpression", "pe", "=", "(", "PropertyExpression", ")", "exp", ";", "String", "name", "=", "pe", ".", "getPropertyAsString", "(", ")", ";", "if", "(", "pe", ".", "getObjectExpression", "(", ")", "instanceof", "ClassExpression", "&&", "name", "!=", "null", ")", "{", "ClassExpression", "ce", "=", "(", "ClassExpression", ")", "pe", ".", "getObjectExpression", "(", ")", ";", "ClassNode", "type", "=", "ce", ".", "getType", "(", ")", ";", "if", "(", "type", ".", "isEnum", "(", ")", ")", "{", "boolean", "ok", "=", "false", ";", "try", "{", "FieldNode", "enumField", "=", "type", ".", "getDeclaredField", "(", "name", ")", ";", "ClassNode", "cn", "=", "enumField", ".", "getType", "(", ")", ";", "ok", "=", "enumField", "!=", "null", "&&", "cn", ".", "equals", "(", "type", ")", ";", "}", "catch", "(", "Exception", "ex", ")", "{", "}", "if", "(", "!", "ok", ")", "{", "addError", "(", "\"\"", "+", "type", ".", "getName", "(", ")", "+", "\".\"", "+", "name", ",", "pe", ")", ";", "return", "false", ";", "}", "}", "}", "}", "return", "true", ";", "}", "private", "Expression", "transformInlineConstants", "(", "Expression", "exp", ")", "{", "if", "(", "exp", "instanceof", "PropertyExpression", ")", "{", "PropertyExpression", "pe", "=", "(", "PropertyExpression", ")", "exp", ";", "if", "(", "pe", ".", "getObjectExpression", "(", ")", "instanceof", "ClassExpression", ")", "{", "ClassExpression", "ce", "=", "(", "ClassExpression", ")", "pe", ".", "getObjectExpression", "(", ")", ";", "ClassNode", "type", "=", "ce", ".", "getType", "(", ")", ";", "if", "(", "type", ".", "isEnum", "(", ")", "||", "!", "type", ".", "isResolved", "(", ")", ")", "return", "exp", ";", "try", "{", "type", ".", "getFields", "(", ")", ";", "if", "(", "type", ".", "hasClass", "(", ")", ")", "{", "Field", "field", "=", "type", ".", "getTypeClass", "(", ")", ".", "getField", "(", "pe", ".", "getPropertyAsString", "(", ")", ")", ";", "if", "(", "field", "!=", "null", "&&", "Modifier", ".", "isStatic", "(", "field", ".", "getModifiers", "(", ")", ")", "&&", "Modifier", ".", "isFinal", "(", "field", ".", "getModifiers", "(", ")", ")", ")", "{", "return", "new", "ConstantExpression", "(", "field", ".", "get", "(", "null", ")", ")", ";", "}", "}", "else", "{", "FieldNode", "fieldNode", "=", "type", ".", "getField", "(", "pe", ".", "getPropertyAsString", "(", ")", ")", ";", "if", "(", "fieldNode", "!=", "null", "&&", "Modifier", ".", "isStatic", "(", "fieldNode", ".", "getModifiers", "(", ")", ")", "&&", "Modifier", ".", "isFinal", "(", "fieldNode", ".", "getModifiers", "(", ")", ")", ")", "{", "Expression", "e", "=", "fieldNode", ".", "getInitialExpression", "(", ")", ";", "if", "(", "e", "==", "null", ")", "{", "return", "exp", ";", "}", "return", "(", "ConstantExpression", ")", "e", ";", "}", "}", "}", "catch", "(", "Exception", "e", ")", "{", "}", "}", "}", "else", "if", "(", "exp", "instanceof", "ListExpression", ")", "{", "ListExpression", "le", "=", "(", "ListExpression", ")", "exp", ";", "ListExpression", "result", "=", "new", "ListExpression", "(", ")", ";", "for", "(", "Expression", "e", ":", "le", ".", "getExpressions", "(", ")", ")", "{", "result", ".", "addExpression", "(", "transformInlineConstants", "(", "e", ")", ")", ";", "}", "return", "result", ";", "}", "return", "exp", ";", "}", "private", "boolean", "checkIfMandatoryAnnotationValuesPassed", "(", "AnnotationNode", "node", ")", "{", "boolean", "ok", "=", "true", ";", "Map", "attributes", "=", "node", ".", "getMembers", "(", ")", ";", "ClassNode", "classNode", "=", "node", ".", "getClassNode", "(", ")", ";", "for", "(", "MethodNode", "mn", ":", "classNode", ".", "getMethods", "(", ")", ")", "{", "String", "methodName", "=", "mn", ".", "getName", "(", ")", ";", "}", "return", "ok", ";", "}", "private", "ClassNode", "getAttributeType", "(", "AnnotationNode", "node", ",", "String", "attrName", ")", "{", "ClassNode", "classNode", "=", "node", ".", "getClassNode", "(", ")", ";", "List", "methods", "=", "classNode", ".", "getMethods", "(", "attrName", ")", ";", "if", "(", "methods", ".", "size", "(", ")", "==", "0", ")", "{", "addError", "(", "\"'\"", "+", "attrName", "+", "\"\"", "+", "classNode", ",", "node", ")", ";", "return", "ClassHelper", ".", "OBJECT_TYPE", ";", "}", "MethodNode", "method", "=", "(", "MethodNode", ")", "methods", ".", "get", "(", "0", ")", ";", "return", "method", ".", "getReturnType", "(", ")", ";", "}", "private", "boolean", "isValidAnnotationClass", "(", "ClassNode", "node", ")", "{", "return", "node", ".", "implementsInterface", "(", "ClassHelper", ".", "Annotation_TYPE", ")", ";", "}", "protected", "void", "visitExpression", "(", "String", "attrName", ",", "Expression", "attrExp", ",", "ClassNode", "attrType", ")", "{", "if", "(", "attrType", ".", "isArray", "(", ")", ")", "{", "if", "(", "attrExp", "instanceof", "ListExpression", ")", "{", "ListExpression", "le", "=", "(", "ListExpression", ")", "attrExp", ";", "visitListExpression", "(", "attrName", ",", "le", ",", "attrType", ".", "getComponentType", "(", ")", ")", ";", "}", "else", "if", "(", "attrExp", "instanceof", "ClosureExpression", ")", "{", "addError", "(", "\"\"", ",", "attrExp", ")", ";", "}", "else", "{", "ListExpression", "listExp", "=", "new", "ListExpression", "(", ")", ";", "listExp", ".", "addExpression", "(", "attrExp", ")", ";", "if", "(", "annotation", "!=", "null", ")", "{", "annotation", ".", "setMember", "(", "attrName", ",", "listExp", ")", ";", "}", "visitExpression", "(", "attrName", ",", "listExp", ",", "attrType", ")", ";", "}", "}", "else", "if", "(", "ClassHelper", ".", "isPrimitiveType", "(", "attrType", ")", ")", "{", "visitConstantExpression", "(", "attrName", ",", "getConstantExpression", "(", "attrExp", ",", "attrType", ")", ",", "ClassHelper", ".", "getWrapper", "(", "attrType", ")", ")", ";", "}", "else", "if", "(", "ClassHelper", ".", "STRING_TYPE", ".", "equals", "(", "attrType", ")", ")", "{", "visitConstantExpression", "(", "attrName", ",", "getConstantExpression", "(", "attrExp", ",", "attrType", ")", ",", "ClassHelper", ".", "STRING_TYPE", ")", ";", "}", "else", "if", "(", "ClassHelper", ".", "CLASS_Type", ".", "equals", "(", "attrType", ")", ")", "{", "if", "(", "!", "(", "attrExp", "instanceof", "ClassExpression", ")", ")", "{", "addError", "(", "\"\"", "+", "attrName", "+", "\"'\"", ",", "attrExp", ")", ";", "}", "}", "else", "if", "(", "attrType", ".", "isDerivedFrom", "(", "ClassHelper", ".", "Enum_Type", ")", ")", "{", "if", "(", "attrExp", "instanceof", "PropertyExpression", ")", "{", "visitEnumExpression", "(", "attrName", ",", "(", "PropertyExpression", ")", "attrExp", ",", "attrType", ")", ";", "}", "else", "{", "addError", "(", "\"\"", "+", "attrName", ",", "attrExp", ")", ";", "}", "}", "else", "if", "(", "isValidAnnotationClass", "(", "attrType", ")", ")", "{", "if", "(", "attrExp", "instanceof", "AnnotationConstantExpression", ")", "{", "visitAnnotationExpression", "(", "attrName", ",", "(", "AnnotationConstantExpression", ")", "attrExp", ",", "attrType", ")", ";", "}", "else", "{", "addError", "(", "\"\"", "+", "attrType", ".", "getName", "(", ")", "+", "\"\"", "+", "attrName", ",", "attrExp", ")", ";", "}", "}", "else", "{", "addError", "(", "\"\"", "+", "attrType", ".", "getName", "(", ")", ",", "attrExp", ")", ";", "}", "}", "public", "void", "checkReturnType", "(", "ClassNode", "attrType", ",", "ASTNode", "node", ")", "{", "if", "(", "attrType", ".", "isArray", "(", ")", ")", "{", "checkReturnType", "(", "attrType", ".", "getComponentType", "(", ")", ",", "node", ")", ";", "}", "else", "if", "(", "ClassHelper", ".", "isPrimitiveType", "(", "attrType", ")", ")", "{", "return", ";", "}", "else", "if", "(", "ClassHelper", ".", "STRING_TYPE", ".", "equals", "(", "attrType", ")", ")", "{", "return", ";", "}", "else", "if", "(", "ClassHelper", ".", "CLASS_Type", ".", "equals", "(", "attrType", ")", ")", "{", "return", ";", "}", "else", "if", "(", "attrType", ".", "isDerivedFrom", "(", "ClassHelper", ".", "Enum_Type", ")", ")", "{", "return", ";", "}", "else", "if", "(", "isValidAnnotationClass", "(", "attrType", ")", ")", "{", "return", ";", "}", "else", "{", "addError", "(", "\"\"", "+", "attrType", ".", "getName", "(", ")", ",", "node", ")", ";", "}", "}", "private", "ConstantExpression", "getConstantExpression", "(", "Expression", "exp", ",", "ClassNode", "attrType", ")", "{", "if", "(", "exp", "instanceof", "ConstantExpression", ")", "{", "return", "(", "ConstantExpression", ")", "exp", ";", "}", "else", "{", "String", "base", "=", "\"expected", "'\"", "+", "exp", ".", "getText", "(", ")", "+", "\"\"", "+", "attrType", ".", "getName", "(", ")", ";", "if", "(", "exp", "instanceof", "PropertyExpression", ")", "{", "addError", "(", "base", "+", "\"\"", ",", "exp", ")", ";", "}", "else", "if", "(", "exp", "instanceof", "VariableExpression", "&&", "(", "(", "VariableExpression", ")", "exp", ")", ".", "getAccessedVariable", "(", ")", "instanceof", "FieldNode", ")", "{", "addError", "(", "base", "+", "\"\"", ",", "exp", ")", ";", "}", "else", "{", "addError", "(", "base", ",", "exp", ")", ";", "}", "return", "ConstantExpression", ".", "EMPTY_EXPRESSION", ";", "}", "}", "protected", "void", "visitAnnotationExpression", "(", "String", "attrName", ",", "AnnotationConstantExpression", "expression", ",", "ClassNode", "attrType", ")", "{", "AnnotationNode", "annotationNode", "=", "(", "AnnotationNode", ")", "expression", ".", "getValue", "(", ")", ";", "AnnotationVisitor", "visitor", "=", "new", "AnnotationVisitor", "(", "this", ".", "source", ",", "this", ".", "errorCollector", ")", ";", "visitor", ".", "visit", "(", "annotationNode", ")", ";", "}", "protected", "void", "visitListExpression", "(", "String", "attrName", ",", "ListExpression", "listExpr", ",", "ClassNode", "elementType", ")", "{", "for", "(", "Expression", "expression", ":", "listExpr", ".", "getExpressions", "(", ")", ")", "{", "visitExpression", "(", "attrName", ",", "expression", ",", "elementType", ")", ";", "}", "}", "protected", "void", "visitConstantExpression", "(", "String", "attrName", ",", "ConstantExpression", "constExpr", ",", "ClassNode", "attrType", ")", "{", "if", "(", "!", "constExpr", ".", "getType", "(", ")", ".", "isDerivedFrom", "(", "attrType", ")", ")", "{", "addError", "(", "\"Attribute", "'\"", "+", "attrName", "+", "\"\"", "+", "attrType", ".", "getName", "(", ")", "+", "\"';", "\"", "+", "\"\"", "+", "constExpr", ".", "getType", "(", ")", ".", "getName", "(", ")", "+", "\"'\"", ",", "constExpr", ")", ";", "}", "}", "protected", "void", "visitEnumExpression", "(", "String", "attrName", ",", "PropertyExpression", "propExpr", ",", "ClassNode", "attrType", ")", "{", "if", "(", "!", "propExpr", ".", "getObjectExpression", "(", ")", ".", "getType", "(", ")", ".", "isDerivedFrom", "(", "attrType", ")", ")", "{", "addError", "(", "\"Attribute", "'\"", "+", "attrName", "+", "\"\"", "+", "attrType", ".", "getName", "(", ")", "+", "\"\"", "+", "propExpr", ".", "getObjectExpression", "(", ")", ".", "getType", "(", ")", ".", "getName", "(", ")", ",", "propExpr", ")", ";", "}", "}", "protected", "void", "addError", "(", "String", "msg", ")", "{", "addError", "(", "msg", ",", "this", ".", "annotation", ")", ";", "}", "protected", "void", "addError", "(", "String", "msg", ",", "ASTNode", "expr", ")", "{", "this", ".", "errorCollector", ".", "addErrorAndContinue", "(", "new", "SyntaxErrorMessage", "(", "new", "SyntaxException", "(", "msg", "+", "\"", "in", "@\"", "+", "this", ".", "reportClass", ".", "getName", "(", ")", "+", "'\\n'", ",", "expr", ".", "getLineNumber", "(", ")", ",", "expr", ".", "getColumnNumber", "(", ")", ")", ",", "this", ".", "source", ")", ")", ";", "}", "public", "void", "checkCircularReference", "(", "ClassNode", "searchClass", ",", "ClassNode", "attrType", ",", "Expression", "startExp", ")", "{", "if", "(", "!", "isValidAnnotationClass", "(", "attrType", ")", ")", "return", ";", "if", "(", "!", "(", "startExp", "instanceof", "AnnotationConstantExpression", ")", ")", "{", "addError", "(", "\"Found", "'\"", "+", "startExp", ".", "getText", "(", ")", "+", "\"\"", ",", "startExp", ")", ";", "return", ";", "}", "AnnotationConstantExpression", "ace", "=", "(", "AnnotationConstantExpression", ")", "startExp", ";", "AnnotationNode", "annotationNode", "=", "(", "AnnotationNode", ")", "ace", ".", "getValue", "(", ")", ";", "if", "(", "annotationNode", ".", "getClassNode", "(", ")", ".", "equals", "(", "searchClass", ")", ")", "{", "addError", "(", "\"\"", "+", "searchClass", ".", "getName", "(", ")", ",", "startExp", ")", ";", "return", ";", "}", "ClassNode", "cn", "=", "annotationNode", ".", "getClassNode", "(", ")", ";", "for", "(", "MethodNode", "method", ":", "cn", ".", "getMethods", "(", ")", ")", "{", "if", "(", "method", ".", "getReturnType", "(", ")", ".", "equals", "(", "searchClass", ")", ")", "{", "addError", "(", "\"\"", "+", "cn", ".", "getName", "(", ")", ",", "startExp", ")", ";", "}", "ReturnStatement", "code", "=", "(", "ReturnStatement", ")", "method", ".", "getCode", "(", ")", ";", "if", "(", "code", "==", "null", ")", "continue", ";", "checkCircularReference", "(", "searchClass", ",", "method", ".", "getReturnType", "(", ")", ",", "code", ".", "getExpression", "(", ")", ")", ";", "}", "}", "}", "</s>" ]
6,694
[ "<s>", "package", "org", ".", "codehaus", ".", "groovy", ".", "classgen", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "*", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "expr", ".", "BinaryExpression", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "expr", ".", "ConstructorCallExpression", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "expr", ".", "Expression", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "expr", ".", "FieldExpression", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "expr", ".", "PropertyExpression", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "expr", ".", "TupleExpression", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "expr", ".", "VariableExpression", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "stmt", ".", "BlockStatement", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "stmt", ".", "ExpressionStatement", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "stmt", ".", "Statement", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "control", ".", "CompilationUnit", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "control", ".", "SourceUnit", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "syntax", ".", "Token", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "syntax", ".", "Types", ";", "import", "org", ".", "objectweb", ".", "asm", ".", "Opcodes", ";", "import", "java", ".", "util", ".", "ArrayList", ";", "import", "java", ".", "util", ".", "Iterator", ";", "import", "java", ".", "util", ".", "List", ";", "public", "class", "InnerClassVisitor", "extends", "InnerClassVisitorHelper", "implements", "Opcodes", "{", "private", "final", "SourceUnit", "sourceUnit", ";", "private", "ClassNode", "classNode", ";", "private", "static", "final", "int", "PUBLIC_SYNTHETIC", "=", "Opcodes", ".", "ACC_PUBLIC", "+", "Opcodes", ".", "ACC_SYNTHETIC", ";", "private", "FieldNode", "thisField", "=", "null", ";", "private", "MethodNode", "currentMethod", ";", "private", "FieldNode", "currentField", ";", "private", "boolean", "processingObjInitStatements", "=", "false", ";", "public", "InnerClassVisitor", "(", "CompilationUnit", "cu", ",", "SourceUnit", "su", ")", "{", "sourceUnit", "=", "su", ";", "}", "protected", "SourceUnit", "getSourceUnit", "(", ")", "{", "return", "sourceUnit", ";", "}", "@", "Override", "public", "void", "visitClass", "(", "ClassNode", "node", ")", "{", "this", ".", "classNode", "=", "node", ";", "thisField", "=", "null", ";", "InnerClassNode", "innerClass", "=", "null", ";", "if", "(", "!", "node", ".", "isEnum", "(", ")", "&&", "!", "node", ".", "isInterface", "(", ")", "&&", "node", "instanceof", "InnerClassNode", ")", "{", "innerClass", "=", "(", "InnerClassNode", ")", "node", ";", "if", "(", "!", "isStatic", "(", "innerClass", ")", "&&", "innerClass", ".", "getVariableScope", "(", ")", "==", "null", ")", "{", "thisField", "=", "innerClass", ".", "addField", "(", "\"this$0\"", ",", "PUBLIC_SYNTHETIC", ",", "node", ".", "getOuterClass", "(", ")", ",", "null", ")", ";", "}", "if", "(", "innerClass", ".", "getVariableScope", "(", ")", "==", "null", "&&", "innerClass", ".", "getDeclaredConstructors", "(", ")", ".", "isEmpty", "(", ")", ")", "{", "innerClass", ".", "addConstructor", "(", "ACC_PUBLIC", ",", "new", "Parameter", "[", "0", "]", ",", "null", ",", "null", ")", ";", "}", "}", "super", ".", "visitClass", "(", "node", ")", ";", "if", "(", "node", ".", "isEnum", "(", ")", "||", "node", ".", "isInterface", "(", ")", ")", "return", ";", "addDispatcherMethods", "(", ")", ";", "if", "(", "innerClass", "==", "null", ")", "return", ";", "if", "(", "node", ".", "getSuperClass", "(", ")", ".", "isInterface", "(", ")", ")", "{", "node", ".", "addInterface", "(", "node", ".", "getUnresolvedSuperClass", "(", ")", ")", ";", "node", ".", "setUnresolvedSuperClass", "(", "ClassHelper", ".", "OBJECT_TYPE", ")", ";", "}", "}", "@", "Override", "protected", "void", "visitObjectInitializerStatements", "(", "ClassNode", "node", ")", "{", "processingObjInitStatements", "=", "true", ";", "super", ".", "visitObjectInitializerStatements", "(", "node", ")", ";", "processingObjInitStatements", "=", "false", ";", "}", "@", "Override", "public", "void", "visitConstructor", "(", "ConstructorNode", "node", ")", "{", "addThisReference", "(", "node", ")", ";", "super", ".", "visitConstructor", "(", "node", ")", ";", "}", "private", "boolean", "shouldHandleImplicitThisForInnerClass", "(", "ClassNode", "cn", ")", "{", "if", "(", "cn", ".", "isEnum", "(", ")", "||", "cn", ".", "isInterface", "(", ")", ")", "return", "false", ";", "if", "(", "(", "cn", ".", "getModifiers", "(", ")", "&", "Opcodes", ".", "ACC_STATIC", ")", "!=", "0", ")", "return", "false", ";", "if", "(", "!", "(", "cn", "instanceof", "InnerClassNode", ")", ")", "return", "false", ";", "InnerClassNode", "innerClass", "=", "(", "InnerClassNode", ")", "cn", ";", "if", "(", "innerClass", ".", "getVariableScope", "(", ")", "!=", "null", ")", "return", "false", ";", "if", "(", "(", "innerClass", ".", "getModifiers", "(", ")", "&", "ACC_STATIC", ")", "!=", "0", ")", "return", "false", ";", "return", "true", ";", "}", "private", "void", "addThisReference", "(", "ConstructorNode", "node", ")", "{", "if", "(", "!", "shouldHandleImplicitThisForInnerClass", "(", "classNode", ")", ")", "return", ";", "Statement", "code", "=", "node", ".", "getCode", "(", ")", ";", "Parameter", "[", "]", "params", "=", "node", ".", "getParameters", "(", ")", ";", "Parameter", "[", "]", "newParams", "=", "new", "Parameter", "[", "params", ".", "length", "+", "1", "]", ";", "System", ".", "arraycopy", "(", "params", ",", "0", ",", "newParams", ",", "1", ",", "params", ".", "length", ")", ";", "Parameter", "thisPara", "=", "new", "Parameter", "(", "classNode", ".", "getOuterClass", "(", ")", ",", "getUniqueName", "(", "params", ",", "node", ")", ")", ";", "newParams", "[", "0", "]", "=", "thisPara", ";", "node", ".", "setParameters", "(", "newParams", ")", ";", "BlockStatement", "block", "=", "null", ";", "if", "(", "code", "==", "null", ")", "{", "block", "=", "new", "BlockStatement", "(", ")", ";", "}", "else", "if", "(", "!", "(", "code", "instanceof", "BlockStatement", ")", ")", "{", "block", "=", "new", "BlockStatement", "(", ")", ";", "block", ".", "addStatement", "(", "code", ")", ";", "}", "else", "{", "block", "=", "(", "BlockStatement", ")", "code", ";", "}", "BlockStatement", "newCode", "=", "new", "BlockStatement", "(", ")", ";", "addFieldInit", "(", "thisPara", ",", "thisField", ",", "newCode", ")", ";", "ConstructorCallExpression", "cce", "=", "getFirstIfSpecialConstructorCall", "(", "block", ")", ";", "if", "(", "cce", "==", "null", ")", "{", "cce", "=", "new", "ConstructorCallExpression", "(", "ClassNode", ".", "SUPER", ",", "new", "TupleExpression", "(", ")", ")", ";", "block", ".", "getStatements", "(", ")", ".", "add", "(", "0", ",", "new", "ExpressionStatement", "(", "cce", ")", ")", ";", "}", "if", "(", "shouldImplicitlyPassThisPara", "(", "cce", ")", ")", "{", "TupleExpression", "args", "=", "(", "TupleExpression", ")", "cce", ".", "getArguments", "(", ")", ";", "List", "<", "Expression", ">", "expressions", "=", "args", ".", "getExpressions", "(", ")", ";", "VariableExpression", "ve", "=", "new", "VariableExpression", "(", "thisPara", ".", "getName", "(", ")", ")", ";", "ve", ".", "setAccessedVariable", "(", "thisPara", ")", ";", "expressions", ".", "add", "(", "0", ",", "ve", ")", ";", "}", "if", "(", "cce", ".", "isSuperCall", "(", ")", ")", "{", "block", ".", "getStatements", "(", ")", ".", "add", "(", "1", ",", "newCode", ")", ";", "}", "node", ".", "setCode", "(", "block", ")", ";", "}", "private", "boolean", "shouldImplicitlyPassThisPara", "(", "ConstructorCallExpression", "cce", ")", "{", "boolean", "pass", "=", "false", ";", "ClassNode", "superCN", "=", "classNode", ".", "getSuperClass", "(", ")", ";", "if", "(", "cce", ".", "isThisCall", "(", ")", ")", "{", "pass", "=", "true", ";", "}", "else", "if", "(", "cce", ".", "isSuperCall", "(", ")", ")", "{", "if", "(", "!", "superCN", ".", "isEnum", "(", ")", "&&", "!", "superCN", ".", "isInterface", "(", ")", "&&", "superCN", "instanceof", "InnerClassNode", ")", "{", "InnerClassNode", "superInnerCN", "=", "(", "InnerClassNode", ")", "superCN", ";", "if", "(", "!", "isStatic", "(", "superInnerCN", ")", "&&", "superCN", ".", "getOuterClass", "(", ")", ".", "equals", "(", "classNode", ".", "getOuterClass", "(", ")", ")", ")", "{", "pass", "=", "true", ";", "}", "}", "}", "return", "pass", ";", "}", "private", "String", "getUniqueName", "(", "Parameter", "[", "]", "params", ",", "ConstructorNode", "node", ")", "{", "String", "namePrefix", "=", "\"$p\"", ";", "outer", ":", "for", "(", "int", "i", "=", "0", ";", "i", "<", "100", ";", "i", "++", ")", "{", "namePrefix", "=", "namePrefix", "+", "\"$\"", ";", "for", "(", "Parameter", "p", ":", "params", ")", "{", "if", "(", "p", ".", "getName", "(", ")", ".", "equals", "(", "namePrefix", ")", ")", "continue", "outer", ";", "}", "return", "namePrefix", ";", "}", "addError", "(", "\"\"", ",", "node", ")", ";", "return", "namePrefix", ";", "}", "private", "ConstructorCallExpression", "getFirstIfSpecialConstructorCall", "(", "BlockStatement", "code", ")", "{", "if", "(", "code", "==", "null", ")", "return", "null", ";", "final", "List", "<", "Statement", ">", "statementList", "=", "code", ".", "getStatements", "(", ")", ";", "if", "(", "statementList", ".", "isEmpty", "(", ")", ")", "return", "null", ";", "final", "Statement", "statement", "=", "statementList", ".", "get", "(", "0", ")", ";", "if", "(", "!", "(", "statement", "instanceof", "ExpressionStatement", ")", ")", "return", "null", ";", "Expression", "expression", "=", "(", "(", "ExpressionStatement", ")", "statement", ")", ".", "getExpression", "(", ")", ";", "if", "(", "!", "(", "expression", "instanceof", "ConstructorCallExpression", ")", ")", "return", "null", ";", "ConstructorCallExpression", "cce", "=", "(", "ConstructorCallExpression", ")", "expression", ";", "if", "(", "cce", ".", "isSpecialCall", "(", ")", ")", "return", "cce", ";", "return", "null", ";", "}", "@", "Override", "protected", "void", "visitConstructorOrMethod", "(", "MethodNode", "node", ",", "boolean", "isConstructor", ")", "{", "this", ".", "currentMethod", "=", "node", ";", "super", ".", "visitConstructorOrMethod", "(", "node", ",", "isConstructor", ")", ";", "this", ".", "currentMethod", "=", "null", ";", "}", "@", "Override", "public", "void", "visitField", "(", "FieldNode", "node", ")", "{", "this", ".", "currentField", "=", "node", ";", "super", ".", "visitField", "(", "node", ")", ";", "this", ".", "currentField", "=", "null", ";", "}", "@", "Override", "public", "void", "visitProperty", "(", "PropertyNode", "node", ")", "{", "final", "FieldNode", "field", "=", "node", ".", "getField", "(", ")", ";", "final", "Expression", "init", "=", "field", ".", "getInitialExpression", "(", ")", ";", "field", ".", "setInitialValueExpression", "(", "null", ")", ";", "super", ".", "visitProperty", "(", "node", ")", ";", "field", ".", "setInitialValueExpression", "(", "init", ")", ";", "}", "@", "Override", "public", "void", "visitConstructorCallExpression", "(", "ConstructorCallExpression", "call", ")", "{", "super", ".", "visitConstructorCallExpression", "(", "call", ")", ";", "if", "(", "!", "call", ".", "isUsingAnonymousInnerClass", "(", ")", ")", "{", "passThisReference", "(", "call", ")", ";", "return", ";", "}", "InnerClassNode", "innerClass", "=", "(", "InnerClassNode", ")", "call", ".", "getType", "(", ")", ";", "if", "(", "!", "innerClass", ".", "getDeclaredConstructors", "(", ")", ".", "isEmpty", "(", ")", ")", "return", ";", "if", "(", "(", "innerClass", ".", "getModifiers", "(", ")", "&", "ACC_STATIC", ")", "!=", "0", ")", "return", ";", "VariableScope", "scope", "=", "innerClass", ".", "getVariableScope", "(", ")", ";", "if", "(", "scope", "==", "null", ")", "return", ";", "boolean", "isStatic", "=", "scope", ".", "isInStaticContext", "(", ")", ";", "List", "<", "Expression", ">", "expressions", "=", "(", "(", "TupleExpression", ")", "call", ".", "getArguments", "(", ")", ")", ".", "getExpressions", "(", ")", ";", "BlockStatement", "block", "=", "new", "BlockStatement", "(", ")", ";", "final", "int", "additionalParamCount", "=", "1", "+", "scope", ".", "getReferencedLocalVariablesCount", "(", ")", ";", "List", "<", "Parameter", ">", "parameters", "=", "new", "ArrayList", "<", "Parameter", ">", "(", "expressions", ".", "size", "(", ")", "+", "additionalParamCount", ")", ";", "List", "<", "Expression", ">", "superCallArguments", "=", "new", "ArrayList", "<", "Expression", ">", "(", "expressions", ".", "size", "(", ")", ")", ";", "int", "pCount", "=", "additionalParamCount", ";", "for", "(", "Expression", "expr", ":", "expressions", ")", "{", "pCount", "++", ";", "Parameter", "param", "=", "new", "Parameter", "(", "ClassHelper", ".", "OBJECT_TYPE", ",", "\"p\"", "+", "pCount", ")", ";", "parameters", ".", "add", "(", "param", ")", ";", "superCallArguments", ".", "add", "(", "new", "VariableExpression", "(", "param", ")", ")", ";", "}", "ConstructorCallExpression", "cce", "=", "new", "ConstructorCallExpression", "(", "ClassNode", ".", "SUPER", ",", "new", "TupleExpression", "(", "superCallArguments", ")", ")", ";", "block", ".", "addStatement", "(", "new", "ExpressionStatement", "(", "cce", ")", ")", ";", "pCount", "=", "0", ";", "expressions", ".", "add", "(", "pCount", ",", "VariableExpression", ".", "THIS_EXPRESSION", ")", ";", "ClassNode", "outerClassType", "=", "getClassNode", "(", "innerClass", ".", "getOuterClass", "(", ")", ",", "isStatic", ")", ";", "Parameter", "thisParameter", "=", "new", "Parameter", "(", "outerClassType", ",", "\"p\"", "+", "pCount", ")", ";", "parameters", ".", "add", "(", "pCount", ",", "thisParameter", ")", ";", "thisField", "=", "innerClass", ".", "addField", "(", "\"this$0\"", ",", "PUBLIC_SYNTHETIC", ",", "outerClassType", ",", "null", ")", ";", "addFieldInit", "(", "thisParameter", ",", "thisField", ",", "block", ")", ";", "for", "(", "Iterator", "it", "=", "scope", ".", "getReferencedLocalVariablesIterator", "(", ")", ";", "it", ".", "hasNext", "(", ")", ";", ")", "{", "pCount", "++", ";", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "Variable", "var", "=", "(", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "Variable", ")", "it", ".", "next", "(", ")", ";", "VariableExpression", "ve", "=", "new", "VariableExpression", "(", "var", ")", ";", "ve", ".", "setClosureSharedVariable", "(", "true", ")", ";", "ve", ".", "setUseReferenceDirectly", "(", "true", ")", ";", "expressions", ".", "add", "(", "pCount", ",", "ve", ")", ";", "ClassNode", "rawReferenceType", "=", "ClassHelper", ".", "REFERENCE_TYPE", ".", "getPlainNodeReference", "(", ")", ";", "Parameter", "p", "=", "new", "Parameter", "(", "rawReferenceType", ",", "\"p\"", "+", "pCount", ")", ";", "parameters", ".", "add", "(", "pCount", ",", "p", ")", ";", "final", "VariableExpression", "initial", "=", "new", "VariableExpression", "(", "p", ")", ";", "initial", ".", "setUseReferenceDirectly", "(", "true", ")", ";", "final", "FieldNode", "pField", "=", "innerClass", ".", "addFieldFirst", "(", "ve", ".", "getName", "(", ")", ",", "PUBLIC_SYNTHETIC", ",", "rawReferenceType", ",", "initial", ")", ";", "pField", ".", "setHolder", "(", "true", ")", ";", "}", "innerClass", ".", "addConstructor", "(", "ACC_SYNTHETIC", ",", "parameters", ".", "toArray", "(", "new", "Parameter", "[", "0", "]", ")", ",", "ClassNode", ".", "EMPTY_ARRAY", ",", "block", ")", ";", "}", "private", "void", "passThisReference", "(", "ConstructorCallExpression", "call", ")", "{", "ClassNode", "cn", "=", "call", ".", "getType", "(", ")", ".", "redirect", "(", ")", ";", "if", "(", "!", "shouldHandleImplicitThisForInnerClass", "(", "cn", ")", ")", "return", ";", "boolean", "isInStaticContext", "=", "true", ";", "if", "(", "currentMethod", "!=", "null", ")", "isInStaticContext", "=", "currentMethod", ".", "getVariableScope", "(", ")", ".", "isInStaticContext", "(", ")", ";", "else", "if", "(", "currentField", "!=", "null", ")", "isInStaticContext", "=", "currentField", ".", "isStatic", "(", ")", ";", "else", "if", "(", "processingObjInitStatements", ")", "isInStaticContext", "=", "false", ";", "if", "(", "isInStaticContext", ")", "{", "Expression", "args", "=", "call", ".", "getArguments", "(", ")", ";", "if", "(", "args", "instanceof", "TupleExpression", "&&", "(", "(", "TupleExpression", ")", "args", ")", ".", "getExpressions", "(", ")", ".", "isEmpty", "(", ")", ")", "{", "addError", "(", "\"\"", ",", "call", ")", ";", "}", "return", ";", "}", "ClassNode", "parent", "=", "classNode", ";", "int", "level", "=", "0", ";", "for", "(", ";", "parent", "!=", "null", "&&", "parent", "!=", "cn", ".", "getOuterClass", "(", ")", ";", "parent", "=", "parent", ".", "getOuterClass", "(", ")", ")", "{", "level", "++", ";", "}", "if", "(", "parent", "==", "null", ")", "return", ";", "Expression", "argsExp", "=", "call", ".", "getArguments", "(", ")", ";", "if", "(", "argsExp", "instanceof", "TupleExpression", ")", "{", "TupleExpression", "argsListExp", "=", "(", "TupleExpression", ")", "argsExp", ";", "Expression", "this0", "=", "VariableExpression", ".", "THIS_EXPRESSION", ";", "for", "(", "int", "i", "=", "0", ";", "i", "!=", "level", ";", "++", "i", ")", "this0", "=", "new", "PropertyExpression", "(", "this0", ",", "\"this$0\"", ")", ";", "argsListExp", ".", "getExpressions", "(", ")", ".", "add", "(", "0", ",", "this0", ")", ";", "}", "}", "private", "void", "addDispatcherMethods", "(", ")", "{", "final", "int", "objectDistance", "=", "getObjectDistance", "(", "classNode", ")", ";", "Parameter", "[", "]", "parameters", "=", "new", "Parameter", "[", "]", "{", "new", "Parameter", "(", "ClassHelper", ".", "STRING_TYPE", ",", "\"name\"", ")", ",", "new", "Parameter", "(", "ClassHelper", ".", "OBJECT_TYPE", ",", "\"args\"", ")", "}", ";", "MethodNode", "method", "=", "classNode", ".", "addSyntheticMethod", "(", "\"\"", "+", "objectDistance", ",", "ACC_PUBLIC", "+", "ACC_SYNTHETIC", ",", "ClassHelper", ".", "OBJECT_TYPE", ",", "parameters", ",", "ClassNode", ".", "EMPTY_ARRAY", ",", "null", ")", ";", "BlockStatement", "block", "=", "new", "BlockStatement", "(", ")", ";", "setMethodDispatcherCode", "(", "block", ",", "VariableExpression", ".", "THIS_EXPRESSION", ",", "parameters", ")", ";", "method", ".", "setCode", "(", "block", ")", ";", "parameters", "=", "new", "Parameter", "[", "]", "{", "new", "Parameter", "(", "ClassHelper", ".", "STRING_TYPE", ",", "\"name\"", ")", ",", "new", "Parameter", "(", "ClassHelper", ".", "OBJECT_TYPE", ",", "\"value\"", ")", "}", ";", "method", "=", "classNode", ".", "addSyntheticMethod", "(", "\"\"", "+", "objectDistance", ",", "ACC_PUBLIC", "+", "ACC_SYNTHETIC", ",", "ClassHelper", ".", "VOID_TYPE", ",", "parameters", ",", "ClassNode", ".", "EMPTY_ARRAY", ",", "null", ")", ";", "block", "=", "new", "BlockStatement", "(", ")", ";", "setPropertySetterDispatcher", "(", "block", ",", "VariableExpression", ".", "THIS_EXPRESSION", ",", "parameters", ")", ";", "method", ".", "setCode", "(", "block", ")", ";", "parameters", "=", "new", "Parameter", "[", "]", "{", "new", "Parameter", "(", "ClassHelper", ".", "STRING_TYPE", ",", "\"name\"", ")", "}", ";", "method", "=", "classNode", ".", "addSyntheticMethod", "(", "\"\"", "+", "objectDistance", ",", "ACC_PUBLIC", "+", "ACC_SYNTHETIC", ",", "ClassHelper", ".", "OBJECT_TYPE", ",", "parameters", ",", "ClassNode", ".", "EMPTY_ARRAY", ",", "null", ")", ";", "block", "=", "new", "BlockStatement", "(", ")", ";", "setPropertyGetterDispatcher", "(", "block", ",", "VariableExpression", ".", "THIS_EXPRESSION", ",", "parameters", ")", ";", "method", ".", "setCode", "(", "block", ")", ";", "}", "private", "static", "void", "addFieldInit", "(", "Parameter", "p", ",", "FieldNode", "fn", ",", "BlockStatement", "block", ")", "{", "VariableExpression", "ve", "=", "new", "VariableExpression", "(", "p", ")", ";", "FieldExpression", "fe", "=", "new", "FieldExpression", "(", "fn", ")", ";", "block", ".", "addStatement", "(", "new", "ExpressionStatement", "(", "new", "BinaryExpression", "(", "fe", ",", "Token", ".", "newSymbol", "(", "Types", ".", "ASSIGN", ",", "-", "1", ",", "-", "1", ")", ",", "ve", ")", ")", ")", ";", "}", "}", "</s>" ]
6,695
[ "<s>", "package", "org", ".", "codehaus", ".", "groovy", ".", "classgen", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "GroovyBugError", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "ClassHelper", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "ClassNode", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "Parameter", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "VariableScope", ";", "import", "org", ".", "objectweb", ".", "asm", ".", "Label", ";", "import", "org", ".", "objectweb", ".", "asm", ".", "MethodVisitor", ";", "import", "org", ".", "objectweb", ".", "asm", ".", "Opcodes", ";", "import", "java", ".", "util", ".", "*", ";", "public", "class", "CompileStack", "implements", "Opcodes", "{", "private", "boolean", "clear", "=", "true", ";", "private", "VariableScope", "scope", ";", "private", "Label", "continueLabel", ";", "private", "Label", "breakLabel", ";", "private", "Map", "stackVariables", "=", "new", "HashMap", "(", ")", ";", "private", "int", "currentVariableIndex", "=", "1", ";", "private", "int", "nextVariableIndex", "=", "1", ";", "private", "final", "LinkedList", "temporaryVariables", "=", "new", "LinkedList", "(", ")", ";", "private", "final", "LinkedList", "usedVariables", "=", "new", "LinkedList", "(", ")", ";", "private", "Map", "superBlockNamedLabels", "=", "new", "HashMap", "(", ")", ";", "private", "Map", "currentBlockNamedLabels", "=", "new", "HashMap", "(", ")", ";", "private", "LinkedList", "<", "BlockRecorder", ">", "finallyBlocks", "=", "new", "LinkedList", "<", "BlockRecorder", ">", "(", ")", ";", "private", "LinkedList", "<", "BlockRecorder", ">", "visitedBlocks", "=", "new", "LinkedList", "<", "BlockRecorder", ">", "(", ")", ";", "private", "Label", "thisStartLabel", ",", "thisEndLabel", ";", "private", "MethodVisitor", "mv", ";", "private", "BytecodeHelper", "helper", ";", "private", "final", "LinkedList", "stateStack", "=", "new", "LinkedList", "(", ")", ";", "private", "int", "localVariableOffset", ";", "private", "final", "Map", "namedLoopBreakLabel", "=", "new", "HashMap", "(", ")", ";", "private", "final", "Map", "namedLoopContinueLabel", "=", "new", "HashMap", "(", ")", ";", "private", "String", "className", ";", "private", "LinkedList", "<", "ExceptionTableEntry", ">", "typedExceptions", "=", "new", "LinkedList", "<", "ExceptionTableEntry", ">", "(", ")", ";", "private", "LinkedList", "<", "ExceptionTableEntry", ">", "untypedExceptions", "=", "new", "LinkedList", "<", "ExceptionTableEntry", ">", "(", ")", ";", "protected", "static", "class", "LabelRange", "{", "public", "Label", "start", ";", "public", "Label", "end", ";", "}", "protected", "static", "class", "BlockRecorder", "{", "private", "boolean", "isEmpty", "=", "true", ";", "public", "Runnable", "excludedStatement", ";", "public", "LinkedList", "<", "LabelRange", ">", "ranges", ";", "public", "BlockRecorder", "(", ")", "{", "ranges", "=", "new", "LinkedList", "<", "LabelRange", ">", "(", ")", ";", "}", "public", "BlockRecorder", "(", "Runnable", "excludedStatement", ")", "{", "this", "(", ")", ";", "this", ".", "excludedStatement", "=", "excludedStatement", ";", "}", "public", "void", "startRange", "(", "Label", "start", ")", "{", "LabelRange", "range", "=", "new", "LabelRange", "(", ")", ";", "range", ".", "start", "=", "start", ";", "ranges", ".", "add", "(", "range", ")", ";", "isEmpty", "=", "false", ";", "}", "public", "void", "closeRange", "(", "Label", "end", ")", "{", "ranges", ".", "getLast", "(", ")", ".", "end", "=", "end", ";", "}", "}", "private", "class", "ExceptionTableEntry", "{", "Label", "start", ",", "end", ",", "goal", ";", "String", "sig", ";", "}", "private", "class", "StateStackElement", "{", "final", "VariableScope", "scope", ";", "final", "Label", "continueLabel", ";", "final", "Label", "breakLabel", ";", "final", "int", "lastVariableIndex", ";", "final", "int", "nextVariableIndex", ";", "final", "Map", "stackVariables", ";", "final", "Map", "currentBlockNamedLabels", ";", "final", "LinkedList", "<", "BlockRecorder", ">", "finallyBlocks", ";", "StateStackElement", "(", ")", "{", "scope", "=", "CompileStack", ".", "this", ".", "scope", ";", "continueLabel", "=", "CompileStack", ".", "this", ".", "continueLabel", ";", "breakLabel", "=", "CompileStack", ".", "this", ".", "breakLabel", ";", "lastVariableIndex", "=", "CompileStack", ".", "this", ".", "currentVariableIndex", ";", "stackVariables", "=", "CompileStack", ".", "this", ".", "stackVariables", ";", "nextVariableIndex", "=", "CompileStack", ".", "this", ".", "nextVariableIndex", ";", "currentBlockNamedLabels", "=", "CompileStack", ".", "this", ".", "currentBlockNamedLabels", ";", "finallyBlocks", "=", "CompileStack", ".", "this", ".", "finallyBlocks", ";", "}", "}", "protected", "void", "pushState", "(", ")", "{", "stateStack", ".", "add", "(", "new", "StateStackElement", "(", ")", ")", ";", "stackVariables", "=", "new", "HashMap", "(", "stackVariables", ")", ";", "finallyBlocks", "=", "new", "LinkedList", "(", "finallyBlocks", ")", ";", "}", "private", "void", "popState", "(", ")", "{", "if", "(", "stateStack", ".", "size", "(", ")", "==", "0", ")", "{", "throw", "new", "GroovyBugError", "(", "\"\"", ")", ";", "}", "StateStackElement", "element", "=", "(", "StateStackElement", ")", "stateStack", ".", "removeLast", "(", ")", ";", "scope", "=", "element", ".", "scope", ";", "continueLabel", "=", "element", ".", "continueLabel", ";", "breakLabel", "=", "element", ".", "breakLabel", ";", "currentVariableIndex", "=", "element", ".", "lastVariableIndex", ";", "stackVariables", "=", "element", ".", "stackVariables", ";", "nextVariableIndex", "=", "element", ".", "nextVariableIndex", ";", "finallyBlocks", "=", "element", ".", "finallyBlocks", ";", "}", "public", "Label", "getContinueLabel", "(", ")", "{", "return", "continueLabel", ";", "}", "public", "Label", "getBreakLabel", "(", ")", "{", "return", "breakLabel", ";", "}", "public", "void", "removeVar", "(", "int", "tempIndex", ")", "{", "final", "Variable", "head", "=", "(", "Variable", ")", "temporaryVariables", ".", "removeFirst", "(", ")", ";", "if", "(", "head", ".", "getIndex", "(", ")", "!=", "tempIndex", ")", "throw", "new", "GroovyBugError", "(", "\"\"", ")", ";", "currentVariableIndex", "=", "head", ".", "getPrevIndex", "(", ")", ";", "nextVariableIndex", "=", "tempIndex", ";", "}", "private", "void", "setEndLabels", "(", ")", "{", "Label", "endLabel", "=", "new", "Label", "(", ")", ";", "mv", ".", "visitLabel", "(", "endLabel", ")", ";", "for", "(", "Iterator", "iter", "=", "stackVariables", ".", "values", "(", ")", ".", "iterator", "(", ")", ";", "iter", ".", "hasNext", "(", ")", ";", ")", "{", "Variable", "var", "=", "(", "Variable", ")", "iter", ".", "next", "(", ")", ";", "var", ".", "setEndLabel", "(", "endLabel", ")", ";", "}", "thisEndLabel", "=", "endLabel", ";", "}", "public", "void", "pop", "(", ")", "{", "setEndLabels", "(", ")", ";", "popState", "(", ")", ";", "}", "public", "VariableScope", "getScope", "(", ")", "{", "return", "scope", ";", "}", "public", "int", "defineTemporaryVariable", "(", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "Variable", "var", ",", "boolean", "store", ")", "{", "return", "defineTemporaryVariable", "(", "var", ".", "getName", "(", ")", ",", "var", ".", "getType", "(", ")", ",", "store", ")", ";", "}", "public", "Variable", "getVariable", "(", "String", "variableName", ")", "{", "return", "getVariable", "(", "variableName", ",", "true", ")", ";", "}", "public", "Variable", "getVariable", "(", "String", "variableName", ",", "boolean", "mustExist", ")", "{", "if", "(", "variableName", ".", "equals", "(", "\"this\"", ")", ")", "return", "Variable", ".", "THIS_VARIABLE", ";", "if", "(", "variableName", ".", "equals", "(", "\"super\"", ")", ")", "return", "Variable", ".", "SUPER_VARIABLE", ";", "Variable", "v", "=", "(", "Variable", ")", "stackVariables", ".", "get", "(", "variableName", ")", ";", "if", "(", "v", "==", "null", "&&", "mustExist", ")", "throw", "new", "GroovyBugError", "(", "\"\"", "+", "variableName", "+", "\"\"", ")", ";", "return", "v", ";", "}", "public", "int", "defineTemporaryVariable", "(", "String", "name", ",", "boolean", "store", ")", "{", "return", "defineTemporaryVariable", "(", "name", ",", "ClassHelper", ".", "DYNAMIC_TYPE", ",", "store", ")", ";", "}", "public", "int", "defineTemporaryVariable", "(", "String", "name", ",", "ClassNode", "node", ",", "boolean", "store", ")", "{", "Variable", "answer", "=", "defineVar", "(", "name", ",", "node", ",", "false", ")", ";", "temporaryVariables", ".", "addFirst", "(", "answer", ")", ";", "usedVariables", ".", "removeLast", "(", ")", ";", "if", "(", "store", ")", "mv", ".", "visitVarInsn", "(", "ASTORE", ",", "currentVariableIndex", ")", ";", "return", "answer", ".", "getIndex", "(", ")", ";", "}", "private", "void", "resetVariableIndex", "(", "boolean", "isStatic", ")", "{", "if", "(", "!", "isStatic", ")", "{", "currentVariableIndex", "=", "1", ";", "nextVariableIndex", "=", "1", ";", "}", "else", "{", "currentVariableIndex", "=", "0", ";", "nextVariableIndex", "=", "0", ";", "}", "}", "public", "void", "clear", "(", ")", "{", "if", "(", "stateStack", ".", "size", "(", ")", ">", "1", ")", "{", "int", "size", "=", "stateStack", ".", "size", "(", ")", "-", "1", ";", "throw", "new", "GroovyBugError", "(", "\"\"", "+", "size", "+", "\"\"", "+", "(", "size", "==", "1", "?", "\"\"", ":", "\"s\"", ")", "+", "\"", "than", "pops.\"", ")", ";", "}", "clear", "=", "true", ";", "if", "(", "true", ")", "{", "if", "(", "thisEndLabel", "==", "null", ")", "setEndLabels", "(", ")", ";", "if", "(", "!", "scope", ".", "isInStaticContext", "(", ")", ")", "{", "mv", ".", "visitLocalVariable", "(", "\"this\"", ",", "className", ",", "null", ",", "thisStartLabel", ",", "thisEndLabel", ",", "0", ")", ";", "}", "for", "(", "Iterator", "iterator", "=", "usedVariables", ".", "iterator", "(", ")", ";", "iterator", ".", "hasNext", "(", ")", ";", ")", "{", "Variable", "v", "=", "(", "Variable", ")", "iterator", ".", "next", "(", ")", ";", "String", "type", "=", "BytecodeHelper", ".", "getTypeDescription", "(", "v", ".", "getType", "(", ")", ")", ";", "Label", "start", "=", "v", ".", "getStartLabel", "(", ")", ";", "Label", "end", "=", "v", ".", "getEndLabel", "(", ")", ";", "if", "(", "start", "!=", "null", "&&", "end", "!=", "null", ")", "mv", ".", "visitLocalVariable", "(", "v", ".", "getName", "(", ")", ",", "type", ",", "null", ",", "start", ",", "end", ",", "v", ".", "getIndex", "(", ")", ")", ";", "}", "}", "for", "(", "ExceptionTableEntry", "ep", ":", "typedExceptions", ")", "{", "mv", ".", "visitTryCatchBlock", "(", "ep", ".", "start", ",", "ep", ".", "end", ",", "ep", ".", "goal", ",", "ep", ".", "sig", ")", ";", "}", "for", "(", "ExceptionTableEntry", "ep", ":", "untypedExceptions", ")", "{", "mv", ".", "visitTryCatchBlock", "(", "ep", ".", "start", ",", "ep", ".", "end", ",", "ep", ".", "goal", ",", "ep", ".", "sig", ")", ";", "}", "pop", "(", ")", ";", "typedExceptions", ".", "clear", "(", ")", ";", "untypedExceptions", ".", "clear", "(", ")", ";", "stackVariables", ".", "clear", "(", ")", ";", "usedVariables", ".", "clear", "(", ")", ";", "scope", "=", "null", ";", "finallyBlocks", ".", "clear", "(", ")", ";", "mv", "=", "null", ";", "resetVariableIndex", "(", "false", ")", ";", "superBlockNamedLabels", ".", "clear", "(", ")", ";", "currentBlockNamedLabels", ".", "clear", "(", ")", ";", "namedLoopBreakLabel", ".", "clear", "(", ")", ";", "namedLoopContinueLabel", ".", "clear", "(", ")", ";", "continueLabel", "=", "null", ";", "breakLabel", "=", "null", ";", "helper", "=", "null", ";", "thisStartLabel", "=", "null", ";", "thisEndLabel", "=", "null", ";", "}", "public", "void", "addExceptionBlock", "(", "Label", "start", ",", "Label", "end", ",", "Label", "goal", ",", "String", "sig", ")", "{", "ExceptionTableEntry", "ep", "=", "new", "ExceptionTableEntry", "(", ")", ";", "ep", ".", "start", "=", "start", ";", "ep", ".", "end", "=", "end", ";", "ep", ".", "sig", "=", "sig", ";", "ep", ".", "goal", "=", "goal", ";", "if", "(", "sig", "==", "null", ")", "{", "untypedExceptions", ".", "add", "(", "ep", ")", ";", "}", "else", "{", "typedExceptions", ".", "add", "(", "ep", ")", ";", "}", "}", "protected", "void", "init", "(", "VariableScope", "el", ",", "Parameter", "[", "]", "parameters", ",", "MethodVisitor", "mv", ",", "ClassNode", "cn", ")", "{", "if", "(", "!", "clear", ")", "throw", "new", "GroovyBugError", "(", "\"\"", ")", ";", "clear", "=", "false", ";", "pushVariableScope", "(", "el", ")", ";", "this", ".", "mv", "=", "mv", ";", "this", ".", "helper", "=", "new", "BytecodeHelper", "(", "mv", ")", ";", "defineMethodVariables", "(", "parameters", ",", "el", ".", "isInStaticContext", "(", ")", ")", ";", "this", ".", "className", "=", "BytecodeHelper", ".", "getTypeDescription", "(", "cn", ")", ";", "}", "protected", "void", "pushVariableScope", "(", "VariableScope", "el", ")", "{", "pushState", "(", ")", ";", "scope", "=", "el", ";", "superBlockNamedLabels", "=", "new", "HashMap", "(", "superBlockNamedLabels", ")", ";", "superBlockNamedLabels", ".", "putAll", "(", "currentBlockNamedLabels", ")", ";", "currentBlockNamedLabels", "=", "new", "HashMap", "(", ")", ";", "}", "protected", "void", "pushLoop", "(", "VariableScope", "el", ",", "String", "labelName", ")", "{", "pushVariableScope", "(", "el", ")", ";", "initLoopLabels", "(", "labelName", ")", ";", "}", "private", "void", "initLoopLabels", "(", "String", "labelName", ")", "{", "continueLabel", "=", "new", "Label", "(", ")", ";", "breakLabel", "=", "new", "Label", "(", ")", ";", "if", "(", "labelName", "!=", "null", ")", "{", "namedLoopBreakLabel", ".", "put", "(", "labelName", ",", "breakLabel", ")", ";", "namedLoopContinueLabel", ".", "put", "(", "labelName", ",", "continueLabel", ")", ";", "}", "}", "protected", "void", "pushLoop", "(", "String", "labelName", ")", "{", "pushState", "(", ")", ";", "initLoopLabels", "(", "labelName", ")", ";", "}", "protected", "Label", "getNamedBreakLabel", "(", "String", "name", ")", "{", "Label", "label", "=", "getBreakLabel", "(", ")", ";", "Label", "endLabel", "=", "null", ";", "if", "(", "name", "!=", "null", ")", "endLabel", "=", "(", "Label", ")", "namedLoopBreakLabel", ".", "get", "(", "name", ")", ";", "if", "(", "endLabel", "!=", "null", ")", "label", "=", "endLabel", ";", "return", "label", ";", "}", "protected", "Label", "getNamedContinueLabel", "(", "String", "name", ")", "{", "Label", "label", "=", "getLabel", "(", "name", ")", ";", "Label", "endLabel", "=", "null", ";", "if", "(", "name", "!=", "null", ")", "endLabel", "=", "(", "Label", ")", "namedLoopContinueLabel", ".", "get", "(", "name", ")", ";", "if", "(", "endLabel", "!=", "null", ")", "label", "=", "endLabel", ";", "return", "label", ";", "}", "protected", "Label", "pushSwitch", "(", ")", "{", "pushState", "(", ")", ";", "breakLabel", "=", "new", "Label", "(", ")", ";", "return", "breakLabel", ";", "}", "protected", "void", "pushBooleanExpression", "(", ")", "{", "pushState", "(", ")", ";", "}", "private", "Variable", "defineVar", "(", "String", "name", ",", "ClassNode", "type", ",", "boolean", "methodParameterUsedInClosure", ")", "{", "int", "prevCurrent", "=", "currentVariableIndex", ";", "makeNextVariableID", "(", "type", ")", ";", "int", "index", "=", "currentVariableIndex", ";", "if", "(", "methodParameterUsedInClosure", ")", "{", "index", "=", "localVariableOffset", "++", ";", "type", "=", "ClassHelper", ".", "getWrapper", "(", "type", ")", ";", "}", "Variable", "answer", "=", "new", "Variable", "(", "index", ",", "type", ",", "name", ",", "prevCurrent", ")", ";", "usedVariables", ".", "add", "(", "answer", ")", ";", "answer", ".", "setHolder", "(", "methodParameterUsedInClosure", ")", ";", "return", "answer", ";", "}", "private", "void", "makeLocalVariablesOffset", "(", "Parameter", "[", "]", "paras", ",", "boolean", "isInStaticContext", ")", "{", "resetVariableIndex", "(", "isInStaticContext", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "paras", ".", "length", ";", "i", "++", ")", "{", "makeNextVariableID", "(", "paras", "[", "i", "]", ".", "getType", "(", ")", ")", ";", "}", "localVariableOffset", "=", "nextVariableIndex", ";", "resetVariableIndex", "(", "isInStaticContext", ")", ";", "}", "private", "void", "defineMethodVariables", "(", "Parameter", "[", "]", "paras", ",", "boolean", "isInStaticContext", ")", "{", "Label", "startLabel", "=", "new", "Label", "(", ")", ";", "thisStartLabel", "=", "startLabel", ";", "mv", ".", "visitLabel", "(", "startLabel", ")", ";", "makeLocalVariablesOffset", "(", "paras", ",", "isInStaticContext", ")", ";", "boolean", "hasHolder", "=", "false", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "paras", ".", "length", ";", "i", "++", ")", "{", "String", "name", "=", "paras", "[", "i", "]", ".", "getName", "(", ")", ";", "Variable", "answer", ";", "ClassNode", "type", "=", "paras", "[", "i", "]", ".", "getType", "(", ")", ";", "if", "(", "paras", "[", "i", "]", ".", "isClosureSharedVariable", "(", ")", ")", "{", "answer", "=", "defineVar", "(", "name", ",", "type", ",", "true", ")", ";", "helper", ".", "load", "(", "type", ",", "currentVariableIndex", ")", ";", "helper", ".", "box", "(", "type", ")", ";", "Label", "newStart", "=", "new", "Label", "(", ")", ";", "mv", ".", "visitLabel", "(", "newStart", ")", ";", "Variable", "var", "=", "new", "Variable", "(", "currentVariableIndex", ",", "paras", "[", "i", "]", ".", "getOriginType", "(", ")", ",", "name", ",", "currentVariableIndex", ")", ";", "var", ".", "setStartLabel", "(", "startLabel", ")", ";", "var", ".", "setEndLabel", "(", "newStart", ")", ";", "usedVariables", ".", "add", "(", "var", ")", ";", "answer", ".", "setStartLabel", "(", "newStart", ")", ";", "createReference", "(", "answer", ")", ";", "hasHolder", "=", "true", ";", "}", "else", "{", "answer", "=", "defineVar", "(", "name", ",", "type", ",", "false", ")", ";", "answer", ".", "setStartLabel", "(", "startLabel", ")", ";", "}", "stackVariables", ".", "put", "(", "name", ",", "answer", ")", ";", "}", "if", "(", "hasHolder", ")", "{", "nextVariableIndex", "=", "localVariableOffset", ";", "}", "}", "private", "void", "createReference", "(", "Variable", "reference", ")", "{", "mv", ".", "visitTypeInsn", "(", "NEW", ",", "\"\"", ")", ";", "mv", ".", "visitInsn", "(", "DUP_X1", ")", ";", "mv", ".", "visitInsn", "(", "SWAP", ")", ";", "mv", ".", "visitMethodInsn", "(", "INVOKESPECIAL", ",", "\"\"", ",", "\"<init>\"", ",", "\"\"", ")", ";", "mv", ".", "visitVarInsn", "(", "ASTORE", ",", "reference", ".", "getIndex", "(", ")", ")", ";", "}", "public", "Variable", "defineVariable", "(", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "Variable", "v", ",", "boolean", "initFromStack", ")", "{", "String", "name", "=", "v", ".", "getName", "(", ")", ";", "Variable", "answer", "=", "defineVar", "(", "name", ",", "v", ".", "getType", "(", ")", ",", "false", ")", ";", "if", "(", "v", ".", "isClosureSharedVariable", "(", ")", ")", "answer", ".", "setHolder", "(", "true", ")", ";", "stackVariables", ".", "put", "(", "name", ",", "answer", ")", ";", "Label", "startLabel", "=", "new", "Label", "(", ")", ";", "answer", ".", "setStartLabel", "(", "startLabel", ")", ";", "if", "(", "answer", ".", "isHolder", "(", ")", ")", "{", "if", "(", "!", "initFromStack", ")", "mv", ".", "visitInsn", "(", "ACONST_NULL", ")", ";", "createReference", "(", "answer", ")", ";", "}", "else", "{", "if", "(", "!", "initFromStack", ")", "mv", ".", "visitInsn", "(", "ACONST_NULL", ")", ";", "mv", ".", "visitVarInsn", "(", "ASTORE", ",", "currentVariableIndex", ")", ";", "}", "mv", ".", "visitLabel", "(", "startLabel", ")", ";", "return", "answer", ";", "}", "public", "boolean", "containsVariable", "(", "String", "name", ")", "{", "return", "stackVariables", ".", "containsKey", "(", "name", ")", ";", "}", "private", "void", "makeNextVariableID", "(", "ClassNode", "type", ")", "{", "currentVariableIndex", "=", "nextVariableIndex", ";", "if", "(", "type", "==", "ClassHelper", ".", "long_TYPE", "||", "type", "==", "ClassHelper", ".", "double_TYPE", ")", "{", "nextVariableIndex", "++", ";", "}", "nextVariableIndex", "++", ";", "}", "public", "Label", "getLabel", "(", "String", "name", ")", "{", "if", "(", "name", "==", "null", ")", "return", "null", ";", "Label", "l", "=", "(", "Label", ")", "superBlockNamedLabels", ".", "get", "(", "name", ")", ";", "if", "(", "l", "==", "null", ")", "l", "=", "createLocalLabel", "(", "name", ")", ";", "return", "l", ";", "}", "public", "Label", "createLocalLabel", "(", "String", "name", ")", "{", "Label", "l", "=", "(", "Label", ")", "currentBlockNamedLabels", ".", "get", "(", "name", ")", ";", "if", "(", "l", "==", "null", ")", "{", "l", "=", "new", "Label", "(", ")", ";", "currentBlockNamedLabels", ".", "put", "(", "name", ",", "l", ")", ";", "}", "return", "l", ";", "}", "public", "void", "applyFinallyBlocks", "(", "Label", "label", ",", "boolean", "isBreakLabel", ")", "{", "StateStackElement", "result", "=", "null", ";", "for", "(", "ListIterator", "iter", "=", "stateStack", ".", "listIterator", "(", "stateStack", ".", "size", "(", ")", ")", ";", "iter", ".", "hasPrevious", "(", ")", ";", ")", "{", "StateStackElement", "element", "=", "(", "StateStackElement", ")", "iter", ".", "previous", "(", ")", ";", "if", "(", "!", "element", ".", "currentBlockNamedLabels", ".", "values", "(", ")", ".", "contains", "(", "label", ")", ")", "{", "if", "(", "isBreakLabel", "&&", "element", ".", "breakLabel", "!=", "label", ")", "{", "result", "=", "element", ";", "break", ";", "}", "if", "(", "!", "isBreakLabel", "&&", "element", ".", "continueLabel", "!=", "label", ")", "{", "result", "=", "element", ";", "break", ";", "}", "}", "}", "List", "<", "BlockRecorder", ">", "blocksToRemove", ";", "if", "(", "result", "==", "null", ")", "{", "blocksToRemove", "=", "(", "List", "<", "BlockRecorder", ">", ")", "Collections", ".", "EMPTY_LIST", ";", "}", "else", "{", "blocksToRemove", "=", "result", ".", "finallyBlocks", ";", "}", "List", "<", "BlockRecorder", ">", "blocks", "=", "new", "LinkedList", "<", "BlockRecorder", ">", "(", "finallyBlocks", ")", ";", "blocks", ".", "removeAll", "(", "blocksToRemove", ")", ";", "applyBlockRecorder", "(", "blocks", ")", ";", "}", "private", "void", "applyBlockRecorder", "(", "List", "<", "BlockRecorder", ">", "blocks", ")", "{", "if", "(", "blocks", ".", "size", "(", ")", "==", "0", "||", "blocks", ".", "size", "(", ")", "==", "visitedBlocks", ".", "size", "(", ")", ")", "return", ";", "Label", "end", "=", "new", "Label", "(", ")", ";", "mv", ".", "visitInsn", "(", "NOP", ")", ";", "mv", ".", "visitLabel", "(", "end", ")", ";", "Label", "newStart", "=", "new", "Label", "(", ")", ";", "for", "(", "BlockRecorder", "fb", ":", "blocks", ")", "{", "if", "(", "visitedBlocks", ".", "contains", "(", "fb", ")", ")", "continue", ";", "fb", ".", "closeRange", "(", "end", ")", ";", "fb", ".", "excludedStatement", ".", "run", "(", ")", ";", "fb", ".", "startRange", "(", "newStart", ")", ";", "}", "mv", ".", "visitInsn", "(", "NOP", ")", ";", "mv", ".", "visitLabel", "(", "newStart", ")", ";", "}", "public", "void", "applyBlockRecorder", "(", ")", "{", "applyBlockRecorder", "(", "finallyBlocks", ")", ";", "}", "public", "boolean", "hasBlockRecorder", "(", ")", "{", "return", "!", "finallyBlocks", ".", "isEmpty", "(", ")", ";", "}", "public", "void", "pushBlockRecorder", "(", "BlockRecorder", "recorder", ")", "{", "pushState", "(", ")", ";", "finallyBlocks", ".", "addFirst", "(", "recorder", ")", ";", "}", "public", "void", "pushBlockRecorderVisit", "(", "BlockRecorder", "finallyBlock", ")", "{", "visitedBlocks", ".", "add", "(", "finallyBlock", ")", ";", "}", "public", "void", "popBlockRecorderVisit", "(", "BlockRecorder", "finallyBlock", ")", "{", "visitedBlocks", ".", "remove", "(", "finallyBlock", ")", ";", "}", "public", "void", "writeExceptionTable", "(", "BlockRecorder", "block", ",", "Label", "goal", ",", "String", "sig", ")", "{", "if", "(", "block", ".", "isEmpty", ")", "return", ";", "for", "(", "LabelRange", "range", ":", "block", ".", "ranges", ")", "{", "mv", ".", "visitTryCatchBlock", "(", "range", ".", "start", ",", "range", ".", "end", ",", "goal", ",", "sig", ")", ";", "}", "}", "}", "</s>" ]
6,696
[ "<s>", "package", "org", ".", "codehaus", ".", "groovy", ".", "classgen", ";", "import", "groovy", ".", "lang", ".", "GroovyRuntimeException", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "GroovyBugError", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "*", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "expr", ".", "*", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "stmt", ".", "*", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "classgen", ".", "CompileStack", ".", "BlockRecorder", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "control", ".", "CompilerConfiguration", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "control", ".", "Janitor", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "control", ".", "SourceUnit", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "runtime", ".", "MetaClassHelper", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "runtime", ".", "ScriptBytecodeAdapter", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "runtime", ".", "callsite", ".", "CallSite", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "runtime", ".", "typehandling", ".", "DefaultTypeTransformation", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "syntax", ".", "RuntimeParserException", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "syntax", ".", "Token", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "syntax", ".", "Types", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "syntax", ".", "SyntaxException", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "transform", ".", "powerassert", ".", "SourceText", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "transform", ".", "powerassert", ".", "SourceTextNotAvailableException", ";", "import", "org", ".", "objectweb", ".", "asm", ".", "AnnotationVisitor", ";", "import", "org", ".", "objectweb", ".", "asm", ".", "*", ";", "import", "java", ".", "util", ".", "*", ";", "public", "class", "AsmClassGenerator", "extends", "ClassGenerator", "{", "private", "static", "class", "AssertionTracker", "{", "int", "recorderIndex", ";", "SourceText", "sourceText", ";", "}", "private", "AssertionTracker", "assertionTracker", ";", "private", "final", "ClassVisitor", "cv", ";", "private", "MethodVisitor", "mv", ";", "private", "GeneratorContext", "context", ";", "private", "String", "sourceFile", ";", "private", "ClassNode", "classNode", ";", "private", "ClassNode", "outermostClass", ";", "private", "String", "internalClassName", ";", "private", "String", "internalBaseClassName", ";", "private", "CompileStack", "compileStack", ";", "private", "boolean", "outputReturn", ";", "private", "boolean", "leftHandExpression", "=", "false", ";", "static", "final", "MethodCallerMultiAdapter", "invokeMethodOnCurrent", "=", "MethodCallerMultiAdapter", ".", "newStatic", "(", "ScriptBytecodeAdapter", ".", "class", ",", "\"\"", ",", "true", ",", "false", ")", ";", "static", "final", "MethodCallerMultiAdapter", "invokeMethodOnSuper", "=", "MethodCallerMultiAdapter", ".", "newStatic", "(", "ScriptBytecodeAdapter", ".", "class", ",", "\"\"", ",", "true", ",", "false", ")", ";", "static", "final", "MethodCallerMultiAdapter", "invokeMethod", "=", "MethodCallerMultiAdapter", ".", "newStatic", "(", "ScriptBytecodeAdapter", ".", "class", ",", "\"invokeMethod\"", ",", "true", ",", "false", ")", ";", "static", "final", "MethodCallerMultiAdapter", "invokeStaticMethod", "=", "MethodCallerMultiAdapter", ".", "newStatic", "(", "ScriptBytecodeAdapter", ".", "class", ",", "\"\"", ",", "true", ",", "true", ")", ";", "static", "final", "MethodCallerMultiAdapter", "invokeNew", "=", "MethodCallerMultiAdapter", ".", "newStatic", "(", "ScriptBytecodeAdapter", ".", "class", ",", "\"invokeNew\"", ",", "true", ",", "true", ")", ";", "static", "final", "MethodCallerMultiAdapter", "setField", "=", "MethodCallerMultiAdapter", ".", "newStatic", "(", "ScriptBytecodeAdapter", ".", "class", ",", "\"setField\"", ",", "false", ",", "false", ")", ";", "static", "final", "MethodCallerMultiAdapter", "getField", "=", "MethodCallerMultiAdapter", ".", "newStatic", "(", "ScriptBytecodeAdapter", ".", "class", ",", "\"getField\"", ",", "false", ",", "false", ")", ";", "static", "final", "MethodCallerMultiAdapter", "setGroovyObjectField", "=", "MethodCallerMultiAdapter", ".", "newStatic", "(", "ScriptBytecodeAdapter", ".", "class", ",", "\"\"", ",", "false", ",", "false", ")", ";", "static", "final", "MethodCallerMultiAdapter", "getGroovyObjectField", "=", "MethodCallerMultiAdapter", ".", "newStatic", "(", "ScriptBytecodeAdapter", ".", "class", ",", "\"\"", ",", "false", ",", "false", ")", ";", "static", "final", "MethodCallerMultiAdapter", "setFieldOnSuper", "=", "MethodCallerMultiAdapter", ".", "newStatic", "(", "ScriptBytecodeAdapter", ".", "class", ",", "\"\"", ",", "false", ",", "false", ")", ";", "static", "final", "MethodCallerMultiAdapter", "getFieldOnSuper", "=", "MethodCallerMultiAdapter", ".", "newStatic", "(", "ScriptBytecodeAdapter", ".", "class", ",", "\"\"", ",", "false", ",", "false", ")", ";", "static", "final", "MethodCallerMultiAdapter", "setProperty", "=", "MethodCallerMultiAdapter", ".", "newStatic", "(", "ScriptBytecodeAdapter", ".", "class", ",", "\"setProperty\"", ",", "false", ",", "false", ")", ";", "static", "final", "MethodCallerMultiAdapter", "getProperty", "=", "MethodCallerMultiAdapter", ".", "newStatic", "(", "ScriptBytecodeAdapter", ".", "class", ",", "\"getProperty\"", ",", "false", ",", "false", ")", ";", "static", "final", "MethodCallerMultiAdapter", "setGroovyObjectProperty", "=", "MethodCallerMultiAdapter", ".", "newStatic", "(", "ScriptBytecodeAdapter", ".", "class", ",", "\"\"", ",", "false", ",", "false", ")", ";", "static", "final", "MethodCallerMultiAdapter", "getGroovyObjectProperty", "=", "MethodCallerMultiAdapter", ".", "newStatic", "(", "ScriptBytecodeAdapter", ".", "class", ",", "\"\"", ",", "false", ",", "false", ")", ";", "static", "final", "MethodCallerMultiAdapter", "setPropertyOnSuper", "=", "MethodCallerMultiAdapter", ".", "newStatic", "(", "ScriptBytecodeAdapter", ".", "class", ",", "\"\"", ",", "false", ",", "false", ")", ";", "static", "final", "MethodCallerMultiAdapter", "getPropertyOnSuper", "=", "MethodCallerMultiAdapter", ".", "newStatic", "(", "ScriptBytecodeAdapter", ".", "class", ",", "\"\"", ",", "false", ",", "false", ")", ";", "static", "final", "MethodCaller", "iteratorNextMethod", "=", "MethodCaller", ".", "newInterface", "(", "Iterator", ".", "class", ",", "\"next\"", ")", ";", "static", "final", "MethodCaller", "iteratorHasNextMethod", "=", "MethodCaller", ".", "newInterface", "(", "Iterator", ".", "class", ",", "\"hasNext\"", ")", ";", "static", "final", "MethodCaller", "assertFailedMethod", "=", "MethodCaller", ".", "newStatic", "(", "ScriptBytecodeAdapter", ".", "class", ",", "\"assertFailed\"", ")", ";", "static", "final", "MethodCaller", "isCaseMethod", "=", "MethodCaller", ".", "newStatic", "(", "ScriptBytecodeAdapter", ".", "class", ",", "\"isCase\"", ")", ";", "static", "final", "MethodCaller", "compareIdenticalMethod", "=", "MethodCaller", ".", "newStatic", "(", "ScriptBytecodeAdapter", ".", "class", ",", "\"\"", ")", ";", "static", "final", "MethodCaller", "compareNotIdenticalMethod", "=", "MethodCaller", ".", "newStatic", "(", "ScriptBytecodeAdapter", ".", "class", ",", "\"\"", ")", ";", "static", "final", "MethodCaller", "compareEqualMethod", "=", "MethodCaller", ".", "newStatic", "(", "ScriptBytecodeAdapter", ".", "class", ",", "\"compareEqual\"", ")", ";", "static", "final", "MethodCaller", "compareNotEqualMethod", "=", "MethodCaller", ".", "newStatic", "(", "ScriptBytecodeAdapter", ".", "class", ",", "\"\"", ")", ";", "static", "final", "MethodCaller", "compareToMethod", "=", "MethodCaller", ".", "newStatic", "(", "ScriptBytecodeAdapter", ".", "class", ",", "\"compareTo\"", ")", ";", "static", "final", "MethodCaller", "compareLessThanMethod", "=", "MethodCaller", ".", "newStatic", "(", "ScriptBytecodeAdapter", ".", "class", ",", "\"\"", ")", ";", "static", "final", "MethodCaller", "compareLessThanEqualMethod", "=", "MethodCaller", ".", "newStatic", "(", "ScriptBytecodeAdapter", ".", "class", ",", "\"\"", ")", ";", "static", "final", "MethodCaller", "compareGreaterThanMethod", "=", "MethodCaller", ".", "newStatic", "(", "ScriptBytecodeAdapter", ".", "class", ",", "\"\"", ")", ";", "static", "final", "MethodCaller", "compareGreaterThanEqualMethod", "=", "MethodCaller", ".", "newStatic", "(", "ScriptBytecodeAdapter", ".", "class", ",", "\"\"", ")", ";", "static", "final", "MethodCaller", "findRegexMethod", "=", "MethodCaller", ".", "newStatic", "(", "ScriptBytecodeAdapter", ".", "class", ",", "\"findRegex\"", ")", ";", "static", "final", "MethodCaller", "matchRegexMethod", "=", "MethodCaller", ".", "newStatic", "(", "ScriptBytecodeAdapter", ".", "class", ",", "\"matchRegex\"", ")", ";", "static", "final", "MethodCaller", "regexPattern", "=", "MethodCaller", ".", "newStatic", "(", "ScriptBytecodeAdapter", ".", "class", ",", "\"regexPattern\"", ")", ";", "static", "final", "MethodCaller", "spreadMap", "=", "MethodCaller", ".", "newStatic", "(", "ScriptBytecodeAdapter", ".", "class", ",", "\"spreadMap\"", ")", ";", "static", "final", "MethodCaller", "despreadList", "=", "MethodCaller", ".", "newStatic", "(", "ScriptBytecodeAdapter", ".", "class", ",", "\"despreadList\"", ")", ";", "static", "final", "MethodCaller", "getMethodPointer", "=", "MethodCaller", ".", "newStatic", "(", "ScriptBytecodeAdapter", ".", "class", ",", "\"\"", ")", ";", "static", "final", "MethodCaller", "invokeClosureMethod", "=", "MethodCaller", ".", "newStatic", "(", "ScriptBytecodeAdapter", ".", "class", ",", "\"\"", ")", ";", "static", "final", "MethodCaller", "unaryPlus", "=", "MethodCaller", ".", "newStatic", "(", "ScriptBytecodeAdapter", ".", "class", ",", "\"unaryPlus\"", ")", ";", "static", "final", "MethodCaller", "unaryMinus", "=", "MethodCaller", ".", "newStatic", "(", "ScriptBytecodeAdapter", ".", "class", ",", "\"unaryMinus\"", ")", ";", "static", "final", "MethodCaller", "bitwiseNegate", "=", "MethodCaller", ".", "newStatic", "(", "ScriptBytecodeAdapter", ".", "class", ",", "\"\"", ")", ";", "static", "final", "MethodCaller", "asTypeMethod", "=", "MethodCaller", ".", "newStatic", "(", "ScriptBytecodeAdapter", ".", "class", ",", "\"asType\"", ")", ";", "static", "final", "MethodCaller", "castToTypeMethod", "=", "MethodCaller", ".", "newStatic", "(", "ScriptBytecodeAdapter", ".", "class", ",", "\"castToType\"", ")", ";", "static", "final", "MethodCaller", "createListMethod", "=", "MethodCaller", ".", "newStatic", "(", "ScriptBytecodeAdapter", ".", "class", ",", "\"createList\"", ")", ";", "static", "final", "MethodCaller", "createTupleMethod", "=", "MethodCaller", ".", "newStatic", "(", "ScriptBytecodeAdapter", ".", "class", ",", "\"createTuple\"", ")", ";", "static", "final", "MethodCaller", "createMapMethod", "=", "MethodCaller", ".", "newStatic", "(", "ScriptBytecodeAdapter", ".", "class", ",", "\"createMap\"", ")", ";", "static", "final", "MethodCaller", "createRangeMethod", "=", "MethodCaller", ".", "newStatic", "(", "ScriptBytecodeAdapter", ".", "class", ",", "\"createRange\"", ")", ";", "static", "final", "MethodCaller", "createPojoWrapperMethod", "=", "MethodCaller", ".", "newStatic", "(", "ScriptBytecodeAdapter", ".", "class", ",", "\"\"", ")", ";", "static", "final", "MethodCaller", "createGroovyObjectWrapperMethod", "=", "MethodCaller", ".", "newStatic", "(", "ScriptBytecodeAdapter", ".", "class", ",", "\"\"", ")", ";", "static", "final", "MethodCaller", "selectConstructorAndTransformArguments", "=", "MethodCaller", ".", "newStatic", "(", "ScriptBytecodeAdapter", ".", "class", ",", "\"\"", ")", ";", "private", "Map", "<", "String", ",", "ClassNode", ">", "referencedClasses", "=", "new", "HashMap", "<", "String", ",", "ClassNode", ">", "(", ")", ";", "private", "boolean", "passingParams", ";", "private", "ConstructorNode", "constructorNode", ";", "private", "MethodNode", "methodNode", ";", "private", "BytecodeHelper", "helper", "=", "new", "BytecodeHelper", "(", "null", ")", ";", "public", "static", "final", "boolean", "CREATE_DEBUG_INFO", "=", "true", ";", "public", "static", "final", "boolean", "CREATE_LINE_NUMBER_INFO", "=", "true", ";", "public", "static", "final", "boolean", "ASM_DEBUG", "=", "false", ";", "private", "int", "lineNumber", "=", "-", "1", ";", "private", "ASTNode", "currentASTNode", "=", "null", ";", "private", "ClassWriter", "dummyClassWriter", "=", "null", ";", "private", "ClassNode", "interfaceClassLoadingClass", ";", "private", "boolean", "implicitThis", "=", "false", ";", "private", "Map", "<", "String", ",", "GenericsType", ">", "genericParameterNames", "=", "null", ";", "private", "ClassNode", "rightHandType", ";", "private", "static", "final", "String", "CONSTRUCTOR", "=", "\"\"", ";", "private", "List", "callSites", "=", "new", "ArrayList", "(", ")", ";", "private", "int", "callSiteArrayVarIndex", ";", "private", "HashMap", "<", "ClosureExpression", ",", "ClassNode", ">", "closureClassMap", ";", "private", "SourceUnit", "source", ";", "private", "static", "final", "String", "DTT", "=", "BytecodeHelper", ".", "getClassInternalName", "(", "DefaultTypeTransformation", ".", "class", ".", "getName", "(", ")", ")", ";", "private", "boolean", "specialCallWithinConstructor", "=", "false", ";", "public", "AsmClassGenerator", "(", "SourceUnit", "source", ",", "GeneratorContext", "context", ",", "ClassVisitor", "classVisitor", ",", "ClassLoader", "classLoader", ",", "String", "sourceFile", ")", "{", "super", "(", "classLoader", ")", ";", "this", ".", "source", "=", "source", ";", "this", ".", "context", "=", "context", ";", "this", ".", "cv", "=", "classVisitor", ";", "this", ".", "sourceFile", "=", "sourceFile", ";", "this", ".", "dummyClassWriter", "=", "new", "ClassWriter", "(", "ClassWriter", ".", "COMPUTE_MAXS", ")", ";", "new", "DummyClassGenerator", "(", "context", ",", "dummyClassWriter", ",", "classLoader", ",", "sourceFile", ")", ";", "compileStack", "=", "new", "CompileStack", "(", ")", ";", "genericParameterNames", "=", "new", "HashMap", "<", "String", ",", "GenericsType", ">", "(", ")", ";", "closureClassMap", "=", "new", "HashMap", "<", "ClosureExpression", ",", "ClassNode", ">", "(", ")", ";", "}", "protected", "SourceUnit", "getSourceUnit", "(", ")", "{", "return", "source", ";", "}", "public", "void", "visitClass", "(", "ClassNode", "classNode", ")", "{", "try", "{", "callSites", ".", "clear", "(", ")", ";", "if", "(", "classNode", "instanceof", "InterfaceHelperClassNode", ")", "{", "InterfaceHelperClassNode", "ihcn", "=", "(", "InterfaceHelperClassNode", ")", "classNode", ";", "callSites", ".", "addAll", "(", "ihcn", ".", "getCallSites", "(", ")", ")", ";", "}", "referencedClasses", ".", "clear", "(", ")", ";", "this", ".", "classNode", "=", "classNode", ";", "this", ".", "outermostClass", "=", "null", ";", "this", ".", "internalClassName", "=", "BytecodeHelper", ".", "getClassInternalName", "(", "classNode", ")", ";", "this", ".", "internalBaseClassName", "=", "BytecodeHelper", ".", "getClassInternalName", "(", "classNode", ".", "getSuperClass", "(", ")", ")", ";", "cv", ".", "visit", "(", "getBytecodeVersion", "(", ")", ",", "adjustedClassModifiers", "(", "classNode", ".", "getModifiers", "(", ")", ")", ",", "internalClassName", ",", "BytecodeHelper", ".", "getGenericsSignature", "(", "classNode", ")", ",", "internalBaseClassName", ",", "BytecodeHelper", ".", "getClassInternalNames", "(", "classNode", ".", "getInterfaces", "(", ")", ")", ")", ";", "cv", ".", "visitSource", "(", "sourceFile", ",", "null", ")", ";", "if", "(", "classNode", ".", "getName", "(", ")", ".", "endsWith", "(", "\"package-info\"", ")", ")", "{", "PackageNode", "packageNode", "=", "classNode", ".", "getPackage", "(", ")", ";", "if", "(", "packageNode", "!=", "null", ")", "{", "for", "(", "AnnotationNode", "an", ":", "packageNode", ".", "getAnnotations", "(", ")", ")", "{", "if", "(", "an", ".", "isBuiltIn", "(", ")", ")", "continue", ";", "if", "(", "an", ".", "hasSourceRetention", "(", ")", ")", "continue", ";", "AnnotationVisitor", "av", "=", "getAnnotationVisitor", "(", "classNode", ",", "an", ",", "cv", ")", ";", "visitAnnotationAttributes", "(", "an", ",", "av", ")", ";", "av", ".", "visitEnd", "(", ")", ";", "}", "}", "cv", ".", "visitEnd", "(", ")", ";", "return", ";", "}", "else", "{", "visitAnnotations", "(", "classNode", ",", "cv", ")", ";", "}", "if", "(", "classNode", ".", "isInterface", "(", ")", ")", "{", "ClassNode", "owner", "=", "classNode", ";", "if", "(", "owner", "instanceof", "InnerClassNode", ")", "{", "owner", "=", "owner", ".", "getOuterClass", "(", ")", ";", "}", "String", "outerClassName", "=", "owner", ".", "getName", "(", ")", ";", "String", "name", "=", "outerClassName", "+", "\"$\"", "+", "context", ".", "getNextInnerClassIdx", "(", ")", ";", "interfaceClassLoadingClass", "=", "new", "InterfaceHelperClassNode", "(", "owner", ",", "name", ",", "4128", ",", "ClassHelper", ".", "OBJECT_TYPE", ",", "callSites", ")", ";", "super", ".", "visitClass", "(", "classNode", ")", ";", "createInterfaceSyntheticStaticFields", "(", ")", ";", "}", "else", "{", "super", ".", "visitClass", "(", "classNode", ")", ";", "if", "(", "!", "classNode", ".", "declaresInterface", "(", "ClassHelper", ".", "GENERATED_CLOSURE_Type", ")", ")", "{", "createMopMethods", "(", ")", ";", "}", "generateCallSiteArray", "(", ")", ";", "createSyntheticStaticFields", "(", ")", ";", "}", "for", "(", "Iterator", "<", "InnerClassNode", ">", "iter", "=", "classNode", ".", "getInnerClasses", "(", ")", ";", "iter", ".", "hasNext", "(", ")", ";", ")", "{", "InnerClassNode", "innerClass", "=", "iter", ".", "next", "(", ")", ";", "makeInnerClassEntry", "(", "innerClass", ")", ";", "}", "makeInnerClassEntry", "(", "classNode", ")", ";", "cv", ".", "visitEnd", "(", ")", ";", "}", "catch", "(", "GroovyRuntimeException", "e", ")", "{", "e", ".", "setModule", "(", "classNode", ".", "getModule", "(", ")", ")", ";", "throw", "e", ";", "}", "}", "private", "void", "makeInnerClassEntry", "(", "ClassNode", "cn", ")", "{", "if", "(", "!", "(", "cn", "instanceof", "InnerClassNode", ")", ")", "return", ";", "InnerClassNode", "innerClass", "=", "(", "InnerClassNode", ")", "cn", ";", "String", "innerClassName", "=", "innerClass", ".", "getName", "(", ")", ";", "String", "innerClassInternalName", "=", "BytecodeHelper", ".", "getClassInternalName", "(", "innerClassName", ")", ";", "{", "int", "index", "=", "innerClassName", ".", "lastIndexOf", "(", "'$'", ")", ";", "if", "(", "index", ">=", "0", ")", "innerClassName", "=", "innerClassName", ".", "substring", "(", "index", "+", "1", ")", ";", "}", "String", "outerClassName", "=", "BytecodeHelper", ".", "getClassInternalName", "(", "innerClass", ".", "getOuterClass", "(", ")", ".", "getName", "(", ")", ")", ";", "MethodNode", "enclosingMethod", "=", "innerClass", ".", "getEnclosingMethod", "(", ")", ";", "if", "(", "enclosingMethod", "!=", "null", ")", "{", "outerClassName", "=", "null", ";", "innerClassName", "=", "null", ";", "}", "int", "mods", "=", "innerClass", ".", "getModifiers", "(", ")", ";", "cv", ".", "visitInnerClass", "(", "innerClassInternalName", ",", "outerClassName", ",", "innerClassName", ",", "mods", ")", ";", "}", "private", "int", "adjustedClassModifiers", "(", "int", "modifiers", ")", "{", "boolean", "needsSuper", "=", "(", "modifiers", "&", "ACC_INTERFACE", ")", "==", "0", ";", "modifiers", "=", "needsSuper", "?", "modifiers", "|", "ACC_SUPER", ":", "modifiers", ";", "modifiers", "=", "modifiers", "&", "~", "ACC_STATIC", ";", "return", "modifiers", ";", "}", "private", "void", "generateCallSiteArray", "(", ")", "{", "if", "(", "!", "classNode", ".", "isInterface", "(", ")", ")", "{", "cv", ".", "visitField", "(", "ACC_PRIVATE", "+", "ACC_STATIC", "+", "ACC_SYNTHETIC", ",", "\"\"", ",", "\"\"", ",", "null", ",", "null", ")", ";", "generateCreateCallSiteArray", "(", ")", ";", "generateGetCallSiteArray", "(", ")", ";", "}", "}", "private", "void", "generateGetCallSiteArray", "(", ")", "{", "int", "visibility", "=", "(", "classNode", "instanceof", "InterfaceHelperClassNode", ")", "?", "ACC_PUBLIC", ":", "ACC_PRIVATE", ";", "MethodVisitor", "mv", "=", "cv", ".", "visitMethod", "(", "visibility", "+", "ACC_SYNTHETIC", "+", "ACC_STATIC", ",", "\"\"", ",", "\"\"", ",", "null", ",", "null", ")", ";", "mv", ".", "visitCode", "(", ")", ";", "mv", ".", "visitFieldInsn", "(", "GETSTATIC", ",", "internalClassName", ",", "\"\"", ",", "\"\"", ")", ";", "Label", "l0", "=", "new", "Label", "(", ")", ";", "mv", ".", "visitJumpInsn", "(", "IFNULL", ",", "l0", ")", ";", "mv", ".", "visitFieldInsn", "(", "GETSTATIC", ",", "internalClassName", ",", "\"\"", ",", "\"\"", ")", ";", "mv", ".", "visitMethodInsn", "(", "INVOKEVIRTUAL", ",", "\"\"", ",", "\"get\"", ",", "\"\"", ")", ";", "mv", ".", "visitTypeInsn", "(", "CHECKCAST", ",", "\"\"", ")", ";", "mv", ".", "visitInsn", "(", "DUP", ")", ";", "mv", ".", "visitVarInsn", "(", "ASTORE", ",", "0", ")", ";", "Label", "l1", "=", "new", "Label", "(", ")", ";", "mv", ".", "visitJumpInsn", "(", "IFNONNULL", ",", "l1", ")", ";", "mv", ".", "visitLabel", "(", "l0", ")", ";", "mv", ".", "visitMethodInsn", "(", "INVOKESTATIC", ",", "internalClassName", ",", "\"\"", ",", "\"\"", ")", ";", "mv", ".", "visitVarInsn", "(", "ASTORE", ",", "0", ")", ";", "mv", ".", "visitTypeInsn", "(", "NEW", ",", "\"\"", ")", ";", "mv", ".", "visitInsn", "(", "DUP", ")", ";", "mv", ".", "visitVarInsn", "(", "ALOAD", ",", "0", ")", ";", "mv", ".", "visitMethodInsn", "(", "INVOKESPECIAL", ",", "\"\"", ",", "\"<init>\"", ",", "\"\"", ")", ";", "mv", ".", "visitFieldInsn", "(", "PUTSTATIC", ",", "internalClassName", ",", "\"\"", ",", "\"\"", ")", ";", "mv", ".", "visitLabel", "(", "l1", ")", ";", "mv", ".", "visitVarInsn", "(", "ALOAD", ",", "0", ")", ";", "mv", ".", "visitFieldInsn", "(", "GETFIELD", ",", "\"\"", ",", "\"array\"", ",", "\"\"", ")", ";", "mv", ".", "visitInsn", "(", "ARETURN", ")", ";", "mv", ".", "visitMaxs", "(", "0", ",", "0", ")", ";", "mv", ".", "visitEnd", "(", ")", ";", "}", "private", "void", "generateCreateCallSiteArray", "(", ")", "{", "List", "<", "String", ">", "callSiteInitMethods", "=", "new", "LinkedList", "<", "String", ">", "(", ")", ";", "int", "index", "=", "0", ";", "int", "methodIndex", "=", "0", ";", "final", "int", "size", "=", "callSites", ".", "size", "(", ")", ";", "final", "int", "maxArrayInit", "=", "5000", ";", "while", "(", "index", "<", "size", ")", "{", "methodIndex", "++", ";", "String", "methodName", "=", "\"\"", "+", "methodIndex", ";", "callSiteInitMethods", ".", "add", "(", "methodName", ")", ";", "MethodVisitor", "mv", "=", "cv", ".", "visitMethod", "(", "ACC_PRIVATE", "+", "ACC_SYNTHETIC", "+", "ACC_STATIC", ",", "methodName", ",", "\"\"", ",", "null", ",", "null", ")", ";", "mv", ".", "visitCode", "(", ")", ";", "int", "methodLimit", "=", "size", ";", "if", "(", "(", "methodLimit", "-", "index", ")", ">", "maxArrayInit", ")", "{", "methodLimit", "=", "index", "+", "maxArrayInit", ";", "}", "for", "(", ";", "index", "<", "methodLimit", ";", "index", "++", ")", "{", "mv", ".", "visitVarInsn", "(", "ALOAD", ",", "0", ")", ";", "mv", ".", "visitLdcInsn", "(", "index", ")", ";", "mv", ".", "visitLdcInsn", "(", "callSites", ".", "get", "(", "index", ")", ")", ";", "mv", ".", "visitInsn", "(", "AASTORE", ")", ";", "}", "mv", ".", "visitInsn", "(", "RETURN", ")", ";", "mv", ".", "visitMaxs", "(", "2", ",", "1", ")", ";", "mv", ".", "visitEnd", "(", ")", ";", "}", "mv", "=", "cv", ".", "visitMethod", "(", "ACC_PRIVATE", "+", "ACC_SYNTHETIC", "+", "ACC_STATIC", ",", "\"\"", ",", "\"\"", ",", "null", ",", "null", ")", ";", "mv", ".", "visitCode", "(", ")", ";", "mv", ".", "visitLdcInsn", "(", "size", ")", ";", "mv", ".", "visitTypeInsn", "(", "ANEWARRAY", ",", "\"\"", ")", ";", "mv", ".", "visitVarInsn", "(", "ASTORE", ",", "0", ")", ";", "for", "(", "String", "methodName", ":", "callSiteInitMethods", ")", "{", "mv", ".", "visitVarInsn", "(", "ALOAD", ",", "0", ")", ";", "mv", ".", "visitMethodInsn", "(", "INVOKESTATIC", ",", "internalClassName", ",", "methodName", ",", "\"\"", ")", ";", "}", "mv", ".", "visitTypeInsn", "(", "NEW", ",", "\"\"", ")", ";", "mv", ".", "visitInsn", "(", "DUP", ")", ";", "visitClassExpression", "(", "new", "ClassExpression", "(", "classNode", ")", ")", ";", "mv", ".", "visitVarInsn", "(", "ALOAD", ",", "0", ")", ";", "mv", ".", "visitMethodInsn", "(", "INVOKESPECIAL", ",", "\"\"", ",", "\"<init>\"", ",", "\"\"", ")", ";", "mv", ".", "visitInsn", "(", "ARETURN", ")", ";", "mv", ".", "visitMaxs", "(", "0", ",", "0", ")", ";", "mv", ".", "visitEnd", "(", ")", ";", "}", "public", "void", "visitGenericType", "(", "GenericsType", "genericsType", ")", "{", "ClassNode", "type", "=", "genericsType", ".", "getType", "(", ")", ";", "genericParameterNames", ".", "put", "(", "type", ".", "getName", "(", ")", ",", "genericsType", ")", ";", "}", "private", "void", "createMopMethods", "(", ")", "{", "visitMopMethodList", "(", "classNode", ".", "getMethods", "(", ")", ",", "true", ")", ";", "visitMopMethodList", "(", "classNode", ".", "getSuperClass", "(", ")", ".", "getAllDeclaredMethods", "(", ")", ",", "false", ")", ";", "}", "private", "String", "[", "]", "buildExceptions", "(", "ClassNode", "[", "]", "exceptions", ")", "{", "if", "(", "exceptions", "==", "null", ")", "return", "null", ";", "String", "[", "]", "ret", "=", "new", "String", "[", "exceptions", ".", "length", "]", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "exceptions", ".", "length", ";", "i", "++", ")", "{", "ret", "[", "i", "]", "=", "BytecodeHelper", ".", "getClassInternalName", "(", "exceptions", "[", "i", "]", ")", ";", "}", "return", "ret", ";", "}", "private", "void", "visitMopMethodList", "(", "List", "methods", ",", "boolean", "isThis", ")", "{", "class", "Key", "{", "int", "hash", "=", "0", ";", "String", "name", ";", "Parameter", "[", "]", "params", ";", "Key", "(", "String", "name", ",", "Parameter", "[", "]", "params", ")", "{", "this", ".", "name", "=", "name", ";", "this", ".", "params", "=", "params", ";", "hash", "=", "name", ".", "hashCode", "(", ")", "<<", "2", "+", "params", ".", "length", ";", "}", "public", "int", "hashCode", "(", ")", "{", "return", "hash", ";", "}", "public", "boolean", "equals", "(", "Object", "obj", ")", "{", "Key", "other", "=", "(", "Key", ")", "obj", ";", "return", "other", ".", "name", ".", "equals", "(", "name", ")", "&&", "equalParameterTypes", "(", "other", ".", "params", ",", "params", ")", ";", "}", "}", "HashMap", "<", "Key", ",", "MethodNode", ">", "mops", "=", "new", "HashMap", "<", "Key", ",", "MethodNode", ">", "(", ")", ";", "LinkedList", "<", "MethodNode", ">", "mopCalls", "=", "new", "LinkedList", "<", "MethodNode", ">", "(", ")", ";", "for", "(", "Object", "method", ":", "methods", ")", "{", "MethodNode", "mn", "=", "(", "MethodNode", ")", "method", ";", "if", "(", "(", "mn", ".", "getModifiers", "(", ")", "&", "ACC_ABSTRACT", ")", "!=", "0", ")", "continue", ";", "if", "(", "mn", ".", "isStatic", "(", ")", ")", "continue", ";", "if", "(", "isThis", "^", "(", "mn", ".", "getModifiers", "(", ")", "&", "(", "ACC_PUBLIC", "|", "ACC_PROTECTED", ")", ")", "==", "0", ")", "continue", ";", "String", "methodName", "=", "mn", ".", "getName", "(", ")", ";", "if", "(", "isMopMethod", "(", "methodName", ")", ")", "{", "mops", ".", "put", "(", "new", "Key", "(", "methodName", ",", "mn", ".", "getParameters", "(", ")", ")", ",", "mn", ")", ";", "continue", ";", "}", "if", "(", "methodName", ".", "startsWith", "(", "\"<\"", ")", ")", "continue", ";", "String", "name", "=", "getMopMethodName", "(", "mn", ",", "isThis", ")", ";", "Key", "key", "=", "new", "Key", "(", "name", ",", "mn", ".", "getParameters", "(", ")", ")", ";", "if", "(", "mops", ".", "containsKey", "(", "key", ")", ")", "continue", ";", "mops", ".", "put", "(", "key", ",", "mn", ")", ";", "mopCalls", ".", "add", "(", "mn", ")", ";", "}", "generateMopCalls", "(", "mopCalls", ",", "isThis", ")", ";", "mopCalls", ".", "clear", "(", ")", ";", "mops", ".", "clear", "(", ")", ";", "}", "private", "boolean", "equalParameterTypes", "(", "Parameter", "[", "]", "p1", ",", "Parameter", "[", "]", "p2", ")", "{", "if", "(", "p1", ".", "length", "!=", "p2", ".", "length", ")", "return", "false", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "p1", ".", "length", ";", "i", "++", ")", "{", "if", "(", "!", "p1", "[", "i", "]", ".", "getType", "(", ")", ".", "equals", "(", "p2", "[", "i", "]", ".", "getType", "(", ")", ")", ")", "return", "false", ";", "}", "return", "true", ";", "}", "private", "void", "generateMopCalls", "(", "LinkedList", "<", "MethodNode", ">", "mopCalls", ",", "boolean", "useThis", ")", "{", "for", "(", "MethodNode", "method", ":", "mopCalls", ")", "{", "String", "name", "=", "getMopMethodName", "(", "method", ",", "useThis", ")", ";", "Parameter", "[", "]", "parameters", "=", "method", ".", "getParameters", "(", ")", ";", "String", "methodDescriptor", "=", "BytecodeHelper", ".", "getMethodDescriptor", "(", "method", ".", "getReturnType", "(", ")", ",", "method", ".", "getParameters", "(", ")", ")", ";", "mv", "=", "cv", ".", "visitMethod", "(", "Opcodes", ".", "ACC_PUBLIC", "|", "Opcodes", ".", "ACC_SYNTHETIC", ",", "name", ",", "methodDescriptor", ",", "null", ",", "null", ")", ";", "mv", ".", "visitVarInsn", "(", "ALOAD", ",", "0", ")", ";", "int", "newRegister", "=", "1", ";", "BytecodeHelper", "helper", "=", "new", "BytecodeHelper", "(", "mv", ")", ";", "for", "(", "Parameter", "parameter", ":", "parameters", ")", "{", "ClassNode", "type", "=", "parameter", ".", "getType", "(", ")", ";", "helper", ".", "load", "(", "parameter", ".", "getType", "(", ")", ",", "newRegister", ")", ";", "newRegister", "++", ";", "if", "(", "type", "==", "ClassHelper", ".", "double_TYPE", "||", "type", "==", "ClassHelper", ".", "long_TYPE", ")", "newRegister", "++", ";", "}", "mv", ".", "visitMethodInsn", "(", "INVOKESPECIAL", ",", "BytecodeHelper", ".", "getClassInternalName", "(", "method", ".", "getDeclaringClass", "(", ")", ")", ",", "method", ".", "getName", "(", ")", ",", "methodDescriptor", ")", ";", "helper", ".", "doReturn", "(", "method", ".", "getReturnType", "(", ")", ")", ";", "mv", ".", "visitMaxs", "(", "0", ",", "0", ")", ";", "mv", ".", "visitEnd", "(", ")", ";", "classNode", ".", "addMethod", "(", "name", ",", "Opcodes", ".", "ACC_PUBLIC", "|", "Opcodes", ".", "ACC_SYNTHETIC", ",", "method", ".", "getReturnType", "(", ")", ",", "parameters", ",", "null", ",", "null", ")", ";", "}", "}", "public", "static", "String", "getMopMethodName", "(", "MethodNode", "method", ",", "boolean", "useThis", ")", "{", "ClassNode", "declaringNode", "=", "method", ".", "getDeclaringClass", "(", ")", ";", "int", "distance", "=", "0", ";", "for", "(", ";", "declaringNode", "!=", "null", ";", "declaringNode", "=", "declaringNode", ".", "getSuperClass", "(", ")", ")", "{", "distance", "++", ";", "}", "return", "(", "useThis", "?", "\"this\"", ":", "\"super\"", ")", "+", "\"$\"", "+", "distance", "+", "\"$\"", "+", "method", ".", "getName", "(", ")", ";", "}", "public", "static", "boolean", "isMopMethod", "(", "String", "methodName", ")", "{", "return", "(", "methodName", ".", "startsWith", "(", "\"this$\"", ")", "||", "methodName", ".", "startsWith", "(", "\"super$\"", ")", ")", "&&", "!", "methodName", ".", "contains", "(", "\"$dist$\"", ")", ";", "}", "protected", "void", "visitConstructorOrMethod", "(", "MethodNode", "node", ",", "boolean", "isConstructor", ")", "{", "lineNumber", "=", "-", "1", ";", "Parameter", "[", "]", "parameters", "=", "node", ".", "getParameters", "(", ")", ";", "String", "methodType", "=", "BytecodeHelper", ".", "getMethodDescriptor", "(", "node", ".", "getReturnType", "(", ")", ",", "parameters", ")", ";", "String", "signature", "=", "BytecodeHelper", ".", "getGenericsMethodSignature", "(", "node", ")", ";", "int", "modifiers", "=", "node", ".", "getModifiers", "(", ")", ";", "if", "(", "isVargs", "(", "node", ".", "getParameters", "(", ")", ")", ")", "modifiers", "|=", "Opcodes", ".", "ACC_VARARGS", ";", "mv", "=", "cv", ".", "visitMethod", "(", "modifiers", ",", "node", ".", "getName", "(", ")", ",", "methodType", ",", "signature", ",", "buildExceptions", "(", "node", ".", "getExceptions", "(", ")", ")", ")", ";", "mv", "=", "new", "MyMethodAdapter", "(", ")", ";", "visitAnnotations", "(", "node", ",", "mv", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "parameters", ".", "length", ";", "i", "++", ")", "{", "visitParameterAnnotations", "(", "parameters", "[", "i", "]", ",", "i", ",", "mv", ")", ";", "}", "helper", "=", "new", "BytecodeHelper", "(", "mv", ")", ";", "if", "(", "classNode", ".", "isAnnotationDefinition", "(", ")", "&&", "!", "node", ".", "isStaticConstructor", "(", ")", ")", "{", "visitAnnotationDefault", "(", "node", ",", "mv", ")", ";", "}", "else", "if", "(", "!", "node", ".", "isAbstract", "(", ")", ")", "{", "Statement", "code", "=", "node", ".", "getCode", "(", ")", ";", "if", "(", "code", "instanceof", "BytecodeSequence", "&&", "(", "(", "BytecodeSequence", ")", "code", ")", ".", "getInstructions", "(", ")", ".", "size", "(", ")", "==", "1", "&&", "(", "(", "BytecodeSequence", ")", "code", ")", ".", "getInstructions", "(", ")", ".", "get", "(", "0", ")", "instanceof", "BytecodeInstruction", ")", "{", "(", "(", "BytecodeInstruction", ")", "(", "(", "BytecodeSequence", ")", "code", ")", ".", "getInstructions", "(", ")", ".", "get", "(", "0", ")", ")", ".", "visit", "(", "mv", ")", ";", "}", "else", "{", "visitStdMethod", "(", "node", ",", "isConstructor", ",", "parameters", ",", "code", ")", ";", "}", "mv", ".", "visitInsn", "(", "NOP", ")", ";", "mv", ".", "visitMaxs", "(", "0", ",", "0", ")", ";", "}", "mv", ".", "visitEnd", "(", ")", ";", "}", "private", "void", "visitStdMethod", "(", "MethodNode", "node", ",", "boolean", "isConstructor", ",", "Parameter", "[", "]", "parameters", ",", "Statement", "code", ")", "{", "if", "(", "isConstructor", "&&", "(", "code", "==", "null", "||", "!", "(", "(", "ConstructorNode", ")", "node", ")", ".", "firstStatementIsSpecialConstructorCall", "(", ")", ")", ")", "{", "mv", ".", "visitVarInsn", "(", "ALOAD", ",", "0", ")", ";", "mv", ".", "visitMethodInsn", "(", "INVOKESPECIAL", ",", "BytecodeHelper", ".", "getClassInternalName", "(", "classNode", ".", "getSuperClass", "(", ")", ")", ",", "\"<init>\"", ",", "\"()V\"", ")", ";", "}", "compileStack", ".", "init", "(", "node", ".", "getVariableScope", "(", ")", ",", "parameters", ",", "mv", ",", "classNode", ")", ";", "if", "(", "isNotClinit", "(", ")", ")", "{", "mv", ".", "visitMethodInsn", "(", "INVOKESTATIC", ",", "internalClassName", ",", "\"\"", ",", "\"\"", ")", ";", "callSiteArrayVarIndex", "=", "compileStack", ".", "defineTemporaryVariable", "(", "\"\"", ",", "ClassHelper", ".", "make", "(", "CallSite", "[", "]", ".", "class", ")", ",", "true", ")", ";", "}", "super", ".", "visitConstructorOrMethod", "(", "node", ",", "isConstructor", ")", ";", "if", "(", "!", "outputReturn", "||", "node", ".", "isVoidMethod", "(", ")", ")", "{", "mv", ".", "visitInsn", "(", "RETURN", ")", ";", "}", "compileStack", ".", "clear", "(", ")", ";", "}", "void", "visitAnnotationDefaultExpression", "(", "AnnotationVisitor", "av", ",", "ClassNode", "type", ",", "Expression", "exp", ")", "{", "if", "(", "type", ".", "isArray", "(", ")", ")", "{", "ListExpression", "list", "=", "(", "ListExpression", ")", "exp", ";", "AnnotationVisitor", "avl", "=", "av", ".", "visitArray", "(", "null", ")", ";", "ClassNode", "componentType", "=", "type", ".", "getComponentType", "(", ")", ";", "for", "(", "Expression", "lExp", ":", "list", ".", "getExpressions", "(", ")", ")", "{", "visitAnnotationDefaultExpression", "(", "avl", ",", "componentType", ",", "lExp", ")", ";", "}", "}", "else", "if", "(", "ClassHelper", ".", "isPrimitiveType", "(", "type", ")", "||", "type", ".", "equals", "(", "ClassHelper", ".", "STRING_TYPE", ")", ")", "{", "ConstantExpression", "constExp", "=", "(", "ConstantExpression", ")", "exp", ";", "av", ".", "visit", "(", "null", ",", "constExp", ".", "getValue", "(", ")", ")", ";", "}", "else", "if", "(", "ClassHelper", ".", "CLASS_Type", ".", "equals", "(", "type", ")", ")", "{", "ClassNode", "clazz", "=", "exp", ".", "getType", "(", ")", ";", "Type", "t", "=", "Type", ".", "getType", "(", "BytecodeHelper", ".", "getTypeDescription", "(", "clazz", ")", ")", ";", "av", ".", "visit", "(", "null", ",", "t", ")", ";", "}", "else", "if", "(", "type", ".", "isDerivedFrom", "(", "ClassHelper", ".", "Enum_Type", ")", ")", "{", "PropertyExpression", "pExp", "=", "(", "PropertyExpression", ")", "exp", ";", "ClassExpression", "cExp", "=", "(", "ClassExpression", ")", "pExp", ".", "getObjectExpression", "(", ")", ";", "String", "desc", "=", "BytecodeHelper", ".", "getTypeDescription", "(", "cExp", ".", "getType", "(", ")", ")", ";", "String", "name", "=", "pExp", ".", "getPropertyAsString", "(", ")", ";", "av", ".", "visitEnum", "(", "null", ",", "desc", ",", "name", ")", ";", "}", "else", "if", "(", "type", ".", "implementsInterface", "(", "ClassHelper", ".", "Annotation_TYPE", ")", ")", "{", "AnnotationConstantExpression", "avExp", "=", "(", "AnnotationConstantExpression", ")", "exp", ";", "AnnotationNode", "value", "=", "(", "AnnotationNode", ")", "avExp", ".", "getValue", "(", ")", ";", "AnnotationVisitor", "avc", "=", "av", ".", "visitAnnotation", "(", "null", ",", "BytecodeHelper", ".", "getTypeDescription", "(", "avExp", ".", "getType", "(", ")", ")", ")", ";", "visitAnnotationAttributes", "(", "value", ",", "avc", ")", ";", "}", "else", "{", "throw", "new", "GroovyBugError", "(", "\"\"", "+", "type", ".", "getName", "(", ")", ")", ";", "}", "av", ".", "visitEnd", "(", ")", ";", "}", "private", "void", "visitAnnotationDefault", "(", "MethodNode", "node", ",", "MethodVisitor", "mv", ")", "{", "if", "(", "!", "node", ".", "hasAnnotationDefault", "(", ")", ")", "return", ";", "Expression", "exp", "=", "(", "(", "ReturnStatement", ")", "node", ".", "getCode", "(", ")", ")", ".", "getExpression", "(", ")", ";", "AnnotationVisitor", "av", "=", "mv", ".", "visitAnnotationDefault", "(", ")", ";", "visitAnnotationDefaultExpression", "(", "av", ",", "node", ".", "getReturnType", "(", ")", ",", "exp", ")", ";", "}", "private", "boolean", "isNotClinit", "(", ")", "{", "return", "methodNode", "==", "null", "||", "!", "methodNode", ".", "getName", "(", ")", ".", "equals", "(", "\"<clinit>\"", ")", ";", "}", "private", "boolean", "isVargs", "(", "Parameter", "[", "]", "p", ")", "{", "if", "(", "p", ".", "length", "==", "0", ")", "return", "false", ";", "ClassNode", "clazz", "=", "p", "[", "p", ".", "length", "-", "1", "]", ".", "getType", "(", ")", ";", "return", "(", "clazz", ".", "isArray", "(", ")", ")", ";", "}", "public", "void", "visitConstructor", "(", "ConstructorNode", "node", ")", "{", "this", ".", "constructorNode", "=", "node", ";", "this", ".", "methodNode", "=", "null", ";", "outputReturn", "=", "false", ";", "super", ".", "visitConstructor", "(", "node", ")", ";", "}", "public", "void", "visitMethod", "(", "MethodNode", "node", ")", "{", "this", ".", "constructorNode", "=", "null", ";", "this", ".", "methodNode", "=", "node", ";", "outputReturn", "=", "false", ";", "super", ".", "visitMethod", "(", "node", ")", ";", "}", "public", "void", "visitField", "(", "FieldNode", "fieldNode", ")", "{", "onLineNumber", "(", "fieldNode", ",", "\"visitField:", "\"", "+", "fieldNode", ".", "getName", "(", ")", ")", ";", "ClassNode", "t", "=", "fieldNode", ".", "getType", "(", ")", ";", "String", "signature", "=", "BytecodeHelper", ".", "getGenericsBounds", "(", "t", ")", ";", "FieldVisitor", "fv", "=", "cv", ".", "visitField", "(", "fieldNode", ".", "getModifiers", "(", ")", ",", "fieldNode", ".", "getName", "(", ")", ",", "BytecodeHelper", ".", "getTypeDescription", "(", "t", ")", ",", "signature", ",", "null", ")", ";", "visitAnnotations", "(", "fieldNode", ",", "fv", ")", ";", "fv", ".", "visitEnd", "(", ")", ";", "}", "public", "void", "visitProperty", "(", "PropertyNode", "statement", ")", "{", "onLineNumber", "(", "statement", ",", "\"\"", "+", "statement", ".", "getField", "(", ")", ".", "getName", "(", ")", ")", ";", "this", ".", "methodNode", "=", "null", ";", "}", "protected", "void", "visitStatement", "(", "Statement", "statement", ")", "{", "String", "name", "=", "statement", ".", "getStatementLabel", "(", ")", ";", "if", "(", "name", "!=", "null", ")", "{", "Label", "label", "=", "compileStack", ".", "createLocalLabel", "(", "name", ")", ";", "mv", ".", "visitLabel", "(", "label", ")", ";", "}", "}", "public", "void", "visitBlockStatement", "(", "BlockStatement", "block", ")", "{", "visitStatement", "(", "block", ")", ";", "compileStack", ".", "pushVariableScope", "(", "block", ".", "getVariableScope", "(", ")", ")", ";", "super", ".", "visitBlockStatement", "(", "block", ")", ";", "compileStack", ".", "pop", "(", ")", ";", "}", "private", "void", "visitExpressionOrStatement", "(", "Object", "o", ")", "{", "if", "(", "o", "==", "EmptyExpression", ".", "INSTANCE", ")", "return", ";", "if", "(", "o", "instanceof", "Expression", ")", "{", "Expression", "expr", "=", "(", "Expression", ")", "o", ";", "visitAndAutoboxBoolean", "(", "expr", ")", ";", "if", "(", "isPopRequired", "(", "expr", ")", ")", "mv", ".", "visitInsn", "(", "POP", ")", ";", "}", "else", "{", "(", "(", "Statement", ")", "o", ")", ".", "visit", "(", "this", ")", ";", "}", "}", "private", "void", "visitForLoopWithClosureList", "(", "ForStatement", "loop", ")", "{", "compileStack", ".", "pushLoop", "(", "loop", ".", "getVariableScope", "(", ")", ",", "loop", ".", "getStatementLabel", "(", ")", ")", ";", "ClosureListExpression", "clExpr", "=", "(", "ClosureListExpression", ")", "loop", ".", "getCollectionExpression", "(", ")", ";", "compileStack", ".", "pushVariableScope", "(", "clExpr", ".", "getVariableScope", "(", ")", ")", ";", "List", "expressions", "=", "clExpr", ".", "getExpressions", "(", ")", ";", "int", "size", "=", "expressions", ".", "size", "(", ")", ";", "int", "condIndex", "=", "(", "size", "-", "1", ")", "/", "2", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "condIndex", ";", "i", "++", ")", "{", "visitExpressionOrStatement", "(", "expressions", ".", "get", "(", "i", ")", ")", ";", "}", "Label", "continueLabel", "=", "compileStack", ".", "getContinueLabel", "(", ")", ";", "Label", "breakLabel", "=", "compileStack", ".", "getBreakLabel", "(", ")", ";", "Label", "cond", "=", "new", "Label", "(", ")", ";", "mv", ".", "visitLabel", "(", "cond", ")", ";", "{", "Expression", "condExpr", "=", "(", "Expression", ")", "expressions", ".", "get", "(", "condIndex", ")", ";", "if", "(", "condExpr", "==", "EmptyExpression", ".", "INSTANCE", ")", "{", "mv", ".", "visitIntInsn", "(", "BIPUSH", ",", "1", ")", ";", "}", "else", "if", "(", "isComparisonExpression", "(", "condExpr", ")", ")", "{", "condExpr", ".", "visit", "(", "this", ")", ";", "}", "else", "{", "visitAndAutoboxBoolean", "(", "condExpr", ")", ";", "helper", ".", "unbox", "(", "ClassHelper", ".", "boolean_TYPE", ")", ";", "}", "}", "mv", ".", "visitJumpInsn", "(", "IFEQ", ",", "breakLabel", ")", ";", "loop", ".", "getLoopBlock", "(", ")", ".", "visit", "(", "this", ")", ";", "mv", ".", "visitLabel", "(", "continueLabel", ")", ";", "for", "(", "int", "i", "=", "condIndex", "+", "1", ";", "i", "<", "size", ";", "i", "++", ")", "{", "visitExpressionOrStatement", "(", "expressions", ".", "get", "(", "i", ")", ")", ";", "}", "mv", ".", "visitJumpInsn", "(", "GOTO", ",", "cond", ")", ";", "mv", ".", "visitLabel", "(", "breakLabel", ")", ";", "compileStack", ".", "pop", "(", ")", ";", "compileStack", ".", "pop", "(", ")", ";", "}", "public", "void", "visitForLoop", "(", "ForStatement", "loop", ")", "{", "onLineNumber", "(", "loop", ",", "\"visitForLoop\"", ")", ";", "visitStatement", "(", "loop", ")", ";", "Parameter", "loopVar", "=", "loop", ".", "getVariable", "(", ")", ";", "if", "(", "loopVar", "==", "ForStatement", ".", "FOR_LOOP_DUMMY", ")", "{", "visitForLoopWithClosureList", "(", "loop", ")", ";", "return", ";", "}", "compileStack", ".", "pushLoop", "(", "loop", ".", "getVariableScope", "(", ")", ",", "loop", ".", "getStatementLabel", "(", ")", ")", ";", "Variable", "variable", "=", "compileStack", ".", "defineVariable", "(", "loop", ".", "getVariable", "(", ")", ",", "false", ")", ";", "MethodCallExpression", "iterator", "=", "new", "MethodCallExpression", "(", "loop", ".", "getCollectionExpression", "(", ")", ",", "\"iterator\"", ",", "new", "ArgumentListExpression", "(", ")", ")", ";", "iterator", ".", "visit", "(", "this", ")", ";", "final", "int", "iteratorIdx", "=", "compileStack", ".", "defineTemporaryVariable", "(", "\"iterator\"", ",", "ClassHelper", ".", "make", "(", "java", ".", "util", ".", "Iterator", ".", "class", ")", ",", "true", ")", ";", "Label", "continueLabel", "=", "compileStack", ".", "getContinueLabel", "(", ")", ";", "Label", "breakLabel", "=", "compileStack", ".", "getBreakLabel", "(", ")", ";", "mv", ".", "visitLabel", "(", "continueLabel", ")", ";", "mv", ".", "visitVarInsn", "(", "ALOAD", ",", "iteratorIdx", ")", ";", "iteratorHasNextMethod", ".", "call", "(", "mv", ")", ";", "mv", ".", "visitJumpInsn", "(", "IFEQ", ",", "breakLabel", ")", ";", "mv", ".", "visitVarInsn", "(", "ALOAD", ",", "iteratorIdx", ")", ";", "iteratorNextMethod", ".", "call", "(", "mv", ")", ";", "helper", ".", "storeVar", "(", "variable", ")", ";", "loop", ".", "getLoopBlock", "(", ")", ".", "visit", "(", "this", ")", ";", "mv", ".", "visitJumpInsn", "(", "GOTO", ",", "continueLabel", ")", ";", "mv", ".", "visitLabel", "(", "breakLabel", ")", ";", "compileStack", ".", "pop", "(", ")", ";", "}", "public", "void", "visitWhileLoop", "(", "WhileStatement", "loop", ")", "{", "onLineNumber", "(", "loop", ",", "\"\"", ")", ";", "visitStatement", "(", "loop", ")", ";", "compileStack", ".", "pushLoop", "(", "loop", ".", "getStatementLabel", "(", ")", ")", ";", "Label", "continueLabel", "=", "compileStack", ".", "getContinueLabel", "(", ")", ";", "Label", "breakLabel", "=", "compileStack", ".", "getBreakLabel", "(", ")", ";", "mv", ".", "visitLabel", "(", "continueLabel", ")", ";", "Expression", "bool", "=", "loop", ".", "getBooleanExpression", "(", ")", ";", "boolean", "boolHandled", "=", "false", ";", "if", "(", "bool", "instanceof", "ConstantExpression", ")", "{", "ConstantExpression", "constant", "=", "(", "ConstantExpression", ")", "bool", ";", "if", "(", "constant", ".", "getValue", "(", ")", "==", "Boolean", ".", "TRUE", ")", "{", "boolHandled", "=", "true", ";", "}", "else", "if", "(", "constant", ".", "getValue", "(", ")", "==", "Boolean", ".", "FALSE", ")", "{", "boolHandled", "=", "true", ";", "mv", ".", "visitJumpInsn", "(", "GOTO", ",", "breakLabel", ")", ";", "}", "}", "if", "(", "!", "boolHandled", ")", "{", "bool", ".", "visit", "(", "this", ")", ";", "mv", ".", "visitJumpInsn", "(", "IFEQ", ",", "breakLabel", ")", ";", "}", "loop", ".", "getLoopBlock", "(", ")", ".", "visit", "(", "this", ")", ";", "mv", ".", "visitJumpInsn", "(", "GOTO", ",", "continueLabel", ")", ";", "mv", ".", "visitLabel", "(", "breakLabel", ")", ";", "compileStack", ".", "pop", "(", ")", ";", "}", "public", "void", "visitDoWhileLoop", "(", "DoWhileStatement", "loop", ")", "{", "onLineNumber", "(", "loop", ",", "\"\"", ")", ";", "visitStatement", "(", "loop", ")", ";", "compileStack", ".", "pushLoop", "(", "loop", ".", "getStatementLabel", "(", ")", ")", ";", "Label", "breakLabel", "=", "compileStack", ".", "getBreakLabel", "(", ")", ";", "Label", "continueLabel", "=", "compileStack", ".", "getContinueLabel", "(", ")", ";", "mv", ".", "visitLabel", "(", "continueLabel", ")", ";", "loop", ".", "getLoopBlock", "(", ")", ".", "visit", "(", "this", ")", ";", "loop", ".", "getBooleanExpression", "(", ")", ".", "visit", "(", "this", ")", ";", "mv", ".", "visitJumpInsn", "(", "IFEQ", ",", "continueLabel", ")", ";", "mv", ".", "visitLabel", "(", "breakLabel", ")", ";", "compileStack", ".", "pop", "(", ")", ";", "}", "public", "void", "visitIfElse", "(", "IfStatement", "ifElse", ")", "{", "onLineNumber", "(", "ifElse", ",", "\"visitIfElse\"", ")", ";", "visitStatement", "(", "ifElse", ")", ";", "ifElse", ".", "getBooleanExpression", "(", ")", ".", "visit", "(", "this", ")", ";", "Label", "l0", "=", "new", "Label", "(", ")", ";", "mv", ".", "visitJumpInsn", "(", "IFEQ", ",", "l0", ")", ";", "compileStack", ".", "pushBooleanExpression", "(", ")", ";", "ifElse", ".", "getIfBlock", "(", ")", ".", "visit", "(", "this", ")", ";", "compileStack", ".", "pop", "(", ")", ";", "Label", "l1", "=", "new", "Label", "(", ")", ";", "mv", ".", "visitJumpInsn", "(", "GOTO", ",", "l1", ")", ";", "mv", ".", "visitLabel", "(", "l0", ")", ";", "compileStack", ".", "pushBooleanExpression", "(", ")", ";", "ifElse", ".", "getElseBlock", "(", ")", ".", "visit", "(", "this", ")", ";", "compileStack", ".", "pop", "(", ")", ";", "mv", ".", "visitLabel", "(", "l1", ")", ";", "}", "public", "void", "visitTernaryExpression", "(", "TernaryExpression", "expression", ")", "{", "onLineNumber", "(", "expression", ",", "\"\"", ")", ";", "BooleanExpression", "boolPart", "=", "expression", ".", "getBooleanExpression", "(", ")", ";", "Expression", "truePart", "=", "expression", ".", "getTrueExpression", "(", ")", ";", "Expression", "falsePart", "=", "expression", ".", "getFalseExpression", "(", ")", ";", "if", "(", "expression", "instanceof", "ElvisOperatorExpression", ")", "{", "visitAndAutoboxBoolean", "(", "expression", ".", "getTrueExpression", "(", ")", ")", ";", "boolPart", "=", "new", "BooleanExpression", "(", "new", "BytecodeExpression", "(", ")", "{", "public", "void", "visit", "(", "MethodVisitor", "mv", ")", "{", "mv", ".", "visitInsn", "(", "DUP", ")", ";", "}", "}", ")", ";", "truePart", "=", "BytecodeExpression", ".", "NOP", ";", "final", "Expression", "oldFalse", "=", "falsePart", ";", "falsePart", "=", "new", "BytecodeExpression", "(", ")", "{", "public", "void", "visit", "(", "MethodVisitor", "mv", ")", "{", "mv", ".", "visitInsn", "(", "POP", ")", ";", "visitAndAutoboxBoolean", "(", "oldFalse", ")", ";", "}", "}", ";", "}", "boolPart", ".", "visit", "(", "this", ")", ";", "Label", "l0", "=", "new", "Label", "(", ")", ";", "mv", ".", "visitJumpInsn", "(", "IFEQ", ",", "l0", ")", ";", "compileStack", ".", "pushBooleanExpression", "(", ")", ";", "visitAndAutoboxBoolean", "(", "truePart", ")", ";", "compileStack", ".", "pop", "(", ")", ";", "Label", "l1", "=", "new", "Label", "(", ")", ";", "mv", ".", "visitJumpInsn", "(", "GOTO", ",", "l1", ")", ";", "mv", ".", "visitLabel", "(", "l0", ")", ";", "compileStack", ".", "pushBooleanExpression", "(", ")", ";", "visitAndAutoboxBoolean", "(", "falsePart", ")", ";", "compileStack", ".", "pop", "(", ")", ";", "mv", ".", "visitLabel", "(", "l1", ")", ";", "}", "public", "void", "visitAssertStatement", "(", "AssertStatement", "statement", ")", "{", "onLineNumber", "(", "statement", ",", "\"\"", ")", ";", "visitStatement", "(", "statement", ")", ";", "boolean", "rewriteAssert", "=", "true", ";", "rewriteAssert", "=", "statement", ".", "getMessageExpression", "(", ")", "==", "ConstantExpression", ".", "NULL", ";", "AssertionTracker", "oldTracker", "=", "assertionTracker", ";", "Janitor", "janitor", "=", "new", "Janitor", "(", ")", ";", "final", "Label", "tryStart", "=", "new", "Label", "(", ")", ";", "if", "(", "rewriteAssert", ")", "{", "assertionTracker", "=", "new", "AssertionTracker", "(", ")", ";", "try", "{", "assertionTracker", ".", "sourceText", "=", "new", "SourceText", "(", "statement", ",", "source", ",", "janitor", ")", ";", "mv", ".", "visitTypeInsn", "(", "NEW", ",", "\"\"", ")", ";", "mv", ".", "visitInsn", "(", "DUP", ")", ";", "mv", ".", "visitMethodInsn", "(", "INVOKESPECIAL", ",", "\"\"", ",", "\"<init>\"", ",", "\"()V\"", ")", ";", "assertionTracker", ".", "recorderIndex", "=", "compileStack", ".", "defineTemporaryVariable", "(", "\"recorder\"", ",", "true", ")", ";", "mv", ".", "visitLabel", "(", "tryStart", ")", ";", "}", "catch", "(", "SourceTextNotAvailableException", "e", ")", "{", "rewriteAssert", "=", "false", ";", "assertionTracker", "=", "oldTracker", ";", "}", "}", "BooleanExpression", "booleanExpression", "=", "statement", ".", "getBooleanExpression", "(", ")", ";", "booleanExpression", ".", "visit", "(", "this", ")", ";", "Label", "exceptionThrower", "=", "new", "Label", "(", ")", ";", "mv", ".", "visitJumpInsn", "(", "IFEQ", ",", "exceptionThrower", ")", ";", "if", "(", "rewriteAssert", ")", "{", "mv", ".", "visitVarInsn", "(", "ALOAD", ",", "assertionTracker", ".", "recorderIndex", ")", ";", "mv", ".", "visitMethodInsn", "(", "INVOKEVIRTUAL", ",", "\"\"", ",", "\"clear\"", ",", "\"()V\"", ")", ";", "}", "Label", "afterAssert", "=", "new", "Label", "(", ")", ";", "mv", ".", "visitJumpInsn", "(", "GOTO", ",", "afterAssert", ")", ";", "mv", ".", "visitLabel", "(", "exceptionThrower", ")", ";", "if", "(", "rewriteAssert", ")", "{", "mv", ".", "visitLdcInsn", "(", "assertionTracker", ".", "sourceText", ".", "getNormalizedText", "(", ")", ")", ";", "mv", ".", "visitVarInsn", "(", "ALOAD", ",", "assertionTracker", ".", "recorderIndex", ")", ";", "mv", ".", "visitMethodInsn", "(", "INVOKESTATIC", ",", "\"\"", ",", "\"render\"", ",", "\"\"", ")", ";", "}", "else", "{", "writeSourclessAssertText", "(", "statement", ")", ";", "}", "AssertionTracker", "savedTracker", "=", "assertionTracker", ";", "assertionTracker", "=", "null", ";", "visitAndAutoboxBoolean", "(", "statement", ".", "getMessageExpression", "(", ")", ")", ";", "assertFailedMethod", ".", "call", "(", "mv", ")", ";", "if", "(", "rewriteAssert", ")", "{", "final", "Label", "tryEnd", "=", "new", "Label", "(", ")", ";", "mv", ".", "visitLabel", "(", "tryEnd", ")", ";", "mv", ".", "visitJumpInsn", "(", "GOTO", ",", "afterAssert", ")", ";", "final", "Label", "catchAny", "=", "new", "Label", "(", ")", ";", "mv", ".", "visitLabel", "(", "catchAny", ")", ";", "mv", ".", "visitVarInsn", "(", "ALOAD", ",", "savedTracker", ".", "recorderIndex", ")", ";", "mv", ".", "visitMethodInsn", "(", "INVOKEVIRTUAL", ",", "\"\"", ",", "\"clear\"", ",", "\"()V\"", ")", ";", "mv", ".", "visitInsn", "(", "ATHROW", ")", ";", "compileStack", ".", "addExceptionBlock", "(", "tryStart", ",", "tryEnd", ",", "catchAny", ",", "null", ")", ";", "}", "mv", ".", "visitLabel", "(", "afterAssert", ")", ";", "assertionTracker", "=", "oldTracker", ";", "janitor", ".", "cleanup", "(", ")", ";", "}", "private", "void", "writeSourclessAssertText", "(", "AssertStatement", "statement", ")", "{", "BooleanExpression", "booleanExpression", "=", "statement", ".", "getBooleanExpression", "(", ")", ";", "String", "expressionText", "=", "booleanExpression", ".", "getText", "(", ")", ";", "List", "<", "String", ">", "list", "=", "new", "ArrayList", "<", "String", ">", "(", ")", ";", "addVariableNames", "(", "booleanExpression", ",", "list", ")", ";", "if", "(", "list", ".", "isEmpty", "(", ")", ")", "{", "mv", ".", "visitLdcInsn", "(", "expressionText", ")", ";", "}", "else", "{", "boolean", "first", "=", "true", ";", "mv", ".", "visitTypeInsn", "(", "NEW", ",", "\"\"", ")", ";", "mv", ".", "visitInsn", "(", "DUP", ")", ";", "mv", ".", "visitLdcInsn", "(", "expressionText", "+", "\".", "Values:", "\"", ")", ";", "mv", ".", "visitMethodInsn", "(", "INVOKESPECIAL", ",", "\"\"", ",", "\"<init>\"", ",", "\"\"", ")", ";", "int", "tempIndex", "=", "compileStack", ".", "defineTemporaryVariable", "(", "\"assert\"", ",", "true", ")", ";", "for", "(", "String", "name", ":", "list", ")", "{", "String", "text", "=", "name", "+", "\"", "=", "\"", ";", "if", "(", "first", ")", "{", "first", "=", "false", ";", "}", "else", "{", "text", "=", "\",", "\"", "+", "text", ";", "}", "mv", ".", "visitVarInsn", "(", "ALOAD", ",", "tempIndex", ")", ";", "mv", ".", "visitLdcInsn", "(", "text", ")", ";", "mv", ".", "visitMethodInsn", "(", "INVOKEVIRTUAL", ",", "\"\"", ",", "\"append\"", ",", "\"\"", ")", ";", "mv", ".", "visitInsn", "(", "POP", ")", ";", "mv", ".", "visitVarInsn", "(", "ALOAD", ",", "tempIndex", ")", ";", "new", "VariableExpression", "(", "name", ")", ".", "visit", "(", "this", ")", ";", "mv", ".", "visitMethodInsn", "(", "INVOKESTATIC", ",", "\"\"", ",", "\"toString\"", ",", "\"\"", ")", ";", "mv", ".", "visitMethodInsn", "(", "INVOKEVIRTUAL", ",", "\"\"", ",", "\"append\"", ",", "\"\"", ")", ";", "mv", ".", "visitInsn", "(", "POP", ")", ";", "}", "mv", ".", "visitVarInsn", "(", "ALOAD", ",", "tempIndex", ")", ";", "compileStack", ".", "removeVar", "(", "tempIndex", ")", ";", "}", "}", "private", "void", "addVariableNames", "(", "Expression", "expression", ",", "List", "<", "String", ">", "list", ")", "{", "if", "(", "expression", "instanceof", "BooleanExpression", ")", "{", "BooleanExpression", "boolExp", "=", "(", "BooleanExpression", ")", "expression", ";", "addVariableNames", "(", "boolExp", ".", "getExpression", "(", ")", ",", "list", ")", ";", "}", "else", "if", "(", "expression", "instanceof", "BinaryExpression", ")", "{", "BinaryExpression", "binExp", "=", "(", "BinaryExpression", ")", "expression", ";", "addVariableNames", "(", "binExp", ".", "getLeftExpression", "(", ")", ",", "list", ")", ";", "addVariableNames", "(", "binExp", ".", "getRightExpression", "(", ")", ",", "list", ")", ";", "}", "else", "if", "(", "expression", "instanceof", "VariableExpression", ")", "{", "VariableExpression", "varExp", "=", "(", "VariableExpression", ")", "expression", ";", "list", ".", "add", "(", "varExp", ".", "getName", "(", ")", ")", ";", "}", "}", "public", "void", "visitTryCatchFinally", "(", "TryCatchStatement", "statement", ")", "{", "visitStatement", "(", "statement", ")", ";", "Statement", "tryStatement", "=", "statement", ".", "getTryStatement", "(", ")", ";", "final", "Statement", "finallyStatement", "=", "statement", ".", "getFinallyStatement", "(", ")", ";", "Label", "tryStart", "=", "new", "Label", "(", ")", ";", "mv", ".", "visitLabel", "(", "tryStart", ")", ";", "BlockRecorder", "tryBlock", "=", "makeBlockRecorder", "(", "finallyStatement", ")", ";", "tryBlock", ".", "startRange", "(", "tryStart", ")", ";", "tryStatement", ".", "visit", "(", "this", ")", ";", "Label", "finallyStart", "=", "new", "Label", "(", ")", ";", "mv", ".", "visitJumpInsn", "(", "GOTO", ",", "finallyStart", ")", ";", "Label", "tryEnd", "=", "new", "Label", "(", ")", ";", "mv", ".", "visitLabel", "(", "tryEnd", ")", ";", "tryBlock", ".", "closeRange", "(", "tryEnd", ")", ";", "compileStack", ".", "pop", "(", ")", ";", "BlockRecorder", "catches", "=", "makeBlockRecorder", "(", "finallyStatement", ")", ";", "for", "(", "CatchStatement", "catchStatement", ":", "statement", ".", "getCatchStatements", "(", ")", ")", "{", "ClassNode", "exceptionType", "=", "catchStatement", ".", "getExceptionType", "(", ")", ";", "String", "exceptionTypeInternalName", "=", "BytecodeHelper", ".", "getClassInternalName", "(", "exceptionType", ")", ";", "Label", "catchStart", "=", "new", "Label", "(", ")", ";", "mv", ".", "visitLabel", "(", "catchStart", ")", ";", "catches", ".", "startRange", "(", "catchStart", ")", ";", "compileStack", ".", "pushState", "(", ")", ";", "compileStack", ".", "defineVariable", "(", "catchStatement", ".", "getVariable", "(", ")", ",", "true", ")", ";", "catchStatement", ".", "visit", "(", "this", ")", ";", "mv", ".", "visitInsn", "(", "NOP", ")", ";", "compileStack", ".", "pop", "(", ")", ";", "Label", "catchEnd", "=", "new", "Label", "(", ")", ";", "mv", ".", "visitLabel", "(", "catchEnd", ")", ";", "catches", ".", "closeRange", "(", "catchEnd", ")", ";", "mv", ".", "visitJumpInsn", "(", "GOTO", ",", "finallyStart", ")", ";", "compileStack", ".", "writeExceptionTable", "(", "tryBlock", ",", "catchStart", ",", "exceptionTypeInternalName", ")", ";", "}", "Label", "catchAny", "=", "new", "Label", "(", ")", ";", "compileStack", ".", "writeExceptionTable", "(", "tryBlock", ",", "catchAny", ",", "null", ")", ";", "compileStack", ".", "writeExceptionTable", "(", "catches", ",", "catchAny", ",", "null", ")", ";", "compileStack", ".", "pop", "(", ")", ";", "mv", ".", "visitLabel", "(", "finallyStart", ")", ";", "finallyStatement", ".", "visit", "(", "this", ")", ";", "mv", ".", "visitInsn", "(", "NOP", ")", ";", "Label", "skipCatchAll", "=", "new", "Label", "(", ")", ";", "mv", ".", "visitJumpInsn", "(", "GOTO", ",", "skipCatchAll", ")", ";", "mv", ".", "visitLabel", "(", "catchAny", ")", ";", "int", "anyExceptionIndex", "=", "compileStack", ".", "defineTemporaryVariable", "(", "\"exception\"", ",", "true", ")", ";", "finallyStatement", ".", "visit", "(", "this", ")", ";", "mv", ".", "visitVarInsn", "(", "ALOAD", ",", "anyExceptionIndex", ")", ";", "mv", ".", "visitInsn", "(", "ATHROW", ")", ";", "mv", ".", "visitLabel", "(", "skipCatchAll", ")", ";", "}", "private", "BlockRecorder", "makeBlockRecorder", "(", "final", "Statement", "finallyStatement", ")", "{", "final", "BlockRecorder", "block", "=", "new", "BlockRecorder", "(", ")", ";", "Runnable", "tryRunner", "=", "new", "Runnable", "(", ")", "{", "public", "void", "run", "(", ")", "{", "compileStack", ".", "pushBlockRecorderVisit", "(", "block", ")", ";", "finallyStatement", ".", "visit", "(", "AsmClassGenerator", ".", "this", ")", ";", "compileStack", ".", "popBlockRecorderVisit", "(", "block", ")", ";", "}", "}", ";", "block", ".", "excludedStatement", "=", "tryRunner", ";", "compileStack", ".", "pushBlockRecorder", "(", "block", ")", ";", "return", "block", ";", "}", "public", "void", "visitSwitch", "(", "SwitchStatement", "statement", ")", "{", "onLineNumber", "(", "statement", ",", "\"visitSwitch\"", ")", ";", "visitStatement", "(", "statement", ")", ";", "statement", ".", "getExpression", "(", ")", ".", "visit", "(", "this", ")", ";", "Label", "breakLabel", "=", "compileStack", ".", "pushSwitch", "(", ")", ";", "int", "switchVariableIndex", "=", "compileStack", ".", "defineTemporaryVariable", "(", "\"switch\"", ",", "true", ")", ";", "List", "caseStatements", "=", "statement", ".", "getCaseStatements", "(", ")", ";", "int", "caseCount", "=", "caseStatements", ".", "size", "(", ")", ";", "Label", "[", "]", "labels", "=", "new", "Label", "[", "caseCount", "+", "1", "]", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "caseCount", ";", "i", "++", ")", "{", "labels", "[", "i", "]", "=", "new", "Label", "(", ")", ";", "}", "int", "i", "=", "0", ";", "for", "(", "Iterator", "iter", "=", "caseStatements", ".", "iterator", "(", ")", ";", "iter", ".", "hasNext", "(", ")", ";", "i", "++", ")", "{", "CaseStatement", "caseStatement", "=", "(", "CaseStatement", ")", "iter", ".", "next", "(", ")", ";", "visitCaseStatement", "(", "caseStatement", ",", "switchVariableIndex", ",", "labels", "[", "i", "]", ",", "labels", "[", "i", "+", "1", "]", ")", ";", "}", "statement", ".", "getDefaultStatement", "(", ")", ".", "visit", "(", "this", ")", ";", "mv", ".", "visitLabel", "(", "breakLabel", ")", ";", "compileStack", ".", "pop", "(", ")", ";", "}", "public", "void", "visitCaseStatement", "(", "CaseStatement", "statement", ")", "{", "}", "public", "void", "visitCaseStatement", "(", "CaseStatement", "statement", ",", "int", "switchVariableIndex", ",", "Label", "thisLabel", ",", "Label", "nextLabel", ")", "{", "onLineNumber", "(", "statement", ",", "\"\"", ")", ";", "mv", ".", "visitVarInsn", "(", "ALOAD", ",", "switchVariableIndex", ")", ";", "statement", ".", "getExpression", "(", ")", ".", "visit", "(", "this", ")", ";", "isCaseMethod", ".", "call", "(", "mv", ")", ";", "Label", "l0", "=", "new", "Label", "(", ")", ";", "mv", ".", "visitJumpInsn", "(", "IFEQ", ",", "l0", ")", ";", "mv", ".", "visitLabel", "(", "thisLabel", ")", ";", "statement", ".", "getCode", "(", ")", ".", "visit", "(", "this", ")", ";", "if", "(", "nextLabel", "!=", "null", ")", "{", "mv", ".", "visitJumpInsn", "(", "GOTO", ",", "nextLabel", ")", ";", "}", "mv", ".", "visitLabel", "(", "l0", ")", ";", "}", "public", "void", "visitBreakStatement", "(", "BreakStatement", "statement", ")", "{", "onLineNumber", "(", "statement", ",", "\"\"", ")", ";", "visitStatement", "(", "statement", ")", ";", "String", "name", "=", "statement", ".", "getLabel", "(", ")", ";", "Label", "breakLabel", "=", "compileStack", ".", "getNamedBreakLabel", "(", "name", ")", ";", "if", "(", "breakLabel", "==", "null", ")", "{", "return", ";", "}", "compileStack", ".", "applyFinallyBlocks", "(", "breakLabel", ",", "true", ")", ";", "mv", ".", "visitJumpInsn", "(", "GOTO", ",", "breakLabel", ")", ";", "}", "public", "void", "visitContinueStatement", "(", "ContinueStatement", "statement", ")", "{", "onLineNumber", "(", "statement", ",", "\"\"", ")", ";", "visitStatement", "(", "statement", ")", ";", "String", "name", "=", "statement", ".", "getLabel", "(", ")", ";", "Label", "continueLabel", "=", "compileStack", ".", "getContinueLabel", "(", ")", ";", "if", "(", "name", "!=", "null", ")", "continueLabel", "=", "compileStack", ".", "getNamedContinueLabel", "(", "name", ")", ";", "compileStack", ".", "applyFinallyBlocks", "(", "continueLabel", ",", "false", ")", ";", "if", "(", "continueLabel", "==", "null", ")", "{", "return", ";", "}", "mv", ".", "visitJumpInsn", "(", "GOTO", ",", "continueLabel", ")", ";", "}", "public", "void", "visitSynchronizedStatement", "(", "SynchronizedStatement", "statement", ")", "{", "onLineNumber", "(", "statement", ",", "\"\"", ")", ";", "visitStatement", "(", "statement", ")", ";", "statement", ".", "getExpression", "(", ")", ".", "visit", "(", "this", ")", ";", "final", "int", "index", "=", "compileStack", ".", "defineTemporaryVariable", "(", "\"synchronized\"", ",", "ClassHelper", ".", "Integer_TYPE", ",", "true", ")", ";", "final", "Label", "synchronizedStart", "=", "new", "Label", "(", ")", ";", "final", "Label", "synchronizedEnd", "=", "new", "Label", "(", ")", ";", "final", "Label", "catchAll", "=", "new", "Label", "(", ")", ";", "mv", ".", "visitVarInsn", "(", "ALOAD", ",", "index", ")", ";", "mv", ".", "visitInsn", "(", "MONITORENTER", ")", ";", "mv", ".", "visitLabel", "(", "synchronizedStart", ")", ";", "mv", ".", "visitInsn", "(", "NOP", ")", ";", "Runnable", "finallyPart", "=", "new", "Runnable", "(", ")", "{", "public", "void", "run", "(", ")", "{", "mv", ".", "visitVarInsn", "(", "ALOAD", ",", "index", ")", ";", "mv", ".", "visitInsn", "(", "MONITOREXIT", ")", ";", "}", "}", ";", "BlockRecorder", "fb", "=", "new", "BlockRecorder", "(", "finallyPart", ")", ";", "fb", ".", "startRange", "(", "synchronizedStart", ")", ";", "compileStack", ".", "pushBlockRecorder", "(", "fb", ")", ";", "statement", ".", "getCode", "(", ")", ".", "visit", "(", "this", ")", ";", "fb", ".", "closeRange", "(", "catchAll", ")", ";", "compileStack", ".", "writeExceptionTable", "(", "fb", ",", "catchAll", ",", "null", ")", ";", "compileStack", ".", "pop", "(", ")", ";", "finallyPart", ".", "run", "(", ")", ";", "mv", ".", "visitJumpInsn", "(", "GOTO", ",", "synchronizedEnd", ")", ";", "mv", ".", "visitLabel", "(", "catchAll", ")", ";", "finallyPart", ".", "run", "(", ")", ";", "mv", ".", "visitInsn", "(", "ATHROW", ")", ";", "mv", ".", "visitLabel", "(", "synchronizedEnd", ")", ";", "}", "public", "void", "visitThrowStatement", "(", "ThrowStatement", "statement", ")", "{", "onLineNumber", "(", "statement", ",", "\"\"", ")", ";", "visitStatement", "(", "statement", ")", ";", "statement", ".", "getExpression", "(", ")", ".", "visit", "(", "this", ")", ";", "mv", ".", "visitTypeInsn", "(", "CHECKCAST", ",", "\"\"", ")", ";", "mv", ".", "visitInsn", "(", "ATHROW", ")", ";", "}", "public", "void", "visitReturnStatement", "(", "ReturnStatement", "statement", ")", "{", "onLineNumber", "(", "statement", ",", "\"\"", ")", ";", "visitStatement", "(", "statement", ")", ";", "ClassNode", "returnType", ";", "if", "(", "methodNode", "!=", "null", ")", "{", "returnType", "=", "methodNode", ".", "getReturnType", "(", ")", ";", "}", "else", "if", "(", "constructorNode", "!=", "null", ")", "{", "returnType", "=", "constructorNode", ".", "getReturnType", "(", ")", ";", "}", "else", "{", "throw", "new", "GroovyBugError", "(", "\"\"", ")", ";", "}", "if", "(", "returnType", "==", "ClassHelper", ".", "VOID_TYPE", ")", "{", "if", "(", "!", "(", "statement", ".", "isReturningNullOrVoid", "(", ")", ")", ")", "{", "throwException", "(", "\"\"", ")", ";", "}", "compileStack", ".", "applyBlockRecorder", "(", ")", ";", "mv", ".", "visitInsn", "(", "RETURN", ")", ";", "outputReturn", "=", "true", ";", "return", ";", "}", "Expression", "expression", "=", "statement", ".", "getExpression", "(", ")", ";", "evaluateExpression", "(", "expression", ")", ";", "if", "(", "returnType", "==", "ClassHelper", ".", "OBJECT_TYPE", "&&", "expression", ".", "getType", "(", ")", "!=", "null", "&&", "expression", ".", "getType", "(", ")", "==", "ClassHelper", ".", "VOID_TYPE", ")", "{", "mv", ".", "visitInsn", "(", "ACONST_NULL", ")", ";", "}", "else", "{", "doConvertAndCast", "(", "returnType", ",", "expression", ",", "false", ",", "true", ",", "false", ")", ";", "}", "if", "(", "compileStack", ".", "hasBlockRecorder", "(", ")", ")", "{", "int", "returnValueIdx", "=", "compileStack", ".", "defineTemporaryVariable", "(", "\"returnValue\"", ",", "ClassHelper", ".", "OBJECT_TYPE", ",", "true", ")", ";", "compileStack", ".", "applyBlockRecorder", "(", ")", ";", "helper", ".", "load", "(", "ClassHelper", ".", "OBJECT_TYPE", ",", "returnValueIdx", ")", ";", "}", "helper", ".", "unbox", "(", "returnType", ")", ";", "helper", ".", "doReturn", "(", "returnType", ")", ";", "outputReturn", "=", "true", ";", "}", "protected", "void", "doConvertAndCast", "(", "ClassNode", "type", ",", "Expression", "expression", ",", "boolean", "ignoreAutoboxing", ",", "boolean", "forceCast", ",", "boolean", "coerce", ")", "{", "ClassNode", "expType", "=", "getExpressionType", "(", "expression", ")", ";", "if", "(", "!", "ignoreAutoboxing", "&&", "ClassHelper", ".", "isPrimitiveType", "(", "type", ")", ")", "{", "type", "=", "ClassHelper", ".", "getWrapper", "(", "type", ")", ";", "}", "if", "(", "forceCast", "||", "(", "type", "!=", "null", "&&", "!", "expType", ".", "isDerivedFrom", "(", "type", ")", "&&", "!", "expType", ".", "implementsInterface", "(", "type", ")", ")", ")", "{", "doConvertAndCast", "(", "type", ",", "coerce", ")", ";", "}", "}", "protected", "void", "evaluateExpression", "(", "Expression", "expression", ")", "{", "visitAndAutoboxBoolean", "(", "expression", ")", ";", "if", "(", "isPopRequired", "(", "expression", ")", ")", "{", "return", ";", "}", "Expression", "assignExpr", "=", "createReturnLHSExpression", "(", "expression", ")", ";", "if", "(", "assignExpr", "!=", "null", ")", "{", "leftHandExpression", "=", "false", ";", "assignExpr", ".", "visit", "(", "this", ")", ";", "}", "}", "public", "void", "visitExpressionStatement", "(", "ExpressionStatement", "statement", ")", "{", "onLineNumber", "(", "statement", ",", "\"\"", "+", "statement", ".", "getExpression", "(", ")", ".", "getClass", "(", ")", ".", "getName", "(", ")", ")", ";", "visitStatement", "(", "statement", ")", ";", "Expression", "expression", "=", "statement", ".", "getExpression", "(", ")", ";", "visitAndAutoboxBoolean", "(", "expression", ")", ";", "if", "(", "isPopRequired", "(", "expression", ")", ")", "{", "mv", ".", "visitInsn", "(", "POP", ")", ";", "}", "}", "public", "void", "visitDeclarationExpression", "(", "DeclarationExpression", "expression", ")", "{", "onLineNumber", "(", "expression", ",", "\"\"", "+", "expression", ".", "getText", "(", ")", "+", "\"\\\"\"", ")", ";", "evaluateEqual", "(", "expression", ",", "true", ")", ";", "}", "public", "void", "visitBinaryExpression", "(", "BinaryExpression", "expression", ")", "{", "onLineNumber", "(", "expression", ",", "\"\"", "+", "expression", ".", "getOperation", "(", ")", ".", "getText", "(", ")", "+", "\"\\\"", "\"", ")", ";", "switch", "(", "expression", ".", "getOperation", "(", ")", ".", "getType", "(", ")", ")", "{", "case", "Types", ".", "EQUAL", ":", "evaluateEqual", "(", "expression", ",", "false", ")", ";", "break", ";", "case", "Types", ".", "COMPARE_IDENTICAL", ":", "case", "Types", ".", "COMPARE_NOT_IDENTICAL", ":", "source", ".", "addError", "(", "new", "SyntaxException", "(", "\"\"", ",", "expression", ".", "getLineNumber", "(", ")", ",", "expression", ".", "getColumnNumber", "(", ")", ")", ")", ";", "break", ";", "case", "Types", ".", "COMPARE_EQUAL", ":", "evaluateBinaryExpression", "(", "compareEqualMethod", ",", "expression", ")", ";", "break", ";", "case", "Types", ".", "COMPARE_NOT_EQUAL", ":", "evaluateBinaryExpression", "(", "compareNotEqualMethod", ",", "expression", ")", ";", "break", ";", "case", "Types", ".", "COMPARE_TO", ":", "evaluateCompareTo", "(", "expression", ")", ";", "break", ";", "case", "Types", ".", "COMPARE_GREATER_THAN", ":", "evaluateBinaryExpression", "(", "compareGreaterThanMethod", ",", "expression", ")", ";", "break", ";", "case", "Types", ".", "COMPARE_GREATER_THAN_EQUAL", ":", "evaluateBinaryExpression", "(", "compareGreaterThanEqualMethod", ",", "expression", ")", ";", "break", ";", "case", "Types", ".", "COMPARE_LESS_THAN", ":", "evaluateBinaryExpression", "(", "compareLessThanMethod", ",", "expression", ")", ";", "break", ";", "case", "Types", ".", "COMPARE_LESS_THAN_EQUAL", ":", "evaluateBinaryExpression", "(", "compareLessThanEqualMethod", ",", "expression", ")", ";", "break", ";", "case", "Types", ".", "LOGICAL_AND", ":", "evaluateLogicalAndExpression", "(", "expression", ")", ";", "break", ";", "case", "Types", ".", "LOGICAL_OR", ":", "evaluateLogicalOrExpression", "(", "expression", ")", ";", "break", ";", "case", "Types", ".", "BITWISE_AND", ":", "evaluateBinaryExpression", "(", "\"and\"", ",", "expression", ")", ";", "break", ";", "case", "Types", ".", "BITWISE_AND_EQUAL", ":", "evaluateBinaryExpressionWithAssignment", "(", "\"and\"", ",", "expression", ")", ";", "break", ";", "case", "Types", ".", "BITWISE_OR", ":", "evaluateBinaryExpression", "(", "\"or\"", ",", "expression", ")", ";", "break", ";", "case", "Types", ".", "BITWISE_OR_EQUAL", ":", "evaluateBinaryExpressionWithAssignment", "(", "\"or\"", ",", "expression", ")", ";", "break", ";", "case", "Types", ".", "BITWISE_XOR", ":", "evaluateBinaryExpression", "(", "\"xor\"", ",", "expression", ")", ";", "break", ";", "case", "Types", ".", "BITWISE_XOR_EQUAL", ":", "evaluateBinaryExpressionWithAssignment", "(", "\"xor\"", ",", "expression", ")", ";", "break", ";", "case", "Types", ".", "PLUS", ":", "evaluateBinaryExpression", "(", "\"plus\"", ",", "expression", ")", ";", "break", ";", "case", "Types", ".", "PLUS_EQUAL", ":", "evaluateBinaryExpressionWithAssignment", "(", "\"plus\"", ",", "expression", ")", ";", "break", ";", "case", "Types", ".", "MINUS", ":", "evaluateBinaryExpression", "(", "\"minus\"", ",", "expression", ")", ";", "break", ";", "case", "Types", ".", "MINUS_EQUAL", ":", "evaluateBinaryExpressionWithAssignment", "(", "\"minus\"", ",", "expression", ")", ";", "break", ";", "case", "Types", ".", "MULTIPLY", ":", "evaluateBinaryExpression", "(", "\"multiply\"", ",", "expression", ")", ";", "break", ";", "case", "Types", ".", "MULTIPLY_EQUAL", ":", "evaluateBinaryExpressionWithAssignment", "(", "\"multiply\"", ",", "expression", ")", ";", "break", ";", "case", "Types", ".", "DIVIDE", ":", "evaluateBinaryExpression", "(", "\"div\"", ",", "expression", ")", ";", "break", ";", "case", "Types", ".", "DIVIDE_EQUAL", ":", "evaluateBinaryExpressionWithAssignment", "(", "\"div\"", ",", "expression", ")", ";", "break", ";", "case", "Types", ".", "INTDIV", ":", "evaluateBinaryExpression", "(", "\"intdiv\"", ",", "expression", ")", ";", "break", ";", "case", "Types", ".", "INTDIV_EQUAL", ":", "evaluateBinaryExpressionWithAssignment", "(", "\"intdiv\"", ",", "expression", ")", ";", "break", ";", "case", "Types", ".", "MOD", ":", "evaluateBinaryExpression", "(", "\"mod\"", ",", "expression", ")", ";", "break", ";", "case", "Types", ".", "MOD_EQUAL", ":", "evaluateBinaryExpressionWithAssignment", "(", "\"mod\"", ",", "expression", ")", ";", "break", ";", "case", "Types", ".", "POWER", ":", "evaluateBinaryExpression", "(", "\"power\"", ",", "expression", ")", ";", "break", ";", "case", "Types", ".", "POWER_EQUAL", ":", "evaluateBinaryExpressionWithAssignment", "(", "\"power\"", ",", "expression", ")", ";", "break", ";", "case", "Types", ".", "LEFT_SHIFT", ":", "evaluateBinaryExpression", "(", "\"leftShift\"", ",", "expression", ")", ";", "break", ";", "case", "Types", ".", "LEFT_SHIFT_EQUAL", ":", "evaluateBinaryExpressionWithAssignment", "(", "\"leftShift\"", ",", "expression", ")", ";", "break", ";", "case", "Types", ".", "RIGHT_SHIFT", ":", "evaluateBinaryExpression", "(", "\"rightShift\"", ",", "expression", ")", ";", "break", ";", "case", "Types", ".", "RIGHT_SHIFT_EQUAL", ":", "evaluateBinaryExpressionWithAssignment", "(", "\"rightShift\"", ",", "expression", ")", ";", "break", ";", "case", "Types", ".", "RIGHT_SHIFT_UNSIGNED", ":", "evaluateBinaryExpression", "(", "\"\"", ",", "expression", ")", ";", "break", ";", "case", "Types", ".", "RIGHT_SHIFT_UNSIGNED_EQUAL", ":", "evaluateBinaryExpressionWithAssignment", "(", "\"\"", ",", "expression", ")", ";", "break", ";", "case", "Types", ".", "KEYWORD_INSTANCEOF", ":", "evaluateInstanceof", "(", "expression", ")", ";", "break", ";", "case", "Types", ".", "FIND_REGEX", ":", "evaluateBinaryExpression", "(", "findRegexMethod", ",", "expression", ")", ";", "break", ";", "case", "Types", ".", "MATCH_REGEX", ":", "evaluateBinaryExpression", "(", "matchRegexMethod", ",", "expression", ")", ";", "break", ";", "case", "Types", ".", "LEFT_SQUARE_BRACKET", ":", "if", "(", "leftHandExpression", ")", "{", "throwException", "(", "\"\"", ")", ";", "}", "else", "{", "evaluateBinaryExpression", "(", "\"getAt\"", ",", "expression", ")", ";", "}", "break", ";", "case", "Types", ".", "KEYWORD_IN", ":", "evaluateBinaryExpression", "(", "isCaseMethod", ",", "expression", ")", ";", "break", ";", "default", ":", "throwException", "(", "\"Operation:", "\"", "+", "expression", ".", "getOperation", "(", ")", "+", "\"\"", ")", ";", "}", "record", "(", "expression", ".", "getOperation", "(", ")", ",", "isComparisonExpression", "(", "expression", ")", ")", ";", "}", "private", "void", "load", "(", "Expression", "exp", ")", "{", "boolean", "wasLeft", "=", "leftHandExpression", ";", "leftHandExpression", "=", "false", ";", "visitAndAutoboxBoolean", "(", "exp", ")", ";", "leftHandExpression", "=", "wasLeft", ";", "}", "public", "void", "visitPostfixExpression", "(", "PostfixExpression", "expression", ")", "{", "switch", "(", "expression", ".", "getOperation", "(", ")", ".", "getType", "(", ")", ")", "{", "case", "Types", ".", "PLUS_PLUS", ":", "evaluatePostfixMethod", "(", "\"next\"", ",", "expression", ".", "getExpression", "(", ")", ")", ";", "break", ";", "case", "Types", ".", "MINUS_MINUS", ":", "evaluatePostfixMethod", "(", "\"previous\"", ",", "expression", ".", "getExpression", "(", ")", ")", ";", "break", ";", "}", "record", "(", "expression", ")", ";", "}", "private", "void", "record", "(", "Token", "token", ",", "boolean", "unboxedValue", ")", "{", "if", "(", "assertionTracker", "==", "null", ")", "return", ";", "if", "(", "unboxedValue", ")", "{", "mv", ".", "visitInsn", "(", "DUP", ")", ";", "helper", ".", "boxBoolean", "(", ")", ";", "}", "record", "(", "assertionTracker", ".", "sourceText", ".", "getNormalizedColumn", "(", "token", ".", "getStartLine", "(", ")", ",", "token", ".", "getStartColumn", "(", ")", ")", ")", ";", "if", "(", "unboxedValue", ")", "mv", ".", "visitInsn", "(", "POP", ")", ";", "}", "private", "void", "record", "(", "Expression", "expression", ")", "{", "if", "(", "assertionTracker", "==", "null", ")", "return", ";", "record", "(", "assertionTracker", ".", "sourceText", ".", "getNormalizedColumn", "(", "expression", ".", "getLineNumber", "(", ")", ",", "expression", ".", "getColumnNumber", "(", ")", ")", ")", ";", "}", "private", "void", "recordBool", "(", "Expression", "expression", ")", "{", "if", "(", "assertionTracker", "==", "null", ")", "return", ";", "mv", ".", "visitInsn", "(", "DUP", ")", ";", "helper", ".", "boxBoolean", "(", ")", ";", "record", "(", "expression", ")", ";", "mv", ".", "visitInsn", "(", "POP", ")", ";", "}", "private", "void", "record", "(", "int", "normalizedColumn", ")", "{", "if", "(", "assertionTracker", "==", "null", ")", "return", ";", "mv", ".", "visitVarInsn", "(", "ALOAD", ",", "assertionTracker", ".", "recorderIndex", ")", ";", "helper", ".", "swapWithObject", "(", "ClassHelper", ".", "OBJECT_TYPE", ")", ";", "mv", ".", "visitLdcInsn", "(", "normalizedColumn", ")", ";", "mv", ".", "visitMethodInsn", "(", "INVOKEVIRTUAL", ",", "\"\"", ",", "\"record\"", ",", "\"\"", ")", ";", "}", "private", "void", "throwException", "(", "String", "s", ")", "{", "throw", "new", "RuntimeParserException", "(", "s", ",", "currentASTNode", ")", ";", "}", "public", "void", "visitPrefixExpression", "(", "PrefixExpression", "expression", ")", "{", "switch", "(", "expression", ".", "getOperation", "(", ")", ".", "getType", "(", ")", ")", "{", "case", "Types", ".", "PLUS_PLUS", ":", "evaluatePrefixMethod", "(", "\"next\"", ",", "expression", ".", "getExpression", "(", ")", ")", ";", "break", ";", "case", "Types", ".", "MINUS_MINUS", ":", "evaluatePrefixMethod", "(", "\"previous\"", ",", "expression", ".", "getExpression", "(", ")", ")", ";", "break", ";", "}", "record", "(", "expression", ")", ";", "}", "public", "void", "visitClosureExpression", "(", "ClosureExpression", "expression", ")", "{", "ClassNode", "innerClass", "=", "closureClassMap", ".", "get", "(", "expression", ")", ";", "if", "(", "innerClass", "==", "null", ")", "{", "innerClass", "=", "createClosureClass", "(", "expression", ")", ";", "closureClassMap", ".", "put", "(", "expression", ",", "innerClass", ")", ";", "addInnerClass", "(", "innerClass", ")", ";", "innerClass", ".", "addInterface", "(", "ClassHelper", ".", "GENERATED_CLOSURE_Type", ")", ";", "}", "String", "innerClassinternalName", "=", "BytecodeHelper", ".", "getClassInternalName", "(", "innerClass", ")", ";", "passingParams", "=", "true", ";", "List", "constructors", "=", "innerClass", ".", "getDeclaredConstructors", "(", ")", ";", "ConstructorNode", "node", "=", "(", "ConstructorNode", ")", "constructors", ".", "get", "(", "0", ")", ";", "Parameter", "[", "]", "localVariableParams", "=", "node", ".", "getParameters", "(", ")", ";", "mv", ".", "visitTypeInsn", "(", "NEW", ",", "innerClassinternalName", ")", ";", "mv", ".", "visitInsn", "(", "DUP", ")", ";", "if", "(", "(", "isStaticMethod", "(", ")", "||", "specialCallWithinConstructor", ")", "&&", "!", "classNode", ".", "declaresInterface", "(", "ClassHelper", ".", "GENERATED_CLOSURE_Type", ")", ")", "{", "visitClassExpression", "(", "new", "ClassExpression", "(", "classNode", ")", ")", ";", "visitClassExpression", "(", "new", "ClassExpression", "(", "getOutermostClass", "(", ")", ")", ")", ";", "}", "else", "{", "mv", ".", "visitVarInsn", "(", "ALOAD", ",", "0", ")", ";", "loadThis", "(", ")", ";", "}", "for", "(", "int", "i", "=", "2", ";", "i", "<", "localVariableParams", ".", "length", ";", "i", "++", ")", "{", "Parameter", "param", "=", "localVariableParams", "[", "i", "]", ";", "String", "name", "=", "param", ".", "getName", "(", ")", ";", "if", "(", "!", "compileStack", ".", "containsVariable", "(", "name", ")", "&&", "compileStack", ".", "getScope", "(", ")", ".", "isReferencedClassVariable", "(", "name", ")", ")", "{", "visitFieldExpression", "(", "new", "FieldExpression", "(", "classNode", ".", "getDeclaredField", "(", "name", ")", ")", ")", ";", "}", "else", "{", "Variable", "v", "=", "compileStack", ".", "getVariable", "(", "name", ",", "!", "classNodeUsesReferences", "(", ")", ")", ";", "if", "(", "v", "==", "null", ")", "{", "FieldNode", "field", "=", "classNode", ".", "getDeclaredField", "(", "name", ")", ";", "mv", ".", "visitVarInsn", "(", "ALOAD", ",", "0", ")", ";", "mv", ".", "visitFieldInsn", "(", "GETFIELD", ",", "internalClassName", ",", "name", ",", "BytecodeHelper", ".", "getTypeDescription", "(", "field", ".", "getType", "(", ")", ")", ")", ";", "param", ".", "setClosureSharedVariable", "(", "false", ")", ";", "v", "=", "compileStack", ".", "defineVariable", "(", "param", ",", "true", ")", ";", "param", ".", "setClosureSharedVariable", "(", "true", ")", ";", "v", ".", "setHolder", "(", "true", ")", ";", "}", "mv", ".", "visitVarInsn", "(", "ALOAD", ",", "v", ".", "getIndex", "(", ")", ")", ";", "}", "}", "passingParams", "=", "false", ";", "mv", ".", "visitMethodInsn", "(", "INVOKESPECIAL", ",", "innerClassinternalName", ",", "\"<init>\"", ",", "BytecodeHelper", ".", "getMethodDescriptor", "(", "ClassHelper", ".", "VOID_TYPE", ",", "localVariableParams", ")", ")", ";", "}", "private", "boolean", "classNodeUsesReferences", "(", ")", "{", "boolean", "ret", "=", "classNode", ".", "getSuperClass", "(", ")", "==", "ClassHelper", ".", "CLOSURE_TYPE", ";", "if", "(", "ret", ")", "return", "ret", ";", "if", "(", "classNode", "instanceof", "InnerClassNode", ")", "{", "InnerClassNode", "inner", "=", "(", "InnerClassNode", ")", "classNode", ";", "return", "inner", ".", "isAnonymous", "(", ")", ";", "}", "return", "false", ";", "}", "protected", "void", "loadThisOrOwner", "(", ")", "{", "if", "(", "isInnerClass", "(", ")", ")", "{", "visitFieldExpression", "(", "new", "FieldExpression", "(", "classNode", ".", "getDeclaredField", "(", "\"owner\"", ")", ")", ")", ";", "}", "else", "{", "loadThis", "(", ")", ";", "}", "}", "@", "Deprecated", "public", "void", "visitRegexExpression", "(", "RegexExpression", "expression", ")", "{", "expression", ".", "getRegex", "(", ")", ".", "visit", "(", "this", ")", ";", "regexPattern", ".", "call", "(", "mv", ")", ";", "}", "public", "void", "visitConstantExpression", "(", "ConstantExpression", "expression", ")", "{", "final", "String", "constantName", "=", "expression", ".", "getConstantName", "(", ")", ";", "if", "(", "(", "methodNode", "!=", "null", "&&", "methodNode", ".", "getName", "(", ")", ".", "equals", "(", "\"<clinit>\"", ")", ")", "||", "constantName", "==", "null", ")", "{", "Object", "value", "=", "expression", ".", "getValue", "(", ")", ";", "helper", ".", "loadConstant", "(", "value", ")", ";", "}", "else", "{", "mv", ".", "visitFieldInsn", "(", "GETSTATIC", ",", "internalClassName", ",", "constantName", ",", "BytecodeHelper", ".", "getTypeDescription", "(", "expression", ".", "getType", "(", ")", ")", ")", ";", "}", "}", "public", "void", "visitSpreadExpression", "(", "SpreadExpression", "expression", ")", "{", "throw", "new", "GroovyBugError", "(", "\"\"", ")", ";", "}", "public", "void", "visitSpreadMapExpression", "(", "SpreadMapExpression", "expression", ")", "{", "Expression", "subExpression", "=", "expression", ".", "getExpression", "(", ")", ";", "AssertionTracker", "old", "=", "assertionTracker", ";", "assertionTracker", "=", "null", ";", "subExpression", ".", "visit", "(", "this", ")", ";", "spreadMap", ".", "call", "(", "mv", ")", ";", "assertionTracker", "=", "old", ";", "}", "public", "void", "visitMethodPointerExpression", "(", "MethodPointerExpression", "expression", ")", "{", "Expression", "subExpression", "=", "expression", ".", "getExpression", "(", ")", ";", "subExpression", ".", "visit", "(", "this", ")", ";", "loadDynamicName", "(", "expression", ".", "getMethodName", "(", ")", ")", ";", "getMethodPointer", ".", "call", "(", "mv", ")", ";", "}", "private", "void", "loadDynamicName", "(", "Expression", "name", ")", "{", "if", "(", "name", "instanceof", "ConstantExpression", ")", "{", "ConstantExpression", "ce", "=", "(", "ConstantExpression", ")", "name", ";", "Object", "value", "=", "ce", ".", "getValue", "(", ")", ";", "if", "(", "value", "instanceof", "String", ")", "{", "helper", ".", "loadConstant", "(", "value", ")", ";", "return", ";", "}", "}", "new", "CastExpression", "(", "ClassHelper", ".", "STRING_TYPE", ",", "name", ")", ".", "visit", "(", "this", ")", ";", "}", "public", "void", "visitUnaryMinusExpression", "(", "UnaryMinusExpression", "expression", ")", "{", "Expression", "subExpression", "=", "expression", ".", "getExpression", "(", ")", ";", "subExpression", ".", "visit", "(", "this", ")", ";", "unaryMinus", ".", "call", "(", "mv", ")", ";", "record", "(", "expression", ")", ";", "}", "public", "void", "visitUnaryPlusExpression", "(", "UnaryPlusExpression", "expression", ")", "{", "Expression", "subExpression", "=", "expression", ".", "getExpression", "(", ")", ";", "subExpression", ".", "visit", "(", "this", ")", ";", "unaryPlus", ".", "call", "(", "mv", ")", ";", "record", "(", "expression", ")", ";", "}", "public", "void", "visitBitwiseNegationExpression", "(", "BitwiseNegationExpression", "expression", ")", "{", "Expression", "subExpression", "=", "expression", ".", "getExpression", "(", ")", ";", "subExpression", ".", "visit", "(", "this", ")", ";", "bitwiseNegate", ".", "call", "(", "mv", ")", ";", "record", "(", "expression", ")", ";", "}", "public", "void", "visitCastExpression", "(", "CastExpression", "castExpression", ")", "{", "ClassNode", "type", "=", "castExpression", ".", "getType", "(", ")", ";", "visitAndAutoboxBoolean", "(", "castExpression", ".", "getExpression", "(", ")", ")", ";", "final", "ClassNode", "rht", "=", "rightHandType", ";", "rightHandType", "=", "castExpression", ".", "getExpression", "(", ")", ".", "getType", "(", ")", ";", "doConvertAndCast", "(", "type", ",", "castExpression", ".", "getExpression", "(", ")", ",", "castExpression", ".", "isIgnoringAutoboxing", "(", ")", ",", "false", ",", "castExpression", ".", "isCoerce", "(", ")", ")", ";", "rightHandType", "=", "rht", ";", "}", "public", "void", "visitNotExpression", "(", "NotExpression", "expression", ")", "{", "Expression", "subExpression", "=", "expression", ".", "getExpression", "(", ")", ";", "subExpression", ".", "visit", "(", "this", ")", ";", "if", "(", "!", "isComparisonExpression", "(", "subExpression", ")", "&&", "!", "(", "subExpression", "instanceof", "BooleanExpression", ")", ")", "{", "helper", ".", "unbox", "(", "boolean", ".", "class", ")", ";", "}", "helper", ".", "negateBoolean", "(", ")", ";", "recordBool", "(", "expression", ")", ";", "}", "public", "void", "visitBooleanExpression", "(", "BooleanExpression", "expression", ")", "{", "compileStack", ".", "pushBooleanExpression", "(", ")", ";", "expression", ".", "getExpression", "(", ")", ".", "visit", "(", "this", ")", ";", "if", "(", "!", "isComparisonExpression", "(", "expression", ".", "getExpression", "(", ")", ")", ")", "{", "helper", ".", "unbox", "(", "boolean", ".", "class", ")", ";", "}", "compileStack", ".", "pop", "(", ")", ";", "}", "private", "void", "makeInvokeMethodCall", "(", "MethodCallExpression", "call", ",", "boolean", "useSuper", ",", "MethodCallerMultiAdapter", "adapter", ")", "{", "Expression", "objectExpression", "=", "call", ".", "getObjectExpression", "(", ")", ";", "if", "(", "!", "isStaticMethod", "(", ")", "&&", "!", "isStaticContext", "(", ")", "&&", "isThisExpression", "(", "call", ".", "getObjectExpression", "(", ")", ")", ")", "{", "objectExpression", "=", "new", "CastExpression", "(", "classNode", ",", "objectExpression", ")", ";", "}", "Expression", "messageName", "=", "new", "CastExpression", "(", "ClassHelper", ".", "STRING_TYPE", ",", "call", ".", "getMethod", "(", ")", ")", ";", "if", "(", "useSuper", ")", "{", "ClassNode", "superClass", "=", "isInClosure", "(", ")", "?", "getOutermostClass", "(", ")", ".", "getSuperClass", "(", ")", ":", "classNode", ".", "getSuperClass", "(", ")", ";", "makeCall", "(", "new", "ClassExpression", "(", "superClass", ")", ",", "objectExpression", ",", "messageName", ",", "call", ".", "getArguments", "(", ")", ",", "adapter", ",", "call", ".", "isSafe", "(", ")", ",", "call", ".", "isSpreadSafe", "(", ")", ",", "false", ")", ";", "}", "else", "{", "makeCall", "(", "objectExpression", ",", "messageName", ",", "call", ".", "getArguments", "(", ")", ",", "adapter", ",", "call", ".", "isSafe", "(", ")", ",", "call", ".", "isSpreadSafe", "(", ")", ",", "call", ".", "isImplicitThis", "(", ")", ")", ";", "}", "}", "private", "void", "makeCall", "(", "Expression", "receiver", ",", "Expression", "message", ",", "Expression", "arguments", ",", "MethodCallerMultiAdapter", "adapter", ",", "boolean", "safe", ",", "boolean", "spreadSafe", ",", "boolean", "implicitThis", ")", "{", "ClassNode", "cn", "=", "classNode", ";", "if", "(", "isInClosure", "(", ")", "&&", "!", "implicitThis", ")", "cn", "=", "cn", ".", "getOuterClass", "(", ")", ";", "makeCall", "(", "new", "ClassExpression", "(", "cn", ")", ",", "receiver", ",", "message", ",", "arguments", ",", "adapter", ",", "safe", ",", "spreadSafe", ",", "implicitThis", ")", ";", "}", "private", "void", "makeCall", "(", "ClassExpression", "sender", ",", "Expression", "receiver", ",", "Expression", "message", ",", "Expression", "arguments", ",", "MethodCallerMultiAdapter", "adapter", ",", "boolean", "safe", ",", "boolean", "spreadSafe", ",", "boolean", "implicitThis", ")", "{", "if", "(", "(", "adapter", "==", "invokeMethod", "||", "adapter", "==", "invokeMethodOnCurrent", "||", "adapter", "==", "invokeStaticMethod", ")", "&&", "!", "spreadSafe", ")", "{", "String", "methodName", "=", "getMethodName", "(", "message", ")", ";", "if", "(", "methodName", "!=", "null", ")", "{", "makeCallSite", "(", "receiver", ",", "methodName", ",", "arguments", ",", "safe", ",", "implicitThis", ",", "adapter", "==", "invokeMethodOnCurrent", ",", "adapter", "==", "invokeStaticMethod", ")", ";", "return", ";", "}", "}", "boolean", "lhs", "=", "leftHandExpression", ";", "leftHandExpression", "=", "false", ";", "sender", ".", "visit", "(", "this", ")", ";", "boolean", "oldVal", "=", "this", ".", "implicitThis", ";", "this", ".", "implicitThis", "=", "implicitThis", ";", "visitAndAutoboxBoolean", "(", "receiver", ")", ";", "this", ".", "implicitThis", "=", "oldVal", ";", "if", "(", "message", "!=", "null", ")", "message", ".", "visit", "(", "this", ")", ";", "boolean", "containsSpreadExpression", "=", "containsSpreadExpression", "(", "arguments", ")", ";", "int", "numberOfArguments", "=", "containsSpreadExpression", "?", "-", "1", ":", "argumentSize", "(", "arguments", ")", ";", "if", "(", "numberOfArguments", ">", "MethodCallerMultiAdapter", ".", "MAX_ARGS", "||", "containsSpreadExpression", ")", "{", "ArgumentListExpression", "ae", ";", "if", "(", "arguments", "instanceof", "ArgumentListExpression", ")", "{", "ae", "=", "(", "ArgumentListExpression", ")", "arguments", ";", "}", "else", "if", "(", "arguments", "instanceof", "TupleExpression", ")", "{", "TupleExpression", "te", "=", "(", "TupleExpression", ")", "arguments", ";", "ae", "=", "new", "ArgumentListExpression", "(", "te", ".", "getExpressions", "(", ")", ")", ";", "}", "else", "{", "ae", "=", "new", "ArgumentListExpression", "(", ")", ";", "ae", ".", "addExpression", "(", "arguments", ")", ";", "}", "if", "(", "containsSpreadExpression", ")", "{", "despreadList", "(", "ae", ".", "getExpressions", "(", ")", ",", "true", ")", ";", "}", "else", "{", "ae", ".", "visit", "(", "this", ")", ";", "}", "}", "else", "if", "(", "numberOfArguments", ">", "0", ")", "{", "TupleExpression", "te", "=", "(", "TupleExpression", ")", "arguments", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "numberOfArguments", ";", "i", "++", ")", "{", "Expression", "argument", "=", "te", ".", "getExpression", "(", "i", ")", ";", "visitAndAutoboxBoolean", "(", "argument", ")", ";", "if", "(", "argument", "instanceof", "CastExpression", ")", "loadWrapper", "(", "argument", ")", ";", "}", "}", "adapter", ".", "call", "(", "mv", ",", "numberOfArguments", ",", "safe", ",", "spreadSafe", ")", ";", "leftHandExpression", "=", "lhs", ";", "}", "private", "void", "makeGetPropertySite", "(", "Expression", "receiver", ",", "String", "methodName", ",", "boolean", "safe", ",", "boolean", "implicitThis", ")", "{", "if", "(", "isNotClinit", "(", ")", ")", "{", "mv", ".", "visitVarInsn", "(", "ALOAD", ",", "callSiteArrayVarIndex", ")", ";", "}", "else", "{", "mv", ".", "visitMethodInsn", "(", "INVOKESTATIC", ",", "getClassName", "(", ")", ",", "\"\"", ",", "\"\"", ")", ";", "}", "final", "int", "index", "=", "allocateIndex", "(", "methodName", ")", ";", "mv", ".", "visitLdcInsn", "(", "index", ")", ";", "mv", ".", "visitInsn", "(", "AALOAD", ")", ";", "boolean", "lhs", "=", "leftHandExpression", ";", "leftHandExpression", "=", "false", ";", "boolean", "oldVal", "=", "this", ".", "implicitThis", ";", "this", ".", "implicitThis", "=", "implicitThis", ";", "visitAndAutoboxBoolean", "(", "receiver", ")", ";", "this", ".", "implicitThis", "=", "oldVal", ";", "if", "(", "!", "safe", ")", "mv", ".", "visitMethodInsn", "(", "INVOKEINTERFACE", ",", "\"\"", ",", "\"\"", ",", "\"\"", ")", ";", "else", "{", "mv", ".", "visitMethodInsn", "(", "INVOKEINTERFACE", ",", "\"\"", ",", "\"\"", ",", "\"\"", ")", ";", "}", "leftHandExpression", "=", "lhs", ";", "}", "private", "void", "makeGroovyObjectGetPropertySite", "(", "Expression", "receiver", ",", "String", "methodName", ",", "boolean", "safe", ",", "boolean", "implicitThis", ")", "{", "if", "(", "isNotClinit", "(", ")", ")", "{", "mv", ".", "visitVarInsn", "(", "ALOAD", ",", "callSiteArrayVarIndex", ")", ";", "}", "else", "{", "mv", ".", "visitMethodInsn", "(", "INVOKESTATIC", ",", "getClassName", "(", ")", ",", "\"\"", ",", "\"\"", ")", ";", "}", "final", "int", "index", "=", "allocateIndex", "(", "methodName", ")", ";", "mv", ".", "visitLdcInsn", "(", "index", ")", ";", "mv", ".", "visitInsn", "(", "AALOAD", ")", ";", "boolean", "lhs", "=", "leftHandExpression", ";", "leftHandExpression", "=", "false", ";", "boolean", "oldVal", "=", "this", ".", "implicitThis", ";", "this", ".", "implicitThis", "=", "implicitThis", ";", "visitAndAutoboxBoolean", "(", "receiver", ")", ";", "this", ".", "implicitThis", "=", "oldVal", ";", "if", "(", "!", "safe", ")", "mv", ".", "visitMethodInsn", "(", "INVOKEINTERFACE", ",", "\"\"", ",", "\"\"", ",", "\"\"", ")", ";", "else", "{", "mv", ".", "visitMethodInsn", "(", "INVOKEINTERFACE", ",", "\"\"", ",", "\"\"", ",", "\"\"", ")", ";", "}", "leftHandExpression", "=", "lhs", ";", "}", "private", "String", "getMethodName", "(", "Expression", "message", ")", "{", "String", "methodName", "=", "null", ";", "if", "(", "message", "instanceof", "CastExpression", ")", "{", "CastExpression", "msg", "=", "(", "CastExpression", ")", "message", ";", "if", "(", "msg", ".", "getType", "(", ")", "==", "ClassHelper", ".", "STRING_TYPE", ")", "{", "final", "Expression", "methodExpr", "=", "msg", ".", "getExpression", "(", ")", ";", "if", "(", "methodExpr", "instanceof", "ConstantExpression", ")", "methodName", "=", "methodExpr", ".", "getText", "(", ")", ";", "}", "}", "if", "(", "methodName", "==", "null", "&&", "message", "instanceof", "ConstantExpression", ")", "{", "ConstantExpression", "constantExpression", "=", "(", "ConstantExpression", ")", "message", ";", "methodName", "=", "constantExpression", ".", "getText", "(", ")", ";", "}", "return", "methodName", ";", "}", "private", "void", "makeCallSite", "(", "Expression", "receiver", ",", "String", "message", ",", "Expression", "arguments", ",", "boolean", "safe", ",", "boolean", "implicitThis", ",", "boolean", "callCurrent", ",", "boolean", "callStatic", ")", "{", "if", "(", "isNotClinit", "(", ")", ")", "{", "mv", ".", "visitVarInsn", "(", "ALOAD", ",", "callSiteArrayVarIndex", ")", ";", "}", "else", "{", "mv", ".", "visitMethodInsn", "(", "INVOKESTATIC", ",", "getClassName", "(", ")", ",", "\"\"", ",", "\"\"", ")", ";", "}", "final", "int", "index", "=", "allocateIndex", "(", "message", ")", ";", "mv", ".", "visitLdcInsn", "(", "index", ")", ";", "mv", ".", "visitInsn", "(", "AALOAD", ")", ";", "boolean", "constructor", "=", "message", ".", "equals", "(", "CONSTRUCTOR", ")", ";", "boolean", "lhs", "=", "leftHandExpression", ";", "leftHandExpression", "=", "false", ";", "boolean", "oldVal", "=", "this", ".", "implicitThis", ";", "this", ".", "implicitThis", "=", "implicitThis", ";", "visitAndAutoboxBoolean", "(", "receiver", ")", ";", "this", ".", "implicitThis", "=", "oldVal", ";", "boolean", "containsSpreadExpression", "=", "containsSpreadExpression", "(", "arguments", ")", ";", "int", "numberOfArguments", "=", "containsSpreadExpression", "?", "-", "1", ":", "argumentSize", "(", "arguments", ")", ";", "if", "(", "numberOfArguments", ">", "MethodCallerMultiAdapter", ".", "MAX_ARGS", "||", "containsSpreadExpression", ")", "{", "ArgumentListExpression", "ae", ";", "if", "(", "arguments", "instanceof", "ArgumentListExpression", ")", "{", "ae", "=", "(", "ArgumentListExpression", ")", "arguments", ";", "}", "else", "if", "(", "arguments", "instanceof", "TupleExpression", ")", "{", "TupleExpression", "te", "=", "(", "TupleExpression", ")", "arguments", ";", "ae", "=", "new", "ArgumentListExpression", "(", "te", ".", "getExpressions", "(", ")", ")", ";", "}", "else", "{", "ae", "=", "new", "ArgumentListExpression", "(", ")", ";", "ae", ".", "addExpression", "(", "arguments", ")", ";", "}", "if", "(", "containsSpreadExpression", ")", "{", "numberOfArguments", "=", "-", "1", ";", "despreadList", "(", "ae", ".", "getExpressions", "(", ")", ",", "true", ")", ";", "}", "else", "{", "numberOfArguments", "=", "ae", ".", "getExpressions", "(", ")", ".", "size", "(", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "numberOfArguments", ";", "i", "++", ")", "{", "Expression", "argument", "=", "ae", ".", "getExpression", "(", "i", ")", ";", "visitAndAutoboxBoolean", "(", "argument", ")", ";", "if", "(", "argument", "instanceof", "CastExpression", ")", "loadWrapper", "(", "argument", ")", ";", "}", "}", "}", "if", "(", "numberOfArguments", "==", "-", "1", ")", "{", "}", "else", "{", "if", "(", "numberOfArguments", ">", "4", ")", "{", "final", "String", "createArraySignature", "=", "getCreateArraySignature", "(", "numberOfArguments", ")", ";", "mv", ".", "visitMethodInsn", "(", "INVOKESTATIC", ",", "\"\"", ",", "\"createArray\"", ",", "createArraySignature", ")", ";", "}", "}", "final", "String", "desc", "=", "getDescForParamNum", "(", "numberOfArguments", ")", ";", "if", "(", "callStatic", ")", "{", "mv", ".", "visitMethodInsn", "(", "INVOKEINTERFACE", ",", "\"\"", ",", "\"callStatic\"", ",", "\"\"", "+", "desc", ")", ";", "}", "else", "if", "(", "constructor", ")", "{", "mv", ".", "visitMethodInsn", "(", "INVOKEINTERFACE", ",", "\"\"", ",", "\"\"", ",", "\"\"", "+", "desc", ")", ";", "}", "else", "{", "if", "(", "callCurrent", ")", "{", "mv", ".", "visitMethodInsn", "(", "INVOKEINTERFACE", ",", "\"\"", ",", "\"callCurrent\"", ",", "\"\"", "+", "desc", ")", ";", "}", "else", "{", "if", "(", "safe", ")", "{", "mv", ".", "visitMethodInsn", "(", "INVOKEINTERFACE", ",", "\"\"", ",", "\"callSafe\"", ",", "\"\"", "+", "desc", ")", ";", "}", "else", "{", "mv", ".", "visitMethodInsn", "(", "INVOKEINTERFACE", ",", "\"\"", ",", "\"call\"", ",", "\"\"", "+", "desc", ")", ";", "}", "}", "}", "leftHandExpression", "=", "lhs", ";", "}", "private", "static", "String", "getDescForParamNum", "(", "int", "numberOfArguments", ")", "{", "switch", "(", "numberOfArguments", ")", "{", "case", "0", ":", "return", "\"\"", ";", "case", "1", ":", "return", "\"\"", ";", "case", "2", ":", "return", "\"\"", ";", "case", "3", ":", "return", "\"\"", ";", "case", "4", ":", "return", "\"\"", ";", "default", ":", "return", "\"\"", ";", "}", "}", "private", "static", "String", "[", "]", "sig", "=", "new", "String", "[", "255", "]", ";", "private", "static", "String", "getCreateArraySignature", "(", "int", "numberOfArguments", ")", "{", "if", "(", "sig", "[", "numberOfArguments", "]", "==", "null", ")", "{", "StringBuilder", "sb", "=", "new", "StringBuilder", "(", "\"(\"", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "!=", "numberOfArguments", ";", "++", "i", ")", "{", "sb", ".", "append", "(", "\"\"", ")", ";", "}", "sb", ".", "append", "(", "\"\"", ")", ";", "sig", "[", "numberOfArguments", "]", "=", "sb", ".", "toString", "(", ")", ";", "}", "return", "sig", "[", "numberOfArguments", "]", ";", "}", "private", "static", "final", "HashSet", "<", "String", ">", "names", "=", "new", "HashSet", "<", "String", ">", "(", ")", ";", "private", "static", "final", "HashSet", "<", "String", ">", "basic", "=", "new", "HashSet", "<", "String", ">", "(", ")", ";", "static", "{", "Collections", ".", "addAll", "(", "names", ",", "\"plus\"", ",", "\"minus\"", ",", "\"multiply\"", ",", "\"div\"", ",", "\"compareTo\"", ",", "\"or\"", ",", "\"and\"", ",", "\"xor\"", ",", "\"intdiv\"", ",", "\"mod\"", ",", "\"leftShift\"", ",", "\"rightShift\"", ",", "\"\"", ")", ";", "Collections", ".", "addAll", "(", "basic", ",", "\"plus\"", ",", "\"minus\"", ",", "\"multiply\"", ",", "\"div\"", ")", ";", "}", "private", "void", "makeBinopCallSite", "(", "Expression", "receiver", ",", "String", "message", ",", "Expression", "arguments", ")", "{", "prepareCallSite", "(", "message", ")", ";", "boolean", "lhs", "=", "leftHandExpression", ";", "leftHandExpression", "=", "false", ";", "boolean", "oldVal", "=", "this", ".", "implicitThis", ";", "this", ".", "implicitThis", "=", "false", ";", "visitAndAutoboxBoolean", "(", "receiver", ")", ";", "this", ".", "implicitThis", "=", "oldVal", ";", "visitAndAutoboxBoolean", "(", "arguments", ")", ";", "mv", ".", "visitMethodInsn", "(", "INVOKEINTERFACE", ",", "\"\"", ",", "\"call\"", ",", "\"\"", ")", ";", "leftHandExpression", "=", "lhs", ";", "}", "private", "void", "prepareCallSite", "(", "String", "message", ")", "{", "if", "(", "isNotClinit", "(", ")", ")", "{", "mv", ".", "visitVarInsn", "(", "ALOAD", ",", "callSiteArrayVarIndex", ")", ";", "}", "else", "{", "mv", ".", "visitMethodInsn", "(", "INVOKESTATIC", ",", "getClassName", "(", ")", ",", "\"\"", ",", "\"\"", ")", ";", "}", "final", "int", "index", "=", "allocateIndex", "(", "message", ")", ";", "mv", ".", "visitLdcInsn", "(", "index", ")", ";", "mv", ".", "visitInsn", "(", "AALOAD", ")", ";", "}", "private", "String", "getClassName", "(", ")", "{", "String", "className", ";", "if", "(", "!", "classNode", ".", "isInterface", "(", ")", "||", "interfaceClassLoadingClass", "==", "null", ")", "{", "className", "=", "internalClassName", ";", "}", "else", "{", "className", "=", "BytecodeHelper", ".", "getClassInternalName", "(", "interfaceClassLoadingClass", ")", ";", "}", "return", "className", ";", "}", "private", "int", "allocateIndex", "(", "String", "name", ")", "{", "callSites", ".", "add", "(", "name", ")", ";", "return", "callSites", ".", "size", "(", ")", "-", "1", ";", "}", "private", "void", "despreadList", "(", "List", "<", "Expression", ">", "expressions", ",", "boolean", "wrap", ")", "{", "List", "<", "Expression", ">", "spreadIndexes", "=", "new", "ArrayList", "<", "Expression", ">", "(", ")", ";", "List", "<", "Expression", ">", "spreadExpressions", "=", "new", "ArrayList", "<", "Expression", ">", "(", ")", ";", "List", "<", "Expression", ">", "normalArguments", "=", "new", "ArrayList", "<", "Expression", ">", "(", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "expressions", ".", "size", "(", ")", ";", "i", "++", ")", "{", "Expression", "expr", "=", "expressions", ".", "get", "(", "i", ")", ";", "if", "(", "!", "(", "expr", "instanceof", "SpreadExpression", ")", ")", "{", "normalArguments", ".", "add", "(", "expr", ")", ";", "}", "else", "{", "spreadIndexes", ".", "add", "(", "new", "ConstantExpression", "(", "i", "-", "spreadExpressions", ".", "size", "(", ")", ")", ")", ";", "spreadExpressions", ".", "add", "(", "(", "(", "SpreadExpression", ")", "expr", ")", ".", "getExpression", "(", ")", ")", ";", "}", "}", "visitTupleExpression", "(", "new", "ArgumentListExpression", "(", "normalArguments", ")", ",", "wrap", ")", ";", "(", "new", "TupleExpression", "(", "spreadExpressions", ")", ")", ".", "visit", "(", "this", ")", ";", "(", "new", "ArrayExpression", "(", "ClassHelper", ".", "int_TYPE", ",", "spreadIndexes", ",", "null", ")", ")", ".", "visit", "(", "this", ")", ";", "despreadList", ".", "call", "(", "mv", ")", ";", "}", "public", "void", "visitMethodCallExpression", "(", "MethodCallExpression", "call", ")", "{", "onLineNumber", "(", "call", ",", "\"\"", "+", "call", ".", "getMethod", "(", ")", "+", "\"\\\":\"", ")", ";", "if", "(", "isUnqualifiedClosureFieldCall", "(", "call", ")", ")", "{", "invokeClosure", "(", "call", ".", "getArguments", "(", ")", ",", "call", ".", "getMethodAsString", "(", ")", ")", ";", "record", "(", "call", ".", "getObjectExpression", "(", ")", ")", ";", "}", "else", "{", "boolean", "isSuperMethodCall", "=", "usesSuper", "(", "call", ")", ";", "MethodCallerMultiAdapter", "adapter", "=", "invokeMethod", ";", "if", "(", "isThisExpression", "(", "call", ".", "getObjectExpression", "(", ")", ")", ")", "adapter", "=", "invokeMethodOnCurrent", ";", "if", "(", "isSuperMethodCall", ")", "adapter", "=", "invokeMethodOnSuper", ";", "if", "(", "isStaticInvocation", "(", "call", ")", ")", "adapter", "=", "invokeStaticMethod", ";", "makeInvokeMethodCall", "(", "call", ",", "isSuperMethodCall", ",", "adapter", ")", ";", "record", "(", "call", ".", "getMethod", "(", ")", ")", ";", "}", "}", "private", "boolean", "isUnqualifiedClosureFieldCall", "(", "MethodCallExpression", "call", ")", "{", "String", "methodName", "=", "call", ".", "getMethodAsString", "(", ")", ";", "if", "(", "methodName", "==", "null", ")", "return", "false", ";", "if", "(", "!", "call", ".", "isImplicitThis", "(", ")", ")", "return", "false", ";", "if", "(", "!", "isThisExpression", "(", "call", ".", "getObjectExpression", "(", ")", ")", ")", "return", "false", ";", "FieldNode", "field", "=", "classNode", ".", "getDeclaredField", "(", "methodName", ")", ";", "if", "(", "field", "==", "null", ")", "return", "false", ";", "if", "(", "isStaticInvocation", "(", "call", ")", "&&", "!", "field", ".", "isStatic", "(", ")", ")", "return", "false", ";", "Expression", "arguments", "=", "call", ".", "getArguments", "(", ")", ";", "return", "!", "classNode", ".", "hasPossibleMethod", "(", "methodName", ",", "arguments", ")", ";", "}", "private", "void", "invokeClosure", "(", "Expression", "arguments", ",", "String", "methodName", ")", "{", "visitVariableExpression", "(", "new", "VariableExpression", "(", "methodName", ")", ")", ";", "if", "(", "arguments", "instanceof", "TupleExpression", ")", "{", "arguments", ".", "visit", "(", "this", ")", ";", "}", "else", "{", "new", "TupleExpression", "(", "arguments", ")", ".", "visit", "(", "this", ")", ";", "}", "invokeClosureMethod", ".", "call", "(", "mv", ")", ";", "}", "private", "boolean", "isStaticInvocation", "(", "MethodCallExpression", "call", ")", "{", "if", "(", "!", "isThisExpression", "(", "call", ".", "getObjectExpression", "(", ")", ")", ")", "return", "false", ";", "if", "(", "isStaticMethod", "(", ")", ")", "return", "true", ";", "return", "isStaticContext", "(", ")", "&&", "!", "call", ".", "isImplicitThis", "(", ")", ";", "}", "protected", "boolean", "emptyArguments", "(", "Expression", "arguments", ")", "{", "return", "argumentSize", "(", "arguments", ")", "==", "0", ";", "}", "protected", "static", "boolean", "containsSpreadExpression", "(", "Expression", "arguments", ")", "{", "List", "<", "Expression", ">", "args", "=", "null", ";", "if", "(", "arguments", "instanceof", "TupleExpression", ")", "{", "TupleExpression", "tupleExpression", "=", "(", "TupleExpression", ")", "arguments", ";", "args", "=", "tupleExpression", ".", "getExpressions", "(", ")", ";", "}", "else", "if", "(", "arguments", "instanceof", "ListExpression", ")", "{", "ListExpression", "le", "=", "(", "ListExpression", ")", "arguments", ";", "args", "=", "le", ".", "getExpressions", "(", ")", ";", "}", "else", "{", "return", "arguments", "instanceof", "SpreadExpression", ";", "}", "for", "(", "Expression", "arg", ":", "args", ")", "{", "if", "(", "arg", "instanceof", "SpreadExpression", ")", "return", "true", ";", "}", "return", "false", ";", "}", "protected", "static", "int", "argumentSize", "(", "Expression", "arguments", ")", "{", "if", "(", "arguments", "instanceof", "TupleExpression", ")", "{", "TupleExpression", "tupleExpression", "=", "(", "TupleExpression", ")", "arguments", ";", "return", "tupleExpression", ".", "getExpressions", "(", ")", ".", "size", "(", ")", ";", "}", "return", "1", ";", "}", "public", "void", "visitStaticMethodCallExpression", "(", "StaticMethodCallExpression", "call", ")", "{", "onLineNumber", "(", "call", ",", "\"\"", "+", "call", ".", "getMethod", "(", ")", "+", "\"\\\":\"", ")", ";", "makeCall", "(", "new", "ClassExpression", "(", "call", ".", "getOwnerType", "(", ")", ")", ",", "new", "ConstantExpression", "(", "call", ".", "getMethod", "(", ")", ")", ",", "call", ".", "getArguments", "(", ")", ",", "invokeStaticMethod", ",", "false", ",", "false", ",", "false", ")", ";", "record", "(", "call", ")", ";", "}", "private", "void", "addGeneratedClosureConstructorCall", "(", "ConstructorCallExpression", "call", ")", "{", "mv", ".", "visitVarInsn", "(", "ALOAD", ",", "0", ")", ";", "ClassNode", "callNode", "=", "classNode", ".", "getSuperClass", "(", ")", ";", "TupleExpression", "arguments", "=", "(", "TupleExpression", ")", "call", ".", "getArguments", "(", ")", ";", "if", "(", "arguments", ".", "getExpressions", "(", ")", ".", "size", "(", ")", "!=", "2", ")", "throw", "new", "GroovyBugError", "(", "\"\"", "+", "arguments", ".", "getExpressions", "(", ")", ".", "size", "(", ")", ")", ";", "arguments", ".", "getExpression", "(", "0", ")", ".", "visit", "(", "this", ")", ";", "arguments", ".", "getExpression", "(", "1", ")", ".", "visit", "(", "this", ")", ";", "Parameter", "p", "=", "new", "Parameter", "(", "ClassHelper", ".", "OBJECT_TYPE", ",", "\"_p\"", ")", ";", "String", "descriptor", "=", "BytecodeHelper", ".", "getMethodDescriptor", "(", "ClassHelper", ".", "VOID_TYPE", ",", "new", "Parameter", "[", "]", "{", "p", ",", "p", "}", ")", ";", "mv", ".", "visitMethodInsn", "(", "INVOKESPECIAL", ",", "BytecodeHelper", ".", "getClassInternalName", "(", "callNode", ")", ",", "\"<init>\"", ",", "descriptor", ")", ";", "}", "private", "void", "visitSpecialConstructorCall", "(", "ConstructorCallExpression", "call", ")", "{", "if", "(", "classNode", ".", "declaresInterface", "(", "ClassHelper", ".", "GENERATED_CLOSURE_Type", ")", ")", "{", "addGeneratedClosureConstructorCall", "(", "call", ")", ";", "return", ";", "}", "ClassNode", "callNode", "=", "classNode", ";", "if", "(", "call", ".", "isSuperCall", "(", ")", ")", "callNode", "=", "callNode", ".", "getSuperClass", "(", ")", ";", "List", "constructors", "=", "sortConstructors", "(", "call", ",", "callNode", ")", ";", "call", ".", "getArguments", "(", ")", ".", "visit", "(", "this", ")", ";", "mv", ".", "visitInsn", "(", "DUP", ")", ";", "helper", ".", "pushConstant", "(", "constructors", ".", "size", "(", ")", ")", ";", "visitClassExpression", "(", "new", "ClassExpression", "(", "callNode", ")", ")", ";", "selectConstructorAndTransformArguments", ".", "call", "(", "mv", ")", ";", "mv", ".", "visitInsn", "(", "DUP_X1", ")", ";", "mv", ".", "visitInsn", "(", "ICONST_1", ")", ";", "mv", ".", "visitInsn", "(", "IAND", ")", ";", "Label", "afterIf", "=", "new", "Label", "(", ")", ";", "mv", ".", "visitJumpInsn", "(", "IFEQ", ",", "afterIf", ")", ";", "mv", ".", "visitInsn", "(", "ICONST_0", ")", ";", "mv", ".", "visitInsn", "(", "AALOAD", ")", ";", "mv", ".", "visitTypeInsn", "(", "CHECKCAST", ",", "\"\"", ")", ";", "mv", ".", "visitLabel", "(", "afterIf", ")", ";", "mv", ".", "visitInsn", "(", "SWAP", ")", ";", "if", "(", "constructorNode", "!=", "null", ")", "{", "mv", ".", "visitVarInsn", "(", "ALOAD", ",", "0", ")", ";", "}", "else", "{", "mv", ".", "visitTypeInsn", "(", "NEW", ",", "BytecodeHelper", ".", "getClassInternalName", "(", "callNode", ")", ")", ";", "}", "mv", ".", "visitInsn", "(", "SWAP", ")", ";", "mv", ".", "visitIntInsn", "(", "BIPUSH", ",", "8", ")", ";", "mv", ".", "visitInsn", "(", "ISHR", ")", ";", "Label", "[", "]", "targets", "=", "new", "Label", "[", "constructors", ".", "size", "(", ")", "]", ";", "int", "[", "]", "indices", "=", "new", "int", "[", "constructors", ".", "size", "(", ")", "]", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "targets", ".", "length", ";", "i", "++", ")", "{", "targets", "[", "i", "]", "=", "new", "Label", "(", ")", ";", "indices", "[", "i", "]", "=", "i", ";", "}", "Label", "defaultLabel", "=", "new", "Label", "(", ")", ";", "Label", "afterSwitch", "=", "new", "Label", "(", ")", ";", "mv", ".", "visitLookupSwitchInsn", "(", "defaultLabel", ",", "indices", ",", "targets", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "targets", ".", "length", ";", "i", "++", ")", "{", "mv", ".", "visitLabel", "(", "targets", "[", "i", "]", ")", ";", "if", "(", "constructorNode", "!=", "null", ")", "{", "mv", ".", "visitInsn", "(", "SWAP", ")", ";", "mv", ".", "visitInsn", "(", "DUP_X1", ")", ";", "}", "else", "{", "mv", ".", "visitInsn", "(", "DUP_X1", ")", ";", "mv", ".", "visitInsn", "(", "DUP2_X1", ")", ";", "mv", ".", "visitInsn", "(", "POP", ")", ";", "}", "ConstructorNode", "cn", "=", "(", "ConstructorNode", ")", "constructors", ".", "get", "(", "i", ")", ";", "String", "descriptor", "=", "BytecodeHelper", ".", "getMethodDescriptor", "(", "ClassHelper", ".", "VOID_TYPE", ",", "cn", ".", "getParameters", "(", ")", ")", ";", "Parameter", "[", "]", "parameters", "=", "cn", ".", "getParameters", "(", ")", ";", "for", "(", "int", "p", "=", "0", ";", "p", "<", "parameters", ".", "length", ";", "p", "++", ")", "{", "mv", ".", "visitInsn", "(", "DUP", ")", ";", "helper", ".", "pushConstant", "(", "p", ")", ";", "mv", ".", "visitInsn", "(", "AALOAD", ")", ";", "ClassNode", "type", "=", "parameters", "[", "p", "]", ".", "getType", "(", ")", ";", "if", "(", "ClassHelper", ".", "isPrimitiveType", "(", "type", ")", ")", "{", "helper", ".", "unbox", "(", "type", ")", ";", "}", "else", "{", "helper", ".", "doCast", "(", "type", ")", ";", "}", "helper", ".", "swapWithObject", "(", "type", ")", ";", "}", "mv", ".", "visitInsn", "(", "POP", ")", ";", "mv", ".", "visitMethodInsn", "(", "INVOKESPECIAL", ",", "BytecodeHelper", ".", "getClassInternalName", "(", "callNode", ")", ",", "\"<init>\"", ",", "descriptor", ")", ";", "mv", ".", "visitJumpInsn", "(", "GOTO", ",", "afterSwitch", ")", ";", "}", "mv", ".", "visitLabel", "(", "defaultLabel", ")", ";", "mv", ".", "visitTypeInsn", "(", "NEW", ",", "\"\"", ")", ";", "mv", ".", "visitInsn", "(", "DUP", ")", ";", "mv", ".", "visitLdcInsn", "(", "\"\"", ")", ";", "mv", ".", "visitMethodInsn", "(", "INVOKESPECIAL", ",", "\"\"", ",", "\"<init>\"", ",", "\"\"", ")", ";", "mv", ".", "visitInsn", "(", "ATHROW", ")", ";", "mv", ".", "visitLabel", "(", "afterSwitch", ")", ";", "if", "(", "constructorNode", "==", "null", ")", "{", "mv", ".", "visitInsn", "(", "SWAP", ")", ";", "}", "mv", ".", "visitInsn", "(", "POP", ")", ";", "}", "private", "List", "sortConstructors", "(", "ConstructorCallExpression", "call", ",", "ClassNode", "callNode", ")", "{", "List", "constructors", "=", "new", "ArrayList", "(", "callNode", ".", "getDeclaredConstructors", "(", ")", ")", ";", "Comparator", "comp", "=", "new", "Comparator", "(", ")", "{", "public", "int", "compare", "(", "Object", "arg0", ",", "Object", "arg1", ")", "{", "ConstructorNode", "c0", "=", "(", "ConstructorNode", ")", "arg0", ";", "ConstructorNode", "c1", "=", "(", "ConstructorNode", ")", "arg1", ";", "String", "descriptor0", "=", "BytecodeHelper", ".", "getMethodDescriptor", "(", "ClassHelper", ".", "VOID_TYPE", ",", "c0", ".", "getParameters", "(", ")", ")", ";", "String", "descriptor1", "=", "BytecodeHelper", ".", "getMethodDescriptor", "(", "ClassHelper", ".", "VOID_TYPE", ",", "c1", ".", "getParameters", "(", ")", ")", ";", "return", "descriptor0", ".", "compareTo", "(", "descriptor1", ")", ";", "}", "}", ";", "Collections", ".", "sort", "(", "constructors", ",", "comp", ")", ";", "return", "constructors", ";", "}", "public", "void", "visitConstructorCallExpression", "(", "ConstructorCallExpression", "call", ")", "{", "onLineNumber", "(", "call", ",", "\"\"", "+", "call", ".", "getType", "(", ")", ".", "getName", "(", ")", "+", "\"\\\":\"", ")", ";", "if", "(", "call", ".", "isSpecialCall", "(", ")", ")", "{", "specialCallWithinConstructor", "=", "true", ";", "visitSpecialConstructorCall", "(", "call", ")", ";", "specialCallWithinConstructor", "=", "false", ";", "return", ";", "}", "Expression", "arguments", "=", "call", ".", "getArguments", "(", ")", ";", "if", "(", "arguments", "instanceof", "TupleExpression", ")", "{", "TupleExpression", "tupleExpression", "=", "(", "TupleExpression", ")", "arguments", ";", "int", "size", "=", "tupleExpression", ".", "getExpressions", "(", ")", ".", "size", "(", ")", ";", "if", "(", "size", "==", "0", ")", "{", "arguments", "=", "MethodCallExpression", ".", "NO_ARGUMENTS", ";", "}", "}", "Expression", "receiverClass", "=", "new", "ClassExpression", "(", "call", ".", "getType", "(", ")", ")", ";", "makeCallSite", "(", "receiverClass", ",", "CONSTRUCTOR", ",", "arguments", ",", "false", ",", "false", ",", "false", ",", "false", ")", ";", "record", "(", "call", ")", ";", "}", "private", "static", "String", "makeFieldClassName", "(", "ClassNode", "type", ")", "{", "String", "internalName", "=", "BytecodeHelper", ".", "getClassInternalName", "(", "type", ")", ";", "StringBuffer", "ret", "=", "new", "StringBuffer", "(", "internalName", ".", "length", "(", ")", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "internalName", ".", "length", "(", ")", ";", "i", "++", ")", "{", "char", "c", "=", "internalName", ".", "charAt", "(", "i", ")", ";", "if", "(", "c", "==", "'/'", ")", "{", "ret", ".", "append", "(", "'$'", ")", ";", "}", "else", "if", "(", "c", "==", "';'", ")", "{", "}", "else", "{", "ret", ".", "append", "(", "c", ")", ";", "}", "}", "return", "ret", ".", "toString", "(", ")", ";", "}", "private", "static", "String", "getStaticFieldName", "(", "ClassNode", "type", ")", "{", "ClassNode", "componentType", "=", "type", ";", "String", "prefix", "=", "\"\"", ";", "for", "(", ";", "componentType", ".", "isArray", "(", ")", ";", "componentType", "=", "componentType", ".", "getComponentType", "(", ")", ")", "{", "prefix", "+=", "\"$\"", ";", "}", "if", "(", "prefix", ".", "length", "(", ")", "!=", "0", ")", "prefix", "=", "\"array\"", "+", "prefix", ";", "String", "name", "=", "prefix", "+", "\"$class$\"", "+", "makeFieldClassName", "(", "componentType", ")", ";", "return", "name", ";", "}", "private", "void", "visitAttributeOrProperty", "(", "PropertyExpression", "expression", ",", "MethodCallerMultiAdapter", "adapter", ")", "{", "Expression", "objectExpression", "=", "expression", ".", "getObjectExpression", "(", ")", ";", "if", "(", "isThisOrSuper", "(", "objectExpression", ")", ")", "{", "String", "name", "=", "expression", ".", "getPropertyAsString", "(", ")", ";", "if", "(", "name", "!=", "null", ")", "{", "FieldNode", "field", "=", "null", ";", "boolean", "privateSuperField", "=", "false", ";", "if", "(", "isSuperExpression", "(", "objectExpression", ")", ")", "{", "field", "=", "classNode", ".", "getSuperClass", "(", ")", ".", "getDeclaredField", "(", "name", ")", ";", "if", "(", "field", "!=", "null", "&&", "(", "(", "field", ".", "getModifiers", "(", ")", "&", "ACC_PRIVATE", ")", "!=", "0", ")", ")", "{", "privateSuperField", "=", "true", ";", "}", "}", "else", "{", "if", "(", "isNotExplicitThisInClosure", "(", "expression", ".", "isImplicitThis", "(", ")", ")", ")", "{", "field", "=", "classNode", ".", "getDeclaredField", "(", "name", ")", ";", "}", "}", "if", "(", "field", "!=", "null", "&&", "!", "privateSuperField", ")", "{", "visitFieldExpression", "(", "new", "FieldExpression", "(", "field", ")", ")", ";", "return", ";", "}", "}", "if", "(", "isSuperExpression", "(", "objectExpression", ")", ")", "{", "String", "prefix", ";", "if", "(", "leftHandExpression", ")", "{", "prefix", "=", "\"set\"", ";", "}", "else", "{", "prefix", "=", "\"get\"", ";", "}", "String", "propName", "=", "prefix", "+", "MetaClassHelper", ".", "capitalize", "(", "name", ")", ";", "visitMethodCallExpression", "(", "new", "MethodCallExpression", "(", "objectExpression", ",", "propName", ",", "MethodCallExpression", ".", "NO_ARGUMENTS", ")", ")", ";", "return", ";", "}", "}", "final", "String", "propName", "=", "expression", ".", "getPropertyAsString", "(", ")", ";", "if", "(", "expression", ".", "getObjectExpression", "(", ")", "instanceof", "ClassExpression", "&&", "propName", "!=", "null", "&&", "propName", ".", "equals", "(", "\"this\"", ")", ")", "{", "ClassNode", "type", "=", "expression", ".", "getObjectExpression", "(", ")", ".", "getType", "(", ")", ";", "ClassNode", "iterType", "=", "classNode", ";", "mv", ".", "visitVarInsn", "(", "ALOAD", ",", "0", ")", ";", "while", "(", "!", "iterType", ".", "equals", "(", "type", ")", ")", "{", "String", "ownerName", "=", "BytecodeHelper", ".", "getClassInternalName", "(", "iterType", ")", ";", "iterType", "=", "iterType", ".", "getOuterClass", "(", ")", ";", "String", "typeName", "=", "BytecodeHelper", ".", "getTypeDescription", "(", "iterType", ")", ";", "mv", ".", "visitFieldInsn", "(", "GETFIELD", ",", "ownerName", ",", "\"this$0\"", ",", "typeName", ")", ";", "}", "return", ";", "}", "if", "(", "adapter", "==", "getProperty", "&&", "!", "expression", ".", "isSpreadSafe", "(", ")", "&&", "propName", "!=", "null", ")", "{", "makeGetPropertySite", "(", "objectExpression", ",", "propName", ",", "expression", ".", "isSafe", "(", ")", ",", "expression", ".", "isImplicitThis", "(", ")", ")", ";", "}", "else", "{", "if", "(", "adapter", "==", "getGroovyObjectProperty", "&&", "!", "expression", ".", "isSpreadSafe", "(", ")", "&&", "propName", "!=", "null", ")", "{", "makeGroovyObjectGetPropertySite", "(", "objectExpression", ",", "propName", ",", "expression", ".", "isSafe", "(", ")", ",", "expression", ".", "isImplicitThis", "(", ")", ")", ";", "}", "else", "{", "makeCall", "(", "objectExpression", ",", "new", "CastExpression", "(", "ClassHelper", ".", "STRING_TYPE", ",", "expression", ".", "getProperty", "(", ")", ")", ",", "MethodCallExpression", ".", "NO_ARGUMENTS", ",", "adapter", ",", "expression", ".", "isSafe", "(", ")", ",", "expression", ".", "isSpreadSafe", "(", ")", ",", "expression", ".", "isImplicitThis", "(", ")", ")", ";", "}", "}", "}", "private", "boolean", "isStaticContext", "(", ")", "{", "if", "(", "compileStack", "!=", "null", "&&", "compileStack", ".", "getScope", "(", ")", "!=", "null", ")", "{", "return", "compileStack", ".", "getScope", "(", ")", ".", "isInStaticContext", "(", ")", ";", "}", "if", "(", "!", "isInClosure", "(", ")", ")", "return", "false", ";", "if", "(", "constructorNode", "!=", "null", ")", "return", "false", ";", "return", "classNode", ".", "isStaticClass", "(", ")", "||", "methodNode", ".", "isStatic", "(", ")", ";", "}", "public", "void", "visitPropertyExpression", "(", "PropertyExpression", "expression", ")", "{", "Expression", "objectExpression", "=", "expression", ".", "getObjectExpression", "(", ")", ";", "MethodCallerMultiAdapter", "adapter", ";", "if", "(", "leftHandExpression", ")", "{", "adapter", "=", "setProperty", ";", "if", "(", "isGroovyObject", "(", "objectExpression", ")", ")", "adapter", "=", "setGroovyObjectProperty", ";", "if", "(", "isStaticContext", "(", ")", "&&", "isThisOrSuper", "(", "objectExpression", ")", ")", "adapter", "=", "setProperty", ";", "}", "else", "{", "adapter", "=", "getProperty", ";", "if", "(", "isGroovyObject", "(", "objectExpression", ")", ")", "adapter", "=", "getGroovyObjectProperty", ";", "if", "(", "isStaticContext", "(", ")", "&&", "isThisOrSuper", "(", "objectExpression", ")", ")", "adapter", "=", "getProperty", ";", "}", "visitAttributeOrProperty", "(", "expression", ",", "adapter", ")", ";", "record", "(", "expression", ".", "getProperty", "(", ")", ")", ";", "}", "public", "void", "visitAttributeExpression", "(", "AttributeExpression", "expression", ")", "{", "Expression", "objectExpression", "=", "expression", ".", "getObjectExpression", "(", ")", ";", "MethodCallerMultiAdapter", "adapter", ";", "if", "(", "leftHandExpression", ")", "{", "adapter", "=", "setField", ";", "if", "(", "isGroovyObject", "(", "objectExpression", ")", ")", "adapter", "=", "setGroovyObjectField", ";", "if", "(", "usesSuper", "(", "expression", ")", ")", "adapter", "=", "setFieldOnSuper", ";", "}", "else", "{", "adapter", "=", "getField", ";", "if", "(", "isGroovyObject", "(", "objectExpression", ")", ")", "adapter", "=", "getGroovyObjectField", ";", "if", "(", "usesSuper", "(", "expression", ")", ")", "adapter", "=", "getFieldOnSuper", ";", "}", "visitAttributeOrProperty", "(", "expression", ",", "adapter", ")", ";", "if", "(", "!", "leftHandExpression", ")", "record", "(", "expression", ".", "getProperty", "(", ")", ")", ";", "}", "protected", "boolean", "isGroovyObject", "(", "Expression", "objectExpression", ")", "{", "return", "isThisExpression", "(", "objectExpression", ")", "||", "objectExpression", ".", "getType", "(", ")", ".", "isDerivedFromGroovyObject", "(", ")", "&&", "!", "(", "objectExpression", "instanceof", "ClassExpression", ")", ";", "}", "public", "void", "visitFieldExpression", "(", "FieldExpression", "expression", ")", "{", "FieldNode", "field", "=", "expression", ".", "getField", "(", ")", ";", "if", "(", "field", ".", "isStatic", "(", ")", ")", "{", "if", "(", "leftHandExpression", ")", "{", "storeStaticField", "(", "expression", ")", ";", "}", "else", "{", "loadStaticField", "(", "expression", ")", ";", "}", "}", "else", "{", "if", "(", "leftHandExpression", ")", "{", "storeThisInstanceField", "(", "expression", ")", ";", "}", "else", "{", "loadInstanceField", "(", "expression", ")", ";", "}", "record", "(", "expression", ")", ";", "}", "}", "public", "void", "loadStaticField", "(", "FieldExpression", "fldExp", ")", "{", "FieldNode", "field", "=", "fldExp", ".", "getField", "(", ")", ";", "boolean", "holder", "=", "field", ".", "isHolder", "(", ")", "&&", "!", "isInClosureConstructor", "(", ")", ";", "ClassNode", "type", "=", "field", ".", "getType", "(", ")", ";", "String", "ownerName", "=", "(", "field", ".", "getOwner", "(", ")", ".", "equals", "(", "classNode", ")", ")", "?", "internalClassName", ":", "BytecodeHelper", ".", "getClassInternalName", "(", "field", ".", "getOwner", "(", ")", ")", ";", "if", "(", "holder", ")", "{", "mv", ".", "visitFieldInsn", "(", "GETSTATIC", ",", "ownerName", ",", "fldExp", ".", "getFieldName", "(", ")", ",", "BytecodeHelper", ".", "getTypeDescription", "(", "type", ")", ")", ";", "mv", ".", "visitMethodInsn", "(", "INVOKEVIRTUAL", ",", "\"\"", ",", "\"get\"", ",", "\"\"", ")", ";", "}", "else", "{", "mv", ".", "visitFieldInsn", "(", "GETSTATIC", ",", "ownerName", ",", "fldExp", ".", "getFieldName", "(", ")", ",", "BytecodeHelper", ".", "getTypeDescription", "(", "type", ")", ")", ";", "if", "(", "ClassHelper", ".", "isPrimitiveType", "(", "type", ")", ")", "{", "helper", ".", "box", "(", "type", ")", ";", "}", "else", "{", "}", "}", "}", "public", "void", "loadInstanceField", "(", "FieldExpression", "fldExp", ")", "{", "FieldNode", "field", "=", "fldExp", ".", "getField", "(", ")", ";", "boolean", "holder", "=", "field", ".", "isHolder", "(", ")", "&&", "!", "isInClosureConstructor", "(", ")", ";", "ClassNode", "type", "=", "field", ".", "getType", "(", ")", ";", "String", "ownerName", "=", "(", "field", ".", "getOwner", "(", ")", ".", "equals", "(", "classNode", ")", ")", "?", "internalClassName", ":", "BytecodeHelper", ".", "getClassInternalName", "(", "field", ".", "getOwner", "(", ")", ")", ";", "mv", ".", "visitVarInsn", "(", "ALOAD", ",", "0", ")", ";", "mv", ".", "visitFieldInsn", "(", "GETFIELD", ",", "ownerName", ",", "fldExp", ".", "getFieldName", "(", ")", ",", "BytecodeHelper", ".", "getTypeDescription", "(", "type", ")", ")", ";", "if", "(", "holder", ")", "{", "mv", ".", "visitMethodInsn", "(", "INVOKEVIRTUAL", ",", "\"\"", ",", "\"get\"", ",", "\"\"", ")", ";", "}", "else", "{", "if", "(", "ClassHelper", ".", "isPrimitiveType", "(", "type", ")", ")", "{", "helper", ".", "box", "(", "type", ")", ";", "}", "else", "{", "}", "}", "}", "public", "void", "storeThisInstanceField", "(", "FieldExpression", "expression", ")", "{", "FieldNode", "field", "=", "expression", ".", "getField", "(", ")", ";", "boolean", "holder", "=", "field", ".", "isHolder", "(", ")", "&&", "!", "isInClosureConstructor", "(", ")", "&&", "!", "expression", ".", "isUseReferenceDirectly", "(", ")", ";", "ClassNode", "type", "=", "field", ".", "getType", "(", ")", ";", "String", "ownerName", "=", "(", "field", ".", "getOwner", "(", ")", ".", "equals", "(", "classNode", ")", ")", "?", "internalClassName", ":", "BytecodeHelper", ".", "getClassInternalName", "(", "field", ".", "getOwner", "(", ")", ")", ";", "if", "(", "holder", ")", "{", "mv", ".", "visitVarInsn", "(", "ALOAD", ",", "0", ")", ";", "mv", ".", "visitFieldInsn", "(", "GETFIELD", ",", "ownerName", ",", "expression", ".", "getFieldName", "(", ")", ",", "BytecodeHelper", ".", "getTypeDescription", "(", "type", ")", ")", ";", "mv", ".", "visitInsn", "(", "SWAP", ")", ";", "mv", ".", "visitMethodInsn", "(", "INVOKEVIRTUAL", ",", "\"\"", ",", "\"set\"", ",", "\"\"", ")", ";", "}", "else", "{", "if", "(", "isInClosureConstructor", "(", ")", ")", "{", "helper", ".", "doCast", "(", "type", ")", ";", "}", "else", "if", "(", "!", "ClassHelper", ".", "isPrimitiveType", "(", "type", ")", ")", "{", "doConvertAndCast", "(", "type", ")", ";", "}", "mv", ".", "visitVarInsn", "(", "ALOAD", ",", "0", ")", ";", "mv", ".", "visitInsn", "(", "SWAP", ")", ";", "helper", ".", "unbox", "(", "type", ")", ";", "helper", ".", "putField", "(", "field", ",", "ownerName", ")", ";", "}", "}", "public", "void", "storeStaticField", "(", "FieldExpression", "expression", ")", "{", "FieldNode", "field", "=", "expression", ".", "getField", "(", ")", ";", "boolean", "holder", "=", "field", ".", "isHolder", "(", ")", "&&", "!", "isInClosureConstructor", "(", ")", ";", "ClassNode", "type", "=", "field", ".", "getType", "(", ")", ";", "String", "ownerName", "=", "(", "field", ".", "getOwner", "(", ")", ".", "equals", "(", "classNode", ")", ")", "?", "internalClassName", ":", "BytecodeHelper", ".", "getClassInternalName", "(", "field", ".", "getOwner", "(", ")", ")", ";", "if", "(", "holder", ")", "{", "mv", ".", "visitFieldInsn", "(", "GETSTATIC", ",", "ownerName", ",", "expression", ".", "getFieldName", "(", ")", ",", "BytecodeHelper", ".", "getTypeDescription", "(", "type", ")", ")", ";", "mv", ".", "visitInsn", "(", "SWAP", ")", ";", "mv", ".", "visitMethodInsn", "(", "INVOKEVIRTUAL", ",", "\"\"", ",", "\"set\"", ",", "\"\"", ")", ";", "}", "else", "{", "helper", ".", "doCast", "(", "type", ")", ";", "mv", ".", "visitFieldInsn", "(", "PUTSTATIC", ",", "ownerName", ",", "expression", ".", "getFieldName", "(", ")", ",", "BytecodeHelper", ".", "getTypeDescription", "(", "type", ")", ")", ";", "}", "}", "protected", "void", "visitOuterFieldExpression", "(", "FieldExpression", "expression", ",", "ClassNode", "outerClassNode", ",", "int", "steps", ",", "boolean", "first", ")", "{", "FieldNode", "field", "=", "expression", ".", "getField", "(", ")", ";", "boolean", "isStatic", "=", "field", ".", "isStatic", "(", ")", ";", "int", "tempIdx", "=", "compileStack", ".", "defineTemporaryVariable", "(", "field", ",", "leftHandExpression", "&&", "first", ")", ";", "if", "(", "steps", ">", "1", "||", "!", "isStatic", ")", "{", "mv", ".", "visitVarInsn", "(", "ALOAD", ",", "0", ")", ";", "mv", ".", "visitFieldInsn", "(", "GETFIELD", ",", "internalClassName", ",", "\"owner\"", ",", "BytecodeHelper", ".", "getTypeDescription", "(", "outerClassNode", ")", ")", ";", "}", "if", "(", "steps", "==", "1", ")", "{", "int", "opcode", "=", "(", "leftHandExpression", ")", "?", "(", "(", "isStatic", ")", "?", "PUTSTATIC", ":", "PUTFIELD", ")", ":", "(", "(", "isStatic", ")", "?", "GETSTATIC", ":", "GETFIELD", ")", ";", "String", "ownerName", "=", "BytecodeHelper", ".", "getClassInternalName", "(", "outerClassNode", ")", ";", "if", "(", "leftHandExpression", ")", "{", "mv", ".", "visitVarInsn", "(", "ALOAD", ",", "tempIdx", ")", ";", "boolean", "holder", "=", "field", ".", "isHolder", "(", ")", "&&", "!", "isInClosureConstructor", "(", ")", ";", "if", "(", "!", "holder", ")", "{", "doConvertAndCast", "(", "field", ".", "getType", "(", ")", ")", ";", "}", "}", "mv", ".", "visitFieldInsn", "(", "opcode", ",", "ownerName", ",", "expression", ".", "getFieldName", "(", ")", ",", "BytecodeHelper", ".", "getTypeDescription", "(", "field", ".", "getType", "(", ")", ")", ")", ";", "if", "(", "!", "leftHandExpression", ")", "{", "if", "(", "ClassHelper", ".", "isPrimitiveType", "(", "field", ".", "getType", "(", ")", ")", ")", "{", "helper", ".", "box", "(", "field", ".", "getType", "(", ")", ")", ";", "}", "}", "}", "else", "{", "visitOuterFieldExpression", "(", "expression", ",", "outerClassNode", ".", "getOuterClass", "(", ")", ",", "steps", "-", "1", ",", "false", ")", ";", "}", "}", "public", "void", "visitVariableExpression", "(", "VariableExpression", "expression", ")", "{", "String", "variableName", "=", "expression", ".", "getName", "(", ")", ";", "ClassNode", "classNode", "=", "this", ".", "classNode", ";", "if", "(", "isInClosure", "(", ")", ")", "classNode", "=", "getOutermostClass", "(", ")", ";", "if", "(", "variableName", ".", "equals", "(", "\"this\"", ")", ")", "{", "if", "(", "isStaticMethod", "(", ")", "||", "(", "!", "implicitThis", "&&", "isStaticContext", "(", ")", ")", ")", "{", "visitClassExpression", "(", "new", "ClassExpression", "(", "classNode", ")", ")", ";", "}", "else", "{", "loadThis", "(", ")", ";", "}", "return", ";", "}", "if", "(", "variableName", ".", "equals", "(", "\"super\"", ")", ")", "{", "if", "(", "isStaticMethod", "(", ")", ")", "{", "visitClassExpression", "(", "new", "ClassExpression", "(", "classNode", ".", "getSuperClass", "(", ")", ")", ")", ";", "}", "else", "{", "loadThis", "(", ")", ";", "}", "return", ";", "}", "Variable", "variable", "=", "compileStack", ".", "getVariable", "(", "variableName", ",", "false", ")", ";", "if", "(", "variable", "==", "null", ")", "{", "processClassVariable", "(", "variableName", ")", ";", "}", "else", "{", "processStackVariable", "(", "variable", ",", "expression", ".", "isUseReferenceDirectly", "(", ")", ")", ";", "}", "if", "(", "!", "leftHandExpression", ")", "record", "(", "expression", ")", ";", "}", "private", "void", "loadThis", "(", ")", "{", "mv", ".", "visitVarInsn", "(", "ALOAD", ",", "0", ")", ";", "if", "(", "!", "implicitThis", "&&", "isInClosure", "(", ")", ")", "{", "mv", ".", "visitMethodInsn", "(", "INVOKEVIRTUAL", ",", "\"\"", ",", "\"\"", ",", "\"\"", ")", ";", "}", "}", "protected", "void", "processStackVariable", "(", "Variable", "variable", ",", "boolean", "useReferenceDirectly", ")", "{", "if", "(", "leftHandExpression", ")", "{", "helper", ".", "storeVar", "(", "variable", ")", ";", "}", "else", "{", "helper", ".", "loadVar", "(", "variable", ",", "useReferenceDirectly", ")", ";", "}", "if", "(", "ASM_DEBUG", ")", "{", "helper", ".", "mark", "(", "\"var:", "\"", "+", "variable", ".", "getName", "(", ")", ")", ";", "}", "}", "protected", "void", "processClassVariable", "(", "String", "name", ")", "{", "if", "(", "passingParams", "&&", "isInScriptBody", "(", ")", ")", "{", "mv", ".", "visitTypeInsn", "(", "NEW", ",", "\"\"", ")", ";", "mv", ".", "visitInsn", "(", "DUP", ")", ";", "loadThisOrOwner", "(", ")", ";", "mv", ".", "visitLdcInsn", "(", "name", ")", ";", "mv", ".", "visitMethodInsn", "(", "INVOKESPECIAL", ",", "\"\"", ",", "\"<init>\"", ",", "\"\"", ")", ";", "}", "else", "{", "PropertyExpression", "pexp", "=", "new", "PropertyExpression", "(", "VariableExpression", ".", "THIS_EXPRESSION", ",", "name", ")", ";", "pexp", ".", "setImplicitThis", "(", "true", ")", ";", "visitPropertyExpression", "(", "pexp", ")", ";", "}", "}", "protected", "void", "processFieldAccess", "(", "String", "name", ",", "FieldNode", "field", ",", "int", "steps", ")", "{", "FieldExpression", "expression", "=", "new", "FieldExpression", "(", "field", ")", ";", "if", "(", "steps", "==", "0", ")", "{", "visitFieldExpression", "(", "expression", ")", ";", "}", "else", "{", "visitOuterFieldExpression", "(", "expression", ",", "classNode", ".", "getOuterClass", "(", ")", ",", "steps", ",", "true", ")", ";", "}", "}", "protected", "boolean", "isInScriptBody", "(", ")", "{", "if", "(", "classNode", ".", "isScriptBody", "(", ")", ")", "{", "return", "true", ";", "}", "else", "{", "return", "classNode", ".", "isScript", "(", ")", "&&", "methodNode", "!=", "null", "&&", "methodNode", ".", "getName", "(", ")", ".", "equals", "(", "\"run\"", ")", ";", "}", "}", "protected", "boolean", "isPopRequired", "(", "Expression", "expression", ")", "{", "if", "(", "expression", "instanceof", "MethodCallExpression", ")", "{", "return", "expression", ".", "getType", "(", ")", "!=", "ClassHelper", ".", "VOID_TYPE", ";", "}", "if", "(", "expression", "instanceof", "DeclarationExpression", ")", "{", "DeclarationExpression", "de", "=", "(", "DeclarationExpression", ")", "expression", ";", "return", "de", ".", "getLeftExpression", "(", ")", "instanceof", "TupleExpression", ";", "}", "if", "(", "expression", "instanceof", "BinaryExpression", ")", "{", "BinaryExpression", "binExp", "=", "(", "BinaryExpression", ")", "expression", ";", "switch", "(", "binExp", ".", "getOperation", "(", ")", ".", "getType", "(", ")", ")", "{", "}", "}", "if", "(", "expression", "instanceof", "ConstructorCallExpression", ")", "{", "ConstructorCallExpression", "cce", "=", "(", "ConstructorCallExpression", ")", "expression", ";", "return", "!", "cce", ".", "isSpecialCall", "(", ")", ";", "}", "return", "true", ";", "}", "protected", "void", "createInterfaceSyntheticStaticFields", "(", ")", "{", "if", "(", "referencedClasses", ".", "isEmpty", "(", ")", ")", "{", "classNode", ".", "forgetInnerClass", "(", "(", "InterfaceHelperClassNode", ")", "interfaceClassLoadingClass", ")", ";", "return", ";", "}", "addInnerClass", "(", "interfaceClassLoadingClass", ")", ";", "for", "(", "String", "staticFieldName", ":", "referencedClasses", ".", "keySet", "(", ")", ")", "{", "interfaceClassLoadingClass", ".", "addField", "(", "staticFieldName", ",", "ACC_STATIC", "+", "ACC_SYNTHETIC", ",", "ClassHelper", ".", "CLASS_Type", ",", "new", "ClassExpression", "(", "referencedClasses", ".", "get", "(", "staticFieldName", ")", ")", ")", ";", "}", "}", "protected", "void", "createSyntheticStaticFields", "(", ")", "{", "for", "(", "String", "staticFieldName", ":", "referencedClasses", ".", "keySet", "(", ")", ")", "{", "FieldNode", "fn", "=", "classNode", ".", "getDeclaredField", "(", "staticFieldName", ")", ";", "if", "(", "fn", "!=", "null", ")", "{", "boolean", "type", "=", "fn", ".", "getType", "(", ")", "==", "ClassHelper", ".", "CLASS_Type", ";", "boolean", "modifiers", "=", "fn", ".", "getModifiers", "(", ")", "==", "ACC_STATIC", "+", "ACC_SYNTHETIC", ";", "if", "(", "!", "type", "||", "!", "modifiers", ")", "{", "String", "text", "=", "\"\"", ";", "if", "(", "!", "type", ")", "text", "=", "\"\"", "+", "fn", ".", "getType", "(", ")", "+", "\"\"", ";", "if", "(", "!", "modifiers", ")", "text", "=", "\"\"", "+", "fn", ".", "getModifiers", "(", ")", "+", "\"", "(\"", "+", "(", "ACC_STATIC", "+", "ACC_SYNTHETIC", ")", "+", "\"", "needed)\"", ";", "throwException", "(", "\"\"", "+", "staticFieldName", "+", "\"", "in", "\"", "+", "classNode", ".", "getName", "(", ")", "+", "\"\"", "+", "\"", "name", "\"", "+", "text", ")", ";", "}", "}", "else", "{", "cv", ".", "visitField", "(", "ACC_PRIVATE", "+", "ACC_STATIC", "+", "ACC_SYNTHETIC", ",", "staticFieldName", ",", "\"\"", ",", "null", ",", "null", ")", ";", "}", "mv", "=", "cv", ".", "visitMethod", "(", "ACC_PRIVATE", "+", "ACC_STATIC", "+", "ACC_SYNTHETIC", ",", "\"$get$\"", "+", "staticFieldName", ",", "\"\"", ",", "null", ",", "null", ")", ";", "mv", ".", "visitCode", "(", ")", ";", "mv", ".", "visitFieldInsn", "(", "GETSTATIC", ",", "internalClassName", ",", "staticFieldName", ",", "\"\"", ")", ";", "mv", ".", "visitInsn", "(", "DUP", ")", ";", "Label", "l0", "=", "new", "Label", "(", ")", ";", "mv", ".", "visitJumpInsn", "(", "IFNONNULL", ",", "l0", ")", ";", "mv", ".", "visitInsn", "(", "POP", ")", ";", "mv", ".", "visitLdcInsn", "(", "BytecodeHelper", ".", "getClassLoadingTypeDescription", "(", "referencedClasses", ".", "get", "(", "staticFieldName", ")", ")", ")", ";", "mv", ".", "visitMethodInsn", "(", "INVOKESTATIC", ",", "internalClassName", ",", "\"class$\"", ",", "\"\"", ")", ";", "mv", ".", "visitInsn", "(", "DUP", ")", ";", "mv", ".", "visitFieldInsn", "(", "PUTSTATIC", ",", "internalClassName", ",", "staticFieldName", ",", "\"\"", ")", ";", "mv", ".", "visitLabel", "(", "l0", ")", ";", "mv", ".", "visitInsn", "(", "ARETURN", ")", ";", "mv", ".", "visitMaxs", "(", "0", ",", "0", ")", ";", "mv", ".", "visitEnd", "(", ")", ";", "}", "mv", "=", "cv", ".", "visitMethod", "(", "ACC_STATIC", "+", "ACC_SYNTHETIC", ",", "\"class$\"", ",", "\"\"", ",", "null", ",", "null", ")", ";", "Label", "l0", "=", "new", "Label", "(", ")", ";", "mv", ".", "visitLabel", "(", "l0", ")", ";", "mv", ".", "visitVarInsn", "(", "ALOAD", ",", "0", ")", ";", "mv", ".", "visitMethodInsn", "(", "INVOKESTATIC", ",", "\"\"", ",", "\"forName\"", ",", "\"\"", ")", ";", "Label", "l1", "=", "new", "Label", "(", ")", ";", "mv", ".", "visitLabel", "(", "l1", ")", ";", "mv", ".", "visitInsn", "(", "ARETURN", ")", ";", "Label", "l2", "=", "new", "Label", "(", ")", ";", "mv", ".", "visitLabel", "(", "l2", ")", ";", "mv", ".", "visitVarInsn", "(", "ASTORE", ",", "1", ")", ";", "mv", ".", "visitTypeInsn", "(", "NEW", ",", "\"\"", ")", ";", "mv", ".", "visitInsn", "(", "DUP", ")", ";", "mv", ".", "visitVarInsn", "(", "ALOAD", ",", "1", ")", ";", "mv", ".", "visitMethodInsn", "(", "INVOKEVIRTUAL", ",", "\"\"", ",", "\"getMessage\"", ",", "\"\"", ")", ";", "mv", ".", "visitMethodInsn", "(", "INVOKESPECIAL", ",", "\"\"", ",", "\"<init>\"", ",", "\"\"", ")", ";", "mv", ".", "visitInsn", "(", "ATHROW", ")", ";", "mv", ".", "visitTryCatchBlock", "(", "l0", ",", "l2", ",", "l2", ",", "\"\"", ")", ";", "mv", ".", "visitMaxs", "(", "3", ",", "2", ")", ";", "}", "public", "void", "visitClassExpression", "(", "ClassExpression", "expression", ")", "{", "ClassNode", "type", "=", "expression", ".", "getType", "(", ")", ";", "if", "(", "ClassHelper", ".", "isPrimitiveType", "(", "type", ")", ")", "{", "ClassNode", "objectType", "=", "ClassHelper", ".", "getWrapper", "(", "type", ")", ";", "mv", ".", "visitFieldInsn", "(", "GETSTATIC", ",", "BytecodeHelper", ".", "getClassInternalName", "(", "objectType", ")", ",", "\"TYPE\"", ",", "\"\"", ")", ";", "}", "else", "{", "String", "staticFieldName", "=", "getStaticFieldName", "(", "type", ")", ";", "referencedClasses", ".", "put", "(", "staticFieldName", ",", "type", ")", ";", "String", "internalClassName", "=", "this", ".", "internalClassName", ";", "if", "(", "classNode", ".", "isInterface", "(", ")", ")", "{", "internalClassName", "=", "BytecodeHelper", ".", "getClassInternalName", "(", "interfaceClassLoadingClass", ")", ";", "mv", ".", "visitFieldInsn", "(", "GETSTATIC", ",", "internalClassName", ",", "staticFieldName", ",", "\"\"", ")", ";", "}", "else", "{", "mv", ".", "visitMethodInsn", "(", "INVOKESTATIC", ",", "internalClassName", ",", "\"$get$\"", "+", "staticFieldName", ",", "\"\"", ")", ";", "}", "}", "}", "public", "void", "visitRangeExpression", "(", "RangeExpression", "expression", ")", "{", "expression", ".", "getFrom", "(", ")", ".", "visit", "(", "this", ")", ";", "expression", ".", "getTo", "(", ")", ".", "visit", "(", "this", ")", ";", "helper", ".", "pushConstant", "(", "expression", ".", "isInclusive", "(", ")", ")", ";", "createRangeMethod", ".", "call", "(", "mv", ")", ";", "}", "public", "void", "visitMapEntryExpression", "(", "MapEntryExpression", "expression", ")", "{", "throw", "new", "GroovyBugError", "(", "\"\"", ")", ";", "}", "public", "void", "visitMapExpression", "(", "MapExpression", "expression", ")", "{", "List", "entries", "=", "expression", ".", "getMapEntryExpressions", "(", ")", ";", "int", "size", "=", "entries", ".", "size", "(", ")", ";", "helper", ".", "pushConstant", "(", "size", "*", "2", ")", ";", "mv", ".", "visitTypeInsn", "(", "ANEWARRAY", ",", "\"\"", ")", ";", "int", "i", "=", "0", ";", "for", "(", "Iterator", "iter", "=", "entries", ".", "iterator", "(", ")", ";", "iter", ".", "hasNext", "(", ")", ";", ")", "{", "Object", "object", "=", "iter", ".", "next", "(", ")", ";", "MapEntryExpression", "entry", "=", "(", "MapEntryExpression", ")", "object", ";", "mv", ".", "visitInsn", "(", "DUP", ")", ";", "helper", ".", "pushConstant", "(", "i", "++", ")", ";", "visitAndAutoboxBoolean", "(", "entry", ".", "getKeyExpression", "(", ")", ")", ";", "mv", ".", "visitInsn", "(", "AASTORE", ")", ";", "mv", ".", "visitInsn", "(", "DUP", ")", ";", "helper", ".", "pushConstant", "(", "i", "++", ")", ";", "visitAndAutoboxBoolean", "(", "entry", ".", "getValueExpression", "(", ")", ")", ";", "mv", ".", "visitInsn", "(", "AASTORE", ")", ";", "}", "createMapMethod", ".", "call", "(", "mv", ")", ";", "}", "public", "void", "visitArgumentlistExpression", "(", "ArgumentListExpression", "ale", ")", "{", "if", "(", "containsSpreadExpression", "(", "ale", ")", ")", "{", "despreadList", "(", "ale", ".", "getExpressions", "(", ")", ",", "true", ")", ";", "}", "else", "{", "visitTupleExpression", "(", "ale", ",", "true", ")", ";", "}", "}", "public", "void", "visitTupleExpression", "(", "TupleExpression", "expression", ")", "{", "visitTupleExpression", "(", "expression", ",", "false", ")", ";", "}", "private", "void", "visitTupleExpression", "(", "TupleExpression", "expression", ",", "boolean", "useWrapper", ")", "{", "int", "size", "=", "expression", ".", "getExpressions", "(", ")", ".", "size", "(", ")", ";", "helper", ".", "pushConstant", "(", "size", ")", ";", "mv", ".", "visitTypeInsn", "(", "ANEWARRAY", ",", "\"\"", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "size", ";", "i", "++", ")", "{", "mv", ".", "visitInsn", "(", "DUP", ")", ";", "helper", ".", "pushConstant", "(", "i", ")", ";", "Expression", "argument", "=", "expression", ".", "getExpression", "(", "i", ")", ";", "visitAndAutoboxBoolean", "(", "argument", ")", ";", "if", "(", "useWrapper", "&&", "argument", "instanceof", "CastExpression", ")", "loadWrapper", "(", "argument", ")", ";", "mv", ".", "visitInsn", "(", "AASTORE", ")", ";", "}", "}", "private", "void", "loadWrapper", "(", "Expression", "argument", ")", "{", "ClassNode", "goalClass", "=", "argument", ".", "getType", "(", ")", ";", "visitClassExpression", "(", "new", "ClassExpression", "(", "goalClass", ")", ")", ";", "if", "(", "goalClass", ".", "isDerivedFromGroovyObject", "(", ")", ")", "{", "createGroovyObjectWrapperMethod", ".", "call", "(", "mv", ")", ";", "}", "else", "{", "createPojoWrapperMethod", ".", "call", "(", "mv", ")", ";", "}", "}", "public", "void", "visitArrayExpression", "(", "ArrayExpression", "expression", ")", "{", "ClassNode", "elementType", "=", "expression", ".", "getElementType", "(", ")", ";", "String", "arrayTypeName", "=", "BytecodeHelper", ".", "getClassInternalName", "(", "elementType", ")", ";", "List", "<", "Expression", ">", "sizeExpression", "=", "expression", ".", "getSizeExpression", "(", ")", ";", "int", "size", "=", "0", ";", "int", "dimensions", "=", "0", ";", "if", "(", "sizeExpression", "!=", "null", ")", "{", "for", "(", "Expression", "element", ":", "sizeExpression", ")", "{", "if", "(", "element", "==", "ConstantExpression", ".", "EMPTY_EXPRESSION", ")", "break", ";", "dimensions", "++", ";", "visitAndAutoboxBoolean", "(", "element", ")", ";", "helper", ".", "unbox", "(", "int", ".", "class", ")", ";", "}", "}", "else", "{", "size", "=", "expression", ".", "getExpressions", "(", ")", ".", "size", "(", ")", ";", "helper", ".", "pushConstant", "(", "size", ")", ";", "}", "int", "storeIns", "=", "AASTORE", ";", "if", "(", "sizeExpression", "!=", "null", ")", "{", "arrayTypeName", "=", "BytecodeHelper", ".", "getTypeDescription", "(", "expression", ".", "getType", "(", ")", ")", ";", "mv", ".", "visitMultiANewArrayInsn", "(", "arrayTypeName", ",", "dimensions", ")", ";", "}", "else", "if", "(", "ClassHelper", ".", "isPrimitiveType", "(", "elementType", ")", ")", "{", "int", "primType", "=", "0", ";", "if", "(", "elementType", "==", "ClassHelper", ".", "boolean_TYPE", ")", "{", "primType", "=", "T_BOOLEAN", ";", "storeIns", "=", "BASTORE", ";", "}", "else", "if", "(", "elementType", "==", "ClassHelper", ".", "char_TYPE", ")", "{", "primType", "=", "T_CHAR", ";", "storeIns", "=", "CASTORE", ";", "}", "else", "if", "(", "elementType", "==", "ClassHelper", ".", "float_TYPE", ")", "{", "primType", "=", "T_FLOAT", ";", "storeIns", "=", "FASTORE", ";", "}", "else", "if", "(", "elementType", "==", "ClassHelper", ".", "double_TYPE", ")", "{", "primType", "=", "T_DOUBLE", ";", "storeIns", "=", "DASTORE", ";", "}", "else", "if", "(", "elementType", "==", "ClassHelper", ".", "byte_TYPE", ")", "{", "primType", "=", "T_BYTE", ";", "storeIns", "=", "BASTORE", ";", "}", "else", "if", "(", "elementType", "==", "ClassHelper", ".", "short_TYPE", ")", "{", "primType", "=", "T_SHORT", ";", "storeIns", "=", "SASTORE", ";", "}", "else", "if", "(", "elementType", "==", "ClassHelper", ".", "int_TYPE", ")", "{", "primType", "=", "T_INT", ";", "storeIns", "=", "IASTORE", ";", "}", "else", "if", "(", "elementType", "==", "ClassHelper", ".", "long_TYPE", ")", "{", "primType", "=", "T_LONG", ";", "storeIns", "=", "LASTORE", ";", "}", "mv", ".", "visitIntInsn", "(", "NEWARRAY", ",", "primType", ")", ";", "}", "else", "{", "mv", ".", "visitTypeInsn", "(", "ANEWARRAY", ",", "arrayTypeName", ")", ";", "}", "for", "(", "int", "i", "=", "0", ";", "i", "<", "size", ";", "i", "++", ")", "{", "mv", ".", "visitInsn", "(", "DUP", ")", ";", "helper", ".", "pushConstant", "(", "i", ")", ";", "Expression", "elementExpression", "=", "expression", ".", "getExpression", "(", "i", ")", ";", "if", "(", "elementExpression", "==", "null", ")", "{", "ConstantExpression", ".", "NULL", ".", "visit", "(", "this", ")", ";", "}", "else", "{", "if", "(", "!", "elementType", ".", "equals", "(", "elementExpression", ".", "getType", "(", ")", ")", ")", "{", "visitCastExpression", "(", "new", "CastExpression", "(", "elementType", ",", "elementExpression", ",", "true", ")", ")", ";", "}", "else", "{", "visitAndAutoboxBoolean", "(", "elementExpression", ")", ";", "}", "}", "mv", ".", "visitInsn", "(", "storeIns", ")", ";", "}", "if", "(", "sizeExpression", "==", "null", "&&", "ClassHelper", ".", "isPrimitiveType", "(", "elementType", ")", ")", "{", "int", "par", "=", "compileStack", ".", "defineTemporaryVariable", "(", "\"par\"", ",", "true", ")", ";", "mv", ".", "visitVarInsn", "(", "ALOAD", ",", "par", ")", ";", "}", "}", "public", "void", "visitClosureListExpression", "(", "ClosureListExpression", "expression", ")", "{", "compileStack", ".", "pushVariableScope", "(", "expression", ".", "getVariableScope", "(", ")", ")", ";", "List", "<", "Expression", ">", "expressions", "=", "expression", ".", "getExpressions", "(", ")", ";", "final", "int", "size", "=", "expressions", ".", "size", "(", ")", ";", "LinkedList", "<", "DeclarationExpression", ">", "declarations", "=", "new", "LinkedList", "<", "DeclarationExpression", ">", "(", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "size", ";", "i", "++", ")", "{", "Expression", "expr", "=", "expressions", ".", "get", "(", "i", ")", ";", "if", "(", "expr", "instanceof", "DeclarationExpression", ")", "{", "declarations", ".", "add", "(", "(", "DeclarationExpression", ")", "expr", ")", ";", "DeclarationExpression", "de", "=", "(", "DeclarationExpression", ")", "expr", ";", "BinaryExpression", "be", "=", "new", "BinaryExpression", "(", "de", ".", "getLeftExpression", "(", ")", ",", "de", ".", "getOperation", "(", ")", ",", "de", ".", "getRightExpression", "(", ")", ")", ";", "expressions", ".", "set", "(", "i", ",", "be", ")", ";", "de", ".", "setRightExpression", "(", "ConstantExpression", ".", "NULL", ")", ";", "visitDeclarationExpression", "(", "de", ")", ";", "}", "}", "LinkedList", "instructions", "=", "new", "LinkedList", "(", ")", ";", "BytecodeSequence", "seq", "=", "new", "BytecodeSequence", "(", "instructions", ")", ";", "BlockStatement", "bs", "=", "new", "BlockStatement", "(", ")", ";", "bs", ".", "addStatement", "(", "seq", ")", ";", "Parameter", "closureIndex", "=", "new", "Parameter", "(", "ClassHelper", ".", "int_TYPE", ",", "\"\"", ")", ";", "ClosureExpression", "ce", "=", "new", "ClosureExpression", "(", "new", "Parameter", "[", "]", "{", "closureIndex", "}", ",", "bs", ")", ";", "ce", ".", "setVariableScope", "(", "expression", ".", "getVariableScope", "(", ")", ")", ";", "instructions", ".", "add", "(", "ConstantExpression", ".", "NULL", ")", ";", "final", "Label", "dflt", "=", "new", "Label", "(", ")", ";", "final", "Label", "tableEnd", "=", "new", "Label", "(", ")", ";", "final", "Label", "[", "]", "labels", "=", "new", "Label", "[", "size", "]", ";", "instructions", ".", "add", "(", "new", "BytecodeInstruction", "(", ")", "{", "public", "void", "visit", "(", "MethodVisitor", "mv", ")", "{", "mv", ".", "visitVarInsn", "(", "ILOAD", ",", "1", ")", ";", "mv", ".", "visitTableSwitchInsn", "(", "0", ",", "size", "-", "1", ",", "dflt", ",", "labels", ")", ";", "}", "}", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "size", ";", "i", "++", ")", "{", "final", "Label", "label", "=", "new", "Label", "(", ")", ";", "Object", "expr", "=", "expressions", ".", "get", "(", "i", ")", ";", "final", "boolean", "isStatement", "=", "expr", "instanceof", "Statement", ";", "labels", "[", "i", "]", "=", "label", ";", "instructions", ".", "add", "(", "new", "BytecodeInstruction", "(", ")", "{", "public", "void", "visit", "(", "MethodVisitor", "mv", ")", "{", "mv", ".", "visitLabel", "(", "label", ")", ";", "if", "(", "!", "isStatement", ")", "mv", ".", "visitInsn", "(", "POP", ")", ";", "}", "}", ")", ";", "instructions", ".", "add", "(", "expr", ")", ";", "instructions", ".", "add", "(", "new", "BytecodeInstruction", "(", ")", "{", "public", "void", "visit", "(", "MethodVisitor", "mv", ")", "{", "mv", ".", "visitJumpInsn", "(", "GOTO", ",", "tableEnd", ")", ";", "}", "}", ")", ";", "}", "{", "instructions", ".", "add", "(", "new", "BytecodeInstruction", "(", ")", "{", "public", "void", "visit", "(", "MethodVisitor", "mv", ")", "{", "mv", ".", "visitLabel", "(", "dflt", ")", ";", "}", "}", ")", ";", "ConstantExpression", "text", "=", "new", "ConstantExpression", "(", "\"\"", ")", ";", "ConstructorCallExpression", "cce", "=", "new", "ConstructorCallExpression", "(", "ClassHelper", ".", "make", "(", "IllegalArgumentException", ".", "class", ")", ",", "text", ")", ";", "ThrowStatement", "ts", "=", "new", "ThrowStatement", "(", "cce", ")", ";", "instructions", ".", "add", "(", "ts", ")", ";", "}", "instructions", ".", "add", "(", "new", "BytecodeInstruction", "(", ")", "{", "public", "void", "visit", "(", "MethodVisitor", "mv", ")", "{", "mv", ".", "visitLabel", "(", "tableEnd", ")", ";", "mv", ".", "visitInsn", "(", "ARETURN", ")", ";", "}", "}", ")", ";", "visitClosureExpression", "(", "ce", ")", ";", "helper", ".", "pushConstant", "(", "size", ")", ";", "mv", ".", "visitTypeInsn", "(", "ANEWARRAY", ",", "\"\"", ")", ";", "int", "listArrayVar", "=", "compileStack", ".", "defineTemporaryVariable", "(", "\"\"", ",", "true", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "size", ";", "i", "++", ")", "{", "mv", ".", "visitTypeInsn", "(", "NEW", ",", "\"\"", ")", ";", "mv", ".", "visitInsn", "(", "DUP2", ")", ";", "mv", ".", "visitInsn", "(", "SWAP", ")", ";", "helper", ".", "pushConstant", "(", "i", ")", ";", "mv", ".", "visitMethodInsn", "(", "INVOKESPECIAL", ",", "\"\"", ",", "\"<init>\"", ",", "\"\"", ")", ";", "mv", ".", "visitVarInsn", "(", "ALOAD", ",", "listArrayVar", ")", ";", "mv", ".", "visitInsn", "(", "SWAP", ")", ";", "helper", ".", "pushConstant", "(", "i", ")", ";", "mv", ".", "visitInsn", "(", "SWAP", ")", ";", "mv", ".", "visitInsn", "(", "AASTORE", ")", ";", "}", "mv", ".", "visitInsn", "(", "POP", ")", ";", "mv", ".", "visitVarInsn", "(", "ALOAD", ",", "listArrayVar", ")", ";", "createListMethod", ".", "call", "(", "mv", ")", ";", "compileStack", ".", "removeVar", "(", "listArrayVar", ")", ";", "compileStack", ".", "pop", "(", ")", ";", "}", "public", "void", "visitBytecodeSequence", "(", "BytecodeSequence", "bytecodeSequence", ")", "{", "List", "instructions", "=", "bytecodeSequence", ".", "getInstructions", "(", ")", ";", "for", "(", "Iterator", "iterator", "=", "instructions", ".", "iterator", "(", ")", ";", "iterator", ".", "hasNext", "(", ")", ";", ")", "{", "Object", "part", "=", "iterator", ".", "next", "(", ")", ";", "if", "(", "part", "==", "EmptyExpression", ".", "INSTANCE", ")", "{", "mv", ".", "visitInsn", "(", "ACONST_NULL", ")", ";", "}", "else", "if", "(", "part", "instanceof", "Expression", ")", "{", "visitAndAutoboxBoolean", "(", "(", "Expression", ")", "part", ")", ";", "}", "else", "if", "(", "part", "instanceof", "Statement", ")", "{", "Statement", "stm", "=", "(", "Statement", ")", "part", ";", "stm", ".", "visit", "(", "this", ")", ";", "mv", ".", "visitInsn", "(", "ACONST_NULL", ")", ";", "}", "else", "{", "BytecodeInstruction", "runner", "=", "(", "BytecodeInstruction", ")", "part", ";", "runner", ".", "visit", "(", "mv", ")", ";", "}", "}", "}", "public", "void", "visitListExpression", "(", "ListExpression", "expression", ")", "{", "onLineNumber", "(", "expression", ",", "\"\"", ")", ";", "int", "size", "=", "expression", ".", "getExpressions", "(", ")", ".", "size", "(", ")", ";", "boolean", "containsSpreadExpression", "=", "containsSpreadExpression", "(", "expression", ")", ";", "if", "(", "!", "containsSpreadExpression", ")", "{", "helper", ".", "pushConstant", "(", "size", ")", ";", "mv", ".", "visitTypeInsn", "(", "ANEWARRAY", ",", "\"\"", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "size", ";", "i", "++", ")", "{", "mv", ".", "visitInsn", "(", "DUP", ")", ";", "helper", ".", "pushConstant", "(", "i", ")", ";", "visitAndAutoboxBoolean", "(", "expression", ".", "getExpression", "(", "i", ")", ")", ";", "mv", ".", "visitInsn", "(", "AASTORE", ")", ";", "}", "}", "else", "{", "despreadList", "(", "expression", ".", "getExpressions", "(", ")", ",", "false", ")", ";", "}", "createListMethod", ".", "call", "(", "mv", ")", ";", "}", "public", "void", "visitGStringExpression", "(", "GStringExpression", "expression", ")", "{", "mv", ".", "visitTypeInsn", "(", "NEW", ",", "\"\"", ")", ";", "mv", ".", "visitInsn", "(", "DUP", ")", ";", "int", "size", "=", "expression", ".", "getValues", "(", ")", ".", "size", "(", ")", ";", "helper", ".", "pushConstant", "(", "size", ")", ";", "mv", ".", "visitTypeInsn", "(", "ANEWARRAY", ",", "\"\"", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "size", ";", "i", "++", ")", "{", "mv", ".", "visitInsn", "(", "DUP", ")", ";", "helper", ".", "pushConstant", "(", "i", ")", ";", "visitAndAutoboxBoolean", "(", "expression", ".", "getValue", "(", "i", ")", ")", ";", "mv", ".", "visitInsn", "(", "AASTORE", ")", ";", "}", "List", "strings", "=", "expression", ".", "getStrings", "(", ")", ";", "size", "=", "strings", ".", "size", "(", ")", ";", "helper", ".", "pushConstant", "(", "size", ")", ";", "mv", ".", "visitTypeInsn", "(", "ANEWARRAY", ",", "\"\"", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "size", ";", "i", "++", ")", "{", "mv", ".", "visitInsn", "(", "DUP", ")", ";", "helper", ".", "pushConstant", "(", "i", ")", ";", "mv", ".", "visitLdcInsn", "(", "(", "(", "ConstantExpression", ")", "strings", ".", "get", "(", "i", ")", ")", ".", "getValue", "(", ")", ")", ";", "mv", ".", "visitInsn", "(", "AASTORE", ")", ";", "}", "mv", ".", "visitMethodInsn", "(", "INVOKESPECIAL", ",", "\"\"", ",", "\"<init>\"", ",", "\"\"", ")", ";", "}", "public", "void", "visitAnnotations", "(", "AnnotatedNode", "node", ")", "{", "}", "private", "void", "visitAnnotations", "(", "AnnotatedNode", "targetNode", ",", "Object", "visitor", ")", "{", "for", "(", "AnnotationNode", "an", ":", "targetNode", ".", "getAnnotations", "(", ")", ")", "{", "if", "(", "an", ".", "isBuiltIn", "(", ")", ")", "continue", ";", "if", "(", "an", ".", "hasSourceRetention", "(", ")", ")", "continue", ";", "AnnotationVisitor", "av", "=", "getAnnotationVisitor", "(", "targetNode", ",", "an", ",", "visitor", ")", ";", "visitAnnotationAttributes", "(", "an", ",", "av", ")", ";", "av", ".", "visitEnd", "(", ")", ";", "}", "}", "private", "void", "visitParameterAnnotations", "(", "Parameter", "parameter", ",", "int", "paramNumber", ",", "MethodVisitor", "mv", ")", "{", "for", "(", "AnnotationNode", "an", ":", "parameter", ".", "getAnnotations", "(", ")", ")", "{", "if", "(", "an", ".", "isBuiltIn", "(", ")", ")", "continue", ";", "if", "(", "an", ".", "hasSourceRetention", "(", ")", ")", "continue", ";", "final", "String", "annotationDescriptor", "=", "BytecodeHelper", ".", "getTypeDescription", "(", "an", ".", "getClassNode", "(", ")", ")", ";", "AnnotationVisitor", "av", "=", "mv", ".", "visitParameterAnnotation", "(", "paramNumber", ",", "annotationDescriptor", ",", "an", ".", "hasRuntimeRetention", "(", ")", ")", ";", "visitAnnotationAttributes", "(", "an", ",", "av", ")", ";", "av", ".", "visitEnd", "(", ")", ";", "}", "}", "private", "AnnotationVisitor", "getAnnotationVisitor", "(", "AnnotatedNode", "targetNode", ",", "AnnotationNode", "an", ",", "Object", "visitor", ")", "{", "final", "String", "annotationDescriptor", "=", "BytecodeHelper", ".", "getTypeDescription", "(", "an", ".", "getClassNode", "(", ")", ")", ";", "if", "(", "targetNode", "instanceof", "MethodNode", ")", "{", "return", "(", "(", "MethodVisitor", ")", "visitor", ")", ".", "visitAnnotation", "(", "annotationDescriptor", ",", "an", ".", "hasRuntimeRetention", "(", ")", ")", ";", "}", "else", "if", "(", "targetNode", "instanceof", "FieldNode", ")", "{", "return", "(", "(", "FieldVisitor", ")", "visitor", ")", ".", "visitAnnotation", "(", "annotationDescriptor", ",", "an", ".", "hasRuntimeRetention", "(", ")", ")", ";", "}", "else", "if", "(", "targetNode", "instanceof", "ClassNode", ")", "{", "return", "(", "(", "ClassVisitor", ")", "visitor", ")", ".", "visitAnnotation", "(", "annotationDescriptor", ",", "an", ".", "hasRuntimeRetention", "(", ")", ")", ";", "}", "throwException", "(", "\"\"", ")", ";", "return", "null", ";", "}", "private", "void", "visitAnnotationAttributes", "(", "AnnotationNode", "an", ",", "AnnotationVisitor", "av", ")", "{", "Map", "<", "String", ",", "Object", ">", "constantAttrs", "=", "new", "HashMap", "<", "String", ",", "Object", ">", "(", ")", ";", "Map", "<", "String", ",", "PropertyExpression", ">", "enumAttrs", "=", "new", "HashMap", "<", "String", ",", "PropertyExpression", ">", "(", ")", ";", "Map", "<", "String", ",", "Object", ">", "atAttrs", "=", "new", "HashMap", "<", "String", ",", "Object", ">", "(", ")", ";", "Map", "<", "String", ",", "ListExpression", ">", "arrayAttrs", "=", "new", "HashMap", "<", "String", ",", "ListExpression", ">", "(", ")", ";", "for", "(", "String", "name", ":", "an", ".", "getMembers", "(", ")", ".", "keySet", "(", ")", ")", "{", "Expression", "expr", "=", "an", ".", "getMember", "(", "name", ")", ";", "if", "(", "expr", "instanceof", "AnnotationConstantExpression", ")", "{", "atAttrs", ".", "put", "(", "name", ",", "(", "(", "AnnotationConstantExpression", ")", "expr", ")", ".", "getValue", "(", ")", ")", ";", "}", "else", "if", "(", "expr", "instanceof", "ConstantExpression", ")", "{", "constantAttrs", ".", "put", "(", "name", ",", "(", "(", "ConstantExpression", ")", "expr", ")", ".", "getValue", "(", ")", ")", ";", "}", "else", "if", "(", "expr", "instanceof", "ClassExpression", ")", "{", "constantAttrs", ".", "put", "(", "name", ",", "Type", ".", "getType", "(", "BytecodeHelper", ".", "getTypeDescription", "(", "expr", ".", "getType", "(", ")", ")", ")", ")", ";", "}", "else", "if", "(", "expr", "instanceof", "PropertyExpression", ")", "{", "enumAttrs", ".", "put", "(", "name", ",", "(", "PropertyExpression", ")", "expr", ")", ";", "}", "else", "if", "(", "expr", "instanceof", "ListExpression", ")", "{", "arrayAttrs", ".", "put", "(", "name", ",", "(", "ListExpression", ")", "expr", ")", ";", "}", "}", "for", "(", "Map", ".", "Entry", "entry", ":", "constantAttrs", ".", "entrySet", "(", ")", ")", "{", "av", ".", "visit", "(", "(", "String", ")", "entry", ".", "getKey", "(", ")", ",", "entry", ".", "getValue", "(", ")", ")", ";", "}", "for", "(", "Map", ".", "Entry", "entry", ":", "enumAttrs", ".", "entrySet", "(", ")", ")", "{", "PropertyExpression", "propExp", "=", "(", "PropertyExpression", ")", "entry", ".", "getValue", "(", ")", ";", "av", ".", "visitEnum", "(", "(", "String", ")", "entry", ".", "getKey", "(", ")", ",", "BytecodeHelper", ".", "getTypeDescription", "(", "propExp", ".", "getObjectExpression", "(", ")", ".", "getType", "(", ")", ")", ",", "String", ".", "valueOf", "(", "(", "(", "ConstantExpression", ")", "propExp", ".", "getProperty", "(", ")", ")", ".", "getValue", "(", ")", ")", ")", ";", "}", "for", "(", "Map", ".", "Entry", "entry", ":", "atAttrs", ".", "entrySet", "(", ")", ")", "{", "AnnotationNode", "atNode", "=", "(", "AnnotationNode", ")", "entry", ".", "getValue", "(", ")", ";", "AnnotationVisitor", "av2", "=", "av", ".", "visitAnnotation", "(", "(", "String", ")", "entry", ".", "getKey", "(", ")", ",", "BytecodeHelper", ".", "getTypeDescription", "(", "atNode", ".", "getClassNode", "(", ")", ")", ")", ";", "visitAnnotationAttributes", "(", "atNode", ",", "av2", ")", ";", "av2", ".", "visitEnd", "(", ")", ";", "}", "visitArrayAttributes", "(", "an", ",", "arrayAttrs", ",", "av", ")", ";", "}", "private", "void", "visitArrayAttributes", "(", "AnnotationNode", "an", ",", "Map", "<", "String", ",", "ListExpression", ">", "arrayAttr", ",", "AnnotationVisitor", "av", ")", "{", "if", "(", "arrayAttr", ".", "isEmpty", "(", ")", ")", "return", ";", "for", "(", "Map", ".", "Entry", "entry", ":", "arrayAttr", ".", "entrySet", "(", ")", ")", "{", "AnnotationVisitor", "av2", "=", "av", ".", "visitArray", "(", "(", "String", ")", "entry", ".", "getKey", "(", ")", ")", ";", "List", "<", "Expression", ">", "values", "=", "(", "(", "ListExpression", ")", "entry", ".", "getValue", "(", ")", ")", ".", "getExpressions", "(", ")", ";", "if", "(", "!", "values", ".", "isEmpty", "(", ")", ")", "{", "int", "arrayElementType", "=", "determineCommonArrayType", "(", "values", ")", ";", "for", "(", "Expression", "exprChild", ":", "values", ")", "{", "visitAnnotationArrayElement", "(", "exprChild", ",", "arrayElementType", ",", "av2", ")", ";", "}", "}", "av2", ".", "visitEnd", "(", ")", ";", "}", "}", "private", "int", "determineCommonArrayType", "(", "List", "values", ")", "{", "Expression", "expr", "=", "(", "Expression", ")", "values", ".", "get", "(", "0", ")", ";", "int", "arrayElementType", "=", "-", "1", ";", "if", "(", "expr", "instanceof", "AnnotationConstantExpression", ")", "{", "arrayElementType", "=", "1", ";", "}", "else", "if", "(", "expr", "instanceof", "ConstantExpression", ")", "{", "arrayElementType", "=", "2", ";", "}", "else", "if", "(", "expr", "instanceof", "ClassExpression", ")", "{", "arrayElementType", "=", "3", ";", "}", "else", "if", "(", "expr", "instanceof", "PropertyExpression", ")", "{", "arrayElementType", "=", "4", ";", "}", "return", "arrayElementType", ";", "}", "private", "void", "visitAnnotationArrayElement", "(", "Expression", "expr", ",", "int", "arrayElementType", ",", "AnnotationVisitor", "av", ")", "{", "switch", "(", "arrayElementType", ")", "{", "case", "1", ":", "AnnotationNode", "atAttr", "=", "(", "AnnotationNode", ")", "(", "(", "AnnotationConstantExpression", ")", "expr", ")", ".", "getValue", "(", ")", ";", "AnnotationVisitor", "av2", "=", "av", ".", "visitAnnotation", "(", "null", ",", "BytecodeHelper", ".", "getTypeDescription", "(", "atAttr", ".", "getClassNode", "(", ")", ")", ")", ";", "visitAnnotationAttributes", "(", "atAttr", ",", "av2", ")", ";", "av2", ".", "visitEnd", "(", ")", ";", "break", ";", "case", "2", ":", "av", ".", "visit", "(", "null", ",", "(", "(", "ConstantExpression", ")", "expr", ")", ".", "getValue", "(", ")", ")", ";", "break", ";", "case", "3", ":", "av", ".", "visit", "(", "null", ",", "Type", ".", "getType", "(", "BytecodeHelper", ".", "getTypeDescription", "(", "expr", ".", "getType", "(", ")", ")", ")", ")", ";", "break", ";", "case", "4", ":", "PropertyExpression", "propExpr", "=", "(", "PropertyExpression", ")", "expr", ";", "av", ".", "visitEnum", "(", "null", ",", "BytecodeHelper", ".", "getTypeDescription", "(", "propExpr", ".", "getObjectExpression", "(", ")", ".", "getType", "(", ")", ")", ",", "String", ".", "valueOf", "(", "(", "(", "ConstantExpression", ")", "propExpr", ".", "getProperty", "(", ")", ")", ".", "getValue", "(", ")", ")", ")", ";", "break", ";", "}", "}", "protected", "boolean", "addInnerClass", "(", "ClassNode", "innerClass", ")", "{", "innerClass", ".", "setModule", "(", "classNode", ".", "getModule", "(", ")", ")", ";", "return", "innerClasses", ".", "add", "(", "innerClass", ")", ";", "}", "protected", "ClassNode", "createClosureClass", "(", "ClosureExpression", "expression", ")", "{", "ClassNode", "outerClass", "=", "getOutermostClass", "(", ")", ";", "String", "name", "=", "outerClass", ".", "getName", "(", ")", "+", "\"$\"", "+", "context", ".", "getNextClosureInnerName", "(", "outerClass", ",", "classNode", ",", "methodNode", ")", ";", "boolean", "staticMethodOrInStaticClass", "=", "isStaticMethod", "(", ")", "||", "classNode", ".", "isStaticClass", "(", ")", ";", "Parameter", "[", "]", "parameters", "=", "expression", ".", "getParameters", "(", ")", ";", "if", "(", "parameters", "==", "null", ")", "{", "parameters", "=", "Parameter", ".", "EMPTY_ARRAY", ";", "}", "else", "if", "(", "parameters", ".", "length", "==", "0", ")", "{", "Parameter", "it", "=", "new", "Parameter", "(", "ClassHelper", ".", "OBJECT_TYPE", ",", "\"it\"", ",", "ConstantExpression", ".", "NULL", ")", ";", "parameters", "=", "new", "Parameter", "[", "]", "{", "it", "}", ";", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "Variable", "ref", "=", "expression", ".", "getVariableScope", "(", ")", ".", "getDeclaredVariable", "(", "\"it\"", ")", ";", "if", "(", "ref", "!=", "null", ")", "it", ".", "setClosureSharedVariable", "(", "ref", ".", "isClosureSharedVariable", "(", ")", ")", ";", "}", "Parameter", "[", "]", "localVariableParams", "=", "getClosureSharedVariables", "(", "expression", ")", ";", "removeInitialValues", "(", "localVariableParams", ")", ";", "InnerClassNode", "answer", "=", "new", "InnerClassNode", "(", "outerClass", ",", "name", ",", "0", ",", "ClassHelper", ".", "CLOSURE_TYPE", ")", ";", "answer", ".", "setEnclosingMethod", "(", "this", ".", "methodNode", ")", ";", "answer", ".", "setSynthetic", "(", "true", ")", ";", "answer", ".", "setUsingGenerics", "(", "outerClass", ".", "isUsingGenerics", "(", ")", ")", ";", "if", "(", "staticMethodOrInStaticClass", ")", "{", "answer", ".", "setStaticClass", "(", "true", ")", ";", "}", "if", "(", "isInScriptBody", "(", ")", ")", "{", "answer", ".", "setScriptBody", "(", "true", ")", ";", "}", "MethodNode", "method", "=", "answer", ".", "addMethod", "(", "\"doCall\"", ",", "ACC_PUBLIC", ",", "ClassHelper", ".", "OBJECT_TYPE", ",", "parameters", ",", "ClassNode", ".", "EMPTY_ARRAY", ",", "expression", ".", "getCode", "(", ")", ")", ";", "method", ".", "setSourcePosition", "(", "expression", ")", ";", "VariableScope", "varScope", "=", "expression", ".", "getVariableScope", "(", ")", ";", "if", "(", "varScope", "==", "null", ")", "{", "throw", "new", "RuntimeException", "(", "\"\"", "+", "expression", "+", "\"", "class:", "\"", "+", "name", ")", ";", "}", "else", "{", "method", ".", "setVariableScope", "(", "varScope", ".", "copy", "(", ")", ")", ";", "}", "if", "(", "parameters", ".", "length", ">", "1", "||", "(", "parameters", ".", "length", "==", "1", "&&", "parameters", "[", "0", "]", ".", "getType", "(", ")", "!=", "null", "&&", "parameters", "[", "0", "]", ".", "getType", "(", ")", "!=", "ClassHelper", ".", "OBJECT_TYPE", ")", ")", "{", "MethodNode", "call", "=", "answer", ".", "addMethod", "(", "\"call\"", ",", "ACC_PUBLIC", ",", "ClassHelper", ".", "OBJECT_TYPE", ",", "parameters", ",", "ClassNode", ".", "EMPTY_ARRAY", ",", "new", "ReturnStatement", "(", "new", "MethodCallExpression", "(", "VariableExpression", ".", "THIS_EXPRESSION", ",", "\"doCall\"", ",", "new", "ArgumentListExpression", "(", "parameters", ")", ")", ")", ")", ";", "call", ".", "setSourcePosition", "(", "expression", ")", ";", "}", "BlockStatement", "block", "=", "new", "BlockStatement", "(", ")", ";", "VariableExpression", "outer", "=", "new", "VariableExpression", "(", "\"\"", ")", ";", "outer", ".", "setSourcePosition", "(", "expression", ")", ";", "block", ".", "getVariableScope", "(", ")", ".", "putReferencedLocalVariable", "(", "outer", ")", ";", "VariableExpression", "thisObject", "=", "new", "VariableExpression", "(", "\"_thisObject\"", ")", ";", "thisObject", ".", "setSourcePosition", "(", "expression", ")", ";", "block", ".", "getVariableScope", "(", ")", ".", "putReferencedLocalVariable", "(", "thisObject", ")", ";", "TupleExpression", "conArgs", "=", "new", "TupleExpression", "(", "outer", ",", "thisObject", ")", ";", "block", ".", "addStatement", "(", "new", "ExpressionStatement", "(", "new", "ConstructorCallExpression", "(", "ClassNode", ".", "SUPER", ",", "conArgs", ")", ")", ")", ";", "for", "(", "Parameter", "param", ":", "localVariableParams", ")", "{", "String", "paramName", "=", "param", ".", "getName", "(", ")", ";", "Expression", "initialValue", "=", "null", ";", "ClassNode", "type", "=", "param", ".", "getType", "(", ")", ";", "FieldNode", "paramField", "=", "null", ";", "if", "(", "true", ")", "{", "initialValue", "=", "new", "VariableExpression", "(", "paramName", ")", ";", "ClassNode", "realType", "=", "type", ";", "type", "=", "ClassHelper", ".", "makeReference", "(", ")", ";", "param", ".", "setType", "(", "ClassHelper", ".", "makeReference", "(", ")", ")", ";", "paramField", "=", "answer", ".", "addField", "(", "paramName", ",", "ACC_PRIVATE", ",", "type", ",", "initialValue", ")", ";", "paramField", ".", "setHolder", "(", "true", ")", ";", "String", "methodName", "=", "Verifier", ".", "capitalize", "(", "paramName", ")", ";", "Expression", "fieldExp", "=", "new", "FieldExpression", "(", "paramField", ")", ";", "answer", ".", "addMethod", "(", "\"get\"", "+", "methodName", ",", "ACC_PUBLIC", ",", "realType", ",", "Parameter", ".", "EMPTY_ARRAY", ",", "ClassNode", ".", "EMPTY_ARRAY", ",", "new", "ReturnStatement", "(", "fieldExp", ")", ")", ";", "}", "}", "Parameter", "[", "]", "params", "=", "new", "Parameter", "[", "2", "+", "localVariableParams", ".", "length", "]", ";", "params", "[", "0", "]", "=", "new", "Parameter", "(", "ClassHelper", ".", "OBJECT_TYPE", ",", "\"\"", ")", ";", "params", "[", "1", "]", "=", "new", "Parameter", "(", "ClassHelper", ".", "OBJECT_TYPE", ",", "\"_thisObject\"", ")", ";", "System", ".", "arraycopy", "(", "localVariableParams", ",", "0", ",", "params", ",", "2", ",", "localVariableParams", ".", "length", ")", ";", "ASTNode", "sn", "=", "answer", ".", "addConstructor", "(", "ACC_PUBLIC", ",", "params", ",", "ClassNode", ".", "EMPTY_ARRAY", ",", "block", ")", ";", "sn", ".", "setSourcePosition", "(", "expression", ")", ";", "return", "answer", ";", "}", "private", "void", "removeInitialValues", "(", "Parameter", "[", "]", "params", ")", "{", "for", "(", "int", "i", "=", "0", ";", "i", "<", "params", ".", "length", ";", "i", "++", ")", "{", "if", "(", "params", "[", "i", "]", ".", "hasInitialExpression", "(", ")", ")", "{", "params", "[", "i", "]", "=", "new", "Parameter", "(", "params", "[", "i", "]", ".", "getType", "(", ")", ",", "params", "[", "i", "]", ".", "getName", "(", ")", ")", ";", "}", "}", "}", "protected", "Parameter", "[", "]", "getClosureSharedVariables", "(", "ClosureExpression", "ce", ")", "{", "VariableScope", "scope", "=", "ce", ".", "getVariableScope", "(", ")", ";", "Parameter", "[", "]", "ret", "=", "new", "Parameter", "[", "scope", ".", "getReferencedLocalVariablesCount", "(", ")", "]", ";", "int", "index", "=", "0", ";", "for", "(", "Iterator", "iter", "=", "scope", ".", "getReferencedLocalVariablesIterator", "(", ")", ";", "iter", ".", "hasNext", "(", ")", ";", ")", "{", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "Variable", "element", "=", "(", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "Variable", ")", "iter", ".", "next", "(", ")", ";", "Parameter", "p", "=", "new", "Parameter", "(", "element", ".", "getType", "(", ")", ",", "element", ".", "getName", "(", ")", ")", ";", "ret", "[", "index", "]", "=", "p", ";", "index", "++", ";", "}", "return", "ret", ";", "}", "protected", "ClassNode", "getOutermostClass", "(", ")", "{", "if", "(", "outermostClass", "==", "null", ")", "{", "outermostClass", "=", "classNode", ";", "while", "(", "outermostClass", "instanceof", "InnerClassNode", ")", "{", "outermostClass", "=", "outermostClass", ".", "getOuterClass", "(", ")", ";", "}", "}", "return", "outermostClass", ";", "}", "protected", "void", "doConvertAndCast", "(", "ClassNode", "type", ")", "{", "doConvertAndCast", "(", "type", ",", "false", ")", ";", "}", "protected", "void", "doConvertAndCast", "(", "ClassNode", "type", ",", "boolean", "coerce", ")", "{", "if", "(", "type", "==", "ClassHelper", ".", "OBJECT_TYPE", ")", "return", ";", "if", "(", "rightHandType", "==", "null", "||", "!", "rightHandType", ".", "isDerivedFrom", "(", "type", ")", "||", "!", "rightHandType", ".", "implementsInterface", "(", "type", ")", ")", "{", "if", "(", "isValidTypeForCast", "(", "type", ")", ")", "{", "visitClassExpression", "(", "new", "ClassExpression", "(", "type", ")", ")", ";", "if", "(", "coerce", ")", "{", "asTypeMethod", ".", "call", "(", "mv", ")", ";", "}", "else", "{", "castToTypeMethod", ".", "call", "(", "mv", ")", ";", "}", "}", "}", "helper", ".", "doCast", "(", "type", ")", ";", "}", "protected", "void", "evaluateLogicalOrExpression", "(", "BinaryExpression", "expression", ")", "{", "visitBooleanExpression", "(", "new", "BooleanExpression", "(", "expression", ".", "getLeftExpression", "(", ")", ")", ")", ";", "Label", "l0", "=", "new", "Label", "(", ")", ";", "Label", "l2", "=", "new", "Label", "(", ")", ";", "mv", ".", "visitJumpInsn", "(", "IFEQ", ",", "l0", ")", ";", "mv", ".", "visitLabel", "(", "l2", ")", ";", "visitConstantExpression", "(", "ConstantExpression", ".", "TRUE", ")", ";", "Label", "l1", "=", "new", "Label", "(", ")", ";", "mv", ".", "visitJumpInsn", "(", "GOTO", ",", "l1", ")", ";", "mv", ".", "visitLabel", "(", "l0", ")", ";", "visitBooleanExpression", "(", "new", "BooleanExpression", "(", "expression", ".", "getRightExpression", "(", ")", ")", ")", ";", "mv", ".", "visitJumpInsn", "(", "IFNE", ",", "l2", ")", ";", "visitConstantExpression", "(", "ConstantExpression", ".", "FALSE", ")", ";", "mv", ".", "visitLabel", "(", "l1", ")", ";", "}", "protected", "void", "evaluateLogicalAndExpression", "(", "BinaryExpression", "expression", ")", "{", "visitBooleanExpression", "(", "new", "BooleanExpression", "(", "expression", ".", "getLeftExpression", "(", ")", ")", ")", ";", "Label", "l0", "=", "new", "Label", "(", ")", ";", "mv", ".", "visitJumpInsn", "(", "IFEQ", ",", "l0", ")", ";", "visitBooleanExpression", "(", "new", "BooleanExpression", "(", "expression", ".", "getRightExpression", "(", ")", ")", ")", ";", "mv", ".", "visitJumpInsn", "(", "IFEQ", ",", "l0", ")", ";", "visitConstantExpression", "(", "ConstantExpression", ".", "TRUE", ")", ";", "Label", "l1", "=", "new", "Label", "(", ")", ";", "mv", ".", "visitJumpInsn", "(", "GOTO", ",", "l1", ")", ";", "mv", ".", "visitLabel", "(", "l0", ")", ";", "visitConstantExpression", "(", "ConstantExpression", ".", "FALSE", ")", ";", "mv", ".", "visitLabel", "(", "l1", ")", ";", "}", "protected", "void", "evaluateBinaryExpression", "(", "String", "method", ",", "BinaryExpression", "expression", ")", "{", "makeBinopCallSite", "(", "expression", ".", "getLeftExpression", "(", ")", ",", "method", ",", "expression", ".", "getRightExpression", "(", ")", ")", ";", "}", "protected", "void", "evaluateCompareTo", "(", "BinaryExpression", "expression", ")", "{", "Expression", "leftExpression", "=", "expression", ".", "getLeftExpression", "(", ")", ";", "leftExpression", ".", "visit", "(", "this", ")", ";", "if", "(", "isComparisonExpression", "(", "leftExpression", ")", ")", "{", "helper", ".", "boxBoolean", "(", ")", ";", "}", "Expression", "rightExpression", "=", "expression", ".", "getRightExpression", "(", ")", ";", "rightExpression", ".", "visit", "(", "this", ")", ";", "if", "(", "isComparisonExpression", "(", "rightExpression", ")", ")", "{", "helper", ".", "boxBoolean", "(", ")", ";", "}", "compareToMethod", ".", "call", "(", "mv", ")", ";", "}", "protected", "void", "evaluateBinaryExpressionWithAssignment", "(", "String", "method", ",", "BinaryExpression", "expression", ")", "{", "Expression", "leftExpression", "=", "expression", ".", "getLeftExpression", "(", ")", ";", "if", "(", "leftExpression", "instanceof", "BinaryExpression", ")", "{", "BinaryExpression", "leftBinExpr", "=", "(", "BinaryExpression", ")", "leftExpression", ";", "if", "(", "leftBinExpr", ".", "getOperation", "(", ")", ".", "getType", "(", ")", "==", "Types", ".", "LEFT_SQUARE_BRACKET", ")", "{", "prepareCallSite", "(", "\"putAt\"", ")", ";", "prepareCallSite", "(", "method", ")", ";", "prepareCallSite", "(", "\"getAt\"", ")", ";", "visitAndAutoboxBoolean", "(", "leftBinExpr", ".", "getLeftExpression", "(", ")", ")", ";", "visitAndAutoboxBoolean", "(", "leftBinExpr", ".", "getRightExpression", "(", ")", ")", ";", "mv", ".", "visitInsn", "(", "DUP2_X2", ")", ";", "mv", ".", "visitMethodInsn", "(", "INVOKEINTERFACE", ",", "\"\"", ",", "\"call\"", ",", "\"\"", ")", ";", "visitAndAutoboxBoolean", "(", "expression", ".", "getRightExpression", "(", ")", ")", ";", "mv", ".", "visitMethodInsn", "(", "INVOKEINTERFACE", ",", "\"\"", ",", "\"call\"", ",", "\"\"", ")", ";", "final", "int", "resultVar", "=", "compileStack", ".", "defineTemporaryVariable", "(", "\"$result\"", ",", "true", ")", ";", "mv", ".", "visitVarInsn", "(", "ALOAD", ",", "resultVar", ")", ";", "mv", ".", "visitMethodInsn", "(", "INVOKEINTERFACE", ",", "\"\"", ",", "\"call\"", ",", "\"\"", ")", ";", "mv", ".", "visitInsn", "(", "POP", ")", ";", "mv", ".", "visitVarInsn", "(", "ALOAD", ",", "resultVar", ")", ";", "compileStack", ".", "removeVar", "(", "resultVar", ")", ";", "return", ";", "}", "}", "evaluateBinaryExpression", "(", "method", ",", "expression", ")", ";", "mv", ".", "visitInsn", "(", "DUP", ")", ";", "doConvertAndCast", "(", "ClassHelper", ".", "getWrapper", "(", "leftExpression", ".", "getType", "(", ")", ")", ")", ";", "leftHandExpression", "=", "true", ";", "evaluateExpression", "(", "leftExpression", ")", ";", "leftHandExpression", "=", "false", ";", "}", "private", "void", "evaluateBinaryExpression", "(", "MethodCaller", "compareMethod", ",", "BinaryExpression", "expression", ")", "{", "Expression", "leftExp", "=", "expression", ".", "getLeftExpression", "(", ")", ";", "Expression", "rightExp", "=", "expression", ".", "getRightExpression", "(", ")", ";", "load", "(", "leftExp", ")", ";", "load", "(", "rightExp", ")", ";", "compareMethod", ".", "call", "(", "mv", ")", ";", "}", "protected", "void", "evaluateEqual", "(", "BinaryExpression", "expression", ",", "boolean", "defineVariable", ")", "{", "Expression", "leftExpression", "=", "expression", ".", "getLeftExpression", "(", ")", ";", "if", "(", "leftExpression", "instanceof", "BinaryExpression", ")", "{", "BinaryExpression", "leftBinExpr", "=", "(", "BinaryExpression", ")", "leftExpression", ";", "if", "(", "leftBinExpr", ".", "getOperation", "(", ")", ".", "getType", "(", ")", "==", "Types", ".", "LEFT_SQUARE_BRACKET", ")", "{", "prepareCallSite", "(", "\"putAt\"", ")", ";", "visitAndAutoboxBoolean", "(", "leftBinExpr", ".", "getLeftExpression", "(", ")", ")", ";", "visitAndAutoboxBoolean", "(", "leftBinExpr", ".", "getRightExpression", "(", ")", ")", ";", "visitAndAutoboxBoolean", "(", "expression", ".", "getRightExpression", "(", ")", ")", ";", "final", "int", "resultVar", "=", "compileStack", ".", "defineTemporaryVariable", "(", "\"$result\"", ",", "true", ")", ";", "mv", ".", "visitVarInsn", "(", "ALOAD", ",", "resultVar", ")", ";", "mv", ".", "visitMethodInsn", "(", "INVOKEINTERFACE", ",", "\"\"", ",", "\"call\"", ",", "\"\"", ")", ";", "mv", ".", "visitInsn", "(", "POP", ")", ";", "mv", ".", "visitVarInsn", "(", "ALOAD", ",", "resultVar", ")", ";", "compileStack", ".", "removeVar", "(", "resultVar", ")", ";", "return", ";", "}", "}", "Expression", "rightExpression", "=", "expression", ".", "getRightExpression", "(", ")", ";", "if", "(", "!", "(", "leftExpression", "instanceof", "TupleExpression", ")", ")", "{", "ClassNode", "type", "=", "null", ";", "if", "(", "expression", "instanceof", "DeclarationExpression", ")", "{", "type", "=", "leftExpression", ".", "getType", "(", ")", ";", "}", "else", "{", "type", "=", "getLHSType", "(", "leftExpression", ")", ";", "}", "assignmentCastAndVisit", "(", "type", ",", "rightExpression", ")", ";", "}", "else", "{", "visitAndAutoboxBoolean", "(", "rightExpression", ")", ";", "}", "rightHandType", "=", "rightExpression", ".", "getType", "(", ")", ";", "leftHandExpression", "=", "true", ";", "if", "(", "leftExpression", "instanceof", "TupleExpression", ")", "{", "TupleExpression", "tuple", "=", "(", "TupleExpression", ")", "leftExpression", ";", "int", "i", "=", "0", ";", "Expression", "lhsExpr", "=", "new", "BytecodeExpression", "(", ")", "{", "public", "void", "visit", "(", "MethodVisitor", "mv", ")", "{", "mv", ".", "visitInsn", "(", "SWAP", ")", ";", "mv", ".", "visitInsn", "(", "DUP_X1", ")", ";", "}", "}", ";", "for", "(", "Expression", "e", ":", "tuple", ".", "getExpressions", "(", ")", ")", "{", "VariableExpression", "var", "=", "(", "VariableExpression", ")", "e", ";", "MethodCallExpression", "call", "=", "new", "MethodCallExpression", "(", "lhsExpr", ",", "\"getAt\"", ",", "new", "ArgumentListExpression", "(", "new", "ConstantExpression", "(", "i", ")", ")", ")", ";", "ClassNode", "type", "=", "getLHSType", "(", "var", ")", ";", "assignmentCastAndVisit", "(", "type", ",", "call", ")", ";", "i", "++", ";", "if", "(", "defineVariable", ")", "{", "compileStack", ".", "defineVariable", "(", "var", ",", "true", ")", ";", "}", "else", "{", "visitVariableExpression", "(", "var", ")", ";", "}", "}", "}", "else", "if", "(", "defineVariable", ")", "{", "VariableExpression", "var", "=", "(", "VariableExpression", ")", "leftExpression", ";", "compileStack", ".", "defineVariable", "(", "var", ",", "true", ")", ";", "}", "else", "{", "mv", ".", "visitInsn", "(", "DUP", ")", ";", "leftExpression", ".", "visit", "(", "this", ")", ";", "}", "rightHandType", "=", "null", ";", "leftHandExpression", "=", "false", ";", "}", "private", "void", "assignmentCastAndVisit", "(", "ClassNode", "type", ",", "Expression", "rightExpression", ")", "{", "if", "(", "ClassHelper", ".", "isPrimitiveType", "(", "type", ")", ")", "{", "visitAndAutoboxBoolean", "(", "rightExpression", ")", ";", "}", "else", "if", "(", "!", "rightExpression", ".", "getType", "(", ")", ".", "isDerivedFrom", "(", "type", ")", ")", "{", "visitCastExpression", "(", "new", "CastExpression", "(", "type", ",", "rightExpression", ")", ")", ";", "}", "else", "{", "visitAndAutoboxBoolean", "(", "rightExpression", ")", ";", "}", "}", "protected", "ClassNode", "getLHSType", "(", "Expression", "leftExpression", ")", "{", "if", "(", "leftExpression", "instanceof", "VariableExpression", ")", "{", "VariableExpression", "varExp", "=", "(", "VariableExpression", ")", "leftExpression", ";", "ClassNode", "type", "=", "varExp", ".", "getType", "(", ")", ";", "if", "(", "isValidTypeForCast", "(", "type", ")", ")", "{", "return", "type", ";", "}", "String", "variableName", "=", "varExp", ".", "getName", "(", ")", ";", "Variable", "variable", "=", "compileStack", ".", "getVariable", "(", "variableName", ",", "false", ")", ";", "if", "(", "variable", "!=", "null", ")", "{", "if", "(", "variable", ".", "isHolder", "(", ")", ")", "{", "return", "type", ";", "}", "if", "(", "variable", ".", "isProperty", "(", ")", ")", "return", "variable", ".", "getType", "(", ")", ";", "type", "=", "variable", ".", "getType", "(", ")", ";", "if", "(", "isValidTypeForCast", "(", "type", ")", ")", "{", "return", "type", ";", "}", "}", "else", "{", "FieldNode", "field", "=", "classNode", ".", "getDeclaredField", "(", "variableName", ")", ";", "if", "(", "field", "==", "null", ")", "{", "field", "=", "classNode", ".", "getOuterField", "(", "variableName", ")", ";", "}", "if", "(", "field", "!=", "null", ")", "{", "type", "=", "field", ".", "getType", "(", ")", ";", "if", "(", "!", "field", ".", "isHolder", "(", ")", "&&", "isValidTypeForCast", "(", "type", ")", ")", "{", "return", "type", ";", "}", "}", "}", "}", "else", "if", "(", "leftExpression", "instanceof", "FieldExpression", ")", "{", "FieldExpression", "fieldExp", "=", "(", "FieldExpression", ")", "leftExpression", ";", "ClassNode", "type", "=", "fieldExp", ".", "getType", "(", ")", ";", "if", "(", "isValidTypeForCast", "(", "type", ")", ")", "{", "return", "type", ";", "}", "}", "return", "leftExpression", ".", "getType", "(", ")", ";", "}", "protected", "boolean", "isValidTypeForCast", "(", "ClassNode", "type", ")", "{", "return", "type", "!=", "ClassHelper", ".", "DYNAMIC_TYPE", "&&", "type", "!=", "ClassHelper", ".", "REFERENCE_TYPE", ";", "}", "public", "void", "visitBytecodeExpression", "(", "BytecodeExpression", "cle", ")", "{", "cle", ".", "visit", "(", "mv", ")", ";", "}", "protected", "void", "visitAndAutoboxBoolean", "(", "Expression", "expression", ")", "{", "if", "(", "expression", "==", "null", ")", "{", "return", ";", "}", "expression", ".", "visit", "(", "this", ")", ";", "if", "(", "isComparisonExpression", "(", "expression", ")", ")", "{", "helper", ".", "boxBoolean", "(", ")", ";", "}", "}", "private", "void", "execMethodAndStoreForSubscriptOperator", "(", "String", "method", ",", "Expression", "expression", ")", "{", "execMethodAndStoreForSubscriptOperator", "(", "method", ",", "expression", ",", "null", ")", ";", "}", "private", "void", "execMethodAndStoreForSubscriptOperator", "(", "String", "method", ",", "Expression", "expression", ",", "Expression", "getAtResultExp", ")", "{", "makeCallSite", "(", "(", "getAtResultExp", "==", "null", "?", "expression", ":", "getAtResultExp", ")", ",", "method", ",", "MethodCallExpression", ".", "NO_ARGUMENTS", ",", "false", ",", "false", ",", "false", ",", "false", ")", ";", "if", "(", "expression", "instanceof", "BinaryExpression", ")", "{", "BinaryExpression", "be", "=", "(", "BinaryExpression", ")", "expression", ";", "if", "(", "be", ".", "getOperation", "(", ")", ".", "getType", "(", ")", "==", "Types", ".", "LEFT_SQUARE_BRACKET", ")", "{", "mv", ".", "visitInsn", "(", "DUP", ")", ";", "final", "int", "resultIdx", "=", "compileStack", ".", "defineTemporaryVariable", "(", "\"postfix_\"", "+", "method", ",", "true", ")", ";", "BytecodeExpression", "result", "=", "new", "BytecodeExpression", "(", ")", "{", "public", "void", "visit", "(", "MethodVisitor", "mv", ")", "{", "mv", ".", "visitVarInsn", "(", "ALOAD", ",", "resultIdx", ")", ";", "}", "}", ";", "TupleExpression", "args", "=", "new", "ArgumentListExpression", "(", ")", ";", "args", ".", "addExpression", "(", "be", ".", "getRightExpression", "(", ")", ")", ";", "args", ".", "addExpression", "(", "result", ")", ";", "makeCallSite", "(", "be", ".", "getLeftExpression", "(", ")", ",", "\"putAt\"", ",", "args", ",", "false", ",", "false", ",", "false", ",", "false", ")", ";", "mv", ".", "visitInsn", "(", "POP", ")", ";", "compileStack", ".", "removeVar", "(", "resultIdx", ")", ";", "}", "}", "if", "(", "expression", "instanceof", "VariableExpression", "||", "expression", "instanceof", "FieldExpression", "||", "expression", "instanceof", "PropertyExpression", ")", "{", "mv", ".", "visitInsn", "(", "DUP", ")", ";", "leftHandExpression", "=", "true", ";", "expression", ".", "visit", "(", "this", ")", ";", "leftHandExpression", "=", "false", ";", "}", "}", "protected", "void", "evaluatePrefixMethod", "(", "String", "method", ",", "Expression", "expression", ")", "{", "execMethodAndStoreForSubscriptOperator", "(", "method", ",", "expression", ")", ";", "}", "protected", "void", "evaluatePostfixMethod", "(", "String", "method", ",", "Expression", "expression", ")", "{", "boolean", "getAtOp", "=", "false", ";", "BinaryExpression", "be", "=", "null", ";", "Expression", "getAtResultExp", "=", "null", ";", "String", "varName", "=", "\"tmp_postfix_\"", "+", "method", ";", "final", "int", "idx", "=", "compileStack", ".", "defineTemporaryVariable", "(", "varName", ",", "false", ")", ";", "if", "(", "expression", "instanceof", "BinaryExpression", ")", "{", "be", "=", "(", "BinaryExpression", ")", "expression", ";", "if", "(", "be", ".", "getOperation", "(", ")", ".", "getType", "(", ")", "==", "Types", ".", "LEFT_SQUARE_BRACKET", ")", "{", "getAtOp", "=", "true", ";", "be", ".", "getRightExpression", "(", ")", ".", "visit", "(", "this", ")", ";", "mv", ".", "visitVarInsn", "(", "ASTORE", ",", "idx", ")", ";", "BytecodeExpression", "newRightExp", "=", "new", "BytecodeExpression", "(", ")", "{", "public", "void", "visit", "(", "MethodVisitor", "mv", ")", "{", "mv", ".", "visitVarInsn", "(", "ALOAD", ",", "idx", ")", ";", "}", "}", ";", "be", ".", "setRightExpression", "(", "newRightExp", ")", ";", "}", "}", "expression", ".", "visit", "(", "this", ")", ";", "final", "int", "tempIdx", "=", "compileStack", ".", "defineTemporaryVariable", "(", "\"postfix_\"", "+", "method", ",", "true", ")", ";", "if", "(", "getAtOp", ")", "{", "getAtResultExp", "=", "new", "BytecodeExpression", "(", ")", "{", "public", "void", "visit", "(", "MethodVisitor", "mv", ")", "{", "mv", ".", "visitVarInsn", "(", "ALOAD", ",", "tempIdx", ")", ";", "}", "}", ";", "}", "execMethodAndStoreForSubscriptOperator", "(", "method", ",", "expression", ",", "getAtResultExp", ")", ";", "mv", ".", "visitInsn", "(", "POP", ")", ";", "mv", ".", "visitVarInsn", "(", "ALOAD", ",", "tempIdx", ")", ";", "compileStack", ".", "removeVar", "(", "tempIdx", ")", ";", "compileStack", ".", "removeVar", "(", "idx", ")", ";", "}", "protected", "void", "evaluateInstanceof", "(", "BinaryExpression", "expression", ")", "{", "visitAndAutoboxBoolean", "(", "expression", ".", "getLeftExpression", "(", ")", ")", ";", "Expression", "rightExp", "=", "expression", ".", "getRightExpression", "(", ")", ";", "ClassNode", "classType", ";", "if", "(", "rightExp", "instanceof", "ClassExpression", ")", "{", "ClassExpression", "classExp", "=", "(", "ClassExpression", ")", "rightExp", ";", "classType", "=", "classExp", ".", "getType", "(", ")", ";", "}", "else", "{", "throw", "new", "RuntimeException", "(", "\"\"", "+", "rightExp", ")", ";", "}", "String", "classInternalName", "=", "BytecodeHelper", ".", "getClassInternalName", "(", "classType", ")", ";", "mv", ".", "visitTypeInsn", "(", "INSTANCEOF", ",", "classInternalName", ")", ";", "}", "protected", "boolean", "argumentsUseStack", "(", "Expression", "arguments", ")", "{", "return", "arguments", "instanceof", "TupleExpression", "||", "arguments", "instanceof", "ClosureExpression", ";", "}", "private", "static", "boolean", "isThisExpression", "(", "Expression", "expression", ")", "{", "if", "(", "expression", "instanceof", "VariableExpression", ")", "{", "VariableExpression", "varExp", "=", "(", "VariableExpression", ")", "expression", ";", "return", "varExp", ".", "getName", "(", ")", ".", "equals", "(", "\"this\"", ")", ";", "}", "return", "false", ";", "}", "private", "static", "boolean", "isSuperExpression", "(", "Expression", "expression", ")", "{", "if", "(", "expression", "instanceof", "VariableExpression", ")", "{", "VariableExpression", "varExp", "=", "(", "VariableExpression", ")", "expression", ";", "return", "varExp", ".", "getName", "(", ")", ".", "equals", "(", "\"super\"", ")", ";", "}", "return", "false", ";", "}", "private", "static", "boolean", "isThisOrSuper", "(", "Expression", "expression", ")", "{", "return", "isThisExpression", "(", "expression", ")", "||", "isSuperExpression", "(", "expression", ")", ";", "}", "protected", "Expression", "createReturnLHSExpression", "(", "Expression", "expression", ")", "{", "if", "(", "expression", "instanceof", "BinaryExpression", ")", "{", "BinaryExpression", "binExpr", "=", "(", "BinaryExpression", ")", "expression", ";", "if", "(", "binExpr", ".", "getOperation", "(", ")", ".", "isA", "(", "Types", ".", "ASSIGNMENT_OPERATOR", ")", ")", "{", "return", "createReusableExpression", "(", "binExpr", ".", "getLeftExpression", "(", ")", ")", ";", "}", "}", "return", "null", ";", "}", "protected", "Expression", "createReusableExpression", "(", "Expression", "expression", ")", "{", "ExpressionTransformer", "transformer", "=", "new", "ExpressionTransformer", "(", ")", "{", "public", "Expression", "transform", "(", "Expression", "expression", ")", "{", "if", "(", "expression", "instanceof", "PostfixExpression", ")", "{", "PostfixExpression", "postfixExp", "=", "(", "PostfixExpression", ")", "expression", ";", "return", "postfixExp", ".", "getExpression", "(", ")", ";", "}", "else", "if", "(", "expression", "instanceof", "PrefixExpression", ")", "{", "PrefixExpression", "prefixExp", "=", "(", "PrefixExpression", ")", "expression", ";", "return", "prefixExp", ".", "getExpression", "(", ")", ";", "}", "return", "expression", ";", "}", "}", ";", "return", "transformer", ".", "transform", "(", "expression", ".", "transformExpression", "(", "transformer", ")", ")", ";", "}", "protected", "boolean", "isComparisonExpression", "(", "Expression", "expression", ")", "{", "if", "(", "expression", "instanceof", "BinaryExpression", ")", "{", "BinaryExpression", "binExpr", "=", "(", "BinaryExpression", ")", "expression", ";", "switch", "(", "binExpr", ".", "getOperation", "(", ")", ".", "getType", "(", ")", ")", "{", "case", "Types", ".", "COMPARE_EQUAL", ":", "case", "Types", ".", "MATCH_REGEX", ":", "case", "Types", ".", "COMPARE_GREATER_THAN", ":", "case", "Types", ".", "COMPARE_GREATER_THAN_EQUAL", ":", "case", "Types", ".", "COMPARE_LESS_THAN", ":", "case", "Types", ".", "COMPARE_LESS_THAN_EQUAL", ":", "case", "Types", ".", "COMPARE_IDENTICAL", ":", "case", "Types", ".", "COMPARE_NOT_EQUAL", ":", "case", "Types", ".", "COMPARE_NOT_IDENTICAL", ":", "case", "Types", ".", "KEYWORD_INSTANCEOF", ":", "case", "Types", ".", "KEYWORD_IN", ":", "return", "true", ";", "}", "}", "else", "if", "(", "expression", "instanceof", "BooleanExpression", ")", "{", "return", "true", ";", "}", "return", "false", ";", "}", "protected", "void", "onLineNumber", "(", "ASTNode", "statement", ",", "String", "message", ")", "{", "if", "(", "statement", "==", "null", ")", "return", ";", "int", "line", "=", "statement", ".", "getLineNumber", "(", ")", ";", "this", ".", "currentASTNode", "=", "statement", ";", "if", "(", "line", "<", "0", ")", "return", ";", "if", "(", "!", "ASM_DEBUG", "&&", "line", "==", "lineNumber", ")", "return", ";", "lineNumber", "=", "line", ";", "if", "(", "mv", "!=", "null", ")", "{", "Label", "l", "=", "new", "Label", "(", ")", ";", "mv", ".", "visitLabel", "(", "l", ")", ";", "mv", ".", "visitLineNumber", "(", "line", ",", "l", ")", ";", "if", "(", "ASM_DEBUG", ")", "{", "helper", ".", "mark", "(", "message", "+", "\"[\"", "+", "statement", ".", "getLineNumber", "(", ")", "+", "\":\"", "+", "statement", ".", "getColumnNumber", "(", ")", "+", "\"]\"", ")", ";", "}", "}", "}", "private", "boolean", "isInnerClass", "(", ")", "{", "return", "classNode", "instanceof", "InnerClassNode", ";", "}", "protected", "boolean", "isFieldOrVariable", "(", "String", "name", ")", "{", "return", "compileStack", ".", "containsVariable", "(", "name", ")", "||", "classNode", ".", "getDeclaredField", "(", "name", ")", "!=", "null", ";", "}", "protected", "ClassNode", "getExpressionType", "(", "Expression", "expression", ")", "{", "if", "(", "isComparisonExpression", "(", "expression", ")", ")", "{", "return", "ClassHelper", ".", "boolean_TYPE", ";", "}", "if", "(", "expression", "instanceof", "VariableExpression", ")", "{", "VariableExpression", "varExpr", "=", "(", "VariableExpression", ")", "expression", ";", "if", "(", "varExpr", ".", "isThisExpression", "(", ")", ")", "{", "return", "classNode", ";", "}", "else", "if", "(", "varExpr", ".", "isSuperExpression", "(", ")", ")", "{", "return", "classNode", ".", "getSuperClass", "(", ")", ";", "}", "Variable", "variable", "=", "compileStack", ".", "getVariable", "(", "varExpr", ".", "getName", "(", ")", ",", "false", ")", ";", "if", "(", "variable", "!=", "null", "&&", "!", "variable", ".", "isHolder", "(", ")", ")", "{", "ClassNode", "type", "=", "variable", ".", "getType", "(", ")", ";", "if", "(", "!", "variable", ".", "isDynamicTyped", "(", ")", ")", "return", "type", ";", "}", "if", "(", "variable", "==", "null", ")", "{", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "Variable", "var", "=", "compileStack", ".", "getScope", "(", ")", ".", "getReferencedClassVariable", "(", "varExpr", ".", "getName", "(", ")", ")", ";", "if", "(", "var", "!=", "null", "&&", "!", "var", ".", "isDynamicTyped", "(", ")", ")", "return", "var", ".", "getType", "(", ")", ";", "}", "}", "return", "expression", ".", "getType", "(", ")", ";", "}", "protected", "boolean", "isInClosureConstructor", "(", ")", "{", "return", "constructorNode", "!=", "null", "&&", "classNode", ".", "getOuterClass", "(", ")", "!=", "null", "&&", "classNode", ".", "getSuperClass", "(", ")", "==", "ClassHelper", ".", "CLOSURE_TYPE", ";", "}", "protected", "boolean", "isInClosure", "(", ")", "{", "return", "classNode", ".", "getOuterClass", "(", ")", "!=", "null", "&&", "classNode", ".", "getSuperClass", "(", ")", "==", "ClassHelper", ".", "CLOSURE_TYPE", ";", "}", "protected", "boolean", "isNotExplicitThisInClosure", "(", "boolean", "implicitThis", ")", "{", "return", "implicitThis", "||", "!", "isInClosure", "(", ")", ";", "}", "protected", "boolean", "isStaticMethod", "(", ")", "{", "return", "methodNode", "!=", "null", "&&", "methodNode", ".", "isStatic", "(", ")", ";", "}", "protected", "CompileUnit", "getCompileUnit", "(", ")", "{", "CompileUnit", "answer", "=", "classNode", ".", "getCompileUnit", "(", ")", ";", "if", "(", "answer", "==", "null", ")", "{", "answer", "=", "context", ".", "getCompileUnit", "(", ")", ";", "}", "return", "answer", ";", "}", "public", "static", "boolean", "usesSuper", "(", "MethodCallExpression", "call", ")", "{", "Expression", "expression", "=", "call", ".", "getObjectExpression", "(", ")", ";", "if", "(", "expression", "instanceof", "VariableExpression", ")", "{", "VariableExpression", "varExp", "=", "(", "VariableExpression", ")", "expression", ";", "String", "variable", "=", "varExp", ".", "getName", "(", ")", ";", "return", "variable", ".", "equals", "(", "\"super\"", ")", ";", "}", "return", "false", ";", "}", "public", "static", "boolean", "usesSuper", "(", "PropertyExpression", "pe", ")", "{", "Expression", "expression", "=", "pe", ".", "getObjectExpression", "(", ")", ";", "if", "(", "expression", "instanceof", "VariableExpression", ")", "{", "VariableExpression", "varExp", "=", "(", "VariableExpression", ")", "expression", ";", "String", "variable", "=", "varExp", ".", "getName", "(", ")", ";", "return", "variable", ".", "equals", "(", "\"super\"", ")", ";", "}", "return", "false", ";", "}", "protected", "int", "getBytecodeVersion", "(", ")", "{", "if", "(", "!", "classNode", ".", "isUsingGenerics", "(", ")", "&&", "!", "classNode", ".", "isAnnotated", "(", ")", "&&", "!", "classNode", ".", "isAnnotationDefinition", "(", ")", ")", "{", "return", "Opcodes", ".", "V1_3", ";", "}", "final", "String", "target", "=", "getCompileUnit", "(", ")", ".", "getConfig", "(", ")", ".", "getTargetBytecode", "(", ")", ";", "return", "CompilerConfiguration", ".", "POST_JDK5", ".", "equals", "(", "target", ")", "?", "Opcodes", ".", "V1_5", ":", "Opcodes", ".", "V1_3", ";", "}", "private", "class", "MyMethodAdapter", "extends", "MethodAdapter", "{", "private", "String", "boxingDesc", "=", "null", ";", "public", "MyMethodAdapter", "(", ")", "{", "super", "(", "AsmClassGenerator", ".", "this", ".", "mv", ")", ";", "}", "private", "void", "dropBoxing", "(", ")", "{", "if", "(", "boxingDesc", "!=", "null", ")", "{", "super", ".", "visitMethodInsn", "(", "INVOKESTATIC", ",", "DTT", ",", "\"box\"", ",", "boxingDesc", ")", ";", "boxingDesc", "=", "null", ";", "}", "}", "public", "void", "visitInsn", "(", "int", "opcode", ")", "{", "dropBoxing", "(", ")", ";", "super", ".", "visitInsn", "(", "opcode", ")", ";", "}", "public", "void", "visitIntInsn", "(", "int", "opcode", ",", "int", "operand", ")", "{", "dropBoxing", "(", ")", ";", "super", ".", "visitIntInsn", "(", "opcode", ",", "operand", ")", ";", "}", "public", "void", "visitVarInsn", "(", "int", "opcode", ",", "int", "var", ")", "{", "dropBoxing", "(", ")", ";", "super", ".", "visitVarInsn", "(", "opcode", ",", "var", ")", ";", "}", "public", "void", "visitTypeInsn", "(", "int", "opcode", ",", "String", "desc", ")", "{", "dropBoxing", "(", ")", ";", "super", ".", "visitTypeInsn", "(", "opcode", ",", "desc", ")", ";", "}", "public", "void", "visitFieldInsn", "(", "int", "opcode", ",", "String", "owner", ",", "String", "name", ",", "String", "desc", ")", "{", "dropBoxing", "(", ")", ";", "super", ".", "visitFieldInsn", "(", "opcode", ",", "owner", ",", "name", ",", "desc", ")", ";", "}", "public", "void", "visitMethodInsn", "(", "int", "opcode", ",", "String", "owner", ",", "String", "name", ",", "String", "desc", ")", "{", "if", "(", "boxing", "(", "opcode", ",", "owner", ",", "name", ")", ")", "{", "boxingDesc", "=", "desc", ";", "dropBoxing", "(", ")", ";", "}", "else", "{", "if", "(", "unboxing", "(", "opcode", ",", "owner", ",", "name", ")", ")", "{", "if", "(", "boxingDesc", "!=", "null", ")", "boxingDesc", "=", "null", ";", "else", "super", ".", "visitMethodInsn", "(", "opcode", ",", "owner", ",", "name", ",", "desc", ")", ";", "}", "else", "{", "dropBoxing", "(", ")", ";", "super", ".", "visitMethodInsn", "(", "opcode", ",", "owner", ",", "name", ",", "desc", ")", ";", "}", "}", "}", "private", "boolean", "boxing", "(", "int", "opcode", ",", "String", "owner", ",", "String", "name", ")", "{", "return", "opcode", "==", "INVOKESTATIC", "&&", "owner", ".", "equals", "(", "DTT", ")", "&&", "name", ".", "equals", "(", "\"box\"", ")", ";", "}", "private", "boolean", "unboxing", "(", "int", "opcode", ",", "String", "owner", ",", "String", "name", ")", "{", "return", "opcode", "==", "INVOKESTATIC", "&&", "owner", ".", "equals", "(", "DTT", ")", "&&", "name", ".", "endsWith", "(", "\"Unbox\"", ")", ";", "}", "public", "void", "visitJumpInsn", "(", "int", "opcode", ",", "Label", "label", ")", "{", "dropBoxing", "(", ")", ";", "super", ".", "visitJumpInsn", "(", "opcode", ",", "label", ")", ";", "}", "public", "void", "visitLabel", "(", "Label", "label", ")", "{", "dropBoxing", "(", ")", ";", "super", ".", "visitLabel", "(", "label", ")", ";", "}", "public", "void", "visitLdcInsn", "(", "Object", "cst", ")", "{", "dropBoxing", "(", ")", ";", "super", ".", "visitLdcInsn", "(", "cst", ")", ";", "}", "public", "void", "visitIincInsn", "(", "int", "var", ",", "int", "increment", ")", "{", "dropBoxing", "(", ")", ";", "super", ".", "visitIincInsn", "(", "var", ",", "increment", ")", ";", "}", "public", "void", "visitTableSwitchInsn", "(", "int", "min", ",", "int", "max", ",", "Label", "dflt", ",", "Label", "labels", "[", "]", ")", "{", "dropBoxing", "(", ")", ";", "super", ".", "visitTableSwitchInsn", "(", "min", ",", "max", ",", "dflt", ",", "labels", ")", ";", "}", "public", "void", "visitLookupSwitchInsn", "(", "Label", "dflt", ",", "int", "keys", "[", "]", ",", "Label", "labels", "[", "]", ")", "{", "dropBoxing", "(", ")", ";", "super", ".", "visitLookupSwitchInsn", "(", "dflt", ",", "keys", ",", "labels", ")", ";", "}", "public", "void", "visitMultiANewArrayInsn", "(", "String", "desc", ",", "int", "dims", ")", "{", "dropBoxing", "(", ")", ";", "super", ".", "visitMultiANewArrayInsn", "(", "desc", ",", "dims", ")", ";", "}", "public", "void", "visitTryCatchBlock", "(", "Label", "start", ",", "Label", "end", ",", "Label", "handler", ",", "String", "type", ")", "{", "dropBoxing", "(", ")", ";", "super", ".", "visitTryCatchBlock", "(", "start", ",", "end", ",", "handler", ",", "type", ")", ";", "}", "}", "}", "</s>" ]
6,697
[ "<s>", "package", "org", ".", "codehaus", ".", "groovy", ".", "classgen", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "GroovyBugError", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "*", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "Variable", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "expr", ".", "*", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "stmt", ".", "BlockStatement", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "stmt", ".", "CatchStatement", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "stmt", ".", "ForStatement", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "stmt", ".", "Statement", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "control", ".", "SourceUnit", ";", "import", "java", ".", "util", ".", "LinkedList", ";", "import", "java", ".", "util", ".", "List", ";", "import", "java", ".", "util", ".", "Map", ";", "public", "class", "VariableScopeVisitor", "extends", "ClassCodeVisitorSupport", "{", "private", "VariableScope", "currentScope", "=", "null", ";", "private", "VariableScope", "headScope", "=", "new", "VariableScope", "(", ")", ";", "private", "ClassNode", "currentClass", "=", "null", ";", "private", "SourceUnit", "source", ";", "private", "boolean", "inClosure", "=", "false", ";", "private", "boolean", "inPropertyExpression", "=", "false", ";", "private", "boolean", "isSpecialConstructorCall", "=", "false", ";", "private", "boolean", "inConstructor", "=", "false", ";", "private", "LinkedList", "stateStack", "=", "new", "LinkedList", "(", ")", ";", "private", "class", "StateStackElement", "{", "VariableScope", "scope", ";", "ClassNode", "clazz", ";", "boolean", "closure", ";", "boolean", "inConstructor", ";", "StateStackElement", "(", ")", "{", "scope", "=", "VariableScopeVisitor", ".", "this", ".", "currentScope", ";", "clazz", "=", "VariableScopeVisitor", ".", "this", ".", "currentClass", ";", "closure", "=", "VariableScopeVisitor", ".", "this", ".", "inClosure", ";", "inConstructor", "=", "VariableScopeVisitor", ".", "this", ".", "inConstructor", ";", "}", "}", "public", "VariableScopeVisitor", "(", "SourceUnit", "source", ")", "{", "this", ".", "source", "=", "source", ";", "currentScope", "=", "headScope", ";", "}", "private", "void", "pushState", "(", "boolean", "isStatic", ")", "{", "stateStack", ".", "add", "(", "new", "StateStackElement", "(", ")", ")", ";", "currentScope", "=", "new", "VariableScope", "(", "currentScope", ")", ";", "currentScope", ".", "setInStaticContext", "(", "isStatic", ")", ";", "}", "private", "void", "pushState", "(", ")", "{", "pushState", "(", "currentScope", ".", "isInStaticContext", "(", ")", ")", ";", "}", "private", "void", "popState", "(", ")", "{", "if", "(", "inClosure", ")", "currentScope", ".", "setInStaticContext", "(", "false", ")", ";", "StateStackElement", "element", "=", "(", "StateStackElement", ")", "stateStack", ".", "removeLast", "(", ")", ";", "currentScope", "=", "element", ".", "scope", ";", "currentClass", "=", "element", ".", "clazz", ";", "inClosure", "=", "element", ".", "closure", ";", "inConstructor", "=", "element", ".", "inConstructor", ";", "}", "private", "void", "declare", "(", "Parameter", "[", "]", "parameters", ",", "ASTNode", "node", ")", "{", "for", "(", "Parameter", "parameter", ":", "parameters", ")", "{", "if", "(", "parameter", ".", "hasInitialExpression", "(", ")", ")", "{", "parameter", ".", "getInitialExpression", "(", ")", ".", "visit", "(", "this", ")", ";", "}", "declare", "(", "parameter", ",", "node", ")", ";", "}", "}", "private", "void", "declare", "(", "VariableExpression", "vex", ")", "{", "vex", ".", "setInStaticContext", "(", "currentScope", ".", "isInStaticContext", "(", ")", ")", ";", "declare", "(", "vex", ",", "vex", ")", ";", "vex", ".", "setAccessedVariable", "(", "vex", ")", ";", "}", "private", "void", "declare", "(", "Variable", "var", ",", "ASTNode", "expr", ")", "{", "String", "scopeType", "=", "\"scope\"", ";", "String", "variableType", "=", "\"variable\"", ";", "if", "(", "expr", ".", "getClass", "(", ")", "==", "FieldNode", ".", "class", ")", "{", "scopeType", "=", "\"class\"", ";", "variableType", "=", "\"field\"", ";", "}", "else", "if", "(", "expr", ".", "getClass", "(", ")", "==", "PropertyNode", ".", "class", ")", "{", "scopeType", "=", "\"class\"", ";", "variableType", "=", "\"property\"", ";", "}", "StringBuffer", "msg", "=", "new", "StringBuffer", "(", ")", ";", "msg", ".", "append", "(", "\"The", "current", "\"", ")", ".", "append", "(", "scopeType", ")", ";", "msg", ".", "append", "(", "\"\"", ")", ".", "append", "(", "variableType", ")", ";", "msg", ".", "append", "(", "\"\"", ")", ".", "append", "(", "var", ".", "getName", "(", ")", ")", ";", "if", "(", "currentScope", ".", "getDeclaredVariable", "(", "var", ".", "getName", "(", ")", ")", "!=", "null", ")", "{", "addError", "(", "msg", ".", "toString", "(", ")", ",", "expr", ")", ";", "return", ";", "}", "for", "(", "VariableScope", "scope", "=", "currentScope", ".", "getParent", "(", ")", ";", "scope", "!=", "null", ";", "scope", "=", "scope", ".", "getParent", "(", ")", ")", "{", "if", "(", "scope", ".", "getClassScope", "(", ")", "!=", "null", ")", "break", ";", "if", "(", "scope", ".", "getDeclaredVariable", "(", "var", ".", "getName", "(", ")", ")", "!=", "null", ")", "{", "addError", "(", "msg", ".", "toString", "(", ")", ",", "expr", ")", ";", "break", ";", "}", "}", "currentScope", ".", "putDeclaredVariable", "(", "var", ")", ";", "}", "protected", "SourceUnit", "getSourceUnit", "(", ")", "{", "return", "source", ";", "}", "private", "Variable", "findClassMember", "(", "ClassNode", "cn", ",", "String", "name", ")", "{", "if", "(", "cn", "==", "null", ")", "return", "null", ";", "if", "(", "cn", ".", "isScript", "(", ")", ")", "{", "return", "new", "DynamicVariable", "(", "name", ",", "false", ")", ";", "}", "for", "(", "FieldNode", "fn", ":", "cn", ".", "getFields", "(", ")", ")", "{", "if", "(", "fn", ".", "getName", "(", ")", ".", "equals", "(", "name", ")", ")", "return", "fn", ";", "}", "for", "(", "MethodNode", "mn", ":", "cn", ".", "getMethods", "(", ")", ")", "{", "String", "pName", "=", "getPropertyName", "(", "mn", ")", ";", "if", "(", "pName", "!=", "null", "&&", "pName", ".", "equals", "(", "name", ")", ")", "{", "PropertyNode", "property", "=", "new", "PropertyNode", "(", "pName", ",", "mn", ".", "getModifiers", "(", ")", ",", "getPropertyType", "(", "mn", ")", ",", "cn", ",", "null", ",", "null", ",", "null", ")", ";", "property", ".", "setDeclaringClass", "(", "cn", ")", ";", "property", ".", "getField", "(", ")", ".", "setDeclaringClass", "(", "cn", ")", ";", "return", "property", ";", "}", "}", "for", "(", "PropertyNode", "pn", ":", "cn", ".", "getProperties", "(", ")", ")", "{", "if", "(", "pn", ".", "getName", "(", ")", ".", "equals", "(", "name", ")", ")", "return", "pn", ";", "}", "Variable", "ret", "=", "findClassMember", "(", "cn", ".", "getSuperClass", "(", ")", ",", "name", ")", ";", "if", "(", "ret", "!=", "null", ")", "return", "ret", ";", "return", "findClassMember", "(", "cn", ".", "getOuterClass", "(", ")", ",", "name", ")", ";", "}", "private", "ClassNode", "getPropertyType", "(", "MethodNode", "m", ")", "{", "if", "(", "m", ".", "getReturnType", "(", ")", "!=", "ClassHelper", ".", "VOID_TYPE", ")", "{", "return", "m", ".", "getReturnType", "(", ")", ";", "}", "return", "m", ".", "getParameters", "(", ")", "[", "0", "]", ".", "getType", "(", ")", ";", "}", "private", "String", "getPropertyName", "(", "MethodNode", "m", ")", "{", "String", "name", "=", "m", ".", "getName", "(", ")", ";", "if", "(", "!", "(", "name", ".", "startsWith", "(", "\"set\"", ")", "||", "name", ".", "startsWith", "(", "\"get\"", ")", ")", ")", "return", "null", ";", "String", "pname", "=", "name", ".", "substring", "(", "3", ")", ";", "if", "(", "pname", ".", "length", "(", ")", "==", "0", ")", "return", "null", ";", "pname", "=", "java", ".", "beans", ".", "Introspector", ".", "decapitalize", "(", "pname", ")", ";", "if", "(", "name", ".", "startsWith", "(", "\"get\"", ")", "&&", "(", "m", ".", "getReturnType", "(", ")", "==", "ClassHelper", ".", "VOID_TYPE", "||", "m", ".", "getParameters", "(", ")", ".", "length", "!=", "0", ")", ")", "{", "return", "null", ";", "}", "if", "(", "name", ".", "startsWith", "(", "\"set\"", ")", "&&", "m", ".", "getParameters", "(", ")", ".", "length", "!=", "1", ")", "{", "return", "null", ";", "}", "return", "pname", ";", "}", "private", "Variable", "checkVariableNameForDeclaration", "(", "String", "name", ",", "Expression", "expression", ")", "{", "if", "(", "\"super\"", ".", "equals", "(", "name", ")", "||", "\"this\"", ".", "equals", "(", "name", ")", ")", "return", "null", ";", "VariableScope", "scope", "=", "currentScope", ";", "Variable", "var", "=", "new", "DynamicVariable", "(", "name", ",", "currentScope", ".", "isInStaticContext", "(", ")", ")", ";", "while", "(", "true", ")", "{", "Variable", "var1", ";", "var1", "=", "scope", ".", "getDeclaredVariable", "(", "var", ".", "getName", "(", ")", ")", ";", "if", "(", "var1", "!=", "null", ")", "{", "var", "=", "var1", ";", "break", ";", "}", "var1", "=", "scope", ".", "getReferencedLocalVariable", "(", "var", ".", "getName", "(", ")", ")", ";", "if", "(", "var1", "!=", "null", ")", "{", "var", "=", "var1", ";", "break", ";", "}", "var1", "=", "scope", ".", "getReferencedClassVariable", "(", "var", ".", "getName", "(", ")", ")", ";", "if", "(", "var1", "!=", "null", ")", "{", "var", "=", "var1", ";", "break", ";", "}", "ClassNode", "classScope", "=", "scope", ".", "getClassScope", "(", ")", ";", "if", "(", "classScope", "!=", "null", ")", "{", "Variable", "member", "=", "findClassMember", "(", "classScope", ",", "var", ".", "getName", "(", ")", ")", ";", "if", "(", "member", "!=", "null", ")", "{", "boolean", "staticScope", "=", "currentScope", ".", "isInStaticContext", "(", ")", "||", "isSpecialConstructorCall", ";", "boolean", "staticMember", "=", "member", ".", "isInStaticContext", "(", ")", ";", "if", "(", "!", "(", "staticScope", "&&", "!", "staticMember", ")", ")", "var", "=", "member", ";", "}", "break", ";", "}", "scope", "=", "scope", ".", "getParent", "(", ")", ";", "}", "VariableScope", "end", "=", "scope", ";", "scope", "=", "currentScope", ";", "while", "(", "scope", "!=", "end", ")", "{", "if", "(", "end", ".", "isClassScope", "(", ")", "||", "(", "end", ".", "isReferencedClassVariable", "(", "name", ")", "&&", "end", ".", "getDeclaredVariable", "(", "name", ")", "==", "null", ")", ")", "{", "scope", ".", "putReferencedClassVariable", "(", "var", ")", ";", "}", "else", "{", "var", ".", "setClosureSharedVariable", "(", "var", ".", "isClosureSharedVariable", "(", ")", "||", "inClosure", ")", ";", "scope", ".", "putReferencedLocalVariable", "(", "var", ")", ";", "}", "scope", "=", "scope", ".", "getParent", "(", ")", ";", "}", "return", "var", ";", "}", "private", "void", "checkPropertyOnExplicitThis", "(", "PropertyExpression", "pe", ")", "{", "if", "(", "!", "currentScope", ".", "isInStaticContext", "(", ")", ")", "return", ";", "Expression", "object", "=", "pe", ".", "getObjectExpression", "(", ")", ";", "if", "(", "!", "(", "object", "instanceof", "VariableExpression", ")", ")", "return", ";", "VariableExpression", "ve", "=", "(", "VariableExpression", ")", "object", ";", "if", "(", "!", "ve", ".", "getName", "(", ")", ".", "equals", "(", "\"this\"", ")", ")", "return", ";", "String", "name", "=", "pe", ".", "getPropertyAsString", "(", ")", ";", "if", "(", "name", ".", "equals", "(", "\"class\"", ")", ")", "return", ";", "if", "(", "name", "==", "null", ")", "return", ";", "Variable", "member", "=", "findClassMember", "(", "currentClass", ",", "name", ")", ";", "if", "(", "member", "==", "null", ")", "return", ";", "checkVariableContextAccess", "(", "member", ",", "pe", ")", ";", "}", "private", "void", "checkVariableContextAccess", "(", "Variable", "v", ",", "Expression", "expr", ")", "{", "if", "(", "inPropertyExpression", "||", "v", ".", "isInStaticContext", "(", ")", "||", "!", "currentScope", ".", "isInStaticContext", "(", ")", ")", "return", ";", "String", "msg", "=", "v", ".", "getName", "(", ")", "+", "\"\"", "+", "\"\"", ";", "addError", "(", "msg", ",", "expr", ")", ";", "DynamicVariable", "v2", "=", "new", "DynamicVariable", "(", "v", ".", "getName", "(", ")", ",", "currentScope", ".", "isInStaticContext", "(", ")", ")", ";", "currentScope", ".", "putDeclaredVariable", "(", "v2", ")", ";", "}", "public", "void", "visitBlockStatement", "(", "BlockStatement", "block", ")", "{", "pushState", "(", ")", ";", "block", ".", "setVariableScope", "(", "currentScope", ")", ";", "super", ".", "visitBlockStatement", "(", "block", ")", ";", "popState", "(", ")", ";", "}", "public", "void", "visitForLoop", "(", "ForStatement", "forLoop", ")", "{", "pushState", "(", ")", ";", "forLoop", ".", "setVariableScope", "(", "currentScope", ")", ";", "Parameter", "p", "=", "forLoop", ".", "getVariable", "(", ")", ";", "p", ".", "setInStaticContext", "(", "currentScope", ".", "isInStaticContext", "(", ")", ")", ";", "if", "(", "p", "!=", "ForStatement", ".", "FOR_LOOP_DUMMY", ")", "declare", "(", "p", ",", "forLoop", ")", ";", "super", ".", "visitForLoop", "(", "forLoop", ")", ";", "popState", "(", ")", ";", "}", "public", "void", "visitDeclarationExpression", "(", "DeclarationExpression", "expression", ")", "{", "expression", ".", "getRightExpression", "(", ")", ".", "visit", "(", "this", ")", ";", "if", "(", "expression", ".", "isMultipleAssignmentDeclaration", "(", ")", ")", "{", "ArgumentListExpression", "list", "=", "(", "ArgumentListExpression", ")", "expression", ".", "getLeftExpression", "(", ")", ";", "for", "(", "Expression", "e", ":", "list", ".", "getExpressions", "(", ")", ")", "{", "VariableExpression", "exp", "=", "(", "VariableExpression", ")", "e", ";", "declare", "(", "exp", ")", ";", "}", "}", "else", "{", "declare", "(", "expression", ".", "getVariableExpression", "(", ")", ")", ";", "}", "}", "public", "void", "visitVariableExpression", "(", "VariableExpression", "expression", ")", "{", "String", "name", "=", "expression", ".", "getName", "(", ")", ";", "Variable", "v", "=", "checkVariableNameForDeclaration", "(", "name", ",", "expression", ")", ";", "if", "(", "v", "==", "null", ")", "return", ";", "expression", ".", "setAccessedVariable", "(", "v", ")", ";", "checkVariableContextAccess", "(", "v", ",", "expression", ")", ";", "}", "public", "void", "visitPropertyExpression", "(", "PropertyExpression", "expression", ")", "{", "boolean", "ipe", "=", "inPropertyExpression", ";", "inPropertyExpression", "=", "true", ";", "expression", ".", "getObjectExpression", "(", ")", ".", "visit", "(", "this", ")", ";", "inPropertyExpression", "=", "false", ";", "expression", ".", "getProperty", "(", ")", ".", "visit", "(", "this", ")", ";", "checkPropertyOnExplicitThis", "(", "expression", ")", ";", "inPropertyExpression", "=", "ipe", ";", "}", "public", "void", "visitClosureExpression", "(", "ClosureExpression", "expression", ")", "{", "pushState", "(", ")", ";", "inClosure", "=", "true", ";", "expression", ".", "setVariableScope", "(", "currentScope", ")", ";", "if", "(", "expression", ".", "isParameterSpecified", "(", ")", ")", "{", "Parameter", "[", "]", "parameters", "=", "expression", ".", "getParameters", "(", ")", ";", "for", "(", "Parameter", "parameter", ":", "parameters", ")", "{", "parameter", ".", "setInStaticContext", "(", "currentScope", ".", "isInStaticContext", "(", ")", ")", ";", "if", "(", "parameter", ".", "hasInitialExpression", "(", ")", ")", "{", "parameter", ".", "getInitialExpression", "(", ")", ".", "visit", "(", "this", ")", ";", "}", "declare", "(", "parameter", ",", "expression", ")", ";", "}", "}", "else", "if", "(", "expression", ".", "getParameters", "(", ")", "!=", "null", ")", "{", "Parameter", "var", "=", "new", "Parameter", "(", "ClassHelper", ".", "OBJECT_TYPE", ",", "\"it\"", ")", ";", "var", ".", "setInStaticContext", "(", "currentScope", ".", "isInStaticContext", "(", ")", ")", ";", "currentScope", ".", "putDeclaredVariable", "(", "var", ")", ";", "}", "super", ".", "visitClosureExpression", "(", "expression", ")", ";", "popState", "(", ")", ";", "}", "public", "void", "visitCatchStatement", "(", "CatchStatement", "statement", ")", "{", "pushState", "(", ")", ";", "Parameter", "p", "=", "statement", ".", "getVariable", "(", ")", ";", "p", ".", "setInStaticContext", "(", "currentScope", ".", "isInStaticContext", "(", ")", ")", ";", "declare", "(", "p", ",", "statement", ")", ";", "super", ".", "visitCatchStatement", "(", "statement", ")", ";", "popState", "(", ")", ";", "}", "public", "void", "visitFieldExpression", "(", "FieldExpression", "expression", ")", "{", "String", "name", "=", "expression", ".", "getFieldName", "(", ")", ";", "Variable", "v", "=", "checkVariableNameForDeclaration", "(", "name", ",", "expression", ")", ";", "checkVariableContextAccess", "(", "v", ",", "expression", ")", ";", "}", "public", "void", "visitClass", "(", "ClassNode", "node", ")", "{", "if", "(", "node", "instanceof", "InnerClassNode", ")", "{", "InnerClassNode", "in", "=", "(", "InnerClassNode", ")", "node", ";", "if", "(", "in", ".", "isAnonymous", "(", ")", ")", "return", ";", "}", "pushState", "(", ")", ";", "currentClass", "=", "node", ";", "currentScope", ".", "setClassScope", "(", "node", ")", ";", "super", ".", "visitClass", "(", "node", ")", ";", "popState", "(", ")", ";", "}", "protected", "void", "visitConstructorOrMethod", "(", "MethodNode", "node", ",", "boolean", "isConstructor", ")", "{", "pushState", "(", "node", ".", "isStatic", "(", ")", ")", ";", "inConstructor", "=", "isConstructor", ";", "node", ".", "setVariableScope", "(", "currentScope", ")", ";", "Parameter", "[", "]", "parameters", "=", "node", ".", "getParameters", "(", ")", ";", "for", "(", "Parameter", "parameter", ":", "parameters", ")", "{", "visitAnnotations", "(", "parameter", ")", ";", "}", "declare", "(", "node", ".", "getParameters", "(", ")", ",", "node", ")", ";", "super", ".", "visitConstructorOrMethod", "(", "node", ",", "isConstructor", ")", ";", "popState", "(", ")", ";", "}", "public", "void", "visitMethodCallExpression", "(", "MethodCallExpression", "call", ")", "{", "if", "(", "call", ".", "isImplicitThis", "(", ")", "&&", "call", ".", "getMethod", "(", ")", "instanceof", "ConstantExpression", ")", "{", "ConstantExpression", "methodNameConstant", "=", "(", "ConstantExpression", ")", "call", ".", "getMethod", "(", ")", ";", "Object", "value", "=", "methodNameConstant", ".", "getText", "(", ")", ";", "if", "(", "!", "(", "value", "instanceof", "String", ")", ")", "{", "throw", "new", "GroovyBugError", "(", "\"\"", ")", ";", "}", "String", "methodName", "=", "(", "String", ")", "value", ";", "Variable", "v", "=", "checkVariableNameForDeclaration", "(", "methodName", ",", "call", ")", ";", "if", "(", "v", "!=", "null", "&&", "!", "(", "v", "instanceof", "DynamicVariable", ")", ")", "{", "checkVariableContextAccess", "(", "v", ",", "call", ")", ";", "}", "if", "(", "v", "instanceof", "VariableExpression", "||", "v", "instanceof", "Parameter", ")", "{", "VariableExpression", "object", "=", "new", "VariableExpression", "(", "v", ")", ";", "object", ".", "setSourcePosition", "(", "methodNameConstant", ")", ";", "call", ".", "setObjectExpression", "(", "object", ")", ";", "ConstantExpression", "method", "=", "new", "ConstantExpression", "(", "\"call\"", ")", ";", "method", ".", "setSourcePosition", "(", "methodNameConstant", ")", ";", "call", ".", "setMethod", "(", "method", ")", ";", "}", "}", "super", ".", "visitMethodCallExpression", "(", "call", ")", ";", "}", "public", "void", "visitConstructorCallExpression", "(", "ConstructorCallExpression", "call", ")", "{", "isSpecialConstructorCall", "=", "call", ".", "isSpecialCall", "(", ")", ";", "super", ".", "visitConstructorCallExpression", "(", "call", ")", ";", "isSpecialConstructorCall", "=", "false", ";", "if", "(", "!", "call", ".", "isUsingAnonymousInnerClass", "(", ")", ")", "return", ";", "pushState", "(", ")", ";", "InnerClassNode", "innerClass", "=", "(", "InnerClassNode", ")", "call", ".", "getType", "(", ")", ";", "innerClass", ".", "setVariableScope", "(", "currentScope", ")", ";", "for", "(", "MethodNode", "method", ":", "innerClass", ".", "getMethods", "(", ")", ")", "{", "Parameter", "[", "]", "parameters", "=", "method", ".", "getParameters", "(", ")", ";", "if", "(", "parameters", ".", "length", "==", "0", ")", "parameters", "=", "null", ";", "ClosureExpression", "cl", "=", "new", "ClosureExpression", "(", "parameters", ",", "method", ".", "getCode", "(", ")", ")", ";", "visitClosureExpression", "(", "cl", ")", ";", "}", "boolean", "ic", "=", "inClosure", ";", "inClosure", "=", "true", ";", "for", "(", "FieldNode", "field", ":", "innerClass", ".", "getFields", "(", ")", ")", "{", "final", "Expression", "expression", "=", "field", ".", "getInitialExpression", "(", ")", ";", "if", "(", "expression", "!=", "null", ")", "{", "expression", ".", "visit", "(", "this", ")", ";", "}", "}", "for", "(", "Statement", "statement", ":", "innerClass", ".", "getObjectInitializerStatements", "(", ")", ")", "{", "statement", ".", "visit", "(", "this", ")", ";", "}", "inClosure", "=", "ic", ";", "popState", "(", ")", ";", "}", "public", "void", "visitProperty", "(", "PropertyNode", "node", ")", "{", "pushState", "(", "node", ".", "isStatic", "(", ")", ")", ";", "super", ".", "visitProperty", "(", "node", ")", ";", "popState", "(", ")", ";", "}", "public", "void", "visitField", "(", "FieldNode", "node", ")", "{", "pushState", "(", "node", ".", "isStatic", "(", ")", ")", ";", "super", ".", "visitField", "(", "node", ")", ";", "popState", "(", ")", ";", "}", "public", "void", "visitAnnotations", "(", "AnnotatedNode", "node", ")", "{", "List", "<", "AnnotationNode", ">", "annotations", "=", "node", ".", "getAnnotations", "(", ")", ";", "if", "(", "annotations", ".", "isEmpty", "(", ")", ")", "return", ";", "ClassNode", "annType", ";", "for", "(", "AnnotationNode", "an", ":", "annotations", ")", "{", "if", "(", "an", ".", "isBuiltIn", "(", ")", ")", "continue", ";", "for", "(", "Map", ".", "Entry", "<", "String", ",", "Expression", ">", "member", ":", "an", ".", "getMembers", "(", ")", ".", "entrySet", "(", ")", ")", "{", "Expression", "annMemberValue", "=", "member", ".", "getValue", "(", ")", ";", "annMemberValue", ".", "visit", "(", "this", ")", ";", "}", "}", "}", "}", "</s>" ]
6,698
[ "<s>", "package", "org", ".", "codehaus", ".", "groovy", ".", "classgen", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "ASTNode", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "AnnotatedNode", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "AnnotationNode", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "ClassNode", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "ConstructorNode", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "FieldNode", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "GenericsType", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "GroovyClassVisitor", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "MethodNode", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "PackageNode", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "Parameter", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "PropertyNode", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "stmt", ".", "ReturnStatement", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "control", ".", "CompilerConfiguration", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "control", ".", "ErrorCollector", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "control", ".", "SourceUnit", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "control", ".", "messages", ".", "SyntaxErrorMessage", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "syntax", ".", "PreciseSyntaxException", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "syntax", ".", "SyntaxException", ";", "import", "org", ".", "objectweb", ".", "asm", ".", "Opcodes", ";", "public", "class", "ExtendedVerifier", "implements", "GroovyClassVisitor", "{", "public", "static", "final", "String", "JVM_ERROR_MESSAGE", "=", "\"\"", ";", "private", "SourceUnit", "source", ";", "private", "ClassNode", "currentClass", ";", "public", "ExtendedVerifier", "(", "SourceUnit", "sourceUnit", ")", "{", "this", ".", "source", "=", "sourceUnit", ";", "}", "public", "void", "visitClass", "(", "ClassNode", "node", ")", "{", "this", ".", "currentClass", "=", "node", ";", "if", "(", "node", ".", "isAnnotationDefinition", "(", ")", ")", "{", "visitAnnotations", "(", "node", ",", "AnnotationNode", ".", "ANNOTATION_TARGET", ")", ";", "}", "else", "{", "visitAnnotations", "(", "node", ",", "AnnotationNode", ".", "TYPE_TARGET", ")", ";", "}", "PackageNode", "packageNode", "=", "node", ".", "getPackage", "(", ")", ";", "if", "(", "packageNode", "!=", "null", ")", "{", "visitAnnotations", "(", "packageNode", ",", "AnnotationNode", ".", "PACKAGE_TARGET", ")", ";", "}", "node", ".", "visitContents", "(", "this", ")", ";", "}", "public", "void", "visitField", "(", "FieldNode", "node", ")", "{", "visitAnnotations", "(", "node", ",", "AnnotationNode", ".", "FIELD_TARGET", ")", ";", "}", "public", "void", "visitConstructor", "(", "ConstructorNode", "node", ")", "{", "visitConstructorOrMethod", "(", "node", ",", "AnnotationNode", ".", "CONSTRUCTOR_TARGET", ")", ";", "}", "public", "void", "visitMethod", "(", "MethodNode", "node", ")", "{", "visitConstructorOrMethod", "(", "node", ",", "AnnotationNode", ".", "METHOD_TARGET", ")", ";", "}", "private", "void", "visitConstructorOrMethod", "(", "MethodNode", "node", ",", "int", "methodTarget", ")", "{", "visitAnnotations", "(", "node", ",", "methodTarget", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "node", ".", "getParameters", "(", ")", ".", "length", ";", "i", "++", ")", "{", "Parameter", "parameter", "=", "node", ".", "getParameters", "(", ")", "[", "i", "]", ";", "visitAnnotations", "(", "parameter", ",", "AnnotationNode", ".", "PARAMETER_TARGET", ")", ";", "}", "if", "(", "this", ".", "currentClass", ".", "isAnnotationDefinition", "(", ")", "&&", "!", "node", ".", "isStaticConstructor", "(", ")", ")", "{", "ErrorCollector", "errorCollector", "=", "new", "ErrorCollector", "(", "this", ".", "source", ".", "getConfiguration", "(", ")", ")", ";", "AnnotationVisitor", "visitor", "=", "new", "AnnotationVisitor", "(", "this", ".", "source", ",", "errorCollector", ")", ";", "visitor", ".", "setReportClass", "(", "currentClass", ")", ";", "visitor", ".", "checkReturnType", "(", "node", ".", "getReturnType", "(", ")", ",", "node", ")", ";", "if", "(", "node", ".", "getParameters", "(", ")", ".", "length", ">", "0", ")", "{", "addError", "(", "\"\"", ",", "node", ".", "getParameters", "(", ")", "[", "0", "]", ")", ";", "}", "if", "(", "node", ".", "getExceptions", "(", ")", ".", "length", ">", "0", ")", "{", "addError", "(", "\"\"", ",", "node", ".", "getExceptions", "(", ")", "[", "0", "]", ")", ";", "}", "ReturnStatement", "code", "=", "(", "ReturnStatement", ")", "node", ".", "getCode", "(", ")", ";", "if", "(", "code", "!=", "null", ")", "{", "visitor", ".", "visitExpression", "(", "node", ".", "getName", "(", ")", ",", "code", ".", "getExpression", "(", ")", ",", "node", ".", "getReturnType", "(", ")", ")", ";", "visitor", ".", "checkCircularReference", "(", "currentClass", ",", "node", ".", "getReturnType", "(", ")", ",", "code", ".", "getExpression", "(", ")", ")", ";", "}", "this", ".", "source", ".", "getErrorCollector", "(", ")", ".", "addCollectorContents", "(", "errorCollector", ")", ";", "}", "}", "public", "void", "visitProperty", "(", "PropertyNode", "node", ")", "{", "}", "protected", "void", "visitAnnotations", "(", "AnnotatedNode", "node", ",", "int", "target", ")", "{", "if", "(", "node", ".", "getAnnotations", "(", ")", ".", "isEmpty", "(", ")", ")", "{", "return", ";", "}", "this", ".", "currentClass", ".", "setAnnotated", "(", "true", ")", ";", "if", "(", "!", "isAnnotationCompatible", "(", ")", ")", "{", "addError", "(", "\"\"", "+", "JVM_ERROR_MESSAGE", ",", "node", ")", ";", "return", ";", "}", "for", "(", "AnnotationNode", "unvisited", ":", "node", ".", "getAnnotations", "(", ")", ")", "{", "AnnotationNode", "visited", "=", "visitAnnotation", "(", "unvisited", ")", ";", "boolean", "isTargetAnnotation", "=", "visited", ".", "getClassNode", "(", ")", ".", "isResolved", "(", ")", "&&", "visited", ".", "getClassNode", "(", ")", ".", "getName", "(", ")", ".", "equals", "(", "\"\"", ")", ";", "if", "(", "!", "isTargetAnnotation", "&&", "!", "visited", ".", "isTargetAllowed", "(", "target", ")", ")", "{", "addError", "(", "\"Annotation", "@\"", "+", "visited", ".", "getClassNode", "(", ")", ".", "getName", "(", ")", "+", "\"\"", "+", "AnnotationNode", ".", "targetToName", "(", "target", ")", ",", "visited", ")", ";", "}", "visitDeprecation", "(", "node", ",", "visited", ")", ";", "}", "}", "private", "void", "visitDeprecation", "(", "AnnotatedNode", "node", ",", "AnnotationNode", "visited", ")", "{", "if", "(", "visited", ".", "getClassNode", "(", ")", ".", "isResolved", "(", ")", "&&", "visited", ".", "getClassNode", "(", ")", ".", "getName", "(", ")", ".", "equals", "(", "\"\"", ")", ")", "{", "if", "(", "node", "instanceof", "MethodNode", ")", "{", "MethodNode", "mn", "=", "(", "MethodNode", ")", "node", ";", "mn", ".", "setModifiers", "(", "mn", ".", "getModifiers", "(", ")", "|", "Opcodes", ".", "ACC_DEPRECATED", ")", ";", "}", "else", "if", "(", "node", "instanceof", "FieldNode", ")", "{", "FieldNode", "fn", "=", "(", "FieldNode", ")", "node", ";", "fn", ".", "setModifiers", "(", "fn", ".", "getModifiers", "(", ")", "|", "Opcodes", ".", "ACC_DEPRECATED", ")", ";", "}", "else", "if", "(", "node", "instanceof", "ClassNode", ")", "{", "ClassNode", "cn", "=", "(", "ClassNode", ")", "node", ";", "cn", ".", "setModifiers", "(", "cn", ".", "getModifiers", "(", ")", "|", "Opcodes", ".", "ACC_DEPRECATED", ")", ";", "}", "}", "}", "private", "AnnotationNode", "visitAnnotation", "(", "AnnotationNode", "unvisited", ")", "{", "ErrorCollector", "errorCollector", "=", "new", "ErrorCollector", "(", "this", ".", "source", ".", "getConfiguration", "(", ")", ")", ";", "AnnotationVisitor", "visitor", "=", "new", "AnnotationVisitor", "(", "this", ".", "source", ",", "errorCollector", ")", ";", "AnnotationNode", "visited", "=", "visitor", ".", "visit", "(", "unvisited", ")", ";", "this", ".", "source", ".", "getErrorCollector", "(", ")", ".", "addCollectorContents", "(", "errorCollector", ")", ";", "return", "visited", ";", "}", "protected", "boolean", "isAnnotationCompatible", "(", ")", "{", "return", "CompilerConfiguration", ".", "POST_JDK5", ".", "equals", "(", "this", ".", "source", ".", "getConfiguration", "(", ")", ".", "getTargetBytecode", "(", ")", ")", ";", "}", "protected", "void", "addError", "(", "String", "msg", ",", "ASTNode", "expr", ")", "{", "if", "(", "expr", "instanceof", "AnnotationNode", ")", "{", "AnnotationNode", "aNode", "=", "(", "AnnotationNode", ")", "expr", ";", "this", ".", "source", ".", "getErrorCollector", "(", ")", ".", "addErrorAndContinue", "(", "new", "SyntaxErrorMessage", "(", "new", "PreciseSyntaxException", "(", "msg", "+", "'\\n'", ",", "expr", ".", "getLineNumber", "(", ")", ",", "expr", ".", "getColumnNumber", "(", ")", ",", "aNode", ".", "getStart", "(", ")", ",", "aNode", ".", "getEnd", "(", ")", ")", ",", "this", ".", "source", ")", ")", ";", "}", "else", "{", "this", ".", "source", ".", "getErrorCollector", "(", ")", ".", "addErrorAndContinue", "(", "new", "SyntaxErrorMessage", "(", "new", "SyntaxException", "(", "msg", "+", "'\\n'", ",", "expr", ".", "getLineNumber", "(", ")", ",", "expr", ".", "getColumnNumber", "(", ")", ")", ",", "this", ".", "source", ")", ")", ";", "}", "}", "public", "void", "visitGenericType", "(", "GenericsType", "genericsType", ")", "{", "}", "}", "</s>" ]
6,699
[ "<s>", "package", "org", ".", "codehaus", ".", "groovy", ".", "classgen", ";", "import", "groovy", ".", "lang", ".", "GroovyClassLoader", ";", "import", "groovy", ".", "lang", ".", "GroovyObject", ";", "import", "groovy", ".", "lang", ".", "GroovyObjectSupport", ";", "import", "groovy", ".", "lang", ".", "MetaClass", ";", "import", "java", ".", "lang", ".", "reflect", ".", "Field", ";", "import", "java", ".", "lang", ".", "reflect", ".", "Modifier", ";", "import", "java", ".", "util", ".", "ArrayList", ";", "import", "java", ".", "util", ".", "Arrays", ";", "import", "java", ".", "util", ".", "Collection", ";", "import", "java", ".", "util", ".", "Collections", ";", "import", "java", ".", "util", ".", "HashMap", ";", "import", "java", ".", "util", ".", "HashSet", ";", "import", "java", ".", "util", ".", "Iterator", ";", "import", "java", ".", "util", ".", "List", ";", "import", "java", ".", "util", ".", "Map", ";", "import", "java", ".", "util", ".", "Set", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "ClassHelper", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "ClassNode", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "CodeVisitorSupport", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "ConstructorNode", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "FieldNode", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "GenericsType", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "GroovyClassVisitor", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "InnerClassNode", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "MethodNode", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "Parameter", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "PropertyNode", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "VariableScope", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "expr", ".", "ArgumentListExpression", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "expr", ".", "BinaryExpression", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "expr", ".", "CastExpression", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "expr", ".", "ClosureExpression", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "expr", ".", "ConstantExpression", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "expr", ".", "ConstructorCallExpression", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "expr", ".", "Expression", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "expr", ".", "FieldExpression", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "expr", ".", "MethodCallExpression", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "expr", ".", "VariableExpression", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "stmt", ".", "BlockStatement", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "stmt", ".", "ExpressionStatement", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "stmt", ".", "ReturnStatement", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "stmt", ".", "Statement", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "reflection", ".", "ClassInfo", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "runtime", ".", "MetaClassHelper", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "syntax", ".", "RuntimeParserException", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "syntax", ".", "Token", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "syntax", ".", "Types", ";", "import", "org", ".", "objectweb", ".", "asm", ".", "Label", ";", "import", "org", ".", "objectweb", ".", "asm", ".", "MethodVisitor", ";", "import", "org", ".", "objectweb", ".", "asm", ".", "Opcodes", ";", "public", "class", "Verifier", "implements", "GroovyClassVisitor", ",", "Opcodes", "{", "public", "static", "final", "String", "SWAP_INIT", "=", "\"__$swapInit\"", ";", "public", "static", "final", "String", "__TIMESTAMP", "=", "\"__timeStamp\"", ";", "public", "static", "final", "String", "__TIMESTAMP__", "=", "\"\"", ";", "private", "static", "final", "Parameter", "[", "]", "INVOKE_METHOD_PARAMS", "=", "new", "Parameter", "[", "]", "{", "new", "Parameter", "(", "ClassHelper", ".", "STRING_TYPE", ",", "\"method\"", ")", ",", "new", "Parameter", "(", "ClassHelper", ".", "OBJECT_TYPE", ",", "\"arguments\"", ")", "}", ";", "private", "static", "final", "Parameter", "[", "]", "SET_PROPERTY_PARAMS", "=", "new", "Parameter", "[", "]", "{", "new", "Parameter", "(", "ClassHelper", ".", "STRING_TYPE", ",", "\"property\"", ")", ",", "new", "Parameter", "(", "ClassHelper", ".", "OBJECT_TYPE", ",", "\"value\"", ")", "}", ";", "private", "static", "final", "Parameter", "[", "]", "GET_PROPERTY_PARAMS", "=", "new", "Parameter", "[", "]", "{", "new", "Parameter", "(", "ClassHelper", ".", "STRING_TYPE", ",", "\"property\"", ")", "}", ";", "private", "static", "final", "Parameter", "[", "]", "SET_METACLASS_PARAMS", "=", "new", "Parameter", "[", "]", "{", "new", "Parameter", "(", "ClassHelper", ".", "METACLASS_TYPE", ",", "\"mc\"", ")", "}", ";", "private", "ClassNode", "classNode", ";", "private", "MethodNode", "methodNode", ";", "public", "boolean", "inlineStaticFieldInitializersIntoClinit", "=", "true", ";", "public", "ClassNode", "getClassNode", "(", ")", "{", "return", "classNode", ";", "}", "public", "MethodNode", "getMethodNode", "(", ")", "{", "return", "methodNode", ";", "}", "private", "FieldNode", "setMetaClassFieldIfNotExists", "(", "ClassNode", "node", ",", "FieldNode", "metaClassField", ")", "{", "if", "(", "metaClassField", "!=", "null", ")", "return", "metaClassField", ";", "final", "String", "classInternalName", "=", "BytecodeHelper", ".", "getClassInternalName", "(", "node", ")", ";", "metaClassField", "=", "node", ".", "addField", "(", "\"metaClass\"", ",", "ACC_PRIVATE", "|", "ACC_TRANSIENT", "|", "ACC_SYNTHETIC", ",", "ClassHelper", ".", "METACLASS_TYPE", ",", "new", "BytecodeExpression", "(", ")", "{", "public", "void", "visit", "(", "MethodVisitor", "mv", ")", "{", "mv", ".", "visitVarInsn", "(", "ALOAD", ",", "0", ")", ";", "mv", ".", "visitMethodInsn", "(", "INVOKEVIRTUAL", ",", "classInternalName", ",", "\"\"", ",", "\"\"", ")", ";", "}", "public", "ClassNode", "getType", "(", ")", "{", "return", "ClassHelper", ".", "METACLASS_TYPE", ";", "}", "}", ")", ";", "metaClassField", ".", "setSynthetic", "(", "true", ")", ";", "return", "metaClassField", ";", "}", "private", "FieldNode", "getMetaClassField", "(", "ClassNode", "node", ")", "{", "FieldNode", "ret", "=", "node", ".", "getDeclaredField", "(", "\"metaClass\"", ")", ";", "if", "(", "ret", "!=", "null", ")", "{", "ClassNode", "mcFieldType", "=", "ret", ".", "getType", "(", ")", ";", "if", "(", "!", "mcFieldType", ".", "equals", "(", "ClassHelper", ".", "METACLASS_TYPE", ")", ")", "{", "throw", "new", "RuntimeParserException", "(", "\"The", "class", "\"", "+", "node", ".", "getName", "(", ")", "+", "\"\"", "+", "mcFieldType", ".", "getName", "(", ")", "+", "\"\"", "+", "\"the", "type", "\"", "+", "ClassHelper", ".", "METACLASS_TYPE", ".", "getName", "(", ")", "+", "\"\"", ",", "ret", ")", ";", "}", "return", "ret", ";", "}", "ClassNode", "current", "=", "node", ".", "getSuperClass", "(", ")", ";", "while", "(", "current", "!=", "null", "&&", "!", "current", ".", "equals", "(", "ClassHelper", ".", "OBJECT_TYPE", ")", ")", "{", "ret", "=", "current", ".", "getDeclaredField", "(", "\"metaClass\"", ")", ";", "if", "(", "ret", "!=", "null", "&&", "!", "Modifier", ".", "isPrivate", "(", "ret", ".", "getModifiers", "(", ")", ")", ")", "return", "ret", ";", "current", "=", "current", ".", "getSuperClass", "(", ")", ";", "}", "return", "null", ";", "}", "public", "void", "visitClass", "(", "final", "ClassNode", "node", ")", "{", "this", ".", "classNode", "=", "node", ";", "if", "(", "(", "classNode", ".", "getModifiers", "(", ")", "&", "Opcodes", ".", "ACC_INTERFACE", ")", ">", "0", ")", "{", "ConstructorNode", "dummy", "=", "new", "ConstructorNode", "(", "0", ",", "null", ")", ";", "addInitialization", "(", "node", ",", "dummy", ")", ";", "node", ".", "visitContents", "(", "this", ")", ";", "return", ";", "}", "ClassNode", "[", "]", "classNodes", "=", "classNode", ".", "getInterfaces", "(", ")", ";", "List", "interfaces", "=", "new", "ArrayList", "(", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "classNodes", ".", "length", ";", "i", "++", ")", "{", "ClassNode", "classNode", "=", "classNodes", "[", "i", "]", ";", "interfaces", ".", "add", "(", "classNode", ".", "getName", "(", ")", ")", ";", "}", "Set", "interfaceSet", "=", "new", "HashSet", "(", "interfaces", ")", ";", "if", "(", "interfaceSet", ".", "size", "(", ")", "!=", "interfaces", ".", "size", "(", ")", ")", "{", "throw", "new", "RuntimeParserException", "(", "\"\"", "+", "interfaces", ",", "classNode", ")", ";", "}", "addDefaultParameterMethods", "(", "node", ")", ";", "addDefaultParameterConstructors", "(", "node", ")", ";", "final", "String", "classInternalName", "=", "BytecodeHelper", ".", "getClassInternalName", "(", "node", ")", ";", "addStaticMetaClassField", "(", "node", ",", "classInternalName", ")", ";", "boolean", "knownSpecialCase", "=", "node", ".", "isDerivedFrom", "(", "ClassHelper", ".", "GSTRING_TYPE", ")", "||", "node", ".", "isDerivedFrom", "(", "ClassHelper", ".", "make", "(", "GroovyObjectSupport", ".", "class", ")", ")", ";", "if", "(", "!", "knownSpecialCase", ")", "addGroovyObjectInterfaceAndMethods", "(", "node", ",", "classInternalName", ")", ";", "addDefaultConstructor", "(", "node", ")", ";", "if", "(", "!", "(", "node", "instanceof", "InnerClassNode", ")", ")", "addTimeStamp", "(", "node", ")", ";", "addInitialization", "(", "node", ")", ";", "checkReturnInObjectInitializer", "(", "node", ".", "getObjectInitializerStatements", "(", ")", ")", ";", "node", ".", "getObjectInitializerStatements", "(", ")", ".", "clear", "(", ")", ";", "addCovariantMethods", "(", "node", ")", ";", "node", ".", "visitContents", "(", "this", ")", ";", "}", "private", "void", "addDefaultConstructor", "(", "ClassNode", "node", ")", "{", "if", "(", "!", "node", ".", "getDeclaredConstructors", "(", ")", ".", "isEmpty", "(", ")", ")", "return", ";", "BlockStatement", "empty", "=", "new", "BlockStatement", "(", ")", ";", "ConstructorNode", "constructor", "=", "new", "ConstructorNode", "(", "ACC_PUBLIC", ",", "empty", ")", ";", "constructor", ".", "setHasNoRealSourcePosition", "(", "true", ")", ";", "node", ".", "addConstructor", "(", "constructor", ")", ";", "}", "private", "void", "addStaticMetaClassField", "(", "ClassNode", "node", ",", "final", "String", "classInternalName", ")", "{", "String", "_staticClassInfoFieldName", "=", "\"\"", ";", "while", "(", "node", ".", "getDeclaredField", "(", "_staticClassInfoFieldName", ")", "!=", "null", ")", "_staticClassInfoFieldName", "=", "_staticClassInfoFieldName", "+", "\"$\"", ";", "final", "String", "staticMetaClassFieldName", "=", "_staticClassInfoFieldName", ";", "FieldNode", "staticMetaClassField", "=", "node", ".", "addField", "(", "staticMetaClassFieldName", ",", "ACC_PRIVATE", "|", "ACC_STATIC", "|", "ACC_SYNTHETIC", ",", "ClassHelper", ".", "make", "(", "ClassInfo", ".", "class", ",", "false", ")", ",", "null", ")", ";", "staticMetaClassField", ".", "setSynthetic", "(", "true", ")", ";", "node", ".", "addSyntheticMethod", "(", "\"\"", ",", "ACC_PROTECTED", ",", "ClassHelper", ".", "make", "(", "MetaClass", ".", "class", ")", ",", "Parameter", ".", "EMPTY_ARRAY", ",", "ClassNode", ".", "EMPTY_ARRAY", ",", "new", "BytecodeSequence", "(", "new", "BytecodeInstruction", "(", ")", "{", "public", "void", "visit", "(", "MethodVisitor", "mv", ")", "{", "mv", ".", "visitVarInsn", "(", "ALOAD", ",", "0", ")", ";", "mv", ".", "visitMethodInsn", "(", "INVOKEVIRTUAL", ",", "\"\"", ",", "\"getClass\"", ",", "\"\"", ")", ";", "mv", ".", "visitMethodInsn", "(", "INVOKESTATIC", ",", "classInternalName", ",", "\"$get$$class$\"", "+", "classInternalName", ".", "replaceAll", "(", "\"\\\\/\"", ",", "\"\\\\$\"", ")", ",", "\"\"", ")", ";", "Label", "l1", "=", "new", "Label", "(", ")", ";", "mv", ".", "visitJumpInsn", "(", "IF_ACMPNE", ",", "l1", ")", ";", "mv", ".", "visitVarInsn", "(", "ALOAD", ",", "0", ")", ";", "mv", ".", "visitMethodInsn", "(", "INVOKESTATIC", ",", "\"\"", ",", "\"\"", ",", "\"\"", ")", ";", "mv", ".", "visitInsn", "(", "ARETURN", ")", ";", "mv", ".", "visitLabel", "(", "l1", ")", ";", "mv", ".", "visitFieldInsn", "(", "GETSTATIC", ",", "classInternalName", ",", "staticMetaClassFieldName", ",", "\"\"", ")", ";", "mv", ".", "visitVarInsn", "(", "ASTORE", ",", "1", ")", ";", "mv", ".", "visitVarInsn", "(", "ALOAD", ",", "1", ")", ";", "Label", "l0", "=", "new", "Label", "(", ")", ";", "mv", ".", "visitJumpInsn", "(", "IFNONNULL", ",", "l0", ")", ";", "mv", ".", "visitVarInsn", "(", "ALOAD", ",", "0", ")", ";", "mv", ".", "visitMethodInsn", "(", "INVOKEVIRTUAL", ",", "\"\"", ",", "\"getClass\"", ",", "\"\"", ")", ";", "mv", ".", "visitMethodInsn", "(", "INVOKESTATIC", ",", "\"\"", ",", "\"getClassInfo\"", ",", "\"\"", ")", ";", "mv", ".", "visitInsn", "(", "DUP", ")", ";", "mv", ".", "visitVarInsn", "(", "ASTORE", ",", "1", ")", ";", "mv", ".", "visitFieldInsn", "(", "PUTSTATIC", ",", "classInternalName", ",", "staticMetaClassFieldName", ",", "\"\"", ")", ";", "mv", ".", "visitLabel", "(", "l0", ")", ";", "mv", ".", "visitVarInsn", "(", "ALOAD", ",", "1", ")", ";", "mv", ".", "visitMethodInsn", "(", "INVOKEVIRTUAL", ",", "\"\"", ",", "\"getMetaClass\"", ",", "\"\"", ")", ";", "mv", ".", "visitInsn", "(", "ARETURN", ")", ";", "}", "}", ")", ")", ";", "}", "protected", "void", "addGroovyObjectInterfaceAndMethods", "(", "ClassNode", "node", ",", "final", "String", "classInternalName", ")", "{", "if", "(", "!", "node", ".", "isDerivedFromGroovyObject", "(", ")", ")", "node", ".", "addInterface", "(", "ClassHelper", ".", "make", "(", "GroovyObject", ".", "class", ")", ")", ";", "FieldNode", "metaClassField", "=", "getMetaClassField", "(", "node", ")", ";", "if", "(", "!", "node", ".", "hasMethod", "(", "\"getMetaClass\"", ",", "Parameter", ".", "EMPTY_ARRAY", ")", ")", "{", "metaClassField", "=", "setMetaClassFieldIfNotExists", "(", "node", ",", "metaClassField", ")", ";", "addMethod", "(", "node", ",", "!", "Modifier", ".", "isAbstract", "(", "node", ".", "getModifiers", "(", ")", ")", ",", "\"getMetaClass\"", ",", "ACC_PUBLIC", ",", "ClassHelper", ".", "METACLASS_TYPE", ",", "Parameter", ".", "EMPTY_ARRAY", ",", "ClassNode", ".", "EMPTY_ARRAY", ",", "new", "BytecodeSequence", "(", "new", "BytecodeInstruction", "(", ")", "{", "public", "void", "visit", "(", "MethodVisitor", "mv", ")", "{", "Label", "nullLabel", "=", "new", "Label", "(", ")", ";", "mv", ".", "visitVarInsn", "(", "ALOAD", ",", "0", ")", ";", "mv", ".", "visitFieldInsn", "(", "GETFIELD", ",", "classInternalName", ",", "\"metaClass\"", ",", "\"\"", ")", ";", "mv", ".", "visitInsn", "(", "DUP", ")", ";", "mv", ".", "visitJumpInsn", "(", "IFNULL", ",", "nullLabel", ")", ";", "mv", ".", "visitInsn", "(", "ARETURN", ")", ";", "mv", ".", "visitLabel", "(", "nullLabel", ")", ";", "mv", ".", "visitInsn", "(", "POP", ")", ";", "mv", ".", "visitVarInsn", "(", "ALOAD", ",", "0", ")", ";", "mv", ".", "visitInsn", "(", "DUP", ")", ";", "mv", ".", "visitMethodInsn", "(", "INVOKEVIRTUAL", ",", "classInternalName", ",", "\"\"", ",", "\"\"", ")", ";", "mv", ".", "visitFieldInsn", "(", "PUTFIELD", ",", "classInternalName", ",", "\"metaClass\"", ",", "\"\"", ")", ";", "mv", ".", "visitVarInsn", "(", "ALOAD", ",", "0", ")", ";", "mv", ".", "visitFieldInsn", "(", "GETFIELD", ",", "classInternalName", ",", "\"metaClass\"", ",", "\"\"", ")", ";", "mv", ".", "visitInsn", "(", "ARETURN", ")", ";", "}", "}", ")", ")", ";", "}", "Parameter", "[", "]", "parameters", "=", "new", "Parameter", "[", "]", "{", "new", "Parameter", "(", "ClassHelper", ".", "METACLASS_TYPE", ",", "\"mc\"", ")", "}", ";", "if", "(", "!", "node", ".", "hasMethod", "(", "\"setMetaClass\"", ",", "parameters", ")", ")", "{", "metaClassField", "=", "setMetaClassFieldIfNotExists", "(", "node", ",", "metaClassField", ")", ";", "Statement", "setMetaClassCode", ";", "if", "(", "Modifier", ".", "isFinal", "(", "metaClassField", ".", "getModifiers", "(", ")", ")", ")", "{", "ConstantExpression", "text", "=", "new", "ConstantExpression", "(", "\"\"", ")", ";", "ConstructorCallExpression", "cce", "=", "new", "ConstructorCallExpression", "(", "ClassHelper", ".", "make", "(", "IllegalArgumentException", ".", "class", ")", ",", "text", ")", ";", "setMetaClassCode", "=", "new", "ExpressionStatement", "(", "cce", ")", ";", "}", "else", "{", "List", "list", "=", "new", "ArrayList", "(", ")", ";", "list", ".", "add", "(", "new", "BytecodeInstruction", "(", ")", "{", "public", "void", "visit", "(", "MethodVisitor", "mv", ")", "{", "mv", ".", "visitVarInsn", "(", "ALOAD", ",", "0", ")", ";", "mv", ".", "visitVarInsn", "(", "ALOAD", ",", "1", ")", ";", "mv", ".", "visitFieldInsn", "(", "PUTFIELD", ",", "classInternalName", ",", "\"metaClass\"", ",", "\"\"", ")", ";", "mv", ".", "visitInsn", "(", "RETURN", ")", ";", "}", "}", ")", ";", "setMetaClassCode", "=", "new", "BytecodeSequence", "(", "list", ")", ";", "}", "addMethod", "(", "node", ",", "!", "Modifier", ".", "isAbstract", "(", "node", ".", "getModifiers", "(", ")", ")", ",", "\"setMetaClass\"", ",", "ACC_PUBLIC", ",", "ClassHelper", ".", "VOID_TYPE", ",", "SET_METACLASS_PARAMS", ",", "ClassNode", ".", "EMPTY_ARRAY", ",", "setMetaClassCode", ")", ";", "}", "if", "(", "!", "node", ".", "hasMethod", "(", "\"invokeMethod\"", ",", "INVOKE_METHOD_PARAMS", ")", ")", "{", "VariableExpression", "vMethods", "=", "new", "VariableExpression", "(", "\"method\"", ")", ";", "VariableExpression", "vArguments", "=", "new", "VariableExpression", "(", "\"arguments\"", ")", ";", "VariableScope", "blockScope", "=", "new", "VariableScope", "(", ")", ";", "blockScope", ".", "putReferencedLocalVariable", "(", "vMethods", ")", ";", "blockScope", ".", "putReferencedLocalVariable", "(", "vArguments", ")", ";", "addMethod", "(", "node", ",", "!", "Modifier", ".", "isAbstract", "(", "node", ".", "getModifiers", "(", ")", ")", ",", "\"invokeMethod\"", ",", "ACC_PUBLIC", ",", "ClassHelper", ".", "OBJECT_TYPE", ",", "INVOKE_METHOD_PARAMS", ",", "ClassNode", ".", "EMPTY_ARRAY", ",", "new", "BytecodeSequence", "(", "new", "BytecodeInstruction", "(", ")", "{", "public", "void", "visit", "(", "MethodVisitor", "mv", ")", "{", "mv", ".", "visitVarInsn", "(", "ALOAD", ",", "0", ")", ";", "mv", ".", "visitMethodInsn", "(", "INVOKEVIRTUAL", ",", "classInternalName", ",", "\"getMetaClass\"", ",", "\"\"", ")", ";", "mv", ".", "visitVarInsn", "(", "ALOAD", ",", "0", ")", ";", "mv", ".", "visitVarInsn", "(", "ALOAD", ",", "1", ")", ";", "mv", ".", "visitVarInsn", "(", "ALOAD", ",", "2", ")", ";", "mv", ".", "visitMethodInsn", "(", "INVOKEINTERFACE", ",", "\"\"", ",", "\"invokeMethod\"", ",", "\"\"", ")", ";", "mv", ".", "visitInsn", "(", "ARETURN", ")", ";", "}", "}", ")", ")", ";", "}", "if", "(", "!", "node", ".", "hasMethod", "(", "\"getProperty\"", ",", "GET_PROPERTY_PARAMS", ")", ")", "{", "addMethod", "(", "node", ",", "!", "Modifier", ".", "isAbstract", "(", "node", ".", "getModifiers", "(", ")", ")", ",", "\"getProperty\"", ",", "ACC_PUBLIC", ",", "ClassHelper", ".", "OBJECT_TYPE", ",", "GET_PROPERTY_PARAMS", ",", "ClassNode", ".", "EMPTY_ARRAY", ",", "new", "BytecodeSequence", "(", "new", "BytecodeInstruction", "(", ")", "{", "public", "void", "visit", "(", "MethodVisitor", "mv", ")", "{", "mv", ".", "visitVarInsn", "(", "ALOAD", ",", "0", ")", ";", "mv", ".", "visitMethodInsn", "(", "INVOKEVIRTUAL", ",", "classInternalName", ",", "\"getMetaClass\"", ",", "\"\"", ")", ";", "mv", ".", "visitVarInsn", "(", "ALOAD", ",", "0", ")", ";", "mv", ".", "visitVarInsn", "(", "ALOAD", ",", "1", ")", ";", "mv", ".", "visitMethodInsn", "(", "INVOKEINTERFACE", ",", "\"\"", ",", "\"getProperty\"", ",", "\"\"", ")", ";", "mv", ".", "visitInsn", "(", "ARETURN", ")", ";", "}", "}", ")", ")", ";", "}", "if", "(", "!", "node", ".", "hasMethod", "(", "\"setProperty\"", ",", "SET_PROPERTY_PARAMS", ")", ")", "{", "addMethod", "(", "node", ",", "!", "Modifier", ".", "isAbstract", "(", "node", ".", "getModifiers", "(", ")", ")", ",", "\"setProperty\"", ",", "ACC_PUBLIC", ",", "ClassHelper", ".", "VOID_TYPE", ",", "SET_PROPERTY_PARAMS", ",", "ClassNode", ".", "EMPTY_ARRAY", ",", "new", "BytecodeSequence", "(", "new", "BytecodeInstruction", "(", ")", "{", "public", "void", "visit", "(", "MethodVisitor", "mv", ")", "{", "mv", ".", "visitVarInsn", "(", "ALOAD", ",", "0", ")", ";", "mv", ".", "visitMethodInsn", "(", "INVOKEVIRTUAL", ",", "classInternalName", ",", "\"getMetaClass\"", ",", "\"\"", ")", ";", "mv", ".", "visitVarInsn", "(", "ALOAD", ",", "0", ")", ";", "mv", ".", "visitVarInsn", "(", "ALOAD", ",", "1", ")", ";", "mv", ".", "visitVarInsn", "(", "ALOAD", ",", "2", ")", ";", "mv", ".", "visitMethodInsn", "(", "INVOKEINTERFACE", ",", "\"\"", ",", "\"setProperty\"", ",", "\"\"", ")", ";", "mv", ".", "visitInsn", "(", "RETURN", ")", ";", "}", "}", ")", ")", ";", "}", "}", "protected", "void", "addMethod", "(", "ClassNode", "node", ",", "boolean", "shouldBeSynthetic", ",", "String", "name", ",", "int", "modifiers", ",", "ClassNode", "returnType", ",", "Parameter", "[", "]", "parameters", ",", "ClassNode", "[", "]", "exceptions", ",", "Statement", "code", ")", "{", "if", "(", "shouldBeSynthetic", ")", "{", "node", ".", "addSyntheticMethod", "(", "name", ",", "modifiers", ",", "returnType", ",", "parameters", ",", "exceptions", ",", "code", ")", ";", "}", "else", "{", "node", ".", "addMethod", "(", "name", ",", "modifiers", "&", "~", "ACC_SYNTHETIC", ",", "returnType", ",", "parameters", ",", "exceptions", ",", "code", ")", ";", "}", "}", "protected", "void", "addTimeStamp", "(", "ClassNode", "node", ")", "{", "if", "(", "node", ".", "getDeclaredField", "(", "Verifier", ".", "__TIMESTAMP", ")", "==", "null", ")", "{", "}", "}", "private", "void", "checkReturnInObjectInitializer", "(", "List", "init", ")", "{", "CodeVisitorSupport", "cvs", "=", "new", "CodeVisitorSupport", "(", ")", "{", "public", "void", "visitReturnStatement", "(", "ReturnStatement", "statement", ")", "{", "throw", "new", "RuntimeParserException", "(", "\"\"", ",", "statement", ")", ";", "}", "@", "Override", "public", "void", "visitClosureExpression", "(", "ClosureExpression", "expression", ")", "{", "}", "}", ";", "for", "(", "Iterator", "iterator", "=", "init", ".", "iterator", "(", ")", ";", "iterator", ".", "hasNext", "(", ")", ";", ")", "{", "Statement", "stm", "=", "(", "Statement", ")", "iterator", ".", "next", "(", ")", ";", "stm", ".", "visit", "(", "cvs", ")", ";", "}", "}", "public", "void", "visitConstructor", "(", "ConstructorNode", "node", ")", "{", "CodeVisitorSupport", "checkSuper", "=", "new", "CodeVisitorSupport", "(", ")", "{", "boolean", "firstMethodCall", "=", "true", ";", "String", "type", "=", "null", ";", "public", "void", "visitMethodCallExpression", "(", "MethodCallExpression", "call", ")", "{", "if", "(", "!", "firstMethodCall", ")", "return", ";", "firstMethodCall", "=", "false", ";", "String", "name", "=", "call", ".", "getMethodAsString", "(", ")", ";", "if", "(", "name", "==", "null", ")", "return", ";", "if", "(", "!", "name", ".", "equals", "(", "\"super\"", ")", "&&", "!", "name", ".", "equals", "(", "\"this\"", ")", ")", "return", ";", "type", "=", "name", ";", "call", ".", "getArguments", "(", ")", ".", "visit", "(", "this", ")", ";", "type", "=", "null", ";", "}", "public", "void", "visitConstructorCallExpression", "(", "ConstructorCallExpression", "call", ")", "{", "if", "(", "!", "call", ".", "isSpecialCall", "(", ")", ")", "return", ";", "type", "=", "call", ".", "getText", "(", ")", ";", "call", ".", "getArguments", "(", ")", ".", "visit", "(", "this", ")", ";", "type", "=", "null", ";", "}", "public", "void", "visitVariableExpression", "(", "VariableExpression", "expression", ")", "{", "if", "(", "type", "==", "null", ")", "return", ";", "String", "name", "=", "expression", ".", "getName", "(", ")", ";", "if", "(", "!", "name", ".", "equals", "(", "\"this\"", ")", "&&", "!", "name", ".", "equals", "(", "\"super\"", ")", ")", "return", ";", "throw", "new", "RuntimeParserException", "(", "\"\"", "+", "name", "+", "\"", "inside", "of", "\"", "+", "type", "+", "\"\"", ",", "expression", ")", ";", "}", "}", ";", "Statement", "s", "=", "node", ".", "getCode", "(", ")", ";", "if", "(", "s", "==", "null", ")", "{", "return", ";", "}", "else", "{", "s", ".", "visit", "(", "new", "VerifierCodeVisitor", "(", "this", ")", ")", ";", "}", "s", ".", "visit", "(", "checkSuper", ")", ";", "}", "public", "void", "visitMethod", "(", "MethodNode", "node", ")", "{", "if", "(", "AsmClassGenerator", ".", "isMopMethod", "(", "node", ".", "getName", "(", ")", ")", ")", "{", "throw", "new", "RuntimeParserException", "(", "\"\"", "+", "classNode", ".", "getName", "(", ")", "+", "\"(\"", "+", "node", ".", "getName", "(", ")", "+", "\")\"", ",", "classNode", ")", ";", "}", "this", ".", "methodNode", "=", "node", ";", "adjustTypesIfStaticMainMethod", "(", "node", ")", ";", "addReturnIfNeeded", "(", "node", ")", ";", "Statement", "statement", ";", "statement", "=", "node", ".", "getCode", "(", ")", ";", "if", "(", "statement", "!=", "null", ")", "statement", ".", "visit", "(", "new", "VerifierCodeVisitor", "(", "this", ")", ")", ";", "}", "private", "void", "adjustTypesIfStaticMainMethod", "(", "MethodNode", "node", ")", "{", "if", "(", "node", ".", "getName", "(", ")", ".", "equals", "(", "\"main\"", ")", "&&", "node", ".", "isStatic", "(", ")", ")", "{", "Parameter", "[", "]", "params", "=", "node", ".", "getParameters", "(", ")", ";", "if", "(", "params", ".", "length", "==", "1", ")", "{", "Parameter", "param", "=", "params", "[", "0", "]", ";", "if", "(", "param", ".", "getType", "(", ")", "==", "null", "||", "param", ".", "getType", "(", ")", "==", "ClassHelper", ".", "OBJECT_TYPE", ")", "{", "param", ".", "setType", "(", "ClassHelper", ".", "STRING_TYPE", ".", "makeArray", "(", ")", ")", ";", "ClassNode", "returnType", "=", "node", ".", "getReturnType", "(", ")", ";", "if", "(", "returnType", "==", "ClassHelper", ".", "OBJECT_TYPE", ")", "{", "node", ".", "setReturnType", "(", "ClassHelper", ".", "VOID_TYPE", ")", ";", "}", "}", "}", "}", "}", "protected", "void", "addReturnIfNeeded", "(", "MethodNode", "node", ")", "{", "ReturnAdder", ".", "addReturnIfNeeded", "(", "node", ")", ";", "}", "public", "void", "visitField", "(", "FieldNode", "node", ")", "{", "}", "private", "boolean", "methodNeedsReplacement", "(", "MethodNode", "m", ")", "{", "if", "(", "m", "==", "null", ")", "return", "true", ";", "if", "(", "m", ".", "getDeclaringClass", "(", ")", "==", "this", ".", "getClassNode", "(", ")", ")", "return", "false", ";", "if", "(", "(", "m", ".", "getModifiers", "(", ")", "&", "ACC_FINAL", ")", "!=", "0", ")", "return", "false", ";", "return", "true", ";", "}", "public", "void", "visitProperty", "(", "PropertyNode", "node", ")", "{", "String", "name", "=", "node", ".", "getName", "(", ")", ";", "FieldNode", "field", "=", "node", ".", "getField", "(", ")", ";", "int", "propNodeModifiers", "=", "node", ".", "getModifiers", "(", ")", ";", "String", "getterName", "=", "\"get\"", "+", "capitalize", "(", "name", ")", ";", "String", "setterName", "=", "\"set\"", "+", "capitalize", "(", "name", ")", ";", "if", "(", "(", "propNodeModifiers", "&", "Modifier", ".", "VOLATILE", ")", "!=", "0", ")", "{", "propNodeModifiers", "=", "propNodeModifiers", "-", "Modifier", ".", "VOLATILE", ";", "}", "if", "(", "(", "propNodeModifiers", "&", "Modifier", ".", "TRANSIENT", ")", "!=", "0", ")", "{", "propNodeModifiers", "=", "propNodeModifiers", "-", "Modifier", ".", "TRANSIENT", ";", "}", "Statement", "getterBlock", "=", "node", ".", "getGetterBlock", "(", ")", ";", "if", "(", "getterBlock", "==", "null", ")", "{", "MethodNode", "getter", "=", "classNode", ".", "getGetterMethod", "(", "getterName", ")", ";", "if", "(", "getter", "==", "null", "&&", "ClassHelper", ".", "boolean_TYPE", "==", "node", ".", "getType", "(", ")", ")", "{", "String", "secondGetterName", "=", "\"is\"", "+", "capitalize", "(", "name", ")", ";", "getter", "=", "classNode", ".", "getGetterMethod", "(", "secondGetterName", ")", ";", "}", "if", "(", "!", "node", ".", "isPrivate", "(", ")", "&&", "methodNeedsReplacement", "(", "getter", ")", ")", "{", "getterBlock", "=", "createGetterBlock", "(", "node", ",", "field", ")", ";", "}", "}", "Statement", "setterBlock", "=", "node", ".", "getSetterBlock", "(", ")", ";", "if", "(", "setterBlock", "==", "null", ")", "{", "MethodNode", "setter", "=", "classNode", ".", "getSetterMethod", "(", "setterName", ")", ";", "if", "(", "!", "node", ".", "isPrivate", "(", ")", "&&", "(", "propNodeModifiers", "&", "ACC_FINAL", ")", "==", "0", "&&", "methodNeedsReplacement", "(", "setter", ")", ")", "{", "setterBlock", "=", "createSetterBlock", "(", "node", ",", "field", ")", ";", "}", "}", "if", "(", "getterBlock", "!=", "null", ")", "{", "MethodNode", "getter", "=", "new", "MethodNode", "(", "getterName", ",", "propNodeModifiers", ",", "node", ".", "getType", "(", ")", ",", "Parameter", ".", "EMPTY_ARRAY", ",", "ClassNode", ".", "EMPTY_ARRAY", ",", "getterBlock", ")", ";", "getter", ".", "setSynthetic", "(", "true", ")", ";", "addPropertyMethod", "(", "getter", ")", ";", "visitMethod", "(", "getter", ")", ";", "if", "(", "ClassHelper", ".", "boolean_TYPE", "==", "node", ".", "getType", "(", ")", "||", "ClassHelper", ".", "Boolean_TYPE", "==", "node", ".", "getType", "(", ")", ")", "{", "String", "secondGetterName", "=", "\"is\"", "+", "capitalize", "(", "name", ")", ";", "MethodNode", "secondGetter", "=", "new", "MethodNode", "(", "secondGetterName", ",", "propNodeModifiers", ",", "node", ".", "getType", "(", ")", ",", "Parameter", ".", "EMPTY_ARRAY", ",", "ClassNode", ".", "EMPTY_ARRAY", ",", "getterBlock", ")", ";", "secondGetter", ".", "setSynthetic", "(", "true", ")", ";", "addPropertyMethod", "(", "secondGetter", ")", ";", "visitMethod", "(", "secondGetter", ")", ";", "}", "}", "if", "(", "setterBlock", "!=", "null", ")", "{", "Parameter", "[", "]", "setterParameterTypes", "=", "{", "new", "Parameter", "(", "node", ".", "getType", "(", ")", ",", "\"value\"", ")", "}", ";", "MethodNode", "setter", "=", "new", "MethodNode", "(", "setterName", ",", "propNodeModifiers", ",", "ClassHelper", ".", "VOID_TYPE", ",", "setterParameterTypes", ",", "ClassNode", ".", "EMPTY_ARRAY", ",", "setterBlock", ")", ";", "setter", ".", "setSynthetic", "(", "true", ")", ";", "addPropertyMethod", "(", "setter", ")", ";", "visitMethod", "(", "setter", ")", ";", "}", "}", "protected", "void", "addPropertyMethod", "(", "MethodNode", "method", ")", "{", "classNode", ".", "addMethod", "(", "method", ")", ";", "}", "public", "interface", "DefaultArgsAction", "{", "void", "call", "(", "ArgumentListExpression", "arguments", ",", "Parameter", "[", "]", "newParams", ",", "MethodNode", "method", ")", ";", "}", "protected", "void", "addDefaultParameterMethods", "(", "final", "ClassNode", "node", ")", "{", "List", "methods", "=", "new", "ArrayList", "(", "node", ".", "getMethods", "(", ")", ")", ";", "addDefaultParameters", "(", "methods", ",", "new", "DefaultArgsAction", "(", ")", "{", "public", "void", "call", "(", "ArgumentListExpression", "arguments", ",", "Parameter", "[", "]", "newParams", ",", "MethodNode", "method", ")", "{", "MethodCallExpression", "expression", "=", "new", "MethodCallExpression", "(", "VariableExpression", ".", "THIS_EXPRESSION", ",", "method", ".", "getName", "(", ")", ",", "arguments", ")", ";", "expression", ".", "setImplicitThis", "(", "true", ")", ";", "Statement", "code", "=", "null", ";", "if", "(", "method", ".", "isVoidMethod", "(", ")", ")", "{", "code", "=", "new", "ExpressionStatement", "(", "expression", ")", ";", "}", "else", "{", "code", "=", "new", "ReturnStatement", "(", "expression", ")", ";", "}", "MethodNode", "newMethod", "=", "new", "MethodNode", "(", "method", ".", "getName", "(", ")", ",", "method", ".", "getModifiers", "(", ")", ",", "method", ".", "getReturnType", "(", ")", ",", "newParams", ",", "method", ".", "getExceptions", "(", ")", ",", "code", ")", ";", "MethodNode", "oldMethod", "=", "node", ".", "getDeclaredMethod", "(", "method", ".", "getName", "(", ")", ",", "newParams", ")", ";", "if", "(", "oldMethod", "!=", "null", ")", "{", "throw", "new", "RuntimeParserException", "(", "\"\"", "+", "method", ".", "getTypeDescriptor", "(", ")", "+", "\"\"", "+", "newMethod", ".", "getTypeDescriptor", "(", ")", "+", "\"\"", ",", "method", ")", ";", "}", "newMethod", ".", "setSourcePosition", "(", "method", ")", ";", "newMethod", ".", "setNameStart", "(", "method", ".", "getNameStart", "(", ")", ")", ";", "newMethod", ".", "setNameEnd", "(", "method", ".", "getNameEnd", "(", ")", ")", ";", "newMethod", ".", "setOriginal", "(", "method", ")", ";", "addPropertyMethod", "(", "newMethod", ")", ";", "newMethod", ".", "setGenericsTypes", "(", "method", ".", "getGenericsTypes", "(", ")", ")", ";", "}", "}", ")", ";", "}", "protected", "void", "addDefaultParameterConstructors", "(", "final", "ClassNode", "node", ")", "{", "List", "methods", "=", "new", "ArrayList", "(", "node", ".", "getDeclaredConstructors", "(", ")", ")", ";", "addDefaultParameters", "(", "methods", ",", "new", "DefaultArgsAction", "(", ")", "{", "public", "void", "call", "(", "ArgumentListExpression", "arguments", ",", "Parameter", "[", "]", "newParams", ",", "MethodNode", "method", ")", "{", "ConstructorNode", "ctor", "=", "(", "ConstructorNode", ")", "method", ";", "ConstructorCallExpression", "expression", "=", "new", "ConstructorCallExpression", "(", "ClassNode", ".", "THIS", ",", "arguments", ")", ";", "Statement", "code", "=", "new", "ExpressionStatement", "(", "expression", ")", ";", "addConstructor", "(", "newParams", ",", "ctor", ",", "code", ",", "node", ")", ";", "}", "}", ")", ";", "}", "protected", "void", "addConstructor", "(", "Parameter", "[", "]", "newParams", ",", "ConstructorNode", "ctor", ",", "Statement", "code", ",", "ClassNode", "node", ")", "{", "node", ".", "addConstructor", "(", "ctor", ".", "getModifiers", "(", ")", ",", "newParams", ",", "ctor", ".", "getExceptions", "(", ")", ",", "code", ")", ";", "}", "protected", "void", "addDefaultParameters", "(", "List", "methods", ",", "DefaultArgsAction", "action", ")", "{", "for", "(", "Iterator", "iter", "=", "methods", ".", "iterator", "(", ")", ";", "iter", ".", "hasNext", "(", ")", ";", ")", "{", "MethodNode", "method", "=", "(", "MethodNode", ")", "iter", ".", "next", "(", ")", ";", "if", "(", "method", ".", "hasDefaultValue", "(", ")", ")", "{", "addDefaultParameters", "(", "action", ",", "method", ")", ";", "}", "}", "}", "protected", "void", "addDefaultParameters", "(", "DefaultArgsAction", "action", ",", "MethodNode", "method", ")", "{", "Parameter", "[", "]", "parameters", "=", "method", ".", "getParameters", "(", ")", ";", "int", "counter", "=", "0", ";", "List", "paramValues", "=", "new", "ArrayList", "(", ")", ";", "int", "size", "=", "parameters", ".", "length", ";", "for", "(", "int", "i", "=", "size", "-", "1", ";", "i", ">=", "0", ";", "i", "--", ")", "{", "Parameter", "parameter", "=", "parameters", "[", "i", "]", ";", "if", "(", "parameter", "!=", "null", "&&", "parameter", ".", "hasInitialExpression", "(", ")", ")", "{", "paramValues", ".", "add", "(", "Integer", ".", "valueOf", "(", "i", ")", ")", ";", "paramValues", ".", "add", "(", "new", "CastExpression", "(", "parameter", ".", "getType", "(", ")", ",", "parameter", ".", "getInitialExpression", "(", ")", ")", ")", ";", "counter", "++", ";", "}", "}", "for", "(", "int", "j", "=", "1", ";", "j", "<=", "counter", ";", "j", "++", ")", "{", "Parameter", "[", "]", "newParams", "=", "new", "Parameter", "[", "parameters", ".", "length", "-", "j", "]", ";", "ArgumentListExpression", "arguments", "=", "new", "ArgumentListExpression", "(", ")", ";", "int", "index", "=", "0", ";", "int", "k", "=", "1", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "parameters", ".", "length", ";", "i", "++", ")", "{", "if", "(", "k", ">", "counter", "-", "j", "&&", "parameters", "[", "i", "]", "!=", "null", "&&", "parameters", "[", "i", "]", ".", "hasInitialExpression", "(", ")", ")", "{", "arguments", ".", "addExpression", "(", "new", "CastExpression", "(", "parameters", "[", "i", "]", ".", "getType", "(", ")", ",", "parameters", "[", "i", "]", ".", "getInitialExpression", "(", ")", ")", ")", ";", "k", "++", ";", "}", "else", "if", "(", "parameters", "[", "i", "]", "!=", "null", "&&", "parameters", "[", "i", "]", ".", "hasInitialExpression", "(", ")", ")", "{", "newParams", "[", "index", "++", "]", "=", "parameters", "[", "i", "]", ";", "arguments", ".", "addExpression", "(", "new", "CastExpression", "(", "parameters", "[", "i", "]", ".", "getType", "(", ")", ",", "new", "VariableExpression", "(", "parameters", "[", "i", "]", ".", "getName", "(", ")", ")", ")", ")", ";", "k", "++", ";", "}", "else", "{", "newParams", "[", "index", "++", "]", "=", "parameters", "[", "i", "]", ";", "arguments", ".", "addExpression", "(", "new", "CastExpression", "(", "parameters", "[", "i", "]", ".", "getType", "(", ")", ",", "new", "VariableExpression", "(", "parameters", "[", "i", "]", ".", "getName", "(", ")", ")", ")", ")", ";", "}", "}", "action", ".", "call", "(", "arguments", ",", "newParams", ",", "method", ")", ";", "}", "for", "(", "int", "i", "=", "0", ";", "i", "<", "parameters", ".", "length", ";", "i", "++", ")", "{", "parameters", "[", "i", "]", ".", "setInitialExpression", "(", "null", ")", ";", "}", "}", "protected", "void", "addClosureCode", "(", "InnerClassNode", "node", ")", "{", "}", "protected", "void", "addInitialization", "(", "final", "ClassNode", "node", ")", "{", "boolean", "addSwapInit", "=", "moveOptimizedConstantsInitialization", "(", "node", ")", ";", "for", "(", "Iterator", "iter", "=", "node", ".", "getDeclaredConstructors", "(", ")", ".", "iterator", "(", ")", ";", "iter", ".", "hasNext", "(", ")", ";", ")", "{", "addInitialization", "(", "node", ",", "(", "ConstructorNode", ")", "iter", ".", "next", "(", ")", ")", ";", "}", "if", "(", "addSwapInit", ")", "{", "BytecodeSequence", "seq", "=", "new", "BytecodeSequence", "(", "new", "BytecodeInstruction", "(", ")", "{", "@", "Override", "public", "void", "visit", "(", "MethodVisitor", "mv", ")", "{", "mv", ".", "visitMethodInsn", "(", "INVOKESTATIC", ",", "BytecodeHelper", ".", "getClassInternalName", "(", "node", ")", ",", "SWAP_INIT", ",", "\"()V\"", ")", ";", "}", "}", ")", ";", "List", "<", "Statement", ">", "swapCall", "=", "new", "ArrayList", "<", "Statement", ">", "(", "1", ")", ";", "swapCall", ".", "add", "(", "seq", ")", ";", "node", ".", "addStaticInitializerStatements", "(", "swapCall", ",", "true", ")", ";", "}", "}", "protected", "void", "addInitialization", "(", "ClassNode", "node", ",", "ConstructorNode", "constructorNode", ")", "{", "Statement", "firstStatement", "=", "constructorNode", ".", "getFirstStatement", "(", ")", ";", "if", "(", "firstStatement", "instanceof", "BytecodeSequence", ")", "return", ";", "ConstructorCallExpression", "first", "=", "getFirstIfSpecialConstructorCall", "(", "firstStatement", ")", ";", "if", "(", "first", "!=", "null", "&&", "(", "first", ".", "isThisCall", "(", ")", ")", ")", "return", ";", "List", "statements", "=", "new", "ArrayList", "(", ")", ";", "List", "staticStatements", "=", "new", "ArrayList", "(", ")", ";", "final", "boolean", "isEnum", "=", "node", ".", "isEnum", "(", ")", ";", "List", "<", "Statement", ">", "initStmtsAfterEnumValuesInit", "=", "new", "ArrayList", "(", ")", ";", "Set", "explicitStaticPropsInEnum", "=", "new", "HashSet", "(", ")", ";", "if", "(", "isEnum", ")", "{", "for", "(", "Iterator", "iter", "=", "node", ".", "getProperties", "(", ")", ".", "iterator", "(", ")", ";", "iter", ".", "hasNext", "(", ")", ";", ")", "{", "PropertyNode", "propNode", "=", "(", "PropertyNode", ")", "iter", ".", "next", "(", ")", ";", "if", "(", "!", "propNode", ".", "isSynthetic", "(", ")", "&&", "propNode", ".", "getField", "(", ")", ".", "isStatic", "(", ")", ")", "{", "explicitStaticPropsInEnum", ".", "add", "(", "propNode", ".", "getField", "(", ")", ".", "getName", "(", ")", ")", ";", "}", "}", "for", "(", "FieldNode", "fieldNode", ":", "node", ".", "getFields", "(", ")", ")", "{", "if", "(", "!", "fieldNode", ".", "isSynthetic", "(", ")", "&&", "fieldNode", ".", "isStatic", "(", ")", "&&", "fieldNode", ".", "getType", "(", ")", "!=", "node", ")", "{", "explicitStaticPropsInEnum", ".", "add", "(", "fieldNode", ".", "getName", "(", ")", ")", ";", "}", "}", "}", "for", "(", "FieldNode", "fn", ":", "node", ".", "getFields", "(", ")", ")", "{", "addFieldInitialization", "(", "statements", ",", "staticStatements", ",", "fn", ",", "isEnum", ",", "initStmtsAfterEnumValuesInit", ",", "explicitStaticPropsInEnum", ")", ";", "}", "statements", ".", "addAll", "(", "node", ".", "getObjectInitializerStatements", "(", ")", ")", ";", "if", "(", "!", "statements", ".", "isEmpty", "(", ")", ")", "{", "Statement", "code", "=", "constructorNode", ".", "getCode", "(", ")", ";", "BlockStatement", "block", "=", "new", "BlockStatement", "(", ")", ";", "List", "otherStatements", "=", "block", ".", "getStatements", "(", ")", ";", "if", "(", "code", "instanceof", "BlockStatement", ")", "{", "block", "=", "(", "BlockStatement", ")", "code", ";", "otherStatements", "=", "block", ".", "getStatements", "(", ")", ";", "}", "else", "if", "(", "code", "!=", "null", ")", "{", "otherStatements", ".", "add", "(", "code", ")", ";", "}", "if", "(", "!", "otherStatements", ".", "isEmpty", "(", ")", ")", "{", "if", "(", "first", "!=", "null", ")", "{", "otherStatements", ".", "remove", "(", "0", ")", ";", "statements", ".", "add", "(", "0", ",", "firstStatement", ")", ";", "}", "Statement", "stmtThis$0", "=", "getImplicitThis$0StmtIfInnerClass", "(", "otherStatements", ")", ";", "if", "(", "stmtThis$0", "!=", "null", ")", "{", "statements", ".", "add", "(", "1", ",", "stmtThis$0", ")", ";", "}", "statements", ".", "addAll", "(", "otherStatements", ")", ";", "}", "BlockStatement", "newBlock", "=", "new", "BlockStatement", "(", "statements", ",", "block", ".", "getVariableScope", "(", ")", ")", ";", "newBlock", ".", "setSourcePosition", "(", "block", ")", ";", "constructorNode", ".", "setCode", "(", "newBlock", ")", ";", "}", "if", "(", "!", "staticStatements", ".", "isEmpty", "(", ")", ")", "{", "if", "(", "isEnum", ")", "{", "staticStatements", ".", "removeAll", "(", "initStmtsAfterEnumValuesInit", ")", ";", "node", ".", "addStaticInitializerStatements", "(", "staticStatements", ",", "true", ")", ";", "if", "(", "!", "initStmtsAfterEnumValuesInit", ".", "isEmpty", "(", ")", ")", "{", "node", ".", "positionStmtsAfterEnumInitStmts", "(", "initStmtsAfterEnumValuesInit", ")", ";", "}", "}", "else", "{", "node", ".", "addStaticInitializerStatements", "(", "staticStatements", ",", "true", ")", ";", "}", "}", "}", "private", "Statement", "getImplicitThis$0StmtIfInnerClass", "(", "List", "<", "Statement", ">", "otherStatements", ")", "{", "if", "(", "!", "(", "classNode", "instanceof", "InnerClassNode", ")", ")", "return", "null", ";", "for", "(", "Statement", "stmt", ":", "otherStatements", ")", "{", "if", "(", "stmt", "instanceof", "BlockStatement", ")", "{", "List", "<", "Statement", ">", "stmts", "=", "(", "(", "BlockStatement", ")", "stmt", ")", ".", "getStatements", "(", ")", ";", "for", "(", "Statement", "bstmt", ":", "stmts", ")", "{", "if", "(", "bstmt", "instanceof", "ExpressionStatement", ")", "{", "Expression", "expr", "=", "(", "(", "ExpressionStatement", ")", "bstmt", ")", ".", "getExpression", "(", ")", ";", "if", "(", "expr", "instanceof", "BinaryExpression", ")", "{", "Expression", "lExpr", "=", "(", "(", "BinaryExpression", ")", "expr", ")", ".", "getLeftExpression", "(", ")", ";", "if", "(", "lExpr", "instanceof", "FieldExpression", ")", "{", "if", "(", "\"this$0\"", ".", "equals", "(", "(", "(", "FieldExpression", ")", "lExpr", ")", ".", "getFieldName", "(", ")", ")", ")", "{", "stmts", ".", "remove", "(", "bstmt", ")", ";", "return", "bstmt", ";", "}", "}", "}", "}", "}", "}", "}", "return", "null", ";", "}", "private", "ConstructorCallExpression", "getFirstIfSpecialConstructorCall", "(", "Statement", "code", ")", "{", "if", "(", "code", "==", "null", "||", "!", "(", "code", "instanceof", "ExpressionStatement", ")", ")", "return", "null", ";", "Expression", "expression", "=", "(", "(", "ExpressionStatement", ")", "code", ")", ".", "getExpression", "(", ")", ";", "if", "(", "!", "(", "expression", "instanceof", "ConstructorCallExpression", ")", ")", "return", "null", ";", "ConstructorCallExpression", "cce", "=", "(", "ConstructorCallExpression", ")", "expression", ";", "if", "(", "cce", ".", "isSpecialCall", "(", ")", ")", "return", "cce", ";", "return", "null", ";", "}", "protected", "void", "addFieldInitialization", "(", "List", "list", ",", "List", "staticList", ",", "FieldNode", "fieldNode", ",", "boolean", "isEnumClassNode", ",", "List", "initStmtsAfterEnumValuesInit", ",", "Set", "explicitStaticPropsInEnum", ")", "{", "Expression", "expression", "=", "fieldNode", ".", "getInitialExpression", "(", ")", ";", "if", "(", "expression", "!=", "null", ")", "{", "final", "FieldExpression", "fe", "=", "new", "FieldExpression", "(", "fieldNode", ")", ";", "if", "(", "fieldNode", ".", "getType", "(", ")", ".", "equals", "(", "ClassHelper", ".", "REFERENCE_TYPE", ")", "&&", "(", "(", "fieldNode", ".", "getModifiers", "(", ")", "&", "Opcodes", ".", "ACC_SYNTHETIC", ")", "!=", "0", ")", ")", "{", "fe", ".", "setUseReferenceDirectly", "(", "true", ")", ";", "}", "ExpressionStatement", "statement", "=", "new", "ExpressionStatement", "(", "new", "BinaryExpression", "(", "fe", ",", "Token", ".", "newSymbol", "(", "Types", ".", "EQUAL", ",", "fieldNode", ".", "getLineNumber", "(", ")", ",", "fieldNode", ".", "getColumnNumber", "(", ")", ")", ",", "expression", ")", ")", ";", "if", "(", "fieldNode", ".", "isStatic", "(", ")", ")", "{", "if", "(", "inlineStaticFieldInitializersIntoClinit", ")", "{", "if", "(", "expression", "instanceof", "ConstantExpression", ")", "{", "staticList", ".", "add", "(", "0", ",", "statement", ")", ";", "}", "else", "{", "staticList", ".", "add", "(", "statement", ")", ";", "}", "fieldNode", ".", "setInitialValueExpression", "(", "null", ")", ";", "}", "if", "(", "isEnumClassNode", "&&", "explicitStaticPropsInEnum", ".", "contains", "(", "fieldNode", ".", "getName", "(", ")", ")", ")", "{", "initStmtsAfterEnumValuesInit", ".", "add", "(", "statement", ")", ";", "}", "}", "else", "{", "list", ".", "add", "(", "statement", ")", ";", "}", "}", "}", "public", "static", "String", "capitalize", "(", "String", "name", ")", "{", "return", "MetaClassHelper", ".", "capitalize", "(", "name", ")", ";", "}", "protected", "Statement", "createGetterBlock", "(", "PropertyNode", "propertyNode", ",", "final", "FieldNode", "field", ")", "{", "return", "new", "BytecodeSequence", "(", "new", "BytecodeInstruction", "(", ")", "{", "public", "void", "visit", "(", "MethodVisitor", "mv", ")", "{", "if", "(", "field", ".", "isStatic", "(", ")", ")", "{", "mv", ".", "visitFieldInsn", "(", "GETSTATIC", ",", "BytecodeHelper", ".", "getClassInternalName", "(", "classNode", ")", ",", "field", ".", "getName", "(", ")", ",", "BytecodeHelper", ".", "getTypeDescription", "(", "field", ".", "getType", "(", ")", ")", ")", ";", "}", "else", "{", "mv", ".", "visitVarInsn", "(", "ALOAD", ",", "0", ")", ";", "mv", ".", "visitFieldInsn", "(", "GETFIELD", ",", "BytecodeHelper", ".", "getClassInternalName", "(", "classNode", ")", ",", "field", ".", "getName", "(", ")", ",", "BytecodeHelper", ".", "getTypeDescription", "(", "field", ".", "getType", "(", ")", ")", ")", ";", "}", "final", "BytecodeHelper", "helper", "=", "new", "BytecodeHelper", "(", "mv", ")", ";", "helper", ".", "doReturn", "(", "field", ".", "getType", "(", ")", ")", ";", "}", "}", ")", ";", "}", "protected", "Statement", "createSetterBlock", "(", "PropertyNode", "propertyNode", ",", "final", "FieldNode", "field", ")", "{", "return", "new", "BytecodeSequence", "(", "new", "BytecodeInstruction", "(", ")", "{", "public", "void", "visit", "(", "MethodVisitor", "mv", ")", "{", "final", "BytecodeHelper", "helper", "=", "new", "BytecodeHelper", "(", "mv", ")", ";", "if", "(", "field", ".", "isStatic", "(", ")", ")", "{", "helper", ".", "load", "(", "field", ".", "getType", "(", ")", ",", "0", ")", ";", "mv", ".", "visitFieldInsn", "(", "PUTSTATIC", ",", "BytecodeHelper", ".", "getClassInternalName", "(", "classNode", ")", ",", "field", ".", "getName", "(", ")", ",", "BytecodeHelper", ".", "getTypeDescription", "(", "field", ".", "getType", "(", ")", ")", ")", ";", "}", "else", "{", "mv", ".", "visitVarInsn", "(", "ALOAD", ",", "0", ")", ";", "helper", ".", "load", "(", "field", ".", "getType", "(", ")", ",", "1", ")", ";", "mv", ".", "visitFieldInsn", "(", "PUTFIELD", ",", "BytecodeHelper", ".", "getClassInternalName", "(", "classNode", ")", ",", "field", ".", "getName", "(", ")", ",", "BytecodeHelper", ".", "getTypeDescription", "(", "field", ".", "getType", "(", ")", ")", ")", ";", "}", "mv", ".", "visitInsn", "(", "RETURN", ")", ";", "}", "}", ")", ";", "}", "public", "void", "visitGenericType", "(", "GenericsType", "genericsType", ")", "{", "}", "public", "static", "long", "getTimestamp", "(", "Class", "clazz", ")", "{", "if", "(", "clazz", ".", "getClassLoader", "(", ")", "instanceof", "GroovyClassLoader", ".", "InnerLoader", ")", "{", "GroovyClassLoader", ".", "InnerLoader", "innerLoader", "=", "(", "GroovyClassLoader", ".", "InnerLoader", ")", "clazz", ".", "getClassLoader", "(", ")", ";", "return", "innerLoader", ".", "getTimeStamp", "(", ")", ";", "}", "final", "Field", "[", "]", "fields", "=", "clazz", ".", "getFields", "(", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "!=", "fields", ".", "length", ";", "++", "i", ")", "{", "if", "(", "Modifier", ".", "isStatic", "(", "fields", "[", "i", "]", ".", "getModifiers", "(", ")", ")", ")", "{", "final", "String", "name", "=", "fields", "[", "i", "]", ".", "getName", "(", ")", ";", "if", "(", "name", ".", "startsWith", "(", "__TIMESTAMP__", ")", ")", "{", "try", "{", "return", "Long", ".", "decode", "(", "name", ".", "substring", "(", "__TIMESTAMP__", ".", "length", "(", ")", ")", ")", ".", "longValue", "(", ")", ";", "}", "catch", "(", "NumberFormatException", "e", ")", "{", "return", "Long", ".", "MAX_VALUE", ";", "}", "}", "}", "}", "return", "Long", ".", "MAX_VALUE", ";", "}", "protected", "void", "addCovariantMethods", "(", "ClassNode", "classNode", ")", "{", "Map", "methodsToAdd", "=", "new", "HashMap", "(", ")", ";", "Map", "genericsSpec", "=", "new", "HashMap", "(", ")", ";", "Map", "abstractMethods", "=", "new", "HashMap", "(", ")", ";", "Map", "<", "String", ",", "MethodNode", ">", "allInterfaceMethods", "=", "new", "HashMap", "<", "String", ",", "MethodNode", ">", "(", ")", ";", "ClassNode", "[", "]", "interfaces", "=", "classNode", ".", "getInterfaces", "(", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "interfaces", ".", "length", ";", "i", "++", ")", "{", "ClassNode", "iface", "=", "interfaces", "[", "i", "]", ";", "Map", "ifaceMethodsMap", "=", "iface", ".", "getDeclaredMethodsMap", "(", ")", ";", "abstractMethods", ".", "putAll", "(", "ifaceMethodsMap", ")", ";", "allInterfaceMethods", ".", "putAll", "(", "ifaceMethodsMap", ")", ";", "}", "collectSuperInterfaceMethods", "(", "classNode", ",", "allInterfaceMethods", ")", ";", "List", "declaredMethods", "=", "new", "ArrayList", "(", "classNode", ".", "getMethods", "(", ")", ")", ";", "for", "(", "Iterator", "methodsIterator", "=", "declaredMethods", ".", "iterator", "(", ")", ";", "methodsIterator", ".", "hasNext", "(", ")", ";", ")", "{", "MethodNode", "m", "=", "(", "MethodNode", ")", "methodsIterator", ".", "next", "(", ")", ";", "abstractMethods", ".", "remove", "(", "m", ".", "getTypeDescriptor", "(", ")", ")", ";", "if", "(", "m", ".", "isStatic", "(", ")", "||", "!", "(", "m", ".", "isPublic", "(", ")", "||", "m", ".", "isProtected", "(", ")", ")", ")", "{", "methodsIterator", ".", "remove", "(", ")", ";", "}", "MethodNode", "intfMethod", "=", "allInterfaceMethods", ".", "get", "(", "m", ".", "getTypeDescriptor", "(", ")", ")", ";", "if", "(", "intfMethod", "!=", "null", "&&", "(", "(", "m", ".", "getModifiers", "(", ")", "&", "ACC_SYNTHETIC", ")", "==", "0", ")", "&&", "!", "m", ".", "isPublic", "(", ")", "&&", "!", "m", ".", "isStaticConstructor", "(", ")", ")", "{", "throw", "new", "RuntimeParserException", "(", "\"The", "method", "\"", "+", "m", ".", "getName", "(", ")", "+", "\"\"", "+", "intfMethod", ".", "getDeclaringClass", "(", ")", ",", "m", ")", ";", "}", "}", "addCovariantMethods", "(", "classNode", ",", "declaredMethods", ",", "abstractMethods", ",", "methodsToAdd", ",", "genericsSpec", ")", ";", "Map", "declaredMethodsMap", "=", "new", "HashMap", "(", ")", ";", "if", "(", "methodsToAdd", ".", "size", "(", ")", ">", "0", ")", "{", "for", "(", "Iterator", "methodsIterator", "=", "declaredMethods", ".", "iterator", "(", ")", ";", "methodsIterator", ".", "hasNext", "(", ")", ";", ")", "{", "MethodNode", "m", "=", "(", "MethodNode", ")", "methodsIterator", ".", "next", "(", ")", ";", "declaredMethodsMap", ".", "put", "(", "m", ".", "getTypeDescriptor", "(", ")", ",", "m", ")", ";", "}", "}", "for", "(", "Iterator", "it", "=", "methodsToAdd", ".", "entrySet", "(", ")", ".", "iterator", "(", ")", ";", "it", ".", "hasNext", "(", ")", ";", ")", "{", "Map", ".", "Entry", "entry", "=", "(", "Map", ".", "Entry", ")", "it", ".", "next", "(", ")", ";", "MethodNode", "method", "=", "(", "MethodNode", ")", "entry", ".", "getValue", "(", ")", ";", "MethodNode", "mn", "=", "(", "MethodNode", ")", "declaredMethodsMap", ".", "get", "(", "entry", ".", "getKey", "(", ")", ")", ";", "if", "(", "mn", "!=", "null", "&&", "mn", ".", "getDeclaringClass", "(", ")", ".", "equals", "(", "classNode", ")", ")", "continue", ";", "addPropertyMethod", "(", "method", ")", ";", "}", "}", "private", "void", "collectSuperInterfaceMethods", "(", "ClassNode", "cn", ",", "Map", "allInterfaceMethods", ")", "{", "List", "cnInterfaces", "=", "Arrays", ".", "asList", "(", "cn", ".", "getInterfaces", "(", ")", ")", ";", "ClassNode", "sn", "=", "cn", ".", "getSuperClass", "(", ")", ";", "while", "(", "sn", "!=", "null", "&&", "!", "sn", ".", "equals", "(", "ClassHelper", ".", "OBJECT_TYPE", ")", ")", "{", "ClassNode", "[", "]", "interfaces", "=", "sn", ".", "getInterfaces", "(", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "interfaces", ".", "length", ";", "i", "++", ")", "{", "ClassNode", "iface", "=", "interfaces", "[", "i", "]", ";", "if", "(", "!", "cnInterfaces", ".", "contains", "(", "iface", ")", ")", "{", "Map", "ifaceMethodsMap", "=", "iface", ".", "getDeclaredMethodsMap", "(", ")", ";", "allInterfaceMethods", ".", "putAll", "(", "ifaceMethodsMap", ")", ";", "}", "}", "sn", "=", "sn", ".", "getSuperClass", "(", ")", ";", "}", "}", "private", "void", "addCovariantMethods", "(", "ClassNode", "classNode", ",", "List", "declaredMethods", ",", "Map", "abstractMethods", ",", "Map", "methodsToAdd", ",", "Map", "oldGenericsSpec", ")", "{", "ClassNode", "sn", "=", "classNode", ".", "getUnresolvedSuperClass", "(", "false", ")", ";", "if", "(", "sn", "!=", "null", ")", "{", "Map", "genericsSpec", "=", "createGenericsSpec", "(", "sn", ",", "oldGenericsSpec", ")", ";", "List", "classMethods", "=", "sn", ".", "getMethods", "(", ")", ";", "for", "(", "Iterator", "it", "=", "declaredMethods", ".", "iterator", "(", ")", ";", "it", ".", "hasNext", "(", ")", ";", ")", "{", "MethodNode", "method", "=", "(", "MethodNode", ")", "it", ".", "next", "(", ")", ";", "if", "(", "method", ".", "isStatic", "(", ")", ")", "continue", ";", "storeMissingCovariantMethods", "(", "classMethods", ",", "method", ",", "methodsToAdd", ",", "genericsSpec", ")", ";", "}", "if", "(", "!", "abstractMethods", ".", "isEmpty", "(", ")", ")", "{", "for", "(", "Iterator", "it", "=", "classMethods", ".", "iterator", "(", ")", ";", "it", ".", "hasNext", "(", ")", ";", ")", "{", "MethodNode", "method", "=", "(", "MethodNode", ")", "it", ".", "next", "(", ")", ";", "if", "(", "method", ".", "isStatic", "(", ")", ")", "continue", ";", "storeMissingCovariantMethods", "(", "abstractMethods", ".", "values", "(", ")", ",", "method", ",", "methodsToAdd", ",", "Collections", ".", "EMPTY_MAP", ")", ";", "}", "}", "addCovariantMethods", "(", "sn", ".", "redirect", "(", ")", ",", "declaredMethods", ",", "abstractMethods", ",", "methodsToAdd", ",", "genericsSpec", ")", ";", "}", "ClassNode", "[", "]", "interfaces", "=", "classNode", ".", "getInterfaces", "(", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "interfaces", ".", "length", ";", "i", "++", ")", "{", "List", "interfacesMethods", "=", "interfaces", "[", "i", "]", ".", "getMethods", "(", ")", ";", "Map", "genericsSpec", "=", "createGenericsSpec", "(", "interfaces", "[", "i", "]", ",", "oldGenericsSpec", ")", ";", "for", "(", "Iterator", "it", "=", "declaredMethods", ".", "iterator", "(", ")", ";", "it", ".", "hasNext", "(", ")", ";", ")", "{", "MethodNode", "method", "=", "(", "MethodNode", ")", "it", ".", "next", "(", ")", ";", "if", "(", "method", ".", "isStatic", "(", ")", ")", "continue", ";", "storeMissingCovariantMethods", "(", "interfacesMethods", ",", "method", ",", "methodsToAdd", ",", "genericsSpec", ")", ";", "}", "addCovariantMethods", "(", "interfaces", "[", "i", "]", ",", "declaredMethods", ",", "abstractMethods", ",", "methodsToAdd", ",", "genericsSpec", ")", ";", "}", "}", "private", "MethodNode", "getCovariantImplementation", "(", "final", "MethodNode", "oldMethod", ",", "final", "MethodNode", "overridingMethod", ",", "Map", "genericsSpec", ")", "{", "if", "(", "!", "oldMethod", ".", "getName", "(", ")", ".", "equals", "(", "overridingMethod", ".", "getName", "(", ")", ")", ")", "return", "null", ";", "if", "(", "(", "overridingMethod", ".", "getModifiers", "(", ")", "&", "ACC_BRIDGE", ")", "!=", "0", ")", "return", "null", ";", "boolean", "normalEqualParameters", "=", "equalParametersNormal", "(", "overridingMethod", ",", "oldMethod", ")", ";", "boolean", "genericEqualParameters", "=", "equalParametersWithGenerics", "(", "overridingMethod", ",", "oldMethod", ",", "genericsSpec", ")", ";", "if", "(", "!", "normalEqualParameters", "&&", "!", "genericEqualParameters", ")", "return", "null", ";", "ClassNode", "mr", "=", "overridingMethod", ".", "getReturnType", "(", ")", ";", "ClassNode", "omr", "=", "oldMethod", ".", "getReturnType", "(", ")", ";", "boolean", "equalReturnType", "=", "mr", ".", "equals", "(", "omr", ")", ";", "if", "(", "equalReturnType", "&&", "normalEqualParameters", ")", "return", "null", ";", "ClassNode", "testmr", "=", "correctToGenericsSpec", "(", "genericsSpec", ",", "omr", ")", ";", "if", "(", "!", "isAssignable", "(", "mr", ",", "testmr", ")", ")", "{", "throw", "new", "RuntimeParserException", "(", "\"\"", "+", "overridingMethod", ".", "getTypeDescriptor", "(", ")", "+", "\"", "in", "\"", "+", "overridingMethod", ".", "getDeclaringClass", "(", ")", ".", "getName", "(", ")", "+", "\"\"", "+", "oldMethod", ".", "getTypeDescriptor", "(", ")", "+", "\"", "in", "\"", "+", "oldMethod", ".", "getDeclaringClass", "(", ")", ".", "getName", "(", ")", ",", "overridingMethod", ")", ";", "}", "if", "(", "(", "oldMethod", ".", "getModifiers", "(", ")", "&", "ACC_FINAL", ")", "!=", "0", ")", "{", "throw", "new", "RuntimeParserException", "(", "\"\"", "+", "oldMethod", ".", "getTypeDescriptor", "(", ")", "+", "\"", "in", "\"", "+", "oldMethod", ".", "getDeclaringClass", "(", ")", ".", "getName", "(", ")", ",", "overridingMethod", ")", ";", "}", "if", "(", "oldMethod", ".", "isStatic", "(", ")", "!=", "overridingMethod", ".", "isStatic", "(", ")", ")", "{", "throw", "new", "RuntimeParserException", "(", "\"\"", "+", "oldMethod", ".", "getTypeDescriptor", "(", ")", "+", "\"", "in", "\"", "+", "oldMethod", ".", "getDeclaringClass", "(", ")", ".", "getName", "(", ")", "+", "\"\"", ",", "overridingMethod", ")", ";", "}", "if", "(", "!", "equalReturnType", ")", "{", "boolean", "oldM", "=", "ClassHelper", ".", "isPrimitiveType", "(", "oldMethod", ".", "getReturnType", "(", ")", ")", ";", "boolean", "newM", "=", "ClassHelper", ".", "isPrimitiveType", "(", "overridingMethod", ".", "getReturnType", "(", ")", ")", ";", "if", "(", "oldM", "||", "newM", ")", "{", "String", "message", "=", "\"\"", ";", "if", "(", "oldM", "&&", "newM", ")", "{", "message", "=", "\"\"", ";", "}", "else", "if", "(", "newM", ")", "{", "message", "=", "\"\"", ";", "}", "else", "if", "(", "oldM", ")", "{", "message", "=", "\"\"", ";", "}", "throw", "new", "RuntimeParserException", "(", "\"\"", "+", "oldMethod", ".", "getTypeDescriptor", "(", ")", "+", "\"", "in", "\"", "+", "oldMethod", ".", "getDeclaringClass", "(", ")", ".", "getName", "(", ")", "+", "message", ",", "overridingMethod", ")", ";", "}", "}", "MethodNode", "newMethod", "=", "new", "MethodNode", "(", "oldMethod", ".", "getName", "(", ")", ",", "overridingMethod", ".", "getModifiers", "(", ")", "|", "ACC_SYNTHETIC", "|", "ACC_BRIDGE", ",", "oldMethod", ".", "getReturnType", "(", ")", ".", "getPlainNodeReference", "(", ")", ",", "cleanParameters", "(", "oldMethod", ".", "getParameters", "(", ")", ")", ",", "oldMethod", ".", "getExceptions", "(", ")", ",", "null", ")", ";", "List", "instructions", "=", "new", "ArrayList", "(", "1", ")", ";", "instructions", ".", "add", "(", "new", "BytecodeInstruction", "(", ")", "{", "public", "void", "visit", "(", "MethodVisitor", "mv", ")", "{", "BytecodeHelper", "helper", "=", "new", "BytecodeHelper", "(", "mv", ")", ";", "mv", ".", "visitVarInsn", "(", "ALOAD", ",", "0", ")", ";", "Parameter", "[", "]", "para", "=", "oldMethod", ".", "getParameters", "(", ")", ";", "Parameter", "[", "]", "goal", "=", "overridingMethod", ".", "getParameters", "(", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "para", ".", "length", ";", "i", "++", ")", "{", "helper", ".", "load", "(", "para", "[", "i", "]", ".", "getType", "(", ")", ",", "i", "+", "1", ")", ";", "if", "(", "!", "para", "[", "i", "]", ".", "getType", "(", ")", ".", "equals", "(", "goal", "[", "i", "]", ".", "getType", "(", ")", ")", ")", "{", "helper", ".", "doCast", "(", "goal", "[", "i", "]", ".", "getType", "(", ")", ")", ";", "}", "}", "mv", ".", "visitMethodInsn", "(", "INVOKEVIRTUAL", ",", "BytecodeHelper", ".", "getClassInternalName", "(", "classNode", ")", ",", "overridingMethod", ".", "getName", "(", ")", ",", "BytecodeHelper", ".", "getMethodDescriptor", "(", "overridingMethod", ".", "getReturnType", "(", ")", ",", "overridingMethod", ".", "getParameters", "(", ")", ")", ")", ";", "helper", ".", "doReturn", "(", "oldMethod", ".", "getReturnType", "(", ")", ")", ";", "}", "}", ")", ";", "newMethod", ".", "setCode", "(", "new", "BytecodeSequence", "(", "instructions", ")", ")", ";", "return", "newMethod", ";", "}", "private", "boolean", "isAssignable", "(", "ClassNode", "node", ",", "ClassNode", "testNode", ")", "{", "if", "(", "testNode", ".", "isInterface", "(", ")", ")", "{", "if", "(", "node", ".", "isInterface", "(", ")", ")", "{", "if", "(", "node", ".", "isDerivedFrom", "(", "testNode", ")", ")", "return", "true", ";", "}", "else", "{", "if", "(", "node", ".", "implementsInterface", "(", "testNode", ")", ")", "return", "true", ";", "}", "}", "else", "{", "if", "(", "node", ".", "isDerivedFrom", "(", "testNode", ")", ")", "return", "true", ";", "}", "return", "false", ";", "}", "private", "Parameter", "[", "]", "cleanParameters", "(", "Parameter", "[", "]", "parameters", ")", "{", "Parameter", "[", "]", "params", "=", "new", "Parameter", "[", "parameters", ".", "length", "]", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "params", ".", "length", ";", "i", "++", ")", "{", "params", "[", "i", "]", "=", "new", "Parameter", "(", "parameters", "[", "i", "]", ".", "getType", "(", ")", ".", "getPlainNodeReference", "(", ")", ",", "parameters", "[", "i", "]", ".", "getName", "(", ")", ")", ";", "}", "return", "params", ";", "}", "private", "void", "storeMissingCovariantMethods", "(", "Collection", "methods", ",", "MethodNode", "method", ",", "Map", "methodsToAdd", ",", "Map", "genericsSpec", ")", "{", "for", "(", "Iterator", "sit", "=", "methods", ".", "iterator", "(", ")", ";", "sit", ".", "hasNext", "(", ")", ";", ")", "{", "MethodNode", "toOverride", "=", "(", "MethodNode", ")", "sit", ".", "next", "(", ")", ";", "MethodNode", "bridgeMethod", "=", "getCovariantImplementation", "(", "toOverride", ",", "method", ",", "genericsSpec", ")", ";", "if", "(", "bridgeMethod", "==", "null", ")", "continue", ";", "methodsToAdd", ".", "put", "(", "bridgeMethod", ".", "getTypeDescriptor", "(", ")", ",", "bridgeMethod", ")", ";", "return", ";", "}", "}", "private", "ClassNode", "correctToGenericsSpec", "(", "Map", "genericsSpec", ",", "GenericsType", "type", ")", "{", "ClassNode", "ret", "=", "null", ";", "if", "(", "type", ".", "isPlaceholder", "(", ")", ")", "{", "String", "name", "=", "type", ".", "getName", "(", ")", ";", "ret", "=", "(", "ClassNode", ")", "genericsSpec", ".", "get", "(", "name", ")", ";", "}", "if", "(", "ret", "==", "null", ")", "ret", "=", "type", ".", "getType", "(", ")", ";", "return", "ret", ";", "}", "private", "ClassNode", "correctToGenericsSpec", "(", "Map", "genericsSpec", ",", "ClassNode", "type", ")", "{", "if", "(", "type", ".", "isGenericsPlaceHolder", "(", ")", ")", "{", "String", "name", "=", "type", ".", "getGenericsTypes", "(", ")", "[", "0", "]", ".", "getName", "(", ")", ";", "type", "=", "(", "ClassNode", ")", "genericsSpec", ".", "get", "(", "name", ")", ";", "}", "if", "(", "type", "==", "null", ")", "type", "=", "ClassHelper", ".", "OBJECT_TYPE", ";", "return", "type", ";", "}", "private", "boolean", "equalParametersNormal", "(", "MethodNode", "m1", ",", "MethodNode", "m2", ")", "{", "Parameter", "[", "]", "p1", "=", "m1", ".", "getParameters", "(", ")", ";", "Parameter", "[", "]", "p2", "=", "m2", ".", "getParameters", "(", ")", ";", "if", "(", "p1", ".", "length", "!=", "p2", ".", "length", ")", "return", "false", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "p2", ".", "length", ";", "i", "++", ")", "{", "ClassNode", "type", "=", "p2", "[", "i", "]", ".", "getType", "(", ")", ";", "ClassNode", "parameterType", "=", "p1", "[", "i", "]", ".", "getType", "(", ")", ";", "if", "(", "!", "parameterType", ".", "equals", "(", "type", ")", ")", "return", "false", ";", "}", "return", "true", ";", "}", "private", "boolean", "equalParametersWithGenerics", "(", "MethodNode", "m1", ",", "MethodNode", "m2", ",", "Map", "genericsSpec", ")", "{", "Parameter", "[", "]", "p1", "=", "m1", ".", "getParameters", "(", ")", ";", "Parameter", "[", "]", "p2", "=", "m2", ".", "getParameters", "(", ")", ";", "if", "(", "p1", ".", "length", "!=", "p2", ".", "length", ")", "return", "false", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "p2", ".", "length", ";", "i", "++", ")", "{", "ClassNode", "type", "=", "p2", "[", "i", "]", ".", "getType", "(", ")", ";", "ClassNode", "genericsType", "=", "correctToGenericsSpec", "(", "genericsSpec", ",", "type", ")", ";", "ClassNode", "parameterType", "=", "p1", "[", "i", "]", ".", "getType", "(", ")", ";", "if", "(", "!", "parameterType", ".", "equals", "(", "genericsType", ")", ")", "return", "false", ";", "}", "return", "true", ";", "}", "private", "Map", "createGenericsSpec", "(", "ClassNode", "current", ",", "Map", "oldSpec", ")", "{", "Map", "ret", "=", "new", "HashMap", "(", "oldSpec", ")", ";", "GenericsType", "[", "]", "sgts", "=", "current", ".", "getGenericsTypes", "(", ")", ";", "if", "(", "sgts", "!=", "null", ")", "{", "ClassNode", "[", "]", "spec", "=", "new", "ClassNode", "[", "sgts", ".", "length", "]", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "spec", ".", "length", ";", "i", "++", ")", "{", "spec", "[", "i", "]", "=", "correctToGenericsSpec", "(", "ret", ",", "sgts", "[", "i", "]", ")", ";", "}", "GenericsType", "[", "]", "newGts", "=", "current", ".", "redirect", "(", ")", ".", "getGenericsTypes", "(", ")", ";", "if", "(", "newGts", "==", "null", ")", "return", "ret", ";", "ret", ".", "clear", "(", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "spec", ".", "length", ";", "i", "++", ")", "{", "ret", ".", "put", "(", "newGts", "[", "i", "]", ".", "getName", "(", ")", ",", "spec", "[", "i", "]", ")", ";", "}", "}", "return", "ret", ";", "}", "private", "boolean", "moveOptimizedConstantsInitialization", "(", "ClassNode", "node", ")", "{", "if", "(", "node", ".", "isInterface", "(", ")", ")", "return", "false", ";", "final", "int", "mods", "=", "Opcodes", ".", "ACC_STATIC", "|", "Opcodes", ".", "ACC_SYNTHETIC", "|", "Opcodes", ".", "ACC_PUBLIC", ";", "String", "name", "=", "SWAP_INIT", ";", "BlockStatement", "methodCode", "=", "new", "BlockStatement", "(", ")", ";", "node", ".", "addSyntheticMethod", "(", "name", ",", "mods", ",", "ClassHelper", ".", "VOID_TYPE", ",", "Parameter", ".", "EMPTY_ARRAY", ",", "ClassNode", ".", "EMPTY_ARRAY", ",", "methodCode", ")", ";", "for", "(", "FieldNode", "fn", ":", "node", ".", "getFields", "(", ")", ")", "{", "if", "(", "!", "fn", ".", "isStatic", "(", ")", "||", "!", "fn", ".", "isSynthetic", "(", ")", "||", "!", "fn", ".", "getName", "(", ")", ".", "startsWith", "(", "\"$const$\"", ")", ")", "continue", ";", "if", "(", "fn", ".", "getInitialExpression", "(", ")", "==", "null", ")", "continue", ";", "final", "FieldExpression", "fe", "=", "new", "FieldExpression", "(", "fn", ")", ";", "if", "(", "fn", ".", "getType", "(", ")", ".", "equals", "(", "ClassHelper", ".", "REFERENCE_TYPE", ")", ")", "fe", ".", "setUseReferenceDirectly", "(", "true", ")", ";", "ConstantExpression", "init", "=", "(", "ConstantExpression", ")", "fn", ".", "getInitialExpression", "(", ")", ";", "ExpressionStatement", "statement", "=", "new", "ExpressionStatement", "(", "new", "BinaryExpression", "(", "fe", ",", "Token", ".", "newSymbol", "(", "Types", ".", "EQUAL", ",", "fn", ".", "getLineNumber", "(", ")", ",", "fn", ".", "getColumnNumber", "(", ")", ")", ",", "init", ")", ")", ";", "fn", ".", "setInitialValueExpression", "(", "null", ")", ";", "init", ".", "setConstantName", "(", "null", ")", ";", "methodCode", ".", "addStatement", "(", "statement", ")", ";", "}", "return", "true", ";", "}", "}", "</s>" ]