diff --git a/glsl/GLSLLexer.g4 b/glsl/GLSLLexer.g4 index b8a139e7e7..4212b1aa22 100644 --- a/glsl/GLSLLexer.g4 +++ b/glsl/GLSLLexer.g4 @@ -1,26 +1,23 @@ /* -MIT License - -Copyright (c) 2022 Mustafa Said Ağca - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. -*/ + MIT License + + Copyright (c) 2022 Mustafa Said Ağca + + Permission is hereby granted, free of charge, to any person obtaining a copy of this software and + associated documentation files (the "Software"), to deal in the Software without restriction, + including without limitation the rights to use, copy, modify, merge, publish, distribute, + sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all copies or + substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT + NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, + DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT + OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ // $antlr-format alignTrailingComments true, columnLimit 150, maxEmptyLinesToKeep 1, reflowComments false, useTab false // $antlr-format allowShortRulesOnASingleLine true, allowShortBlocksOnASingleLine true, minEmptyLines 0, alignSemicolons ownLine @@ -262,7 +259,7 @@ LEFT_PAREN : '('; MOD_ASSIGN : '%='; MUL_ASSIGN : '*='; NE_OP : '!='; -NUMBER_SIGN : '#' -> channel (DIRECTIVES), pushMode (DIRECTIVE_MODE); +NUMBER_SIGN : '#' -> channel(DIRECTIVES), pushMode(DIRECTIVE_MODE); OR_ASSIGN : '|='; OR_OP : '||'; PERCENT : '%'; @@ -293,100 +290,100 @@ FLOATCONSTANT: ; INTCONSTANT : DECIMAL_CONSTANT | HEX_CONSTANT | OCTAL_CONSTANT; UINTCONSTANT : INTCONSTANT INTEGER_SUFFIX; -BLOCK_COMMENT : '/*' .*? '*/' -> channel (COMMENTS); -LINE_COMMENT : '//' (~ [\r\n\\] | '\\' (NEWLINE | .))* -> channel (COMMENTS); -LINE_CONTINUATION : '\\' NEWLINE -> channel (HIDDEN); +BLOCK_COMMENT : '/*' .*? '*/' -> channel(COMMENTS); +LINE_COMMENT : '//' (~ [\r\n\\] | '\\' (NEWLINE | .))* -> channel(COMMENTS); +LINE_CONTINUATION : '\\' NEWLINE -> channel(HIDDEN); IDENTIFIER : [a-zA-Z_] [a-zA-Z0-9_]*; -WHITE_SPACE : [ \t\r\n]+ -> channel (HIDDEN); +WHITE_SPACE : [ \t\r\n]+ -> channel(HIDDEN); mode DIRECTIVE_MODE; -DEFINE_DIRECTIVE : 'define' -> channel (DIRECTIVES), mode (DEFINE_DIRECTIVE_MODE); -ELIF_DIRECTIVE : 'elif' -> channel (DIRECTIVES), popMode, mode (ELIF_DIRECTIVE_MODE); -ELSE_DIRECTIVE : 'else' -> channel (DIRECTIVES), popMode, mode (PROGRAM_TEXT_MODE); -ENDIF_DIRECTIVE : 'endif' -> channel (DIRECTIVES), popMode, popMode, popMode; -ERROR_DIRECTIVE : 'error' -> channel (DIRECTIVES), mode (ERROR_DIRECTIVE_MODE); -EXTENSION_DIRECTIVE : 'extension' -> channel (DIRECTIVES), mode (EXTENSION_DIRECTIVE_MODE); -IF_DIRECTIVE : 'if' -> channel (DIRECTIVES), mode (IF_DIRECTIVE_MODE); -IFDEF_DIRECTIVE : 'ifdef' -> channel (DIRECTIVES), mode (IFDEF_DIRECTIVE_MODE); -IFNDEF_DIRECTIVE : 'ifndef' -> channel (DIRECTIVES), mode (IFDEF_DIRECTIVE_MODE); -LINE_DIRECTIVE : 'line' -> channel (DIRECTIVES), mode (LINE_DIRECTIVE_MODE); -PRAGMA_DIRECTIVE : 'pragma' -> channel (DIRECTIVES), mode (PRAGMA_DIRECTIVE_MODE); -UNDEF_DIRECTIVE : 'undef' -> channel (DIRECTIVES), mode (UNDEF_DIRECTIVE_MODE); -VERSION_DIRECTIVE : 'version' -> channel (DIRECTIVES), mode (VERSION_DIRECTIVE_MODE); -SPACE_TAB_0 : SPACE_TAB -> skip; -NEWLINE_0 : NEWLINE -> skip, popMode; +DEFINE_DIRECTIVE : 'define' -> channel(DIRECTIVES), mode(DEFINE_DIRECTIVE_MODE); +ELIF_DIRECTIVE : 'elif' -> channel(DIRECTIVES), popMode, mode(ELIF_DIRECTIVE_MODE); +ELSE_DIRECTIVE : 'else' -> channel(DIRECTIVES), popMode, mode(PROGRAM_TEXT_MODE); +ENDIF_DIRECTIVE : 'endif' -> channel(DIRECTIVES), popMode, popMode, popMode; +ERROR_DIRECTIVE : 'error' -> channel(DIRECTIVES), mode(ERROR_DIRECTIVE_MODE); +EXTENSION_DIRECTIVE : 'extension' -> channel(DIRECTIVES), mode(EXTENSION_DIRECTIVE_MODE); +IF_DIRECTIVE : 'if' -> channel(DIRECTIVES), mode(IF_DIRECTIVE_MODE); +IFDEF_DIRECTIVE : 'ifdef' -> channel(DIRECTIVES), mode(IFDEF_DIRECTIVE_MODE); +IFNDEF_DIRECTIVE : 'ifndef' -> channel(DIRECTIVES), mode(IFDEF_DIRECTIVE_MODE); +LINE_DIRECTIVE : 'line' -> channel(DIRECTIVES), mode(LINE_DIRECTIVE_MODE); +PRAGMA_DIRECTIVE : 'pragma' -> channel(DIRECTIVES), mode(PRAGMA_DIRECTIVE_MODE); +UNDEF_DIRECTIVE : 'undef' -> channel(DIRECTIVES), mode(UNDEF_DIRECTIVE_MODE); +VERSION_DIRECTIVE : 'version' -> channel(DIRECTIVES), mode(VERSION_DIRECTIVE_MODE); +SPACE_TAB_0 : SPACE_TAB -> channel(HIDDEN), type(WHITE_SPACE); +NEWLINE_0 : NEWLINE -> channel(HIDDEN), type(WHITE_SPACE), popMode; mode DEFINE_DIRECTIVE_MODE; -MACRO_NAME : IDENTIFIER MACRO_ARGS? -> channel (DIRECTIVES), mode (MACRO_TEXT_MODE); -NEWLINE_1 : NEWLINE -> skip, popMode; -SPACE_TAB_1 : SPACE_TAB -> skip; +MACRO_NAME : IDENTIFIER MACRO_ARGS? -> channel(DIRECTIVES), mode(MACRO_TEXT_MODE); +NEWLINE_1 : NEWLINE -> channel(HIDDEN), type(WHITE_SPACE), popMode; +SPACE_TAB_1 : SPACE_TAB -> channel(HIDDEN), type(WHITE_SPACE); mode ELIF_DIRECTIVE_MODE; -CONSTANT_EXPRESSION : ~ [\r\n]+ -> channel (DIRECTIVES); -NEWLINE_2 : NEWLINE -> skip, mode (PROGRAM_TEXT_MODE); +CONSTANT_EXPRESSION : ~ [\r\n]+ -> channel(DIRECTIVES); +NEWLINE_2 : NEWLINE -> channel(HIDDEN), type(WHITE_SPACE), mode(PROGRAM_TEXT_MODE); mode ERROR_DIRECTIVE_MODE; -ERROR_MESSAGE : ~ [\r\n]+ -> channel (DIRECTIVES); -NEWLINE_3 : NEWLINE -> skip, popMode; +ERROR_MESSAGE : ~ [\r\n]+ -> channel(DIRECTIVES); +NEWLINE_3 : NEWLINE -> channel(HIDDEN), type(WHITE_SPACE), popMode; mode EXTENSION_DIRECTIVE_MODE; -BEHAVIOR : ('require' | 'enable' | 'warn' | 'disable') -> channel (DIRECTIVES); -COLON_0 : COLON -> channel (DIRECTIVES), type (COLON); -EXTENSION_NAME : IDENTIFIER -> channel (DIRECTIVES); -NEWLINE_4 : NEWLINE -> skip, popMode; -SPACE_TAB_2 : SPACE_TAB -> skip; +BEHAVIOR : ('require' | 'enable' | 'warn' | 'disable') -> channel(DIRECTIVES); +COLON_0 : COLON -> channel(DIRECTIVES), type(COLON); +EXTENSION_NAME : IDENTIFIER -> channel(DIRECTIVES); +NEWLINE_4 : NEWLINE -> channel(HIDDEN), type(WHITE_SPACE), popMode; +SPACE_TAB_2 : SPACE_TAB -> channel(HIDDEN), type(WHITE_SPACE); mode IF_DIRECTIVE_MODE; -CONSTANT_EXPRESSION_0 : CONSTANT_EXPRESSION -> channel (DIRECTIVES), type (CONSTANT_EXPRESSION); -NEWLINE_5 : NEWLINE -> skip, pushMode (PROGRAM_TEXT_MODE); +CONSTANT_EXPRESSION_0 : CONSTANT_EXPRESSION -> channel(DIRECTIVES), type(CONSTANT_EXPRESSION); +NEWLINE_5 : NEWLINE -> channel(HIDDEN), type(WHITE_SPACE), pushMode(PROGRAM_TEXT_MODE); mode IFDEF_DIRECTIVE_MODE; -MACRO_IDENTIFIER : IDENTIFIER -> channel (DIRECTIVES); -NEWLINE_6 : NEWLINE -> skip, pushMode (PROGRAM_TEXT_MODE); -SPACE_TAB_3 : SPACE_TAB -> skip; +MACRO_IDENTIFIER : IDENTIFIER -> channel(DIRECTIVES); +NEWLINE_6 : NEWLINE -> channel(HIDDEN), type(WHITE_SPACE), pushMode(PROGRAM_TEXT_MODE); +SPACE_TAB_3 : SPACE_TAB -> channel(HIDDEN), type(WHITE_SPACE); mode LINE_DIRECTIVE_MODE; -LINE_EXPRESSION : ~ [\r\n]+ -> channel (DIRECTIVES); -NEWLINE_7 : NEWLINE -> skip, mode (PROGRAM_TEXT_MODE); +LINE_EXPRESSION : ~ [\r\n]+ -> channel(DIRECTIVES); +NEWLINE_7 : NEWLINE -> channel(HIDDEN), type(WHITE_SPACE), mode(PROGRAM_TEXT_MODE); mode MACRO_TEXT_MODE; -BLOCK_COMMENT_0 : BLOCK_COMMENT -> channel (COMMENTS), type(BLOCK_COMMENT); +BLOCK_COMMENT_0 : BLOCK_COMMENT -> channel(COMMENTS), type(BLOCK_COMMENT); MACRO_ESC_NEWLINE : '\\' NEWLINE -> channel(DIRECTIVES); -MACRO_ESC_SEQUENCE : '\\' . -> channel(DIRECTIVES), type (MACRO_TEXT); -MACRO_TEXT : ~ [/\r\n\\]+ -> channel (DIRECTIVES); -NEWLINE_8 : NEWLINE -> skip, popMode; +MACRO_ESC_SEQUENCE : '\\' . -> channel(DIRECTIVES), type(MACRO_TEXT); +MACRO_TEXT : ~ [/\r\n\\]+ -> channel(DIRECTIVES); +NEWLINE_8 : NEWLINE -> channel(HIDDEN), type(WHITE_SPACE), popMode; SLASH_0 : SLASH -> more; mode PRAGMA_DIRECTIVE_MODE; -DEBUG : 'debug' -> channel (DIRECTIVES); -LEFT_PAREN_0 : LEFT_PAREN -> channel (DIRECTIVES), type (LEFT_PAREN); -NEWLINE_9 : NEWLINE -> skip, popMode; -OFF : 'off' -> channel (DIRECTIVES); -ON : 'on' -> channel (DIRECTIVES); -OPTIMIZE : 'optimize' -> channel (DIRECTIVES); -RIGHT_PAREN_0 : RIGHT_PAREN -> channel (DIRECTIVES), type (RIGHT_PAREN); -SPACE_TAB_5 : SPACE_TAB -> skip; -STDGL : 'STDGL' -> channel (DIRECTIVES); +DEBUG : 'debug' -> channel(DIRECTIVES); +LEFT_PAREN_0 : LEFT_PAREN -> channel(DIRECTIVES), type(LEFT_PAREN); +NEWLINE_9 : NEWLINE -> channel(HIDDEN), type(WHITE_SPACE), popMode; +OFF : 'off' -> channel(DIRECTIVES); +ON : 'on' -> channel(DIRECTIVES); +OPTIMIZE : 'optimize' -> channel(DIRECTIVES); +RIGHT_PAREN_0 : RIGHT_PAREN -> channel(DIRECTIVES), type(RIGHT_PAREN); +SPACE_TAB_5 : SPACE_TAB -> channel(HIDDEN), type(WHITE_SPACE); +STDGL : 'STDGL' -> channel(DIRECTIVES); mode PROGRAM_TEXT_MODE; -BLOCK_COMMENT_1 : BLOCK_COMMENT -> channel (COMMENTS), type (BLOCK_COMMENT); -LINE_COMMENT_0 : LINE_COMMENT -> channel (COMMENTS), type (LINE_COMMENT); +BLOCK_COMMENT_1 : BLOCK_COMMENT -> channel(COMMENTS), type(BLOCK_COMMENT); +LINE_COMMENT_0 : LINE_COMMENT -> channel(COMMENTS), type(LINE_COMMENT); NUMBER_SIGN_0: - NUMBER_SIGN -> channel (DIRECTIVES), type (NUMBER_SIGN), pushMode (DIRECTIVE_MODE) + NUMBER_SIGN -> channel(DIRECTIVES), type(NUMBER_SIGN), pushMode(DIRECTIVE_MODE) ; -PROGRAM_TEXT : ~ [#/]+ -> channel (DIRECTIVES); +PROGRAM_TEXT : ~ [#/]+ -> channel(DIRECTIVES); SLASH_1 : SLASH -> more; mode UNDEF_DIRECTIVE_MODE; -MACRO_IDENTIFIER_0 : MACRO_IDENTIFIER -> channel (DIRECTIVES), type (MACRO_IDENTIFIER); -NEWLINE_10 : NEWLINE -> skip, popMode; -SPACE_TAB_6 : SPACE_TAB -> skip; +MACRO_IDENTIFIER_0 : MACRO_IDENTIFIER -> channel(DIRECTIVES), type(MACRO_IDENTIFIER); +NEWLINE_10 : NEWLINE -> channel(HIDDEN), type(WHITE_SPACE), popMode; +SPACE_TAB_6 : SPACE_TAB -> channel(HIDDEN), type(WHITE_SPACE); mode VERSION_DIRECTIVE_MODE; -NEWLINE_11 : NEWLINE -> skip, popMode; -NUMBER : [0-9]+ -> channel (DIRECTIVES); -PROFILE : ('core' | 'compatibility' | 'es') -> channel (DIRECTIVES); -SPACE_TAB_7 : SPACE_TAB -> skip; +NEWLINE_11 : NEWLINE -> channel(HIDDEN), type(WHITE_SPACE), popMode; +NUMBER : [0-9]+ -> channel(DIRECTIVES); +PROFILE : ('core' | 'compatibility' | 'es') -> channel(DIRECTIVES); +SPACE_TAB_7 : SPACE_TAB -> channel(HIDDEN), type(WHITE_SPACE); fragment DECIMAL_CONSTANT : [1-9] [0-9]*; fragment DIGIT_SEQUENCE : [0-9]+; diff --git a/glsl/GLSLParser.g4 b/glsl/GLSLParser.g4 index 4630491785..456f71fb07 100644 --- a/glsl/GLSLParser.g4 +++ b/glsl/GLSLParser.g4 @@ -1,26 +1,23 @@ /* -MIT License - -Copyright (c) 2022 Mustafa Said Ağca - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. -*/ + MIT License + + Copyright (c) 2022 Mustafa Said Ağca + + Permission is hereby granted, free of charge, to any person obtaining a copy of this software and + associated documentation files (the "Software"), to deal in the Software without restriction, + including without limitation the rights to use, copy, modify, merge, publish, distribute, + sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all copies or + substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT + NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, + DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT + OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ // $antlr-format alignTrailingComments true, columnLimit 150, minEmptyLines 1, maxEmptyLinesToKeep 1, reflowComments false, useTab false // $antlr-format allowShortRulesOnASingleLine false, allowShortBlocksOnASingleLine true, alignSemicolons hanging, alignColons hanging diff --git a/glsl/GLSLPreParser.g4 b/glsl/GLSLPreParser.g4 index 952237d1eb..0b74899669 100644 --- a/glsl/GLSLPreParser.g4 +++ b/glsl/GLSLPreParser.g4 @@ -1,26 +1,23 @@ /* -MIT License - -Copyright (c) 2022 Mustafa Said Ağca - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. -*/ + MIT License + + Copyright (c) 2022 Mustafa Said Ağca + + Permission is hereby granted, free of charge, to any person obtaining a copy of this software and + associated documentation files (the "Software"), to deal in the Software without restriction, + including without limitation the rights to use, copy, modify, merge, publish, distribute, + sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all copies or + substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT + NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, + DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT + OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ // $antlr-format alignTrailingComments true, columnLimit 150, minEmptyLines 1, maxEmptyLinesToKeep 1, reflowComments false, useTab false // $antlr-format allowShortRulesOnASingleLine false, allowShortBlocksOnASingleLine true, alignSemicolons hanging, alignColons hanging diff --git a/verilog/systemverilog/SystemVerilogLexer.g4 b/verilog/systemverilog/SystemVerilogLexer.g4 index 19881f3d57..adbc665da2 100755 --- a/verilog/systemverilog/SystemVerilogLexer.g4 +++ b/verilog/systemverilog/SystemVerilogLexer.g4 @@ -1,26 +1,23 @@ /* -MIT License - -Copyright (c) 2022 Mustafa Said Ağca - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. -*/ + MIT License + + Copyright (c) 2022 Mustafa Said Ağca + + Permission is hereby granted, free of charge, to any person obtaining a copy of this software and + associated documentation files (the "Software"), to deal in the Software without restriction, + including without limitation the rights to use, copy, modify, merge, publish, distribute, + sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all copies or + substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT + NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, + DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT + OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ // $antlr-format alignTrailingComments true, columnLimit 150, maxEmptyLinesToKeep 1, reflowComments false, useTab false // $antlr-format allowShortRulesOnASingleLine true, allowShortBlocksOnASingleLine true, minEmptyLines 0, alignSemicolons ownLine @@ -536,8 +533,8 @@ NEWLINE_9 : NEWLINE -> channel(HIDDEN), type(WHITE_SPACE), mode(SOURCE_TEX SPACE_TAB_8 : SPACE_TAB -> channel(HIDDEN), type(WHITE_SPACE); mode ENDIF_DIRECTIVE_MODE; -NEWLINE_13 : NEWLINE -> channel(HIDDEN), type(WHITE_SPACE), popMode, popMode, popMode ; -SPACE_TAB_12 : SPACE_TAB -> channel(HIDDEN), type(WHITE_SPACE) ; +NEWLINE_13 : NEWLINE -> channel(HIDDEN), type(WHITE_SPACE), popMode, popMode, popMode; +SPACE_TAB_12 : SPACE_TAB -> channel(HIDDEN), type(WHITE_SPACE); mode FILENAME_MODE; DQ_1: DQ -> channel(DIRECTIVES), type(DQ), popMode; @@ -640,4 +637,4 @@ fragment ESC_SPECIAL_CHAR : '\\' ( [nt\\"vfa] | CHAR_HEX | CHAR_OCTAL); fragment IDENTIFIER : ESCAPED_IDENTIFIER | SIMPLE_IDENTIFIER; fragment MACRO_ARGS : '(' ( MACRO_ARGS | ASCII_NO_PARENTHESES)* ')'; fragment NEWLINE : '\r'? '\n'; -fragment SPACE_TAB : [ \t]+; +fragment SPACE_TAB : [ \t]+; \ No newline at end of file diff --git a/verilog/systemverilog/SystemVerilogParser.g4 b/verilog/systemverilog/SystemVerilogParser.g4 index 9e469e4ace..f12bc4243c 100644 --- a/verilog/systemverilog/SystemVerilogParser.g4 +++ b/verilog/systemverilog/SystemVerilogParser.g4 @@ -1,26 +1,23 @@ /* -MIT License - -Copyright (c) 2022 Mustafa Said Ağca - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. -*/ + MIT License + + Copyright (c) 2022 Mustafa Said Ağca + + Permission is hereby granted, free of charge, to any person obtaining a copy of this software and + associated documentation files (the "Software"), to deal in the Software without restriction, + including without limitation the rights to use, copy, modify, merge, publish, distribute, + sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all copies or + substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT + NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, + DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT + OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ // $antlr-format alignTrailingComments true, columnLimit 150, minEmptyLines 1, maxEmptyLinesToKeep 1, reflowComments false, useTab false // $antlr-format allowShortRulesOnASingleLine false, allowShortBlocksOnASingleLine true, alignSemicolons hanging, alignColons hanging diff --git a/verilog/systemverilog/SystemVerilogPreParser.g4 b/verilog/systemverilog/SystemVerilogPreParser.g4 index a9cf56d5cb..709fd42383 100755 --- a/verilog/systemverilog/SystemVerilogPreParser.g4 +++ b/verilog/systemverilog/SystemVerilogPreParser.g4 @@ -1,26 +1,23 @@ /* -MIT License - -Copyright (c) 2022 Mustafa Said Ağca - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. -*/ + MIT License + + Copyright (c) 2022 Mustafa Said Ağca + + Permission is hereby granted, free of charge, to any person obtaining a copy of this software and + associated documentation files (the "Software"), to deal in the Software without restriction, + including without limitation the rights to use, copy, modify, merge, publish, distribute, + sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all copies or + substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT + NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, + DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT + OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ // $antlr-format alignTrailingComments true, columnLimit 150, minEmptyLines 1, maxEmptyLinesToKeep 1, reflowComments false, useTab false // $antlr-format allowShortRulesOnASingleLine false, allowShortBlocksOnASingleLine true, alignSemicolons hanging, alignColons hanging diff --git a/verilog/verilog/VerilogLexer.g4 b/verilog/verilog/VerilogLexer.g4 index b330a6fa8b..ea09592ea9 100644 --- a/verilog/verilog/VerilogLexer.g4 +++ b/verilog/verilog/VerilogLexer.g4 @@ -1,26 +1,23 @@ /* -MIT License - -Copyright (c) 2022 Mustafa Said Ağca - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. -*/ + MIT License + + Copyright (c) 2022 Mustafa Said Ağca + + Permission is hereby granted, free of charge, to any person obtaining a copy of this software and + associated documentation files (the "Software"), to deal in the Software without restriction, + including without limitation the rights to use, copy, modify, merge, publish, distribute, + sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all copies or + substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT + NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, + DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT + OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ // $antlr-format alignTrailingComments true, columnLimit 150, maxEmptyLinesToKeep 1, reflowComments false, useTab false // $antlr-format allowShortRulesOnASingleLine true, allowShortBlocksOnASingleLine true, minEmptyLines 0, alignSemicolons ownLine @@ -363,8 +360,8 @@ NEWLINE_9 : NEWLINE -> channel(HIDDEN), type(WHITE_SPACE), mode(SOURCE_TEX SPACE_TAB_8 : SPACE_TAB -> channel(HIDDEN), type(WHITE_SPACE); mode ENDIF_DIRECTIVE_MODE; -NEWLINE_13 : NEWLINE -> channel(HIDDEN), type(WHITE_SPACE), popMode, popMode, popMode ; -SPACE_TAB_12 : SPACE_TAB -> channel(HIDDEN), type(WHITE_SPACE) ; +NEWLINE_13 : NEWLINE -> channel(HIDDEN), type(WHITE_SPACE), popMode, popMode, popMode; +SPACE_TAB_12 : SPACE_TAB -> channel(HIDDEN), type(WHITE_SPACE); mode FILENAME_MODE; DQ_1 : DQ -> channel(DIRECTIVES), type(DQ), popMode; @@ -458,4 +455,4 @@ fragment ESC_SPECIAL_CHAR : '\\' ( [nt\\"] | CHAR_OCTAL); fragment IDENTIFIER : ESCAPED_IDENTIFIER | SIMPLE_IDENTIFIER; fragment MACRO_ARGS : '(' ( MACRO_ARGS | ASCII_NO_PARENTHESES)* ')'; fragment NEWLINE : '\r'? '\n'; -fragment SPACE_TAB : [ \t]+; +fragment SPACE_TAB : [ \t]+; \ No newline at end of file diff --git a/verilog/verilog/VerilogParser.g4 b/verilog/verilog/VerilogParser.g4 index d0fa90eb77..add41742e8 100644 --- a/verilog/verilog/VerilogParser.g4 +++ b/verilog/verilog/VerilogParser.g4 @@ -1,26 +1,23 @@ /* -MIT License - -Copyright (c) 2022 Mustafa Said Ağca - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. -*/ + MIT License + + Copyright (c) 2022 Mustafa Said Ağca + + Permission is hereby granted, free of charge, to any person obtaining a copy of this software and + associated documentation files (the "Software"), to deal in the Software without restriction, + including without limitation the rights to use, copy, modify, merge, publish, distribute, + sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all copies or + substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT + NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, + DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT + OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ // $antlr-format alignTrailingComments true, columnLimit 150, minEmptyLines 1, maxEmptyLinesToKeep 1, reflowComments false, useTab false // $antlr-format allowShortRulesOnASingleLine false, allowShortBlocksOnASingleLine true, alignSemicolons hanging, alignColons hanging diff --git a/verilog/verilog/VerilogPreParser.g4 b/verilog/verilog/VerilogPreParser.g4 index 350b9f8d2b..b6a8cd8207 100644 --- a/verilog/verilog/VerilogPreParser.g4 +++ b/verilog/verilog/VerilogPreParser.g4 @@ -1,26 +1,23 @@ /* -MIT License - -Copyright (c) 2022 Mustafa Said Ağca - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. -*/ + MIT License + + Copyright (c) 2022 Mustafa Said Ağca + + Permission is hereby granted, free of charge, to any person obtaining a copy of this software and + associated documentation files (the "Software"), to deal in the Software without restriction, + including without limitation the rights to use, copy, modify, merge, publish, distribute, + sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all copies or + substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT + NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, + DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT + OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ // $antlr-format alignTrailingComments true, columnLimit 150, minEmptyLines 1, maxEmptyLinesToKeep 1, reflowComments false, useTab false // $antlr-format allowShortRulesOnASingleLine false, allowShortBlocksOnASingleLine true, alignSemicolons hanging, alignColons hanging