Skip to content

Commit

Permalink
For now keep the antlr/example grammars as is
Browse files Browse the repository at this point in the history
They serve special purposes and are not normal grammars.
  • Loading branch information
mike-lischke committed Nov 25, 2023
1 parent 63b8419 commit 35e5f38
Show file tree
Hide file tree
Showing 16 changed files with 4,154 additions and 4,272 deletions.
2,761 changes: 1,591 additions & 1,170 deletions antlr/antlr4/examples/CPP14.g4

Large diffs are not rendered by default.

18 changes: 3 additions & 15 deletions antlr/antlr4/examples/Hello.g4
Original file line number Diff line number Diff line change
@@ -1,18 +1,6 @@
// define a grammar called Hello

// $antlr-format alignTrailingComments true, columnLimit 150, minEmptyLines 1, maxEmptyLinesToKeep 1, reflowComments false, useTab false
// $antlr-format allowShortRulesOnASingleLine false, allowShortBlocksOnASingleLine true, alignSemicolons hanging, alignColons hanging

grammar Hello;
r : 'hello' ID;
ID : [a-z]+ ;
WS : [ \t\r\n]+ -> skip ;

r
: 'hello' ID
;

ID
: [a-z]+
;

WS
: [ \t\r\n]+ -> skip
;
5 changes: 1 addition & 4 deletions antlr/antlr4/examples/Issue1567.g4
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
// $antlr-format alignTrailingComments true, columnLimit 150, minEmptyLines 1, maxEmptyLinesToKeep 1, reflowComments false, useTab false
// $antlr-format allowShortRulesOnASingleLine false, allowShortBlocksOnASingleLine true, alignSemicolons hanging, alignColons hanging

grammar Sample;

options {
foo = {};
foo = {};
}

@members {
Expand Down
7 changes: 1 addition & 6 deletions antlr/antlr4/examples/LexerElementLabel.g4
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
// Testing that lexer rules must not contain element labels.

// $antlr-format alignTrailingComments true, columnLimit 150, maxEmptyLinesToKeep 1, reflowComments false, useTab false
// $antlr-format allowShortRulesOnASingleLine true, allowShortBlocksOnASingleLine true, minEmptyLines 0, alignSemicolons ownLine
// $antlr-format alignColons trailing, singleLineOverrulesHangingColon true, alignLexerCommands true, alignLabels true, alignTrailers true

lexer grammar LexerElementLabel;

Token: var = 'token';
Token : var='token' ;
Loading

0 comments on commit 35e5f38

Please sign in to comment.