1 /***********************************************************************
3 * This software is part of the ast package *
4 * Copyright (c) 1982-2010 AT&T Intellectual Property *
5 * and is licensed under the *
6 * Common Public License, Version 1.0 *
7 * by AT&T Intellectual Property *
9 * A copy of the License is available at *
10 * http://www.opensource.org/licenses/cpl1.0.txt *
11 * (with md5 checksum 059e8cd6165cb4c31e351f2b69388fd9) *
13 * Information and Software Systems Research *
17 * David Korn <dgk@research.att.com> *
19 ***********************************************************************/
22 * data for string evaluator library
25 #include <ast_standards.h>
26 #include "FEATURE/options"
29 const unsigned char strval_precedence
[35] =
30 /* opcode precedence,assignment */
32 /* DEFAULT */ MAXPREC
|NOASSIGN
,
33 /* DONE */ 0|NOASSIGN
|RASSOC
,
34 /* NEQ */ 10|NOASSIGN
,
35 /* NOT */ MAXPREC
|NOASSIGN
,
37 /* ANDAND */ 6|NOASSIGN
|SEQPOINT
,
39 /* LPAREN */ MAXPREC
|NOASSIGN
|SEQPOINT
,
40 /* RPAREN */ 1|NOASSIGN
|RASSOC
|SEQPOINT
,
41 /* POW */ 14|NOASSIGN
|RASSOC
,
43 /* PLUSPLUS */ 15|NOASSIGN
|NOFLOAT
|SEQPOINT
,
45 /* COMMA */ 1|NOASSIGN
|SEQPOINT
,
46 /* MINUSMINUS */ 15|NOASSIGN
|NOFLOAT
|SEQPOINT
,
49 /* LSHIFT */ 12|NOFLOAT
,
53 /* ASSIGNMENT */ 2|RASSOC
,
54 /* COLON */ 0|NOASSIGN
,
55 /* RSHIFT */ 12|NOFLOAT
,
58 /* QCOLON */ 3|NOASSIGN
|SEQPOINT
,
59 /* QUEST */ 3|NOASSIGN
|SEQPOINT
|RASSOC
,
61 /* OROR */ 5|NOASSIGN
|SEQPOINT
,
63 /* DEFAULT */ MAXPREC
|NOASSIGN
,
64 /* DEFAULT */ MAXPREC
|NOASSIGN
,
65 /* DEFAULT */ MAXPREC
|NOASSIGN
,
66 /* DEFAULT */ MAXPREC
|NOASSIGN
70 * This is for arithmetic expressions
72 const char strval_states
[64] =
74 A_EOF
, A_REG
, A_REG
, A_REG
, A_REG
, A_REG
, A_REG
, A_REG
,
75 A_REG
, 0, 0, A_REG
, A_REG
, A_REG
, A_REG
, A_REG
,
76 A_REG
, A_REG
, A_REG
, A_REG
, A_REG
, A_REG
, A_REG
, A_REG
,
77 A_REG
, A_REG
, A_REG
, A_REG
, A_REG
, A_REG
, A_REG
, A_REG
,
79 0, A_NOT
, 0, A_REG
, A_REG
, A_MOD
, A_AND
, A_LIT
,
80 A_LPAR
, A_RPAR
, A_TIMES
,A_PLUS
, A_COMMA
,A_MINUS
,A_DOT
, A_DIV
,
81 A_DIG
, A_DIG
, A_DIG
, A_DIG
, A_DIG
, A_DIG
, A_DIG
, A_DIG
,
82 A_DIG
, A_DIG
, A_COLON
,A_REG
, A_LT
, A_ASSIGN
,A_GT
, A_QUEST
87 const char e_argcount
[] = "%s: function has wrong number of arguments";
88 const char e_badnum
[] = "%s: bad number";
89 const char e_moretokens
[] = "%s: more tokens expected";
90 const char e_paren
[] = "%s: unbalanced parenthesis";
91 const char e_badcolon
[] = "%s: invalid use of :";
92 const char e_divzero
[] = "%s: divide by zero";
93 const char e_synbad
[] = "%s: arithmetic syntax error";
94 const char e_notlvalue
[] = "%s: assignment requires lvalue";
95 const char e_recursive
[] = "%s: recursion too deep";
96 const char e_questcolon
[] = "%s: ':' expected for '?' operator";
97 const char e_function
[] = "%s: unknown function";
98 const char e_incompatible
[] = "%s: invalid floating point operation";
99 const char e_overflow
[] = "%s: overflow exception";
100 const char e_domain
[] = "%s: domain exception";
101 const char e_singularity
[] = "%s: singularity exception";
102 const char e_charconst
[] = "%s: invalid character constant";
104 #include "FEATURE/math"