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[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))
277 if (inch ==
'*' &&
GETCHAR() ==
'/')
283 else if (inch ==
'/' &&
GETCHAR() ==
'*')
303 unsigned int character = 0;
332 if (inch==
' ' || inch==
'\t')
346 else if (inch ==
',' || inch ==
'-')
349 if (inch ==
'-' && this->
line_offset + 1 < this->current_length &&
365 unsigned int inch2 =
GETCHAR();
367 if (inch2 ==
'/' && (this->
line_offset + 1 < this->current_length) &&
374 if (inch2 ==
'-' && (this->
line_offset + 1 < this->current_length) &&
382 if (inch2 !=
' ' && inch2 !=
'\t')
404 this->
position(startline, startoffset);
410 else if (inch ==
'/' && (this->
line_offset + 1 < this->current_length) &&
452 char error_output[2];
457 error_output[1] =
'\0';
463 value = OREF_NULLSTRING;
470 real_length = length;
471 for (i = 0; i < length; i++)
474 if (this->
current[inpointer] ==
' ' || this->
current[inpointer] ==
'\t')
547 for (j = 0; j < i; j++)
550 for (k = oddhex; k < 2; k++)
553 nibble = this->
current[inpointer];
555 while (nibble ==
' ' || nibble ==
'\t')
558 nibble = this->
current[inpointer];
562 if (nibble >=
'0' && nibble <=
'9')
565 else if (nibble >=
'a' && nibble <=
'f')
570 else if (nibble >=
'A' && nibble <=
'F')
579 error_output[0] = nibble;
587 value->
putChar(outpointer,
byte);
603 for (j = 0; j < i; j++)
606 for (k = oddhex; k < 8; k++)
609 nibble = this->
current[inpointer];
611 while (nibble ==
' ' || nibble ==
'\t')
614 nibble = this->
current[inpointer];
622 else if (nibble !=
'0')
626 error_output[0] = nibble;
632 value->
putChar(outpointer,
byte);
639 if (value != OREF_NULLSTRING)
646 bool messageUnderstood = value->
messageSend(OREF_SETENCODING, args, 1, 0, result,
false);
657 size_t sourceLiteralEnd;
679 length = sourceLiteralEnd - start;
705 unsigned int literal_delimiter;
718 #define EXP_EXCLUDED 1
728 #define AFTER_INTEGER 8
729 #define AFTER_NUMBER 9
806 if (inch >=
'0' && inch <=
'9')
810 else if (inch ==
'.')
830 else if (inch < '0' || inch >
'9')
839 if (inch < '0' || inch >
'9')
856 else if (inch < '0' || inch >
'9')
866 if (inch >=
'0' && inch <=
'9')
878 if (inch >=
'0' && inch <=
'9')
894 if (inch < '0' || inch >
'9')
918 if (state ==
EXP_E && eoffset == 0)
950 if (state ==
EXP_E && (inch ==
'+' || inch ==
'-'))
990 for (i = 0; i < length; i++)
995 inch = this->
current[start + i];
1015 if (length == 1 && inch ==
'.')
1020 else if (inch >=
'0' && inch <=
'9')
1027 if (inch !=
'0' || length == 1)
1034 else if (inch ==
'.')
1046 if (dot_count == 1 && value->
getChar(length-1) ==
'.')
1077 else if (inch==
'\'' || inch==
'\"')
1079 literal_delimiter = inch;
1092 if (literal_delimiter ==
'\'')
1105 if (literal_delimiter == inch)
1116 if (inch != literal_delimiter)
1127 if (inch ==
'x' || inch ==
'X')
1142 else if (inch ==
'b' || inch ==
'B')
1157 length = litend - start + 1;
1167 length = litend - start + 1;
1171 for (i = 0, j = 0; j < length; i++, j++)
1174 inch = this->
current[start + j];
1176 if (inch == literal_delimiter)
1194 if (inch == (
unsigned char)0xC2 && this->
nextSpecial((
unsigned char)0xAC, location,
false))
1297 else token =
OPERATOR(BACKSLASH_EQUAL);
1379 token =
OPERATOR(STRICT_LESSTHAN_EQUAL);
1396 token =
OPERATOR(LESSTHAN_GREATERTHAN);
1412 token =
OPERATOR(STRICT_GREATERTHAN_EQUAL);
1416 token =
OPERATOR(STRICT_GREATERTHAN);
1423 token =
OPERATOR(GREATERTHAN_EQUAL);
1429 token =
OPERATOR(GREATERTHAN_LESSTHAN);
1440 case (
unsigned char)0xAA:
1441 case (
unsigned char)0xAC:
1453 token =
OPERATOR(STRICT_BACKSLASH_EQUAL);
1467 token =
OPERATOR(STRICT_BACKSLASH_GREATERTHAN);
1471 token =
OPERATOR(BACKSLASH_GREATERTHAN);
1481 token =
OPERATOR(STRICT_BACKSLASH_LESSTHAN);
1485 token =
OPERATOR(BACKSLASH_LESSTHAN);
1499 snprintf(badchar,
sizeof badchar,
"%c", inch);
1500 snprintf(hexbadchar,
sizeof badchar,
"%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 * raw_string(stringsize_t l)
RexxString * new_string(const char *s, stringsize_t l)
#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
void setEnd(size_t, size_t)
RexxToken * newToken(int, int, RexxString *, SourceLocation &)
const SourceLocation & getLocation()
bool messageSend(RexxString *, RexxObject **, size_t, size_t, ProtectedObject &, bool processUnknown=true, bool dynamicTarget=true)
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)
static bool isSymbolCharacter(codepoint_t ch)
void syntaxErrorAt(int errorcode, RexxToken *token)
void endLocation(SourceLocation &)
bool nextSpecial(unsigned int, SourceLocation &, bool advance=true)
void position(size_t, size_t)
RexxString * commonString(RexxString *)
RexxString * extract(SourceLocation &, bool=false)
RexxString * packLiteral(size_t, size_t, int)
static int translateChar(codepoint_t ch)
static int characterTable[]
char putChar(size_t p, char c)
void setEnd(SourceLocation &l)
void setStart(SourceLocation &l)
void setLimitedTrace(bool b)
void setEndOffset(size_t l)
void setLocation(size_t line, size_t offset, size_t end, size_t end_offset, bool limited_trace=false)