1 |
jds |
74 |
/* |
2 |
aw0a |
1 |
* Syntax Routines |
3 |
|
|
* by Tom Epperly |
4 |
|
|
* Created: 3/22/1990 |
5 |
|
|
* Version: $Revision: 1.9 $ |
6 |
|
|
* Version control file: $RCSfile: syntax.h,v $ |
7 |
|
|
* Date last modified: $Date: 1998/04/12 18:31:16 $ |
8 |
|
|
* Last modified by: $Author: ballan $ |
9 |
|
|
* |
10 |
|
|
* This file is part of the Ascend Language Interpreter. |
11 |
|
|
* |
12 |
|
|
* Copyright (C) 1990, 1993, 1994 Thomas Guthrie Epperly |
13 |
|
|
* |
14 |
|
|
* The Ascend Language Interpreter is free software; you can redistribute |
15 |
|
|
* it and/or modify it under the terms of the GNU General Public License as |
16 |
|
|
* published by the Free Software Foundation; either version 2 of the |
17 |
|
|
* License, or (at your option) any later version. |
18 |
|
|
* |
19 |
|
|
* The Ascend Language Interpreter is distributed in hope that it will be |
20 |
|
|
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty of |
21 |
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
22 |
|
|
* General Public License for more details. |
23 |
|
|
* |
24 |
|
|
* You should have received a copy of the GNU General Public License along |
25 |
|
|
* with the program; if not, write to the Free Software Foundation, Inc., 675 |
26 |
|
|
* Mass Ave, Cambridge, MA 02139 USA. Check the file named COPYING. |
27 |
|
|
*/ |
28 |
jds |
74 |
|
29 |
jds |
54 |
/** @file |
30 |
|
|
* Syntax Routines. |
31 |
|
|
* These routines support the yacc parsing file ascParse.y. This module |
32 |
|
|
* provides functions to check syntax. |
33 |
|
|
* <pre> |
34 |
aw0a |
1 |
* When #including syntax.h, make sure these files are #included first: |
35 |
jds |
54 |
* #include "utilities/ascConfig.h" |
36 |
jds |
74 |
* #include "compiler/fractions.h" |
37 |
|
|
* #include "compiler/compiler.h" |
38 |
|
|
* #include "compiler/dimen.h" |
39 |
|
|
* #include "compiler/types.h" |
40 |
|
|
* #include "compiler/exprs.h" |
41 |
|
|
* #include "compiler/stattypes.h" |
42 |
jds |
54 |
* </pre> |
43 |
aw0a |
1 |
*/ |
44 |
|
|
|
45 |
johnpye |
1066 |
#ifndef ASC_SYNTAX_H |
46 |
|
|
#define ASC_SYNTAX_H |
47 |
aw0a |
1 |
|
48 |
johnpye |
1066 |
/** addtogroup compiler Compiler |
49 |
|
|
@{ |
50 |
|
|
*/ |
51 |
|
|
|
52 |
jds |
54 |
extern unsigned NumberOfRelOps(struct Expr *ex); |
53 |
ben.allan |
33 |
/**< |
54 |
jds |
74 |
* Counts the number of relation operators in the given Expr. |
55 |
|
|
* |
56 |
|
|
* @param ex The expresion to evaluate. |
57 |
|
|
* @return The number of relation operators in ex. |
58 |
aw0a |
1 |
*/ |
59 |
|
|
|
60 |
jds |
54 |
extern int IsRelation(struct Expr *ex); |
61 |
jds |
74 |
/**< |
62 |
|
|
* Tests whether an expression is a real or logical relation. |
63 |
|
|
* |
64 |
|
|
* @param ex The expresion to test. |
65 |
|
|
* @return Returns 1 if ex is a real relation, 0 if a |
66 |
|
|
* logical relation. |
67 |
|
|
* @todo compiler/syntax:IsRelation() notated as broken in source file. |
68 |
|
|
* Fix or remove comment. |
69 |
aw0a |
1 |
*/ |
70 |
|
|
|
71 |
|
|
extern int GetParseRelnsFlag(void); |
72 |
jds |
54 |
/**< |
73 |
jds |
74 |
* Retrieves the value of the parse relations flag. If this flag is |
74 |
|
|
* non-zero (the default), normal ASCEND relations will be parsed. |
75 |
|
|
* If it is 0, they will not be. This flag does not affect |
76 |
|
|
* external relations. |
77 |
|
|
* |
78 |
|
|
* @return The current value of the parse relations flag. |
79 |
aw0a |
1 |
*/ |
80 |
|
|
|
81 |
johnpye |
1063 |
ASC_DLLSPEC void SetParseRelnsFlag(int flag); |
82 |
jds |
74 |
/**< |
83 |
|
|
* Sets the parse relations flag. Any nonzero integer will |
84 |
|
|
* cause relations to be parsed (see GetParseRelnsFlag()). |
85 |
|
|
* Later it may be given more meaning. |
86 |
|
|
* |
87 |
|
|
* @param flag The new value for the parse relations flag. |
88 |
aw0a |
1 |
*/ |
89 |
|
|
|
90 |
johnpye |
1066 |
/* @} */ |
91 |
jds |
54 |
|
92 |
johnpye |
1066 |
#endif /* ASC_SYNTAX_H */ |
93 |
|
|
|