51 #define HIGHEST_PRECEDENCE 100
135 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
136 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
137 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
138 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
139 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
140 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
141 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
142 0, 0, 0, 0, 74, 75, 0, 0, 0, 0,
143 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
144 90, 91, 0, 0, 0, 0, 0, 0, 0, 0,
145 0, 0, 0, 0, 0, 0, 0, 0, 0, 109,
146 0, 111, 0, 0, 0, 0, 0, 0, 0, 0,
147 0, 0, 0, 123, 124, 0, 0, 0, 0, 129,
148 130, 131, 132, 133, 134, 135, 136, 137, 0, 0,
149 0, 0, 0, 0, 0, 145, 146, 147, 148, 149,
150 150, 151, 152, 153, 0, 0, 0, 0, 0, 0,
151 0, 0, 162, 163, 164, 165, 166, 167, 168, 169,
152 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
153 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
154 0, 0, 0, 193, 194, 195, 196, 197, 198, 199,
155 200, 201, 0, 0, 0, 0, 0, 0, 0, 209,
156 210, 211, 212, 213, 214, 215, 216, 217, 0, 0,
157 0, 0, 0, 0, 0, 0, 226, 227, 228, 229,
158 230, 231, 232, 233, 0, 0, 0, 0, 0, 0,
159 240, 241, 242, 243, 244, 245, 246, 247, 248, 249,
162 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
163 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
164 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
165 0, 0, 0,33, 0, 35,36, 0, 0, 0,
166 0, 0, 0, 0, 0, 0,46, 0,48,49,
167 50,51,52,53,54, 55,56,57, 0, 0,
168 0, 0, 0,63,64, 65,66,67,68,69,
169 70,71,72,73,74, 75,76,77,78,79,
170 80,81,82,83,84, 85,86,87,88,89,
171 90, 0, 0, 0, 0, 95, 0,65,66,67,
173 68,69,70,71,72, 73,74,75,76,77,
174 78,79,80,81,82, 83,84,85,86,87,
175 88,89,90, 0, 0, 0, 0, 0, 0, 0,
176 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
177 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
178 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
179 0, 0,162,0, 0, 0, 0, 0, 0, 0,
180 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
181 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
182 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
183 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
184 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
185 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
186 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
187 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
196 #define GETCHAR() ((unsigned char)(this->current[size_v(this->line_offset)]))
197 #define MORELINE() (this->line_offset < this->current_length)
198 #define OPERATOR(op) (this->clause->newToken(TOKEN_OPERATOR, OPERATOR_##op, (RexxString *)OREF_##op, location))
199 #define CHECK_ASSIGNMENT(op, token) (token->checkAssignment(this, (RexxString *)OREF_ASSIGNMENT_##op))
273 if (inch ==
'*' &&
GETCHAR() ==
'/')
279 else if (inch ==
'/' &&
GETCHAR() ==
'*')
299 unsigned int character = 0;
328 if (inch==
' ' || inch==
'\t')
342 else if (inch ==
',' || inch ==
'-')
345 if (inch ==
'-' && this->
line_offset + 1 < this->current_length &&
361 unsigned int inch2 =
GETCHAR();
363 if (inch2 ==
'/' && (this->
line_offset + 1 < this->current_length) &&
370 if (inch2 ==
'-' && (this->
line_offset + 1 < this->current_length) &&
378 if (inch2 !=
' ' && inch2 !=
'\t')
400 this->
position(startline, startoffset);
406 else if (inch ==
'/' && (this->
line_offset + 1 < this->current_length) &&
448 char error_output[2];
453 error_output[1] =
'\0';
459 value = OREF_NULLSTRING;
466 real_length = length;
467 for (i = 0; i < length; i++)
543 for (j = 0; j < i; j++)
546 for (k = oddhex; k < 2; k++)
551 while (nibble ==
' ' || nibble ==
'\t')
558 if (nibble >=
'0' && nibble <=
'9')
561 else if (nibble >=
'a' && nibble <=
'f')
566 else if (nibble >=
'A' && nibble <=
'F')
575 error_output[0] = nibble;
599 for (j = 0; j < i; j++)
602 for (k = oddhex; k < 8; k++)
607 while (nibble ==
' ' || nibble ==
'\t')
618 else if (nibble !=
'0')
622 error_output[0] = nibble;
663 length = sourceLiteralEnd - start;
689 unsigned int literal_delimiter;
702 #define EXP_EXCLUDED 1
712 #define AFTER_INTEGER 8
713 #define AFTER_NUMBER 9
790 if (inch >=
'0' && inch <=
'9')
794 else if (inch ==
'.')
814 else if (inch < '0' || inch >
'9')
823 if (inch < '0' || inch >
'9')
840 else if (inch < '0' || inch >
'9')
850 if (inch >=
'0' && inch <=
'9')
862 if (inch >=
'0' && inch <=
'9')
878 if (inch < '0' || inch >
'9')
902 if (state ==
EXP_E && eoffset == 0)
934 if (state ==
EXP_E && (inch ==
'+' || inch ==
'-'))
974 for (i = 0; i < length; i++)
999 if (length == 1 && inch ==
'.')
1004 else if (inch >=
'0' && inch <=
'9')
1011 if (inch !=
'0' || length == 1)
1018 else if (inch ==
'.')
1030 if (dot_count == 1 && value->
getCharB(length-1) ==
'.')
1061 else if (inch==
'\'' || inch==
'\"')
1063 literal_delimiter = inch;
1076 if (literal_delimiter ==
'\'')
1089 if (literal_delimiter == inch)
1100 if (inch != literal_delimiter)
1111 if (inch ==
'x' || inch ==
'X')
1126 else if (inch ==
'b' || inch ==
'B')
1141 length = litend - start + 1;
1151 length = litend - start + 1;
1155 for (i = 0, j = 0; j < length; i++, j++)
1160 if (inch == literal_delimiter)
1349 token =
OPERATOR(STRICT_LESSTHAN_EQUAL);
1366 token =
OPERATOR(LESSTHAN_GREATERTHAN);
1382 token =
OPERATOR(STRICT_GREATERTHAN_EQUAL);
1386 token =
OPERATOR(STRICT_GREATERTHAN);
1393 token =
OPERATOR(GREATERTHAN_EQUAL);
1399 token =
OPERATOR(GREATERTHAN_LESSTHAN);
1415 token =
OPERATOR(STRICT_BACKSLASH_EQUAL);
1429 token =
OPERATOR(STRICT_BACKSLASH_GREATERTHAN);
1433 token =
OPERATOR(BACKSLASH_GREATERTHAN);
1443 token =
OPERATOR(STRICT_BACKSLASH_LESSTHAN);
1447 token =
OPERATOR(BACKSLASH_LESSTHAN);
1457 case (
unsigned char)0xAA:
1458 case (
unsigned char)0xAC:
1466 token =
OPERATOR(STRICT_BACKSLASH_EQUAL);
1480 token =
OPERATOR(STRICT_BACKSLASH_GREATERTHAN);
1484 token =
OPERATOR(BACKSLASH_GREATERTHAN);
1494 token =
OPERATOR(STRICT_BACKSLASH_LESSTHAN);
1498 token =
OPERATOR(BACKSLASH_LESSTHAN);
1512 sprintf(badchar,
"%c", inch);
1513 sprintf(hexbadchar,
"%2.2X", inch);
RexxInteger * new_integer(wholenumber_t v)
const int MAX_SYMBOL_LENGTH
#define Error_Unmatched_quote_comment
#define Error_Unexpected_curly_bracket
#define Error_Unmatched_quote_single
#define Error_Invalid_character_char
#define Error_Name_too_long_name
#define Error_Invalid_hex_binblank
#define Error_Unmatched_parenthesis_curly
#define Error_Invalid_hex_invbin
#define Error_Invalid_hex_hexblank
#define Error_Unmatched_quote_double
#define Error_Invalid_hex_invhex
#define HIGHEST_PRECEDENCE
#define CHECK_ASSIGNMENT(op, token)
RexxString * new_string(const char *s, stringsizeB_t bl, sizeC_t cl=-1)
RexxString * raw_string(stringsizeB_t bl, stringsizeC_t cl=-1)
#define OPERATOR_SUBTRACT
#define OPERATOR_BACKSLASH
#define OPERATOR_STRICT_GREATERTHAN_EQUAL
#define OPERATOR_BACKSLASH_EQUAL
#define CLAUSEEND_SEMICOLON
#define OPERATOR_STRICT_EQUAL
#define OPERATOR_LESSTHAN_EQUAL
#define OPERATOR_STRICT_BACKSLASH_EQUAL
#define OPERATOR_GREATERTHAN_LESSTHAN
#define OPERATOR_GREATERTHAN_EQUAL
#define OPERATOR_BACKSLASH_LESSTHAN
#define OPERATOR_CONCATENATE
#define OPERATOR_MULTIPLY
#define OPERATOR_LESSTHAN_GREATERTHAN
#define OPERATOR_LESSTHAN
#define OPERATOR_STRICT_LESSTHAN_EQUAL
#define OPERATOR_GREATERTHAN
#define OPERATOR_STRICT_GREATERTHAN
#define OPERATOR_REMAINDER
#define OPERATOR_STRICT_LESSTHAN
#define OPERATOR_BACKSLASH_GREATERTHAN
#define OPERATOR_STRICT_BACKSLASH_LESSTHAN
#define OPERATOR_STRICT_BACKSLASH_GREATERTHAN
#define TOKEN_SOURCE_LITERAL
static const size_t DEFAULT_DIGITS
RexxToken * newToken(int, int, RexxString *, SourceLocation &)
void setEnd(size_t, sizeB_t)
const SourceLocation & getLocation()
RexxToken * sourceNextToken(RexxToken *)
unsigned int locateToken(RexxToken *)
static int precedence(RexxToken *)
void startLocation(SourceLocation &)
void syntaxError(int errorcode, RexxInstruction *i)
SourceLocation clauseLocation
RexxToken * sourceLiteral(size_t, SourceLocation)
bool nextSpecial(unsigned int, SourceLocation &)
static bool isSymbolCharacter(codepoint_t ch)
void syntaxErrorAt(int errorcode, RexxToken *token)
void endLocation(SourceLocation &)
RexxString * packLiteral(sizeB_t, sizeB_t, int)
RexxString * commonString(RexxString *)
RexxString * extract(SourceLocation &, bool=false)
void position(size_t, sizeB_t)
static int translateChar(codepoint_t ch)
static int characterTable[]
char putCharB(sizeB_t p, char c)
void setEnd(SourceLocation &l)
void setStart(SourceLocation &l)
void setEndOffset(sizeB_t l)
void setLocation(size_t line, sizeB_t offset, size_t end, sizeB_t end_offset, bool limited_trace=false)
void setLimitedTrace(bool b)