Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 70 lines (59 sloc) 2.18 kb
03e306c Stephen Williams Infrastructure for parsing analog process statements.
authored
1 /*
2 * Copyright (c) 2008 Stephen Williams (steve@icarus.com)
3 *
4 * This source code is free software; you can redistribute it
5 * and/or modify it in source code form under the terms of the GNU
6 * General Public License as published by the Free Software
7 * Foundation; either version 2 of the License, or (at your option)
8 * any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
18 */
19
20 # include "config.h"
21 # include "compiler.h"
22 # include "pform.h"
23 # include "parse_misc.h"
24 # include "AStatement.h"
25
25a27f9 Stephen Williams Parse contribution statements as far as pform.
authored
26 AStatement* pform_contribution_statement(const struct vlltype&loc,
27 PExpr*lval, PExpr*rval)
03e306c Stephen Williams Infrastructure for parsing analog process statements.
authored
28 {
25a27f9 Stephen Williams Parse contribution statements as far as pform.
authored
29 AContrib*tmp = new AContrib(lval, rval);
03e306c Stephen Williams Infrastructure for parsing analog process statements.
authored
30 FILE_NAME(tmp, loc);
31 return tmp;
32 }
33
34 void pform_make_analog_behavior(const struct vlltype&loc, AProcess::Type pt,
35 AStatement*statement)
36 {
37 AProcess*proc = new AProcess(pt, statement);
38 FILE_NAME(proc, loc);
39
40 pform_put_behavior_in_scope(proc);
41 }
25a27f9 Stephen Williams Parse contribution statements as far as pform.
authored
42
43 PExpr* pform_make_branch_probe_expression(const struct vlltype&loc,
44 char*name, char*n1, char*n2)
45 {
46 vector<PExpr*> parms (2);
47 parms[0] = new PEIdent(lex_strings.make(n1));
48 FILE_NAME(parms[0], loc);
49
50 parms[1] = new PEIdent(lex_strings.make(n2));
51 FILE_NAME(parms[1], loc);
52
53 PECallFunction*res = new PECallFunction(lex_strings.make(name), parms);
54 FILE_NAME(res, loc);
55 return res;
56 }
57
58 PExpr* pform_make_branch_probe_expression(const struct vlltype&loc,
59 char*name, char*branch_name)
60 {
61 vector<PExpr*> parms (1);
62 parms[0] = new PEIdent(lex_strings.make(branch_name));
63 FILE_NAME(parms[0], loc);
64
65 PECallFunction*res = new PECallFunction(lex_strings.make(name), parms);
66 FILE_NAME(res, loc);
67
68 return res;
69 }
Something went wrong with that request. Please try again.