Skip to content

Commit

Permalink
Added CONNECT
Browse files Browse the repository at this point in the history
git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@179 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
x97davka committed Mar 9, 1998
1 parent bef5ec9 commit 8f1a639
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 10 deletions.
1 change: 1 addition & 0 deletions modeq/ast/attrib.c
Expand Up @@ -93,6 +93,7 @@ void print_attr(Attrib *attr, FILE *f)
tokprinter(LPAR); /* 31 */
tokprinter(RPAR); /* 32 */
tokprinter(AND); /* 40 */
tokprinter(CONNECT);
tokprinter(EQUALS); /* 49 */
tokprinter(ASSIGN); /* 50 */
tokprinter(PLUS); /* 51 */
Expand Down
23 changes: 13 additions & 10 deletions modeq/ast/modgram.g
Expand Up @@ -110,6 +110,7 @@ extern void *sibling_list(AST *ast);
#token TIME "time"
#token FALS "false"
#token TRU "true"
#token CONNECT "connect"

/* #token FORALL "forall" */
/* #token ENDFORALL "endforall" */
Expand Down Expand Up @@ -481,16 +482,18 @@ algorithm_clause :
;

equation : << bool is_assign = false; AST *top; >>
( lh:simple_expression << top = #lh; >>
{ ( a:ASSIGN^ << top = #a; >>
| e:EQUALS^ << top = #e; >> )
rh:expression << is_assign=true; >> }
<<
if(is_assign)
top->rml = Absyn__EQ_5fEQUALS(#lh->rml, #rh->rml);
else
top->rml = Absyn__EQ_5fEXPR(#lh->rml);
>>
CONNECT^ LPAR c1: component_reference "," c2:component_reference RPAR
<< #0->rml = Absyn__EQ_5fCONNECT(#c1->rml,#c2->rml); >>
| ( lh:simple_expression << top = #lh; >>
{ ( a:ASSIGN^ << top = #a; >>
| e:EQUALS^ << top = #e; >> )
rh:expression << is_assign=true; >> }
<<
if(is_assign)
top->rml = Absyn__EQ_5fEQUALS(#lh->rml, #rh->rml);
else
top->rml = Absyn__EQ_5fEXPR(#lh->rml);
>>
| conditional_equation
| for_clause
| while_clause )
Expand Down

0 comments on commit 8f1a639

Please sign in to comment.