1 /* Cycript - Error.hppution Server and Disassembler
2 * Copyright (C) 2009 Jay Freeman (saurik)
5 /* Modified BSD License {{{ */
7 * Redistribution and use in source and binary
8 * forms, with or without modification, are permitted
9 * provided that the following conditions are met:
11 * 1. Redistributions of source code must retain the
12 * above copyright notice, this list of conditions
13 * and the following disclaimer.
14 * 2. Redistributions in binary form must reproduce the
15 * above copyright notice, this list of conditions
16 * and the following disclaimer in the documentation
17 * and/or other materials provided with the
19 * 3. The name of the author may not be used to endorse
20 * or promote products derived from this software
21 * without specific prior written permission.
23 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS''
24 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
25 * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
26 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
27 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE
28 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
29 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
30 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
31 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
32 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
33 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
34 * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
35 * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
36 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
43 // XXX: wtf is this here?!
53 #include "location.hh"
54 #include "Pooling.hpp"
56 template <typename Type_>
70 void SetNext(Type_ *next) {
79 virtual void Output(struct CYOutput &out) const = 0;
95 CYOutput(std::ostream &out) :
103 void Check(char value);
106 CYOutput &operator <<(char rhs);
107 CYOutput &operator <<(const char *rhs);
109 _finline CYOutput &operator <<(const CYThing *rhs) {
115 _finline CYOutput &operator <<(const CYThing &rhs) {
121 struct CYPropertyName {
122 virtual void PropertyName(CYOutput &out) const = 0;
124 virtual ~CYPropertyName() {
138 CYNoBrace = (1 << 0),
139 CYNoFunction = (1 << 1),
142 CYNoRightHand = (1 << 4),
143 CYNoDangle = (1 << 5),
144 CYNoBF = (CYNoBrace | CYNoFunction),
150 CYContext(apr_pool_t *pool) :
155 template <typename Type_>
156 void Replace(Type_ *&value) {
158 while (Type_ *replace = value->Replace(*this))
166 virtual ~CYStatement() {
169 void Single(CYOutput &out, CYFlags flags) const;
170 void Multiple(CYOutput &out, CYFlags flags = CYNoFlags) const;
172 CYStatement *ReplaceAll(CYContext &context);
174 virtual CYStatement *Replace(CYContext &context) = 0;
177 virtual void Output(CYOutput &out, CYFlags flags) const = 0;
180 struct CYStatements {
190 operator CYStatement *() const {
194 CYStatements &operator ->*(CYStatement *next) {
196 if (first_ == NULL) {
199 } else for (;; last_ = last_->next_)
200 if (last_->next_ == NULL) {
210 virtual ~CYClassName() {
213 virtual CYExpression *ClassName(CYContext &context, bool object) = 0;
214 virtual void ClassName(CYOutput &out, bool object) const = 0;
224 CYWord(const char *word) :
229 const char *Value() const {
233 virtual void Output(CYOutput &out) const;
235 virtual CYExpression *ClassName(CYContext &context, bool object);
236 virtual void ClassName(CYOutput &out, bool object) const;
237 virtual void PropertyName(CYOutput &out) const;
240 _finline std::ostream &operator <<(std::ostream &lhs, const CYWord &rhs) {
241 return lhs << rhs.Value();
244 struct CYIdentifier :
247 CYIdentifier(const char *word) :
257 CYStatement *statement_;
259 CYLabel(CYIdentifier *name, CYStatement *statement) :
261 statement_(statement)
265 virtual CYStatement *Replace(CYContext &context);
266 virtual void Output(CYOutput &out, CYFlags flags) const;
272 CYStatement *statements_;
274 CYProgram(CYStatement *statements) :
275 statements_(statements)
279 virtual void Replace(CYContext &context);
281 virtual void Output(CYOutput &out) const;
288 CYStatement *statements_;
290 CYBlock(CYStatement *statements) :
291 statements_(statements)
295 operator CYStatement *() const {
299 virtual CYStatement *Replace(CYContext &context);
301 virtual void Output(CYOutput &out) const;
302 virtual void Output(CYOutput &out, CYFlags flags) const;
330 std::string filename_;
334 cy::location location_;
335 std::string message_;
338 typedef std::vector<Error> Errors;
345 void ScannerDestroy();
348 CYDriver(const std::string &filename);
351 Condition GetCondition();
352 void SetCondition(Condition condition);
354 void PushCondition(Condition condition);
357 void Warning(const cy::location &location, const char *message);
360 struct CYForInitialiser {
361 virtual ~CYForInitialiser() {
364 virtual void For(CYOutput &out) const = 0;
367 struct CYForInInitialiser {
368 virtual ~CYForInInitialiser() {
371 virtual void ForIn(CYOutput &out, CYFlags flags) const = 0;
372 virtual const char *ForEachIn() const = 0;
373 virtual CYExpression *ForEachIn(CYContext &out) = 0;
379 struct CYExpression :
380 CYNext<CYExpression>,
386 virtual unsigned Precedence() const = 0;
388 virtual bool RightHand() const {
392 virtual void For(CYOutput &out) const;
393 virtual void ForIn(CYOutput &out, CYFlags flags) const;
395 virtual const char *ForEachIn() const;
396 virtual CYExpression *ForEachIn(CYContext &out);
398 virtual void Output(CYOutput &out) const;
399 virtual void Output(CYOutput &out, CYFlags flags) const = 0;
400 void Output(CYOutput &out, unsigned precedence, CYFlags flags) const;
402 virtual CYExpression *ClassName(CYContext &context, bool object);
403 virtual void ClassName(CYOutput &out, bool object) const;
405 CYExpression *ReplaceAll(CYContext &context);
407 virtual CYExpression *Replace(CYContext &context) = 0;
409 virtual CYExpression *Primitive(CYContext &context) {
413 virtual CYNumber *Number(CYContext &context) {
417 virtual CYString *String(CYContext &context) {
421 virtual const char *Word() const {
426 #define CYAlphabetic(value) \
427 virtual bool Alphabetic() const { \
431 #define CYPrecedence(value) \
432 virtual unsigned Precedence() const { \
436 #define CYRightHand(value) \
437 virtual bool RightHand() const { \
444 CYExpression *expressions_;
446 CYCompound(CYExpression *expressions) :
447 expressions_(expressions)
451 void AddPrev(CYExpression *expression) {
452 CYExpression *last(expression);
453 while (last->next_ != NULL)
455 last->SetNext(expressions_);
456 expressions_ = expression;
461 virtual CYExpression *Replace(CYContext &context);
462 void Output(CYOutput &out, CYFlags flags) const;
465 struct CYFunctionParameter :
466 CYNext<CYFunctionParameter>,
471 CYFunctionParameter(CYIdentifier *name, CYFunctionParameter *next = NULL) :
472 CYNext<CYFunctionParameter>(next),
477 virtual void Output(CYOutput &out) const;
480 struct CYComprehension :
481 CYNext<CYComprehension>,
484 virtual const char *Name() const = 0;
486 virtual CYFunctionParameter *Parameter(CYContext &context) const = 0;
487 CYFunctionParameter *Parameters(CYContext &context) const;
488 virtual CYStatement *Replace(CYContext &context, CYStatement *statement) const;
489 virtual void Output(CYOutput &out) const = 0;
492 struct CYForInComprehension :
498 CYForInComprehension(CYIdentifier *name, CYExpression *set) :
504 virtual const char *Name() const {
505 return name_->Value();
508 virtual CYFunctionParameter *Parameter(CYContext &context) const;
509 virtual CYStatement *Replace(CYContext &context, CYStatement *statement) const;
510 virtual void Output(CYOutput &out) const;
513 struct CYForEachInComprehension :
519 CYForEachInComprehension(CYIdentifier *name, CYExpression *set) :
525 virtual const char *Name() const {
526 return name_->Value();
529 virtual CYFunctionParameter *Parameter(CYContext &context) const;
530 virtual CYStatement *Replace(CYContext &context, CYStatement *statement) const;
531 virtual void Output(CYOutput &out) const;
534 struct CYIfComprehension :
539 CYIfComprehension(CYExpression *test) :
544 virtual const char *Name() const {
548 virtual CYFunctionParameter *Parameter(CYContext &context) const;
549 virtual CYStatement *Replace(CYContext &context, CYStatement *statement) const;
550 virtual void Output(CYOutput &out) const;
553 struct CYArrayComprehension :
556 CYExpression *expression_;
557 CYComprehension *comprehensions_;
559 CYArrayComprehension(CYExpression *expression, CYComprehension *comprehensions) :
560 expression_(expression),
561 comprehensions_(comprehensions)
567 virtual CYExpression *Replace(CYContext &context);
568 virtual void Output(CYOutput &out, CYFlags flags) const;
581 virtual CYExpression *Replace(CYContext &context);
595 CYRange(uint64_t lo, uint64_t hi) :
600 bool operator [](uint8_t value) const {
601 return !(value >> 7) && (value >> 6 ? hi_ : lo_) >> (value & 0x3f) & 0x1;
604 void operator()(uint8_t value) {
607 (value >> 6 ? hi_ : lo_) |= uint64_t(0x1) << (value & 0x3f);
611 extern CYRange DigitRange_;
612 extern CYRange WordStartRange_;
613 extern CYRange WordEndRange_;
628 CYString(const char *value) :
634 CYString(const char *value, size_t size) :
640 CYString(const CYWord *word) :
641 value_(word->Value()),
642 size_(strlen(value_))
646 const char *Value() const {
650 virtual const char *Word() const;
652 virtual CYNumber *Number(CYContext &context);
653 virtual CYString *String(CYContext &context);
655 CYString *Concat(CYContext &out, CYString *rhs) const;
656 virtual void Output(CYOutput &out, CYFlags flags) const;
657 virtual void PropertyName(CYOutput &out) const;
666 CYNumber(double value) :
671 double Value() const {
675 virtual CYNumber *Number(CYContext &context);
676 virtual CYString *String(CYContext &context);
678 virtual void Output(CYOutput &out, CYFlags flags) const;
679 virtual void PropertyName(CYOutput &out) const;
687 CYRegEx(const char *value) :
692 const char *Value() const {
696 virtual void Output(CYOutput &out, CYFlags flags) const;
708 virtual CYNumber *Number(CYContext &context);
709 virtual CYString *String(CYContext &context);
711 virtual void Output(CYOutput &out, CYFlags flags) const;
723 virtual CYExpression *Replace(CYContext &context);
724 virtual void Output(CYOutput &out, CYFlags flags) const;
730 virtual bool Value() const = 0;
731 virtual void Output(CYOutput &out, CYFlags flags) const;
743 virtual bool Value() const {
747 virtual CYNumber *Number(CYContext &context);
748 virtual CYString *String(CYContext &context);
760 virtual bool Value() const {
764 virtual CYNumber *Number(CYContext &context);
765 virtual CYString *String(CYContext &context);
773 CYVariable(CYIdentifier *name) :
781 virtual CYExpression *Replace(CYContext &context);
782 virtual void Output(CYOutput &out, CYFlags flags) const;
790 CYPrefix(CYExpression *rhs) :
795 virtual bool Alphabetic() const = 0;
796 virtual const char *Operator() const = 0;
800 virtual CYExpression *Replace(CYContext &context);
801 virtual void Output(CYOutput &out, CYFlags flags) const;
810 CYInfix(CYExpression *lhs, CYExpression *rhs) :
816 void SetLeft(CYExpression *lhs) {
820 virtual bool Alphabetic() const = 0;
821 virtual const char *Operator() const = 0;
823 virtual CYExpression *Replace(CYContext &context);
824 virtual void Output(CYOutput &out, CYFlags flags) const;
832 CYPostfix(CYExpression *lhs) :
837 virtual const char *Operator() const = 0;
841 virtual CYExpression *Replace(CYContext &context);
842 virtual void Output(CYOutput &out, CYFlags flags) const;
845 struct CYAssignment :
851 CYAssignment(CYExpression *lhs, CYExpression *rhs) :
857 void SetLeft(CYExpression *lhs) {
861 virtual const char *Operator() const = 0;
865 virtual CYExpression *Replace(CYContext &context);
866 virtual void Output(CYOutput &out, CYFlags flags) const;
874 CYExpression *value_;
876 CYArgument(CYExpression *value, CYArgument *next = NULL) :
877 CYNext<CYArgument>(next),
883 CYArgument(CYWord *name, CYExpression *value, CYArgument *next = NULL) :
884 CYNext<CYArgument>(next),
890 void Replace(CYContext &context);
891 void Output(CYOutput &out) const;
908 CYStatement *statements_;
910 CYClause(CYExpression *_case, CYStatement *statements) :
912 statements_(statements)
916 void Replace(CYContext &context);
917 virtual void Output(CYOutput &out) const;
924 CYExpression *value_;
926 CYElement(CYExpression *value, CYElement *next) :
927 CYNext<CYElement>(next),
932 void Replace(CYContext &context);
933 void Output(CYOutput &out) const;
939 CYElement *elements_;
941 CYArray(CYElement *elements = NULL) :
946 virtual CYExpression *Replace(CYContext &context);
947 virtual void Output(CYOutput &out, CYFlags flags) const;
954 CYPropertyName *name_;
955 CYExpression *value_;
957 CYProperty(CYPropertyName *name, CYExpression *value, CYProperty *next = NULL) :
958 CYNext<CYProperty>(next),
964 void Replace(CYContext &context);
965 virtual void Output(CYOutput &out) const;
968 struct CYDeclaration :
971 CYIdentifier *identifier_;
972 CYExpression *initialiser_;
974 CYDeclaration(CYIdentifier *identifier, CYExpression *initialiser = NULL) :
975 identifier_(identifier),
976 initialiser_(initialiser)
980 virtual void ForIn(CYOutput &out, CYFlags flags) const;
982 virtual const char *ForEachIn() const;
983 virtual CYExpression *ForEachIn(CYContext &out);
985 void Replace(CYContext &context);
987 virtual void Output(CYOutput &out, CYFlags flags) const;
990 struct CYDeclarations :
991 CYNext<CYDeclarations>,
995 CYDeclaration *declaration_;
997 CYDeclarations(CYDeclaration *declaration, CYDeclarations *next = NULL) :
998 CYNext<CYDeclarations>(next),
999 declaration_(declaration)
1003 virtual void For(CYOutput &out) const;
1005 void Replace(CYContext &context);
1006 CYProperty *Property(CYContext &context);
1008 virtual void Output(CYOutput &out) const;
1009 virtual void Output(CYOutput &out, CYFlags flags) const;
1015 CYDeclarations *declarations_;
1017 CYVar(CYDeclarations *declarations) :
1018 declarations_(declarations)
1022 virtual CYStatement *Replace(CYContext &context);
1023 virtual void Output(CYOutput &out, CYFlags flags) const;
1029 CYDeclarations *declarations_;
1032 CYLet(CYDeclarations *declarations, CYStatement *statements) :
1033 declarations_(declarations),
1038 virtual CYStatement *Replace(CYContext &context);
1039 virtual void Output(CYOutput &out, CYFlags flags) const;
1045 CYForInitialiser *initialiser_;
1046 CYExpression *test_;
1047 CYExpression *increment_;
1050 CYFor(CYForInitialiser *initialiser, CYExpression *test, CYExpression *increment, CYStatement *code) :
1051 initialiser_(initialiser),
1053 increment_(increment),
1058 virtual CYStatement *Replace(CYContext &context);
1059 virtual void Output(CYOutput &out, CYFlags flags) const;
1065 CYForInInitialiser *initialiser_;
1069 CYForIn(CYForInInitialiser *initialiser, CYExpression *set, CYStatement *code) :
1070 initialiser_(initialiser),
1076 virtual CYStatement *Replace(CYContext &context);
1077 virtual void Output(CYOutput &out, CYFlags flags) const;
1080 struct CYForEachIn :
1083 CYForInInitialiser *initialiser_;
1087 CYForEachIn(CYForInInitialiser *initialiser, CYExpression *set, CYStatement *code) :
1088 initialiser_(initialiser),
1094 virtual CYStatement *Replace(CYContext &context);
1095 virtual void Output(CYOutput &out, CYFlags flags) const;
1101 CYProperty *properties_;
1103 CYObject(CYProperty *properties) :
1104 properties_(properties)
1108 virtual CYExpression *Replace(CYContext &context);
1109 void Output(CYOutput &out, CYFlags flags) const;
1115 CYExpression *object_;
1116 CYExpression *property_;
1118 CYMember(CYExpression *object, CYExpression *property) :
1124 void SetLeft(CYExpression *object) {
1128 void Replace_(CYContext &context);
1131 struct CYDirectMember :
1134 CYDirectMember(CYExpression *object, CYExpression *property) :
1135 CYMember(object, property)
1142 virtual CYExpression *Replace(CYContext &context);
1143 virtual void Output(CYOutput &out, CYFlags flags) const;
1146 struct CYIndirectMember :
1149 CYIndirectMember(CYExpression *object, CYExpression *property) :
1150 CYMember(object, property)
1157 virtual CYExpression *Replace(CYContext &context);
1158 virtual void Output(CYOutput &out, CYFlags flags) const;
1164 CYExpression *constructor_;
1165 CYArgument *arguments_;
1167 CYNew(CYExpression *constructor, CYArgument *arguments) :
1168 constructor_(constructor),
1169 arguments_(arguments)
1173 virtual unsigned Precedence() const {
1174 return arguments_ == NULL ? 2 : 1;
1179 virtual CYExpression *Replace(CYContext &context);
1180 virtual void Output(CYOutput &out, CYFlags flags) const;
1186 CYExpression *function_;
1187 CYArgument *arguments_;
1189 CYCall(CYExpression *function, CYArgument *arguments = NULL) :
1190 function_(function),
1191 arguments_(arguments)
1198 virtual CYExpression *Replace(CYContext &context);
1199 virtual void Output(CYOutput &out, CYFlags flags) const;
1205 CYExpression *test_;
1207 CYStatement *false_;
1209 CYIf(CYExpression *test, CYStatement *_true, CYStatement *_false = NULL) :
1216 virtual CYStatement *Replace(CYContext &context);
1217 virtual void Output(CYOutput &out, CYFlags flags) const;
1223 CYExpression *test_;
1226 CYDoWhile(CYExpression *test, CYStatement *code) :
1232 virtual CYStatement *Replace(CYContext &context);
1233 virtual void Output(CYOutput &out, CYFlags flags) const;
1239 CYExpression *test_;
1242 CYWhile(CYExpression *test, CYStatement *code) :
1248 virtual CYStatement *Replace(CYContext &context);
1249 virtual void Output(CYOutput &out, CYFlags flags) const;
1253 CYIdentifier *name_;
1254 CYFunctionParameter *parameters_;
1257 CYFunction(CYIdentifier *name, CYFunctionParameter *parameters, CYStatement *statements) :
1259 parameters_(parameters),
1264 virtual ~CYFunction() {
1267 virtual void Replace_(CYContext &context);
1268 virtual void Output(CYOutput &out, CYFlags flags) const;
1271 struct CYFunctionExpression :
1275 CYFunctionExpression(CYIdentifier *name, CYFunctionParameter *parameters, CYStatement *statements) :
1276 CYFunction(name, parameters, statements)
1283 virtual CYExpression *Replace(CYContext &context);
1284 virtual void Output(CYOutput &out, CYFlags flags) const;
1287 struct CYFunctionStatement :
1291 CYFunctionStatement(CYIdentifier *name, CYFunctionParameter *parameters, CYStatement *statements) :
1292 CYFunction(name, parameters, statements)
1296 virtual CYStatement *Replace(CYContext &context);
1297 virtual void Output(CYOutput &out, CYFlags flags) const;
1303 CYExpression *expression_;
1305 CYExpress(CYExpression *expression) :
1306 expression_(expression)
1310 virtual CYStatement *Replace(CYContext &context);
1311 virtual void Output(CYOutput &out, CYFlags flags) const;
1317 CYIdentifier *label_;
1319 CYContinue(CYIdentifier *label) :
1324 virtual CYStatement *Replace(CYContext &context);
1325 virtual void Output(CYOutput &out, CYFlags flags) const;
1331 CYIdentifier *label_;
1333 CYBreak(CYIdentifier *label) :
1338 virtual CYStatement *Replace(CYContext &context);
1339 virtual void Output(CYOutput &out, CYFlags flags) const;
1345 CYExpression *value_;
1347 CYReturn(CYExpression *value) :
1352 virtual CYStatement *Replace(CYContext &context);
1353 virtual void Output(CYOutput &out, CYFlags flags) const;
1359 virtual CYStatement *Replace(CYContext &context);
1360 virtual void Output(CYOutput &out, CYFlags flags) const;
1368 CYFinally(CYStatement *statements) :
1373 void Replace(CYContext &context);
1374 virtual void Output(CYOutput &out) const;
1383 CYIdentifier *name_;
1386 Catch(CYIdentifier *name, CYStatement *statements) :
1392 void Replace(CYContext &context);
1393 virtual void Output(CYOutput &out) const;
1401 CYFinally *finally_;
1403 Try(CYStatement *statements, Catch *_catch, CYFinally *finally) :
1410 virtual CYStatement *Replace(CYContext &context);
1411 virtual void Output(CYOutput &out, CYFlags flags) const;
1417 CYExpression *value_;
1419 Throw(CYExpression *value) :
1424 virtual CYStatement *Replace(CYContext &context);
1425 virtual void Output(CYOutput &out, CYFlags flags) const;
1433 CYExpression *scope_;
1436 CYWith(CYExpression *scope, CYStatement *code) :
1442 virtual CYStatement *Replace(CYContext &context);
1443 virtual void Output(CYOutput &out, CYFlags flags) const;
1449 CYExpression *value_;
1452 CYSwitch(CYExpression *value, CYClause *clauses) :
1458 virtual CYStatement *Replace(CYContext &context);
1459 virtual void Output(CYOutput &out, CYFlags flags) const;
1462 struct CYCondition :
1465 CYExpression *test_;
1466 CYExpression *true_;
1467 CYExpression *false_;
1469 CYCondition(CYExpression *test, CYExpression *_true, CYExpression *_false) :
1478 virtual CYExpression *Replace(CYContext &context);
1479 virtual void Output(CYOutput &out, CYFlags flags) const;
1482 struct CYAddressOf :
1485 CYAddressOf(CYExpression *rhs) :
1490 virtual const char *Operator() const {
1496 virtual CYExpression *Replace(CYContext &context);
1502 CYIndirect(CYExpression *rhs) :
1507 virtual const char *Operator() const {
1513 virtual CYExpression *Replace(CYContext &context);
1517 virtual CYExpression *Replace(CYContext &context);
1519 #define CYPostfix_(op, name, args...) \
1520 struct CY ## name : \
1523 CY ## name(CYExpression *lhs) : \
1528 virtual const char *Operator() const { \
1533 #define CYPrefix_(alphabetic, op, name, args...) \
1534 struct CY ## name : \
1537 CY ## name(CYExpression *rhs) : \
1542 CYAlphabetic(alphabetic) \
1544 virtual const char *Operator() const { \
1549 #define CYInfix_(alphabetic, precedence, op, name, args...) \
1550 struct CY ## name : \
1553 CY ## name(CYExpression *lhs, CYExpression *rhs) : \
1558 CYAlphabetic(alphabetic) \
1559 CYPrecedence(precedence) \
1561 virtual const char *Operator() const { \
1566 #define CYAssignment_(op, name, args...) \
1567 struct CY ## name ## Assign : \
1570 CY ## name ## Assign(CYExpression *lhs, CYExpression *rhs) : \
1571 CYAssignment(lhs, rhs) \
1575 virtual const char *Operator() const { \
1580 CYPostfix_("++", PostIncrement)
1581 CYPostfix_("--", PostDecrement)
1583 CYPrefix_(true, "delete", Delete)
1584 CYPrefix_(true, "void", Void)
1585 CYPrefix_(true, "typeof", TypeOf)
1586 CYPrefix_(false, "++", PreIncrement)
1587 CYPrefix_(false, "--", PreDecrement)
1588 CYPrefix_(false, "+", Affirm)
1589 CYPrefix_(false, "-", Negate)
1590 CYPrefix_(false, "~", BitwiseNot)
1591 CYPrefix_(false, "!", LogicalNot)
1593 CYInfix_(false, 5, "*", Multiply)
1594 CYInfix_(false, 5, "/", Divide)
1595 CYInfix_(false, 5, "%", Modulus)
1596 CYInfix_(false, 6, "+", Add, CYReplace)
1597 CYInfix_(false, 6, "-", Subtract)
1598 CYInfix_(false, 7, "<<", ShiftLeft)
1599 CYInfix_(false, 7, ">>", ShiftRightSigned)
1600 CYInfix_(false, 7, ">>>", ShiftRightUnsigned)
1601 CYInfix_(false, 8, "<", Less)
1602 CYInfix_(false, 8, ">", Greater)
1603 CYInfix_(false, 8, "<=", LessOrEqual)
1604 CYInfix_(false, 8, ">=", GreaterOrEqual)
1605 CYInfix_(true, 8, "instanceof", InstanceOf)
1606 CYInfix_(true, 8, "in", In)
1607 CYInfix_(false, 9, "==", Equal)
1608 CYInfix_(false, 9, "!=", NotEqual)
1609 CYInfix_(false, 9, "===", Identical)
1610 CYInfix_(false, 9, "!==", NotIdentical)
1611 CYInfix_(false, 10, "&", BitwiseAnd)
1612 CYInfix_(false, 11, "^", BitwiseXOr)
1613 CYInfix_(false, 12, "|", BitwiseOr)
1614 CYInfix_(false, 13, "&&", LogicalAnd)
1615 CYInfix_(false, 14, "||", LogicalOr)
1617 CYAssignment_("=", )
1618 CYAssignment_("*=", Multiply)
1619 CYAssignment_("/=", Divide)
1620 CYAssignment_("%=", Modulus)
1621 CYAssignment_("+=", Add)
1622 CYAssignment_("-=", Subtract)
1623 CYAssignment_("<<=", ShiftLeft)
1624 CYAssignment_(">>=", ShiftRightSigned)
1625 CYAssignment_(">>>=", ShiftRightUnsigned)
1626 CYAssignment_("&=", BitwiseAnd)
1627 CYAssignment_("^=", BitwiseXOr)
1628 CYAssignment_("|=", BitwiseOr)
1630 #endif/*CYPARSER_HPP*/