diff --git a/.idea/misc.xml b/.idea/misc.xml index faf7c92..4c2ad01 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -13,6 +13,16 @@ diff --git a/src/grammars/SoftwareRequirements.g4 b/src/grammars/SoftwareRequirements.g4 deleted file mode 100644 index e0346de..0000000 --- a/src/grammars/SoftwareRequirements.g4 +++ /dev/null @@ -1,100 +0,0 @@ -grammar SoftwareRequirements; - -// Loser rules -ID : [a-zA-Z]+ ; -STRING : '"' ~'"'* '"' ; -DESCRIPTION : '~' ~[~]*? '~' ; -WS : [ \t\r\n]+ -> skip ; -INT : [0-9]+ ; -FLOAT : [0-9]+ '.' [0-9]* | '.' [0-9]+ ; - -// Puturos rules - -program : description? - 'package' ID - '{' - program_body - '}' - ; - -program_body : (requirementSpec | functionSpec)+ ; - -requirementSpec : description? - importance? - ID '{' - req_specification* - result_specification* - '}' ; - -req_specification : importance? '@' ID (logical_op ID)* ';'; - -result_specification : 'result' importance? ID ';'; - -predicate : expression '=>' expression ; - -expression : term (logical_op term)* ; - -term : '{' expression '}' - | STRING; - -logical_op : '&&' | '||' ; - - - -// Function Specification - -functionSpec : description? - importance? - access_modifiers? - ID'(' input_types? ')' - functionBody - ; - -functionBody : '{' - specification* - return_types - '}' - ; - -input_types : variable (',' variable)*; - -return_types : 'return' variable (',' variable)* ';' ; - -specification : '@' ID ':' - STRING - ';' - ; - -// General Rules - -variable : type '[]'? ID; - -importance : 'critical' | 'optional' ; - -type : 'INT' - | 'FLOAT' - | 'DOUBLE' - | 'STRING' - | 'BOOLEAN' - | 'CHAR' - | 'VOID' - ; - -access_modifiers : 'public' - | 'protected' - | 'private' - | 'default' - ; - -description : DESCRIPTION; - -// Symballs -LPAREN : '(' ; -RPAREN : ')' ; -COLON : ':' ; -SEMICOLON : ';' ; -COMMA : ',' ; -LBRACE : '{' ; -RBRACE : '}' ; -TILDE : '~' ; -EXCLAM : '!' ; diff --git a/src/grammars/Winx.g4 b/src/grammars/Winx.g4 new file mode 100644 index 0000000..19d40f2 --- /dev/null +++ b/src/grammars/Winx.g4 @@ -0,0 +1,111 @@ +grammar Winx; + +// Lexer rules +ID : [a-zA-Z]+ ; +STRING : '"' ~'"'* '"' ; +DESCRIPTION : '~' ~[~]*? '~' ; +WS : [ \t\r\n]+ -> skip ; +INT : [0-9]+ ; +FLOAT : [0-9]+ '.' [0-9]* | '.' [0-9]+ ; + +// Parser rules + +winx : (package | DESCRIPTION)+; + +body : ( + interface + | specification + | DESCRIPTION + )+ ; + +// Hierarchies + +package : 'package' ID '{' body '}' ; + +interface : importance? + access_modifiers? + 'interface' + ID '{' interface_body '}' ; + +specification : 'specification' + ID ('implements' ID)* + '{' specification_body '}' ; + +interface_body : (requirementSpec | functionSpec)+ ; + +specification_body : (requirementSpec | functionSpec)+ ; + + +// Non-functional Requirements + +requirementSpec : description? + importance? + ID '{' + req_specification* + result_specification* + '}' ; + +req_specification : importance? '@' ID (logical_op ID)* ';' ; + +result_specification : 'result' importance? ID ';' ; + +logical_op : 'AND' | 'OR' ; + +// Functional Requirements + +functionSpec : description? + importance? + access_modifiers? + ID'(' input_types? ')' + ('implements' ID)* + functionBody + ; + +functionBody : '{' + specificationEntry* + return_types + '}' + ; + +input_types : variable (',' variable)* ; + +return_types : 'return' variable (',' variable)* ';' ; + +specificationEntry : '@' ID ':' + STRING + ';' + ; + +// General Rules + +variable : type '[]'? ID; + +importance : 'critical' | 'optional' ; + +type : 'INT' + | 'FLOAT' + | 'DOUBLE' + | 'STRING' + | 'BOOLEAN' + | 'CHAR' + | 'VOID' + ; + +access_modifiers : 'public' + | 'protected' + | 'private' + | 'default' + ; + +description : DESCRIPTION; + +// Symballs +LPAREN : '(' ; +RPAREN : ')' ; +COLON : ':' ; +SEMICOLON : ';' ; +COMMA : ',' ; +LBRACE : '{' ; +RBRACE : '}' ; +TILDE : '~' ; +EXCLAM : '!' ; diff --git a/src/main/java/org/lumijiez/Main.java b/src/main/java/org/lumijiez/Main.java index b326590..4b327c7 100644 --- a/src/main/java/org/lumijiez/Main.java +++ b/src/main/java/org/lumijiez/Main.java @@ -4,9 +4,9 @@ import org.antlr.v4.runtime.CharStream; import org.antlr.v4.runtime.CharStreams; import org.antlr.v4.runtime.CommonTokenStream; import org.antlr.v4.runtime.tree.ParseTreeWalker; -import org.lumijiez.parser.SoftwareRequirementsBaseListener; -import org.lumijiez.parser.SoftwareRequirementsLexer; -import org.lumijiez.parser.SoftwareRequirementsParser; +import org.lumijiez.parser.WinxBaseListener; +import org.lumijiez.parser.WinxLexer; +import org.lumijiez.parser.WinxParser; import java.io.IOException; import java.net.URISyntaxException; @@ -19,18 +19,18 @@ public class Main { String input = new String(Files.readAllBytes(Path.of(Objects.requireNonNull(Main.class.getResource("/TestProgram.txt")).toURI()))); CharStream inputStream = CharStreams.fromString(input); - SoftwareRequirementsLexer lexer = new SoftwareRequirementsLexer(inputStream); + WinxLexer lexer = new WinxLexer(inputStream); CommonTokenStream tokenStream = new CommonTokenStream(lexer); - SoftwareRequirementsParser parser = new SoftwareRequirementsParser(tokenStream); + WinxParser parser = new WinxParser(tokenStream); ParseTreeWalker walker = new ParseTreeWalker(); SoftwareReqParseTree listener = new SoftwareReqParseTree(); - walker.walk(listener, parser.program()); + walker.walk(listener, parser.winx()); } - static class SoftwareReqParseTree extends SoftwareRequirementsBaseListener { + static class SoftwareReqParseTree extends WinxBaseListener { @Override - public void enterProgram(SoftwareRequirementsParser.ProgramContext ctx) { + public void enterWinx(WinxParser.WinxContext ctx) { System.out.println("Parsed: " + ctx.getText()); } } diff --git a/src/main/java/org/lumijiez/parser/SoftwareRequirements.interp b/src/main/java/org/lumijiez/parser/SoftwareRequirements.interp deleted file mode 100644 index 1ce711a..0000000 --- a/src/main/java/org/lumijiez/parser/SoftwareRequirements.interp +++ /dev/null @@ -1,102 +0,0 @@ -token literal names: -null -'package' -'@' -'result' -'=>' -'&&' -'||' -'return' -'[]' -'critical' -'optional' -'INT' -'FLOAT' -'DOUBLE' -'STRING' -'BOOLEAN' -'CHAR' -'VOID' -'public' -'protected' -'private' -'default' -null -null -null -null -null -null -'(' -')' -':' -';' -',' -'{' -'}' -'~' -'!' - -token symbolic names: -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -ID -STRING -DESCRIPTION -WS -INT -FLOAT -LPAREN -RPAREN -COLON -SEMICOLON -COMMA -LBRACE -RBRACE -TILDE -EXCLAM - -rule names: -program -program_body -requirementSpec -req_specification -result_specification -predicate -expression -term -logical_op -functionSpec -functionBody -input_types -return_types -specification -variable -importance -type -access_modifiers -description - - -atn: -[4, 1, 36, 186, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 2, 14, 7, 14, 2, 15, 7, 15, 2, 16, 7, 16, 2, 17, 7, 17, 2, 18, 7, 18, 1, 0, 3, 0, 40, 8, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 4, 1, 50, 8, 1, 11, 1, 12, 1, 51, 1, 2, 3, 2, 55, 8, 2, 1, 2, 3, 2, 58, 8, 2, 1, 2, 1, 2, 1, 2, 5, 2, 63, 8, 2, 10, 2, 12, 2, 66, 9, 2, 1, 2, 5, 2, 69, 8, 2, 10, 2, 12, 2, 72, 9, 2, 1, 2, 1, 2, 1, 3, 3, 3, 77, 8, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 5, 3, 84, 8, 3, 10, 3, 12, 3, 87, 9, 3, 1, 3, 1, 3, 1, 4, 1, 4, 3, 4, 93, 8, 4, 1, 4, 1, 4, 1, 4, 1, 5, 1, 5, 1, 5, 1, 5, 1, 6, 1, 6, 1, 6, 1, 6, 5, 6, 106, 8, 6, 10, 6, 12, 6, 109, 9, 6, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 3, 7, 116, 8, 7, 1, 8, 1, 8, 1, 9, 3, 9, 121, 8, 9, 1, 9, 3, 9, 124, 8, 9, 1, 9, 3, 9, 127, 8, 9, 1, 9, 1, 9, 1, 9, 3, 9, 132, 8, 9, 1, 9, 1, 9, 1, 9, 1, 10, 1, 10, 5, 10, 139, 8, 10, 10, 10, 12, 10, 142, 9, 10, 1, 10, 1, 10, 1, 10, 1, 11, 1, 11, 1, 11, 5, 11, 150, 8, 11, 10, 11, 12, 11, 153, 9, 11, 1, 12, 1, 12, 1, 12, 1, 12, 5, 12, 159, 8, 12, 10, 12, 12, 12, 162, 9, 12, 1, 12, 1, 12, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 14, 1, 14, 3, 14, 174, 8, 14, 1, 14, 1, 14, 1, 15, 1, 15, 1, 16, 1, 16, 1, 17, 1, 17, 1, 18, 1, 18, 1, 18, 0, 0, 19, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 0, 4, 1, 0, 5, 6, 1, 0, 9, 10, 1, 0, 11, 17, 1, 0, 18, 21, 186, 0, 39, 1, 0, 0, 0, 2, 49, 1, 0, 0, 0, 4, 54, 1, 0, 0, 0, 6, 76, 1, 0, 0, 0, 8, 90, 1, 0, 0, 0, 10, 97, 1, 0, 0, 0, 12, 101, 1, 0, 0, 0, 14, 115, 1, 0, 0, 0, 16, 117, 1, 0, 0, 0, 18, 120, 1, 0, 0, 0, 20, 136, 1, 0, 0, 0, 22, 146, 1, 0, 0, 0, 24, 154, 1, 0, 0, 0, 26, 165, 1, 0, 0, 0, 28, 171, 1, 0, 0, 0, 30, 177, 1, 0, 0, 0, 32, 179, 1, 0, 0, 0, 34, 181, 1, 0, 0, 0, 36, 183, 1, 0, 0, 0, 38, 40, 3, 36, 18, 0, 39, 38, 1, 0, 0, 0, 39, 40, 1, 0, 0, 0, 40, 41, 1, 0, 0, 0, 41, 42, 5, 1, 0, 0, 42, 43, 5, 22, 0, 0, 43, 44, 5, 33, 0, 0, 44, 45, 3, 2, 1, 0, 45, 46, 5, 34, 0, 0, 46, 1, 1, 0, 0, 0, 47, 50, 3, 4, 2, 0, 48, 50, 3, 18, 9, 0, 49, 47, 1, 0, 0, 0, 49, 48, 1, 0, 0, 0, 50, 51, 1, 0, 0, 0, 51, 49, 1, 0, 0, 0, 51, 52, 1, 0, 0, 0, 52, 3, 1, 0, 0, 0, 53, 55, 3, 36, 18, 0, 54, 53, 1, 0, 0, 0, 54, 55, 1, 0, 0, 0, 55, 57, 1, 0, 0, 0, 56, 58, 3, 30, 15, 0, 57, 56, 1, 0, 0, 0, 57, 58, 1, 0, 0, 0, 58, 59, 1, 0, 0, 0, 59, 60, 5, 22, 0, 0, 60, 64, 5, 33, 0, 0, 61, 63, 3, 6, 3, 0, 62, 61, 1, 0, 0, 0, 63, 66, 1, 0, 0, 0, 64, 62, 1, 0, 0, 0, 64, 65, 1, 0, 0, 0, 65, 70, 1, 0, 0, 0, 66, 64, 1, 0, 0, 0, 67, 69, 3, 8, 4, 0, 68, 67, 1, 0, 0, 0, 69, 72, 1, 0, 0, 0, 70, 68, 1, 0, 0, 0, 70, 71, 1, 0, 0, 0, 71, 73, 1, 0, 0, 0, 72, 70, 1, 0, 0, 0, 73, 74, 5, 34, 0, 0, 74, 5, 1, 0, 0, 0, 75, 77, 3, 30, 15, 0, 76, 75, 1, 0, 0, 0, 76, 77, 1, 0, 0, 0, 77, 78, 1, 0, 0, 0, 78, 79, 5, 2, 0, 0, 79, 85, 5, 22, 0, 0, 80, 81, 3, 16, 8, 0, 81, 82, 5, 22, 0, 0, 82, 84, 1, 0, 0, 0, 83, 80, 1, 0, 0, 0, 84, 87, 1, 0, 0, 0, 85, 83, 1, 0, 0, 0, 85, 86, 1, 0, 0, 0, 86, 88, 1, 0, 0, 0, 87, 85, 1, 0, 0, 0, 88, 89, 5, 31, 0, 0, 89, 7, 1, 0, 0, 0, 90, 92, 5, 3, 0, 0, 91, 93, 3, 30, 15, 0, 92, 91, 1, 0, 0, 0, 92, 93, 1, 0, 0, 0, 93, 94, 1, 0, 0, 0, 94, 95, 5, 22, 0, 0, 95, 96, 5, 31, 0, 0, 96, 9, 1, 0, 0, 0, 97, 98, 3, 12, 6, 0, 98, 99, 5, 4, 0, 0, 99, 100, 3, 12, 6, 0, 100, 11, 1, 0, 0, 0, 101, 107, 3, 14, 7, 0, 102, 103, 3, 16, 8, 0, 103, 104, 3, 14, 7, 0, 104, 106, 1, 0, 0, 0, 105, 102, 1, 0, 0, 0, 106, 109, 1, 0, 0, 0, 107, 105, 1, 0, 0, 0, 107, 108, 1, 0, 0, 0, 108, 13, 1, 0, 0, 0, 109, 107, 1, 0, 0, 0, 110, 111, 5, 33, 0, 0, 111, 112, 3, 12, 6, 0, 112, 113, 5, 34, 0, 0, 113, 116, 1, 0, 0, 0, 114, 116, 5, 23, 0, 0, 115, 110, 1, 0, 0, 0, 115, 114, 1, 0, 0, 0, 116, 15, 1, 0, 0, 0, 117, 118, 7, 0, 0, 0, 118, 17, 1, 0, 0, 0, 119, 121, 3, 36, 18, 0, 120, 119, 1, 0, 0, 0, 120, 121, 1, 0, 0, 0, 121, 123, 1, 0, 0, 0, 122, 124, 3, 30, 15, 0, 123, 122, 1, 0, 0, 0, 123, 124, 1, 0, 0, 0, 124, 126, 1, 0, 0, 0, 125, 127, 3, 34, 17, 0, 126, 125, 1, 0, 0, 0, 126, 127, 1, 0, 0, 0, 127, 128, 1, 0, 0, 0, 128, 129, 5, 22, 0, 0, 129, 131, 5, 28, 0, 0, 130, 132, 3, 22, 11, 0, 131, 130, 1, 0, 0, 0, 131, 132, 1, 0, 0, 0, 132, 133, 1, 0, 0, 0, 133, 134, 5, 29, 0, 0, 134, 135, 3, 20, 10, 0, 135, 19, 1, 0, 0, 0, 136, 140, 5, 33, 0, 0, 137, 139, 3, 26, 13, 0, 138, 137, 1, 0, 0, 0, 139, 142, 1, 0, 0, 0, 140, 138, 1, 0, 0, 0, 140, 141, 1, 0, 0, 0, 141, 143, 1, 0, 0, 0, 142, 140, 1, 0, 0, 0, 143, 144, 3, 24, 12, 0, 144, 145, 5, 34, 0, 0, 145, 21, 1, 0, 0, 0, 146, 151, 3, 28, 14, 0, 147, 148, 5, 32, 0, 0, 148, 150, 3, 28, 14, 0, 149, 147, 1, 0, 0, 0, 150, 153, 1, 0, 0, 0, 151, 149, 1, 0, 0, 0, 151, 152, 1, 0, 0, 0, 152, 23, 1, 0, 0, 0, 153, 151, 1, 0, 0, 0, 154, 155, 5, 7, 0, 0, 155, 160, 3, 28, 14, 0, 156, 157, 5, 32, 0, 0, 157, 159, 3, 28, 14, 0, 158, 156, 1, 0, 0, 0, 159, 162, 1, 0, 0, 0, 160, 158, 1, 0, 0, 0, 160, 161, 1, 0, 0, 0, 161, 163, 1, 0, 0, 0, 162, 160, 1, 0, 0, 0, 163, 164, 5, 31, 0, 0, 164, 25, 1, 0, 0, 0, 165, 166, 5, 2, 0, 0, 166, 167, 5, 22, 0, 0, 167, 168, 5, 30, 0, 0, 168, 169, 5, 23, 0, 0, 169, 170, 5, 31, 0, 0, 170, 27, 1, 0, 0, 0, 171, 173, 3, 32, 16, 0, 172, 174, 5, 8, 0, 0, 173, 172, 1, 0, 0, 0, 173, 174, 1, 0, 0, 0, 174, 175, 1, 0, 0, 0, 175, 176, 5, 22, 0, 0, 176, 29, 1, 0, 0, 0, 177, 178, 7, 1, 0, 0, 178, 31, 1, 0, 0, 0, 179, 180, 7, 2, 0, 0, 180, 33, 1, 0, 0, 0, 181, 182, 7, 3, 0, 0, 182, 35, 1, 0, 0, 0, 183, 184, 5, 24, 0, 0, 184, 37, 1, 0, 0, 0, 20, 39, 49, 51, 54, 57, 64, 70, 76, 85, 92, 107, 115, 120, 123, 126, 131, 140, 151, 160, 173] \ No newline at end of file diff --git a/src/main/java/org/lumijiez/parser/SoftwareRequirements.tokens b/src/main/java/org/lumijiez/parser/SoftwareRequirements.tokens deleted file mode 100644 index 3567d7b..0000000 --- a/src/main/java/org/lumijiez/parser/SoftwareRequirements.tokens +++ /dev/null @@ -1,66 +0,0 @@ -T__0=1 -T__1=2 -T__2=3 -T__3=4 -T__4=5 -T__5=6 -T__6=7 -T__7=8 -T__8=9 -T__9=10 -T__10=11 -T__11=12 -T__12=13 -T__13=14 -T__14=15 -T__15=16 -T__16=17 -T__17=18 -T__18=19 -T__19=20 -T__20=21 -ID=22 -STRING=23 -DESCRIPTION=24 -WS=25 -INT=26 -FLOAT=27 -LPAREN=28 -RPAREN=29 -COLON=30 -SEMICOLON=31 -COMMA=32 -LBRACE=33 -RBRACE=34 -TILDE=35 -EXCLAM=36 -'package'=1 -'@'=2 -'result'=3 -'=>'=4 -'&&'=5 -'||'=6 -'return'=7 -'[]'=8 -'critical'=9 -'optional'=10 -'INT'=11 -'FLOAT'=12 -'DOUBLE'=13 -'STRING'=14 -'BOOLEAN'=15 -'CHAR'=16 -'VOID'=17 -'public'=18 -'protected'=19 -'private'=20 -'default'=21 -'('=28 -')'=29 -':'=30 -';'=31 -','=32 -'{'=33 -'}'=34 -'~'=35 -'!'=36 diff --git a/src/main/java/org/lumijiez/parser/SoftwareRequirementsLexer.interp b/src/main/java/org/lumijiez/parser/SoftwareRequirementsLexer.interp deleted file mode 100644 index efb89b5..0000000 --- a/src/main/java/org/lumijiez/parser/SoftwareRequirementsLexer.interp +++ /dev/null @@ -1,125 +0,0 @@ -token literal names: -null -'package' -'@' -'result' -'=>' -'&&' -'||' -'return' -'[]' -'critical' -'optional' -'INT' -'FLOAT' -'DOUBLE' -'STRING' -'BOOLEAN' -'CHAR' -'VOID' -'public' -'protected' -'private' -'default' -null -null -null -null -null -null -'(' -')' -':' -';' -',' -'{' -'}' -'~' -'!' - -token symbolic names: -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -ID -STRING -DESCRIPTION -WS -INT -FLOAT -LPAREN -RPAREN -COLON -SEMICOLON -COMMA -LBRACE -RBRACE -TILDE -EXCLAM - -rule names: -T__0 -T__1 -T__2 -T__3 -T__4 -T__5 -T__6 -T__7 -T__8 -T__9 -T__10 -T__11 -T__12 -T__13 -T__14 -T__15 -T__16 -T__17 -T__18 -T__19 -T__20 -ID -STRING -DESCRIPTION -WS -INT -FLOAT -LPAREN -RPAREN -COLON -SEMICOLON -COMMA -LBRACE -RBRACE -TILDE -EXCLAM - -channel names: -DEFAULT_TOKEN_CHANNEL -HIDDEN - -mode names: -DEFAULT_MODE - -atn: -[4, 0, 36, 275, 6, -1, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 2, 14, 7, 14, 2, 15, 7, 15, 2, 16, 7, 16, 2, 17, 7, 17, 2, 18, 7, 18, 2, 19, 7, 19, 2, 20, 7, 20, 2, 21, 7, 21, 2, 22, 7, 22, 2, 23, 7, 23, 2, 24, 7, 24, 2, 25, 7, 25, 2, 26, 7, 26, 2, 27, 7, 27, 2, 28, 7, 28, 2, 29, 7, 29, 2, 30, 7, 30, 2, 31, 7, 31, 2, 32, 7, 32, 2, 33, 7, 33, 2, 34, 7, 34, 2, 35, 7, 35, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 3, 1, 3, 1, 3, 1, 4, 1, 4, 1, 4, 1, 5, 1, 5, 1, 5, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 7, 1, 7, 1, 7, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 10, 1, 10, 1, 10, 1, 10, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 21, 4, 21, 204, 8, 21, 11, 21, 12, 21, 205, 1, 22, 1, 22, 5, 22, 210, 8, 22, 10, 22, 12, 22, 213, 9, 22, 1, 22, 1, 22, 1, 23, 1, 23, 5, 23, 219, 8, 23, 10, 23, 12, 23, 222, 9, 23, 1, 23, 1, 23, 1, 24, 4, 24, 227, 8, 24, 11, 24, 12, 24, 228, 1, 24, 1, 24, 1, 25, 4, 25, 234, 8, 25, 11, 25, 12, 25, 235, 1, 26, 4, 26, 239, 8, 26, 11, 26, 12, 26, 240, 1, 26, 1, 26, 5, 26, 245, 8, 26, 10, 26, 12, 26, 248, 9, 26, 1, 26, 1, 26, 4, 26, 252, 8, 26, 11, 26, 12, 26, 253, 3, 26, 256, 8, 26, 1, 27, 1, 27, 1, 28, 1, 28, 1, 29, 1, 29, 1, 30, 1, 30, 1, 31, 1, 31, 1, 32, 1, 32, 1, 33, 1, 33, 1, 34, 1, 34, 1, 35, 1, 35, 1, 220, 0, 36, 1, 1, 3, 2, 5, 3, 7, 4, 9, 5, 11, 6, 13, 7, 15, 8, 17, 9, 19, 10, 21, 11, 23, 12, 25, 13, 27, 14, 29, 15, 31, 16, 33, 17, 35, 18, 37, 19, 39, 20, 41, 21, 43, 22, 45, 23, 47, 24, 49, 25, 51, 26, 53, 27, 55, 28, 57, 29, 59, 30, 61, 31, 63, 32, 65, 33, 67, 34, 69, 35, 71, 36, 1, 0, 5, 2, 0, 65, 90, 97, 122, 1, 0, 34, 34, 1, 0, 126, 126, 3, 0, 9, 10, 13, 13, 32, 32, 1, 0, 48, 57, 283, 0, 1, 1, 0, 0, 0, 0, 3, 1, 0, 0, 0, 0, 5, 1, 0, 0, 0, 0, 7, 1, 0, 0, 0, 0, 9, 1, 0, 0, 0, 0, 11, 1, 0, 0, 0, 0, 13, 1, 0, 0, 0, 0, 15, 1, 0, 0, 0, 0, 17, 1, 0, 0, 0, 0, 19, 1, 0, 0, 0, 0, 21, 1, 0, 0, 0, 0, 23, 1, 0, 0, 0, 0, 25, 1, 0, 0, 0, 0, 27, 1, 0, 0, 0, 0, 29, 1, 0, 0, 0, 0, 31, 1, 0, 0, 0, 0, 33, 1, 0, 0, 0, 0, 35, 1, 0, 0, 0, 0, 37, 1, 0, 0, 0, 0, 39, 1, 0, 0, 0, 0, 41, 1, 0, 0, 0, 0, 43, 1, 0, 0, 0, 0, 45, 1, 0, 0, 0, 0, 47, 1, 0, 0, 0, 0, 49, 1, 0, 0, 0, 0, 51, 1, 0, 0, 0, 0, 53, 1, 0, 0, 0, 0, 55, 1, 0, 0, 0, 0, 57, 1, 0, 0, 0, 0, 59, 1, 0, 0, 0, 0, 61, 1, 0, 0, 0, 0, 63, 1, 0, 0, 0, 0, 65, 1, 0, 0, 0, 0, 67, 1, 0, 0, 0, 0, 69, 1, 0, 0, 0, 0, 71, 1, 0, 0, 0, 1, 73, 1, 0, 0, 0, 3, 81, 1, 0, 0, 0, 5, 83, 1, 0, 0, 0, 7, 90, 1, 0, 0, 0, 9, 93, 1, 0, 0, 0, 11, 96, 1, 0, 0, 0, 13, 99, 1, 0, 0, 0, 15, 106, 1, 0, 0, 0, 17, 109, 1, 0, 0, 0, 19, 118, 1, 0, 0, 0, 21, 127, 1, 0, 0, 0, 23, 131, 1, 0, 0, 0, 25, 137, 1, 0, 0, 0, 27, 144, 1, 0, 0, 0, 29, 151, 1, 0, 0, 0, 31, 159, 1, 0, 0, 0, 33, 164, 1, 0, 0, 0, 35, 169, 1, 0, 0, 0, 37, 176, 1, 0, 0, 0, 39, 186, 1, 0, 0, 0, 41, 194, 1, 0, 0, 0, 43, 203, 1, 0, 0, 0, 45, 207, 1, 0, 0, 0, 47, 216, 1, 0, 0, 0, 49, 226, 1, 0, 0, 0, 51, 233, 1, 0, 0, 0, 53, 255, 1, 0, 0, 0, 55, 257, 1, 0, 0, 0, 57, 259, 1, 0, 0, 0, 59, 261, 1, 0, 0, 0, 61, 263, 1, 0, 0, 0, 63, 265, 1, 0, 0, 0, 65, 267, 1, 0, 0, 0, 67, 269, 1, 0, 0, 0, 69, 271, 1, 0, 0, 0, 71, 273, 1, 0, 0, 0, 73, 74, 5, 112, 0, 0, 74, 75, 5, 97, 0, 0, 75, 76, 5, 99, 0, 0, 76, 77, 5, 107, 0, 0, 77, 78, 5, 97, 0, 0, 78, 79, 5, 103, 0, 0, 79, 80, 5, 101, 0, 0, 80, 2, 1, 0, 0, 0, 81, 82, 5, 64, 0, 0, 82, 4, 1, 0, 0, 0, 83, 84, 5, 114, 0, 0, 84, 85, 5, 101, 0, 0, 85, 86, 5, 115, 0, 0, 86, 87, 5, 117, 0, 0, 87, 88, 5, 108, 0, 0, 88, 89, 5, 116, 0, 0, 89, 6, 1, 0, 0, 0, 90, 91, 5, 61, 0, 0, 91, 92, 5, 62, 0, 0, 92, 8, 1, 0, 0, 0, 93, 94, 5, 38, 0, 0, 94, 95, 5, 38, 0, 0, 95, 10, 1, 0, 0, 0, 96, 97, 5, 124, 0, 0, 97, 98, 5, 124, 0, 0, 98, 12, 1, 0, 0, 0, 99, 100, 5, 114, 0, 0, 100, 101, 5, 101, 0, 0, 101, 102, 5, 116, 0, 0, 102, 103, 5, 117, 0, 0, 103, 104, 5, 114, 0, 0, 104, 105, 5, 110, 0, 0, 105, 14, 1, 0, 0, 0, 106, 107, 5, 91, 0, 0, 107, 108, 5, 93, 0, 0, 108, 16, 1, 0, 0, 0, 109, 110, 5, 99, 0, 0, 110, 111, 5, 114, 0, 0, 111, 112, 5, 105, 0, 0, 112, 113, 5, 116, 0, 0, 113, 114, 5, 105, 0, 0, 114, 115, 5, 99, 0, 0, 115, 116, 5, 97, 0, 0, 116, 117, 5, 108, 0, 0, 117, 18, 1, 0, 0, 0, 118, 119, 5, 111, 0, 0, 119, 120, 5, 112, 0, 0, 120, 121, 5, 116, 0, 0, 121, 122, 5, 105, 0, 0, 122, 123, 5, 111, 0, 0, 123, 124, 5, 110, 0, 0, 124, 125, 5, 97, 0, 0, 125, 126, 5, 108, 0, 0, 126, 20, 1, 0, 0, 0, 127, 128, 5, 73, 0, 0, 128, 129, 5, 78, 0, 0, 129, 130, 5, 84, 0, 0, 130, 22, 1, 0, 0, 0, 131, 132, 5, 70, 0, 0, 132, 133, 5, 76, 0, 0, 133, 134, 5, 79, 0, 0, 134, 135, 5, 65, 0, 0, 135, 136, 5, 84, 0, 0, 136, 24, 1, 0, 0, 0, 137, 138, 5, 68, 0, 0, 138, 139, 5, 79, 0, 0, 139, 140, 5, 85, 0, 0, 140, 141, 5, 66, 0, 0, 141, 142, 5, 76, 0, 0, 142, 143, 5, 69, 0, 0, 143, 26, 1, 0, 0, 0, 144, 145, 5, 83, 0, 0, 145, 146, 5, 84, 0, 0, 146, 147, 5, 82, 0, 0, 147, 148, 5, 73, 0, 0, 148, 149, 5, 78, 0, 0, 149, 150, 5, 71, 0, 0, 150, 28, 1, 0, 0, 0, 151, 152, 5, 66, 0, 0, 152, 153, 5, 79, 0, 0, 153, 154, 5, 79, 0, 0, 154, 155, 5, 76, 0, 0, 155, 156, 5, 69, 0, 0, 156, 157, 5, 65, 0, 0, 157, 158, 5, 78, 0, 0, 158, 30, 1, 0, 0, 0, 159, 160, 5, 67, 0, 0, 160, 161, 5, 72, 0, 0, 161, 162, 5, 65, 0, 0, 162, 163, 5, 82, 0, 0, 163, 32, 1, 0, 0, 0, 164, 165, 5, 86, 0, 0, 165, 166, 5, 79, 0, 0, 166, 167, 5, 73, 0, 0, 167, 168, 5, 68, 0, 0, 168, 34, 1, 0, 0, 0, 169, 170, 5, 112, 0, 0, 170, 171, 5, 117, 0, 0, 171, 172, 5, 98, 0, 0, 172, 173, 5, 108, 0, 0, 173, 174, 5, 105, 0, 0, 174, 175, 5, 99, 0, 0, 175, 36, 1, 0, 0, 0, 176, 177, 5, 112, 0, 0, 177, 178, 5, 114, 0, 0, 178, 179, 5, 111, 0, 0, 179, 180, 5, 116, 0, 0, 180, 181, 5, 101, 0, 0, 181, 182, 5, 99, 0, 0, 182, 183, 5, 116, 0, 0, 183, 184, 5, 101, 0, 0, 184, 185, 5, 100, 0, 0, 185, 38, 1, 0, 0, 0, 186, 187, 5, 112, 0, 0, 187, 188, 5, 114, 0, 0, 188, 189, 5, 105, 0, 0, 189, 190, 5, 118, 0, 0, 190, 191, 5, 97, 0, 0, 191, 192, 5, 116, 0, 0, 192, 193, 5, 101, 0, 0, 193, 40, 1, 0, 0, 0, 194, 195, 5, 100, 0, 0, 195, 196, 5, 101, 0, 0, 196, 197, 5, 102, 0, 0, 197, 198, 5, 97, 0, 0, 198, 199, 5, 117, 0, 0, 199, 200, 5, 108, 0, 0, 200, 201, 5, 116, 0, 0, 201, 42, 1, 0, 0, 0, 202, 204, 7, 0, 0, 0, 203, 202, 1, 0, 0, 0, 204, 205, 1, 0, 0, 0, 205, 203, 1, 0, 0, 0, 205, 206, 1, 0, 0, 0, 206, 44, 1, 0, 0, 0, 207, 211, 5, 34, 0, 0, 208, 210, 8, 1, 0, 0, 209, 208, 1, 0, 0, 0, 210, 213, 1, 0, 0, 0, 211, 209, 1, 0, 0, 0, 211, 212, 1, 0, 0, 0, 212, 214, 1, 0, 0, 0, 213, 211, 1, 0, 0, 0, 214, 215, 5, 34, 0, 0, 215, 46, 1, 0, 0, 0, 216, 220, 5, 126, 0, 0, 217, 219, 8, 2, 0, 0, 218, 217, 1, 0, 0, 0, 219, 222, 1, 0, 0, 0, 220, 221, 1, 0, 0, 0, 220, 218, 1, 0, 0, 0, 221, 223, 1, 0, 0, 0, 222, 220, 1, 0, 0, 0, 223, 224, 5, 126, 0, 0, 224, 48, 1, 0, 0, 0, 225, 227, 7, 3, 0, 0, 226, 225, 1, 0, 0, 0, 227, 228, 1, 0, 0, 0, 228, 226, 1, 0, 0, 0, 228, 229, 1, 0, 0, 0, 229, 230, 1, 0, 0, 0, 230, 231, 6, 24, 0, 0, 231, 50, 1, 0, 0, 0, 232, 234, 7, 4, 0, 0, 233, 232, 1, 0, 0, 0, 234, 235, 1, 0, 0, 0, 235, 233, 1, 0, 0, 0, 235, 236, 1, 0, 0, 0, 236, 52, 1, 0, 0, 0, 237, 239, 7, 4, 0, 0, 238, 237, 1, 0, 0, 0, 239, 240, 1, 0, 0, 0, 240, 238, 1, 0, 0, 0, 240, 241, 1, 0, 0, 0, 241, 242, 1, 0, 0, 0, 242, 246, 5, 46, 0, 0, 243, 245, 7, 4, 0, 0, 244, 243, 1, 0, 0, 0, 245, 248, 1, 0, 0, 0, 246, 244, 1, 0, 0, 0, 246, 247, 1, 0, 0, 0, 247, 256, 1, 0, 0, 0, 248, 246, 1, 0, 0, 0, 249, 251, 5, 46, 0, 0, 250, 252, 7, 4, 0, 0, 251, 250, 1, 0, 0, 0, 252, 253, 1, 0, 0, 0, 253, 251, 1, 0, 0, 0, 253, 254, 1, 0, 0, 0, 254, 256, 1, 0, 0, 0, 255, 238, 1, 0, 0, 0, 255, 249, 1, 0, 0, 0, 256, 54, 1, 0, 0, 0, 257, 258, 5, 40, 0, 0, 258, 56, 1, 0, 0, 0, 259, 260, 5, 41, 0, 0, 260, 58, 1, 0, 0, 0, 261, 262, 5, 58, 0, 0, 262, 60, 1, 0, 0, 0, 263, 264, 5, 59, 0, 0, 264, 62, 1, 0, 0, 0, 265, 266, 5, 44, 0, 0, 266, 64, 1, 0, 0, 0, 267, 268, 5, 123, 0, 0, 268, 66, 1, 0, 0, 0, 269, 270, 5, 125, 0, 0, 270, 68, 1, 0, 0, 0, 271, 272, 5, 126, 0, 0, 272, 70, 1, 0, 0, 0, 273, 274, 5, 33, 0, 0, 274, 72, 1, 0, 0, 0, 10, 0, 205, 211, 220, 228, 235, 240, 246, 253, 255, 1, 6, 0, 0] \ No newline at end of file diff --git a/src/main/java/org/lumijiez/parser/SoftwareRequirementsLexer.java b/src/main/java/org/lumijiez/parser/SoftwareRequirementsLexer.java deleted file mode 100644 index e827f4e..0000000 --- a/src/main/java/org/lumijiez/parser/SoftwareRequirementsLexer.java +++ /dev/null @@ -1,300 +0,0 @@ -// Generated from D:/Source/JavaProjects/dsl-formal-requirements/src/grammars/SoftwareRequirements.g4 by ANTLR 4.13.1 -package org.lumijiez.parser; -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", "CheckReturnValue", "this-escape"}) -public class SoftwareRequirementsLexer extends Lexer { - static { RuntimeMetaData.checkVersion("4.13.1", RuntimeMetaData.VERSION); } - - protected static final DFA[] _decisionToDFA; - protected static final PredictionContextCache _sharedContextCache = - new PredictionContextCache(); - public static final int - T__0=1, T__1=2, T__2=3, T__3=4, T__4=5, T__5=6, T__6=7, T__7=8, T__8=9, - T__9=10, T__10=11, T__11=12, T__12=13, T__13=14, T__14=15, T__15=16, T__16=17, - T__17=18, T__18=19, T__19=20, T__20=21, ID=22, STRING=23, DESCRIPTION=24, - WS=25, INT=26, FLOAT=27, LPAREN=28, RPAREN=29, COLON=30, SEMICOLON=31, - COMMA=32, LBRACE=33, RBRACE=34, TILDE=35, EXCLAM=36; - public static String[] channelNames = { - "DEFAULT_TOKEN_CHANNEL", "HIDDEN" - }; - - public static String[] modeNames = { - "DEFAULT_MODE" - }; - - private static String[] makeRuleNames() { - return new String[] { - "T__0", "T__1", "T__2", "T__3", "T__4", "T__5", "T__6", "T__7", "T__8", - "T__9", "T__10", "T__11", "T__12", "T__13", "T__14", "T__15", "T__16", - "T__17", "T__18", "T__19", "T__20", "ID", "STRING", "DESCRIPTION", "WS", - "INT", "FLOAT", "LPAREN", "RPAREN", "COLON", "SEMICOLON", "COMMA", "LBRACE", - "RBRACE", "TILDE", "EXCLAM" - }; - } - public static final String[] ruleNames = makeRuleNames(); - - private static String[] makeLiteralNames() { - return new String[] { - null, "'package'", "'@'", "'result'", "'=>'", "'&&'", "'||'", "'return'", - "'[]'", "'critical'", "'optional'", "'INT'", "'FLOAT'", "'DOUBLE'", "'STRING'", - "'BOOLEAN'", "'CHAR'", "'VOID'", "'public'", "'protected'", "'private'", - "'default'", null, null, null, null, null, null, "'('", "')'", "':'", - "';'", "','", "'{'", "'}'", "'~'", "'!'" - }; - } - private static final String[] _LITERAL_NAMES = makeLiteralNames(); - private static String[] makeSymbolicNames() { - return new String[] { - null, null, null, null, null, null, null, null, null, null, null, null, - null, null, null, null, null, null, null, null, null, null, "ID", "STRING", - "DESCRIPTION", "WS", "INT", "FLOAT", "LPAREN", "RPAREN", "COLON", "SEMICOLON", - "COMMA", "LBRACE", "RBRACE", "TILDE", "EXCLAM" - }; - } - 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 SoftwareRequirementsLexer(CharStream input) { - super(input); - _interp = new LexerATNSimulator(this,_ATN,_decisionToDFA,_sharedContextCache); - } - - @Override - public String getGrammarFileName() { return "SoftwareRequirements.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; } - - public static final String _serializedATN = - "\u0004\u0000$\u0113\u0006\uffff\uffff\u0002\u0000\u0007\u0000\u0002\u0001"+ - "\u0007\u0001\u0002\u0002\u0007\u0002\u0002\u0003\u0007\u0003\u0002\u0004"+ - "\u0007\u0004\u0002\u0005\u0007\u0005\u0002\u0006\u0007\u0006\u0002\u0007"+ - "\u0007\u0007\u0002\b\u0007\b\u0002\t\u0007\t\u0002\n\u0007\n\u0002\u000b"+ - "\u0007\u000b\u0002\f\u0007\f\u0002\r\u0007\r\u0002\u000e\u0007\u000e\u0002"+ - "\u000f\u0007\u000f\u0002\u0010\u0007\u0010\u0002\u0011\u0007\u0011\u0002"+ - "\u0012\u0007\u0012\u0002\u0013\u0007\u0013\u0002\u0014\u0007\u0014\u0002"+ - "\u0015\u0007\u0015\u0002\u0016\u0007\u0016\u0002\u0017\u0007\u0017\u0002"+ - "\u0018\u0007\u0018\u0002\u0019\u0007\u0019\u0002\u001a\u0007\u001a\u0002"+ - "\u001b\u0007\u001b\u0002\u001c\u0007\u001c\u0002\u001d\u0007\u001d\u0002"+ - "\u001e\u0007\u001e\u0002\u001f\u0007\u001f\u0002 \u0007 \u0002!\u0007"+ - "!\u0002\"\u0007\"\u0002#\u0007#\u0001\u0000\u0001\u0000\u0001\u0000\u0001"+ - "\u0000\u0001\u0000\u0001\u0000\u0001\u0000\u0001\u0000\u0001\u0001\u0001"+ - "\u0001\u0001\u0002\u0001\u0002\u0001\u0002\u0001\u0002\u0001\u0002\u0001"+ - "\u0002\u0001\u0002\u0001\u0003\u0001\u0003\u0001\u0003\u0001\u0004\u0001"+ - "\u0004\u0001\u0004\u0001\u0005\u0001\u0005\u0001\u0005\u0001\u0006\u0001"+ - "\u0006\u0001\u0006\u0001\u0006\u0001\u0006\u0001\u0006\u0001\u0006\u0001"+ - "\u0007\u0001\u0007\u0001\u0007\u0001\b\u0001\b\u0001\b\u0001\b\u0001\b"+ - "\u0001\b\u0001\b\u0001\b\u0001\b\u0001\t\u0001\t\u0001\t\u0001\t\u0001"+ - "\t\u0001\t\u0001\t\u0001\t\u0001\t\u0001\n\u0001\n\u0001\n\u0001\n\u0001"+ - "\u000b\u0001\u000b\u0001\u000b\u0001\u000b\u0001\u000b\u0001\u000b\u0001"+ - "\f\u0001\f\u0001\f\u0001\f\u0001\f\u0001\f\u0001\f\u0001\r\u0001\r\u0001"+ - "\r\u0001\r\u0001\r\u0001\r\u0001\r\u0001\u000e\u0001\u000e\u0001\u000e"+ - "\u0001\u000e\u0001\u000e\u0001\u000e\u0001\u000e\u0001\u000e\u0001\u000f"+ - "\u0001\u000f\u0001\u000f\u0001\u000f\u0001\u000f\u0001\u0010\u0001\u0010"+ - "\u0001\u0010\u0001\u0010\u0001\u0010\u0001\u0011\u0001\u0011\u0001\u0011"+ - "\u0001\u0011\u0001\u0011\u0001\u0011\u0001\u0011\u0001\u0012\u0001\u0012"+ - "\u0001\u0012\u0001\u0012\u0001\u0012\u0001\u0012\u0001\u0012\u0001\u0012"+ - "\u0001\u0012\u0001\u0012\u0001\u0013\u0001\u0013\u0001\u0013\u0001\u0013"+ - "\u0001\u0013\u0001\u0013\u0001\u0013\u0001\u0013\u0001\u0014\u0001\u0014"+ - "\u0001\u0014\u0001\u0014\u0001\u0014\u0001\u0014\u0001\u0014\u0001\u0014"+ - "\u0001\u0015\u0004\u0015\u00cc\b\u0015\u000b\u0015\f\u0015\u00cd\u0001"+ - "\u0016\u0001\u0016\u0005\u0016\u00d2\b\u0016\n\u0016\f\u0016\u00d5\t\u0016"+ - "\u0001\u0016\u0001\u0016\u0001\u0017\u0001\u0017\u0005\u0017\u00db\b\u0017"+ - "\n\u0017\f\u0017\u00de\t\u0017\u0001\u0017\u0001\u0017\u0001\u0018\u0004"+ - "\u0018\u00e3\b\u0018\u000b\u0018\f\u0018\u00e4\u0001\u0018\u0001\u0018"+ - "\u0001\u0019\u0004\u0019\u00ea\b\u0019\u000b\u0019\f\u0019\u00eb\u0001"+ - "\u001a\u0004\u001a\u00ef\b\u001a\u000b\u001a\f\u001a\u00f0\u0001\u001a"+ - "\u0001\u001a\u0005\u001a\u00f5\b\u001a\n\u001a\f\u001a\u00f8\t\u001a\u0001"+ - "\u001a\u0001\u001a\u0004\u001a\u00fc\b\u001a\u000b\u001a\f\u001a\u00fd"+ - "\u0003\u001a\u0100\b\u001a\u0001\u001b\u0001\u001b\u0001\u001c\u0001\u001c"+ - "\u0001\u001d\u0001\u001d\u0001\u001e\u0001\u001e\u0001\u001f\u0001\u001f"+ - "\u0001 \u0001 \u0001!\u0001!\u0001\"\u0001\"\u0001#\u0001#\u0001\u00dc"+ - "\u0000$\u0001\u0001\u0003\u0002\u0005\u0003\u0007\u0004\t\u0005\u000b"+ - "\u0006\r\u0007\u000f\b\u0011\t\u0013\n\u0015\u000b\u0017\f\u0019\r\u001b"+ - "\u000e\u001d\u000f\u001f\u0010!\u0011#\u0012%\u0013\'\u0014)\u0015+\u0016"+ - "-\u0017/\u00181\u00193\u001a5\u001b7\u001c9\u001d;\u001e=\u001f? A!C\""+ - "E#G$\u0001\u0000\u0005\u0002\u0000AZaz\u0001\u0000\"\"\u0001\u0000~~\u0003"+ - "\u0000\t\n\r\r \u0001\u000009\u011b\u0000\u0001\u0001\u0000\u0000\u0000"+ - "\u0000\u0003\u0001\u0000\u0000\u0000\u0000\u0005\u0001\u0000\u0000\u0000"+ - "\u0000\u0007\u0001\u0000\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000\u0000"+ - "\u000b\u0001\u0000\u0000\u0000\u0000\r\u0001\u0000\u0000\u0000\u0000\u000f"+ - "\u0001\u0000\u0000\u0000\u0000\u0011\u0001\u0000\u0000\u0000\u0000\u0013"+ - "\u0001\u0000\u0000\u0000\u0000\u0015\u0001\u0000\u0000\u0000\u0000\u0017"+ - "\u0001\u0000\u0000\u0000\u0000\u0019\u0001\u0000\u0000\u0000\u0000\u001b"+ - "\u0001\u0000\u0000\u0000\u0000\u001d\u0001\u0000\u0000\u0000\u0000\u001f"+ - "\u0001\u0000\u0000\u0000\u0000!\u0001\u0000\u0000\u0000\u0000#\u0001\u0000"+ - "\u0000\u0000\u0000%\u0001\u0000\u0000\u0000\u0000\'\u0001\u0000\u0000"+ - "\u0000\u0000)\u0001\u0000\u0000\u0000\u0000+\u0001\u0000\u0000\u0000\u0000"+ - "-\u0001\u0000\u0000\u0000\u0000/\u0001\u0000\u0000\u0000\u00001\u0001"+ - "\u0000\u0000\u0000\u00003\u0001\u0000\u0000\u0000\u00005\u0001\u0000\u0000"+ - "\u0000\u00007\u0001\u0000\u0000\u0000\u00009\u0001\u0000\u0000\u0000\u0000"+ - ";\u0001\u0000\u0000\u0000\u0000=\u0001\u0000\u0000\u0000\u0000?\u0001"+ - "\u0000\u0000\u0000\u0000A\u0001\u0000\u0000\u0000\u0000C\u0001\u0000\u0000"+ - "\u0000\u0000E\u0001\u0000\u0000\u0000\u0000G\u0001\u0000\u0000\u0000\u0001"+ - "I\u0001\u0000\u0000\u0000\u0003Q\u0001\u0000\u0000\u0000\u0005S\u0001"+ - "\u0000\u0000\u0000\u0007Z\u0001\u0000\u0000\u0000\t]\u0001\u0000\u0000"+ - "\u0000\u000b`\u0001\u0000\u0000\u0000\rc\u0001\u0000\u0000\u0000\u000f"+ - "j\u0001\u0000\u0000\u0000\u0011m\u0001\u0000\u0000\u0000\u0013v\u0001"+ - "\u0000\u0000\u0000\u0015\u007f\u0001\u0000\u0000\u0000\u0017\u0083\u0001"+ - "\u0000\u0000\u0000\u0019\u0089\u0001\u0000\u0000\u0000\u001b\u0090\u0001"+ - "\u0000\u0000\u0000\u001d\u0097\u0001\u0000\u0000\u0000\u001f\u009f\u0001"+ - "\u0000\u0000\u0000!\u00a4\u0001\u0000\u0000\u0000#\u00a9\u0001\u0000\u0000"+ - "\u0000%\u00b0\u0001\u0000\u0000\u0000\'\u00ba\u0001\u0000\u0000\u0000"+ - ")\u00c2\u0001\u0000\u0000\u0000+\u00cb\u0001\u0000\u0000\u0000-\u00cf"+ - "\u0001\u0000\u0000\u0000/\u00d8\u0001\u0000\u0000\u00001\u00e2\u0001\u0000"+ - "\u0000\u00003\u00e9\u0001\u0000\u0000\u00005\u00ff\u0001\u0000\u0000\u0000"+ - "7\u0101\u0001\u0000\u0000\u00009\u0103\u0001\u0000\u0000\u0000;\u0105"+ - "\u0001\u0000\u0000\u0000=\u0107\u0001\u0000\u0000\u0000?\u0109\u0001\u0000"+ - "\u0000\u0000A\u010b\u0001\u0000\u0000\u0000C\u010d\u0001\u0000\u0000\u0000"+ - "E\u010f\u0001\u0000\u0000\u0000G\u0111\u0001\u0000\u0000\u0000IJ\u0005"+ - "p\u0000\u0000JK\u0005a\u0000\u0000KL\u0005c\u0000\u0000LM\u0005k\u0000"+ - "\u0000MN\u0005a\u0000\u0000NO\u0005g\u0000\u0000OP\u0005e\u0000\u0000"+ - "P\u0002\u0001\u0000\u0000\u0000QR\u0005@\u0000\u0000R\u0004\u0001\u0000"+ - "\u0000\u0000ST\u0005r\u0000\u0000TU\u0005e\u0000\u0000UV\u0005s\u0000"+ - "\u0000VW\u0005u\u0000\u0000WX\u0005l\u0000\u0000XY\u0005t\u0000\u0000"+ - "Y\u0006\u0001\u0000\u0000\u0000Z[\u0005=\u0000\u0000[\\\u0005>\u0000\u0000"+ - "\\\b\u0001\u0000\u0000\u0000]^\u0005&\u0000\u0000^_\u0005&\u0000\u0000"+ - "_\n\u0001\u0000\u0000\u0000`a\u0005|\u0000\u0000ab\u0005|\u0000\u0000"+ - "b\f\u0001\u0000\u0000\u0000cd\u0005r\u0000\u0000de\u0005e\u0000\u0000"+ - "ef\u0005t\u0000\u0000fg\u0005u\u0000\u0000gh\u0005r\u0000\u0000hi\u0005"+ - "n\u0000\u0000i\u000e\u0001\u0000\u0000\u0000jk\u0005[\u0000\u0000kl\u0005"+ - "]\u0000\u0000l\u0010\u0001\u0000\u0000\u0000mn\u0005c\u0000\u0000no\u0005"+ - "r\u0000\u0000op\u0005i\u0000\u0000pq\u0005t\u0000\u0000qr\u0005i\u0000"+ - "\u0000rs\u0005c\u0000\u0000st\u0005a\u0000\u0000tu\u0005l\u0000\u0000"+ - "u\u0012\u0001\u0000\u0000\u0000vw\u0005o\u0000\u0000wx\u0005p\u0000\u0000"+ - "xy\u0005t\u0000\u0000yz\u0005i\u0000\u0000z{\u0005o\u0000\u0000{|\u0005"+ - "n\u0000\u0000|}\u0005a\u0000\u0000}~\u0005l\u0000\u0000~\u0014\u0001\u0000"+ - "\u0000\u0000\u007f\u0080\u0005I\u0000\u0000\u0080\u0081\u0005N\u0000\u0000"+ - "\u0081\u0082\u0005T\u0000\u0000\u0082\u0016\u0001\u0000\u0000\u0000\u0083"+ - "\u0084\u0005F\u0000\u0000\u0084\u0085\u0005L\u0000\u0000\u0085\u0086\u0005"+ - "O\u0000\u0000\u0086\u0087\u0005A\u0000\u0000\u0087\u0088\u0005T\u0000"+ - "\u0000\u0088\u0018\u0001\u0000\u0000\u0000\u0089\u008a\u0005D\u0000\u0000"+ - "\u008a\u008b\u0005O\u0000\u0000\u008b\u008c\u0005U\u0000\u0000\u008c\u008d"+ - "\u0005B\u0000\u0000\u008d\u008e\u0005L\u0000\u0000\u008e\u008f\u0005E"+ - "\u0000\u0000\u008f\u001a\u0001\u0000\u0000\u0000\u0090\u0091\u0005S\u0000"+ - "\u0000\u0091\u0092\u0005T\u0000\u0000\u0092\u0093\u0005R\u0000\u0000\u0093"+ - "\u0094\u0005I\u0000\u0000\u0094\u0095\u0005N\u0000\u0000\u0095\u0096\u0005"+ - "G\u0000\u0000\u0096\u001c\u0001\u0000\u0000\u0000\u0097\u0098\u0005B\u0000"+ - "\u0000\u0098\u0099\u0005O\u0000\u0000\u0099\u009a\u0005O\u0000\u0000\u009a"+ - "\u009b\u0005L\u0000\u0000\u009b\u009c\u0005E\u0000\u0000\u009c\u009d\u0005"+ - "A\u0000\u0000\u009d\u009e\u0005N\u0000\u0000\u009e\u001e\u0001\u0000\u0000"+ - "\u0000\u009f\u00a0\u0005C\u0000\u0000\u00a0\u00a1\u0005H\u0000\u0000\u00a1"+ - "\u00a2\u0005A\u0000\u0000\u00a2\u00a3\u0005R\u0000\u0000\u00a3 \u0001"+ - "\u0000\u0000\u0000\u00a4\u00a5\u0005V\u0000\u0000\u00a5\u00a6\u0005O\u0000"+ - "\u0000\u00a6\u00a7\u0005I\u0000\u0000\u00a7\u00a8\u0005D\u0000\u0000\u00a8"+ - "\"\u0001\u0000\u0000\u0000\u00a9\u00aa\u0005p\u0000\u0000\u00aa\u00ab"+ - "\u0005u\u0000\u0000\u00ab\u00ac\u0005b\u0000\u0000\u00ac\u00ad\u0005l"+ - "\u0000\u0000\u00ad\u00ae\u0005i\u0000\u0000\u00ae\u00af\u0005c\u0000\u0000"+ - "\u00af$\u0001\u0000\u0000\u0000\u00b0\u00b1\u0005p\u0000\u0000\u00b1\u00b2"+ - "\u0005r\u0000\u0000\u00b2\u00b3\u0005o\u0000\u0000\u00b3\u00b4\u0005t"+ - "\u0000\u0000\u00b4\u00b5\u0005e\u0000\u0000\u00b5\u00b6\u0005c\u0000\u0000"+ - "\u00b6\u00b7\u0005t\u0000\u0000\u00b7\u00b8\u0005e\u0000\u0000\u00b8\u00b9"+ - "\u0005d\u0000\u0000\u00b9&\u0001\u0000\u0000\u0000\u00ba\u00bb\u0005p"+ - "\u0000\u0000\u00bb\u00bc\u0005r\u0000\u0000\u00bc\u00bd\u0005i\u0000\u0000"+ - "\u00bd\u00be\u0005v\u0000\u0000\u00be\u00bf\u0005a\u0000\u0000\u00bf\u00c0"+ - "\u0005t\u0000\u0000\u00c0\u00c1\u0005e\u0000\u0000\u00c1(\u0001\u0000"+ - "\u0000\u0000\u00c2\u00c3\u0005d\u0000\u0000\u00c3\u00c4\u0005e\u0000\u0000"+ - "\u00c4\u00c5\u0005f\u0000\u0000\u00c5\u00c6\u0005a\u0000\u0000\u00c6\u00c7"+ - "\u0005u\u0000\u0000\u00c7\u00c8\u0005l\u0000\u0000\u00c8\u00c9\u0005t"+ - "\u0000\u0000\u00c9*\u0001\u0000\u0000\u0000\u00ca\u00cc\u0007\u0000\u0000"+ - "\u0000\u00cb\u00ca\u0001\u0000\u0000\u0000\u00cc\u00cd\u0001\u0000\u0000"+ - "\u0000\u00cd\u00cb\u0001\u0000\u0000\u0000\u00cd\u00ce\u0001\u0000\u0000"+ - "\u0000\u00ce,\u0001\u0000\u0000\u0000\u00cf\u00d3\u0005\"\u0000\u0000"+ - "\u00d0\u00d2\b\u0001\u0000\u0000\u00d1\u00d0\u0001\u0000\u0000\u0000\u00d2"+ - "\u00d5\u0001\u0000\u0000\u0000\u00d3\u00d1\u0001\u0000\u0000\u0000\u00d3"+ - "\u00d4\u0001\u0000\u0000\u0000\u00d4\u00d6\u0001\u0000\u0000\u0000\u00d5"+ - "\u00d3\u0001\u0000\u0000\u0000\u00d6\u00d7\u0005\"\u0000\u0000\u00d7."+ - "\u0001\u0000\u0000\u0000\u00d8\u00dc\u0005~\u0000\u0000\u00d9\u00db\b"+ - "\u0002\u0000\u0000\u00da\u00d9\u0001\u0000\u0000\u0000\u00db\u00de\u0001"+ - "\u0000\u0000\u0000\u00dc\u00dd\u0001\u0000\u0000\u0000\u00dc\u00da\u0001"+ - "\u0000\u0000\u0000\u00dd\u00df\u0001\u0000\u0000\u0000\u00de\u00dc\u0001"+ - "\u0000\u0000\u0000\u00df\u00e0\u0005~\u0000\u0000\u00e00\u0001\u0000\u0000"+ - "\u0000\u00e1\u00e3\u0007\u0003\u0000\u0000\u00e2\u00e1\u0001\u0000\u0000"+ - "\u0000\u00e3\u00e4\u0001\u0000\u0000\u0000\u00e4\u00e2\u0001\u0000\u0000"+ - "\u0000\u00e4\u00e5\u0001\u0000\u0000\u0000\u00e5\u00e6\u0001\u0000\u0000"+ - "\u0000\u00e6\u00e7\u0006\u0018\u0000\u0000\u00e72\u0001\u0000\u0000\u0000"+ - "\u00e8\u00ea\u0007\u0004\u0000\u0000\u00e9\u00e8\u0001\u0000\u0000\u0000"+ - "\u00ea\u00eb\u0001\u0000\u0000\u0000\u00eb\u00e9\u0001\u0000\u0000\u0000"+ - "\u00eb\u00ec\u0001\u0000\u0000\u0000\u00ec4\u0001\u0000\u0000\u0000\u00ed"+ - "\u00ef\u0007\u0004\u0000\u0000\u00ee\u00ed\u0001\u0000\u0000\u0000\u00ef"+ - "\u00f0\u0001\u0000\u0000\u0000\u00f0\u00ee\u0001\u0000\u0000\u0000\u00f0"+ - "\u00f1\u0001\u0000\u0000\u0000\u00f1\u00f2\u0001\u0000\u0000\u0000\u00f2"+ - "\u00f6\u0005.\u0000\u0000\u00f3\u00f5\u0007\u0004\u0000\u0000\u00f4\u00f3"+ - "\u0001\u0000\u0000\u0000\u00f5\u00f8\u0001\u0000\u0000\u0000\u00f6\u00f4"+ - "\u0001\u0000\u0000\u0000\u00f6\u00f7\u0001\u0000\u0000\u0000\u00f7\u0100"+ - "\u0001\u0000\u0000\u0000\u00f8\u00f6\u0001\u0000\u0000\u0000\u00f9\u00fb"+ - "\u0005.\u0000\u0000\u00fa\u00fc\u0007\u0004\u0000\u0000\u00fb\u00fa\u0001"+ - "\u0000\u0000\u0000\u00fc\u00fd\u0001\u0000\u0000\u0000\u00fd\u00fb\u0001"+ - "\u0000\u0000\u0000\u00fd\u00fe\u0001\u0000\u0000\u0000\u00fe\u0100\u0001"+ - "\u0000\u0000\u0000\u00ff\u00ee\u0001\u0000\u0000\u0000\u00ff\u00f9\u0001"+ - "\u0000\u0000\u0000\u01006\u0001\u0000\u0000\u0000\u0101\u0102\u0005(\u0000"+ - "\u0000\u01028\u0001\u0000\u0000\u0000\u0103\u0104\u0005)\u0000\u0000\u0104"+ - ":\u0001\u0000\u0000\u0000\u0105\u0106\u0005:\u0000\u0000\u0106<\u0001"+ - "\u0000\u0000\u0000\u0107\u0108\u0005;\u0000\u0000\u0108>\u0001\u0000\u0000"+ - "\u0000\u0109\u010a\u0005,\u0000\u0000\u010a@\u0001\u0000\u0000\u0000\u010b"+ - "\u010c\u0005{\u0000\u0000\u010cB\u0001\u0000\u0000\u0000\u010d\u010e\u0005"+ - "}\u0000\u0000\u010eD\u0001\u0000\u0000\u0000\u010f\u0110\u0005~\u0000"+ - "\u0000\u0110F\u0001\u0000\u0000\u0000\u0111\u0112\u0005!\u0000\u0000\u0112"+ - "H\u0001\u0000\u0000\u0000\n\u0000\u00cd\u00d3\u00dc\u00e4\u00eb\u00f0"+ - "\u00f6\u00fd\u00ff\u0001\u0006\u0000\u0000"; - 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/org/lumijiez/parser/SoftwareRequirementsLexer.tokens b/src/main/java/org/lumijiez/parser/SoftwareRequirementsLexer.tokens deleted file mode 100644 index 3567d7b..0000000 --- a/src/main/java/org/lumijiez/parser/SoftwareRequirementsLexer.tokens +++ /dev/null @@ -1,66 +0,0 @@ -T__0=1 -T__1=2 -T__2=3 -T__3=4 -T__4=5 -T__5=6 -T__6=7 -T__7=8 -T__8=9 -T__9=10 -T__10=11 -T__11=12 -T__12=13 -T__13=14 -T__14=15 -T__15=16 -T__16=17 -T__17=18 -T__18=19 -T__19=20 -T__20=21 -ID=22 -STRING=23 -DESCRIPTION=24 -WS=25 -INT=26 -FLOAT=27 -LPAREN=28 -RPAREN=29 -COLON=30 -SEMICOLON=31 -COMMA=32 -LBRACE=33 -RBRACE=34 -TILDE=35 -EXCLAM=36 -'package'=1 -'@'=2 -'result'=3 -'=>'=4 -'&&'=5 -'||'=6 -'return'=7 -'[]'=8 -'critical'=9 -'optional'=10 -'INT'=11 -'FLOAT'=12 -'DOUBLE'=13 -'STRING'=14 -'BOOLEAN'=15 -'CHAR'=16 -'VOID'=17 -'public'=18 -'protected'=19 -'private'=20 -'default'=21 -'('=28 -')'=29 -':'=30 -';'=31 -','=32 -'{'=33 -'}'=34 -'~'=35 -'!'=36 diff --git a/src/main/java/org/lumijiez/parser/SoftwareRequirementsListener.java b/src/main/java/org/lumijiez/parser/SoftwareRequirementsListener.java deleted file mode 100644 index aabdcef..0000000 --- a/src/main/java/org/lumijiez/parser/SoftwareRequirementsListener.java +++ /dev/null @@ -1,200 +0,0 @@ -// Generated from D:/Source/JavaProjects/dsl-formal-requirements/src/grammars/SoftwareRequirements.g4 by ANTLR 4.13.1 -package org.lumijiez.parser; -import org.antlr.v4.runtime.tree.ParseTreeListener; - -/** - * This interface defines a complete listener for a parse tree produced by - * {@link SoftwareRequirementsParser}. - */ -public interface SoftwareRequirementsListener extends ParseTreeListener { - /** - * Enter a parse tree produced by {@link SoftwareRequirementsParser#program}. - * @param ctx the parse tree - */ - void enterProgram(SoftwareRequirementsParser.ProgramContext ctx); - /** - * Exit a parse tree produced by {@link SoftwareRequirementsParser#program}. - * @param ctx the parse tree - */ - void exitProgram(SoftwareRequirementsParser.ProgramContext ctx); - /** - * Enter a parse tree produced by {@link SoftwareRequirementsParser#program_body}. - * @param ctx the parse tree - */ - void enterProgram_body(SoftwareRequirementsParser.Program_bodyContext ctx); - /** - * Exit a parse tree produced by {@link SoftwareRequirementsParser#program_body}. - * @param ctx the parse tree - */ - void exitProgram_body(SoftwareRequirementsParser.Program_bodyContext ctx); - /** - * Enter a parse tree produced by {@link SoftwareRequirementsParser#requirementSpec}. - * @param ctx the parse tree - */ - void enterRequirementSpec(SoftwareRequirementsParser.RequirementSpecContext ctx); - /** - * Exit a parse tree produced by {@link SoftwareRequirementsParser#requirementSpec}. - * @param ctx the parse tree - */ - void exitRequirementSpec(SoftwareRequirementsParser.RequirementSpecContext ctx); - /** - * Enter a parse tree produced by {@link SoftwareRequirementsParser#req_specification}. - * @param ctx the parse tree - */ - void enterReq_specification(SoftwareRequirementsParser.Req_specificationContext ctx); - /** - * Exit a parse tree produced by {@link SoftwareRequirementsParser#req_specification}. - * @param ctx the parse tree - */ - void exitReq_specification(SoftwareRequirementsParser.Req_specificationContext ctx); - /** - * Enter a parse tree produced by {@link SoftwareRequirementsParser#result_specification}. - * @param ctx the parse tree - */ - void enterResult_specification(SoftwareRequirementsParser.Result_specificationContext ctx); - /** - * Exit a parse tree produced by {@link SoftwareRequirementsParser#result_specification}. - * @param ctx the parse tree - */ - void exitResult_specification(SoftwareRequirementsParser.Result_specificationContext ctx); - /** - * Enter a parse tree produced by {@link SoftwareRequirementsParser#predicate}. - * @param ctx the parse tree - */ - void enterPredicate(SoftwareRequirementsParser.PredicateContext ctx); - /** - * Exit a parse tree produced by {@link SoftwareRequirementsParser#predicate}. - * @param ctx the parse tree - */ - void exitPredicate(SoftwareRequirementsParser.PredicateContext ctx); - /** - * Enter a parse tree produced by {@link SoftwareRequirementsParser#expression}. - * @param ctx the parse tree - */ - void enterExpression(SoftwareRequirementsParser.ExpressionContext ctx); - /** - * Exit a parse tree produced by {@link SoftwareRequirementsParser#expression}. - * @param ctx the parse tree - */ - void exitExpression(SoftwareRequirementsParser.ExpressionContext ctx); - /** - * Enter a parse tree produced by {@link SoftwareRequirementsParser#term}. - * @param ctx the parse tree - */ - void enterTerm(SoftwareRequirementsParser.TermContext ctx); - /** - * Exit a parse tree produced by {@link SoftwareRequirementsParser#term}. - * @param ctx the parse tree - */ - void exitTerm(SoftwareRequirementsParser.TermContext ctx); - /** - * Enter a parse tree produced by {@link SoftwareRequirementsParser#logical_op}. - * @param ctx the parse tree - */ - void enterLogical_op(SoftwareRequirementsParser.Logical_opContext ctx); - /** - * Exit a parse tree produced by {@link SoftwareRequirementsParser#logical_op}. - * @param ctx the parse tree - */ - void exitLogical_op(SoftwareRequirementsParser.Logical_opContext ctx); - /** - * Enter a parse tree produced by {@link SoftwareRequirementsParser#functionSpec}. - * @param ctx the parse tree - */ - void enterFunctionSpec(SoftwareRequirementsParser.FunctionSpecContext ctx); - /** - * Exit a parse tree produced by {@link SoftwareRequirementsParser#functionSpec}. - * @param ctx the parse tree - */ - void exitFunctionSpec(SoftwareRequirementsParser.FunctionSpecContext ctx); - /** - * Enter a parse tree produced by {@link SoftwareRequirementsParser#functionBody}. - * @param ctx the parse tree - */ - void enterFunctionBody(SoftwareRequirementsParser.FunctionBodyContext ctx); - /** - * Exit a parse tree produced by {@link SoftwareRequirementsParser#functionBody}. - * @param ctx the parse tree - */ - void exitFunctionBody(SoftwareRequirementsParser.FunctionBodyContext ctx); - /** - * Enter a parse tree produced by {@link SoftwareRequirementsParser#input_types}. - * @param ctx the parse tree - */ - void enterInput_types(SoftwareRequirementsParser.Input_typesContext ctx); - /** - * Exit a parse tree produced by {@link SoftwareRequirementsParser#input_types}. - * @param ctx the parse tree - */ - void exitInput_types(SoftwareRequirementsParser.Input_typesContext ctx); - /** - * Enter a parse tree produced by {@link SoftwareRequirementsParser#return_types}. - * @param ctx the parse tree - */ - void enterReturn_types(SoftwareRequirementsParser.Return_typesContext ctx); - /** - * Exit a parse tree produced by {@link SoftwareRequirementsParser#return_types}. - * @param ctx the parse tree - */ - void exitReturn_types(SoftwareRequirementsParser.Return_typesContext ctx); - /** - * Enter a parse tree produced by {@link SoftwareRequirementsParser#specification}. - * @param ctx the parse tree - */ - void enterSpecification(SoftwareRequirementsParser.SpecificationContext ctx); - /** - * Exit a parse tree produced by {@link SoftwareRequirementsParser#specification}. - * @param ctx the parse tree - */ - void exitSpecification(SoftwareRequirementsParser.SpecificationContext ctx); - /** - * Enter a parse tree produced by {@link SoftwareRequirementsParser#variable}. - * @param ctx the parse tree - */ - void enterVariable(SoftwareRequirementsParser.VariableContext ctx); - /** - * Exit a parse tree produced by {@link SoftwareRequirementsParser#variable}. - * @param ctx the parse tree - */ - void exitVariable(SoftwareRequirementsParser.VariableContext ctx); - /** - * Enter a parse tree produced by {@link SoftwareRequirementsParser#importance}. - * @param ctx the parse tree - */ - void enterImportance(SoftwareRequirementsParser.ImportanceContext ctx); - /** - * Exit a parse tree produced by {@link SoftwareRequirementsParser#importance}. - * @param ctx the parse tree - */ - void exitImportance(SoftwareRequirementsParser.ImportanceContext ctx); - /** - * Enter a parse tree produced by {@link SoftwareRequirementsParser#type}. - * @param ctx the parse tree - */ - void enterType(SoftwareRequirementsParser.TypeContext ctx); - /** - * Exit a parse tree produced by {@link SoftwareRequirementsParser#type}. - * @param ctx the parse tree - */ - void exitType(SoftwareRequirementsParser.TypeContext ctx); - /** - * Enter a parse tree produced by {@link SoftwareRequirementsParser#access_modifiers}. - * @param ctx the parse tree - */ - void enterAccess_modifiers(SoftwareRequirementsParser.Access_modifiersContext ctx); - /** - * Exit a parse tree produced by {@link SoftwareRequirementsParser#access_modifiers}. - * @param ctx the parse tree - */ - void exitAccess_modifiers(SoftwareRequirementsParser.Access_modifiersContext ctx); - /** - * Enter a parse tree produced by {@link SoftwareRequirementsParser#description}. - * @param ctx the parse tree - */ - void enterDescription(SoftwareRequirementsParser.DescriptionContext ctx); - /** - * Exit a parse tree produced by {@link SoftwareRequirementsParser#description}. - * @param ctx the parse tree - */ - void exitDescription(SoftwareRequirementsParser.DescriptionContext ctx); -} \ No newline at end of file diff --git a/src/main/java/org/lumijiez/parser/SoftwareRequirementsParser.java b/src/main/java/org/lumijiez/parser/SoftwareRequirementsParser.java deleted file mode 100644 index 1c17d16..0000000 --- a/src/main/java/org/lumijiez/parser/SoftwareRequirementsParser.java +++ /dev/null @@ -1,1514 +0,0 @@ -// Generated from D:/Source/JavaProjects/dsl-formal-requirements/src/grammars/SoftwareRequirements.g4 by ANTLR 4.13.1 -package org.lumijiez.parser; -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", "CheckReturnValue"}) -public class SoftwareRequirementsParser extends Parser { - static { RuntimeMetaData.checkVersion("4.13.1", RuntimeMetaData.VERSION); } - - protected static final DFA[] _decisionToDFA; - protected static final PredictionContextCache _sharedContextCache = - new PredictionContextCache(); - public static final int - T__0=1, T__1=2, T__2=3, T__3=4, T__4=5, T__5=6, T__6=7, T__7=8, T__8=9, - T__9=10, T__10=11, T__11=12, T__12=13, T__13=14, T__14=15, T__15=16, T__16=17, - T__17=18, T__18=19, T__19=20, T__20=21, ID=22, STRING=23, DESCRIPTION=24, - WS=25, INT=26, FLOAT=27, LPAREN=28, RPAREN=29, COLON=30, SEMICOLON=31, - COMMA=32, LBRACE=33, RBRACE=34, TILDE=35, EXCLAM=36; - public static final int - RULE_program = 0, RULE_program_body = 1, RULE_requirementSpec = 2, RULE_req_specification = 3, - RULE_result_specification = 4, RULE_predicate = 5, RULE_expression = 6, - RULE_term = 7, RULE_logical_op = 8, RULE_functionSpec = 9, RULE_functionBody = 10, - RULE_input_types = 11, RULE_return_types = 12, RULE_specification = 13, - RULE_variable = 14, RULE_importance = 15, RULE_type = 16, RULE_access_modifiers = 17, - RULE_description = 18; - private static String[] makeRuleNames() { - return new String[] { - "program", "program_body", "requirementSpec", "req_specification", "result_specification", - "predicate", "expression", "term", "logical_op", "functionSpec", "functionBody", - "input_types", "return_types", "specification", "variable", "importance", - "type", "access_modifiers", "description" - }; - } - public static final String[] ruleNames = makeRuleNames(); - - private static String[] makeLiteralNames() { - return new String[] { - null, "'package'", "'@'", "'result'", "'=>'", "'&&'", "'||'", "'return'", - "'[]'", "'critical'", "'optional'", "'INT'", "'FLOAT'", "'DOUBLE'", "'STRING'", - "'BOOLEAN'", "'CHAR'", "'VOID'", "'public'", "'protected'", "'private'", - "'default'", null, null, null, null, null, null, "'('", "')'", "':'", - "';'", "','", "'{'", "'}'", "'~'", "'!'" - }; - } - private static final String[] _LITERAL_NAMES = makeLiteralNames(); - private static String[] makeSymbolicNames() { - return new String[] { - null, null, null, null, null, null, null, null, null, null, null, null, - null, null, null, null, null, null, null, null, null, null, "ID", "STRING", - "DESCRIPTION", "WS", "INT", "FLOAT", "LPAREN", "RPAREN", "COLON", "SEMICOLON", - "COMMA", "LBRACE", "RBRACE", "TILDE", "EXCLAM" - }; - } - 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 "SoftwareRequirements.g4"; } - - @Override - public String[] getRuleNames() { return ruleNames; } - - @Override - public String getSerializedATN() { return _serializedATN; } - - @Override - public ATN getATN() { return _ATN; } - - public SoftwareRequirementsParser(TokenStream input) { - super(input); - _interp = new ParserATNSimulator(this,_ATN,_decisionToDFA,_sharedContextCache); - } - - @SuppressWarnings("CheckReturnValue") - public static class ProgramContext extends ParserRuleContext { - public TerminalNode ID() { return getToken(SoftwareRequirementsParser.ID, 0); } - public TerminalNode LBRACE() { return getToken(SoftwareRequirementsParser.LBRACE, 0); } - public Program_bodyContext program_body() { - return getRuleContext(Program_bodyContext.class,0); - } - public TerminalNode RBRACE() { return getToken(SoftwareRequirementsParser.RBRACE, 0); } - public DescriptionContext description() { - return getRuleContext(DescriptionContext.class,0); - } - public ProgramContext(ParserRuleContext parent, int invokingState) { - super(parent, invokingState); - } - @Override public int getRuleIndex() { return RULE_program; } - @Override - public void enterRule(ParseTreeListener listener) { - if ( listener instanceof SoftwareRequirementsListener ) ((SoftwareRequirementsListener)listener).enterProgram(this); - } - @Override - public void exitRule(ParseTreeListener listener) { - if ( listener instanceof SoftwareRequirementsListener ) ((SoftwareRequirementsListener)listener).exitProgram(this); - } - @Override - public T accept(ParseTreeVisitor visitor) { - if ( visitor instanceof SoftwareRequirementsVisitor ) return ((SoftwareRequirementsVisitor)visitor).visitProgram(this); - else return visitor.visitChildren(this); - } - } - - public final ProgramContext program() throws RecognitionException { - ProgramContext _localctx = new ProgramContext(_ctx, getState()); - enterRule(_localctx, 0, RULE_program); - int _la; - try { - enterOuterAlt(_localctx, 1); - { - setState(39); - _errHandler.sync(this); - _la = _input.LA(1); - if (_la==DESCRIPTION) { - { - setState(38); - description(); - } - } - - setState(41); - match(T__0); - setState(42); - match(ID); - setState(43); - match(LBRACE); - setState(44); - program_body(); - setState(45); - match(RBRACE); - } - } - catch (RecognitionException re) { - _localctx.exception = re; - _errHandler.reportError(this, re); - _errHandler.recover(this, re); - } - finally { - exitRule(); - } - return _localctx; - } - - @SuppressWarnings("CheckReturnValue") - public static class Program_bodyContext extends ParserRuleContext { - public List requirementSpec() { - return getRuleContexts(RequirementSpecContext.class); - } - public RequirementSpecContext requirementSpec(int i) { - return getRuleContext(RequirementSpecContext.class,i); - } - public List functionSpec() { - return getRuleContexts(FunctionSpecContext.class); - } - public FunctionSpecContext functionSpec(int i) { - return getRuleContext(FunctionSpecContext.class,i); - } - public Program_bodyContext(ParserRuleContext parent, int invokingState) { - super(parent, invokingState); - } - @Override public int getRuleIndex() { return RULE_program_body; } - @Override - public void enterRule(ParseTreeListener listener) { - if ( listener instanceof SoftwareRequirementsListener ) ((SoftwareRequirementsListener)listener).enterProgram_body(this); - } - @Override - public void exitRule(ParseTreeListener listener) { - if ( listener instanceof SoftwareRequirementsListener ) ((SoftwareRequirementsListener)listener).exitProgram_body(this); - } - @Override - public T accept(ParseTreeVisitor visitor) { - if ( visitor instanceof SoftwareRequirementsVisitor ) return ((SoftwareRequirementsVisitor)visitor).visitProgram_body(this); - else return visitor.visitChildren(this); - } - } - - public final Program_bodyContext program_body() throws RecognitionException { - Program_bodyContext _localctx = new Program_bodyContext(_ctx, getState()); - enterRule(_localctx, 2, RULE_program_body); - int _la; - try { - enterOuterAlt(_localctx, 1); - { - setState(49); - _errHandler.sync(this); - _la = _input.LA(1); - do { - { - setState(49); - _errHandler.sync(this); - switch ( getInterpreter().adaptivePredict(_input,1,_ctx) ) { - case 1: - { - setState(47); - requirementSpec(); - } - break; - case 2: - { - setState(48); - functionSpec(); - } - break; - } - } - setState(51); - _errHandler.sync(this); - _la = _input.LA(1); - } while ( (((_la) & ~0x3f) == 0 && ((1L << _la) & 24905216L) != 0) ); - } - } - catch (RecognitionException re) { - _localctx.exception = re; - _errHandler.reportError(this, re); - _errHandler.recover(this, re); - } - finally { - exitRule(); - } - return _localctx; - } - - @SuppressWarnings("CheckReturnValue") - public static class RequirementSpecContext extends ParserRuleContext { - public TerminalNode ID() { return getToken(SoftwareRequirementsParser.ID, 0); } - public TerminalNode LBRACE() { return getToken(SoftwareRequirementsParser.LBRACE, 0); } - public TerminalNode RBRACE() { return getToken(SoftwareRequirementsParser.RBRACE, 0); } - public DescriptionContext description() { - return getRuleContext(DescriptionContext.class,0); - } - public ImportanceContext importance() { - return getRuleContext(ImportanceContext.class,0); - } - public List req_specification() { - return getRuleContexts(Req_specificationContext.class); - } - public Req_specificationContext req_specification(int i) { - return getRuleContext(Req_specificationContext.class,i); - } - public List result_specification() { - return getRuleContexts(Result_specificationContext.class); - } - public Result_specificationContext result_specification(int i) { - return getRuleContext(Result_specificationContext.class,i); - } - public RequirementSpecContext(ParserRuleContext parent, int invokingState) { - super(parent, invokingState); - } - @Override public int getRuleIndex() { return RULE_requirementSpec; } - @Override - public void enterRule(ParseTreeListener listener) { - if ( listener instanceof SoftwareRequirementsListener ) ((SoftwareRequirementsListener)listener).enterRequirementSpec(this); - } - @Override - public void exitRule(ParseTreeListener listener) { - if ( listener instanceof SoftwareRequirementsListener ) ((SoftwareRequirementsListener)listener).exitRequirementSpec(this); - } - @Override - public T accept(ParseTreeVisitor visitor) { - if ( visitor instanceof SoftwareRequirementsVisitor ) return ((SoftwareRequirementsVisitor)visitor).visitRequirementSpec(this); - else return visitor.visitChildren(this); - } - } - - public final RequirementSpecContext requirementSpec() throws RecognitionException { - RequirementSpecContext _localctx = new RequirementSpecContext(_ctx, getState()); - enterRule(_localctx, 4, RULE_requirementSpec); - int _la; - try { - enterOuterAlt(_localctx, 1); - { - setState(54); - _errHandler.sync(this); - _la = _input.LA(1); - if (_la==DESCRIPTION) { - { - setState(53); - description(); - } - } - - setState(57); - _errHandler.sync(this); - _la = _input.LA(1); - if (_la==T__8 || _la==T__9) { - { - setState(56); - importance(); - } - } - - setState(59); - match(ID); - setState(60); - match(LBRACE); - setState(64); - _errHandler.sync(this); - _la = _input.LA(1); - while ((((_la) & ~0x3f) == 0 && ((1L << _la) & 1540L) != 0)) { - { - { - setState(61); - req_specification(); - } - } - setState(66); - _errHandler.sync(this); - _la = _input.LA(1); - } - setState(70); - _errHandler.sync(this); - _la = _input.LA(1); - while (_la==T__2) { - { - { - setState(67); - result_specification(); - } - } - setState(72); - _errHandler.sync(this); - _la = _input.LA(1); - } - setState(73); - match(RBRACE); - } - } - catch (RecognitionException re) { - _localctx.exception = re; - _errHandler.reportError(this, re); - _errHandler.recover(this, re); - } - finally { - exitRule(); - } - return _localctx; - } - - @SuppressWarnings("CheckReturnValue") - public static class Req_specificationContext extends ParserRuleContext { - public List ID() { return getTokens(SoftwareRequirementsParser.ID); } - public TerminalNode ID(int i) { - return getToken(SoftwareRequirementsParser.ID, i); - } - public TerminalNode SEMICOLON() { return getToken(SoftwareRequirementsParser.SEMICOLON, 0); } - public ImportanceContext importance() { - return getRuleContext(ImportanceContext.class,0); - } - public List logical_op() { - return getRuleContexts(Logical_opContext.class); - } - public Logical_opContext logical_op(int i) { - return getRuleContext(Logical_opContext.class,i); - } - public Req_specificationContext(ParserRuleContext parent, int invokingState) { - super(parent, invokingState); - } - @Override public int getRuleIndex() { return RULE_req_specification; } - @Override - public void enterRule(ParseTreeListener listener) { - if ( listener instanceof SoftwareRequirementsListener ) ((SoftwareRequirementsListener)listener).enterReq_specification(this); - } - @Override - public void exitRule(ParseTreeListener listener) { - if ( listener instanceof SoftwareRequirementsListener ) ((SoftwareRequirementsListener)listener).exitReq_specification(this); - } - @Override - public T accept(ParseTreeVisitor visitor) { - if ( visitor instanceof SoftwareRequirementsVisitor ) return ((SoftwareRequirementsVisitor)visitor).visitReq_specification(this); - else return visitor.visitChildren(this); - } - } - - public final Req_specificationContext req_specification() throws RecognitionException { - Req_specificationContext _localctx = new Req_specificationContext(_ctx, getState()); - enterRule(_localctx, 6, RULE_req_specification); - int _la; - try { - enterOuterAlt(_localctx, 1); - { - setState(76); - _errHandler.sync(this); - _la = _input.LA(1); - if (_la==T__8 || _la==T__9) { - { - setState(75); - importance(); - } - } - - setState(78); - match(T__1); - setState(79); - match(ID); - setState(85); - _errHandler.sync(this); - _la = _input.LA(1); - while (_la==T__4 || _la==T__5) { - { - { - setState(80); - logical_op(); - setState(81); - match(ID); - } - } - setState(87); - _errHandler.sync(this); - _la = _input.LA(1); - } - setState(88); - match(SEMICOLON); - } - } - catch (RecognitionException re) { - _localctx.exception = re; - _errHandler.reportError(this, re); - _errHandler.recover(this, re); - } - finally { - exitRule(); - } - return _localctx; - } - - @SuppressWarnings("CheckReturnValue") - public static class Result_specificationContext extends ParserRuleContext { - public TerminalNode ID() { return getToken(SoftwareRequirementsParser.ID, 0); } - public TerminalNode SEMICOLON() { return getToken(SoftwareRequirementsParser.SEMICOLON, 0); } - public ImportanceContext importance() { - return getRuleContext(ImportanceContext.class,0); - } - public Result_specificationContext(ParserRuleContext parent, int invokingState) { - super(parent, invokingState); - } - @Override public int getRuleIndex() { return RULE_result_specification; } - @Override - public void enterRule(ParseTreeListener listener) { - if ( listener instanceof SoftwareRequirementsListener ) ((SoftwareRequirementsListener)listener).enterResult_specification(this); - } - @Override - public void exitRule(ParseTreeListener listener) { - if ( listener instanceof SoftwareRequirementsListener ) ((SoftwareRequirementsListener)listener).exitResult_specification(this); - } - @Override - public T accept(ParseTreeVisitor visitor) { - if ( visitor instanceof SoftwareRequirementsVisitor ) return ((SoftwareRequirementsVisitor)visitor).visitResult_specification(this); - else return visitor.visitChildren(this); - } - } - - public final Result_specificationContext result_specification() throws RecognitionException { - Result_specificationContext _localctx = new Result_specificationContext(_ctx, getState()); - enterRule(_localctx, 8, RULE_result_specification); - int _la; - try { - enterOuterAlt(_localctx, 1); - { - setState(90); - match(T__2); - setState(92); - _errHandler.sync(this); - _la = _input.LA(1); - if (_la==T__8 || _la==T__9) { - { - setState(91); - importance(); - } - } - - setState(94); - match(ID); - setState(95); - match(SEMICOLON); - } - } - catch (RecognitionException re) { - _localctx.exception = re; - _errHandler.reportError(this, re); - _errHandler.recover(this, re); - } - finally { - exitRule(); - } - return _localctx; - } - - @SuppressWarnings("CheckReturnValue") - public static class PredicateContext extends ParserRuleContext { - public List expression() { - return getRuleContexts(ExpressionContext.class); - } - public ExpressionContext expression(int i) { - return getRuleContext(ExpressionContext.class,i); - } - public PredicateContext(ParserRuleContext parent, int invokingState) { - super(parent, invokingState); - } - @Override public int getRuleIndex() { return RULE_predicate; } - @Override - public void enterRule(ParseTreeListener listener) { - if ( listener instanceof SoftwareRequirementsListener ) ((SoftwareRequirementsListener)listener).enterPredicate(this); - } - @Override - public void exitRule(ParseTreeListener listener) { - if ( listener instanceof SoftwareRequirementsListener ) ((SoftwareRequirementsListener)listener).exitPredicate(this); - } - @Override - public T accept(ParseTreeVisitor visitor) { - if ( visitor instanceof SoftwareRequirementsVisitor ) return ((SoftwareRequirementsVisitor)visitor).visitPredicate(this); - else return visitor.visitChildren(this); - } - } - - public final PredicateContext predicate() throws RecognitionException { - PredicateContext _localctx = new PredicateContext(_ctx, getState()); - enterRule(_localctx, 10, RULE_predicate); - try { - enterOuterAlt(_localctx, 1); - { - setState(97); - expression(); - setState(98); - match(T__3); - setState(99); - expression(); - } - } - catch (RecognitionException re) { - _localctx.exception = re; - _errHandler.reportError(this, re); - _errHandler.recover(this, re); - } - finally { - exitRule(); - } - return _localctx; - } - - @SuppressWarnings("CheckReturnValue") - public static class ExpressionContext extends ParserRuleContext { - public List term() { - return getRuleContexts(TermContext.class); - } - public TermContext term(int i) { - return getRuleContext(TermContext.class,i); - } - public List logical_op() { - return getRuleContexts(Logical_opContext.class); - } - public Logical_opContext logical_op(int i) { - return getRuleContext(Logical_opContext.class,i); - } - public ExpressionContext(ParserRuleContext parent, int invokingState) { - super(parent, invokingState); - } - @Override public int getRuleIndex() { return RULE_expression; } - @Override - public void enterRule(ParseTreeListener listener) { - if ( listener instanceof SoftwareRequirementsListener ) ((SoftwareRequirementsListener)listener).enterExpression(this); - } - @Override - public void exitRule(ParseTreeListener listener) { - if ( listener instanceof SoftwareRequirementsListener ) ((SoftwareRequirementsListener)listener).exitExpression(this); - } - @Override - public T accept(ParseTreeVisitor visitor) { - if ( visitor instanceof SoftwareRequirementsVisitor ) return ((SoftwareRequirementsVisitor)visitor).visitExpression(this); - else return visitor.visitChildren(this); - } - } - - public final ExpressionContext expression() throws RecognitionException { - ExpressionContext _localctx = new ExpressionContext(_ctx, getState()); - enterRule(_localctx, 12, RULE_expression); - int _la; - try { - enterOuterAlt(_localctx, 1); - { - setState(101); - term(); - setState(107); - _errHandler.sync(this); - _la = _input.LA(1); - while (_la==T__4 || _la==T__5) { - { - { - setState(102); - logical_op(); - setState(103); - term(); - } - } - setState(109); - _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; - } - - @SuppressWarnings("CheckReturnValue") - public static class TermContext extends ParserRuleContext { - public TerminalNode LBRACE() { return getToken(SoftwareRequirementsParser.LBRACE, 0); } - public ExpressionContext expression() { - return getRuleContext(ExpressionContext.class,0); - } - public TerminalNode RBRACE() { return getToken(SoftwareRequirementsParser.RBRACE, 0); } - public TerminalNode STRING() { return getToken(SoftwareRequirementsParser.STRING, 0); } - public TermContext(ParserRuleContext parent, int invokingState) { - super(parent, invokingState); - } - @Override public int getRuleIndex() { return RULE_term; } - @Override - public void enterRule(ParseTreeListener listener) { - if ( listener instanceof SoftwareRequirementsListener ) ((SoftwareRequirementsListener)listener).enterTerm(this); - } - @Override - public void exitRule(ParseTreeListener listener) { - if ( listener instanceof SoftwareRequirementsListener ) ((SoftwareRequirementsListener)listener).exitTerm(this); - } - @Override - public T accept(ParseTreeVisitor visitor) { - if ( visitor instanceof SoftwareRequirementsVisitor ) return ((SoftwareRequirementsVisitor)visitor).visitTerm(this); - else return visitor.visitChildren(this); - } - } - - public final TermContext term() throws RecognitionException { - TermContext _localctx = new TermContext(_ctx, getState()); - enterRule(_localctx, 14, RULE_term); - try { - setState(115); - _errHandler.sync(this); - switch (_input.LA(1)) { - case LBRACE: - enterOuterAlt(_localctx, 1); - { - setState(110); - match(LBRACE); - setState(111); - expression(); - setState(112); - match(RBRACE); - } - break; - case STRING: - enterOuterAlt(_localctx, 2); - { - setState(114); - match(STRING); - } - break; - default: - throw new NoViableAltException(this); - } - } - catch (RecognitionException re) { - _localctx.exception = re; - _errHandler.reportError(this, re); - _errHandler.recover(this, re); - } - finally { - exitRule(); - } - return _localctx; - } - - @SuppressWarnings("CheckReturnValue") - public static class Logical_opContext extends ParserRuleContext { - public Logical_opContext(ParserRuleContext parent, int invokingState) { - super(parent, invokingState); - } - @Override public int getRuleIndex() { return RULE_logical_op; } - @Override - public void enterRule(ParseTreeListener listener) { - if ( listener instanceof SoftwareRequirementsListener ) ((SoftwareRequirementsListener)listener).enterLogical_op(this); - } - @Override - public void exitRule(ParseTreeListener listener) { - if ( listener instanceof SoftwareRequirementsListener ) ((SoftwareRequirementsListener)listener).exitLogical_op(this); - } - @Override - public T accept(ParseTreeVisitor visitor) { - if ( visitor instanceof SoftwareRequirementsVisitor ) return ((SoftwareRequirementsVisitor)visitor).visitLogical_op(this); - else return visitor.visitChildren(this); - } - } - - public final Logical_opContext logical_op() throws RecognitionException { - Logical_opContext _localctx = new Logical_opContext(_ctx, getState()); - enterRule(_localctx, 16, RULE_logical_op); - int _la; - try { - enterOuterAlt(_localctx, 1); - { - setState(117); - _la = _input.LA(1); - if ( !(_la==T__4 || _la==T__5) ) { - _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; - } - - @SuppressWarnings("CheckReturnValue") - public static class FunctionSpecContext extends ParserRuleContext { - public TerminalNode ID() { return getToken(SoftwareRequirementsParser.ID, 0); } - public TerminalNode LPAREN() { return getToken(SoftwareRequirementsParser.LPAREN, 0); } - public TerminalNode RPAREN() { return getToken(SoftwareRequirementsParser.RPAREN, 0); } - public FunctionBodyContext functionBody() { - return getRuleContext(FunctionBodyContext.class,0); - } - public DescriptionContext description() { - return getRuleContext(DescriptionContext.class,0); - } - public ImportanceContext importance() { - return getRuleContext(ImportanceContext.class,0); - } - public Access_modifiersContext access_modifiers() { - return getRuleContext(Access_modifiersContext.class,0); - } - public Input_typesContext input_types() { - return getRuleContext(Input_typesContext.class,0); - } - public FunctionSpecContext(ParserRuleContext parent, int invokingState) { - super(parent, invokingState); - } - @Override public int getRuleIndex() { return RULE_functionSpec; } - @Override - public void enterRule(ParseTreeListener listener) { - if ( listener instanceof SoftwareRequirementsListener ) ((SoftwareRequirementsListener)listener).enterFunctionSpec(this); - } - @Override - public void exitRule(ParseTreeListener listener) { - if ( listener instanceof SoftwareRequirementsListener ) ((SoftwareRequirementsListener)listener).exitFunctionSpec(this); - } - @Override - public T accept(ParseTreeVisitor visitor) { - if ( visitor instanceof SoftwareRequirementsVisitor ) return ((SoftwareRequirementsVisitor)visitor).visitFunctionSpec(this); - else return visitor.visitChildren(this); - } - } - - public final FunctionSpecContext functionSpec() throws RecognitionException { - FunctionSpecContext _localctx = new FunctionSpecContext(_ctx, getState()); - enterRule(_localctx, 18, RULE_functionSpec); - int _la; - try { - enterOuterAlt(_localctx, 1); - { - setState(120); - _errHandler.sync(this); - _la = _input.LA(1); - if (_la==DESCRIPTION) { - { - setState(119); - description(); - } - } - - setState(123); - _errHandler.sync(this); - _la = _input.LA(1); - if (_la==T__8 || _la==T__9) { - { - setState(122); - importance(); - } - } - - setState(126); - _errHandler.sync(this); - _la = _input.LA(1); - if ((((_la) & ~0x3f) == 0 && ((1L << _la) & 3932160L) != 0)) { - { - setState(125); - access_modifiers(); - } - } - - setState(128); - match(ID); - setState(129); - match(LPAREN); - setState(131); - _errHandler.sync(this); - _la = _input.LA(1); - if ((((_la) & ~0x3f) == 0 && ((1L << _la) & 260096L) != 0)) { - { - setState(130); - input_types(); - } - } - - setState(133); - match(RPAREN); - setState(134); - functionBody(); - } - } - catch (RecognitionException re) { - _localctx.exception = re; - _errHandler.reportError(this, re); - _errHandler.recover(this, re); - } - finally { - exitRule(); - } - return _localctx; - } - - @SuppressWarnings("CheckReturnValue") - public static class FunctionBodyContext extends ParserRuleContext { - public TerminalNode LBRACE() { return getToken(SoftwareRequirementsParser.LBRACE, 0); } - public Return_typesContext return_types() { - return getRuleContext(Return_typesContext.class,0); - } - public TerminalNode RBRACE() { return getToken(SoftwareRequirementsParser.RBRACE, 0); } - public List specification() { - return getRuleContexts(SpecificationContext.class); - } - public SpecificationContext specification(int i) { - return getRuleContext(SpecificationContext.class,i); - } - public FunctionBodyContext(ParserRuleContext parent, int invokingState) { - super(parent, invokingState); - } - @Override public int getRuleIndex() { return RULE_functionBody; } - @Override - public void enterRule(ParseTreeListener listener) { - if ( listener instanceof SoftwareRequirementsListener ) ((SoftwareRequirementsListener)listener).enterFunctionBody(this); - } - @Override - public void exitRule(ParseTreeListener listener) { - if ( listener instanceof SoftwareRequirementsListener ) ((SoftwareRequirementsListener)listener).exitFunctionBody(this); - } - @Override - public T accept(ParseTreeVisitor visitor) { - if ( visitor instanceof SoftwareRequirementsVisitor ) return ((SoftwareRequirementsVisitor)visitor).visitFunctionBody(this); - else return visitor.visitChildren(this); - } - } - - public final FunctionBodyContext functionBody() throws RecognitionException { - FunctionBodyContext _localctx = new FunctionBodyContext(_ctx, getState()); - enterRule(_localctx, 20, RULE_functionBody); - int _la; - try { - enterOuterAlt(_localctx, 1); - { - setState(136); - match(LBRACE); - setState(140); - _errHandler.sync(this); - _la = _input.LA(1); - while (_la==T__1) { - { - { - setState(137); - specification(); - } - } - setState(142); - _errHandler.sync(this); - _la = _input.LA(1); - } - setState(143); - return_types(); - setState(144); - match(RBRACE); - } - } - catch (RecognitionException re) { - _localctx.exception = re; - _errHandler.reportError(this, re); - _errHandler.recover(this, re); - } - finally { - exitRule(); - } - return _localctx; - } - - @SuppressWarnings("CheckReturnValue") - public static class Input_typesContext extends ParserRuleContext { - public List variable() { - return getRuleContexts(VariableContext.class); - } - public VariableContext variable(int i) { - return getRuleContext(VariableContext.class,i); - } - public List COMMA() { return getTokens(SoftwareRequirementsParser.COMMA); } - public TerminalNode COMMA(int i) { - return getToken(SoftwareRequirementsParser.COMMA, i); - } - public Input_typesContext(ParserRuleContext parent, int invokingState) { - super(parent, invokingState); - } - @Override public int getRuleIndex() { return RULE_input_types; } - @Override - public void enterRule(ParseTreeListener listener) { - if ( listener instanceof SoftwareRequirementsListener ) ((SoftwareRequirementsListener)listener).enterInput_types(this); - } - @Override - public void exitRule(ParseTreeListener listener) { - if ( listener instanceof SoftwareRequirementsListener ) ((SoftwareRequirementsListener)listener).exitInput_types(this); - } - @Override - public T accept(ParseTreeVisitor visitor) { - if ( visitor instanceof SoftwareRequirementsVisitor ) return ((SoftwareRequirementsVisitor)visitor).visitInput_types(this); - else return visitor.visitChildren(this); - } - } - - public final Input_typesContext input_types() throws RecognitionException { - Input_typesContext _localctx = new Input_typesContext(_ctx, getState()); - enterRule(_localctx, 22, RULE_input_types); - int _la; - try { - enterOuterAlt(_localctx, 1); - { - setState(146); - variable(); - setState(151); - _errHandler.sync(this); - _la = _input.LA(1); - while (_la==COMMA) { - { - { - setState(147); - match(COMMA); - setState(148); - variable(); - } - } - setState(153); - _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; - } - - @SuppressWarnings("CheckReturnValue") - public static class Return_typesContext extends ParserRuleContext { - public List variable() { - return getRuleContexts(VariableContext.class); - } - public VariableContext variable(int i) { - return getRuleContext(VariableContext.class,i); - } - public TerminalNode SEMICOLON() { return getToken(SoftwareRequirementsParser.SEMICOLON, 0); } - public List COMMA() { return getTokens(SoftwareRequirementsParser.COMMA); } - public TerminalNode COMMA(int i) { - return getToken(SoftwareRequirementsParser.COMMA, i); - } - public Return_typesContext(ParserRuleContext parent, int invokingState) { - super(parent, invokingState); - } - @Override public int getRuleIndex() { return RULE_return_types; } - @Override - public void enterRule(ParseTreeListener listener) { - if ( listener instanceof SoftwareRequirementsListener ) ((SoftwareRequirementsListener)listener).enterReturn_types(this); - } - @Override - public void exitRule(ParseTreeListener listener) { - if ( listener instanceof SoftwareRequirementsListener ) ((SoftwareRequirementsListener)listener).exitReturn_types(this); - } - @Override - public T accept(ParseTreeVisitor visitor) { - if ( visitor instanceof SoftwareRequirementsVisitor ) return ((SoftwareRequirementsVisitor)visitor).visitReturn_types(this); - else return visitor.visitChildren(this); - } - } - - public final Return_typesContext return_types() throws RecognitionException { - Return_typesContext _localctx = new Return_typesContext(_ctx, getState()); - enterRule(_localctx, 24, RULE_return_types); - int _la; - try { - enterOuterAlt(_localctx, 1); - { - setState(154); - match(T__6); - setState(155); - variable(); - setState(160); - _errHandler.sync(this); - _la = _input.LA(1); - while (_la==COMMA) { - { - { - setState(156); - match(COMMA); - setState(157); - variable(); - } - } - setState(162); - _errHandler.sync(this); - _la = _input.LA(1); - } - setState(163); - match(SEMICOLON); - } - } - catch (RecognitionException re) { - _localctx.exception = re; - _errHandler.reportError(this, re); - _errHandler.recover(this, re); - } - finally { - exitRule(); - } - return _localctx; - } - - @SuppressWarnings("CheckReturnValue") - public static class SpecificationContext extends ParserRuleContext { - public TerminalNode ID() { return getToken(SoftwareRequirementsParser.ID, 0); } - public TerminalNode COLON() { return getToken(SoftwareRequirementsParser.COLON, 0); } - public TerminalNode STRING() { return getToken(SoftwareRequirementsParser.STRING, 0); } - public TerminalNode SEMICOLON() { return getToken(SoftwareRequirementsParser.SEMICOLON, 0); } - public SpecificationContext(ParserRuleContext parent, int invokingState) { - super(parent, invokingState); - } - @Override public int getRuleIndex() { return RULE_specification; } - @Override - public void enterRule(ParseTreeListener listener) { - if ( listener instanceof SoftwareRequirementsListener ) ((SoftwareRequirementsListener)listener).enterSpecification(this); - } - @Override - public void exitRule(ParseTreeListener listener) { - if ( listener instanceof SoftwareRequirementsListener ) ((SoftwareRequirementsListener)listener).exitSpecification(this); - } - @Override - public T accept(ParseTreeVisitor visitor) { - if ( visitor instanceof SoftwareRequirementsVisitor ) return ((SoftwareRequirementsVisitor)visitor).visitSpecification(this); - else return visitor.visitChildren(this); - } - } - - public final SpecificationContext specification() throws RecognitionException { - SpecificationContext _localctx = new SpecificationContext(_ctx, getState()); - enterRule(_localctx, 26, RULE_specification); - try { - enterOuterAlt(_localctx, 1); - { - setState(165); - match(T__1); - setState(166); - match(ID); - setState(167); - match(COLON); - setState(168); - match(STRING); - setState(169); - match(SEMICOLON); - } - } - catch (RecognitionException re) { - _localctx.exception = re; - _errHandler.reportError(this, re); - _errHandler.recover(this, re); - } - finally { - exitRule(); - } - return _localctx; - } - - @SuppressWarnings("CheckReturnValue") - public static class VariableContext extends ParserRuleContext { - public TypeContext type() { - return getRuleContext(TypeContext.class,0); - } - public TerminalNode ID() { return getToken(SoftwareRequirementsParser.ID, 0); } - public VariableContext(ParserRuleContext parent, int invokingState) { - super(parent, invokingState); - } - @Override public int getRuleIndex() { return RULE_variable; } - @Override - public void enterRule(ParseTreeListener listener) { - if ( listener instanceof SoftwareRequirementsListener ) ((SoftwareRequirementsListener)listener).enterVariable(this); - } - @Override - public void exitRule(ParseTreeListener listener) { - if ( listener instanceof SoftwareRequirementsListener ) ((SoftwareRequirementsListener)listener).exitVariable(this); - } - @Override - public T accept(ParseTreeVisitor visitor) { - if ( visitor instanceof SoftwareRequirementsVisitor ) return ((SoftwareRequirementsVisitor)visitor).visitVariable(this); - else return visitor.visitChildren(this); - } - } - - public final VariableContext variable() throws RecognitionException { - VariableContext _localctx = new VariableContext(_ctx, getState()); - enterRule(_localctx, 28, RULE_variable); - int _la; - try { - enterOuterAlt(_localctx, 1); - { - setState(171); - type(); - setState(173); - _errHandler.sync(this); - _la = _input.LA(1); - if (_la==T__7) { - { - setState(172); - match(T__7); - } - } - - setState(175); - match(ID); - } - } - catch (RecognitionException re) { - _localctx.exception = re; - _errHandler.reportError(this, re); - _errHandler.recover(this, re); - } - finally { - exitRule(); - } - return _localctx; - } - - @SuppressWarnings("CheckReturnValue") - public static class ImportanceContext extends ParserRuleContext { - public ImportanceContext(ParserRuleContext parent, int invokingState) { - super(parent, invokingState); - } - @Override public int getRuleIndex() { return RULE_importance; } - @Override - public void enterRule(ParseTreeListener listener) { - if ( listener instanceof SoftwareRequirementsListener ) ((SoftwareRequirementsListener)listener).enterImportance(this); - } - @Override - public void exitRule(ParseTreeListener listener) { - if ( listener instanceof SoftwareRequirementsListener ) ((SoftwareRequirementsListener)listener).exitImportance(this); - } - @Override - public T accept(ParseTreeVisitor visitor) { - if ( visitor instanceof SoftwareRequirementsVisitor ) return ((SoftwareRequirementsVisitor)visitor).visitImportance(this); - else return visitor.visitChildren(this); - } - } - - public final ImportanceContext importance() throws RecognitionException { - ImportanceContext _localctx = new ImportanceContext(_ctx, getState()); - enterRule(_localctx, 30, RULE_importance); - int _la; - try { - enterOuterAlt(_localctx, 1); - { - setState(177); - _la = _input.LA(1); - if ( !(_la==T__8 || _la==T__9) ) { - _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; - } - - @SuppressWarnings("CheckReturnValue") - public static class TypeContext extends ParserRuleContext { - public TypeContext(ParserRuleContext parent, int invokingState) { - super(parent, invokingState); - } - @Override public int getRuleIndex() { return RULE_type; } - @Override - public void enterRule(ParseTreeListener listener) { - if ( listener instanceof SoftwareRequirementsListener ) ((SoftwareRequirementsListener)listener).enterType(this); - } - @Override - public void exitRule(ParseTreeListener listener) { - if ( listener instanceof SoftwareRequirementsListener ) ((SoftwareRequirementsListener)listener).exitType(this); - } - @Override - public T accept(ParseTreeVisitor visitor) { - if ( visitor instanceof SoftwareRequirementsVisitor ) return ((SoftwareRequirementsVisitor)visitor).visitType(this); - else return visitor.visitChildren(this); - } - } - - public final TypeContext type() throws RecognitionException { - TypeContext _localctx = new TypeContext(_ctx, getState()); - enterRule(_localctx, 32, RULE_type); - int _la; - try { - enterOuterAlt(_localctx, 1); - { - setState(179); - _la = _input.LA(1); - if ( !((((_la) & ~0x3f) == 0 && ((1L << _la) & 260096L) != 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; - } - - @SuppressWarnings("CheckReturnValue") - public static class Access_modifiersContext extends ParserRuleContext { - public Access_modifiersContext(ParserRuleContext parent, int invokingState) { - super(parent, invokingState); - } - @Override public int getRuleIndex() { return RULE_access_modifiers; } - @Override - public void enterRule(ParseTreeListener listener) { - if ( listener instanceof SoftwareRequirementsListener ) ((SoftwareRequirementsListener)listener).enterAccess_modifiers(this); - } - @Override - public void exitRule(ParseTreeListener listener) { - if ( listener instanceof SoftwareRequirementsListener ) ((SoftwareRequirementsListener)listener).exitAccess_modifiers(this); - } - @Override - public T accept(ParseTreeVisitor visitor) { - if ( visitor instanceof SoftwareRequirementsVisitor ) return ((SoftwareRequirementsVisitor)visitor).visitAccess_modifiers(this); - else return visitor.visitChildren(this); - } - } - - public final Access_modifiersContext access_modifiers() throws RecognitionException { - Access_modifiersContext _localctx = new Access_modifiersContext(_ctx, getState()); - enterRule(_localctx, 34, RULE_access_modifiers); - int _la; - try { - enterOuterAlt(_localctx, 1); - { - setState(181); - _la = _input.LA(1); - if ( !((((_la) & ~0x3f) == 0 && ((1L << _la) & 3932160L) != 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; - } - - @SuppressWarnings("CheckReturnValue") - public static class DescriptionContext extends ParserRuleContext { - public TerminalNode DESCRIPTION() { return getToken(SoftwareRequirementsParser.DESCRIPTION, 0); } - public DescriptionContext(ParserRuleContext parent, int invokingState) { - super(parent, invokingState); - } - @Override public int getRuleIndex() { return RULE_description; } - @Override - public void enterRule(ParseTreeListener listener) { - if ( listener instanceof SoftwareRequirementsListener ) ((SoftwareRequirementsListener)listener).enterDescription(this); - } - @Override - public void exitRule(ParseTreeListener listener) { - if ( listener instanceof SoftwareRequirementsListener ) ((SoftwareRequirementsListener)listener).exitDescription(this); - } - @Override - public T accept(ParseTreeVisitor visitor) { - if ( visitor instanceof SoftwareRequirementsVisitor ) return ((SoftwareRequirementsVisitor)visitor).visitDescription(this); - else return visitor.visitChildren(this); - } - } - - public final DescriptionContext description() throws RecognitionException { - DescriptionContext _localctx = new DescriptionContext(_ctx, getState()); - enterRule(_localctx, 36, RULE_description); - try { - enterOuterAlt(_localctx, 1); - { - setState(183); - match(DESCRIPTION); - } - } - catch (RecognitionException re) { - _localctx.exception = re; - _errHandler.reportError(this, re); - _errHandler.recover(this, re); - } - finally { - exitRule(); - } - return _localctx; - } - - public static final String _serializedATN = - "\u0004\u0001$\u00ba\u0002\u0000\u0007\u0000\u0002\u0001\u0007\u0001\u0002"+ - "\u0002\u0007\u0002\u0002\u0003\u0007\u0003\u0002\u0004\u0007\u0004\u0002"+ - "\u0005\u0007\u0005\u0002\u0006\u0007\u0006\u0002\u0007\u0007\u0007\u0002"+ - "\b\u0007\b\u0002\t\u0007\t\u0002\n\u0007\n\u0002\u000b\u0007\u000b\u0002"+ - "\f\u0007\f\u0002\r\u0007\r\u0002\u000e\u0007\u000e\u0002\u000f\u0007\u000f"+ - "\u0002\u0010\u0007\u0010\u0002\u0011\u0007\u0011\u0002\u0012\u0007\u0012"+ - "\u0001\u0000\u0003\u0000(\b\u0000\u0001\u0000\u0001\u0000\u0001\u0000"+ - "\u0001\u0000\u0001\u0000\u0001\u0000\u0001\u0001\u0001\u0001\u0004\u0001"+ - "2\b\u0001\u000b\u0001\f\u00013\u0001\u0002\u0003\u00027\b\u0002\u0001"+ - "\u0002\u0003\u0002:\b\u0002\u0001\u0002\u0001\u0002\u0001\u0002\u0005"+ - "\u0002?\b\u0002\n\u0002\f\u0002B\t\u0002\u0001\u0002\u0005\u0002E\b\u0002"+ - "\n\u0002\f\u0002H\t\u0002\u0001\u0002\u0001\u0002\u0001\u0003\u0003\u0003"+ - "M\b\u0003\u0001\u0003\u0001\u0003\u0001\u0003\u0001\u0003\u0001\u0003"+ - "\u0005\u0003T\b\u0003\n\u0003\f\u0003W\t\u0003\u0001\u0003\u0001\u0003"+ - "\u0001\u0004\u0001\u0004\u0003\u0004]\b\u0004\u0001\u0004\u0001\u0004"+ - "\u0001\u0004\u0001\u0005\u0001\u0005\u0001\u0005\u0001\u0005\u0001\u0006"+ - "\u0001\u0006\u0001\u0006\u0001\u0006\u0005\u0006j\b\u0006\n\u0006\f\u0006"+ - "m\t\u0006\u0001\u0007\u0001\u0007\u0001\u0007\u0001\u0007\u0001\u0007"+ - "\u0003\u0007t\b\u0007\u0001\b\u0001\b\u0001\t\u0003\ty\b\t\u0001\t\u0003"+ - "\t|\b\t\u0001\t\u0003\t\u007f\b\t\u0001\t\u0001\t\u0001\t\u0003\t\u0084"+ - "\b\t\u0001\t\u0001\t\u0001\t\u0001\n\u0001\n\u0005\n\u008b\b\n\n\n\f\n"+ - "\u008e\t\n\u0001\n\u0001\n\u0001\n\u0001\u000b\u0001\u000b\u0001\u000b"+ - "\u0005\u000b\u0096\b\u000b\n\u000b\f\u000b\u0099\t\u000b\u0001\f\u0001"+ - "\f\u0001\f\u0001\f\u0005\f\u009f\b\f\n\f\f\f\u00a2\t\f\u0001\f\u0001\f"+ - "\u0001\r\u0001\r\u0001\r\u0001\r\u0001\r\u0001\r\u0001\u000e\u0001\u000e"+ - "\u0003\u000e\u00ae\b\u000e\u0001\u000e\u0001\u000e\u0001\u000f\u0001\u000f"+ - "\u0001\u0010\u0001\u0010\u0001\u0011\u0001\u0011\u0001\u0012\u0001\u0012"+ - "\u0001\u0012\u0000\u0000\u0013\u0000\u0002\u0004\u0006\b\n\f\u000e\u0010"+ - "\u0012\u0014\u0016\u0018\u001a\u001c\u001e \"$\u0000\u0004\u0001\u0000"+ - "\u0005\u0006\u0001\u0000\t\n\u0001\u0000\u000b\u0011\u0001\u0000\u0012"+ - "\u0015\u00ba\u0000\'\u0001\u0000\u0000\u0000\u00021\u0001\u0000\u0000"+ - "\u0000\u00046\u0001\u0000\u0000\u0000\u0006L\u0001\u0000\u0000\u0000\b"+ - "Z\u0001\u0000\u0000\u0000\na\u0001\u0000\u0000\u0000\fe\u0001\u0000\u0000"+ - "\u0000\u000es\u0001\u0000\u0000\u0000\u0010u\u0001\u0000\u0000\u0000\u0012"+ - "x\u0001\u0000\u0000\u0000\u0014\u0088\u0001\u0000\u0000\u0000\u0016\u0092"+ - "\u0001\u0000\u0000\u0000\u0018\u009a\u0001\u0000\u0000\u0000\u001a\u00a5"+ - "\u0001\u0000\u0000\u0000\u001c\u00ab\u0001\u0000\u0000\u0000\u001e\u00b1"+ - "\u0001\u0000\u0000\u0000 \u00b3\u0001\u0000\u0000\u0000\"\u00b5\u0001"+ - "\u0000\u0000\u0000$\u00b7\u0001\u0000\u0000\u0000&(\u0003$\u0012\u0000"+ - "\'&\u0001\u0000\u0000\u0000\'(\u0001\u0000\u0000\u0000()\u0001\u0000\u0000"+ - "\u0000)*\u0005\u0001\u0000\u0000*+\u0005\u0016\u0000\u0000+,\u0005!\u0000"+ - "\u0000,-\u0003\u0002\u0001\u0000-.\u0005\"\u0000\u0000.\u0001\u0001\u0000"+ - "\u0000\u0000/2\u0003\u0004\u0002\u000002\u0003\u0012\t\u00001/\u0001\u0000"+ - "\u0000\u000010\u0001\u0000\u0000\u000023\u0001\u0000\u0000\u000031\u0001"+ - "\u0000\u0000\u000034\u0001\u0000\u0000\u00004\u0003\u0001\u0000\u0000"+ - "\u000057\u0003$\u0012\u000065\u0001\u0000\u0000\u000067\u0001\u0000\u0000"+ - "\u000079\u0001\u0000\u0000\u00008:\u0003\u001e\u000f\u000098\u0001\u0000"+ - "\u0000\u00009:\u0001\u0000\u0000\u0000:;\u0001\u0000\u0000\u0000;<\u0005"+ - "\u0016\u0000\u0000<@\u0005!\u0000\u0000=?\u0003\u0006\u0003\u0000>=\u0001"+ - "\u0000\u0000\u0000?B\u0001\u0000\u0000\u0000@>\u0001\u0000\u0000\u0000"+ - "@A\u0001\u0000\u0000\u0000AF\u0001\u0000\u0000\u0000B@\u0001\u0000\u0000"+ - "\u0000CE\u0003\b\u0004\u0000DC\u0001\u0000\u0000\u0000EH\u0001\u0000\u0000"+ - "\u0000FD\u0001\u0000\u0000\u0000FG\u0001\u0000\u0000\u0000GI\u0001\u0000"+ - "\u0000\u0000HF\u0001\u0000\u0000\u0000IJ\u0005\"\u0000\u0000J\u0005\u0001"+ - "\u0000\u0000\u0000KM\u0003\u001e\u000f\u0000LK\u0001\u0000\u0000\u0000"+ - "LM\u0001\u0000\u0000\u0000MN\u0001\u0000\u0000\u0000NO\u0005\u0002\u0000"+ - "\u0000OU\u0005\u0016\u0000\u0000PQ\u0003\u0010\b\u0000QR\u0005\u0016\u0000"+ - "\u0000RT\u0001\u0000\u0000\u0000SP\u0001\u0000\u0000\u0000TW\u0001\u0000"+ - "\u0000\u0000US\u0001\u0000\u0000\u0000UV\u0001\u0000\u0000\u0000VX\u0001"+ - "\u0000\u0000\u0000WU\u0001\u0000\u0000\u0000XY\u0005\u001f\u0000\u0000"+ - "Y\u0007\u0001\u0000\u0000\u0000Z\\\u0005\u0003\u0000\u0000[]\u0003\u001e"+ - "\u000f\u0000\\[\u0001\u0000\u0000\u0000\\]\u0001\u0000\u0000\u0000]^\u0001"+ - "\u0000\u0000\u0000^_\u0005\u0016\u0000\u0000_`\u0005\u001f\u0000\u0000"+ - "`\t\u0001\u0000\u0000\u0000ab\u0003\f\u0006\u0000bc\u0005\u0004\u0000"+ - "\u0000cd\u0003\f\u0006\u0000d\u000b\u0001\u0000\u0000\u0000ek\u0003\u000e"+ - "\u0007\u0000fg\u0003\u0010\b\u0000gh\u0003\u000e\u0007\u0000hj\u0001\u0000"+ - "\u0000\u0000if\u0001\u0000\u0000\u0000jm\u0001\u0000\u0000\u0000ki\u0001"+ - "\u0000\u0000\u0000kl\u0001\u0000\u0000\u0000l\r\u0001\u0000\u0000\u0000"+ - "mk\u0001\u0000\u0000\u0000no\u0005!\u0000\u0000op\u0003\f\u0006\u0000"+ - "pq\u0005\"\u0000\u0000qt\u0001\u0000\u0000\u0000rt\u0005\u0017\u0000\u0000"+ - "sn\u0001\u0000\u0000\u0000sr\u0001\u0000\u0000\u0000t\u000f\u0001\u0000"+ - "\u0000\u0000uv\u0007\u0000\u0000\u0000v\u0011\u0001\u0000\u0000\u0000"+ - "wy\u0003$\u0012\u0000xw\u0001\u0000\u0000\u0000xy\u0001\u0000\u0000\u0000"+ - "y{\u0001\u0000\u0000\u0000z|\u0003\u001e\u000f\u0000{z\u0001\u0000\u0000"+ - "\u0000{|\u0001\u0000\u0000\u0000|~\u0001\u0000\u0000\u0000}\u007f\u0003"+ - "\"\u0011\u0000~}\u0001\u0000\u0000\u0000~\u007f\u0001\u0000\u0000\u0000"+ - "\u007f\u0080\u0001\u0000\u0000\u0000\u0080\u0081\u0005\u0016\u0000\u0000"+ - "\u0081\u0083\u0005\u001c\u0000\u0000\u0082\u0084\u0003\u0016\u000b\u0000"+ - "\u0083\u0082\u0001\u0000\u0000\u0000\u0083\u0084\u0001\u0000\u0000\u0000"+ - "\u0084\u0085\u0001\u0000\u0000\u0000\u0085\u0086\u0005\u001d\u0000\u0000"+ - "\u0086\u0087\u0003\u0014\n\u0000\u0087\u0013\u0001\u0000\u0000\u0000\u0088"+ - "\u008c\u0005!\u0000\u0000\u0089\u008b\u0003\u001a\r\u0000\u008a\u0089"+ - "\u0001\u0000\u0000\u0000\u008b\u008e\u0001\u0000\u0000\u0000\u008c\u008a"+ - "\u0001\u0000\u0000\u0000\u008c\u008d\u0001\u0000\u0000\u0000\u008d\u008f"+ - "\u0001\u0000\u0000\u0000\u008e\u008c\u0001\u0000\u0000\u0000\u008f\u0090"+ - "\u0003\u0018\f\u0000\u0090\u0091\u0005\"\u0000\u0000\u0091\u0015\u0001"+ - "\u0000\u0000\u0000\u0092\u0097\u0003\u001c\u000e\u0000\u0093\u0094\u0005"+ - " \u0000\u0000\u0094\u0096\u0003\u001c\u000e\u0000\u0095\u0093\u0001\u0000"+ - "\u0000\u0000\u0096\u0099\u0001\u0000\u0000\u0000\u0097\u0095\u0001\u0000"+ - "\u0000\u0000\u0097\u0098\u0001\u0000\u0000\u0000\u0098\u0017\u0001\u0000"+ - "\u0000\u0000\u0099\u0097\u0001\u0000\u0000\u0000\u009a\u009b\u0005\u0007"+ - "\u0000\u0000\u009b\u00a0\u0003\u001c\u000e\u0000\u009c\u009d\u0005 \u0000"+ - "\u0000\u009d\u009f\u0003\u001c\u000e\u0000\u009e\u009c\u0001\u0000\u0000"+ - "\u0000\u009f\u00a2\u0001\u0000\u0000\u0000\u00a0\u009e\u0001\u0000\u0000"+ - "\u0000\u00a0\u00a1\u0001\u0000\u0000\u0000\u00a1\u00a3\u0001\u0000\u0000"+ - "\u0000\u00a2\u00a0\u0001\u0000\u0000\u0000\u00a3\u00a4\u0005\u001f\u0000"+ - "\u0000\u00a4\u0019\u0001\u0000\u0000\u0000\u00a5\u00a6\u0005\u0002\u0000"+ - "\u0000\u00a6\u00a7\u0005\u0016\u0000\u0000\u00a7\u00a8\u0005\u001e\u0000"+ - "\u0000\u00a8\u00a9\u0005\u0017\u0000\u0000\u00a9\u00aa\u0005\u001f\u0000"+ - "\u0000\u00aa\u001b\u0001\u0000\u0000\u0000\u00ab\u00ad\u0003 \u0010\u0000"+ - "\u00ac\u00ae\u0005\b\u0000\u0000\u00ad\u00ac\u0001\u0000\u0000\u0000\u00ad"+ - "\u00ae\u0001\u0000\u0000\u0000\u00ae\u00af\u0001\u0000\u0000\u0000\u00af"+ - "\u00b0\u0005\u0016\u0000\u0000\u00b0\u001d\u0001\u0000\u0000\u0000\u00b1"+ - "\u00b2\u0007\u0001\u0000\u0000\u00b2\u001f\u0001\u0000\u0000\u0000\u00b3"+ - "\u00b4\u0007\u0002\u0000\u0000\u00b4!\u0001\u0000\u0000\u0000\u00b5\u00b6"+ - "\u0007\u0003\u0000\u0000\u00b6#\u0001\u0000\u0000\u0000\u00b7\u00b8\u0005"+ - "\u0018\u0000\u0000\u00b8%\u0001\u0000\u0000\u0000\u0014\'1369@FLU\\ks"+ - "x{~\u0083\u008c\u0097\u00a0\u00ad"; - 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/org/lumijiez/parser/SoftwareRequirementsVisitor.java b/src/main/java/org/lumijiez/parser/SoftwareRequirementsVisitor.java deleted file mode 100644 index ed8f466..0000000 --- a/src/main/java/org/lumijiez/parser/SoftwareRequirementsVisitor.java +++ /dev/null @@ -1,127 +0,0 @@ -// Generated from D:/Source/JavaProjects/dsl-formal-requirements/src/grammars/SoftwareRequirements.g4 by ANTLR 4.13.1 -package org.lumijiez.parser; -import org.antlr.v4.runtime.tree.ParseTreeVisitor; - -/** - * This interface defines a complete generic visitor for a parse tree produced - * by {@link SoftwareRequirementsParser}. - * - * @param The return type of the visit operation. Use {@link Void} for - * operations with no return type. - */ -public interface SoftwareRequirementsVisitor extends ParseTreeVisitor { - /** - * Visit a parse tree produced by {@link SoftwareRequirementsParser#program}. - * @param ctx the parse tree - * @return the visitor result - */ - T visitProgram(SoftwareRequirementsParser.ProgramContext ctx); - /** - * Visit a parse tree produced by {@link SoftwareRequirementsParser#program_body}. - * @param ctx the parse tree - * @return the visitor result - */ - T visitProgram_body(SoftwareRequirementsParser.Program_bodyContext ctx); - /** - * Visit a parse tree produced by {@link SoftwareRequirementsParser#requirementSpec}. - * @param ctx the parse tree - * @return the visitor result - */ - T visitRequirementSpec(SoftwareRequirementsParser.RequirementSpecContext ctx); - /** - * Visit a parse tree produced by {@link SoftwareRequirementsParser#req_specification}. - * @param ctx the parse tree - * @return the visitor result - */ - T visitReq_specification(SoftwareRequirementsParser.Req_specificationContext ctx); - /** - * Visit a parse tree produced by {@link SoftwareRequirementsParser#result_specification}. - * @param ctx the parse tree - * @return the visitor result - */ - T visitResult_specification(SoftwareRequirementsParser.Result_specificationContext ctx); - /** - * Visit a parse tree produced by {@link SoftwareRequirementsParser#predicate}. - * @param ctx the parse tree - * @return the visitor result - */ - T visitPredicate(SoftwareRequirementsParser.PredicateContext ctx); - /** - * Visit a parse tree produced by {@link SoftwareRequirementsParser#expression}. - * @param ctx the parse tree - * @return the visitor result - */ - T visitExpression(SoftwareRequirementsParser.ExpressionContext ctx); - /** - * Visit a parse tree produced by {@link SoftwareRequirementsParser#term}. - * @param ctx the parse tree - * @return the visitor result - */ - T visitTerm(SoftwareRequirementsParser.TermContext ctx); - /** - * Visit a parse tree produced by {@link SoftwareRequirementsParser#logical_op}. - * @param ctx the parse tree - * @return the visitor result - */ - T visitLogical_op(SoftwareRequirementsParser.Logical_opContext ctx); - /** - * Visit a parse tree produced by {@link SoftwareRequirementsParser#functionSpec}. - * @param ctx the parse tree - * @return the visitor result - */ - T visitFunctionSpec(SoftwareRequirementsParser.FunctionSpecContext ctx); - /** - * Visit a parse tree produced by {@link SoftwareRequirementsParser#functionBody}. - * @param ctx the parse tree - * @return the visitor result - */ - T visitFunctionBody(SoftwareRequirementsParser.FunctionBodyContext ctx); - /** - * Visit a parse tree produced by {@link SoftwareRequirementsParser#input_types}. - * @param ctx the parse tree - * @return the visitor result - */ - T visitInput_types(SoftwareRequirementsParser.Input_typesContext ctx); - /** - * Visit a parse tree produced by {@link SoftwareRequirementsParser#return_types}. - * @param ctx the parse tree - * @return the visitor result - */ - T visitReturn_types(SoftwareRequirementsParser.Return_typesContext ctx); - /** - * Visit a parse tree produced by {@link SoftwareRequirementsParser#specification}. - * @param ctx the parse tree - * @return the visitor result - */ - T visitSpecification(SoftwareRequirementsParser.SpecificationContext ctx); - /** - * Visit a parse tree produced by {@link SoftwareRequirementsParser#variable}. - * @param ctx the parse tree - * @return the visitor result - */ - T visitVariable(SoftwareRequirementsParser.VariableContext ctx); - /** - * Visit a parse tree produced by {@link SoftwareRequirementsParser#importance}. - * @param ctx the parse tree - * @return the visitor result - */ - T visitImportance(SoftwareRequirementsParser.ImportanceContext ctx); - /** - * Visit a parse tree produced by {@link SoftwareRequirementsParser#type}. - * @param ctx the parse tree - * @return the visitor result - */ - T visitType(SoftwareRequirementsParser.TypeContext ctx); - /** - * Visit a parse tree produced by {@link SoftwareRequirementsParser#access_modifiers}. - * @param ctx the parse tree - * @return the visitor result - */ - T visitAccess_modifiers(SoftwareRequirementsParser.Access_modifiersContext ctx); - /** - * Visit a parse tree produced by {@link SoftwareRequirementsParser#description}. - * @param ctx the parse tree - * @return the visitor result - */ - T visitDescription(SoftwareRequirementsParser.DescriptionContext ctx); -} \ No newline at end of file diff --git a/src/main/java/org/lumijiez/parser/Winx.interp b/src/main/java/org/lumijiez/parser/Winx.interp new file mode 100644 index 0000000..028d943 --- /dev/null +++ b/src/main/java/org/lumijiez/parser/Winx.interp @@ -0,0 +1,108 @@ +token literal names: +null +'package' +'interface' +'specification' +'implements' +'@' +'result' +'AND' +'OR' +'return' +'[]' +'critical' +'optional' +'INT' +'FLOAT' +'DOUBLE' +'STRING' +'BOOLEAN' +'CHAR' +'VOID' +'public' +'protected' +'private' +'default' +null +null +null +null +null +null +'(' +')' +':' +';' +',' +'{' +'}' +'~' +'!' + +token symbolic names: +null +null +null +null +null +null +null +null +null +null +null +null +null +null +null +null +null +null +null +null +null +null +null +null +ID +STRING +DESCRIPTION +WS +INT +FLOAT +LPAREN +RPAREN +COLON +SEMICOLON +COMMA +LBRACE +RBRACE +TILDE +EXCLAM + +rule names: +winx +body +package +interface +specification +interface_body +specification_body +requirementSpec +req_specification +result_specification +logical_op +functionSpec +functionBody +input_types +return_types +specificationEntry +variable +importance +type +access_modifiers +description + + +atn: +[4, 1, 38, 218, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 2, 14, 7, 14, 2, 15, 7, 15, 2, 16, 7, 16, 2, 17, 7, 17, 2, 18, 7, 18, 2, 19, 7, 19, 2, 20, 7, 20, 1, 0, 1, 0, 4, 0, 45, 8, 0, 11, 0, 12, 0, 46, 1, 1, 1, 1, 1, 1, 4, 1, 52, 8, 1, 11, 1, 12, 1, 53, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 3, 3, 3, 63, 8, 3, 1, 3, 3, 3, 66, 8, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 4, 1, 4, 1, 4, 1, 4, 5, 4, 78, 8, 4, 10, 4, 12, 4, 81, 9, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 5, 1, 5, 4, 5, 89, 8, 5, 11, 5, 12, 5, 90, 1, 6, 1, 6, 4, 6, 95, 8, 6, 11, 6, 12, 6, 96, 1, 7, 3, 7, 100, 8, 7, 1, 7, 3, 7, 103, 8, 7, 1, 7, 1, 7, 1, 7, 5, 7, 108, 8, 7, 10, 7, 12, 7, 111, 9, 7, 1, 7, 5, 7, 114, 8, 7, 10, 7, 12, 7, 117, 9, 7, 1, 7, 1, 7, 1, 8, 3, 8, 122, 8, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 5, 8, 129, 8, 8, 10, 8, 12, 8, 132, 9, 8, 1, 8, 1, 8, 1, 9, 1, 9, 3, 9, 138, 8, 9, 1, 9, 1, 9, 1, 9, 1, 10, 1, 10, 1, 11, 3, 11, 146, 8, 11, 1, 11, 3, 11, 149, 8, 11, 1, 11, 3, 11, 152, 8, 11, 1, 11, 1, 11, 1, 11, 3, 11, 157, 8, 11, 1, 11, 1, 11, 1, 11, 5, 11, 162, 8, 11, 10, 11, 12, 11, 165, 9, 11, 1, 11, 1, 11, 1, 12, 1, 12, 5, 12, 171, 8, 12, 10, 12, 12, 12, 174, 9, 12, 1, 12, 1, 12, 1, 12, 1, 13, 1, 13, 1, 13, 5, 13, 182, 8, 13, 10, 13, 12, 13, 185, 9, 13, 1, 14, 1, 14, 1, 14, 1, 14, 5, 14, 191, 8, 14, 10, 14, 12, 14, 194, 9, 14, 1, 14, 1, 14, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 16, 1, 16, 3, 16, 206, 8, 16, 1, 16, 1, 16, 1, 17, 1, 17, 1, 18, 1, 18, 1, 19, 1, 19, 1, 20, 1, 20, 1, 20, 0, 0, 21, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 0, 4, 1, 0, 7, 8, 1, 0, 11, 12, 1, 0, 13, 19, 1, 0, 20, 23, 224, 0, 44, 1, 0, 0, 0, 2, 51, 1, 0, 0, 0, 4, 55, 1, 0, 0, 0, 6, 62, 1, 0, 0, 0, 8, 73, 1, 0, 0, 0, 10, 88, 1, 0, 0, 0, 12, 94, 1, 0, 0, 0, 14, 99, 1, 0, 0, 0, 16, 121, 1, 0, 0, 0, 18, 135, 1, 0, 0, 0, 20, 142, 1, 0, 0, 0, 22, 145, 1, 0, 0, 0, 24, 168, 1, 0, 0, 0, 26, 178, 1, 0, 0, 0, 28, 186, 1, 0, 0, 0, 30, 197, 1, 0, 0, 0, 32, 203, 1, 0, 0, 0, 34, 209, 1, 0, 0, 0, 36, 211, 1, 0, 0, 0, 38, 213, 1, 0, 0, 0, 40, 215, 1, 0, 0, 0, 42, 45, 3, 4, 2, 0, 43, 45, 5, 26, 0, 0, 44, 42, 1, 0, 0, 0, 44, 43, 1, 0, 0, 0, 45, 46, 1, 0, 0, 0, 46, 44, 1, 0, 0, 0, 46, 47, 1, 0, 0, 0, 47, 1, 1, 0, 0, 0, 48, 52, 3, 6, 3, 0, 49, 52, 3, 8, 4, 0, 50, 52, 5, 26, 0, 0, 51, 48, 1, 0, 0, 0, 51, 49, 1, 0, 0, 0, 51, 50, 1, 0, 0, 0, 52, 53, 1, 0, 0, 0, 53, 51, 1, 0, 0, 0, 53, 54, 1, 0, 0, 0, 54, 3, 1, 0, 0, 0, 55, 56, 5, 1, 0, 0, 56, 57, 5, 24, 0, 0, 57, 58, 5, 35, 0, 0, 58, 59, 3, 2, 1, 0, 59, 60, 5, 36, 0, 0, 60, 5, 1, 0, 0, 0, 61, 63, 3, 34, 17, 0, 62, 61, 1, 0, 0, 0, 62, 63, 1, 0, 0, 0, 63, 65, 1, 0, 0, 0, 64, 66, 3, 38, 19, 0, 65, 64, 1, 0, 0, 0, 65, 66, 1, 0, 0, 0, 66, 67, 1, 0, 0, 0, 67, 68, 5, 2, 0, 0, 68, 69, 5, 24, 0, 0, 69, 70, 5, 35, 0, 0, 70, 71, 3, 10, 5, 0, 71, 72, 5, 36, 0, 0, 72, 7, 1, 0, 0, 0, 73, 74, 5, 3, 0, 0, 74, 79, 5, 24, 0, 0, 75, 76, 5, 4, 0, 0, 76, 78, 5, 24, 0, 0, 77, 75, 1, 0, 0, 0, 78, 81, 1, 0, 0, 0, 79, 77, 1, 0, 0, 0, 79, 80, 1, 0, 0, 0, 80, 82, 1, 0, 0, 0, 81, 79, 1, 0, 0, 0, 82, 83, 5, 35, 0, 0, 83, 84, 3, 12, 6, 0, 84, 85, 5, 36, 0, 0, 85, 9, 1, 0, 0, 0, 86, 89, 3, 14, 7, 0, 87, 89, 3, 22, 11, 0, 88, 86, 1, 0, 0, 0, 88, 87, 1, 0, 0, 0, 89, 90, 1, 0, 0, 0, 90, 88, 1, 0, 0, 0, 90, 91, 1, 0, 0, 0, 91, 11, 1, 0, 0, 0, 92, 95, 3, 14, 7, 0, 93, 95, 3, 22, 11, 0, 94, 92, 1, 0, 0, 0, 94, 93, 1, 0, 0, 0, 95, 96, 1, 0, 0, 0, 96, 94, 1, 0, 0, 0, 96, 97, 1, 0, 0, 0, 97, 13, 1, 0, 0, 0, 98, 100, 3, 40, 20, 0, 99, 98, 1, 0, 0, 0, 99, 100, 1, 0, 0, 0, 100, 102, 1, 0, 0, 0, 101, 103, 3, 34, 17, 0, 102, 101, 1, 0, 0, 0, 102, 103, 1, 0, 0, 0, 103, 104, 1, 0, 0, 0, 104, 105, 5, 24, 0, 0, 105, 109, 5, 35, 0, 0, 106, 108, 3, 16, 8, 0, 107, 106, 1, 0, 0, 0, 108, 111, 1, 0, 0, 0, 109, 107, 1, 0, 0, 0, 109, 110, 1, 0, 0, 0, 110, 115, 1, 0, 0, 0, 111, 109, 1, 0, 0, 0, 112, 114, 3, 18, 9, 0, 113, 112, 1, 0, 0, 0, 114, 117, 1, 0, 0, 0, 115, 113, 1, 0, 0, 0, 115, 116, 1, 0, 0, 0, 116, 118, 1, 0, 0, 0, 117, 115, 1, 0, 0, 0, 118, 119, 5, 36, 0, 0, 119, 15, 1, 0, 0, 0, 120, 122, 3, 34, 17, 0, 121, 120, 1, 0, 0, 0, 121, 122, 1, 0, 0, 0, 122, 123, 1, 0, 0, 0, 123, 124, 5, 5, 0, 0, 124, 130, 5, 24, 0, 0, 125, 126, 3, 20, 10, 0, 126, 127, 5, 24, 0, 0, 127, 129, 1, 0, 0, 0, 128, 125, 1, 0, 0, 0, 129, 132, 1, 0, 0, 0, 130, 128, 1, 0, 0, 0, 130, 131, 1, 0, 0, 0, 131, 133, 1, 0, 0, 0, 132, 130, 1, 0, 0, 0, 133, 134, 5, 33, 0, 0, 134, 17, 1, 0, 0, 0, 135, 137, 5, 6, 0, 0, 136, 138, 3, 34, 17, 0, 137, 136, 1, 0, 0, 0, 137, 138, 1, 0, 0, 0, 138, 139, 1, 0, 0, 0, 139, 140, 5, 24, 0, 0, 140, 141, 5, 33, 0, 0, 141, 19, 1, 0, 0, 0, 142, 143, 7, 0, 0, 0, 143, 21, 1, 0, 0, 0, 144, 146, 3, 40, 20, 0, 145, 144, 1, 0, 0, 0, 145, 146, 1, 0, 0, 0, 146, 148, 1, 0, 0, 0, 147, 149, 3, 34, 17, 0, 148, 147, 1, 0, 0, 0, 148, 149, 1, 0, 0, 0, 149, 151, 1, 0, 0, 0, 150, 152, 3, 38, 19, 0, 151, 150, 1, 0, 0, 0, 151, 152, 1, 0, 0, 0, 152, 153, 1, 0, 0, 0, 153, 154, 5, 24, 0, 0, 154, 156, 5, 30, 0, 0, 155, 157, 3, 26, 13, 0, 156, 155, 1, 0, 0, 0, 156, 157, 1, 0, 0, 0, 157, 158, 1, 0, 0, 0, 158, 163, 5, 31, 0, 0, 159, 160, 5, 4, 0, 0, 160, 162, 5, 24, 0, 0, 161, 159, 1, 0, 0, 0, 162, 165, 1, 0, 0, 0, 163, 161, 1, 0, 0, 0, 163, 164, 1, 0, 0, 0, 164, 166, 1, 0, 0, 0, 165, 163, 1, 0, 0, 0, 166, 167, 3, 24, 12, 0, 167, 23, 1, 0, 0, 0, 168, 172, 5, 35, 0, 0, 169, 171, 3, 30, 15, 0, 170, 169, 1, 0, 0, 0, 171, 174, 1, 0, 0, 0, 172, 170, 1, 0, 0, 0, 172, 173, 1, 0, 0, 0, 173, 175, 1, 0, 0, 0, 174, 172, 1, 0, 0, 0, 175, 176, 3, 28, 14, 0, 176, 177, 5, 36, 0, 0, 177, 25, 1, 0, 0, 0, 178, 183, 3, 32, 16, 0, 179, 180, 5, 34, 0, 0, 180, 182, 3, 32, 16, 0, 181, 179, 1, 0, 0, 0, 182, 185, 1, 0, 0, 0, 183, 181, 1, 0, 0, 0, 183, 184, 1, 0, 0, 0, 184, 27, 1, 0, 0, 0, 185, 183, 1, 0, 0, 0, 186, 187, 5, 9, 0, 0, 187, 192, 3, 32, 16, 0, 188, 189, 5, 34, 0, 0, 189, 191, 3, 32, 16, 0, 190, 188, 1, 0, 0, 0, 191, 194, 1, 0, 0, 0, 192, 190, 1, 0, 0, 0, 192, 193, 1, 0, 0, 0, 193, 195, 1, 0, 0, 0, 194, 192, 1, 0, 0, 0, 195, 196, 5, 33, 0, 0, 196, 29, 1, 0, 0, 0, 197, 198, 5, 5, 0, 0, 198, 199, 5, 24, 0, 0, 199, 200, 5, 32, 0, 0, 200, 201, 5, 25, 0, 0, 201, 202, 5, 33, 0, 0, 202, 31, 1, 0, 0, 0, 203, 205, 3, 36, 18, 0, 204, 206, 5, 10, 0, 0, 205, 204, 1, 0, 0, 0, 205, 206, 1, 0, 0, 0, 206, 207, 1, 0, 0, 0, 207, 208, 5, 24, 0, 0, 208, 33, 1, 0, 0, 0, 209, 210, 7, 1, 0, 0, 210, 35, 1, 0, 0, 0, 211, 212, 7, 2, 0, 0, 212, 37, 1, 0, 0, 0, 213, 214, 7, 3, 0, 0, 214, 39, 1, 0, 0, 0, 215, 216, 5, 26, 0, 0, 216, 41, 1, 0, 0, 0, 27, 44, 46, 51, 53, 62, 65, 79, 88, 90, 94, 96, 99, 102, 109, 115, 121, 130, 137, 145, 148, 151, 156, 163, 172, 183, 192, 205] \ No newline at end of file diff --git a/src/main/java/org/lumijiez/parser/Winx.tokens b/src/main/java/org/lumijiez/parser/Winx.tokens new file mode 100644 index 0000000..217c3c6 --- /dev/null +++ b/src/main/java/org/lumijiez/parser/Winx.tokens @@ -0,0 +1,70 @@ +T__0=1 +T__1=2 +T__2=3 +T__3=4 +T__4=5 +T__5=6 +T__6=7 +T__7=8 +T__8=9 +T__9=10 +T__10=11 +T__11=12 +T__12=13 +T__13=14 +T__14=15 +T__15=16 +T__16=17 +T__17=18 +T__18=19 +T__19=20 +T__20=21 +T__21=22 +T__22=23 +ID=24 +STRING=25 +DESCRIPTION=26 +WS=27 +INT=28 +FLOAT=29 +LPAREN=30 +RPAREN=31 +COLON=32 +SEMICOLON=33 +COMMA=34 +LBRACE=35 +RBRACE=36 +TILDE=37 +EXCLAM=38 +'package'=1 +'interface'=2 +'specification'=3 +'implements'=4 +'@'=5 +'result'=6 +'AND'=7 +'OR'=8 +'return'=9 +'[]'=10 +'critical'=11 +'optional'=12 +'INT'=13 +'FLOAT'=14 +'DOUBLE'=15 +'STRING'=16 +'BOOLEAN'=17 +'CHAR'=18 +'VOID'=19 +'public'=20 +'protected'=21 +'private'=22 +'default'=23 +'('=30 +')'=31 +':'=32 +';'=33 +','=34 +'{'=35 +'}'=36 +'~'=37 +'!'=38 diff --git a/src/main/java/org/lumijiez/parser/SoftwareRequirementsBaseListener.java b/src/main/java/org/lumijiez/parser/WinxBaseListener.java similarity index 52% rename from src/main/java/org/lumijiez/parser/SoftwareRequirementsBaseListener.java rename to src/main/java/org/lumijiez/parser/WinxBaseListener.java index 05de305..1e726d8 100644 --- a/src/main/java/org/lumijiez/parser/SoftwareRequirementsBaseListener.java +++ b/src/main/java/org/lumijiez/parser/WinxBaseListener.java @@ -1,4 +1,4 @@ -// Generated from D:/Source/JavaProjects/dsl-formal-requirements/src/grammars/SoftwareRequirements.g4 by ANTLR 4.13.1 +// Generated from D:/Source/JavaProjects/dsl-formal-requirements/src/grammars/Winx.g4 by ANTLR 4.13.1 package org.lumijiez.parser; import org.antlr.v4.runtime.ParserRuleContext; @@ -6,240 +6,264 @@ import org.antlr.v4.runtime.tree.ErrorNode; import org.antlr.v4.runtime.tree.TerminalNode; /** - * This class provides an empty implementation of {@link SoftwareRequirementsListener}, + * This class provides an empty implementation of {@link WinxListener}, * which can be extended to create a listener which only needs to handle a subset * of the available methods. */ @SuppressWarnings("CheckReturnValue") -public class SoftwareRequirementsBaseListener implements SoftwareRequirementsListener { +public class WinxBaseListener implements WinxListener { /** * {@inheritDoc} * *

The default implementation does nothing.

*/ - @Override public void enterProgram(SoftwareRequirementsParser.ProgramContext ctx) { } + @Override public void enterWinx(WinxParser.WinxContext ctx) { } /** * {@inheritDoc} * *

The default implementation does nothing.

*/ - @Override public void exitProgram(SoftwareRequirementsParser.ProgramContext ctx) { } + @Override public void exitWinx(WinxParser.WinxContext ctx) { } /** * {@inheritDoc} * *

The default implementation does nothing.

*/ - @Override public void enterProgram_body(SoftwareRequirementsParser.Program_bodyContext ctx) { } + @Override public void enterBody(WinxParser.BodyContext ctx) { } /** * {@inheritDoc} * *

The default implementation does nothing.

*/ - @Override public void exitProgram_body(SoftwareRequirementsParser.Program_bodyContext ctx) { } + @Override public void exitBody(WinxParser.BodyContext ctx) { } /** * {@inheritDoc} * *

The default implementation does nothing.

*/ - @Override public void enterRequirementSpec(SoftwareRequirementsParser.RequirementSpecContext ctx) { } + @Override public void enterPackage(WinxParser.PackageContext ctx) { } /** * {@inheritDoc} * *

The default implementation does nothing.

*/ - @Override public void exitRequirementSpec(SoftwareRequirementsParser.RequirementSpecContext ctx) { } + @Override public void exitPackage(WinxParser.PackageContext ctx) { } /** * {@inheritDoc} * *

The default implementation does nothing.

*/ - @Override public void enterReq_specification(SoftwareRequirementsParser.Req_specificationContext ctx) { } + @Override public void enterInterface(WinxParser.InterfaceContext ctx) { } /** * {@inheritDoc} * *

The default implementation does nothing.

*/ - @Override public void exitReq_specification(SoftwareRequirementsParser.Req_specificationContext ctx) { } + @Override public void exitInterface(WinxParser.InterfaceContext ctx) { } /** * {@inheritDoc} * *

The default implementation does nothing.

*/ - @Override public void enterResult_specification(SoftwareRequirementsParser.Result_specificationContext ctx) { } + @Override public void enterSpecification(WinxParser.SpecificationContext ctx) { } /** * {@inheritDoc} * *

The default implementation does nothing.

*/ - @Override public void exitResult_specification(SoftwareRequirementsParser.Result_specificationContext ctx) { } + @Override public void exitSpecification(WinxParser.SpecificationContext ctx) { } /** * {@inheritDoc} * *

The default implementation does nothing.

*/ - @Override public void enterPredicate(SoftwareRequirementsParser.PredicateContext ctx) { } + @Override public void enterInterface_body(WinxParser.Interface_bodyContext ctx) { } /** * {@inheritDoc} * *

The default implementation does nothing.

*/ - @Override public void exitPredicate(SoftwareRequirementsParser.PredicateContext ctx) { } + @Override public void exitInterface_body(WinxParser.Interface_bodyContext ctx) { } /** * {@inheritDoc} * *

The default implementation does nothing.

*/ - @Override public void enterExpression(SoftwareRequirementsParser.ExpressionContext ctx) { } + @Override public void enterSpecification_body(WinxParser.Specification_bodyContext ctx) { } /** * {@inheritDoc} * *

The default implementation does nothing.

*/ - @Override public void exitExpression(SoftwareRequirementsParser.ExpressionContext ctx) { } + @Override public void exitSpecification_body(WinxParser.Specification_bodyContext ctx) { } /** * {@inheritDoc} * *

The default implementation does nothing.

*/ - @Override public void enterTerm(SoftwareRequirementsParser.TermContext ctx) { } + @Override public void enterRequirementSpec(WinxParser.RequirementSpecContext ctx) { } /** * {@inheritDoc} * *

The default implementation does nothing.

*/ - @Override public void exitTerm(SoftwareRequirementsParser.TermContext ctx) { } + @Override public void exitRequirementSpec(WinxParser.RequirementSpecContext ctx) { } /** * {@inheritDoc} * *

The default implementation does nothing.

*/ - @Override public void enterLogical_op(SoftwareRequirementsParser.Logical_opContext ctx) { } + @Override public void enterReq_specification(WinxParser.Req_specificationContext ctx) { } /** * {@inheritDoc} * *

The default implementation does nothing.

*/ - @Override public void exitLogical_op(SoftwareRequirementsParser.Logical_opContext ctx) { } + @Override public void exitReq_specification(WinxParser.Req_specificationContext ctx) { } /** * {@inheritDoc} * *

The default implementation does nothing.

*/ - @Override public void enterFunctionSpec(SoftwareRequirementsParser.FunctionSpecContext ctx) { } + @Override public void enterResult_specification(WinxParser.Result_specificationContext ctx) { } /** * {@inheritDoc} * *

The default implementation does nothing.

*/ - @Override public void exitFunctionSpec(SoftwareRequirementsParser.FunctionSpecContext ctx) { } + @Override public void exitResult_specification(WinxParser.Result_specificationContext ctx) { } /** * {@inheritDoc} * *

The default implementation does nothing.

*/ - @Override public void enterFunctionBody(SoftwareRequirementsParser.FunctionBodyContext ctx) { } + @Override public void enterLogical_op(WinxParser.Logical_opContext ctx) { } /** * {@inheritDoc} * *

The default implementation does nothing.

*/ - @Override public void exitFunctionBody(SoftwareRequirementsParser.FunctionBodyContext ctx) { } + @Override public void exitLogical_op(WinxParser.Logical_opContext ctx) { } /** * {@inheritDoc} * *

The default implementation does nothing.

*/ - @Override public void enterInput_types(SoftwareRequirementsParser.Input_typesContext ctx) { } + @Override public void enterFunctionSpec(WinxParser.FunctionSpecContext ctx) { } /** * {@inheritDoc} * *

The default implementation does nothing.

*/ - @Override public void exitInput_types(SoftwareRequirementsParser.Input_typesContext ctx) { } + @Override public void exitFunctionSpec(WinxParser.FunctionSpecContext ctx) { } /** * {@inheritDoc} * *

The default implementation does nothing.

*/ - @Override public void enterReturn_types(SoftwareRequirementsParser.Return_typesContext ctx) { } + @Override public void enterFunctionBody(WinxParser.FunctionBodyContext ctx) { } /** * {@inheritDoc} * *

The default implementation does nothing.

*/ - @Override public void exitReturn_types(SoftwareRequirementsParser.Return_typesContext ctx) { } + @Override public void exitFunctionBody(WinxParser.FunctionBodyContext ctx) { } /** * {@inheritDoc} * *

The default implementation does nothing.

*/ - @Override public void enterSpecification(SoftwareRequirementsParser.SpecificationContext ctx) { } + @Override public void enterInput_types(WinxParser.Input_typesContext ctx) { } /** * {@inheritDoc} * *

The default implementation does nothing.

*/ - @Override public void exitSpecification(SoftwareRequirementsParser.SpecificationContext ctx) { } + @Override public void exitInput_types(WinxParser.Input_typesContext ctx) { } /** * {@inheritDoc} * *

The default implementation does nothing.

*/ - @Override public void enterVariable(SoftwareRequirementsParser.VariableContext ctx) { } + @Override public void enterReturn_types(WinxParser.Return_typesContext ctx) { } /** * {@inheritDoc} * *

The default implementation does nothing.

*/ - @Override public void exitVariable(SoftwareRequirementsParser.VariableContext ctx) { } + @Override public void exitReturn_types(WinxParser.Return_typesContext ctx) { } /** * {@inheritDoc} * *

The default implementation does nothing.

*/ - @Override public void enterImportance(SoftwareRequirementsParser.ImportanceContext ctx) { } + @Override public void enterSpecificationEntry(WinxParser.SpecificationEntryContext ctx) { } /** * {@inheritDoc} * *

The default implementation does nothing.

*/ - @Override public void exitImportance(SoftwareRequirementsParser.ImportanceContext ctx) { } + @Override public void exitSpecificationEntry(WinxParser.SpecificationEntryContext ctx) { } /** * {@inheritDoc} * *

The default implementation does nothing.

*/ - @Override public void enterType(SoftwareRequirementsParser.TypeContext ctx) { } + @Override public void enterVariable(WinxParser.VariableContext ctx) { } /** * {@inheritDoc} * *

The default implementation does nothing.

*/ - @Override public void exitType(SoftwareRequirementsParser.TypeContext ctx) { } + @Override public void exitVariable(WinxParser.VariableContext ctx) { } /** * {@inheritDoc} * *

The default implementation does nothing.

*/ - @Override public void enterAccess_modifiers(SoftwareRequirementsParser.Access_modifiersContext ctx) { } + @Override public void enterImportance(WinxParser.ImportanceContext ctx) { } /** * {@inheritDoc} * *

The default implementation does nothing.

*/ - @Override public void exitAccess_modifiers(SoftwareRequirementsParser.Access_modifiersContext ctx) { } + @Override public void exitImportance(WinxParser.ImportanceContext ctx) { } /** * {@inheritDoc} * *

The default implementation does nothing.

*/ - @Override public void enterDescription(SoftwareRequirementsParser.DescriptionContext ctx) { } + @Override public void enterType(WinxParser.TypeContext ctx) { } /** * {@inheritDoc} * *

The default implementation does nothing.

*/ - @Override public void exitDescription(SoftwareRequirementsParser.DescriptionContext ctx) { } + @Override public void exitType(WinxParser.TypeContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterAccess_modifiers(WinxParser.Access_modifiersContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitAccess_modifiers(WinxParser.Access_modifiersContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterDescription(WinxParser.DescriptionContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitDescription(WinxParser.DescriptionContext ctx) { } /** * {@inheritDoc} diff --git a/src/main/java/org/lumijiez/parser/SoftwareRequirementsBaseVisitor.java b/src/main/java/org/lumijiez/parser/WinxBaseVisitor.java similarity index 55% rename from src/main/java/org/lumijiez/parser/SoftwareRequirementsBaseVisitor.java rename to src/main/java/org/lumijiez/parser/WinxBaseVisitor.java index 0a27449..4fa9abc 100644 --- a/src/main/java/org/lumijiez/parser/SoftwareRequirementsBaseVisitor.java +++ b/src/main/java/org/lumijiez/parser/WinxBaseVisitor.java @@ -1,9 +1,9 @@ -// Generated from D:/Source/JavaProjects/dsl-formal-requirements/src/grammars/SoftwareRequirements.g4 by ANTLR 4.13.1 +// Generated from D:/Source/JavaProjects/dsl-formal-requirements/src/grammars/Winx.g4 by ANTLR 4.13.1 package org.lumijiez.parser; import org.antlr.v4.runtime.tree.AbstractParseTreeVisitor; /** - * This class provides an empty implementation of {@link SoftwareRequirementsVisitor}, + * This class provides an empty implementation of {@link WinxVisitor}, * which can be extended to create a visitor which only needs to handle a subset * of the available methods. * @@ -11,138 +11,152 @@ import org.antlr.v4.runtime.tree.AbstractParseTreeVisitor; * operations with no return type. */ @SuppressWarnings("CheckReturnValue") -public class SoftwareRequirementsBaseVisitor extends AbstractParseTreeVisitor implements SoftwareRequirementsVisitor { +public class WinxBaseVisitor extends AbstractParseTreeVisitor implements WinxVisitor { /** * {@inheritDoc} * *

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

*/ - @Override public T visitProgram(SoftwareRequirementsParser.ProgramContext ctx) { return visitChildren(ctx); } + @Override public T visitWinx(WinxParser.WinxContext ctx) { return visitChildren(ctx); } /** * {@inheritDoc} * *

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

*/ - @Override public T visitProgram_body(SoftwareRequirementsParser.Program_bodyContext ctx) { return visitChildren(ctx); } + @Override public T visitBody(WinxParser.BodyContext ctx) { return visitChildren(ctx); } /** * {@inheritDoc} * *

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

*/ - @Override public T visitRequirementSpec(SoftwareRequirementsParser.RequirementSpecContext ctx) { return visitChildren(ctx); } + @Override public T visitPackage(WinxParser.PackageContext ctx) { return visitChildren(ctx); } /** * {@inheritDoc} * *

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

*/ - @Override public T visitReq_specification(SoftwareRequirementsParser.Req_specificationContext ctx) { return visitChildren(ctx); } + @Override public T visitInterface(WinxParser.InterfaceContext ctx) { return visitChildren(ctx); } /** * {@inheritDoc} * *

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

*/ - @Override public T visitResult_specification(SoftwareRequirementsParser.Result_specificationContext ctx) { return visitChildren(ctx); } + @Override public T visitSpecification(WinxParser.SpecificationContext ctx) { return visitChildren(ctx); } /** * {@inheritDoc} * *

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

*/ - @Override public T visitPredicate(SoftwareRequirementsParser.PredicateContext ctx) { return visitChildren(ctx); } + @Override public T visitInterface_body(WinxParser.Interface_bodyContext ctx) { return visitChildren(ctx); } /** * {@inheritDoc} * *

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

*/ - @Override public T visitExpression(SoftwareRequirementsParser.ExpressionContext ctx) { return visitChildren(ctx); } + @Override public T visitSpecification_body(WinxParser.Specification_bodyContext ctx) { return visitChildren(ctx); } /** * {@inheritDoc} * *

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

*/ - @Override public T visitTerm(SoftwareRequirementsParser.TermContext ctx) { return visitChildren(ctx); } + @Override public T visitRequirementSpec(WinxParser.RequirementSpecContext ctx) { return visitChildren(ctx); } /** * {@inheritDoc} * *

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

*/ - @Override public T visitLogical_op(SoftwareRequirementsParser.Logical_opContext ctx) { return visitChildren(ctx); } + @Override public T visitReq_specification(WinxParser.Req_specificationContext ctx) { return visitChildren(ctx); } /** * {@inheritDoc} * *

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

*/ - @Override public T visitFunctionSpec(SoftwareRequirementsParser.FunctionSpecContext ctx) { return visitChildren(ctx); } + @Override public T visitResult_specification(WinxParser.Result_specificationContext ctx) { return visitChildren(ctx); } /** * {@inheritDoc} * *

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

*/ - @Override public T visitFunctionBody(SoftwareRequirementsParser.FunctionBodyContext ctx) { return visitChildren(ctx); } + @Override public T visitLogical_op(WinxParser.Logical_opContext ctx) { return visitChildren(ctx); } /** * {@inheritDoc} * *

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

*/ - @Override public T visitInput_types(SoftwareRequirementsParser.Input_typesContext ctx) { return visitChildren(ctx); } + @Override public T visitFunctionSpec(WinxParser.FunctionSpecContext ctx) { return visitChildren(ctx); } /** * {@inheritDoc} * *

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

*/ - @Override public T visitReturn_types(SoftwareRequirementsParser.Return_typesContext ctx) { return visitChildren(ctx); } + @Override public T visitFunctionBody(WinxParser.FunctionBodyContext ctx) { return visitChildren(ctx); } /** * {@inheritDoc} * *

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

*/ - @Override public T visitSpecification(SoftwareRequirementsParser.SpecificationContext ctx) { return visitChildren(ctx); } + @Override public T visitInput_types(WinxParser.Input_typesContext ctx) { return visitChildren(ctx); } /** * {@inheritDoc} * *

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

*/ - @Override public T visitVariable(SoftwareRequirementsParser.VariableContext ctx) { return visitChildren(ctx); } + @Override public T visitReturn_types(WinxParser.Return_typesContext ctx) { return visitChildren(ctx); } /** * {@inheritDoc} * *

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

*/ - @Override public T visitImportance(SoftwareRequirementsParser.ImportanceContext ctx) { return visitChildren(ctx); } + @Override public T visitSpecificationEntry(WinxParser.SpecificationEntryContext ctx) { return visitChildren(ctx); } /** * {@inheritDoc} * *

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

*/ - @Override public T visitType(SoftwareRequirementsParser.TypeContext ctx) { return visitChildren(ctx); } + @Override public T visitVariable(WinxParser.VariableContext ctx) { return visitChildren(ctx); } /** * {@inheritDoc} * *

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

*/ - @Override public T visitAccess_modifiers(SoftwareRequirementsParser.Access_modifiersContext ctx) { return visitChildren(ctx); } + @Override public T visitImportance(WinxParser.ImportanceContext ctx) { return visitChildren(ctx); } /** * {@inheritDoc} * *

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

*/ - @Override public T visitDescription(SoftwareRequirementsParser.DescriptionContext ctx) { return visitChildren(ctx); } + @Override public T visitType(WinxParser.TypeContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

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

+ */ + @Override public T visitAccess_modifiers(WinxParser.Access_modifiersContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

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

+ */ + @Override public T visitDescription(WinxParser.DescriptionContext ctx) { return visitChildren(ctx); } } \ No newline at end of file diff --git a/src/main/java/org/lumijiez/parser/WinxLexer.interp b/src/main/java/org/lumijiez/parser/WinxLexer.interp new file mode 100644 index 0000000..a548240 --- /dev/null +++ b/src/main/java/org/lumijiez/parser/WinxLexer.interp @@ -0,0 +1,131 @@ +token literal names: +null +'package' +'interface' +'specification' +'implements' +'@' +'result' +'AND' +'OR' +'return' +'[]' +'critical' +'optional' +'INT' +'FLOAT' +'DOUBLE' +'STRING' +'BOOLEAN' +'CHAR' +'VOID' +'public' +'protected' +'private' +'default' +null +null +null +null +null +null +'(' +')' +':' +';' +',' +'{' +'}' +'~' +'!' + +token symbolic names: +null +null +null +null +null +null +null +null +null +null +null +null +null +null +null +null +null +null +null +null +null +null +null +null +ID +STRING +DESCRIPTION +WS +INT +FLOAT +LPAREN +RPAREN +COLON +SEMICOLON +COMMA +LBRACE +RBRACE +TILDE +EXCLAM + +rule names: +T__0 +T__1 +T__2 +T__3 +T__4 +T__5 +T__6 +T__7 +T__8 +T__9 +T__10 +T__11 +T__12 +T__13 +T__14 +T__15 +T__16 +T__17 +T__18 +T__19 +T__20 +T__21 +T__22 +ID +STRING +DESCRIPTION +WS +INT +FLOAT +LPAREN +RPAREN +COLON +SEMICOLON +COMMA +LBRACE +RBRACE +TILDE +EXCLAM + +channel names: +DEFAULT_TOKEN_CHANNEL +HIDDEN + +mode names: +DEFAULT_MODE + +atn: +[4, 0, 38, 312, 6, -1, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 2, 14, 7, 14, 2, 15, 7, 15, 2, 16, 7, 16, 2, 17, 7, 17, 2, 18, 7, 18, 2, 19, 7, 19, 2, 20, 7, 20, 2, 21, 7, 21, 2, 22, 7, 22, 2, 23, 7, 23, 2, 24, 7, 24, 2, 25, 7, 25, 2, 26, 7, 26, 2, 27, 7, 27, 2, 28, 7, 28, 2, 29, 7, 29, 2, 30, 7, 30, 2, 31, 7, 31, 2, 32, 7, 32, 2, 33, 7, 33, 2, 34, 7, 34, 2, 35, 7, 35, 2, 36, 7, 36, 2, 37, 7, 37, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 4, 1, 4, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 6, 1, 6, 1, 6, 1, 6, 1, 7, 1, 7, 1, 7, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 9, 1, 9, 1, 9, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 12, 1, 12, 1, 12, 1, 12, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 21, 1, 21, 1, 21, 1, 21, 1, 21, 1, 21, 1, 21, 1, 21, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 23, 4, 23, 241, 8, 23, 11, 23, 12, 23, 242, 1, 24, 1, 24, 5, 24, 247, 8, 24, 10, 24, 12, 24, 250, 9, 24, 1, 24, 1, 24, 1, 25, 1, 25, 5, 25, 256, 8, 25, 10, 25, 12, 25, 259, 9, 25, 1, 25, 1, 25, 1, 26, 4, 26, 264, 8, 26, 11, 26, 12, 26, 265, 1, 26, 1, 26, 1, 27, 4, 27, 271, 8, 27, 11, 27, 12, 27, 272, 1, 28, 4, 28, 276, 8, 28, 11, 28, 12, 28, 277, 1, 28, 1, 28, 5, 28, 282, 8, 28, 10, 28, 12, 28, 285, 9, 28, 1, 28, 1, 28, 4, 28, 289, 8, 28, 11, 28, 12, 28, 290, 3, 28, 293, 8, 28, 1, 29, 1, 29, 1, 30, 1, 30, 1, 31, 1, 31, 1, 32, 1, 32, 1, 33, 1, 33, 1, 34, 1, 34, 1, 35, 1, 35, 1, 36, 1, 36, 1, 37, 1, 37, 1, 257, 0, 38, 1, 1, 3, 2, 5, 3, 7, 4, 9, 5, 11, 6, 13, 7, 15, 8, 17, 9, 19, 10, 21, 11, 23, 12, 25, 13, 27, 14, 29, 15, 31, 16, 33, 17, 35, 18, 37, 19, 39, 20, 41, 21, 43, 22, 45, 23, 47, 24, 49, 25, 51, 26, 53, 27, 55, 28, 57, 29, 59, 30, 61, 31, 63, 32, 65, 33, 67, 34, 69, 35, 71, 36, 73, 37, 75, 38, 1, 0, 5, 2, 0, 65, 90, 97, 122, 1, 0, 34, 34, 1, 0, 126, 126, 3, 0, 9, 10, 13, 13, 32, 32, 1, 0, 48, 57, 320, 0, 1, 1, 0, 0, 0, 0, 3, 1, 0, 0, 0, 0, 5, 1, 0, 0, 0, 0, 7, 1, 0, 0, 0, 0, 9, 1, 0, 0, 0, 0, 11, 1, 0, 0, 0, 0, 13, 1, 0, 0, 0, 0, 15, 1, 0, 0, 0, 0, 17, 1, 0, 0, 0, 0, 19, 1, 0, 0, 0, 0, 21, 1, 0, 0, 0, 0, 23, 1, 0, 0, 0, 0, 25, 1, 0, 0, 0, 0, 27, 1, 0, 0, 0, 0, 29, 1, 0, 0, 0, 0, 31, 1, 0, 0, 0, 0, 33, 1, 0, 0, 0, 0, 35, 1, 0, 0, 0, 0, 37, 1, 0, 0, 0, 0, 39, 1, 0, 0, 0, 0, 41, 1, 0, 0, 0, 0, 43, 1, 0, 0, 0, 0, 45, 1, 0, 0, 0, 0, 47, 1, 0, 0, 0, 0, 49, 1, 0, 0, 0, 0, 51, 1, 0, 0, 0, 0, 53, 1, 0, 0, 0, 0, 55, 1, 0, 0, 0, 0, 57, 1, 0, 0, 0, 0, 59, 1, 0, 0, 0, 0, 61, 1, 0, 0, 0, 0, 63, 1, 0, 0, 0, 0, 65, 1, 0, 0, 0, 0, 67, 1, 0, 0, 0, 0, 69, 1, 0, 0, 0, 0, 71, 1, 0, 0, 0, 0, 73, 1, 0, 0, 0, 0, 75, 1, 0, 0, 0, 1, 77, 1, 0, 0, 0, 3, 85, 1, 0, 0, 0, 5, 95, 1, 0, 0, 0, 7, 109, 1, 0, 0, 0, 9, 120, 1, 0, 0, 0, 11, 122, 1, 0, 0, 0, 13, 129, 1, 0, 0, 0, 15, 133, 1, 0, 0, 0, 17, 136, 1, 0, 0, 0, 19, 143, 1, 0, 0, 0, 21, 146, 1, 0, 0, 0, 23, 155, 1, 0, 0, 0, 25, 164, 1, 0, 0, 0, 27, 168, 1, 0, 0, 0, 29, 174, 1, 0, 0, 0, 31, 181, 1, 0, 0, 0, 33, 188, 1, 0, 0, 0, 35, 196, 1, 0, 0, 0, 37, 201, 1, 0, 0, 0, 39, 206, 1, 0, 0, 0, 41, 213, 1, 0, 0, 0, 43, 223, 1, 0, 0, 0, 45, 231, 1, 0, 0, 0, 47, 240, 1, 0, 0, 0, 49, 244, 1, 0, 0, 0, 51, 253, 1, 0, 0, 0, 53, 263, 1, 0, 0, 0, 55, 270, 1, 0, 0, 0, 57, 292, 1, 0, 0, 0, 59, 294, 1, 0, 0, 0, 61, 296, 1, 0, 0, 0, 63, 298, 1, 0, 0, 0, 65, 300, 1, 0, 0, 0, 67, 302, 1, 0, 0, 0, 69, 304, 1, 0, 0, 0, 71, 306, 1, 0, 0, 0, 73, 308, 1, 0, 0, 0, 75, 310, 1, 0, 0, 0, 77, 78, 5, 112, 0, 0, 78, 79, 5, 97, 0, 0, 79, 80, 5, 99, 0, 0, 80, 81, 5, 107, 0, 0, 81, 82, 5, 97, 0, 0, 82, 83, 5, 103, 0, 0, 83, 84, 5, 101, 0, 0, 84, 2, 1, 0, 0, 0, 85, 86, 5, 105, 0, 0, 86, 87, 5, 110, 0, 0, 87, 88, 5, 116, 0, 0, 88, 89, 5, 101, 0, 0, 89, 90, 5, 114, 0, 0, 90, 91, 5, 102, 0, 0, 91, 92, 5, 97, 0, 0, 92, 93, 5, 99, 0, 0, 93, 94, 5, 101, 0, 0, 94, 4, 1, 0, 0, 0, 95, 96, 5, 115, 0, 0, 96, 97, 5, 112, 0, 0, 97, 98, 5, 101, 0, 0, 98, 99, 5, 99, 0, 0, 99, 100, 5, 105, 0, 0, 100, 101, 5, 102, 0, 0, 101, 102, 5, 105, 0, 0, 102, 103, 5, 99, 0, 0, 103, 104, 5, 97, 0, 0, 104, 105, 5, 116, 0, 0, 105, 106, 5, 105, 0, 0, 106, 107, 5, 111, 0, 0, 107, 108, 5, 110, 0, 0, 108, 6, 1, 0, 0, 0, 109, 110, 5, 105, 0, 0, 110, 111, 5, 109, 0, 0, 111, 112, 5, 112, 0, 0, 112, 113, 5, 108, 0, 0, 113, 114, 5, 101, 0, 0, 114, 115, 5, 109, 0, 0, 115, 116, 5, 101, 0, 0, 116, 117, 5, 110, 0, 0, 117, 118, 5, 116, 0, 0, 118, 119, 5, 115, 0, 0, 119, 8, 1, 0, 0, 0, 120, 121, 5, 64, 0, 0, 121, 10, 1, 0, 0, 0, 122, 123, 5, 114, 0, 0, 123, 124, 5, 101, 0, 0, 124, 125, 5, 115, 0, 0, 125, 126, 5, 117, 0, 0, 126, 127, 5, 108, 0, 0, 127, 128, 5, 116, 0, 0, 128, 12, 1, 0, 0, 0, 129, 130, 5, 65, 0, 0, 130, 131, 5, 78, 0, 0, 131, 132, 5, 68, 0, 0, 132, 14, 1, 0, 0, 0, 133, 134, 5, 79, 0, 0, 134, 135, 5, 82, 0, 0, 135, 16, 1, 0, 0, 0, 136, 137, 5, 114, 0, 0, 137, 138, 5, 101, 0, 0, 138, 139, 5, 116, 0, 0, 139, 140, 5, 117, 0, 0, 140, 141, 5, 114, 0, 0, 141, 142, 5, 110, 0, 0, 142, 18, 1, 0, 0, 0, 143, 144, 5, 91, 0, 0, 144, 145, 5, 93, 0, 0, 145, 20, 1, 0, 0, 0, 146, 147, 5, 99, 0, 0, 147, 148, 5, 114, 0, 0, 148, 149, 5, 105, 0, 0, 149, 150, 5, 116, 0, 0, 150, 151, 5, 105, 0, 0, 151, 152, 5, 99, 0, 0, 152, 153, 5, 97, 0, 0, 153, 154, 5, 108, 0, 0, 154, 22, 1, 0, 0, 0, 155, 156, 5, 111, 0, 0, 156, 157, 5, 112, 0, 0, 157, 158, 5, 116, 0, 0, 158, 159, 5, 105, 0, 0, 159, 160, 5, 111, 0, 0, 160, 161, 5, 110, 0, 0, 161, 162, 5, 97, 0, 0, 162, 163, 5, 108, 0, 0, 163, 24, 1, 0, 0, 0, 164, 165, 5, 73, 0, 0, 165, 166, 5, 78, 0, 0, 166, 167, 5, 84, 0, 0, 167, 26, 1, 0, 0, 0, 168, 169, 5, 70, 0, 0, 169, 170, 5, 76, 0, 0, 170, 171, 5, 79, 0, 0, 171, 172, 5, 65, 0, 0, 172, 173, 5, 84, 0, 0, 173, 28, 1, 0, 0, 0, 174, 175, 5, 68, 0, 0, 175, 176, 5, 79, 0, 0, 176, 177, 5, 85, 0, 0, 177, 178, 5, 66, 0, 0, 178, 179, 5, 76, 0, 0, 179, 180, 5, 69, 0, 0, 180, 30, 1, 0, 0, 0, 181, 182, 5, 83, 0, 0, 182, 183, 5, 84, 0, 0, 183, 184, 5, 82, 0, 0, 184, 185, 5, 73, 0, 0, 185, 186, 5, 78, 0, 0, 186, 187, 5, 71, 0, 0, 187, 32, 1, 0, 0, 0, 188, 189, 5, 66, 0, 0, 189, 190, 5, 79, 0, 0, 190, 191, 5, 79, 0, 0, 191, 192, 5, 76, 0, 0, 192, 193, 5, 69, 0, 0, 193, 194, 5, 65, 0, 0, 194, 195, 5, 78, 0, 0, 195, 34, 1, 0, 0, 0, 196, 197, 5, 67, 0, 0, 197, 198, 5, 72, 0, 0, 198, 199, 5, 65, 0, 0, 199, 200, 5, 82, 0, 0, 200, 36, 1, 0, 0, 0, 201, 202, 5, 86, 0, 0, 202, 203, 5, 79, 0, 0, 203, 204, 5, 73, 0, 0, 204, 205, 5, 68, 0, 0, 205, 38, 1, 0, 0, 0, 206, 207, 5, 112, 0, 0, 207, 208, 5, 117, 0, 0, 208, 209, 5, 98, 0, 0, 209, 210, 5, 108, 0, 0, 210, 211, 5, 105, 0, 0, 211, 212, 5, 99, 0, 0, 212, 40, 1, 0, 0, 0, 213, 214, 5, 112, 0, 0, 214, 215, 5, 114, 0, 0, 215, 216, 5, 111, 0, 0, 216, 217, 5, 116, 0, 0, 217, 218, 5, 101, 0, 0, 218, 219, 5, 99, 0, 0, 219, 220, 5, 116, 0, 0, 220, 221, 5, 101, 0, 0, 221, 222, 5, 100, 0, 0, 222, 42, 1, 0, 0, 0, 223, 224, 5, 112, 0, 0, 224, 225, 5, 114, 0, 0, 225, 226, 5, 105, 0, 0, 226, 227, 5, 118, 0, 0, 227, 228, 5, 97, 0, 0, 228, 229, 5, 116, 0, 0, 229, 230, 5, 101, 0, 0, 230, 44, 1, 0, 0, 0, 231, 232, 5, 100, 0, 0, 232, 233, 5, 101, 0, 0, 233, 234, 5, 102, 0, 0, 234, 235, 5, 97, 0, 0, 235, 236, 5, 117, 0, 0, 236, 237, 5, 108, 0, 0, 237, 238, 5, 116, 0, 0, 238, 46, 1, 0, 0, 0, 239, 241, 7, 0, 0, 0, 240, 239, 1, 0, 0, 0, 241, 242, 1, 0, 0, 0, 242, 240, 1, 0, 0, 0, 242, 243, 1, 0, 0, 0, 243, 48, 1, 0, 0, 0, 244, 248, 5, 34, 0, 0, 245, 247, 8, 1, 0, 0, 246, 245, 1, 0, 0, 0, 247, 250, 1, 0, 0, 0, 248, 246, 1, 0, 0, 0, 248, 249, 1, 0, 0, 0, 249, 251, 1, 0, 0, 0, 250, 248, 1, 0, 0, 0, 251, 252, 5, 34, 0, 0, 252, 50, 1, 0, 0, 0, 253, 257, 5, 126, 0, 0, 254, 256, 8, 2, 0, 0, 255, 254, 1, 0, 0, 0, 256, 259, 1, 0, 0, 0, 257, 258, 1, 0, 0, 0, 257, 255, 1, 0, 0, 0, 258, 260, 1, 0, 0, 0, 259, 257, 1, 0, 0, 0, 260, 261, 5, 126, 0, 0, 261, 52, 1, 0, 0, 0, 262, 264, 7, 3, 0, 0, 263, 262, 1, 0, 0, 0, 264, 265, 1, 0, 0, 0, 265, 263, 1, 0, 0, 0, 265, 266, 1, 0, 0, 0, 266, 267, 1, 0, 0, 0, 267, 268, 6, 26, 0, 0, 268, 54, 1, 0, 0, 0, 269, 271, 7, 4, 0, 0, 270, 269, 1, 0, 0, 0, 271, 272, 1, 0, 0, 0, 272, 270, 1, 0, 0, 0, 272, 273, 1, 0, 0, 0, 273, 56, 1, 0, 0, 0, 274, 276, 7, 4, 0, 0, 275, 274, 1, 0, 0, 0, 276, 277, 1, 0, 0, 0, 277, 275, 1, 0, 0, 0, 277, 278, 1, 0, 0, 0, 278, 279, 1, 0, 0, 0, 279, 283, 5, 46, 0, 0, 280, 282, 7, 4, 0, 0, 281, 280, 1, 0, 0, 0, 282, 285, 1, 0, 0, 0, 283, 281, 1, 0, 0, 0, 283, 284, 1, 0, 0, 0, 284, 293, 1, 0, 0, 0, 285, 283, 1, 0, 0, 0, 286, 288, 5, 46, 0, 0, 287, 289, 7, 4, 0, 0, 288, 287, 1, 0, 0, 0, 289, 290, 1, 0, 0, 0, 290, 288, 1, 0, 0, 0, 290, 291, 1, 0, 0, 0, 291, 293, 1, 0, 0, 0, 292, 275, 1, 0, 0, 0, 292, 286, 1, 0, 0, 0, 293, 58, 1, 0, 0, 0, 294, 295, 5, 40, 0, 0, 295, 60, 1, 0, 0, 0, 296, 297, 5, 41, 0, 0, 297, 62, 1, 0, 0, 0, 298, 299, 5, 58, 0, 0, 299, 64, 1, 0, 0, 0, 300, 301, 5, 59, 0, 0, 301, 66, 1, 0, 0, 0, 302, 303, 5, 44, 0, 0, 303, 68, 1, 0, 0, 0, 304, 305, 5, 123, 0, 0, 305, 70, 1, 0, 0, 0, 306, 307, 5, 125, 0, 0, 307, 72, 1, 0, 0, 0, 308, 309, 5, 126, 0, 0, 309, 74, 1, 0, 0, 0, 310, 311, 5, 33, 0, 0, 311, 76, 1, 0, 0, 0, 10, 0, 242, 248, 257, 265, 272, 277, 283, 290, 292, 1, 6, 0, 0] \ No newline at end of file diff --git a/src/main/java/org/lumijiez/parser/WinxLexer.java b/src/main/java/org/lumijiez/parser/WinxLexer.java new file mode 100644 index 0000000..8c2897f --- /dev/null +++ b/src/main/java/org/lumijiez/parser/WinxLexer.java @@ -0,0 +1,324 @@ +// Generated from D:/Source/JavaProjects/dsl-formal-requirements/src/grammars/Winx.g4 by ANTLR 4.13.1 +package org.lumijiez.parser; +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", "CheckReturnValue", "this-escape"}) +public class WinxLexer extends Lexer { + static { RuntimeMetaData.checkVersion("4.13.1", RuntimeMetaData.VERSION); } + + protected static final DFA[] _decisionToDFA; + protected static final PredictionContextCache _sharedContextCache = + new PredictionContextCache(); + public static final int + T__0=1, T__1=2, T__2=3, T__3=4, T__4=5, T__5=6, T__6=7, T__7=8, T__8=9, + T__9=10, T__10=11, T__11=12, T__12=13, T__13=14, T__14=15, T__15=16, T__16=17, + T__17=18, T__18=19, T__19=20, T__20=21, T__21=22, T__22=23, ID=24, STRING=25, + DESCRIPTION=26, WS=27, INT=28, FLOAT=29, LPAREN=30, RPAREN=31, COLON=32, + SEMICOLON=33, COMMA=34, LBRACE=35, RBRACE=36, TILDE=37, EXCLAM=38; + public static String[] channelNames = { + "DEFAULT_TOKEN_CHANNEL", "HIDDEN" + }; + + public static String[] modeNames = { + "DEFAULT_MODE" + }; + + private static String[] makeRuleNames() { + return new String[] { + "T__0", "T__1", "T__2", "T__3", "T__4", "T__5", "T__6", "T__7", "T__8", + "T__9", "T__10", "T__11", "T__12", "T__13", "T__14", "T__15", "T__16", + "T__17", "T__18", "T__19", "T__20", "T__21", "T__22", "ID", "STRING", + "DESCRIPTION", "WS", "INT", "FLOAT", "LPAREN", "RPAREN", "COLON", "SEMICOLON", + "COMMA", "LBRACE", "RBRACE", "TILDE", "EXCLAM" + }; + } + public static final String[] ruleNames = makeRuleNames(); + + private static String[] makeLiteralNames() { + return new String[] { + null, "'package'", "'interface'", "'specification'", "'implements'", + "'@'", "'result'", "'AND'", "'OR'", "'return'", "'[]'", "'critical'", + "'optional'", "'INT'", "'FLOAT'", "'DOUBLE'", "'STRING'", "'BOOLEAN'", + "'CHAR'", "'VOID'", "'public'", "'protected'", "'private'", "'default'", + null, null, null, null, null, null, "'('", "')'", "':'", "';'", "','", + "'{'", "'}'", "'~'", "'!'" + }; + } + private static final String[] _LITERAL_NAMES = makeLiteralNames(); + private static String[] makeSymbolicNames() { + return new String[] { + null, null, null, null, null, null, null, null, null, null, null, null, + null, null, null, null, null, null, null, null, null, null, null, null, + "ID", "STRING", "DESCRIPTION", "WS", "INT", "FLOAT", "LPAREN", "RPAREN", + "COLON", "SEMICOLON", "COMMA", "LBRACE", "RBRACE", "TILDE", "EXCLAM" + }; + } + 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 WinxLexer(CharStream input) { + super(input); + _interp = new LexerATNSimulator(this,_ATN,_decisionToDFA,_sharedContextCache); + } + + @Override + public String getGrammarFileName() { return "Winx.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; } + + public static final String _serializedATN = + "\u0004\u0000&\u0138\u0006\uffff\uffff\u0002\u0000\u0007\u0000\u0002\u0001"+ + "\u0007\u0001\u0002\u0002\u0007\u0002\u0002\u0003\u0007\u0003\u0002\u0004"+ + "\u0007\u0004\u0002\u0005\u0007\u0005\u0002\u0006\u0007\u0006\u0002\u0007"+ + "\u0007\u0007\u0002\b\u0007\b\u0002\t\u0007\t\u0002\n\u0007\n\u0002\u000b"+ + "\u0007\u000b\u0002\f\u0007\f\u0002\r\u0007\r\u0002\u000e\u0007\u000e\u0002"+ + "\u000f\u0007\u000f\u0002\u0010\u0007\u0010\u0002\u0011\u0007\u0011\u0002"+ + "\u0012\u0007\u0012\u0002\u0013\u0007\u0013\u0002\u0014\u0007\u0014\u0002"+ + "\u0015\u0007\u0015\u0002\u0016\u0007\u0016\u0002\u0017\u0007\u0017\u0002"+ + "\u0018\u0007\u0018\u0002\u0019\u0007\u0019\u0002\u001a\u0007\u001a\u0002"+ + "\u001b\u0007\u001b\u0002\u001c\u0007\u001c\u0002\u001d\u0007\u001d\u0002"+ + "\u001e\u0007\u001e\u0002\u001f\u0007\u001f\u0002 \u0007 \u0002!\u0007"+ + "!\u0002\"\u0007\"\u0002#\u0007#\u0002$\u0007$\u0002%\u0007%\u0001\u0000"+ + "\u0001\u0000\u0001\u0000\u0001\u0000\u0001\u0000\u0001\u0000\u0001\u0000"+ + "\u0001\u0000\u0001\u0001\u0001\u0001\u0001\u0001\u0001\u0001\u0001\u0001"+ + "\u0001\u0001\u0001\u0001\u0001\u0001\u0001\u0001\u0001\u0001\u0001\u0002"+ + "\u0001\u0002\u0001\u0002\u0001\u0002\u0001\u0002\u0001\u0002\u0001\u0002"+ + "\u0001\u0002\u0001\u0002\u0001\u0002\u0001\u0002\u0001\u0002\u0001\u0002"+ + "\u0001\u0002\u0001\u0003\u0001\u0003\u0001\u0003\u0001\u0003\u0001\u0003"+ + "\u0001\u0003\u0001\u0003\u0001\u0003\u0001\u0003\u0001\u0003\u0001\u0003"+ + "\u0001\u0004\u0001\u0004\u0001\u0005\u0001\u0005\u0001\u0005\u0001\u0005"+ + "\u0001\u0005\u0001\u0005\u0001\u0005\u0001\u0006\u0001\u0006\u0001\u0006"+ + "\u0001\u0006\u0001\u0007\u0001\u0007\u0001\u0007\u0001\b\u0001\b\u0001"+ + "\b\u0001\b\u0001\b\u0001\b\u0001\b\u0001\t\u0001\t\u0001\t\u0001\n\u0001"+ + "\n\u0001\n\u0001\n\u0001\n\u0001\n\u0001\n\u0001\n\u0001\n\u0001\u000b"+ + "\u0001\u000b\u0001\u000b\u0001\u000b\u0001\u000b\u0001\u000b\u0001\u000b"+ + "\u0001\u000b\u0001\u000b\u0001\f\u0001\f\u0001\f\u0001\f\u0001\r\u0001"+ + "\r\u0001\r\u0001\r\u0001\r\u0001\r\u0001\u000e\u0001\u000e\u0001\u000e"+ + "\u0001\u000e\u0001\u000e\u0001\u000e\u0001\u000e\u0001\u000f\u0001\u000f"+ + "\u0001\u000f\u0001\u000f\u0001\u000f\u0001\u000f\u0001\u000f\u0001\u0010"+ + "\u0001\u0010\u0001\u0010\u0001\u0010\u0001\u0010\u0001\u0010\u0001\u0010"+ + "\u0001\u0010\u0001\u0011\u0001\u0011\u0001\u0011\u0001\u0011\u0001\u0011"+ + "\u0001\u0012\u0001\u0012\u0001\u0012\u0001\u0012\u0001\u0012\u0001\u0013"+ + "\u0001\u0013\u0001\u0013\u0001\u0013\u0001\u0013\u0001\u0013\u0001\u0013"+ + "\u0001\u0014\u0001\u0014\u0001\u0014\u0001\u0014\u0001\u0014\u0001\u0014"+ + "\u0001\u0014\u0001\u0014\u0001\u0014\u0001\u0014\u0001\u0015\u0001\u0015"+ + "\u0001\u0015\u0001\u0015\u0001\u0015\u0001\u0015\u0001\u0015\u0001\u0015"+ + "\u0001\u0016\u0001\u0016\u0001\u0016\u0001\u0016\u0001\u0016\u0001\u0016"+ + "\u0001\u0016\u0001\u0016\u0001\u0017\u0004\u0017\u00f1\b\u0017\u000b\u0017"+ + "\f\u0017\u00f2\u0001\u0018\u0001\u0018\u0005\u0018\u00f7\b\u0018\n\u0018"+ + "\f\u0018\u00fa\t\u0018\u0001\u0018\u0001\u0018\u0001\u0019\u0001\u0019"+ + "\u0005\u0019\u0100\b\u0019\n\u0019\f\u0019\u0103\t\u0019\u0001\u0019\u0001"+ + "\u0019\u0001\u001a\u0004\u001a\u0108\b\u001a\u000b\u001a\f\u001a\u0109"+ + "\u0001\u001a\u0001\u001a\u0001\u001b\u0004\u001b\u010f\b\u001b\u000b\u001b"+ + "\f\u001b\u0110\u0001\u001c\u0004\u001c\u0114\b\u001c\u000b\u001c\f\u001c"+ + "\u0115\u0001\u001c\u0001\u001c\u0005\u001c\u011a\b\u001c\n\u001c\f\u001c"+ + "\u011d\t\u001c\u0001\u001c\u0001\u001c\u0004\u001c\u0121\b\u001c\u000b"+ + "\u001c\f\u001c\u0122\u0003\u001c\u0125\b\u001c\u0001\u001d\u0001\u001d"+ + "\u0001\u001e\u0001\u001e\u0001\u001f\u0001\u001f\u0001 \u0001 \u0001!"+ + "\u0001!\u0001\"\u0001\"\u0001#\u0001#\u0001$\u0001$\u0001%\u0001%\u0001"+ + "\u0101\u0000&\u0001\u0001\u0003\u0002\u0005\u0003\u0007\u0004\t\u0005"+ + "\u000b\u0006\r\u0007\u000f\b\u0011\t\u0013\n\u0015\u000b\u0017\f\u0019"+ + "\r\u001b\u000e\u001d\u000f\u001f\u0010!\u0011#\u0012%\u0013\'\u0014)\u0015"+ + "+\u0016-\u0017/\u00181\u00193\u001a5\u001b7\u001c9\u001d;\u001e=\u001f"+ + "? A!C\"E#G$I%K&\u0001\u0000\u0005\u0002\u0000AZaz\u0001\u0000\"\"\u0001"+ + "\u0000~~\u0003\u0000\t\n\r\r \u0001\u000009\u0140\u0000\u0001\u0001\u0000"+ + "\u0000\u0000\u0000\u0003\u0001\u0000\u0000\u0000\u0000\u0005\u0001\u0000"+ + "\u0000\u0000\u0000\u0007\u0001\u0000\u0000\u0000\u0000\t\u0001\u0000\u0000"+ + "\u0000\u0000\u000b\u0001\u0000\u0000\u0000\u0000\r\u0001\u0000\u0000\u0000"+ + "\u0000\u000f\u0001\u0000\u0000\u0000\u0000\u0011\u0001\u0000\u0000\u0000"+ + "\u0000\u0013\u0001\u0000\u0000\u0000\u0000\u0015\u0001\u0000\u0000\u0000"+ + "\u0000\u0017\u0001\u0000\u0000\u0000\u0000\u0019\u0001\u0000\u0000\u0000"+ + "\u0000\u001b\u0001\u0000\u0000\u0000\u0000\u001d\u0001\u0000\u0000\u0000"+ + "\u0000\u001f\u0001\u0000\u0000\u0000\u0000!\u0001\u0000\u0000\u0000\u0000"+ + "#\u0001\u0000\u0000\u0000\u0000%\u0001\u0000\u0000\u0000\u0000\'\u0001"+ + "\u0000\u0000\u0000\u0000)\u0001\u0000\u0000\u0000\u0000+\u0001\u0000\u0000"+ + "\u0000\u0000-\u0001\u0000\u0000\u0000\u0000/\u0001\u0000\u0000\u0000\u0000"+ + "1\u0001\u0000\u0000\u0000\u00003\u0001\u0000\u0000\u0000\u00005\u0001"+ + "\u0000\u0000\u0000\u00007\u0001\u0000\u0000\u0000\u00009\u0001\u0000\u0000"+ + "\u0000\u0000;\u0001\u0000\u0000\u0000\u0000=\u0001\u0000\u0000\u0000\u0000"+ + "?\u0001\u0000\u0000\u0000\u0000A\u0001\u0000\u0000\u0000\u0000C\u0001"+ + "\u0000\u0000\u0000\u0000E\u0001\u0000\u0000\u0000\u0000G\u0001\u0000\u0000"+ + "\u0000\u0000I\u0001\u0000\u0000\u0000\u0000K\u0001\u0000\u0000\u0000\u0001"+ + "M\u0001\u0000\u0000\u0000\u0003U\u0001\u0000\u0000\u0000\u0005_\u0001"+ + "\u0000\u0000\u0000\u0007m\u0001\u0000\u0000\u0000\tx\u0001\u0000\u0000"+ + "\u0000\u000bz\u0001\u0000\u0000\u0000\r\u0081\u0001\u0000\u0000\u0000"+ + "\u000f\u0085\u0001\u0000\u0000\u0000\u0011\u0088\u0001\u0000\u0000\u0000"+ + "\u0013\u008f\u0001\u0000\u0000\u0000\u0015\u0092\u0001\u0000\u0000\u0000"+ + "\u0017\u009b\u0001\u0000\u0000\u0000\u0019\u00a4\u0001\u0000\u0000\u0000"+ + "\u001b\u00a8\u0001\u0000\u0000\u0000\u001d\u00ae\u0001\u0000\u0000\u0000"+ + "\u001f\u00b5\u0001\u0000\u0000\u0000!\u00bc\u0001\u0000\u0000\u0000#\u00c4"+ + "\u0001\u0000\u0000\u0000%\u00c9\u0001\u0000\u0000\u0000\'\u00ce\u0001"+ + "\u0000\u0000\u0000)\u00d5\u0001\u0000\u0000\u0000+\u00df\u0001\u0000\u0000"+ + "\u0000-\u00e7\u0001\u0000\u0000\u0000/\u00f0\u0001\u0000\u0000\u00001"+ + "\u00f4\u0001\u0000\u0000\u00003\u00fd\u0001\u0000\u0000\u00005\u0107\u0001"+ + "\u0000\u0000\u00007\u010e\u0001\u0000\u0000\u00009\u0124\u0001\u0000\u0000"+ + "\u0000;\u0126\u0001\u0000\u0000\u0000=\u0128\u0001\u0000\u0000\u0000?"+ + "\u012a\u0001\u0000\u0000\u0000A\u012c\u0001\u0000\u0000\u0000C\u012e\u0001"+ + "\u0000\u0000\u0000E\u0130\u0001\u0000\u0000\u0000G\u0132\u0001\u0000\u0000"+ + "\u0000I\u0134\u0001\u0000\u0000\u0000K\u0136\u0001\u0000\u0000\u0000M"+ + "N\u0005p\u0000\u0000NO\u0005a\u0000\u0000OP\u0005c\u0000\u0000PQ\u0005"+ + "k\u0000\u0000QR\u0005a\u0000\u0000RS\u0005g\u0000\u0000ST\u0005e\u0000"+ + "\u0000T\u0002\u0001\u0000\u0000\u0000UV\u0005i\u0000\u0000VW\u0005n\u0000"+ + "\u0000WX\u0005t\u0000\u0000XY\u0005e\u0000\u0000YZ\u0005r\u0000\u0000"+ + "Z[\u0005f\u0000\u0000[\\\u0005a\u0000\u0000\\]\u0005c\u0000\u0000]^\u0005"+ + "e\u0000\u0000^\u0004\u0001\u0000\u0000\u0000_`\u0005s\u0000\u0000`a\u0005"+ + "p\u0000\u0000ab\u0005e\u0000\u0000bc\u0005c\u0000\u0000cd\u0005i\u0000"+ + "\u0000de\u0005f\u0000\u0000ef\u0005i\u0000\u0000fg\u0005c\u0000\u0000"+ + "gh\u0005a\u0000\u0000hi\u0005t\u0000\u0000ij\u0005i\u0000\u0000jk\u0005"+ + "o\u0000\u0000kl\u0005n\u0000\u0000l\u0006\u0001\u0000\u0000\u0000mn\u0005"+ + "i\u0000\u0000no\u0005m\u0000\u0000op\u0005p\u0000\u0000pq\u0005l\u0000"+ + "\u0000qr\u0005e\u0000\u0000rs\u0005m\u0000\u0000st\u0005e\u0000\u0000"+ + "tu\u0005n\u0000\u0000uv\u0005t\u0000\u0000vw\u0005s\u0000\u0000w\b\u0001"+ + "\u0000\u0000\u0000xy\u0005@\u0000\u0000y\n\u0001\u0000\u0000\u0000z{\u0005"+ + "r\u0000\u0000{|\u0005e\u0000\u0000|}\u0005s\u0000\u0000}~\u0005u\u0000"+ + "\u0000~\u007f\u0005l\u0000\u0000\u007f\u0080\u0005t\u0000\u0000\u0080"+ + "\f\u0001\u0000\u0000\u0000\u0081\u0082\u0005A\u0000\u0000\u0082\u0083"+ + "\u0005N\u0000\u0000\u0083\u0084\u0005D\u0000\u0000\u0084\u000e\u0001\u0000"+ + "\u0000\u0000\u0085\u0086\u0005O\u0000\u0000\u0086\u0087\u0005R\u0000\u0000"+ + "\u0087\u0010\u0001\u0000\u0000\u0000\u0088\u0089\u0005r\u0000\u0000\u0089"+ + "\u008a\u0005e\u0000\u0000\u008a\u008b\u0005t\u0000\u0000\u008b\u008c\u0005"+ + "u\u0000\u0000\u008c\u008d\u0005r\u0000\u0000\u008d\u008e\u0005n\u0000"+ + "\u0000\u008e\u0012\u0001\u0000\u0000\u0000\u008f\u0090\u0005[\u0000\u0000"+ + "\u0090\u0091\u0005]\u0000\u0000\u0091\u0014\u0001\u0000\u0000\u0000\u0092"+ + "\u0093\u0005c\u0000\u0000\u0093\u0094\u0005r\u0000\u0000\u0094\u0095\u0005"+ + "i\u0000\u0000\u0095\u0096\u0005t\u0000\u0000\u0096\u0097\u0005i\u0000"+ + "\u0000\u0097\u0098\u0005c\u0000\u0000\u0098\u0099\u0005a\u0000\u0000\u0099"+ + "\u009a\u0005l\u0000\u0000\u009a\u0016\u0001\u0000\u0000\u0000\u009b\u009c"+ + "\u0005o\u0000\u0000\u009c\u009d\u0005p\u0000\u0000\u009d\u009e\u0005t"+ + "\u0000\u0000\u009e\u009f\u0005i\u0000\u0000\u009f\u00a0\u0005o\u0000\u0000"+ + "\u00a0\u00a1\u0005n\u0000\u0000\u00a1\u00a2\u0005a\u0000\u0000\u00a2\u00a3"+ + "\u0005l\u0000\u0000\u00a3\u0018\u0001\u0000\u0000\u0000\u00a4\u00a5\u0005"+ + "I\u0000\u0000\u00a5\u00a6\u0005N\u0000\u0000\u00a6\u00a7\u0005T\u0000"+ + "\u0000\u00a7\u001a\u0001\u0000\u0000\u0000\u00a8\u00a9\u0005F\u0000\u0000"+ + "\u00a9\u00aa\u0005L\u0000\u0000\u00aa\u00ab\u0005O\u0000\u0000\u00ab\u00ac"+ + "\u0005A\u0000\u0000\u00ac\u00ad\u0005T\u0000\u0000\u00ad\u001c\u0001\u0000"+ + "\u0000\u0000\u00ae\u00af\u0005D\u0000\u0000\u00af\u00b0\u0005O\u0000\u0000"+ + "\u00b0\u00b1\u0005U\u0000\u0000\u00b1\u00b2\u0005B\u0000\u0000\u00b2\u00b3"+ + "\u0005L\u0000\u0000\u00b3\u00b4\u0005E\u0000\u0000\u00b4\u001e\u0001\u0000"+ + "\u0000\u0000\u00b5\u00b6\u0005S\u0000\u0000\u00b6\u00b7\u0005T\u0000\u0000"+ + "\u00b7\u00b8\u0005R\u0000\u0000\u00b8\u00b9\u0005I\u0000\u0000\u00b9\u00ba"+ + "\u0005N\u0000\u0000\u00ba\u00bb\u0005G\u0000\u0000\u00bb \u0001\u0000"+ + "\u0000\u0000\u00bc\u00bd\u0005B\u0000\u0000\u00bd\u00be\u0005O\u0000\u0000"+ + "\u00be\u00bf\u0005O\u0000\u0000\u00bf\u00c0\u0005L\u0000\u0000\u00c0\u00c1"+ + "\u0005E\u0000\u0000\u00c1\u00c2\u0005A\u0000\u0000\u00c2\u00c3\u0005N"+ + "\u0000\u0000\u00c3\"\u0001\u0000\u0000\u0000\u00c4\u00c5\u0005C\u0000"+ + "\u0000\u00c5\u00c6\u0005H\u0000\u0000\u00c6\u00c7\u0005A\u0000\u0000\u00c7"+ + "\u00c8\u0005R\u0000\u0000\u00c8$\u0001\u0000\u0000\u0000\u00c9\u00ca\u0005"+ + "V\u0000\u0000\u00ca\u00cb\u0005O\u0000\u0000\u00cb\u00cc\u0005I\u0000"+ + "\u0000\u00cc\u00cd\u0005D\u0000\u0000\u00cd&\u0001\u0000\u0000\u0000\u00ce"+ + "\u00cf\u0005p\u0000\u0000\u00cf\u00d0\u0005u\u0000\u0000\u00d0\u00d1\u0005"+ + "b\u0000\u0000\u00d1\u00d2\u0005l\u0000\u0000\u00d2\u00d3\u0005i\u0000"+ + "\u0000\u00d3\u00d4\u0005c\u0000\u0000\u00d4(\u0001\u0000\u0000\u0000\u00d5"+ + "\u00d6\u0005p\u0000\u0000\u00d6\u00d7\u0005r\u0000\u0000\u00d7\u00d8\u0005"+ + "o\u0000\u0000\u00d8\u00d9\u0005t\u0000\u0000\u00d9\u00da\u0005e\u0000"+ + "\u0000\u00da\u00db\u0005c\u0000\u0000\u00db\u00dc\u0005t\u0000\u0000\u00dc"+ + "\u00dd\u0005e\u0000\u0000\u00dd\u00de\u0005d\u0000\u0000\u00de*\u0001"+ + "\u0000\u0000\u0000\u00df\u00e0\u0005p\u0000\u0000\u00e0\u00e1\u0005r\u0000"+ + "\u0000\u00e1\u00e2\u0005i\u0000\u0000\u00e2\u00e3\u0005v\u0000\u0000\u00e3"+ + "\u00e4\u0005a\u0000\u0000\u00e4\u00e5\u0005t\u0000\u0000\u00e5\u00e6\u0005"+ + "e\u0000\u0000\u00e6,\u0001\u0000\u0000\u0000\u00e7\u00e8\u0005d\u0000"+ + "\u0000\u00e8\u00e9\u0005e\u0000\u0000\u00e9\u00ea\u0005f\u0000\u0000\u00ea"+ + "\u00eb\u0005a\u0000\u0000\u00eb\u00ec\u0005u\u0000\u0000\u00ec\u00ed\u0005"+ + "l\u0000\u0000\u00ed\u00ee\u0005t\u0000\u0000\u00ee.\u0001\u0000\u0000"+ + "\u0000\u00ef\u00f1\u0007\u0000\u0000\u0000\u00f0\u00ef\u0001\u0000\u0000"+ + "\u0000\u00f1\u00f2\u0001\u0000\u0000\u0000\u00f2\u00f0\u0001\u0000\u0000"+ + "\u0000\u00f2\u00f3\u0001\u0000\u0000\u0000\u00f30\u0001\u0000\u0000\u0000"+ + "\u00f4\u00f8\u0005\"\u0000\u0000\u00f5\u00f7\b\u0001\u0000\u0000\u00f6"+ + "\u00f5\u0001\u0000\u0000\u0000\u00f7\u00fa\u0001\u0000\u0000\u0000\u00f8"+ + "\u00f6\u0001\u0000\u0000\u0000\u00f8\u00f9\u0001\u0000\u0000\u0000\u00f9"+ + "\u00fb\u0001\u0000\u0000\u0000\u00fa\u00f8\u0001\u0000\u0000\u0000\u00fb"+ + "\u00fc\u0005\"\u0000\u0000\u00fc2\u0001\u0000\u0000\u0000\u00fd\u0101"+ + "\u0005~\u0000\u0000\u00fe\u0100\b\u0002\u0000\u0000\u00ff\u00fe\u0001"+ + "\u0000\u0000\u0000\u0100\u0103\u0001\u0000\u0000\u0000\u0101\u0102\u0001"+ + "\u0000\u0000\u0000\u0101\u00ff\u0001\u0000\u0000\u0000\u0102\u0104\u0001"+ + "\u0000\u0000\u0000\u0103\u0101\u0001\u0000\u0000\u0000\u0104\u0105\u0005"+ + "~\u0000\u0000\u01054\u0001\u0000\u0000\u0000\u0106\u0108\u0007\u0003\u0000"+ + "\u0000\u0107\u0106\u0001\u0000\u0000\u0000\u0108\u0109\u0001\u0000\u0000"+ + "\u0000\u0109\u0107\u0001\u0000\u0000\u0000\u0109\u010a\u0001\u0000\u0000"+ + "\u0000\u010a\u010b\u0001\u0000\u0000\u0000\u010b\u010c\u0006\u001a\u0000"+ + "\u0000\u010c6\u0001\u0000\u0000\u0000\u010d\u010f\u0007\u0004\u0000\u0000"+ + "\u010e\u010d\u0001\u0000\u0000\u0000\u010f\u0110\u0001\u0000\u0000\u0000"+ + "\u0110\u010e\u0001\u0000\u0000\u0000\u0110\u0111\u0001\u0000\u0000\u0000"+ + "\u01118\u0001\u0000\u0000\u0000\u0112\u0114\u0007\u0004\u0000\u0000\u0113"+ + "\u0112\u0001\u0000\u0000\u0000\u0114\u0115\u0001\u0000\u0000\u0000\u0115"+ + "\u0113\u0001\u0000\u0000\u0000\u0115\u0116\u0001\u0000\u0000\u0000\u0116"+ + "\u0117\u0001\u0000\u0000\u0000\u0117\u011b\u0005.\u0000\u0000\u0118\u011a"+ + "\u0007\u0004\u0000\u0000\u0119\u0118\u0001\u0000\u0000\u0000\u011a\u011d"+ + "\u0001\u0000\u0000\u0000\u011b\u0119\u0001\u0000\u0000\u0000\u011b\u011c"+ + "\u0001\u0000\u0000\u0000\u011c\u0125\u0001\u0000\u0000\u0000\u011d\u011b"+ + "\u0001\u0000\u0000\u0000\u011e\u0120\u0005.\u0000\u0000\u011f\u0121\u0007"+ + "\u0004\u0000\u0000\u0120\u011f\u0001\u0000\u0000\u0000\u0121\u0122\u0001"+ + "\u0000\u0000\u0000\u0122\u0120\u0001\u0000\u0000\u0000\u0122\u0123\u0001"+ + "\u0000\u0000\u0000\u0123\u0125\u0001\u0000\u0000\u0000\u0124\u0113\u0001"+ + "\u0000\u0000\u0000\u0124\u011e\u0001\u0000\u0000\u0000\u0125:\u0001\u0000"+ + "\u0000\u0000\u0126\u0127\u0005(\u0000\u0000\u0127<\u0001\u0000\u0000\u0000"+ + "\u0128\u0129\u0005)\u0000\u0000\u0129>\u0001\u0000\u0000\u0000\u012a\u012b"+ + "\u0005:\u0000\u0000\u012b@\u0001\u0000\u0000\u0000\u012c\u012d\u0005;"+ + "\u0000\u0000\u012dB\u0001\u0000\u0000\u0000\u012e\u012f\u0005,\u0000\u0000"+ + "\u012fD\u0001\u0000\u0000\u0000\u0130\u0131\u0005{\u0000\u0000\u0131F"+ + "\u0001\u0000\u0000\u0000\u0132\u0133\u0005}\u0000\u0000\u0133H\u0001\u0000"+ + "\u0000\u0000\u0134\u0135\u0005~\u0000\u0000\u0135J\u0001\u0000\u0000\u0000"+ + "\u0136\u0137\u0005!\u0000\u0000\u0137L\u0001\u0000\u0000\u0000\n\u0000"+ + "\u00f2\u00f8\u0101\u0109\u0110\u0115\u011b\u0122\u0124\u0001\u0006\u0000"+ + "\u0000"; + 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/org/lumijiez/parser/WinxLexer.tokens b/src/main/java/org/lumijiez/parser/WinxLexer.tokens new file mode 100644 index 0000000..217c3c6 --- /dev/null +++ b/src/main/java/org/lumijiez/parser/WinxLexer.tokens @@ -0,0 +1,70 @@ +T__0=1 +T__1=2 +T__2=3 +T__3=4 +T__4=5 +T__5=6 +T__6=7 +T__7=8 +T__8=9 +T__9=10 +T__10=11 +T__11=12 +T__12=13 +T__13=14 +T__14=15 +T__15=16 +T__16=17 +T__17=18 +T__18=19 +T__19=20 +T__20=21 +T__21=22 +T__22=23 +ID=24 +STRING=25 +DESCRIPTION=26 +WS=27 +INT=28 +FLOAT=29 +LPAREN=30 +RPAREN=31 +COLON=32 +SEMICOLON=33 +COMMA=34 +LBRACE=35 +RBRACE=36 +TILDE=37 +EXCLAM=38 +'package'=1 +'interface'=2 +'specification'=3 +'implements'=4 +'@'=5 +'result'=6 +'AND'=7 +'OR'=8 +'return'=9 +'[]'=10 +'critical'=11 +'optional'=12 +'INT'=13 +'FLOAT'=14 +'DOUBLE'=15 +'STRING'=16 +'BOOLEAN'=17 +'CHAR'=18 +'VOID'=19 +'public'=20 +'protected'=21 +'private'=22 +'default'=23 +'('=30 +')'=31 +':'=32 +';'=33 +','=34 +'{'=35 +'}'=36 +'~'=37 +'!'=38 diff --git a/src/main/java/org/lumijiez/parser/WinxListener.java b/src/main/java/org/lumijiez/parser/WinxListener.java new file mode 100644 index 0000000..1916c0d --- /dev/null +++ b/src/main/java/org/lumijiez/parser/WinxListener.java @@ -0,0 +1,220 @@ +// Generated from D:/Source/JavaProjects/dsl-formal-requirements/src/grammars/Winx.g4 by ANTLR 4.13.1 +package org.lumijiez.parser; +import org.antlr.v4.runtime.tree.ParseTreeListener; + +/** + * This interface defines a complete listener for a parse tree produced by + * {@link WinxParser}. + */ +public interface WinxListener extends ParseTreeListener { + /** + * Enter a parse tree produced by {@link WinxParser#winx}. + * @param ctx the parse tree + */ + void enterWinx(WinxParser.WinxContext ctx); + /** + * Exit a parse tree produced by {@link WinxParser#winx}. + * @param ctx the parse tree + */ + void exitWinx(WinxParser.WinxContext ctx); + /** + * Enter a parse tree produced by {@link WinxParser#body}. + * @param ctx the parse tree + */ + void enterBody(WinxParser.BodyContext ctx); + /** + * Exit a parse tree produced by {@link WinxParser#body}. + * @param ctx the parse tree + */ + void exitBody(WinxParser.BodyContext ctx); + /** + * Enter a parse tree produced by {@link WinxParser#package}. + * @param ctx the parse tree + */ + void enterPackage(WinxParser.PackageContext ctx); + /** + * Exit a parse tree produced by {@link WinxParser#package}. + * @param ctx the parse tree + */ + void exitPackage(WinxParser.PackageContext ctx); + /** + * Enter a parse tree produced by {@link WinxParser#interface}. + * @param ctx the parse tree + */ + void enterInterface(WinxParser.InterfaceContext ctx); + /** + * Exit a parse tree produced by {@link WinxParser#interface}. + * @param ctx the parse tree + */ + void exitInterface(WinxParser.InterfaceContext ctx); + /** + * Enter a parse tree produced by {@link WinxParser#specification}. + * @param ctx the parse tree + */ + void enterSpecification(WinxParser.SpecificationContext ctx); + /** + * Exit a parse tree produced by {@link WinxParser#specification}. + * @param ctx the parse tree + */ + void exitSpecification(WinxParser.SpecificationContext ctx); + /** + * Enter a parse tree produced by {@link WinxParser#interface_body}. + * @param ctx the parse tree + */ + void enterInterface_body(WinxParser.Interface_bodyContext ctx); + /** + * Exit a parse tree produced by {@link WinxParser#interface_body}. + * @param ctx the parse tree + */ + void exitInterface_body(WinxParser.Interface_bodyContext ctx); + /** + * Enter a parse tree produced by {@link WinxParser#specification_body}. + * @param ctx the parse tree + */ + void enterSpecification_body(WinxParser.Specification_bodyContext ctx); + /** + * Exit a parse tree produced by {@link WinxParser#specification_body}. + * @param ctx the parse tree + */ + void exitSpecification_body(WinxParser.Specification_bodyContext ctx); + /** + * Enter a parse tree produced by {@link WinxParser#requirementSpec}. + * @param ctx the parse tree + */ + void enterRequirementSpec(WinxParser.RequirementSpecContext ctx); + /** + * Exit a parse tree produced by {@link WinxParser#requirementSpec}. + * @param ctx the parse tree + */ + void exitRequirementSpec(WinxParser.RequirementSpecContext ctx); + /** + * Enter a parse tree produced by {@link WinxParser#req_specification}. + * @param ctx the parse tree + */ + void enterReq_specification(WinxParser.Req_specificationContext ctx); + /** + * Exit a parse tree produced by {@link WinxParser#req_specification}. + * @param ctx the parse tree + */ + void exitReq_specification(WinxParser.Req_specificationContext ctx); + /** + * Enter a parse tree produced by {@link WinxParser#result_specification}. + * @param ctx the parse tree + */ + void enterResult_specification(WinxParser.Result_specificationContext ctx); + /** + * Exit a parse tree produced by {@link WinxParser#result_specification}. + * @param ctx the parse tree + */ + void exitResult_specification(WinxParser.Result_specificationContext ctx); + /** + * Enter a parse tree produced by {@link WinxParser#logical_op}. + * @param ctx the parse tree + */ + void enterLogical_op(WinxParser.Logical_opContext ctx); + /** + * Exit a parse tree produced by {@link WinxParser#logical_op}. + * @param ctx the parse tree + */ + void exitLogical_op(WinxParser.Logical_opContext ctx); + /** + * Enter a parse tree produced by {@link WinxParser#functionSpec}. + * @param ctx the parse tree + */ + void enterFunctionSpec(WinxParser.FunctionSpecContext ctx); + /** + * Exit a parse tree produced by {@link WinxParser#functionSpec}. + * @param ctx the parse tree + */ + void exitFunctionSpec(WinxParser.FunctionSpecContext ctx); + /** + * Enter a parse tree produced by {@link WinxParser#functionBody}. + * @param ctx the parse tree + */ + void enterFunctionBody(WinxParser.FunctionBodyContext ctx); + /** + * Exit a parse tree produced by {@link WinxParser#functionBody}. + * @param ctx the parse tree + */ + void exitFunctionBody(WinxParser.FunctionBodyContext ctx); + /** + * Enter a parse tree produced by {@link WinxParser#input_types}. + * @param ctx the parse tree + */ + void enterInput_types(WinxParser.Input_typesContext ctx); + /** + * Exit a parse tree produced by {@link WinxParser#input_types}. + * @param ctx the parse tree + */ + void exitInput_types(WinxParser.Input_typesContext ctx); + /** + * Enter a parse tree produced by {@link WinxParser#return_types}. + * @param ctx the parse tree + */ + void enterReturn_types(WinxParser.Return_typesContext ctx); + /** + * Exit a parse tree produced by {@link WinxParser#return_types}. + * @param ctx the parse tree + */ + void exitReturn_types(WinxParser.Return_typesContext ctx); + /** + * Enter a parse tree produced by {@link WinxParser#specificationEntry}. + * @param ctx the parse tree + */ + void enterSpecificationEntry(WinxParser.SpecificationEntryContext ctx); + /** + * Exit a parse tree produced by {@link WinxParser#specificationEntry}. + * @param ctx the parse tree + */ + void exitSpecificationEntry(WinxParser.SpecificationEntryContext ctx); + /** + * Enter a parse tree produced by {@link WinxParser#variable}. + * @param ctx the parse tree + */ + void enterVariable(WinxParser.VariableContext ctx); + /** + * Exit a parse tree produced by {@link WinxParser#variable}. + * @param ctx the parse tree + */ + void exitVariable(WinxParser.VariableContext ctx); + /** + * Enter a parse tree produced by {@link WinxParser#importance}. + * @param ctx the parse tree + */ + void enterImportance(WinxParser.ImportanceContext ctx); + /** + * Exit a parse tree produced by {@link WinxParser#importance}. + * @param ctx the parse tree + */ + void exitImportance(WinxParser.ImportanceContext ctx); + /** + * Enter a parse tree produced by {@link WinxParser#type}. + * @param ctx the parse tree + */ + void enterType(WinxParser.TypeContext ctx); + /** + * Exit a parse tree produced by {@link WinxParser#type}. + * @param ctx the parse tree + */ + void exitType(WinxParser.TypeContext ctx); + /** + * Enter a parse tree produced by {@link WinxParser#access_modifiers}. + * @param ctx the parse tree + */ + void enterAccess_modifiers(WinxParser.Access_modifiersContext ctx); + /** + * Exit a parse tree produced by {@link WinxParser#access_modifiers}. + * @param ctx the parse tree + */ + void exitAccess_modifiers(WinxParser.Access_modifiersContext ctx); + /** + * Enter a parse tree produced by {@link WinxParser#description}. + * @param ctx the parse tree + */ + void enterDescription(WinxParser.DescriptionContext ctx); + /** + * Exit a parse tree produced by {@link WinxParser#description}. + * @param ctx the parse tree + */ + void exitDescription(WinxParser.DescriptionContext ctx); +} \ No newline at end of file diff --git a/src/main/java/org/lumijiez/parser/WinxParser.java b/src/main/java/org/lumijiez/parser/WinxParser.java new file mode 100644 index 0000000..e2405ab --- /dev/null +++ b/src/main/java/org/lumijiez/parser/WinxParser.java @@ -0,0 +1,1769 @@ +// Generated from D:/Source/JavaProjects/dsl-formal-requirements/src/grammars/Winx.g4 by ANTLR 4.13.1 +package org.lumijiez.parser; +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", "CheckReturnValue"}) +public class WinxParser extends Parser { + static { RuntimeMetaData.checkVersion("4.13.1", RuntimeMetaData.VERSION); } + + protected static final DFA[] _decisionToDFA; + protected static final PredictionContextCache _sharedContextCache = + new PredictionContextCache(); + public static final int + T__0=1, T__1=2, T__2=3, T__3=4, T__4=5, T__5=6, T__6=7, T__7=8, T__8=9, + T__9=10, T__10=11, T__11=12, T__12=13, T__13=14, T__14=15, T__15=16, T__16=17, + T__17=18, T__18=19, T__19=20, T__20=21, T__21=22, T__22=23, ID=24, STRING=25, + DESCRIPTION=26, WS=27, INT=28, FLOAT=29, LPAREN=30, RPAREN=31, COLON=32, + SEMICOLON=33, COMMA=34, LBRACE=35, RBRACE=36, TILDE=37, EXCLAM=38; + public static final int + RULE_winx = 0, RULE_body = 1, RULE_package = 2, RULE_interface = 3, RULE_specification = 4, + RULE_interface_body = 5, RULE_specification_body = 6, RULE_requirementSpec = 7, + RULE_req_specification = 8, RULE_result_specification = 9, RULE_logical_op = 10, + RULE_functionSpec = 11, RULE_functionBody = 12, RULE_input_types = 13, + RULE_return_types = 14, RULE_specificationEntry = 15, RULE_variable = 16, + RULE_importance = 17, RULE_type = 18, RULE_access_modifiers = 19, RULE_description = 20; + private static String[] makeRuleNames() { + return new String[] { + "winx", "body", "package", "interface", "specification", "interface_body", + "specification_body", "requirementSpec", "req_specification", "result_specification", + "logical_op", "functionSpec", "functionBody", "input_types", "return_types", + "specificationEntry", "variable", "importance", "type", "access_modifiers", + "description" + }; + } + public static final String[] ruleNames = makeRuleNames(); + + private static String[] makeLiteralNames() { + return new String[] { + null, "'package'", "'interface'", "'specification'", "'implements'", + "'@'", "'result'", "'AND'", "'OR'", "'return'", "'[]'", "'critical'", + "'optional'", "'INT'", "'FLOAT'", "'DOUBLE'", "'STRING'", "'BOOLEAN'", + "'CHAR'", "'VOID'", "'public'", "'protected'", "'private'", "'default'", + null, null, null, null, null, null, "'('", "')'", "':'", "';'", "','", + "'{'", "'}'", "'~'", "'!'" + }; + } + private static final String[] _LITERAL_NAMES = makeLiteralNames(); + private static String[] makeSymbolicNames() { + return new String[] { + null, null, null, null, null, null, null, null, null, null, null, null, + null, null, null, null, null, null, null, null, null, null, null, null, + "ID", "STRING", "DESCRIPTION", "WS", "INT", "FLOAT", "LPAREN", "RPAREN", + "COLON", "SEMICOLON", "COMMA", "LBRACE", "RBRACE", "TILDE", "EXCLAM" + }; + } + 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 "Winx.g4"; } + + @Override + public String[] getRuleNames() { return ruleNames; } + + @Override + public String getSerializedATN() { return _serializedATN; } + + @Override + public ATN getATN() { return _ATN; } + + public WinxParser(TokenStream input) { + super(input); + _interp = new ParserATNSimulator(this,_ATN,_decisionToDFA,_sharedContextCache); + } + + @SuppressWarnings("CheckReturnValue") + public static class WinxContext extends ParserRuleContext { + public List package_() { + return getRuleContexts(PackageContext.class); + } + public PackageContext package_(int i) { + return getRuleContext(PackageContext.class,i); + } + public List DESCRIPTION() { return getTokens(WinxParser.DESCRIPTION); } + public TerminalNode DESCRIPTION(int i) { + return getToken(WinxParser.DESCRIPTION, i); + } + public WinxContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_winx; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof WinxListener ) ((WinxListener)listener).enterWinx(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof WinxListener ) ((WinxListener)listener).exitWinx(this); + } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof WinxVisitor ) return ((WinxVisitor)visitor).visitWinx(this); + else return visitor.visitChildren(this); + } + } + + public final WinxContext winx() throws RecognitionException { + WinxContext _localctx = new WinxContext(_ctx, getState()); + enterRule(_localctx, 0, RULE_winx); + int _la; + try { + enterOuterAlt(_localctx, 1); + { + setState(44); + _errHandler.sync(this); + _la = _input.LA(1); + do { + { + setState(44); + _errHandler.sync(this); + switch (_input.LA(1)) { + case T__0: + { + setState(42); + package_(); + } + break; + case DESCRIPTION: + { + setState(43); + match(DESCRIPTION); + } + break; + default: + throw new NoViableAltException(this); + } + } + setState(46); + _errHandler.sync(this); + _la = _input.LA(1); + } while ( _la==T__0 || _la==DESCRIPTION ); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + @SuppressWarnings("CheckReturnValue") + public static class BodyContext extends ParserRuleContext { + public List interface_() { + return getRuleContexts(InterfaceContext.class); + } + public InterfaceContext interface_(int i) { + return getRuleContext(InterfaceContext.class,i); + } + public List specification() { + return getRuleContexts(SpecificationContext.class); + } + public SpecificationContext specification(int i) { + return getRuleContext(SpecificationContext.class,i); + } + public List DESCRIPTION() { return getTokens(WinxParser.DESCRIPTION); } + public TerminalNode DESCRIPTION(int i) { + return getToken(WinxParser.DESCRIPTION, i); + } + public BodyContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_body; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof WinxListener ) ((WinxListener)listener).enterBody(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof WinxListener ) ((WinxListener)listener).exitBody(this); + } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof WinxVisitor ) return ((WinxVisitor)visitor).visitBody(this); + else return visitor.visitChildren(this); + } + } + + public final BodyContext body() throws RecognitionException { + BodyContext _localctx = new BodyContext(_ctx, getState()); + enterRule(_localctx, 2, RULE_body); + int _la; + try { + enterOuterAlt(_localctx, 1); + { + setState(51); + _errHandler.sync(this); + _la = _input.LA(1); + do { + { + setState(51); + _errHandler.sync(this); + switch (_input.LA(1)) { + case T__1: + case T__10: + case T__11: + case T__19: + case T__20: + case T__21: + case T__22: + { + setState(48); + interface_(); + } + break; + case T__2: + { + setState(49); + specification(); + } + break; + case DESCRIPTION: + { + setState(50); + match(DESCRIPTION); + } + break; + default: + throw new NoViableAltException(this); + } + } + setState(53); + _errHandler.sync(this); + _la = _input.LA(1); + } while ( (((_la) & ~0x3f) == 0 && ((1L << _la) & 82843660L) != 0) ); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + @SuppressWarnings("CheckReturnValue") + public static class PackageContext extends ParserRuleContext { + public TerminalNode ID() { return getToken(WinxParser.ID, 0); } + public TerminalNode LBRACE() { return getToken(WinxParser.LBRACE, 0); } + public BodyContext body() { + return getRuleContext(BodyContext.class,0); + } + public TerminalNode RBRACE() { return getToken(WinxParser.RBRACE, 0); } + public PackageContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_package; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof WinxListener ) ((WinxListener)listener).enterPackage(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof WinxListener ) ((WinxListener)listener).exitPackage(this); + } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof WinxVisitor ) return ((WinxVisitor)visitor).visitPackage(this); + else return visitor.visitChildren(this); + } + } + + public final PackageContext package_() throws RecognitionException { + PackageContext _localctx = new PackageContext(_ctx, getState()); + enterRule(_localctx, 4, RULE_package); + try { + enterOuterAlt(_localctx, 1); + { + setState(55); + match(T__0); + setState(56); + match(ID); + setState(57); + match(LBRACE); + setState(58); + body(); + setState(59); + match(RBRACE); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + @SuppressWarnings("CheckReturnValue") + public static class InterfaceContext extends ParserRuleContext { + public TerminalNode ID() { return getToken(WinxParser.ID, 0); } + public TerminalNode LBRACE() { return getToken(WinxParser.LBRACE, 0); } + public Interface_bodyContext interface_body() { + return getRuleContext(Interface_bodyContext.class,0); + } + public TerminalNode RBRACE() { return getToken(WinxParser.RBRACE, 0); } + public ImportanceContext importance() { + return getRuleContext(ImportanceContext.class,0); + } + public Access_modifiersContext access_modifiers() { + return getRuleContext(Access_modifiersContext.class,0); + } + public InterfaceContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_interface; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof WinxListener ) ((WinxListener)listener).enterInterface(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof WinxListener ) ((WinxListener)listener).exitInterface(this); + } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof WinxVisitor ) return ((WinxVisitor)visitor).visitInterface(this); + else return visitor.visitChildren(this); + } + } + + public final InterfaceContext interface_() throws RecognitionException { + InterfaceContext _localctx = new InterfaceContext(_ctx, getState()); + enterRule(_localctx, 6, RULE_interface); + int _la; + try { + enterOuterAlt(_localctx, 1); + { + setState(62); + _errHandler.sync(this); + _la = _input.LA(1); + if (_la==T__10 || _la==T__11) { + { + setState(61); + importance(); + } + } + + setState(65); + _errHandler.sync(this); + _la = _input.LA(1); + if ((((_la) & ~0x3f) == 0 && ((1L << _la) & 15728640L) != 0)) { + { + setState(64); + access_modifiers(); + } + } + + setState(67); + match(T__1); + setState(68); + match(ID); + setState(69); + match(LBRACE); + setState(70); + interface_body(); + setState(71); + match(RBRACE); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + @SuppressWarnings("CheckReturnValue") + public static class SpecificationContext extends ParserRuleContext { + public List ID() { return getTokens(WinxParser.ID); } + public TerminalNode ID(int i) { + return getToken(WinxParser.ID, i); + } + public TerminalNode LBRACE() { return getToken(WinxParser.LBRACE, 0); } + public Specification_bodyContext specification_body() { + return getRuleContext(Specification_bodyContext.class,0); + } + public TerminalNode RBRACE() { return getToken(WinxParser.RBRACE, 0); } + public SpecificationContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_specification; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof WinxListener ) ((WinxListener)listener).enterSpecification(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof WinxListener ) ((WinxListener)listener).exitSpecification(this); + } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof WinxVisitor ) return ((WinxVisitor)visitor).visitSpecification(this); + else return visitor.visitChildren(this); + } + } + + public final SpecificationContext specification() throws RecognitionException { + SpecificationContext _localctx = new SpecificationContext(_ctx, getState()); + enterRule(_localctx, 8, RULE_specification); + int _la; + try { + enterOuterAlt(_localctx, 1); + { + setState(73); + match(T__2); + setState(74); + match(ID); + setState(79); + _errHandler.sync(this); + _la = _input.LA(1); + while (_la==T__3) { + { + { + setState(75); + match(T__3); + setState(76); + match(ID); + } + } + setState(81); + _errHandler.sync(this); + _la = _input.LA(1); + } + setState(82); + match(LBRACE); + setState(83); + specification_body(); + setState(84); + match(RBRACE); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + @SuppressWarnings("CheckReturnValue") + public static class Interface_bodyContext extends ParserRuleContext { + public List requirementSpec() { + return getRuleContexts(RequirementSpecContext.class); + } + public RequirementSpecContext requirementSpec(int i) { + return getRuleContext(RequirementSpecContext.class,i); + } + public List functionSpec() { + return getRuleContexts(FunctionSpecContext.class); + } + public FunctionSpecContext functionSpec(int i) { + return getRuleContext(FunctionSpecContext.class,i); + } + public Interface_bodyContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_interface_body; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof WinxListener ) ((WinxListener)listener).enterInterface_body(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof WinxListener ) ((WinxListener)listener).exitInterface_body(this); + } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof WinxVisitor ) return ((WinxVisitor)visitor).visitInterface_body(this); + else return visitor.visitChildren(this); + } + } + + public final Interface_bodyContext interface_body() throws RecognitionException { + Interface_bodyContext _localctx = new Interface_bodyContext(_ctx, getState()); + enterRule(_localctx, 10, RULE_interface_body); + int _la; + try { + enterOuterAlt(_localctx, 1); + { + setState(88); + _errHandler.sync(this); + _la = _input.LA(1); + do { + { + setState(88); + _errHandler.sync(this); + switch ( getInterpreter().adaptivePredict(_input,7,_ctx) ) { + case 1: + { + setState(86); + requirementSpec(); + } + break; + case 2: + { + setState(87); + functionSpec(); + } + break; + } + } + setState(90); + _errHandler.sync(this); + _la = _input.LA(1); + } while ( (((_la) & ~0x3f) == 0 && ((1L << _la) & 99620864L) != 0) ); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + @SuppressWarnings("CheckReturnValue") + public static class Specification_bodyContext extends ParserRuleContext { + public List requirementSpec() { + return getRuleContexts(RequirementSpecContext.class); + } + public RequirementSpecContext requirementSpec(int i) { + return getRuleContext(RequirementSpecContext.class,i); + } + public List functionSpec() { + return getRuleContexts(FunctionSpecContext.class); + } + public FunctionSpecContext functionSpec(int i) { + return getRuleContext(FunctionSpecContext.class,i); + } + public Specification_bodyContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_specification_body; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof WinxListener ) ((WinxListener)listener).enterSpecification_body(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof WinxListener ) ((WinxListener)listener).exitSpecification_body(this); + } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof WinxVisitor ) return ((WinxVisitor)visitor).visitSpecification_body(this); + else return visitor.visitChildren(this); + } + } + + public final Specification_bodyContext specification_body() throws RecognitionException { + Specification_bodyContext _localctx = new Specification_bodyContext(_ctx, getState()); + enterRule(_localctx, 12, RULE_specification_body); + int _la; + try { + enterOuterAlt(_localctx, 1); + { + setState(94); + _errHandler.sync(this); + _la = _input.LA(1); + do { + { + setState(94); + _errHandler.sync(this); + switch ( getInterpreter().adaptivePredict(_input,9,_ctx) ) { + case 1: + { + setState(92); + requirementSpec(); + } + break; + case 2: + { + setState(93); + functionSpec(); + } + break; + } + } + setState(96); + _errHandler.sync(this); + _la = _input.LA(1); + } while ( (((_la) & ~0x3f) == 0 && ((1L << _la) & 99620864L) != 0) ); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + @SuppressWarnings("CheckReturnValue") + public static class RequirementSpecContext extends ParserRuleContext { + public TerminalNode ID() { return getToken(WinxParser.ID, 0); } + public TerminalNode LBRACE() { return getToken(WinxParser.LBRACE, 0); } + public TerminalNode RBRACE() { return getToken(WinxParser.RBRACE, 0); } + public DescriptionContext description() { + return getRuleContext(DescriptionContext.class,0); + } + public ImportanceContext importance() { + return getRuleContext(ImportanceContext.class,0); + } + public List req_specification() { + return getRuleContexts(Req_specificationContext.class); + } + public Req_specificationContext req_specification(int i) { + return getRuleContext(Req_specificationContext.class,i); + } + public List result_specification() { + return getRuleContexts(Result_specificationContext.class); + } + public Result_specificationContext result_specification(int i) { + return getRuleContext(Result_specificationContext.class,i); + } + public RequirementSpecContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_requirementSpec; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof WinxListener ) ((WinxListener)listener).enterRequirementSpec(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof WinxListener ) ((WinxListener)listener).exitRequirementSpec(this); + } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof WinxVisitor ) return ((WinxVisitor)visitor).visitRequirementSpec(this); + else return visitor.visitChildren(this); + } + } + + public final RequirementSpecContext requirementSpec() throws RecognitionException { + RequirementSpecContext _localctx = new RequirementSpecContext(_ctx, getState()); + enterRule(_localctx, 14, RULE_requirementSpec); + int _la; + try { + enterOuterAlt(_localctx, 1); + { + setState(99); + _errHandler.sync(this); + _la = _input.LA(1); + if (_la==DESCRIPTION) { + { + setState(98); + description(); + } + } + + setState(102); + _errHandler.sync(this); + _la = _input.LA(1); + if (_la==T__10 || _la==T__11) { + { + setState(101); + importance(); + } + } + + setState(104); + match(ID); + setState(105); + match(LBRACE); + setState(109); + _errHandler.sync(this); + _la = _input.LA(1); + while ((((_la) & ~0x3f) == 0 && ((1L << _la) & 6176L) != 0)) { + { + { + setState(106); + req_specification(); + } + } + setState(111); + _errHandler.sync(this); + _la = _input.LA(1); + } + setState(115); + _errHandler.sync(this); + _la = _input.LA(1); + while (_la==T__5) { + { + { + setState(112); + result_specification(); + } + } + setState(117); + _errHandler.sync(this); + _la = _input.LA(1); + } + setState(118); + match(RBRACE); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + @SuppressWarnings("CheckReturnValue") + public static class Req_specificationContext extends ParserRuleContext { + public List ID() { return getTokens(WinxParser.ID); } + public TerminalNode ID(int i) { + return getToken(WinxParser.ID, i); + } + public TerminalNode SEMICOLON() { return getToken(WinxParser.SEMICOLON, 0); } + public ImportanceContext importance() { + return getRuleContext(ImportanceContext.class,0); + } + public List logical_op() { + return getRuleContexts(Logical_opContext.class); + } + public Logical_opContext logical_op(int i) { + return getRuleContext(Logical_opContext.class,i); + } + public Req_specificationContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_req_specification; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof WinxListener ) ((WinxListener)listener).enterReq_specification(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof WinxListener ) ((WinxListener)listener).exitReq_specification(this); + } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof WinxVisitor ) return ((WinxVisitor)visitor).visitReq_specification(this); + else return visitor.visitChildren(this); + } + } + + public final Req_specificationContext req_specification() throws RecognitionException { + Req_specificationContext _localctx = new Req_specificationContext(_ctx, getState()); + enterRule(_localctx, 16, RULE_req_specification); + int _la; + try { + enterOuterAlt(_localctx, 1); + { + setState(121); + _errHandler.sync(this); + _la = _input.LA(1); + if (_la==T__10 || _la==T__11) { + { + setState(120); + importance(); + } + } + + setState(123); + match(T__4); + setState(124); + match(ID); + setState(130); + _errHandler.sync(this); + _la = _input.LA(1); + while (_la==T__6 || _la==T__7) { + { + { + setState(125); + logical_op(); + setState(126); + match(ID); + } + } + setState(132); + _errHandler.sync(this); + _la = _input.LA(1); + } + setState(133); + match(SEMICOLON); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + @SuppressWarnings("CheckReturnValue") + public static class Result_specificationContext extends ParserRuleContext { + public TerminalNode ID() { return getToken(WinxParser.ID, 0); } + public TerminalNode SEMICOLON() { return getToken(WinxParser.SEMICOLON, 0); } + public ImportanceContext importance() { + return getRuleContext(ImportanceContext.class,0); + } + public Result_specificationContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_result_specification; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof WinxListener ) ((WinxListener)listener).enterResult_specification(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof WinxListener ) ((WinxListener)listener).exitResult_specification(this); + } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof WinxVisitor ) return ((WinxVisitor)visitor).visitResult_specification(this); + else return visitor.visitChildren(this); + } + } + + public final Result_specificationContext result_specification() throws RecognitionException { + Result_specificationContext _localctx = new Result_specificationContext(_ctx, getState()); + enterRule(_localctx, 18, RULE_result_specification); + int _la; + try { + enterOuterAlt(_localctx, 1); + { + setState(135); + match(T__5); + setState(137); + _errHandler.sync(this); + _la = _input.LA(1); + if (_la==T__10 || _la==T__11) { + { + setState(136); + importance(); + } + } + + setState(139); + match(ID); + setState(140); + match(SEMICOLON); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + @SuppressWarnings("CheckReturnValue") + public static class Logical_opContext extends ParserRuleContext { + public Logical_opContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_logical_op; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof WinxListener ) ((WinxListener)listener).enterLogical_op(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof WinxListener ) ((WinxListener)listener).exitLogical_op(this); + } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof WinxVisitor ) return ((WinxVisitor)visitor).visitLogical_op(this); + else return visitor.visitChildren(this); + } + } + + public final Logical_opContext logical_op() throws RecognitionException { + Logical_opContext _localctx = new Logical_opContext(_ctx, getState()); + enterRule(_localctx, 20, RULE_logical_op); + int _la; + try { + enterOuterAlt(_localctx, 1); + { + setState(142); + _la = _input.LA(1); + if ( !(_la==T__6 || _la==T__7) ) { + _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; + } + + @SuppressWarnings("CheckReturnValue") + public static class FunctionSpecContext extends ParserRuleContext { + public List ID() { return getTokens(WinxParser.ID); } + public TerminalNode ID(int i) { + return getToken(WinxParser.ID, i); + } + public TerminalNode LPAREN() { return getToken(WinxParser.LPAREN, 0); } + public TerminalNode RPAREN() { return getToken(WinxParser.RPAREN, 0); } + public FunctionBodyContext functionBody() { + return getRuleContext(FunctionBodyContext.class,0); + } + public DescriptionContext description() { + return getRuleContext(DescriptionContext.class,0); + } + public ImportanceContext importance() { + return getRuleContext(ImportanceContext.class,0); + } + public Access_modifiersContext access_modifiers() { + return getRuleContext(Access_modifiersContext.class,0); + } + public Input_typesContext input_types() { + return getRuleContext(Input_typesContext.class,0); + } + public FunctionSpecContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_functionSpec; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof WinxListener ) ((WinxListener)listener).enterFunctionSpec(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof WinxListener ) ((WinxListener)listener).exitFunctionSpec(this); + } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof WinxVisitor ) return ((WinxVisitor)visitor).visitFunctionSpec(this); + else return visitor.visitChildren(this); + } + } + + public final FunctionSpecContext functionSpec() throws RecognitionException { + FunctionSpecContext _localctx = new FunctionSpecContext(_ctx, getState()); + enterRule(_localctx, 22, RULE_functionSpec); + int _la; + try { + enterOuterAlt(_localctx, 1); + { + setState(145); + _errHandler.sync(this); + _la = _input.LA(1); + if (_la==DESCRIPTION) { + { + setState(144); + description(); + } + } + + setState(148); + _errHandler.sync(this); + _la = _input.LA(1); + if (_la==T__10 || _la==T__11) { + { + setState(147); + importance(); + } + } + + setState(151); + _errHandler.sync(this); + _la = _input.LA(1); + if ((((_la) & ~0x3f) == 0 && ((1L << _la) & 15728640L) != 0)) { + { + setState(150); + access_modifiers(); + } + } + + setState(153); + match(ID); + setState(154); + match(LPAREN); + setState(156); + _errHandler.sync(this); + _la = _input.LA(1); + if ((((_la) & ~0x3f) == 0 && ((1L << _la) & 1040384L) != 0)) { + { + setState(155); + input_types(); + } + } + + setState(158); + match(RPAREN); + setState(163); + _errHandler.sync(this); + _la = _input.LA(1); + while (_la==T__3) { + { + { + setState(159); + match(T__3); + setState(160); + match(ID); + } + } + setState(165); + _errHandler.sync(this); + _la = _input.LA(1); + } + setState(166); + functionBody(); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + @SuppressWarnings("CheckReturnValue") + public static class FunctionBodyContext extends ParserRuleContext { + public TerminalNode LBRACE() { return getToken(WinxParser.LBRACE, 0); } + public Return_typesContext return_types() { + return getRuleContext(Return_typesContext.class,0); + } + public TerminalNode RBRACE() { return getToken(WinxParser.RBRACE, 0); } + public List specificationEntry() { + return getRuleContexts(SpecificationEntryContext.class); + } + public SpecificationEntryContext specificationEntry(int i) { + return getRuleContext(SpecificationEntryContext.class,i); + } + public FunctionBodyContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_functionBody; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof WinxListener ) ((WinxListener)listener).enterFunctionBody(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof WinxListener ) ((WinxListener)listener).exitFunctionBody(this); + } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof WinxVisitor ) return ((WinxVisitor)visitor).visitFunctionBody(this); + else return visitor.visitChildren(this); + } + } + + public final FunctionBodyContext functionBody() throws RecognitionException { + FunctionBodyContext _localctx = new FunctionBodyContext(_ctx, getState()); + enterRule(_localctx, 24, RULE_functionBody); + int _la; + try { + enterOuterAlt(_localctx, 1); + { + setState(168); + match(LBRACE); + setState(172); + _errHandler.sync(this); + _la = _input.LA(1); + while (_la==T__4) { + { + { + setState(169); + specificationEntry(); + } + } + setState(174); + _errHandler.sync(this); + _la = _input.LA(1); + } + setState(175); + return_types(); + setState(176); + match(RBRACE); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + @SuppressWarnings("CheckReturnValue") + public static class Input_typesContext extends ParserRuleContext { + public List variable() { + return getRuleContexts(VariableContext.class); + } + public VariableContext variable(int i) { + return getRuleContext(VariableContext.class,i); + } + public List COMMA() { return getTokens(WinxParser.COMMA); } + public TerminalNode COMMA(int i) { + return getToken(WinxParser.COMMA, i); + } + public Input_typesContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_input_types; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof WinxListener ) ((WinxListener)listener).enterInput_types(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof WinxListener ) ((WinxListener)listener).exitInput_types(this); + } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof WinxVisitor ) return ((WinxVisitor)visitor).visitInput_types(this); + else return visitor.visitChildren(this); + } + } + + public final Input_typesContext input_types() throws RecognitionException { + Input_typesContext _localctx = new Input_typesContext(_ctx, getState()); + enterRule(_localctx, 26, RULE_input_types); + int _la; + try { + enterOuterAlt(_localctx, 1); + { + setState(178); + variable(); + setState(183); + _errHandler.sync(this); + _la = _input.LA(1); + while (_la==COMMA) { + { + { + setState(179); + match(COMMA); + setState(180); + variable(); + } + } + setState(185); + _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; + } + + @SuppressWarnings("CheckReturnValue") + public static class Return_typesContext extends ParserRuleContext { + public List variable() { + return getRuleContexts(VariableContext.class); + } + public VariableContext variable(int i) { + return getRuleContext(VariableContext.class,i); + } + public TerminalNode SEMICOLON() { return getToken(WinxParser.SEMICOLON, 0); } + public List COMMA() { return getTokens(WinxParser.COMMA); } + public TerminalNode COMMA(int i) { + return getToken(WinxParser.COMMA, i); + } + public Return_typesContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_return_types; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof WinxListener ) ((WinxListener)listener).enterReturn_types(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof WinxListener ) ((WinxListener)listener).exitReturn_types(this); + } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof WinxVisitor ) return ((WinxVisitor)visitor).visitReturn_types(this); + else return visitor.visitChildren(this); + } + } + + public final Return_typesContext return_types() throws RecognitionException { + Return_typesContext _localctx = new Return_typesContext(_ctx, getState()); + enterRule(_localctx, 28, RULE_return_types); + int _la; + try { + enterOuterAlt(_localctx, 1); + { + setState(186); + match(T__8); + setState(187); + variable(); + setState(192); + _errHandler.sync(this); + _la = _input.LA(1); + while (_la==COMMA) { + { + { + setState(188); + match(COMMA); + setState(189); + variable(); + } + } + setState(194); + _errHandler.sync(this); + _la = _input.LA(1); + } + setState(195); + match(SEMICOLON); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + @SuppressWarnings("CheckReturnValue") + public static class SpecificationEntryContext extends ParserRuleContext { + public TerminalNode ID() { return getToken(WinxParser.ID, 0); } + public TerminalNode COLON() { return getToken(WinxParser.COLON, 0); } + public TerminalNode STRING() { return getToken(WinxParser.STRING, 0); } + public TerminalNode SEMICOLON() { return getToken(WinxParser.SEMICOLON, 0); } + public SpecificationEntryContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_specificationEntry; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof WinxListener ) ((WinxListener)listener).enterSpecificationEntry(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof WinxListener ) ((WinxListener)listener).exitSpecificationEntry(this); + } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof WinxVisitor ) return ((WinxVisitor)visitor).visitSpecificationEntry(this); + else return visitor.visitChildren(this); + } + } + + public final SpecificationEntryContext specificationEntry() throws RecognitionException { + SpecificationEntryContext _localctx = new SpecificationEntryContext(_ctx, getState()); + enterRule(_localctx, 30, RULE_specificationEntry); + try { + enterOuterAlt(_localctx, 1); + { + setState(197); + match(T__4); + setState(198); + match(ID); + setState(199); + match(COLON); + setState(200); + match(STRING); + setState(201); + match(SEMICOLON); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + @SuppressWarnings("CheckReturnValue") + public static class VariableContext extends ParserRuleContext { + public TypeContext type() { + return getRuleContext(TypeContext.class,0); + } + public TerminalNode ID() { return getToken(WinxParser.ID, 0); } + public VariableContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_variable; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof WinxListener ) ((WinxListener)listener).enterVariable(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof WinxListener ) ((WinxListener)listener).exitVariable(this); + } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof WinxVisitor ) return ((WinxVisitor)visitor).visitVariable(this); + else return visitor.visitChildren(this); + } + } + + public final VariableContext variable() throws RecognitionException { + VariableContext _localctx = new VariableContext(_ctx, getState()); + enterRule(_localctx, 32, RULE_variable); + int _la; + try { + enterOuterAlt(_localctx, 1); + { + setState(203); + type(); + setState(205); + _errHandler.sync(this); + _la = _input.LA(1); + if (_la==T__9) { + { + setState(204); + match(T__9); + } + } + + setState(207); + match(ID); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + @SuppressWarnings("CheckReturnValue") + public static class ImportanceContext extends ParserRuleContext { + public ImportanceContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_importance; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof WinxListener ) ((WinxListener)listener).enterImportance(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof WinxListener ) ((WinxListener)listener).exitImportance(this); + } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof WinxVisitor ) return ((WinxVisitor)visitor).visitImportance(this); + else return visitor.visitChildren(this); + } + } + + public final ImportanceContext importance() throws RecognitionException { + ImportanceContext _localctx = new ImportanceContext(_ctx, getState()); + enterRule(_localctx, 34, RULE_importance); + int _la; + try { + enterOuterAlt(_localctx, 1); + { + setState(209); + _la = _input.LA(1); + if ( !(_la==T__10 || _la==T__11) ) { + _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; + } + + @SuppressWarnings("CheckReturnValue") + public static class TypeContext extends ParserRuleContext { + public TypeContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_type; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof WinxListener ) ((WinxListener)listener).enterType(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof WinxListener ) ((WinxListener)listener).exitType(this); + } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof WinxVisitor ) return ((WinxVisitor)visitor).visitType(this); + else return visitor.visitChildren(this); + } + } + + public final TypeContext type() throws RecognitionException { + TypeContext _localctx = new TypeContext(_ctx, getState()); + enterRule(_localctx, 36, RULE_type); + int _la; + try { + enterOuterAlt(_localctx, 1); + { + setState(211); + _la = _input.LA(1); + if ( !((((_la) & ~0x3f) == 0 && ((1L << _la) & 1040384L) != 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; + } + + @SuppressWarnings("CheckReturnValue") + public static class Access_modifiersContext extends ParserRuleContext { + public Access_modifiersContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_access_modifiers; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof WinxListener ) ((WinxListener)listener).enterAccess_modifiers(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof WinxListener ) ((WinxListener)listener).exitAccess_modifiers(this); + } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof WinxVisitor ) return ((WinxVisitor)visitor).visitAccess_modifiers(this); + else return visitor.visitChildren(this); + } + } + + public final Access_modifiersContext access_modifiers() throws RecognitionException { + Access_modifiersContext _localctx = new Access_modifiersContext(_ctx, getState()); + enterRule(_localctx, 38, RULE_access_modifiers); + int _la; + try { + enterOuterAlt(_localctx, 1); + { + setState(213); + _la = _input.LA(1); + if ( !((((_la) & ~0x3f) == 0 && ((1L << _la) & 15728640L) != 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; + } + + @SuppressWarnings("CheckReturnValue") + public static class DescriptionContext extends ParserRuleContext { + public TerminalNode DESCRIPTION() { return getToken(WinxParser.DESCRIPTION, 0); } + public DescriptionContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_description; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof WinxListener ) ((WinxListener)listener).enterDescription(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof WinxListener ) ((WinxListener)listener).exitDescription(this); + } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof WinxVisitor ) return ((WinxVisitor)visitor).visitDescription(this); + else return visitor.visitChildren(this); + } + } + + public final DescriptionContext description() throws RecognitionException { + DescriptionContext _localctx = new DescriptionContext(_ctx, getState()); + enterRule(_localctx, 40, RULE_description); + try { + enterOuterAlt(_localctx, 1); + { + setState(215); + match(DESCRIPTION); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static final String _serializedATN = + "\u0004\u0001&\u00da\u0002\u0000\u0007\u0000\u0002\u0001\u0007\u0001\u0002"+ + "\u0002\u0007\u0002\u0002\u0003\u0007\u0003\u0002\u0004\u0007\u0004\u0002"+ + "\u0005\u0007\u0005\u0002\u0006\u0007\u0006\u0002\u0007\u0007\u0007\u0002"+ + "\b\u0007\b\u0002\t\u0007\t\u0002\n\u0007\n\u0002\u000b\u0007\u000b\u0002"+ + "\f\u0007\f\u0002\r\u0007\r\u0002\u000e\u0007\u000e\u0002\u000f\u0007\u000f"+ + "\u0002\u0010\u0007\u0010\u0002\u0011\u0007\u0011\u0002\u0012\u0007\u0012"+ + "\u0002\u0013\u0007\u0013\u0002\u0014\u0007\u0014\u0001\u0000\u0001\u0000"+ + "\u0004\u0000-\b\u0000\u000b\u0000\f\u0000.\u0001\u0001\u0001\u0001\u0001"+ + "\u0001\u0004\u00014\b\u0001\u000b\u0001\f\u00015\u0001\u0002\u0001\u0002"+ + "\u0001\u0002\u0001\u0002\u0001\u0002\u0001\u0002\u0001\u0003\u0003\u0003"+ + "?\b\u0003\u0001\u0003\u0003\u0003B\b\u0003\u0001\u0003\u0001\u0003\u0001"+ + "\u0003\u0001\u0003\u0001\u0003\u0001\u0003\u0001\u0004\u0001\u0004\u0001"+ + "\u0004\u0001\u0004\u0005\u0004N\b\u0004\n\u0004\f\u0004Q\t\u0004\u0001"+ + "\u0004\u0001\u0004\u0001\u0004\u0001\u0004\u0001\u0005\u0001\u0005\u0004"+ + "\u0005Y\b\u0005\u000b\u0005\f\u0005Z\u0001\u0006\u0001\u0006\u0004\u0006"+ + "_\b\u0006\u000b\u0006\f\u0006`\u0001\u0007\u0003\u0007d\b\u0007\u0001"+ + "\u0007\u0003\u0007g\b\u0007\u0001\u0007\u0001\u0007\u0001\u0007\u0005"+ + "\u0007l\b\u0007\n\u0007\f\u0007o\t\u0007\u0001\u0007\u0005\u0007r\b\u0007"+ + "\n\u0007\f\u0007u\t\u0007\u0001\u0007\u0001\u0007\u0001\b\u0003\bz\b\b"+ + "\u0001\b\u0001\b\u0001\b\u0001\b\u0001\b\u0005\b\u0081\b\b\n\b\f\b\u0084"+ + "\t\b\u0001\b\u0001\b\u0001\t\u0001\t\u0003\t\u008a\b\t\u0001\t\u0001\t"+ + "\u0001\t\u0001\n\u0001\n\u0001\u000b\u0003\u000b\u0092\b\u000b\u0001\u000b"+ + "\u0003\u000b\u0095\b\u000b\u0001\u000b\u0003\u000b\u0098\b\u000b\u0001"+ + "\u000b\u0001\u000b\u0001\u000b\u0003\u000b\u009d\b\u000b\u0001\u000b\u0001"+ + "\u000b\u0001\u000b\u0005\u000b\u00a2\b\u000b\n\u000b\f\u000b\u00a5\t\u000b"+ + "\u0001\u000b\u0001\u000b\u0001\f\u0001\f\u0005\f\u00ab\b\f\n\f\f\f\u00ae"+ + "\t\f\u0001\f\u0001\f\u0001\f\u0001\r\u0001\r\u0001\r\u0005\r\u00b6\b\r"+ + "\n\r\f\r\u00b9\t\r\u0001\u000e\u0001\u000e\u0001\u000e\u0001\u000e\u0005"+ + "\u000e\u00bf\b\u000e\n\u000e\f\u000e\u00c2\t\u000e\u0001\u000e\u0001\u000e"+ + "\u0001\u000f\u0001\u000f\u0001\u000f\u0001\u000f\u0001\u000f\u0001\u000f"+ + "\u0001\u0010\u0001\u0010\u0003\u0010\u00ce\b\u0010\u0001\u0010\u0001\u0010"+ + "\u0001\u0011\u0001\u0011\u0001\u0012\u0001\u0012\u0001\u0013\u0001\u0013"+ + "\u0001\u0014\u0001\u0014\u0001\u0014\u0000\u0000\u0015\u0000\u0002\u0004"+ + "\u0006\b\n\f\u000e\u0010\u0012\u0014\u0016\u0018\u001a\u001c\u001e \""+ + "$&(\u0000\u0004\u0001\u0000\u0007\b\u0001\u0000\u000b\f\u0001\u0000\r"+ + "\u0013\u0001\u0000\u0014\u0017\u00e0\u0000,\u0001\u0000\u0000\u0000\u0002"+ + "3\u0001\u0000\u0000\u0000\u00047\u0001\u0000\u0000\u0000\u0006>\u0001"+ + "\u0000\u0000\u0000\bI\u0001\u0000\u0000\u0000\nX\u0001\u0000\u0000\u0000"+ + "\f^\u0001\u0000\u0000\u0000\u000ec\u0001\u0000\u0000\u0000\u0010y\u0001"+ + "\u0000\u0000\u0000\u0012\u0087\u0001\u0000\u0000\u0000\u0014\u008e\u0001"+ + "\u0000\u0000\u0000\u0016\u0091\u0001\u0000\u0000\u0000\u0018\u00a8\u0001"+ + "\u0000\u0000\u0000\u001a\u00b2\u0001\u0000\u0000\u0000\u001c\u00ba\u0001"+ + "\u0000\u0000\u0000\u001e\u00c5\u0001\u0000\u0000\u0000 \u00cb\u0001\u0000"+ + "\u0000\u0000\"\u00d1\u0001\u0000\u0000\u0000$\u00d3\u0001\u0000\u0000"+ + "\u0000&\u00d5\u0001\u0000\u0000\u0000(\u00d7\u0001\u0000\u0000\u0000*"+ + "-\u0003\u0004\u0002\u0000+-\u0005\u001a\u0000\u0000,*\u0001\u0000\u0000"+ + "\u0000,+\u0001\u0000\u0000\u0000-.\u0001\u0000\u0000\u0000.,\u0001\u0000"+ + "\u0000\u0000./\u0001\u0000\u0000\u0000/\u0001\u0001\u0000\u0000\u0000"+ + "04\u0003\u0006\u0003\u000014\u0003\b\u0004\u000024\u0005\u001a\u0000\u0000"+ + "30\u0001\u0000\u0000\u000031\u0001\u0000\u0000\u000032\u0001\u0000\u0000"+ + "\u000045\u0001\u0000\u0000\u000053\u0001\u0000\u0000\u000056\u0001\u0000"+ + "\u0000\u00006\u0003\u0001\u0000\u0000\u000078\u0005\u0001\u0000\u0000"+ + "89\u0005\u0018\u0000\u00009:\u0005#\u0000\u0000:;\u0003\u0002\u0001\u0000"+ + ";<\u0005$\u0000\u0000<\u0005\u0001\u0000\u0000\u0000=?\u0003\"\u0011\u0000"+ + ">=\u0001\u0000\u0000\u0000>?\u0001\u0000\u0000\u0000?A\u0001\u0000\u0000"+ + "\u0000@B\u0003&\u0013\u0000A@\u0001\u0000\u0000\u0000AB\u0001\u0000\u0000"+ + "\u0000BC\u0001\u0000\u0000\u0000CD\u0005\u0002\u0000\u0000DE\u0005\u0018"+ + "\u0000\u0000EF\u0005#\u0000\u0000FG\u0003\n\u0005\u0000GH\u0005$\u0000"+ + "\u0000H\u0007\u0001\u0000\u0000\u0000IJ\u0005\u0003\u0000\u0000JO\u0005"+ + "\u0018\u0000\u0000KL\u0005\u0004\u0000\u0000LN\u0005\u0018\u0000\u0000"+ + "MK\u0001\u0000\u0000\u0000NQ\u0001\u0000\u0000\u0000OM\u0001\u0000\u0000"+ + "\u0000OP\u0001\u0000\u0000\u0000PR\u0001\u0000\u0000\u0000QO\u0001\u0000"+ + "\u0000\u0000RS\u0005#\u0000\u0000ST\u0003\f\u0006\u0000TU\u0005$\u0000"+ + "\u0000U\t\u0001\u0000\u0000\u0000VY\u0003\u000e\u0007\u0000WY\u0003\u0016"+ + "\u000b\u0000XV\u0001\u0000\u0000\u0000XW\u0001\u0000\u0000\u0000YZ\u0001"+ + "\u0000\u0000\u0000ZX\u0001\u0000\u0000\u0000Z[\u0001\u0000\u0000\u0000"+ + "[\u000b\u0001\u0000\u0000\u0000\\_\u0003\u000e\u0007\u0000]_\u0003\u0016"+ + "\u000b\u0000^\\\u0001\u0000\u0000\u0000^]\u0001\u0000\u0000\u0000_`\u0001"+ + "\u0000\u0000\u0000`^\u0001\u0000\u0000\u0000`a\u0001\u0000\u0000\u0000"+ + "a\r\u0001\u0000\u0000\u0000bd\u0003(\u0014\u0000cb\u0001\u0000\u0000\u0000"+ + "cd\u0001\u0000\u0000\u0000df\u0001\u0000\u0000\u0000eg\u0003\"\u0011\u0000"+ + "fe\u0001\u0000\u0000\u0000fg\u0001\u0000\u0000\u0000gh\u0001\u0000\u0000"+ + "\u0000hi\u0005\u0018\u0000\u0000im\u0005#\u0000\u0000jl\u0003\u0010\b"+ + "\u0000kj\u0001\u0000\u0000\u0000lo\u0001\u0000\u0000\u0000mk\u0001\u0000"+ + "\u0000\u0000mn\u0001\u0000\u0000\u0000ns\u0001\u0000\u0000\u0000om\u0001"+ + "\u0000\u0000\u0000pr\u0003\u0012\t\u0000qp\u0001\u0000\u0000\u0000ru\u0001"+ + "\u0000\u0000\u0000sq\u0001\u0000\u0000\u0000st\u0001\u0000\u0000\u0000"+ + "tv\u0001\u0000\u0000\u0000us\u0001\u0000\u0000\u0000vw\u0005$\u0000\u0000"+ + "w\u000f\u0001\u0000\u0000\u0000xz\u0003\"\u0011\u0000yx\u0001\u0000\u0000"+ + "\u0000yz\u0001\u0000\u0000\u0000z{\u0001\u0000\u0000\u0000{|\u0005\u0005"+ + "\u0000\u0000|\u0082\u0005\u0018\u0000\u0000}~\u0003\u0014\n\u0000~\u007f"+ + "\u0005\u0018\u0000\u0000\u007f\u0081\u0001\u0000\u0000\u0000\u0080}\u0001"+ + "\u0000\u0000\u0000\u0081\u0084\u0001\u0000\u0000\u0000\u0082\u0080\u0001"+ + "\u0000\u0000\u0000\u0082\u0083\u0001\u0000\u0000\u0000\u0083\u0085\u0001"+ + "\u0000\u0000\u0000\u0084\u0082\u0001\u0000\u0000\u0000\u0085\u0086\u0005"+ + "!\u0000\u0000\u0086\u0011\u0001\u0000\u0000\u0000\u0087\u0089\u0005\u0006"+ + "\u0000\u0000\u0088\u008a\u0003\"\u0011\u0000\u0089\u0088\u0001\u0000\u0000"+ + "\u0000\u0089\u008a\u0001\u0000\u0000\u0000\u008a\u008b\u0001\u0000\u0000"+ + "\u0000\u008b\u008c\u0005\u0018\u0000\u0000\u008c\u008d\u0005!\u0000\u0000"+ + "\u008d\u0013\u0001\u0000\u0000\u0000\u008e\u008f\u0007\u0000\u0000\u0000"+ + "\u008f\u0015\u0001\u0000\u0000\u0000\u0090\u0092\u0003(\u0014\u0000\u0091"+ + "\u0090\u0001\u0000\u0000\u0000\u0091\u0092\u0001\u0000\u0000\u0000\u0092"+ + "\u0094\u0001\u0000\u0000\u0000\u0093\u0095\u0003\"\u0011\u0000\u0094\u0093"+ + "\u0001\u0000\u0000\u0000\u0094\u0095\u0001\u0000\u0000\u0000\u0095\u0097"+ + "\u0001\u0000\u0000\u0000\u0096\u0098\u0003&\u0013\u0000\u0097\u0096\u0001"+ + "\u0000\u0000\u0000\u0097\u0098\u0001\u0000\u0000\u0000\u0098\u0099\u0001"+ + "\u0000\u0000\u0000\u0099\u009a\u0005\u0018\u0000\u0000\u009a\u009c\u0005"+ + "\u001e\u0000\u0000\u009b\u009d\u0003\u001a\r\u0000\u009c\u009b\u0001\u0000"+ + "\u0000\u0000\u009c\u009d\u0001\u0000\u0000\u0000\u009d\u009e\u0001\u0000"+ + "\u0000\u0000\u009e\u00a3\u0005\u001f\u0000\u0000\u009f\u00a0\u0005\u0004"+ + "\u0000\u0000\u00a0\u00a2\u0005\u0018\u0000\u0000\u00a1\u009f\u0001\u0000"+ + "\u0000\u0000\u00a2\u00a5\u0001\u0000\u0000\u0000\u00a3\u00a1\u0001\u0000"+ + "\u0000\u0000\u00a3\u00a4\u0001\u0000\u0000\u0000\u00a4\u00a6\u0001\u0000"+ + "\u0000\u0000\u00a5\u00a3\u0001\u0000\u0000\u0000\u00a6\u00a7\u0003\u0018"+ + "\f\u0000\u00a7\u0017\u0001\u0000\u0000\u0000\u00a8\u00ac\u0005#\u0000"+ + "\u0000\u00a9\u00ab\u0003\u001e\u000f\u0000\u00aa\u00a9\u0001\u0000\u0000"+ + "\u0000\u00ab\u00ae\u0001\u0000\u0000\u0000\u00ac\u00aa\u0001\u0000\u0000"+ + "\u0000\u00ac\u00ad\u0001\u0000\u0000\u0000\u00ad\u00af\u0001\u0000\u0000"+ + "\u0000\u00ae\u00ac\u0001\u0000\u0000\u0000\u00af\u00b0\u0003\u001c\u000e"+ + "\u0000\u00b0\u00b1\u0005$\u0000\u0000\u00b1\u0019\u0001\u0000\u0000\u0000"+ + "\u00b2\u00b7\u0003 \u0010\u0000\u00b3\u00b4\u0005\"\u0000\u0000\u00b4"+ + "\u00b6\u0003 \u0010\u0000\u00b5\u00b3\u0001\u0000\u0000\u0000\u00b6\u00b9"+ + "\u0001\u0000\u0000\u0000\u00b7\u00b5\u0001\u0000\u0000\u0000\u00b7\u00b8"+ + "\u0001\u0000\u0000\u0000\u00b8\u001b\u0001\u0000\u0000\u0000\u00b9\u00b7"+ + "\u0001\u0000\u0000\u0000\u00ba\u00bb\u0005\t\u0000\u0000\u00bb\u00c0\u0003"+ + " \u0010\u0000\u00bc\u00bd\u0005\"\u0000\u0000\u00bd\u00bf\u0003 \u0010"+ + "\u0000\u00be\u00bc\u0001\u0000\u0000\u0000\u00bf\u00c2\u0001\u0000\u0000"+ + "\u0000\u00c0\u00be\u0001\u0000\u0000\u0000\u00c0\u00c1\u0001\u0000\u0000"+ + "\u0000\u00c1\u00c3\u0001\u0000\u0000\u0000\u00c2\u00c0\u0001\u0000\u0000"+ + "\u0000\u00c3\u00c4\u0005!\u0000\u0000\u00c4\u001d\u0001\u0000\u0000\u0000"+ + "\u00c5\u00c6\u0005\u0005\u0000\u0000\u00c6\u00c7\u0005\u0018\u0000\u0000"+ + "\u00c7\u00c8\u0005 \u0000\u0000\u00c8\u00c9\u0005\u0019\u0000\u0000\u00c9"+ + "\u00ca\u0005!\u0000\u0000\u00ca\u001f\u0001\u0000\u0000\u0000\u00cb\u00cd"+ + "\u0003$\u0012\u0000\u00cc\u00ce\u0005\n\u0000\u0000\u00cd\u00cc\u0001"+ + "\u0000\u0000\u0000\u00cd\u00ce\u0001\u0000\u0000\u0000\u00ce\u00cf\u0001"+ + "\u0000\u0000\u0000\u00cf\u00d0\u0005\u0018\u0000\u0000\u00d0!\u0001\u0000"+ + "\u0000\u0000\u00d1\u00d2\u0007\u0001\u0000\u0000\u00d2#\u0001\u0000\u0000"+ + "\u0000\u00d3\u00d4\u0007\u0002\u0000\u0000\u00d4%\u0001\u0000\u0000\u0000"+ + "\u00d5\u00d6\u0007\u0003\u0000\u0000\u00d6\'\u0001\u0000\u0000\u0000\u00d7"+ + "\u00d8\u0005\u001a\u0000\u0000\u00d8)\u0001\u0000\u0000\u0000\u001b,."+ + "35>AOXZ^`cfmsy\u0082\u0089\u0091\u0094\u0097\u009c\u00a3\u00ac\u00b7\u00c0"+ + "\u00cd"; + 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/org/lumijiez/parser/WinxVisitor.java b/src/main/java/org/lumijiez/parser/WinxVisitor.java new file mode 100644 index 0000000..e6245a6 --- /dev/null +++ b/src/main/java/org/lumijiez/parser/WinxVisitor.java @@ -0,0 +1,139 @@ +// Generated from D:/Source/JavaProjects/dsl-formal-requirements/src/grammars/Winx.g4 by ANTLR 4.13.1 +package org.lumijiez.parser; +import org.antlr.v4.runtime.tree.ParseTreeVisitor; + +/** + * This interface defines a complete generic visitor for a parse tree produced + * by {@link WinxParser}. + * + * @param The return type of the visit operation. Use {@link Void} for + * operations with no return type. + */ +public interface WinxVisitor extends ParseTreeVisitor { + /** + * Visit a parse tree produced by {@link WinxParser#winx}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitWinx(WinxParser.WinxContext ctx); + /** + * Visit a parse tree produced by {@link WinxParser#body}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitBody(WinxParser.BodyContext ctx); + /** + * Visit a parse tree produced by {@link WinxParser#package}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitPackage(WinxParser.PackageContext ctx); + /** + * Visit a parse tree produced by {@link WinxParser#interface}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitInterface(WinxParser.InterfaceContext ctx); + /** + * Visit a parse tree produced by {@link WinxParser#specification}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitSpecification(WinxParser.SpecificationContext ctx); + /** + * Visit a parse tree produced by {@link WinxParser#interface_body}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitInterface_body(WinxParser.Interface_bodyContext ctx); + /** + * Visit a parse tree produced by {@link WinxParser#specification_body}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitSpecification_body(WinxParser.Specification_bodyContext ctx); + /** + * Visit a parse tree produced by {@link WinxParser#requirementSpec}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitRequirementSpec(WinxParser.RequirementSpecContext ctx); + /** + * Visit a parse tree produced by {@link WinxParser#req_specification}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitReq_specification(WinxParser.Req_specificationContext ctx); + /** + * Visit a parse tree produced by {@link WinxParser#result_specification}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitResult_specification(WinxParser.Result_specificationContext ctx); + /** + * Visit a parse tree produced by {@link WinxParser#logical_op}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitLogical_op(WinxParser.Logical_opContext ctx); + /** + * Visit a parse tree produced by {@link WinxParser#functionSpec}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitFunctionSpec(WinxParser.FunctionSpecContext ctx); + /** + * Visit a parse tree produced by {@link WinxParser#functionBody}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitFunctionBody(WinxParser.FunctionBodyContext ctx); + /** + * Visit a parse tree produced by {@link WinxParser#input_types}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitInput_types(WinxParser.Input_typesContext ctx); + /** + * Visit a parse tree produced by {@link WinxParser#return_types}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitReturn_types(WinxParser.Return_typesContext ctx); + /** + * Visit a parse tree produced by {@link WinxParser#specificationEntry}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitSpecificationEntry(WinxParser.SpecificationEntryContext ctx); + /** + * Visit a parse tree produced by {@link WinxParser#variable}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitVariable(WinxParser.VariableContext ctx); + /** + * Visit a parse tree produced by {@link WinxParser#importance}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitImportance(WinxParser.ImportanceContext ctx); + /** + * Visit a parse tree produced by {@link WinxParser#type}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitType(WinxParser.TypeContext ctx); + /** + * Visit a parse tree produced by {@link WinxParser#access_modifiers}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitAccess_modifiers(WinxParser.Access_modifiersContext ctx); + /** + * Visit a parse tree produced by {@link WinxParser#description}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitDescription(WinxParser.DescriptionContext ctx); +} \ No newline at end of file diff --git a/src/main/resources/TestProgram.txt b/src/main/resources/TestProgram.txt index 705dc54..a60ec75 100644 --- a/src/main/resources/TestProgram.txt +++ b/src/main/resources/TestProgram.txt @@ -1,22 +1,38 @@ +~A package defines a full set of specifications for a general set of features~ package Database { - ~This is for comments, or descriptions~ - critical DatabaseAccess { - optional @UserHasAdminAccess; - critical @UserIsNotBanned; + ~An interface holds an abstract structure to be implemented in a specification~ + critical interface Database { - result optional DatabaseAdminPanel; - result critical DatabaseVisualizerPanel; - result Clock; + ~This is a variably abstract functional specification~ + critical public GetUserList(FLOAT[] x, STRING ag) { + @ExecTime : "10s"; + @MaxReturnVals : "10s"; + return INT x; + } } - ~This is for comments, or explanations~ - critical public GetUserList(FLOAT[] x, STRING ag) { - @ExecTime : "10s"; - @MaxReturnVals : "10s"; - return INT x; - } + ~A specification is a concrete implementation of requirement specifications~ + ~It might or might not implement an interface~ + specification DatabaseAccess implements Database { + ~This is a concrete non-functional specification~ + critical DatabaseAccessMember { + optional @UserHasAdminAccess; + critical @UserIsNotBanned; + + result optional DatabaseAdminPanel; + result critical DatabaseVisualizerPanel; + result Clock; + } + + ~This is a concrete functional specification, it might implement an interface~ + critical public GetUserList(FLOAT[] x, STRING ag) implements DatabaseAccessImpl { + @ExecTime : "10s"; + @MaxReturnVals : "10s"; + return INT x; + } + } }