Skip to content

Commit

Permalink
Labeling scalar values and adding python visitor, v0.10.0
Browse files Browse the repository at this point in the history
  • Loading branch information
godber committed Feb 19, 2015
1 parent 0e45b58 commit 2d38e1b
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 16 deletions.
2 changes: 1 addition & 1 deletion antlr_grammar/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ all: clean $(PYTARGETS) build-java/ODLv21Lexer.java
javac build-java/*.java

$(PYTARGETS): ODLv21.g4
$(antlr4) ODLv21.g4 -o build-python -Dlanguage=Python2
$(antlr4) ODLv21.g4 -o build-python -visitor -Dlanguage=Python2

build-java/ODLv21Lexer.java: ODLv21.g4
$(antlr4) ODLv21.g4 -o build-java
Expand Down
28 changes: 14 additions & 14 deletions antlr_grammar/ODLv21.g4
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,13 @@ set_value
;

scalar_value
: INTEGER (units_expression)?
| BASED_INTEGER (units_expression)?
| FLOAT (units_expression)?
| SCALED_REAL (units_expression)?
| IDENTIFIER
| SYMBOL_STRING
| STRING
: INTEGER (units_expression)? # ScalarInteger
| BASED_INTEGER (units_expression)? # ScalarBasedInteger
| FLOAT (units_expression)? # ScalarFloat
| SCALED_REAL (units_expression)? # ScalarScaledReal
| IDENTIFIER # ScalarIdentifier
| SYMBOL_STRING # ScalarSymbol
| STRING # ScalarString
;

units_expression
Expand All @@ -100,8 +100,8 @@ DATE
;

TIME
: HH_MM_SS // HH:MM(:SS)
| HH_MM_SS 'Z' // HH:MM(:SS)Z
: HH_MM_SS // HH:MM(:SS)
| HH_MM_SS 'Z' // HH:MM(:SS)Z
| HH_MM_SS SIGN DIGIT+ // HH:MM(:SS)+N
;

Expand All @@ -114,7 +114,7 @@ YEAR_DOY
;

HH_MM_SS
: DIGIT DIGIT ':' DIGIT DIGIT (':' DIGIT DIGIT)? // HH:MM(:SS)
: DIGIT DIGIT ':' DIGIT DIGIT (':' DIGIT DIGIT)? // HH:MM(:SS)
| DIGIT DIGIT ':' DIGIT DIGIT (':' DIGIT DIGIT '.' DIGIT+)? // HH:MM(:SS.FF)
;

Expand Down Expand Up @@ -145,13 +145,13 @@ SYMBOL_STRING

// Unscaled Real: 12.3.1.3
FLOAT
: (SIGN)? DIGIT+ '.' DIGIT* // 1.23 1. 1.123123
| (SIGN)? '.' DIGIT+ // .1 .123123
: (SIGN)? DIGIT+ '.' DIGIT* // 1.23 1. 1.123123
| (SIGN)? '.' DIGIT+ // .1 .123123
;

SCALED_REAL
: FLOAT ('E'|'e') INTEGER // 1.0E5, .5e3
| INTEGER ('E'|'e') INTEGER // 3145e3 - Handling an integer mantissa
: FLOAT ('E'|'e') INTEGER // 1.0E5, .5e3
| INTEGER ('E'|'e') INTEGER // 3145e3 - Handling an integer mantissa
;

BASED_INTEGER
Expand Down
2 changes: 1 addition & 1 deletion antlr_grammar/VERSION.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v0.9.0
v0.10.0

0 comments on commit 2d38e1b

Please sign in to comment.