Commit 4016609d authored by Laurent MEYER's avatar Laurent MEYER
Browse files

* Added SYNONYMS parsing (internals only)

parent 69d43614
......@@ -123,6 +123,8 @@ tokens {
STRUCT;
FIELDS;
FIELD;
SYNONYM;
SYNONYM_LIST;
}
......@@ -263,9 +265,10 @@ content
| timer_declaration
| syntype_definition
| newtype_definition
| variable_definition)*
| variable_definition
| synonym_definition)*
-> ^(TEXTAREA_CONTENT
fpar* procedure* variable_definition* syntype_definition* newtype_definition* timer_declaration*);
fpar* procedure* variable_definition* syntype_definition* newtype_definition* timer_declaration* synonym_definition*);
timer_declaration
......@@ -315,6 +318,16 @@ variable_definition
end
-> ^(DCL variables_of_sort+);
synonym_definition
: internal_synonym_definition;
internal_synonym_definition
: SYNONYM synonym_definition_item (',' synonym_definition_item)* end
-> ^(SYNONYM_LIST synonym_definition_item+);
synonym_definition_item
: sort sort '=' ground_expression
-> ^(SYNONYM sort sort ground_expression);
variables_of_sort
: variable_id (',' variable_id)* sort (':=' ground_expression)?
......@@ -959,7 +972,7 @@ conditional_expression
: IF expression THEN expression ELSE expression FI;
synonym : ID; // synonym_id | external_synonym;
//synonym : ID; // synonym_id | external_synonym;
external_synonym
......@@ -1262,6 +1275,7 @@ ENDNEWTYPE : E N D N E W T Y P E;
ARRAY : A R R A Y;
CONSTANTS : C O N S T A N T S;
STRUCT : S T R U C T;
SYNONYM : S Y N O N Y M;
StringLiteral : STR+ ;
fragment
......
This diff is collapsed.
This diff is collapsed.
......@@ -47,7 +47,7 @@ SDL_BLACKBOLD = ['\\b{word}\\b'.format(word=word) for word in (
'CHECKME', 'PROCEDURE', 'EXTERNAL', 'IN', 'OUT', 'TIMER',
'SET_TIMER', 'RESET_TIMER', 'VIA', 'ENTRY', 'EXIT',
'SYNTYPE', 'ENDSYNTYPE', 'CONSTANTS',
'NEWTYPE', 'ENDNEWTYPE', 'ARRAY', 'STRUCT')]
'NEWTYPE', 'ENDNEWTYPE', 'ARRAY', 'STRUCT', 'SYNONYM')]
SDL_REDBOLD = ['\\b{word}\\b'.format(word=word) for word in (
'INPUT', 'OUTPUT', 'STATE', 'DECISION', 'NEXTSTATE',
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment