Skip to content

Commit

Permalink
Works around antrl issue.
Browse files Browse the repository at this point in the history
  • Loading branch information
peter-takacs committed Mar 13, 2018
1 parent 17e2bda commit 3e586cf
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 34 deletions.
20 changes: 0 additions & 20 deletions karra_takacs/src/main/antlr4/qlviz/QL.g4
Original file line number Diff line number Diff line change
Expand Up @@ -31,29 +31,9 @@ booleanExpression : BOOLEAN

expression: numericExpression | booleanExpression;

//To skip New Lines, White spaces and comments
NEWLINE: ('\n' | '\r' | '\r\n') -> skip;
WHITESPACE : (' ' | '\n' | '\r' | '\t') -> skip;
COMMENT : ('/*' .*? '*/') ->skip;
LINE_COMMENT : '//' ~[\r\n]* ->skip;
BRACKET_OPEN : '{';
BRACKET_CLOSE: '}';
PAREN_OPEN: '(';
PAREN_CLOSE: ')';

QUESTION_DELIMITER: ':';

//keywords

IF :'if';
FORM_HEADER : 'form';


//literals
IDENTIFIER : [a-zA-Z0-1_]+;
NUMBER : [0-9]+(.[0-9]+)?;
BOOLEAN : 'true' | 'false';
STRING : '"' .*? '"';



Expand Down
21 changes: 21 additions & 0 deletions karra_takacs/src/main/antlr4/qlviz/QLCommon.g4
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,24 @@ QUESTION_TYPE: 'boolean'
| 'date'
| 'decimal'
;
//To skip New Lines, White spaces and comments
NEWLINE: ('\n' | '\r' | '\r\n') -> skip;
WHITESPACE : (' ' | '\n' | '\r' | '\t') -> skip;
COMMENT : ('/*' .*? '*/') ->skip;
LINE_COMMENT : '//' ~[\r\n]* ->skip;
BRACKET_OPEN : '{';
BRACKET_CLOSE: '}';
PAREN_OPEN: '(';
PAREN_CLOSE: ')';

//keywords
IF :'if';
FORM_HEADER : 'form';


//literals
IDENTIFIER : [a-zA-Z0-1_]+;
NUMBER : [0-9]+(.[0-9]+)?;
BOOLEAN : 'true' | 'false';
STRING : '"' .*? '"';

14 changes: 0 additions & 14 deletions karra_takacs/src/main/antlr4/qlviz/QLS.g4
Original file line number Diff line number Diff line change
Expand Up @@ -35,20 +35,6 @@ STYLESHEET: 'stylesheet';
PAGE: 'page';
WIDGET: 'widget';

// To skip New Lines, White spaces and comments
NEWLINE: ('\n' | '\r' | '\r\n') -> skip;
WHITESPACE : (' ' | '\n' | '\r' | '\t') -> skip;
COMMENT : ('/*' .*? '*/') ->skip;
LINE_COMMENT : '//' ~[\r\n]* ->skip;
BRACKET_OPEN : '{';
BRACKET_CLOSE: '}';
PAREN_OPEN: '(';
PAREN_CLOSE: ')';
PROPERTY_SEPARATOR: ':';

// Literals
IDENTIFIER : [a-zA-Z0-1_]+;
NUMBER : [0-9]+(.[0-9]+)?;
BOOLEAN : 'true' | 'false';
STRING : '"' .*? '"';
COLOR : '#' [a-fA-F0-9][a-fA-F0-9][a-fA-F0-9][a-fA-F0-9][a-fA-F0-9][a-fA-F0-9];

0 comments on commit 3e586cf

Please sign in to comment.