Skip to content

Commit 1cc0719

Browse files
author
vlamas
committed
fix: correct constraint usage in parser and lexer definitions
1 parent caa8148 commit 1cc0719

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

uvl/UVLLexer.g4

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ FEATURES_KEY: 'features';
88
IMPORTS_KEY: 'imports';
99
NAMESPACE_KEY: 'namespace';
1010
AS_KEY: 'as';
11+
CONSTRAINT_KEY: 'constraint';
1112
CONSTRAINTS_KEY: 'constraints';
1213
CARDINALITY_KEY: 'cardinality';
1314
STRING_KEY: 'String';
@@ -60,17 +61,17 @@ CLOSE_BRACE: '}';
6061
OPEN_COMMENT: '/*';
6162
CLOSE_COMMENT: '*/';
6263

63-
FLOAT: '-'? [0-9]* [.][0-9]+;
64-
INTEGER: '0' | '-'? [1-9][0-9]*;
64+
FLOAT: '-'?[0-9]*[.][0-9]+;
65+
INTEGER: '0' | '-'?[1-9][0-9]*;
6566
BOOLEAN: 'true' | 'false';
6667

6768
COMMA: ',';
6869
DOT: '.';
6970

70-
ID_NOT_STRICT: '"' ~[\r\n".]+ '"';
71+
ID_NOT_STRICT: '"'~[\r\n".]+'"';
7172
ID_STRICT: [a-zA-Z]([a-zA-Z0-9_#§%?\\'äüöß;])*;
7273

73-
STRING: '\'' ~[\r\n']+ '\'';
74+
STRING: '\''~[\r\n'.]+'\'';
7475

7576
SKIP_: ( SPACES | COMMENT) -> skip;
7677

uvl/UVLParser.g4

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ value: BOOLEAN | FLOAT | INTEGER | STRING | attributes | vector;
4444
vector: OPEN_BRACK (value (COMMA value)*)? CLOSE_BRACK;
4545

4646
constraintAttribute:
47-
CONSTRAINTS_KEY constraint # SingleConstraintAttribute
47+
CONSTRAINT_KEY constraint # SingleConstraintAttribute
4848
| CONSTRAINTS_KEY constraintList # ListConstraintAttribute;
4949
constraintList:
5050
OPEN_BRACK (constraint (COMMA constraint)*)? CLOSE_BRACK;

0 commit comments

Comments
 (0)