Project

General

Profile

Revision 54ae8ac7 src/parser_lustre.mly

View differences:

src/parser_lustre.mly
90 90
%token MULT DIV MOD
91 91
%token MINUS PLUS UMINUS
92 92
%token PRE ARROW
93

  
93
%token PROTOTYPE IN
94 94
%token EOF
95 95

  
96 96
%nonassoc COMMA
......
131 131
| open_lusi open_list { $1 :: $2 }
132 132

  
133 133
open_lusi:
134
  OPEN QUOTE IDENT QUOTE { mktop_decl (Open $3) }
134
| OPEN QUOTE IDENT QUOTE { mktop_decl (Open (true, $3))}
135
| OPEN LT IDENT GT { mktop_decl (Open (false, $3)) }
135 136

  
136 137
top_decl_list:
137 138
  top_decl {[$1]}
......
147 148
| NODE { false }
148 149

  
149 150
top_decl_header:
150
  nodespec_list state_annot IDENT LPAR vdecl_list SCOL_opt RPAR RETURNS LPAR vdecl_list SCOL_opt RPAR SCOL
151
| CONST cdecl_list { fun _ -> mktop_decl (Consts (List.rev $2)) }
152
| nodespec_list state_annot IDENT LPAR vdecl_list SCOL_opt RPAR RETURNS LPAR vdecl_list SCOL_opt RPAR  prototype_opt in_lib_opt SCOL
151 153
    {let nd = mktop_decl (ImportedNode
152 154
                            {nodei_id = $3;
153 155
                             nodei_type = Types.new_var ();
......
155 157
                             nodei_inputs = List.rev $5;
156 158
                             nodei_outputs = List.rev $10;
157 159
			     nodei_stateless = $2;
158
			     nodei_spec = $1})
160
			     nodei_spec = $1;
161
			     nodei_prototype = $13;
162
			     nodei_in_lib = $14;})
159 163
    in
160 164
    (fun own -> add_node own ("node " ^ $3) node_table $3 nd; nd) }
161 165

  
166
prototype_opt:
167
 { None }
168
| PROTOTYPE IDENT { Some $2}
169

  
170
in_lib_opt:
171
{ None }
172
| IN IDENT {Some $2} 
173

  
162 174
top_decl:
163 175
| CONST cdecl_list { mktop_decl (Consts (List.rev $2)) }
164 176
| nodespec_list state_annot IDENT LPAR vdecl_list SCOL_opt RPAR RETURNS LPAR vdecl_list SCOL_opt RPAR SCOL_opt locals LET eq_list TEL 

Also available in: Unified diff