diff --git a/.github/license-check/config.json b/.github/license-check/config.json index 55cf4fdf1..30ad9e886 100644 --- a/.github/license-check/config.json +++ b/.github/license-check/config.json @@ -5,7 +5,8 @@ "**/*.vpr", "**/*.go", "build.sbt", - "src/main/resources/stubs/github.com/**/*.gobra" + "src/main/resources/stubs/github.com/**/*.gobra", + "**/Gobra*.g4" ], "exclude": [ "carbon/**", @@ -15,7 +16,8 @@ "project/project/**", "project/target/**", "target/**", - "src/test/resources/**/*.go" + "src/test/resources/**/*.go", + "src/test/scala/viper/gobra/parsing/GoParserUnitTests.scala" ], "license": "./.github/license-check/headers/MPLv2-ETH.txt" }, @@ -89,16 +91,27 @@ "docs/**", "artifact/content/paper.pdf", "artifact/content/tutorial.md", - "artifact/evaluation/**" + "artifact/evaluation/**", + "src/main/java/**/*.java" ] }, { "include": [ - "src/main/**/*.gobra" + "src/main/**/*.gobra", + "src/test/scala/viper/gobra/parsing/GoParserUnitTests.scala" ], "exclude": [ "src/main/resources/stubs/github.com/**/*.gobra" ], "license": "./.github/license-check/headers/Go.txt" + }, + { + "include": [ + "src/main/**/*.g4" + ], + "exclude": [ + "src/main/**/Gobra*.g4" + ], + "license": "./.github/license-check/headers/BSD-3-SIDM.txt" } ] diff --git a/.github/license-check/headers/BSD-3-SIDM.txt b/.github/license-check/headers/BSD-3-SIDM.txt new file mode 100644 index 000000000..ca36cc667 --- /dev/null +++ b/.github/license-check/headers/BSD-3-SIDM.txt @@ -0,0 +1,30 @@ +/* + [The "BSD licence"] + Copyright (c) 2017 Sasa Coh, Michał Błotniak + Copyright (c) 2019 Ivan Kochurkin, kvanttt@gmail.com, Positive Technologies + Copyright (c) 2019 Dmitry Rassadin, flipparassa@gmail.com, Positive Technologies + Copyright (c) 2021 Martin Mirchev, mirchevmartin2203@gmail.com + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + 3. The name of the author may not be used to endorse or promote products + derived from this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ diff --git a/.gitignore b/.gitignore index 859399b2c..0bab1655a 100644 --- a/.gitignore +++ b/.gitignore @@ -14,6 +14,12 @@ logger.log *.go.* *.gobra.* +/src/main/java/viper/gobra/frontend/GobraLexer.tokens +/src/main/java/viper/gobra/frontend/GobraParser.interp +/src/main/java/viper/gobra/frontend/GobraParser.tokens +/gen/ +/.gobra/ + .bloop/ .metals/ .vscode/ diff --git a/build.sbt b/build.sbt index 1808e0d09..2533d8e2f 100644 --- a/build.sbt +++ b/build.sbt @@ -42,13 +42,14 @@ lazy val gobra = (project in file(".")) libraryDependencies += "org.apache.commons" % "commons-lang3" % "3.9", // for SystemUtils libraryDependencies += "org.apache.commons" % "commons-text" % "1.9", // for escaping strings in parser preprocessor libraryDependencies += "commons-codec" % "commons-codec" % "1.15", // for obtaining the hex encoding of a string + libraryDependencies += "org.antlr" % "antlr4-runtime" % "4.9.2", scalacOptions ++= Seq( "-encoding", "UTF-8", // Enforce UTF-8, instead of relying on properly set locales "-Ypatmat-exhaust-depth", "40" ), - javacOptions ++= Seq("-encoding", "UTF-8", "-charset", "UTF-8", "-docencoding", "UTF-8"), + javacOptions := Seq("-encoding", "UTF-8"), // Run settings run / javaOptions ++= Seq( @@ -57,6 +58,7 @@ lazy val gobra = (project in file(".")) ), fork := true, + cancelable in Global := true, // Test settings diff --git a/src/main/antlr4/GoLexer.g4 b/src/main/antlr4/GoLexer.g4 new file mode 100644 index 000000000..efcba1f79 --- /dev/null +++ b/src/main/antlr4/GoLexer.g4 @@ -0,0 +1,507 @@ +/* + [The "BSD licence"] + Copyright (c) 2017 Sasa Coh, Michał Błotniak + Copyright (c) 2019 Ivan Kochurkin, kvanttt@gmail.com, Positive Technologies + Copyright (c) 2019 Dmitry Rassadin, flipparassa@gmail.com, Positive Technologies + Copyright (c) 2021 Martin Mirchev, mirchevmartin2203@gmail.com + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + 3. The name of the author may not be used to endorse or promote products + derived from this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +/* + * A Go grammar for ANTLR 4 derived from the Go Language Specification + * https://golang.org/ref/spec + */ + +// Imported to Gobra from https://github.com/antlr/grammars-v4/blob/4c06ad8cc8130931c75ca0b17cbc1453f3830cd2/golang + + +lexer grammar GoLexer; + +// Keywords + +BREAK : 'break' -> mode(NLSEMI); +DEFAULT : 'default'; +FUNC : 'func'; +INTERFACE : 'interface'; +SELECT : 'select'; +CASE : 'case'; +DEFER : 'defer'; +GO : 'go'; +MAP : 'map'; +STRUCT : 'struct'; +CHAN : 'chan'; +ELSE : 'else'; +GOTO : 'goto'; +PACKAGE : 'package'; +SWITCH : 'switch'; +CONST : 'const'; +FALLTHROUGH : 'fallthrough' -> mode(NLSEMI); +IF : 'if'; +RANGE : 'range'; +TYPE : 'type'; +CONTINUE : 'continue' -> mode(NLSEMI); +FOR : 'for'; +IMPORT : 'import'; +RETURN : 'return' -> mode(NLSEMI); +VAR : 'var'; + +NIL_LIT : 'nil' -> mode(NLSEMI); + +IDENTIFIER : LETTER (LETTER | UNICODE_DIGIT)* -> mode(NLSEMI); + +// Punctuation + +L_PAREN : '('; +R_PAREN : ')' -> mode(NLSEMI); +L_CURLY : '{'; +R_CURLY : '}' -> mode(NLSEMI); +L_BRACKET : '['; +R_BRACKET : ']' -> mode(NLSEMI); +ASSIGN : '='; +COMMA : ','; +SEMI : ';'; +COLON : ':'; +DOT : '.'; +PLUS_PLUS : '++' -> mode(NLSEMI); +MINUS_MINUS : '--' -> mode(NLSEMI); +DECLARE_ASSIGN : ':='; +ELLIPSIS : '...'; + +// Logical + +LOGICAL_OR : '||'; +LOGICAL_AND : '&&'; + +// Relation operators + +EQUALS : '=='; +NOT_EQUALS : '!='; +LESS : '<'; +LESS_OR_EQUALS : '<='; +GREATER : '>'; +GREATER_OR_EQUALS : '>='; + +// Arithmetic operators + +OR : '|'; +DIV : '/'; +MOD : '%'; +LSHIFT : '<<'; +RSHIFT : '>>'; +BIT_CLEAR : '&^'; + +// Unary operators + +EXCLAMATION : '!'; + +// Mixed operators + +PLUS : '+'; +MINUS : '-'; +CARET : '^'; +STAR : '*'; +AMPERSAND : '&'; +RECEIVE : '<-'; + +// Number literals + +DECIMAL_LIT : ('0' | [1-9] ('_'? [0-9])*) -> mode(NLSEMI); +BINARY_LIT : '0' [bB] ('_'? BIN_DIGIT)+ -> mode(NLSEMI); +OCTAL_LIT : '0' [oO]? ('_'? OCTAL_DIGIT)+ -> mode(NLSEMI); +HEX_LIT : '0' [xX] ('_'? HEX_DIGIT)+ -> mode(NLSEMI); + + +FLOAT_LIT : (DECIMAL_FLOAT_LIT | HEX_FLOAT_LIT) -> mode(NLSEMI); + +DECIMAL_FLOAT_LIT : DECIMALS ('.' DECIMALS? EXPONENT? | EXPONENT) + | '.' DECIMALS EXPONENT? + ; + +HEX_FLOAT_LIT : '0' [xX] HEX_MANTISSA HEX_EXPONENT + ; + +fragment HEX_MANTISSA : ('_'? HEX_DIGIT)+ ('.' ( '_'? HEX_DIGIT )*)? + | '.' HEX_DIGIT ('_'? HEX_DIGIT)*; + +fragment HEX_EXPONENT : [pP] [+-] DECIMALS; + + +IMAGINARY_LIT : (DECIMAL_LIT | BINARY_LIT | OCTAL_LIT | HEX_LIT | FLOAT_LIT) 'i' -> mode(NLSEMI); + +// Rune literals + +fragment RUNE : '\'' (UNICODE_VALUE | BYTE_VALUE) '\'';//: '\'' (~[\n\\] | ESCAPED_VALUE) '\''; + +RUNE_LIT : RUNE -> mode(NLSEMI); + + + +BYTE_VALUE : OCTAL_BYTE_VALUE | HEX_BYTE_VALUE; + +OCTAL_BYTE_VALUE: '\\' OCTAL_DIGIT OCTAL_DIGIT OCTAL_DIGIT; + +HEX_BYTE_VALUE: '\\' 'x' HEX_DIGIT HEX_DIGIT; + +LITTLE_U_VALUE: '\\' 'u' HEX_DIGIT HEX_DIGIT HEX_DIGIT HEX_DIGIT; + +BIG_U_VALUE: '\\' 'U' HEX_DIGIT HEX_DIGIT HEX_DIGIT HEX_DIGIT HEX_DIGIT HEX_DIGIT HEX_DIGIT HEX_DIGIT; + +// String literals + +RAW_STRING_LIT : '`' ~'`'* '`' -> mode(NLSEMI); +INTERPRETED_STRING_LIT : '"' (~["\\] | ESCAPED_VALUE)* '"' -> mode(NLSEMI); +// Hidden tokens +WS : [ \t]+ -> channel(HIDDEN); +COMMENT : '/*' .*? '*/' -> channel(HIDDEN); +TERMINATOR : [\r\n]+ -> channel(HIDDEN); +LINE_COMMENT : '//' ~[\r\n]* -> channel(HIDDEN); + +fragment UNICODE_VALUE: ~[\r\n'] | LITTLE_U_VALUE | BIG_U_VALUE | ESCAPED_VALUE; +// Fragments +fragment ESCAPED_VALUE + : '\\' ('u' HEX_DIGIT HEX_DIGIT HEX_DIGIT HEX_DIGIT + | 'U' HEX_DIGIT HEX_DIGIT HEX_DIGIT HEX_DIGIT HEX_DIGIT HEX_DIGIT HEX_DIGIT HEX_DIGIT + | [abfnrtv\\'"] + | OCTAL_DIGIT OCTAL_DIGIT OCTAL_DIGIT + | 'x' HEX_DIGIT HEX_DIGIT) + ; +fragment DECIMALS + : [0-9] ('_'? [0-9])* + ; +fragment OCTAL_DIGIT + : [0-7] + ; +fragment HEX_DIGIT + : [0-9a-fA-F] + ; +fragment BIN_DIGIT + : [01] + ; +fragment EXPONENT + : [eE] [+-]? DECIMALS + ; +fragment LETTER + : UNICODE_LETTER + | '_' + ; +fragment UNICODE_DIGIT + : [\p{Nd}] + /* [\u0030-\u0039] + | [\u0660-\u0669] + | [\u06F0-\u06F9] + | [\u0966-\u096F] + | [\u09E6-\u09EF] + | [\u0A66-\u0A6F] + | [\u0AE6-\u0AEF] + | [\u0B66-\u0B6F] + | [\u0BE7-\u0BEF] + | [\u0C66-\u0C6F] + | [\u0CE6-\u0CEF] + | [\u0D66-\u0D6F] + | [\u0E50-\u0E59] + | [\u0ED0-\u0ED9] + | [\u0F20-\u0F29] + | [\u1040-\u1049] + | [\u1369-\u1371] + | [\u17E0-\u17E9] + | [\u1810-\u1819] + | [\uFF10-\uFF19]*/ + ; +fragment UNICODE_LETTER + : [\p{L}] + /* [\u0041-\u005A] + | [\u0061-\u007A] + | [\u00AA] + | [\u00B5] + | [\u00BA] + | [\u00C0-\u00D6] + | [\u00D8-\u00F6] + | [\u00F8-\u021F] + | [\u0222-\u0233] + | [\u0250-\u02AD] + | [\u02B0-\u02B8] + | [\u02BB-\u02C1] + | [\u02D0-\u02D1] + | [\u02E0-\u02E4] + | [\u02EE] + | [\u037A] + | [\u0386] + | [\u0388-\u038A] + | [\u038C] + | [\u038E-\u03A1] + | [\u03A3-\u03CE] + | [\u03D0-\u03D7] + | [\u03DA-\u03F3] + | [\u0400-\u0481] + | [\u048C-\u04C4] + | [\u04C7-\u04C8] + | [\u04CB-\u04CC] + | [\u04D0-\u04F5] + | [\u04F8-\u04F9] + | [\u0531-\u0556] + | [\u0559] + | [\u0561-\u0587] + | [\u05D0-\u05EA] + | [\u05F0-\u05F2] + | [\u0621-\u063A] + | [\u0640-\u064A] + | [\u0671-\u06D3] + | [\u06D5] + | [\u06E5-\u06E6] + | [\u06FA-\u06FC] + | [\u0710] + | [\u0712-\u072C] + | [\u0780-\u07A5] + | [\u0905-\u0939] + | [\u093D] + | [\u0950] + | [\u0958-\u0961] + | [\u0985-\u098C] + | [\u098F-\u0990] + | [\u0993-\u09A8] + | [\u09AA-\u09B0] + | [\u09B2] + | [\u09B6-\u09B9] + | [\u09DC-\u09DD] + | [\u09DF-\u09E1] + | [\u09F0-\u09F1] + | [\u0A05-\u0A0A] + | [\u0A0F-\u0A10] + | [\u0A13-\u0A28] + | [\u0A2A-\u0A30] + | [\u0A32-\u0A33] + | [\u0A35-\u0A36] + | [\u0A38-\u0A39] + | [\u0A59-\u0A5C] + | [\u0A5E] + | [\u0A72-\u0A74] + | [\u0A85-\u0A8B] + | [\u0A8D] + | [\u0A8F-\u0A91] + | [\u0A93-\u0AA8] + | [\u0AAA-\u0AB0] + | [\u0AB2-\u0AB3] + | [\u0AB5-\u0AB9] + | [\u0ABD] + | [\u0AD0] + | [\u0AE0] + | [\u0B05-\u0B0C] + | [\u0B0F-\u0B10] + | [\u0B13-\u0B28] + | [\u0B2A-\u0B30] + | [\u0B32-\u0B33] + | [\u0B36-\u0B39] + | [\u0B3D] + | [\u0B5C-\u0B5D] + | [\u0B5F-\u0B61] + | [\u0B85-\u0B8A] + | [\u0B8E-\u0B90] + | [\u0B92-\u0B95] + | [\u0B99-\u0B9A] + | [\u0B9C] + | [\u0B9E-\u0B9F] + | [\u0BA3-\u0BA4] + | [\u0BA8-\u0BAA] + | [\u0BAE-\u0BB5] + | [\u0BB7-\u0BB9] + | [\u0C05-\u0C0C] + | [\u0C0E-\u0C10] + | [\u0C12-\u0C28] + | [\u0C2A-\u0C33] + | [\u0C35-\u0C39] + | [\u0C60-\u0C61] + | [\u0C85-\u0C8C] + | [\u0C8E-\u0C90] + | [\u0C92-\u0CA8] + | [\u0CAA-\u0CB3] + | [\u0CB5-\u0CB9] + | [\u0CDE] + | [\u0CE0-\u0CE1] + | [\u0D05-\u0D0C] + | [\u0D0E-\u0D10] + | [\u0D12-\u0D28] + | [\u0D2A-\u0D39] + | [\u0D60-\u0D61] + | [\u0D85-\u0D96] + | [\u0D9A-\u0DB1] + | [\u0DB3-\u0DBB] + | [\u0DBD] + | [\u0DC0-\u0DC6] + | [\u0E01-\u0E30] + | [\u0E32-\u0E33] + | [\u0E40-\u0E46] + | [\u0E81-\u0E82] + | [\u0E84] + | [\u0E87-\u0E88] + | [\u0E8A] + | [\u0E8D] + | [\u0E94-\u0E97] + | [\u0E99-\u0E9F] + | [\u0EA1-\u0EA3] + | [\u0EA5] + | [\u0EA7] + | [\u0EAA-\u0EAB] + | [\u0EAD-\u0EB0] + | [\u0EB2-\u0EB3] + | [\u0EBD-\u0EC4] + | [\u0EC6] + | [\u0EDC-\u0EDD] + | [\u0F00] + | [\u0F40-\u0F6A] + | [\u0F88-\u0F8B] + | [\u1000-\u1021] + | [\u1023-\u1027] + | [\u1029-\u102A] + | [\u1050-\u1055] + | [\u10A0-\u10C5] + | [\u10D0-\u10F6] + | [\u1100-\u1159] + | [\u115F-\u11A2] + | [\u11A8-\u11F9] + | [\u1200-\u1206] + | [\u1208-\u1246] + | [\u1248] + | [\u124A-\u124D] + | [\u1250-\u1256] + | [\u1258] + | [\u125A-\u125D] + | [\u1260-\u1286] + | [\u1288] + | [\u128A-\u128D] + | [\u1290-\u12AE] + | [\u12B0] + | [\u12B2-\u12B5] + | [\u12B8-\u12BE] + | [\u12C0] + | [\u12C2-\u12C5] + | [\u12C8-\u12CE] + | [\u12D0-\u12D6] + | [\u12D8-\u12EE] + | [\u12F0-\u130E] + | [\u1310] + | [\u1312-\u1315] + | [\u1318-\u131E] + | [\u1320-\u1346] + | [\u1348-\u135A] + | [\u13A0-\u13B0] + | [\u13B1-\u13F4] + | [\u1401-\u1676] + | [\u1681-\u169A] + | [\u16A0-\u16EA] + | [\u1780-\u17B3] + | [\u1820-\u1877] + | [\u1880-\u18A8] + | [\u1E00-\u1E9B] + | [\u1EA0-\u1EE0] + | [\u1EE1-\u1EF9] + | [\u1F00-\u1F15] + | [\u1F18-\u1F1D] + | [\u1F20-\u1F39] + | [\u1F3A-\u1F45] + | [\u1F48-\u1F4D] + | [\u1F50-\u1F57] + | [\u1F59] + | [\u1F5B] + | [\u1F5D] + | [\u1F5F-\u1F7D] + | [\u1F80-\u1FB4] + | [\u1FB6-\u1FBC] + | [\u1FBE] + | [\u1FC2-\u1FC4] + | [\u1FC6-\u1FCC] + | [\u1FD0-\u1FD3] + | [\u1FD6-\u1FDB] + | [\u1FE0-\u1FEC] + | [\u1FF2-\u1FF4] + | [\u1FF6-\u1FFC] + | [\u207F] + | [\u2102] + | [\u2107] + | [\u210A-\u2113] + | [\u2115] + | [\u2119-\u211D] + | [\u2124] + | [\u2126] + | [\u2128] + | [\u212A-\u212D] + | [\u212F-\u2131] + | [\u2133-\u2139] + | [\u2160-\u2183] + | [\u3005-\u3007] + | [\u3021-\u3029] + | [\u3031-\u3035] + | [\u3038-\u303A] + | [\u3041-\u3094] + | [\u309D-\u309E] + | [\u30A1-\u30FA] + | [\u30FC-\u30FE] + | [\u3105-\u312C] + | [\u3131-\u318E] + | [\u31A0-\u31B7] + | [\u3400] + | [\u4DB5] + | [\u4E00] + | [\u9FA5] + | [\uA000-\uA48C] + | [\uAC00] + | [\uD7A3] + | [\uF900-\uFA2D] + | [\uFB00-\uFB06] + | [\uFB13-\uFB17] + | [\uFB1D] + | [\uFB1F-\uFB28] + | [\uFB2A-\uFB36] + | [\uFB38-\uFB3C] + | [\uFB3E] + | [\uFB40-\uFB41] + | [\uFB43-\uFB44] + | [\uFB46-\uFBB1] + | [\uFBD3-\uFD3D] + | [\uFD50-\uFD8F] + | [\uFD92-\uFDC7] + | [\uFDF0-\uFDFB] + | [\uFE70-\uFE72] + | [\uFE74] + | [\uFE76-\uFEFC] + | [\uFF21-\uFF3A] + | [\uFF41-\uFF5A] + | [\uFF66-\uFFBE] + | [\uFFC2-\uFFC7] + | [\uFFCA-\uFFCF] + | [\uFFD2-\uFFD7] + | [\uFFDA-\uFFDC] + */ + ; +mode NLSEMI; +// Treat whitespace as normal +WS_NLSEMI : [ \t]+ -> channel(HIDDEN); +// Ignore any comments that only span one line +COMMENT_NLSEMI : '/*' ~[\r\n]*? '*/' -> channel(HIDDEN); +LINE_COMMENT_NLSEMI : '//' ~[\r\n]* -> channel(HIDDEN); +// Emit an EOS token for any newlines, semicolon, multiline comments or the EOF and +//return to normal lexing +EOS: ([\r\n]+ | ';' | '/*' .*? '*/' | EOF) -> mode(DEFAULT_MODE); +// Did not find an EOS, so go back to normal lexing +OTHER: -> mode(DEFAULT_MODE), channel(HIDDEN); \ No newline at end of file diff --git a/src/main/antlr4/GoParser.g4 b/src/main/antlr4/GoParser.g4 new file mode 100644 index 000000000..0843b0c2c --- /dev/null +++ b/src/main/antlr4/GoParser.g4 @@ -0,0 +1,388 @@ +/* + [The "BSD licence"] + Copyright (c) 2017 Sasa Coh, Michał Błotniak + Copyright (c) 2019 Ivan Kochurkin, kvanttt@gmail.com, Positive Technologies + Copyright (c) 2019 Dmitry Rassadin, flipparassa@gmail.com, Positive Technologies + Copyright (c) 2021 Martin Mirchev, mirchevmartin2203@gmail.com + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + 3. The name of the author may not be used to endorse or promote products + derived from this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ +/* + * A Go grammar for ANTLR 4 derived from the Go Language Specification https://golang.org/ref/spec + */ + +// Imported to Gobra from https://github.com/antlr/grammars-v4/blob/4c06ad8cc8130931c75ca0b17cbc1453f3830cd2/golang + +parser grammar GoParser; + +options { + tokenVocab = GoLexer; + superClass = GoParserBase; +} + +sourceFile: + packageClause eos (importDecl eos)* ( + (functionDecl | methodDecl | declaration) eos + )* EOF; + +packageClause: PACKAGE packageName = IDENTIFIER; + +importDecl: + IMPORT (importSpec | L_PAREN (importSpec eos)* R_PAREN); + +importSpec: alias = (DOT | IDENTIFIER)? importPath; + +importPath: string_; + +declaration: constDecl | typeDecl | varDecl; + +constDecl: CONST (constSpec | L_PAREN (constSpec eos)* R_PAREN); + +constSpec: identifierList (type_? ASSIGN expressionList)?; + +identifierList: IDENTIFIER (COMMA IDENTIFIER)*; + +expressionList: expression (COMMA expression)*; + +typeDecl: TYPE (typeSpec | L_PAREN (typeSpec eos)* R_PAREN); + +typeSpec: IDENTIFIER ASSIGN? type_; + +// Function declarations + +functionDecl: FUNC IDENTIFIER (signature block?); + +methodDecl: FUNC receiver IDENTIFIER ( signature block?); + +receiver: parameters; + +varDecl: VAR (varSpec | L_PAREN (varSpec eos)* R_PAREN); + +varSpec: + identifierList ( + type_ (ASSIGN expressionList)? + | ASSIGN expressionList + ); + +block: L_CURLY statementList? R_CURLY; + +statementList: (eos? statement eos)+; + +statement: + declaration + | labeledStmt + | simpleStmt + | goStmt + | returnStmt + | breakStmt + | continueStmt + | gotoStmt + | fallthroughStmt + | block + | ifStmt + | switchStmt + | selectStmt + | forStmt + | deferStmt; + +simpleStmt: + sendStmt + | incDecStmt + | assignment + | expressionStmt + | shortVarDecl; + +expressionStmt: expression; + +sendStmt: channel = expression RECEIVE expression; + +incDecStmt: expression (PLUS_PLUS | MINUS_MINUS); + +assignment: expressionList assign_op expressionList; + +assign_op: ( + PLUS + | MINUS + | OR + | CARET + | STAR + | DIV + | MOD + | LSHIFT + | RSHIFT + | AMPERSAND + | BIT_CLEAR + )? ASSIGN; + +shortVarDecl: identifierList DECLARE_ASSIGN expressionList; + +emptyStmt: EOS | SEMI; + +labeledStmt: IDENTIFIER COLON statement?; + +returnStmt: RETURN expressionList?; + +breakStmt: BREAK IDENTIFIER?; + +continueStmt: CONTINUE IDENTIFIER?; + +gotoStmt: GOTO IDENTIFIER; + +fallthroughStmt: FALLTHROUGH; + +deferStmt: DEFER expression; + +ifStmt: + IF ( expression + | eos expression + | simpleStmt eos expression + ) block ( + ELSE (ifStmt | block) + )?; + +switchStmt: exprSwitchStmt | typeSwitchStmt; + +exprSwitchStmt: + SWITCH (expression? + | simpleStmt? eos expression? + ) L_CURLY exprCaseClause* R_CURLY; + +exprCaseClause: exprSwitchCase COLON statementList?; + +exprSwitchCase: CASE expressionList | DEFAULT; + +typeSwitchStmt: + SWITCH ( typeSwitchGuard + | eos typeSwitchGuard + | simpleStmt eos typeSwitchGuard) + L_CURLY typeCaseClause* R_CURLY; + +typeSwitchGuard: (IDENTIFIER DECLARE_ASSIGN)? primaryExpr DOT L_PAREN TYPE R_PAREN; + +typeCaseClause: typeSwitchCase COLON statementList?; + +typeSwitchCase: CASE typeList | DEFAULT; + +typeList: (type_ | NIL_LIT) (COMMA (type_ | NIL_LIT))*; + +selectStmt: SELECT L_CURLY commClause* R_CURLY; + +commClause: commCase COLON statementList?; + +commCase: CASE (sendStmt | recvStmt) | DEFAULT; + +recvStmt: (expressionList ASSIGN | identifierList DECLARE_ASSIGN)? recvExpr = expression; + +forStmt: FOR (expression | forClause | rangeClause)? block; + +forClause: + initStmt = simpleStmt? eos expression? eos postStmt = simpleStmt?; + +rangeClause: ( + expressionList ASSIGN + | identifierList DECLARE_ASSIGN + )? RANGE expression; + +goStmt: GO expression; + +type_: typeName | typeLit | L_PAREN type_ R_PAREN; + +typeName: qualifiedIdent | IDENTIFIER; + +typeLit: + arrayType + | structType + | pointerType + | functionType + | interfaceType + | sliceType + | mapType + | channelType; + +arrayType: L_BRACKET arrayLength R_BRACKET elementType; + +arrayLength: expression; + +elementType: type_; + +pointerType: STAR type_; + +interfaceType: + INTERFACE L_CURLY ((methodSpec | typeName) eos)* R_CURLY; + +sliceType: L_BRACKET R_BRACKET elementType; + +// It's possible to replace `type` with more restricted typeLit list and also pay attention to nil maps +mapType: MAP L_BRACKET type_ R_BRACKET elementType; + +channelType: (CHAN | CHAN RECEIVE | RECEIVE CHAN) elementType; + +methodSpec: + IDENTIFIER parameters result + | IDENTIFIER parameters; + +functionType: FUNC signature; + +signature: + parameters result + | parameters; + +result: parameters | type_; + +parameters: + L_PAREN (parameterDecl (COMMA parameterDecl)* COMMA?)? R_PAREN; + +parameterDecl: identifierList? ELLIPSIS? type_; + +expression: + primaryExpr + | unary_op = ( + PLUS + | MINUS + | EXCLAMATION + | CARET + | STAR + | AMPERSAND + | RECEIVE + ) expression + | expression mul_op = ( + STAR + | DIV + | MOD + | LSHIFT + | RSHIFT + | AMPERSAND + | BIT_CLEAR + ) expression + | expression add_op = (PLUS | MINUS | OR | CARET) expression + | expression rel_op = ( + EQUALS + | NOT_EQUALS + | LESS + | LESS_OR_EQUALS + | GREATER + | GREATER_OR_EQUALS + ) expression + | expression LOGICAL_AND expression + | expression LOGICAL_OR expression; + +primaryExpr: + operand + | conversion + | methodExpr + | primaryExpr ( + (DOT IDENTIFIER) + | index + | slice_ + | typeAssertion + | arguments + ); + + +conversion: nonNamedType L_PAREN expression COMMA? R_PAREN; + +nonNamedType: typeLit | L_PAREN nonNamedType R_PAREN; + +operand: literal | operandName | L_PAREN expression R_PAREN; + +literal: basicLit | compositeLit | functionLit; + +basicLit: + NIL_LIT + | integer + | string_ + | FLOAT_LIT; + +integer: + DECIMAL_LIT + | BINARY_LIT + | OCTAL_LIT + | HEX_LIT + | IMAGINARY_LIT + | RUNE_LIT; + +operandName: IDENTIFIER; + +qualifiedIdent: IDENTIFIER DOT IDENTIFIER; + +compositeLit: literalType literalValue; + +literalType: + structType + | arrayType + | L_BRACKET ELLIPSIS R_BRACKET elementType + | sliceType + | mapType + | typeName; + +literalValue: L_CURLY (elementList COMMA?)? R_CURLY; + +elementList: keyedElement (COMMA keyedElement)*; + +keyedElement: (key COLON)? element; + +key: expression | literalValue; + +element: expression | literalValue; + +structType: STRUCT L_CURLY (fieldDecl eos)* R_CURLY; + +fieldDecl: ( + identifierList type_ + | embeddedField + ) tag = string_?; + +string_: RAW_STRING_LIT | INTERPRETED_STRING_LIT; + +embeddedField: STAR? typeName; + +functionLit: FUNC signature block; // function + +index: L_BRACKET expression R_BRACKET; + +slice_: + L_BRACKET ( + expression? COLON expression? + | expression? COLON expression COLON expression + ) R_BRACKET; + +typeAssertion: DOT L_PAREN type_ R_PAREN; + +arguments: + L_PAREN ( + (expressionList | nonNamedType (COMMA expressionList)?) ELLIPSIS? COMMA? + )? R_PAREN; + +methodExpr: nonNamedType DOT IDENTIFIER; + +//receiverType: typeName | '(' ('*' typeName | receiverType) ')'; + +receiverType: type_; + +eos: + SEMI + | EOF + | EOS + | {closingBracket()}? + ; \ No newline at end of file diff --git a/src/main/antlr4/GobraLexer.g4 b/src/main/antlr4/GobraLexer.g4 new file mode 100644 index 000000000..a615b50af --- /dev/null +++ b/src/main/antlr4/GobraLexer.g4 @@ -0,0 +1,79 @@ +// This Source Code Form is subject to the terms of the Mozilla Public +// License, v. 2.0. If a copy of the MPL was not distributed with this +// file, You can obtain one at http://mozilla.org/MPL/2.0/. +// +// Copyright (c) 2011-2020 ETH Zurich. + +lexer grammar GobraLexer; +import GoLexer; + +FLOAT_LIT : (DECIMAL_FLOAT_LIT | HEX_FLOAT_LIT) -> mode(NLSEMI); + +// Add lookahead to avoid parsing range expressions like '[1..3]' as two floats '1.' and '.3' +DECIMAL_FLOAT_LIT : DECIMALS ('.'{_input.LA(1) != '.'}? DECIMALS? EXPONENT? | EXPONENT) + | '.'{_input.index() <2 || _input.LA(-2) != '.'}? DECIMALS EXPONENT? + ; + +// ->mode(NLSEMI) means line breaks directly after this token +// emit a semicolon. (just like after identifiers, literals, ')}]' etc in base Go) + +TRUE : 'true' -> mode(NLSEMI); +FALSE : 'false' -> mode(NLSEMI); +ASSERT : 'assert'; +ASSUME : 'assume'; +INHALE : 'inhale'; +EXHALE : 'exhale'; +PRE : 'requires'; +PRESERVES : 'preserves'; +POST : 'ensures'; +INV : 'invariant'; +DEC : 'decreases' -> mode(NLSEMI); +PURE : 'pure' -> mode(NLSEMI); +IMPL : 'implements'; +OLD : 'old'-> mode(NLSEMI); +LHS : '#lhs'; +FORALL : 'forall'; +EXISTS : 'exists'; +ACCESS : 'acc' -> mode(NLSEMI); +FOLD : 'fold'; +UNFOLD : 'unfold'; +UNFOLDING : 'unfolding'; +GHOST : 'ghost'; +IN : 'in'; +MULTI : '#'; +SUBSET : 'subset'; +UNION : 'union'; +INTERSECTION: 'intersection'; +SETMINUS : 'setminus'; +IMPLIES : '==>'; +WAND : '--*'; +APPLY : 'apply'; +QMARK : '?'; +L_PRED : '!<'; +R_PRED : '!>' -> mode(NLSEMI); +SEQ : 'seq'-> mode(NLSEMI); +SET : 'set'-> mode(NLSEMI); +MSET : 'mset'-> mode(NLSEMI); +DICT : 'dict'-> mode(NLSEMI); +OPT : 'option'-> mode(NLSEMI); +LEN : 'len'-> mode(NLSEMI); +NEW : 'new'-> mode(NLSEMI); +MAKE : 'make'-> mode(NLSEMI); +CAP : 'cap'-> mode(NLSEMI); +SOME : 'some'-> mode(NLSEMI); +GET : 'get'-> mode(NLSEMI); +DOM : 'domain'-> mode(NLSEMI); +AXIOM : 'axiom'-> mode(NLSEMI); +NONE : 'none' -> mode(NLSEMI); +PRED : 'pred'; +TYPE_OF : 'typeOf'-> mode(NLSEMI); +IS_COMPARABLE: 'isComparable'-> mode(NLSEMI); +SHARE : 'share'; +ADDR_MOD : '@'-> mode(NLSEMI); +DOT_DOT : '..'; +SHARED : 'shared'; +EXCLUSIVE : 'exclusive'; +PREDICATE : 'predicate'; +WRITEPERM : 'writePerm' -> mode(NLSEMI); +NOPERM : 'noPerm' -> mode(NLSEMI); +TRUSTED : 'trusted' -> mode(NLSEMI); \ No newline at end of file diff --git a/src/main/antlr4/GobraParser.g4 b/src/main/antlr4/GobraParser.g4 new file mode 100644 index 000000000..24761310b --- /dev/null +++ b/src/main/antlr4/GobraParser.g4 @@ -0,0 +1,394 @@ +// This Source Code Form is subject to the terms of the Mozilla Public +// License, v. 2.0. If a copy of the MPL was not distributed with this +// file, You can obtain one at http://mozilla.org/MPL/2.0/. +// +// Copyright (c) 2011-2020 ETH Zurich. + +parser grammar GobraParser; +import GoParser; + +options { + tokenVocab = GobraLexer; + superClass = GobraParserBase; +} +/////////////////// +// New Rules // +/////////////////// + +@members {boolean specOnly = false;} + +// Rules for fine-grained parsing. Without the EOF, they might only parse parts of the input +// and succeed instead of failing +exprOnly: expression EOF; + +stmtOnly: statement EOF; + +typeOnly: type_ EOF; + + +// Identifier lists with added addressability modifiers +maybeAddressableIdentifierList: maybeAddressableIdentifier (COMMA maybeAddressableIdentifier)*; + + +maybeAddressableIdentifier: IDENTIFIER ADDR_MOD?; + +// Ghost members + +sourceFile: + packageClause eos (importDecl eos)* ( + (specMember | declaration | ghostMember) eos + )* EOF; + +ghostMember: implementationProof + | fpredicateDecl + | mpredicateDecl + | explicitGhostMember; + +// Ghost statements + +ghostStatement: + GHOST statement #explicitGhostStatement + | fold_stmt=(FOLD | UNFOLD) predicateAccess #foldStatement + | kind=(ASSUME | ASSERT | INHALE | EXHALE) expression #proofStatement + ; + +// Ghost Primary Expressions + +ghostPrimaryExpr: range + | access + | typeOf + | typeExpr + | isComparable + | old + | sConversion + | optionNone | optionSome | optionGet + | permission; + +permission: WRITEPERM | NOPERM; + +typeExpr: TYPE L_BRACKET type_ R_BRACKET; + +boundVariables + : boundVariableDecl (COMMA boundVariableDecl)* COMMA? + ; + +boundVariableDecl + : IDENTIFIER (COMMA IDENTIFIER)* elementType + ; + +triggers: trigger*; + +trigger: L_CURLY expression (COMMA expression)* R_CURLY; + +predicateAccess: primaryExpr; + +optionSome: SOME L_PAREN expression R_PAREN; + +optionNone: NONE L_BRACKET type_ R_BRACKET; + +optionGet: GET L_PAREN expression R_PAREN; + +sConversion: kind=(SET | SEQ | MSET) L_PAREN expression R_PAREN; + +old: OLD (L_BRACKET oldLabelUse R_BRACKET)? L_PAREN expression R_PAREN; + +oldLabelUse: labelUse | LHS; + +labelUse: IDENTIFIER; + +isComparable: IS_COMPARABLE L_PAREN expression R_PAREN; + +typeOf: TYPE_OF L_PAREN expression R_PAREN; + +access: ACCESS L_PAREN expression (COMMA expression)? R_PAREN; + +range: kind=(SEQ | SET | MSET) L_BRACKET expression DOT_DOT expression R_BRACKET; + +// Added directly to primaryExpr +seqUpdExp: L_BRACKET (seqUpdClause (COMMA seqUpdClause)*) R_BRACKET; + +seqUpdClause: expression ASSIGN expression; + +// Ghost Type Literals + +ghostTypeLit: sqType | ghostSliceType | domainType; + +domainType: DOM L_CURLY (domainClause eos)* R_CURLY; + +domainClause: FUNC IDENTIFIER signature | AXIOM L_CURLY expression eos R_CURLY; + +ghostSliceType: GHOST L_BRACKET R_BRACKET elementType; + +sqType: (kind=(SEQ | SET | MSET | OPT) L_BRACKET type_ R_BRACKET) + | kind=DICT L_BRACKET type_ R_BRACKET type_; + +// Specifications + +specification returns[boolean trusted = false, boolean pure = false;]: + ((specStatement | PURE {$pure = true;} | TRUSTED {$trusted = true;}) eos)*? (PURE {$pure = true;})? // Non-greedily match PURE to avoid missing eos errors. + ; + +specStatement + : kind=PRE assertion + | kind=PRESERVES assertion + | kind=POST assertion + | kind=DEC terminationMeasure + ; +terminationMeasure: expressionList? (IF expression)?; + +assertion: + | expression + ; + +blockWithBodyParameterInfo: L_CURLY (SHARE identifierList eos)? statementList? R_CURLY; + +// Implementation proofs +implementationProof: type_ IMPL type_ (L_CURLY (implementationProofPredicateAlias eos)* (methodImplementationProof eos)* R_CURLY)?; + +methodImplementationProof: PURE? nonLocalReceiver IDENTIFIER signature block?; + +nonLocalReceiver: L_PAREN IDENTIFIER? STAR? typeName R_PAREN; + +// Selection matches any primary Expression, make sure to check if it is truly a selection +// This cannot be done in the parser because of precedence +selection: primaryExpr + | type_ DOT IDENTIFIER; + +implementationProofPredicateAlias: PRED IDENTIFIER DECLARE_ASSIGN (selection | operandName); + +// Built-in methods baked into the parser for now +make: MAKE L_PAREN type_ (COMMA expressionList)? R_PAREN; + +new_: NEW L_PAREN type_ R_PAREN; + + +/////////////////// +// Changed Rules // +/////////////////// + +// Added specifications and parameter info + +specMember: specification (functionDecl[$specification.trusted, $specification.pure] | methodDecl[$specification.trusted, $specification.pure]); + +functionDecl[boolean trusted, boolean pure]: FUNC IDENTIFIER (signature blockWithBodyParameterInfo?); + +methodDecl[boolean trusted, boolean pure]: FUNC receiver IDENTIFIER (signature blockWithBodyParameterInfo?); + + + +explicitGhostMember: GHOST (specMember | declaration); + +fpredicateDecl: PRED IDENTIFIER parameters predicateBody?; + +predicateBody: L_CURLY expression eos R_CURLY; + +mpredicateDecl: PRED receiver IDENTIFIER parameters predicateBody?; + + +// Addressability + +varSpec: + maybeAddressableIdentifierList ( + type_ (ASSIGN expressionList)? + | ASSIGN expressionList + ); + +shortVarDecl: maybeAddressableIdentifierList DECLARE_ASSIGN expressionList; + +receiver: L_PAREN maybeAddressableIdentifier? type_ COMMA? R_PAREN; + + +// Added ghost parameters +parameterDecl: actualParameterDecl | ghostParameterDecl; + +actualParameterDecl: identifierList? parameterType; + +ghostParameterDecl: GHOST identifierList? parameterType; + +parameterType: ELLIPSIS? type_; + +// Added Gobra's operators (set, wand, quantifications, etc) +expression: + unary_op = ( + PLUS + | MINUS + | EXCLAMATION + | CARET + | STAR + | AMPERSAND + | RECEIVE + ) expression #unaryExpr + | primaryExpr #primaryExpr_ + | expression mul_op = ( + STAR + | DIV + | MOD + | LSHIFT + | RSHIFT + | AMPERSAND + | BIT_CLEAR + ) expression #mulExpr + | expression add_op = (PLUS | MINUS | OR | CARET | PLUS_PLUS | WAND) expression #addExpr + | expression p42_op = ( + UNION + | INTERSECTION + | SETMINUS + ) expression #p42Expr + | expression p41_op = ( + IN + | MULTI + | SUBSET + ) expression #p41Expr + | expression rel_op = ( + EQUALS + | NOT_EQUALS + | LESS + | LESS_OR_EQUALS + | GREATER + | GREATER_OR_EQUALS + ) expression #relExpr + | expression LOGICAL_AND expression #andExpr + | expression LOGICAL_OR expression #orExpr + | expression IMPLIES expression #implication + | expression QMARK expression COLON expression #ternaryExpr + | UNFOLDING predicateAccess IN expression #unfolding + | (FORALL | EXISTS) boundVariables COLON COLON triggers expression #quantification + ; + + +// Added ghost statements +statement: + ghostStatement + | packageStmt + | applyStmt + | declaration + | labeledStmt + | simpleStmt + | goStmt + | returnStmt + | breakStmt + | continueStmt + | gotoStmt + | fallthroughStmt + | block + | ifStmt + | switchStmt + | selectStmt + | specForStmt + | deferStmt; + +applyStmt: APPLY expression; + +packageStmt: PACKAGE expression block?; + +specForStmt: loopSpec forStmt; + +loopSpec: (INV expression eos)* (DEC terminationMeasure eos)?; + + +// Added true, false as literals +basicLit: + TRUE + | FALSE + | NIL_LIT + | integer + | string_ + | FLOAT_LIT + | IMAGINARY_LIT + | RUNE_LIT; + +// Added ghostPrimaryExprs +primaryExpr: + operand #operandPrimaryExpr + | conversion #conversionPrimaryExpr + | methodExpr #methodPrimaryExpr + | ghostPrimaryExpr #ghostPrimaryExpr_ + | new_ #newExpr + | make #makeExpr + | primaryExpr DOT IDENTIFIER #selectorPrimaryExpr + | primaryExpr index #indexPrimaryExpr + | primaryExpr slice_ #slicePrimaryExpr + | primaryExpr seqUpdExp #seqUpdPrimaryExpr + | primaryExpr typeAssertion #typeAssertionPrimaryExpr + | primaryExpr arguments #invokePrimaryExpr + | primaryExpr predConstructArgs #predConstrPrimaryExpr + | call_op=( + LEN + | CAP + | DOM + | RANGE + ) L_PAREN expression R_PAREN #builtInCallExpr // Remove this alternative when predeclared functions are properly handled + ; + +predConstructArgs: L_PRED expressionList? COMMA? R_PRED; + +// Added predicate spec and method specifications +interfaceType: + INTERFACE L_CURLY ((methodSpec | typeName| predicateSpec) eos)* R_CURLY; + +predicateSpec: PRED IDENTIFIER parameters; + +methodSpec: + GHOST? specification IDENTIFIER parameters result + | GHOST? specification IDENTIFIER parameters; + +// Added ghostTypeLiterals +type_: typeName | typeLit | ghostTypeLit | L_PAREN type_ R_PAREN; + +// Added pred types +typeLit: + arrayType + | structType + | pointerType + | functionType + | interfaceType + | sliceType + | mapType + | channelType + | predType; + +predType: PRED predTypeParams; + +predTypeParams: L_PAREN (type_ (COMMA type_)* COMMA?)? R_PAREN; + +// Added ghost type and moved implicit size arrays to their own rule +literalType: + structType + | arrayType + | implicitArray + | sliceType + | mapType + | ghostTypeLit + | typeName; + +implicitArray: L_BRACKET ELLIPSIS R_BRACKET elementType; + +// ANTLR Grammar fixes + +// distinguish low,high cap +slice_: + L_BRACKET ( + low? COLON high? + | low? COLON high COLON cap + ) R_BRACKET; + +low : expression; +high: expression; +cap: expression; + + + +// Introduce label for operator +assign_op: ass_op=( + PLUS + | MINUS + | OR + | CARET + | STAR + | DIV + | MOD + | LSHIFT + | RSHIFT + | AMPERSAND + | BIT_CLEAR + )? ASSIGN; diff --git a/src/main/java/viper/gobra/frontend/GobraLexer.java b/src/main/java/viper/gobra/frontend/GobraLexer.java new file mode 100644 index 000000000..363346b02 --- /dev/null +++ b/src/main/java/viper/gobra/frontend/GobraLexer.java @@ -0,0 +1,874 @@ +// Generated from /home/nico/Documents/repositories/projects/eth/BA/gobraHome/gobra/src/main/antlr4/GobraLexer.g4 by ANTLR 4.9.2 +package viper.gobra.frontend; +import org.antlr.v4.runtime.Lexer; +import org.antlr.v4.runtime.CharStream; +import org.antlr.v4.runtime.Token; +import org.antlr.v4.runtime.TokenStream; +import org.antlr.v4.runtime.*; +import org.antlr.v4.runtime.atn.*; +import org.antlr.v4.runtime.dfa.DFA; +import org.antlr.v4.runtime.misc.*; + +@SuppressWarnings({"all", "warnings", "unchecked", "unused", "cast"}) +public class GobraLexer extends Lexer { + static { RuntimeMetaData.checkVersion("4.9.2", RuntimeMetaData.VERSION); } + + protected static final DFA[] _decisionToDFA; + protected static final PredictionContextCache _sharedContextCache = + new PredictionContextCache(); + public static final int + FLOAT_LIT=1, DECIMAL_FLOAT_LIT=2, TRUE=3, FALSE=4, ASSERT=5, ASSUME=6, + INHALE=7, EXHALE=8, PRE=9, PRESERVES=10, POST=11, INV=12, DEC=13, PURE=14, + IMPL=15, OLD=16, LHS=17, FORALL=18, EXISTS=19, ACCESS=20, FOLD=21, UNFOLD=22, + UNFOLDING=23, GHOST=24, IN=25, MULTI=26, SUBSET=27, UNION=28, INTERSECTION=29, + SETMINUS=30, IMPLIES=31, WAND=32, APPLY=33, QMARK=34, L_PRED=35, R_PRED=36, + SEQ=37, SET=38, MSET=39, DICT=40, OPT=41, LEN=42, NEW=43, MAKE=44, CAP=45, + SOME=46, GET=47, DOM=48, AXIOM=49, NONE=50, PRED=51, TYPE_OF=52, IS_COMPARABLE=53, + SHARE=54, ADDR_MOD=55, DOT_DOT=56, SHARED=57, EXCLUSIVE=58, PREDICATE=59, + WRITEPERM=60, NOPERM=61, TRUSTED=62, BREAK=63, DEFAULT=64, FUNC=65, INTERFACE=66, + SELECT=67, CASE=68, DEFER=69, GO=70, MAP=71, STRUCT=72, CHAN=73, ELSE=74, + GOTO=75, PACKAGE=76, SWITCH=77, CONST=78, FALLTHROUGH=79, IF=80, RANGE=81, + TYPE=82, CONTINUE=83, FOR=84, IMPORT=85, RETURN=86, VAR=87, NIL_LIT=88, + IDENTIFIER=89, L_PAREN=90, R_PAREN=91, L_CURLY=92, R_CURLY=93, L_BRACKET=94, + R_BRACKET=95, ASSIGN=96, COMMA=97, SEMI=98, COLON=99, DOT=100, PLUS_PLUS=101, + MINUS_MINUS=102, DECLARE_ASSIGN=103, ELLIPSIS=104, LOGICAL_OR=105, LOGICAL_AND=106, + EQUALS=107, NOT_EQUALS=108, LESS=109, LESS_OR_EQUALS=110, GREATER=111, + GREATER_OR_EQUALS=112, OR=113, DIV=114, MOD=115, LSHIFT=116, RSHIFT=117, + BIT_CLEAR=118, EXCLAMATION=119, PLUS=120, MINUS=121, CARET=122, STAR=123, + AMPERSAND=124, RECEIVE=125, DECIMAL_LIT=126, BINARY_LIT=127, OCTAL_LIT=128, + HEX_LIT=129, HEX_FLOAT_LIT=130, IMAGINARY_LIT=131, RUNE_LIT=132, BYTE_VALUE=133, + OCTAL_BYTE_VALUE=134, HEX_BYTE_VALUE=135, LITTLE_U_VALUE=136, BIG_U_VALUE=137, + RAW_STRING_LIT=138, INTERPRETED_STRING_LIT=139, WS=140, COMMENT=141, TERMINATOR=142, + LINE_COMMENT=143, WS_NLSEMI=144, COMMENT_NLSEMI=145, LINE_COMMENT_NLSEMI=146, + EOS=147, OTHER=148; + public static final int + NLSEMI=1; + public static String[] channelNames = { + "DEFAULT_TOKEN_CHANNEL", "HIDDEN" + }; + + public static String[] modeNames = { + "DEFAULT_MODE", "NLSEMI" + }; + + private static String[] makeRuleNames() { + return new String[] { + "FLOAT_LIT", "DECIMAL_FLOAT_LIT", "TRUE", "FALSE", "ASSERT", "ASSUME", + "INHALE", "EXHALE", "PRE", "PRESERVES", "POST", "INV", "DEC", "PURE", + "IMPL", "OLD", "LHS", "FORALL", "EXISTS", "ACCESS", "FOLD", "UNFOLD", + "UNFOLDING", "GHOST", "IN", "MULTI", "SUBSET", "UNION", "INTERSECTION", + "SETMINUS", "IMPLIES", "WAND", "APPLY", "QMARK", "L_PRED", "R_PRED", + "SEQ", "SET", "MSET", "DICT", "OPT", "LEN", "NEW", "MAKE", "CAP", "SOME", + "GET", "DOM", "AXIOM", "NONE", "PRED", "TYPE_OF", "IS_COMPARABLE", "SHARE", + "ADDR_MOD", "DOT_DOT", "SHARED", "EXCLUSIVE", "PREDICATE", "WRITEPERM", + "NOPERM", "TRUSTED", "BREAK", "DEFAULT", "FUNC", "INTERFACE", "SELECT", + "CASE", "DEFER", "GO", "MAP", "STRUCT", "CHAN", "ELSE", "GOTO", "PACKAGE", + "SWITCH", "CONST", "FALLTHROUGH", "IF", "RANGE", "TYPE", "CONTINUE", + "FOR", "IMPORT", "RETURN", "VAR", "NIL_LIT", "IDENTIFIER", "L_PAREN", + "R_PAREN", "L_CURLY", "R_CURLY", "L_BRACKET", "R_BRACKET", "ASSIGN", + "COMMA", "SEMI", "COLON", "DOT", "PLUS_PLUS", "MINUS_MINUS", "DECLARE_ASSIGN", + "ELLIPSIS", "LOGICAL_OR", "LOGICAL_AND", "EQUALS", "NOT_EQUALS", "LESS", + "LESS_OR_EQUALS", "GREATER", "GREATER_OR_EQUALS", "OR", "DIV", "MOD", + "LSHIFT", "RSHIFT", "BIT_CLEAR", "EXCLAMATION", "PLUS", "MINUS", "CARET", + "STAR", "AMPERSAND", "RECEIVE", "DECIMAL_LIT", "BINARY_LIT", "OCTAL_LIT", + "HEX_LIT", "HEX_FLOAT_LIT", "HEX_MANTISSA", "HEX_EXPONENT", "IMAGINARY_LIT", + "RUNE", "RUNE_LIT", "BYTE_VALUE", "OCTAL_BYTE_VALUE", "HEX_BYTE_VALUE", + "LITTLE_U_VALUE", "BIG_U_VALUE", "RAW_STRING_LIT", "INTERPRETED_STRING_LIT", + "WS", "COMMENT", "TERMINATOR", "LINE_COMMENT", "UNICODE_VALUE", "ESCAPED_VALUE", + "DECIMALS", "OCTAL_DIGIT", "HEX_DIGIT", "BIN_DIGIT", "EXPONENT", "LETTER", + "UNICODE_DIGIT", "UNICODE_LETTER", "WS_NLSEMI", "COMMENT_NLSEMI", "LINE_COMMENT_NLSEMI", + "EOS", "OTHER" + }; + } + public static final String[] ruleNames = makeRuleNames(); + + private static String[] makeLiteralNames() { + return new String[] { + null, null, null, "'true'", "'false'", "'assert'", "'assume'", "'inhale'", + "'exhale'", "'requires'", "'preserves'", "'ensures'", "'invariant'", + "'decreases'", "'pure'", "'implements'", "'old'", "'#lhs'", "'forall'", + "'exists'", "'acc'", "'fold'", "'unfold'", "'unfolding'", "'ghost'", + "'in'", "'#'", "'subset'", "'union'", "'intersection'", "'setminus'", + "'==>'", "'--*'", "'apply'", "'?'", "'!<'", "'!>'", "'seq'", "'set'", + "'mset'", "'dict'", "'option'", "'len'", "'new'", "'make'", "'cap'", + "'some'", "'get'", "'domain'", "'axiom'", "'none'", "'pred'", "'typeOf'", + "'isComparable'", "'share'", "'@'", "'..'", "'shared'", "'exclusive'", + "'predicate'", "'writePerm'", "'noPerm'", "'trusted'", "'break'", "'default'", + "'func'", "'interface'", "'select'", "'case'", "'defer'", "'go'", "'map'", + "'struct'", "'chan'", "'else'", "'goto'", "'package'", "'switch'", "'const'", + "'fallthrough'", "'if'", "'range'", "'type'", "'continue'", "'for'", + "'import'", "'return'", "'var'", "'nil'", null, "'('", "')'", "'{'", + "'}'", "'['", "']'", "'='", "','", "';'", "':'", "'.'", "'++'", "'--'", + "':='", "'...'", "'||'", "'&&'", "'=='", "'!='", "'<'", "'<='", "'>'", + "'>='", "'|'", "'/'", "'%'", "'<<'", "'>>'", "'&^'", "'!'", "'+'", "'-'", + "'^'", "'*'", "'&'", "'<-'" + }; + } + private static final String[] _LITERAL_NAMES = makeLiteralNames(); + private static String[] makeSymbolicNames() { + return new String[] { + null, "FLOAT_LIT", "DECIMAL_FLOAT_LIT", "TRUE", "FALSE", "ASSERT", "ASSUME", + "INHALE", "EXHALE", "PRE", "PRESERVES", "POST", "INV", "DEC", "PURE", + "IMPL", "OLD", "LHS", "FORALL", "EXISTS", "ACCESS", "FOLD", "UNFOLD", + "UNFOLDING", "GHOST", "IN", "MULTI", "SUBSET", "UNION", "INTERSECTION", + "SETMINUS", "IMPLIES", "WAND", "APPLY", "QMARK", "L_PRED", "R_PRED", + "SEQ", "SET", "MSET", "DICT", "OPT", "LEN", "NEW", "MAKE", "CAP", "SOME", + "GET", "DOM", "AXIOM", "NONE", "PRED", "TYPE_OF", "IS_COMPARABLE", "SHARE", + "ADDR_MOD", "DOT_DOT", "SHARED", "EXCLUSIVE", "PREDICATE", "WRITEPERM", + "NOPERM", "TRUSTED", "BREAK", "DEFAULT", "FUNC", "INTERFACE", "SELECT", + "CASE", "DEFER", "GO", "MAP", "STRUCT", "CHAN", "ELSE", "GOTO", "PACKAGE", + "SWITCH", "CONST", "FALLTHROUGH", "IF", "RANGE", "TYPE", "CONTINUE", + "FOR", "IMPORT", "RETURN", "VAR", "NIL_LIT", "IDENTIFIER", "L_PAREN", + "R_PAREN", "L_CURLY", "R_CURLY", "L_BRACKET", "R_BRACKET", "ASSIGN", + "COMMA", "SEMI", "COLON", "DOT", "PLUS_PLUS", "MINUS_MINUS", "DECLARE_ASSIGN", + "ELLIPSIS", "LOGICAL_OR", "LOGICAL_AND", "EQUALS", "NOT_EQUALS", "LESS", + "LESS_OR_EQUALS", "GREATER", "GREATER_OR_EQUALS", "OR", "DIV", "MOD", + "LSHIFT", "RSHIFT", "BIT_CLEAR", "EXCLAMATION", "PLUS", "MINUS", "CARET", + "STAR", "AMPERSAND", "RECEIVE", "DECIMAL_LIT", "BINARY_LIT", "OCTAL_LIT", + "HEX_LIT", "HEX_FLOAT_LIT", "IMAGINARY_LIT", "RUNE_LIT", "BYTE_VALUE", + "OCTAL_BYTE_VALUE", "HEX_BYTE_VALUE", "LITTLE_U_VALUE", "BIG_U_VALUE", + "RAW_STRING_LIT", "INTERPRETED_STRING_LIT", "WS", "COMMENT", "TERMINATOR", + "LINE_COMMENT", "WS_NLSEMI", "COMMENT_NLSEMI", "LINE_COMMENT_NLSEMI", + "EOS", "OTHER" + }; + } + private static final String[] _SYMBOLIC_NAMES = makeSymbolicNames(); + public static final Vocabulary VOCABULARY = new VocabularyImpl(_LITERAL_NAMES, _SYMBOLIC_NAMES); + + /** + * @deprecated Use {@link #VOCABULARY} instead. + */ + @Deprecated + public static final String[] tokenNames; + static { + tokenNames = new String[_SYMBOLIC_NAMES.length]; + for (int i = 0; i < tokenNames.length; i++) { + tokenNames[i] = VOCABULARY.getLiteralName(i); + if (tokenNames[i] == null) { + tokenNames[i] = VOCABULARY.getSymbolicName(i); + } + + if (tokenNames[i] == null) { + tokenNames[i] = ""; + } + } + } + + @Override + @Deprecated + public String[] getTokenNames() { + return tokenNames; + } + + @Override + + public Vocabulary getVocabulary() { + return VOCABULARY; + } + + + public GobraLexer(CharStream input) { + super(input); + _interp = new LexerATNSimulator(this,_ATN,_decisionToDFA,_sharedContextCache); + } + + @Override + public String getGrammarFileName() { return "GobraLexer.g4"; } + + @Override + public String[] getRuleNames() { return ruleNames; } + + @Override + public String getSerializedATN() { return _serializedATN; } + + @Override + public String[] getChannelNames() { return channelNames; } + + @Override + public String[] getModeNames() { return modeNames; } + + @Override + public ATN getATN() { return _ATN; } + + @Override + public boolean sempred(RuleContext _localctx, int ruleIndex, int predIndex) { + switch (ruleIndex) { + case 1: + return DECIMAL_FLOAT_LIT_sempred((RuleContext)_localctx, predIndex); + } + return true; + } + private boolean DECIMAL_FLOAT_LIT_sempred(RuleContext _localctx, int predIndex) { + switch (predIndex) { + case 0: + return _input.LA(1) != '.'; + case 1: + return _input.index() <2 || _input.LA(-2) != '.'; + } + return true; + } + + public static final String _serializedATN = + "\3\u608b\ua72a\u8133\ub9ed\u417c\u3be7\u7786\u5964\2\u0096\u056f\b\1\b"+ + "\1\4\2\t\2\4\3\t\3\4\4\t\4\4\5\t\5\4\6\t\6\4\7\t\7\4\b\t\b\4\t\t\t\4\n"+ + "\t\n\4\13\t\13\4\f\t\f\4\r\t\r\4\16\t\16\4\17\t\17\4\20\t\20\4\21\t\21"+ + "\4\22\t\22\4\23\t\23\4\24\t\24\4\25\t\25\4\26\t\26\4\27\t\27\4\30\t\30"+ + "\4\31\t\31\4\32\t\32\4\33\t\33\4\34\t\34\4\35\t\35\4\36\t\36\4\37\t\37"+ + "\4 \t \4!\t!\4\"\t\"\4#\t#\4$\t$\4%\t%\4&\t&\4\'\t\'\4(\t(\4)\t)\4*\t"+ + "*\4+\t+\4,\t,\4-\t-\4.\t.\4/\t/\4\60\t\60\4\61\t\61\4\62\t\62\4\63\t\63"+ + "\4\64\t\64\4\65\t\65\4\66\t\66\4\67\t\67\48\t8\49\t9\4:\t:\4;\t;\4<\t"+ + "<\4=\t=\4>\t>\4?\t?\4@\t@\4A\tA\4B\tB\4C\tC\4D\tD\4E\tE\4F\tF\4G\tG\4"+ + "H\tH\4I\tI\4J\tJ\4K\tK\4L\tL\4M\tM\4N\tN\4O\tO\4P\tP\4Q\tQ\4R\tR\4S\t"+ + "S\4T\tT\4U\tU\4V\tV\4W\tW\4X\tX\4Y\tY\4Z\tZ\4[\t[\4\\\t\\\4]\t]\4^\t^"+ + "\4_\t_\4`\t`\4a\ta\4b\tb\4c\tc\4d\td\4e\te\4f\tf\4g\tg\4h\th\4i\ti\4j"+ + "\tj\4k\tk\4l\tl\4m\tm\4n\tn\4o\to\4p\tp\4q\tq\4r\tr\4s\ts\4t\tt\4u\tu"+ + "\4v\tv\4w\tw\4x\tx\4y\ty\4z\tz\4{\t{\4|\t|\4}\t}\4~\t~\4\177\t\177\4\u0080"+ + "\t\u0080\4\u0081\t\u0081\4\u0082\t\u0082\4\u0083\t\u0083\4\u0084\t\u0084"+ + "\4\u0085\t\u0085\4\u0086\t\u0086\4\u0087\t\u0087\4\u0088\t\u0088\4\u0089"+ + "\t\u0089\4\u008a\t\u008a\4\u008b\t\u008b\4\u008c\t\u008c\4\u008d\t\u008d"+ + "\4\u008e\t\u008e\4\u008f\t\u008f\4\u0090\t\u0090\4\u0091\t\u0091\4\u0092"+ + "\t\u0092\4\u0093\t\u0093\4\u0094\t\u0094\4\u0095\t\u0095\4\u0096\t\u0096"+ + "\4\u0097\t\u0097\4\u0098\t\u0098\4\u0099\t\u0099\4\u009a\t\u009a\4\u009b"+ + "\t\u009b\4\u009c\t\u009c\4\u009d\t\u009d\4\u009e\t\u009e\4\u009f\t\u009f"+ + "\4\u00a0\t\u00a0\4\u00a1\t\u00a1\4\u00a2\t\u00a2\3\2\3\2\5\2\u0149\n\2"+ + "\3\2\3\2\3\3\3\3\3\3\3\3\5\3\u0151\n\3\3\3\5\3\u0154\n\3\3\3\5\3\u0157"+ + "\n\3\3\3\3\3\3\3\3\3\5\3\u015d\n\3\5\3\u015f\n\3\3\4\3\4\3\4\3\4\3\4\3"+ + "\4\3\4\3\5\3\5\3\5\3\5\3\5\3\5\3\5\3\5\3\6\3\6\3\6\3\6\3\6\3\6\3\6\3\7"+ + "\3\7\3\7\3\7\3\7\3\7\3\7\3\b\3\b\3\b\3\b\3\b\3\b\3\b\3\t\3\t\3\t\3\t\3"+ + "\t\3\t\3\t\3\n\3\n\3\n\3\n\3\n\3\n\3\n\3\n\3\n\3\13\3\13\3\13\3\13\3\13"+ + "\3\13\3\13\3\13\3\13\3\13\3\f\3\f\3\f\3\f\3\f\3\f\3\f\3\f\3\r\3\r\3\r"+ + "\3\r\3\r\3\r\3\r\3\r\3\r\3\r\3\16\3\16\3\16\3\16\3\16\3\16\3\16\3\16\3"+ + "\16\3\16\3\16\3\16\3\17\3\17\3\17\3\17\3\17\3\17\3\17\3\20\3\20\3\20\3"+ + "\20\3\20\3\20\3\20\3\20\3\20\3\20\3\20\3\21\3\21\3\21\3\21\3\21\3\21\3"+ + "\22\3\22\3\22\3\22\3\22\3\23\3\23\3\23\3\23\3\23\3\23\3\23\3\24\3\24\3"+ + "\24\3\24\3\24\3\24\3\24\3\25\3\25\3\25\3\25\3\25\3\25\3\26\3\26\3\26\3"+ + "\26\3\26\3\27\3\27\3\27\3\27\3\27\3\27\3\27\3\30\3\30\3\30\3\30\3\30\3"+ + "\30\3\30\3\30\3\30\3\30\3\31\3\31\3\31\3\31\3\31\3\31\3\32\3\32\3\32\3"+ + "\33\3\33\3\34\3\34\3\34\3\34\3\34\3\34\3\34\3\35\3\35\3\35\3\35\3\35\3"+ + "\35\3\36\3\36\3\36\3\36\3\36\3\36\3\36\3\36\3\36\3\36\3\36\3\36\3\36\3"+ + "\37\3\37\3\37\3\37\3\37\3\37\3\37\3\37\3\37\3 \3 \3 \3 \3!\3!\3!\3!\3"+ + "\"\3\"\3\"\3\"\3\"\3\"\3#\3#\3$\3$\3$\3%\3%\3%\3%\3%\3&\3&\3&\3&\3&\3"+ + "&\3\'\3\'\3\'\3\'\3\'\3\'\3(\3(\3(\3(\3(\3(\3(\3)\3)\3)\3)\3)\3)\3)\3"+ + "*\3*\3*\3*\3*\3*\3*\3*\3*\3+\3+\3+\3+\3+\3+\3,\3,\3,\3,\3,\3,\3-\3-\3"+ + "-\3-\3-\3-\3-\3.\3.\3.\3.\3.\3.\3/\3/\3/\3/\3/\3/\3/\3\60\3\60\3\60\3"+ + "\60\3\60\3\60\3\61\3\61\3\61\3\61\3\61\3\61\3\61\3\61\3\61\3\62\3\62\3"+ + "\62\3\62\3\62\3\62\3\62\3\62\3\63\3\63\3\63\3\63\3\63\3\63\3\63\3\64\3"+ + "\64\3\64\3\64\3\64\3\65\3\65\3\65\3\65\3\65\3\65\3\65\3\65\3\65\3\66\3"+ + "\66\3\66\3\66\3\66\3\66\3\66\3\66\3\66\3\66\3\66\3\66\3\66\3\66\3\66\3"+ + "\67\3\67\3\67\3\67\3\67\3\67\38\38\38\38\39\39\39\3:\3:\3:\3:\3:\3:\3"+ + ":\3;\3;\3;\3;\3;\3;\3;\3;\3;\3;\3<\3<\3<\3<\3<\3<\3<\3<\3<\3<\3=\3=\3"+ + "=\3=\3=\3=\3=\3=\3=\3=\3=\3=\3>\3>\3>\3>\3>\3>\3>\3>\3>\3?\3?\3?\3?\3"+ + "?\3?\3?\3?\3?\3?\3@\3@\3@\3@\3@\3@\3@\3@\3A\3A\3A\3A\3A\3A\3A\3A\3B\3"+ + "B\3B\3B\3B\3C\3C\3C\3C\3C\3C\3C\3C\3C\3C\3D\3D\3D\3D\3D\3D\3D\3E\3E\3"+ + "E\3E\3E\3F\3F\3F\3F\3F\3F\3G\3G\3G\3H\3H\3H\3H\3I\3I\3I\3I\3I\3I\3I\3"+ + "J\3J\3J\3J\3J\3K\3K\3K\3K\3K\3L\3L\3L\3L\3L\3M\3M\3M\3M\3M\3M\3M\3M\3"+ + "N\3N\3N\3N\3N\3N\3N\3O\3O\3O\3O\3O\3O\3P\3P\3P\3P\3P\3P\3P\3P\3P\3P\3"+ + "P\3P\3P\3P\3Q\3Q\3Q\3R\3R\3R\3R\3R\3R\3S\3S\3S\3S\3S\3T\3T\3T\3T\3T\3"+ + "T\3T\3T\3T\3T\3T\3U\3U\3U\3U\3V\3V\3V\3V\3V\3V\3V\3W\3W\3W\3W\3W\3W\3"+ + "W\3W\3W\3X\3X\3X\3X\3Y\3Y\3Y\3Y\3Y\3Y\3Z\3Z\3Z\7Z\u03ba\nZ\fZ\16Z\u03bd"+ + "\13Z\3Z\3Z\3[\3[\3\\\3\\\3\\\3\\\3]\3]\3^\3^\3^\3^\3_\3_\3`\3`\3`\3`\3"+ + "a\3a\3b\3b\3c\3c\3d\3d\3e\3e\3f\3f\3f\3f\3f\3g\3g\3g\3g\3g\3h\3h\3h\3"+ + "i\3i\3i\3i\3j\3j\3j\3k\3k\3k\3l\3l\3l\3m\3m\3m\3n\3n\3o\3o\3o\3p\3p\3"+ + "q\3q\3q\3r\3r\3s\3s\3t\3t\3u\3u\3u\3v\3v\3v\3w\3w\3w\3x\3x\3y\3y\3z\3"+ + "z\3{\3{\3|\3|\3}\3}\3~\3~\3~\3\177\3\177\3\177\5\177\u0425\n\177\3\177"+ + "\7\177\u0428\n\177\f\177\16\177\u042b\13\177\5\177\u042d\n\177\3\177\3"+ + "\177\3\u0080\3\u0080\3\u0080\5\u0080\u0434\n\u0080\3\u0080\6\u0080\u0437"+ + "\n\u0080\r\u0080\16\u0080\u0438\3\u0080\3\u0080\3\u0081\3\u0081\5\u0081"+ + "\u043f\n\u0081\3\u0081\5\u0081\u0442\n\u0081\3\u0081\6\u0081\u0445\n\u0081"+ + "\r\u0081\16\u0081\u0446\3\u0081\3\u0081\3\u0082\3\u0082\3\u0082\5\u0082"+ + "\u044e\n\u0082\3\u0082\6\u0082\u0451\n\u0082\r\u0082\16\u0082\u0452\3"+ + "\u0082\3\u0082\3\u0083\3\u0083\3\u0083\3\u0083\3\u0083\3\u0084\5\u0084"+ + "\u045d\n\u0084\3\u0084\6\u0084\u0460\n\u0084\r\u0084\16\u0084\u0461\3"+ + "\u0084\3\u0084\5\u0084\u0466\n\u0084\3\u0084\7\u0084\u0469\n\u0084\f\u0084"+ + "\16\u0084\u046c\13\u0084\5\u0084\u046e\n\u0084\3\u0084\3\u0084\3\u0084"+ + "\5\u0084\u0473\n\u0084\3\u0084\7\u0084\u0476\n\u0084\f\u0084\16\u0084"+ + "\u0479\13\u0084\5\u0084\u047b\n\u0084\3\u0085\3\u0085\3\u0085\3\u0085"+ + "\3\u0086\3\u0086\3\u0086\3\u0086\3\u0086\5\u0086\u0486\n\u0086\3\u0086"+ + "\3\u0086\3\u0086\3\u0086\3\u0087\3\u0087\3\u0087\5\u0087\u048f\n\u0087"+ + "\3\u0087\3\u0087\3\u0088\3\u0088\3\u0088\3\u0088\3\u0089\3\u0089\5\u0089"+ + "\u0499\n\u0089\3\u008a\3\u008a\3\u008a\3\u008a\3\u008a\3\u008b\3\u008b"+ + "\3\u008b\3\u008b\3\u008b\3\u008c\3\u008c\3\u008c\3\u008c\3\u008c\3\u008c"+ + "\3\u008c\3\u008d\3\u008d\3\u008d\3\u008d\3\u008d\3\u008d\3\u008d\3\u008d"+ + "\3\u008d\3\u008d\3\u008d\3\u008e\3\u008e\7\u008e\u04b9\n\u008e\f\u008e"+ + "\16\u008e\u04bc\13\u008e\3\u008e\3\u008e\3\u008e\3\u008e\3\u008f\3\u008f"+ + "\3\u008f\7\u008f\u04c5\n\u008f\f\u008f\16\u008f\u04c8\13\u008f\3\u008f"+ + "\3\u008f\3\u008f\3\u008f\3\u0090\6\u0090\u04cf\n\u0090\r\u0090\16\u0090"+ + "\u04d0\3\u0090\3\u0090\3\u0091\3\u0091\3\u0091\3\u0091\7\u0091\u04d9\n"+ + "\u0091\f\u0091\16\u0091\u04dc\13\u0091\3\u0091\3\u0091\3\u0091\3\u0091"+ + "\3\u0091\3\u0092\6\u0092\u04e4\n\u0092\r\u0092\16\u0092\u04e5\3\u0092"+ + "\3\u0092\3\u0093\3\u0093\3\u0093\3\u0093\7\u0093\u04ee\n\u0093\f\u0093"+ + "\16\u0093\u04f1\13\u0093\3\u0093\3\u0093\3\u0094\3\u0094\3\u0094\3\u0094"+ + "\5\u0094\u04f9\n\u0094\3\u0095\3\u0095\3\u0095\3\u0095\3\u0095\3\u0095"+ + "\3\u0095\3\u0095\3\u0095\3\u0095\3\u0095\3\u0095\3\u0095\3\u0095\3\u0095"+ + "\3\u0095\3\u0095\3\u0095\3\u0095\3\u0095\3\u0095\3\u0095\3\u0095\3\u0095"+ + "\3\u0095\3\u0095\5\u0095\u0515\n\u0095\3\u0096\3\u0096\5\u0096\u0519\n"+ + "\u0096\3\u0096\7\u0096\u051c\n\u0096\f\u0096\16\u0096\u051f\13\u0096\3"+ + "\u0097\3\u0097\3\u0098\3\u0098\3\u0099\3\u0099\3\u009a\3\u009a\5\u009a"+ + "\u0529\n\u009a\3\u009a\3\u009a\3\u009b\3\u009b\5\u009b\u052f\n\u009b\3"+ + "\u009c\3\u009c\3\u009d\3\u009d\3\u009e\6\u009e\u0536\n\u009e\r\u009e\16"+ + "\u009e\u0537\3\u009e\3\u009e\3\u009f\3\u009f\3\u009f\3\u009f\7\u009f\u0540"+ + "\n\u009f\f\u009f\16\u009f\u0543\13\u009f\3\u009f\3\u009f\3\u009f\3\u009f"+ + "\3\u009f\3\u00a0\3\u00a0\3\u00a0\3\u00a0\7\u00a0\u054e\n\u00a0\f\u00a0"+ + "\16\u00a0\u0551\13\u00a0\3\u00a0\3\u00a0\3\u00a1\6\u00a1\u0556\n\u00a1"+ + "\r\u00a1\16\u00a1\u0557\3\u00a1\3\u00a1\3\u00a1\3\u00a1\3\u00a1\7\u00a1"+ + "\u055f\n\u00a1\f\u00a1\16\u00a1\u0562\13\u00a1\3\u00a1\3\u00a1\3\u00a1"+ + "\5\u00a1\u0567\n\u00a1\3\u00a1\3\u00a1\3\u00a2\3\u00a2\3\u00a2\3\u00a2"+ + "\3\u00a2\5\u04da\u0541\u0560\2\u00a3\4\3\6\4\b\5\n\6\f\7\16\b\20\t\22"+ + "\n\24\13\26\f\30\r\32\16\34\17\36\20 \21\"\22$\23&\24(\25*\26,\27.\30"+ + "\60\31\62\32\64\33\66\348\35:\36<\37> @!B\"D#F$H%J&L\'N(P)R*T+V,X-Z.\\"+ + "/^\60`\61b\62d\63f\64h\65j\66l\67n8p9r:t;v|?~@\u0080A\u0082B\u0084"+ + "C\u0086D\u0088E\u008aF\u008cG\u008eH\u0090I\u0092J\u0094K\u0096L\u0098"+ + "M\u009aN\u009cO\u009eP\u00a0Q\u00a2R\u00a4S\u00a6T\u00a8U\u00aaV\u00ac"+ + "W\u00aeX\u00b0Y\u00b2Z\u00b4[\u00b6\\\u00b8]\u00ba^\u00bc_\u00be`\u00c0"+ + "a\u00c2b\u00c4c\u00c6d\u00c8e\u00caf\u00ccg\u00ceh\u00d0i\u00d2j\u00d4"+ + "k\u00d6l\u00d8m\u00dan\u00dco\u00dep\u00e0q\u00e2r\u00e4s\u00e6t\u00e8"+ + "u\u00eav\u00ecw\u00eex\u00f0y\u00f2z\u00f4{\u00f6|\u00f8}\u00fa~\u00fc"+ + "\177\u00fe\u0080\u0100\u0081\u0102\u0082\u0104\u0083\u0106\u0084\u0108"+ + "\2\u010a\2\u010c\u0085\u010e\2\u0110\u0086\u0112\u0087\u0114\u0088\u0116"+ + "\u0089\u0118\u008a\u011a\u008b\u011c\u008c\u011e\u008d\u0120\u008e\u0122"+ + "\u008f\u0124\u0090\u0126\u0091\u0128\2\u012a\2\u012c\2\u012e\2\u0130\2"+ + "\u0132\2\u0134\2\u0136\2\u0138\2\u013a\2\u013c\u0092\u013e\u0093\u0140"+ + "\u0094\u0142\u0095\u0144\u0096\4\2\3\23\3\2\63;\3\2\62;\4\2DDdd\4\2QQ"+ + "qq\4\2ZZzz\4\2RRrr\4\2--//\3\2bb\4\2$$^^\4\2\13\13\"\"\4\2\f\f\17\17\5"+ + "\2\f\f\17\17))\13\2$$))^^cdhhppttvvxx\3\2\629\5\2\62;CHch\3\2\62\63\4"+ + "\2GGgg\49\2\62\2;\2\u0662\2\u066b\2\u06f2\2\u06fb\2\u07c2\2\u07cb\2\u0968"+ + "\2\u0971\2\u09e8\2\u09f1\2\u0a68\2\u0a71\2\u0ae8\2\u0af1\2\u0b68\2\u0b71"+ + "\2\u0be8\2\u0bf1\2\u0c68\2\u0c71\2\u0ce8\2\u0cf1\2\u0d68\2\u0d71\2\u0de8"+ + "\2\u0df1\2\u0e52\2\u0e5b\2\u0ed2\2\u0edb\2\u0f22\2\u0f2b\2\u1042\2\u104b"+ + "\2\u1092\2\u109b\2\u17e2\2\u17eb\2\u1812\2\u181b\2\u1948\2\u1951\2\u19d2"+ + "\2\u19db\2\u1a82\2\u1a8b\2\u1a92\2\u1a9b\2\u1b52\2\u1b5b\2\u1bb2\2\u1bbb"+ + "\2\u1c42\2\u1c4b\2\u1c52\2\u1c5b\2\ua622\2\ua62b\2\ua8d2\2\ua8db\2\ua902"+ + "\2\ua90b\2\ua9d2\2\ua9db\2\ua9f2\2\ua9fb\2\uaa52\2\uaa5b\2\uabf2\2\uabfb"+ + "\2\uff12\2\uff1b\2\u04a2\3\u04ab\3\u1068\3\u1071\3\u10f2\3\u10fb\3\u1138"+ + "\3\u1141\3\u11d2\3\u11db\3\u12f2\3\u12fb\3\u1452\3\u145b\3\u14d2\3\u14db"+ + "\3\u1652\3\u165b\3\u16c2\3\u16cb\3\u1732\3\u173b\3\u18e2\3\u18eb\3\u1c52"+ + "\3\u1c5b\3\u1d52\3\u1d5b\3\u6a62\3\u6a6b\3\u6b52\3\u6b5b\3\ud7d0\3\ud801"+ + "\3\ue952\3\ue95b\3\u024b\2C\2\\\2c\2|\2\u00ac\2\u00ac\2\u00b7\2\u00b7"+ + "\2\u00bc\2\u00bc\2\u00c2\2\u00d8\2\u00da\2\u00f8\2\u00fa\2\u02c3\2\u02c8"+ + "\2\u02d3\2\u02e2\2\u02e6\2\u02ee\2\u02ee\2\u02f0\2\u02f0\2\u0372\2\u0376"+ + "\2\u0378\2\u0379\2\u037c\2\u037f\2\u0381\2\u0381\2\u0388\2\u0388\2\u038a"+ + "\2\u038c\2\u038e\2\u038e\2\u0390\2\u03a3\2\u03a5\2\u03f7\2\u03f9\2\u0483"+ + "\2\u048c\2\u0531\2\u0533\2\u0558\2\u055b\2\u055b\2\u0563\2\u0589\2\u05d2"+ + "\2\u05ec\2\u05f2\2\u05f4\2\u0622\2\u064c\2\u0670\2\u0671\2\u0673\2\u06d5"+ + "\2\u06d7\2\u06d7\2\u06e7\2\u06e8\2\u06f0\2\u06f1\2\u06fc\2\u06fe\2\u0701"+ + "\2\u0701\2\u0712\2\u0712\2\u0714\2\u0731\2\u074f\2\u07a7\2\u07b3\2\u07b3"+ + "\2\u07cc\2\u07ec\2\u07f6\2\u07f7\2\u07fc\2\u07fc\2\u0802\2\u0817\2\u081c"+ + "\2\u081c\2\u0826\2\u0826\2\u082a\2\u082a\2\u0842\2\u085a\2\u0862\2\u086c"+ + "\2\u08a2\2\u08b6\2\u08b8\2\u08bf\2\u0906\2\u093b\2\u093f\2\u093f\2\u0952"+ + "\2\u0952\2\u095a\2\u0963\2\u0973\2\u0982\2\u0987\2\u098e\2\u0991\2\u0992"+ + "\2\u0995\2\u09aa\2\u09ac\2\u09b2\2\u09b4\2\u09b4\2\u09b8\2\u09bb\2\u09bf"+ + "\2\u09bf\2\u09d0\2\u09d0\2\u09de\2\u09df\2\u09e1\2\u09e3\2\u09f2\2\u09f3"+ + "\2\u09fe\2\u09fe\2\u0a07\2\u0a0c\2\u0a11\2\u0a12\2\u0a15\2\u0a2a\2\u0a2c"+ + "\2\u0a32\2\u0a34\2\u0a35\2\u0a37\2\u0a38\2\u0a3a\2\u0a3b\2\u0a5b\2\u0a5e"+ + "\2\u0a60\2\u0a60\2\u0a74\2\u0a76\2\u0a87\2\u0a8f\2\u0a91\2\u0a93\2\u0a95"+ + "\2\u0aaa\2\u0aac\2\u0ab2\2\u0ab4\2\u0ab5\2\u0ab7\2\u0abb\2\u0abf\2\u0abf"+ + "\2\u0ad2\2\u0ad2\2\u0ae2\2\u0ae3\2\u0afb\2\u0afb\2\u0b07\2\u0b0e\2\u0b11"+ + "\2\u0b12\2\u0b15\2\u0b2a\2\u0b2c\2\u0b32\2\u0b34\2\u0b35\2\u0b37\2\u0b3b"+ + "\2\u0b3f\2\u0b3f\2\u0b5e\2\u0b5f\2\u0b61\2\u0b63\2\u0b73\2\u0b73\2\u0b85"+ + "\2\u0b85\2\u0b87\2\u0b8c\2\u0b90\2\u0b92\2\u0b94\2\u0b97\2\u0b9b\2\u0b9c"+ + "\2\u0b9e\2\u0b9e\2\u0ba0\2\u0ba1\2\u0ba5\2\u0ba6\2\u0baa\2\u0bac\2\u0bb0"+ + "\2\u0bbb\2\u0bd2\2\u0bd2\2\u0c07\2\u0c0e\2\u0c10\2\u0c12\2\u0c14\2\u0c2a"+ + "\2\u0c2c\2\u0c3b\2\u0c3f\2\u0c3f\2\u0c5a\2\u0c5c\2\u0c62\2\u0c63\2\u0c82"+ + "\2\u0c82\2\u0c87\2\u0c8e\2\u0c90\2\u0c92\2\u0c94\2\u0caa\2\u0cac\2\u0cb5"+ + "\2\u0cb7\2\u0cbb\2\u0cbf\2\u0cbf\2\u0ce0\2\u0ce0\2\u0ce2\2\u0ce3\2\u0cf3"+ + "\2\u0cf4\2\u0d07\2\u0d0e\2\u0d10\2\u0d12\2\u0d14\2\u0d3c\2\u0d3f\2\u0d3f"+ + "\2\u0d50\2\u0d50\2\u0d56\2\u0d58\2\u0d61\2\u0d63\2\u0d7c\2\u0d81\2\u0d87"+ + "\2\u0d98\2\u0d9c\2\u0db3\2\u0db5\2\u0dbd\2\u0dbf\2\u0dbf\2\u0dc2\2\u0dc8"+ + "\2\u0e03\2\u0e32\2\u0e34\2\u0e35\2\u0e42\2\u0e48\2\u0e83\2\u0e84\2\u0e86"+ + "\2\u0e86\2\u0e89\2\u0e8a\2\u0e8c\2\u0e8c\2\u0e8f\2\u0e8f\2\u0e96\2\u0e99"+ + "\2\u0e9b\2\u0ea1\2\u0ea3\2\u0ea5\2\u0ea7\2\u0ea7\2\u0ea9\2\u0ea9\2\u0eac"+ + "\2\u0ead\2\u0eaf\2\u0eb2\2\u0eb4\2\u0eb5\2\u0ebf\2\u0ebf\2\u0ec2\2\u0ec6"+ + "\2\u0ec8\2\u0ec8\2\u0ede\2\u0ee1\2\u0f02\2\u0f02\2\u0f42\2\u0f49\2\u0f4b"+ + "\2\u0f6e\2\u0f8a\2\u0f8e\2\u1002\2\u102c\2\u1041\2\u1041\2\u1052\2\u1057"+ + "\2\u105c\2\u105f\2\u1063\2\u1063\2\u1067\2\u1068\2\u1070\2\u1072\2\u1077"+ + "\2\u1083\2\u1090\2\u1090\2\u10a2\2\u10c7\2\u10c9\2\u10c9\2\u10cf\2\u10cf"+ + "\2\u10d2\2\u10fc\2\u10fe\2\u124a\2\u124c\2\u124f\2\u1252\2\u1258\2\u125a"+ + "\2\u125a\2\u125c\2\u125f\2\u1262\2\u128a\2\u128c\2\u128f\2\u1292\2\u12b2"+ + "\2\u12b4\2\u12b7\2\u12ba\2\u12c0\2\u12c2\2\u12c2\2\u12c4\2\u12c7\2\u12ca"+ + "\2\u12d8\2\u12da\2\u1312\2\u1314\2\u1317\2\u131a\2\u135c\2\u1382\2\u1391"+ + "\2\u13a2\2\u13f7\2\u13fa\2\u13ff\2\u1403\2\u166e\2\u1671\2\u1681\2\u1683"+ + "\2\u169c\2\u16a2\2\u16ec\2\u16f3\2\u16fa\2\u1702\2\u170e\2\u1710\2\u1713"+ + "\2\u1722\2\u1733\2\u1742\2\u1753\2\u1762\2\u176e\2\u1770\2\u1772\2\u1782"+ + "\2\u17b5\2\u17d9\2\u17d9\2\u17de\2\u17de\2\u1822\2\u1879\2\u1882\2\u1886"+ + "\2\u1889\2\u18aa\2\u18ac\2\u18ac\2\u18b2\2\u18f7\2\u1902\2\u1920\2\u1952"+ + "\2\u196f\2\u1972\2\u1976\2\u1982\2\u19ad\2\u19b2\2\u19cb\2\u1a02\2\u1a18"+ + "\2\u1a22\2\u1a56\2\u1aa9\2\u1aa9\2\u1b07\2\u1b35\2\u1b47\2\u1b4d\2\u1b85"+ + "\2\u1ba2\2\u1bb0\2\u1bb1\2\u1bbc\2\u1be7\2\u1c02\2\u1c25\2\u1c4f\2\u1c51"+ + "\2\u1c5c\2\u1c7f\2\u1c82\2\u1c8a\2\u1ceb\2\u1cee\2\u1cf0\2\u1cf3\2\u1cf7"+ + "\2\u1cf8\2\u1d02\2\u1dc1\2\u1e02\2\u1f17\2\u1f1a\2\u1f1f\2\u1f22\2\u1f47"+ + "\2\u1f4a\2\u1f4f\2\u1f52\2\u1f59\2\u1f5b\2\u1f5b\2\u1f5d\2\u1f5d\2\u1f5f"+ + "\2\u1f5f\2\u1f61\2\u1f7f\2\u1f82\2\u1fb6\2\u1fb8\2\u1fbe\2\u1fc0\2\u1fc0"+ + "\2\u1fc4\2\u1fc6\2\u1fc8\2\u1fce\2\u1fd2\2\u1fd5\2\u1fd8\2\u1fdd\2\u1fe2"+ + "\2\u1fee\2\u1ff4\2\u1ff6\2\u1ff8\2\u1ffe\2\u2073\2\u2073\2\u2081\2\u2081"+ + "\2\u2092\2\u209e\2\u2104\2\u2104\2\u2109\2\u2109\2\u210c\2\u2115\2\u2117"+ + "\2\u2117\2\u211b\2\u211f\2\u2126\2\u2126\2\u2128\2\u2128\2\u212a\2\u212a"+ + "\2\u212c\2\u212f\2\u2131\2\u213b\2\u213e\2\u2141\2\u2147\2\u214b\2\u2150"+ + "\2\u2150\2\u2185\2\u2186\2\u2c02\2\u2c30\2\u2c32\2\u2c60\2\u2c62\2\u2ce6"+ + "\2\u2ced\2\u2cf0\2\u2cf4\2\u2cf5\2\u2d02\2\u2d27\2\u2d29\2\u2d29\2\u2d2f"+ + "\2\u2d2f\2\u2d32\2\u2d69\2\u2d71\2\u2d71\2\u2d82\2\u2d98\2\u2da2\2\u2da8"+ + "\2\u2daa\2\u2db0\2\u2db2\2\u2db8\2\u2dba\2\u2dc0\2\u2dc2\2\u2dc8\2\u2dca"+ + "\2\u2dd0\2\u2dd2\2\u2dd8\2\u2dda\2\u2de0\2\u2e31\2\u2e31\2\u3007\2\u3008"+ + "\2\u3033\2\u3037\2\u303d\2\u303e\2\u3043\2\u3098\2\u309f\2\u30a1\2\u30a3"+ + "\2\u30fc\2\u30fe\2\u3101\2\u3107\2\u3130\2\u3133\2\u3190\2\u31a2\2\u31bc"+ + "\2\u31f2\2\u3201\2\u3402\2\u4db7\2\u4e02\2\u9fec\2\ua002\2\ua48e\2\ua4d2"+ + "\2\ua4ff\2\ua502\2\ua60e\2\ua612\2\ua621\2\ua62c\2\ua62d\2\ua642\2\ua670"+ + "\2\ua681\2\ua69f\2\ua6a2\2\ua6e7\2\ua719\2\ua721\2\ua724\2\ua78a\2\ua78d"+ + "\2\ua7b0\2\ua7b2\2\ua7b9\2\ua7f9\2\ua803\2\ua805\2\ua807\2\ua809\2\ua80c"+ + "\2\ua80e\2\ua824\2\ua842\2\ua875\2\ua884\2\ua8b5\2\ua8f4\2\ua8f9\2\ua8fd"+ + "\2\ua8fd\2\ua8ff\2\ua8ff\2\ua90c\2\ua927\2\ua932\2\ua948\2\ua962\2\ua97e"+ + "\2\ua986\2\ua9b4\2\ua9d1\2\ua9d1\2\ua9e2\2\ua9e6\2\ua9e8\2\ua9f1\2\ua9fc"+ + "\2\uaa00\2\uaa02\2\uaa2a\2\uaa42\2\uaa44\2\uaa46\2\uaa4d\2\uaa62\2\uaa78"+ + "\2\uaa7c\2\uaa7c\2\uaa80\2\uaab1\2\uaab3\2\uaab3\2\uaab7\2\uaab8\2\uaabb"+ + "\2\uaabf\2\uaac2\2\uaac2\2\uaac4\2\uaac4\2\uaadd\2\uaadf\2\uaae2\2\uaaec"+ + "\2\uaaf4\2\uaaf6\2\uab03\2\uab08\2\uab0b\2\uab10\2\uab13\2\uab18\2\uab22"+ + "\2\uab28\2\uab2a\2\uab30\2\uab32\2\uab5c\2\uab5e\2\uab67\2\uab72\2\uabe4"+ + "\2\uac02\2\ud7a5\2\ud7b2\2\ud7c8\2\ud7cd\2\ud7fd\2\uf902\2\ufa6f\2\ufa72"+ + "\2\ufadb\2\ufb02\2\ufb08\2\ufb15\2\ufb19\2\ufb1f\2\ufb1f\2\ufb21\2\ufb2a"+ + "\2\ufb2c\2\ufb38\2\ufb3a\2\ufb3e\2\ufb40\2\ufb40\2\ufb42\2\ufb43\2\ufb45"+ + "\2\ufb46\2\ufb48\2\ufbb3\2\ufbd5\2\ufd3f\2\ufd52\2\ufd91\2\ufd94\2\ufdc9"+ + "\2\ufdf2\2\ufdfd\2\ufe72\2\ufe76\2\ufe78\2\ufefe\2\uff23\2\uff3c\2\uff43"+ + "\2\uff5c\2\uff68\2\uffc0\2\uffc4\2\uffc9\2\uffcc\2\uffd1\2\uffd4\2\uffd9"+ + "\2\uffdc\2\uffde\2\2\3\r\3\17\3(\3*\3<\3>\3?\3A\3O\3R\3_\3\u0082\3\u00fc"+ + "\3\u0282\3\u029e\3\u02a2\3\u02d2\3\u0302\3\u0321\3\u032f\3\u0342\3\u0344"+ + "\3\u034b\3\u0352\3\u0377\3\u0382\3\u039f\3\u03a2\3\u03c5\3\u03ca\3\u03d1"+ + "\3\u0402\3\u049f\3\u04b2\3\u04d5\3\u04da\3\u04fd\3\u0502\3\u0529\3\u0532"+ + "\3\u0565\3\u0602\3\u0738\3\u0742\3\u0757\3\u0762\3\u0769\3\u0802\3\u0807"+ + "\3\u080a\3\u080a\3\u080c\3\u0837\3\u0839\3\u083a\3\u083e\3\u083e\3\u0841"+ + "\3\u0857\3\u0862\3\u0878\3\u0882\3\u08a0\3\u08e2\3\u08f4\3\u08f6\3\u08f7"+ + "\3\u0902\3\u0917\3\u0922\3\u093b\3\u0982\3\u09b9\3\u09c0\3\u09c1\3\u0a02"+ + "\3\u0a02\3\u0a12\3\u0a15\3\u0a17\3\u0a19\3\u0a1b\3\u0a35\3\u0a62\3\u0a7e"+ + "\3\u0a82\3\u0a9e\3\u0ac2\3\u0ac9\3\u0acb\3\u0ae6\3\u0b02\3\u0b37\3\u0b42"+ + "\3\u0b57\3\u0b62\3\u0b74\3\u0b82\3\u0b93\3\u0c02\3\u0c4a\3\u0c82\3\u0cb4"+ + "\3\u0cc2\3\u0cf4\3\u1005\3\u1039\3\u1085\3\u10b1\3\u10d2\3\u10ea\3\u1105"+ + "\3\u1128\3\u1152\3\u1174\3\u1178\3\u1178\3\u1185\3\u11b4\3\u11c3\3\u11c6"+ + "\3\u11dc\3\u11dc\3\u11de\3\u11de\3\u1202\3\u1213\3\u1215\3\u122d\3\u1282"+ + "\3\u1288\3\u128a\3\u128a\3\u128c\3\u128f\3\u1291\3\u129f\3\u12a1\3\u12aa"+ + "\3\u12b2\3\u12e0\3\u1307\3\u130e\3\u1311\3\u1312\3\u1315\3\u132a\3\u132c"+ + "\3\u1332\3\u1334\3\u1335\3\u1337\3\u133b\3\u133f\3\u133f\3\u1352\3\u1352"+ + "\3\u135f\3\u1363\3\u1402\3\u1436\3\u1449\3\u144c\3\u1482\3\u14b1\3\u14c6"+ + "\3\u14c7\3\u14c9\3\u14c9\3\u1582\3\u15b0\3\u15da\3\u15dd\3\u1602\3\u1631"+ + "\3\u1646\3\u1646\3\u1682\3\u16ac\3\u1702\3\u171b\3\u18a2\3\u18e1\3\u1901"+ + "\3\u1901\3\u1a02\3\u1a02\3\u1a0d\3\u1a34\3\u1a3c\3\u1a3c\3\u1a52\3\u1a52"+ + "\3\u1a5e\3\u1a85\3\u1a88\3\u1a8b\3\u1ac2\3\u1afa\3\u1c02\3\u1c0a\3\u1c0c"+ + "\3\u1c30\3\u1c42\3\u1c42\3\u1c74\3\u1c91\3\u1d02\3\u1d08\3\u1d0a\3\u1d0b"+ + "\3\u1d0d\3\u1d32\3\u1d48\3\u1d48\3\u2002\3\u239b\3\u2482\3\u2545\3\u3002"+ + "\3\u3430\3\u4402\3\u4648\3\u6802\3\u6a3a\3\u6a42\3\u6a60\3\u6ad2\3\u6aef"+ + "\3\u6b02\3\u6b31\3\u6b42\3\u6b45\3\u6b65\3\u6b79\3\u6b7f\3\u6b91\3\u6f02"+ + "\3\u6f46\3\u6f52\3\u6f52\3\u6f95\3\u6fa1\3\u6fe2\3\u6fe3\3\u7002\3\u87ee"+ + "\3\u8802\3\u8af4\3\ub002\3\ub120\3\ub172\3\ub2fd\3\ubc02\3\ubc6c\3\ubc72"+ + "\3\ubc7e\3\ubc82\3\ubc8a\3\ubc92\3\ubc9b\3\ud402\3\ud456\3\ud458\3\ud49e"+ + "\3\ud4a0\3\ud4a1\3\ud4a4\3\ud4a4\3\ud4a7\3\ud4a8\3\ud4ab\3\ud4ae\3\ud4b0"+ + "\3\ud4bb\3\ud4bd\3\ud4bd\3\ud4bf\3\ud4c5\3\ud4c7\3\ud507\3\ud509\3\ud50c"+ + "\3\ud50f\3\ud516\3\ud518\3\ud51e\3\ud520\3\ud53b\3\ud53d\3\ud540\3\ud542"+ + "\3\ud546\3\ud548\3\ud548\3\ud54c\3\ud552\3\ud554\3\ud6a7\3\ud6aa\3\ud6c2"+ + "\3\ud6c4\3\ud6dc\3\ud6de\3\ud6fc\3\ud6fe\3\ud716\3\ud718\3\ud736\3\ud738"+ + "\3\ud750\3\ud752\3\ud770\3\ud772\3\ud78a\3\ud78c\3\ud7aa\3\ud7ac\3\ud7c4"+ + "\3\ud7c6\3\ud7cd\3\ue802\3\ue8c6\3\ue902\3\ue945\3\uee02\3\uee05\3\uee07"+ + "\3\uee21\3\uee23\3\uee24\3\uee26\3\uee26\3\uee29\3\uee29\3\uee2b\3\uee34"+ + "\3\uee36\3\uee39\3\uee3b\3\uee3b\3\uee3d\3\uee3d\3\uee44\3\uee44\3\uee49"+ + "\3\uee49\3\uee4b\3\uee4b\3\uee4d\3\uee4d\3\uee4f\3\uee51\3\uee53\3\uee54"+ + "\3\uee56\3\uee56\3\uee59\3\uee59\3\uee5b\3\uee5b\3\uee5d\3\uee5d\3\uee5f"+ + "\3\uee5f\3\uee61\3\uee61\3\uee63\3\uee64\3\uee66\3\uee66\3\uee69\3\uee6c"+ + "\3\uee6e\3\uee74\3\uee76\3\uee79\3\uee7b\3\uee7e\3\uee80\3\uee80\3\uee82"+ + "\3\uee8b\3\uee8d\3\uee9d\3\ueea3\3\ueea5\3\ueea7\3\ueeab\3\ueead\3\ueebd"+ + "\3\2\4\ua6d8\4\ua702\4\ub736\4\ub742\4\ub81f\4\ub822\4\ucea3\4\uceb2\4"+ + "\uebe2\4\uf802\4\ufa1f\4\u059a\2\4\3\2\2\2\2\6\3\2\2\2\2\b\3\2\2\2\2\n"+ + "\3\2\2\2\2\f\3\2\2\2\2\16\3\2\2\2\2\20\3\2\2\2\2\22\3\2\2\2\2\24\3\2\2"+ + "\2\2\26\3\2\2\2\2\30\3\2\2\2\2\32\3\2\2\2\2\34\3\2\2\2\2\36\3\2\2\2\2"+ + " \3\2\2\2\2\"\3\2\2\2\2$\3\2\2\2\2&\3\2\2\2\2(\3\2\2\2\2*\3\2\2\2\2,\3"+ + "\2\2\2\2.\3\2\2\2\2\60\3\2\2\2\2\62\3\2\2\2\2\64\3\2\2\2\2\66\3\2\2\2"+ + "\28\3\2\2\2\2:\3\2\2\2\2<\3\2\2\2\2>\3\2\2\2\2@\3\2\2\2\2B\3\2\2\2\2D"+ + "\3\2\2\2\2F\3\2\2\2\2H\3\2\2\2\2J\3\2\2\2\2L\3\2\2\2\2N\3\2\2\2\2P\3\2"+ + "\2\2\2R\3\2\2\2\2T\3\2\2\2\2V\3\2\2\2\2X\3\2\2\2\2Z\3\2\2\2\2\\\3\2\2"+ + "\2\2^\3\2\2\2\2`\3\2\2\2\2b\3\2\2\2\2d\3\2\2\2\2f\3\2\2\2\2h\3\2\2\2\2"+ + "j\3\2\2\2\2l\3\2\2\2\2n\3\2\2\2\2p\3\2\2\2\2r\3\2\2\2\2t\3\2\2\2\2v\3"+ + "\2\2\2\2x\3\2\2\2\2z\3\2\2\2\2|\3\2\2\2\2~\3\2\2\2\2\u0080\3\2\2\2\2\u0082"+ + "\3\2\2\2\2\u0084\3\2\2\2\2\u0086\3\2\2\2\2\u0088\3\2\2\2\2\u008a\3\2\2"+ + "\2\2\u008c\3\2\2\2\2\u008e\3\2\2\2\2\u0090\3\2\2\2\2\u0092\3\2\2\2\2\u0094"+ + "\3\2\2\2\2\u0096\3\2\2\2\2\u0098\3\2\2\2\2\u009a\3\2\2\2\2\u009c\3\2\2"+ + "\2\2\u009e\3\2\2\2\2\u00a0\3\2\2\2\2\u00a2\3\2\2\2\2\u00a4\3\2\2\2\2\u00a6"+ + "\3\2\2\2\2\u00a8\3\2\2\2\2\u00aa\3\2\2\2\2\u00ac\3\2\2\2\2\u00ae\3\2\2"+ + "\2\2\u00b0\3\2\2\2\2\u00b2\3\2\2\2\2\u00b4\3\2\2\2\2\u00b6\3\2\2\2\2\u00b8"+ + "\3\2\2\2\2\u00ba\3\2\2\2\2\u00bc\3\2\2\2\2\u00be\3\2\2\2\2\u00c0\3\2\2"+ + "\2\2\u00c2\3\2\2\2\2\u00c4\3\2\2\2\2\u00c6\3\2\2\2\2\u00c8\3\2\2\2\2\u00ca"+ + "\3\2\2\2\2\u00cc\3\2\2\2\2\u00ce\3\2\2\2\2\u00d0\3\2\2\2\2\u00d2\3\2\2"+ + "\2\2\u00d4\3\2\2\2\2\u00d6\3\2\2\2\2\u00d8\3\2\2\2\2\u00da\3\2\2\2\2\u00dc"+ + "\3\2\2\2\2\u00de\3\2\2\2\2\u00e0\3\2\2\2\2\u00e2\3\2\2\2\2\u00e4\3\2\2"+ + "\2\2\u00e6\3\2\2\2\2\u00e8\3\2\2\2\2\u00ea\3\2\2\2\2\u00ec\3\2\2\2\2\u00ee"+ + "\3\2\2\2\2\u00f0\3\2\2\2\2\u00f2\3\2\2\2\2\u00f4\3\2\2\2\2\u00f6\3\2\2"+ + "\2\2\u00f8\3\2\2\2\2\u00fa\3\2\2\2\2\u00fc\3\2\2\2\2\u00fe\3\2\2\2\2\u0100"+ + "\3\2\2\2\2\u0102\3\2\2\2\2\u0104\3\2\2\2\2\u0106\3\2\2\2\2\u010c\3\2\2"+ + "\2\2\u0110\3\2\2\2\2\u0112\3\2\2\2\2\u0114\3\2\2\2\2\u0116\3\2\2\2\2\u0118"+ + "\3\2\2\2\2\u011a\3\2\2\2\2\u011c\3\2\2\2\2\u011e\3\2\2\2\2\u0120\3\2\2"+ + "\2\2\u0122\3\2\2\2\2\u0124\3\2\2\2\2\u0126\3\2\2\2\3\u013c\3\2\2\2\3\u013e"+ + "\3\2\2\2\3\u0140\3\2\2\2\3\u0142\3\2\2\2\3\u0144\3\2\2\2\4\u0148\3\2\2"+ + "\2\6\u015e\3\2\2\2\b\u0160\3\2\2\2\n\u0167\3\2\2\2\f\u016f\3\2\2\2\16"+ + "\u0176\3\2\2\2\20\u017d\3\2\2\2\22\u0184\3\2\2\2\24\u018b\3\2\2\2\26\u0194"+ + "\3\2\2\2\30\u019e\3\2\2\2\32\u01a6\3\2\2\2\34\u01b0\3\2\2\2\36\u01bc\3"+ + "\2\2\2 \u01c3\3\2\2\2\"\u01ce\3\2\2\2$\u01d4\3\2\2\2&\u01d9\3\2\2\2(\u01e0"+ + "\3\2\2\2*\u01e7\3\2\2\2,\u01ed\3\2\2\2.\u01f2\3\2\2\2\60\u01f9\3\2\2\2"+ + "\62\u0203\3\2\2\2\64\u0209\3\2\2\2\66\u020c\3\2\2\28\u020e\3\2\2\2:\u0215"+ + "\3\2\2\2<\u021b\3\2\2\2>\u0228\3\2\2\2@\u0231\3\2\2\2B\u0235\3\2\2\2D"+ + "\u0239\3\2\2\2F\u023f\3\2\2\2H\u0241\3\2\2\2J\u0244\3\2\2\2L\u0249\3\2"+ + "\2\2N\u024f\3\2\2\2P\u0255\3\2\2\2R\u025c\3\2\2\2T\u0263\3\2\2\2V\u026c"+ + "\3\2\2\2X\u0272\3\2\2\2Z\u0278\3\2\2\2\\\u027f\3\2\2\2^\u0285\3\2\2\2"+ + "`\u028c\3\2\2\2b\u0292\3\2\2\2d\u029b\3\2\2\2f\u02a3\3\2\2\2h\u02aa\3"+ + "\2\2\2j\u02af\3\2\2\2l\u02b8\3\2\2\2n\u02c7\3\2\2\2p\u02cd\3\2\2\2r\u02d1"+ + "\3\2\2\2t\u02d4\3\2\2\2v\u02db\3\2\2\2x\u02e5\3\2\2\2z\u02ef\3\2\2\2|"+ + "\u02fb\3\2\2\2~\u0304\3\2\2\2\u0080\u030e\3\2\2\2\u0082\u0316\3\2\2\2"+ + "\u0084\u031e\3\2\2\2\u0086\u0323\3\2\2\2\u0088\u032d\3\2\2\2\u008a\u0334"+ + "\3\2\2\2\u008c\u0339\3\2\2\2\u008e\u033f\3\2\2\2\u0090\u0342\3\2\2\2\u0092"+ + "\u0346\3\2\2\2\u0094\u034d\3\2\2\2\u0096\u0352\3\2\2\2\u0098\u0357\3\2"+ + "\2\2\u009a\u035c\3\2\2\2\u009c\u0364\3\2\2\2\u009e\u036b\3\2\2\2\u00a0"+ + "\u0371\3\2\2\2\u00a2\u037f\3\2\2\2\u00a4\u0382\3\2\2\2\u00a6\u0388\3\2"+ + "\2\2\u00a8\u038d\3\2\2\2\u00aa\u0398\3\2\2\2\u00ac\u039c\3\2\2\2\u00ae"+ + "\u03a3\3\2\2\2\u00b0\u03ac\3\2\2\2\u00b2\u03b0\3\2\2\2\u00b4\u03b6\3\2"+ + "\2\2\u00b6\u03c0\3\2\2\2\u00b8\u03c2\3\2\2\2\u00ba\u03c6\3\2\2\2\u00bc"+ + "\u03c8\3\2\2\2\u00be\u03cc\3\2\2\2\u00c0\u03ce\3\2\2\2\u00c2\u03d2\3\2"+ + "\2\2\u00c4\u03d4\3\2\2\2\u00c6\u03d6\3\2\2\2\u00c8\u03d8\3\2\2\2\u00ca"+ + "\u03da\3\2\2\2\u00cc\u03dc\3\2\2\2\u00ce\u03e1\3\2\2\2\u00d0\u03e6\3\2"+ + "\2\2\u00d2\u03e9\3\2\2\2\u00d4\u03ed\3\2\2\2\u00d6\u03f0\3\2\2\2\u00d8"+ + "\u03f3\3\2\2\2\u00da\u03f6\3\2\2\2\u00dc\u03f9\3\2\2\2\u00de\u03fb\3\2"+ + "\2\2\u00e0\u03fe\3\2\2\2\u00e2\u0400\3\2\2\2\u00e4\u0403\3\2\2\2\u00e6"+ + "\u0405\3\2\2\2\u00e8\u0407\3\2\2\2\u00ea\u0409\3\2\2\2\u00ec\u040c\3\2"+ + "\2\2\u00ee\u040f\3\2\2\2\u00f0\u0412\3\2\2\2\u00f2\u0414\3\2\2\2\u00f4"+ + "\u0416\3\2\2\2\u00f6\u0418\3\2\2\2\u00f8\u041a\3\2\2\2\u00fa\u041c\3\2"+ + "\2\2\u00fc\u041e\3\2\2\2\u00fe\u042c\3\2\2\2\u0100\u0430\3\2\2\2\u0102"+ + "\u043c\3\2\2\2\u0104\u044a\3\2\2\2\u0106\u0456\3\2\2\2\u0108\u047a\3\2"+ + "\2\2\u010a\u047c\3\2\2\2\u010c\u0485\3\2\2\2\u010e\u048b\3\2\2\2\u0110"+ + "\u0492\3\2\2\2\u0112\u0498\3\2\2\2\u0114\u049a\3\2\2\2\u0116\u049f\3\2"+ + "\2\2\u0118\u04a4\3\2\2\2\u011a\u04ab\3\2\2\2\u011c\u04b6\3\2\2\2\u011e"+ + "\u04c1\3\2\2\2\u0120\u04ce\3\2\2\2\u0122\u04d4\3\2\2\2\u0124\u04e3\3\2"+ + "\2\2\u0126\u04e9\3\2\2\2\u0128\u04f8\3\2\2\2\u012a\u04fa\3\2\2\2\u012c"+ + "\u0516\3\2\2\2\u012e\u0520\3\2\2\2\u0130\u0522\3\2\2\2\u0132\u0524\3\2"+ + "\2\2\u0134\u0526\3\2\2\2\u0136\u052e\3\2\2\2\u0138\u0530\3\2\2\2\u013a"+ + "\u0532\3\2\2\2\u013c\u0535\3\2\2\2\u013e\u053b\3\2\2\2\u0140\u0549\3\2"+ + "\2\2\u0142\u0566\3\2\2\2\u0144\u056a\3\2\2\2\u0146\u0149\5\6\3\2\u0147"+ + "\u0149\5\u0106\u0083\2\u0148\u0146\3\2\2\2\u0148\u0147\3\2\2\2\u0149\u014a"+ + "\3\2\2\2\u014a\u014b\b\2\2\2\u014b\5\3\2\2\2\u014c\u0156\5\u012c\u0096"+ + "\2\u014d\u014e\7\60\2\2\u014e\u0150\6\3\2\2\u014f\u0151\5\u012c\u0096"+ + "\2\u0150\u014f\3\2\2\2\u0150\u0151\3\2\2\2\u0151\u0153\3\2\2\2\u0152\u0154"+ + "\5\u0134\u009a\2\u0153\u0152\3\2\2\2\u0153\u0154\3\2\2\2\u0154\u0157\3"+ + "\2\2\2\u0155\u0157\5\u0134\u009a\2\u0156\u014d\3\2\2\2\u0156\u0155\3\2"+ + "\2\2\u0157\u015f\3\2\2\2\u0158\u0159\7\60\2\2\u0159\u015a\6\3\3\2\u015a"+ + "\u015c\5\u012c\u0096\2\u015b\u015d\5\u0134\u009a\2\u015c\u015b\3\2\2\2"+ + "\u015c\u015d\3\2\2\2\u015d\u015f\3\2\2\2\u015e\u014c\3\2\2\2\u015e\u0158"+ + "\3\2\2\2\u015f\7\3\2\2\2\u0160\u0161\7v\2\2\u0161\u0162\7t\2\2\u0162\u0163"+ + "\7w\2\2\u0163\u0164\7g\2\2\u0164\u0165\3\2\2\2\u0165\u0166\b\4\2\2\u0166"+ + "\t\3\2\2\2\u0167\u0168\7h\2\2\u0168\u0169\7c\2\2\u0169\u016a\7n\2\2\u016a"+ + "\u016b\7u\2\2\u016b\u016c\7g\2\2\u016c\u016d\3\2\2\2\u016d\u016e\b\5\2"+ + "\2\u016e\13\3\2\2\2\u016f\u0170\7c\2\2\u0170\u0171\7u\2\2\u0171\u0172"+ + "\7u\2\2\u0172\u0173\7g\2\2\u0173\u0174\7t\2\2\u0174\u0175\7v\2\2\u0175"+ + "\r\3\2\2\2\u0176\u0177\7c\2\2\u0177\u0178\7u\2\2\u0178\u0179\7u\2\2\u0179"+ + "\u017a\7w\2\2\u017a\u017b\7o\2\2\u017b\u017c\7g\2\2\u017c\17\3\2\2\2\u017d"+ + "\u017e\7k\2\2\u017e\u017f\7p\2\2\u017f\u0180\7j\2\2\u0180\u0181\7c\2\2"+ + "\u0181\u0182\7n\2\2\u0182\u0183\7g\2\2\u0183\21\3\2\2\2\u0184\u0185\7"+ + "g\2\2\u0185\u0186\7z\2\2\u0186\u0187\7j\2\2\u0187\u0188\7c\2\2\u0188\u0189"+ + "\7n\2\2\u0189\u018a\7g\2\2\u018a\23\3\2\2\2\u018b\u018c\7t\2\2\u018c\u018d"+ + "\7g\2\2\u018d\u018e\7s\2\2\u018e\u018f\7w\2\2\u018f\u0190\7k\2\2\u0190"+ + "\u0191\7t\2\2\u0191\u0192\7g\2\2\u0192\u0193\7u\2\2\u0193\25\3\2\2\2\u0194"+ + "\u0195\7r\2\2\u0195\u0196\7t\2\2\u0196\u0197\7g\2\2\u0197\u0198\7u\2\2"+ + "\u0198\u0199\7g\2\2\u0199\u019a\7t\2\2\u019a\u019b\7x\2\2\u019b\u019c"+ + "\7g\2\2\u019c\u019d\7u\2\2\u019d\27\3\2\2\2\u019e\u019f\7g\2\2\u019f\u01a0"+ + "\7p\2\2\u01a0\u01a1\7u\2\2\u01a1\u01a2\7w\2\2\u01a2\u01a3\7t\2\2\u01a3"+ + "\u01a4\7g\2\2\u01a4\u01a5\7u\2\2\u01a5\31\3\2\2\2\u01a6\u01a7\7k\2\2\u01a7"+ + "\u01a8\7p\2\2\u01a8\u01a9\7x\2\2\u01a9\u01aa\7c\2\2\u01aa\u01ab\7t\2\2"+ + "\u01ab\u01ac\7k\2\2\u01ac\u01ad\7c\2\2\u01ad\u01ae\7p\2\2\u01ae\u01af"+ + "\7v\2\2\u01af\33\3\2\2\2\u01b0\u01b1\7f\2\2\u01b1\u01b2\7g\2\2\u01b2\u01b3"+ + "\7e\2\2\u01b3\u01b4\7t\2\2\u01b4\u01b5\7g\2\2\u01b5\u01b6\7c\2\2\u01b6"+ + "\u01b7\7u\2\2\u01b7\u01b8\7g\2\2\u01b8\u01b9\7u\2\2\u01b9\u01ba\3\2\2"+ + "\2\u01ba\u01bb\b\16\2\2\u01bb\35\3\2\2\2\u01bc\u01bd\7r\2\2\u01bd\u01be"+ + "\7w\2\2\u01be\u01bf\7t\2\2\u01bf\u01c0\7g\2\2\u01c0\u01c1\3\2\2\2\u01c1"+ + "\u01c2\b\17\2\2\u01c2\37\3\2\2\2\u01c3\u01c4\7k\2\2\u01c4\u01c5\7o\2\2"+ + "\u01c5\u01c6\7r\2\2\u01c6\u01c7\7n\2\2\u01c7\u01c8\7g\2\2\u01c8\u01c9"+ + "\7o\2\2\u01c9\u01ca\7g\2\2\u01ca\u01cb\7p\2\2\u01cb\u01cc\7v\2\2\u01cc"+ + "\u01cd\7u\2\2\u01cd!\3\2\2\2\u01ce\u01cf\7q\2\2\u01cf\u01d0\7n\2\2\u01d0"+ + "\u01d1\7f\2\2\u01d1\u01d2\3\2\2\2\u01d2\u01d3\b\21\2\2\u01d3#\3\2\2\2"+ + "\u01d4\u01d5\7%\2\2\u01d5\u01d6\7n\2\2\u01d6\u01d7\7j\2\2\u01d7\u01d8"+ + "\7u\2\2\u01d8%\3\2\2\2\u01d9\u01da\7h\2\2\u01da\u01db\7q\2\2\u01db\u01dc"+ + "\7t\2\2\u01dc\u01dd\7c\2\2\u01dd\u01de\7n\2\2\u01de\u01df\7n\2\2\u01df"+ + "\'\3\2\2\2\u01e0\u01e1\7g\2\2\u01e1\u01e2\7z\2\2\u01e2\u01e3\7k\2\2\u01e3"+ + "\u01e4\7u\2\2\u01e4\u01e5\7v\2\2\u01e5\u01e6\7u\2\2\u01e6)\3\2\2\2\u01e7"+ + "\u01e8\7c\2\2\u01e8\u01e9\7e\2\2\u01e9\u01ea\7e\2\2\u01ea\u01eb\3\2\2"+ + "\2\u01eb\u01ec\b\25\2\2\u01ec+\3\2\2\2\u01ed\u01ee\7h\2\2\u01ee\u01ef"+ + "\7q\2\2\u01ef\u01f0\7n\2\2\u01f0\u01f1\7f\2\2\u01f1-\3\2\2\2\u01f2\u01f3"+ + "\7w\2\2\u01f3\u01f4\7p\2\2\u01f4\u01f5\7h\2\2\u01f5\u01f6\7q\2\2\u01f6"+ + "\u01f7\7n\2\2\u01f7\u01f8\7f\2\2\u01f8/\3\2\2\2\u01f9\u01fa\7w\2\2\u01fa"+ + "\u01fb\7p\2\2\u01fb\u01fc\7h\2\2\u01fc\u01fd\7q\2\2\u01fd\u01fe\7n\2\2"+ + "\u01fe\u01ff\7f\2\2\u01ff\u0200\7k\2\2\u0200\u0201\7p\2\2\u0201\u0202"+ + "\7i\2\2\u0202\61\3\2\2\2\u0203\u0204\7i\2\2\u0204\u0205\7j\2\2\u0205\u0206"+ + "\7q\2\2\u0206\u0207\7u\2\2\u0207\u0208\7v\2\2\u0208\63\3\2\2\2\u0209\u020a"+ + "\7k\2\2\u020a\u020b\7p\2\2\u020b\65\3\2\2\2\u020c\u020d\7%\2\2\u020d\67"+ + "\3\2\2\2\u020e\u020f\7u\2\2\u020f\u0210\7w\2\2\u0210\u0211\7d\2\2\u0211"+ + "\u0212\7u\2\2\u0212\u0213\7g\2\2\u0213\u0214\7v\2\2\u02149\3\2\2\2\u0215"+ + "\u0216\7w\2\2\u0216\u0217\7p\2\2\u0217\u0218\7k\2\2\u0218\u0219\7q\2\2"+ + "\u0219\u021a\7p\2\2\u021a;\3\2\2\2\u021b\u021c\7k\2\2\u021c\u021d\7p\2"+ + "\2\u021d\u021e\7v\2\2\u021e\u021f\7g\2\2\u021f\u0220\7t\2\2\u0220\u0221"+ + "\7u\2\2\u0221\u0222\7g\2\2\u0222\u0223\7e\2\2\u0223\u0224\7v\2\2\u0224"+ + "\u0225\7k\2\2\u0225\u0226\7q\2\2\u0226\u0227\7p\2\2\u0227=\3\2\2\2\u0228"+ + "\u0229\7u\2\2\u0229\u022a\7g\2\2\u022a\u022b\7v\2\2\u022b\u022c\7o\2\2"+ + "\u022c\u022d\7k\2\2\u022d\u022e\7p\2\2\u022e\u022f\7w\2\2\u022f\u0230"+ + "\7u\2\2\u0230?\3\2\2\2\u0231\u0232\7?\2\2\u0232\u0233\7?\2\2\u0233\u0234"+ + "\7@\2\2\u0234A\3\2\2\2\u0235\u0236\7/\2\2\u0236\u0237\7/\2\2\u0237\u0238"+ + "\7,\2\2\u0238C\3\2\2\2\u0239\u023a\7c\2\2\u023a\u023b\7r\2\2\u023b\u023c"+ + "\7r\2\2\u023c\u023d\7n\2\2\u023d\u023e\7{\2\2\u023eE\3\2\2\2\u023f\u0240"+ + "\7A\2\2\u0240G\3\2\2\2\u0241\u0242\7#\2\2\u0242\u0243\7>\2\2\u0243I\3"+ + "\2\2\2\u0244\u0245\7#\2\2\u0245\u0246\7@\2\2\u0246\u0247\3\2\2\2\u0247"+ + "\u0248\b%\2\2\u0248K\3\2\2\2\u0249\u024a\7u\2\2\u024a\u024b\7g\2\2\u024b"+ + "\u024c\7s\2\2\u024c\u024d\3\2\2\2\u024d\u024e\b&\2\2\u024eM\3\2\2\2\u024f"+ + "\u0250\7u\2\2\u0250\u0251\7g\2\2\u0251\u0252\7v\2\2\u0252\u0253\3\2\2"+ + "\2\u0253\u0254\b\'\2\2\u0254O\3\2\2\2\u0255\u0256\7o\2\2\u0256\u0257\7"+ + "u\2\2\u0257\u0258\7g\2\2\u0258\u0259\7v\2\2\u0259\u025a\3\2\2\2\u025a"+ + "\u025b\b(\2\2\u025bQ\3\2\2\2\u025c\u025d\7f\2\2\u025d\u025e\7k\2\2\u025e"+ + "\u025f\7e\2\2\u025f\u0260\7v\2\2\u0260\u0261\3\2\2\2\u0261\u0262\b)\2"+ + "\2\u0262S\3\2\2\2\u0263\u0264\7q\2\2\u0264\u0265\7r\2\2\u0265\u0266\7"+ + "v\2\2\u0266\u0267\7k\2\2\u0267\u0268\7q\2\2\u0268\u0269\7p\2\2\u0269\u026a"+ + "\3\2\2\2\u026a\u026b\b*\2\2\u026bU\3\2\2\2\u026c\u026d\7n\2\2\u026d\u026e"+ + "\7g\2\2\u026e\u026f\7p\2\2\u026f\u0270\3\2\2\2\u0270\u0271\b+\2\2\u0271"+ + "W\3\2\2\2\u0272\u0273\7p\2\2\u0273\u0274\7g\2\2\u0274\u0275\7y\2\2\u0275"+ + "\u0276\3\2\2\2\u0276\u0277\b,\2\2\u0277Y\3\2\2\2\u0278\u0279\7o\2\2\u0279"+ + "\u027a\7c\2\2\u027a\u027b\7m\2\2\u027b\u027c\7g\2\2\u027c\u027d\3\2\2"+ + "\2\u027d\u027e\b-\2\2\u027e[\3\2\2\2\u027f\u0280\7e\2\2\u0280\u0281\7"+ + "c\2\2\u0281\u0282\7r\2\2\u0282\u0283\3\2\2\2\u0283\u0284\b.\2\2\u0284"+ + "]\3\2\2\2\u0285\u0286\7u\2\2\u0286\u0287\7q\2\2\u0287\u0288\7o\2\2\u0288"+ + "\u0289\7g\2\2\u0289\u028a\3\2\2\2\u028a\u028b\b/\2\2\u028b_\3\2\2\2\u028c"+ + "\u028d\7i\2\2\u028d\u028e\7g\2\2\u028e\u028f\7v\2\2\u028f\u0290\3\2\2"+ + "\2\u0290\u0291\b\60\2\2\u0291a\3\2\2\2\u0292\u0293\7f\2\2\u0293\u0294"+ + "\7q\2\2\u0294\u0295\7o\2\2\u0295\u0296\7c\2\2\u0296\u0297\7k\2\2\u0297"+ + "\u0298\7p\2\2\u0298\u0299\3\2\2\2\u0299\u029a\b\61\2\2\u029ac\3\2\2\2"+ + "\u029b\u029c\7c\2\2\u029c\u029d\7z\2\2\u029d\u029e\7k\2\2\u029e\u029f"+ + "\7q\2\2\u029f\u02a0\7o\2\2\u02a0\u02a1\3\2\2\2\u02a1\u02a2\b\62\2\2\u02a2"+ + "e\3\2\2\2\u02a3\u02a4\7p\2\2\u02a4\u02a5\7q\2\2\u02a5\u02a6\7p\2\2\u02a6"+ + "\u02a7\7g\2\2\u02a7\u02a8\3\2\2\2\u02a8\u02a9\b\63\2\2\u02a9g\3\2\2\2"+ + "\u02aa\u02ab\7r\2\2\u02ab\u02ac\7t\2\2\u02ac\u02ad\7g\2\2\u02ad\u02ae"+ + "\7f\2\2\u02aei\3\2\2\2\u02af\u02b0\7v\2\2\u02b0\u02b1\7{\2\2\u02b1\u02b2"+ + "\7r\2\2\u02b2\u02b3\7g\2\2\u02b3\u02b4\7Q\2\2\u02b4\u02b5\7h\2\2\u02b5"+ + "\u02b6\3\2\2\2\u02b6\u02b7\b\65\2\2\u02b7k\3\2\2\2\u02b8\u02b9\7k\2\2"+ + "\u02b9\u02ba\7u\2\2\u02ba\u02bb\7E\2\2\u02bb\u02bc\7q\2\2\u02bc\u02bd"+ + "\7o\2\2\u02bd\u02be\7r\2\2\u02be\u02bf\7c\2\2\u02bf\u02c0\7t\2\2\u02c0"+ + "\u02c1\7c\2\2\u02c1\u02c2\7d\2\2\u02c2\u02c3\7n\2\2\u02c3\u02c4\7g\2\2"+ + "\u02c4\u02c5\3\2\2\2\u02c5\u02c6\b\66\2\2\u02c6m\3\2\2\2\u02c7\u02c8\7"+ + "u\2\2\u02c8\u02c9\7j\2\2\u02c9\u02ca\7c\2\2\u02ca\u02cb\7t\2\2\u02cb\u02cc"+ + "\7g\2\2\u02cco\3\2\2\2\u02cd\u02ce\7B\2\2\u02ce\u02cf\3\2\2\2\u02cf\u02d0"+ + "\b8\2\2\u02d0q\3\2\2\2\u02d1\u02d2\7\60\2\2\u02d2\u02d3\7\60\2\2\u02d3"+ + "s\3\2\2\2\u02d4\u02d5\7u\2\2\u02d5\u02d6\7j\2\2\u02d6\u02d7\7c\2\2\u02d7"+ + "\u02d8\7t\2\2\u02d8\u02d9\7g\2\2\u02d9\u02da\7f\2\2\u02dau\3\2\2\2\u02db"+ + "\u02dc\7g\2\2\u02dc\u02dd\7z\2\2\u02dd\u02de\7e\2\2\u02de\u02df\7n\2\2"+ + "\u02df\u02e0\7w\2\2\u02e0\u02e1\7u\2\2\u02e1\u02e2\7k\2\2\u02e2\u02e3"+ + "\7x\2\2\u02e3\u02e4\7g\2\2\u02e4w\3\2\2\2\u02e5\u02e6\7r\2\2\u02e6\u02e7"+ + "\7t\2\2\u02e7\u02e8\7g\2\2\u02e8\u02e9\7f\2\2\u02e9\u02ea\7k\2\2\u02ea"+ + "\u02eb\7e\2\2\u02eb\u02ec\7c\2\2\u02ec\u02ed\7v\2\2\u02ed\u02ee\7g\2\2"+ + "\u02eey\3\2\2\2\u02ef\u02f0\7y\2\2\u02f0\u02f1\7t\2\2\u02f1\u02f2\7k\2"+ + "\2\u02f2\u02f3\7v\2\2\u02f3\u02f4\7g\2\2\u02f4\u02f5\7R\2\2\u02f5\u02f6"+ + "\7g\2\2\u02f6\u02f7\7t\2\2\u02f7\u02f8\7o\2\2\u02f8\u02f9\3\2\2\2\u02f9"+ + "\u02fa\b=\2\2\u02fa{\3\2\2\2\u02fb\u02fc\7p\2\2\u02fc\u02fd\7q\2\2\u02fd"+ + "\u02fe\7R\2\2\u02fe\u02ff\7g\2\2\u02ff\u0300\7t\2\2\u0300\u0301\7o\2\2"+ + "\u0301\u0302\3\2\2\2\u0302\u0303\b>\2\2\u0303}\3\2\2\2\u0304\u0305\7v"+ + "\2\2\u0305\u0306\7t\2\2\u0306\u0307\7w\2\2\u0307\u0308\7u\2\2\u0308\u0309"+ + "\7v\2\2\u0309\u030a\7g\2\2\u030a\u030b\7f\2\2\u030b\u030c\3\2\2\2\u030c"+ + "\u030d\b?\2\2\u030d\177\3\2\2\2\u030e\u030f\7d\2\2\u030f\u0310\7t\2\2"+ + "\u0310\u0311\7g\2\2\u0311\u0312\7c\2\2\u0312\u0313\7m\2\2\u0313\u0314"+ + "\3\2\2\2\u0314\u0315\b@\2\2\u0315\u0081\3\2\2\2\u0316\u0317\7f\2\2\u0317"+ + "\u0318\7g\2\2\u0318\u0319\7h\2\2\u0319\u031a\7c\2\2\u031a\u031b\7w\2\2"+ + "\u031b\u031c\7n\2\2\u031c\u031d\7v\2\2\u031d\u0083\3\2\2\2\u031e\u031f"+ + "\7h\2\2\u031f\u0320\7w\2\2\u0320\u0321\7p\2\2\u0321\u0322\7e\2\2\u0322"+ + "\u0085\3\2\2\2\u0323\u0324\7k\2\2\u0324\u0325\7p\2\2\u0325\u0326\7v\2"+ + "\2\u0326\u0327\7g\2\2\u0327\u0328\7t\2\2\u0328\u0329\7h\2\2\u0329\u032a"+ + "\7c\2\2\u032a\u032b\7e\2\2\u032b\u032c\7g\2\2\u032c\u0087\3\2\2\2\u032d"+ + "\u032e\7u\2\2\u032e\u032f\7g\2\2\u032f\u0330\7n\2\2\u0330\u0331\7g\2\2"+ + "\u0331\u0332\7e\2\2\u0332\u0333\7v\2\2\u0333\u0089\3\2\2\2\u0334\u0335"+ + "\7e\2\2\u0335\u0336\7c\2\2\u0336\u0337\7u\2\2\u0337\u0338\7g\2\2\u0338"+ + "\u008b\3\2\2\2\u0339\u033a\7f\2\2\u033a\u033b\7g\2\2\u033b\u033c\7h\2"+ + "\2\u033c\u033d\7g\2\2\u033d\u033e\7t\2\2\u033e\u008d\3\2\2\2\u033f\u0340"+ + "\7i\2\2\u0340\u0341\7q\2\2\u0341\u008f\3\2\2\2\u0342\u0343\7o\2\2\u0343"+ + "\u0344\7c\2\2\u0344\u0345\7r\2\2\u0345\u0091\3\2\2\2\u0346\u0347\7u\2"+ + "\2\u0347\u0348\7v\2\2\u0348\u0349\7t\2\2\u0349\u034a\7w\2\2\u034a\u034b"+ + "\7e\2\2\u034b\u034c\7v\2\2\u034c\u0093\3\2\2\2\u034d\u034e\7e\2\2\u034e"+ + "\u034f\7j\2\2\u034f\u0350\7c\2\2\u0350\u0351\7p\2\2\u0351\u0095\3\2\2"+ + "\2\u0352\u0353\7g\2\2\u0353\u0354\7n\2\2\u0354\u0355\7u\2\2\u0355\u0356"+ + "\7g\2\2\u0356\u0097\3\2\2\2\u0357\u0358\7i\2\2\u0358\u0359\7q\2\2\u0359"+ + "\u035a\7v\2\2\u035a\u035b\7q\2\2\u035b\u0099\3\2\2\2\u035c\u035d\7r\2"+ + "\2\u035d\u035e\7c\2\2\u035e\u035f\7e\2\2\u035f\u0360\7m\2\2\u0360\u0361"+ + "\7c\2\2\u0361\u0362\7i\2\2\u0362\u0363\7g\2\2\u0363\u009b\3\2\2\2\u0364"+ + "\u0365\7u\2\2\u0365\u0366\7y\2\2\u0366\u0367\7k\2\2\u0367\u0368\7v\2\2"+ + "\u0368\u0369\7e\2\2\u0369\u036a\7j\2\2\u036a\u009d\3\2\2\2\u036b\u036c"+ + "\7e\2\2\u036c\u036d\7q\2\2\u036d\u036e\7p\2\2\u036e\u036f\7u\2\2\u036f"+ + "\u0370\7v\2\2\u0370\u009f\3\2\2\2\u0371\u0372\7h\2\2\u0372\u0373\7c\2"+ + "\2\u0373\u0374\7n\2\2\u0374\u0375\7n\2\2\u0375\u0376\7v\2\2\u0376\u0377"+ + "\7j\2\2\u0377\u0378\7t\2\2\u0378\u0379\7q\2\2\u0379\u037a\7w\2\2\u037a"+ + "\u037b\7i\2\2\u037b\u037c\7j\2\2\u037c\u037d\3\2\2\2\u037d\u037e\bP\2"+ + "\2\u037e\u00a1\3\2\2\2\u037f\u0380\7k\2\2\u0380\u0381\7h\2\2\u0381\u00a3"+ + "\3\2\2\2\u0382\u0383\7t\2\2\u0383\u0384\7c\2\2\u0384\u0385\7p\2\2\u0385"+ + "\u0386\7i\2\2\u0386\u0387\7g\2\2\u0387\u00a5\3\2\2\2\u0388\u0389\7v\2"+ + "\2\u0389\u038a\7{\2\2\u038a\u038b\7r\2\2\u038b\u038c\7g\2\2\u038c\u00a7"+ + "\3\2\2\2\u038d\u038e\7e\2\2\u038e\u038f\7q\2\2\u038f\u0390\7p\2\2\u0390"+ + "\u0391\7v\2\2\u0391\u0392\7k\2\2\u0392\u0393\7p\2\2\u0393\u0394\7w\2\2"+ + "\u0394\u0395\7g\2\2\u0395\u0396\3\2\2\2\u0396\u0397\bT\2\2\u0397\u00a9"+ + "\3\2\2\2\u0398\u0399\7h\2\2\u0399\u039a\7q\2\2\u039a\u039b\7t\2\2\u039b"+ + "\u00ab\3\2\2\2\u039c\u039d\7k\2\2\u039d\u039e\7o\2\2\u039e\u039f\7r\2"+ + "\2\u039f\u03a0\7q\2\2\u03a0\u03a1\7t\2\2\u03a1\u03a2\7v\2\2\u03a2\u00ad"+ + "\3\2\2\2\u03a3\u03a4\7t\2\2\u03a4\u03a5\7g\2\2\u03a5\u03a6\7v\2\2\u03a6"+ + "\u03a7\7w\2\2\u03a7\u03a8\7t\2\2\u03a8\u03a9\7p\2\2\u03a9\u03aa\3\2\2"+ + "\2\u03aa\u03ab\bW\2\2\u03ab\u00af\3\2\2\2\u03ac\u03ad\7x\2\2\u03ad\u03ae"+ + "\7c\2\2\u03ae\u03af\7t\2\2\u03af\u00b1\3\2\2\2\u03b0\u03b1\7p\2\2\u03b1"+ + "\u03b2\7k\2\2\u03b2\u03b3\7n\2\2\u03b3\u03b4\3\2\2\2\u03b4\u03b5\bY\2"+ + "\2\u03b5\u00b3\3\2\2\2\u03b6\u03bb\5\u0136\u009b\2\u03b7\u03ba\5\u0136"+ + "\u009b\2\u03b8\u03ba\5\u0138\u009c\2\u03b9\u03b7\3\2\2\2\u03b9\u03b8\3"+ + "\2\2\2\u03ba\u03bd\3\2\2\2\u03bb\u03b9\3\2\2\2\u03bb\u03bc\3\2\2\2\u03bc"+ + "\u03be\3\2\2\2\u03bd\u03bb\3\2\2\2\u03be\u03bf\bZ\2\2\u03bf\u00b5\3\2"+ + "\2\2\u03c0\u03c1\7*\2\2\u03c1\u00b7\3\2\2\2\u03c2\u03c3\7+\2\2\u03c3\u03c4"+ + "\3\2\2\2\u03c4\u03c5\b\\\2\2\u03c5\u00b9\3\2\2\2\u03c6\u03c7\7}\2\2\u03c7"+ + "\u00bb\3\2\2\2\u03c8\u03c9\7\177\2\2\u03c9\u03ca\3\2\2\2\u03ca\u03cb\b"+ + "^\2\2\u03cb\u00bd\3\2\2\2\u03cc\u03cd\7]\2\2\u03cd\u00bf\3\2\2\2\u03ce"+ + "\u03cf\7_\2\2\u03cf\u03d0\3\2\2\2\u03d0\u03d1\b`\2\2\u03d1\u00c1\3\2\2"+ + "\2\u03d2\u03d3\7?\2\2\u03d3\u00c3\3\2\2\2\u03d4\u03d5\7.\2\2\u03d5\u00c5"+ + "\3\2\2\2\u03d6\u03d7\7=\2\2\u03d7\u00c7\3\2\2\2\u03d8\u03d9\7<\2\2\u03d9"+ + "\u00c9\3\2\2\2\u03da\u03db\7\60\2\2\u03db\u00cb\3\2\2\2\u03dc\u03dd\7"+ + "-\2\2\u03dd\u03de\7-\2\2\u03de\u03df\3\2\2\2\u03df\u03e0\bf\2\2\u03e0"+ + "\u00cd\3\2\2\2\u03e1\u03e2\7/\2\2\u03e2\u03e3\7/\2\2\u03e3\u03e4\3\2\2"+ + "\2\u03e4\u03e5\bg\2\2\u03e5\u00cf\3\2\2\2\u03e6\u03e7\7<\2\2\u03e7\u03e8"+ + "\7?\2\2\u03e8\u00d1\3\2\2\2\u03e9\u03ea\7\60\2\2\u03ea\u03eb\7\60\2\2"+ + "\u03eb\u03ec\7\60\2\2\u03ec\u00d3\3\2\2\2\u03ed\u03ee\7~\2\2\u03ee\u03ef"+ + "\7~\2\2\u03ef\u00d5\3\2\2\2\u03f0\u03f1\7(\2\2\u03f1\u03f2\7(\2\2\u03f2"+ + "\u00d7\3\2\2\2\u03f3\u03f4\7?\2\2\u03f4\u03f5\7?\2\2\u03f5\u00d9\3\2\2"+ + "\2\u03f6\u03f7\7#\2\2\u03f7\u03f8\7?\2\2\u03f8\u00db\3\2\2\2\u03f9\u03fa"+ + "\7>\2\2\u03fa\u00dd\3\2\2\2\u03fb\u03fc\7>\2\2\u03fc\u03fd\7?\2\2\u03fd"+ + "\u00df\3\2\2\2\u03fe\u03ff\7@\2\2\u03ff\u00e1\3\2\2\2\u0400\u0401\7@\2"+ + "\2\u0401\u0402\7?\2\2\u0402\u00e3\3\2\2\2\u0403\u0404\7~\2\2\u0404\u00e5"+ + "\3\2\2\2\u0405\u0406\7\61\2\2\u0406\u00e7\3\2\2\2\u0407\u0408\7\'\2\2"+ + "\u0408\u00e9\3\2\2\2\u0409\u040a\7>\2\2\u040a\u040b\7>\2\2\u040b\u00eb"+ + "\3\2\2\2\u040c\u040d\7@\2\2\u040d\u040e\7@\2\2\u040e\u00ed\3\2\2\2\u040f"+ + "\u0410\7(\2\2\u0410\u0411\7`\2\2\u0411\u00ef\3\2\2\2\u0412\u0413\7#\2"+ + "\2\u0413\u00f1\3\2\2\2\u0414\u0415\7-\2\2\u0415\u00f3\3\2\2\2\u0416\u0417"+ + "\7/\2\2\u0417\u00f5\3\2\2\2\u0418\u0419\7`\2\2\u0419\u00f7\3\2\2\2\u041a"+ + "\u041b\7,\2\2\u041b\u00f9\3\2\2\2\u041c\u041d\7(\2\2\u041d\u00fb\3\2\2"+ + "\2\u041e\u041f\7>\2\2\u041f\u0420\7/\2\2\u0420\u00fd\3\2\2\2\u0421\u042d"+ + "\7\62\2\2\u0422\u0429\t\2\2\2\u0423\u0425\7a\2\2\u0424\u0423\3\2\2\2\u0424"+ + "\u0425\3\2\2\2\u0425\u0426\3\2\2\2\u0426\u0428\t\3\2\2\u0427\u0424\3\2"+ + "\2\2\u0428\u042b\3\2\2\2\u0429\u0427\3\2\2\2\u0429\u042a\3\2\2\2\u042a"+ + "\u042d\3\2\2\2\u042b\u0429\3\2\2\2\u042c\u0421\3\2\2\2\u042c\u0422\3\2"+ + "\2\2\u042d\u042e\3\2\2\2\u042e\u042f\b\177\2\2\u042f\u00ff\3\2\2\2\u0430"+ + "\u0431\7\62\2\2\u0431\u0436\t\4\2\2\u0432\u0434\7a\2\2\u0433\u0432\3\2"+ + "\2\2\u0433\u0434\3\2\2\2\u0434\u0435\3\2\2\2\u0435\u0437\5\u0132\u0099"+ + "\2\u0436\u0433\3\2\2\2\u0437\u0438\3\2\2\2\u0438\u0436\3\2\2\2\u0438\u0439"+ + "\3\2\2\2\u0439\u043a\3\2\2\2\u043a\u043b\b\u0080\2\2\u043b\u0101\3\2\2"+ + "\2\u043c\u043e\7\62\2\2\u043d\u043f\t\5\2\2\u043e\u043d\3\2\2\2\u043e"+ + "\u043f\3\2\2\2\u043f\u0444\3\2\2\2\u0440\u0442\7a\2\2\u0441\u0440\3\2"+ + "\2\2\u0441\u0442\3\2\2\2\u0442\u0443\3\2\2\2\u0443\u0445\5\u012e\u0097"+ + "\2\u0444\u0441\3\2\2\2\u0445\u0446\3\2\2\2\u0446\u0444\3\2\2\2\u0446\u0447"+ + "\3\2\2\2\u0447\u0448\3\2\2\2\u0448\u0449\b\u0081\2\2\u0449\u0103\3\2\2"+ + "\2\u044a\u044b\7\62\2\2\u044b\u0450\t\6\2\2\u044c\u044e\7a\2\2\u044d\u044c"+ + "\3\2\2\2\u044d\u044e\3\2\2\2\u044e\u044f\3\2\2\2\u044f\u0451\5\u0130\u0098"+ + "\2\u0450\u044d\3\2\2\2\u0451\u0452\3\2\2\2\u0452\u0450\3\2\2\2\u0452\u0453"+ + "\3\2\2\2\u0453\u0454\3\2\2\2\u0454\u0455\b\u0082\2\2\u0455\u0105\3\2\2"+ + "\2\u0456\u0457\7\62\2\2\u0457\u0458\t\6\2\2\u0458\u0459\5\u0108\u0084"+ + "\2\u0459\u045a\5\u010a\u0085\2\u045a\u0107\3\2\2\2\u045b\u045d\7a\2\2"+ + "\u045c\u045b\3\2\2\2\u045c\u045d\3\2\2\2\u045d\u045e\3\2\2\2\u045e\u0460"+ + "\5\u0130\u0098\2\u045f\u045c\3\2\2\2\u0460\u0461\3\2\2\2\u0461\u045f\3"+ + "\2\2\2\u0461\u0462\3\2\2\2\u0462\u046d\3\2\2\2\u0463\u046a\7\60\2\2\u0464"+ + "\u0466\7a\2\2\u0465\u0464\3\2\2\2\u0465\u0466\3\2\2\2\u0466\u0467\3\2"+ + "\2\2\u0467\u0469\5\u0130\u0098\2\u0468\u0465\3\2\2\2\u0469\u046c\3\2\2"+ + "\2\u046a\u0468\3\2\2\2\u046a\u046b\3\2\2\2\u046b\u046e\3\2\2\2\u046c\u046a"+ + "\3\2\2\2\u046d\u0463\3\2\2\2\u046d\u046e\3\2\2\2\u046e\u047b\3\2\2\2\u046f"+ + "\u0470\7\60\2\2\u0470\u0477\5\u0130\u0098\2\u0471\u0473\7a\2\2\u0472\u0471"+ + "\3\2\2\2\u0472\u0473\3\2\2\2\u0473\u0474\3\2\2\2\u0474\u0476\5\u0130\u0098"+ + "\2\u0475\u0472\3\2\2\2\u0476\u0479\3\2\2\2\u0477\u0475\3\2\2\2\u0477\u0478"+ + "\3\2\2\2\u0478\u047b\3\2\2\2\u0479\u0477\3\2\2\2\u047a\u045f\3\2\2\2\u047a"+ + "\u046f\3\2\2\2\u047b\u0109\3\2\2\2\u047c\u047d\t\7\2\2\u047d\u047e\t\b"+ + "\2\2\u047e\u047f\5\u012c\u0096\2\u047f\u010b\3\2\2\2\u0480\u0486\5\u00fe"+ + "\177\2\u0481\u0486\5\u0100\u0080\2\u0482\u0486\5\u0102\u0081\2\u0483\u0486"+ + "\5\u0104\u0082\2\u0484\u0486\5\4\2\2\u0485\u0480\3\2\2\2\u0485\u0481\3"+ + "\2\2\2\u0485\u0482\3\2\2\2\u0485\u0483\3\2\2\2\u0485\u0484\3\2\2\2\u0486"+ + "\u0487\3\2\2\2\u0487\u0488\7k\2\2\u0488\u0489\3\2\2\2\u0489\u048a\b\u0086"+ + "\2\2\u048a\u010d\3\2\2\2\u048b\u048e\7)\2\2\u048c\u048f\5\u0128\u0094"+ + "\2\u048d\u048f\5\u0112\u0089\2\u048e\u048c\3\2\2\2\u048e\u048d\3\2\2\2"+ + "\u048f\u0490\3\2\2\2\u0490\u0491\7)\2\2\u0491\u010f\3\2\2\2\u0492\u0493"+ + "\5\u010e\u0087\2\u0493\u0494\3\2\2\2\u0494\u0495\b\u0088\2\2\u0495\u0111"+ + "\3\2\2\2\u0496\u0499\5\u0114\u008a\2\u0497\u0499\5\u0116\u008b\2\u0498"+ + "\u0496\3\2\2\2\u0498\u0497\3\2\2\2\u0499\u0113\3\2\2\2\u049a\u049b\7^"+ + "\2\2\u049b\u049c\5\u012e\u0097\2\u049c\u049d\5\u012e\u0097\2\u049d\u049e"+ + "\5\u012e\u0097\2\u049e\u0115\3\2\2\2\u049f\u04a0\7^\2\2\u04a0\u04a1\7"+ + "z\2\2\u04a1\u04a2\5\u0130\u0098\2\u04a2\u04a3\5\u0130\u0098\2\u04a3\u0117"+ + "\3\2\2\2\u04a4\u04a5\7^\2\2\u04a5\u04a6\7w\2\2\u04a6\u04a7\5\u0130\u0098"+ + "\2\u04a7\u04a8\5\u0130\u0098\2\u04a8\u04a9\5\u0130\u0098\2\u04a9\u04aa"+ + "\5\u0130\u0098\2\u04aa\u0119\3\2\2\2\u04ab\u04ac\7^\2\2\u04ac\u04ad\7"+ + "W\2\2\u04ad\u04ae\5\u0130\u0098\2\u04ae\u04af\5\u0130\u0098\2\u04af\u04b0"+ + "\5\u0130\u0098\2\u04b0\u04b1\5\u0130\u0098\2\u04b1\u04b2\5\u0130\u0098"+ + "\2\u04b2\u04b3\5\u0130\u0098\2\u04b3\u04b4\5\u0130\u0098\2\u04b4\u04b5"+ + "\5\u0130\u0098\2\u04b5\u011b\3\2\2\2\u04b6\u04ba\7b\2\2\u04b7\u04b9\n"+ + "\t\2\2\u04b8\u04b7\3\2\2\2\u04b9\u04bc\3\2\2\2\u04ba\u04b8\3\2\2\2\u04ba"+ + "\u04bb\3\2\2\2\u04bb\u04bd\3\2\2\2\u04bc\u04ba\3\2\2\2\u04bd\u04be\7b"+ + "\2\2\u04be\u04bf\3\2\2\2\u04bf\u04c0\b\u008e\2\2\u04c0\u011d\3\2\2\2\u04c1"+ + "\u04c6\7$\2\2\u04c2\u04c5\n\n\2\2\u04c3\u04c5\5\u012a\u0095\2\u04c4\u04c2"+ + "\3\2\2\2\u04c4\u04c3\3\2\2\2\u04c5\u04c8\3\2\2\2\u04c6\u04c4\3\2\2\2\u04c6"+ + "\u04c7\3\2\2\2\u04c7\u04c9\3\2\2\2\u04c8\u04c6\3\2\2\2\u04c9\u04ca\7$"+ + "\2\2\u04ca\u04cb\3\2\2\2\u04cb\u04cc\b\u008f\2\2\u04cc\u011f\3\2\2\2\u04cd"+ + "\u04cf\t\13\2\2\u04ce\u04cd\3\2\2\2\u04cf\u04d0\3\2\2\2\u04d0\u04ce\3"+ + "\2\2\2\u04d0\u04d1\3\2\2\2\u04d1\u04d2\3\2\2\2\u04d2\u04d3\b\u0090\3\2"+ + "\u04d3\u0121\3\2\2\2\u04d4\u04d5\7\61\2\2\u04d5\u04d6\7,\2\2\u04d6\u04da"+ + "\3\2\2\2\u04d7\u04d9\13\2\2\2\u04d8\u04d7\3\2\2\2\u04d9\u04dc\3\2\2\2"+ + "\u04da\u04db\3\2\2\2\u04da\u04d8\3\2\2\2\u04db\u04dd\3\2\2\2\u04dc\u04da"+ + "\3\2\2\2\u04dd\u04de\7,\2\2\u04de\u04df\7\61\2\2\u04df\u04e0\3\2\2\2\u04e0"+ + "\u04e1\b\u0091\3\2\u04e1\u0123\3\2\2\2\u04e2\u04e4\t\f\2\2\u04e3\u04e2"+ + "\3\2\2\2\u04e4\u04e5\3\2\2\2\u04e5\u04e3\3\2\2\2\u04e5\u04e6\3\2\2\2\u04e6"+ + "\u04e7\3\2\2\2\u04e7\u04e8\b\u0092\3\2\u04e8\u0125\3\2\2\2\u04e9\u04ea"+ + "\7\61\2\2\u04ea\u04eb\7\61\2\2\u04eb\u04ef\3\2\2\2\u04ec\u04ee\n\f\2\2"+ + "\u04ed\u04ec\3\2\2\2\u04ee\u04f1\3\2\2\2\u04ef\u04ed\3\2\2\2\u04ef\u04f0"+ + "\3\2\2\2\u04f0\u04f2\3\2\2\2\u04f1\u04ef\3\2\2\2\u04f2\u04f3\b\u0093\3"+ + "\2\u04f3\u0127\3\2\2\2\u04f4\u04f9\n\r\2\2\u04f5\u04f9\5\u0118\u008c\2"+ + "\u04f6\u04f9\5\u011a\u008d\2\u04f7\u04f9\5\u012a\u0095\2\u04f8\u04f4\3"+ + "\2\2\2\u04f8\u04f5\3\2\2\2\u04f8\u04f6\3\2\2\2\u04f8\u04f7\3\2\2\2\u04f9"+ + "\u0129\3\2\2\2\u04fa\u0514\7^\2\2\u04fb\u04fc\7w\2\2\u04fc\u04fd\5\u0130"+ + "\u0098\2\u04fd\u04fe\5\u0130\u0098\2\u04fe\u04ff\5\u0130\u0098\2\u04ff"+ + "\u0500\5\u0130\u0098\2\u0500\u0515\3\2\2\2\u0501\u0502\7W\2\2\u0502\u0503"+ + "\5\u0130\u0098\2\u0503\u0504\5\u0130\u0098\2\u0504\u0505\5\u0130\u0098"+ + "\2\u0505\u0506\5\u0130\u0098\2\u0506\u0507\5\u0130\u0098\2\u0507\u0508"+ + "\5\u0130\u0098\2\u0508\u0509\5\u0130\u0098\2\u0509\u050a\5\u0130\u0098"+ + "\2\u050a\u0515\3\2\2\2\u050b\u0515\t\16\2\2\u050c\u050d\5\u012e\u0097"+ + "\2\u050d\u050e\5\u012e\u0097\2\u050e\u050f\5\u012e\u0097\2\u050f\u0515"+ + "\3\2\2\2\u0510\u0511\7z\2\2\u0511\u0512\5\u0130\u0098\2\u0512\u0513\5"+ + "\u0130\u0098\2\u0513\u0515\3\2\2\2\u0514\u04fb\3\2\2\2\u0514\u0501\3\2"+ + "\2\2\u0514\u050b\3\2\2\2\u0514\u050c\3\2\2\2\u0514\u0510\3\2\2\2\u0515"+ + "\u012b\3\2\2\2\u0516\u051d\t\3\2\2\u0517\u0519\7a\2\2\u0518\u0517\3\2"+ + "\2\2\u0518\u0519\3\2\2\2\u0519\u051a\3\2\2\2\u051a\u051c\t\3\2\2\u051b"+ + "\u0518\3\2\2\2\u051c\u051f\3\2\2\2\u051d\u051b\3\2\2\2\u051d\u051e\3\2"+ + "\2\2\u051e\u012d\3\2\2\2\u051f\u051d\3\2\2\2\u0520\u0521\t\17\2\2\u0521"+ + "\u012f\3\2\2\2\u0522\u0523\t\20\2\2\u0523\u0131\3\2\2\2\u0524\u0525\t"+ + "\21\2\2\u0525\u0133\3\2\2\2\u0526\u0528\t\22\2\2\u0527\u0529\t\b\2\2\u0528"+ + "\u0527\3\2\2\2\u0528\u0529\3\2\2\2\u0529\u052a\3\2\2\2\u052a\u052b\5\u012c"+ + "\u0096\2\u052b\u0135\3\2\2\2\u052c\u052f\5\u013a\u009d\2\u052d\u052f\7"+ + "a\2\2\u052e\u052c\3\2\2\2\u052e\u052d\3\2\2\2\u052f\u0137\3\2\2\2\u0530"+ + "\u0531\t\23\2\2\u0531\u0139\3\2\2\2\u0532\u0533\t\24\2\2\u0533\u013b\3"+ + "\2\2\2\u0534\u0536\t\13\2\2\u0535\u0534\3\2\2\2\u0536\u0537\3\2\2\2\u0537"+ + "\u0535\3\2\2\2\u0537\u0538\3\2\2\2\u0538\u0539\3\2\2\2\u0539\u053a\b\u009e"+ + "\3\2\u053a\u013d\3\2\2\2\u053b\u053c\7\61\2\2\u053c\u053d\7,\2\2\u053d"+ + "\u0541\3\2\2\2\u053e\u0540\n\f\2\2\u053f\u053e\3\2\2\2\u0540\u0543\3\2"+ + "\2\2\u0541\u0542\3\2\2\2\u0541\u053f\3\2\2\2\u0542\u0544\3\2\2\2\u0543"+ + "\u0541\3\2\2\2\u0544\u0545\7,\2\2\u0545\u0546\7\61\2\2\u0546\u0547\3\2"+ + "\2\2\u0547\u0548\b\u009f\3\2\u0548\u013f\3\2\2\2\u0549\u054a\7\61\2\2"+ + "\u054a\u054b\7\61\2\2\u054b\u054f\3\2\2\2\u054c\u054e\n\f\2\2\u054d\u054c"+ + "\3\2\2\2\u054e\u0551\3\2\2\2\u054f\u054d\3\2\2\2\u054f\u0550\3\2\2\2\u0550"+ + "\u0552\3\2\2\2\u0551\u054f\3\2\2\2\u0552\u0553\b\u00a0\3\2\u0553\u0141"+ + "\3\2\2\2\u0554\u0556\t\f\2\2\u0555\u0554\3\2\2\2\u0556\u0557\3\2\2\2\u0557"+ + "\u0555\3\2\2\2\u0557\u0558\3\2\2\2\u0558\u0567\3\2\2\2\u0559\u0567\7="+ + "\2\2\u055a\u055b\7\61\2\2\u055b\u055c\7,\2\2\u055c\u0560\3\2\2\2\u055d"+ + "\u055f\13\2\2\2\u055e\u055d\3\2\2\2\u055f\u0562\3\2\2\2\u0560\u0561\3"+ + "\2\2\2\u0560\u055e\3\2\2\2\u0561\u0563\3\2\2\2\u0562\u0560\3\2\2\2\u0563"+ + "\u0564\7,\2\2\u0564\u0567\7\61\2\2\u0565\u0567\7\2\2\3\u0566\u0555\3\2"+ + "\2\2\u0566\u0559\3\2\2\2\u0566\u055a\3\2\2\2\u0566\u0565\3\2\2\2\u0567"+ + "\u0568\3\2\2\2\u0568\u0569\b\u00a1\4\2\u0569\u0143\3\2\2\2\u056a\u056b"+ + "\3\2\2\2\u056b\u056c\3\2\2\2\u056c\u056d\b\u00a2\4\2\u056d\u056e\b\u00a2"+ + "\3\2\u056e\u0145\3\2\2\2\64\2\3\u0148\u0150\u0153\u0156\u015c\u015e\u03b9"+ + "\u03bb\u0424\u0429\u042c\u0433\u0438\u043e\u0441\u0446\u044d\u0452\u045c"+ + "\u0461\u0465\u046a\u046d\u0472\u0477\u047a\u0485\u048e\u0498\u04ba\u04c4"+ + "\u04c6\u04d0\u04da\u04e5\u04ef\u04f8\u0514\u0518\u051d\u0528\u052e\u0537"+ + "\u0541\u054f\u0557\u0560\u0566\5\4\3\2\2\3\2\4\2\2"; + public static final ATN _ATN = + new ATNDeserializer().deserialize(_serializedATN.toCharArray()); + static { + _decisionToDFA = new DFA[_ATN.getNumberOfDecisions()]; + for (int i = 0; i < _ATN.getNumberOfDecisions(); i++) { + _decisionToDFA[i] = new DFA(_ATN.getDecisionState(i), i); + } + } +} \ No newline at end of file diff --git a/src/main/java/viper/gobra/frontend/GobraParser.java b/src/main/java/viper/gobra/frontend/GobraParser.java new file mode 100644 index 000000000..26ca40a2f --- /dev/null +++ b/src/main/java/viper/gobra/frontend/GobraParser.java @@ -0,0 +1,12013 @@ +// Generated from /home/nico/Documents/repositories/projects/eth/BA/gobraHome/gobra/src/main/antlr4/GobraParser.g4 by ANTLR 4.9.2 +package viper.gobra.frontend; +import org.antlr.v4.runtime.atn.*; +import org.antlr.v4.runtime.dfa.DFA; +import org.antlr.v4.runtime.*; +import org.antlr.v4.runtime.misc.*; +import org.antlr.v4.runtime.tree.*; +import java.util.List; +import java.util.Iterator; +import java.util.ArrayList; + +@SuppressWarnings({"all", "warnings", "unchecked", "unused", "cast"}) +public class GobraParser extends GobraParserBase { + static { RuntimeMetaData.checkVersion("4.9.2", RuntimeMetaData.VERSION); } + + protected static final DFA[] _decisionToDFA; + protected static final PredictionContextCache _sharedContextCache = + new PredictionContextCache(); + public static final int + FLOAT_LIT=1, DECIMAL_FLOAT_LIT=2, TRUE=3, FALSE=4, ASSERT=5, ASSUME=6, + INHALE=7, EXHALE=8, PRE=9, PRESERVES=10, POST=11, INV=12, DEC=13, PURE=14, + IMPL=15, OLD=16, LHS=17, FORALL=18, EXISTS=19, ACCESS=20, FOLD=21, UNFOLD=22, + UNFOLDING=23, GHOST=24, IN=25, MULTI=26, SUBSET=27, UNION=28, INTERSECTION=29, + SETMINUS=30, IMPLIES=31, WAND=32, APPLY=33, QMARK=34, L_PRED=35, R_PRED=36, + SEQ=37, SET=38, MSET=39, DICT=40, OPT=41, LEN=42, NEW=43, MAKE=44, CAP=45, + SOME=46, GET=47, DOM=48, AXIOM=49, NONE=50, PRED=51, TYPE_OF=52, IS_COMPARABLE=53, + SHARE=54, ADDR_MOD=55, DOT_DOT=56, SHARED=57, EXCLUSIVE=58, PREDICATE=59, + WRITEPERM=60, NOPERM=61, TRUSTED=62, BREAK=63, DEFAULT=64, FUNC=65, INTERFACE=66, + SELECT=67, CASE=68, DEFER=69, GO=70, MAP=71, STRUCT=72, CHAN=73, ELSE=74, + GOTO=75, PACKAGE=76, SWITCH=77, CONST=78, FALLTHROUGH=79, IF=80, RANGE=81, + TYPE=82, CONTINUE=83, FOR=84, IMPORT=85, RETURN=86, VAR=87, NIL_LIT=88, + IDENTIFIER=89, L_PAREN=90, R_PAREN=91, L_CURLY=92, R_CURLY=93, L_BRACKET=94, + R_BRACKET=95, ASSIGN=96, COMMA=97, SEMI=98, COLON=99, DOT=100, PLUS_PLUS=101, + MINUS_MINUS=102, DECLARE_ASSIGN=103, ELLIPSIS=104, LOGICAL_OR=105, LOGICAL_AND=106, + EQUALS=107, NOT_EQUALS=108, LESS=109, LESS_OR_EQUALS=110, GREATER=111, + GREATER_OR_EQUALS=112, OR=113, DIV=114, MOD=115, LSHIFT=116, RSHIFT=117, + BIT_CLEAR=118, EXCLAMATION=119, PLUS=120, MINUS=121, CARET=122, STAR=123, + AMPERSAND=124, RECEIVE=125, DECIMAL_LIT=126, BINARY_LIT=127, OCTAL_LIT=128, + HEX_LIT=129, HEX_FLOAT_LIT=130, IMAGINARY_LIT=131, RUNE_LIT=132, BYTE_VALUE=133, + OCTAL_BYTE_VALUE=134, HEX_BYTE_VALUE=135, LITTLE_U_VALUE=136, BIG_U_VALUE=137, + RAW_STRING_LIT=138, INTERPRETED_STRING_LIT=139, WS=140, COMMENT=141, TERMINATOR=142, + LINE_COMMENT=143, WS_NLSEMI=144, COMMENT_NLSEMI=145, LINE_COMMENT_NLSEMI=146, + EOS=147, OTHER=148; + public static final int + RULE_exprOnly = 0, RULE_stmtOnly = 1, RULE_typeOnly = 2, RULE_maybeAddressableIdentifierList = 3, + RULE_maybeAddressableIdentifier = 4, RULE_ghostStatement = 5, RULE_ghostPrimaryExpr = 6, + RULE_permission = 7, RULE_typeExpr = 8, RULE_boundVariables = 9, RULE_boundVariableDecl = 10, + RULE_triggers = 11, RULE_trigger = 12, RULE_predicateAccess = 13, RULE_optionSome = 14, + RULE_optionNone = 15, RULE_optionGet = 16, RULE_sConversion = 17, RULE_old = 18, + RULE_oldLabelUse = 19, RULE_labelUse = 20, RULE_isComparable = 21, RULE_typeOf = 22, + RULE_access = 23, RULE_range = 24, RULE_seqUpdExp = 25, RULE_seqUpdClause = 26, + RULE_ghostTypeLit = 27, RULE_domainType = 28, RULE_domainClause = 29, + RULE_ghostSliceType = 30, RULE_sqType = 31, RULE_specification = 32, RULE_specStatement = 33, + RULE_terminationMeasure = 34, RULE_assertion = 35, RULE_blockWithBodyParameterInfo = 36, + RULE_implementationProof = 37, RULE_methodImplementationProof = 38, RULE_nonLocalReceiver = 39, + RULE_selection = 40, RULE_implementationProofPredicateAlias = 41, RULE_make = 42, + RULE_new_ = 43, RULE_specMember = 44, RULE_functionDecl = 45, RULE_methodDecl = 46, + RULE_sourceFile = 47, RULE_ghostMember = 48, RULE_explicitGhostMember = 49, + RULE_fpredicateDecl = 50, RULE_predicateBody = 51, RULE_mpredicateDecl = 52, + RULE_varSpec = 53, RULE_shortVarDecl = 54, RULE_receiver = 55, RULE_parameterDecl = 56, + RULE_actualParameterDecl = 57, RULE_ghostParameterDecl = 58, RULE_parameterType = 59, + RULE_expression = 60, RULE_statement = 61, RULE_applyStmt = 62, RULE_packageStmt = 63, + RULE_specForStmt = 64, RULE_loopSpec = 65, RULE_basicLit = 66, RULE_primaryExpr = 67, + RULE_predConstructArgs = 68, RULE_interfaceType = 69, RULE_predicateSpec = 70, + RULE_methodSpec = 71, RULE_type_ = 72, RULE_typeLit = 73, RULE_predType = 74, + RULE_predTypeParams = 75, RULE_literalType = 76, RULE_implicitArray = 77, + RULE_slice_ = 78, RULE_low = 79, RULE_high = 80, RULE_cap = 81, RULE_assign_op = 82, + RULE_packageClause = 83, RULE_importDecl = 84, RULE_importSpec = 85, RULE_importPath = 86, + RULE_declaration = 87, RULE_constDecl = 88, RULE_constSpec = 89, RULE_identifierList = 90, + RULE_expressionList = 91, RULE_typeDecl = 92, RULE_typeSpec = 93, RULE_varDecl = 94, + RULE_block = 95, RULE_statementList = 96, RULE_simpleStmt = 97, RULE_expressionStmt = 98, + RULE_sendStmt = 99, RULE_incDecStmt = 100, RULE_assignment = 101, RULE_emptyStmt = 102, + RULE_labeledStmt = 103, RULE_returnStmt = 104, RULE_breakStmt = 105, RULE_continueStmt = 106, + RULE_gotoStmt = 107, RULE_fallthroughStmt = 108, RULE_deferStmt = 109, + RULE_ifStmt = 110, RULE_switchStmt = 111, RULE_exprSwitchStmt = 112, RULE_exprCaseClause = 113, + RULE_exprSwitchCase = 114, RULE_typeSwitchStmt = 115, RULE_typeSwitchGuard = 116, + RULE_typeCaseClause = 117, RULE_typeSwitchCase = 118, RULE_typeList = 119, + RULE_selectStmt = 120, RULE_commClause = 121, RULE_commCase = 122, RULE_recvStmt = 123, + RULE_forStmt = 124, RULE_forClause = 125, RULE_rangeClause = 126, RULE_goStmt = 127, + RULE_typeName = 128, RULE_arrayType = 129, RULE_arrayLength = 130, RULE_elementType = 131, + RULE_pointerType = 132, RULE_sliceType = 133, RULE_mapType = 134, RULE_channelType = 135, + RULE_functionType = 136, RULE_signature = 137, RULE_result = 138, RULE_parameters = 139, + RULE_conversion = 140, RULE_nonNamedType = 141, RULE_operand = 142, RULE_literal = 143, + RULE_integer = 144, RULE_operandName = 145, RULE_qualifiedIdent = 146, + RULE_compositeLit = 147, RULE_literalValue = 148, RULE_elementList = 149, + RULE_keyedElement = 150, RULE_key = 151, RULE_element = 152, RULE_structType = 153, + RULE_fieldDecl = 154, RULE_string_ = 155, RULE_embeddedField = 156, RULE_functionLit = 157, + RULE_index = 158, RULE_typeAssertion = 159, RULE_arguments = 160, RULE_methodExpr = 161, + RULE_receiverType = 162, RULE_eos = 163; + private static String[] makeRuleNames() { + return new String[] { + "exprOnly", "stmtOnly", "typeOnly", "maybeAddressableIdentifierList", + "maybeAddressableIdentifier", "ghostStatement", "ghostPrimaryExpr", "permission", + "typeExpr", "boundVariables", "boundVariableDecl", "triggers", "trigger", + "predicateAccess", "optionSome", "optionNone", "optionGet", "sConversion", + "old", "oldLabelUse", "labelUse", "isComparable", "typeOf", "access", + "range", "seqUpdExp", "seqUpdClause", "ghostTypeLit", "domainType", "domainClause", + "ghostSliceType", "sqType", "specification", "specStatement", "terminationMeasure", + "assertion", "blockWithBodyParameterInfo", "implementationProof", "methodImplementationProof", + "nonLocalReceiver", "selection", "implementationProofPredicateAlias", + "make", "new_", "specMember", "functionDecl", "methodDecl", "sourceFile", + "ghostMember", "explicitGhostMember", "fpredicateDecl", "predicateBody", + "mpredicateDecl", "varSpec", "shortVarDecl", "receiver", "parameterDecl", + "actualParameterDecl", "ghostParameterDecl", "parameterType", "expression", + "statement", "applyStmt", "packageStmt", "specForStmt", "loopSpec", "basicLit", + "primaryExpr", "predConstructArgs", "interfaceType", "predicateSpec", + "methodSpec", "type_", "typeLit", "predType", "predTypeParams", "literalType", + "implicitArray", "slice_", "low", "high", "cap", "assign_op", "packageClause", + "importDecl", "importSpec", "importPath", "declaration", "constDecl", + "constSpec", "identifierList", "expressionList", "typeDecl", "typeSpec", + "varDecl", "block", "statementList", "simpleStmt", "expressionStmt", + "sendStmt", "incDecStmt", "assignment", "emptyStmt", "labeledStmt", "returnStmt", + "breakStmt", "continueStmt", "gotoStmt", "fallthroughStmt", "deferStmt", + "ifStmt", "switchStmt", "exprSwitchStmt", "exprCaseClause", "exprSwitchCase", + "typeSwitchStmt", "typeSwitchGuard", "typeCaseClause", "typeSwitchCase", + "typeList", "selectStmt", "commClause", "commCase", "recvStmt", "forStmt", + "forClause", "rangeClause", "goStmt", "typeName", "arrayType", "arrayLength", + "elementType", "pointerType", "sliceType", "mapType", "channelType", + "functionType", "signature", "result", "parameters", "conversion", "nonNamedType", + "operand", "literal", "integer", "operandName", "qualifiedIdent", "compositeLit", + "literalValue", "elementList", "keyedElement", "key", "element", "structType", + "fieldDecl", "string_", "embeddedField", "functionLit", "index", "typeAssertion", + "arguments", "methodExpr", "receiverType", "eos" + }; + } + public static final String[] ruleNames = makeRuleNames(); + + private static String[] makeLiteralNames() { + return new String[] { + null, null, null, "'true'", "'false'", "'assert'", "'assume'", "'inhale'", + "'exhale'", "'requires'", "'preserves'", "'ensures'", "'invariant'", + "'decreases'", "'pure'", "'implements'", "'old'", "'#lhs'", "'forall'", + "'exists'", "'acc'", "'fold'", "'unfold'", "'unfolding'", "'ghost'", + "'in'", "'#'", "'subset'", "'union'", "'intersection'", "'setminus'", + "'==>'", "'--*'", "'apply'", "'?'", "'!<'", "'!>'", "'seq'", "'set'", + "'mset'", "'dict'", "'option'", "'len'", "'new'", "'make'", "'cap'", + "'some'", "'get'", "'domain'", "'axiom'", "'none'", "'pred'", "'typeOf'", + "'isComparable'", "'share'", "'@'", "'..'", "'shared'", "'exclusive'", + "'predicate'", "'writePerm'", "'noPerm'", "'trusted'", "'break'", "'default'", + "'func'", "'interface'", "'select'", "'case'", "'defer'", "'go'", "'map'", + "'struct'", "'chan'", "'else'", "'goto'", "'package'", "'switch'", "'const'", + "'fallthrough'", "'if'", "'range'", "'type'", "'continue'", "'for'", + "'import'", "'return'", "'var'", "'nil'", null, "'('", "')'", "'{'", + "'}'", "'['", "']'", "'='", "','", "';'", "':'", "'.'", "'++'", "'--'", + "':='", "'...'", "'||'", "'&&'", "'=='", "'!='", "'<'", "'<='", "'>'", + "'>='", "'|'", "'/'", "'%'", "'<<'", "'>>'", "'&^'", "'!'", "'+'", "'-'", + "'^'", "'*'", "'&'", "'<-'" + }; + } + private static final String[] _LITERAL_NAMES = makeLiteralNames(); + private static String[] makeSymbolicNames() { + return new String[] { + null, "FLOAT_LIT", "DECIMAL_FLOAT_LIT", "TRUE", "FALSE", "ASSERT", "ASSUME", + "INHALE", "EXHALE", "PRE", "PRESERVES", "POST", "INV", "DEC", "PURE", + "IMPL", "OLD", "LHS", "FORALL", "EXISTS", "ACCESS", "FOLD", "UNFOLD", + "UNFOLDING", "GHOST", "IN", "MULTI", "SUBSET", "UNION", "INTERSECTION", + "SETMINUS", "IMPLIES", "WAND", "APPLY", "QMARK", "L_PRED", "R_PRED", + "SEQ", "SET", "MSET", "DICT", "OPT", "LEN", "NEW", "MAKE", "CAP", "SOME", + "GET", "DOM", "AXIOM", "NONE", "PRED", "TYPE_OF", "IS_COMPARABLE", "SHARE", + "ADDR_MOD", "DOT_DOT", "SHARED", "EXCLUSIVE", "PREDICATE", "WRITEPERM", + "NOPERM", "TRUSTED", "BREAK", "DEFAULT", "FUNC", "INTERFACE", "SELECT", + "CASE", "DEFER", "GO", "MAP", "STRUCT", "CHAN", "ELSE", "GOTO", "PACKAGE", + "SWITCH", "CONST", "FALLTHROUGH", "IF", "RANGE", "TYPE", "CONTINUE", + "FOR", "IMPORT", "RETURN", "VAR", "NIL_LIT", "IDENTIFIER", "L_PAREN", + "R_PAREN", "L_CURLY", "R_CURLY", "L_BRACKET", "R_BRACKET", "ASSIGN", + "COMMA", "SEMI", "COLON", "DOT", "PLUS_PLUS", "MINUS_MINUS", "DECLARE_ASSIGN", + "ELLIPSIS", "LOGICAL_OR", "LOGICAL_AND", "EQUALS", "NOT_EQUALS", "LESS", + "LESS_OR_EQUALS", "GREATER", "GREATER_OR_EQUALS", "OR", "DIV", "MOD", + "LSHIFT", "RSHIFT", "BIT_CLEAR", "EXCLAMATION", "PLUS", "MINUS", "CARET", + "STAR", "AMPERSAND", "RECEIVE", "DECIMAL_LIT", "BINARY_LIT", "OCTAL_LIT", + "HEX_LIT", "HEX_FLOAT_LIT", "IMAGINARY_LIT", "RUNE_LIT", "BYTE_VALUE", + "OCTAL_BYTE_VALUE", "HEX_BYTE_VALUE", "LITTLE_U_VALUE", "BIG_U_VALUE", + "RAW_STRING_LIT", "INTERPRETED_STRING_LIT", "WS", "COMMENT", "TERMINATOR", + "LINE_COMMENT", "WS_NLSEMI", "COMMENT_NLSEMI", "LINE_COMMENT_NLSEMI", + "EOS", "OTHER" + }; + } + private static final String[] _SYMBOLIC_NAMES = makeSymbolicNames(); + public static final Vocabulary VOCABULARY = new VocabularyImpl(_LITERAL_NAMES, _SYMBOLIC_NAMES); + + /** + * @deprecated Use {@link #VOCABULARY} instead. + */ + @Deprecated + public static final String[] tokenNames; + static { + tokenNames = new String[_SYMBOLIC_NAMES.length]; + for (int i = 0; i < tokenNames.length; i++) { + tokenNames[i] = VOCABULARY.getLiteralName(i); + if (tokenNames[i] == null) { + tokenNames[i] = VOCABULARY.getSymbolicName(i); + } + + if (tokenNames[i] == null) { + tokenNames[i] = ""; + } + } + } + + @Override + @Deprecated + public String[] getTokenNames() { + return tokenNames; + } + + @Override + + public Vocabulary getVocabulary() { + return VOCABULARY; + } + + @Override + public String getGrammarFileName() { return "GobraParser.g4"; } + + @Override + public String[] getRuleNames() { return ruleNames; } + + @Override + public String getSerializedATN() { return _serializedATN; } + + @Override + public ATN getATN() { return _ATN; } + + boolean specOnly = false; + public GobraParser(TokenStream input) { + super(input); + _interp = new ParserATNSimulator(this,_ATN,_decisionToDFA,_sharedContextCache); + } + + public static class ExprOnlyContext extends ParserRuleContext { + public ExpressionContext expression() { + return getRuleContext(ExpressionContext.class,0); + } + public TerminalNode EOF() { return getToken(GobraParser.EOF, 0); } + public ExprOnlyContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_exprOnly; } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof GobraParserVisitor ) return ((GobraParserVisitor)visitor).visitExprOnly(this); + else return visitor.visitChildren(this); + } + } + + public final ExprOnlyContext exprOnly() throws RecognitionException { + ExprOnlyContext _localctx = new ExprOnlyContext(_ctx, getState()); + enterRule(_localctx, 0, RULE_exprOnly); + try { + enterOuterAlt(_localctx, 1); + { + setState(328); + expression(0); + setState(329); + match(EOF); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class StmtOnlyContext extends ParserRuleContext { + public StatementContext statement() { + return getRuleContext(StatementContext.class,0); + } + public TerminalNode EOF() { return getToken(GobraParser.EOF, 0); } + public StmtOnlyContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_stmtOnly; } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof GobraParserVisitor ) return ((GobraParserVisitor)visitor).visitStmtOnly(this); + else return visitor.visitChildren(this); + } + } + + public final StmtOnlyContext stmtOnly() throws RecognitionException { + StmtOnlyContext _localctx = new StmtOnlyContext(_ctx, getState()); + enterRule(_localctx, 2, RULE_stmtOnly); + try { + enterOuterAlt(_localctx, 1); + { + setState(331); + statement(); + setState(332); + match(EOF); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class TypeOnlyContext extends ParserRuleContext { + public Type_Context type_() { + return getRuleContext(Type_Context.class,0); + } + public TerminalNode EOF() { return getToken(GobraParser.EOF, 0); } + public TypeOnlyContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_typeOnly; } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof GobraParserVisitor ) return ((GobraParserVisitor)visitor).visitTypeOnly(this); + else return visitor.visitChildren(this); + } + } + + public final TypeOnlyContext typeOnly() throws RecognitionException { + TypeOnlyContext _localctx = new TypeOnlyContext(_ctx, getState()); + enterRule(_localctx, 4, RULE_typeOnly); + try { + enterOuterAlt(_localctx, 1); + { + setState(334); + type_(); + setState(335); + match(EOF); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class MaybeAddressableIdentifierListContext extends ParserRuleContext { + public List maybeAddressableIdentifier() { + return getRuleContexts(MaybeAddressableIdentifierContext.class); + } + public MaybeAddressableIdentifierContext maybeAddressableIdentifier(int i) { + return getRuleContext(MaybeAddressableIdentifierContext.class,i); + } + public List COMMA() { return getTokens(GobraParser.COMMA); } + public TerminalNode COMMA(int i) { + return getToken(GobraParser.COMMA, i); + } + public MaybeAddressableIdentifierListContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_maybeAddressableIdentifierList; } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof GobraParserVisitor ) return ((GobraParserVisitor)visitor).visitMaybeAddressableIdentifierList(this); + else return visitor.visitChildren(this); + } + } + + public final MaybeAddressableIdentifierListContext maybeAddressableIdentifierList() throws RecognitionException { + MaybeAddressableIdentifierListContext _localctx = new MaybeAddressableIdentifierListContext(_ctx, getState()); + enterRule(_localctx, 6, RULE_maybeAddressableIdentifierList); + int _la; + try { + enterOuterAlt(_localctx, 1); + { + setState(337); + maybeAddressableIdentifier(); + setState(342); + _errHandler.sync(this); + _la = _input.LA(1); + while (_la==COMMA) { + { + { + setState(338); + match(COMMA); + setState(339); + maybeAddressableIdentifier(); + } + } + setState(344); + _errHandler.sync(this); + _la = _input.LA(1); + } + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class MaybeAddressableIdentifierContext extends ParserRuleContext { + public TerminalNode IDENTIFIER() { return getToken(GobraParser.IDENTIFIER, 0); } + public TerminalNode ADDR_MOD() { return getToken(GobraParser.ADDR_MOD, 0); } + public MaybeAddressableIdentifierContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_maybeAddressableIdentifier; } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof GobraParserVisitor ) return ((GobraParserVisitor)visitor).visitMaybeAddressableIdentifier(this); + else return visitor.visitChildren(this); + } + } + + public final MaybeAddressableIdentifierContext maybeAddressableIdentifier() throws RecognitionException { + MaybeAddressableIdentifierContext _localctx = new MaybeAddressableIdentifierContext(_ctx, getState()); + enterRule(_localctx, 8, RULE_maybeAddressableIdentifier); + int _la; + try { + enterOuterAlt(_localctx, 1); + { + setState(345); + match(IDENTIFIER); + setState(347); + _errHandler.sync(this); + _la = _input.LA(1); + if (_la==ADDR_MOD) { + { + setState(346); + match(ADDR_MOD); + } + } + + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class GhostStatementContext extends ParserRuleContext { + public GhostStatementContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_ghostStatement; } + + public GhostStatementContext() { } + public void copyFrom(GhostStatementContext ctx) { + super.copyFrom(ctx); + } + } + public static class ProofStatementContext extends GhostStatementContext { + public Token kind; + public ExpressionContext expression() { + return getRuleContext(ExpressionContext.class,0); + } + public TerminalNode ASSUME() { return getToken(GobraParser.ASSUME, 0); } + public TerminalNode ASSERT() { return getToken(GobraParser.ASSERT, 0); } + public TerminalNode INHALE() { return getToken(GobraParser.INHALE, 0); } + public TerminalNode EXHALE() { return getToken(GobraParser.EXHALE, 0); } + public ProofStatementContext(GhostStatementContext ctx) { copyFrom(ctx); } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof GobraParserVisitor ) return ((GobraParserVisitor)visitor).visitProofStatement(this); + else return visitor.visitChildren(this); + } + } + public static class ExplicitGhostStatementContext extends GhostStatementContext { + public TerminalNode GHOST() { return getToken(GobraParser.GHOST, 0); } + public StatementContext statement() { + return getRuleContext(StatementContext.class,0); + } + public ExplicitGhostStatementContext(GhostStatementContext ctx) { copyFrom(ctx); } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof GobraParserVisitor ) return ((GobraParserVisitor)visitor).visitExplicitGhostStatement(this); + else return visitor.visitChildren(this); + } + } + public static class FoldStatementContext extends GhostStatementContext { + public Token fold_stmt; + public PredicateAccessContext predicateAccess() { + return getRuleContext(PredicateAccessContext.class,0); + } + public TerminalNode FOLD() { return getToken(GobraParser.FOLD, 0); } + public TerminalNode UNFOLD() { return getToken(GobraParser.UNFOLD, 0); } + public FoldStatementContext(GhostStatementContext ctx) { copyFrom(ctx); } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof GobraParserVisitor ) return ((GobraParserVisitor)visitor).visitFoldStatement(this); + else return visitor.visitChildren(this); + } + } + + public final GhostStatementContext ghostStatement() throws RecognitionException { + GhostStatementContext _localctx = new GhostStatementContext(_ctx, getState()); + enterRule(_localctx, 10, RULE_ghostStatement); + int _la; + try { + setState(355); + _errHandler.sync(this); + switch (_input.LA(1)) { + case GHOST: + _localctx = new ExplicitGhostStatementContext(_localctx); + enterOuterAlt(_localctx, 1); + { + setState(349); + match(GHOST); + setState(350); + statement(); + } + break; + case FOLD: + case UNFOLD: + _localctx = new FoldStatementContext(_localctx); + enterOuterAlt(_localctx, 2); + { + setState(351); + ((FoldStatementContext)_localctx).fold_stmt = _input.LT(1); + _la = _input.LA(1); + if ( !(_la==FOLD || _la==UNFOLD) ) { + ((FoldStatementContext)_localctx).fold_stmt = (Token)_errHandler.recoverInline(this); + } + else { + if ( _input.LA(1)==Token.EOF ) matchedEOF = true; + _errHandler.reportMatch(this); + consume(); + } + setState(352); + predicateAccess(); + } + break; + case ASSERT: + case ASSUME: + case INHALE: + case EXHALE: + _localctx = new ProofStatementContext(_localctx); + enterOuterAlt(_localctx, 3); + { + setState(353); + ((ProofStatementContext)_localctx).kind = _input.LT(1); + _la = _input.LA(1); + if ( !((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << ASSERT) | (1L << ASSUME) | (1L << INHALE) | (1L << EXHALE))) != 0)) ) { + ((ProofStatementContext)_localctx).kind = (Token)_errHandler.recoverInline(this); + } + else { + if ( _input.LA(1)==Token.EOF ) matchedEOF = true; + _errHandler.reportMatch(this); + consume(); + } + setState(354); + expression(0); + } + break; + default: + throw new NoViableAltException(this); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class GhostPrimaryExprContext extends ParserRuleContext { + public RangeContext range() { + return getRuleContext(RangeContext.class,0); + } + public AccessContext access() { + return getRuleContext(AccessContext.class,0); + } + public TypeOfContext typeOf() { + return getRuleContext(TypeOfContext.class,0); + } + public TypeExprContext typeExpr() { + return getRuleContext(TypeExprContext.class,0); + } + public IsComparableContext isComparable() { + return getRuleContext(IsComparableContext.class,0); + } + public OldContext old() { + return getRuleContext(OldContext.class,0); + } + public SConversionContext sConversion() { + return getRuleContext(SConversionContext.class,0); + } + public OptionNoneContext optionNone() { + return getRuleContext(OptionNoneContext.class,0); + } + public OptionSomeContext optionSome() { + return getRuleContext(OptionSomeContext.class,0); + } + public OptionGetContext optionGet() { + return getRuleContext(OptionGetContext.class,0); + } + public PermissionContext permission() { + return getRuleContext(PermissionContext.class,0); + } + public GhostPrimaryExprContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_ghostPrimaryExpr; } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof GobraParserVisitor ) return ((GobraParserVisitor)visitor).visitGhostPrimaryExpr(this); + else return visitor.visitChildren(this); + } + } + + public final GhostPrimaryExprContext ghostPrimaryExpr() throws RecognitionException { + GhostPrimaryExprContext _localctx = new GhostPrimaryExprContext(_ctx, getState()); + enterRule(_localctx, 12, RULE_ghostPrimaryExpr); + try { + setState(368); + _errHandler.sync(this); + switch ( getInterpreter().adaptivePredict(_input,3,_ctx) ) { + case 1: + enterOuterAlt(_localctx, 1); + { + setState(357); + range(); + } + break; + case 2: + enterOuterAlt(_localctx, 2); + { + setState(358); + access(); + } + break; + case 3: + enterOuterAlt(_localctx, 3); + { + setState(359); + typeOf(); + } + break; + case 4: + enterOuterAlt(_localctx, 4); + { + setState(360); + typeExpr(); + } + break; + case 5: + enterOuterAlt(_localctx, 5); + { + setState(361); + isComparable(); + } + break; + case 6: + enterOuterAlt(_localctx, 6); + { + setState(362); + old(); + } + break; + case 7: + enterOuterAlt(_localctx, 7); + { + setState(363); + sConversion(); + } + break; + case 8: + enterOuterAlt(_localctx, 8); + { + setState(364); + optionNone(); + } + break; + case 9: + enterOuterAlt(_localctx, 9); + { + setState(365); + optionSome(); + } + break; + case 10: + enterOuterAlt(_localctx, 10); + { + setState(366); + optionGet(); + } + break; + case 11: + enterOuterAlt(_localctx, 11); + { + setState(367); + permission(); + } + break; + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class PermissionContext extends ParserRuleContext { + public TerminalNode WRITEPERM() { return getToken(GobraParser.WRITEPERM, 0); } + public TerminalNode NOPERM() { return getToken(GobraParser.NOPERM, 0); } + public PermissionContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_permission; } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof GobraParserVisitor ) return ((GobraParserVisitor)visitor).visitPermission(this); + else return visitor.visitChildren(this); + } + } + + public final PermissionContext permission() throws RecognitionException { + PermissionContext _localctx = new PermissionContext(_ctx, getState()); + enterRule(_localctx, 14, RULE_permission); + int _la; + try { + enterOuterAlt(_localctx, 1); + { + setState(370); + _la = _input.LA(1); + if ( !(_la==WRITEPERM || _la==NOPERM) ) { + _errHandler.recoverInline(this); + } + else { + if ( _input.LA(1)==Token.EOF ) matchedEOF = true; + _errHandler.reportMatch(this); + consume(); + } + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class TypeExprContext extends ParserRuleContext { + public TerminalNode TYPE() { return getToken(GobraParser.TYPE, 0); } + public TerminalNode L_BRACKET() { return getToken(GobraParser.L_BRACKET, 0); } + public Type_Context type_() { + return getRuleContext(Type_Context.class,0); + } + public TerminalNode R_BRACKET() { return getToken(GobraParser.R_BRACKET, 0); } + public TypeExprContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_typeExpr; } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof GobraParserVisitor ) return ((GobraParserVisitor)visitor).visitTypeExpr(this); + else return visitor.visitChildren(this); + } + } + + public final TypeExprContext typeExpr() throws RecognitionException { + TypeExprContext _localctx = new TypeExprContext(_ctx, getState()); + enterRule(_localctx, 16, RULE_typeExpr); + try { + enterOuterAlt(_localctx, 1); + { + setState(372); + match(TYPE); + setState(373); + match(L_BRACKET); + setState(374); + type_(); + setState(375); + match(R_BRACKET); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class BoundVariablesContext extends ParserRuleContext { + public List boundVariableDecl() { + return getRuleContexts(BoundVariableDeclContext.class); + } + public BoundVariableDeclContext boundVariableDecl(int i) { + return getRuleContext(BoundVariableDeclContext.class,i); + } + public List COMMA() { return getTokens(GobraParser.COMMA); } + public TerminalNode COMMA(int i) { + return getToken(GobraParser.COMMA, i); + } + public BoundVariablesContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_boundVariables; } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof GobraParserVisitor ) return ((GobraParserVisitor)visitor).visitBoundVariables(this); + else return visitor.visitChildren(this); + } + } + + public final BoundVariablesContext boundVariables() throws RecognitionException { + BoundVariablesContext _localctx = new BoundVariablesContext(_ctx, getState()); + enterRule(_localctx, 18, RULE_boundVariables); + int _la; + try { + int _alt; + enterOuterAlt(_localctx, 1); + { + setState(377); + boundVariableDecl(); + setState(382); + _errHandler.sync(this); + _alt = getInterpreter().adaptivePredict(_input,4,_ctx); + while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) { + if ( _alt==1 ) { + { + { + setState(378); + match(COMMA); + setState(379); + boundVariableDecl(); + } + } + } + setState(384); + _errHandler.sync(this); + _alt = getInterpreter().adaptivePredict(_input,4,_ctx); + } + setState(386); + _errHandler.sync(this); + _la = _input.LA(1); + if (_la==COMMA) { + { + setState(385); + match(COMMA); + } + } + + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class BoundVariableDeclContext extends ParserRuleContext { + public List IDENTIFIER() { return getTokens(GobraParser.IDENTIFIER); } + public TerminalNode IDENTIFIER(int i) { + return getToken(GobraParser.IDENTIFIER, i); + } + public ElementTypeContext elementType() { + return getRuleContext(ElementTypeContext.class,0); + } + public List COMMA() { return getTokens(GobraParser.COMMA); } + public TerminalNode COMMA(int i) { + return getToken(GobraParser.COMMA, i); + } + public BoundVariableDeclContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_boundVariableDecl; } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof GobraParserVisitor ) return ((GobraParserVisitor)visitor).visitBoundVariableDecl(this); + else return visitor.visitChildren(this); + } + } + + public final BoundVariableDeclContext boundVariableDecl() throws RecognitionException { + BoundVariableDeclContext _localctx = new BoundVariableDeclContext(_ctx, getState()); + enterRule(_localctx, 20, RULE_boundVariableDecl); + int _la; + try { + enterOuterAlt(_localctx, 1); + { + setState(388); + match(IDENTIFIER); + setState(393); + _errHandler.sync(this); + _la = _input.LA(1); + while (_la==COMMA) { + { + { + setState(389); + match(COMMA); + setState(390); + match(IDENTIFIER); + } + } + setState(395); + _errHandler.sync(this); + _la = _input.LA(1); + } + setState(396); + elementType(); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class TriggersContext extends ParserRuleContext { + public List trigger() { + return getRuleContexts(TriggerContext.class); + } + public TriggerContext trigger(int i) { + return getRuleContext(TriggerContext.class,i); + } + public TriggersContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_triggers; } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof GobraParserVisitor ) return ((GobraParserVisitor)visitor).visitTriggers(this); + else return visitor.visitChildren(this); + } + } + + public final TriggersContext triggers() throws RecognitionException { + TriggersContext _localctx = new TriggersContext(_ctx, getState()); + enterRule(_localctx, 22, RULE_triggers); + int _la; + try { + enterOuterAlt(_localctx, 1); + { + setState(401); + _errHandler.sync(this); + _la = _input.LA(1); + while (_la==L_CURLY) { + { + { + setState(398); + trigger(); + } + } + setState(403); + _errHandler.sync(this); + _la = _input.LA(1); + } + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class TriggerContext extends ParserRuleContext { + public TerminalNode L_CURLY() { return getToken(GobraParser.L_CURLY, 0); } + public List expression() { + return getRuleContexts(ExpressionContext.class); + } + public ExpressionContext expression(int i) { + return getRuleContext(ExpressionContext.class,i); + } + public TerminalNode R_CURLY() { return getToken(GobraParser.R_CURLY, 0); } + public List COMMA() { return getTokens(GobraParser.COMMA); } + public TerminalNode COMMA(int i) { + return getToken(GobraParser.COMMA, i); + } + public TriggerContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_trigger; } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof GobraParserVisitor ) return ((GobraParserVisitor)visitor).visitTrigger(this); + else return visitor.visitChildren(this); + } + } + + public final TriggerContext trigger() throws RecognitionException { + TriggerContext _localctx = new TriggerContext(_ctx, getState()); + enterRule(_localctx, 24, RULE_trigger); + int _la; + try { + enterOuterAlt(_localctx, 1); + { + setState(404); + match(L_CURLY); + setState(405); + expression(0); + setState(410); + _errHandler.sync(this); + _la = _input.LA(1); + while (_la==COMMA) { + { + { + setState(406); + match(COMMA); + setState(407); + expression(0); + } + } + setState(412); + _errHandler.sync(this); + _la = _input.LA(1); + } + setState(413); + match(R_CURLY); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class PredicateAccessContext extends ParserRuleContext { + public PrimaryExprContext primaryExpr() { + return getRuleContext(PrimaryExprContext.class,0); + } + public PredicateAccessContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_predicateAccess; } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof GobraParserVisitor ) return ((GobraParserVisitor)visitor).visitPredicateAccess(this); + else return visitor.visitChildren(this); + } + } + + public final PredicateAccessContext predicateAccess() throws RecognitionException { + PredicateAccessContext _localctx = new PredicateAccessContext(_ctx, getState()); + enterRule(_localctx, 26, RULE_predicateAccess); + try { + enterOuterAlt(_localctx, 1); + { + setState(415); + primaryExpr(0); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class OptionSomeContext extends ParserRuleContext { + public TerminalNode SOME() { return getToken(GobraParser.SOME, 0); } + public TerminalNode L_PAREN() { return getToken(GobraParser.L_PAREN, 0); } + public ExpressionContext expression() { + return getRuleContext(ExpressionContext.class,0); + } + public TerminalNode R_PAREN() { return getToken(GobraParser.R_PAREN, 0); } + public OptionSomeContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_optionSome; } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof GobraParserVisitor ) return ((GobraParserVisitor)visitor).visitOptionSome(this); + else return visitor.visitChildren(this); + } + } + + public final OptionSomeContext optionSome() throws RecognitionException { + OptionSomeContext _localctx = new OptionSomeContext(_ctx, getState()); + enterRule(_localctx, 28, RULE_optionSome); + try { + enterOuterAlt(_localctx, 1); + { + setState(417); + match(SOME); + setState(418); + match(L_PAREN); + setState(419); + expression(0); + setState(420); + match(R_PAREN); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class OptionNoneContext extends ParserRuleContext { + public TerminalNode NONE() { return getToken(GobraParser.NONE, 0); } + public TerminalNode L_BRACKET() { return getToken(GobraParser.L_BRACKET, 0); } + public Type_Context type_() { + return getRuleContext(Type_Context.class,0); + } + public TerminalNode R_BRACKET() { return getToken(GobraParser.R_BRACKET, 0); } + public OptionNoneContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_optionNone; } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof GobraParserVisitor ) return ((GobraParserVisitor)visitor).visitOptionNone(this); + else return visitor.visitChildren(this); + } + } + + public final OptionNoneContext optionNone() throws RecognitionException { + OptionNoneContext _localctx = new OptionNoneContext(_ctx, getState()); + enterRule(_localctx, 30, RULE_optionNone); + try { + enterOuterAlt(_localctx, 1); + { + setState(422); + match(NONE); + setState(423); + match(L_BRACKET); + setState(424); + type_(); + setState(425); + match(R_BRACKET); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class OptionGetContext extends ParserRuleContext { + public TerminalNode GET() { return getToken(GobraParser.GET, 0); } + public TerminalNode L_PAREN() { return getToken(GobraParser.L_PAREN, 0); } + public ExpressionContext expression() { + return getRuleContext(ExpressionContext.class,0); + } + public TerminalNode R_PAREN() { return getToken(GobraParser.R_PAREN, 0); } + public OptionGetContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_optionGet; } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof GobraParserVisitor ) return ((GobraParserVisitor)visitor).visitOptionGet(this); + else return visitor.visitChildren(this); + } + } + + public final OptionGetContext optionGet() throws RecognitionException { + OptionGetContext _localctx = new OptionGetContext(_ctx, getState()); + enterRule(_localctx, 32, RULE_optionGet); + try { + enterOuterAlt(_localctx, 1); + { + setState(427); + match(GET); + setState(428); + match(L_PAREN); + setState(429); + expression(0); + setState(430); + match(R_PAREN); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class SConversionContext extends ParserRuleContext { + public Token kind; + public TerminalNode L_PAREN() { return getToken(GobraParser.L_PAREN, 0); } + public ExpressionContext expression() { + return getRuleContext(ExpressionContext.class,0); + } + public TerminalNode R_PAREN() { return getToken(GobraParser.R_PAREN, 0); } + public TerminalNode SET() { return getToken(GobraParser.SET, 0); } + public TerminalNode SEQ() { return getToken(GobraParser.SEQ, 0); } + public TerminalNode MSET() { return getToken(GobraParser.MSET, 0); } + public SConversionContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_sConversion; } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof GobraParserVisitor ) return ((GobraParserVisitor)visitor).visitSConversion(this); + else return visitor.visitChildren(this); + } + } + + public final SConversionContext sConversion() throws RecognitionException { + SConversionContext _localctx = new SConversionContext(_ctx, getState()); + enterRule(_localctx, 34, RULE_sConversion); + int _la; + try { + enterOuterAlt(_localctx, 1); + { + setState(432); + ((SConversionContext)_localctx).kind = _input.LT(1); + _la = _input.LA(1); + if ( !((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << SEQ) | (1L << SET) | (1L << MSET))) != 0)) ) { + ((SConversionContext)_localctx).kind = (Token)_errHandler.recoverInline(this); + } + else { + if ( _input.LA(1)==Token.EOF ) matchedEOF = true; + _errHandler.reportMatch(this); + consume(); + } + setState(433); + match(L_PAREN); + setState(434); + expression(0); + setState(435); + match(R_PAREN); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class OldContext extends ParserRuleContext { + public TerminalNode OLD() { return getToken(GobraParser.OLD, 0); } + public TerminalNode L_PAREN() { return getToken(GobraParser.L_PAREN, 0); } + public ExpressionContext expression() { + return getRuleContext(ExpressionContext.class,0); + } + public TerminalNode R_PAREN() { return getToken(GobraParser.R_PAREN, 0); } + public TerminalNode L_BRACKET() { return getToken(GobraParser.L_BRACKET, 0); } + public OldLabelUseContext oldLabelUse() { + return getRuleContext(OldLabelUseContext.class,0); + } + public TerminalNode R_BRACKET() { return getToken(GobraParser.R_BRACKET, 0); } + public OldContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_old; } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof GobraParserVisitor ) return ((GobraParserVisitor)visitor).visitOld(this); + else return visitor.visitChildren(this); + } + } + + public final OldContext old() throws RecognitionException { + OldContext _localctx = new OldContext(_ctx, getState()); + enterRule(_localctx, 36, RULE_old); + int _la; + try { + enterOuterAlt(_localctx, 1); + { + setState(437); + match(OLD); + setState(442); + _errHandler.sync(this); + _la = _input.LA(1); + if (_la==L_BRACKET) { + { + setState(438); + match(L_BRACKET); + setState(439); + oldLabelUse(); + setState(440); + match(R_BRACKET); + } + } + + setState(444); + match(L_PAREN); + setState(445); + expression(0); + setState(446); + match(R_PAREN); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class OldLabelUseContext extends ParserRuleContext { + public LabelUseContext labelUse() { + return getRuleContext(LabelUseContext.class,0); + } + public TerminalNode LHS() { return getToken(GobraParser.LHS, 0); } + public OldLabelUseContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_oldLabelUse; } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof GobraParserVisitor ) return ((GobraParserVisitor)visitor).visitOldLabelUse(this); + else return visitor.visitChildren(this); + } + } + + public final OldLabelUseContext oldLabelUse() throws RecognitionException { + OldLabelUseContext _localctx = new OldLabelUseContext(_ctx, getState()); + enterRule(_localctx, 38, RULE_oldLabelUse); + try { + setState(450); + _errHandler.sync(this); + switch (_input.LA(1)) { + case IDENTIFIER: + enterOuterAlt(_localctx, 1); + { + setState(448); + labelUse(); + } + break; + case LHS: + enterOuterAlt(_localctx, 2); + { + setState(449); + match(LHS); + } + break; + default: + throw new NoViableAltException(this); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class LabelUseContext extends ParserRuleContext { + public TerminalNode IDENTIFIER() { return getToken(GobraParser.IDENTIFIER, 0); } + public LabelUseContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_labelUse; } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof GobraParserVisitor ) return ((GobraParserVisitor)visitor).visitLabelUse(this); + else return visitor.visitChildren(this); + } + } + + public final LabelUseContext labelUse() throws RecognitionException { + LabelUseContext _localctx = new LabelUseContext(_ctx, getState()); + enterRule(_localctx, 40, RULE_labelUse); + try { + enterOuterAlt(_localctx, 1); + { + setState(452); + match(IDENTIFIER); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class IsComparableContext extends ParserRuleContext { + public TerminalNode IS_COMPARABLE() { return getToken(GobraParser.IS_COMPARABLE, 0); } + public TerminalNode L_PAREN() { return getToken(GobraParser.L_PAREN, 0); } + public ExpressionContext expression() { + return getRuleContext(ExpressionContext.class,0); + } + public TerminalNode R_PAREN() { return getToken(GobraParser.R_PAREN, 0); } + public IsComparableContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_isComparable; } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof GobraParserVisitor ) return ((GobraParserVisitor)visitor).visitIsComparable(this); + else return visitor.visitChildren(this); + } + } + + public final IsComparableContext isComparable() throws RecognitionException { + IsComparableContext _localctx = new IsComparableContext(_ctx, getState()); + enterRule(_localctx, 42, RULE_isComparable); + try { + enterOuterAlt(_localctx, 1); + { + setState(454); + match(IS_COMPARABLE); + setState(455); + match(L_PAREN); + setState(456); + expression(0); + setState(457); + match(R_PAREN); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class TypeOfContext extends ParserRuleContext { + public TerminalNode TYPE_OF() { return getToken(GobraParser.TYPE_OF, 0); } + public TerminalNode L_PAREN() { return getToken(GobraParser.L_PAREN, 0); } + public ExpressionContext expression() { + return getRuleContext(ExpressionContext.class,0); + } + public TerminalNode R_PAREN() { return getToken(GobraParser.R_PAREN, 0); } + public TypeOfContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_typeOf; } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof GobraParserVisitor ) return ((GobraParserVisitor)visitor).visitTypeOf(this); + else return visitor.visitChildren(this); + } + } + + public final TypeOfContext typeOf() throws RecognitionException { + TypeOfContext _localctx = new TypeOfContext(_ctx, getState()); + enterRule(_localctx, 44, RULE_typeOf); + try { + enterOuterAlt(_localctx, 1); + { + setState(459); + match(TYPE_OF); + setState(460); + match(L_PAREN); + setState(461); + expression(0); + setState(462); + match(R_PAREN); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class AccessContext extends ParserRuleContext { + public TerminalNode ACCESS() { return getToken(GobraParser.ACCESS, 0); } + public TerminalNode L_PAREN() { return getToken(GobraParser.L_PAREN, 0); } + public List expression() { + return getRuleContexts(ExpressionContext.class); + } + public ExpressionContext expression(int i) { + return getRuleContext(ExpressionContext.class,i); + } + public TerminalNode R_PAREN() { return getToken(GobraParser.R_PAREN, 0); } + public TerminalNode COMMA() { return getToken(GobraParser.COMMA, 0); } + public AccessContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_access; } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof GobraParserVisitor ) return ((GobraParserVisitor)visitor).visitAccess(this); + else return visitor.visitChildren(this); + } + } + + public final AccessContext access() throws RecognitionException { + AccessContext _localctx = new AccessContext(_ctx, getState()); + enterRule(_localctx, 46, RULE_access); + int _la; + try { + enterOuterAlt(_localctx, 1); + { + setState(464); + match(ACCESS); + setState(465); + match(L_PAREN); + setState(466); + expression(0); + setState(469); + _errHandler.sync(this); + _la = _input.LA(1); + if (_la==COMMA) { + { + setState(467); + match(COMMA); + setState(468); + expression(0); + } + } + + setState(471); + match(R_PAREN); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class RangeContext extends ParserRuleContext { + public Token kind; + public TerminalNode L_BRACKET() { return getToken(GobraParser.L_BRACKET, 0); } + public List expression() { + return getRuleContexts(ExpressionContext.class); + } + public ExpressionContext expression(int i) { + return getRuleContext(ExpressionContext.class,i); + } + public TerminalNode DOT_DOT() { return getToken(GobraParser.DOT_DOT, 0); } + public TerminalNode R_BRACKET() { return getToken(GobraParser.R_BRACKET, 0); } + public TerminalNode SEQ() { return getToken(GobraParser.SEQ, 0); } + public TerminalNode SET() { return getToken(GobraParser.SET, 0); } + public TerminalNode MSET() { return getToken(GobraParser.MSET, 0); } + public RangeContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_range; } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof GobraParserVisitor ) return ((GobraParserVisitor)visitor).visitRange(this); + else return visitor.visitChildren(this); + } + } + + public final RangeContext range() throws RecognitionException { + RangeContext _localctx = new RangeContext(_ctx, getState()); + enterRule(_localctx, 48, RULE_range); + int _la; + try { + enterOuterAlt(_localctx, 1); + { + setState(473); + ((RangeContext)_localctx).kind = _input.LT(1); + _la = _input.LA(1); + if ( !((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << SEQ) | (1L << SET) | (1L << MSET))) != 0)) ) { + ((RangeContext)_localctx).kind = (Token)_errHandler.recoverInline(this); + } + else { + if ( _input.LA(1)==Token.EOF ) matchedEOF = true; + _errHandler.reportMatch(this); + consume(); + } + setState(474); + match(L_BRACKET); + setState(475); + expression(0); + setState(476); + match(DOT_DOT); + setState(477); + expression(0); + setState(478); + match(R_BRACKET); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class SeqUpdExpContext extends ParserRuleContext { + public TerminalNode L_BRACKET() { return getToken(GobraParser.L_BRACKET, 0); } + public TerminalNode R_BRACKET() { return getToken(GobraParser.R_BRACKET, 0); } + public List seqUpdClause() { + return getRuleContexts(SeqUpdClauseContext.class); + } + public SeqUpdClauseContext seqUpdClause(int i) { + return getRuleContext(SeqUpdClauseContext.class,i); + } + public List COMMA() { return getTokens(GobraParser.COMMA); } + public TerminalNode COMMA(int i) { + return getToken(GobraParser.COMMA, i); + } + public SeqUpdExpContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_seqUpdExp; } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof GobraParserVisitor ) return ((GobraParserVisitor)visitor).visitSeqUpdExp(this); + else return visitor.visitChildren(this); + } + } + + public final SeqUpdExpContext seqUpdExp() throws RecognitionException { + SeqUpdExpContext _localctx = new SeqUpdExpContext(_ctx, getState()); + enterRule(_localctx, 50, RULE_seqUpdExp); + int _la; + try { + enterOuterAlt(_localctx, 1); + { + setState(480); + match(L_BRACKET); + { + setState(481); + seqUpdClause(); + setState(486); + _errHandler.sync(this); + _la = _input.LA(1); + while (_la==COMMA) { + { + { + setState(482); + match(COMMA); + setState(483); + seqUpdClause(); + } + } + setState(488); + _errHandler.sync(this); + _la = _input.LA(1); + } + } + setState(489); + match(R_BRACKET); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class SeqUpdClauseContext extends ParserRuleContext { + public List expression() { + return getRuleContexts(ExpressionContext.class); + } + public ExpressionContext expression(int i) { + return getRuleContext(ExpressionContext.class,i); + } + public TerminalNode ASSIGN() { return getToken(GobraParser.ASSIGN, 0); } + public SeqUpdClauseContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_seqUpdClause; } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof GobraParserVisitor ) return ((GobraParserVisitor)visitor).visitSeqUpdClause(this); + else return visitor.visitChildren(this); + } + } + + public final SeqUpdClauseContext seqUpdClause() throws RecognitionException { + SeqUpdClauseContext _localctx = new SeqUpdClauseContext(_ctx, getState()); + enterRule(_localctx, 52, RULE_seqUpdClause); + try { + enterOuterAlt(_localctx, 1); + { + setState(491); + expression(0); + setState(492); + match(ASSIGN); + setState(493); + expression(0); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class GhostTypeLitContext extends ParserRuleContext { + public SqTypeContext sqType() { + return getRuleContext(SqTypeContext.class,0); + } + public GhostSliceTypeContext ghostSliceType() { + return getRuleContext(GhostSliceTypeContext.class,0); + } + public DomainTypeContext domainType() { + return getRuleContext(DomainTypeContext.class,0); + } + public GhostTypeLitContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_ghostTypeLit; } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof GobraParserVisitor ) return ((GobraParserVisitor)visitor).visitGhostTypeLit(this); + else return visitor.visitChildren(this); + } + } + + public final GhostTypeLitContext ghostTypeLit() throws RecognitionException { + GhostTypeLitContext _localctx = new GhostTypeLitContext(_ctx, getState()); + enterRule(_localctx, 54, RULE_ghostTypeLit); + try { + setState(498); + _errHandler.sync(this); + switch (_input.LA(1)) { + case SEQ: + case SET: + case MSET: + case DICT: + case OPT: + enterOuterAlt(_localctx, 1); + { + setState(495); + sqType(); + } + break; + case GHOST: + enterOuterAlt(_localctx, 2); + { + setState(496); + ghostSliceType(); + } + break; + case DOM: + enterOuterAlt(_localctx, 3); + { + setState(497); + domainType(); + } + break; + default: + throw new NoViableAltException(this); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class DomainTypeContext extends ParserRuleContext { + public TerminalNode DOM() { return getToken(GobraParser.DOM, 0); } + public TerminalNode L_CURLY() { return getToken(GobraParser.L_CURLY, 0); } + public TerminalNode R_CURLY() { return getToken(GobraParser.R_CURLY, 0); } + public List domainClause() { + return getRuleContexts(DomainClauseContext.class); + } + public DomainClauseContext domainClause(int i) { + return getRuleContext(DomainClauseContext.class,i); + } + public List eos() { + return getRuleContexts(EosContext.class); + } + public EosContext eos(int i) { + return getRuleContext(EosContext.class,i); + } + public DomainTypeContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_domainType; } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof GobraParserVisitor ) return ((GobraParserVisitor)visitor).visitDomainType(this); + else return visitor.visitChildren(this); + } + } + + public final DomainTypeContext domainType() throws RecognitionException { + DomainTypeContext _localctx = new DomainTypeContext(_ctx, getState()); + enterRule(_localctx, 56, RULE_domainType); + int _la; + try { + enterOuterAlt(_localctx, 1); + { + setState(500); + match(DOM); + setState(501); + match(L_CURLY); + setState(507); + _errHandler.sync(this); + _la = _input.LA(1); + while (_la==AXIOM || _la==FUNC) { + { + { + setState(502); + domainClause(); + setState(503); + eos(); + } + } + setState(509); + _errHandler.sync(this); + _la = _input.LA(1); + } + setState(510); + match(R_CURLY); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class DomainClauseContext extends ParserRuleContext { + public TerminalNode FUNC() { return getToken(GobraParser.FUNC, 0); } + public TerminalNode IDENTIFIER() { return getToken(GobraParser.IDENTIFIER, 0); } + public SignatureContext signature() { + return getRuleContext(SignatureContext.class,0); + } + public TerminalNode AXIOM() { return getToken(GobraParser.AXIOM, 0); } + public TerminalNode L_CURLY() { return getToken(GobraParser.L_CURLY, 0); } + public ExpressionContext expression() { + return getRuleContext(ExpressionContext.class,0); + } + public EosContext eos() { + return getRuleContext(EosContext.class,0); + } + public TerminalNode R_CURLY() { return getToken(GobraParser.R_CURLY, 0); } + public DomainClauseContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_domainClause; } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof GobraParserVisitor ) return ((GobraParserVisitor)visitor).visitDomainClause(this); + else return visitor.visitChildren(this); + } + } + + public final DomainClauseContext domainClause() throws RecognitionException { + DomainClauseContext _localctx = new DomainClauseContext(_ctx, getState()); + enterRule(_localctx, 58, RULE_domainClause); + try { + setState(521); + _errHandler.sync(this); + switch (_input.LA(1)) { + case FUNC: + enterOuterAlt(_localctx, 1); + { + setState(512); + match(FUNC); + setState(513); + match(IDENTIFIER); + setState(514); + signature(); + } + break; + case AXIOM: + enterOuterAlt(_localctx, 2); + { + setState(515); + match(AXIOM); + setState(516); + match(L_CURLY); + setState(517); + expression(0); + setState(518); + eos(); + setState(519); + match(R_CURLY); + } + break; + default: + throw new NoViableAltException(this); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class GhostSliceTypeContext extends ParserRuleContext { + public TerminalNode GHOST() { return getToken(GobraParser.GHOST, 0); } + public TerminalNode L_BRACKET() { return getToken(GobraParser.L_BRACKET, 0); } + public TerminalNode R_BRACKET() { return getToken(GobraParser.R_BRACKET, 0); } + public ElementTypeContext elementType() { + return getRuleContext(ElementTypeContext.class,0); + } + public GhostSliceTypeContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_ghostSliceType; } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof GobraParserVisitor ) return ((GobraParserVisitor)visitor).visitGhostSliceType(this); + else return visitor.visitChildren(this); + } + } + + public final GhostSliceTypeContext ghostSliceType() throws RecognitionException { + GhostSliceTypeContext _localctx = new GhostSliceTypeContext(_ctx, getState()); + enterRule(_localctx, 60, RULE_ghostSliceType); + try { + enterOuterAlt(_localctx, 1); + { + setState(523); + match(GHOST); + setState(524); + match(L_BRACKET); + setState(525); + match(R_BRACKET); + setState(526); + elementType(); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class SqTypeContext extends ParserRuleContext { + public Token kind; + public TerminalNode L_BRACKET() { return getToken(GobraParser.L_BRACKET, 0); } + public List type_() { + return getRuleContexts(Type_Context.class); + } + public Type_Context type_(int i) { + return getRuleContext(Type_Context.class,i); + } + public TerminalNode R_BRACKET() { return getToken(GobraParser.R_BRACKET, 0); } + public TerminalNode SEQ() { return getToken(GobraParser.SEQ, 0); } + public TerminalNode SET() { return getToken(GobraParser.SET, 0); } + public TerminalNode MSET() { return getToken(GobraParser.MSET, 0); } + public TerminalNode OPT() { return getToken(GobraParser.OPT, 0); } + public TerminalNode DICT() { return getToken(GobraParser.DICT, 0); } + public SqTypeContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_sqType; } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof GobraParserVisitor ) return ((GobraParserVisitor)visitor).visitSqType(this); + else return visitor.visitChildren(this); + } + } + + public final SqTypeContext sqType() throws RecognitionException { + SqTypeContext _localctx = new SqTypeContext(_ctx, getState()); + enterRule(_localctx, 62, RULE_sqType); + int _la; + try { + setState(539); + _errHandler.sync(this); + switch (_input.LA(1)) { + case SEQ: + case SET: + case MSET: + case OPT: + enterOuterAlt(_localctx, 1); + { + { + setState(528); + ((SqTypeContext)_localctx).kind = _input.LT(1); + _la = _input.LA(1); + if ( !((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << SEQ) | (1L << SET) | (1L << MSET) | (1L << OPT))) != 0)) ) { + ((SqTypeContext)_localctx).kind = (Token)_errHandler.recoverInline(this); + } + else { + if ( _input.LA(1)==Token.EOF ) matchedEOF = true; + _errHandler.reportMatch(this); + consume(); + } + setState(529); + match(L_BRACKET); + setState(530); + type_(); + setState(531); + match(R_BRACKET); + } + } + break; + case DICT: + enterOuterAlt(_localctx, 2); + { + setState(533); + ((SqTypeContext)_localctx).kind = match(DICT); + setState(534); + match(L_BRACKET); + setState(535); + type_(); + setState(536); + match(R_BRACKET); + setState(537); + type_(); + } + break; + default: + throw new NoViableAltException(this); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class SpecificationContext extends ParserRuleContext { + public boolean trusted = false; + public boolean pure = false;; + public List eos() { + return getRuleContexts(EosContext.class); + } + public EosContext eos(int i) { + return getRuleContext(EosContext.class,i); + } + public List PURE() { return getTokens(GobraParser.PURE); } + public TerminalNode PURE(int i) { + return getToken(GobraParser.PURE, i); + } + public List specStatement() { + return getRuleContexts(SpecStatementContext.class); + } + public SpecStatementContext specStatement(int i) { + return getRuleContext(SpecStatementContext.class,i); + } + public List TRUSTED() { return getTokens(GobraParser.TRUSTED); } + public TerminalNode TRUSTED(int i) { + return getToken(GobraParser.TRUSTED, i); + } + public SpecificationContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_specification; } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof GobraParserVisitor ) return ((GobraParserVisitor)visitor).visitSpecification(this); + else return visitor.visitChildren(this); + } + } + + public final SpecificationContext specification() throws RecognitionException { + SpecificationContext _localctx = new SpecificationContext(_ctx, getState()); + enterRule(_localctx, 64, RULE_specification); + int _la; + try { + int _alt; + enterOuterAlt(_localctx, 1); + { + setState(551); + _errHandler.sync(this); + _alt = getInterpreter().adaptivePredict(_input,18,_ctx); + while ( _alt!=1 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) { + if ( _alt==1+1 ) { + { + { + setState(546); + _errHandler.sync(this); + switch (_input.LA(1)) { + case PRE: + case PRESERVES: + case POST: + case DEC: + { + setState(541); + specStatement(); + } + break; + case PURE: + { + setState(542); + match(PURE); + ((SpecificationContext)_localctx).pure = true; + } + break; + case TRUSTED: + { + setState(544); + match(TRUSTED); + ((SpecificationContext)_localctx).trusted = true; + } + break; + default: + throw new NoViableAltException(this); + } + setState(548); + eos(); + } + } + } + setState(553); + _errHandler.sync(this); + _alt = getInterpreter().adaptivePredict(_input,18,_ctx); + } + setState(556); + _errHandler.sync(this); + _la = _input.LA(1); + if (_la==PURE) { + { + setState(554); + match(PURE); + ((SpecificationContext)_localctx).pure = true; + } + } + + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class SpecStatementContext extends ParserRuleContext { + public Token kind; + public AssertionContext assertion() { + return getRuleContext(AssertionContext.class,0); + } + public TerminalNode PRE() { return getToken(GobraParser.PRE, 0); } + public TerminalNode PRESERVES() { return getToken(GobraParser.PRESERVES, 0); } + public TerminalNode POST() { return getToken(GobraParser.POST, 0); } + public TerminationMeasureContext terminationMeasure() { + return getRuleContext(TerminationMeasureContext.class,0); + } + public TerminalNode DEC() { return getToken(GobraParser.DEC, 0); } + public SpecStatementContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_specStatement; } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof GobraParserVisitor ) return ((GobraParserVisitor)visitor).visitSpecStatement(this); + else return visitor.visitChildren(this); + } + } + + public final SpecStatementContext specStatement() throws RecognitionException { + SpecStatementContext _localctx = new SpecStatementContext(_ctx, getState()); + enterRule(_localctx, 66, RULE_specStatement); + try { + setState(566); + _errHandler.sync(this); + switch (_input.LA(1)) { + case PRE: + enterOuterAlt(_localctx, 1); + { + setState(558); + ((SpecStatementContext)_localctx).kind = match(PRE); + setState(559); + assertion(); + } + break; + case PRESERVES: + enterOuterAlt(_localctx, 2); + { + setState(560); + ((SpecStatementContext)_localctx).kind = match(PRESERVES); + setState(561); + assertion(); + } + break; + case POST: + enterOuterAlt(_localctx, 3); + { + setState(562); + ((SpecStatementContext)_localctx).kind = match(POST); + setState(563); + assertion(); + } + break; + case DEC: + enterOuterAlt(_localctx, 4); + { + setState(564); + ((SpecStatementContext)_localctx).kind = match(DEC); + setState(565); + terminationMeasure(); + } + break; + default: + throw new NoViableAltException(this); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class TerminationMeasureContext extends ParserRuleContext { + public ExpressionListContext expressionList() { + return getRuleContext(ExpressionListContext.class,0); + } + public TerminalNode IF() { return getToken(GobraParser.IF, 0); } + public ExpressionContext expression() { + return getRuleContext(ExpressionContext.class,0); + } + public TerminationMeasureContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_terminationMeasure; } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof GobraParserVisitor ) return ((GobraParserVisitor)visitor).visitTerminationMeasure(this); + else return visitor.visitChildren(this); + } + } + + public final TerminationMeasureContext terminationMeasure() throws RecognitionException { + TerminationMeasureContext _localctx = new TerminationMeasureContext(_ctx, getState()); + enterRule(_localctx, 68, RULE_terminationMeasure); + try { + enterOuterAlt(_localctx, 1); + { + setState(569); + _errHandler.sync(this); + switch ( getInterpreter().adaptivePredict(_input,21,_ctx) ) { + case 1: + { + setState(568); + expressionList(); + } + break; + } + setState(573); + _errHandler.sync(this); + switch ( getInterpreter().adaptivePredict(_input,22,_ctx) ) { + case 1: + { + setState(571); + match(IF); + setState(572); + expression(0); + } + break; + } + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class AssertionContext extends ParserRuleContext { + public ExpressionContext expression() { + return getRuleContext(ExpressionContext.class,0); + } + public AssertionContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_assertion; } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof GobraParserVisitor ) return ((GobraParserVisitor)visitor).visitAssertion(this); + else return visitor.visitChildren(this); + } + } + + public final AssertionContext assertion() throws RecognitionException { + AssertionContext _localctx = new AssertionContext(_ctx, getState()); + enterRule(_localctx, 70, RULE_assertion); + try { + setState(577); + _errHandler.sync(this); + switch ( getInterpreter().adaptivePredict(_input,23,_ctx) ) { + case 1: + enterOuterAlt(_localctx, 1); + { + } + break; + case 2: + enterOuterAlt(_localctx, 2); + { + setState(576); + expression(0); + } + break; + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class BlockWithBodyParameterInfoContext extends ParserRuleContext { + public TerminalNode L_CURLY() { return getToken(GobraParser.L_CURLY, 0); } + public TerminalNode R_CURLY() { return getToken(GobraParser.R_CURLY, 0); } + public TerminalNode SHARE() { return getToken(GobraParser.SHARE, 0); } + public IdentifierListContext identifierList() { + return getRuleContext(IdentifierListContext.class,0); + } + public EosContext eos() { + return getRuleContext(EosContext.class,0); + } + public StatementListContext statementList() { + return getRuleContext(StatementListContext.class,0); + } + public BlockWithBodyParameterInfoContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_blockWithBodyParameterInfo; } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof GobraParserVisitor ) return ((GobraParserVisitor)visitor).visitBlockWithBodyParameterInfo(this); + else return visitor.visitChildren(this); + } + } + + public final BlockWithBodyParameterInfoContext blockWithBodyParameterInfo() throws RecognitionException { + BlockWithBodyParameterInfoContext _localctx = new BlockWithBodyParameterInfoContext(_ctx, getState()); + enterRule(_localctx, 72, RULE_blockWithBodyParameterInfo); + try { + enterOuterAlt(_localctx, 1); + { + setState(579); + match(L_CURLY); + setState(584); + _errHandler.sync(this); + switch ( getInterpreter().adaptivePredict(_input,24,_ctx) ) { + case 1: + { + setState(580); + match(SHARE); + setState(581); + identifierList(); + setState(582); + eos(); + } + break; + } + setState(587); + _errHandler.sync(this); + switch ( getInterpreter().adaptivePredict(_input,25,_ctx) ) { + case 1: + { + setState(586); + statementList(); + } + break; + } + setState(589); + match(R_CURLY); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class ImplementationProofContext extends ParserRuleContext { + public List type_() { + return getRuleContexts(Type_Context.class); + } + public Type_Context type_(int i) { + return getRuleContext(Type_Context.class,i); + } + public TerminalNode IMPL() { return getToken(GobraParser.IMPL, 0); } + public TerminalNode L_CURLY() { return getToken(GobraParser.L_CURLY, 0); } + public TerminalNode R_CURLY() { return getToken(GobraParser.R_CURLY, 0); } + public List implementationProofPredicateAlias() { + return getRuleContexts(ImplementationProofPredicateAliasContext.class); + } + public ImplementationProofPredicateAliasContext implementationProofPredicateAlias(int i) { + return getRuleContext(ImplementationProofPredicateAliasContext.class,i); + } + public List eos() { + return getRuleContexts(EosContext.class); + } + public EosContext eos(int i) { + return getRuleContext(EosContext.class,i); + } + public List methodImplementationProof() { + return getRuleContexts(MethodImplementationProofContext.class); + } + public MethodImplementationProofContext methodImplementationProof(int i) { + return getRuleContext(MethodImplementationProofContext.class,i); + } + public ImplementationProofContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_implementationProof; } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof GobraParserVisitor ) return ((GobraParserVisitor)visitor).visitImplementationProof(this); + else return visitor.visitChildren(this); + } + } + + public final ImplementationProofContext implementationProof() throws RecognitionException { + ImplementationProofContext _localctx = new ImplementationProofContext(_ctx, getState()); + enterRule(_localctx, 74, RULE_implementationProof); + int _la; + try { + enterOuterAlt(_localctx, 1); + { + setState(591); + type_(); + setState(592); + match(IMPL); + setState(593); + type_(); + setState(612); + _errHandler.sync(this); + switch ( getInterpreter().adaptivePredict(_input,28,_ctx) ) { + case 1: + { + setState(594); + match(L_CURLY); + setState(600); + _errHandler.sync(this); + _la = _input.LA(1); + while (_la==PRED) { + { + { + setState(595); + implementationProofPredicateAlias(); + setState(596); + eos(); + } + } + setState(602); + _errHandler.sync(this); + _la = _input.LA(1); + } + setState(608); + _errHandler.sync(this); + _la = _input.LA(1); + while (_la==PURE || _la==L_PAREN) { + { + { + setState(603); + methodImplementationProof(); + setState(604); + eos(); + } + } + setState(610); + _errHandler.sync(this); + _la = _input.LA(1); + } + setState(611); + match(R_CURLY); + } + break; + } + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class MethodImplementationProofContext extends ParserRuleContext { + public NonLocalReceiverContext nonLocalReceiver() { + return getRuleContext(NonLocalReceiverContext.class,0); + } + public TerminalNode IDENTIFIER() { return getToken(GobraParser.IDENTIFIER, 0); } + public SignatureContext signature() { + return getRuleContext(SignatureContext.class,0); + } + public TerminalNode PURE() { return getToken(GobraParser.PURE, 0); } + public BlockContext block() { + return getRuleContext(BlockContext.class,0); + } + public MethodImplementationProofContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_methodImplementationProof; } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof GobraParserVisitor ) return ((GobraParserVisitor)visitor).visitMethodImplementationProof(this); + else return visitor.visitChildren(this); + } + } + + public final MethodImplementationProofContext methodImplementationProof() throws RecognitionException { + MethodImplementationProofContext _localctx = new MethodImplementationProofContext(_ctx, getState()); + enterRule(_localctx, 76, RULE_methodImplementationProof); + int _la; + try { + enterOuterAlt(_localctx, 1); + { + setState(615); + _errHandler.sync(this); + _la = _input.LA(1); + if (_la==PURE) { + { + setState(614); + match(PURE); + } + } + + setState(617); + nonLocalReceiver(); + setState(618); + match(IDENTIFIER); + setState(619); + signature(); + setState(621); + _errHandler.sync(this); + switch ( getInterpreter().adaptivePredict(_input,30,_ctx) ) { + case 1: + { + setState(620); + block(); + } + break; + } + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class NonLocalReceiverContext extends ParserRuleContext { + public TerminalNode L_PAREN() { return getToken(GobraParser.L_PAREN, 0); } + public TypeNameContext typeName() { + return getRuleContext(TypeNameContext.class,0); + } + public TerminalNode R_PAREN() { return getToken(GobraParser.R_PAREN, 0); } + public TerminalNode IDENTIFIER() { return getToken(GobraParser.IDENTIFIER, 0); } + public TerminalNode STAR() { return getToken(GobraParser.STAR, 0); } + public NonLocalReceiverContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_nonLocalReceiver; } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof GobraParserVisitor ) return ((GobraParserVisitor)visitor).visitNonLocalReceiver(this); + else return visitor.visitChildren(this); + } + } + + public final NonLocalReceiverContext nonLocalReceiver() throws RecognitionException { + NonLocalReceiverContext _localctx = new NonLocalReceiverContext(_ctx, getState()); + enterRule(_localctx, 78, RULE_nonLocalReceiver); + int _la; + try { + enterOuterAlt(_localctx, 1); + { + setState(623); + match(L_PAREN); + setState(625); + _errHandler.sync(this); + switch ( getInterpreter().adaptivePredict(_input,31,_ctx) ) { + case 1: + { + setState(624); + match(IDENTIFIER); + } + break; + } + setState(628); + _errHandler.sync(this); + _la = _input.LA(1); + if (_la==STAR) { + { + setState(627); + match(STAR); + } + } + + setState(630); + typeName(); + setState(631); + match(R_PAREN); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class SelectionContext extends ParserRuleContext { + public PrimaryExprContext primaryExpr() { + return getRuleContext(PrimaryExprContext.class,0); + } + public Type_Context type_() { + return getRuleContext(Type_Context.class,0); + } + public TerminalNode DOT() { return getToken(GobraParser.DOT, 0); } + public TerminalNode IDENTIFIER() { return getToken(GobraParser.IDENTIFIER, 0); } + public SelectionContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_selection; } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof GobraParserVisitor ) return ((GobraParserVisitor)visitor).visitSelection(this); + else return visitor.visitChildren(this); + } + } + + public final SelectionContext selection() throws RecognitionException { + SelectionContext _localctx = new SelectionContext(_ctx, getState()); + enterRule(_localctx, 80, RULE_selection); + try { + setState(638); + _errHandler.sync(this); + switch ( getInterpreter().adaptivePredict(_input,33,_ctx) ) { + case 1: + enterOuterAlt(_localctx, 1); + { + setState(633); + primaryExpr(0); + } + break; + case 2: + enterOuterAlt(_localctx, 2); + { + setState(634); + type_(); + setState(635); + match(DOT); + setState(636); + match(IDENTIFIER); + } + break; + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class ImplementationProofPredicateAliasContext extends ParserRuleContext { + public TerminalNode PRED() { return getToken(GobraParser.PRED, 0); } + public TerminalNode IDENTIFIER() { return getToken(GobraParser.IDENTIFIER, 0); } + public TerminalNode DECLARE_ASSIGN() { return getToken(GobraParser.DECLARE_ASSIGN, 0); } + public SelectionContext selection() { + return getRuleContext(SelectionContext.class,0); + } + public OperandNameContext operandName() { + return getRuleContext(OperandNameContext.class,0); + } + public ImplementationProofPredicateAliasContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_implementationProofPredicateAlias; } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof GobraParserVisitor ) return ((GobraParserVisitor)visitor).visitImplementationProofPredicateAlias(this); + else return visitor.visitChildren(this); + } + } + + public final ImplementationProofPredicateAliasContext implementationProofPredicateAlias() throws RecognitionException { + ImplementationProofPredicateAliasContext _localctx = new ImplementationProofPredicateAliasContext(_ctx, getState()); + enterRule(_localctx, 82, RULE_implementationProofPredicateAlias); + try { + enterOuterAlt(_localctx, 1); + { + setState(640); + match(PRED); + setState(641); + match(IDENTIFIER); + setState(642); + match(DECLARE_ASSIGN); + setState(645); + _errHandler.sync(this); + switch ( getInterpreter().adaptivePredict(_input,34,_ctx) ) { + case 1: + { + setState(643); + selection(); + } + break; + case 2: + { + setState(644); + operandName(); + } + break; + } + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class MakeContext extends ParserRuleContext { + public TerminalNode MAKE() { return getToken(GobraParser.MAKE, 0); } + public TerminalNode L_PAREN() { return getToken(GobraParser.L_PAREN, 0); } + public Type_Context type_() { + return getRuleContext(Type_Context.class,0); + } + public TerminalNode R_PAREN() { return getToken(GobraParser.R_PAREN, 0); } + public TerminalNode COMMA() { return getToken(GobraParser.COMMA, 0); } + public ExpressionListContext expressionList() { + return getRuleContext(ExpressionListContext.class,0); + } + public MakeContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_make; } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof GobraParserVisitor ) return ((GobraParserVisitor)visitor).visitMake(this); + else return visitor.visitChildren(this); + } + } + + public final MakeContext make() throws RecognitionException { + MakeContext _localctx = new MakeContext(_ctx, getState()); + enterRule(_localctx, 84, RULE_make); + int _la; + try { + enterOuterAlt(_localctx, 1); + { + setState(647); + match(MAKE); + setState(648); + match(L_PAREN); + setState(649); + type_(); + setState(652); + _errHandler.sync(this); + _la = _input.LA(1); + if (_la==COMMA) { + { + setState(650); + match(COMMA); + setState(651); + expressionList(); + } + } + + setState(654); + match(R_PAREN); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class New_Context extends ParserRuleContext { + public TerminalNode NEW() { return getToken(GobraParser.NEW, 0); } + public TerminalNode L_PAREN() { return getToken(GobraParser.L_PAREN, 0); } + public Type_Context type_() { + return getRuleContext(Type_Context.class,0); + } + public TerminalNode R_PAREN() { return getToken(GobraParser.R_PAREN, 0); } + public New_Context(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_new_; } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof GobraParserVisitor ) return ((GobraParserVisitor)visitor).visitNew_(this); + else return visitor.visitChildren(this); + } + } + + public final New_Context new_() throws RecognitionException { + New_Context _localctx = new New_Context(_ctx, getState()); + enterRule(_localctx, 86, RULE_new_); + try { + enterOuterAlt(_localctx, 1); + { + setState(656); + match(NEW); + setState(657); + match(L_PAREN); + setState(658); + type_(); + setState(659); + match(R_PAREN); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class SpecMemberContext extends ParserRuleContext { + public SpecificationContext specification; + public SpecificationContext specification() { + return getRuleContext(SpecificationContext.class,0); + } + public FunctionDeclContext functionDecl() { + return getRuleContext(FunctionDeclContext.class,0); + } + public MethodDeclContext methodDecl() { + return getRuleContext(MethodDeclContext.class,0); + } + public SpecMemberContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_specMember; } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof GobraParserVisitor ) return ((GobraParserVisitor)visitor).visitSpecMember(this); + else return visitor.visitChildren(this); + } + } + + public final SpecMemberContext specMember() throws RecognitionException { + SpecMemberContext _localctx = new SpecMemberContext(_ctx, getState()); + enterRule(_localctx, 88, RULE_specMember); + try { + enterOuterAlt(_localctx, 1); + { + setState(661); + ((SpecMemberContext)_localctx).specification = specification(); + setState(664); + _errHandler.sync(this); + switch ( getInterpreter().adaptivePredict(_input,36,_ctx) ) { + case 1: + { + setState(662); + functionDecl(((SpecMemberContext)_localctx).specification.trusted, ((SpecMemberContext)_localctx).specification.pure); + } + break; + case 2: + { + setState(663); + methodDecl(((SpecMemberContext)_localctx).specification.trusted, ((SpecMemberContext)_localctx).specification.pure); + } + break; + } + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class FunctionDeclContext extends ParserRuleContext { + public boolean trusted; + public boolean pure; + public TerminalNode FUNC() { return getToken(GobraParser.FUNC, 0); } + public TerminalNode IDENTIFIER() { return getToken(GobraParser.IDENTIFIER, 0); } + public SignatureContext signature() { + return getRuleContext(SignatureContext.class,0); + } + public BlockWithBodyParameterInfoContext blockWithBodyParameterInfo() { + return getRuleContext(BlockWithBodyParameterInfoContext.class,0); + } + public FunctionDeclContext(ParserRuleContext parent, int invokingState) { super(parent, invokingState); } + public FunctionDeclContext(ParserRuleContext parent, int invokingState, boolean trusted, boolean pure) { + super(parent, invokingState); + this.trusted = trusted; + this.pure = pure; + } + @Override public int getRuleIndex() { return RULE_functionDecl; } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof GobraParserVisitor ) return ((GobraParserVisitor)visitor).visitFunctionDecl(this); + else return visitor.visitChildren(this); + } + } + + public final FunctionDeclContext functionDecl(boolean trusted,boolean pure) throws RecognitionException { + FunctionDeclContext _localctx = new FunctionDeclContext(_ctx, getState(), trusted, pure); + enterRule(_localctx, 90, RULE_functionDecl); + try { + enterOuterAlt(_localctx, 1); + { + setState(666); + match(FUNC); + setState(667); + match(IDENTIFIER); + { + setState(668); + signature(); + setState(670); + _errHandler.sync(this); + switch ( getInterpreter().adaptivePredict(_input,37,_ctx) ) { + case 1: + { + setState(669); + blockWithBodyParameterInfo(); + } + break; + } + } + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class MethodDeclContext extends ParserRuleContext { + public boolean trusted; + public boolean pure; + public TerminalNode FUNC() { return getToken(GobraParser.FUNC, 0); } + public ReceiverContext receiver() { + return getRuleContext(ReceiverContext.class,0); + } + public TerminalNode IDENTIFIER() { return getToken(GobraParser.IDENTIFIER, 0); } + public SignatureContext signature() { + return getRuleContext(SignatureContext.class,0); + } + public BlockWithBodyParameterInfoContext blockWithBodyParameterInfo() { + return getRuleContext(BlockWithBodyParameterInfoContext.class,0); + } + public MethodDeclContext(ParserRuleContext parent, int invokingState) { super(parent, invokingState); } + public MethodDeclContext(ParserRuleContext parent, int invokingState, boolean trusted, boolean pure) { + super(parent, invokingState); + this.trusted = trusted; + this.pure = pure; + } + @Override public int getRuleIndex() { return RULE_methodDecl; } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof GobraParserVisitor ) return ((GobraParserVisitor)visitor).visitMethodDecl(this); + else return visitor.visitChildren(this); + } + } + + public final MethodDeclContext methodDecl(boolean trusted,boolean pure) throws RecognitionException { + MethodDeclContext _localctx = new MethodDeclContext(_ctx, getState(), trusted, pure); + enterRule(_localctx, 92, RULE_methodDecl); + try { + enterOuterAlt(_localctx, 1); + { + setState(672); + match(FUNC); + setState(673); + receiver(); + setState(674); + match(IDENTIFIER); + { + setState(675); + signature(); + setState(677); + _errHandler.sync(this); + switch ( getInterpreter().adaptivePredict(_input,38,_ctx) ) { + case 1: + { + setState(676); + blockWithBodyParameterInfo(); + } + break; + } + } + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class SourceFileContext extends ParserRuleContext { + public PackageClauseContext packageClause() { + return getRuleContext(PackageClauseContext.class,0); + } + public List eos() { + return getRuleContexts(EosContext.class); + } + public EosContext eos(int i) { + return getRuleContext(EosContext.class,i); + } + public TerminalNode EOF() { return getToken(GobraParser.EOF, 0); } + public List importDecl() { + return getRuleContexts(ImportDeclContext.class); + } + public ImportDeclContext importDecl(int i) { + return getRuleContext(ImportDeclContext.class,i); + } + public List specMember() { + return getRuleContexts(SpecMemberContext.class); + } + public SpecMemberContext specMember(int i) { + return getRuleContext(SpecMemberContext.class,i); + } + public List declaration() { + return getRuleContexts(DeclarationContext.class); + } + public DeclarationContext declaration(int i) { + return getRuleContext(DeclarationContext.class,i); + } + public List ghostMember() { + return getRuleContexts(GhostMemberContext.class); + } + public GhostMemberContext ghostMember(int i) { + return getRuleContext(GhostMemberContext.class,i); + } + public SourceFileContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_sourceFile; } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof GobraParserVisitor ) return ((GobraParserVisitor)visitor).visitSourceFile(this); + else return visitor.visitChildren(this); + } + } + + public final SourceFileContext sourceFile() throws RecognitionException { + SourceFileContext _localctx = new SourceFileContext(_ctx, getState()); + enterRule(_localctx, 94, RULE_sourceFile); + int _la; + try { + enterOuterAlt(_localctx, 1); + { + setState(679); + packageClause(); + setState(680); + eos(); + setState(686); + _errHandler.sync(this); + _la = _input.LA(1); + while (_la==IMPORT) { + { + { + setState(681); + importDecl(); + setState(682); + eos(); + } + } + setState(688); + _errHandler.sync(this); + _la = _input.LA(1); + } + setState(698); + _errHandler.sync(this); + _la = _input.LA(1); + while ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << PRE) | (1L << PRESERVES) | (1L << POST) | (1L << DEC) | (1L << PURE) | (1L << GHOST) | (1L << SEQ) | (1L << SET) | (1L << MSET) | (1L << DICT) | (1L << OPT) | (1L << DOM) | (1L << PRED) | (1L << TRUSTED))) != 0) || ((((_la - 65)) & ~0x3f) == 0 && ((1L << (_la - 65)) & ((1L << (FUNC - 65)) | (1L << (INTERFACE - 65)) | (1L << (MAP - 65)) | (1L << (STRUCT - 65)) | (1L << (CHAN - 65)) | (1L << (CONST - 65)) | (1L << (TYPE - 65)) | (1L << (VAR - 65)) | (1L << (IDENTIFIER - 65)) | (1L << (L_PAREN - 65)) | (1L << (L_BRACKET - 65)) | (1L << (STAR - 65)) | (1L << (RECEIVE - 65)))) != 0)) { + { + { + setState(692); + _errHandler.sync(this); + switch ( getInterpreter().adaptivePredict(_input,40,_ctx) ) { + case 1: + { + setState(689); + specMember(); + } + break; + case 2: + { + setState(690); + declaration(); + } + break; + case 3: + { + setState(691); + ghostMember(); + } + break; + } + setState(694); + eos(); + } + } + setState(700); + _errHandler.sync(this); + _la = _input.LA(1); + } + setState(701); + match(EOF); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class GhostMemberContext extends ParserRuleContext { + public ImplementationProofContext implementationProof() { + return getRuleContext(ImplementationProofContext.class,0); + } + public FpredicateDeclContext fpredicateDecl() { + return getRuleContext(FpredicateDeclContext.class,0); + } + public MpredicateDeclContext mpredicateDecl() { + return getRuleContext(MpredicateDeclContext.class,0); + } + public ExplicitGhostMemberContext explicitGhostMember() { + return getRuleContext(ExplicitGhostMemberContext.class,0); + } + public GhostMemberContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_ghostMember; } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof GobraParserVisitor ) return ((GobraParserVisitor)visitor).visitGhostMember(this); + else return visitor.visitChildren(this); + } + } + + public final GhostMemberContext ghostMember() throws RecognitionException { + GhostMemberContext _localctx = new GhostMemberContext(_ctx, getState()); + enterRule(_localctx, 96, RULE_ghostMember); + try { + setState(707); + _errHandler.sync(this); + switch ( getInterpreter().adaptivePredict(_input,42,_ctx) ) { + case 1: + enterOuterAlt(_localctx, 1); + { + setState(703); + implementationProof(); + } + break; + case 2: + enterOuterAlt(_localctx, 2); + { + setState(704); + fpredicateDecl(); + } + break; + case 3: + enterOuterAlt(_localctx, 3); + { + setState(705); + mpredicateDecl(); + } + break; + case 4: + enterOuterAlt(_localctx, 4); + { + setState(706); + explicitGhostMember(); + } + break; + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class ExplicitGhostMemberContext extends ParserRuleContext { + public TerminalNode GHOST() { return getToken(GobraParser.GHOST, 0); } + public SpecMemberContext specMember() { + return getRuleContext(SpecMemberContext.class,0); + } + public DeclarationContext declaration() { + return getRuleContext(DeclarationContext.class,0); + } + public ExplicitGhostMemberContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_explicitGhostMember; } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof GobraParserVisitor ) return ((GobraParserVisitor)visitor).visitExplicitGhostMember(this); + else return visitor.visitChildren(this); + } + } + + public final ExplicitGhostMemberContext explicitGhostMember() throws RecognitionException { + ExplicitGhostMemberContext _localctx = new ExplicitGhostMemberContext(_ctx, getState()); + enterRule(_localctx, 98, RULE_explicitGhostMember); + try { + enterOuterAlt(_localctx, 1); + { + setState(709); + match(GHOST); + setState(712); + _errHandler.sync(this); + switch (_input.LA(1)) { + case PRE: + case PRESERVES: + case POST: + case DEC: + case PURE: + case TRUSTED: + case FUNC: + { + setState(710); + specMember(); + } + break; + case CONST: + case TYPE: + case VAR: + { + setState(711); + declaration(); + } + break; + default: + throw new NoViableAltException(this); + } + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class FpredicateDeclContext extends ParserRuleContext { + public TerminalNode PRED() { return getToken(GobraParser.PRED, 0); } + public TerminalNode IDENTIFIER() { return getToken(GobraParser.IDENTIFIER, 0); } + public ParametersContext parameters() { + return getRuleContext(ParametersContext.class,0); + } + public PredicateBodyContext predicateBody() { + return getRuleContext(PredicateBodyContext.class,0); + } + public FpredicateDeclContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_fpredicateDecl; } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof GobraParserVisitor ) return ((GobraParserVisitor)visitor).visitFpredicateDecl(this); + else return visitor.visitChildren(this); + } + } + + public final FpredicateDeclContext fpredicateDecl() throws RecognitionException { + FpredicateDeclContext _localctx = new FpredicateDeclContext(_ctx, getState()); + enterRule(_localctx, 100, RULE_fpredicateDecl); + try { + enterOuterAlt(_localctx, 1); + { + setState(714); + match(PRED); + setState(715); + match(IDENTIFIER); + setState(716); + parameters(); + setState(718); + _errHandler.sync(this); + switch ( getInterpreter().adaptivePredict(_input,44,_ctx) ) { + case 1: + { + setState(717); + predicateBody(); + } + break; + } + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class PredicateBodyContext extends ParserRuleContext { + public TerminalNode L_CURLY() { return getToken(GobraParser.L_CURLY, 0); } + public ExpressionContext expression() { + return getRuleContext(ExpressionContext.class,0); + } + public EosContext eos() { + return getRuleContext(EosContext.class,0); + } + public TerminalNode R_CURLY() { return getToken(GobraParser.R_CURLY, 0); } + public PredicateBodyContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_predicateBody; } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof GobraParserVisitor ) return ((GobraParserVisitor)visitor).visitPredicateBody(this); + else return visitor.visitChildren(this); + } + } + + public final PredicateBodyContext predicateBody() throws RecognitionException { + PredicateBodyContext _localctx = new PredicateBodyContext(_ctx, getState()); + enterRule(_localctx, 102, RULE_predicateBody); + try { + enterOuterAlt(_localctx, 1); + { + setState(720); + match(L_CURLY); + setState(721); + expression(0); + setState(722); + eos(); + setState(723); + match(R_CURLY); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class MpredicateDeclContext extends ParserRuleContext { + public TerminalNode PRED() { return getToken(GobraParser.PRED, 0); } + public ReceiverContext receiver() { + return getRuleContext(ReceiverContext.class,0); + } + public TerminalNode IDENTIFIER() { return getToken(GobraParser.IDENTIFIER, 0); } + public ParametersContext parameters() { + return getRuleContext(ParametersContext.class,0); + } + public PredicateBodyContext predicateBody() { + return getRuleContext(PredicateBodyContext.class,0); + } + public MpredicateDeclContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_mpredicateDecl; } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof GobraParserVisitor ) return ((GobraParserVisitor)visitor).visitMpredicateDecl(this); + else return visitor.visitChildren(this); + } + } + + public final MpredicateDeclContext mpredicateDecl() throws RecognitionException { + MpredicateDeclContext _localctx = new MpredicateDeclContext(_ctx, getState()); + enterRule(_localctx, 104, RULE_mpredicateDecl); + try { + enterOuterAlt(_localctx, 1); + { + setState(725); + match(PRED); + setState(726); + receiver(); + setState(727); + match(IDENTIFIER); + setState(728); + parameters(); + setState(730); + _errHandler.sync(this); + switch ( getInterpreter().adaptivePredict(_input,45,_ctx) ) { + case 1: + { + setState(729); + predicateBody(); + } + break; + } + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class VarSpecContext extends ParserRuleContext { + public MaybeAddressableIdentifierListContext maybeAddressableIdentifierList() { + return getRuleContext(MaybeAddressableIdentifierListContext.class,0); + } + public Type_Context type_() { + return getRuleContext(Type_Context.class,0); + } + public TerminalNode ASSIGN() { return getToken(GobraParser.ASSIGN, 0); } + public ExpressionListContext expressionList() { + return getRuleContext(ExpressionListContext.class,0); + } + public VarSpecContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_varSpec; } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof GobraParserVisitor ) return ((GobraParserVisitor)visitor).visitVarSpec(this); + else return visitor.visitChildren(this); + } + } + + public final VarSpecContext varSpec() throws RecognitionException { + VarSpecContext _localctx = new VarSpecContext(_ctx, getState()); + enterRule(_localctx, 106, RULE_varSpec); + try { + enterOuterAlt(_localctx, 1); + { + setState(732); + maybeAddressableIdentifierList(); + setState(740); + _errHandler.sync(this); + switch (_input.LA(1)) { + case GHOST: + case SEQ: + case SET: + case MSET: + case DICT: + case OPT: + case DOM: + case PRED: + case FUNC: + case INTERFACE: + case MAP: + case STRUCT: + case CHAN: + case IDENTIFIER: + case L_PAREN: + case L_BRACKET: + case STAR: + case RECEIVE: + { + setState(733); + type_(); + setState(736); + _errHandler.sync(this); + switch ( getInterpreter().adaptivePredict(_input,46,_ctx) ) { + case 1: + { + setState(734); + match(ASSIGN); + setState(735); + expressionList(); + } + break; + } + } + break; + case ASSIGN: + { + setState(738); + match(ASSIGN); + setState(739); + expressionList(); + } + break; + default: + throw new NoViableAltException(this); + } + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class ShortVarDeclContext extends ParserRuleContext { + public MaybeAddressableIdentifierListContext maybeAddressableIdentifierList() { + return getRuleContext(MaybeAddressableIdentifierListContext.class,0); + } + public TerminalNode DECLARE_ASSIGN() { return getToken(GobraParser.DECLARE_ASSIGN, 0); } + public ExpressionListContext expressionList() { + return getRuleContext(ExpressionListContext.class,0); + } + public ShortVarDeclContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_shortVarDecl; } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof GobraParserVisitor ) return ((GobraParserVisitor)visitor).visitShortVarDecl(this); + else return visitor.visitChildren(this); + } + } + + public final ShortVarDeclContext shortVarDecl() throws RecognitionException { + ShortVarDeclContext _localctx = new ShortVarDeclContext(_ctx, getState()); + enterRule(_localctx, 108, RULE_shortVarDecl); + try { + enterOuterAlt(_localctx, 1); + { + setState(742); + maybeAddressableIdentifierList(); + setState(743); + match(DECLARE_ASSIGN); + setState(744); + expressionList(); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class ReceiverContext extends ParserRuleContext { + public TerminalNode L_PAREN() { return getToken(GobraParser.L_PAREN, 0); } + public Type_Context type_() { + return getRuleContext(Type_Context.class,0); + } + public TerminalNode R_PAREN() { return getToken(GobraParser.R_PAREN, 0); } + public MaybeAddressableIdentifierContext maybeAddressableIdentifier() { + return getRuleContext(MaybeAddressableIdentifierContext.class,0); + } + public TerminalNode COMMA() { return getToken(GobraParser.COMMA, 0); } + public ReceiverContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_receiver; } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof GobraParserVisitor ) return ((GobraParserVisitor)visitor).visitReceiver(this); + else return visitor.visitChildren(this); + } + } + + public final ReceiverContext receiver() throws RecognitionException { + ReceiverContext _localctx = new ReceiverContext(_ctx, getState()); + enterRule(_localctx, 110, RULE_receiver); + int _la; + try { + enterOuterAlt(_localctx, 1); + { + setState(746); + match(L_PAREN); + setState(748); + _errHandler.sync(this); + switch ( getInterpreter().adaptivePredict(_input,48,_ctx) ) { + case 1: + { + setState(747); + maybeAddressableIdentifier(); + } + break; + } + setState(750); + type_(); + setState(752); + _errHandler.sync(this); + _la = _input.LA(1); + if (_la==COMMA) { + { + setState(751); + match(COMMA); + } + } + + setState(754); + match(R_PAREN); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class ParameterDeclContext extends ParserRuleContext { + public ActualParameterDeclContext actualParameterDecl() { + return getRuleContext(ActualParameterDeclContext.class,0); + } + public GhostParameterDeclContext ghostParameterDecl() { + return getRuleContext(GhostParameterDeclContext.class,0); + } + public ParameterDeclContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_parameterDecl; } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof GobraParserVisitor ) return ((GobraParserVisitor)visitor).visitParameterDecl(this); + else return visitor.visitChildren(this); + } + } + + public final ParameterDeclContext parameterDecl() throws RecognitionException { + ParameterDeclContext _localctx = new ParameterDeclContext(_ctx, getState()); + enterRule(_localctx, 112, RULE_parameterDecl); + try { + setState(758); + _errHandler.sync(this); + switch ( getInterpreter().adaptivePredict(_input,50,_ctx) ) { + case 1: + enterOuterAlt(_localctx, 1); + { + setState(756); + actualParameterDecl(); + } + break; + case 2: + enterOuterAlt(_localctx, 2); + { + setState(757); + ghostParameterDecl(); + } + break; + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class ActualParameterDeclContext extends ParserRuleContext { + public ParameterTypeContext parameterType() { + return getRuleContext(ParameterTypeContext.class,0); + } + public IdentifierListContext identifierList() { + return getRuleContext(IdentifierListContext.class,0); + } + public ActualParameterDeclContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_actualParameterDecl; } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof GobraParserVisitor ) return ((GobraParserVisitor)visitor).visitActualParameterDecl(this); + else return visitor.visitChildren(this); + } + } + + public final ActualParameterDeclContext actualParameterDecl() throws RecognitionException { + ActualParameterDeclContext _localctx = new ActualParameterDeclContext(_ctx, getState()); + enterRule(_localctx, 114, RULE_actualParameterDecl); + try { + enterOuterAlt(_localctx, 1); + { + setState(761); + _errHandler.sync(this); + switch ( getInterpreter().adaptivePredict(_input,51,_ctx) ) { + case 1: + { + setState(760); + identifierList(); + } + break; + } + setState(763); + parameterType(); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class GhostParameterDeclContext extends ParserRuleContext { + public TerminalNode GHOST() { return getToken(GobraParser.GHOST, 0); } + public ParameterTypeContext parameterType() { + return getRuleContext(ParameterTypeContext.class,0); + } + public IdentifierListContext identifierList() { + return getRuleContext(IdentifierListContext.class,0); + } + public GhostParameterDeclContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_ghostParameterDecl; } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof GobraParserVisitor ) return ((GobraParserVisitor)visitor).visitGhostParameterDecl(this); + else return visitor.visitChildren(this); + } + } + + public final GhostParameterDeclContext ghostParameterDecl() throws RecognitionException { + GhostParameterDeclContext _localctx = new GhostParameterDeclContext(_ctx, getState()); + enterRule(_localctx, 116, RULE_ghostParameterDecl); + try { + enterOuterAlt(_localctx, 1); + { + setState(765); + match(GHOST); + setState(767); + _errHandler.sync(this); + switch ( getInterpreter().adaptivePredict(_input,52,_ctx) ) { + case 1: + { + setState(766); + identifierList(); + } + break; + } + setState(769); + parameterType(); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class ParameterTypeContext extends ParserRuleContext { + public Type_Context type_() { + return getRuleContext(Type_Context.class,0); + } + public TerminalNode ELLIPSIS() { return getToken(GobraParser.ELLIPSIS, 0); } + public ParameterTypeContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_parameterType; } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof GobraParserVisitor ) return ((GobraParserVisitor)visitor).visitParameterType(this); + else return visitor.visitChildren(this); + } + } + + public final ParameterTypeContext parameterType() throws RecognitionException { + ParameterTypeContext _localctx = new ParameterTypeContext(_ctx, getState()); + enterRule(_localctx, 118, RULE_parameterType); + int _la; + try { + enterOuterAlt(_localctx, 1); + { + setState(772); + _errHandler.sync(this); + _la = _input.LA(1); + if (_la==ELLIPSIS) { + { + setState(771); + match(ELLIPSIS); + } + } + + setState(774); + type_(); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class ExpressionContext extends ParserRuleContext { + public ExpressionContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_expression; } + + public ExpressionContext() { } + public void copyFrom(ExpressionContext ctx) { + super.copyFrom(ctx); + } + } + public static class PrimaryExpr_Context extends ExpressionContext { + public PrimaryExprContext primaryExpr() { + return getRuleContext(PrimaryExprContext.class,0); + } + public PrimaryExpr_Context(ExpressionContext ctx) { copyFrom(ctx); } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof GobraParserVisitor ) return ((GobraParserVisitor)visitor).visitPrimaryExpr_(this); + else return visitor.visitChildren(this); + } + } + public static class QuantificationContext extends ExpressionContext { + public BoundVariablesContext boundVariables() { + return getRuleContext(BoundVariablesContext.class,0); + } + public List COLON() { return getTokens(GobraParser.COLON); } + public TerminalNode COLON(int i) { + return getToken(GobraParser.COLON, i); + } + public TriggersContext triggers() { + return getRuleContext(TriggersContext.class,0); + } + public ExpressionContext expression() { + return getRuleContext(ExpressionContext.class,0); + } + public TerminalNode FORALL() { return getToken(GobraParser.FORALL, 0); } + public TerminalNode EXISTS() { return getToken(GobraParser.EXISTS, 0); } + public QuantificationContext(ExpressionContext ctx) { copyFrom(ctx); } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof GobraParserVisitor ) return ((GobraParserVisitor)visitor).visitQuantification(this); + else return visitor.visitChildren(this); + } + } + public static class UnfoldingContext extends ExpressionContext { + public TerminalNode UNFOLDING() { return getToken(GobraParser.UNFOLDING, 0); } + public PredicateAccessContext predicateAccess() { + return getRuleContext(PredicateAccessContext.class,0); + } + public TerminalNode IN() { return getToken(GobraParser.IN, 0); } + public ExpressionContext expression() { + return getRuleContext(ExpressionContext.class,0); + } + public UnfoldingContext(ExpressionContext ctx) { copyFrom(ctx); } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof GobraParserVisitor ) return ((GobraParserVisitor)visitor).visitUnfolding(this); + else return visitor.visitChildren(this); + } + } + public static class OrExprContext extends ExpressionContext { + public List expression() { + return getRuleContexts(ExpressionContext.class); + } + public ExpressionContext expression(int i) { + return getRuleContext(ExpressionContext.class,i); + } + public TerminalNode LOGICAL_OR() { return getToken(GobraParser.LOGICAL_OR, 0); } + public OrExprContext(ExpressionContext ctx) { copyFrom(ctx); } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof GobraParserVisitor ) return ((GobraParserVisitor)visitor).visitOrExpr(this); + else return visitor.visitChildren(this); + } + } + public static class P41ExprContext extends ExpressionContext { + public Token p41_op; + public List expression() { + return getRuleContexts(ExpressionContext.class); + } + public ExpressionContext expression(int i) { + return getRuleContext(ExpressionContext.class,i); + } + public TerminalNode IN() { return getToken(GobraParser.IN, 0); } + public TerminalNode MULTI() { return getToken(GobraParser.MULTI, 0); } + public TerminalNode SUBSET() { return getToken(GobraParser.SUBSET, 0); } + public P41ExprContext(ExpressionContext ctx) { copyFrom(ctx); } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof GobraParserVisitor ) return ((GobraParserVisitor)visitor).visitP41Expr(this); + else return visitor.visitChildren(this); + } + } + public static class UnaryExprContext extends ExpressionContext { + public Token unary_op; + public ExpressionContext expression() { + return getRuleContext(ExpressionContext.class,0); + } + public TerminalNode PLUS() { return getToken(GobraParser.PLUS, 0); } + public TerminalNode MINUS() { return getToken(GobraParser.MINUS, 0); } + public TerminalNode EXCLAMATION() { return getToken(GobraParser.EXCLAMATION, 0); } + public TerminalNode CARET() { return getToken(GobraParser.CARET, 0); } + public TerminalNode STAR() { return getToken(GobraParser.STAR, 0); } + public TerminalNode AMPERSAND() { return getToken(GobraParser.AMPERSAND, 0); } + public TerminalNode RECEIVE() { return getToken(GobraParser.RECEIVE, 0); } + public UnaryExprContext(ExpressionContext ctx) { copyFrom(ctx); } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof GobraParserVisitor ) return ((GobraParserVisitor)visitor).visitUnaryExpr(this); + else return visitor.visitChildren(this); + } + } + public static class P42ExprContext extends ExpressionContext { + public Token p42_op; + public List expression() { + return getRuleContexts(ExpressionContext.class); + } + public ExpressionContext expression(int i) { + return getRuleContext(ExpressionContext.class,i); + } + public TerminalNode UNION() { return getToken(GobraParser.UNION, 0); } + public TerminalNode INTERSECTION() { return getToken(GobraParser.INTERSECTION, 0); } + public TerminalNode SETMINUS() { return getToken(GobraParser.SETMINUS, 0); } + public P42ExprContext(ExpressionContext ctx) { copyFrom(ctx); } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof GobraParserVisitor ) return ((GobraParserVisitor)visitor).visitP42Expr(this); + else return visitor.visitChildren(this); + } + } + public static class TernaryExprContext extends ExpressionContext { + public List expression() { + return getRuleContexts(ExpressionContext.class); + } + public ExpressionContext expression(int i) { + return getRuleContext(ExpressionContext.class,i); + } + public TerminalNode QMARK() { return getToken(GobraParser.QMARK, 0); } + public TerminalNode COLON() { return getToken(GobraParser.COLON, 0); } + public TernaryExprContext(ExpressionContext ctx) { copyFrom(ctx); } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof GobraParserVisitor ) return ((GobraParserVisitor)visitor).visitTernaryExpr(this); + else return visitor.visitChildren(this); + } + } + public static class AddExprContext extends ExpressionContext { + public Token add_op; + public List expression() { + return getRuleContexts(ExpressionContext.class); + } + public ExpressionContext expression(int i) { + return getRuleContext(ExpressionContext.class,i); + } + public TerminalNode PLUS() { return getToken(GobraParser.PLUS, 0); } + public TerminalNode MINUS() { return getToken(GobraParser.MINUS, 0); } + public TerminalNode OR() { return getToken(GobraParser.OR, 0); } + public TerminalNode CARET() { return getToken(GobraParser.CARET, 0); } + public TerminalNode PLUS_PLUS() { return getToken(GobraParser.PLUS_PLUS, 0); } + public TerminalNode WAND() { return getToken(GobraParser.WAND, 0); } + public AddExprContext(ExpressionContext ctx) { copyFrom(ctx); } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof GobraParserVisitor ) return ((GobraParserVisitor)visitor).visitAddExpr(this); + else return visitor.visitChildren(this); + } + } + public static class ImplicationContext extends ExpressionContext { + public List expression() { + return getRuleContexts(ExpressionContext.class); + } + public ExpressionContext expression(int i) { + return getRuleContext(ExpressionContext.class,i); + } + public TerminalNode IMPLIES() { return getToken(GobraParser.IMPLIES, 0); } + public ImplicationContext(ExpressionContext ctx) { copyFrom(ctx); } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof GobraParserVisitor ) return ((GobraParserVisitor)visitor).visitImplication(this); + else return visitor.visitChildren(this); + } + } + public static class MulExprContext extends ExpressionContext { + public Token mul_op; + public List expression() { + return getRuleContexts(ExpressionContext.class); + } + public ExpressionContext expression(int i) { + return getRuleContext(ExpressionContext.class,i); + } + public TerminalNode STAR() { return getToken(GobraParser.STAR, 0); } + public TerminalNode DIV() { return getToken(GobraParser.DIV, 0); } + public TerminalNode MOD() { return getToken(GobraParser.MOD, 0); } + public TerminalNode LSHIFT() { return getToken(GobraParser.LSHIFT, 0); } + public TerminalNode RSHIFT() { return getToken(GobraParser.RSHIFT, 0); } + public TerminalNode AMPERSAND() { return getToken(GobraParser.AMPERSAND, 0); } + public TerminalNode BIT_CLEAR() { return getToken(GobraParser.BIT_CLEAR, 0); } + public MulExprContext(ExpressionContext ctx) { copyFrom(ctx); } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof GobraParserVisitor ) return ((GobraParserVisitor)visitor).visitMulExpr(this); + else return visitor.visitChildren(this); + } + } + public static class RelExprContext extends ExpressionContext { + public Token rel_op; + public List expression() { + return getRuleContexts(ExpressionContext.class); + } + public ExpressionContext expression(int i) { + return getRuleContext(ExpressionContext.class,i); + } + public TerminalNode EQUALS() { return getToken(GobraParser.EQUALS, 0); } + public TerminalNode NOT_EQUALS() { return getToken(GobraParser.NOT_EQUALS, 0); } + public TerminalNode LESS() { return getToken(GobraParser.LESS, 0); } + public TerminalNode LESS_OR_EQUALS() { return getToken(GobraParser.LESS_OR_EQUALS, 0); } + public TerminalNode GREATER() { return getToken(GobraParser.GREATER, 0); } + public TerminalNode GREATER_OR_EQUALS() { return getToken(GobraParser.GREATER_OR_EQUALS, 0); } + public RelExprContext(ExpressionContext ctx) { copyFrom(ctx); } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof GobraParserVisitor ) return ((GobraParserVisitor)visitor).visitRelExpr(this); + else return visitor.visitChildren(this); + } + } + public static class AndExprContext extends ExpressionContext { + public List expression() { + return getRuleContexts(ExpressionContext.class); + } + public ExpressionContext expression(int i) { + return getRuleContext(ExpressionContext.class,i); + } + public TerminalNode LOGICAL_AND() { return getToken(GobraParser.LOGICAL_AND, 0); } + public AndExprContext(ExpressionContext ctx) { copyFrom(ctx); } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof GobraParserVisitor ) return ((GobraParserVisitor)visitor).visitAndExpr(this); + else return visitor.visitChildren(this); + } + } + + public final ExpressionContext expression() throws RecognitionException { + return expression(0); + } + + private ExpressionContext expression(int _p) throws RecognitionException { + ParserRuleContext _parentctx = _ctx; + int _parentState = getState(); + ExpressionContext _localctx = new ExpressionContext(_ctx, _parentState); + ExpressionContext _prevctx = _localctx; + int _startState = 120; + enterRecursionRule(_localctx, 120, RULE_expression, _p); + int _la; + try { + int _alt; + enterOuterAlt(_localctx, 1); + { + setState(792); + _errHandler.sync(this); + switch ( getInterpreter().adaptivePredict(_input,54,_ctx) ) { + case 1: + { + _localctx = new UnaryExprContext(_localctx); + _ctx = _localctx; + _prevctx = _localctx; + + setState(777); + ((UnaryExprContext)_localctx).unary_op = _input.LT(1); + _la = _input.LA(1); + if ( !(((((_la - 119)) & ~0x3f) == 0 && ((1L << (_la - 119)) & ((1L << (EXCLAMATION - 119)) | (1L << (PLUS - 119)) | (1L << (MINUS - 119)) | (1L << (CARET - 119)) | (1L << (STAR - 119)) | (1L << (AMPERSAND - 119)) | (1L << (RECEIVE - 119)))) != 0)) ) { + ((UnaryExprContext)_localctx).unary_op = (Token)_errHandler.recoverInline(this); + } + else { + if ( _input.LA(1)==Token.EOF ) matchedEOF = true; + _errHandler.reportMatch(this); + consume(); + } + setState(778); + expression(13); + } + break; + case 2: + { + _localctx = new PrimaryExpr_Context(_localctx); + _ctx = _localctx; + _prevctx = _localctx; + setState(779); + primaryExpr(0); + } + break; + case 3: + { + _localctx = new UnfoldingContext(_localctx); + _ctx = _localctx; + _prevctx = _localctx; + setState(780); + match(UNFOLDING); + setState(781); + predicateAccess(); + setState(782); + match(IN); + setState(783); + expression(2); + } + break; + case 4: + { + _localctx = new QuantificationContext(_localctx); + _ctx = _localctx; + _prevctx = _localctx; + setState(785); + _la = _input.LA(1); + if ( !(_la==FORALL || _la==EXISTS) ) { + _errHandler.recoverInline(this); + } + else { + if ( _input.LA(1)==Token.EOF ) matchedEOF = true; + _errHandler.reportMatch(this); + consume(); + } + setState(786); + boundVariables(); + setState(787); + match(COLON); + setState(788); + match(COLON); + setState(789); + triggers(); + setState(790); + expression(1); + } + break; + } + _ctx.stop = _input.LT(-1); + setState(826); + _errHandler.sync(this); + _alt = getInterpreter().adaptivePredict(_input,56,_ctx); + while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) { + if ( _alt==1 ) { + if ( _parseListeners!=null ) triggerExitRuleEvent(); + _prevctx = _localctx; + { + setState(824); + _errHandler.sync(this); + switch ( getInterpreter().adaptivePredict(_input,55,_ctx) ) { + case 1: + { + _localctx = new MulExprContext(new ExpressionContext(_parentctx, _parentState)); + pushNewRecursionContext(_localctx, _startState, RULE_expression); + setState(794); + if (!(precpred(_ctx, 11))) throw new FailedPredicateException(this, "precpred(_ctx, 11)"); + setState(795); + ((MulExprContext)_localctx).mul_op = _input.LT(1); + _la = _input.LA(1); + if ( !(((((_la - 114)) & ~0x3f) == 0 && ((1L << (_la - 114)) & ((1L << (DIV - 114)) | (1L << (MOD - 114)) | (1L << (LSHIFT - 114)) | (1L << (RSHIFT - 114)) | (1L << (BIT_CLEAR - 114)) | (1L << (STAR - 114)) | (1L << (AMPERSAND - 114)))) != 0)) ) { + ((MulExprContext)_localctx).mul_op = (Token)_errHandler.recoverInline(this); + } + else { + if ( _input.LA(1)==Token.EOF ) matchedEOF = true; + _errHandler.reportMatch(this); + consume(); + } + setState(796); + expression(12); + } + break; + case 2: + { + _localctx = new AddExprContext(new ExpressionContext(_parentctx, _parentState)); + pushNewRecursionContext(_localctx, _startState, RULE_expression); + setState(797); + if (!(precpred(_ctx, 10))) throw new FailedPredicateException(this, "precpred(_ctx, 10)"); + setState(798); + ((AddExprContext)_localctx).add_op = _input.LT(1); + _la = _input.LA(1); + if ( !(_la==WAND || ((((_la - 101)) & ~0x3f) == 0 && ((1L << (_la - 101)) & ((1L << (PLUS_PLUS - 101)) | (1L << (OR - 101)) | (1L << (PLUS - 101)) | (1L << (MINUS - 101)) | (1L << (CARET - 101)))) != 0)) ) { + ((AddExprContext)_localctx).add_op = (Token)_errHandler.recoverInline(this); + } + else { + if ( _input.LA(1)==Token.EOF ) matchedEOF = true; + _errHandler.reportMatch(this); + consume(); + } + setState(799); + expression(11); + } + break; + case 3: + { + _localctx = new P42ExprContext(new ExpressionContext(_parentctx, _parentState)); + pushNewRecursionContext(_localctx, _startState, RULE_expression); + setState(800); + if (!(precpred(_ctx, 9))) throw new FailedPredicateException(this, "precpred(_ctx, 9)"); + setState(801); + ((P42ExprContext)_localctx).p42_op = _input.LT(1); + _la = _input.LA(1); + if ( !((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << UNION) | (1L << INTERSECTION) | (1L << SETMINUS))) != 0)) ) { + ((P42ExprContext)_localctx).p42_op = (Token)_errHandler.recoverInline(this); + } + else { + if ( _input.LA(1)==Token.EOF ) matchedEOF = true; + _errHandler.reportMatch(this); + consume(); + } + setState(802); + expression(10); + } + break; + case 4: + { + _localctx = new P41ExprContext(new ExpressionContext(_parentctx, _parentState)); + pushNewRecursionContext(_localctx, _startState, RULE_expression); + setState(803); + if (!(precpred(_ctx, 8))) throw new FailedPredicateException(this, "precpred(_ctx, 8)"); + setState(804); + ((P41ExprContext)_localctx).p41_op = _input.LT(1); + _la = _input.LA(1); + if ( !((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << IN) | (1L << MULTI) | (1L << SUBSET))) != 0)) ) { + ((P41ExprContext)_localctx).p41_op = (Token)_errHandler.recoverInline(this); + } + else { + if ( _input.LA(1)==Token.EOF ) matchedEOF = true; + _errHandler.reportMatch(this); + consume(); + } + setState(805); + expression(9); + } + break; + case 5: + { + _localctx = new RelExprContext(new ExpressionContext(_parentctx, _parentState)); + pushNewRecursionContext(_localctx, _startState, RULE_expression); + setState(806); + if (!(precpred(_ctx, 7))) throw new FailedPredicateException(this, "precpred(_ctx, 7)"); + setState(807); + ((RelExprContext)_localctx).rel_op = _input.LT(1); + _la = _input.LA(1); + if ( !(((((_la - 107)) & ~0x3f) == 0 && ((1L << (_la - 107)) & ((1L << (EQUALS - 107)) | (1L << (NOT_EQUALS - 107)) | (1L << (LESS - 107)) | (1L << (LESS_OR_EQUALS - 107)) | (1L << (GREATER - 107)) | (1L << (GREATER_OR_EQUALS - 107)))) != 0)) ) { + ((RelExprContext)_localctx).rel_op = (Token)_errHandler.recoverInline(this); + } + else { + if ( _input.LA(1)==Token.EOF ) matchedEOF = true; + _errHandler.reportMatch(this); + consume(); + } + setState(808); + expression(8); + } + break; + case 6: + { + _localctx = new AndExprContext(new ExpressionContext(_parentctx, _parentState)); + pushNewRecursionContext(_localctx, _startState, RULE_expression); + setState(809); + if (!(precpred(_ctx, 6))) throw new FailedPredicateException(this, "precpred(_ctx, 6)"); + setState(810); + match(LOGICAL_AND); + setState(811); + expression(7); + } + break; + case 7: + { + _localctx = new OrExprContext(new ExpressionContext(_parentctx, _parentState)); + pushNewRecursionContext(_localctx, _startState, RULE_expression); + setState(812); + if (!(precpred(_ctx, 5))) throw new FailedPredicateException(this, "precpred(_ctx, 5)"); + setState(813); + match(LOGICAL_OR); + setState(814); + expression(6); + } + break; + case 8: + { + _localctx = new ImplicationContext(new ExpressionContext(_parentctx, _parentState)); + pushNewRecursionContext(_localctx, _startState, RULE_expression); + setState(815); + if (!(precpred(_ctx, 4))) throw new FailedPredicateException(this, "precpred(_ctx, 4)"); + setState(816); + match(IMPLIES); + setState(817); + expression(4); + } + break; + case 9: + { + _localctx = new TernaryExprContext(new ExpressionContext(_parentctx, _parentState)); + pushNewRecursionContext(_localctx, _startState, RULE_expression); + setState(818); + if (!(precpred(_ctx, 3))) throw new FailedPredicateException(this, "precpred(_ctx, 3)"); + setState(819); + match(QMARK); + setState(820); + expression(0); + setState(821); + match(COLON); + setState(822); + expression(3); + } + break; + } + } + } + setState(828); + _errHandler.sync(this); + _alt = getInterpreter().adaptivePredict(_input,56,_ctx); + } + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + unrollRecursionContexts(_parentctx); + } + return _localctx; + } + + public static class StatementContext extends ParserRuleContext { + public GhostStatementContext ghostStatement() { + return getRuleContext(GhostStatementContext.class,0); + } + public PackageStmtContext packageStmt() { + return getRuleContext(PackageStmtContext.class,0); + } + public ApplyStmtContext applyStmt() { + return getRuleContext(ApplyStmtContext.class,0); + } + public DeclarationContext declaration() { + return getRuleContext(DeclarationContext.class,0); + } + public LabeledStmtContext labeledStmt() { + return getRuleContext(LabeledStmtContext.class,0); + } + public SimpleStmtContext simpleStmt() { + return getRuleContext(SimpleStmtContext.class,0); + } + public GoStmtContext goStmt() { + return getRuleContext(GoStmtContext.class,0); + } + public ReturnStmtContext returnStmt() { + return getRuleContext(ReturnStmtContext.class,0); + } + public BreakStmtContext breakStmt() { + return getRuleContext(BreakStmtContext.class,0); + } + public ContinueStmtContext continueStmt() { + return getRuleContext(ContinueStmtContext.class,0); + } + public GotoStmtContext gotoStmt() { + return getRuleContext(GotoStmtContext.class,0); + } + public FallthroughStmtContext fallthroughStmt() { + return getRuleContext(FallthroughStmtContext.class,0); + } + public BlockContext block() { + return getRuleContext(BlockContext.class,0); + } + public IfStmtContext ifStmt() { + return getRuleContext(IfStmtContext.class,0); + } + public SwitchStmtContext switchStmt() { + return getRuleContext(SwitchStmtContext.class,0); + } + public SelectStmtContext selectStmt() { + return getRuleContext(SelectStmtContext.class,0); + } + public SpecForStmtContext specForStmt() { + return getRuleContext(SpecForStmtContext.class,0); + } + public DeferStmtContext deferStmt() { + return getRuleContext(DeferStmtContext.class,0); + } + public StatementContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_statement; } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof GobraParserVisitor ) return ((GobraParserVisitor)visitor).visitStatement(this); + else return visitor.visitChildren(this); + } + } + + public final StatementContext statement() throws RecognitionException { + StatementContext _localctx = new StatementContext(_ctx, getState()); + enterRule(_localctx, 122, RULE_statement); + try { + setState(847); + _errHandler.sync(this); + switch ( getInterpreter().adaptivePredict(_input,57,_ctx) ) { + case 1: + enterOuterAlt(_localctx, 1); + { + setState(829); + ghostStatement(); + } + break; + case 2: + enterOuterAlt(_localctx, 2); + { + setState(830); + packageStmt(); + } + break; + case 3: + enterOuterAlt(_localctx, 3); + { + setState(831); + applyStmt(); + } + break; + case 4: + enterOuterAlt(_localctx, 4); + { + setState(832); + declaration(); + } + break; + case 5: + enterOuterAlt(_localctx, 5); + { + setState(833); + labeledStmt(); + } + break; + case 6: + enterOuterAlt(_localctx, 6); + { + setState(834); + simpleStmt(); + } + break; + case 7: + enterOuterAlt(_localctx, 7); + { + setState(835); + goStmt(); + } + break; + case 8: + enterOuterAlt(_localctx, 8); + { + setState(836); + returnStmt(); + } + break; + case 9: + enterOuterAlt(_localctx, 9); + { + setState(837); + breakStmt(); + } + break; + case 10: + enterOuterAlt(_localctx, 10); + { + setState(838); + continueStmt(); + } + break; + case 11: + enterOuterAlt(_localctx, 11); + { + setState(839); + gotoStmt(); + } + break; + case 12: + enterOuterAlt(_localctx, 12); + { + setState(840); + fallthroughStmt(); + } + break; + case 13: + enterOuterAlt(_localctx, 13); + { + setState(841); + block(); + } + break; + case 14: + enterOuterAlt(_localctx, 14); + { + setState(842); + ifStmt(); + } + break; + case 15: + enterOuterAlt(_localctx, 15); + { + setState(843); + switchStmt(); + } + break; + case 16: + enterOuterAlt(_localctx, 16); + { + setState(844); + selectStmt(); + } + break; + case 17: + enterOuterAlt(_localctx, 17); + { + setState(845); + specForStmt(); + } + break; + case 18: + enterOuterAlt(_localctx, 18); + { + setState(846); + deferStmt(); + } + break; + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class ApplyStmtContext extends ParserRuleContext { + public TerminalNode APPLY() { return getToken(GobraParser.APPLY, 0); } + public ExpressionContext expression() { + return getRuleContext(ExpressionContext.class,0); + } + public ApplyStmtContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_applyStmt; } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof GobraParserVisitor ) return ((GobraParserVisitor)visitor).visitApplyStmt(this); + else return visitor.visitChildren(this); + } + } + + public final ApplyStmtContext applyStmt() throws RecognitionException { + ApplyStmtContext _localctx = new ApplyStmtContext(_ctx, getState()); + enterRule(_localctx, 124, RULE_applyStmt); + try { + enterOuterAlt(_localctx, 1); + { + setState(849); + match(APPLY); + setState(850); + expression(0); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class PackageStmtContext extends ParserRuleContext { + public TerminalNode PACKAGE() { return getToken(GobraParser.PACKAGE, 0); } + public ExpressionContext expression() { + return getRuleContext(ExpressionContext.class,0); + } + public BlockContext block() { + return getRuleContext(BlockContext.class,0); + } + public PackageStmtContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_packageStmt; } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof GobraParserVisitor ) return ((GobraParserVisitor)visitor).visitPackageStmt(this); + else return visitor.visitChildren(this); + } + } + + public final PackageStmtContext packageStmt() throws RecognitionException { + PackageStmtContext _localctx = new PackageStmtContext(_ctx, getState()); + enterRule(_localctx, 126, RULE_packageStmt); + try { + enterOuterAlt(_localctx, 1); + { + setState(852); + match(PACKAGE); + setState(853); + expression(0); + setState(855); + _errHandler.sync(this); + switch ( getInterpreter().adaptivePredict(_input,58,_ctx) ) { + case 1: + { + setState(854); + block(); + } + break; + } + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class SpecForStmtContext extends ParserRuleContext { + public LoopSpecContext loopSpec() { + return getRuleContext(LoopSpecContext.class,0); + } + public ForStmtContext forStmt() { + return getRuleContext(ForStmtContext.class,0); + } + public SpecForStmtContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_specForStmt; } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof GobraParserVisitor ) return ((GobraParserVisitor)visitor).visitSpecForStmt(this); + else return visitor.visitChildren(this); + } + } + + public final SpecForStmtContext specForStmt() throws RecognitionException { + SpecForStmtContext _localctx = new SpecForStmtContext(_ctx, getState()); + enterRule(_localctx, 128, RULE_specForStmt); + try { + enterOuterAlt(_localctx, 1); + { + setState(857); + loopSpec(); + setState(858); + forStmt(); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class LoopSpecContext extends ParserRuleContext { + public List INV() { return getTokens(GobraParser.INV); } + public TerminalNode INV(int i) { + return getToken(GobraParser.INV, i); + } + public List expression() { + return getRuleContexts(ExpressionContext.class); + } + public ExpressionContext expression(int i) { + return getRuleContext(ExpressionContext.class,i); + } + public List eos() { + return getRuleContexts(EosContext.class); + } + public EosContext eos(int i) { + return getRuleContext(EosContext.class,i); + } + public TerminalNode DEC() { return getToken(GobraParser.DEC, 0); } + public TerminationMeasureContext terminationMeasure() { + return getRuleContext(TerminationMeasureContext.class,0); + } + public LoopSpecContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_loopSpec; } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof GobraParserVisitor ) return ((GobraParserVisitor)visitor).visitLoopSpec(this); + else return visitor.visitChildren(this); + } + } + + public final LoopSpecContext loopSpec() throws RecognitionException { + LoopSpecContext _localctx = new LoopSpecContext(_ctx, getState()); + enterRule(_localctx, 130, RULE_loopSpec); + int _la; + try { + enterOuterAlt(_localctx, 1); + { + setState(866); + _errHandler.sync(this); + _la = _input.LA(1); + while (_la==INV) { + { + { + setState(860); + match(INV); + setState(861); + expression(0); + setState(862); + eos(); + } + } + setState(868); + _errHandler.sync(this); + _la = _input.LA(1); + } + setState(873); + _errHandler.sync(this); + _la = _input.LA(1); + if (_la==DEC) { + { + setState(869); + match(DEC); + setState(870); + terminationMeasure(); + setState(871); + eos(); + } + } + + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class BasicLitContext extends ParserRuleContext { + public TerminalNode TRUE() { return getToken(GobraParser.TRUE, 0); } + public TerminalNode FALSE() { return getToken(GobraParser.FALSE, 0); } + public TerminalNode NIL_LIT() { return getToken(GobraParser.NIL_LIT, 0); } + public IntegerContext integer() { + return getRuleContext(IntegerContext.class,0); + } + public String_Context string_() { + return getRuleContext(String_Context.class,0); + } + public TerminalNode FLOAT_LIT() { return getToken(GobraParser.FLOAT_LIT, 0); } + public TerminalNode IMAGINARY_LIT() { return getToken(GobraParser.IMAGINARY_LIT, 0); } + public TerminalNode RUNE_LIT() { return getToken(GobraParser.RUNE_LIT, 0); } + public BasicLitContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_basicLit; } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof GobraParserVisitor ) return ((GobraParserVisitor)visitor).visitBasicLit(this); + else return visitor.visitChildren(this); + } + } + + public final BasicLitContext basicLit() throws RecognitionException { + BasicLitContext _localctx = new BasicLitContext(_ctx, getState()); + enterRule(_localctx, 132, RULE_basicLit); + try { + setState(883); + _errHandler.sync(this); + switch ( getInterpreter().adaptivePredict(_input,61,_ctx) ) { + case 1: + enterOuterAlt(_localctx, 1); + { + setState(875); + match(TRUE); + } + break; + case 2: + enterOuterAlt(_localctx, 2); + { + setState(876); + match(FALSE); + } + break; + case 3: + enterOuterAlt(_localctx, 3); + { + setState(877); + match(NIL_LIT); + } + break; + case 4: + enterOuterAlt(_localctx, 4); + { + setState(878); + integer(); + } + break; + case 5: + enterOuterAlt(_localctx, 5); + { + setState(879); + string_(); + } + break; + case 6: + enterOuterAlt(_localctx, 6); + { + setState(880); + match(FLOAT_LIT); + } + break; + case 7: + enterOuterAlt(_localctx, 7); + { + setState(881); + match(IMAGINARY_LIT); + } + break; + case 8: + enterOuterAlt(_localctx, 8); + { + setState(882); + match(RUNE_LIT); + } + break; + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class PrimaryExprContext extends ParserRuleContext { + public PrimaryExprContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_primaryExpr; } + + public PrimaryExprContext() { } + public void copyFrom(PrimaryExprContext ctx) { + super.copyFrom(ctx); + } + } + public static class NewExprContext extends PrimaryExprContext { + public New_Context new_() { + return getRuleContext(New_Context.class,0); + } + public NewExprContext(PrimaryExprContext ctx) { copyFrom(ctx); } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof GobraParserVisitor ) return ((GobraParserVisitor)visitor).visitNewExpr(this); + else return visitor.visitChildren(this); + } + } + public static class MakeExprContext extends PrimaryExprContext { + public MakeContext make() { + return getRuleContext(MakeContext.class,0); + } + public MakeExprContext(PrimaryExprContext ctx) { copyFrom(ctx); } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof GobraParserVisitor ) return ((GobraParserVisitor)visitor).visitMakeExpr(this); + else return visitor.visitChildren(this); + } + } + public static class GhostPrimaryExpr_Context extends PrimaryExprContext { + public GhostPrimaryExprContext ghostPrimaryExpr() { + return getRuleContext(GhostPrimaryExprContext.class,0); + } + public GhostPrimaryExpr_Context(PrimaryExprContext ctx) { copyFrom(ctx); } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof GobraParserVisitor ) return ((GobraParserVisitor)visitor).visitGhostPrimaryExpr_(this); + else return visitor.visitChildren(this); + } + } + public static class IndexPrimaryExprContext extends PrimaryExprContext { + public PrimaryExprContext primaryExpr() { + return getRuleContext(PrimaryExprContext.class,0); + } + public IndexContext index() { + return getRuleContext(IndexContext.class,0); + } + public IndexPrimaryExprContext(PrimaryExprContext ctx) { copyFrom(ctx); } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof GobraParserVisitor ) return ((GobraParserVisitor)visitor).visitIndexPrimaryExpr(this); + else return visitor.visitChildren(this); + } + } + public static class SeqUpdPrimaryExprContext extends PrimaryExprContext { + public PrimaryExprContext primaryExpr() { + return getRuleContext(PrimaryExprContext.class,0); + } + public SeqUpdExpContext seqUpdExp() { + return getRuleContext(SeqUpdExpContext.class,0); + } + public SeqUpdPrimaryExprContext(PrimaryExprContext ctx) { copyFrom(ctx); } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof GobraParserVisitor ) return ((GobraParserVisitor)visitor).visitSeqUpdPrimaryExpr(this); + else return visitor.visitChildren(this); + } + } + public static class MethodPrimaryExprContext extends PrimaryExprContext { + public MethodExprContext methodExpr() { + return getRuleContext(MethodExprContext.class,0); + } + public MethodPrimaryExprContext(PrimaryExprContext ctx) { copyFrom(ctx); } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof GobraParserVisitor ) return ((GobraParserVisitor)visitor).visitMethodPrimaryExpr(this); + else return visitor.visitChildren(this); + } + } + public static class PredConstrPrimaryExprContext extends PrimaryExprContext { + public PrimaryExprContext primaryExpr() { + return getRuleContext(PrimaryExprContext.class,0); + } + public PredConstructArgsContext predConstructArgs() { + return getRuleContext(PredConstructArgsContext.class,0); + } + public PredConstrPrimaryExprContext(PrimaryExprContext ctx) { copyFrom(ctx); } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof GobraParserVisitor ) return ((GobraParserVisitor)visitor).visitPredConstrPrimaryExpr(this); + else return visitor.visitChildren(this); + } + } + public static class InvokePrimaryExprContext extends PrimaryExprContext { + public PrimaryExprContext primaryExpr() { + return getRuleContext(PrimaryExprContext.class,0); + } + public ArgumentsContext arguments() { + return getRuleContext(ArgumentsContext.class,0); + } + public InvokePrimaryExprContext(PrimaryExprContext ctx) { copyFrom(ctx); } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof GobraParserVisitor ) return ((GobraParserVisitor)visitor).visitInvokePrimaryExpr(this); + else return visitor.visitChildren(this); + } + } + public static class OperandPrimaryExprContext extends PrimaryExprContext { + public OperandContext operand() { + return getRuleContext(OperandContext.class,0); + } + public OperandPrimaryExprContext(PrimaryExprContext ctx) { copyFrom(ctx); } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof GobraParserVisitor ) return ((GobraParserVisitor)visitor).visitOperandPrimaryExpr(this); + else return visitor.visitChildren(this); + } + } + public static class TypeAssertionPrimaryExprContext extends PrimaryExprContext { + public PrimaryExprContext primaryExpr() { + return getRuleContext(PrimaryExprContext.class,0); + } + public TypeAssertionContext typeAssertion() { + return getRuleContext(TypeAssertionContext.class,0); + } + public TypeAssertionPrimaryExprContext(PrimaryExprContext ctx) { copyFrom(ctx); } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof GobraParserVisitor ) return ((GobraParserVisitor)visitor).visitTypeAssertionPrimaryExpr(this); + else return visitor.visitChildren(this); + } + } + public static class BuiltInCallExprContext extends PrimaryExprContext { + public Token call_op; + public TerminalNode L_PAREN() { return getToken(GobraParser.L_PAREN, 0); } + public ExpressionContext expression() { + return getRuleContext(ExpressionContext.class,0); + } + public TerminalNode R_PAREN() { return getToken(GobraParser.R_PAREN, 0); } + public TerminalNode LEN() { return getToken(GobraParser.LEN, 0); } + public TerminalNode CAP() { return getToken(GobraParser.CAP, 0); } + public TerminalNode DOM() { return getToken(GobraParser.DOM, 0); } + public TerminalNode RANGE() { return getToken(GobraParser.RANGE, 0); } + public BuiltInCallExprContext(PrimaryExprContext ctx) { copyFrom(ctx); } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof GobraParserVisitor ) return ((GobraParserVisitor)visitor).visitBuiltInCallExpr(this); + else return visitor.visitChildren(this); + } + } + public static class SelectorPrimaryExprContext extends PrimaryExprContext { + public PrimaryExprContext primaryExpr() { + return getRuleContext(PrimaryExprContext.class,0); + } + public TerminalNode DOT() { return getToken(GobraParser.DOT, 0); } + public TerminalNode IDENTIFIER() { return getToken(GobraParser.IDENTIFIER, 0); } + public SelectorPrimaryExprContext(PrimaryExprContext ctx) { copyFrom(ctx); } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof GobraParserVisitor ) return ((GobraParserVisitor)visitor).visitSelectorPrimaryExpr(this); + else return visitor.visitChildren(this); + } + } + public static class ConversionPrimaryExprContext extends PrimaryExprContext { + public ConversionContext conversion() { + return getRuleContext(ConversionContext.class,0); + } + public ConversionPrimaryExprContext(PrimaryExprContext ctx) { copyFrom(ctx); } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof GobraParserVisitor ) return ((GobraParserVisitor)visitor).visitConversionPrimaryExpr(this); + else return visitor.visitChildren(this); + } + } + public static class SlicePrimaryExprContext extends PrimaryExprContext { + public PrimaryExprContext primaryExpr() { + return getRuleContext(PrimaryExprContext.class,0); + } + public Slice_Context slice_() { + return getRuleContext(Slice_Context.class,0); + } + public SlicePrimaryExprContext(PrimaryExprContext ctx) { copyFrom(ctx); } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof GobraParserVisitor ) return ((GobraParserVisitor)visitor).visitSlicePrimaryExpr(this); + else return visitor.visitChildren(this); + } + } + + public final PrimaryExprContext primaryExpr() throws RecognitionException { + return primaryExpr(0); + } + + private PrimaryExprContext primaryExpr(int _p) throws RecognitionException { + ParserRuleContext _parentctx = _ctx; + int _parentState = getState(); + PrimaryExprContext _localctx = new PrimaryExprContext(_ctx, _parentState); + PrimaryExprContext _prevctx = _localctx; + int _startState = 134; + enterRecursionRule(_localctx, 134, RULE_primaryExpr, _p); + int _la; + try { + int _alt; + enterOuterAlt(_localctx, 1); + { + setState(897); + _errHandler.sync(this); + switch ( getInterpreter().adaptivePredict(_input,62,_ctx) ) { + case 1: + { + _localctx = new OperandPrimaryExprContext(_localctx); + _ctx = _localctx; + _prevctx = _localctx; + + setState(886); + operand(); + } + break; + case 2: + { + _localctx = new ConversionPrimaryExprContext(_localctx); + _ctx = _localctx; + _prevctx = _localctx; + setState(887); + conversion(); + } + break; + case 3: + { + _localctx = new MethodPrimaryExprContext(_localctx); + _ctx = _localctx; + _prevctx = _localctx; + setState(888); + methodExpr(); + } + break; + case 4: + { + _localctx = new GhostPrimaryExpr_Context(_localctx); + _ctx = _localctx; + _prevctx = _localctx; + setState(889); + ghostPrimaryExpr(); + } + break; + case 5: + { + _localctx = new NewExprContext(_localctx); + _ctx = _localctx; + _prevctx = _localctx; + setState(890); + new_(); + } + break; + case 6: + { + _localctx = new MakeExprContext(_localctx); + _ctx = _localctx; + _prevctx = _localctx; + setState(891); + make(); + } + break; + case 7: + { + _localctx = new BuiltInCallExprContext(_localctx); + _ctx = _localctx; + _prevctx = _localctx; + setState(892); + ((BuiltInCallExprContext)_localctx).call_op = _input.LT(1); + _la = _input.LA(1); + if ( !(((((_la - 42)) & ~0x3f) == 0 && ((1L << (_la - 42)) & ((1L << (LEN - 42)) | (1L << (CAP - 42)) | (1L << (DOM - 42)) | (1L << (RANGE - 42)))) != 0)) ) { + ((BuiltInCallExprContext)_localctx).call_op = (Token)_errHandler.recoverInline(this); + } + else { + if ( _input.LA(1)==Token.EOF ) matchedEOF = true; + _errHandler.reportMatch(this); + consume(); + } + setState(893); + match(L_PAREN); + setState(894); + expression(0); + setState(895); + match(R_PAREN); + } + break; + } + _ctx.stop = _input.LT(-1); + setState(916); + _errHandler.sync(this); + _alt = getInterpreter().adaptivePredict(_input,64,_ctx); + while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) { + if ( _alt==1 ) { + if ( _parseListeners!=null ) triggerExitRuleEvent(); + _prevctx = _localctx; + { + setState(914); + _errHandler.sync(this); + switch ( getInterpreter().adaptivePredict(_input,63,_ctx) ) { + case 1: + { + _localctx = new SelectorPrimaryExprContext(new PrimaryExprContext(_parentctx, _parentState)); + pushNewRecursionContext(_localctx, _startState, RULE_primaryExpr); + setState(899); + if (!(precpred(_ctx, 8))) throw new FailedPredicateException(this, "precpred(_ctx, 8)"); + setState(900); + match(DOT); + setState(901); + match(IDENTIFIER); + } + break; + case 2: + { + _localctx = new IndexPrimaryExprContext(new PrimaryExprContext(_parentctx, _parentState)); + pushNewRecursionContext(_localctx, _startState, RULE_primaryExpr); + setState(902); + if (!(precpred(_ctx, 7))) throw new FailedPredicateException(this, "precpred(_ctx, 7)"); + setState(903); + index(); + } + break; + case 3: + { + _localctx = new SlicePrimaryExprContext(new PrimaryExprContext(_parentctx, _parentState)); + pushNewRecursionContext(_localctx, _startState, RULE_primaryExpr); + setState(904); + if (!(precpred(_ctx, 6))) throw new FailedPredicateException(this, "precpred(_ctx, 6)"); + setState(905); + slice_(); + } + break; + case 4: + { + _localctx = new SeqUpdPrimaryExprContext(new PrimaryExprContext(_parentctx, _parentState)); + pushNewRecursionContext(_localctx, _startState, RULE_primaryExpr); + setState(906); + if (!(precpred(_ctx, 5))) throw new FailedPredicateException(this, "precpred(_ctx, 5)"); + setState(907); + seqUpdExp(); + } + break; + case 5: + { + _localctx = new TypeAssertionPrimaryExprContext(new PrimaryExprContext(_parentctx, _parentState)); + pushNewRecursionContext(_localctx, _startState, RULE_primaryExpr); + setState(908); + if (!(precpred(_ctx, 4))) throw new FailedPredicateException(this, "precpred(_ctx, 4)"); + setState(909); + typeAssertion(); + } + break; + case 6: + { + _localctx = new InvokePrimaryExprContext(new PrimaryExprContext(_parentctx, _parentState)); + pushNewRecursionContext(_localctx, _startState, RULE_primaryExpr); + setState(910); + if (!(precpred(_ctx, 3))) throw new FailedPredicateException(this, "precpred(_ctx, 3)"); + setState(911); + arguments(); + } + break; + case 7: + { + _localctx = new PredConstrPrimaryExprContext(new PrimaryExprContext(_parentctx, _parentState)); + pushNewRecursionContext(_localctx, _startState, RULE_primaryExpr); + setState(912); + if (!(precpred(_ctx, 2))) throw new FailedPredicateException(this, "precpred(_ctx, 2)"); + setState(913); + predConstructArgs(); + } + break; + } + } + } + setState(918); + _errHandler.sync(this); + _alt = getInterpreter().adaptivePredict(_input,64,_ctx); + } + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + unrollRecursionContexts(_parentctx); + } + return _localctx; + } + + public static class PredConstructArgsContext extends ParserRuleContext { + public TerminalNode L_PRED() { return getToken(GobraParser.L_PRED, 0); } + public TerminalNode R_PRED() { return getToken(GobraParser.R_PRED, 0); } + public ExpressionListContext expressionList() { + return getRuleContext(ExpressionListContext.class,0); + } + public TerminalNode COMMA() { return getToken(GobraParser.COMMA, 0); } + public PredConstructArgsContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_predConstructArgs; } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof GobraParserVisitor ) return ((GobraParserVisitor)visitor).visitPredConstructArgs(this); + else return visitor.visitChildren(this); + } + } + + public final PredConstructArgsContext predConstructArgs() throws RecognitionException { + PredConstructArgsContext _localctx = new PredConstructArgsContext(_ctx, getState()); + enterRule(_localctx, 136, RULE_predConstructArgs); + int _la; + try { + enterOuterAlt(_localctx, 1); + { + setState(919); + match(L_PRED); + setState(921); + _errHandler.sync(this); + _la = _input.LA(1); + if ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << FLOAT_LIT) | (1L << TRUE) | (1L << FALSE) | (1L << OLD) | (1L << FORALL) | (1L << EXISTS) | (1L << ACCESS) | (1L << UNFOLDING) | (1L << GHOST) | (1L << SEQ) | (1L << SET) | (1L << MSET) | (1L << DICT) | (1L << OPT) | (1L << LEN) | (1L << NEW) | (1L << MAKE) | (1L << CAP) | (1L << SOME) | (1L << GET) | (1L << DOM) | (1L << NONE) | (1L << PRED) | (1L << TYPE_OF) | (1L << IS_COMPARABLE) | (1L << WRITEPERM) | (1L << NOPERM))) != 0) || ((((_la - 65)) & ~0x3f) == 0 && ((1L << (_la - 65)) & ((1L << (FUNC - 65)) | (1L << (INTERFACE - 65)) | (1L << (MAP - 65)) | (1L << (STRUCT - 65)) | (1L << (CHAN - 65)) | (1L << (RANGE - 65)) | (1L << (TYPE - 65)) | (1L << (NIL_LIT - 65)) | (1L << (IDENTIFIER - 65)) | (1L << (L_PAREN - 65)) | (1L << (L_BRACKET - 65)) | (1L << (EXCLAMATION - 65)) | (1L << (PLUS - 65)) | (1L << (MINUS - 65)) | (1L << (CARET - 65)) | (1L << (STAR - 65)) | (1L << (AMPERSAND - 65)) | (1L << (RECEIVE - 65)) | (1L << (DECIMAL_LIT - 65)) | (1L << (BINARY_LIT - 65)) | (1L << (OCTAL_LIT - 65)))) != 0) || ((((_la - 129)) & ~0x3f) == 0 && ((1L << (_la - 129)) & ((1L << (HEX_LIT - 129)) | (1L << (IMAGINARY_LIT - 129)) | (1L << (RUNE_LIT - 129)) | (1L << (RAW_STRING_LIT - 129)) | (1L << (INTERPRETED_STRING_LIT - 129)))) != 0)) { + { + setState(920); + expressionList(); + } + } + + setState(924); + _errHandler.sync(this); + _la = _input.LA(1); + if (_la==COMMA) { + { + setState(923); + match(COMMA); + } + } + + setState(926); + match(R_PRED); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class InterfaceTypeContext extends ParserRuleContext { + public TerminalNode INTERFACE() { return getToken(GobraParser.INTERFACE, 0); } + public TerminalNode L_CURLY() { return getToken(GobraParser.L_CURLY, 0); } + public TerminalNode R_CURLY() { return getToken(GobraParser.R_CURLY, 0); } + public List eos() { + return getRuleContexts(EosContext.class); + } + public EosContext eos(int i) { + return getRuleContext(EosContext.class,i); + } + public List methodSpec() { + return getRuleContexts(MethodSpecContext.class); + } + public MethodSpecContext methodSpec(int i) { + return getRuleContext(MethodSpecContext.class,i); + } + public List typeName() { + return getRuleContexts(TypeNameContext.class); + } + public TypeNameContext typeName(int i) { + return getRuleContext(TypeNameContext.class,i); + } + public List predicateSpec() { + return getRuleContexts(PredicateSpecContext.class); + } + public PredicateSpecContext predicateSpec(int i) { + return getRuleContext(PredicateSpecContext.class,i); + } + public InterfaceTypeContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_interfaceType; } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof GobraParserVisitor ) return ((GobraParserVisitor)visitor).visitInterfaceType(this); + else return visitor.visitChildren(this); + } + } + + public final InterfaceTypeContext interfaceType() throws RecognitionException { + InterfaceTypeContext _localctx = new InterfaceTypeContext(_ctx, getState()); + enterRule(_localctx, 138, RULE_interfaceType); + int _la; + try { + enterOuterAlt(_localctx, 1); + { + setState(928); + match(INTERFACE); + setState(929); + match(L_CURLY); + setState(939); + _errHandler.sync(this); + _la = _input.LA(1); + while ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << PRE) | (1L << PRESERVES) | (1L << POST) | (1L << DEC) | (1L << PURE) | (1L << GHOST) | (1L << PRED) | (1L << TRUSTED))) != 0) || _la==IDENTIFIER) { + { + { + setState(933); + _errHandler.sync(this); + switch ( getInterpreter().adaptivePredict(_input,67,_ctx) ) { + case 1: + { + setState(930); + methodSpec(); + } + break; + case 2: + { + setState(931); + typeName(); + } + break; + case 3: + { + setState(932); + predicateSpec(); + } + break; + } + setState(935); + eos(); + } + } + setState(941); + _errHandler.sync(this); + _la = _input.LA(1); + } + setState(942); + match(R_CURLY); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class PredicateSpecContext extends ParserRuleContext { + public TerminalNode PRED() { return getToken(GobraParser.PRED, 0); } + public TerminalNode IDENTIFIER() { return getToken(GobraParser.IDENTIFIER, 0); } + public ParametersContext parameters() { + return getRuleContext(ParametersContext.class,0); + } + public PredicateSpecContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_predicateSpec; } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof GobraParserVisitor ) return ((GobraParserVisitor)visitor).visitPredicateSpec(this); + else return visitor.visitChildren(this); + } + } + + public final PredicateSpecContext predicateSpec() throws RecognitionException { + PredicateSpecContext _localctx = new PredicateSpecContext(_ctx, getState()); + enterRule(_localctx, 140, RULE_predicateSpec); + try { + enterOuterAlt(_localctx, 1); + { + setState(944); + match(PRED); + setState(945); + match(IDENTIFIER); + setState(946); + parameters(); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class MethodSpecContext extends ParserRuleContext { + public SpecificationContext specification() { + return getRuleContext(SpecificationContext.class,0); + } + public TerminalNode IDENTIFIER() { return getToken(GobraParser.IDENTIFIER, 0); } + public ParametersContext parameters() { + return getRuleContext(ParametersContext.class,0); + } + public ResultContext result() { + return getRuleContext(ResultContext.class,0); + } + public TerminalNode GHOST() { return getToken(GobraParser.GHOST, 0); } + public MethodSpecContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_methodSpec; } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof GobraParserVisitor ) return ((GobraParserVisitor)visitor).visitMethodSpec(this); + else return visitor.visitChildren(this); + } + } + + public final MethodSpecContext methodSpec() throws RecognitionException { + MethodSpecContext _localctx = new MethodSpecContext(_ctx, getState()); + enterRule(_localctx, 142, RULE_methodSpec); + int _la; + try { + setState(963); + _errHandler.sync(this); + switch ( getInterpreter().adaptivePredict(_input,71,_ctx) ) { + case 1: + enterOuterAlt(_localctx, 1); + { + setState(949); + _errHandler.sync(this); + _la = _input.LA(1); + if (_la==GHOST) { + { + setState(948); + match(GHOST); + } + } + + setState(951); + specification(); + setState(952); + match(IDENTIFIER); + setState(953); + parameters(); + setState(954); + result(); + } + break; + case 2: + enterOuterAlt(_localctx, 2); + { + setState(957); + _errHandler.sync(this); + _la = _input.LA(1); + if (_la==GHOST) { + { + setState(956); + match(GHOST); + } + } + + setState(959); + specification(); + setState(960); + match(IDENTIFIER); + setState(961); + parameters(); + } + break; + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class Type_Context extends ParserRuleContext { + public TypeNameContext typeName() { + return getRuleContext(TypeNameContext.class,0); + } + public TypeLitContext typeLit() { + return getRuleContext(TypeLitContext.class,0); + } + public GhostTypeLitContext ghostTypeLit() { + return getRuleContext(GhostTypeLitContext.class,0); + } + public TerminalNode L_PAREN() { return getToken(GobraParser.L_PAREN, 0); } + public Type_Context type_() { + return getRuleContext(Type_Context.class,0); + } + public TerminalNode R_PAREN() { return getToken(GobraParser.R_PAREN, 0); } + public Type_Context(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_type_; } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof GobraParserVisitor ) return ((GobraParserVisitor)visitor).visitType_(this); + else return visitor.visitChildren(this); + } + } + + public final Type_Context type_() throws RecognitionException { + Type_Context _localctx = new Type_Context(_ctx, getState()); + enterRule(_localctx, 144, RULE_type_); + try { + setState(972); + _errHandler.sync(this); + switch (_input.LA(1)) { + case IDENTIFIER: + enterOuterAlt(_localctx, 1); + { + setState(965); + typeName(); + } + break; + case PRED: + case FUNC: + case INTERFACE: + case MAP: + case STRUCT: + case CHAN: + case L_BRACKET: + case STAR: + case RECEIVE: + enterOuterAlt(_localctx, 2); + { + setState(966); + typeLit(); + } + break; + case GHOST: + case SEQ: + case SET: + case MSET: + case DICT: + case OPT: + case DOM: + enterOuterAlt(_localctx, 3); + { + setState(967); + ghostTypeLit(); + } + break; + case L_PAREN: + enterOuterAlt(_localctx, 4); + { + setState(968); + match(L_PAREN); + setState(969); + type_(); + setState(970); + match(R_PAREN); + } + break; + default: + throw new NoViableAltException(this); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class TypeLitContext extends ParserRuleContext { + public ArrayTypeContext arrayType() { + return getRuleContext(ArrayTypeContext.class,0); + } + public StructTypeContext structType() { + return getRuleContext(StructTypeContext.class,0); + } + public PointerTypeContext pointerType() { + return getRuleContext(PointerTypeContext.class,0); + } + public FunctionTypeContext functionType() { + return getRuleContext(FunctionTypeContext.class,0); + } + public InterfaceTypeContext interfaceType() { + return getRuleContext(InterfaceTypeContext.class,0); + } + public SliceTypeContext sliceType() { + return getRuleContext(SliceTypeContext.class,0); + } + public MapTypeContext mapType() { + return getRuleContext(MapTypeContext.class,0); + } + public ChannelTypeContext channelType() { + return getRuleContext(ChannelTypeContext.class,0); + } + public PredTypeContext predType() { + return getRuleContext(PredTypeContext.class,0); + } + public TypeLitContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_typeLit; } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof GobraParserVisitor ) return ((GobraParserVisitor)visitor).visitTypeLit(this); + else return visitor.visitChildren(this); + } + } + + public final TypeLitContext typeLit() throws RecognitionException { + TypeLitContext _localctx = new TypeLitContext(_ctx, getState()); + enterRule(_localctx, 146, RULE_typeLit); + try { + setState(983); + _errHandler.sync(this); + switch ( getInterpreter().adaptivePredict(_input,73,_ctx) ) { + case 1: + enterOuterAlt(_localctx, 1); + { + setState(974); + arrayType(); + } + break; + case 2: + enterOuterAlt(_localctx, 2); + { + setState(975); + structType(); + } + break; + case 3: + enterOuterAlt(_localctx, 3); + { + setState(976); + pointerType(); + } + break; + case 4: + enterOuterAlt(_localctx, 4); + { + setState(977); + functionType(); + } + break; + case 5: + enterOuterAlt(_localctx, 5); + { + setState(978); + interfaceType(); + } + break; + case 6: + enterOuterAlt(_localctx, 6); + { + setState(979); + sliceType(); + } + break; + case 7: + enterOuterAlt(_localctx, 7); + { + setState(980); + mapType(); + } + break; + case 8: + enterOuterAlt(_localctx, 8); + { + setState(981); + channelType(); + } + break; + case 9: + enterOuterAlt(_localctx, 9); + { + setState(982); + predType(); + } + break; + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class PredTypeContext extends ParserRuleContext { + public TerminalNode PRED() { return getToken(GobraParser.PRED, 0); } + public PredTypeParamsContext predTypeParams() { + return getRuleContext(PredTypeParamsContext.class,0); + } + public PredTypeContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_predType; } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof GobraParserVisitor ) return ((GobraParserVisitor)visitor).visitPredType(this); + else return visitor.visitChildren(this); + } + } + + public final PredTypeContext predType() throws RecognitionException { + PredTypeContext _localctx = new PredTypeContext(_ctx, getState()); + enterRule(_localctx, 148, RULE_predType); + try { + enterOuterAlt(_localctx, 1); + { + setState(985); + match(PRED); + setState(986); + predTypeParams(); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class PredTypeParamsContext extends ParserRuleContext { + public TerminalNode L_PAREN() { return getToken(GobraParser.L_PAREN, 0); } + public TerminalNode R_PAREN() { return getToken(GobraParser.R_PAREN, 0); } + public List type_() { + return getRuleContexts(Type_Context.class); + } + public Type_Context type_(int i) { + return getRuleContext(Type_Context.class,i); + } + public List COMMA() { return getTokens(GobraParser.COMMA); } + public TerminalNode COMMA(int i) { + return getToken(GobraParser.COMMA, i); + } + public PredTypeParamsContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_predTypeParams; } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof GobraParserVisitor ) return ((GobraParserVisitor)visitor).visitPredTypeParams(this); + else return visitor.visitChildren(this); + } + } + + public final PredTypeParamsContext predTypeParams() throws RecognitionException { + PredTypeParamsContext _localctx = new PredTypeParamsContext(_ctx, getState()); + enterRule(_localctx, 150, RULE_predTypeParams); + int _la; + try { + int _alt; + enterOuterAlt(_localctx, 1); + { + setState(988); + match(L_PAREN); + setState(1000); + _errHandler.sync(this); + _la = _input.LA(1); + if ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << GHOST) | (1L << SEQ) | (1L << SET) | (1L << MSET) | (1L << DICT) | (1L << OPT) | (1L << DOM) | (1L << PRED))) != 0) || ((((_la - 65)) & ~0x3f) == 0 && ((1L << (_la - 65)) & ((1L << (FUNC - 65)) | (1L << (INTERFACE - 65)) | (1L << (MAP - 65)) | (1L << (STRUCT - 65)) | (1L << (CHAN - 65)) | (1L << (IDENTIFIER - 65)) | (1L << (L_PAREN - 65)) | (1L << (L_BRACKET - 65)) | (1L << (STAR - 65)) | (1L << (RECEIVE - 65)))) != 0)) { + { + setState(989); + type_(); + setState(994); + _errHandler.sync(this); + _alt = getInterpreter().adaptivePredict(_input,74,_ctx); + while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) { + if ( _alt==1 ) { + { + { + setState(990); + match(COMMA); + setState(991); + type_(); + } + } + } + setState(996); + _errHandler.sync(this); + _alt = getInterpreter().adaptivePredict(_input,74,_ctx); + } + setState(998); + _errHandler.sync(this); + _la = _input.LA(1); + if (_la==COMMA) { + { + setState(997); + match(COMMA); + } + } + + } + } + + setState(1002); + match(R_PAREN); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class LiteralTypeContext extends ParserRuleContext { + public StructTypeContext structType() { + return getRuleContext(StructTypeContext.class,0); + } + public ArrayTypeContext arrayType() { + return getRuleContext(ArrayTypeContext.class,0); + } + public ImplicitArrayContext implicitArray() { + return getRuleContext(ImplicitArrayContext.class,0); + } + public SliceTypeContext sliceType() { + return getRuleContext(SliceTypeContext.class,0); + } + public MapTypeContext mapType() { + return getRuleContext(MapTypeContext.class,0); + } + public GhostTypeLitContext ghostTypeLit() { + return getRuleContext(GhostTypeLitContext.class,0); + } + public TypeNameContext typeName() { + return getRuleContext(TypeNameContext.class,0); + } + public LiteralTypeContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_literalType; } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof GobraParserVisitor ) return ((GobraParserVisitor)visitor).visitLiteralType(this); + else return visitor.visitChildren(this); + } + } + + public final LiteralTypeContext literalType() throws RecognitionException { + LiteralTypeContext _localctx = new LiteralTypeContext(_ctx, getState()); + enterRule(_localctx, 152, RULE_literalType); + try { + setState(1011); + _errHandler.sync(this); + switch ( getInterpreter().adaptivePredict(_input,77,_ctx) ) { + case 1: + enterOuterAlt(_localctx, 1); + { + setState(1004); + structType(); + } + break; + case 2: + enterOuterAlt(_localctx, 2); + { + setState(1005); + arrayType(); + } + break; + case 3: + enterOuterAlt(_localctx, 3); + { + setState(1006); + implicitArray(); + } + break; + case 4: + enterOuterAlt(_localctx, 4); + { + setState(1007); + sliceType(); + } + break; + case 5: + enterOuterAlt(_localctx, 5); + { + setState(1008); + mapType(); + } + break; + case 6: + enterOuterAlt(_localctx, 6); + { + setState(1009); + ghostTypeLit(); + } + break; + case 7: + enterOuterAlt(_localctx, 7); + { + setState(1010); + typeName(); + } + break; + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class ImplicitArrayContext extends ParserRuleContext { + public TerminalNode L_BRACKET() { return getToken(GobraParser.L_BRACKET, 0); } + public TerminalNode ELLIPSIS() { return getToken(GobraParser.ELLIPSIS, 0); } + public TerminalNode R_BRACKET() { return getToken(GobraParser.R_BRACKET, 0); } + public ElementTypeContext elementType() { + return getRuleContext(ElementTypeContext.class,0); + } + public ImplicitArrayContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_implicitArray; } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof GobraParserVisitor ) return ((GobraParserVisitor)visitor).visitImplicitArray(this); + else return visitor.visitChildren(this); + } + } + + public final ImplicitArrayContext implicitArray() throws RecognitionException { + ImplicitArrayContext _localctx = new ImplicitArrayContext(_ctx, getState()); + enterRule(_localctx, 154, RULE_implicitArray); + try { + enterOuterAlt(_localctx, 1); + { + setState(1013); + match(L_BRACKET); + setState(1014); + match(ELLIPSIS); + setState(1015); + match(R_BRACKET); + setState(1016); + elementType(); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class Slice_Context extends ParserRuleContext { + public TerminalNode L_BRACKET() { return getToken(GobraParser.L_BRACKET, 0); } + public TerminalNode R_BRACKET() { return getToken(GobraParser.R_BRACKET, 0); } + public List COLON() { return getTokens(GobraParser.COLON); } + public TerminalNode COLON(int i) { + return getToken(GobraParser.COLON, i); + } + public HighContext high() { + return getRuleContext(HighContext.class,0); + } + public CapContext cap() { + return getRuleContext(CapContext.class,0); + } + public LowContext low() { + return getRuleContext(LowContext.class,0); + } + public Slice_Context(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_slice_; } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof GobraParserVisitor ) return ((GobraParserVisitor)visitor).visitSlice_(this); + else return visitor.visitChildren(this); + } + } + + public final Slice_Context slice_() throws RecognitionException { + Slice_Context _localctx = new Slice_Context(_ctx, getState()); + enterRule(_localctx, 156, RULE_slice_); + int _la; + try { + enterOuterAlt(_localctx, 1); + { + setState(1018); + match(L_BRACKET); + setState(1034); + _errHandler.sync(this); + switch ( getInterpreter().adaptivePredict(_input,81,_ctx) ) { + case 1: + { + setState(1020); + _errHandler.sync(this); + _la = _input.LA(1); + if ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << FLOAT_LIT) | (1L << TRUE) | (1L << FALSE) | (1L << OLD) | (1L << FORALL) | (1L << EXISTS) | (1L << ACCESS) | (1L << UNFOLDING) | (1L << GHOST) | (1L << SEQ) | (1L << SET) | (1L << MSET) | (1L << DICT) | (1L << OPT) | (1L << LEN) | (1L << NEW) | (1L << MAKE) | (1L << CAP) | (1L << SOME) | (1L << GET) | (1L << DOM) | (1L << NONE) | (1L << PRED) | (1L << TYPE_OF) | (1L << IS_COMPARABLE) | (1L << WRITEPERM) | (1L << NOPERM))) != 0) || ((((_la - 65)) & ~0x3f) == 0 && ((1L << (_la - 65)) & ((1L << (FUNC - 65)) | (1L << (INTERFACE - 65)) | (1L << (MAP - 65)) | (1L << (STRUCT - 65)) | (1L << (CHAN - 65)) | (1L << (RANGE - 65)) | (1L << (TYPE - 65)) | (1L << (NIL_LIT - 65)) | (1L << (IDENTIFIER - 65)) | (1L << (L_PAREN - 65)) | (1L << (L_BRACKET - 65)) | (1L << (EXCLAMATION - 65)) | (1L << (PLUS - 65)) | (1L << (MINUS - 65)) | (1L << (CARET - 65)) | (1L << (STAR - 65)) | (1L << (AMPERSAND - 65)) | (1L << (RECEIVE - 65)) | (1L << (DECIMAL_LIT - 65)) | (1L << (BINARY_LIT - 65)) | (1L << (OCTAL_LIT - 65)))) != 0) || ((((_la - 129)) & ~0x3f) == 0 && ((1L << (_la - 129)) & ((1L << (HEX_LIT - 129)) | (1L << (IMAGINARY_LIT - 129)) | (1L << (RUNE_LIT - 129)) | (1L << (RAW_STRING_LIT - 129)) | (1L << (INTERPRETED_STRING_LIT - 129)))) != 0)) { + { + setState(1019); + low(); + } + } + + setState(1022); + match(COLON); + setState(1024); + _errHandler.sync(this); + _la = _input.LA(1); + if ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << FLOAT_LIT) | (1L << TRUE) | (1L << FALSE) | (1L << OLD) | (1L << FORALL) | (1L << EXISTS) | (1L << ACCESS) | (1L << UNFOLDING) | (1L << GHOST) | (1L << SEQ) | (1L << SET) | (1L << MSET) | (1L << DICT) | (1L << OPT) | (1L << LEN) | (1L << NEW) | (1L << MAKE) | (1L << CAP) | (1L << SOME) | (1L << GET) | (1L << DOM) | (1L << NONE) | (1L << PRED) | (1L << TYPE_OF) | (1L << IS_COMPARABLE) | (1L << WRITEPERM) | (1L << NOPERM))) != 0) || ((((_la - 65)) & ~0x3f) == 0 && ((1L << (_la - 65)) & ((1L << (FUNC - 65)) | (1L << (INTERFACE - 65)) | (1L << (MAP - 65)) | (1L << (STRUCT - 65)) | (1L << (CHAN - 65)) | (1L << (RANGE - 65)) | (1L << (TYPE - 65)) | (1L << (NIL_LIT - 65)) | (1L << (IDENTIFIER - 65)) | (1L << (L_PAREN - 65)) | (1L << (L_BRACKET - 65)) | (1L << (EXCLAMATION - 65)) | (1L << (PLUS - 65)) | (1L << (MINUS - 65)) | (1L << (CARET - 65)) | (1L << (STAR - 65)) | (1L << (AMPERSAND - 65)) | (1L << (RECEIVE - 65)) | (1L << (DECIMAL_LIT - 65)) | (1L << (BINARY_LIT - 65)) | (1L << (OCTAL_LIT - 65)))) != 0) || ((((_la - 129)) & ~0x3f) == 0 && ((1L << (_la - 129)) & ((1L << (HEX_LIT - 129)) | (1L << (IMAGINARY_LIT - 129)) | (1L << (RUNE_LIT - 129)) | (1L << (RAW_STRING_LIT - 129)) | (1L << (INTERPRETED_STRING_LIT - 129)))) != 0)) { + { + setState(1023); + high(); + } + } + + } + break; + case 2: + { + setState(1027); + _errHandler.sync(this); + _la = _input.LA(1); + if ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << FLOAT_LIT) | (1L << TRUE) | (1L << FALSE) | (1L << OLD) | (1L << FORALL) | (1L << EXISTS) | (1L << ACCESS) | (1L << UNFOLDING) | (1L << GHOST) | (1L << SEQ) | (1L << SET) | (1L << MSET) | (1L << DICT) | (1L << OPT) | (1L << LEN) | (1L << NEW) | (1L << MAKE) | (1L << CAP) | (1L << SOME) | (1L << GET) | (1L << DOM) | (1L << NONE) | (1L << PRED) | (1L << TYPE_OF) | (1L << IS_COMPARABLE) | (1L << WRITEPERM) | (1L << NOPERM))) != 0) || ((((_la - 65)) & ~0x3f) == 0 && ((1L << (_la - 65)) & ((1L << (FUNC - 65)) | (1L << (INTERFACE - 65)) | (1L << (MAP - 65)) | (1L << (STRUCT - 65)) | (1L << (CHAN - 65)) | (1L << (RANGE - 65)) | (1L << (TYPE - 65)) | (1L << (NIL_LIT - 65)) | (1L << (IDENTIFIER - 65)) | (1L << (L_PAREN - 65)) | (1L << (L_BRACKET - 65)) | (1L << (EXCLAMATION - 65)) | (1L << (PLUS - 65)) | (1L << (MINUS - 65)) | (1L << (CARET - 65)) | (1L << (STAR - 65)) | (1L << (AMPERSAND - 65)) | (1L << (RECEIVE - 65)) | (1L << (DECIMAL_LIT - 65)) | (1L << (BINARY_LIT - 65)) | (1L << (OCTAL_LIT - 65)))) != 0) || ((((_la - 129)) & ~0x3f) == 0 && ((1L << (_la - 129)) & ((1L << (HEX_LIT - 129)) | (1L << (IMAGINARY_LIT - 129)) | (1L << (RUNE_LIT - 129)) | (1L << (RAW_STRING_LIT - 129)) | (1L << (INTERPRETED_STRING_LIT - 129)))) != 0)) { + { + setState(1026); + low(); + } + } + + setState(1029); + match(COLON); + setState(1030); + high(); + setState(1031); + match(COLON); + setState(1032); + cap(); + } + break; + } + setState(1036); + match(R_BRACKET); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class LowContext extends ParserRuleContext { + public ExpressionContext expression() { + return getRuleContext(ExpressionContext.class,0); + } + public LowContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_low; } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof GobraParserVisitor ) return ((GobraParserVisitor)visitor).visitLow(this); + else return visitor.visitChildren(this); + } + } + + public final LowContext low() throws RecognitionException { + LowContext _localctx = new LowContext(_ctx, getState()); + enterRule(_localctx, 158, RULE_low); + try { + enterOuterAlt(_localctx, 1); + { + setState(1038); + expression(0); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class HighContext extends ParserRuleContext { + public ExpressionContext expression() { + return getRuleContext(ExpressionContext.class,0); + } + public HighContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_high; } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof GobraParserVisitor ) return ((GobraParserVisitor)visitor).visitHigh(this); + else return visitor.visitChildren(this); + } + } + + public final HighContext high() throws RecognitionException { + HighContext _localctx = new HighContext(_ctx, getState()); + enterRule(_localctx, 160, RULE_high); + try { + enterOuterAlt(_localctx, 1); + { + setState(1040); + expression(0); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class CapContext extends ParserRuleContext { + public ExpressionContext expression() { + return getRuleContext(ExpressionContext.class,0); + } + public CapContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_cap; } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof GobraParserVisitor ) return ((GobraParserVisitor)visitor).visitCap(this); + else return visitor.visitChildren(this); + } + } + + public final CapContext cap() throws RecognitionException { + CapContext _localctx = new CapContext(_ctx, getState()); + enterRule(_localctx, 162, RULE_cap); + try { + enterOuterAlt(_localctx, 1); + { + setState(1042); + expression(0); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class Assign_opContext extends ParserRuleContext { + public Token ass_op; + public TerminalNode ASSIGN() { return getToken(GobraParser.ASSIGN, 0); } + public TerminalNode PLUS() { return getToken(GobraParser.PLUS, 0); } + public TerminalNode MINUS() { return getToken(GobraParser.MINUS, 0); } + public TerminalNode OR() { return getToken(GobraParser.OR, 0); } + public TerminalNode CARET() { return getToken(GobraParser.CARET, 0); } + public TerminalNode STAR() { return getToken(GobraParser.STAR, 0); } + public TerminalNode DIV() { return getToken(GobraParser.DIV, 0); } + public TerminalNode MOD() { return getToken(GobraParser.MOD, 0); } + public TerminalNode LSHIFT() { return getToken(GobraParser.LSHIFT, 0); } + public TerminalNode RSHIFT() { return getToken(GobraParser.RSHIFT, 0); } + public TerminalNode AMPERSAND() { return getToken(GobraParser.AMPERSAND, 0); } + public TerminalNode BIT_CLEAR() { return getToken(GobraParser.BIT_CLEAR, 0); } + public Assign_opContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_assign_op; } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof GobraParserVisitor ) return ((GobraParserVisitor)visitor).visitAssign_op(this); + else return visitor.visitChildren(this); + } + } + + public final Assign_opContext assign_op() throws RecognitionException { + Assign_opContext _localctx = new Assign_opContext(_ctx, getState()); + enterRule(_localctx, 164, RULE_assign_op); + int _la; + try { + enterOuterAlt(_localctx, 1); + { + setState(1045); + _errHandler.sync(this); + _la = _input.LA(1); + if (((((_la - 113)) & ~0x3f) == 0 && ((1L << (_la - 113)) & ((1L << (OR - 113)) | (1L << (DIV - 113)) | (1L << (MOD - 113)) | (1L << (LSHIFT - 113)) | (1L << (RSHIFT - 113)) | (1L << (BIT_CLEAR - 113)) | (1L << (PLUS - 113)) | (1L << (MINUS - 113)) | (1L << (CARET - 113)) | (1L << (STAR - 113)) | (1L << (AMPERSAND - 113)))) != 0)) { + { + setState(1044); + ((Assign_opContext)_localctx).ass_op = _input.LT(1); + _la = _input.LA(1); + if ( !(((((_la - 113)) & ~0x3f) == 0 && ((1L << (_la - 113)) & ((1L << (OR - 113)) | (1L << (DIV - 113)) | (1L << (MOD - 113)) | (1L << (LSHIFT - 113)) | (1L << (RSHIFT - 113)) | (1L << (BIT_CLEAR - 113)) | (1L << (PLUS - 113)) | (1L << (MINUS - 113)) | (1L << (CARET - 113)) | (1L << (STAR - 113)) | (1L << (AMPERSAND - 113)))) != 0)) ) { + ((Assign_opContext)_localctx).ass_op = (Token)_errHandler.recoverInline(this); + } + else { + if ( _input.LA(1)==Token.EOF ) matchedEOF = true; + _errHandler.reportMatch(this); + consume(); + } + } + } + + setState(1047); + match(ASSIGN); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class PackageClauseContext extends ParserRuleContext { + public Token packageName; + public TerminalNode PACKAGE() { return getToken(GobraParser.PACKAGE, 0); } + public TerminalNode IDENTIFIER() { return getToken(GobraParser.IDENTIFIER, 0); } + public PackageClauseContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_packageClause; } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof GobraParserVisitor ) return ((GobraParserVisitor)visitor).visitPackageClause(this); + else return visitor.visitChildren(this); + } + } + + public final PackageClauseContext packageClause() throws RecognitionException { + PackageClauseContext _localctx = new PackageClauseContext(_ctx, getState()); + enterRule(_localctx, 166, RULE_packageClause); + try { + enterOuterAlt(_localctx, 1); + { + setState(1049); + match(PACKAGE); + setState(1050); + ((PackageClauseContext)_localctx).packageName = match(IDENTIFIER); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class ImportDeclContext extends ParserRuleContext { + public TerminalNode IMPORT() { return getToken(GobraParser.IMPORT, 0); } + public List importSpec() { + return getRuleContexts(ImportSpecContext.class); + } + public ImportSpecContext importSpec(int i) { + return getRuleContext(ImportSpecContext.class,i); + } + public TerminalNode L_PAREN() { return getToken(GobraParser.L_PAREN, 0); } + public TerminalNode R_PAREN() { return getToken(GobraParser.R_PAREN, 0); } + public List eos() { + return getRuleContexts(EosContext.class); + } + public EosContext eos(int i) { + return getRuleContext(EosContext.class,i); + } + public ImportDeclContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_importDecl; } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof GobraParserVisitor ) return ((GobraParserVisitor)visitor).visitImportDecl(this); + else return visitor.visitChildren(this); + } + } + + public final ImportDeclContext importDecl() throws RecognitionException { + ImportDeclContext _localctx = new ImportDeclContext(_ctx, getState()); + enterRule(_localctx, 168, RULE_importDecl); + int _la; + try { + enterOuterAlt(_localctx, 1); + { + setState(1052); + match(IMPORT); + setState(1064); + _errHandler.sync(this); + switch (_input.LA(1)) { + case IDENTIFIER: + case DOT: + case RAW_STRING_LIT: + case INTERPRETED_STRING_LIT: + { + setState(1053); + importSpec(); + } + break; + case L_PAREN: + { + setState(1054); + match(L_PAREN); + setState(1060); + _errHandler.sync(this); + _la = _input.LA(1); + while (((((_la - 89)) & ~0x3f) == 0 && ((1L << (_la - 89)) & ((1L << (IDENTIFIER - 89)) | (1L << (DOT - 89)) | (1L << (RAW_STRING_LIT - 89)) | (1L << (INTERPRETED_STRING_LIT - 89)))) != 0)) { + { + { + setState(1055); + importSpec(); + setState(1056); + eos(); + } + } + setState(1062); + _errHandler.sync(this); + _la = _input.LA(1); + } + setState(1063); + match(R_PAREN); + } + break; + default: + throw new NoViableAltException(this); + } + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class ImportSpecContext extends ParserRuleContext { + public Token alias; + public ImportPathContext importPath() { + return getRuleContext(ImportPathContext.class,0); + } + public TerminalNode DOT() { return getToken(GobraParser.DOT, 0); } + public TerminalNode IDENTIFIER() { return getToken(GobraParser.IDENTIFIER, 0); } + public ImportSpecContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_importSpec; } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof GobraParserVisitor ) return ((GobraParserVisitor)visitor).visitImportSpec(this); + else return visitor.visitChildren(this); + } + } + + public final ImportSpecContext importSpec() throws RecognitionException { + ImportSpecContext _localctx = new ImportSpecContext(_ctx, getState()); + enterRule(_localctx, 170, RULE_importSpec); + int _la; + try { + enterOuterAlt(_localctx, 1); + { + setState(1067); + _errHandler.sync(this); + _la = _input.LA(1); + if (_la==IDENTIFIER || _la==DOT) { + { + setState(1066); + ((ImportSpecContext)_localctx).alias = _input.LT(1); + _la = _input.LA(1); + if ( !(_la==IDENTIFIER || _la==DOT) ) { + ((ImportSpecContext)_localctx).alias = (Token)_errHandler.recoverInline(this); + } + else { + if ( _input.LA(1)==Token.EOF ) matchedEOF = true; + _errHandler.reportMatch(this); + consume(); + } + } + } + + setState(1069); + importPath(); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class ImportPathContext extends ParserRuleContext { + public String_Context string_() { + return getRuleContext(String_Context.class,0); + } + public ImportPathContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_importPath; } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof GobraParserVisitor ) return ((GobraParserVisitor)visitor).visitImportPath(this); + else return visitor.visitChildren(this); + } + } + + public final ImportPathContext importPath() throws RecognitionException { + ImportPathContext _localctx = new ImportPathContext(_ctx, getState()); + enterRule(_localctx, 172, RULE_importPath); + try { + enterOuterAlt(_localctx, 1); + { + setState(1071); + string_(); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class DeclarationContext extends ParserRuleContext { + public ConstDeclContext constDecl() { + return getRuleContext(ConstDeclContext.class,0); + } + public TypeDeclContext typeDecl() { + return getRuleContext(TypeDeclContext.class,0); + } + public VarDeclContext varDecl() { + return getRuleContext(VarDeclContext.class,0); + } + public DeclarationContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_declaration; } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof GobraParserVisitor ) return ((GobraParserVisitor)visitor).visitDeclaration(this); + else return visitor.visitChildren(this); + } + } + + public final DeclarationContext declaration() throws RecognitionException { + DeclarationContext _localctx = new DeclarationContext(_ctx, getState()); + enterRule(_localctx, 174, RULE_declaration); + try { + setState(1076); + _errHandler.sync(this); + switch (_input.LA(1)) { + case CONST: + enterOuterAlt(_localctx, 1); + { + setState(1073); + constDecl(); + } + break; + case TYPE: + enterOuterAlt(_localctx, 2); + { + setState(1074); + typeDecl(); + } + break; + case VAR: + enterOuterAlt(_localctx, 3); + { + setState(1075); + varDecl(); + } + break; + default: + throw new NoViableAltException(this); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class ConstDeclContext extends ParserRuleContext { + public TerminalNode CONST() { return getToken(GobraParser.CONST, 0); } + public List constSpec() { + return getRuleContexts(ConstSpecContext.class); + } + public ConstSpecContext constSpec(int i) { + return getRuleContext(ConstSpecContext.class,i); + } + public TerminalNode L_PAREN() { return getToken(GobraParser.L_PAREN, 0); } + public TerminalNode R_PAREN() { return getToken(GobraParser.R_PAREN, 0); } + public List eos() { + return getRuleContexts(EosContext.class); + } + public EosContext eos(int i) { + return getRuleContext(EosContext.class,i); + } + public ConstDeclContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_constDecl; } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof GobraParserVisitor ) return ((GobraParserVisitor)visitor).visitConstDecl(this); + else return visitor.visitChildren(this); + } + } + + public final ConstDeclContext constDecl() throws RecognitionException { + ConstDeclContext _localctx = new ConstDeclContext(_ctx, getState()); + enterRule(_localctx, 176, RULE_constDecl); + int _la; + try { + enterOuterAlt(_localctx, 1); + { + setState(1078); + match(CONST); + setState(1090); + _errHandler.sync(this); + switch (_input.LA(1)) { + case IDENTIFIER: + { + setState(1079); + constSpec(); + } + break; + case L_PAREN: + { + setState(1080); + match(L_PAREN); + setState(1086); + _errHandler.sync(this); + _la = _input.LA(1); + while (_la==IDENTIFIER) { + { + { + setState(1081); + constSpec(); + setState(1082); + eos(); + } + } + setState(1088); + _errHandler.sync(this); + _la = _input.LA(1); + } + setState(1089); + match(R_PAREN); + } + break; + default: + throw new NoViableAltException(this); + } + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class ConstSpecContext extends ParserRuleContext { + public IdentifierListContext identifierList() { + return getRuleContext(IdentifierListContext.class,0); + } + public TerminalNode ASSIGN() { return getToken(GobraParser.ASSIGN, 0); } + public ExpressionListContext expressionList() { + return getRuleContext(ExpressionListContext.class,0); + } + public Type_Context type_() { + return getRuleContext(Type_Context.class,0); + } + public ConstSpecContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_constSpec; } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof GobraParserVisitor ) return ((GobraParserVisitor)visitor).visitConstSpec(this); + else return visitor.visitChildren(this); + } + } + + public final ConstSpecContext constSpec() throws RecognitionException { + ConstSpecContext _localctx = new ConstSpecContext(_ctx, getState()); + enterRule(_localctx, 178, RULE_constSpec); + int _la; + try { + enterOuterAlt(_localctx, 1); + { + setState(1092); + identifierList(); + setState(1098); + _errHandler.sync(this); + switch ( getInterpreter().adaptivePredict(_input,90,_ctx) ) { + case 1: + { + setState(1094); + _errHandler.sync(this); + _la = _input.LA(1); + if ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << GHOST) | (1L << SEQ) | (1L << SET) | (1L << MSET) | (1L << DICT) | (1L << OPT) | (1L << DOM) | (1L << PRED))) != 0) || ((((_la - 65)) & ~0x3f) == 0 && ((1L << (_la - 65)) & ((1L << (FUNC - 65)) | (1L << (INTERFACE - 65)) | (1L << (MAP - 65)) | (1L << (STRUCT - 65)) | (1L << (CHAN - 65)) | (1L << (IDENTIFIER - 65)) | (1L << (L_PAREN - 65)) | (1L << (L_BRACKET - 65)) | (1L << (STAR - 65)) | (1L << (RECEIVE - 65)))) != 0)) { + { + setState(1093); + type_(); + } + } + + setState(1096); + match(ASSIGN); + setState(1097); + expressionList(); + } + break; + } + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class IdentifierListContext extends ParserRuleContext { + public List IDENTIFIER() { return getTokens(GobraParser.IDENTIFIER); } + public TerminalNode IDENTIFIER(int i) { + return getToken(GobraParser.IDENTIFIER, i); + } + public List COMMA() { return getTokens(GobraParser.COMMA); } + public TerminalNode COMMA(int i) { + return getToken(GobraParser.COMMA, i); + } + public IdentifierListContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_identifierList; } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof GobraParserVisitor ) return ((GobraParserVisitor)visitor).visitIdentifierList(this); + else return visitor.visitChildren(this); + } + } + + public final IdentifierListContext identifierList() throws RecognitionException { + IdentifierListContext _localctx = new IdentifierListContext(_ctx, getState()); + enterRule(_localctx, 180, RULE_identifierList); + try { + int _alt; + enterOuterAlt(_localctx, 1); + { + setState(1100); + match(IDENTIFIER); + setState(1105); + _errHandler.sync(this); + _alt = getInterpreter().adaptivePredict(_input,91,_ctx); + while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) { + if ( _alt==1 ) { + { + { + setState(1101); + match(COMMA); + setState(1102); + match(IDENTIFIER); + } + } + } + setState(1107); + _errHandler.sync(this); + _alt = getInterpreter().adaptivePredict(_input,91,_ctx); + } + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class ExpressionListContext extends ParserRuleContext { + public List expression() { + return getRuleContexts(ExpressionContext.class); + } + public ExpressionContext expression(int i) { + return getRuleContext(ExpressionContext.class,i); + } + public List COMMA() { return getTokens(GobraParser.COMMA); } + public TerminalNode COMMA(int i) { + return getToken(GobraParser.COMMA, i); + } + public ExpressionListContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_expressionList; } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof GobraParserVisitor ) return ((GobraParserVisitor)visitor).visitExpressionList(this); + else return visitor.visitChildren(this); + } + } + + public final ExpressionListContext expressionList() throws RecognitionException { + ExpressionListContext _localctx = new ExpressionListContext(_ctx, getState()); + enterRule(_localctx, 182, RULE_expressionList); + try { + int _alt; + enterOuterAlt(_localctx, 1); + { + setState(1108); + expression(0); + setState(1113); + _errHandler.sync(this); + _alt = getInterpreter().adaptivePredict(_input,92,_ctx); + while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) { + if ( _alt==1 ) { + { + { + setState(1109); + match(COMMA); + setState(1110); + expression(0); + } + } + } + setState(1115); + _errHandler.sync(this); + _alt = getInterpreter().adaptivePredict(_input,92,_ctx); + } + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class TypeDeclContext extends ParserRuleContext { + public TerminalNode TYPE() { return getToken(GobraParser.TYPE, 0); } + public List typeSpec() { + return getRuleContexts(TypeSpecContext.class); + } + public TypeSpecContext typeSpec(int i) { + return getRuleContext(TypeSpecContext.class,i); + } + public TerminalNode L_PAREN() { return getToken(GobraParser.L_PAREN, 0); } + public TerminalNode R_PAREN() { return getToken(GobraParser.R_PAREN, 0); } + public List eos() { + return getRuleContexts(EosContext.class); + } + public EosContext eos(int i) { + return getRuleContext(EosContext.class,i); + } + public TypeDeclContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_typeDecl; } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof GobraParserVisitor ) return ((GobraParserVisitor)visitor).visitTypeDecl(this); + else return visitor.visitChildren(this); + } + } + + public final TypeDeclContext typeDecl() throws RecognitionException { + TypeDeclContext _localctx = new TypeDeclContext(_ctx, getState()); + enterRule(_localctx, 184, RULE_typeDecl); + int _la; + try { + enterOuterAlt(_localctx, 1); + { + setState(1116); + match(TYPE); + setState(1128); + _errHandler.sync(this); + switch (_input.LA(1)) { + case IDENTIFIER: + { + setState(1117); + typeSpec(); + } + break; + case L_PAREN: + { + setState(1118); + match(L_PAREN); + setState(1124); + _errHandler.sync(this); + _la = _input.LA(1); + while (_la==IDENTIFIER) { + { + { + setState(1119); + typeSpec(); + setState(1120); + eos(); + } + } + setState(1126); + _errHandler.sync(this); + _la = _input.LA(1); + } + setState(1127); + match(R_PAREN); + } + break; + default: + throw new NoViableAltException(this); + } + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class TypeSpecContext extends ParserRuleContext { + public TerminalNode IDENTIFIER() { return getToken(GobraParser.IDENTIFIER, 0); } + public Type_Context type_() { + return getRuleContext(Type_Context.class,0); + } + public TerminalNode ASSIGN() { return getToken(GobraParser.ASSIGN, 0); } + public TypeSpecContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_typeSpec; } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof GobraParserVisitor ) return ((GobraParserVisitor)visitor).visitTypeSpec(this); + else return visitor.visitChildren(this); + } + } + + public final TypeSpecContext typeSpec() throws RecognitionException { + TypeSpecContext _localctx = new TypeSpecContext(_ctx, getState()); + enterRule(_localctx, 186, RULE_typeSpec); + int _la; + try { + enterOuterAlt(_localctx, 1); + { + setState(1130); + match(IDENTIFIER); + setState(1132); + _errHandler.sync(this); + _la = _input.LA(1); + if (_la==ASSIGN) { + { + setState(1131); + match(ASSIGN); + } + } + + setState(1134); + type_(); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class VarDeclContext extends ParserRuleContext { + public TerminalNode VAR() { return getToken(GobraParser.VAR, 0); } + public List varSpec() { + return getRuleContexts(VarSpecContext.class); + } + public VarSpecContext varSpec(int i) { + return getRuleContext(VarSpecContext.class,i); + } + public TerminalNode L_PAREN() { return getToken(GobraParser.L_PAREN, 0); } + public TerminalNode R_PAREN() { return getToken(GobraParser.R_PAREN, 0); } + public List eos() { + return getRuleContexts(EosContext.class); + } + public EosContext eos(int i) { + return getRuleContext(EosContext.class,i); + } + public VarDeclContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_varDecl; } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof GobraParserVisitor ) return ((GobraParserVisitor)visitor).visitVarDecl(this); + else return visitor.visitChildren(this); + } + } + + public final VarDeclContext varDecl() throws RecognitionException { + VarDeclContext _localctx = new VarDeclContext(_ctx, getState()); + enterRule(_localctx, 188, RULE_varDecl); + int _la; + try { + enterOuterAlt(_localctx, 1); + { + setState(1136); + match(VAR); + setState(1148); + _errHandler.sync(this); + switch (_input.LA(1)) { + case IDENTIFIER: + { + setState(1137); + varSpec(); + } + break; + case L_PAREN: + { + setState(1138); + match(L_PAREN); + setState(1144); + _errHandler.sync(this); + _la = _input.LA(1); + while (_la==IDENTIFIER) { + { + { + setState(1139); + varSpec(); + setState(1140); + eos(); + } + } + setState(1146); + _errHandler.sync(this); + _la = _input.LA(1); + } + setState(1147); + match(R_PAREN); + } + break; + default: + throw new NoViableAltException(this); + } + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class BlockContext extends ParserRuleContext { + public TerminalNode L_CURLY() { return getToken(GobraParser.L_CURLY, 0); } + public TerminalNode R_CURLY() { return getToken(GobraParser.R_CURLY, 0); } + public StatementListContext statementList() { + return getRuleContext(StatementListContext.class,0); + } + public BlockContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_block; } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof GobraParserVisitor ) return ((GobraParserVisitor)visitor).visitBlock(this); + else return visitor.visitChildren(this); + } + } + + public final BlockContext block() throws RecognitionException { + BlockContext _localctx = new BlockContext(_ctx, getState()); + enterRule(_localctx, 190, RULE_block); + try { + enterOuterAlt(_localctx, 1); + { + setState(1150); + match(L_CURLY); + setState(1152); + _errHandler.sync(this); + switch ( getInterpreter().adaptivePredict(_input,98,_ctx) ) { + case 1: + { + setState(1151); + statementList(); + } + break; + } + setState(1154); + match(R_CURLY); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class StatementListContext extends ParserRuleContext { + public List statement() { + return getRuleContexts(StatementContext.class); + } + public StatementContext statement(int i) { + return getRuleContext(StatementContext.class,i); + } + public List eos() { + return getRuleContexts(EosContext.class); + } + public EosContext eos(int i) { + return getRuleContext(EosContext.class,i); + } + public StatementListContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_statementList; } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof GobraParserVisitor ) return ((GobraParserVisitor)visitor).visitStatementList(this); + else return visitor.visitChildren(this); + } + } + + public final StatementListContext statementList() throws RecognitionException { + StatementListContext _localctx = new StatementListContext(_ctx, getState()); + enterRule(_localctx, 192, RULE_statementList); + try { + int _alt; + enterOuterAlt(_localctx, 1); + { + setState(1162); + _errHandler.sync(this); + _alt = 1; + do { + switch (_alt) { + case 1: + { + { + setState(1157); + _errHandler.sync(this); + switch ( getInterpreter().adaptivePredict(_input,99,_ctx) ) { + case 1: + { + setState(1156); + eos(); + } + break; + } + setState(1159); + statement(); + setState(1160); + eos(); + } + } + break; + default: + throw new NoViableAltException(this); + } + setState(1164); + _errHandler.sync(this); + _alt = getInterpreter().adaptivePredict(_input,100,_ctx); + } while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class SimpleStmtContext extends ParserRuleContext { + public SendStmtContext sendStmt() { + return getRuleContext(SendStmtContext.class,0); + } + public IncDecStmtContext incDecStmt() { + return getRuleContext(IncDecStmtContext.class,0); + } + public AssignmentContext assignment() { + return getRuleContext(AssignmentContext.class,0); + } + public ExpressionStmtContext expressionStmt() { + return getRuleContext(ExpressionStmtContext.class,0); + } + public ShortVarDeclContext shortVarDecl() { + return getRuleContext(ShortVarDeclContext.class,0); + } + public SimpleStmtContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_simpleStmt; } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof GobraParserVisitor ) return ((GobraParserVisitor)visitor).visitSimpleStmt(this); + else return visitor.visitChildren(this); + } + } + + public final SimpleStmtContext simpleStmt() throws RecognitionException { + SimpleStmtContext _localctx = new SimpleStmtContext(_ctx, getState()); + enterRule(_localctx, 194, RULE_simpleStmt); + try { + setState(1171); + _errHandler.sync(this); + switch ( getInterpreter().adaptivePredict(_input,101,_ctx) ) { + case 1: + enterOuterAlt(_localctx, 1); + { + setState(1166); + sendStmt(); + } + break; + case 2: + enterOuterAlt(_localctx, 2); + { + setState(1167); + incDecStmt(); + } + break; + case 3: + enterOuterAlt(_localctx, 3); + { + setState(1168); + assignment(); + } + break; + case 4: + enterOuterAlt(_localctx, 4); + { + setState(1169); + expressionStmt(); + } + break; + case 5: + enterOuterAlt(_localctx, 5); + { + setState(1170); + shortVarDecl(); + } + break; + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class ExpressionStmtContext extends ParserRuleContext { + public ExpressionContext expression() { + return getRuleContext(ExpressionContext.class,0); + } + public ExpressionStmtContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_expressionStmt; } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof GobraParserVisitor ) return ((GobraParserVisitor)visitor).visitExpressionStmt(this); + else return visitor.visitChildren(this); + } + } + + public final ExpressionStmtContext expressionStmt() throws RecognitionException { + ExpressionStmtContext _localctx = new ExpressionStmtContext(_ctx, getState()); + enterRule(_localctx, 196, RULE_expressionStmt); + try { + enterOuterAlt(_localctx, 1); + { + setState(1173); + expression(0); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class SendStmtContext extends ParserRuleContext { + public ExpressionContext channel; + public TerminalNode RECEIVE() { return getToken(GobraParser.RECEIVE, 0); } + public List expression() { + return getRuleContexts(ExpressionContext.class); + } + public ExpressionContext expression(int i) { + return getRuleContext(ExpressionContext.class,i); + } + public SendStmtContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_sendStmt; } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof GobraParserVisitor ) return ((GobraParserVisitor)visitor).visitSendStmt(this); + else return visitor.visitChildren(this); + } + } + + public final SendStmtContext sendStmt() throws RecognitionException { + SendStmtContext _localctx = new SendStmtContext(_ctx, getState()); + enterRule(_localctx, 198, RULE_sendStmt); + try { + enterOuterAlt(_localctx, 1); + { + setState(1175); + ((SendStmtContext)_localctx).channel = expression(0); + setState(1176); + match(RECEIVE); + setState(1177); + expression(0); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class IncDecStmtContext extends ParserRuleContext { + public ExpressionContext expression() { + return getRuleContext(ExpressionContext.class,0); + } + public TerminalNode PLUS_PLUS() { return getToken(GobraParser.PLUS_PLUS, 0); } + public TerminalNode MINUS_MINUS() { return getToken(GobraParser.MINUS_MINUS, 0); } + public IncDecStmtContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_incDecStmt; } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof GobraParserVisitor ) return ((GobraParserVisitor)visitor).visitIncDecStmt(this); + else return visitor.visitChildren(this); + } + } + + public final IncDecStmtContext incDecStmt() throws RecognitionException { + IncDecStmtContext _localctx = new IncDecStmtContext(_ctx, getState()); + enterRule(_localctx, 200, RULE_incDecStmt); + int _la; + try { + enterOuterAlt(_localctx, 1); + { + setState(1179); + expression(0); + setState(1180); + _la = _input.LA(1); + if ( !(_la==PLUS_PLUS || _la==MINUS_MINUS) ) { + _errHandler.recoverInline(this); + } + else { + if ( _input.LA(1)==Token.EOF ) matchedEOF = true; + _errHandler.reportMatch(this); + consume(); + } + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class AssignmentContext extends ParserRuleContext { + public List expressionList() { + return getRuleContexts(ExpressionListContext.class); + } + public ExpressionListContext expressionList(int i) { + return getRuleContext(ExpressionListContext.class,i); + } + public Assign_opContext assign_op() { + return getRuleContext(Assign_opContext.class,0); + } + public AssignmentContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_assignment; } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof GobraParserVisitor ) return ((GobraParserVisitor)visitor).visitAssignment(this); + else return visitor.visitChildren(this); + } + } + + public final AssignmentContext assignment() throws RecognitionException { + AssignmentContext _localctx = new AssignmentContext(_ctx, getState()); + enterRule(_localctx, 202, RULE_assignment); + try { + enterOuterAlt(_localctx, 1); + { + setState(1182); + expressionList(); + setState(1183); + assign_op(); + setState(1184); + expressionList(); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class EmptyStmtContext extends ParserRuleContext { + public TerminalNode EOS() { return getToken(GobraParser.EOS, 0); } + public TerminalNode SEMI() { return getToken(GobraParser.SEMI, 0); } + public EmptyStmtContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_emptyStmt; } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof GobraParserVisitor ) return ((GobraParserVisitor)visitor).visitEmptyStmt(this); + else return visitor.visitChildren(this); + } + } + + public final EmptyStmtContext emptyStmt() throws RecognitionException { + EmptyStmtContext _localctx = new EmptyStmtContext(_ctx, getState()); + enterRule(_localctx, 204, RULE_emptyStmt); + int _la; + try { + enterOuterAlt(_localctx, 1); + { + setState(1186); + _la = _input.LA(1); + if ( !(_la==SEMI || _la==EOS) ) { + _errHandler.recoverInline(this); + } + else { + if ( _input.LA(1)==Token.EOF ) matchedEOF = true; + _errHandler.reportMatch(this); + consume(); + } + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class LabeledStmtContext extends ParserRuleContext { + public TerminalNode IDENTIFIER() { return getToken(GobraParser.IDENTIFIER, 0); } + public TerminalNode COLON() { return getToken(GobraParser.COLON, 0); } + public StatementContext statement() { + return getRuleContext(StatementContext.class,0); + } + public LabeledStmtContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_labeledStmt; } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof GobraParserVisitor ) return ((GobraParserVisitor)visitor).visitLabeledStmt(this); + else return visitor.visitChildren(this); + } + } + + public final LabeledStmtContext labeledStmt() throws RecognitionException { + LabeledStmtContext _localctx = new LabeledStmtContext(_ctx, getState()); + enterRule(_localctx, 206, RULE_labeledStmt); + try { + enterOuterAlt(_localctx, 1); + { + setState(1188); + match(IDENTIFIER); + setState(1189); + match(COLON); + setState(1191); + _errHandler.sync(this); + switch ( getInterpreter().adaptivePredict(_input,102,_ctx) ) { + case 1: + { + setState(1190); + statement(); + } + break; + } + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class ReturnStmtContext extends ParserRuleContext { + public TerminalNode RETURN() { return getToken(GobraParser.RETURN, 0); } + public ExpressionListContext expressionList() { + return getRuleContext(ExpressionListContext.class,0); + } + public ReturnStmtContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_returnStmt; } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof GobraParserVisitor ) return ((GobraParserVisitor)visitor).visitReturnStmt(this); + else return visitor.visitChildren(this); + } + } + + public final ReturnStmtContext returnStmt() throws RecognitionException { + ReturnStmtContext _localctx = new ReturnStmtContext(_ctx, getState()); + enterRule(_localctx, 208, RULE_returnStmt); + try { + enterOuterAlt(_localctx, 1); + { + setState(1193); + match(RETURN); + setState(1195); + _errHandler.sync(this); + switch ( getInterpreter().adaptivePredict(_input,103,_ctx) ) { + case 1: + { + setState(1194); + expressionList(); + } + break; + } + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class BreakStmtContext extends ParserRuleContext { + public TerminalNode BREAK() { return getToken(GobraParser.BREAK, 0); } + public TerminalNode IDENTIFIER() { return getToken(GobraParser.IDENTIFIER, 0); } + public BreakStmtContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_breakStmt; } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof GobraParserVisitor ) return ((GobraParserVisitor)visitor).visitBreakStmt(this); + else return visitor.visitChildren(this); + } + } + + public final BreakStmtContext breakStmt() throws RecognitionException { + BreakStmtContext _localctx = new BreakStmtContext(_ctx, getState()); + enterRule(_localctx, 210, RULE_breakStmt); + try { + enterOuterAlt(_localctx, 1); + { + setState(1197); + match(BREAK); + setState(1199); + _errHandler.sync(this); + switch ( getInterpreter().adaptivePredict(_input,104,_ctx) ) { + case 1: + { + setState(1198); + match(IDENTIFIER); + } + break; + } + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class ContinueStmtContext extends ParserRuleContext { + public TerminalNode CONTINUE() { return getToken(GobraParser.CONTINUE, 0); } + public TerminalNode IDENTIFIER() { return getToken(GobraParser.IDENTIFIER, 0); } + public ContinueStmtContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_continueStmt; } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof GobraParserVisitor ) return ((GobraParserVisitor)visitor).visitContinueStmt(this); + else return visitor.visitChildren(this); + } + } + + public final ContinueStmtContext continueStmt() throws RecognitionException { + ContinueStmtContext _localctx = new ContinueStmtContext(_ctx, getState()); + enterRule(_localctx, 212, RULE_continueStmt); + try { + enterOuterAlt(_localctx, 1); + { + setState(1201); + match(CONTINUE); + setState(1203); + _errHandler.sync(this); + switch ( getInterpreter().adaptivePredict(_input,105,_ctx) ) { + case 1: + { + setState(1202); + match(IDENTIFIER); + } + break; + } + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class GotoStmtContext extends ParserRuleContext { + public TerminalNode GOTO() { return getToken(GobraParser.GOTO, 0); } + public TerminalNode IDENTIFIER() { return getToken(GobraParser.IDENTIFIER, 0); } + public GotoStmtContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_gotoStmt; } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof GobraParserVisitor ) return ((GobraParserVisitor)visitor).visitGotoStmt(this); + else return visitor.visitChildren(this); + } + } + + public final GotoStmtContext gotoStmt() throws RecognitionException { + GotoStmtContext _localctx = new GotoStmtContext(_ctx, getState()); + enterRule(_localctx, 214, RULE_gotoStmt); + try { + enterOuterAlt(_localctx, 1); + { + setState(1205); + match(GOTO); + setState(1206); + match(IDENTIFIER); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class FallthroughStmtContext extends ParserRuleContext { + public TerminalNode FALLTHROUGH() { return getToken(GobraParser.FALLTHROUGH, 0); } + public FallthroughStmtContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_fallthroughStmt; } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof GobraParserVisitor ) return ((GobraParserVisitor)visitor).visitFallthroughStmt(this); + else return visitor.visitChildren(this); + } + } + + public final FallthroughStmtContext fallthroughStmt() throws RecognitionException { + FallthroughStmtContext _localctx = new FallthroughStmtContext(_ctx, getState()); + enterRule(_localctx, 216, RULE_fallthroughStmt); + try { + enterOuterAlt(_localctx, 1); + { + setState(1208); + match(FALLTHROUGH); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class DeferStmtContext extends ParserRuleContext { + public TerminalNode DEFER() { return getToken(GobraParser.DEFER, 0); } + public ExpressionContext expression() { + return getRuleContext(ExpressionContext.class,0); + } + public DeferStmtContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_deferStmt; } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof GobraParserVisitor ) return ((GobraParserVisitor)visitor).visitDeferStmt(this); + else return visitor.visitChildren(this); + } + } + + public final DeferStmtContext deferStmt() throws RecognitionException { + DeferStmtContext _localctx = new DeferStmtContext(_ctx, getState()); + enterRule(_localctx, 218, RULE_deferStmt); + try { + enterOuterAlt(_localctx, 1); + { + setState(1210); + match(DEFER); + setState(1211); + expression(0); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class IfStmtContext extends ParserRuleContext { + public TerminalNode IF() { return getToken(GobraParser.IF, 0); } + public List block() { + return getRuleContexts(BlockContext.class); + } + public BlockContext block(int i) { + return getRuleContext(BlockContext.class,i); + } + public ExpressionContext expression() { + return getRuleContext(ExpressionContext.class,0); + } + public EosContext eos() { + return getRuleContext(EosContext.class,0); + } + public SimpleStmtContext simpleStmt() { + return getRuleContext(SimpleStmtContext.class,0); + } + public TerminalNode ELSE() { return getToken(GobraParser.ELSE, 0); } + public IfStmtContext ifStmt() { + return getRuleContext(IfStmtContext.class,0); + } + public IfStmtContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_ifStmt; } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof GobraParserVisitor ) return ((GobraParserVisitor)visitor).visitIfStmt(this); + else return visitor.visitChildren(this); + } + } + + public final IfStmtContext ifStmt() throws RecognitionException { + IfStmtContext _localctx = new IfStmtContext(_ctx, getState()); + enterRule(_localctx, 220, RULE_ifStmt); + try { + enterOuterAlt(_localctx, 1); + { + setState(1213); + match(IF); + setState(1222); + _errHandler.sync(this); + switch ( getInterpreter().adaptivePredict(_input,106,_ctx) ) { + case 1: + { + setState(1214); + expression(0); + } + break; + case 2: + { + setState(1215); + eos(); + setState(1216); + expression(0); + } + break; + case 3: + { + setState(1218); + simpleStmt(); + setState(1219); + eos(); + setState(1220); + expression(0); + } + break; + } + setState(1224); + block(); + setState(1230); + _errHandler.sync(this); + switch ( getInterpreter().adaptivePredict(_input,108,_ctx) ) { + case 1: + { + setState(1225); + match(ELSE); + setState(1228); + _errHandler.sync(this); + switch (_input.LA(1)) { + case IF: + { + setState(1226); + ifStmt(); + } + break; + case L_CURLY: + { + setState(1227); + block(); + } + break; + default: + throw new NoViableAltException(this); + } + } + break; + } + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class SwitchStmtContext extends ParserRuleContext { + public ExprSwitchStmtContext exprSwitchStmt() { + return getRuleContext(ExprSwitchStmtContext.class,0); + } + public TypeSwitchStmtContext typeSwitchStmt() { + return getRuleContext(TypeSwitchStmtContext.class,0); + } + public SwitchStmtContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_switchStmt; } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof GobraParserVisitor ) return ((GobraParserVisitor)visitor).visitSwitchStmt(this); + else return visitor.visitChildren(this); + } + } + + public final SwitchStmtContext switchStmt() throws RecognitionException { + SwitchStmtContext _localctx = new SwitchStmtContext(_ctx, getState()); + enterRule(_localctx, 222, RULE_switchStmt); + try { + setState(1234); + _errHandler.sync(this); + switch ( getInterpreter().adaptivePredict(_input,109,_ctx) ) { + case 1: + enterOuterAlt(_localctx, 1); + { + setState(1232); + exprSwitchStmt(); + } + break; + case 2: + enterOuterAlt(_localctx, 2); + { + setState(1233); + typeSwitchStmt(); + } + break; + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class ExprSwitchStmtContext extends ParserRuleContext { + public TerminalNode SWITCH() { return getToken(GobraParser.SWITCH, 0); } + public TerminalNode L_CURLY() { return getToken(GobraParser.L_CURLY, 0); } + public TerminalNode R_CURLY() { return getToken(GobraParser.R_CURLY, 0); } + public EosContext eos() { + return getRuleContext(EosContext.class,0); + } + public List exprCaseClause() { + return getRuleContexts(ExprCaseClauseContext.class); + } + public ExprCaseClauseContext exprCaseClause(int i) { + return getRuleContext(ExprCaseClauseContext.class,i); + } + public ExpressionContext expression() { + return getRuleContext(ExpressionContext.class,0); + } + public SimpleStmtContext simpleStmt() { + return getRuleContext(SimpleStmtContext.class,0); + } + public ExprSwitchStmtContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_exprSwitchStmt; } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof GobraParserVisitor ) return ((GobraParserVisitor)visitor).visitExprSwitchStmt(this); + else return visitor.visitChildren(this); + } + } + + public final ExprSwitchStmtContext exprSwitchStmt() throws RecognitionException { + ExprSwitchStmtContext _localctx = new ExprSwitchStmtContext(_ctx, getState()); + enterRule(_localctx, 224, RULE_exprSwitchStmt); + int _la; + try { + enterOuterAlt(_localctx, 1); + { + setState(1236); + match(SWITCH); + setState(1247); + _errHandler.sync(this); + switch ( getInterpreter().adaptivePredict(_input,113,_ctx) ) { + case 1: + { + setState(1238); + _errHandler.sync(this); + _la = _input.LA(1); + if ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << FLOAT_LIT) | (1L << TRUE) | (1L << FALSE) | (1L << OLD) | (1L << FORALL) | (1L << EXISTS) | (1L << ACCESS) | (1L << UNFOLDING) | (1L << GHOST) | (1L << SEQ) | (1L << SET) | (1L << MSET) | (1L << DICT) | (1L << OPT) | (1L << LEN) | (1L << NEW) | (1L << MAKE) | (1L << CAP) | (1L << SOME) | (1L << GET) | (1L << DOM) | (1L << NONE) | (1L << PRED) | (1L << TYPE_OF) | (1L << IS_COMPARABLE) | (1L << WRITEPERM) | (1L << NOPERM))) != 0) || ((((_la - 65)) & ~0x3f) == 0 && ((1L << (_la - 65)) & ((1L << (FUNC - 65)) | (1L << (INTERFACE - 65)) | (1L << (MAP - 65)) | (1L << (STRUCT - 65)) | (1L << (CHAN - 65)) | (1L << (RANGE - 65)) | (1L << (TYPE - 65)) | (1L << (NIL_LIT - 65)) | (1L << (IDENTIFIER - 65)) | (1L << (L_PAREN - 65)) | (1L << (L_BRACKET - 65)) | (1L << (EXCLAMATION - 65)) | (1L << (PLUS - 65)) | (1L << (MINUS - 65)) | (1L << (CARET - 65)) | (1L << (STAR - 65)) | (1L << (AMPERSAND - 65)) | (1L << (RECEIVE - 65)) | (1L << (DECIMAL_LIT - 65)) | (1L << (BINARY_LIT - 65)) | (1L << (OCTAL_LIT - 65)))) != 0) || ((((_la - 129)) & ~0x3f) == 0 && ((1L << (_la - 129)) & ((1L << (HEX_LIT - 129)) | (1L << (IMAGINARY_LIT - 129)) | (1L << (RUNE_LIT - 129)) | (1L << (RAW_STRING_LIT - 129)) | (1L << (INTERPRETED_STRING_LIT - 129)))) != 0)) { + { + setState(1237); + expression(0); + } + } + + } + break; + case 2: + { + setState(1241); + _errHandler.sync(this); + switch ( getInterpreter().adaptivePredict(_input,111,_ctx) ) { + case 1: + { + setState(1240); + simpleStmt(); + } + break; + } + setState(1243); + eos(); + setState(1245); + _errHandler.sync(this); + _la = _input.LA(1); + if ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << FLOAT_LIT) | (1L << TRUE) | (1L << FALSE) | (1L << OLD) | (1L << FORALL) | (1L << EXISTS) | (1L << ACCESS) | (1L << UNFOLDING) | (1L << GHOST) | (1L << SEQ) | (1L << SET) | (1L << MSET) | (1L << DICT) | (1L << OPT) | (1L << LEN) | (1L << NEW) | (1L << MAKE) | (1L << CAP) | (1L << SOME) | (1L << GET) | (1L << DOM) | (1L << NONE) | (1L << PRED) | (1L << TYPE_OF) | (1L << IS_COMPARABLE) | (1L << WRITEPERM) | (1L << NOPERM))) != 0) || ((((_la - 65)) & ~0x3f) == 0 && ((1L << (_la - 65)) & ((1L << (FUNC - 65)) | (1L << (INTERFACE - 65)) | (1L << (MAP - 65)) | (1L << (STRUCT - 65)) | (1L << (CHAN - 65)) | (1L << (RANGE - 65)) | (1L << (TYPE - 65)) | (1L << (NIL_LIT - 65)) | (1L << (IDENTIFIER - 65)) | (1L << (L_PAREN - 65)) | (1L << (L_BRACKET - 65)) | (1L << (EXCLAMATION - 65)) | (1L << (PLUS - 65)) | (1L << (MINUS - 65)) | (1L << (CARET - 65)) | (1L << (STAR - 65)) | (1L << (AMPERSAND - 65)) | (1L << (RECEIVE - 65)) | (1L << (DECIMAL_LIT - 65)) | (1L << (BINARY_LIT - 65)) | (1L << (OCTAL_LIT - 65)))) != 0) || ((((_la - 129)) & ~0x3f) == 0 && ((1L << (_la - 129)) & ((1L << (HEX_LIT - 129)) | (1L << (IMAGINARY_LIT - 129)) | (1L << (RUNE_LIT - 129)) | (1L << (RAW_STRING_LIT - 129)) | (1L << (INTERPRETED_STRING_LIT - 129)))) != 0)) { + { + setState(1244); + expression(0); + } + } + + } + break; + } + setState(1249); + match(L_CURLY); + setState(1253); + _errHandler.sync(this); + _la = _input.LA(1); + while (_la==DEFAULT || _la==CASE) { + { + { + setState(1250); + exprCaseClause(); + } + } + setState(1255); + _errHandler.sync(this); + _la = _input.LA(1); + } + setState(1256); + match(R_CURLY); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class ExprCaseClauseContext extends ParserRuleContext { + public ExprSwitchCaseContext exprSwitchCase() { + return getRuleContext(ExprSwitchCaseContext.class,0); + } + public TerminalNode COLON() { return getToken(GobraParser.COLON, 0); } + public StatementListContext statementList() { + return getRuleContext(StatementListContext.class,0); + } + public ExprCaseClauseContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_exprCaseClause; } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof GobraParserVisitor ) return ((GobraParserVisitor)visitor).visitExprCaseClause(this); + else return visitor.visitChildren(this); + } + } + + public final ExprCaseClauseContext exprCaseClause() throws RecognitionException { + ExprCaseClauseContext _localctx = new ExprCaseClauseContext(_ctx, getState()); + enterRule(_localctx, 226, RULE_exprCaseClause); + try { + enterOuterAlt(_localctx, 1); + { + setState(1258); + exprSwitchCase(); + setState(1259); + match(COLON); + setState(1261); + _errHandler.sync(this); + switch ( getInterpreter().adaptivePredict(_input,115,_ctx) ) { + case 1: + { + setState(1260); + statementList(); + } + break; + } + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class ExprSwitchCaseContext extends ParserRuleContext { + public TerminalNode CASE() { return getToken(GobraParser.CASE, 0); } + public ExpressionListContext expressionList() { + return getRuleContext(ExpressionListContext.class,0); + } + public TerminalNode DEFAULT() { return getToken(GobraParser.DEFAULT, 0); } + public ExprSwitchCaseContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_exprSwitchCase; } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof GobraParserVisitor ) return ((GobraParserVisitor)visitor).visitExprSwitchCase(this); + else return visitor.visitChildren(this); + } + } + + public final ExprSwitchCaseContext exprSwitchCase() throws RecognitionException { + ExprSwitchCaseContext _localctx = new ExprSwitchCaseContext(_ctx, getState()); + enterRule(_localctx, 228, RULE_exprSwitchCase); + try { + setState(1266); + _errHandler.sync(this); + switch (_input.LA(1)) { + case CASE: + enterOuterAlt(_localctx, 1); + { + setState(1263); + match(CASE); + setState(1264); + expressionList(); + } + break; + case DEFAULT: + enterOuterAlt(_localctx, 2); + { + setState(1265); + match(DEFAULT); + } + break; + default: + throw new NoViableAltException(this); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class TypeSwitchStmtContext extends ParserRuleContext { + public TerminalNode SWITCH() { return getToken(GobraParser.SWITCH, 0); } + public TerminalNode L_CURLY() { return getToken(GobraParser.L_CURLY, 0); } + public TerminalNode R_CURLY() { return getToken(GobraParser.R_CURLY, 0); } + public TypeSwitchGuardContext typeSwitchGuard() { + return getRuleContext(TypeSwitchGuardContext.class,0); + } + public EosContext eos() { + return getRuleContext(EosContext.class,0); + } + public SimpleStmtContext simpleStmt() { + return getRuleContext(SimpleStmtContext.class,0); + } + public List typeCaseClause() { + return getRuleContexts(TypeCaseClauseContext.class); + } + public TypeCaseClauseContext typeCaseClause(int i) { + return getRuleContext(TypeCaseClauseContext.class,i); + } + public TypeSwitchStmtContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_typeSwitchStmt; } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof GobraParserVisitor ) return ((GobraParserVisitor)visitor).visitTypeSwitchStmt(this); + else return visitor.visitChildren(this); + } + } + + public final TypeSwitchStmtContext typeSwitchStmt() throws RecognitionException { + TypeSwitchStmtContext _localctx = new TypeSwitchStmtContext(_ctx, getState()); + enterRule(_localctx, 230, RULE_typeSwitchStmt); + int _la; + try { + enterOuterAlt(_localctx, 1); + { + setState(1268); + match(SWITCH); + setState(1277); + _errHandler.sync(this); + switch ( getInterpreter().adaptivePredict(_input,117,_ctx) ) { + case 1: + { + setState(1269); + typeSwitchGuard(); + } + break; + case 2: + { + setState(1270); + eos(); + setState(1271); + typeSwitchGuard(); + } + break; + case 3: + { + setState(1273); + simpleStmt(); + setState(1274); + eos(); + setState(1275); + typeSwitchGuard(); + } + break; + } + setState(1279); + match(L_CURLY); + setState(1283); + _errHandler.sync(this); + _la = _input.LA(1); + while (_la==DEFAULT || _la==CASE) { + { + { + setState(1280); + typeCaseClause(); + } + } + setState(1285); + _errHandler.sync(this); + _la = _input.LA(1); + } + setState(1286); + match(R_CURLY); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class TypeSwitchGuardContext extends ParserRuleContext { + public PrimaryExprContext primaryExpr() { + return getRuleContext(PrimaryExprContext.class,0); + } + public TerminalNode DOT() { return getToken(GobraParser.DOT, 0); } + public TerminalNode L_PAREN() { return getToken(GobraParser.L_PAREN, 0); } + public TerminalNode TYPE() { return getToken(GobraParser.TYPE, 0); } + public TerminalNode R_PAREN() { return getToken(GobraParser.R_PAREN, 0); } + public TerminalNode IDENTIFIER() { return getToken(GobraParser.IDENTIFIER, 0); } + public TerminalNode DECLARE_ASSIGN() { return getToken(GobraParser.DECLARE_ASSIGN, 0); } + public TypeSwitchGuardContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_typeSwitchGuard; } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof GobraParserVisitor ) return ((GobraParserVisitor)visitor).visitTypeSwitchGuard(this); + else return visitor.visitChildren(this); + } + } + + public final TypeSwitchGuardContext typeSwitchGuard() throws RecognitionException { + TypeSwitchGuardContext _localctx = new TypeSwitchGuardContext(_ctx, getState()); + enterRule(_localctx, 232, RULE_typeSwitchGuard); + try { + enterOuterAlt(_localctx, 1); + { + setState(1290); + _errHandler.sync(this); + switch ( getInterpreter().adaptivePredict(_input,119,_ctx) ) { + case 1: + { + setState(1288); + match(IDENTIFIER); + setState(1289); + match(DECLARE_ASSIGN); + } + break; + } + setState(1292); + primaryExpr(0); + setState(1293); + match(DOT); + setState(1294); + match(L_PAREN); + setState(1295); + match(TYPE); + setState(1296); + match(R_PAREN); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class TypeCaseClauseContext extends ParserRuleContext { + public TypeSwitchCaseContext typeSwitchCase() { + return getRuleContext(TypeSwitchCaseContext.class,0); + } + public TerminalNode COLON() { return getToken(GobraParser.COLON, 0); } + public StatementListContext statementList() { + return getRuleContext(StatementListContext.class,0); + } + public TypeCaseClauseContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_typeCaseClause; } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof GobraParserVisitor ) return ((GobraParserVisitor)visitor).visitTypeCaseClause(this); + else return visitor.visitChildren(this); + } + } + + public final TypeCaseClauseContext typeCaseClause() throws RecognitionException { + TypeCaseClauseContext _localctx = new TypeCaseClauseContext(_ctx, getState()); + enterRule(_localctx, 234, RULE_typeCaseClause); + try { + enterOuterAlt(_localctx, 1); + { + setState(1298); + typeSwitchCase(); + setState(1299); + match(COLON); + setState(1301); + _errHandler.sync(this); + switch ( getInterpreter().adaptivePredict(_input,120,_ctx) ) { + case 1: + { + setState(1300); + statementList(); + } + break; + } + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class TypeSwitchCaseContext extends ParserRuleContext { + public TerminalNode CASE() { return getToken(GobraParser.CASE, 0); } + public TypeListContext typeList() { + return getRuleContext(TypeListContext.class,0); + } + public TerminalNode DEFAULT() { return getToken(GobraParser.DEFAULT, 0); } + public TypeSwitchCaseContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_typeSwitchCase; } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof GobraParserVisitor ) return ((GobraParserVisitor)visitor).visitTypeSwitchCase(this); + else return visitor.visitChildren(this); + } + } + + public final TypeSwitchCaseContext typeSwitchCase() throws RecognitionException { + TypeSwitchCaseContext _localctx = new TypeSwitchCaseContext(_ctx, getState()); + enterRule(_localctx, 236, RULE_typeSwitchCase); + try { + setState(1306); + _errHandler.sync(this); + switch (_input.LA(1)) { + case CASE: + enterOuterAlt(_localctx, 1); + { + setState(1303); + match(CASE); + setState(1304); + typeList(); + } + break; + case DEFAULT: + enterOuterAlt(_localctx, 2); + { + setState(1305); + match(DEFAULT); + } + break; + default: + throw new NoViableAltException(this); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class TypeListContext extends ParserRuleContext { + public List type_() { + return getRuleContexts(Type_Context.class); + } + public Type_Context type_(int i) { + return getRuleContext(Type_Context.class,i); + } + public List NIL_LIT() { return getTokens(GobraParser.NIL_LIT); } + public TerminalNode NIL_LIT(int i) { + return getToken(GobraParser.NIL_LIT, i); + } + public List COMMA() { return getTokens(GobraParser.COMMA); } + public TerminalNode COMMA(int i) { + return getToken(GobraParser.COMMA, i); + } + public TypeListContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_typeList; } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof GobraParserVisitor ) return ((GobraParserVisitor)visitor).visitTypeList(this); + else return visitor.visitChildren(this); + } + } + + public final TypeListContext typeList() throws RecognitionException { + TypeListContext _localctx = new TypeListContext(_ctx, getState()); + enterRule(_localctx, 238, RULE_typeList); + int _la; + try { + enterOuterAlt(_localctx, 1); + { + setState(1310); + _errHandler.sync(this); + switch (_input.LA(1)) { + case GHOST: + case SEQ: + case SET: + case MSET: + case DICT: + case OPT: + case DOM: + case PRED: + case FUNC: + case INTERFACE: + case MAP: + case STRUCT: + case CHAN: + case IDENTIFIER: + case L_PAREN: + case L_BRACKET: + case STAR: + case RECEIVE: + { + setState(1308); + type_(); + } + break; + case NIL_LIT: + { + setState(1309); + match(NIL_LIT); + } + break; + default: + throw new NoViableAltException(this); + } + setState(1319); + _errHandler.sync(this); + _la = _input.LA(1); + while (_la==COMMA) { + { + { + setState(1312); + match(COMMA); + setState(1315); + _errHandler.sync(this); + switch (_input.LA(1)) { + case GHOST: + case SEQ: + case SET: + case MSET: + case DICT: + case OPT: + case DOM: + case PRED: + case FUNC: + case INTERFACE: + case MAP: + case STRUCT: + case CHAN: + case IDENTIFIER: + case L_PAREN: + case L_BRACKET: + case STAR: + case RECEIVE: + { + setState(1313); + type_(); + } + break; + case NIL_LIT: + { + setState(1314); + match(NIL_LIT); + } + break; + default: + throw new NoViableAltException(this); + } + } + } + setState(1321); + _errHandler.sync(this); + _la = _input.LA(1); + } + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class SelectStmtContext extends ParserRuleContext { + public TerminalNode SELECT() { return getToken(GobraParser.SELECT, 0); } + public TerminalNode L_CURLY() { return getToken(GobraParser.L_CURLY, 0); } + public TerminalNode R_CURLY() { return getToken(GobraParser.R_CURLY, 0); } + public List commClause() { + return getRuleContexts(CommClauseContext.class); + } + public CommClauseContext commClause(int i) { + return getRuleContext(CommClauseContext.class,i); + } + public SelectStmtContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_selectStmt; } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof GobraParserVisitor ) return ((GobraParserVisitor)visitor).visitSelectStmt(this); + else return visitor.visitChildren(this); + } + } + + public final SelectStmtContext selectStmt() throws RecognitionException { + SelectStmtContext _localctx = new SelectStmtContext(_ctx, getState()); + enterRule(_localctx, 240, RULE_selectStmt); + int _la; + try { + enterOuterAlt(_localctx, 1); + { + setState(1322); + match(SELECT); + setState(1323); + match(L_CURLY); + setState(1327); + _errHandler.sync(this); + _la = _input.LA(1); + while (_la==DEFAULT || _la==CASE) { + { + { + setState(1324); + commClause(); + } + } + setState(1329); + _errHandler.sync(this); + _la = _input.LA(1); + } + setState(1330); + match(R_CURLY); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class CommClauseContext extends ParserRuleContext { + public CommCaseContext commCase() { + return getRuleContext(CommCaseContext.class,0); + } + public TerminalNode COLON() { return getToken(GobraParser.COLON, 0); } + public StatementListContext statementList() { + return getRuleContext(StatementListContext.class,0); + } + public CommClauseContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_commClause; } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof GobraParserVisitor ) return ((GobraParserVisitor)visitor).visitCommClause(this); + else return visitor.visitChildren(this); + } + } + + public final CommClauseContext commClause() throws RecognitionException { + CommClauseContext _localctx = new CommClauseContext(_ctx, getState()); + enterRule(_localctx, 242, RULE_commClause); + try { + enterOuterAlt(_localctx, 1); + { + setState(1332); + commCase(); + setState(1333); + match(COLON); + setState(1335); + _errHandler.sync(this); + switch ( getInterpreter().adaptivePredict(_input,126,_ctx) ) { + case 1: + { + setState(1334); + statementList(); + } + break; + } + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class CommCaseContext extends ParserRuleContext { + public TerminalNode CASE() { return getToken(GobraParser.CASE, 0); } + public SendStmtContext sendStmt() { + return getRuleContext(SendStmtContext.class,0); + } + public RecvStmtContext recvStmt() { + return getRuleContext(RecvStmtContext.class,0); + } + public TerminalNode DEFAULT() { return getToken(GobraParser.DEFAULT, 0); } + public CommCaseContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_commCase; } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof GobraParserVisitor ) return ((GobraParserVisitor)visitor).visitCommCase(this); + else return visitor.visitChildren(this); + } + } + + public final CommCaseContext commCase() throws RecognitionException { + CommCaseContext _localctx = new CommCaseContext(_ctx, getState()); + enterRule(_localctx, 244, RULE_commCase); + try { + setState(1343); + _errHandler.sync(this); + switch (_input.LA(1)) { + case CASE: + enterOuterAlt(_localctx, 1); + { + setState(1337); + match(CASE); + setState(1340); + _errHandler.sync(this); + switch ( getInterpreter().adaptivePredict(_input,127,_ctx) ) { + case 1: + { + setState(1338); + sendStmt(); + } + break; + case 2: + { + setState(1339); + recvStmt(); + } + break; + } + } + break; + case DEFAULT: + enterOuterAlt(_localctx, 2); + { + setState(1342); + match(DEFAULT); + } + break; + default: + throw new NoViableAltException(this); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class RecvStmtContext extends ParserRuleContext { + public ExpressionContext recvExpr; + public ExpressionContext expression() { + return getRuleContext(ExpressionContext.class,0); + } + public ExpressionListContext expressionList() { + return getRuleContext(ExpressionListContext.class,0); + } + public TerminalNode ASSIGN() { return getToken(GobraParser.ASSIGN, 0); } + public IdentifierListContext identifierList() { + return getRuleContext(IdentifierListContext.class,0); + } + public TerminalNode DECLARE_ASSIGN() { return getToken(GobraParser.DECLARE_ASSIGN, 0); } + public RecvStmtContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_recvStmt; } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof GobraParserVisitor ) return ((GobraParserVisitor)visitor).visitRecvStmt(this); + else return visitor.visitChildren(this); + } + } + + public final RecvStmtContext recvStmt() throws RecognitionException { + RecvStmtContext _localctx = new RecvStmtContext(_ctx, getState()); + enterRule(_localctx, 246, RULE_recvStmt); + try { + enterOuterAlt(_localctx, 1); + { + setState(1351); + _errHandler.sync(this); + switch ( getInterpreter().adaptivePredict(_input,129,_ctx) ) { + case 1: + { + setState(1345); + expressionList(); + setState(1346); + match(ASSIGN); + } + break; + case 2: + { + setState(1348); + identifierList(); + setState(1349); + match(DECLARE_ASSIGN); + } + break; + } + setState(1353); + ((RecvStmtContext)_localctx).recvExpr = expression(0); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class ForStmtContext extends ParserRuleContext { + public TerminalNode FOR() { return getToken(GobraParser.FOR, 0); } + public BlockContext block() { + return getRuleContext(BlockContext.class,0); + } + public ExpressionContext expression() { + return getRuleContext(ExpressionContext.class,0); + } + public ForClauseContext forClause() { + return getRuleContext(ForClauseContext.class,0); + } + public RangeClauseContext rangeClause() { + return getRuleContext(RangeClauseContext.class,0); + } + public ForStmtContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_forStmt; } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof GobraParserVisitor ) return ((GobraParserVisitor)visitor).visitForStmt(this); + else return visitor.visitChildren(this); + } + } + + public final ForStmtContext forStmt() throws RecognitionException { + ForStmtContext _localctx = new ForStmtContext(_ctx, getState()); + enterRule(_localctx, 248, RULE_forStmt); + try { + enterOuterAlt(_localctx, 1); + { + setState(1355); + match(FOR); + setState(1359); + _errHandler.sync(this); + switch ( getInterpreter().adaptivePredict(_input,130,_ctx) ) { + case 1: + { + setState(1356); + expression(0); + } + break; + case 2: + { + setState(1357); + forClause(); + } + break; + case 3: + { + setState(1358); + rangeClause(); + } + break; + } + setState(1361); + block(); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class ForClauseContext extends ParserRuleContext { + public SimpleStmtContext initStmt; + public SimpleStmtContext postStmt; + public List eos() { + return getRuleContexts(EosContext.class); + } + public EosContext eos(int i) { + return getRuleContext(EosContext.class,i); + } + public ExpressionContext expression() { + return getRuleContext(ExpressionContext.class,0); + } + public List simpleStmt() { + return getRuleContexts(SimpleStmtContext.class); + } + public SimpleStmtContext simpleStmt(int i) { + return getRuleContext(SimpleStmtContext.class,i); + } + public ForClauseContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_forClause; } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof GobraParserVisitor ) return ((GobraParserVisitor)visitor).visitForClause(this); + else return visitor.visitChildren(this); + } + } + + public final ForClauseContext forClause() throws RecognitionException { + ForClauseContext _localctx = new ForClauseContext(_ctx, getState()); + enterRule(_localctx, 250, RULE_forClause); + int _la; + try { + enterOuterAlt(_localctx, 1); + { + setState(1364); + _errHandler.sync(this); + switch ( getInterpreter().adaptivePredict(_input,131,_ctx) ) { + case 1: + { + setState(1363); + ((ForClauseContext)_localctx).initStmt = simpleStmt(); + } + break; + } + setState(1366); + eos(); + setState(1368); + _errHandler.sync(this); + switch ( getInterpreter().adaptivePredict(_input,132,_ctx) ) { + case 1: + { + setState(1367); + expression(0); + } + break; + } + setState(1370); + eos(); + setState(1372); + _errHandler.sync(this); + _la = _input.LA(1); + if ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << FLOAT_LIT) | (1L << TRUE) | (1L << FALSE) | (1L << OLD) | (1L << FORALL) | (1L << EXISTS) | (1L << ACCESS) | (1L << UNFOLDING) | (1L << GHOST) | (1L << SEQ) | (1L << SET) | (1L << MSET) | (1L << DICT) | (1L << OPT) | (1L << LEN) | (1L << NEW) | (1L << MAKE) | (1L << CAP) | (1L << SOME) | (1L << GET) | (1L << DOM) | (1L << NONE) | (1L << PRED) | (1L << TYPE_OF) | (1L << IS_COMPARABLE) | (1L << WRITEPERM) | (1L << NOPERM))) != 0) || ((((_la - 65)) & ~0x3f) == 0 && ((1L << (_la - 65)) & ((1L << (FUNC - 65)) | (1L << (INTERFACE - 65)) | (1L << (MAP - 65)) | (1L << (STRUCT - 65)) | (1L << (CHAN - 65)) | (1L << (RANGE - 65)) | (1L << (TYPE - 65)) | (1L << (NIL_LIT - 65)) | (1L << (IDENTIFIER - 65)) | (1L << (L_PAREN - 65)) | (1L << (L_BRACKET - 65)) | (1L << (EXCLAMATION - 65)) | (1L << (PLUS - 65)) | (1L << (MINUS - 65)) | (1L << (CARET - 65)) | (1L << (STAR - 65)) | (1L << (AMPERSAND - 65)) | (1L << (RECEIVE - 65)) | (1L << (DECIMAL_LIT - 65)) | (1L << (BINARY_LIT - 65)) | (1L << (OCTAL_LIT - 65)))) != 0) || ((((_la - 129)) & ~0x3f) == 0 && ((1L << (_la - 129)) & ((1L << (HEX_LIT - 129)) | (1L << (IMAGINARY_LIT - 129)) | (1L << (RUNE_LIT - 129)) | (1L << (RAW_STRING_LIT - 129)) | (1L << (INTERPRETED_STRING_LIT - 129)))) != 0)) { + { + setState(1371); + ((ForClauseContext)_localctx).postStmt = simpleStmt(); + } + } + + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class RangeClauseContext extends ParserRuleContext { + public TerminalNode RANGE() { return getToken(GobraParser.RANGE, 0); } + public ExpressionContext expression() { + return getRuleContext(ExpressionContext.class,0); + } + public ExpressionListContext expressionList() { + return getRuleContext(ExpressionListContext.class,0); + } + public TerminalNode ASSIGN() { return getToken(GobraParser.ASSIGN, 0); } + public IdentifierListContext identifierList() { + return getRuleContext(IdentifierListContext.class,0); + } + public TerminalNode DECLARE_ASSIGN() { return getToken(GobraParser.DECLARE_ASSIGN, 0); } + public RangeClauseContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_rangeClause; } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof GobraParserVisitor ) return ((GobraParserVisitor)visitor).visitRangeClause(this); + else return visitor.visitChildren(this); + } + } + + public final RangeClauseContext rangeClause() throws RecognitionException { + RangeClauseContext _localctx = new RangeClauseContext(_ctx, getState()); + enterRule(_localctx, 252, RULE_rangeClause); + try { + enterOuterAlt(_localctx, 1); + { + setState(1380); + _errHandler.sync(this); + switch ( getInterpreter().adaptivePredict(_input,134,_ctx) ) { + case 1: + { + setState(1374); + expressionList(); + setState(1375); + match(ASSIGN); + } + break; + case 2: + { + setState(1377); + identifierList(); + setState(1378); + match(DECLARE_ASSIGN); + } + break; + } + setState(1382); + match(RANGE); + setState(1383); + expression(0); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class GoStmtContext extends ParserRuleContext { + public TerminalNode GO() { return getToken(GobraParser.GO, 0); } + public ExpressionContext expression() { + return getRuleContext(ExpressionContext.class,0); + } + public GoStmtContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_goStmt; } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof GobraParserVisitor ) return ((GobraParserVisitor)visitor).visitGoStmt(this); + else return visitor.visitChildren(this); + } + } + + public final GoStmtContext goStmt() throws RecognitionException { + GoStmtContext _localctx = new GoStmtContext(_ctx, getState()); + enterRule(_localctx, 254, RULE_goStmt); + try { + enterOuterAlt(_localctx, 1); + { + setState(1385); + match(GO); + setState(1386); + expression(0); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class TypeNameContext extends ParserRuleContext { + public QualifiedIdentContext qualifiedIdent() { + return getRuleContext(QualifiedIdentContext.class,0); + } + public TerminalNode IDENTIFIER() { return getToken(GobraParser.IDENTIFIER, 0); } + public TypeNameContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_typeName; } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof GobraParserVisitor ) return ((GobraParserVisitor)visitor).visitTypeName(this); + else return visitor.visitChildren(this); + } + } + + public final TypeNameContext typeName() throws RecognitionException { + TypeNameContext _localctx = new TypeNameContext(_ctx, getState()); + enterRule(_localctx, 256, RULE_typeName); + try { + setState(1390); + _errHandler.sync(this); + switch ( getInterpreter().adaptivePredict(_input,135,_ctx) ) { + case 1: + enterOuterAlt(_localctx, 1); + { + setState(1388); + qualifiedIdent(); + } + break; + case 2: + enterOuterAlt(_localctx, 2); + { + setState(1389); + match(IDENTIFIER); + } + break; + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class ArrayTypeContext extends ParserRuleContext { + public TerminalNode L_BRACKET() { return getToken(GobraParser.L_BRACKET, 0); } + public ArrayLengthContext arrayLength() { + return getRuleContext(ArrayLengthContext.class,0); + } + public TerminalNode R_BRACKET() { return getToken(GobraParser.R_BRACKET, 0); } + public ElementTypeContext elementType() { + return getRuleContext(ElementTypeContext.class,0); + } + public ArrayTypeContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_arrayType; } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof GobraParserVisitor ) return ((GobraParserVisitor)visitor).visitArrayType(this); + else return visitor.visitChildren(this); + } + } + + public final ArrayTypeContext arrayType() throws RecognitionException { + ArrayTypeContext _localctx = new ArrayTypeContext(_ctx, getState()); + enterRule(_localctx, 258, RULE_arrayType); + try { + enterOuterAlt(_localctx, 1); + { + setState(1392); + match(L_BRACKET); + setState(1393); + arrayLength(); + setState(1394); + match(R_BRACKET); + setState(1395); + elementType(); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class ArrayLengthContext extends ParserRuleContext { + public ExpressionContext expression() { + return getRuleContext(ExpressionContext.class,0); + } + public ArrayLengthContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_arrayLength; } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof GobraParserVisitor ) return ((GobraParserVisitor)visitor).visitArrayLength(this); + else return visitor.visitChildren(this); + } + } + + public final ArrayLengthContext arrayLength() throws RecognitionException { + ArrayLengthContext _localctx = new ArrayLengthContext(_ctx, getState()); + enterRule(_localctx, 260, RULE_arrayLength); + try { + enterOuterAlt(_localctx, 1); + { + setState(1397); + expression(0); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class ElementTypeContext extends ParserRuleContext { + public Type_Context type_() { + return getRuleContext(Type_Context.class,0); + } + public ElementTypeContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_elementType; } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof GobraParserVisitor ) return ((GobraParserVisitor)visitor).visitElementType(this); + else return visitor.visitChildren(this); + } + } + + public final ElementTypeContext elementType() throws RecognitionException { + ElementTypeContext _localctx = new ElementTypeContext(_ctx, getState()); + enterRule(_localctx, 262, RULE_elementType); + try { + enterOuterAlt(_localctx, 1); + { + setState(1399); + type_(); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class PointerTypeContext extends ParserRuleContext { + public TerminalNode STAR() { return getToken(GobraParser.STAR, 0); } + public Type_Context type_() { + return getRuleContext(Type_Context.class,0); + } + public PointerTypeContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_pointerType; } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof GobraParserVisitor ) return ((GobraParserVisitor)visitor).visitPointerType(this); + else return visitor.visitChildren(this); + } + } + + public final PointerTypeContext pointerType() throws RecognitionException { + PointerTypeContext _localctx = new PointerTypeContext(_ctx, getState()); + enterRule(_localctx, 264, RULE_pointerType); + try { + enterOuterAlt(_localctx, 1); + { + setState(1401); + match(STAR); + setState(1402); + type_(); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class SliceTypeContext extends ParserRuleContext { + public TerminalNode L_BRACKET() { return getToken(GobraParser.L_BRACKET, 0); } + public TerminalNode R_BRACKET() { return getToken(GobraParser.R_BRACKET, 0); } + public ElementTypeContext elementType() { + return getRuleContext(ElementTypeContext.class,0); + } + public SliceTypeContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_sliceType; } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof GobraParserVisitor ) return ((GobraParserVisitor)visitor).visitSliceType(this); + else return visitor.visitChildren(this); + } + } + + public final SliceTypeContext sliceType() throws RecognitionException { + SliceTypeContext _localctx = new SliceTypeContext(_ctx, getState()); + enterRule(_localctx, 266, RULE_sliceType); + try { + enterOuterAlt(_localctx, 1); + { + setState(1404); + match(L_BRACKET); + setState(1405); + match(R_BRACKET); + setState(1406); + elementType(); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class MapTypeContext extends ParserRuleContext { + public TerminalNode MAP() { return getToken(GobraParser.MAP, 0); } + public TerminalNode L_BRACKET() { return getToken(GobraParser.L_BRACKET, 0); } + public Type_Context type_() { + return getRuleContext(Type_Context.class,0); + } + public TerminalNode R_BRACKET() { return getToken(GobraParser.R_BRACKET, 0); } + public ElementTypeContext elementType() { + return getRuleContext(ElementTypeContext.class,0); + } + public MapTypeContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_mapType; } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof GobraParserVisitor ) return ((GobraParserVisitor)visitor).visitMapType(this); + else return visitor.visitChildren(this); + } + } + + public final MapTypeContext mapType() throws RecognitionException { + MapTypeContext _localctx = new MapTypeContext(_ctx, getState()); + enterRule(_localctx, 268, RULE_mapType); + try { + enterOuterAlt(_localctx, 1); + { + setState(1408); + match(MAP); + setState(1409); + match(L_BRACKET); + setState(1410); + type_(); + setState(1411); + match(R_BRACKET); + setState(1412); + elementType(); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class ChannelTypeContext extends ParserRuleContext { + public ElementTypeContext elementType() { + return getRuleContext(ElementTypeContext.class,0); + } + public TerminalNode CHAN() { return getToken(GobraParser.CHAN, 0); } + public TerminalNode RECEIVE() { return getToken(GobraParser.RECEIVE, 0); } + public ChannelTypeContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_channelType; } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof GobraParserVisitor ) return ((GobraParserVisitor)visitor).visitChannelType(this); + else return visitor.visitChildren(this); + } + } + + public final ChannelTypeContext channelType() throws RecognitionException { + ChannelTypeContext _localctx = new ChannelTypeContext(_ctx, getState()); + enterRule(_localctx, 270, RULE_channelType); + try { + enterOuterAlt(_localctx, 1); + { + setState(1419); + _errHandler.sync(this); + switch ( getInterpreter().adaptivePredict(_input,136,_ctx) ) { + case 1: + { + setState(1414); + match(CHAN); + } + break; + case 2: + { + setState(1415); + match(CHAN); + setState(1416); + match(RECEIVE); + } + break; + case 3: + { + setState(1417); + match(RECEIVE); + setState(1418); + match(CHAN); + } + break; + } + setState(1421); + elementType(); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class FunctionTypeContext extends ParserRuleContext { + public TerminalNode FUNC() { return getToken(GobraParser.FUNC, 0); } + public SignatureContext signature() { + return getRuleContext(SignatureContext.class,0); + } + public FunctionTypeContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_functionType; } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof GobraParserVisitor ) return ((GobraParserVisitor)visitor).visitFunctionType(this); + else return visitor.visitChildren(this); + } + } + + public final FunctionTypeContext functionType() throws RecognitionException { + FunctionTypeContext _localctx = new FunctionTypeContext(_ctx, getState()); + enterRule(_localctx, 272, RULE_functionType); + try { + enterOuterAlt(_localctx, 1); + { + setState(1423); + match(FUNC); + setState(1424); + signature(); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class SignatureContext extends ParserRuleContext { + public ParametersContext parameters() { + return getRuleContext(ParametersContext.class,0); + } + public ResultContext result() { + return getRuleContext(ResultContext.class,0); + } + public SignatureContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_signature; } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof GobraParserVisitor ) return ((GobraParserVisitor)visitor).visitSignature(this); + else return visitor.visitChildren(this); + } + } + + public final SignatureContext signature() throws RecognitionException { + SignatureContext _localctx = new SignatureContext(_ctx, getState()); + enterRule(_localctx, 274, RULE_signature); + try { + setState(1430); + _errHandler.sync(this); + switch ( getInterpreter().adaptivePredict(_input,137,_ctx) ) { + case 1: + enterOuterAlt(_localctx, 1); + { + setState(1426); + parameters(); + setState(1427); + result(); + } + break; + case 2: + enterOuterAlt(_localctx, 2); + { + setState(1429); + parameters(); + } + break; + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class ResultContext extends ParserRuleContext { + public ParametersContext parameters() { + return getRuleContext(ParametersContext.class,0); + } + public Type_Context type_() { + return getRuleContext(Type_Context.class,0); + } + public ResultContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_result; } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof GobraParserVisitor ) return ((GobraParserVisitor)visitor).visitResult(this); + else return visitor.visitChildren(this); + } + } + + public final ResultContext result() throws RecognitionException { + ResultContext _localctx = new ResultContext(_ctx, getState()); + enterRule(_localctx, 276, RULE_result); + try { + setState(1434); + _errHandler.sync(this); + switch ( getInterpreter().adaptivePredict(_input,138,_ctx) ) { + case 1: + enterOuterAlt(_localctx, 1); + { + setState(1432); + parameters(); + } + break; + case 2: + enterOuterAlt(_localctx, 2); + { + setState(1433); + type_(); + } + break; + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class ParametersContext extends ParserRuleContext { + public TerminalNode L_PAREN() { return getToken(GobraParser.L_PAREN, 0); } + public TerminalNode R_PAREN() { return getToken(GobraParser.R_PAREN, 0); } + public List parameterDecl() { + return getRuleContexts(ParameterDeclContext.class); + } + public ParameterDeclContext parameterDecl(int i) { + return getRuleContext(ParameterDeclContext.class,i); + } + public List COMMA() { return getTokens(GobraParser.COMMA); } + public TerminalNode COMMA(int i) { + return getToken(GobraParser.COMMA, i); + } + public ParametersContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_parameters; } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof GobraParserVisitor ) return ((GobraParserVisitor)visitor).visitParameters(this); + else return visitor.visitChildren(this); + } + } + + public final ParametersContext parameters() throws RecognitionException { + ParametersContext _localctx = new ParametersContext(_ctx, getState()); + enterRule(_localctx, 278, RULE_parameters); + int _la; + try { + int _alt; + enterOuterAlt(_localctx, 1); + { + setState(1436); + match(L_PAREN); + setState(1448); + _errHandler.sync(this); + _la = _input.LA(1); + if ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << GHOST) | (1L << SEQ) | (1L << SET) | (1L << MSET) | (1L << DICT) | (1L << OPT) | (1L << DOM) | (1L << PRED))) != 0) || ((((_la - 65)) & ~0x3f) == 0 && ((1L << (_la - 65)) & ((1L << (FUNC - 65)) | (1L << (INTERFACE - 65)) | (1L << (MAP - 65)) | (1L << (STRUCT - 65)) | (1L << (CHAN - 65)) | (1L << (IDENTIFIER - 65)) | (1L << (L_PAREN - 65)) | (1L << (L_BRACKET - 65)) | (1L << (ELLIPSIS - 65)) | (1L << (STAR - 65)) | (1L << (RECEIVE - 65)))) != 0)) { + { + setState(1437); + parameterDecl(); + setState(1442); + _errHandler.sync(this); + _alt = getInterpreter().adaptivePredict(_input,139,_ctx); + while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) { + if ( _alt==1 ) { + { + { + setState(1438); + match(COMMA); + setState(1439); + parameterDecl(); + } + } + } + setState(1444); + _errHandler.sync(this); + _alt = getInterpreter().adaptivePredict(_input,139,_ctx); + } + setState(1446); + _errHandler.sync(this); + _la = _input.LA(1); + if (_la==COMMA) { + { + setState(1445); + match(COMMA); + } + } + + } + } + + setState(1450); + match(R_PAREN); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class ConversionContext extends ParserRuleContext { + public NonNamedTypeContext nonNamedType() { + return getRuleContext(NonNamedTypeContext.class,0); + } + public TerminalNode L_PAREN() { return getToken(GobraParser.L_PAREN, 0); } + public ExpressionContext expression() { + return getRuleContext(ExpressionContext.class,0); + } + public TerminalNode R_PAREN() { return getToken(GobraParser.R_PAREN, 0); } + public TerminalNode COMMA() { return getToken(GobraParser.COMMA, 0); } + public ConversionContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_conversion; } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof GobraParserVisitor ) return ((GobraParserVisitor)visitor).visitConversion(this); + else return visitor.visitChildren(this); + } + } + + public final ConversionContext conversion() throws RecognitionException { + ConversionContext _localctx = new ConversionContext(_ctx, getState()); + enterRule(_localctx, 280, RULE_conversion); + int _la; + try { + enterOuterAlt(_localctx, 1); + { + setState(1452); + nonNamedType(); + setState(1453); + match(L_PAREN); + setState(1454); + expression(0); + setState(1456); + _errHandler.sync(this); + _la = _input.LA(1); + if (_la==COMMA) { + { + setState(1455); + match(COMMA); + } + } + + setState(1458); + match(R_PAREN); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class NonNamedTypeContext extends ParserRuleContext { + public TypeLitContext typeLit() { + return getRuleContext(TypeLitContext.class,0); + } + public TerminalNode L_PAREN() { return getToken(GobraParser.L_PAREN, 0); } + public NonNamedTypeContext nonNamedType() { + return getRuleContext(NonNamedTypeContext.class,0); + } + public TerminalNode R_PAREN() { return getToken(GobraParser.R_PAREN, 0); } + public NonNamedTypeContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_nonNamedType; } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof GobraParserVisitor ) return ((GobraParserVisitor)visitor).visitNonNamedType(this); + else return visitor.visitChildren(this); + } + } + + public final NonNamedTypeContext nonNamedType() throws RecognitionException { + NonNamedTypeContext _localctx = new NonNamedTypeContext(_ctx, getState()); + enterRule(_localctx, 282, RULE_nonNamedType); + try { + setState(1465); + _errHandler.sync(this); + switch (_input.LA(1)) { + case PRED: + case FUNC: + case INTERFACE: + case MAP: + case STRUCT: + case CHAN: + case L_BRACKET: + case STAR: + case RECEIVE: + enterOuterAlt(_localctx, 1); + { + setState(1460); + typeLit(); + } + break; + case L_PAREN: + enterOuterAlt(_localctx, 2); + { + setState(1461); + match(L_PAREN); + setState(1462); + nonNamedType(); + setState(1463); + match(R_PAREN); + } + break; + default: + throw new NoViableAltException(this); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class OperandContext extends ParserRuleContext { + public LiteralContext literal() { + return getRuleContext(LiteralContext.class,0); + } + public OperandNameContext operandName() { + return getRuleContext(OperandNameContext.class,0); + } + public TerminalNode L_PAREN() { return getToken(GobraParser.L_PAREN, 0); } + public ExpressionContext expression() { + return getRuleContext(ExpressionContext.class,0); + } + public TerminalNode R_PAREN() { return getToken(GobraParser.R_PAREN, 0); } + public OperandContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_operand; } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof GobraParserVisitor ) return ((GobraParserVisitor)visitor).visitOperand(this); + else return visitor.visitChildren(this); + } + } + + public final OperandContext operand() throws RecognitionException { + OperandContext _localctx = new OperandContext(_ctx, getState()); + enterRule(_localctx, 284, RULE_operand); + try { + setState(1473); + _errHandler.sync(this); + switch ( getInterpreter().adaptivePredict(_input,144,_ctx) ) { + case 1: + enterOuterAlt(_localctx, 1); + { + setState(1467); + literal(); + } + break; + case 2: + enterOuterAlt(_localctx, 2); + { + setState(1468); + operandName(); + } + break; + case 3: + enterOuterAlt(_localctx, 3); + { + setState(1469); + match(L_PAREN); + setState(1470); + expression(0); + setState(1471); + match(R_PAREN); + } + break; + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class LiteralContext extends ParserRuleContext { + public BasicLitContext basicLit() { + return getRuleContext(BasicLitContext.class,0); + } + public CompositeLitContext compositeLit() { + return getRuleContext(CompositeLitContext.class,0); + } + public FunctionLitContext functionLit() { + return getRuleContext(FunctionLitContext.class,0); + } + public LiteralContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_literal; } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof GobraParserVisitor ) return ((GobraParserVisitor)visitor).visitLiteral(this); + else return visitor.visitChildren(this); + } + } + + public final LiteralContext literal() throws RecognitionException { + LiteralContext _localctx = new LiteralContext(_ctx, getState()); + enterRule(_localctx, 286, RULE_literal); + try { + setState(1478); + _errHandler.sync(this); + switch (_input.LA(1)) { + case FLOAT_LIT: + case TRUE: + case FALSE: + case NIL_LIT: + case DECIMAL_LIT: + case BINARY_LIT: + case OCTAL_LIT: + case HEX_LIT: + case IMAGINARY_LIT: + case RUNE_LIT: + case RAW_STRING_LIT: + case INTERPRETED_STRING_LIT: + enterOuterAlt(_localctx, 1); + { + setState(1475); + basicLit(); + } + break; + case GHOST: + case SEQ: + case SET: + case MSET: + case DICT: + case OPT: + case DOM: + case MAP: + case STRUCT: + case IDENTIFIER: + case L_BRACKET: + enterOuterAlt(_localctx, 2); + { + setState(1476); + compositeLit(); + } + break; + case FUNC: + enterOuterAlt(_localctx, 3); + { + setState(1477); + functionLit(); + } + break; + default: + throw new NoViableAltException(this); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class IntegerContext extends ParserRuleContext { + public TerminalNode DECIMAL_LIT() { return getToken(GobraParser.DECIMAL_LIT, 0); } + public TerminalNode BINARY_LIT() { return getToken(GobraParser.BINARY_LIT, 0); } + public TerminalNode OCTAL_LIT() { return getToken(GobraParser.OCTAL_LIT, 0); } + public TerminalNode HEX_LIT() { return getToken(GobraParser.HEX_LIT, 0); } + public TerminalNode IMAGINARY_LIT() { return getToken(GobraParser.IMAGINARY_LIT, 0); } + public TerminalNode RUNE_LIT() { return getToken(GobraParser.RUNE_LIT, 0); } + public IntegerContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_integer; } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof GobraParserVisitor ) return ((GobraParserVisitor)visitor).visitInteger(this); + else return visitor.visitChildren(this); + } + } + + public final IntegerContext integer() throws RecognitionException { + IntegerContext _localctx = new IntegerContext(_ctx, getState()); + enterRule(_localctx, 288, RULE_integer); + int _la; + try { + enterOuterAlt(_localctx, 1); + { + setState(1480); + _la = _input.LA(1); + if ( !(((((_la - 126)) & ~0x3f) == 0 && ((1L << (_la - 126)) & ((1L << (DECIMAL_LIT - 126)) | (1L << (BINARY_LIT - 126)) | (1L << (OCTAL_LIT - 126)) | (1L << (HEX_LIT - 126)) | (1L << (IMAGINARY_LIT - 126)) | (1L << (RUNE_LIT - 126)))) != 0)) ) { + _errHandler.recoverInline(this); + } + else { + if ( _input.LA(1)==Token.EOF ) matchedEOF = true; + _errHandler.reportMatch(this); + consume(); + } + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class OperandNameContext extends ParserRuleContext { + public TerminalNode IDENTIFIER() { return getToken(GobraParser.IDENTIFIER, 0); } + public OperandNameContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_operandName; } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof GobraParserVisitor ) return ((GobraParserVisitor)visitor).visitOperandName(this); + else return visitor.visitChildren(this); + } + } + + public final OperandNameContext operandName() throws RecognitionException { + OperandNameContext _localctx = new OperandNameContext(_ctx, getState()); + enterRule(_localctx, 290, RULE_operandName); + try { + enterOuterAlt(_localctx, 1); + { + setState(1482); + match(IDENTIFIER); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class QualifiedIdentContext extends ParserRuleContext { + public List IDENTIFIER() { return getTokens(GobraParser.IDENTIFIER); } + public TerminalNode IDENTIFIER(int i) { + return getToken(GobraParser.IDENTIFIER, i); + } + public TerminalNode DOT() { return getToken(GobraParser.DOT, 0); } + public QualifiedIdentContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_qualifiedIdent; } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof GobraParserVisitor ) return ((GobraParserVisitor)visitor).visitQualifiedIdent(this); + else return visitor.visitChildren(this); + } + } + + public final QualifiedIdentContext qualifiedIdent() throws RecognitionException { + QualifiedIdentContext _localctx = new QualifiedIdentContext(_ctx, getState()); + enterRule(_localctx, 292, RULE_qualifiedIdent); + try { + enterOuterAlt(_localctx, 1); + { + setState(1484); + match(IDENTIFIER); + setState(1485); + match(DOT); + setState(1486); + match(IDENTIFIER); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class CompositeLitContext extends ParserRuleContext { + public LiteralTypeContext literalType() { + return getRuleContext(LiteralTypeContext.class,0); + } + public LiteralValueContext literalValue() { + return getRuleContext(LiteralValueContext.class,0); + } + public CompositeLitContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_compositeLit; } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof GobraParserVisitor ) return ((GobraParserVisitor)visitor).visitCompositeLit(this); + else return visitor.visitChildren(this); + } + } + + public final CompositeLitContext compositeLit() throws RecognitionException { + CompositeLitContext _localctx = new CompositeLitContext(_ctx, getState()); + enterRule(_localctx, 294, RULE_compositeLit); + try { + enterOuterAlt(_localctx, 1); + { + setState(1488); + literalType(); + setState(1489); + literalValue(); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class LiteralValueContext extends ParserRuleContext { + public TerminalNode L_CURLY() { return getToken(GobraParser.L_CURLY, 0); } + public TerminalNode R_CURLY() { return getToken(GobraParser.R_CURLY, 0); } + public ElementListContext elementList() { + return getRuleContext(ElementListContext.class,0); + } + public TerminalNode COMMA() { return getToken(GobraParser.COMMA, 0); } + public LiteralValueContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_literalValue; } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof GobraParserVisitor ) return ((GobraParserVisitor)visitor).visitLiteralValue(this); + else return visitor.visitChildren(this); + } + } + + public final LiteralValueContext literalValue() throws RecognitionException { + LiteralValueContext _localctx = new LiteralValueContext(_ctx, getState()); + enterRule(_localctx, 296, RULE_literalValue); + int _la; + try { + enterOuterAlt(_localctx, 1); + { + setState(1491); + match(L_CURLY); + setState(1496); + _errHandler.sync(this); + _la = _input.LA(1); + if ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << FLOAT_LIT) | (1L << TRUE) | (1L << FALSE) | (1L << OLD) | (1L << FORALL) | (1L << EXISTS) | (1L << ACCESS) | (1L << UNFOLDING) | (1L << GHOST) | (1L << SEQ) | (1L << SET) | (1L << MSET) | (1L << DICT) | (1L << OPT) | (1L << LEN) | (1L << NEW) | (1L << MAKE) | (1L << CAP) | (1L << SOME) | (1L << GET) | (1L << DOM) | (1L << NONE) | (1L << PRED) | (1L << TYPE_OF) | (1L << IS_COMPARABLE) | (1L << WRITEPERM) | (1L << NOPERM))) != 0) || ((((_la - 65)) & ~0x3f) == 0 && ((1L << (_la - 65)) & ((1L << (FUNC - 65)) | (1L << (INTERFACE - 65)) | (1L << (MAP - 65)) | (1L << (STRUCT - 65)) | (1L << (CHAN - 65)) | (1L << (RANGE - 65)) | (1L << (TYPE - 65)) | (1L << (NIL_LIT - 65)) | (1L << (IDENTIFIER - 65)) | (1L << (L_PAREN - 65)) | (1L << (L_CURLY - 65)) | (1L << (L_BRACKET - 65)) | (1L << (EXCLAMATION - 65)) | (1L << (PLUS - 65)) | (1L << (MINUS - 65)) | (1L << (CARET - 65)) | (1L << (STAR - 65)) | (1L << (AMPERSAND - 65)) | (1L << (RECEIVE - 65)) | (1L << (DECIMAL_LIT - 65)) | (1L << (BINARY_LIT - 65)) | (1L << (OCTAL_LIT - 65)))) != 0) || ((((_la - 129)) & ~0x3f) == 0 && ((1L << (_la - 129)) & ((1L << (HEX_LIT - 129)) | (1L << (IMAGINARY_LIT - 129)) | (1L << (RUNE_LIT - 129)) | (1L << (RAW_STRING_LIT - 129)) | (1L << (INTERPRETED_STRING_LIT - 129)))) != 0)) { + { + setState(1492); + elementList(); + setState(1494); + _errHandler.sync(this); + _la = _input.LA(1); + if (_la==COMMA) { + { + setState(1493); + match(COMMA); + } + } + + } + } + + setState(1498); + match(R_CURLY); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class ElementListContext extends ParserRuleContext { + public List keyedElement() { + return getRuleContexts(KeyedElementContext.class); + } + public KeyedElementContext keyedElement(int i) { + return getRuleContext(KeyedElementContext.class,i); + } + public List COMMA() { return getTokens(GobraParser.COMMA); } + public TerminalNode COMMA(int i) { + return getToken(GobraParser.COMMA, i); + } + public ElementListContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_elementList; } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof GobraParserVisitor ) return ((GobraParserVisitor)visitor).visitElementList(this); + else return visitor.visitChildren(this); + } + } + + public final ElementListContext elementList() throws RecognitionException { + ElementListContext _localctx = new ElementListContext(_ctx, getState()); + enterRule(_localctx, 298, RULE_elementList); + try { + int _alt; + enterOuterAlt(_localctx, 1); + { + setState(1500); + keyedElement(); + setState(1505); + _errHandler.sync(this); + _alt = getInterpreter().adaptivePredict(_input,148,_ctx); + while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) { + if ( _alt==1 ) { + { + { + setState(1501); + match(COMMA); + setState(1502); + keyedElement(); + } + } + } + setState(1507); + _errHandler.sync(this); + _alt = getInterpreter().adaptivePredict(_input,148,_ctx); + } + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class KeyedElementContext extends ParserRuleContext { + public ElementContext element() { + return getRuleContext(ElementContext.class,0); + } + public KeyContext key() { + return getRuleContext(KeyContext.class,0); + } + public TerminalNode COLON() { return getToken(GobraParser.COLON, 0); } + public KeyedElementContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_keyedElement; } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof GobraParserVisitor ) return ((GobraParserVisitor)visitor).visitKeyedElement(this); + else return visitor.visitChildren(this); + } + } + + public final KeyedElementContext keyedElement() throws RecognitionException { + KeyedElementContext _localctx = new KeyedElementContext(_ctx, getState()); + enterRule(_localctx, 300, RULE_keyedElement); + try { + enterOuterAlt(_localctx, 1); + { + setState(1511); + _errHandler.sync(this); + switch ( getInterpreter().adaptivePredict(_input,149,_ctx) ) { + case 1: + { + setState(1508); + key(); + setState(1509); + match(COLON); + } + break; + } + setState(1513); + element(); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class KeyContext extends ParserRuleContext { + public ExpressionContext expression() { + return getRuleContext(ExpressionContext.class,0); + } + public LiteralValueContext literalValue() { + return getRuleContext(LiteralValueContext.class,0); + } + public KeyContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_key; } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof GobraParserVisitor ) return ((GobraParserVisitor)visitor).visitKey(this); + else return visitor.visitChildren(this); + } + } + + public final KeyContext key() throws RecognitionException { + KeyContext _localctx = new KeyContext(_ctx, getState()); + enterRule(_localctx, 302, RULE_key); + try { + setState(1517); + _errHandler.sync(this); + switch (_input.LA(1)) { + case FLOAT_LIT: + case TRUE: + case FALSE: + case OLD: + case FORALL: + case EXISTS: + case ACCESS: + case UNFOLDING: + case GHOST: + case SEQ: + case SET: + case MSET: + case DICT: + case OPT: + case LEN: + case NEW: + case MAKE: + case CAP: + case SOME: + case GET: + case DOM: + case NONE: + case PRED: + case TYPE_OF: + case IS_COMPARABLE: + case WRITEPERM: + case NOPERM: + case FUNC: + case INTERFACE: + case MAP: + case STRUCT: + case CHAN: + case RANGE: + case TYPE: + case NIL_LIT: + case IDENTIFIER: + case L_PAREN: + case L_BRACKET: + case EXCLAMATION: + case PLUS: + case MINUS: + case CARET: + case STAR: + case AMPERSAND: + case RECEIVE: + case DECIMAL_LIT: + case BINARY_LIT: + case OCTAL_LIT: + case HEX_LIT: + case IMAGINARY_LIT: + case RUNE_LIT: + case RAW_STRING_LIT: + case INTERPRETED_STRING_LIT: + enterOuterAlt(_localctx, 1); + { + setState(1515); + expression(0); + } + break; + case L_CURLY: + enterOuterAlt(_localctx, 2); + { + setState(1516); + literalValue(); + } + break; + default: + throw new NoViableAltException(this); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class ElementContext extends ParserRuleContext { + public ExpressionContext expression() { + return getRuleContext(ExpressionContext.class,0); + } + public LiteralValueContext literalValue() { + return getRuleContext(LiteralValueContext.class,0); + } + public ElementContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_element; } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof GobraParserVisitor ) return ((GobraParserVisitor)visitor).visitElement(this); + else return visitor.visitChildren(this); + } + } + + public final ElementContext element() throws RecognitionException { + ElementContext _localctx = new ElementContext(_ctx, getState()); + enterRule(_localctx, 304, RULE_element); + try { + setState(1521); + _errHandler.sync(this); + switch (_input.LA(1)) { + case FLOAT_LIT: + case TRUE: + case FALSE: + case OLD: + case FORALL: + case EXISTS: + case ACCESS: + case UNFOLDING: + case GHOST: + case SEQ: + case SET: + case MSET: + case DICT: + case OPT: + case LEN: + case NEW: + case MAKE: + case CAP: + case SOME: + case GET: + case DOM: + case NONE: + case PRED: + case TYPE_OF: + case IS_COMPARABLE: + case WRITEPERM: + case NOPERM: + case FUNC: + case INTERFACE: + case MAP: + case STRUCT: + case CHAN: + case RANGE: + case TYPE: + case NIL_LIT: + case IDENTIFIER: + case L_PAREN: + case L_BRACKET: + case EXCLAMATION: + case PLUS: + case MINUS: + case CARET: + case STAR: + case AMPERSAND: + case RECEIVE: + case DECIMAL_LIT: + case BINARY_LIT: + case OCTAL_LIT: + case HEX_LIT: + case IMAGINARY_LIT: + case RUNE_LIT: + case RAW_STRING_LIT: + case INTERPRETED_STRING_LIT: + enterOuterAlt(_localctx, 1); + { + setState(1519); + expression(0); + } + break; + case L_CURLY: + enterOuterAlt(_localctx, 2); + { + setState(1520); + literalValue(); + } + break; + default: + throw new NoViableAltException(this); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class StructTypeContext extends ParserRuleContext { + public TerminalNode STRUCT() { return getToken(GobraParser.STRUCT, 0); } + public TerminalNode L_CURLY() { return getToken(GobraParser.L_CURLY, 0); } + public TerminalNode R_CURLY() { return getToken(GobraParser.R_CURLY, 0); } + public List fieldDecl() { + return getRuleContexts(FieldDeclContext.class); + } + public FieldDeclContext fieldDecl(int i) { + return getRuleContext(FieldDeclContext.class,i); + } + public List eos() { + return getRuleContexts(EosContext.class); + } + public EosContext eos(int i) { + return getRuleContext(EosContext.class,i); + } + public StructTypeContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_structType; } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof GobraParserVisitor ) return ((GobraParserVisitor)visitor).visitStructType(this); + else return visitor.visitChildren(this); + } + } + + public final StructTypeContext structType() throws RecognitionException { + StructTypeContext _localctx = new StructTypeContext(_ctx, getState()); + enterRule(_localctx, 306, RULE_structType); + int _la; + try { + enterOuterAlt(_localctx, 1); + { + setState(1523); + match(STRUCT); + setState(1524); + match(L_CURLY); + setState(1530); + _errHandler.sync(this); + _la = _input.LA(1); + while (_la==IDENTIFIER || _la==STAR) { + { + { + setState(1525); + fieldDecl(); + setState(1526); + eos(); + } + } + setState(1532); + _errHandler.sync(this); + _la = _input.LA(1); + } + setState(1533); + match(R_CURLY); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class FieldDeclContext extends ParserRuleContext { + public String_Context tag; + public IdentifierListContext identifierList() { + return getRuleContext(IdentifierListContext.class,0); + } + public Type_Context type_() { + return getRuleContext(Type_Context.class,0); + } + public EmbeddedFieldContext embeddedField() { + return getRuleContext(EmbeddedFieldContext.class,0); + } + public String_Context string_() { + return getRuleContext(String_Context.class,0); + } + public FieldDeclContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_fieldDecl; } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof GobraParserVisitor ) return ((GobraParserVisitor)visitor).visitFieldDecl(this); + else return visitor.visitChildren(this); + } + } + + public final FieldDeclContext fieldDecl() throws RecognitionException { + FieldDeclContext _localctx = new FieldDeclContext(_ctx, getState()); + enterRule(_localctx, 308, RULE_fieldDecl); + try { + enterOuterAlt(_localctx, 1); + { + setState(1539); + _errHandler.sync(this); + switch ( getInterpreter().adaptivePredict(_input,153,_ctx) ) { + case 1: + { + setState(1535); + identifierList(); + setState(1536); + type_(); + } + break; + case 2: + { + setState(1538); + embeddedField(); + } + break; + } + setState(1542); + _errHandler.sync(this); + switch ( getInterpreter().adaptivePredict(_input,154,_ctx) ) { + case 1: + { + setState(1541); + ((FieldDeclContext)_localctx).tag = string_(); + } + break; + } + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class String_Context extends ParserRuleContext { + public TerminalNode RAW_STRING_LIT() { return getToken(GobraParser.RAW_STRING_LIT, 0); } + public TerminalNode INTERPRETED_STRING_LIT() { return getToken(GobraParser.INTERPRETED_STRING_LIT, 0); } + public String_Context(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_string_; } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof GobraParserVisitor ) return ((GobraParserVisitor)visitor).visitString_(this); + else return visitor.visitChildren(this); + } + } + + public final String_Context string_() throws RecognitionException { + String_Context _localctx = new String_Context(_ctx, getState()); + enterRule(_localctx, 310, RULE_string_); + int _la; + try { + enterOuterAlt(_localctx, 1); + { + setState(1544); + _la = _input.LA(1); + if ( !(_la==RAW_STRING_LIT || _la==INTERPRETED_STRING_LIT) ) { + _errHandler.recoverInline(this); + } + else { + if ( _input.LA(1)==Token.EOF ) matchedEOF = true; + _errHandler.reportMatch(this); + consume(); + } + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class EmbeddedFieldContext extends ParserRuleContext { + public TypeNameContext typeName() { + return getRuleContext(TypeNameContext.class,0); + } + public TerminalNode STAR() { return getToken(GobraParser.STAR, 0); } + public EmbeddedFieldContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_embeddedField; } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof GobraParserVisitor ) return ((GobraParserVisitor)visitor).visitEmbeddedField(this); + else return visitor.visitChildren(this); + } + } + + public final EmbeddedFieldContext embeddedField() throws RecognitionException { + EmbeddedFieldContext _localctx = new EmbeddedFieldContext(_ctx, getState()); + enterRule(_localctx, 312, RULE_embeddedField); + int _la; + try { + enterOuterAlt(_localctx, 1); + { + setState(1547); + _errHandler.sync(this); + _la = _input.LA(1); + if (_la==STAR) { + { + setState(1546); + match(STAR); + } + } + + setState(1549); + typeName(); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class FunctionLitContext extends ParserRuleContext { + public TerminalNode FUNC() { return getToken(GobraParser.FUNC, 0); } + public SignatureContext signature() { + return getRuleContext(SignatureContext.class,0); + } + public BlockContext block() { + return getRuleContext(BlockContext.class,0); + } + public FunctionLitContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_functionLit; } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof GobraParserVisitor ) return ((GobraParserVisitor)visitor).visitFunctionLit(this); + else return visitor.visitChildren(this); + } + } + + public final FunctionLitContext functionLit() throws RecognitionException { + FunctionLitContext _localctx = new FunctionLitContext(_ctx, getState()); + enterRule(_localctx, 314, RULE_functionLit); + try { + enterOuterAlt(_localctx, 1); + { + setState(1551); + match(FUNC); + setState(1552); + signature(); + setState(1553); + block(); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class IndexContext extends ParserRuleContext { + public TerminalNode L_BRACKET() { return getToken(GobraParser.L_BRACKET, 0); } + public ExpressionContext expression() { + return getRuleContext(ExpressionContext.class,0); + } + public TerminalNode R_BRACKET() { return getToken(GobraParser.R_BRACKET, 0); } + public IndexContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_index; } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof GobraParserVisitor ) return ((GobraParserVisitor)visitor).visitIndex(this); + else return visitor.visitChildren(this); + } + } + + public final IndexContext index() throws RecognitionException { + IndexContext _localctx = new IndexContext(_ctx, getState()); + enterRule(_localctx, 316, RULE_index); + try { + enterOuterAlt(_localctx, 1); + { + setState(1555); + match(L_BRACKET); + setState(1556); + expression(0); + setState(1557); + match(R_BRACKET); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class TypeAssertionContext extends ParserRuleContext { + public TerminalNode DOT() { return getToken(GobraParser.DOT, 0); } + public TerminalNode L_PAREN() { return getToken(GobraParser.L_PAREN, 0); } + public Type_Context type_() { + return getRuleContext(Type_Context.class,0); + } + public TerminalNode R_PAREN() { return getToken(GobraParser.R_PAREN, 0); } + public TypeAssertionContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_typeAssertion; } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof GobraParserVisitor ) return ((GobraParserVisitor)visitor).visitTypeAssertion(this); + else return visitor.visitChildren(this); + } + } + + public final TypeAssertionContext typeAssertion() throws RecognitionException { + TypeAssertionContext _localctx = new TypeAssertionContext(_ctx, getState()); + enterRule(_localctx, 318, RULE_typeAssertion); + try { + enterOuterAlt(_localctx, 1); + { + setState(1559); + match(DOT); + setState(1560); + match(L_PAREN); + setState(1561); + type_(); + setState(1562); + match(R_PAREN); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class ArgumentsContext extends ParserRuleContext { + public TerminalNode L_PAREN() { return getToken(GobraParser.L_PAREN, 0); } + public TerminalNode R_PAREN() { return getToken(GobraParser.R_PAREN, 0); } + public ExpressionListContext expressionList() { + return getRuleContext(ExpressionListContext.class,0); + } + public NonNamedTypeContext nonNamedType() { + return getRuleContext(NonNamedTypeContext.class,0); + } + public TerminalNode ELLIPSIS() { return getToken(GobraParser.ELLIPSIS, 0); } + public List COMMA() { return getTokens(GobraParser.COMMA); } + public TerminalNode COMMA(int i) { + return getToken(GobraParser.COMMA, i); + } + public ArgumentsContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_arguments; } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof GobraParserVisitor ) return ((GobraParserVisitor)visitor).visitArguments(this); + else return visitor.visitChildren(this); + } + } + + public final ArgumentsContext arguments() throws RecognitionException { + ArgumentsContext _localctx = new ArgumentsContext(_ctx, getState()); + enterRule(_localctx, 320, RULE_arguments); + int _la; + try { + enterOuterAlt(_localctx, 1); + { + setState(1564); + match(L_PAREN); + setState(1579); + _errHandler.sync(this); + _la = _input.LA(1); + if ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << FLOAT_LIT) | (1L << TRUE) | (1L << FALSE) | (1L << OLD) | (1L << FORALL) | (1L << EXISTS) | (1L << ACCESS) | (1L << UNFOLDING) | (1L << GHOST) | (1L << SEQ) | (1L << SET) | (1L << MSET) | (1L << DICT) | (1L << OPT) | (1L << LEN) | (1L << NEW) | (1L << MAKE) | (1L << CAP) | (1L << SOME) | (1L << GET) | (1L << DOM) | (1L << NONE) | (1L << PRED) | (1L << TYPE_OF) | (1L << IS_COMPARABLE) | (1L << WRITEPERM) | (1L << NOPERM))) != 0) || ((((_la - 65)) & ~0x3f) == 0 && ((1L << (_la - 65)) & ((1L << (FUNC - 65)) | (1L << (INTERFACE - 65)) | (1L << (MAP - 65)) | (1L << (STRUCT - 65)) | (1L << (CHAN - 65)) | (1L << (RANGE - 65)) | (1L << (TYPE - 65)) | (1L << (NIL_LIT - 65)) | (1L << (IDENTIFIER - 65)) | (1L << (L_PAREN - 65)) | (1L << (L_BRACKET - 65)) | (1L << (EXCLAMATION - 65)) | (1L << (PLUS - 65)) | (1L << (MINUS - 65)) | (1L << (CARET - 65)) | (1L << (STAR - 65)) | (1L << (AMPERSAND - 65)) | (1L << (RECEIVE - 65)) | (1L << (DECIMAL_LIT - 65)) | (1L << (BINARY_LIT - 65)) | (1L << (OCTAL_LIT - 65)))) != 0) || ((((_la - 129)) & ~0x3f) == 0 && ((1L << (_la - 129)) & ((1L << (HEX_LIT - 129)) | (1L << (IMAGINARY_LIT - 129)) | (1L << (RUNE_LIT - 129)) | (1L << (RAW_STRING_LIT - 129)) | (1L << (INTERPRETED_STRING_LIT - 129)))) != 0)) { + { + setState(1571); + _errHandler.sync(this); + switch ( getInterpreter().adaptivePredict(_input,157,_ctx) ) { + case 1: + { + setState(1565); + expressionList(); + } + break; + case 2: + { + setState(1566); + nonNamedType(); + setState(1569); + _errHandler.sync(this); + switch ( getInterpreter().adaptivePredict(_input,156,_ctx) ) { + case 1: + { + setState(1567); + match(COMMA); + setState(1568); + expressionList(); + } + break; + } + } + break; + } + setState(1574); + _errHandler.sync(this); + _la = _input.LA(1); + if (_la==ELLIPSIS) { + { + setState(1573); + match(ELLIPSIS); + } + } + + setState(1577); + _errHandler.sync(this); + _la = _input.LA(1); + if (_la==COMMA) { + { + setState(1576); + match(COMMA); + } + } + + } + } + + setState(1581); + match(R_PAREN); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class MethodExprContext extends ParserRuleContext { + public NonNamedTypeContext nonNamedType() { + return getRuleContext(NonNamedTypeContext.class,0); + } + public TerminalNode DOT() { return getToken(GobraParser.DOT, 0); } + public TerminalNode IDENTIFIER() { return getToken(GobraParser.IDENTIFIER, 0); } + public MethodExprContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_methodExpr; } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof GobraParserVisitor ) return ((GobraParserVisitor)visitor).visitMethodExpr(this); + else return visitor.visitChildren(this); + } + } + + public final MethodExprContext methodExpr() throws RecognitionException { + MethodExprContext _localctx = new MethodExprContext(_ctx, getState()); + enterRule(_localctx, 322, RULE_methodExpr); + try { + enterOuterAlt(_localctx, 1); + { + setState(1583); + nonNamedType(); + setState(1584); + match(DOT); + setState(1585); + match(IDENTIFIER); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class ReceiverTypeContext extends ParserRuleContext { + public Type_Context type_() { + return getRuleContext(Type_Context.class,0); + } + public ReceiverTypeContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_receiverType; } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof GobraParserVisitor ) return ((GobraParserVisitor)visitor).visitReceiverType(this); + else return visitor.visitChildren(this); + } + } + + public final ReceiverTypeContext receiverType() throws RecognitionException { + ReceiverTypeContext _localctx = new ReceiverTypeContext(_ctx, getState()); + enterRule(_localctx, 324, RULE_receiverType); + try { + enterOuterAlt(_localctx, 1); + { + setState(1587); + type_(); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class EosContext extends ParserRuleContext { + public TerminalNode SEMI() { return getToken(GobraParser.SEMI, 0); } + public TerminalNode EOF() { return getToken(GobraParser.EOF, 0); } + public TerminalNode EOS() { return getToken(GobraParser.EOS, 0); } + public EosContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_eos; } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof GobraParserVisitor ) return ((GobraParserVisitor)visitor).visitEos(this); + else return visitor.visitChildren(this); + } + } + + public final EosContext eos() throws RecognitionException { + EosContext _localctx = new EosContext(_ctx, getState()); + enterRule(_localctx, 326, RULE_eos); + try { + setState(1593); + _errHandler.sync(this); + switch ( getInterpreter().adaptivePredict(_input,161,_ctx) ) { + case 1: + enterOuterAlt(_localctx, 1); + { + setState(1589); + match(SEMI); + } + break; + case 2: + enterOuterAlt(_localctx, 2); + { + setState(1590); + match(EOF); + } + break; + case 3: + enterOuterAlt(_localctx, 3); + { + setState(1591); + match(EOS); + } + break; + case 4: + enterOuterAlt(_localctx, 4); + { + setState(1592); + if (!(closingBracket())) throw new FailedPredicateException(this, "closingBracket()"); + } + break; + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public boolean sempred(RuleContext _localctx, int ruleIndex, int predIndex) { + switch (ruleIndex) { + case 60: + return expression_sempred((ExpressionContext)_localctx, predIndex); + case 67: + return primaryExpr_sempred((PrimaryExprContext)_localctx, predIndex); + case 163: + return eos_sempred((EosContext)_localctx, predIndex); + } + return true; + } + private boolean expression_sempred(ExpressionContext _localctx, int predIndex) { + switch (predIndex) { + case 0: + return precpred(_ctx, 11); + case 1: + return precpred(_ctx, 10); + case 2: + return precpred(_ctx, 9); + case 3: + return precpred(_ctx, 8); + case 4: + return precpred(_ctx, 7); + case 5: + return precpred(_ctx, 6); + case 6: + return precpred(_ctx, 5); + case 7: + return precpred(_ctx, 4); + case 8: + return precpred(_ctx, 3); + } + return true; + } + private boolean primaryExpr_sempred(PrimaryExprContext _localctx, int predIndex) { + switch (predIndex) { + case 9: + return precpred(_ctx, 8); + case 10: + return precpred(_ctx, 7); + case 11: + return precpred(_ctx, 6); + case 12: + return precpred(_ctx, 5); + case 13: + return precpred(_ctx, 4); + case 14: + return precpred(_ctx, 3); + case 15: + return precpred(_ctx, 2); + } + return true; + } + private boolean eos_sempred(EosContext _localctx, int predIndex) { + switch (predIndex) { + case 16: + return closingBracket(); + } + return true; + } + + public static final String _serializedATN = + "\3\u608b\ua72a\u8133\ub9ed\u417c\u3be7\u7786\u5964\3\u0096\u063e\4\2\t"+ + "\2\4\3\t\3\4\4\t\4\4\5\t\5\4\6\t\6\4\7\t\7\4\b\t\b\4\t\t\t\4\n\t\n\4\13"+ + "\t\13\4\f\t\f\4\r\t\r\4\16\t\16\4\17\t\17\4\20\t\20\4\21\t\21\4\22\t\22"+ + "\4\23\t\23\4\24\t\24\4\25\t\25\4\26\t\26\4\27\t\27\4\30\t\30\4\31\t\31"+ + "\4\32\t\32\4\33\t\33\4\34\t\34\4\35\t\35\4\36\t\36\4\37\t\37\4 \t \4!"+ + "\t!\4\"\t\"\4#\t#\4$\t$\4%\t%\4&\t&\4\'\t\'\4(\t(\4)\t)\4*\t*\4+\t+\4"+ + ",\t,\4-\t-\4.\t.\4/\t/\4\60\t\60\4\61\t\61\4\62\t\62\4\63\t\63\4\64\t"+ + "\64\4\65\t\65\4\66\t\66\4\67\t\67\48\t8\49\t9\4:\t:\4;\t;\4<\t<\4=\t="+ + "\4>\t>\4?\t?\4@\t@\4A\tA\4B\tB\4C\tC\4D\tD\4E\tE\4F\tF\4G\tG\4H\tH\4I"+ + "\tI\4J\tJ\4K\tK\4L\tL\4M\tM\4N\tN\4O\tO\4P\tP\4Q\tQ\4R\tR\4S\tS\4T\tT"+ + "\4U\tU\4V\tV\4W\tW\4X\tX\4Y\tY\4Z\tZ\4[\t[\4\\\t\\\4]\t]\4^\t^\4_\t_\4"+ + "`\t`\4a\ta\4b\tb\4c\tc\4d\td\4e\te\4f\tf\4g\tg\4h\th\4i\ti\4j\tj\4k\t"+ + "k\4l\tl\4m\tm\4n\tn\4o\to\4p\tp\4q\tq\4r\tr\4s\ts\4t\tt\4u\tu\4v\tv\4"+ + "w\tw\4x\tx\4y\ty\4z\tz\4{\t{\4|\t|\4}\t}\4~\t~\4\177\t\177\4\u0080\t\u0080"+ + "\4\u0081\t\u0081\4\u0082\t\u0082\4\u0083\t\u0083\4\u0084\t\u0084\4\u0085"+ + "\t\u0085\4\u0086\t\u0086\4\u0087\t\u0087\4\u0088\t\u0088\4\u0089\t\u0089"+ + "\4\u008a\t\u008a\4\u008b\t\u008b\4\u008c\t\u008c\4\u008d\t\u008d\4\u008e"+ + "\t\u008e\4\u008f\t\u008f\4\u0090\t\u0090\4\u0091\t\u0091\4\u0092\t\u0092"+ + "\4\u0093\t\u0093\4\u0094\t\u0094\4\u0095\t\u0095\4\u0096\t\u0096\4\u0097"+ + "\t\u0097\4\u0098\t\u0098\4\u0099\t\u0099\4\u009a\t\u009a\4\u009b\t\u009b"+ + "\4\u009c\t\u009c\4\u009d\t\u009d\4\u009e\t\u009e\4\u009f\t\u009f\4\u00a0"+ + "\t\u00a0\4\u00a1\t\u00a1\4\u00a2\t\u00a2\4\u00a3\t\u00a3\4\u00a4\t\u00a4"+ + "\4\u00a5\t\u00a5\3\2\3\2\3\2\3\3\3\3\3\3\3\4\3\4\3\4\3\5\3\5\3\5\7\5\u0157"+ + "\n\5\f\5\16\5\u015a\13\5\3\6\3\6\5\6\u015e\n\6\3\7\3\7\3\7\3\7\3\7\3\7"+ + "\5\7\u0166\n\7\3\b\3\b\3\b\3\b\3\b\3\b\3\b\3\b\3\b\3\b\3\b\5\b\u0173\n"+ + "\b\3\t\3\t\3\n\3\n\3\n\3\n\3\n\3\13\3\13\3\13\7\13\u017f\n\13\f\13\16"+ + "\13\u0182\13\13\3\13\5\13\u0185\n\13\3\f\3\f\3\f\7\f\u018a\n\f\f\f\16"+ + "\f\u018d\13\f\3\f\3\f\3\r\7\r\u0192\n\r\f\r\16\r\u0195\13\r\3\16\3\16"+ + "\3\16\3\16\7\16\u019b\n\16\f\16\16\16\u019e\13\16\3\16\3\16\3\17\3\17"+ + "\3\20\3\20\3\20\3\20\3\20\3\21\3\21\3\21\3\21\3\21\3\22\3\22\3\22\3\22"+ + "\3\22\3\23\3\23\3\23\3\23\3\23\3\24\3\24\3\24\3\24\3\24\5\24\u01bd\n\24"+ + "\3\24\3\24\3\24\3\24\3\25\3\25\5\25\u01c5\n\25\3\26\3\26\3\27\3\27\3\27"+ + "\3\27\3\27\3\30\3\30\3\30\3\30\3\30\3\31\3\31\3\31\3\31\3\31\5\31\u01d8"+ + "\n\31\3\31\3\31\3\32\3\32\3\32\3\32\3\32\3\32\3\32\3\33\3\33\3\33\3\33"+ + "\7\33\u01e7\n\33\f\33\16\33\u01ea\13\33\3\33\3\33\3\34\3\34\3\34\3\34"+ + "\3\35\3\35\3\35\5\35\u01f5\n\35\3\36\3\36\3\36\3\36\3\36\7\36\u01fc\n"+ + "\36\f\36\16\36\u01ff\13\36\3\36\3\36\3\37\3\37\3\37\3\37\3\37\3\37\3\37"+ + "\3\37\3\37\5\37\u020c\n\37\3 \3 \3 \3 \3 \3!\3!\3!\3!\3!\3!\3!\3!\3!\3"+ + "!\3!\5!\u021e\n!\3\"\3\"\3\"\3\"\3\"\5\"\u0225\n\"\3\"\7\"\u0228\n\"\f"+ + "\"\16\"\u022b\13\"\3\"\3\"\5\"\u022f\n\"\3#\3#\3#\3#\3#\3#\3#\3#\5#\u0239"+ + "\n#\3$\5$\u023c\n$\3$\3$\5$\u0240\n$\3%\3%\5%\u0244\n%\3&\3&\3&\3&\3&"+ + "\5&\u024b\n&\3&\5&\u024e\n&\3&\3&\3\'\3\'\3\'\3\'\3\'\3\'\3\'\7\'\u0259"+ + "\n\'\f\'\16\'\u025c\13\'\3\'\3\'\3\'\7\'\u0261\n\'\f\'\16\'\u0264\13\'"+ + "\3\'\5\'\u0267\n\'\3(\5(\u026a\n(\3(\3(\3(\3(\5(\u0270\n(\3)\3)\5)\u0274"+ + "\n)\3)\5)\u0277\n)\3)\3)\3)\3*\3*\3*\3*\3*\5*\u0281\n*\3+\3+\3+\3+\3+"+ + "\5+\u0288\n+\3,\3,\3,\3,\3,\5,\u028f\n,\3,\3,\3-\3-\3-\3-\3-\3.\3.\3."+ + "\5.\u029b\n.\3/\3/\3/\3/\5/\u02a1\n/\3\60\3\60\3\60\3\60\3\60\5\60\u02a8"+ + "\n\60\3\61\3\61\3\61\3\61\3\61\7\61\u02af\n\61\f\61\16\61\u02b2\13\61"+ + "\3\61\3\61\3\61\5\61\u02b7\n\61\3\61\3\61\7\61\u02bb\n\61\f\61\16\61\u02be"+ + "\13\61\3\61\3\61\3\62\3\62\3\62\3\62\5\62\u02c6\n\62\3\63\3\63\3\63\5"+ + "\63\u02cb\n\63\3\64\3\64\3\64\3\64\5\64\u02d1\n\64\3\65\3\65\3\65\3\65"+ + "\3\65\3\66\3\66\3\66\3\66\3\66\5\66\u02dd\n\66\3\67\3\67\3\67\3\67\5\67"+ + "\u02e3\n\67\3\67\3\67\5\67\u02e7\n\67\38\38\38\38\39\39\59\u02ef\n9\3"+ + "9\39\59\u02f3\n9\39\39\3:\3:\5:\u02f9\n:\3;\5;\u02fc\n;\3;\3;\3<\3<\5"+ + "<\u0302\n<\3<\3<\3=\5=\u0307\n=\3=\3=\3>\3>\3>\3>\3>\3>\3>\3>\3>\3>\3"+ + ">\3>\3>\3>\3>\3>\5>\u031b\n>\3>\3>\3>\3>\3>\3>\3>\3>\3>\3>\3>\3>\3>\3"+ + ">\3>\3>\3>\3>\3>\3>\3>\3>\3>\3>\3>\3>\3>\3>\3>\3>\7>\u033b\n>\f>\16>\u033e"+ + "\13>\3?\3?\3?\3?\3?\3?\3?\3?\3?\3?\3?\3?\3?\3?\3?\3?\3?\3?\5?\u0352\n"+ + "?\3@\3@\3@\3A\3A\3A\5A\u035a\nA\3B\3B\3B\3C\3C\3C\3C\7C\u0363\nC\fC\16"+ + "C\u0366\13C\3C\3C\3C\3C\5C\u036c\nC\3D\3D\3D\3D\3D\3D\3D\3D\5D\u0376\n"+ + "D\3E\3E\3E\3E\3E\3E\3E\3E\3E\3E\3E\3E\5E\u0384\nE\3E\3E\3E\3E\3E\3E\3"+ + "E\3E\3E\3E\3E\3E\3E\3E\3E\7E\u0395\nE\fE\16E\u0398\13E\3F\3F\5F\u039c"+ + "\nF\3F\5F\u039f\nF\3F\3F\3G\3G\3G\3G\3G\5G\u03a8\nG\3G\3G\7G\u03ac\nG"+ + "\fG\16G\u03af\13G\3G\3G\3H\3H\3H\3H\3I\5I\u03b8\nI\3I\3I\3I\3I\3I\3I\5"+ + "I\u03c0\nI\3I\3I\3I\3I\5I\u03c6\nI\3J\3J\3J\3J\3J\3J\3J\5J\u03cf\nJ\3"+ + "K\3K\3K\3K\3K\3K\3K\3K\3K\5K\u03da\nK\3L\3L\3L\3M\3M\3M\3M\7M\u03e3\n"+ + "M\fM\16M\u03e6\13M\3M\5M\u03e9\nM\5M\u03eb\nM\3M\3M\3N\3N\3N\3N\3N\3N"+ + "\3N\5N\u03f6\nN\3O\3O\3O\3O\3O\3P\3P\5P\u03ff\nP\3P\3P\5P\u0403\nP\3P"+ + "\5P\u0406\nP\3P\3P\3P\3P\3P\5P\u040d\nP\3P\3P\3Q\3Q\3R\3R\3S\3S\3T\5T"+ + "\u0418\nT\3T\3T\3U\3U\3U\3V\3V\3V\3V\3V\3V\7V\u0425\nV\fV\16V\u0428\13"+ + "V\3V\5V\u042b\nV\3W\5W\u042e\nW\3W\3W\3X\3X\3Y\3Y\3Y\5Y\u0437\nY\3Z\3"+ + "Z\3Z\3Z\3Z\3Z\7Z\u043f\nZ\fZ\16Z\u0442\13Z\3Z\5Z\u0445\nZ\3[\3[\5[\u0449"+ + "\n[\3[\3[\5[\u044d\n[\3\\\3\\\3\\\7\\\u0452\n\\\f\\\16\\\u0455\13\\\3"+ + "]\3]\3]\7]\u045a\n]\f]\16]\u045d\13]\3^\3^\3^\3^\3^\3^\7^\u0465\n^\f^"+ + "\16^\u0468\13^\3^\5^\u046b\n^\3_\3_\5_\u046f\n_\3_\3_\3`\3`\3`\3`\3`\3"+ + "`\7`\u0479\n`\f`\16`\u047c\13`\3`\5`\u047f\n`\3a\3a\5a\u0483\na\3a\3a"+ + "\3b\5b\u0488\nb\3b\3b\3b\6b\u048d\nb\rb\16b\u048e\3c\3c\3c\3c\3c\5c\u0496"+ + "\nc\3d\3d\3e\3e\3e\3e\3f\3f\3f\3g\3g\3g\3g\3h\3h\3i\3i\3i\5i\u04aa\ni"+ + "\3j\3j\5j\u04ae\nj\3k\3k\5k\u04b2\nk\3l\3l\5l\u04b6\nl\3m\3m\3m\3n\3n"+ + "\3o\3o\3o\3p\3p\3p\3p\3p\3p\3p\3p\3p\5p\u04c9\np\3p\3p\3p\3p\5p\u04cf"+ + "\np\5p\u04d1\np\3q\3q\5q\u04d5\nq\3r\3r\5r\u04d9\nr\3r\5r\u04dc\nr\3r"+ + "\3r\5r\u04e0\nr\5r\u04e2\nr\3r\3r\7r\u04e6\nr\fr\16r\u04e9\13r\3r\3r\3"+ + "s\3s\3s\5s\u04f0\ns\3t\3t\3t\5t\u04f5\nt\3u\3u\3u\3u\3u\3u\3u\3u\3u\5"+ + "u\u0500\nu\3u\3u\7u\u0504\nu\fu\16u\u0507\13u\3u\3u\3v\3v\5v\u050d\nv"+ + "\3v\3v\3v\3v\3v\3v\3w\3w\3w\5w\u0518\nw\3x\3x\3x\5x\u051d\nx\3y\3y\5y"+ + "\u0521\ny\3y\3y\3y\5y\u0526\ny\7y\u0528\ny\fy\16y\u052b\13y\3z\3z\3z\7"+ + "z\u0530\nz\fz\16z\u0533\13z\3z\3z\3{\3{\3{\5{\u053a\n{\3|\3|\3|\5|\u053f"+ + "\n|\3|\5|\u0542\n|\3}\3}\3}\3}\3}\3}\5}\u054a\n}\3}\3}\3~\3~\3~\3~\5~"+ + "\u0552\n~\3~\3~\3\177\5\177\u0557\n\177\3\177\3\177\5\177\u055b\n\177"+ + "\3\177\3\177\5\177\u055f\n\177\3\u0080\3\u0080\3\u0080\3\u0080\3\u0080"+ + "\3\u0080\5\u0080\u0567\n\u0080\3\u0080\3\u0080\3\u0080\3\u0081\3\u0081"+ + "\3\u0081\3\u0082\3\u0082\5\u0082\u0571\n\u0082\3\u0083\3\u0083\3\u0083"+ + "\3\u0083\3\u0083\3\u0084\3\u0084\3\u0085\3\u0085\3\u0086\3\u0086\3\u0086"+ + "\3\u0087\3\u0087\3\u0087\3\u0087\3\u0088\3\u0088\3\u0088\3\u0088\3\u0088"+ + "\3\u0088\3\u0089\3\u0089\3\u0089\3\u0089\3\u0089\5\u0089\u058e\n\u0089"+ + "\3\u0089\3\u0089\3\u008a\3\u008a\3\u008a\3\u008b\3\u008b\3\u008b\3\u008b"+ + "\5\u008b\u0599\n\u008b\3\u008c\3\u008c\5\u008c\u059d\n\u008c\3\u008d\3"+ + "\u008d\3\u008d\3\u008d\7\u008d\u05a3\n\u008d\f\u008d\16\u008d\u05a6\13"+ + "\u008d\3\u008d\5\u008d\u05a9\n\u008d\5\u008d\u05ab\n\u008d\3\u008d\3\u008d"+ + "\3\u008e\3\u008e\3\u008e\3\u008e\5\u008e\u05b3\n\u008e\3\u008e\3\u008e"+ + "\3\u008f\3\u008f\3\u008f\3\u008f\3\u008f\5\u008f\u05bc\n\u008f\3\u0090"+ + "\3\u0090\3\u0090\3\u0090\3\u0090\3\u0090\5\u0090\u05c4\n\u0090\3\u0091"+ + "\3\u0091\3\u0091\5\u0091\u05c9\n\u0091\3\u0092\3\u0092\3\u0093\3\u0093"+ + "\3\u0094\3\u0094\3\u0094\3\u0094\3\u0095\3\u0095\3\u0095\3\u0096\3\u0096"+ + "\3\u0096\5\u0096\u05d9\n\u0096\5\u0096\u05db\n\u0096\3\u0096\3\u0096\3"+ + "\u0097\3\u0097\3\u0097\7\u0097\u05e2\n\u0097\f\u0097\16\u0097\u05e5\13"+ + "\u0097\3\u0098\3\u0098\3\u0098\5\u0098\u05ea\n\u0098\3\u0098\3\u0098\3"+ + "\u0099\3\u0099\5\u0099\u05f0\n\u0099\3\u009a\3\u009a\5\u009a\u05f4\n\u009a"+ + "\3\u009b\3\u009b\3\u009b\3\u009b\3\u009b\7\u009b\u05fb\n\u009b\f\u009b"+ + "\16\u009b\u05fe\13\u009b\3\u009b\3\u009b\3\u009c\3\u009c\3\u009c\3\u009c"+ + "\5\u009c\u0606\n\u009c\3\u009c\5\u009c\u0609\n\u009c\3\u009d\3\u009d\3"+ + "\u009e\5\u009e\u060e\n\u009e\3\u009e\3\u009e\3\u009f\3\u009f\3\u009f\3"+ + "\u009f\3\u00a0\3\u00a0\3\u00a0\3\u00a0\3\u00a1\3\u00a1\3\u00a1\3\u00a1"+ + "\3\u00a1\3\u00a2\3\u00a2\3\u00a2\3\u00a2\3\u00a2\5\u00a2\u0624\n\u00a2"+ + "\5\u00a2\u0626\n\u00a2\3\u00a2\5\u00a2\u0629\n\u00a2\3\u00a2\5\u00a2\u062c"+ + "\n\u00a2\5\u00a2\u062e\n\u00a2\3\u00a2\3\u00a2\3\u00a3\3\u00a3\3\u00a3"+ + "\3\u00a3\3\u00a4\3\u00a4\3\u00a5\3\u00a5\3\u00a5\3\u00a5\5\u00a5\u063c"+ + "\n\u00a5\3\u00a5\3\u0229\4z\u0088\u00a6\2\4\6\b\n\f\16\20\22\24\26\30"+ + "\32\34\36 \"$&(*,.\60\62\64\668:<>@BDFHJLNPRTVXZ\\^`bdfhjlnprtvxz|~\u0080"+ + "\u0082\u0084\u0086\u0088\u008a\u008c\u008e\u0090\u0092\u0094\u0096\u0098"+ + "\u009a\u009c\u009e\u00a0\u00a2\u00a4\u00a6\u00a8\u00aa\u00ac\u00ae\u00b0"+ + "\u00b2\u00b4\u00b6\u00b8\u00ba\u00bc\u00be\u00c0\u00c2\u00c4\u00c6\u00c8"+ + "\u00ca\u00cc\u00ce\u00d0\u00d2\u00d4\u00d6\u00d8\u00da\u00dc\u00de\u00e0"+ + "\u00e2\u00e4\u00e6\u00e8\u00ea\u00ec\u00ee\u00f0\u00f2\u00f4\u00f6\u00f8"+ + "\u00fa\u00fc\u00fe\u0100\u0102\u0104\u0106\u0108\u010a\u010c\u010e\u0110"+ + "\u0112\u0114\u0116\u0118\u011a\u011c\u011e\u0120\u0122\u0124\u0126\u0128"+ + "\u012a\u012c\u012e\u0130\u0132\u0134\u0136\u0138\u013a\u013c\u013e\u0140"+ + "\u0142\u0144\u0146\u0148\2\25\3\2\27\30\3\2\7\n\3\2>?\3\2\')\4\2\')++"+ + "\3\2y\177\3\2\24\25\4\2tx}~\6\2\"\"ggssz|\3\2\36 \3\2\33\35\3\2mr\6\2"+ + ",,//\62\62SS\4\2sxz~\4\2[[ff\3\2gh\4\2dd\u0095\u0095\4\2\u0080\u0083\u0085"+ + "\u0086\3\2\u008c\u008d\2\u0693\2\u014a\3\2\2\2\4\u014d\3\2\2\2\6\u0150"+ + "\3\2\2\2\b\u0153\3\2\2\2\n\u015b\3\2\2\2\f\u0165\3\2\2\2\16\u0172\3\2"+ + "\2\2\20\u0174\3\2\2\2\22\u0176\3\2\2\2\24\u017b\3\2\2\2\26\u0186\3\2\2"+ + "\2\30\u0193\3\2\2\2\32\u0196\3\2\2\2\34\u01a1\3\2\2\2\36\u01a3\3\2\2\2"+ + " \u01a8\3\2\2\2\"\u01ad\3\2\2\2$\u01b2\3\2\2\2&\u01b7\3\2\2\2(\u01c4\3"+ + "\2\2\2*\u01c6\3\2\2\2,\u01c8\3\2\2\2.\u01cd\3\2\2\2\60\u01d2\3\2\2\2\62"+ + "\u01db\3\2\2\2\64\u01e2\3\2\2\2\66\u01ed\3\2\2\28\u01f4\3\2\2\2:\u01f6"+ + "\3\2\2\2<\u020b\3\2\2\2>\u020d\3\2\2\2@\u021d\3\2\2\2B\u0229\3\2\2\2D"+ + "\u0238\3\2\2\2F\u023b\3\2\2\2H\u0243\3\2\2\2J\u0245\3\2\2\2L\u0251\3\2"+ + "\2\2N\u0269\3\2\2\2P\u0271\3\2\2\2R\u0280\3\2\2\2T\u0282\3\2\2\2V\u0289"+ + "\3\2\2\2X\u0292\3\2\2\2Z\u0297\3\2\2\2\\\u029c\3\2\2\2^\u02a2\3\2\2\2"+ + "`\u02a9\3\2\2\2b\u02c5\3\2\2\2d\u02c7\3\2\2\2f\u02cc\3\2\2\2h\u02d2\3"+ + "\2\2\2j\u02d7\3\2\2\2l\u02de\3\2\2\2n\u02e8\3\2\2\2p\u02ec\3\2\2\2r\u02f8"+ + "\3\2\2\2t\u02fb\3\2\2\2v\u02ff\3\2\2\2x\u0306\3\2\2\2z\u031a\3\2\2\2|"+ + "\u0351\3\2\2\2~\u0353\3\2\2\2\u0080\u0356\3\2\2\2\u0082\u035b\3\2\2\2"+ + "\u0084\u0364\3\2\2\2\u0086\u0375\3\2\2\2\u0088\u0383\3\2\2\2\u008a\u0399"+ + "\3\2\2\2\u008c\u03a2\3\2\2\2\u008e\u03b2\3\2\2\2\u0090\u03c5\3\2\2\2\u0092"+ + "\u03ce\3\2\2\2\u0094\u03d9\3\2\2\2\u0096\u03db\3\2\2\2\u0098\u03de\3\2"+ + "\2\2\u009a\u03f5\3\2\2\2\u009c\u03f7\3\2\2\2\u009e\u03fc\3\2\2\2\u00a0"+ + "\u0410\3\2\2\2\u00a2\u0412\3\2\2\2\u00a4\u0414\3\2\2\2\u00a6\u0417\3\2"+ + "\2\2\u00a8\u041b\3\2\2\2\u00aa\u041e\3\2\2\2\u00ac\u042d\3\2\2\2\u00ae"+ + "\u0431\3\2\2\2\u00b0\u0436\3\2\2\2\u00b2\u0438\3\2\2\2\u00b4\u0446\3\2"+ + "\2\2\u00b6\u044e\3\2\2\2\u00b8\u0456\3\2\2\2\u00ba\u045e\3\2\2\2\u00bc"+ + "\u046c\3\2\2\2\u00be\u0472\3\2\2\2\u00c0\u0480\3\2\2\2\u00c2\u048c\3\2"+ + "\2\2\u00c4\u0495\3\2\2\2\u00c6\u0497\3\2\2\2\u00c8\u0499\3\2\2\2\u00ca"+ + "\u049d\3\2\2\2\u00cc\u04a0\3\2\2\2\u00ce\u04a4\3\2\2\2\u00d0\u04a6\3\2"+ + "\2\2\u00d2\u04ab\3\2\2\2\u00d4\u04af\3\2\2\2\u00d6\u04b3\3\2\2\2\u00d8"+ + "\u04b7\3\2\2\2\u00da\u04ba\3\2\2\2\u00dc\u04bc\3\2\2\2\u00de\u04bf\3\2"+ + "\2\2\u00e0\u04d4\3\2\2\2\u00e2\u04d6\3\2\2\2\u00e4\u04ec\3\2\2\2\u00e6"+ + "\u04f4\3\2\2\2\u00e8\u04f6\3\2\2\2\u00ea\u050c\3\2\2\2\u00ec\u0514\3\2"+ + "\2\2\u00ee\u051c\3\2\2\2\u00f0\u0520\3\2\2\2\u00f2\u052c\3\2\2\2\u00f4"+ + "\u0536\3\2\2\2\u00f6\u0541\3\2\2\2\u00f8\u0549\3\2\2\2\u00fa\u054d\3\2"+ + "\2\2\u00fc\u0556\3\2\2\2\u00fe\u0566\3\2\2\2\u0100\u056b\3\2\2\2\u0102"+ + "\u0570\3\2\2\2\u0104\u0572\3\2\2\2\u0106\u0577\3\2\2\2\u0108\u0579\3\2"+ + "\2\2\u010a\u057b\3\2\2\2\u010c\u057e\3\2\2\2\u010e\u0582\3\2\2\2\u0110"+ + "\u058d\3\2\2\2\u0112\u0591\3\2\2\2\u0114\u0598\3\2\2\2\u0116\u059c\3\2"+ + "\2\2\u0118\u059e\3\2\2\2\u011a\u05ae\3\2\2\2\u011c\u05bb\3\2\2\2\u011e"+ + "\u05c3\3\2\2\2\u0120\u05c8\3\2\2\2\u0122\u05ca\3\2\2\2\u0124\u05cc\3\2"+ + "\2\2\u0126\u05ce\3\2\2\2\u0128\u05d2\3\2\2\2\u012a\u05d5\3\2\2\2\u012c"+ + "\u05de\3\2\2\2\u012e\u05e9\3\2\2\2\u0130\u05ef\3\2\2\2\u0132\u05f3\3\2"+ + "\2\2\u0134\u05f5\3\2\2\2\u0136\u0605\3\2\2\2\u0138\u060a\3\2\2\2\u013a"+ + "\u060d\3\2\2\2\u013c\u0611\3\2\2\2\u013e\u0615\3\2\2\2\u0140\u0619\3\2"+ + "\2\2\u0142\u061e\3\2\2\2\u0144\u0631\3\2\2\2\u0146\u0635\3\2\2\2\u0148"+ + "\u063b\3\2\2\2\u014a\u014b\5z>\2\u014b\u014c\7\2\2\3\u014c\3\3\2\2\2\u014d"+ + "\u014e\5|?\2\u014e\u014f\7\2\2\3\u014f\5\3\2\2\2\u0150\u0151\5\u0092J"+ + "\2\u0151\u0152\7\2\2\3\u0152\7\3\2\2\2\u0153\u0158\5\n\6\2\u0154\u0155"+ + "\7c\2\2\u0155\u0157\5\n\6\2\u0156\u0154\3\2\2\2\u0157\u015a\3\2\2\2\u0158"+ + "\u0156\3\2\2\2\u0158\u0159\3\2\2\2\u0159\t\3\2\2\2\u015a\u0158\3\2\2\2"+ + "\u015b\u015d\7[\2\2\u015c\u015e\79\2\2\u015d\u015c\3\2\2\2\u015d\u015e"+ + "\3\2\2\2\u015e\13\3\2\2\2\u015f\u0160\7\32\2\2\u0160\u0166\5|?\2\u0161"+ + "\u0162\t\2\2\2\u0162\u0166\5\34\17\2\u0163\u0164\t\3\2\2\u0164\u0166\5"+ + "z>\2\u0165\u015f\3\2\2\2\u0165\u0161\3\2\2\2\u0165\u0163\3\2\2\2\u0166"+ + "\r\3\2\2\2\u0167\u0173\5\62\32\2\u0168\u0173\5\60\31\2\u0169\u0173\5."+ + "\30\2\u016a\u0173\5\22\n\2\u016b\u0173\5,\27\2\u016c\u0173\5&\24\2\u016d"+ + "\u0173\5$\23\2\u016e\u0173\5 \21\2\u016f\u0173\5\36\20\2\u0170\u0173\5"+ + "\"\22\2\u0171\u0173\5\20\t\2\u0172\u0167\3\2\2\2\u0172\u0168\3\2\2\2\u0172"+ + "\u0169\3\2\2\2\u0172\u016a\3\2\2\2\u0172\u016b\3\2\2\2\u0172\u016c\3\2"+ + "\2\2\u0172\u016d\3\2\2\2\u0172\u016e\3\2\2\2\u0172\u016f\3\2\2\2\u0172"+ + "\u0170\3\2\2\2\u0172\u0171\3\2\2\2\u0173\17\3\2\2\2\u0174\u0175\t\4\2"+ + "\2\u0175\21\3\2\2\2\u0176\u0177\7T\2\2\u0177\u0178\7`\2\2\u0178\u0179"+ + "\5\u0092J\2\u0179\u017a\7a\2\2\u017a\23\3\2\2\2\u017b\u0180\5\26\f\2\u017c"+ + "\u017d\7c\2\2\u017d\u017f\5\26\f\2\u017e\u017c\3\2\2\2\u017f\u0182\3\2"+ + "\2\2\u0180\u017e\3\2\2\2\u0180\u0181\3\2\2\2\u0181\u0184\3\2\2\2\u0182"+ + "\u0180\3\2\2\2\u0183\u0185\7c\2\2\u0184\u0183\3\2\2\2\u0184\u0185\3\2"+ + "\2\2\u0185\25\3\2\2\2\u0186\u018b\7[\2\2\u0187\u0188\7c\2\2\u0188\u018a"+ + "\7[\2\2\u0189\u0187\3\2\2\2\u018a\u018d\3\2\2\2\u018b\u0189\3\2\2\2\u018b"+ + "\u018c\3\2\2\2\u018c\u018e\3\2\2\2\u018d\u018b\3\2\2\2\u018e\u018f\5\u0108"+ + "\u0085\2\u018f\27\3\2\2\2\u0190\u0192\5\32\16\2\u0191\u0190\3\2\2\2\u0192"+ + "\u0195\3\2\2\2\u0193\u0191\3\2\2\2\u0193\u0194\3\2\2\2\u0194\31\3\2\2"+ + "\2\u0195\u0193\3\2\2\2\u0196\u0197\7^\2\2\u0197\u019c\5z>\2\u0198\u0199"+ + "\7c\2\2\u0199\u019b\5z>\2\u019a\u0198\3\2\2\2\u019b\u019e\3\2\2\2\u019c"+ + "\u019a\3\2\2\2\u019c\u019d\3\2\2\2\u019d\u019f\3\2\2\2\u019e\u019c\3\2"+ + "\2\2\u019f\u01a0\7_\2\2\u01a0\33\3\2\2\2\u01a1\u01a2\5\u0088E\2\u01a2"+ + "\35\3\2\2\2\u01a3\u01a4\7\60\2\2\u01a4\u01a5\7\\\2\2\u01a5\u01a6\5z>\2"+ + "\u01a6\u01a7\7]\2\2\u01a7\37\3\2\2\2\u01a8\u01a9\7\64\2\2\u01a9\u01aa"+ + "\7`\2\2\u01aa\u01ab\5\u0092J\2\u01ab\u01ac\7a\2\2\u01ac!\3\2\2\2\u01ad"+ + "\u01ae\7\61\2\2\u01ae\u01af\7\\\2\2\u01af\u01b0\5z>\2\u01b0\u01b1\7]\2"+ + "\2\u01b1#\3\2\2\2\u01b2\u01b3\t\5\2\2\u01b3\u01b4\7\\\2\2\u01b4\u01b5"+ + "\5z>\2\u01b5\u01b6\7]\2\2\u01b6%\3\2\2\2\u01b7\u01bc\7\22\2\2\u01b8\u01b9"+ + "\7`\2\2\u01b9\u01ba\5(\25\2\u01ba\u01bb\7a\2\2\u01bb\u01bd\3\2\2\2\u01bc"+ + "\u01b8\3\2\2\2\u01bc\u01bd\3\2\2\2\u01bd\u01be\3\2\2\2\u01be\u01bf\7\\"+ + "\2\2\u01bf\u01c0\5z>\2\u01c0\u01c1\7]\2\2\u01c1\'\3\2\2\2\u01c2\u01c5"+ + "\5*\26\2\u01c3\u01c5\7\23\2\2\u01c4\u01c2\3\2\2\2\u01c4\u01c3\3\2\2\2"+ + "\u01c5)\3\2\2\2\u01c6\u01c7\7[\2\2\u01c7+\3\2\2\2\u01c8\u01c9\7\67\2\2"+ + "\u01c9\u01ca\7\\\2\2\u01ca\u01cb\5z>\2\u01cb\u01cc\7]\2\2\u01cc-\3\2\2"+ + "\2\u01cd\u01ce\7\66\2\2\u01ce\u01cf\7\\\2\2\u01cf\u01d0\5z>\2\u01d0\u01d1"+ + "\7]\2\2\u01d1/\3\2\2\2\u01d2\u01d3\7\26\2\2\u01d3\u01d4\7\\\2\2\u01d4"+ + "\u01d7\5z>\2\u01d5\u01d6\7c\2\2\u01d6\u01d8\5z>\2\u01d7\u01d5\3\2\2\2"+ + "\u01d7\u01d8\3\2\2\2\u01d8\u01d9\3\2\2\2\u01d9\u01da\7]\2\2\u01da\61\3"+ + "\2\2\2\u01db\u01dc\t\5\2\2\u01dc\u01dd\7`\2\2\u01dd\u01de\5z>\2\u01de"+ + "\u01df\7:\2\2\u01df\u01e0\5z>\2\u01e0\u01e1\7a\2\2\u01e1\63\3\2\2\2\u01e2"+ + "\u01e3\7`\2\2\u01e3\u01e8\5\66\34\2\u01e4\u01e5\7c\2\2\u01e5\u01e7\5\66"+ + "\34\2\u01e6\u01e4\3\2\2\2\u01e7\u01ea\3\2\2\2\u01e8\u01e6\3\2\2\2\u01e8"+ + "\u01e9\3\2\2\2\u01e9\u01eb\3\2\2\2\u01ea\u01e8\3\2\2\2\u01eb\u01ec\7a"+ + "\2\2\u01ec\65\3\2\2\2\u01ed\u01ee\5z>\2\u01ee\u01ef\7b\2\2\u01ef\u01f0"+ + "\5z>\2\u01f0\67\3\2\2\2\u01f1\u01f5\5@!\2\u01f2\u01f5\5> \2\u01f3\u01f5"+ + "\5:\36\2\u01f4\u01f1\3\2\2\2\u01f4\u01f2\3\2\2\2\u01f4\u01f3\3\2\2\2\u01f5"+ + "9\3\2\2\2\u01f6\u01f7\7\62\2\2\u01f7\u01fd\7^\2\2\u01f8\u01f9\5<\37\2"+ + "\u01f9\u01fa\5\u0148\u00a5\2\u01fa\u01fc\3\2\2\2\u01fb\u01f8\3\2\2\2\u01fc"+ + "\u01ff\3\2\2\2\u01fd\u01fb\3\2\2\2\u01fd\u01fe\3\2\2\2\u01fe\u0200\3\2"+ + "\2\2\u01ff\u01fd\3\2\2\2\u0200\u0201\7_\2\2\u0201;\3\2\2\2\u0202\u0203"+ + "\7C\2\2\u0203\u0204\7[\2\2\u0204\u020c\5\u0114\u008b\2\u0205\u0206\7\63"+ + "\2\2\u0206\u0207\7^\2\2\u0207\u0208\5z>\2\u0208\u0209\5\u0148\u00a5\2"+ + "\u0209\u020a\7_\2\2\u020a\u020c\3\2\2\2\u020b\u0202\3\2\2\2\u020b\u0205"+ + "\3\2\2\2\u020c=\3\2\2\2\u020d\u020e\7\32\2\2\u020e\u020f\7`\2\2\u020f"+ + "\u0210\7a\2\2\u0210\u0211\5\u0108\u0085\2\u0211?\3\2\2\2\u0212\u0213\t"+ + "\6\2\2\u0213\u0214\7`\2\2\u0214\u0215\5\u0092J\2\u0215\u0216\7a\2\2\u0216"+ + "\u021e\3\2\2\2\u0217\u0218\7*\2\2\u0218\u0219\7`\2\2\u0219\u021a\5\u0092"+ + "J\2\u021a\u021b\7a\2\2\u021b\u021c\5\u0092J\2\u021c\u021e\3\2\2\2\u021d"+ + "\u0212\3\2\2\2\u021d\u0217\3\2\2\2\u021eA\3\2\2\2\u021f\u0225\5D#\2\u0220"+ + "\u0221\7\20\2\2\u0221\u0225\b\"\1\2\u0222\u0223\7@\2\2\u0223\u0225\b\""+ + "\1\2\u0224\u021f\3\2\2\2\u0224\u0220\3\2\2\2\u0224\u0222\3\2\2\2\u0225"+ + "\u0226\3\2\2\2\u0226\u0228\5\u0148\u00a5\2\u0227\u0224\3\2\2\2\u0228\u022b"+ + "\3\2\2\2\u0229\u022a\3\2\2\2\u0229\u0227\3\2\2\2\u022a\u022e\3\2\2\2\u022b"+ + "\u0229\3\2\2\2\u022c\u022d\7\20\2\2\u022d\u022f\b\"\1\2\u022e\u022c\3"+ + "\2\2\2\u022e\u022f\3\2\2\2\u022fC\3\2\2\2\u0230\u0231\7\13\2\2\u0231\u0239"+ + "\5H%\2\u0232\u0233\7\f\2\2\u0233\u0239\5H%\2\u0234\u0235\7\r\2\2\u0235"+ + "\u0239\5H%\2\u0236\u0237\7\17\2\2\u0237\u0239\5F$\2\u0238\u0230\3\2\2"+ + "\2\u0238\u0232\3\2\2\2\u0238\u0234\3\2\2\2\u0238\u0236\3\2\2\2\u0239E"+ + "\3\2\2\2\u023a\u023c\5\u00b8]\2\u023b\u023a\3\2\2\2\u023b\u023c\3\2\2"+ + "\2\u023c\u023f\3\2\2\2\u023d\u023e\7R\2\2\u023e\u0240\5z>\2\u023f\u023d"+ + "\3\2\2\2\u023f\u0240\3\2\2\2\u0240G\3\2\2\2\u0241\u0244\3\2\2\2\u0242"+ + "\u0244\5z>\2\u0243\u0241\3\2\2\2\u0243\u0242\3\2\2\2\u0244I\3\2\2\2\u0245"+ + "\u024a\7^\2\2\u0246\u0247\78\2\2\u0247\u0248\5\u00b6\\\2\u0248\u0249\5"+ + "\u0148\u00a5\2\u0249\u024b\3\2\2\2\u024a\u0246\3\2\2\2\u024a\u024b\3\2"+ + "\2\2\u024b\u024d\3\2\2\2\u024c\u024e\5\u00c2b\2\u024d\u024c\3\2\2\2\u024d"+ + "\u024e\3\2\2\2\u024e\u024f\3\2\2\2\u024f\u0250\7_\2\2\u0250K\3\2\2\2\u0251"+ + "\u0252\5\u0092J\2\u0252\u0253\7\21\2\2\u0253\u0266\5\u0092J\2\u0254\u025a"+ + "\7^\2\2\u0255\u0256\5T+\2\u0256\u0257\5\u0148\u00a5\2\u0257\u0259\3\2"+ + "\2\2\u0258\u0255\3\2\2\2\u0259\u025c\3\2\2\2\u025a\u0258\3\2\2\2\u025a"+ + "\u025b\3\2\2\2\u025b\u0262\3\2\2\2\u025c\u025a\3\2\2\2\u025d\u025e\5N"+ + "(\2\u025e\u025f\5\u0148\u00a5\2\u025f\u0261\3\2\2\2\u0260\u025d\3\2\2"+ + "\2\u0261\u0264\3\2\2\2\u0262\u0260\3\2\2\2\u0262\u0263\3\2\2\2\u0263\u0265"+ + "\3\2\2\2\u0264\u0262\3\2\2\2\u0265\u0267\7_\2\2\u0266\u0254\3\2\2\2\u0266"+ + "\u0267\3\2\2\2\u0267M\3\2\2\2\u0268\u026a\7\20\2\2\u0269\u0268\3\2\2\2"+ + "\u0269\u026a\3\2\2\2\u026a\u026b\3\2\2\2\u026b\u026c\5P)\2\u026c\u026d"+ + "\7[\2\2\u026d\u026f\5\u0114\u008b\2\u026e\u0270\5\u00c0a\2\u026f\u026e"+ + "\3\2\2\2\u026f\u0270\3\2\2\2\u0270O\3\2\2\2\u0271\u0273\7\\\2\2\u0272"+ + "\u0274\7[\2\2\u0273\u0272\3\2\2\2\u0273\u0274\3\2\2\2\u0274\u0276\3\2"+ + "\2\2\u0275\u0277\7}\2\2\u0276\u0275\3\2\2\2\u0276\u0277\3\2\2\2\u0277"+ + "\u0278\3\2\2\2\u0278\u0279\5\u0102\u0082\2\u0279\u027a\7]\2\2\u027aQ\3"+ + "\2\2\2\u027b\u0281\5\u0088E\2\u027c\u027d\5\u0092J\2\u027d\u027e\7f\2"+ + "\2\u027e\u027f\7[\2\2\u027f\u0281\3\2\2\2\u0280\u027b\3\2\2\2\u0280\u027c"+ + "\3\2\2\2\u0281S\3\2\2\2\u0282\u0283\7\65\2\2\u0283\u0284\7[\2\2\u0284"+ + "\u0287\7i\2\2\u0285\u0288\5R*\2\u0286\u0288\5\u0124\u0093\2\u0287\u0285"+ + "\3\2\2\2\u0287\u0286\3\2\2\2\u0288U\3\2\2\2\u0289\u028a\7.\2\2\u028a\u028b"+ + "\7\\\2\2\u028b\u028e\5\u0092J\2\u028c\u028d\7c\2\2\u028d\u028f\5\u00b8"+ + "]\2\u028e\u028c\3\2\2\2\u028e\u028f\3\2\2\2\u028f\u0290\3\2\2\2\u0290"+ + "\u0291\7]\2\2\u0291W\3\2\2\2\u0292\u0293\7-\2\2\u0293\u0294\7\\\2\2\u0294"+ + "\u0295\5\u0092J\2\u0295\u0296\7]\2\2\u0296Y\3\2\2\2\u0297\u029a\5B\"\2"+ + "\u0298\u029b\5\\/\2\u0299\u029b\5^\60\2\u029a\u0298\3\2\2\2\u029a\u0299"+ + "\3\2\2\2\u029b[\3\2\2\2\u029c\u029d\7C\2\2\u029d\u029e\7[\2\2\u029e\u02a0"+ + "\5\u0114\u008b\2\u029f\u02a1\5J&\2\u02a0\u029f\3\2\2\2\u02a0\u02a1\3\2"+ + "\2\2\u02a1]\3\2\2\2\u02a2\u02a3\7C\2\2\u02a3\u02a4\5p9\2\u02a4\u02a5\7"+ + "[\2\2\u02a5\u02a7\5\u0114\u008b\2\u02a6\u02a8\5J&\2\u02a7\u02a6\3\2\2"+ + "\2\u02a7\u02a8\3\2\2\2\u02a8_\3\2\2\2\u02a9\u02aa\5\u00a8U\2\u02aa\u02b0"+ + "\5\u0148\u00a5\2\u02ab\u02ac\5\u00aaV\2\u02ac\u02ad\5\u0148\u00a5\2\u02ad"+ + "\u02af\3\2\2\2\u02ae\u02ab\3\2\2\2\u02af\u02b2\3\2\2\2\u02b0\u02ae\3\2"+ + "\2\2\u02b0\u02b1\3\2\2\2\u02b1\u02bc\3\2\2\2\u02b2\u02b0\3\2\2\2\u02b3"+ + "\u02b7\5Z.\2\u02b4\u02b7\5\u00b0Y\2\u02b5\u02b7\5b\62\2\u02b6\u02b3\3"+ + "\2\2\2\u02b6\u02b4\3\2\2\2\u02b6\u02b5\3\2\2\2\u02b7\u02b8\3\2\2\2\u02b8"+ + "\u02b9\5\u0148\u00a5\2\u02b9\u02bb\3\2\2\2\u02ba\u02b6\3\2\2\2\u02bb\u02be"+ + "\3\2\2\2\u02bc\u02ba\3\2\2\2\u02bc\u02bd\3\2\2\2\u02bd\u02bf\3\2\2\2\u02be"+ + "\u02bc\3\2\2\2\u02bf\u02c0\7\2\2\3\u02c0a\3\2\2\2\u02c1\u02c6\5L\'\2\u02c2"+ + "\u02c6\5f\64\2\u02c3\u02c6\5j\66\2\u02c4\u02c6\5d\63\2\u02c5\u02c1\3\2"+ + "\2\2\u02c5\u02c2\3\2\2\2\u02c5\u02c3\3\2\2\2\u02c5\u02c4\3\2\2\2\u02c6"+ + "c\3\2\2\2\u02c7\u02ca\7\32\2\2\u02c8\u02cb\5Z.\2\u02c9\u02cb\5\u00b0Y"+ + "\2\u02ca\u02c8\3\2\2\2\u02ca\u02c9\3\2\2\2\u02cbe\3\2\2\2\u02cc\u02cd"+ + "\7\65\2\2\u02cd\u02ce\7[\2\2\u02ce\u02d0\5\u0118\u008d\2\u02cf\u02d1\5"+ + "h\65\2\u02d0\u02cf\3\2\2\2\u02d0\u02d1\3\2\2\2\u02d1g\3\2\2\2\u02d2\u02d3"+ + "\7^\2\2\u02d3\u02d4\5z>\2\u02d4\u02d5\5\u0148\u00a5\2\u02d5\u02d6\7_\2"+ + "\2\u02d6i\3\2\2\2\u02d7\u02d8\7\65\2\2\u02d8\u02d9\5p9\2\u02d9\u02da\7"+ + "[\2\2\u02da\u02dc\5\u0118\u008d\2\u02db\u02dd\5h\65\2\u02dc\u02db\3\2"+ + "\2\2\u02dc\u02dd\3\2\2\2\u02ddk\3\2\2\2\u02de\u02e6\5\b\5\2\u02df\u02e2"+ + "\5\u0092J\2\u02e0\u02e1\7b\2\2\u02e1\u02e3\5\u00b8]\2\u02e2\u02e0\3\2"+ + "\2\2\u02e2\u02e3\3\2\2\2\u02e3\u02e7\3\2\2\2\u02e4\u02e5\7b\2\2\u02e5"+ + "\u02e7\5\u00b8]\2\u02e6\u02df\3\2\2\2\u02e6\u02e4\3\2\2\2\u02e7m\3\2\2"+ + "\2\u02e8\u02e9\5\b\5\2\u02e9\u02ea\7i\2\2\u02ea\u02eb\5\u00b8]\2\u02eb"+ + "o\3\2\2\2\u02ec\u02ee\7\\\2\2\u02ed\u02ef\5\n\6\2\u02ee\u02ed\3\2\2\2"+ + "\u02ee\u02ef\3\2\2\2\u02ef\u02f0\3\2\2\2\u02f0\u02f2\5\u0092J\2\u02f1"+ + "\u02f3\7c\2\2\u02f2\u02f1\3\2\2\2\u02f2\u02f3\3\2\2\2\u02f3\u02f4\3\2"+ + "\2\2\u02f4\u02f5\7]\2\2\u02f5q\3\2\2\2\u02f6\u02f9\5t;\2\u02f7\u02f9\5"+ + "v<\2\u02f8\u02f6\3\2\2\2\u02f8\u02f7\3\2\2\2\u02f9s\3\2\2\2\u02fa\u02fc"+ + "\5\u00b6\\\2\u02fb\u02fa\3\2\2\2\u02fb\u02fc\3\2\2\2\u02fc\u02fd\3\2\2"+ + "\2\u02fd\u02fe\5x=\2\u02feu\3\2\2\2\u02ff\u0301\7\32\2\2\u0300\u0302\5"+ + "\u00b6\\\2\u0301\u0300\3\2\2\2\u0301\u0302\3\2\2\2\u0302\u0303\3\2\2\2"+ + "\u0303\u0304\5x=\2\u0304w\3\2\2\2\u0305\u0307\7j\2\2\u0306\u0305\3\2\2"+ + "\2\u0306\u0307\3\2\2\2\u0307\u0308\3\2\2\2\u0308\u0309\5\u0092J\2\u0309"+ + "y\3\2\2\2\u030a\u030b\b>\1\2\u030b\u030c\t\7\2\2\u030c\u031b\5z>\17\u030d"+ + "\u031b\5\u0088E\2\u030e\u030f\7\31\2\2\u030f\u0310\5\34\17\2\u0310\u0311"+ + "\7\33\2\2\u0311\u0312\5z>\4\u0312\u031b\3\2\2\2\u0313\u0314\t\b\2\2\u0314"+ + "\u0315\5\24\13\2\u0315\u0316\7e\2\2\u0316\u0317\7e\2\2\u0317\u0318\5\30"+ + "\r\2\u0318\u0319\5z>\3\u0319\u031b\3\2\2\2\u031a\u030a\3\2\2\2\u031a\u030d"+ + "\3\2\2\2\u031a\u030e\3\2\2\2\u031a\u0313\3\2\2\2\u031b\u033c\3\2\2\2\u031c"+ + "\u031d\f\r\2\2\u031d\u031e\t\t\2\2\u031e\u033b\5z>\16\u031f\u0320\f\f"+ + "\2\2\u0320\u0321\t\n\2\2\u0321\u033b\5z>\r\u0322\u0323\f\13\2\2\u0323"+ + "\u0324\t\13\2\2\u0324\u033b\5z>\f\u0325\u0326\f\n\2\2\u0326\u0327\t\f"+ + "\2\2\u0327\u033b\5z>\13\u0328\u0329\f\t\2\2\u0329\u032a\t\r\2\2\u032a"+ + "\u033b\5z>\n\u032b\u032c\f\b\2\2\u032c\u032d\7l\2\2\u032d\u033b\5z>\t"+ + "\u032e\u032f\f\7\2\2\u032f\u0330\7k\2\2\u0330\u033b\5z>\b\u0331\u0332"+ + "\f\6\2\2\u0332\u0333\7!\2\2\u0333\u033b\5z>\6\u0334\u0335\f\5\2\2\u0335"+ + "\u0336\7$\2\2\u0336\u0337\5z>\2\u0337\u0338\7e\2\2\u0338\u0339\5z>\5\u0339"+ + "\u033b\3\2\2\2\u033a\u031c\3\2\2\2\u033a\u031f\3\2\2\2\u033a\u0322\3\2"+ + "\2\2\u033a\u0325\3\2\2\2\u033a\u0328\3\2\2\2\u033a\u032b\3\2\2\2\u033a"+ + "\u032e\3\2\2\2\u033a\u0331\3\2\2\2\u033a\u0334\3\2\2\2\u033b\u033e\3\2"+ + "\2\2\u033c\u033a\3\2\2\2\u033c\u033d\3\2\2\2\u033d{\3\2\2\2\u033e\u033c"+ + "\3\2\2\2\u033f\u0352\5\f\7\2\u0340\u0352\5\u0080A\2\u0341\u0352\5~@\2"+ + "\u0342\u0352\5\u00b0Y\2\u0343\u0352\5\u00d0i\2\u0344\u0352\5\u00c4c\2"+ + "\u0345\u0352\5\u0100\u0081\2\u0346\u0352\5\u00d2j\2\u0347\u0352\5\u00d4"+ + "k\2\u0348\u0352\5\u00d6l\2\u0349\u0352\5\u00d8m\2\u034a\u0352\5\u00da"+ + "n\2\u034b\u0352\5\u00c0a\2\u034c\u0352\5\u00dep\2\u034d\u0352\5\u00e0"+ + "q\2\u034e\u0352\5\u00f2z\2\u034f\u0352\5\u0082B\2\u0350\u0352\5\u00dc"+ + "o\2\u0351\u033f\3\2\2\2\u0351\u0340\3\2\2\2\u0351\u0341\3\2\2\2\u0351"+ + "\u0342\3\2\2\2\u0351\u0343\3\2\2\2\u0351\u0344\3\2\2\2\u0351\u0345\3\2"+ + "\2\2\u0351\u0346\3\2\2\2\u0351\u0347\3\2\2\2\u0351\u0348\3\2\2\2\u0351"+ + "\u0349\3\2\2\2\u0351\u034a\3\2\2\2\u0351\u034b\3\2\2\2\u0351\u034c\3\2"+ + "\2\2\u0351\u034d\3\2\2\2\u0351\u034e\3\2\2\2\u0351\u034f\3\2\2\2\u0351"+ + "\u0350\3\2\2\2\u0352}\3\2\2\2\u0353\u0354\7#\2\2\u0354\u0355\5z>\2\u0355"+ + "\177\3\2\2\2\u0356\u0357\7N\2\2\u0357\u0359\5z>\2\u0358\u035a\5\u00c0"+ + "a\2\u0359\u0358\3\2\2\2\u0359\u035a\3\2\2\2\u035a\u0081\3\2\2\2\u035b"+ + "\u035c\5\u0084C\2\u035c\u035d\5\u00fa~\2\u035d\u0083\3\2\2\2\u035e\u035f"+ + "\7\16\2\2\u035f\u0360\5z>\2\u0360\u0361\5\u0148\u00a5\2\u0361\u0363\3"+ + "\2\2\2\u0362\u035e\3\2\2\2\u0363\u0366\3\2\2\2\u0364\u0362\3\2\2\2\u0364"+ + "\u0365\3\2\2\2\u0365\u036b\3\2\2\2\u0366\u0364\3\2\2\2\u0367\u0368\7\17"+ + "\2\2\u0368\u0369\5F$\2\u0369\u036a\5\u0148\u00a5\2\u036a\u036c\3\2\2\2"+ + "\u036b\u0367\3\2\2\2\u036b\u036c\3\2\2\2\u036c\u0085\3\2\2\2\u036d\u0376"+ + "\7\5\2\2\u036e\u0376\7\6\2\2\u036f\u0376\7Z\2\2\u0370\u0376\5\u0122\u0092"+ + "\2\u0371\u0376\5\u0138\u009d\2\u0372\u0376\7\3\2\2\u0373\u0376\7\u0085"+ + "\2\2\u0374\u0376\7\u0086\2\2\u0375\u036d\3\2\2\2\u0375\u036e\3\2\2\2\u0375"+ + "\u036f\3\2\2\2\u0375\u0370\3\2\2\2\u0375\u0371\3\2\2\2\u0375\u0372\3\2"+ + "\2\2\u0375\u0373\3\2\2\2\u0375\u0374\3\2\2\2\u0376\u0087\3\2\2\2\u0377"+ + "\u0378\bE\1\2\u0378\u0384\5\u011e\u0090\2\u0379\u0384\5\u011a\u008e\2"+ + "\u037a\u0384\5\u0144\u00a3\2\u037b\u0384\5\16\b\2\u037c\u0384\5X-\2\u037d"+ + "\u0384\5V,\2\u037e\u037f\t\16\2\2\u037f\u0380\7\\\2\2\u0380\u0381\5z>"+ + "\2\u0381\u0382\7]\2\2\u0382\u0384\3\2\2\2\u0383\u0377\3\2\2\2\u0383\u0379"+ + "\3\2\2\2\u0383\u037a\3\2\2\2\u0383\u037b\3\2\2\2\u0383\u037c\3\2\2\2\u0383"+ + "\u037d\3\2\2\2\u0383\u037e\3\2\2\2\u0384\u0396\3\2\2\2\u0385\u0386\f\n"+ + "\2\2\u0386\u0387\7f\2\2\u0387\u0395\7[\2\2\u0388\u0389\f\t\2\2\u0389\u0395"+ + "\5\u013e\u00a0\2\u038a\u038b\f\b\2\2\u038b\u0395\5\u009eP\2\u038c\u038d"+ + "\f\7\2\2\u038d\u0395\5\64\33\2\u038e\u038f\f\6\2\2\u038f\u0395\5\u0140"+ + "\u00a1\2\u0390\u0391\f\5\2\2\u0391\u0395\5\u0142\u00a2\2\u0392\u0393\f"+ + "\4\2\2\u0393\u0395\5\u008aF\2\u0394\u0385\3\2\2\2\u0394\u0388\3\2\2\2"+ + "\u0394\u038a\3\2\2\2\u0394\u038c\3\2\2\2\u0394\u038e\3\2\2\2\u0394\u0390"+ + "\3\2\2\2\u0394\u0392\3\2\2\2\u0395\u0398\3\2\2\2\u0396\u0394\3\2\2\2\u0396"+ + "\u0397\3\2\2\2\u0397\u0089\3\2\2\2\u0398\u0396\3\2\2\2\u0399\u039b\7%"+ + "\2\2\u039a\u039c\5\u00b8]\2\u039b\u039a\3\2\2\2\u039b\u039c\3\2\2\2\u039c"+ + "\u039e\3\2\2\2\u039d\u039f\7c\2\2\u039e\u039d\3\2\2\2\u039e\u039f\3\2"+ + "\2\2\u039f\u03a0\3\2\2\2\u03a0\u03a1\7&\2\2\u03a1\u008b\3\2\2\2\u03a2"+ + "\u03a3\7D\2\2\u03a3\u03ad\7^\2\2\u03a4\u03a8\5\u0090I\2\u03a5\u03a8\5"+ + "\u0102\u0082\2\u03a6\u03a8\5\u008eH\2\u03a7\u03a4\3\2\2\2\u03a7\u03a5"+ + "\3\2\2\2\u03a7\u03a6\3\2\2\2\u03a8\u03a9\3\2\2\2\u03a9\u03aa\5\u0148\u00a5"+ + "\2\u03aa\u03ac\3\2\2\2\u03ab\u03a7\3\2\2\2\u03ac\u03af\3\2\2\2\u03ad\u03ab"+ + "\3\2\2\2\u03ad\u03ae\3\2\2\2\u03ae\u03b0\3\2\2\2\u03af\u03ad\3\2\2\2\u03b0"+ + "\u03b1\7_\2\2\u03b1\u008d\3\2\2\2\u03b2\u03b3\7\65\2\2\u03b3\u03b4\7["+ + "\2\2\u03b4\u03b5\5\u0118\u008d\2\u03b5\u008f\3\2\2\2\u03b6\u03b8\7\32"+ + "\2\2\u03b7\u03b6\3\2\2\2\u03b7\u03b8\3\2\2\2\u03b8\u03b9\3\2\2\2\u03b9"+ + "\u03ba\5B\"\2\u03ba\u03bb\7[\2\2\u03bb\u03bc\5\u0118\u008d\2\u03bc\u03bd"+ + "\5\u0116\u008c\2\u03bd\u03c6\3\2\2\2\u03be\u03c0\7\32\2\2\u03bf\u03be"+ + "\3\2\2\2\u03bf\u03c0\3\2\2\2\u03c0\u03c1\3\2\2\2\u03c1\u03c2\5B\"\2\u03c2"+ + "\u03c3\7[\2\2\u03c3\u03c4\5\u0118\u008d\2\u03c4\u03c6\3\2\2\2\u03c5\u03b7"+ + "\3\2\2\2\u03c5\u03bf\3\2\2\2\u03c6\u0091\3\2\2\2\u03c7\u03cf\5\u0102\u0082"+ + "\2\u03c8\u03cf\5\u0094K\2\u03c9\u03cf\58\35\2\u03ca\u03cb\7\\\2\2\u03cb"+ + "\u03cc\5\u0092J\2\u03cc\u03cd\7]\2\2\u03cd\u03cf\3\2\2\2\u03ce\u03c7\3"+ + "\2\2\2\u03ce\u03c8\3\2\2\2\u03ce\u03c9\3\2\2\2\u03ce\u03ca\3\2\2\2\u03cf"+ + "\u0093\3\2\2\2\u03d0\u03da\5\u0104\u0083\2\u03d1\u03da\5\u0134\u009b\2"+ + "\u03d2\u03da\5\u010a\u0086\2\u03d3\u03da\5\u0112\u008a\2\u03d4\u03da\5"+ + "\u008cG\2\u03d5\u03da\5\u010c\u0087\2\u03d6\u03da\5\u010e\u0088\2\u03d7"+ + "\u03da\5\u0110\u0089\2\u03d8\u03da\5\u0096L\2\u03d9\u03d0\3\2\2\2\u03d9"+ + "\u03d1\3\2\2\2\u03d9\u03d2\3\2\2\2\u03d9\u03d3\3\2\2\2\u03d9\u03d4\3\2"+ + "\2\2\u03d9\u03d5\3\2\2\2\u03d9\u03d6\3\2\2\2\u03d9\u03d7\3\2\2\2\u03d9"+ + "\u03d8\3\2\2\2\u03da\u0095\3\2\2\2\u03db\u03dc\7\65\2\2\u03dc\u03dd\5"+ + "\u0098M\2\u03dd\u0097\3\2\2\2\u03de\u03ea\7\\\2\2\u03df\u03e4\5\u0092"+ + "J\2\u03e0\u03e1\7c\2\2\u03e1\u03e3\5\u0092J\2\u03e2\u03e0\3\2\2\2\u03e3"+ + "\u03e6\3\2\2\2\u03e4\u03e2\3\2\2\2\u03e4\u03e5\3\2\2\2\u03e5\u03e8\3\2"+ + "\2\2\u03e6\u03e4\3\2\2\2\u03e7\u03e9\7c\2\2\u03e8\u03e7\3\2\2\2\u03e8"+ + "\u03e9\3\2\2\2\u03e9\u03eb\3\2\2\2\u03ea\u03df\3\2\2\2\u03ea\u03eb\3\2"+ + "\2\2\u03eb\u03ec\3\2\2\2\u03ec\u03ed\7]\2\2\u03ed\u0099\3\2\2\2\u03ee"+ + "\u03f6\5\u0134\u009b\2\u03ef\u03f6\5\u0104\u0083\2\u03f0\u03f6\5\u009c"+ + "O\2\u03f1\u03f6\5\u010c\u0087\2\u03f2\u03f6\5\u010e\u0088\2\u03f3\u03f6"+ + "\58\35\2\u03f4\u03f6\5\u0102\u0082\2\u03f5\u03ee\3\2\2\2\u03f5\u03ef\3"+ + "\2\2\2\u03f5\u03f0\3\2\2\2\u03f5\u03f1\3\2\2\2\u03f5\u03f2\3\2\2\2\u03f5"+ + "\u03f3\3\2\2\2\u03f5\u03f4\3\2\2\2\u03f6\u009b\3\2\2\2\u03f7\u03f8\7`"+ + "\2\2\u03f8\u03f9\7j\2\2\u03f9\u03fa\7a\2\2\u03fa\u03fb\5\u0108\u0085\2"+ + "\u03fb\u009d\3\2\2\2\u03fc\u040c\7`\2\2\u03fd\u03ff\5\u00a0Q\2\u03fe\u03fd"+ + "\3\2\2\2\u03fe\u03ff\3\2\2\2\u03ff\u0400\3\2\2\2\u0400\u0402\7e\2\2\u0401"+ + "\u0403\5\u00a2R\2\u0402\u0401\3\2\2\2\u0402\u0403\3\2\2\2\u0403\u040d"+ + "\3\2\2\2\u0404\u0406\5\u00a0Q\2\u0405\u0404\3\2\2\2\u0405\u0406\3\2\2"+ + "\2\u0406\u0407\3\2\2\2\u0407\u0408\7e\2\2\u0408\u0409\5\u00a2R\2\u0409"+ + "\u040a\7e\2\2\u040a\u040b\5\u00a4S\2\u040b\u040d\3\2\2\2\u040c\u03fe\3"+ + "\2\2\2\u040c\u0405\3\2\2\2\u040d\u040e\3\2\2\2\u040e\u040f\7a\2\2\u040f"+ + "\u009f\3\2\2\2\u0410\u0411\5z>\2\u0411\u00a1\3\2\2\2\u0412\u0413\5z>\2"+ + "\u0413\u00a3\3\2\2\2\u0414\u0415\5z>\2\u0415\u00a5\3\2\2\2\u0416\u0418"+ + "\t\17\2\2\u0417\u0416\3\2\2\2\u0417\u0418\3\2\2\2\u0418\u0419\3\2\2\2"+ + "\u0419\u041a\7b\2\2\u041a\u00a7\3\2\2\2\u041b\u041c\7N\2\2\u041c\u041d"+ + "\7[\2\2\u041d\u00a9\3\2\2\2\u041e\u042a\7W\2\2\u041f\u042b\5\u00acW\2"+ + "\u0420\u0426\7\\\2\2\u0421\u0422\5\u00acW\2\u0422\u0423\5\u0148\u00a5"+ + "\2\u0423\u0425\3\2\2\2\u0424\u0421\3\2\2\2\u0425\u0428\3\2\2\2\u0426\u0424"+ + "\3\2\2\2\u0426\u0427\3\2\2\2\u0427\u0429\3\2\2\2\u0428\u0426\3\2\2\2\u0429"+ + "\u042b\7]\2\2\u042a\u041f\3\2\2\2\u042a\u0420\3\2\2\2\u042b\u00ab\3\2"+ + "\2\2\u042c\u042e\t\20\2\2\u042d\u042c\3\2\2\2\u042d\u042e\3\2\2\2\u042e"+ + "\u042f\3\2\2\2\u042f\u0430\5\u00aeX\2\u0430\u00ad\3\2\2\2\u0431\u0432"+ + "\5\u0138\u009d\2\u0432\u00af\3\2\2\2\u0433\u0437\5\u00b2Z\2\u0434\u0437"+ + "\5\u00ba^\2\u0435\u0437\5\u00be`\2\u0436\u0433\3\2\2\2\u0436\u0434\3\2"+ + "\2\2\u0436\u0435\3\2\2\2\u0437\u00b1\3\2\2\2\u0438\u0444\7P\2\2\u0439"+ + "\u0445\5\u00b4[\2\u043a\u0440\7\\\2\2\u043b\u043c\5\u00b4[\2\u043c\u043d"+ + "\5\u0148\u00a5\2\u043d\u043f\3\2\2\2\u043e\u043b\3\2\2\2\u043f\u0442\3"+ + "\2\2\2\u0440\u043e\3\2\2\2\u0440\u0441\3\2\2\2\u0441\u0443\3\2\2\2\u0442"+ + "\u0440\3\2\2\2\u0443\u0445\7]\2\2\u0444\u0439\3\2\2\2\u0444\u043a\3\2"+ + "\2\2\u0445\u00b3\3\2\2\2\u0446\u044c\5\u00b6\\\2\u0447\u0449\5\u0092J"+ + "\2\u0448\u0447\3\2\2\2\u0448\u0449\3\2\2\2\u0449\u044a\3\2\2\2\u044a\u044b"+ + "\7b\2\2\u044b\u044d\5\u00b8]\2\u044c\u0448\3\2\2\2\u044c\u044d\3\2\2\2"+ + "\u044d\u00b5\3\2\2\2\u044e\u0453\7[\2\2\u044f\u0450\7c\2\2\u0450\u0452"+ + "\7[\2\2\u0451\u044f\3\2\2\2\u0452\u0455\3\2\2\2\u0453\u0451\3\2\2\2\u0453"+ + "\u0454\3\2\2\2\u0454\u00b7\3\2\2\2\u0455\u0453\3\2\2\2\u0456\u045b\5z"+ + ">\2\u0457\u0458\7c\2\2\u0458\u045a\5z>\2\u0459\u0457\3\2\2\2\u045a\u045d"+ + "\3\2\2\2\u045b\u0459\3\2\2\2\u045b\u045c\3\2\2\2\u045c\u00b9\3\2\2\2\u045d"+ + "\u045b\3\2\2\2\u045e\u046a\7T\2\2\u045f\u046b\5\u00bc_\2\u0460\u0466\7"+ + "\\\2\2\u0461\u0462\5\u00bc_\2\u0462\u0463\5\u0148\u00a5\2\u0463\u0465"+ + "\3\2\2\2\u0464\u0461\3\2\2\2\u0465\u0468\3\2\2\2\u0466\u0464\3\2\2\2\u0466"+ + "\u0467\3\2\2\2\u0467\u0469\3\2\2\2\u0468\u0466\3\2\2\2\u0469\u046b\7]"+ + "\2\2\u046a\u045f\3\2\2\2\u046a\u0460\3\2\2\2\u046b\u00bb\3\2\2\2\u046c"+ + "\u046e\7[\2\2\u046d\u046f\7b\2\2\u046e\u046d\3\2\2\2\u046e\u046f\3\2\2"+ + "\2\u046f\u0470\3\2\2\2\u0470\u0471\5\u0092J\2\u0471\u00bd\3\2\2\2\u0472"+ + "\u047e\7Y\2\2\u0473\u047f\5l\67\2\u0474\u047a\7\\\2\2\u0475\u0476\5l\67"+ + "\2\u0476\u0477\5\u0148\u00a5\2\u0477\u0479\3\2\2\2\u0478\u0475\3\2\2\2"+ + "\u0479\u047c\3\2\2\2\u047a\u0478\3\2\2\2\u047a\u047b\3\2\2\2\u047b\u047d"+ + "\3\2\2\2\u047c\u047a\3\2\2\2\u047d\u047f\7]\2\2\u047e\u0473\3\2\2\2\u047e"+ + "\u0474\3\2\2\2\u047f\u00bf\3\2\2\2\u0480\u0482\7^\2\2\u0481\u0483\5\u00c2"+ + "b\2\u0482\u0481\3\2\2\2\u0482\u0483\3\2\2\2\u0483\u0484\3\2\2\2\u0484"+ + "\u0485\7_\2\2\u0485\u00c1\3\2\2\2\u0486\u0488\5\u0148\u00a5\2\u0487\u0486"+ + "\3\2\2\2\u0487\u0488\3\2\2\2\u0488\u0489\3\2\2\2\u0489\u048a\5|?\2\u048a"+ + "\u048b\5\u0148\u00a5\2\u048b\u048d\3\2\2\2\u048c\u0487\3\2\2\2\u048d\u048e"+ + "\3\2\2\2\u048e\u048c\3\2\2\2\u048e\u048f\3\2\2\2\u048f\u00c3\3\2\2\2\u0490"+ + "\u0496\5\u00c8e\2\u0491\u0496\5\u00caf\2\u0492\u0496\5\u00ccg\2\u0493"+ + "\u0496\5\u00c6d\2\u0494\u0496\5n8\2\u0495\u0490\3\2\2\2\u0495\u0491\3"+ + "\2\2\2\u0495\u0492\3\2\2\2\u0495\u0493\3\2\2\2\u0495\u0494\3\2\2\2\u0496"+ + "\u00c5\3\2\2\2\u0497\u0498\5z>\2\u0498\u00c7\3\2\2\2\u0499\u049a\5z>\2"+ + "\u049a\u049b\7\177\2\2\u049b\u049c\5z>\2\u049c\u00c9\3\2\2\2\u049d\u049e"+ + "\5z>\2\u049e\u049f\t\21\2\2\u049f\u00cb\3\2\2\2\u04a0\u04a1\5\u00b8]\2"+ + "\u04a1\u04a2\5\u00a6T\2\u04a2\u04a3\5\u00b8]\2\u04a3\u00cd\3\2\2\2\u04a4"+ + "\u04a5\t\22\2\2\u04a5\u00cf\3\2\2\2\u04a6\u04a7\7[\2\2\u04a7\u04a9\7e"+ + "\2\2\u04a8\u04aa\5|?\2\u04a9\u04a8\3\2\2\2\u04a9\u04aa\3\2\2\2\u04aa\u00d1"+ + "\3\2\2\2\u04ab\u04ad\7X\2\2\u04ac\u04ae\5\u00b8]\2\u04ad\u04ac\3\2\2\2"+ + "\u04ad\u04ae\3\2\2\2\u04ae\u00d3\3\2\2\2\u04af\u04b1\7A\2\2\u04b0\u04b2"+ + "\7[\2\2\u04b1\u04b0\3\2\2\2\u04b1\u04b2\3\2\2\2\u04b2\u00d5\3\2\2\2\u04b3"+ + "\u04b5\7U\2\2\u04b4\u04b6\7[\2\2\u04b5\u04b4\3\2\2\2\u04b5\u04b6\3\2\2"+ + "\2\u04b6\u00d7\3\2\2\2\u04b7\u04b8\7M\2\2\u04b8\u04b9\7[\2\2\u04b9\u00d9"+ + "\3\2\2\2\u04ba\u04bb\7Q\2\2\u04bb\u00db\3\2\2\2\u04bc\u04bd\7G\2\2\u04bd"+ + "\u04be\5z>\2\u04be\u00dd\3\2\2\2\u04bf\u04c8\7R\2\2\u04c0\u04c9\5z>\2"+ + "\u04c1\u04c2\5\u0148\u00a5\2\u04c2\u04c3\5z>\2\u04c3\u04c9\3\2\2\2\u04c4"+ + "\u04c5\5\u00c4c\2\u04c5\u04c6\5\u0148\u00a5\2\u04c6\u04c7\5z>\2\u04c7"+ + "\u04c9\3\2\2\2\u04c8\u04c0\3\2\2\2\u04c8\u04c1\3\2\2\2\u04c8\u04c4\3\2"+ + "\2\2\u04c9\u04ca\3\2\2\2\u04ca\u04d0\5\u00c0a\2\u04cb\u04ce\7L\2\2\u04cc"+ + "\u04cf\5\u00dep\2\u04cd\u04cf\5\u00c0a\2\u04ce\u04cc\3\2\2\2\u04ce\u04cd"+ + "\3\2\2\2\u04cf\u04d1\3\2\2\2\u04d0\u04cb\3\2\2\2\u04d0\u04d1\3\2\2\2\u04d1"+ + "\u00df\3\2\2\2\u04d2\u04d5\5\u00e2r\2\u04d3\u04d5\5\u00e8u\2\u04d4\u04d2"+ + "\3\2\2\2\u04d4\u04d3\3\2\2\2\u04d5\u00e1\3\2\2\2\u04d6\u04e1\7O\2\2\u04d7"+ + "\u04d9\5z>\2\u04d8\u04d7\3\2\2\2\u04d8\u04d9\3\2\2\2\u04d9\u04e2\3\2\2"+ + "\2\u04da\u04dc\5\u00c4c\2\u04db\u04da\3\2\2\2\u04db\u04dc\3\2\2\2\u04dc"+ + "\u04dd\3\2\2\2\u04dd\u04df\5\u0148\u00a5\2\u04de\u04e0\5z>\2\u04df\u04de"+ + "\3\2\2\2\u04df\u04e0\3\2\2\2\u04e0\u04e2\3\2\2\2\u04e1\u04d8\3\2\2\2\u04e1"+ + "\u04db\3\2\2\2\u04e2\u04e3\3\2\2\2\u04e3\u04e7\7^\2\2\u04e4\u04e6\5\u00e4"+ + "s\2\u04e5\u04e4\3\2\2\2\u04e6\u04e9\3\2\2\2\u04e7\u04e5\3\2\2\2\u04e7"+ + "\u04e8\3\2\2\2\u04e8\u04ea\3\2\2\2\u04e9\u04e7\3\2\2\2\u04ea\u04eb\7_"+ + "\2\2\u04eb\u00e3\3\2\2\2\u04ec\u04ed\5\u00e6t\2\u04ed\u04ef\7e\2\2\u04ee"+ + "\u04f0\5\u00c2b\2\u04ef\u04ee\3\2\2\2\u04ef\u04f0\3\2\2\2\u04f0\u00e5"+ + "\3\2\2\2\u04f1\u04f2\7F\2\2\u04f2\u04f5\5\u00b8]\2\u04f3\u04f5\7B\2\2"+ + "\u04f4\u04f1\3\2\2\2\u04f4\u04f3\3\2\2\2\u04f5\u00e7\3\2\2\2\u04f6\u04ff"+ + "\7O\2\2\u04f7\u0500\5\u00eav\2\u04f8\u04f9\5\u0148\u00a5\2\u04f9\u04fa"+ + "\5\u00eav\2\u04fa\u0500\3\2\2\2\u04fb\u04fc\5\u00c4c\2\u04fc\u04fd\5\u0148"+ + "\u00a5\2\u04fd\u04fe\5\u00eav\2\u04fe\u0500\3\2\2\2\u04ff\u04f7\3\2\2"+ + "\2\u04ff\u04f8\3\2\2\2\u04ff\u04fb\3\2\2\2\u0500\u0501\3\2\2\2\u0501\u0505"+ + "\7^\2\2\u0502\u0504\5\u00ecw\2\u0503\u0502\3\2\2\2\u0504\u0507\3\2\2\2"+ + "\u0505\u0503\3\2\2\2\u0505\u0506\3\2\2\2\u0506\u0508\3\2\2\2\u0507\u0505"+ + "\3\2\2\2\u0508\u0509\7_\2\2\u0509\u00e9\3\2\2\2\u050a\u050b\7[\2\2\u050b"+ + "\u050d\7i\2\2\u050c\u050a\3\2\2\2\u050c\u050d\3\2\2\2\u050d\u050e\3\2"+ + "\2\2\u050e\u050f\5\u0088E\2\u050f\u0510\7f\2\2\u0510\u0511\7\\\2\2\u0511"+ + "\u0512\7T\2\2\u0512\u0513\7]\2\2\u0513\u00eb\3\2\2\2\u0514\u0515\5\u00ee"+ + "x\2\u0515\u0517\7e\2\2\u0516\u0518\5\u00c2b\2\u0517\u0516\3\2\2\2\u0517"+ + "\u0518\3\2\2\2\u0518\u00ed\3\2\2\2\u0519\u051a\7F\2\2\u051a\u051d\5\u00f0"+ + "y\2\u051b\u051d\7B\2\2\u051c\u0519\3\2\2\2\u051c\u051b\3\2\2\2\u051d\u00ef"+ + "\3\2\2\2\u051e\u0521\5\u0092J\2\u051f\u0521\7Z\2\2\u0520\u051e\3\2\2\2"+ + "\u0520\u051f\3\2\2\2\u0521\u0529\3\2\2\2\u0522\u0525\7c\2\2\u0523\u0526"+ + "\5\u0092J\2\u0524\u0526\7Z\2\2\u0525\u0523\3\2\2\2\u0525\u0524\3\2\2\2"+ + "\u0526\u0528\3\2\2\2\u0527\u0522\3\2\2\2\u0528\u052b\3\2\2\2\u0529\u0527"+ + "\3\2\2\2\u0529\u052a\3\2\2\2\u052a\u00f1\3\2\2\2\u052b\u0529\3\2\2\2\u052c"+ + "\u052d\7E\2\2\u052d\u0531\7^\2\2\u052e\u0530\5\u00f4{\2\u052f\u052e\3"+ + "\2\2\2\u0530\u0533\3\2\2\2\u0531\u052f\3\2\2\2\u0531\u0532\3\2\2\2\u0532"+ + "\u0534\3\2\2\2\u0533\u0531\3\2\2\2\u0534\u0535\7_\2\2\u0535\u00f3\3\2"+ + "\2\2\u0536\u0537\5\u00f6|\2\u0537\u0539\7e\2\2\u0538\u053a\5\u00c2b\2"+ + "\u0539\u0538\3\2\2\2\u0539\u053a\3\2\2\2\u053a\u00f5\3\2\2\2\u053b\u053e"+ + "\7F\2\2\u053c\u053f\5\u00c8e\2\u053d\u053f\5\u00f8}\2\u053e\u053c\3\2"+ + "\2\2\u053e\u053d\3\2\2\2\u053f\u0542\3\2\2\2\u0540\u0542\7B\2\2\u0541"+ + "\u053b\3\2\2\2\u0541\u0540\3\2\2\2\u0542\u00f7\3\2\2\2\u0543\u0544\5\u00b8"+ + "]\2\u0544\u0545\7b\2\2\u0545\u054a\3\2\2\2\u0546\u0547\5\u00b6\\\2\u0547"+ + "\u0548\7i\2\2\u0548\u054a\3\2\2\2\u0549\u0543\3\2\2\2\u0549\u0546\3\2"+ + "\2\2\u0549\u054a\3\2\2\2\u054a\u054b\3\2\2\2\u054b\u054c\5z>\2\u054c\u00f9"+ + "\3\2\2\2\u054d\u0551\7V\2\2\u054e\u0552\5z>\2\u054f\u0552\5\u00fc\177"+ + "\2\u0550\u0552\5\u00fe\u0080\2\u0551\u054e\3\2\2\2\u0551\u054f\3\2\2\2"+ + "\u0551\u0550\3\2\2\2\u0551\u0552\3\2\2\2\u0552\u0553\3\2\2\2\u0553\u0554"+ + "\5\u00c0a\2\u0554\u00fb\3\2\2\2\u0555\u0557\5\u00c4c\2\u0556\u0555\3\2"+ + "\2\2\u0556\u0557\3\2\2\2\u0557\u0558\3\2\2\2\u0558\u055a\5\u0148\u00a5"+ + "\2\u0559\u055b\5z>\2\u055a\u0559\3\2\2\2\u055a\u055b\3\2\2\2\u055b\u055c"+ + "\3\2\2\2\u055c\u055e\5\u0148\u00a5\2\u055d\u055f\5\u00c4c\2\u055e\u055d"+ + "\3\2\2\2\u055e\u055f\3\2\2\2\u055f\u00fd\3\2\2\2\u0560\u0561\5\u00b8]"+ + "\2\u0561\u0562\7b\2\2\u0562\u0567\3\2\2\2\u0563\u0564\5\u00b6\\\2\u0564"+ + "\u0565\7i\2\2\u0565\u0567\3\2\2\2\u0566\u0560\3\2\2\2\u0566\u0563\3\2"+ + "\2\2\u0566\u0567\3\2\2\2\u0567\u0568\3\2\2\2\u0568\u0569\7S\2\2\u0569"+ + "\u056a\5z>\2\u056a\u00ff\3\2\2\2\u056b\u056c\7H\2\2\u056c\u056d\5z>\2"+ + "\u056d\u0101\3\2\2\2\u056e\u0571\5\u0126\u0094\2\u056f\u0571\7[\2\2\u0570"+ + "\u056e\3\2\2\2\u0570\u056f\3\2\2\2\u0571\u0103\3\2\2\2\u0572\u0573\7`"+ + "\2\2\u0573\u0574\5\u0106\u0084\2\u0574\u0575\7a\2\2\u0575\u0576\5\u0108"+ + "\u0085\2\u0576\u0105\3\2\2\2\u0577\u0578\5z>\2\u0578\u0107\3\2\2\2\u0579"+ + "\u057a\5\u0092J\2\u057a\u0109\3\2\2\2\u057b\u057c\7}\2\2\u057c\u057d\5"+ + "\u0092J\2\u057d\u010b\3\2\2\2\u057e\u057f\7`\2\2\u057f\u0580\7a\2\2\u0580"+ + "\u0581\5\u0108\u0085\2\u0581\u010d\3\2\2\2\u0582\u0583\7I\2\2\u0583\u0584"+ + "\7`\2\2\u0584\u0585\5\u0092J\2\u0585\u0586\7a\2\2\u0586\u0587\5\u0108"+ + "\u0085\2\u0587\u010f\3\2\2\2\u0588\u058e\7K\2\2\u0589\u058a\7K\2\2\u058a"+ + "\u058e\7\177\2\2\u058b\u058c\7\177\2\2\u058c\u058e\7K\2\2\u058d\u0588"+ + "\3\2\2\2\u058d\u0589\3\2\2\2\u058d\u058b\3\2\2\2\u058e\u058f\3\2\2\2\u058f"+ + "\u0590\5\u0108\u0085\2\u0590\u0111\3\2\2\2\u0591\u0592\7C\2\2\u0592\u0593"+ + "\5\u0114\u008b\2\u0593\u0113\3\2\2\2\u0594\u0595\5\u0118\u008d\2\u0595"+ + "\u0596\5\u0116\u008c\2\u0596\u0599\3\2\2\2\u0597\u0599\5\u0118\u008d\2"+ + "\u0598\u0594\3\2\2\2\u0598\u0597\3\2\2\2\u0599\u0115\3\2\2\2\u059a\u059d"+ + "\5\u0118\u008d\2\u059b\u059d\5\u0092J\2\u059c\u059a\3\2\2\2\u059c\u059b"+ + "\3\2\2\2\u059d\u0117\3\2\2\2\u059e\u05aa\7\\\2\2\u059f\u05a4\5r:\2\u05a0"+ + "\u05a1\7c\2\2\u05a1\u05a3\5r:\2\u05a2\u05a0\3\2\2\2\u05a3\u05a6\3\2\2"+ + "\2\u05a4\u05a2\3\2\2\2\u05a4\u05a5\3\2\2\2\u05a5\u05a8\3\2\2\2\u05a6\u05a4"+ + "\3\2\2\2\u05a7\u05a9\7c\2\2\u05a8\u05a7\3\2\2\2\u05a8\u05a9\3\2\2\2\u05a9"+ + "\u05ab\3\2\2\2\u05aa\u059f\3\2\2\2\u05aa\u05ab\3\2\2\2\u05ab\u05ac\3\2"+ + "\2\2\u05ac\u05ad\7]\2\2\u05ad\u0119\3\2\2\2\u05ae\u05af\5\u011c\u008f"+ + "\2\u05af\u05b0\7\\\2\2\u05b0\u05b2\5z>\2\u05b1\u05b3\7c\2\2\u05b2\u05b1"+ + "\3\2\2\2\u05b2\u05b3\3\2\2\2\u05b3\u05b4\3\2\2\2\u05b4\u05b5\7]\2\2\u05b5"+ + "\u011b\3\2\2\2\u05b6\u05bc\5\u0094K\2\u05b7\u05b8\7\\\2\2\u05b8\u05b9"+ + "\5\u011c\u008f\2\u05b9\u05ba\7]\2\2\u05ba\u05bc\3\2\2\2\u05bb\u05b6\3"+ + "\2\2\2\u05bb\u05b7\3\2\2\2\u05bc\u011d\3\2\2\2\u05bd\u05c4\5\u0120\u0091"+ + "\2\u05be\u05c4\5\u0124\u0093\2\u05bf\u05c0\7\\\2\2\u05c0\u05c1\5z>\2\u05c1"+ + "\u05c2\7]\2\2\u05c2\u05c4\3\2\2\2\u05c3\u05bd\3\2\2\2\u05c3\u05be\3\2"+ + "\2\2\u05c3\u05bf\3\2\2\2\u05c4\u011f\3\2\2\2\u05c5\u05c9\5\u0086D\2\u05c6"+ + "\u05c9\5\u0128\u0095\2\u05c7\u05c9\5\u013c\u009f\2\u05c8\u05c5\3\2\2\2"+ + "\u05c8\u05c6\3\2\2\2\u05c8\u05c7\3\2\2\2\u05c9\u0121\3\2\2\2\u05ca\u05cb"+ + "\t\23\2\2\u05cb\u0123\3\2\2\2\u05cc\u05cd\7[\2\2\u05cd\u0125\3\2\2\2\u05ce"+ + "\u05cf\7[\2\2\u05cf\u05d0\7f\2\2\u05d0\u05d1\7[\2\2\u05d1\u0127\3\2\2"+ + "\2\u05d2\u05d3\5\u009aN\2\u05d3\u05d4\5\u012a\u0096\2\u05d4\u0129\3\2"+ + "\2\2\u05d5\u05da\7^\2\2\u05d6\u05d8\5\u012c\u0097\2\u05d7\u05d9\7c\2\2"+ + "\u05d8\u05d7\3\2\2\2\u05d8\u05d9\3\2\2\2\u05d9\u05db\3\2\2\2\u05da\u05d6"+ + "\3\2\2\2\u05da\u05db\3\2\2\2\u05db\u05dc\3\2\2\2\u05dc\u05dd\7_\2\2\u05dd"+ + "\u012b\3\2\2\2\u05de\u05e3\5\u012e\u0098\2\u05df\u05e0\7c\2\2\u05e0\u05e2"+ + "\5\u012e\u0098\2\u05e1\u05df\3\2\2\2\u05e2\u05e5\3\2\2\2\u05e3\u05e1\3"+ + "\2\2\2\u05e3\u05e4\3\2\2\2\u05e4\u012d\3\2\2\2\u05e5\u05e3\3\2\2\2\u05e6"+ + "\u05e7\5\u0130\u0099\2\u05e7\u05e8\7e\2\2\u05e8\u05ea\3\2\2\2\u05e9\u05e6"+ + "\3\2\2\2\u05e9\u05ea\3\2\2\2\u05ea\u05eb\3\2\2\2\u05eb\u05ec\5\u0132\u009a"+ + "\2\u05ec\u012f\3\2\2\2\u05ed\u05f0\5z>\2\u05ee\u05f0\5\u012a\u0096\2\u05ef"+ + "\u05ed\3\2\2\2\u05ef\u05ee\3\2\2\2\u05f0\u0131\3\2\2\2\u05f1\u05f4\5z"+ + ">\2\u05f2\u05f4\5\u012a\u0096\2\u05f3\u05f1\3\2\2\2\u05f3\u05f2\3\2\2"+ + "\2\u05f4\u0133\3\2\2\2\u05f5\u05f6\7J\2\2\u05f6\u05fc\7^\2\2\u05f7\u05f8"+ + "\5\u0136\u009c\2\u05f8\u05f9\5\u0148\u00a5\2\u05f9\u05fb\3\2\2\2\u05fa"+ + "\u05f7\3\2\2\2\u05fb\u05fe\3\2\2\2\u05fc\u05fa\3\2\2\2\u05fc\u05fd\3\2"+ + "\2\2\u05fd\u05ff\3\2\2\2\u05fe\u05fc\3\2\2\2\u05ff\u0600\7_\2\2\u0600"+ + "\u0135\3\2\2\2\u0601\u0602\5\u00b6\\\2\u0602\u0603\5\u0092J\2\u0603\u0606"+ + "\3\2\2\2\u0604\u0606\5\u013a\u009e\2\u0605\u0601\3\2\2\2\u0605\u0604\3"+ + "\2\2\2\u0606\u0608\3\2\2\2\u0607\u0609\5\u0138\u009d\2\u0608\u0607\3\2"+ + "\2\2\u0608\u0609\3\2\2\2\u0609\u0137\3\2\2\2\u060a\u060b\t\24\2\2\u060b"+ + "\u0139\3\2\2\2\u060c\u060e\7}\2\2\u060d\u060c\3\2\2\2\u060d\u060e\3\2"+ + "\2\2\u060e\u060f\3\2\2\2\u060f\u0610\5\u0102\u0082\2\u0610\u013b\3\2\2"+ + "\2\u0611\u0612\7C\2\2\u0612\u0613\5\u0114\u008b\2\u0613\u0614\5\u00c0"+ + "a\2\u0614\u013d\3\2\2\2\u0615\u0616\7`\2\2\u0616\u0617\5z>\2\u0617\u0618"+ + "\7a\2\2\u0618\u013f\3\2\2\2\u0619\u061a\7f\2\2\u061a\u061b\7\\\2\2\u061b"+ + "\u061c\5\u0092J\2\u061c\u061d\7]\2\2\u061d\u0141\3\2\2\2\u061e\u062d\7"+ + "\\\2\2\u061f\u0626\5\u00b8]\2\u0620\u0623\5\u011c\u008f\2\u0621\u0622"+ + "\7c\2\2\u0622\u0624\5\u00b8]\2\u0623\u0621\3\2\2\2\u0623\u0624\3\2\2\2"+ + "\u0624\u0626\3\2\2\2\u0625\u061f\3\2\2\2\u0625\u0620\3\2\2\2\u0626\u0628"+ + "\3\2\2\2\u0627\u0629\7j\2\2\u0628\u0627\3\2\2\2\u0628\u0629\3\2\2\2\u0629"+ + "\u062b\3\2\2\2\u062a\u062c\7c\2\2\u062b\u062a\3\2\2\2\u062b\u062c\3\2"+ + "\2\2\u062c\u062e\3\2\2\2\u062d\u0625\3\2\2\2\u062d\u062e\3\2\2\2\u062e"+ + "\u062f\3\2\2\2\u062f\u0630\7]\2\2\u0630\u0143\3\2\2\2\u0631\u0632\5\u011c"+ + "\u008f\2\u0632\u0633\7f\2\2\u0633\u0634\7[\2\2\u0634\u0145\3\2\2\2\u0635"+ + "\u0636\5\u0092J\2\u0636\u0147\3\2\2\2\u0637\u063c\7d\2\2\u0638\u063c\7"+ + "\2\2\3\u0639\u063c\7\u0095\2\2\u063a\u063c\6\u00a5\22\2\u063b\u0637\3"+ + "\2\2\2\u063b\u0638\3\2\2\2\u063b\u0639\3\2\2\2\u063b\u063a\3\2\2\2\u063c"+ + "\u0149\3\2\2\2\u00a4\u0158\u015d\u0165\u0172\u0180\u0184\u018b\u0193\u019c"+ + "\u01bc\u01c4\u01d7\u01e8\u01f4\u01fd\u020b\u021d\u0224\u0229\u022e\u0238"+ + "\u023b\u023f\u0243\u024a\u024d\u025a\u0262\u0266\u0269\u026f\u0273\u0276"+ + "\u0280\u0287\u028e\u029a\u02a0\u02a7\u02b0\u02b6\u02bc\u02c5\u02ca\u02d0"+ + "\u02dc\u02e2\u02e6\u02ee\u02f2\u02f8\u02fb\u0301\u0306\u031a\u033a\u033c"+ + "\u0351\u0359\u0364\u036b\u0375\u0383\u0394\u0396\u039b\u039e\u03a7\u03ad"+ + "\u03b7\u03bf\u03c5\u03ce\u03d9\u03e4\u03e8\u03ea\u03f5\u03fe\u0402\u0405"+ + "\u040c\u0417\u0426\u042a\u042d\u0436\u0440\u0444\u0448\u044c\u0453\u045b"+ + "\u0466\u046a\u046e\u047a\u047e\u0482\u0487\u048e\u0495\u04a9\u04ad\u04b1"+ + "\u04b5\u04c8\u04ce\u04d0\u04d4\u04d8\u04db\u04df\u04e1\u04e7\u04ef\u04f4"+ + "\u04ff\u0505\u050c\u0517\u051c\u0520\u0525\u0529\u0531\u0539\u053e\u0541"+ + "\u0549\u0551\u0556\u055a\u055e\u0566\u0570\u058d\u0598\u059c\u05a4\u05a8"+ + "\u05aa\u05b2\u05bb\u05c3\u05c8\u05d8\u05da\u05e3\u05e9\u05ef\u05f3\u05fc"+ + "\u0605\u0608\u060d\u0623\u0625\u0628\u062b\u062d\u063b"; + public static final ATN _ATN = + new ATNDeserializer().deserialize(_serializedATN.toCharArray()); + static { + _decisionToDFA = new DFA[_ATN.getNumberOfDecisions()]; + for (int i = 0; i < _ATN.getNumberOfDecisions(); i++) { + _decisionToDFA[i] = new DFA(_ATN.getDecisionState(i), i); + } + } +} \ No newline at end of file diff --git a/src/main/java/viper/gobra/frontend/GobraParserBase.java b/src/main/java/viper/gobra/frontend/GobraParserBase.java new file mode 100644 index 000000000..3d3ee41ab --- /dev/null +++ b/src/main/java/viper/gobra/frontend/GobraParserBase.java @@ -0,0 +1,26 @@ +// Imported to Gobra from https://github.com/antlr/grammars-v4/blob/4c06ad8cc8130931c75ca0b17cbc1453f3830cd2/golang + +package viper.gobra.frontend; +import org.antlr.v4.runtime.*; + +/** + * All parser methods that are used in grammar (p, prev, notLineTerminator, etc.) + * should start with lower case char similar to parser rules. + */ +public abstract class GobraParserBase extends org.antlr.v4.runtime.Parser +{ + protected GobraParserBase(TokenStream input) { + super(input); + } + + /** + * Returns true if the current Token is a closing bracket (")", "}" or "!>") + */ + protected boolean closingBracket() + { + BufferedTokenStream stream = (BufferedTokenStream)_input; + int prevTokenType = stream.LA(1); + // Gobra change: Also allow semicolons to be left out right before !> + return prevTokenType == GobraParser.R_CURLY || prevTokenType == GobraParser.R_PAREN || prevTokenType == GobraParser.R_PRED; + } +} diff --git a/src/main/java/viper/gobra/frontend/GobraParserBaseVisitor.java b/src/main/java/viper/gobra/frontend/GobraParserBaseVisitor.java new file mode 100644 index 000000000..ea8fb6c6e --- /dev/null +++ b/src/main/java/viper/gobra/frontend/GobraParserBaseVisitor.java @@ -0,0 +1,1351 @@ +// Generated from /home/nico/Documents/repositories/projects/eth/BA/gobraHome/gobra/src/main/antlr4/GobraParser.g4 by ANTLR 4.9.2 +package viper.gobra.frontend; +import org.antlr.v4.runtime.tree.AbstractParseTreeVisitor; + +/** + * This class provides an empty implementation of {@link GobraParserVisitor}, + * which can be extended to create a visitor which only needs to handle a subset + * of the available methods. + * + * @param The return type of the visit operation. Use {@link Void} for + * operations with no return type. + */ +public class GobraParserBaseVisitor extends AbstractParseTreeVisitor implements GobraParserVisitor { + /** + * {@inheritDoc} + * + *

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

+ */ + @Override public T visitExprOnly(GobraParser.ExprOnlyContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

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

+ */ + @Override public T visitStmtOnly(GobraParser.StmtOnlyContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

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

+ */ + @Override public T visitTypeOnly(GobraParser.TypeOnlyContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

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

+ */ + @Override public T visitMaybeAddressableIdentifierList(GobraParser.MaybeAddressableIdentifierListContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

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

+ */ + @Override public T visitMaybeAddressableIdentifier(GobraParser.MaybeAddressableIdentifierContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

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

+ */ + @Override public T visitExplicitGhostStatement(GobraParser.ExplicitGhostStatementContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

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

+ */ + @Override public T visitFoldStatement(GobraParser.FoldStatementContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

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

+ */ + @Override public T visitProofStatement(GobraParser.ProofStatementContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

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

+ */ + @Override public T visitGhostPrimaryExpr(GobraParser.GhostPrimaryExprContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

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

+ */ + @Override public T visitPermission(GobraParser.PermissionContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

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

+ */ + @Override public T visitTypeExpr(GobraParser.TypeExprContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

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

+ */ + @Override public T visitBoundVariables(GobraParser.BoundVariablesContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

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

+ */ + @Override public T visitBoundVariableDecl(GobraParser.BoundVariableDeclContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

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

+ */ + @Override public T visitTriggers(GobraParser.TriggersContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

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

+ */ + @Override public T visitTrigger(GobraParser.TriggerContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

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

+ */ + @Override public T visitPredicateAccess(GobraParser.PredicateAccessContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

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

+ */ + @Override public T visitOptionSome(GobraParser.OptionSomeContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

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

+ */ + @Override public T visitOptionNone(GobraParser.OptionNoneContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

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

+ */ + @Override public T visitOptionGet(GobraParser.OptionGetContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

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

+ */ + @Override public T visitSConversion(GobraParser.SConversionContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

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

+ */ + @Override public T visitOld(GobraParser.OldContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

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

+ */ + @Override public T visitOldLabelUse(GobraParser.OldLabelUseContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

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

+ */ + @Override public T visitLabelUse(GobraParser.LabelUseContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

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

+ */ + @Override public T visitIsComparable(GobraParser.IsComparableContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

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

+ */ + @Override public T visitTypeOf(GobraParser.TypeOfContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

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

+ */ + @Override public T visitAccess(GobraParser.AccessContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

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

+ */ + @Override public T visitRange(GobraParser.RangeContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

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

+ */ + @Override public T visitSeqUpdExp(GobraParser.SeqUpdExpContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

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

+ */ + @Override public T visitSeqUpdClause(GobraParser.SeqUpdClauseContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

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

+ */ + @Override public T visitGhostTypeLit(GobraParser.GhostTypeLitContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

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

+ */ + @Override public T visitDomainType(GobraParser.DomainTypeContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

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

+ */ + @Override public T visitDomainClause(GobraParser.DomainClauseContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

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

+ */ + @Override public T visitGhostSliceType(GobraParser.GhostSliceTypeContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

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

+ */ + @Override public T visitSqType(GobraParser.SqTypeContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

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

+ */ + @Override public T visitSpecification(GobraParser.SpecificationContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

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

+ */ + @Override public T visitSpecStatement(GobraParser.SpecStatementContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

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

+ */ + @Override public T visitTerminationMeasure(GobraParser.TerminationMeasureContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

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

+ */ + @Override public T visitAssertion(GobraParser.AssertionContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

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

+ */ + @Override public T visitBlockWithBodyParameterInfo(GobraParser.BlockWithBodyParameterInfoContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

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

+ */ + @Override public T visitImplementationProof(GobraParser.ImplementationProofContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

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

+ */ + @Override public T visitMethodImplementationProof(GobraParser.MethodImplementationProofContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

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

+ */ + @Override public T visitNonLocalReceiver(GobraParser.NonLocalReceiverContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

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

+ */ + @Override public T visitSelection(GobraParser.SelectionContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

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

+ */ + @Override public T visitImplementationProofPredicateAlias(GobraParser.ImplementationProofPredicateAliasContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

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

+ */ + @Override public T visitMake(GobraParser.MakeContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

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

+ */ + @Override public T visitNew_(GobraParser.New_Context ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

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

+ */ + @Override public T visitSpecMember(GobraParser.SpecMemberContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

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

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

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

+ */ + @Override public T visitMethodDecl(GobraParser.MethodDeclContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

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

+ */ + @Override public T visitSourceFile(GobraParser.SourceFileContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

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

+ */ + @Override public T visitGhostMember(GobraParser.GhostMemberContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

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

+ */ + @Override public T visitExplicitGhostMember(GobraParser.ExplicitGhostMemberContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

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

+ */ + @Override public T visitFpredicateDecl(GobraParser.FpredicateDeclContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

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

+ */ + @Override public T visitPredicateBody(GobraParser.PredicateBodyContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

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

+ */ + @Override public T visitMpredicateDecl(GobraParser.MpredicateDeclContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

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

+ */ + @Override public T visitVarSpec(GobraParser.VarSpecContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

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

+ */ + @Override public T visitShortVarDecl(GobraParser.ShortVarDeclContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

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

+ */ + @Override public T visitReceiver(GobraParser.ReceiverContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

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

+ */ + @Override public T visitParameterDecl(GobraParser.ParameterDeclContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

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

+ */ + @Override public T visitActualParameterDecl(GobraParser.ActualParameterDeclContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

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

+ */ + @Override public T visitGhostParameterDecl(GobraParser.GhostParameterDeclContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

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

+ */ + @Override public T visitParameterType(GobraParser.ParameterTypeContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

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

+ */ + @Override public T visitPrimaryExpr_(GobraParser.PrimaryExpr_Context ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

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

+ */ + @Override public T visitQuantification(GobraParser.QuantificationContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

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

+ */ + @Override public T visitUnfolding(GobraParser.UnfoldingContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

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

+ */ + @Override public T visitOrExpr(GobraParser.OrExprContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

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

+ */ + @Override public T visitP41Expr(GobraParser.P41ExprContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

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

+ */ + @Override public T visitUnaryExpr(GobraParser.UnaryExprContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

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

+ */ + @Override public T visitP42Expr(GobraParser.P42ExprContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

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

+ */ + @Override public T visitTernaryExpr(GobraParser.TernaryExprContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

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

+ */ + @Override public T visitAddExpr(GobraParser.AddExprContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

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

+ */ + @Override public T visitImplication(GobraParser.ImplicationContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

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

+ */ + @Override public T visitMulExpr(GobraParser.MulExprContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

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

+ */ + @Override public T visitRelExpr(GobraParser.RelExprContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

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

+ */ + @Override public T visitAndExpr(GobraParser.AndExprContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

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

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

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

+ */ + @Override public T visitApplyStmt(GobraParser.ApplyStmtContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

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

+ */ + @Override public T visitPackageStmt(GobraParser.PackageStmtContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

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

+ */ + @Override public T visitSpecForStmt(GobraParser.SpecForStmtContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

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

+ */ + @Override public T visitLoopSpec(GobraParser.LoopSpecContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

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

+ */ + @Override public T visitBasicLit(GobraParser.BasicLitContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

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

+ */ + @Override public T visitNewExpr(GobraParser.NewExprContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

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

+ */ + @Override public T visitMakeExpr(GobraParser.MakeExprContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

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

+ */ + @Override public T visitGhostPrimaryExpr_(GobraParser.GhostPrimaryExpr_Context ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

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

+ */ + @Override public T visitIndexPrimaryExpr(GobraParser.IndexPrimaryExprContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

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

+ */ + @Override public T visitSeqUpdPrimaryExpr(GobraParser.SeqUpdPrimaryExprContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

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

+ */ + @Override public T visitMethodPrimaryExpr(GobraParser.MethodPrimaryExprContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

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

+ */ + @Override public T visitPredConstrPrimaryExpr(GobraParser.PredConstrPrimaryExprContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

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

+ */ + @Override public T visitInvokePrimaryExpr(GobraParser.InvokePrimaryExprContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

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

+ */ + @Override public T visitOperandPrimaryExpr(GobraParser.OperandPrimaryExprContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

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

+ */ + @Override public T visitTypeAssertionPrimaryExpr(GobraParser.TypeAssertionPrimaryExprContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

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

+ */ + @Override public T visitBuiltInCallExpr(GobraParser.BuiltInCallExprContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

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

+ */ + @Override public T visitSelectorPrimaryExpr(GobraParser.SelectorPrimaryExprContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

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

+ */ + @Override public T visitConversionPrimaryExpr(GobraParser.ConversionPrimaryExprContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

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

+ */ + @Override public T visitSlicePrimaryExpr(GobraParser.SlicePrimaryExprContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

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

+ */ + @Override public T visitPredConstructArgs(GobraParser.PredConstructArgsContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

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

+ */ + @Override public T visitInterfaceType(GobraParser.InterfaceTypeContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

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

+ */ + @Override public T visitPredicateSpec(GobraParser.PredicateSpecContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

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

+ */ + @Override public T visitMethodSpec(GobraParser.MethodSpecContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

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

+ */ + @Override public T visitType_(GobraParser.Type_Context ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

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

+ */ + @Override public T visitTypeLit(GobraParser.TypeLitContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

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

+ */ + @Override public T visitPredType(GobraParser.PredTypeContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

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

+ */ + @Override public T visitPredTypeParams(GobraParser.PredTypeParamsContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

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

+ */ + @Override public T visitLiteralType(GobraParser.LiteralTypeContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

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

+ */ + @Override public T visitImplicitArray(GobraParser.ImplicitArrayContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

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

+ */ + @Override public T visitSlice_(GobraParser.Slice_Context ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

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

+ */ + @Override public T visitLow(GobraParser.LowContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

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

+ */ + @Override public T visitHigh(GobraParser.HighContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

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

+ */ + @Override public T visitCap(GobraParser.CapContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

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

+ */ + @Override public T visitAssign_op(GobraParser.Assign_opContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

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

+ */ + @Override public T visitPackageClause(GobraParser.PackageClauseContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

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

+ */ + @Override public T visitImportDecl(GobraParser.ImportDeclContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

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

+ */ + @Override public T visitImportSpec(GobraParser.ImportSpecContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

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

+ */ + @Override public T visitImportPath(GobraParser.ImportPathContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

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

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

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

+ */ + @Override public T visitConstDecl(GobraParser.ConstDeclContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

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

+ */ + @Override public T visitConstSpec(GobraParser.ConstSpecContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

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

+ */ + @Override public T visitIdentifierList(GobraParser.IdentifierListContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

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

+ */ + @Override public T visitExpressionList(GobraParser.ExpressionListContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

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

+ */ + @Override public T visitTypeDecl(GobraParser.TypeDeclContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

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

+ */ + @Override public T visitTypeSpec(GobraParser.TypeSpecContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

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

+ */ + @Override public T visitVarDecl(GobraParser.VarDeclContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

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

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

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

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

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

+ */ + @Override public T visitSimpleStmt(GobraParser.SimpleStmtContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

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

+ */ + @Override public T visitExpressionStmt(GobraParser.ExpressionStmtContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

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

+ */ + @Override public T visitSendStmt(GobraParser.SendStmtContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

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

+ */ + @Override public T visitIncDecStmt(GobraParser.IncDecStmtContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

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

+ */ + @Override public T visitAssignment(GobraParser.AssignmentContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

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

+ */ + @Override public T visitEmptyStmt(GobraParser.EmptyStmtContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

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

+ */ + @Override public T visitLabeledStmt(GobraParser.LabeledStmtContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

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

+ */ + @Override public T visitReturnStmt(GobraParser.ReturnStmtContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

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

+ */ + @Override public T visitBreakStmt(GobraParser.BreakStmtContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

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

+ */ + @Override public T visitContinueStmt(GobraParser.ContinueStmtContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

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

+ */ + @Override public T visitGotoStmt(GobraParser.GotoStmtContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

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

+ */ + @Override public T visitFallthroughStmt(GobraParser.FallthroughStmtContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

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

+ */ + @Override public T visitDeferStmt(GobraParser.DeferStmtContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

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

+ */ + @Override public T visitIfStmt(GobraParser.IfStmtContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

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

+ */ + @Override public T visitSwitchStmt(GobraParser.SwitchStmtContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

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

+ */ + @Override public T visitExprSwitchStmt(GobraParser.ExprSwitchStmtContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

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

+ */ + @Override public T visitExprCaseClause(GobraParser.ExprCaseClauseContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

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

+ */ + @Override public T visitExprSwitchCase(GobraParser.ExprSwitchCaseContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

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

+ */ + @Override public T visitTypeSwitchStmt(GobraParser.TypeSwitchStmtContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

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

+ */ + @Override public T visitTypeSwitchGuard(GobraParser.TypeSwitchGuardContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

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

+ */ + @Override public T visitTypeCaseClause(GobraParser.TypeCaseClauseContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

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

+ */ + @Override public T visitTypeSwitchCase(GobraParser.TypeSwitchCaseContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

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

+ */ + @Override public T visitTypeList(GobraParser.TypeListContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

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

+ */ + @Override public T visitSelectStmt(GobraParser.SelectStmtContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

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

+ */ + @Override public T visitCommClause(GobraParser.CommClauseContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

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

+ */ + @Override public T visitCommCase(GobraParser.CommCaseContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

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

+ */ + @Override public T visitRecvStmt(GobraParser.RecvStmtContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

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

+ */ + @Override public T visitForStmt(GobraParser.ForStmtContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

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

+ */ + @Override public T visitForClause(GobraParser.ForClauseContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

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

+ */ + @Override public T visitRangeClause(GobraParser.RangeClauseContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

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

+ */ + @Override public T visitGoStmt(GobraParser.GoStmtContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

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

+ */ + @Override public T visitTypeName(GobraParser.TypeNameContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

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

+ */ + @Override public T visitArrayType(GobraParser.ArrayTypeContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

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

+ */ + @Override public T visitArrayLength(GobraParser.ArrayLengthContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

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

+ */ + @Override public T visitElementType(GobraParser.ElementTypeContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

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

+ */ + @Override public T visitPointerType(GobraParser.PointerTypeContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

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

+ */ + @Override public T visitSliceType(GobraParser.SliceTypeContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

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

+ */ + @Override public T visitMapType(GobraParser.MapTypeContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

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

+ */ + @Override public T visitChannelType(GobraParser.ChannelTypeContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

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

+ */ + @Override public T visitFunctionType(GobraParser.FunctionTypeContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

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

+ */ + @Override public T visitSignature(GobraParser.SignatureContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

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

+ */ + @Override public T visitResult(GobraParser.ResultContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

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

+ */ + @Override public T visitParameters(GobraParser.ParametersContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

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

+ */ + @Override public T visitConversion(GobraParser.ConversionContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

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

+ */ + @Override public T visitNonNamedType(GobraParser.NonNamedTypeContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

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

+ */ + @Override public T visitOperand(GobraParser.OperandContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

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

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

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

+ */ + @Override public T visitInteger(GobraParser.IntegerContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

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

+ */ + @Override public T visitOperandName(GobraParser.OperandNameContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

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

+ */ + @Override public T visitQualifiedIdent(GobraParser.QualifiedIdentContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

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

+ */ + @Override public T visitCompositeLit(GobraParser.CompositeLitContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

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

+ */ + @Override public T visitLiteralValue(GobraParser.LiteralValueContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

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

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

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

+ */ + @Override public T visitKeyedElement(GobraParser.KeyedElementContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

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

+ */ + @Override public T visitKey(GobraParser.KeyContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

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

+ */ + @Override public T visitElement(GobraParser.ElementContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

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

+ */ + @Override public T visitStructType(GobraParser.StructTypeContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

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

+ */ + @Override public T visitFieldDecl(GobraParser.FieldDeclContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

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

+ */ + @Override public T visitString_(GobraParser.String_Context ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

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

+ */ + @Override public T visitEmbeddedField(GobraParser.EmbeddedFieldContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

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

+ */ + @Override public T visitFunctionLit(GobraParser.FunctionLitContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

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

+ */ + @Override public T visitIndex(GobraParser.IndexContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

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

+ */ + @Override public T visitTypeAssertion(GobraParser.TypeAssertionContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

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

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

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

+ */ + @Override public T visitMethodExpr(GobraParser.MethodExprContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

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

+ */ + @Override public T visitReceiverType(GobraParser.ReceiverTypeContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

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

+ */ + @Override public T visitEos(GobraParser.EosContext ctx) { return visitChildren(ctx); } +} \ No newline at end of file diff --git a/src/main/java/viper/gobra/frontend/GobraParserVisitor.java b/src/main/java/viper/gobra/frontend/GobraParserVisitor.java new file mode 100644 index 000000000..b136fa5b3 --- /dev/null +++ b/src/main/java/viper/gobra/frontend/GobraParserVisitor.java @@ -0,0 +1,1189 @@ +// Generated from /home/nico/Documents/repositories/projects/eth/BA/gobraHome/gobra/src/main/antlr4/GobraParser.g4 by ANTLR 4.9.2 +package viper.gobra.frontend; +import org.antlr.v4.runtime.tree.ParseTreeVisitor; + +/** + * This interface defines a complete generic visitor for a parse tree produced + * by {@link GobraParser}. + * + * @param The return type of the visit operation. Use {@link Void} for + * operations with no return type. + */ +public interface GobraParserVisitor extends ParseTreeVisitor { + /** + * Visit a parse tree produced by {@link GobraParser#exprOnly}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitExprOnly(GobraParser.ExprOnlyContext ctx); + /** + * Visit a parse tree produced by {@link GobraParser#stmtOnly}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitStmtOnly(GobraParser.StmtOnlyContext ctx); + /** + * Visit a parse tree produced by {@link GobraParser#typeOnly}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitTypeOnly(GobraParser.TypeOnlyContext ctx); + /** + * Visit a parse tree produced by {@link GobraParser#maybeAddressableIdentifierList}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitMaybeAddressableIdentifierList(GobraParser.MaybeAddressableIdentifierListContext ctx); + /** + * Visit a parse tree produced by {@link GobraParser#maybeAddressableIdentifier}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitMaybeAddressableIdentifier(GobraParser.MaybeAddressableIdentifierContext ctx); + /** + * Visit a parse tree produced by the {@code explicitGhostStatement} + * labeled alternative in {@link GobraParser#ghostStatement}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitExplicitGhostStatement(GobraParser.ExplicitGhostStatementContext ctx); + /** + * Visit a parse tree produced by the {@code foldStatement} + * labeled alternative in {@link GobraParser#ghostStatement}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitFoldStatement(GobraParser.FoldStatementContext ctx); + /** + * Visit a parse tree produced by the {@code proofStatement} + * labeled alternative in {@link GobraParser#ghostStatement}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitProofStatement(GobraParser.ProofStatementContext ctx); + /** + * Visit a parse tree produced by {@link GobraParser#ghostPrimaryExpr}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitGhostPrimaryExpr(GobraParser.GhostPrimaryExprContext ctx); + /** + * Visit a parse tree produced by {@link GobraParser#permission}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitPermission(GobraParser.PermissionContext ctx); + /** + * Visit a parse tree produced by {@link GobraParser#typeExpr}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitTypeExpr(GobraParser.TypeExprContext ctx); + /** + * Visit a parse tree produced by {@link GobraParser#boundVariables}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitBoundVariables(GobraParser.BoundVariablesContext ctx); + /** + * Visit a parse tree produced by {@link GobraParser#boundVariableDecl}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitBoundVariableDecl(GobraParser.BoundVariableDeclContext ctx); + /** + * Visit a parse tree produced by {@link GobraParser#triggers}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitTriggers(GobraParser.TriggersContext ctx); + /** + * Visit a parse tree produced by {@link GobraParser#trigger}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitTrigger(GobraParser.TriggerContext ctx); + /** + * Visit a parse tree produced by {@link GobraParser#predicateAccess}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitPredicateAccess(GobraParser.PredicateAccessContext ctx); + /** + * Visit a parse tree produced by {@link GobraParser#optionSome}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitOptionSome(GobraParser.OptionSomeContext ctx); + /** + * Visit a parse tree produced by {@link GobraParser#optionNone}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitOptionNone(GobraParser.OptionNoneContext ctx); + /** + * Visit a parse tree produced by {@link GobraParser#optionGet}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitOptionGet(GobraParser.OptionGetContext ctx); + /** + * Visit a parse tree produced by {@link GobraParser#sConversion}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitSConversion(GobraParser.SConversionContext ctx); + /** + * Visit a parse tree produced by {@link GobraParser#old}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitOld(GobraParser.OldContext ctx); + /** + * Visit a parse tree produced by {@link GobraParser#oldLabelUse}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitOldLabelUse(GobraParser.OldLabelUseContext ctx); + /** + * Visit a parse tree produced by {@link GobraParser#labelUse}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitLabelUse(GobraParser.LabelUseContext ctx); + /** + * Visit a parse tree produced by {@link GobraParser#isComparable}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitIsComparable(GobraParser.IsComparableContext ctx); + /** + * Visit a parse tree produced by {@link GobraParser#typeOf}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitTypeOf(GobraParser.TypeOfContext ctx); + /** + * Visit a parse tree produced by {@link GobraParser#access}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitAccess(GobraParser.AccessContext ctx); + /** + * Visit a parse tree produced by {@link GobraParser#range}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitRange(GobraParser.RangeContext ctx); + /** + * Visit a parse tree produced by {@link GobraParser#seqUpdExp}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitSeqUpdExp(GobraParser.SeqUpdExpContext ctx); + /** + * Visit a parse tree produced by {@link GobraParser#seqUpdClause}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitSeqUpdClause(GobraParser.SeqUpdClauseContext ctx); + /** + * Visit a parse tree produced by {@link GobraParser#ghostTypeLit}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitGhostTypeLit(GobraParser.GhostTypeLitContext ctx); + /** + * Visit a parse tree produced by {@link GobraParser#domainType}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitDomainType(GobraParser.DomainTypeContext ctx); + /** + * Visit a parse tree produced by {@link GobraParser#domainClause}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitDomainClause(GobraParser.DomainClauseContext ctx); + /** + * Visit a parse tree produced by {@link GobraParser#ghostSliceType}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitGhostSliceType(GobraParser.GhostSliceTypeContext ctx); + /** + * Visit a parse tree produced by {@link GobraParser#sqType}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitSqType(GobraParser.SqTypeContext ctx); + /** + * Visit a parse tree produced by {@link GobraParser#specification}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitSpecification(GobraParser.SpecificationContext ctx); + /** + * Visit a parse tree produced by {@link GobraParser#specStatement}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitSpecStatement(GobraParser.SpecStatementContext ctx); + /** + * Visit a parse tree produced by {@link GobraParser#terminationMeasure}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitTerminationMeasure(GobraParser.TerminationMeasureContext ctx); + /** + * Visit a parse tree produced by {@link GobraParser#assertion}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitAssertion(GobraParser.AssertionContext ctx); + /** + * Visit a parse tree produced by {@link GobraParser#blockWithBodyParameterInfo}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitBlockWithBodyParameterInfo(GobraParser.BlockWithBodyParameterInfoContext ctx); + /** + * Visit a parse tree produced by {@link GobraParser#implementationProof}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitImplementationProof(GobraParser.ImplementationProofContext ctx); + /** + * Visit a parse tree produced by {@link GobraParser#methodImplementationProof}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitMethodImplementationProof(GobraParser.MethodImplementationProofContext ctx); + /** + * Visit a parse tree produced by {@link GobraParser#nonLocalReceiver}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitNonLocalReceiver(GobraParser.NonLocalReceiverContext ctx); + /** + * Visit a parse tree produced by {@link GobraParser#selection}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitSelection(GobraParser.SelectionContext ctx); + /** + * Visit a parse tree produced by {@link GobraParser#implementationProofPredicateAlias}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitImplementationProofPredicateAlias(GobraParser.ImplementationProofPredicateAliasContext ctx); + /** + * Visit a parse tree produced by {@link GobraParser#make}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitMake(GobraParser.MakeContext ctx); + /** + * Visit a parse tree produced by {@link GobraParser#new_}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitNew_(GobraParser.New_Context ctx); + /** + * Visit a parse tree produced by {@link GobraParser#specMember}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitSpecMember(GobraParser.SpecMemberContext ctx); + /** + * Visit a parse tree produced by {@link GobraParser#functionDecl}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitFunctionDecl(GobraParser.FunctionDeclContext ctx); + /** + * Visit a parse tree produced by {@link GobraParser#methodDecl}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitMethodDecl(GobraParser.MethodDeclContext ctx); + /** + * Visit a parse tree produced by {@link GobraParser#sourceFile}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitSourceFile(GobraParser.SourceFileContext ctx); + /** + * Visit a parse tree produced by {@link GobraParser#ghostMember}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitGhostMember(GobraParser.GhostMemberContext ctx); + /** + * Visit a parse tree produced by {@link GobraParser#explicitGhostMember}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitExplicitGhostMember(GobraParser.ExplicitGhostMemberContext ctx); + /** + * Visit a parse tree produced by {@link GobraParser#fpredicateDecl}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitFpredicateDecl(GobraParser.FpredicateDeclContext ctx); + /** + * Visit a parse tree produced by {@link GobraParser#predicateBody}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitPredicateBody(GobraParser.PredicateBodyContext ctx); + /** + * Visit a parse tree produced by {@link GobraParser#mpredicateDecl}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitMpredicateDecl(GobraParser.MpredicateDeclContext ctx); + /** + * Visit a parse tree produced by {@link GobraParser#varSpec}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitVarSpec(GobraParser.VarSpecContext ctx); + /** + * Visit a parse tree produced by {@link GobraParser#shortVarDecl}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitShortVarDecl(GobraParser.ShortVarDeclContext ctx); + /** + * Visit a parse tree produced by {@link GobraParser#receiver}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitReceiver(GobraParser.ReceiverContext ctx); + /** + * Visit a parse tree produced by {@link GobraParser#parameterDecl}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitParameterDecl(GobraParser.ParameterDeclContext ctx); + /** + * Visit a parse tree produced by {@link GobraParser#actualParameterDecl}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitActualParameterDecl(GobraParser.ActualParameterDeclContext ctx); + /** + * Visit a parse tree produced by {@link GobraParser#ghostParameterDecl}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitGhostParameterDecl(GobraParser.GhostParameterDeclContext ctx); + /** + * Visit a parse tree produced by {@link GobraParser#parameterType}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitParameterType(GobraParser.ParameterTypeContext ctx); + /** + * Visit a parse tree produced by the {@code primaryExpr_} + * labeled alternative in {@link GobraParser#expression}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitPrimaryExpr_(GobraParser.PrimaryExpr_Context ctx); + /** + * Visit a parse tree produced by the {@code quantification} + * labeled alternative in {@link GobraParser#expression}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitQuantification(GobraParser.QuantificationContext ctx); + /** + * Visit a parse tree produced by the {@code unfolding} + * labeled alternative in {@link GobraParser#expression}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitUnfolding(GobraParser.UnfoldingContext ctx); + /** + * Visit a parse tree produced by the {@code orExpr} + * labeled alternative in {@link GobraParser#expression}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitOrExpr(GobraParser.OrExprContext ctx); + /** + * Visit a parse tree produced by the {@code p41Expr} + * labeled alternative in {@link GobraParser#expression}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitP41Expr(GobraParser.P41ExprContext ctx); + /** + * Visit a parse tree produced by the {@code unaryExpr} + * labeled alternative in {@link GobraParser#expression}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitUnaryExpr(GobraParser.UnaryExprContext ctx); + /** + * Visit a parse tree produced by the {@code p42Expr} + * labeled alternative in {@link GobraParser#expression}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitP42Expr(GobraParser.P42ExprContext ctx); + /** + * Visit a parse tree produced by the {@code ternaryExpr} + * labeled alternative in {@link GobraParser#expression}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitTernaryExpr(GobraParser.TernaryExprContext ctx); + /** + * Visit a parse tree produced by the {@code addExpr} + * labeled alternative in {@link GobraParser#expression}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitAddExpr(GobraParser.AddExprContext ctx); + /** + * Visit a parse tree produced by the {@code implication} + * labeled alternative in {@link GobraParser#expression}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitImplication(GobraParser.ImplicationContext ctx); + /** + * Visit a parse tree produced by the {@code mulExpr} + * labeled alternative in {@link GobraParser#expression}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitMulExpr(GobraParser.MulExprContext ctx); + /** + * Visit a parse tree produced by the {@code relExpr} + * labeled alternative in {@link GobraParser#expression}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitRelExpr(GobraParser.RelExprContext ctx); + /** + * Visit a parse tree produced by the {@code andExpr} + * labeled alternative in {@link GobraParser#expression}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitAndExpr(GobraParser.AndExprContext ctx); + /** + * Visit a parse tree produced by {@link GobraParser#statement}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitStatement(GobraParser.StatementContext ctx); + /** + * Visit a parse tree produced by {@link GobraParser#applyStmt}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitApplyStmt(GobraParser.ApplyStmtContext ctx); + /** + * Visit a parse tree produced by {@link GobraParser#packageStmt}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitPackageStmt(GobraParser.PackageStmtContext ctx); + /** + * Visit a parse tree produced by {@link GobraParser#specForStmt}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitSpecForStmt(GobraParser.SpecForStmtContext ctx); + /** + * Visit a parse tree produced by {@link GobraParser#loopSpec}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitLoopSpec(GobraParser.LoopSpecContext ctx); + /** + * Visit a parse tree produced by {@link GobraParser#basicLit}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitBasicLit(GobraParser.BasicLitContext ctx); + /** + * Visit a parse tree produced by the {@code newExpr} + * labeled alternative in {@link GobraParser#primaryExpr}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitNewExpr(GobraParser.NewExprContext ctx); + /** + * Visit a parse tree produced by the {@code makeExpr} + * labeled alternative in {@link GobraParser#primaryExpr}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitMakeExpr(GobraParser.MakeExprContext ctx); + /** + * Visit a parse tree produced by the {@code ghostPrimaryExpr_} + * labeled alternative in {@link GobraParser#primaryExpr}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitGhostPrimaryExpr_(GobraParser.GhostPrimaryExpr_Context ctx); + /** + * Visit a parse tree produced by the {@code indexPrimaryExpr} + * labeled alternative in {@link GobraParser#primaryExpr}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitIndexPrimaryExpr(GobraParser.IndexPrimaryExprContext ctx); + /** + * Visit a parse tree produced by the {@code seqUpdPrimaryExpr} + * labeled alternative in {@link GobraParser#primaryExpr}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitSeqUpdPrimaryExpr(GobraParser.SeqUpdPrimaryExprContext ctx); + /** + * Visit a parse tree produced by the {@code methodPrimaryExpr} + * labeled alternative in {@link GobraParser#primaryExpr}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitMethodPrimaryExpr(GobraParser.MethodPrimaryExprContext ctx); + /** + * Visit a parse tree produced by the {@code predConstrPrimaryExpr} + * labeled alternative in {@link GobraParser#primaryExpr}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitPredConstrPrimaryExpr(GobraParser.PredConstrPrimaryExprContext ctx); + /** + * Visit a parse tree produced by the {@code invokePrimaryExpr} + * labeled alternative in {@link GobraParser#primaryExpr}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitInvokePrimaryExpr(GobraParser.InvokePrimaryExprContext ctx); + /** + * Visit a parse tree produced by the {@code operandPrimaryExpr} + * labeled alternative in {@link GobraParser#primaryExpr}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitOperandPrimaryExpr(GobraParser.OperandPrimaryExprContext ctx); + /** + * Visit a parse tree produced by the {@code typeAssertionPrimaryExpr} + * labeled alternative in {@link GobraParser#primaryExpr}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitTypeAssertionPrimaryExpr(GobraParser.TypeAssertionPrimaryExprContext ctx); + /** + * Visit a parse tree produced by the {@code builtInCallExpr} + * labeled alternative in {@link GobraParser#primaryExpr}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitBuiltInCallExpr(GobraParser.BuiltInCallExprContext ctx); + /** + * Visit a parse tree produced by the {@code selectorPrimaryExpr} + * labeled alternative in {@link GobraParser#primaryExpr}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitSelectorPrimaryExpr(GobraParser.SelectorPrimaryExprContext ctx); + /** + * Visit a parse tree produced by the {@code conversionPrimaryExpr} + * labeled alternative in {@link GobraParser#primaryExpr}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitConversionPrimaryExpr(GobraParser.ConversionPrimaryExprContext ctx); + /** + * Visit a parse tree produced by the {@code slicePrimaryExpr} + * labeled alternative in {@link GobraParser#primaryExpr}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitSlicePrimaryExpr(GobraParser.SlicePrimaryExprContext ctx); + /** + * Visit a parse tree produced by {@link GobraParser#predConstructArgs}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitPredConstructArgs(GobraParser.PredConstructArgsContext ctx); + /** + * Visit a parse tree produced by {@link GobraParser#interfaceType}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitInterfaceType(GobraParser.InterfaceTypeContext ctx); + /** + * Visit a parse tree produced by {@link GobraParser#predicateSpec}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitPredicateSpec(GobraParser.PredicateSpecContext ctx); + /** + * Visit a parse tree produced by {@link GobraParser#methodSpec}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitMethodSpec(GobraParser.MethodSpecContext ctx); + /** + * Visit a parse tree produced by {@link GobraParser#type_}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitType_(GobraParser.Type_Context ctx); + /** + * Visit a parse tree produced by {@link GobraParser#typeLit}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitTypeLit(GobraParser.TypeLitContext ctx); + /** + * Visit a parse tree produced by {@link GobraParser#predType}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitPredType(GobraParser.PredTypeContext ctx); + /** + * Visit a parse tree produced by {@link GobraParser#predTypeParams}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitPredTypeParams(GobraParser.PredTypeParamsContext ctx); + /** + * Visit a parse tree produced by {@link GobraParser#literalType}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitLiteralType(GobraParser.LiteralTypeContext ctx); + /** + * Visit a parse tree produced by {@link GobraParser#implicitArray}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitImplicitArray(GobraParser.ImplicitArrayContext ctx); + /** + * Visit a parse tree produced by {@link GobraParser#slice_}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitSlice_(GobraParser.Slice_Context ctx); + /** + * Visit a parse tree produced by {@link GobraParser#low}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitLow(GobraParser.LowContext ctx); + /** + * Visit a parse tree produced by {@link GobraParser#high}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitHigh(GobraParser.HighContext ctx); + /** + * Visit a parse tree produced by {@link GobraParser#cap}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitCap(GobraParser.CapContext ctx); + /** + * Visit a parse tree produced by {@link GobraParser#assign_op}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitAssign_op(GobraParser.Assign_opContext ctx); + /** + * Visit a parse tree produced by {@link GobraParser#packageClause}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitPackageClause(GobraParser.PackageClauseContext ctx); + /** + * Visit a parse tree produced by {@link GobraParser#importDecl}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitImportDecl(GobraParser.ImportDeclContext ctx); + /** + * Visit a parse tree produced by {@link GobraParser#importSpec}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitImportSpec(GobraParser.ImportSpecContext ctx); + /** + * Visit a parse tree produced by {@link GobraParser#importPath}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitImportPath(GobraParser.ImportPathContext ctx); + /** + * Visit a parse tree produced by {@link GobraParser#declaration}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitDeclaration(GobraParser.DeclarationContext ctx); + /** + * Visit a parse tree produced by {@link GobraParser#constDecl}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitConstDecl(GobraParser.ConstDeclContext ctx); + /** + * Visit a parse tree produced by {@link GobraParser#constSpec}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitConstSpec(GobraParser.ConstSpecContext ctx); + /** + * Visit a parse tree produced by {@link GobraParser#identifierList}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitIdentifierList(GobraParser.IdentifierListContext ctx); + /** + * Visit a parse tree produced by {@link GobraParser#expressionList}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitExpressionList(GobraParser.ExpressionListContext ctx); + /** + * Visit a parse tree produced by {@link GobraParser#typeDecl}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitTypeDecl(GobraParser.TypeDeclContext ctx); + /** + * Visit a parse tree produced by {@link GobraParser#typeSpec}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitTypeSpec(GobraParser.TypeSpecContext ctx); + /** + * Visit a parse tree produced by {@link GobraParser#varDecl}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitVarDecl(GobraParser.VarDeclContext ctx); + /** + * Visit a parse tree produced by {@link GobraParser#block}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitBlock(GobraParser.BlockContext ctx); + /** + * Visit a parse tree produced by {@link GobraParser#statementList}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitStatementList(GobraParser.StatementListContext ctx); + /** + * Visit a parse tree produced by {@link GobraParser#simpleStmt}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitSimpleStmt(GobraParser.SimpleStmtContext ctx); + /** + * Visit a parse tree produced by {@link GobraParser#expressionStmt}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitExpressionStmt(GobraParser.ExpressionStmtContext ctx); + /** + * Visit a parse tree produced by {@link GobraParser#sendStmt}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitSendStmt(GobraParser.SendStmtContext ctx); + /** + * Visit a parse tree produced by {@link GobraParser#incDecStmt}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitIncDecStmt(GobraParser.IncDecStmtContext ctx); + /** + * Visit a parse tree produced by {@link GobraParser#assignment}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitAssignment(GobraParser.AssignmentContext ctx); + /** + * Visit a parse tree produced by {@link GobraParser#emptyStmt}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitEmptyStmt(GobraParser.EmptyStmtContext ctx); + /** + * Visit a parse tree produced by {@link GobraParser#labeledStmt}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitLabeledStmt(GobraParser.LabeledStmtContext ctx); + /** + * Visit a parse tree produced by {@link GobraParser#returnStmt}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitReturnStmt(GobraParser.ReturnStmtContext ctx); + /** + * Visit a parse tree produced by {@link GobraParser#breakStmt}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitBreakStmt(GobraParser.BreakStmtContext ctx); + /** + * Visit a parse tree produced by {@link GobraParser#continueStmt}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitContinueStmt(GobraParser.ContinueStmtContext ctx); + /** + * Visit a parse tree produced by {@link GobraParser#gotoStmt}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitGotoStmt(GobraParser.GotoStmtContext ctx); + /** + * Visit a parse tree produced by {@link GobraParser#fallthroughStmt}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitFallthroughStmt(GobraParser.FallthroughStmtContext ctx); + /** + * Visit a parse tree produced by {@link GobraParser#deferStmt}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitDeferStmt(GobraParser.DeferStmtContext ctx); + /** + * Visit a parse tree produced by {@link GobraParser#ifStmt}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitIfStmt(GobraParser.IfStmtContext ctx); + /** + * Visit a parse tree produced by {@link GobraParser#switchStmt}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitSwitchStmt(GobraParser.SwitchStmtContext ctx); + /** + * Visit a parse tree produced by {@link GobraParser#exprSwitchStmt}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitExprSwitchStmt(GobraParser.ExprSwitchStmtContext ctx); + /** + * Visit a parse tree produced by {@link GobraParser#exprCaseClause}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitExprCaseClause(GobraParser.ExprCaseClauseContext ctx); + /** + * Visit a parse tree produced by {@link GobraParser#exprSwitchCase}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitExprSwitchCase(GobraParser.ExprSwitchCaseContext ctx); + /** + * Visit a parse tree produced by {@link GobraParser#typeSwitchStmt}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitTypeSwitchStmt(GobraParser.TypeSwitchStmtContext ctx); + /** + * Visit a parse tree produced by {@link GobraParser#typeSwitchGuard}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitTypeSwitchGuard(GobraParser.TypeSwitchGuardContext ctx); + /** + * Visit a parse tree produced by {@link GobraParser#typeCaseClause}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitTypeCaseClause(GobraParser.TypeCaseClauseContext ctx); + /** + * Visit a parse tree produced by {@link GobraParser#typeSwitchCase}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitTypeSwitchCase(GobraParser.TypeSwitchCaseContext ctx); + /** + * Visit a parse tree produced by {@link GobraParser#typeList}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitTypeList(GobraParser.TypeListContext ctx); + /** + * Visit a parse tree produced by {@link GobraParser#selectStmt}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitSelectStmt(GobraParser.SelectStmtContext ctx); + /** + * Visit a parse tree produced by {@link GobraParser#commClause}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitCommClause(GobraParser.CommClauseContext ctx); + /** + * Visit a parse tree produced by {@link GobraParser#commCase}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitCommCase(GobraParser.CommCaseContext ctx); + /** + * Visit a parse tree produced by {@link GobraParser#recvStmt}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitRecvStmt(GobraParser.RecvStmtContext ctx); + /** + * Visit a parse tree produced by {@link GobraParser#forStmt}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitForStmt(GobraParser.ForStmtContext ctx); + /** + * Visit a parse tree produced by {@link GobraParser#forClause}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitForClause(GobraParser.ForClauseContext ctx); + /** + * Visit a parse tree produced by {@link GobraParser#rangeClause}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitRangeClause(GobraParser.RangeClauseContext ctx); + /** + * Visit a parse tree produced by {@link GobraParser#goStmt}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitGoStmt(GobraParser.GoStmtContext ctx); + /** + * Visit a parse tree produced by {@link GobraParser#typeName}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitTypeName(GobraParser.TypeNameContext ctx); + /** + * Visit a parse tree produced by {@link GobraParser#arrayType}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitArrayType(GobraParser.ArrayTypeContext ctx); + /** + * Visit a parse tree produced by {@link GobraParser#arrayLength}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitArrayLength(GobraParser.ArrayLengthContext ctx); + /** + * Visit a parse tree produced by {@link GobraParser#elementType}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitElementType(GobraParser.ElementTypeContext ctx); + /** + * Visit a parse tree produced by {@link GobraParser#pointerType}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitPointerType(GobraParser.PointerTypeContext ctx); + /** + * Visit a parse tree produced by {@link GobraParser#sliceType}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitSliceType(GobraParser.SliceTypeContext ctx); + /** + * Visit a parse tree produced by {@link GobraParser#mapType}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitMapType(GobraParser.MapTypeContext ctx); + /** + * Visit a parse tree produced by {@link GobraParser#channelType}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitChannelType(GobraParser.ChannelTypeContext ctx); + /** + * Visit a parse tree produced by {@link GobraParser#functionType}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitFunctionType(GobraParser.FunctionTypeContext ctx); + /** + * Visit a parse tree produced by {@link GobraParser#signature}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitSignature(GobraParser.SignatureContext ctx); + /** + * Visit a parse tree produced by {@link GobraParser#result}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitResult(GobraParser.ResultContext ctx); + /** + * Visit a parse tree produced by {@link GobraParser#parameters}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitParameters(GobraParser.ParametersContext ctx); + /** + * Visit a parse tree produced by {@link GobraParser#conversion}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitConversion(GobraParser.ConversionContext ctx); + /** + * Visit a parse tree produced by {@link GobraParser#nonNamedType}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitNonNamedType(GobraParser.NonNamedTypeContext ctx); + /** + * Visit a parse tree produced by {@link GobraParser#operand}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitOperand(GobraParser.OperandContext ctx); + /** + * Visit a parse tree produced by {@link GobraParser#literal}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitLiteral(GobraParser.LiteralContext ctx); + /** + * Visit a parse tree produced by {@link GobraParser#integer}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitInteger(GobraParser.IntegerContext ctx); + /** + * Visit a parse tree produced by {@link GobraParser#operandName}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitOperandName(GobraParser.OperandNameContext ctx); + /** + * Visit a parse tree produced by {@link GobraParser#qualifiedIdent}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitQualifiedIdent(GobraParser.QualifiedIdentContext ctx); + /** + * Visit a parse tree produced by {@link GobraParser#compositeLit}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitCompositeLit(GobraParser.CompositeLitContext ctx); + /** + * Visit a parse tree produced by {@link GobraParser#literalValue}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitLiteralValue(GobraParser.LiteralValueContext ctx); + /** + * Visit a parse tree produced by {@link GobraParser#elementList}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitElementList(GobraParser.ElementListContext ctx); + /** + * Visit a parse tree produced by {@link GobraParser#keyedElement}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitKeyedElement(GobraParser.KeyedElementContext ctx); + /** + * Visit a parse tree produced by {@link GobraParser#key}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitKey(GobraParser.KeyContext ctx); + /** + * Visit a parse tree produced by {@link GobraParser#element}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitElement(GobraParser.ElementContext ctx); + /** + * Visit a parse tree produced by {@link GobraParser#structType}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitStructType(GobraParser.StructTypeContext ctx); + /** + * Visit a parse tree produced by {@link GobraParser#fieldDecl}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitFieldDecl(GobraParser.FieldDeclContext ctx); + /** + * Visit a parse tree produced by {@link GobraParser#string_}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitString_(GobraParser.String_Context ctx); + /** + * Visit a parse tree produced by {@link GobraParser#embeddedField}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitEmbeddedField(GobraParser.EmbeddedFieldContext ctx); + /** + * Visit a parse tree produced by {@link GobraParser#functionLit}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitFunctionLit(GobraParser.FunctionLitContext ctx); + /** + * Visit a parse tree produced by {@link GobraParser#index}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitIndex(GobraParser.IndexContext ctx); + /** + * Visit a parse tree produced by {@link GobraParser#typeAssertion}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitTypeAssertion(GobraParser.TypeAssertionContext ctx); + /** + * Visit a parse tree produced by {@link GobraParser#arguments}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitArguments(GobraParser.ArgumentsContext ctx); + /** + * Visit a parse tree produced by {@link GobraParser#methodExpr}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitMethodExpr(GobraParser.MethodExprContext ctx); + /** + * Visit a parse tree produced by {@link GobraParser#receiverType}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitReceiverType(GobraParser.ReceiverTypeContext ctx); + /** + * Visit a parse tree produced by {@link GobraParser#eos}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitEos(GobraParser.EosContext ctx); +} \ No newline at end of file diff --git a/src/main/java/viper/gobra/frontend/LICENSE b/src/main/java/viper/gobra/frontend/LICENSE new file mode 100644 index 000000000..717862421 --- /dev/null +++ b/src/main/java/viper/gobra/frontend/LICENSE @@ -0,0 +1,5 @@ +This Source Code Form is subject to the terms of the Mozilla Public +License, v. 2.0. If a copy of the MPL was not distributed with this +file, You can obtain one at http://mozilla.org/MPL/2.0/. + +Copyright (c) 2011-2020 ETH Zurich. diff --git a/src/main/scala/viper/gobra/Gobra.scala b/src/main/scala/viper/gobra/Gobra.scala index 4b358e164..dcfd68ac9 100644 --- a/src/main/scala/viper/gobra/Gobra.scala +++ b/src/main/scala/viper/gobra/Gobra.scala @@ -9,89 +9,151 @@ package viper.gobra import java.nio.file.Paths import java.util.concurrent.ExecutionException import com.typesafe.scalalogging.StrictLogging -import org.bitbucket.inkytonik.kiama.util.Source import viper.gobra.ast.frontend.PPackage import viper.gobra.ast.internal.Program import viper.gobra.ast.internal.transform.{CGEdgesTerminationTransform, OverflowChecksTransform} import viper.gobra.backend.BackendVerifier import viper.gobra.frontend.info.{Info, TypeInfo} -import viper.gobra.frontend.{Config, Desugar, Parser, ScallopGobraConfig} +import viper.gobra.frontend.{Config, Desugar, PackageInfo, Parser, ScallopGobraConfig} import viper.gobra.reporting._ import viper.gobra.translator.Translator import viper.gobra.util.Violation.{KnownZ3BugException, LogicException, UglyErrorMessage} import viper.gobra.util.{DefaultGobraExecutionContext, GobraExecutionContext} +import viper.silicon.BuildInfo import viper.silver.{ast => vpr} -import scala.concurrent.duration.Duration -import scala.concurrent.{Await, Future} +import scala.concurrent.{Await, Future, TimeoutException} object GoVerifier { - val copyright = "(c) Copyright ETH Zurich 2012 - 2021" + val copyright = "(c) Copyright ETH Zurich 2012 - 2022" val name = "Gobra" val rootLogger = "viper.gobra" val version: String = { - val buildRevision = BuildInfo.git("revision") - val buildBranch = BuildInfo.git("branch") + val buildRevision = BuildInfo.gitRevision + val buildBranch = BuildInfo.gitBranch val buildVersion = s"$buildRevision${if (buildBranch == "master") "" else s"@$buildBranch"}" s"${BuildInfo.projectVersion} ($buildVersion)" } } -trait GoVerifier { +trait GoVerifier extends StrictLogging { def name: String = { this.getClass.getSimpleName } - def verify(config: Config)(executor: GobraExecutionContext): Future[VerifierResult] = { - verify(config.inputs, config)(executor) + /** + * Verifies all packages defined in the packageInfoInputMap of the config. + * It uses the package identifier to uniquely identify each verification task on a package level. + * Additionally statistics are collected with the StatsCollector reporter class + */ + def verifyAllPackages(config: Config)(executor: GobraExecutionContext): Vector[VerifierError] = { + val statsCollector = StatsCollector(config.reporter) + var warningCount: Int = 0 + var allErrors: Vector[VerifierError] = Vector() + + // write report to file on shutdown, this makes sure a report is produced even if a run is shutdown + // by some signal. + Runtime.getRuntime.addShutdownHook(new Thread() { + override def run(): Unit = { + val statsFile = config.gobraDirectory.resolve("stats.json").toFile + logger.info("Writing report to " + statsFile.getPath) + statsCollector.writeJsonReportToFile(statsFile) + + val timedOutMembers = statsCollector.getTimedOutMembers + if(timedOutMembers.nonEmpty) { + timedOutMembers.foreach(member => logger.error(s"The verification of member $member did not terminate")) + } + } + }) + + config.packageInfoInputMap.keys.foreach(pkgInfo => { + val pkgId = pkgInfo.id + logger.info(s"Verifying Package $pkgId") + val future = verify(pkgInfo, config.copy(reporter = statsCollector, taskName = pkgInfo.id))(executor) + .map(result => { + // report that verification of this package has finished in order that `statsCollector` can free space by getting rid of this package's typeInfo + statsCollector.report(VerificationTaskFinishedMessage(pkgId)) + + val warnings = statsCollector.getWarnings(pkgId, config) + warningCount += warnings.size + warnings.foreach(w => logger.warn(w)) + + result match { + case VerifierResult.Success => logger.info(s"$name found no errors") + case VerifierResult.Failure(errors) => + logger.error(s"$name has found ${errors.length} error(s) in package $pkgId") + errors.foreach(err => logger.error(s"\t${err.formattedMessage}")) + allErrors = allErrors ++ errors + } + })(executor) + try { + Await.result(future, config.packageTimeout) + } catch { + case _: TimeoutException => logger.error(s"The verification of package $pkgId got terminated after " + config.packageTimeout.toString) + } + }) + + if(warningCount > 0) { + logger.info(s"$name has found $warningCount warning(s)") + } + + logger.info(s"$name has found ${allErrors.size} error(s)") + + // Print statistics for caching + if(config.cacheFile.isDefined) { + logger.info(s"Number of cacheable Viper member(s): ${statsCollector.getNumberOfCacheableViperMembers}") + logger.info(s"Number of cached Viper member(s): ${statsCollector.getNumberOfCachedViperMembers}") + } + + logger.info(s"Gobra has found ${statsCollector.getNumberOfVerifiableMembers} methods and functions" ) + logger.info(s"${statsCollector.getNumberOfVerifiedMembers} have specification") + logger.info(s"${statsCollector.getNumberOfVerifiedMembersWithAssumptions} are assumed to be satisfied") + + allErrors } - protected[this] def verify(input: Vector[Source], config: Config)(executor: GobraExecutionContext): Future[VerifierResult] + protected[this] def verify(pkgInfo: PackageInfo, config: Config)(executor: GobraExecutionContext): Future[VerifierResult] } trait GoIdeVerifier { - protected[this] def verifyAst(config: Config, ast: vpr.Program, backtrack: BackTranslator.BackTrackInfo)(executor: GobraExecutionContext): Future[VerifierResult] + protected[this] def verifyAst(config: Config, pkgInfo: PackageInfo, ast: vpr.Program, backtrack: BackTranslator.BackTrackInfo)(executor: GobraExecutionContext): Future[VerifierResult] } class Gobra extends GoVerifier with GoIdeVerifier { - override def verify(input: Vector[Source], config: Config)(executor: GobraExecutionContext): Future[VerifierResult] = { + override def verify(pkgInfo: PackageInfo, config: Config)(executor: GobraExecutionContext): Future[VerifierResult] = { // directly declaring the parameter implicit somehow does not work as the compiler is unable to spot the inheritance implicit val _executor: GobraExecutionContext = executor val task = Future { - - val finalConfig = getAndMergeInFileConfig(config) - - config.reporter report CopyrightReport(s"${GoVerifier.name} ${GoVerifier.version}\n${GoVerifier.copyright}") - + val finalConfig = getAndMergeInFileConfig(config, pkgInfo) for { - parsedPackage <- performParsing(input, finalConfig) - typeInfo <- performTypeChecking(parsedPackage, input, finalConfig) + parsedPackage <- performParsing(pkgInfo, finalConfig) + typeInfo <- performTypeChecking(parsedPackage, finalConfig) program <- performDesugaring(parsedPackage, typeInfo, finalConfig) - program <- performInternalTransformations(program, finalConfig) - viperTask <- performViperEncoding(program, finalConfig) + program <- performInternalTransformations(program, finalConfig, pkgInfo) + viperTask <- performViperEncoding(program, finalConfig, pkgInfo) } yield (viperTask, finalConfig) } task.flatMap{ case Left(Vector()) => Future(VerifierResult.Success) case Left(errors) => Future(VerifierResult.Failure(errors)) - case Right((job, finalConfig)) => verifyAst(finalConfig, job.program, job.backtrack)(executor) + case Right((job, finalConfig)) => verifyAst(finalConfig, pkgInfo, job.program, job.backtrack)(executor) } } - override def verifyAst(config: Config, ast: vpr.Program, backtrack: BackTranslator.BackTrackInfo)(executor: GobraExecutionContext): Future[VerifierResult] = { + override def verifyAst(config: Config, pkgInfo: PackageInfo, ast: vpr.Program, backtrack: BackTranslator.BackTrackInfo)(executor: GobraExecutionContext): Future[VerifierResult] = { // directly declaring the parameter implicit somehow does not work as the compiler is unable to spot the inheritance implicit val _executor: GobraExecutionContext = executor val viperTask = BackendVerifier.Task(ast, backtrack) - performVerification(viperTask, config) + performVerification(viperTask, config, pkgInfo) .map(BackTranslator.backTranslate(_)(config)) .recoverWith { case e: ExecutionException if isKnownZ3Bug(e) => @@ -121,8 +183,8 @@ class Gobra extends GoVerifier with GoIdeVerifier { * These in-file command options get combined for all files and passed to ScallopGobraConfig. * The current config merged with the newly created config is then returned */ - def getAndMergeInFileConfig(config: Config): Config = { - val inFileConfigs = config.inputs.flatMap(input => { + def getAndMergeInFileConfig(config: Config, pkgInfo: PackageInfo): Config = { + val inFileConfigs = config.packageInfoInputMap(pkgInfo).flatMap(input => { val content = input.content val configs = for (m <- inFileConfigRegex.findAllMatchIn(content)) yield m.group(1) if (configs.isEmpty) { @@ -144,17 +206,17 @@ class Gobra extends GoVerifier with GoIdeVerifier { inFileConfigs.foldLeft(config){ case (oldConfig, fileConfig) => oldConfig.merge(fileConfig) } } - private def performParsing(input: Vector[Source], config: Config): Either[Vector[VerifierError], PPackage] = { + private def performParsing(pkgInfo: PackageInfo, config: Config): Either[Vector[VerifierError], PPackage] = { if (config.shouldParse) { - Parser.parse(input)(config) + Parser.parse(config.packageInfoInputMap(pkgInfo), pkgInfo)(config) } else { Left(Vector()) } } - private def performTypeChecking(parsedPackage: PPackage, input: Vector[Source], config: Config): Either[Vector[VerifierError], TypeInfo] = { + private def performTypeChecking(parsedPackage: PPackage, config: Config): Either[Vector[VerifierError], TypeInfo] = { if (config.shouldTypeCheck) { - Info.check(parsedPackage, input, isMainContext = true)(config) + Info.check(parsedPackage, config.packageInfoInputMap(parsedPackage.info), isMainContext = true)(config) } else { Left(Vector()) } @@ -172,29 +234,29 @@ class Gobra extends GoVerifier with GoIdeVerifier { * Applies transformations to programs in the internal language. Currently, only adds overflow checks but it can * be easily extended to perform more transformations */ - private def performInternalTransformations(program: Program, config: Config): Either[Vector[VerifierError], Program] = { + private def performInternalTransformations(program: Program, config: Config, pkgInfo: PackageInfo): Either[Vector[VerifierError], Program] = { val transformed = CGEdgesTerminationTransform.transform(program) if (config.checkOverflows) { val result = OverflowChecksTransform.transform(transformed) - config.reporter report AppliedInternalTransformsMessage(config.inputs.map(_.name), () => result) + config.reporter report AppliedInternalTransformsMessage(config.packageInfoInputMap(pkgInfo).map(_.name), () => result) Right(result) } else { Right(transformed) } } - private def performViperEncoding(program: Program, config: Config): Either[Vector[VerifierError], BackendVerifier.Task] = { + private def performViperEncoding(program: Program, config: Config, pkgInfo: PackageInfo): Either[Vector[VerifierError], BackendVerifier.Task] = { if (config.shouldViperEncode) { - Right(Translator.translate(program)(config)) + Right(Translator.translate(program, pkgInfo)(config)) } else { Left(Vector()) } } - private def performVerification(viperTask: BackendVerifier.Task, config: Config)(implicit executor: GobraExecutionContext): Future[BackendVerifier.Result] = { + private def performVerification(viperTask: BackendVerifier.Task, config: Config, pkgInfo: PackageInfo)(implicit executor: GobraExecutionContext): Future[BackendVerifier.Result] = { if (config.shouldVerify) { - BackendVerifier.verify(viperTask)(config) + BackendVerifier.verify(viperTask, pkgInfo)(config) } else { Future(BackendVerifier.Success) } @@ -212,44 +274,39 @@ class GobraFrontend { object GobraRunner extends GobraFrontend with StrictLogging { def main(args: Array[String]): Unit = { + val executor: GobraExecutionContext = new DefaultGobraExecutionContext() + val verifier = createVerifier() + var exitCode = 0 try { - val scallopGobraconfig = new ScallopGobraConfig(args.toSeq) - val config = scallopGobraconfig.config - val executor: GobraExecutionContext = new DefaultGobraExecutionContext() - val verifier = createVerifier() - val resultFuture = verifier.verify(config)(executor) - val result = Await.result(resultFuture, Duration.Inf) - executor.terminate() + val scallopGobraConfig = new ScallopGobraConfig(args.toSeq) + val config = scallopGobraConfig.config + // Print copyright report + config.reporter report CopyrightReport(s"${GoVerifier.name} ${GoVerifier.version}\n${GoVerifier.copyright}") - result match { - case VerifierResult.Success => - logger.info(s"${verifier.name} found no errors") - sys.exit(0) - case VerifierResult.Failure(errors) => - logger.error(s"${verifier.name} has found ${errors.length} error(s):") - errors foreach (e => logger.error(s"\t${e.formattedMessage}")) - sys.exit(1) + val errors = verifier.verifyAllPackages(config)(executor) + + if(errors.nonEmpty) { + exitCode = 1 } } catch { case e: UglyErrorMessage => - logger.error(s"Gobra has found 1 error(s):") + logger.error(s"${verifier.name} has found 1 error(s): ") logger.error(s"\t${e.error.formattedMessage}") - sys.exit(1) - + exitCode = 1 case e: LogicException => logger.error("An assumption was violated during execution.") logger.error(e.getLocalizedMessage, e) - sys.exit(1) - + exitCode = 1 case e: KnownZ3BugException => logger.error(e.getLocalizedMessage, e) - sys.exit(1) - + exitCode = 1 case e: Exception => logger.error("An unknown Exception was thrown.") logger.error(e.getLocalizedMessage, e) - sys.exit(1) + exitCode = 1 + } finally { + executor.terminate() + sys.exit(exitCode) } - } } diff --git a/src/main/scala/viper/gobra/ast/frontend/Ast.scala b/src/main/scala/viper/gobra/ast/frontend/Ast.scala index 6b6a22b89..e140bf7be 100644 --- a/src/main/scala/viper/gobra/ast/frontend/Ast.scala +++ b/src/main/scala/viper/gobra/ast/frontend/Ast.scala @@ -10,6 +10,7 @@ import org.bitbucket.inkytonik.kiama.rewriting.Rewritable import org.bitbucket.inkytonik.kiama.util.Messaging.Messages import org.bitbucket.inkytonik.kiama.util._ import viper.gobra.ast.frontend.PNode.PPkg +import viper.gobra.frontend.PackageInfo import viper.gobra.frontend.Source.TransformableSource import viper.gobra.reporting.VerifierError import viper.gobra.util.{Decimal, NumBase} @@ -42,7 +43,8 @@ sealed trait PUnorderedScope extends PScope case class PPackage( packageClause: PPackageClause, programs: Vector[PProgram], - positions: PositionManager + positions: PositionManager, + info: PackageInfo ) extends PNode with PUnorderedScope { // TODO: remove duplicate package imports: lazy val imports: Vector[PImport] = programs.flatMap(_.imports) @@ -111,6 +113,8 @@ sealed trait PGhostifiable extends PNode sealed trait PMember extends PNode +sealed trait PDeclaration extends PNode with PMember with PStatement + /** Member that can have a body */ sealed trait PWithBody extends PNode { def body: Option[(PBodyParameterInfo, PBlock)] @@ -136,9 +140,9 @@ sealed trait PCodeRootWithResult extends PCodeRoot { def result: PResult } -case class PConstDecl(typ: Option[PType], right: Vector[PExpression], left: Vector[PDefLikeId]) extends PActualMember with PActualStatement with PGhostifiableStatement with PGhostifiableMember +case class PConstDecl(typ: Option[PType], right: Vector[PExpression], left: Vector[PDefLikeId]) extends PActualMember with PActualStatement with PGhostifiableStatement with PGhostifiableMember with PDeclaration -case class PVarDecl(typ: Option[PType], right: Vector[PExpression], left: Vector[PDefLikeId], addressable: Vector[Boolean]) extends PActualMember with PActualStatement with PGhostifiableStatement with PGhostifiableMember +case class PVarDecl(typ: Option[PType], right: Vector[PExpression], left: Vector[PDefLikeId], addressable: Vector[Boolean]) extends PActualMember with PActualStatement with PGhostifiableStatement with PGhostifiableMember with PDeclaration case class PFunctionDecl( id: PIdnDef, @@ -157,7 +161,7 @@ case class PMethodDecl( body: Option[(PBodyParameterInfo, PBlock)] ) extends PActualMember with PDependentDef with PScope with PCodeRootWithResult with PWithBody with PGhostifiableMember -sealed trait PTypeDecl extends PActualMember with PActualStatement with PGhostifiableStatement with PGhostifiableMember { +sealed trait PTypeDecl extends PActualMember with PActualStatement with PGhostifiableStatement with PGhostifiableMember with PDeclaration { def left: PIdnDef @@ -269,7 +273,7 @@ case class PBreak(label: Option[PLabelUse]) extends PActualStatement case class PContinue(label: Option[PLabelUse]) extends PActualStatement -case class PGoto(label: PLabelDef) extends PActualStatement +case class PGoto(label: PLabelUse) extends PActualStatement case class PDeferStmt(exp: PExpression) extends PActualStatement @@ -319,9 +323,7 @@ sealed trait PUnaryExp extends PActualExpression { case class PBlankIdentifier() extends PAssignee -case class PNamedOperand(id: PIdnUse) extends PActualExpression with PActualType with PExpressionAndType with PAssignee with PLiteralType with PNamedType with PNameOrDot{ - override val name : String = id.name -} +case class PNamedOperand(id: PIdnUse) extends PActualExpression with PActualType with PExpressionAndType with PAssignee with PLiteralType with PUnqualifiedTypeName with PNameOrDot sealed trait PLiteral extends PActualExpression @@ -376,6 +378,9 @@ case class PBoolLit(lit: Boolean) extends PBasicLiteral // only be read by pretty-printers case class PIntLit(lit: BigInt, base: NumBase = Decimal) extends PBasicLiteral with PNumExpression +// Stand-in float literals +case class PFloatLit(lit: BigDecimal) extends PBasicLiteral with PNumExpression + case class PNilLit() extends PBasicLiteral case class PStringLit(lit: String) extends PBasicLiteral @@ -404,7 +409,7 @@ case class PInvoke(base: PExpressionOrType, args: Vector[PExpression]) extends P // TODO: Check Arguments in language specification, also allows preceding type -case class PDot(base: PExpressionOrType, id: PIdnUse) extends PActualExpression with PActualType with PExpressionAndType with PAssignee with PLiteralType with PNameOrDot +case class PDot(base: PExpressionOrType, id: PIdnUse) extends PActualExpression with PActualType with PExpressionAndType with PAssignee with PLiteralType with PNameOrDot with PTypeName case class PIndexedExp(base: PExpression, index: PExpression) extends PActualExpression with PAssignee @@ -550,11 +555,36 @@ sealed trait PActualType extends PType sealed trait PLiteralType extends PNode -sealed trait PNamedType extends PActualType { - def name: String +/** + * Represents a named type in Go. + * @see [[https://go.dev/ref/spec#TypeName]] + **/ +sealed trait PTypeName extends PActualType { + def id : PUseLikeId + val name: String = id.name +} + +/** + * Represents a type name without a qualifier, e.g. "`int`" or "`MyCustomType`". + */ +sealed trait PUnqualifiedTypeName extends PTypeName + +object PUnqualifiedTypeName { + def unapply(arg: PUnqualifiedTypeName): Option[String] = Some(arg.name) } -sealed abstract class PPredeclaredType(override val name: String) extends PNamedType +/** + * Represents a predeclared type in Go's default name space. + * + * This class is a holdover from when built in types were identified in the parser, + * and can be removed as soon as arrays and other structures of non-predeclared types are + * fully supported. + * + * @param name The identifier associated with this type + */ +sealed abstract class PPredeclaredType(override val name: String) extends PUnqualifiedTypeName with PUseLikeId { + override def id: PUseLikeId = this +} case class PBoolType() extends PPredeclaredType("bool") case class PStringType() extends PPredeclaredType("string") @@ -657,7 +687,7 @@ case class PInterfaceType( sealed trait PInterfaceClause extends PNode -case class PInterfaceName(typ: PNamedOperand) extends PInterfaceClause +case class PInterfaceName(typ: PTypeName) extends PInterfaceClause // Felix: I see `isGhost` as part of the declaration and not as port of the specification. // In the past, I usually created some ghost wrapper for these cases, but I wanted to get rid of them in the future. @@ -742,13 +772,13 @@ case class PUnnamedReceiver(typ: PMethodRecvType) extends PReceiver case class PResult(outs: Vector[PParameter]) extends PNode with PActualMisc sealed trait PEmbeddedType extends PNode with PActualMisc { - def typ: PNamedType + def typ: PUnqualifiedTypeName def name: String = typ.name } -case class PEmbeddedName(typ: PNamedType) extends PEmbeddedType +case class PEmbeddedName(typ: PUnqualifiedTypeName) extends PEmbeddedType -case class PEmbeddedPointer(typ: PNamedType) extends PEmbeddedType +case class PEmbeddedPointer(typ: PUnqualifiedTypeName) extends PEmbeddedType /** @@ -910,6 +940,8 @@ case class PExists(vars: Vector[PBoundVariable], triggers: Vector[PTrigger], bod case class PTypeOf(exp: PExpression) extends PGhostExpression +case class PTypeExpr(typ: PType) extends PGhostExpression + case class PIsComparable(exp: PExpressionOrType) extends PGhostExpression case class PMagicWand(left: PExpression, right: PExpression) extends PGhostExpression diff --git a/src/main/scala/viper/gobra/ast/frontend/AstPattern.scala b/src/main/scala/viper/gobra/ast/frontend/AstPattern.scala index 2e577919b..4af4dbd52 100644 --- a/src/main/scala/viper/gobra/ast/frontend/AstPattern.scala +++ b/src/main/scala/viper/gobra/ast/frontend/AstPattern.scala @@ -23,6 +23,8 @@ object AstPattern { case class NamedType(id: PIdnUse, symb: st.ActualTypeEntity) extends Type with Symbolic case class PointerType(base: PType) extends Type + case class BuiltInType(id: PIdnUse, symb: st.BuiltInType) extends Type with Symbolic + sealed trait Expr extends Pattern case class Constant(id: PIdnUse, symb: st.Constant) extends Expr with Symbolic diff --git a/src/main/scala/viper/gobra/ast/frontend/PrettyPrinter.scala b/src/main/scala/viper/gobra/ast/frontend/PrettyPrinter.scala index fd949c65a..c168b7476 100644 --- a/src/main/scala/viper/gobra/ast/frontend/PrettyPrinter.scala +++ b/src/main/scala/viper/gobra/ast/frontend/PrettyPrinter.scala @@ -396,6 +396,7 @@ class DefaultPrettyPrinter extends PrettyPrinter with kiama.output.PrettyPrinter case Hexadecimal => "0x" } prefix + lit.toString(base.base) + case PFloatLit(lit) => lit.toString() case PNilLit() => "nil" case PStringLit(lit) => "\"" <> lit <> "\"" case PCompositeLit(typ, lit) => showLiteralType(typ) <+> showLiteralValue(lit) @@ -466,6 +467,7 @@ class DefaultPrettyPrinter extends PrettyPrinter with kiama.output.PrettyPrinter case PMagicWand(left, right) => showSubExpr(expr, left) <+> "--*" <+> showSubExpr(expr, right) case PTypeOf(exp) => "typeOf" <> parens(showExpr(exp)) + case PTypeExpr(typ) => "type" <> brackets(showType(typ)) case PIsComparable(exp) => "isComparable" <> parens(showExprOrType(exp)) case POptionNone(t) => "none" <> brackets(showType(t)) diff --git a/src/main/scala/viper/gobra/backend/BackendVerifier.scala b/src/main/scala/viper/gobra/backend/BackendVerifier.scala index 97ed463fa..56b61442f 100644 --- a/src/main/scala/viper/gobra/backend/BackendVerifier.scala +++ b/src/main/scala/viper/gobra/backend/BackendVerifier.scala @@ -7,7 +7,7 @@ package viper.gobra.backend import viper.gobra.backend.ViperBackends.{CarbonBackend => Carbon} -import viper.gobra.frontend.Config +import viper.gobra.frontend.{Config, PackageInfo} import viper.gobra.reporting.BackTranslator.BackTrackInfo import viper.gobra.reporting.{BackTranslator, BacktranslatingReporter, ChoppedProgressMessage} import viper.gobra.util.{ChopperUtil, GobraExecutionContext} @@ -31,7 +31,7 @@ object BackendVerifier { backtrack: BackTranslator.BackTrackInfo ) extends Result - def verify(task: Task)(config: Config)(implicit executor: GobraExecutionContext): Future[Result] = { + def verify(task: Task, pkgInfo: PackageInfo)(config: Config)(implicit executor: GobraExecutionContext): Future[Result] = { var exePaths: Vector[String] = Vector.empty @@ -49,13 +49,13 @@ object BackendVerifier { val verificationResults = { val verifier = config.backend.create(exePaths, config) - val programID = s"_programID_${config.inputs.map(_.name).mkString("_")}" + val reporter = BacktranslatingReporter(config.reporter, task.backtrack, config) if (!config.shouldChop) { - verifier.verify(programID, BacktranslatingReporter(config.reporter, task.backtrack, config), task.program)(executor) + verifier.verify(config.taskName, reporter, task.program)(executor) } else { - val programs = ChopperUtil.computeChoppedPrograms(task)(config) + val programs = ChopperUtil.computeChoppedPrograms(task, pkgInfo)(config) val num = programs.size //// (Felix) Currently, Silicon cannot be invoked concurrently. @@ -65,11 +65,10 @@ object BackendVerifier { // } programs.zipWithIndex.foldLeft(Future.successful(silver.verifier.Success): Future[VerificationResult]) { case (res, (program, idx)) => - val programSubID = s"${programID}_$idx" for { acc <- res next <- verifier - .verify(programSubID, BacktranslatingReporter(config.reporter, task.backtrack, config), program)(executor) + .verify(config.taskName, reporter, program)(executor) .andThen(_ => config.reporter report ChoppedProgressMessage(idx+1, num)) } yield (acc, next) match { case (acc, silver.verifier.Success) => acc diff --git a/src/main/scala/viper/gobra/frontend/Config.scala b/src/main/scala/viper/gobra/frontend/Config.scala index 848c54425..1661eb327 100644 --- a/src/main/scala/viper/gobra/frontend/Config.scala +++ b/src/main/scala/viper/gobra/frontend/Config.scala @@ -16,48 +16,73 @@ import org.rogach.scallop.{ScallopConf, ScallopOption, listArgConverter, singleA import org.slf4j.LoggerFactory import viper.gobra.backend.{ViperBackend, ViperBackends} import viper.gobra.GoVerifier -import viper.gobra.frontend.PackageResolver.RegularImport +import viper.gobra.frontend.Source.{FromFileSource, getPackageInfo} import viper.gobra.reporting.{FileWriterReporter, GobraReporter, StdIOReporter} import viper.gobra.util.{TypeBounds, Violation} import viper.silver.ast.SourcePosition +import scala.concurrent.duration.Duration + object LoggerDefaults { val DefaultLevel: Level = Level.INFO } + +object ConfigDefaults { + val DefaultGobraDirectory: String = ".gobra" + val DefaultTaskName: String = "gobra-task" +} + case class Config( - inputs: Vector[Source], - moduleName: String = "", - includeDirs: Vector[Path] = Vector(), - reporter: GobraReporter = StdIOReporter(), - backend: ViperBackend = ViperBackends.SiliconBackend, - isolate: Option[Vector[SourcePosition]] = None, - choppingUpperBound: Int = 1, - z3Exe: Option[String] = None, - boogieExe: Option[String] = None, - logLevel: Level = LoggerDefaults.DefaultLevel, - cacheFile: Option[String] = None, - shouldParse: Boolean = true, - shouldTypeCheck: Boolean = true, - shouldDesugar: Boolean = true, - shouldViperEncode: Boolean = true, - checkOverflows: Boolean = false, - checkConsistency: Boolean = false, - shouldVerify: Boolean = true, - shouldChop: Boolean = false, - // The go language specification states that int and uint variables can have either 32bit or 64, as long - // as they have the same size. This flag allows users to pick the size of int's and uints's: 32 if true, - // 64 bit otherwise. - int32bit: Boolean = false, - // the following option is currently not controllable via CLI as it is meaningless without a constantly - // running JVM. It is targeted in particular to Gobra Server and Gobra IDE - cacheParser: Boolean = false - ) { + recursive: Boolean = false, + gobraDirectory: Path = Path.of(ConfigDefaults.DefaultGobraDirectory), + // Used as an identifier of a verification task, ideally it shouldn't change between verifications + // because it is used as a caching key. Additionally it should be unique when using the StatsCollector + taskName: String = ConfigDefaults.DefaultTaskName, + // Contains a mapping of packages to all input sources for that package + packageInfoInputMap: Map[PackageInfo, Vector[Source]] = Map(), + moduleName: String = "", + includeDirs: Vector[Path] = Vector(), + projectRoot: Path = Path.of(""), + reporter: GobraReporter = StdIOReporter(), + backend: ViperBackend = ViperBackends.SiliconBackend, + isolate: Option[Vector[SourcePosition]] = None, + choppingUpperBound: Int = 1, + packageTimeout: Duration = Duration.Inf, + z3Exe: Option[String] = None, + boogieExe: Option[String] = None, + logLevel: Level = LoggerDefaults.DefaultLevel, + cacheFile: Option[String] = None, + shouldParse: Boolean = true, + shouldTypeCheck: Boolean = true, + shouldDesugar: Boolean = true, + shouldViperEncode: Boolean = true, + checkOverflows: Boolean = false, + checkConsistency: Boolean = false, + shouldVerify: Boolean = true, + shouldChop: Boolean = false, + // The go language specification states that int and uint variables can have either 32bit or 64, as long + // as they have the same size. This flag allows users to pick the size of int's and uints's: 32 if true, + // 64 bit otherwise. + int32bit: Boolean = false, + // the following option is currently not controllable via CLI as it is meaningless without a constantly + // running JVM. It is targeted in particular to Gobra Server and Gobra IDE + cacheParser: Boolean = false +) { def merge(other: Config): Config = { // this config takes precedence over other config + val newInputs: Map[PackageInfo, Vector[Source]] = { + val keys = packageInfoInputMap.keys ++ other.packageInfoInputMap.keys + keys.map(k => k -> (packageInfoInputMap.getOrElse(k, Vector()) ++ other.packageInfoInputMap.getOrElse(k, Vector())).distinct).toMap + } + Config( - inputs = (inputs ++ other.inputs).distinct, + recursive = recursive, moduleName = moduleName, + taskName = taskName, + gobraDirectory = gobraDirectory, + packageInfoInputMap = newInputs, + projectRoot = projectRoot, includeDirs = (includeDirs ++ other.includeDirs).distinct, reporter = reporter, backend = backend, @@ -66,6 +91,7 @@ case class Config( case (l, None) => l case (Some(l), Some(r)) => Some((l ++ r).distinct) }, + packageTimeout = if(packageTimeout < other.packageTimeout) packageTimeout else other.packageTimeout, // take minimum z3Exe = z3Exe orElse other.z3Exe, boogieExe = boogieExe orElse other.boogieExe, logLevel = if (logLevel.isGreaterOrEqual(other.logLevel)) other.logLevel else logLevel, // take minimum @@ -116,9 +142,38 @@ class ScallopGobraConfig(arguments: Seq[String], isInputOptional: Boolean = fals */ val input: ScallopOption[List[String]] = opt[List[String]]( name = "input", - descr = "List of Gobra programs or a single package name to verify" + descr = "List of Gobra programs, a project directory or a single package name to verify", + short = 'i' ) + val recursive: ScallopOption[Boolean] = toggle( + name = "recursive", + descrYes = "Verify nested packages recursively", + default = Some(false), + short = 'r' + ) + + val includePackages: ScallopOption[List[String]] = opt[List[String]]( + name = "includePackages", + descr = "Packages to verify. All packages found in the specified directories are verified by default.", + default = Some(List.empty), + short = 'p' + ) + + val excludePackages: ScallopOption[List[String]] = opt[List[String]]( + name = "excludePackages", + descr = "Packages to ignore. These packages will not be verified, even if they are found in the specified directories.", + default = Some(List.empty), + noshort = true + ) + + val gobraDirectory: ScallopOption[Path] = opt[Path]( + name = "gobraDirectory", + descr = "Output directory for Gobra", + default = Some(Path.of(ConfigDefaults.DefaultGobraDirectory)), + short = 'g' + )(singleArgConverter(arg => Path.of(arg))) + val module: ScallopOption[String] = opt[String]( name = "module", descr = "Name of current module that should be used for resolving imports", @@ -208,6 +263,13 @@ class ScallopGobraConfig(arguments: Seq[String], isInputOptional: Boolean = fals noshort = true ) + val packageTimeout: ScallopOption[String] = opt[String]( + name = "packageTimeout", + descr = "Duration till the verification of a package times out", + default = None, + noshort = true + ) + val z3Exe: ScallopOption[String] = opt[String]( name = "z3Exe", descr = "The Z3 executable", @@ -229,6 +291,13 @@ class ScallopGobraConfig(arguments: Seq[String], isInputOptional: Boolean = fals noshort = false ) + val rootDirectory: ScallopOption[Path] = opt[Path]( + name = "projectRoot", + descr = "The root directory of the project", + default = None, + noshort = true + ) + val cacheFile: ScallopOption[String] = opt[String]( name = "cacheFile", descr = "Cache file to be used by Viper Server", @@ -243,7 +312,6 @@ class ScallopGobraConfig(arguments: Seq[String], isInputOptional: Boolean = fals noshort = false ) - /** * Exception handling */ @@ -257,64 +325,73 @@ class ScallopGobraConfig(arguments: Seq[String], isInputOptional: Boolean = fals } - - /** File Validation */ def validateInput(inputOption: ScallopOption[List[String]], - moduleOption: ScallopOption[String], - includeOption: ScallopOption[List[File]]): Unit = validateOpt(inputOption, includeOption) { (inputOpt, includeOpt) => - - def checkConversion(input: List[String], moduleName: String, includeDirs: Vector[Path]): Either[String, Vector[Path]] = { - def validateSources(sources: Vector[Source]): Either[Messages, Vector[Path]] = { - val (remainingSources, paths) = sources.partitionMap { - case FileSource(name, _) => Right(Paths.get(name)) - case s => Left(s) + recOption: ScallopOption[Boolean], + rootDirectoryOption: ScallopOption[Path], + includeOption: ScallopOption[List[File]], + includePkgOption: ScallopOption[List[String]], + excludePkgOption: ScallopOption[List[String]]): Unit = + validateOpt(inputOption, recOption, rootDirectoryOption, includeOption, includePkgOption, excludePkgOption) { + (inputOpt, recOpt, rootDirectoryOpt, includeOpt, includePkgOpt, excludePkgOpt) => + def checkConversion(input: List[String]): Either[String, Vector[Path]] = { + def validateSources(sources: Vector[Source]): Either[Messages, Vector[Path]] = { + val (remainingSources, paths) = sources.partitionMap { + case FileSource(name, _) => Right(Paths.get(name)) + case FromFileSource(path, _, _) => Right(path) + case s => Left(s) + } + if (remainingSources.isEmpty) Right(paths) + else Left(message(null, s"Expected file sources but got $remainingSources")) } - if (remainingSources.isEmpty) Right(paths) - else Left(message(remainingSources, s"Expected file sources but got ${remainingSources}")) - } - val inputValidationMsgs = InputConverter.validate(input) - val paths = for { - _ <- if (inputValidationMsgs.isEmpty) Right(()) else Left(inputValidationMsgs) - sources = InputConverter.convert(input, moduleName, includeDirs) - paths <- validateSources(sources) - } yield paths + val shouldParseRecursively = recOpt.getOrElse(false) + val inputValidationMsgs = InputConverter.validate(input, shouldParseRecursively) - paths.left.map(msgs => s"The following errors have occurred: ${msgs.map(_.label).mkString(",")}") - } + lazy val projectRoot = rootDirectoryOpt.getOrElse( + includeOpt.flatMap(_.headOption.map(_.toPath)).getOrElse(Path.of("")) + ) - def atLeastOneFile(files: Vector[Path]): Either[String, Unit] = { - if (files.nonEmpty || isInputOptional) Right(()) else Left(s"Package resolution has not found any files for verification - are you using '.${PackageResolver.gobraExtension}' or '.${PackageResolver.goExtension}' as file extension?") - } + val paths = for { + _ <- if (inputValidationMsgs.isEmpty) Right(()) else Left(inputValidationMsgs) + sources = InputConverter.convert(input, shouldParseRecursively, projectRoot, includePkgOpt.getOrElse(List()), excludePkgOpt.getOrElse(List())) + paths <- validateSources(sources.values.flatten.toVector) + } yield paths - def filesExist(files: Vector[Path]): Either[String, Unit] = { - val notExisting = files.filterNot(Files.exists(_)) - if (notExisting.isEmpty) Right(()) else Left(s"Files '${notExisting.mkString(",")}' do not exist") - } + paths.left.map(msgs => s"The following errors have occurred: ${msgs.map(_.label).mkString(",")}") + } - def filesAreFiles(files: Vector[Path]): Either[String, Unit] = { - val notFiles = files.filterNot(Files.isRegularFile(_)) - if (notFiles.isEmpty) Right(()) else Left(s"Files '${notFiles.mkString(",")}' are not files") - } + def atLeastOnePath(paths: Vector[Path]): Either[String, Unit] = { + if (paths.nonEmpty || isInputOptional) Right(()) else Left(s"Package resolution has not found any files for verification - are you using '.${PackageResolver.gobraExtension}' or '.${PackageResolver.goExtension}' as file extension?") + } - def filesAreReadable(files: Vector[Path]): Either[String, Unit] = { - val notReadable = files.filterNot(Files.isReadable) - if (notReadable.isEmpty) Right(()) else Left(s"Files '${notReadable.mkString(",")}' are not readable") - } + def pathsExist(paths: Vector[Path]): Either[String, Unit] = { + val notExisting = paths.filterNot(Files.exists(_)) + if (notExisting.isEmpty) Right(()) else Left(s"Files '${notExisting.mkString(",")}' do not exist") + } + + def pathsAreFilesOrDirectories(paths: Vector[Path]): Either[String, Unit] = { + val notFilesOrDirectories = paths.filterNot(file => Files.isRegularFile(file) || Files.isDirectory(file)) + if (notFilesOrDirectories.isEmpty) Right(()) else Left(s"Files '${notFilesOrDirectories.mkString(",")}' are neither files or directories") + } - // perform the following checks: - // - validate fileOpt using includeOpt - // - convert fileOpt using includeOpt - // - result should be non-empty, exist, be files and be readable - val input: List[String] = inputOpt.getOrElse(List()) - for { - convertedFiles <- checkConversion(input, moduleOption.getOrElse(""), includeOpt.map(_.map(_.toPath).toVector).getOrElse(Vector())) - _ <- atLeastOneFile(convertedFiles) - _ <- filesExist(convertedFiles) - _ <- filesAreFiles(convertedFiles) - _ <- filesAreReadable(convertedFiles) - } yield () + def pathsAreReadable(paths: Vector[Path]): Either[String, Unit] = { + val notReadable = paths.filterNot(Files.isReadable) + if (notReadable.isEmpty) Right(()) else Left(s"Files '${notReadable.mkString(",")}' are not readable") + } + + // perform the following checks: + // - validate fileOpt using includeOpt + // - convert fileOpt using includeOpt + // - result should be non-empty, exist, be files and be readable + val input: List[String] = inputOpt.getOrElse(List()) + for { + convertedFiles <- checkConversion(input) + _ <- atLeastOnePath(convertedFiles) + _ <- pathsExist(convertedFiles) + _ <- pathsAreFilesOrDirectories(convertedFiles) + _ <- pathsAreReadable(convertedFiles) + } yield () } if (!skipIncludeDirChecks) { @@ -335,7 +412,7 @@ class ScallopGobraConfig(arguments: Seq[String], isInputOptional: Boolean = fals }) val cutInput: ScallopOption[List[String]] = cutInputWithIdxs.map(_.map(_._1)) - validateInput(cutInput, module, include) + validateInput(input, recursive, rootDirectory, include, includePackages, excludePackages) // cache file should only be usable when using viper server validateOpt (backend, cacheFile) { @@ -345,16 +422,61 @@ class ScallopGobraConfig(arguments: Seq[String], isInputOptional: Boolean = fals case (_, Some(_)) => Left("Cache file can only be specified when the backend uses Viper Server") } + validateOpt (gobraDirectory) { + case Some(dir) => + // Set up gobra directory + val gobraDirectory = dir.toFile + if(!gobraDirectory.exists && !gobraDirectory.mkdir()) { + Left( s"Could not create directory $gobraDirectory") + } else if (!gobraDirectory.isDirectory) { + Left(s"$dir is not a directory") + } else if (!gobraDirectory.canRead) { + Left(s"Couldn't read gobra directory $dir") + } else if (!gobraDirectory.canWrite) { + Left(s"Couldn't write to gobra directory $dir") + } else { + Right(()) + } + case _ => Right(()) + } + + validateOpt (packageTimeout) { + case Some(s) => try { + Right(Duration(s)) + } catch { + case e: NumberFormatException => Left(s"Couldn't parse package timeout: " + e.getMessage) + } + case None => Right(()) + } + + lazy val packageTimeoutDuration: Duration = packageTimeout.toOption match { + case Some(d) => Duration(d) + case _ => Duration.Inf + } + verify() lazy val includeDirs: Vector[Path] = include.toOption.map(_.map(_.toPath).toVector).getOrElse(Vector()) - lazy val inputs: Vector[Source] = InputConverter.convert(cutInput.toOption.getOrElse(List()), module.getOrElse(""), includeDirs) + + // Take the user input for the project root or fallback to the fist include directory or the current directory + lazy val projectRoot: Path = rootDirectory.getOrElse( + includeDirs.headOption.getOrElse(Path.of("")) + ) + + lazy val inputPackageMap: Map[PackageInfo, Vector[Source]] = InputConverter.convert( + input.toOption.getOrElse(List()), + recursive.getOrElse(false), + projectRoot, + includePackages.getOrElse(List()), + excludePackages.getOrElse(List()) + ) lazy val isolated: Option[Vector[SourcePosition]] = InputConverter.isolatedPosition(cutInputWithIdxs.toOption) match { case Nil => None case positions => Some(positions.toVector) } + /** set log level */ LoggerFactory.getLogger(GoVerifier.rootLogger) @@ -370,68 +492,66 @@ class ScallopGobraConfig(arguments: Seq[String], isInputOptional: Boolean = fals private object InputConverter { - def validate(input: List[String]): Messages = { - val files = input map isGoFilePath - files.partition(_.isLeft) match { - case (pkgs, files) if pkgs.length == 1 && files.isEmpty => noMessages - case (pkgs, files) if pkgs.isEmpty && files.nonEmpty => noMessages - // error states: - case (pkgs, files) if pkgs.length > 1 && files.isEmpty => - message(pkgs, s"multiple package names provided: '${concatLeft(pkgs, ",")}'") - case (pkgs, files) if pkgs.nonEmpty && files.nonEmpty => - message(pkgs, s"specific input files and one or more package names were simultaneously provided (files: '${concatRight(files, ",")}'; package names: '${concatLeft(pkgs, ",")}')") + def validate(inputs: List[String], recursive: Boolean): Messages = { + val files = inputs flatMap (file => getAllGobraFiles(file, recursive)) + files match { + case files if files.nonEmpty => noMessages case _ if isInputOptional => noMessages - case (pkgs, files) if pkgs.isEmpty && files.isEmpty => message(null, s"no input specified") + // error states + case files if files.isEmpty => message(null, s"no files found in the specified input (use -r to traverse directories)") case c => Violation.violation(s"This case should be unreachable, but got $c") } } - def convert(input: List[String], moduleName: String, includeDirs: Vector[Path]): Vector[Source] = { - val res = for { - i <- identifyInput(input).toRight("invalid input") - sources <- i match { - case Right(filePaths) => Right(filePaths.map(f => FileSource(f.toString))) - case Left(_) => PackageResolver.resolveSources(RegularImport(""), moduleName, includeDirs) - } - } yield sources - assert(isInputOptional || res.isRight, s"validate function did not catch this problem: '${res.swap.getOrElse(None)}'") - res.getOrElse(Vector()) + def convert(input: List[String], recursive: Boolean, projectRoot: Path, includePackages: List[String], excludePackages: List[String]): Map[PackageInfo, Vector[Source]] = { + val sources = parseInputStrings(input.toVector, recursive) + sources.groupBy(src => getPackageInfo(src, projectRoot)) + .filter({case (pkgInfo, _) => (includePackages.isEmpty || includePackages.contains(pkgInfo.name)) && !excludePackages.contains(pkgInfo.name)}) } /** - * Checks whether string ends in "." where corresponds to the extension defined in InputConverter - * @return Right with the string converted to a File if the condition is met, otherwise Left containing `input` - */ - private def isGoFilePath(input: String): Either[String, File] = input match { - case PackageResolver.inputFileRegex(filename) => Right(new File(filename)) - case pkgName => Left(pkgName) - } - - private def concatLeft(p: List[Either[String, File]], sep: String): String = { - (for(Left(pkg) <- p.toVector) yield pkg).mkString(sep) - } - - private def concatRight(p: List[Either[String, File]], sep: String): String = { - (for(Right(f) <- p.toVector) yield f).mkString(sep) + * Parses all provided inputs and returns a list of all gobra files found + * + */ + private def parseInputStrings(inputs: Vector[String], recursive: Boolean): Vector[Source] = { + inputs.flatMap(input => getAllGobraFiles(input, recursive)) + .map(file => FileSource(file.getPath)) } /** - * Decides whether the provided input strings should be interpreted as a single package name (Left) or - * a vector of file paths (Right). If a mix is provided None is returned. - */ - def identifyInput(input: List[String]): Option[Either[String, Vector[Path]]] = { - val files = input map isGoFilePath - files.partition(_.isLeft) match { - case (pkgs, files) if pkgs.length == 1 && files.isEmpty => pkgs.head.swap.map(Left(_)).toOption - case (pkgs, files) if pkgs.isEmpty && files.nonEmpty => Some(Right(for(Right(s) <- files.toVector) yield s.toPath)) - case _ => None + * Gets all gobra files in a input location. If the location is a file that ends in "." it is returned. + * If it is a directory, all files contained in it, ending in ".", are returned. + * + * @param recursive if true, directories are traversed recursively + * @return a Vector of the resolved gobra files + */ + private def getAllGobraFiles(input: String, recursive: Boolean): Vector[File] = + input match { + case PackageResolver.inputFileRegex(filename) => Vector(new File(filename)) + case dirname => getInputFilesInDir(new File(dirname), recursive) } + + /** + * Gets all files with a go/gobra extension inside this directory + * + * @param directory directory to look for files + * @param recursive traverse subdirectories if this is set to true + * @return a List of go/gobra files + */ + private def getInputFilesInDir(directory: File, recursive: Boolean): Vector[File] = { + Violation.violation(directory.exists && directory.isDirectory, "getInputFilesInDir didn't receive a directory as input: " + directory.toString) + directory.listFiles() + // Filters out all files that aren't either go/gobra files or directories (if recursive is set) + .filter(file => (file.isDirectory && recursive) || PackageResolver.inputFileRegex.matches(file.getName)) + .flatMap(file => if (file.isDirectory) getInputFilesInDir(file, recursive) else List(file)) + .toVector } def isolatedPosition(cutInputWithIdxs: Option[List[(String, List[Int])]]): List[SourcePosition] = { cutInputWithIdxs.map(_.flatMap { case (input, idxs) => - isGoFilePath(input) match { // only go and gobra files can have a position - case Right(file) => idxs.map(idx => SourcePosition(file.toPath, idx, 0)) + getAllGobraFiles(input, recursive = false) match { + // only go and gobra files and not directories can have a position + case Vector(file) => idxs.map(idx => SourcePosition(file.toPath, idx, 0)) case _ => List.empty } }).getOrElse(List.empty) @@ -439,9 +559,12 @@ class ScallopGobraConfig(arguments: Seq[String], isInputOptional: Boolean = fals } lazy val config: Config = Config( - inputs = inputs, + recursive = recursive(), + gobraDirectory = gobraDirectory(), + packageInfoInputMap = inputPackageMap, moduleName = module(), includeDirs = includeDirs, + projectRoot = projectRoot, reporter = FileWriterReporter( unparse = unparse(), eraseGhost = eraseGhost(), @@ -452,6 +575,7 @@ class ScallopGobraConfig(arguments: Seq[String], isInputOptional: Boolean = fals backend = backend(), isolate = isolated, choppingUpperBound = chopUpperBound(), + packageTimeout = packageTimeoutDuration, z3Exe = z3Exe.toOption, boogieExe = boogieExe.toOption, logLevel = logLevel(), diff --git a/src/main/scala/viper/gobra/frontend/Desugar.scala b/src/main/scala/viper/gobra/frontend/Desugar.scala index d0348355d..67a4c4d38 100644 --- a/src/main/scala/viper/gobra/frontend/Desugar.scala +++ b/src/main/scala/viper/gobra/frontend/Desugar.scala @@ -38,7 +38,7 @@ object Desugar { val mainDesugarer = new Desugarer(pkg.positions, info) // combine all desugared results into one Viper program: val internalProgram = combine(mainDesugarer, mainDesugarer.packageD(pkg), importedPrograms) - config.reporter report DesugaredMessage(config.inputs.map(_.name), () => internalProgram) + config.reporter report DesugaredMessage(config.packageInfoInputMap(pkg.info).map(_.name), () => internalProgram) internalProgram } @@ -1525,6 +1525,9 @@ object Desugar { case Some(_: ap.NamedType) => val name = typeD(info.symbType(n), Addressability.Exclusive)(src).asInstanceOf[in.DefinedT].name unit(in.DefinedTExpr(name)(src)) + case Some(_: ap.BuiltInType) => + val name = typeD(info.symbType(n), Addressability.Exclusive)(src).asInstanceOf[in.DefinedT].name + unit(in.DefinedTExpr(name)(src)) case p => Violation.violation(s"encountered unexpected pattern: $p") } @@ -1552,6 +1555,9 @@ object Desugar { case Some(_: ap.NamedType) => val name = typeD(info.symbType(n), Addressability.Exclusive)(src).asInstanceOf[in.DefinedT].name unit(in.DefinedTExpr(name)(src)) + case Some(_: ap.BuiltInType) => + val name = typeD(info.symbType(n), Addressability.Exclusive)(src).asInstanceOf[in.DefinedT].name + unit(in.DefinedTExpr(name)(src)) case Some(p) => Violation.violation(s"only field selections, global constants, and types can be desugared to an expression, but got $p") case _ => Violation.violation(s"could not resolve $n") } @@ -1863,6 +1869,9 @@ object Desugar { val src: Meta = meta(expr) expr match { + + case PTypeExpr(t) => go(t) + case e: PExpression => exprD(ctx)(e) case PBoolType() => unit(in.BoolTExpr()(src)) @@ -3143,13 +3152,14 @@ object Desugar { private def name(postfix: String)(n: String, s: PScope, context: ExternalTypeInfo): String = { maybeRegister(s, context) + // n has occur first in order that function inverse properly works - s"${n}_${context.pkgName}_$postfix${scopeMap(s)}" // deterministic + s"${n}_${context.pkgInfo.viperId}_$postfix${scopeMap(s)}" // deterministic } private def nameWithoutScope(postfix: String)(n: String, context: ExternalTypeInfo): String = { // n has occur first in order that function inverse properly works - s"${n}_${context.pkgName}_$postfix" // deterministic + s"${n}_${context.pkgInfo.viperId}_$postfix" // deterministic } def variable(n: String, s: PScope, context: ExternalTypeInfo): String = name(VARIABLE_PREFIX)(n, s, context) diff --git a/src/main/scala/viper/gobra/frontend/InformativeErrorListener.scala b/src/main/scala/viper/gobra/frontend/InformativeErrorListener.scala new file mode 100644 index 000000000..9a9a69ae0 --- /dev/null +++ b/src/main/scala/viper/gobra/frontend/InformativeErrorListener.scala @@ -0,0 +1,318 @@ +// This Source Code Form is subject to the terms of the Mozilla Public +// License, v. 2.0. If a copy of the MPL was not distributed with this +// file, You can obtain one at http://mozilla.org/MPL/2.0/. +// +// Copyright (c) 2011-2022 ETH Zurich. + +package viper.gobra.frontend + +import org.antlr.v4.runtime.misc.IntervalSet +import org.antlr.v4.runtime.{BaseErrorListener, CommonTokenStream, FailedPredicateException, InputMismatchException, Lexer, NoViableAltException, Parser, RecognitionException, Recognizer, Token} +import org.bitbucket.inkytonik.kiama.util.{FileSource, Source} +import viper.gobra.frontend.GobraParser._ +import viper.gobra.frontend.Source.FromFileSource +import viper.gobra.reporting.ParserError +import viper.silver.ast.SourcePosition + +import java.nio.file.Path +import scala.annotation.unused +import scala.collection.mutable.ListBuffer + +class InformativeErrorListener(val messages: ListBuffer[ParserError], val source: Source) extends BaseErrorListener { + + /** + * + * @param recognizer The recognizer that encountered the error + * @param offendingSymbol The symbol that caused the error + * @param line The line number in the Source + * @param charPositionInLine The column in the line + * @param msg The message emitted by the [[org.antlr.v4.runtime.ANTLRErrorListener]] + * @param e The specific [[RecognitionException]] thrown by the parser + */ + override def syntaxError(recognizer: Recognizer[_, _], offendingSymbol: Any, line: Int, charPositionInLine: Int, msg: String, e: RecognitionException): Unit = { + // We don't analyze Lexer errors any further: The defaults are sufficient + val error = recognizer match { + case lexer: Lexer => DefaultErrorType()(LexerErrorContext(lexer, null, line, charPositionInLine, msg)) + case parser: Parser => + analyzeParserError(ParserErrorContext(parser, offendingSymbol.asInstanceOf[Token], line, charPositionInLine, msg), e) + } + + // Depending on the source, get the applicable type of position information + val pos = source match { + case source: FileSource => Some(SourcePosition(Path.of(source.name), line, charPositionInLine)) + case source: FromFileSource => Some(SourcePosition(source.path, line, charPositionInLine)) + case _ => None + } + + // Wrap the error in Gobra's error class + val message = Some(ParserError(error.full, pos)) + messages.appendAll(message) + } + + /** + * Check the given error context against a set of known patterns to check for specific common errors. + * @param context + * @param e + * @return + */ + def analyzeParserError(implicit context : ParserErrorContext, e : RecognitionException): ErrorType = { + e match { + case exception: FailedPredicateException => analyzeFailedPredicate(context, exception) + case exception: InputMismatchException => analyzeInputMismatch(context, exception) + case exception: NoViableAltException => analyzeNoViable(context, exception) + case null => context.msg match { + case extraneous() => analyzeExtraneous(context) + case missing() => DefaultErrorType() + } + case _ => DefaultErrorType() + } + } + + + /** + * Failed predicate errors are emitted when no viable alternatives remain, as all alternatives conflict with the input + * or contain a semantic predicate that evaluated to false. Because the only predicate present in Gobra's grammar + * is responsible for inducing semicolons, we know that if a predicate failed, we are at a point where a statement + * could have ended, but another token was discovered. + * + * @see [[FailedPredicateException]] + * @param context + * @param exception + * @return + */ + def analyzeFailedPredicate(implicit context: ParserErrorContext, @unused exception: FailedPredicateException): ErrorType = { + val parser = context.recognizer + parser.getContext match { + // One example of a known pattern: Parser reads ':=' when expecting the end of statement: The user probably + // used ':=' instead of '=' + case _: GobraParser.EosContext => { + context.offendingSymbol.getType match { + // An unexpected := was encountered, perhaps the user meant = + case GobraParser.DECLARE_ASSIGN => GotAssignErrorType() + case _ => DefaultFailedEOS() + } + } + case _ => DefaultErrorType() + } + } + + /** + * An extraneous token error is emitted whenever a single token stands in the way of correctly + * parsing the input. + * + * @param context The context of the error + * @return + */ + def analyzeExtraneous(implicit context: ParserErrorContext): ErrorType = { + (context.offendingSymbol.getType, context.recognizer.getContext) match { + // Type aliases use an = token, while type definitions do not use an assignemnt token at all + // The extraneous := was most likely supposed to be a = + case (GobraParser.DECLARE_ASSIGN, _ : TypeSpecContext) => GotAssignErrorType() + // We expected more tokens inside a slice expression but got a closing bracket: One of the + // limits must be missing. + case (GobraParser.R_BRACKET, expr : ExpressionContext) if expr.parent.isInstanceOf[CapContext] => SliceMissingIndex(3) + case _ => DefaultExtraneous() + } + } + + /** + * The input did not match the expected tokens. This is one of the most common exceptions. + * + * @see [[InputMismatchException]] + * @param context The context of the error + * @param exception + * @return + */ + def analyzeInputMismatch(implicit context: ParserErrorContext, @unused exception: InputMismatchException): ErrorType = { + (context.offendingSymbol.getType, context.recognizer.getContext) match { + case (Token.EOF, _) => DefaultMismatch() + // Again, we have an unexpected :=, so suggest using a = + case (GobraParser.DECLARE_ASSIGN, _) => GotAssignErrorType() + case (GobraParser.R_BRACKET, e : ExpressionContext) if e.parent.isInstanceOf[CapContext] => SliceMissingIndex(3) + case _ => DefaultMismatch() + } + } + + /** + * The parser simulated all possible rule alternatives, but did not find any that matched the input. + * + * @see [[NoViableAltException]] + * @param context The context of the error + * @param exception + * @return + */ + def analyzeNoViable(implicit context: ParserErrorContext, exception: NoViableAltException): ErrorType = { + val parser = context.recognizer + val ctx = parser.getContext + ctx match { + case _: Slice_Context => { + // Missing either the second or second and third argument (or completely wrong) + SliceMissingIndex() + } + case _: VarSpecContext | _: Type_Context if context.offendingSymbol.getType == GobraParser.DECLARE_ASSIGN => GotAssignErrorType() + case _: EosContext => { + parser.getTokenStream.LT(2).getType match { + case GobraParser.DECLARE_ASSIGN => GotAssignErrorType()(context.copy(offendingSymbol = parser.getTokenStream.LT(2))) + case _ => DefaultNoViable(exception) + } + } + case e: ExpressionContext if e.parent.isInstanceOf[CapContext] => SliceMissingIndex(3) + case _ if new_reserved.contains(context.offendingSymbol.getType) => ReservedWord() + case _ => DefaultNoViable(exception) + } + } + + + /** + * This method will print out the line containing the offending symbol, as well as + * caret character underlining the error. This is slightly modified from the base version found + * in the official ANTLR Guide + * + * @param context The context of the error + * @param restOfTheLine Also underline the rest of the line. Useful if the rest of the line is most likely wrong as + * well as the token in the [[ErrorContext]] + * @return + */ + protected def underlineError(context : ErrorContext, restOfTheLine : Boolean = false): String = { + val offendingToken = context.offendingSymbol match { + case t : Token => t + case _ => return "" + } + val tokens = context.recognizer.getInputStream.asInstanceOf[CommonTokenStream] + val input = tokens.getTokenSource.getInputStream.toString + val lines = input.split("\r?\n", -1) + var message = lines(offendingToken.getLine - 1) + val rest = message.length + message += "\n" + message += " " * offendingToken.getCharPositionInLine + val start = offendingToken.getCharPositionInLine + val stop = if (restOfTheLine) rest else offendingToken.getCharPositionInLine + offendingToken.getText.length + if (start >= 0 && stop >= 0) { message += "^" * (stop - start) } + message += "\n" + message + } + + + /** + * Return the display name associated with a specific rule + * @param index + * @return + */ + def getRuleDisplay(index : Int): String = { + betterRuleNames.getOrElse(index, ruleNames(index)) + } + + /** + * Not all rules have a very descriptive name, this map provides more user-friendly names for them. + */ + private val betterRuleNames : Map[Int, String] = Map{ + RULE_type_ -> "type" + RULE_eos -> "end of line" + RULE_varDecl -> "var declaration" + RULE_shortVarDecl -> "short variable declaration" + RULE_blockWithBodyParameterInfo -> "block" + } + + /** + * The same as [[betterRuleNames]], but for tokens. + * @param t + * @return + */ + def getTokenDisplay(t : Token): String = { + t.getText match { + case "\n" => "end of line" + case s => s + } + } + + + private val extraneous = "extraneous.*".r + private val missing = "missing.*".r + + /** + * This is a wrapper around all context informatin passed to the error listener. + */ + sealed trait ErrorContext { + val recognizer : Recognizer[_, _] + val offendingSymbol: Token + val line: Int + val charPositionInLine: Int + val msg: String + } + + case class LexerErrorContext(recognizer: Lexer, offendingSymbol: Null, line: Int, charPositionInLine: Int, msg: String) extends ErrorContext + + case class ParserErrorContext(recognizer: Parser, offendingSymbol: Token, line: Int, charPositionInLine: Int, msg: String) extends ErrorContext + + + /** + * This class and its inheritors characterise different error types and + * include specific error messages for them. + */ + sealed trait ErrorType { + val context: ErrorContext + val msg : String + lazy val expected : IntervalSet = context.recognizer match { + case _: Lexer => IntervalSet.EMPTY_SET + case parser: Parser => parser.getExpectedTokens + } + lazy val underlined : String = underlineError(context) + lazy val full : String = msg + "\n" + underlined + } + + case class DefaultErrorType()(implicit val context : ErrorContext) extends ErrorType { + val msg : String = context.msg + } + + case class DefaultExtraneous()(implicit val context : ParserErrorContext) extends ErrorType { + val msg : String = s"extraneous ${context.offendingSymbol.getText} in ${context.recognizer.getRuleNames()(context.recognizer.getContext.getRuleIndex)}" + } + + case class DefaultMismatch()(implicit val context : ParserErrorContext) extends ErrorType { + val msg : String = s"unexpected ${getTokenDisplay(context.offendingSymbol)}" + + (if (context.offendingSymbol == context.recognizer.getContext.getStart) s", expecting ${context.recognizer.getRuleNames()(context.recognizer.getContext.getRuleIndex)}" + else s" in ${getRuleDisplay(context.recognizer.getContext.getRuleIndex)}, expecting ${context.recognizer.getExpectedTokens.toString(GobraParser.VOCABULARY)}") + + } + + case class DefaultNoViable(e : NoViableAltException)(implicit val context: ParserErrorContext) extends ErrorType { + //val msg : String = s"Wrong Syntax at '${context.recognizer.getTokenStream.getText(e.getStartToken, e.getOffendingToken)}'." + val msg : String = context.msg + override lazy val underlined: String = underlineError(context.copy(offendingSymbol = e.getStartToken), restOfTheLine = true) + } + + case class DefaultFailedEOS()(implicit val context: ParserErrorContext) extends ErrorType { + val msg : String = s"Could not finish parsing the line." + } + + case class GotAssignErrorType()(implicit val context : ParserErrorContext) extends ErrorType { + val msg : String = "Unexpected ':=', did you mean '='?" + } + + case class SliceMissingIndex(index : Int = 0)(implicit val context : ParserErrorContext) extends ErrorType { + val msg : String = s"Wrong syntax inside slice type. In a 3-index slice, the ${ + index match { + case 2 => "2nd is" + case 3 => "3rd is" + case _ => "2nd and 3rd are" + } + } required." + } + + case class RangeNoSpaces(hint : String = "")(implicit val context : ErrorContext) extends ErrorType { + val msg = "Missing spaces" + } + + + case class EOFError()(implicit val context : ErrorContext) extends ErrorType { + val msg = "Unexpectedly reached end of file." + override lazy val full: String = msg + } + + case class ReservedWord()(implicit val context : ErrorContext) extends ErrorType { + val msg = s"Unexpected reserved word ${context.offendingSymbol.getText}." + } + + // All tokens reserved by gobra, but not by Go + val new_reserved = IntervalSet.of(GobraParser.TRUE, GobraParser.TRUSTED) +} diff --git a/src/main/scala/viper/gobra/frontend/PackageResolver.scala b/src/main/scala/viper/gobra/frontend/PackageResolver.scala index 05568d4ba..269f1404f 100644 --- a/src/main/scala/viper/gobra/frontend/PackageResolver.scala +++ b/src/main/scala/viper/gobra/frontend/PackageResolver.scala @@ -11,7 +11,7 @@ import java.nio.file.{FileSystem, FileSystemAlreadyExistsException, FileSystems, import java.util.Collections import org.apache.commons.io.FilenameUtils import org.apache.commons.lang3.SystemUtils -import org.bitbucket.inkytonik.kiama.util.{FileSource, Source} +import org.bitbucket.inkytonik.kiama.util.Source import viper.gobra.ast.frontend.PImplicitQualifiedImport import viper.gobra.frontend.Source.FromFileSource @@ -114,13 +114,13 @@ object PackageResolver { } private def getIncludeResources(includeDirs: Vector[Path]): Vector[InputResource] = { - includeDirs.map(FileResource) + includeDirs.map(FileResource(_)) } - private val getBuiltInResource: Option[InputResource] = getResource(builtInDirectory) - private val getStubResources: Vector[InputResource] = stubDirectories.flatMap(getResource) + private val getBuiltInResource: Option[InputResource] = getBuiltInResource(builtInDirectory) + private val getStubResources: Vector[InputResource] = stubDirectories.flatMap(getBuiltInResource(_)) - private def getResource(path: String): Option[InputResource] = { + private def getBuiltInResource(path: String): Option[InputResource] = { val nullableResourceUri = getClass.getClassLoader.getResource(path).toURI for { resourceUri <- Option.when(nullableResourceUri != null)(nullableResourceUri) @@ -130,14 +130,14 @@ object PackageResolver { // BaseJarResource provides an abstraction that internally uses an adhoc filesystem to enable file-like access // to these resources. resource <- resourceUri.getScheme match { - case s if s == fileUriScheme => Some(FileResource(Paths.get(resourceUri))) + case s if s == fileUriScheme => Some(FileResource(Paths.get(resourceUri), builtin = true)) case s if s == jarUriScheme => val fs = try { FileSystems.newFileSystem(resourceUri, Collections.emptyMap[String, Any]()) } catch { case _: FileSystemAlreadyExistsException => FileSystems.getFileSystem(resourceUri) } - Some(JarResource(fs, path)) + Some(JarResource(fs, path, builtin = true)) case _ => None } } yield resource @@ -205,7 +205,7 @@ object PackageResolver { // importPath is only used to create an error message that is similar to the error message of the official Go compiler def getPackageClauses(files: Vector[InputResource]): Either[String, Vector[(InputResource, String)]] = { val pkgClauses = files.map(f => { - getPackageClause(f) match { + getPackageClause(f.asSource()) match { case Some(pkgClause) => Right(f -> pkgClause) case _ => Left(f) } @@ -230,22 +230,20 @@ object PackageResolver { } yield pkgName } - private lazy val pkgClauseRegex = """(?:\/\/.*|\/\*(?:.|\n)*\*\/|package(?:\s|\n)+([a-zA-Z_][a-zA-Z0-9_]*))""".r + // Multiline comments are matched lazily, meaning it will stop at the earliest encountered '*/' + private lazy val pkgClauseRegex = """(?:\/\/.*|\/\*(?:.|\n)*?\*\/|package(?:\s|\n)+([a-zA-Z_][a-zA-Z0-9_]*))""".r - private def getPackageClause(file: InputResource): Option[String] = { - val inputStream = file.asStream() - val bufferedSource = new BufferedSource(inputStream) - val content = bufferedSource.mkString - bufferedSource.close() + def getPackageClause(src: Source): Option[String] = { // TODO is there a way to perform the regex lazily on the file's content? pkgClauseRegex - .findAllMatchIn(content) + .findAllMatchIn(src.content) .collectFirst { case m if m.group(1) != null => m.group(1) } } trait InputResource extends Closeable { val path: Path + val builtin: Boolean def resolve(pathComponent: String): InputResource @@ -278,7 +276,7 @@ object PackageResolver { def asSource(): Source } - case class FileResource(path: Path) extends InputResource { + case class FileResource(path: Path, builtin: Boolean = false) extends InputResource { override def resolve(pathComponent: String): FileResource = FileResource(path.resolve(pathComponent)) @@ -288,15 +286,15 @@ object PackageResolver { .map(p => FileResource(p)) } - override def asSource(): FileSource = FileSource(path.toString) + override def asSource(): FromFileSource = FromFileSource(path, builtin) } - case class JarResource(filesystem: FileSystem, pathString: String) extends InputResource { + case class JarResource(filesystem: FileSystem, pathString: String, builtin: Boolean = false) extends InputResource { override def resolve(pathComponent: String): JarResource = - JarResource(filesystem, path.resolve(pathComponent).toString) + JarResource(filesystem, path.resolve(pathComponent).toString, builtin) override def listContent(): Vector[JarResource] = - Files.newDirectoryStream(path).asScala.toVector.map(p => JarResource(filesystem, p.toString)) + Files.newDirectoryStream(path).asScala.toVector.map(p => JarResource(filesystem, p.toString, builtin)) override val path: Path = filesystem.getPath(pathString) @@ -304,7 +302,7 @@ object PackageResolver { val bufferedSource = new BufferedSource(asStream()) val content = bufferedSource.mkString bufferedSource.close() - FromFileSource(path, content) + FromFileSource(path, content, builtin) } } } diff --git a/src/main/scala/viper/gobra/frontend/ParseTreeTranslator.scala b/src/main/scala/viper/gobra/frontend/ParseTreeTranslator.scala new file mode 100644 index 000000000..3d93d581a --- /dev/null +++ b/src/main/scala/viper/gobra/frontend/ParseTreeTranslator.scala @@ -0,0 +1,2241 @@ +// This Source Code Form is subject to the terms of the Mozilla Public +// License, v. 2.0. If a copy of the MPL was not distributed with this +// file, You can obtain one at http://mozilla.org/MPL/2.0/. +// +// Copyright (c) 2011-2022 ETH Zurich. + + +package viper.gobra.frontend +import org.antlr.v4.runtime.{ParserRuleContext, Token} +import org.antlr.v4.runtime.tree.{ParseTree, RuleNode, TerminalNode} +import org.bitbucket.inkytonik.kiama.util.{Position, Source} +import viper.carbon.boogie.Implicits.lift +import viper.gobra.ast.frontend._ +import viper.gobra.util.{Binary, Hexadecimal, Octal} +import viper.gobra.frontend.GobraParser._ +import viper.gobra.frontend.Parser.PRewriter +import viper.gobra.frontend.TranslationHelpers._ +import viper.gobra.util.Violation.violation + +import scala.StringContext.InvalidEscapeException +import scala.annotation.unused +import scala.collection.mutable.ListBuffer +import scala.jdk.CollectionConverters._ + +class ParseTreeTranslator(pom: PositionManager, source: Source, specOnly : Boolean = false) extends GobraParserBaseVisitor[AnyRef] { + + val warnings : ListBuffer[TranslationWarning] = ListBuffer.empty + + lazy val rewriter = new PRewriter(pom.positions) + + def translate[Rule <: ParserRuleContext, Node](tree: Rule): Node = { + visit(tree) match { + case n : Node @unchecked => n + } + } + + //region Partial parsing + /** + * This region contains functions to support parsing only one specific rule, and failing + * if the entire input cannot be matched by this rule. + */ + + /** + * Visit the rule + * typeOnly: type_ EOF; + */ + override def visitTypeOnly(ctx: TypeOnlyContext): PType = visitNode[PType](ctx.type_()) + + /** + * Visit the rule + * stmtOnly: statement EOF; + */ + override def visitStmtOnly(ctx: StmtOnlyContext): PStatement = visitNode[PStatement](ctx.statement()) + + /** + * Visit the rule + * exprOnly: expression EOF; + */ + override def visitExprOnly(ctx: ExprOnlyContext): PExpression = visitNode[PExpression](ctx.expression()) + //endregion + + //region Lexical Elements + /** + * This region contains visitors for the basic lexical elements, such as + * identifiers and basic literals. + */ + + //region Identifiers + + /** + * This class extracts PIdnNodes from IDENTIFIER tokens + * + * @param constructor The constructor used to create the PIdnNode + * @param blankIdentifier A function to handle blank identifiers. If blank identifiers are not allowed, it should + * always return None, otherwise it should return the appropriate PIdnNode. + * @tparam N the type of the PIdnNode to return + */ + case class PIdnNodeEx[N <: PNode](constructor : String => N, blankIdentifier : TerminalNode => Option[N]) { + def unapply(arg: TerminalNode) : Option[N] = { + arg.getText match { + case "_" => blankIdentifier(arg) + case a : String => Some(constructor(a).at(arg)) + case _ => None + } + } + /** + * Directly extract a PIdnNode from an IDENTIFIER token. Fails if the token doesn't match. + * @param arg The IDENTIFIER to extract from + * @return A vector of PIdnNodes + */ + def get(arg : TerminalNode) : N = unapply(arg) match { + case Some(value) => value + case None => fail(arg) + } + } + + /** + * This class extracts Vectors of PIdnNode from Lists of IDENTIFIER tokens + * + * @param extractor The extractor used for the individual identifiers + * @tparam N The type of the PIdnNode to return + */ + case class PIdnNodeListEx[N <: PNode](extractor : PIdnNodeEx[N]) { + def unapply(arg : Iterable[TerminalNode]) : Option[Vector[N]] = { + Some(arg.map(extractor.get).toVector) + } + + /** + * Directly extract a Vector of PIdnNode from a List of IDENTIFIER tokens. Fails if one of the tokens + * doen't match. + * @param arg An iterable of TerminalNodes + * @return A vector of PIdnNodes + */ + def get(arg: Iterable[TerminalNode]) : Vector[N] = unapply(arg) match { + case Some(value) => value + case None => fail(arg.head) + } + } + + // Extractors for all the possible types of PIdnNodes + private val idnDef = PIdnNodeEx(PIdnDef, _ => None) + private val idnDefList = PIdnNodeListEx(idnDef) + private val idnDefLike = PIdnNodeEx(PIdnDef, term => Some(PWildcard().at(term))) + private val idnDefLikeList = PIdnNodeListEx(idnDefLike) + private val idnUnk = PIdnNodeEx(PIdnUnk, _ => None) + private val idnUnkList = PIdnNodeListEx(idnUnk) + private val idnUnkLike = PIdnNodeEx(PIdnUnk, term => Some(PWildcard().at(term))) + private val idnUnkLikeList = PIdnNodeListEx(idnUnkLike) + private val idnUse = PIdnNodeEx(PIdnUse, _ => None) + private val idnUseList = PIdnNodeListEx(idnUse) + private val idnUseLike = PIdnNodeEx(PIdnUse, term => Some(PWildcard().at(term))) + @unused private val idnUseLikeList = PIdnNodeListEx(idnUseLike) + + // These extractors may only be used where Go allows the blank identifier, but Gobra doesnt + // They generate a unique PIdnNode whose name starts with "_" to not overlap any other identifiers + private val goIdnDef = PIdnNodeEx(PIdnDef, term => Some(uniqueWildcard(PIdnDef, term).at(term))) + private val goIdnDefList = PIdnNodeListEx(goIdnDef) + private val goIdnUnk = PIdnNodeEx(PIdnUnk, term => Some(uniqueWildcard(PIdnUnk, term).at(term))) + private val goIdnUnkList = PIdnNodeListEx(goIdnUnk) + + def uniqueWildcard[N](constructor : String => N, term : TerminalNode) : N = constructor("_"+term.getSymbol.getTokenIndex) + //endregion + + //region Basic Literals + + /** + * Visits integer literals. Supports octal, hex, binary, decimal and single char or little-u + * runes. (For example 'a', '本', '\t', '\u12e4') + * @param ctx the parse tree + * */ + override def visitInteger(ctx: GobraParser.IntegerContext): PIntLit = { + val octal = raw"0[oO]?([0-7_]+)".r + val hex = "0[xX]([0-9A-Fa-f_]+)".r + val bin = "0[bB]([01_]+)".r + val dec = "([0-9_]+)".r + val runeChar = "'(.*)'".r + val bigU = """\\U([0-9a-fA-F]{8})""".r + val hex_byte = """\\x([0-9a-fA-F]{2})""".r + val octal_byte = """\\([0-7]{3})""".r + visitChildren(ctx).asInstanceOf[String] match { + case octal(digits) => PIntLit(BigInt(digits, 8), Octal).at(ctx) + case hex(digits) => PIntLit(BigInt(digits, 16), Hexadecimal).at(ctx) + case bin(digits) => PIntLit(BigInt(digits, 2), Binary).at(ctx) + case dec(digits) => PIntLit(BigInt(digits)).at(ctx) + case runeChar(rune) => rune match { + case bigU(digits) => PIntLit(BigInt(digits, 16), Hexadecimal).at(ctx) + case hex_byte(digits) => PIntLit(BigInt(digits, 16), Hexadecimal).at(ctx) + case octal_byte(digits) => PIntLit(BigInt(digits, 8), Octal).at(ctx) + // Single rune char + case _ => try { + StringContext.processEscapes(rune).codePoints().toArray match { + case Array(i : Int) => PIntLit(BigInt(i)).at(ctx) + } + } catch { + case e : InvalidEscapeException => violation(s"Rune literal should not have been parsed: ${e}") + } + } + case _ => fail(ctx, "This literal is not supported yet") + } + } + + def visitFloat(node: TerminalNode): PBasicLiteral = { + val hex = "(0[xX].*)".r + node.getText.replace("_","") match { + // TODO : This only supports hex floats in the Double range (53 + 12 bits), Go requests up to 256 + 16 bits + case hex(float) => java.lang.Double.parseDouble(float) match { + case Double.NegativeInfinity | Double.PositiveInfinity => fail(node, "Gobra only supports hex floats in the float64 range") + case float => PFloatLit(BigDecimal(float)).at(node) + } + case float => PFloatLit(BigDecimal(float)).at(node) + } + } + + /** + * {@inheritDoc } + * + *

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

+ */ + override def visitString_(ctx: GobraParser.String_Context): PStringLit = { + // Remove the delimiters + val string = ".((?:.|\n)*).".r + visitChildren(ctx).asInstanceOf[String] match { + case string(str) => PStringLit(str).at(ctx) + } + } + //endregion + + //endregion + + //region Types + + override def visitTypeName(ctx: GobraParser.TypeNameContext): PTypeName = { + visitChildren(ctx) match { + case idnUse(id) => visitTypeIdentifier(id) // replace with `PNamedOperand(id)` when arrays etc. of custom types are supported + case qualified : PDot => qualified + case _ => unexpected(ctx) + } + } + + /** + * {@inheritDoc } + * + *

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

+ */ + override def visitQualifiedIdent(ctx: QualifiedIdentContext): PDot = { + visitChildren(ctx) match { + case Vector(idnUse(base), ".", idnUse(id)) => PDot(PNamedOperand(base).at(base), id).at(ctx) + case _ => unexpected(ctx) + } + } + + def visitTypeIdentifier(typ: PIdnUse): PUnqualifiedTypeName = { + typ.name match { + case "perm" => PPermissionType().at(typ) + case "int" => PIntType().at(typ) + case "int16" => PInt16Type().at(typ) + case "int32" => PInt32Type().at(typ) + case "int64" => PInt64Type().at(typ) + case "uint" => PUIntType().at(typ) + case "byte" => PByte().at(typ) + case "uint8" => PUInt8Type().at(typ) + case "uint16" => PUInt16Type().at(typ) + case "uint32" => PUInt32Type().at(typ) + case "uint64" => PUInt64Type().at(typ) + case "uintptr" => PUIntPtr().at(typ) + case "float32" => PFloat32().at(typ) + case "float64" => PFloat64().at(typ) + case "bool" => PBoolType().at(typ) + case "string" => PStringType().at(typ) + case "rune" => PRune().at(typ) + case _ => PNamedOperand(typ).at(typ) + } + } + + /** + * Visits the rule + * arrayType: L_BRACKET arrayLength R_BRACKET elementType; + */ + override def visitArrayType(ctx: ArrayTypeContext): PArrayType = { + visitChildren(ctx) match { + case Vector("[", len : PExpression, "]", elem : PType) => PArrayType(len, elem) + case _ => unexpected(ctx) + } + } + + + /** + * Visits the rule + * implicitArray: L_BRACKET ELLIPSIS R_BRACKET elementType; + */ + override def visitImplicitArray(ctx: ImplicitArrayContext): AnyRef = visitChildren(ctx) match { + case Vector("[", "...", "]", elem: PType) => PImplicitSizeArrayType(elem) + } + + /** + * Visits the rule + * sliceType: L_BRACKET R_BRACKET elementType; + */ + override def visitSliceType(ctx: SliceTypeContext): PSliceType = visitChildren(ctx) match { + case Vector("[", "]", typ : PType) => PSliceType(typ) + case _ => unexpected(ctx) + } + + //region Struct Types + /** + * {@inheritDoc } + * + *

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

+ */ + override def visitStructType(ctx: StructTypeContext): PStructType = { + val decls = for (decl <- ctx.fieldDecl().asScala.toVector) yield visitNode[PStructClause](decl) + PStructType(decls).at(ctx) + } + + /** + * {@inheritDoc } + * + *

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

+ */ + override def visitFieldDecl(ctx: FieldDeclContext): PStructClause = { + if (ctx.embeddedField() != null) { + val et = visitNode[PEmbeddedType](ctx.embeddedField()) + PEmbeddedDecl(et, PIdnDef(et.name).at(et)) + } else { + val goIdnDefList(ids) = visitIdentifierList(ctx.identifierList()) + val t = visitNode[PType](ctx.type_()) + PFieldDecls(ids map (id => PFieldDecl(id, t.copy).at(id))) + } + } + + /** + * {@inheritDoc } + * + *

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

+ */ + override def visitEmbeddedField(ctx: EmbeddedFieldContext): PEmbeddedType = { + visitChildren(ctx) match { + case name : PUnqualifiedTypeName => PEmbeddedName(name) + case Vector("*", name : PUnqualifiedTypeName) => PEmbeddedPointer(name) + case _ : PDot | Vector("*", _ : PDot) => fail(ctx, "Imported types are not yet supported as embedded interface names") + } + } + //endregion + + /** + * {@inheritDoc } + * + *

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

+ */ + override def visitPointerType(ctx: PointerTypeContext): PDeref = visitChildren(ctx) match { + case Vector("*", typ : PType) => PDeref(typ) + case _ => unexpected(ctx) + } + + //region Function Types + /** + * {@inheritDoc } + * + *

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

+ */ + override def visitFunctionType(ctx: FunctionTypeContext): PFunctionType = { + visitChildren(ctx) match { + case Vector("func", (args: Vector[PParameter] @unchecked, result : PResult)) => PFunctionType(args, result) + } + } + + /** + * Visit a parse tree produced by `GobraParser`. + * + * @param ctx the parse tree + * @return the visitor result + */ + override def visitSignature(ctx: GobraParser.SignatureContext): Signature = { + val params = visitNode[Vector[Vector[PParameter]]](ctx.parameters()) + val result = if (ctx.result() != null) visitResult(ctx.result()) else PResult(Vector.empty).at(ctx) + (params.flatten, result) + } + + override def visitParameters(ctx: ParametersContext): Vector[Vector[PParameter]] = { + for (param <- ctx.parameterDecl().asScala.toVector) yield visitNode[Vector[PParameter]](param) + } + + type Signature = (Vector[PParameter], PResult) + + /** + * Visit a parse tree produced by `GobraParser`. + * + * @param ctx the parse tree + * @return the visitor result + */ + override def visitResult(ctx: GobraParser.ResultContext): PResult = { + super.visitResult(ctx) match { + case res: Vector[Vector[PParameter]] => PResult(res.flatten).at(ctx) + case typ: PType => PResult(Vector(PUnnamedParameter(typ).at(typ))).at(ctx) + } + } + + override def visitActualParameterDecl(ctx: ActualParameterDeclContext): Vector[PParameter] = super.visitActualParameterDecl(ctx) match { + case Vector(goIdnDefList(ids), typ : PType) => ids.map(id => PNamedParameter(id, typ.copy).at(id)) + case typ : PType => Vector(PUnnamedParameter(typ).at(typ)) + } + + override def visitGhostParameterDecl(ctx: GhostParameterDeclContext): AnyRef = super.visitGhostParameterDecl(ctx) match { + case Vector("ghost", rest@_*) => rest match { + case Vector(goIdnDefList(ids), typ : PType) => ids.map(id => PExplicitGhostParameter(PNamedParameter(id, typ.copy).at(id)).at(id)) + case Vector(typ : PType) => Vector(PExplicitGhostParameter(PUnnamedParameter(typ).at(typ)).at(typ)) + } + } + + override def visitParameterType(ctx: ParameterTypeContext): AnyRef = super.visitParameterType(ctx) match { + case Vector("...", typ : PType) => PVariadicType(typ) + case typ: PType => typ + } + //endregion + + /** + * {@inheritDoc } + * + *

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

+ */ + override def visitInterfaceType(ctx: GobraParser.InterfaceTypeContext): PInterfaceType = { + val methodDecls = visitListNode[PMethodSig](ctx.methodSpec()) + val embedded = visitListNode[PTypeName](ctx.typeName()).map { + case tn: PUnqualifiedTypeName => PInterfaceName(tn) + case _: PDot => fail(ctx, "Imported types are not yet supported as embedded fields.") + case _ => fail(ctx, s"Interface embeds predeclared type.") + } + val predicateDecls = visitListNode[PMPredicateSig](ctx.predicateSpec()) + PInterfaceType(embedded, methodDecls, predicateDecls).at(ctx) + } + + + /** + * {@inheritDoc } + * + *

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

+ */ + override def visitMethodSpec(ctx: GobraParser.MethodSpecContext): PMethodSig = { + val ghost = has(ctx.GHOST()) + val spec = if (ctx.specification() != null) visitSpecification(ctx.specification()) else PFunctionSpec(Vector.empty,Vector.empty,Vector.empty, Vector.empty).at(ctx) + // The name of each explicitly specified method must be unique and not blank. + val id = idnDef.get(ctx.IDENTIFIER()) + val args = visitNode[Vector[Vector[PParameter]]](ctx.parameters()) + val result = visitNodeOrElse[PResult](ctx.result(), PResult(Vector.empty)) + PMethodSig(id, args.flatten, result, spec, isGhost = ghost).at(ctx) + } + + /** + * {@inheritDoc } + * + *

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

+ */ + override def visitPredicateSpec(ctx: PredicateSpecContext): PMPredicateSig = { + val id = idnDef.get(ctx.IDENTIFIER()) + val args = visitNode[Vector[Vector[PParameter]]](ctx.parameters()) + PMPredicateSig(id, args.flatten).at(ctx) + } + + + /** + * Visits the rule + * mapType: MAP L_BRACKET type_ R_BRACKET elementType; + */ + override def visitMapType(ctx: MapTypeContext): PMapType = { + visitChildren(ctx) match { + case Vector("map", "[", key : PType, "]", elem : PType) => PMapType(key, elem).at(ctx) + } + } + + /** + * Visits channel types. + * @param ctx the channel context + * */ + override def visitChannelType(ctx: ChannelTypeContext): PChannelType = { + val res = visitChildren(ctx) match { + case Vector("chan", typ : PType) => PBiChannelType(typ) + case Vector("chan", "<-", typ : PType) => PSendChannelType(typ) + case Vector("<-", "chan", typ : PType) => PRecvChannelType(typ) + } + res.at(ctx) + } + + //region Ghost types + /** + * {@inheritDoc } + * + *

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

+ */ + override def visitSqType(ctx: SqTypeContext): PGhostLiteralType = { + visitChildren(ctx) match { + case Vector(kind : String, "[", typ : PType, "]") => (kind match { + case "seq" => PSequenceType(typ) + case "set" => PSetType(typ) + case "mset" => PMultisetType(typ) + case "option" => POptionType(typ) + }).at(ctx) + case Vector("dict", "[", keys : PType, "]", values : PType) => PMathematicalMapType(keys, values).at(ctx) + } + } + + + /** + * {@inheritDoc } + * + *

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

+ */ + override def visitGhostSliceType(ctx: GhostSliceTypeContext): PGhostSliceType = { + val typ = visitNode[PType](ctx.elementType().type_()) + PGhostSliceType(typ).at(ctx) + } + + /** + * {@inheritDoc } + * + *

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

+ */ + override def visitDomainType(ctx: DomainTypeContext): PDomainType = { + val (funcs, axioms) = ctx.domainClause().asScala.toVector.partitionMap(visitDomainClause) + PDomainType(funcs, axioms).at(ctx) + } + + override def visitDomainClause(ctx: DomainClauseContext): Either[PDomainFunction, PDomainAxiom] = { + visitChildren(ctx) match { + case Vector("func", idnDef(id), (params : Vector[PParameter] @unchecked, result : PResult)) => Left(PDomainFunction(id, params, result).at(ctx)) + case Vector("axiom", "{", expr : PExpression, _, "}") => Right(PDomainAxiom(expr).at(ctx)) + case _ => fail(ctx) + } + } + + /** + * {@inheritDoc } + * + *

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

+ */ + override def visitPredType(ctx: PredTypeContext): PPredType = visitChildren(ctx) match { + case Vector("pred", params : Vector[PType] @unchecked) => PPredType(params) + } + + /** + * {@inheritDoc } + * + *

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

+ */ + override def visitPredTypeParams(ctx: PredTypeParamsContext): Vector[PType] = { + for (typ <- ctx.type_().asScala.toVector) yield visitNode[PType](typ) + } + + //endregion + + + //endregion + + //region Blocks + /** + * Visit a parse tree produced by `GobraParser`. + * + * @param ctx the parse tree + * @return the visitor result + */ + override def visitBlock(ctx: GobraParser.BlockContext): PBlock = { + if (ctx.statementList() != null) PBlock(visitStatementList(ctx.statementList())).at(ctx) else PBlock(Vector.empty).at(ctx) + } + + /** + * {@inheritDoc } + * + *

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

+ */ + override def visitBlockWithBodyParameterInfo(ctx: BlockWithBodyParameterInfoContext): (PBodyParameterInfo, PBlock) = { + val shareable = if (has(ctx.SHARE())) idnUseList.get(visitIdentifierList(ctx.identifierList())) else Vector.empty + val paramInfo = PBodyParameterInfo(shareable) + val body = if (has(ctx.statementList())) PBlock(visitStatementList(ctx.statementList())).at(ctx) else PBlock(Vector.empty).at(ctx) + (paramInfo, body) + } + + /** + * Visit a parse tree produced by `GobraParser`. + * + * @param ctx the parse tree + * @return the visitor result + */ + override def visitStatementList(ctx: GobraParser.StatementListContext): Vector[PStatement] = { + if (ctx == null) return Vector.empty + for (stmt <- ctx.statement().asScala.toVector) yield visitStatement(stmt) + } + //endregion + + //region Declarations + /** + * {@inheritDoc } + * + *

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

+ */ + override def visitConstDecl(ctx: GobraParser.ConstDeclContext): Vector[PConstDecl] = { + visitListNode[PConstDecl](ctx.constSpec()) match { + // Make sure the first expression list is not empty + case Vector(PConstDecl(_, Vector(), _), _*) => fail(ctx) + case decls => decls + } + } + + /** + * {@inheritDoc } + * + *

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

+ */ + override def visitConstSpec(ctx: GobraParser.ConstSpecContext): PConstDecl = { + val typ = if (ctx.type_() != null) Some(visitNode[PType](ctx.type_())) else None + + val idnDefLikeList(left) = visitIdentifierList(ctx.identifierList()) + val right = visitExpressionList(ctx.expressionList()) + + PConstDecl(typ, right, left).at(ctx) + } + + + /** + * {@inheritDoc } + * + *

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

+ */ + override def visitTypeDecl(ctx: GobraParser.TypeDeclContext): Vector[PTypeDecl] = { + visitListNode[PTypeDecl](ctx.typeSpec()) + } + + /** + * {@inheritDoc } + * + *

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

+ */ + override def visitTypeSpec(ctx: GobraParser.TypeSpecContext): PTypeDecl = { + val left = goIdnDef.get(ctx.IDENTIFIER()) + val right = visitNode[PType](ctx.type_()) + if (ctx.ASSIGN() != null) { + // = -> This is a type alias + PTypeAlias(right, left).at(ctx) + } else { + // -> This is a type definition + PTypeDef(right, left).at(ctx) + } + } + + + /** + * {@inheritDoc } + * + *

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

+ */ + override def visitVarDecl(ctx: GobraParser.VarDeclContext): Vector[PVarDecl] = { + visitListNode[PVarDecl](ctx.varSpec()) + } + + /** + * {@inheritDoc } + * + *

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

+ */ + override def visitVarSpec(ctx: GobraParser.VarSpecContext): PVarDecl = { + val (idnDefLikeList(vars), addressable) = visitMaybeAddressableIdentifierList(ctx.maybeAddressableIdentifierList()) + val typ = if(has(ctx.type_())) Some(visitNode[PType](ctx.type_())) else None + val right = if (has(ctx.expressionList())) visitExpressionList(ctx.expressionList()) else Vector.empty + PVarDecl(typ, right, vars, addressable).at(ctx) + } + + override def visitShortVarDecl(ctx: GobraParser.ShortVarDeclContext): PShortVarDecl = { + val (idnUnkLikeList(vars), addressable) = visitMaybeAddressableIdentifierList(ctx.maybeAddressableIdentifierList()) + val right = visitExpressionList(ctx.expressionList()) + PShortVarDecl(right, vars, addressable).at(ctx) + } + + + /** + * Visits an identifier list and returns a vector of TerminalNodes that can be matched by the + * appropriate PIdnExtractor. + * @param ctx the parse tree + * */ + override def visitIdentifierList(ctx: IdentifierListContext): Iterable[TerminalNode] = { + ctx.IDENTIFIER().asScala.view + } + + /** + * Visits a list of identifiers that may have the addressability modifier `@` + */ + override def visitMaybeAddressableIdentifierList(ctx: MaybeAddressableIdentifierListContext): (Vector[TerminalNode], Vector[Boolean]) = { + ctx.maybeAddressableIdentifier().asScala.toVector + .map(ctx => (ctx.IDENTIFIER(), has(ctx.ADDR_MOD()))) + .unzip + } + + /** + * Visits a single identifier that may have the addressability modifier `@` + */ + override def visitMaybeAddressableIdentifier(ctx: MaybeAddressableIdentifierContext): (TerminalNode, Boolean) = { + (ctx.IDENTIFIER(), has(ctx.ADDR_MOD())) + } + + + def visitAssignee(ctx: GobraParser.ExpressionContext): PAssignee = { + visitNode[PExpression](ctx) match { + case a : PAssignee => a + case _ => fail(ctx, "not an assignee") + } + } + + def visitAssigneeList(ctx : GobraParser.ExpressionListContext) : Vector[PAssignee] = { + if (!has(ctx)) Vector.empty else + (for (expr <- ctx.expression().asScala.view) yield visitAssignee(expr)).toVector.at(ctx) + } + + + /** + * Visit a parse tree produced by `GobraParser`. + * + * @param ctx the parse tree + * @return the visitor result + */ + override def visitExpressionList(ctx: GobraParser.ExpressionListContext): Vector[PExpression] = { + if (!has(ctx)) Vector.empty else + (for (expr <- ctx.expression().asScala.toVector) yield visitNode[PExpression](expr)).at(ctx) + } + + override def visitSpecMember(ctx: SpecMemberContext): AnyRef = super.visitSpecMember(ctx) match { + case Vector(spec : PFunctionSpec, (id: PIdnDef, args: Vector[PParameter], result: PResult, body: Option[(PBodyParameterInfo, PBlock)])) + => PFunctionDecl(id, args, result, spec, body) + case Vector(spec : PFunctionSpec, (id: PIdnDef, receiver: PReceiver, args: Vector[PParameter], result: PResult, body: Option[(PBodyParameterInfo, PBlock)])) + => PMethodDecl(id, receiver, args, result, spec, body) + } + + /** + * Visit a parse tree produced by `GobraParser`. + * + * @param ctx the parse tree + * @return the visitor result + */ + override def visitFunctionDecl(ctx: GobraParser.FunctionDeclContext): (PIdnDef, Vector[PParameter], PResult, Option[(PBodyParameterInfo, PBlock)]) = { + // Go allows the blank identifier here, but PFunctionDecl doesn't. + val id = goIdnDef.get(ctx.IDENTIFIER()) + val sig = visitNode[Signature](ctx.signature()) + // Translate the function body if the function is not abstract or trusted, specOnly isn't set or the function is pure + val body = if (has(ctx.blockWithBodyParameterInfo()) && !ctx.trusted && (!specOnly || ctx.pure)) Some(visitNode[(PBodyParameterInfo, PBlock)](ctx.blockWithBodyParameterInfo())) else None + (id, sig._1, sig._2, body) + } + + + override def visitMethodDecl(ctx: MethodDeclContext): (PIdnDef, PReceiver, Vector[PParameter], PResult, Option[(PBodyParameterInfo, PBlock)]) = { + // Go allows the blank identifier here, but PFunctionDecl doesn't. + val id = goIdnDef.get(ctx.IDENTIFIER()) + val recv = visitNode[PReceiver](ctx.receiver()) + val sig = visitNode[Signature](ctx.signature()) + val body = if (has(ctx.blockWithBodyParameterInfo()) && !ctx.trusted && (!specOnly || ctx.pure)) Some(visitNode[(PBodyParameterInfo, PBlock)](ctx.blockWithBodyParameterInfo())) else None + (id, recv,sig._1, sig._2, body) + } + + /** + * Visits Gobra specifications + * + * */ + override def visitSpecification(ctx: GobraParser.SpecificationContext): PFunctionSpec = { + // Group the specifications by keyword + val groups = ctx.specStatement().asScala.view.groupBy(_.kind.getType) + // Get the respective groups + val pres = groups.getOrElse(GobraParser.PRE, Seq.empty).toVector.map(s => visitNode[PExpression](s.assertion().expression())) + val preserves = groups.getOrElse(GobraParser.PRESERVES, Vector.empty).toVector.map(s => visitNode[PExpression](s.assertion().expression())) + val posts = groups.getOrElse(GobraParser.POST, Vector.empty).toVector.map(s => visitNode[PExpression](s.assertion().expression())) + val terms = groups.getOrElse(GobraParser.DEC, Vector.empty).toVector.map(s => visitTerminationMeasure(s.terminationMeasure())) + + PFunctionSpec(pres, preserves, posts, terms, isPure = ctx.pure, isTrusted = ctx.trusted) + } + + /** + * {@inheritDoc } + * + *

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

+ */ + override def visitReceiver(ctx: ReceiverContext): PReceiver = { + val recvType = visitNode[PType](ctx.type_()) match { + case t : PNamedOperand => PMethodReceiveName(t).at(t) + case PDeref(t : PNamedOperand) => PMethodReceivePointer(t).at(t) + case f => fail(ctx.type_(), s"Expected declared type or pointer to declared type but got: $f.") + } + + if (has(ctx.maybeAddressableIdentifier())) { + val (goIdnDef(id), addr) = visitMaybeAddressableIdentifier(ctx.maybeAddressableIdentifier()) + PNamedReceiver(id, recvType, addr).at(ctx) + } else PUnnamedReceiver(recvType).at(ctx) + } + + //region Ghost members + /** + * Visits the rule + * explicitGhostMember: GHOST (methodDecl | functionDecl | declaration); + * */ + override def visitExplicitGhostMember(ctx: ExplicitGhostMemberContext): Vector[PExplicitGhostMember] = super.visitExplicitGhostMember(ctx) match { + case Vector("ghost", decl : PGhostifiableMember) => Vector(PExplicitGhostMember(decl).at(ctx)) + case Vector("ghost", decl : Vector[PGhostifiableMember] @unchecked) => decl.map(PExplicitGhostMember(_).at(ctx)) + } + + + //region Implementation proofs + /** + * {@inheritDoc } + * + *

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

+ */ + override def visitImplementationProof(ctx: ImplementationProofContext): Vector[PImplementationProof] = { + val subT : PType = visitNode(ctx.type_(0)) + val superT : PType = visitNode[PType](ctx.type_(1)) + val alias = visitListNode[PImplementationProofPredicateAlias](ctx.implementationProofPredicateAlias()) + val memberProofs = visitListNode[PMethodImplementationProof](ctx.methodImplementationProof()) + Vector(PImplementationProof(subT, superT, alias, memberProofs).at(ctx)) + } + + /** + * {@inheritDoc } + * + *

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

+ */ + override def visitMethodImplementationProof(ctx: MethodImplementationProofContext): PMethodImplementationProof = { + val id = idnUse.get(ctx.IDENTIFIER()) + val receiver : PParameter = visitNode(ctx.nonLocalReceiver()) + val (args, result) = visitNode[Signature](ctx.signature()) + val isPure = has(ctx.PURE()) + val body = if (has(ctx.block())) Some((PBodyParameterInfo(Vector.empty).at(ctx), visitBlock(ctx.block()))) else None + body match { + case Some((a, b)) => pom.positions.dupRangePos(a, b, body) + case _ => + } + PMethodImplementationProof(id, receiver, args, result, isPure = isPure, body).at(ctx) + } + + /** + * {@inheritDoc } + * + *

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

+ */ + override def visitNonLocalReceiver(ctx: NonLocalReceiverContext): PParameter = { + visitChildren(ctx) match { + case Vector("(", idnDef(name), "*", typ : PTypeName, ")") => PNamedParameter(name, PDeref(typ).at(typ)).at(ctx) + case Vector("(", idnDef(name), typ : PTypeName, ")") => PNamedParameter(name, typ).at(ctx) + case Vector("(", "*", typ : PTypeName, ")") => PUnnamedParameter(PDeref(typ).at(typ)).at(ctx) + case Vector("(", typ : PTypeName, ")") => PUnnamedParameter(typ).at(ctx) + case _ => unexpected(ctx) + } + } + + + /** + * {@inheritDoc } + * + *

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

+ */ + override def visitImplementationProofPredicateAlias(ctx: ImplementationProofPredicateAliasContext): PImplementationProofPredicateAlias = { + val left = idnUse.get(ctx.IDENTIFIER()) + val right = visitChildren(ctx.selection()) match { + case name : PNamedOperand => name + case dot : PDot => dot + case Vector(typ : PType, ".", _) => PDot(typ, idnUse.get(ctx.selection().IDENTIFIER())).at(ctx.selection()) + case _ => fail(ctx, "must be either a selection or a named operand") + } + PImplementationProofPredicateAlias(left, right).at(ctx) + } + //endregion + + + + /** + * {@inheritDoc } + * + *

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

+ */ + override def visitMpredicateDecl(ctx: MpredicateDeclContext): Vector[PMPredicateDecl] = { + val id = idnDef.get(ctx.IDENTIFIER()) + val receiver = visitReceiver(ctx.receiver()) + val params = visitNode[Vector[Vector[PParameter]]](ctx.parameters()) + val body = if (has(ctx.predicateBody())) Some(visitNode[PExpression](ctx.predicateBody().expression())) else None + Vector(PMPredicateDecl(id, receiver, params.flatten, body).at(ctx)) + } + + /** + * {@inheritDoc } + * + *

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

+ */ + override def visitFpredicateDecl(ctx: FpredicateDeclContext): Vector[PFPredicateDecl] = { + val id = idnDef.get(ctx.IDENTIFIER()) + val params = visitNode[Vector[Vector[PParameter]]](ctx.parameters()) + val body = if (has(ctx.predicateBody())) Some(visitNode[PExpression](ctx.predicateBody().expression())) else None + Vector(PFPredicateDecl(id, params.flatten, body).at(ctx)) + } + //endregion + + //endregion + + //region Expressions + + //region Operands + /** + * Translates the rule + * operand: literal | operandName | L_PAREN expression R_PAREN; + * + * @param ctx the parse tree + * @return the visitor result + */ + override def visitOperand(ctx: GobraParser.OperandContext): PExpression = { + visitChildren(ctx) match { + case e : PExpression => e + case Vector("(", e : PExpression, ")") => e + case _ => fail(ctx) + } + } + + /** + * Translates the rule + * + * operandName: IDENTIFIER (DOT IDENTIFIER)?; + * + * @param ctx the parse tree + * @return the visitor result + */ + override def visitOperandName(ctx: GobraParser.OperandNameContext): PExpression = { + visitChildren(ctx) match { + case idnUseLike(id) => id match { + case id@PIdnUse(_) => PNamedOperand(id).at(id) + case PWildcard() => PBlankIdentifier().at(ctx) + case _ => unexpected(ctx) + } + case _ => unexpected(ctx) + } + } + + override def visitBasicLit(ctx: GobraParser.BasicLitContext): PBasicLiteral = { + visitChildren(ctx) match { + case "true" => PBoolLit(true).at(ctx) + case "false" => PBoolLit(false).at(ctx) + case "nil" => PNilLit().at(ctx) + case _ if has(ctx.FLOAT_LIT()) => visitFloat(ctx.FLOAT_LIT()) + case lit : PBasicLiteral => lit + } + } + + //endregion + + //region Composite Literals + /** + * {@inheritDoc } + * + *

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

+ */ + override def visitCompositeLit(ctx: CompositeLitContext): PCompositeLit = { + visitChildren(ctx) match { + case Vector(typ : PLiteralType, lit : PLiteralValue) => PCompositeLit(typ, lit).at(ctx) + } + } + + + /** Translates the rule + * literalValue: L_CURLY (elementList COMMA?)? R_CURLY; + * + * Not positioned + */ + override def visitLiteralValue(ctx: LiteralValueContext): PLiteralValue = { + visitChildren(ctx) match { + case Vector(_, elems : Vector[PKeyedElement @unchecked], _*) => PLiteralValue(elems) + case _ => PLiteralValue(Vector.empty) + } + } + + /** + * {@inheritDoc } + * + *

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

+ */ + override def visitElementList(ctx: ElementListContext): Vector[PKeyedElement] = { + visitListNode[PKeyedElement](ctx.keyedElement()) + } + + /** + * {@inheritDoc } + * + *

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

+ */ + override def visitKeyedElement(ctx: KeyedElementContext): PKeyedElement = { + val key = visitNodeOrNone[PCompositeKey](ctx.key()) + val elem = visitElement(ctx.element()) + + PKeyedElement(key, elem).at(ctx) + } + + /** + * {@inheritDoc } + * + *

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

+ */ + override def visitKey(ctx: KeyContext): PCompositeKey = { + visitChildren(ctx) match { + case idnUse(id) => PIdentifierKey(id).at(ctx) + case lit : PLiteralValue => PLitCompositeVal(lit).at(ctx) + case n@PNamedOperand(id) => PIdentifierKey(id).at(n) + case n : PExpression => PExpCompositeVal(n).at(n) + case _ => fail(ctx, "Invalid key") + } + } + + /** + * {@inheritDoc } + * + *

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

+ */ + override def visitElement(ctx: ElementContext): PCompositeVal = { + visitChildren(ctx) match { + case e : PExpression => PExpCompositeVal(e).at(e) + case lit : PLiteralValue => PLitCompositeVal(lit).at(lit) + case _ => fail(ctx) + } + } + + //endregion + + /** visits a function literal + * does not position itself + */ + override def visitFunctionLit(ctx: FunctionLitContext): PFunctionLit = { + visitChildren(ctx) match { + case Vector(_, (params: Vector[PParameter] @unchecked, result : PResult), b : PBlock ) => PFunctionLit(params, result, b) + } + } + + //region Primary Expressions + /** + * Visits the rule + * primaryExpr: operand | conversion | methodExpr | ghostPrimaryExpr | new_ + * | primaryExpr ( (DOT IDENTIFIER)| index| slice_| seqUpdExp| typeAssertion| arguments| predConstructArgs ); + * + * @param ctx the parse tree + * @return the unpositioned visitor result + */ + override def visitIndexPrimaryExpr(ctx: IndexPrimaryExprContext): AnyRef = super.visitIndexPrimaryExpr(ctx) match { + case Vector(pe: PExpression, Vector("[", index : PExpression, "]")) => PIndexedExp(pe, index).at(ctx) + } + + override def visitSeqUpdPrimaryExpr(ctx: SeqUpdPrimaryExprContext): AnyRef = super.visitSeqUpdPrimaryExpr(ctx) match { + case Vector(pe: PExpression, Updates(upd)) => PGhostCollectionUpdate(pe, upd) + } + + override def visitPredConstrPrimaryExpr(ctx: PredConstrPrimaryExprContext): AnyRef = super.visitPredConstrPrimaryExpr(ctx) match { + case Vector(pe: PExpression, PredArgs(args)) => val id = pe match { + case recvWithId@PDot(_, _) => PDottedBase(recvWithId).at(recvWithId) + case PNamedOperand(identifier@PIdnUse(_)) => PFPredBase(identifier).at(identifier) + case _ => fail(ctx.primaryExpr(), "Wrong base type for predicate constructor.") + } + PPredConstructor(id, args).at(ctx) + case _ => fail(ctx) + } + + override def visitInvokePrimaryExpr(ctx: InvokePrimaryExprContext): AnyRef = super.visitInvokePrimaryExpr(ctx) match { + case Vector(pe : PExpression, InvokeArgs(args)) => PInvoke(pe, args) + } + + override def visitTypeAssertionPrimaryExpr(ctx: TypeAssertionPrimaryExprContext): AnyRef = super.visitTypeAssertionPrimaryExpr(ctx) match { + case Vector(pe: PExpression, Vector(".", "(", typ : PType, ")")) => PTypeAssertion(pe, typ) + } + + override def visitSelectorPrimaryExpr(ctx: SelectorPrimaryExprContext): AnyRef = super.visitSelectorPrimaryExpr(ctx) match { + case Vector(pe : PExpression, ".", idnUse(id)) => PDot(pe, id) + } + + override def visitSlicePrimaryExpr(ctx: SlicePrimaryExprContext): AnyRef = super.visitSlicePrimaryExpr(ctx) match { + case Vector(pe: PExpression, (low: Option[PExpression] @unchecked, high : Option[PExpression] @unchecked, cap : Option[PExpression] @unchecked)) => + PSliceExp(pe, low, high, cap).at(ctx) + } + + + override def visitBuiltInCallExpr(ctx: BuiltInCallExprContext): AnyRef = super.visitBuiltInCallExpr(ctx) match { + case Vector(call : String, "(", arg : PExpression, ")") => getUnaryOp(call, ctx)(arg).at(ctx) + } + + /** + * Visits the rule + * type_ L_PAREN expression COMMA? R_PAREN; + * + * @param ctx the parse tree + * */ + override def visitConversion(ctx: ConversionContext): PInvoke= { + visitChildren(ctx) match { + case Vector(typ : PType, "(", exp : PExpression, _*) => PInvoke(typ, Vector(exp)).at(ctx) + } + } + + /** + * {@inheritDoc } + * + *

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

+ */ + override def visitArguments(ctx: GobraParser.ArgumentsContext): InvokeArgs = { + val exprs : Vector[PExpression] = if (ctx.expressionList() != null) visitExpressionList(ctx.expressionList()) else Vector.empty + if (ctx.ELLIPSIS() != null) { + // We have ..., so the last parameter has to be unpacked + InvokeArgs(exprs.init.appended(PUnpackSlice(exprs.last).at(ctx))) + } else { + InvokeArgs(exprs) + } + } + case class InvokeArgs(args : Vector[PExpression]) + + + /** + * Visits the rule + * predConstructArgs: L_PRED expressionList? COMMA? R_PRED + * @param ctx the parse tree + * */ + override def visitPredConstructArgs(ctx: PredConstructArgsContext): PredArgs = { + PredArgs( // Wrap this to ensure type safe pattern matching + visitExpressionList(ctx.expressionList()).map { + case PBlankIdentifier() => None + case e => Some(e) + } + ) + } + case class PredArgs(args: Vector[Option[PExpression]]) + + /** + * Visits the rule + * methodExpr: nonNamedType DOT IDENTIFIER + * + */ + override def visitMethodExpr(ctx: MethodExprContext): PDot = visitChildren(ctx) match { + case Vector(typ : PType, ".", idnUse(id)) => PDot(typ, id) + } + + /** + * @param ctx the parse tree + * */ + override def visitNew_(ctx: New_Context): PNew = { + val typ : PType = visitNode(ctx.type_()) + PNew(typ).at(ctx) + } + + /** + * {@inheritDoc } + * + *

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

+ */ + override def visitMake(ctx: MakeContext): PMake = { + val typ = visitNode[PType](ctx.type_()) + val args = visitExpressionList(ctx.expressionList()) + PMake(typ, args).at(ctx) + } + + + + /** + * Visits the rule + * slice_: L_BRACKET ( low? COLON high? | low? COLON high COLON cap) R_BRACKET; + * + * @param ctx the parse tree + */ + override def visitSlice_(ctx: Slice_Context): (Option[PExpression], Option[PExpression], Option[PExpression]) = { + val low = if (ctx.low() != null) Some(visitNode[PExpression](ctx.low().expression())).pos() else None + val high = if (ctx.high() != null) Some(visitNode[PExpression](ctx.high().expression())).pos() else None + val cap = if (ctx.cap() != null) Some(visitNode[PExpression](ctx.cap().expression())).pos() else None + (low, high, cap) + } + + /** + * Visits the rule + * seqUpdExp: L_BRACKET (seqUpdClause (COMMA seqUpdClause)*) R_BRACKET; + * @param ctx the parse tree + */ + override def visitSeqUpdExp(ctx: SeqUpdExpContext): Updates = { + Updates( // Wrap this to ensure type safe matching + ctx.seqUpdClause().asScala.view.map { upd => + PGhostCollectionUpdateClause(visitNode[PExpression](upd.expression(0)), visitNode[PExpression](upd.expression(1))).at(upd) + }.toVector + ) + } + // Wrapper class to distinguish from Vector[PExpression] in patterns + case class Updates(upd : Vector[PGhostCollectionUpdateClause]) + + //region Ghost primary expressions + + /** + * Visits the rule + * range: kind=(SEQ | SET | MSET) L_BRACKET expression DOT_DOT expression R_BRACKET; + */ + override def visitRange(ctx: RangeContext): AnyRef = super.visitRange(ctx) match { + case Vector(kind : String, "[", low: PExpression, "..", high : PExpression, "]") => + val seqRange = PRangeSequence(low, high).at(ctx) + kind match { + case "seq" => seqRange + case "set" => PSetConversion(seqRange) + case "mset" => PMultisetConversion(seqRange) + } + } + + + /** + * Visits the rule + * typeOf: TYPE_OF L_PAREN expression R_PAREN; + */ + override def visitTypeOf(ctx: TypeOfContext): AnyRef = super.visitTypeOf(ctx) match { + case Vector("typeOf", "(", expr: PExpression, ")") => PTypeOf(expr) + } + + /** + * {@inheritDoc } + * + *

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

+ */ + override def visitTypeExpr(ctx: TypeExprContext): AnyRef = super.visitTypeExpr(ctx) match { + case Vector("type", "[", typ : PType, "]") => PTypeExpr(typ) + } + + + /** + * Visits the rule + * isComparable: IS_COMPARABLE L_PAREN expression R_PAREN; + */ + override def visitIsComparable(ctx: IsComparableContext): AnyRef = super.visitIsComparable(ctx) match { + case Vector("isComparable", "(", e : PExpression, ")") => PIsComparable(e) + } + + + /** + * Visits the rule + * isComparable: IS_COMPARABLE L_PAREN expression R_PAREN; + */ + override def visitQuantification(ctx: QuantificationContext): AnyRef = super.visitQuantification(ctx) match { + case Vector(quantifier: String, + vars : Vector[PBoundVariable], ":", ":", triggers : Vector[PTrigger], body : PExpression) => + (quantifier match { + case "forall" => PForall + case "exists" => PExists + })(vars, triggers, body) + } + + /** + * {@inheritDoc } + * + *

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

+ */ + override def visitSConversion(ctx: SConversionContext): PGhostCollectionExp = { + val exp = visitNode[PExpression](ctx.expression()) + val conversion = ctx.kind.getType match { + case GobraParser.SEQ => PSequenceConversion + case GobraParser.SET => PSetConversion + case GobraParser.MSET => PMultisetConversion + } + conversion(exp) + } + + + /** + * Visits the rule + * NONE L_BRACKET type_ R_BRACKET; + */ + override def visitOptionNone(ctx: OptionNoneContext): AnyRef = super.visitOptionNone(ctx) match { + case Vector("none" , "[", typ : PType, "]") => POptionNone(typ) + } + + + /** + * Visits the rule + * optionSome: SOME L_PAREN expression R_PAREN; + */ + override def visitOptionSome(ctx: OptionSomeContext): AnyRef = super.visitOptionSome(ctx) match { + case Vector("some", "(", exp : PExpression, ")") => POptionSome(exp) + } + + + /** + * {@inheritDoc } + * + *

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

+ */ + override def visitOptionGet(ctx: OptionGetContext): AnyRef = super.visitOptionGet(ctx) match { + case Vector("get", "(", exp : PExpression, ")") => POptionGet(exp) + } + + + /** + * {@inheritDoc } + * + *

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

+ */ + override def visitPermission(ctx: PermissionContext): AnyRef = super.visitPermission(ctx) match { + case "writePerm" => PFullPerm() + case "noPerm" => PNoPerm() + } + + /** + * {@inheritDoc } + * + *

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

+ */ + override def visitOld(ctx: OldContext): PGhostExpression = { + val expr = visitNode[PExpression](ctx.expression()) + if (has(ctx.oldLabelUse())) { + // old [