diff options
author | 2021-06-28 17:16:56 +0200 | |
---|---|---|
committer | 2021-06-28 17:16:56 +0200 | |
commit | 82a2ca3c963e47611d1ba55f6938e7665488fc5a (patch) | |
tree | 6913165e6941526730c60f2cd3ed6678c387df44 /language/src/main/java/org/eclipse/viatra/solver | |
parent | Add scoping tests and simplify implicit nodes (diff) | |
download | refinery-82a2ca3c963e47611d1ba55f6938e7665488fc5a.tar.gz refinery-82a2ca3c963e47611d1ba55f6938e7665488fc5a.tar.zst refinery-82a2ca3c963e47611d1ba55f6938e7665488fc5a.zip |
Fix real literals
Diffstat (limited to 'language/src/main/java/org/eclipse/viatra/solver')
-rw-r--r-- | language/src/main/java/org/eclipse/viatra/solver/language/Problem.xtext | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/language/src/main/java/org/eclipse/viatra/solver/language/Problem.xtext b/language/src/main/java/org/eclipse/viatra/solver/language/Problem.xtext index 495f50e4..4aeb0acd 100644 --- a/language/src/main/java/org/eclipse/viatra/solver/language/Problem.xtext +++ b/language/src/main/java/org/eclipse/viatra/solver/language/Problem.xtext | |||
@@ -92,7 +92,7 @@ NodeValueAssertion: | |||
92 | node=[Node|QualifiedName] ":" value=Constant "."; | 92 | node=[Node|QualifiedName] ":" value=Constant "."; |
93 | 93 | ||
94 | Constant: | 94 | Constant: |
95 | IntConstant | RealConstant | StringConstant; | 95 | RealConstant | IntConstant | StringConstant; |
96 | 96 | ||
97 | IntConstant: | 97 | IntConstant: |
98 | intValue=Integer; | 98 | intValue=Integer; |
@@ -133,18 +133,21 @@ QualifiedName hidden(): | |||
133 | QUOTED_ID | Identifier ("::" Identifier)*; | 133 | QUOTED_ID | Identifier ("::" Identifier)*; |
134 | 134 | ||
135 | Identifier: | 135 | Identifier: |
136 | ID | "true" | "false" | "e" | "E"; | 136 | ID | "true" | "false"; |
137 | 137 | ||
138 | Integer returns ecore::EInt hidden(): | 138 | Integer returns ecore::EInt hidden(): |
139 | "-"? INT; | 139 | "-"? INT; |
140 | 140 | ||
141 | Real returns ecore::EDouble hidden(): | 141 | Real returns ecore::EDouble: |
142 | "-"? INT ("." INT | ("." INT)? ("e" | "E") ("-" | "+")? INT); | 142 | "-"? (EXPONENTIAL | INT "." (INT | EXPONENTIAL)); |
143 | 143 | ||
144 | @Override | 144 | @Override |
145 | terminal ID: | 145 | terminal ID: |
146 | ('a'..'z'|'A'..'Z'|'_') ('a'..'z'|'A'..'Z'|'_'|'0'..'9')*; | 146 | ('a'..'z'|'A'..'Z'|'_') ('a'..'z'|'A'..'Z'|'_'|'0'..'9')*; |
147 | 147 | ||
148 | terminal EXPONENTIAL: | ||
149 | INT ("e" | "E") ("+" | "-")? INT; | ||
150 | |||
148 | @Override | 151 | @Override |
149 | terminal STRING: | 152 | terminal STRING: |
150 | '"' ('\\' . /* 'b'|'t'|'n'|'f'|'r'|'u'|'"'|"'"|'\\' */ | !('\\' | '"'))* '"'; | 153 | '"' ('\\' . /* 'b'|'t'|'n'|'f'|'r'|'u'|'"'|"'"|'\\' */ | !('\\' | '"'))* '"'; |