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) {
76 virtual void Output(struct CYOutput &out) const = 0;
92 CYOutput(std::ostream &out) :
100 void Check(char value);
103 CYOutput &operator <<(char rhs);
104 CYOutput &operator <<(const char *rhs);
106 _finline CYOutput &operator <<(const CYThing *rhs) {
112 _finline CYOutput &operator <<(const CYThing &rhs) {
118 struct CYPropertyName {
119 virtual void PropertyName(CYOutput &out) const = 0;
132 CYNoBrace = (1 << 0),
133 CYNoFunction = (1 << 1),
136 CYNoRightHand = (1 << 4),
137 CYNoDangle = (1 << 5),
138 CYNoBF = (CYNoBrace | CYNoFunction),
144 CYContext(apr_pool_t *pool) :
149 template <typename Type_>
150 void Replace(Type_ *&value) {
152 while (Type_ *replace = value->Replace(*this))
160 void Single(CYOutput &out, CYFlags flags) const;
161 void Multiple(CYOutput &out, CYFlags flags = CYNoFlags) const;
163 CYStatement *ReplaceAll(CYContext &context);
165 virtual CYStatement *Replace(CYContext &context) = 0;
168 virtual void Output(CYOutput &out, CYFlags flags) const = 0;
171 struct CYStatements {
181 operator CYStatement *() const {
185 CYStatements &operator ->*(CYStatement *next) {
187 if (first_ == NULL) {
190 } else for (;; last_ = last_->next_)
191 if (last_->next_ == NULL) {
201 virtual CYExpression *ClassName(CYContext &context, bool object) = 0;
202 virtual void ClassName(CYOutput &out, bool object) const = 0;
212 CYWord(const char *word) :
217 const char *Value() const {
221 virtual void Output(CYOutput &out) const;
223 virtual CYExpression *ClassName(CYContext &context, bool object);
224 virtual void ClassName(CYOutput &out, bool object) const;
225 virtual void PropertyName(CYOutput &out) const;
228 _finline std::ostream &operator <<(std::ostream &lhs, const CYWord &rhs) {
229 return lhs << rhs.Value();
232 struct CYIdentifier :
235 CYIdentifier(const char *word) :
245 CYStatement *statement_;
247 CYLabel(CYIdentifier *name, CYStatement *statement) :
249 statement_(statement)
253 virtual CYStatement *Replace(CYContext &context);
254 virtual void Output(CYOutput &out, CYFlags flags) const;
260 CYStatement *statements_;
262 CYProgram(CYStatement *statements) :
263 statements_(statements)
267 virtual void Replace(CYContext &context);
269 virtual void Output(CYOutput &out) const;
276 CYStatement *statements_;
278 CYBlock(CYStatement *statements) :
279 statements_(statements)
283 operator CYStatement *() const {
287 virtual CYStatement *Replace(CYContext &context);
289 virtual void Output(CYOutput &out) const;
290 virtual void Output(CYOutput &out, CYFlags flags) const;
318 std::string filename_;
322 cy::location location_;
323 std::string message_;
326 typedef std::vector<Error> Errors;
333 void ScannerDestroy();
336 CYDriver(const std::string &filename);
339 Condition GetCondition();
340 void SetCondition(Condition condition);
342 void PushCondition(Condition condition);
345 void Warning(const cy::location &location, const char *message);
348 struct CYForInitialiser {
349 virtual void For(CYOutput &out) const = 0;
352 struct CYForInInitialiser {
353 virtual void ForIn(CYOutput &out, CYFlags flags) const = 0;
354 virtual const char *ForEachIn() const = 0;
355 virtual CYExpression *ForEachIn(CYContext &out) = 0;
361 struct CYExpression :
362 CYNext<CYExpression>,
368 virtual unsigned Precedence() const = 0;
370 virtual bool RightHand() const {
374 virtual void For(CYOutput &out) const;
375 virtual void ForIn(CYOutput &out, CYFlags flags) const;
377 virtual const char *ForEachIn() const;
378 virtual CYExpression *ForEachIn(CYContext &out);
380 virtual void Output(CYOutput &out) const;
381 virtual void Output(CYOutput &out, CYFlags flags) const = 0;
382 void Output(CYOutput &out, unsigned precedence, CYFlags flags) const;
384 virtual CYExpression *ClassName(CYContext &context, bool object);
385 virtual void ClassName(CYOutput &out, bool object) const;
387 CYExpression *ReplaceAll(CYContext &context);
389 virtual CYExpression *Replace(CYContext &context) = 0;
391 virtual CYExpression *Primitive(CYContext &context) {
395 virtual CYNumber *Number(CYContext &context) {
399 virtual CYString *String(CYContext &context) {
403 virtual const char *Word() const {
408 #define CYAlphabetic(value) \
409 virtual bool Alphabetic() const { \
413 #define CYPrecedence(value) \
414 virtual unsigned Precedence() const { \
418 #define CYRightHand(value) \
419 virtual bool RightHand() const { \
426 CYExpression *expressions_;
428 CYCompound(CYExpression *expressions) :
429 expressions_(expressions)
433 void AddPrev(CYExpression *expression) {
434 CYExpression *last(expression);
435 while (last->next_ != NULL)
437 last->SetNext(expressions_);
438 expressions_ = expression;
443 virtual CYExpression *Replace(CYContext &context);
444 void Output(CYOutput &out, CYFlags flags) const;
447 struct CYFunctionParameter :
448 CYNext<CYFunctionParameter>,
453 CYFunctionParameter(CYIdentifier *name, CYFunctionParameter *next = NULL) :
454 CYNext<CYFunctionParameter>(next),
459 virtual void Output(CYOutput &out) const;
462 struct CYComprehension :
463 CYNext<CYComprehension>,
466 virtual const char *Name() const = 0;
468 virtual CYFunctionParameter *Parameter(CYContext &context) const = 0;
469 CYFunctionParameter *Parameters(CYContext &context) const;
470 virtual CYStatement *Replace(CYContext &context, CYStatement *statement) const;
471 virtual void Output(CYOutput &out) const = 0;
474 struct CYForInComprehension :
480 CYForInComprehension(CYIdentifier *name, CYExpression *set) :
486 virtual const char *Name() const {
487 return name_->Value();
490 virtual CYFunctionParameter *Parameter(CYContext &context) const;
491 virtual CYStatement *Replace(CYContext &context, CYStatement *statement) const;
492 virtual void Output(CYOutput &out) const;
495 struct CYForEachInComprehension :
501 CYForEachInComprehension(CYIdentifier *name, CYExpression *set) :
507 virtual const char *Name() const {
508 return name_->Value();
511 virtual CYFunctionParameter *Parameter(CYContext &context) const;
512 virtual CYStatement *Replace(CYContext &context, CYStatement *statement) const;
513 virtual void Output(CYOutput &out) const;
516 struct CYIfComprehension :
521 CYIfComprehension(CYExpression *test) :
526 virtual const char *Name() const {
530 virtual CYFunctionParameter *Parameter(CYContext &context) const;
531 virtual CYStatement *Replace(CYContext &context, CYStatement *statement) const;
532 virtual void Output(CYOutput &out) const;
535 struct CYArrayComprehension :
538 CYExpression *expression_;
539 CYComprehension *comprehensions_;
541 CYArrayComprehension(CYExpression *expression, CYComprehension *comprehensions) :
542 expression_(expression),
543 comprehensions_(comprehensions)
549 virtual CYExpression *Replace(CYContext &context);
550 virtual void Output(CYOutput &out, CYFlags flags) const;
563 virtual CYExpression *Replace(CYContext &context);
577 CYRange(uint64_t lo, uint64_t hi) :
582 bool operator [](uint8_t value) const {
583 return !(value >> 7) && (value >> 6 ? hi_ : lo_) >> (value & 0x3f) & 0x1;
586 void operator()(uint8_t value) {
589 (value >> 6 ? hi_ : lo_) |= uint64_t(0x1) << (value & 0x3f);
593 extern CYRange DigitRange_;
594 extern CYRange WordStartRange_;
595 extern CYRange WordEndRange_;
610 CYString(const char *value) :
616 CYString(const char *value, size_t size) :
622 CYString(const CYWord *word) :
623 value_(word->Value()),
624 size_(strlen(value_))
628 const char *Value() const {
632 virtual const char *Word() const;
634 virtual CYNumber *Number(CYContext &context);
635 virtual CYString *String(CYContext &context);
637 virtual CYString *Concat(CYContext &out, CYString *rhs) const;
638 virtual void Output(CYOutput &out, CYFlags flags) const;
639 virtual void PropertyName(CYOutput &out) const;
648 CYNumber(double value) :
653 double Value() const {
657 virtual CYNumber *Number(CYContext &context);
658 virtual CYString *String(CYContext &context);
660 virtual void Output(CYOutput &out, CYFlags flags) const;
661 virtual void PropertyName(CYOutput &out) const;
669 CYRegEx(const char *value) :
674 const char *Value() const {
678 virtual void Output(CYOutput &out, CYFlags flags) const;
690 virtual CYNumber *Number(CYContext &context);
691 virtual CYString *String(CYContext &context);
693 virtual void Output(CYOutput &out, CYFlags flags) const;
705 virtual CYExpression *Replace(CYContext &context);
706 virtual void Output(CYOutput &out, CYFlags flags) const;
712 virtual bool Value() const = 0;
713 virtual void Output(CYOutput &out, CYFlags flags) const;
725 virtual bool Value() const {
729 virtual CYNumber *Number(CYContext &context);
730 virtual CYString *String(CYContext &context);
742 virtual bool Value() const {
746 virtual CYNumber *Number(CYContext &context);
747 virtual CYString *String(CYContext &context);
755 CYVariable(CYIdentifier *name) :
763 virtual CYExpression *Replace(CYContext &context);
764 virtual void Output(CYOutput &out, CYFlags flags) const;
772 CYPrefix(CYExpression *rhs) :
777 virtual bool Alphabetic() const = 0;
778 virtual const char *Operator() const = 0;
782 virtual CYExpression *Replace(CYContext &context);
783 virtual void Output(CYOutput &out, CYFlags flags) const;
792 CYInfix(CYExpression *lhs, CYExpression *rhs) :
798 void SetLeft(CYExpression *lhs) {
802 virtual bool Alphabetic() const = 0;
803 virtual const char *Operator() const = 0;
805 virtual CYExpression *Replace(CYContext &context);
806 virtual void Output(CYOutput &out, CYFlags flags) const;
814 CYPostfix(CYExpression *lhs) :
819 virtual const char *Operator() const = 0;
823 virtual CYExpression *Replace(CYContext &context);
824 virtual void Output(CYOutput &out, CYFlags flags) const;
827 struct CYAssignment :
833 CYAssignment(CYExpression *lhs, CYExpression *rhs) :
839 void SetLeft(CYExpression *lhs) {
843 virtual const char *Operator() const = 0;
847 virtual CYExpression *Replace(CYContext &context);
848 virtual void Output(CYOutput &out, CYFlags flags) const;
856 CYExpression *value_;
858 CYArgument(CYExpression *value, CYArgument *next = NULL) :
859 CYNext<CYArgument>(next),
865 CYArgument(CYWord *name, CYExpression *value, CYArgument *next = NULL) :
866 CYNext<CYArgument>(next),
872 void Replace(CYContext &context);
873 void Output(CYOutput &out) const;
890 CYStatement *statements_;
892 CYClause(CYExpression *_case, CYStatement *statements) :
894 statements_(statements)
898 void Replace(CYContext &context);
899 virtual void Output(CYOutput &out) const;
906 CYExpression *value_;
908 CYElement(CYExpression *value, CYElement *next) :
909 CYNext<CYElement>(next),
914 void Replace(CYContext &context);
915 void Output(CYOutput &out) const;
921 CYElement *elements_;
923 CYArray(CYElement *elements = NULL) :
928 virtual CYExpression *Replace(CYContext &context);
929 virtual void Output(CYOutput &out, CYFlags flags) const;
932 struct CYDeclaration :
935 CYIdentifier *identifier_;
936 CYExpression *initialiser_;
938 CYDeclaration(CYIdentifier *identifier, CYExpression *initialiser) :
939 identifier_(identifier),
940 initialiser_(initialiser)
944 virtual void ForIn(CYOutput &out, CYFlags flags) const;
946 virtual const char *ForEachIn() const;
947 virtual CYExpression *ForEachIn(CYContext &out);
949 void Replace(CYContext &context);
951 virtual void Output(CYOutput &out, CYFlags flags) const;
954 struct CYDeclarations :
955 CYNext<CYDeclarations>,
959 CYDeclaration *declaration_;
961 CYDeclarations(CYDeclaration *declaration, CYDeclarations *next = NULL) :
962 CYNext<CYDeclarations>(next),
963 declaration_(declaration)
967 virtual void For(CYOutput &out) const;
969 void Replace(CYContext &context);
971 virtual void Output(CYOutput &out) const;
972 virtual void Output(CYOutput &out, CYFlags flags) const;
978 CYDeclarations *declarations_;
980 CYVar(CYDeclarations *declarations) :
981 declarations_(declarations)
985 virtual CYStatement *Replace(CYContext &context);
986 virtual void Output(CYOutput &out, CYFlags flags) const;
992 CYDeclarations *declarations_;
995 CYLet(CYDeclarations *declarations, CYStatement *statements) :
996 declarations_(declarations),
1001 virtual CYStatement *Replace(CYContext &context);
1002 virtual void Output(CYOutput &out, CYFlags flags) const;
1008 CYForInitialiser *initialiser_;
1009 CYExpression *test_;
1010 CYExpression *increment_;
1013 CYFor(CYForInitialiser *initialiser, CYExpression *test, CYExpression *increment, CYStatement *code) :
1014 initialiser_(initialiser),
1016 increment_(increment),
1021 virtual CYStatement *Replace(CYContext &context);
1022 virtual void Output(CYOutput &out, CYFlags flags) const;
1028 CYForInInitialiser *initialiser_;
1032 CYForIn(CYForInInitialiser *initialiser, CYExpression *set, CYStatement *code) :
1033 initialiser_(initialiser),
1039 virtual CYStatement *Replace(CYContext &context);
1040 virtual void Output(CYOutput &out, CYFlags flags) const;
1043 struct CYForEachIn :
1046 CYForInInitialiser *initialiser_;
1050 CYForEachIn(CYForInInitialiser *initialiser, CYExpression *set, CYStatement *code) :
1051 initialiser_(initialiser),
1057 virtual CYStatement *Replace(CYContext &context);
1058 virtual void Output(CYOutput &out, CYFlags flags) const;
1065 CYPropertyName *name_;
1066 CYExpression *value_;
1068 CYProperty(CYPropertyName *name, CYExpression *value, CYProperty *next = NULL) :
1069 CYNext<CYProperty>(next),
1075 void Replace(CYContext &context);
1076 virtual void Output(CYOutput &out) const;
1082 CYProperty *properties_;
1084 CYObject(CYProperty *properties) :
1085 properties_(properties)
1089 virtual CYExpression *Replace(CYContext &context);
1090 void Output(CYOutput &out, CYFlags flags) const;
1096 CYExpression *object_;
1097 CYExpression *property_;
1099 CYMember(CYExpression *object, CYExpression *property) :
1105 void SetLeft(CYExpression *object) {
1109 void Replace_(CYContext &context);
1112 struct CYDirectMember :
1115 CYDirectMember(CYExpression *object, CYExpression *property) :
1116 CYMember(object, property)
1123 virtual CYExpression *Replace(CYContext &context);
1124 virtual void Output(CYOutput &out, CYFlags flags) const;
1127 struct CYIndirectMember :
1130 CYIndirectMember(CYExpression *object, CYExpression *property) :
1131 CYMember(object, property)
1138 virtual CYExpression *Replace(CYContext &context);
1139 virtual void Output(CYOutput &out, CYFlags flags) const;
1145 CYExpression *constructor_;
1146 CYArgument *arguments_;
1148 CYNew(CYExpression *constructor, CYArgument *arguments) :
1149 constructor_(constructor),
1150 arguments_(arguments)
1154 virtual unsigned Precedence() const {
1155 return arguments_ == NULL ? 2 : 1;
1160 virtual CYExpression *Replace(CYContext &context);
1161 virtual void Output(CYOutput &out, CYFlags flags) const;
1167 CYExpression *function_;
1168 CYArgument *arguments_;
1170 CYCall(CYExpression *function, CYArgument *arguments = NULL) :
1171 function_(function),
1172 arguments_(arguments)
1179 virtual CYExpression *Replace(CYContext &context);
1180 virtual void Output(CYOutput &out, CYFlags flags) const;
1186 CYExpression *test_;
1188 CYStatement *false_;
1190 CYIf(CYExpression *test, CYStatement *_true, CYStatement *_false = NULL) :
1197 virtual CYStatement *Replace(CYContext &context);
1198 virtual void Output(CYOutput &out, CYFlags flags) const;
1204 CYExpression *test_;
1207 CYDoWhile(CYExpression *test, CYStatement *code) :
1213 virtual CYStatement *Replace(CYContext &context);
1214 virtual void Output(CYOutput &out, CYFlags flags) const;
1220 CYExpression *test_;
1223 CYWhile(CYExpression *test, CYStatement *code) :
1229 virtual CYStatement *Replace(CYContext &context);
1230 virtual void Output(CYOutput &out, CYFlags flags) const;
1234 CYIdentifier *name_;
1235 CYFunctionParameter *parameters_;
1238 CYFunction(CYIdentifier *name, CYFunctionParameter *parameters, CYStatement *statements) :
1240 parameters_(parameters),
1245 virtual void Replace_(CYContext &context);
1246 virtual void Output(CYOutput &out, CYFlags flags) const;
1249 struct CYFunctionExpression :
1253 CYFunctionExpression(CYIdentifier *name, CYFunctionParameter *parameters, CYStatement *statements) :
1254 CYFunction(name, parameters, statements)
1261 virtual CYExpression *Replace(CYContext &context);
1262 virtual void Output(CYOutput &out, CYFlags flags) const;
1265 struct CYFunctionStatement :
1269 CYFunctionStatement(CYIdentifier *name, CYFunctionParameter *parameters, CYStatement *statements) :
1270 CYFunction(name, parameters, statements)
1274 virtual CYStatement *Replace(CYContext &context);
1275 virtual void Output(CYOutput &out, CYFlags flags) const;
1281 CYExpression *expression_;
1283 CYExpress(CYExpression *expression) :
1284 expression_(expression)
1288 virtual CYStatement *Replace(CYContext &context);
1289 virtual void Output(CYOutput &out, CYFlags flags) const;
1295 CYIdentifier *label_;
1297 CYContinue(CYIdentifier *label) :
1302 virtual CYStatement *Replace(CYContext &context);
1303 virtual void Output(CYOutput &out, CYFlags flags) const;
1309 CYIdentifier *label_;
1311 CYBreak(CYIdentifier *label) :
1316 virtual CYStatement *Replace(CYContext &context);
1317 virtual void Output(CYOutput &out, CYFlags flags) const;
1323 CYExpression *value_;
1325 CYReturn(CYExpression *value) :
1330 virtual CYStatement *Replace(CYContext &context);
1331 virtual void Output(CYOutput &out, CYFlags flags) const;
1337 virtual CYStatement *Replace(CYContext &context);
1338 virtual void Output(CYOutput &out, CYFlags flags) const;
1346 CYFinally(CYStatement *statements) :
1351 void Replace(CYContext &context);
1352 virtual void Output(CYOutput &out) const;
1361 CYIdentifier *name_;
1364 Catch(CYIdentifier *name, CYStatement *statements) :
1370 void Replace(CYContext &context);
1371 virtual void Output(CYOutput &out) const;
1379 CYFinally *finally_;
1381 Try(CYStatement *statements, Catch *_catch, CYFinally *finally) :
1388 virtual CYStatement *Replace(CYContext &context);
1389 virtual void Output(CYOutput &out, CYFlags flags) const;
1395 CYExpression *value_;
1397 Throw(CYExpression *value) :
1402 virtual CYStatement *Replace(CYContext &context);
1403 virtual void Output(CYOutput &out, CYFlags flags) const;
1411 CYExpression *scope_;
1414 CYWith(CYExpression *scope, CYStatement *code) :
1420 virtual CYStatement *Replace(CYContext &context);
1421 virtual void Output(CYOutput &out, CYFlags flags) const;
1427 CYExpression *value_;
1430 CYSwitch(CYExpression *value, CYClause *clauses) :
1436 virtual CYStatement *Replace(CYContext &context);
1437 virtual void Output(CYOutput &out, CYFlags flags) const;
1440 struct CYCondition :
1443 CYExpression *test_;
1444 CYExpression *true_;
1445 CYExpression *false_;
1447 CYCondition(CYExpression *test, CYExpression *_true, CYExpression *_false) :
1456 virtual CYExpression *Replace(CYContext &context);
1457 virtual void Output(CYOutput &out, CYFlags flags) const;
1460 struct CYAddressOf :
1463 CYAddressOf(CYExpression *rhs) :
1468 virtual const char *Operator() const {
1474 virtual CYExpression *Replace(CYContext &context);
1480 CYIndirect(CYExpression *rhs) :
1485 virtual const char *Operator() const {
1491 virtual CYExpression *Replace(CYContext &context);
1495 virtual CYExpression *Replace(CYContext &context);
1497 #define CYPostfix_(op, name, args...) \
1498 struct CY ## name : \
1501 CY ## name(CYExpression *lhs) : \
1506 virtual const char *Operator() const { \
1511 #define CYPrefix_(alphabetic, op, name, args...) \
1512 struct CY ## name : \
1515 CY ## name(CYExpression *rhs) : \
1520 CYAlphabetic(alphabetic) \
1522 virtual const char *Operator() const { \
1527 #define CYInfix_(alphabetic, precedence, op, name, args...) \
1528 struct CY ## name : \
1531 CY ## name(CYExpression *lhs, CYExpression *rhs) : \
1536 CYAlphabetic(alphabetic) \
1537 CYPrecedence(precedence) \
1539 virtual const char *Operator() const { \
1544 #define CYAssignment_(op, name, args...) \
1545 struct CY ## name ## Assign : \
1548 CY ## name ## Assign(CYExpression *lhs, CYExpression *rhs) : \
1549 CYAssignment(lhs, rhs) \
1553 virtual const char *Operator() const { \
1558 CYPostfix_("++", PostIncrement)
1559 CYPostfix_("--", PostDecrement)
1561 CYPrefix_(true, "delete", Delete)
1562 CYPrefix_(true, "void", Void)
1563 CYPrefix_(true, "typeof", TypeOf)
1564 CYPrefix_(false, "++", PreIncrement)
1565 CYPrefix_(false, "--", PreDecrement)
1566 CYPrefix_(false, "+", Affirm)
1567 CYPrefix_(false, "-", Negate)
1568 CYPrefix_(false, "~", BitwiseNot)
1569 CYPrefix_(false, "!", LogicalNot)
1571 CYInfix_(false, 5, "*", Multiply)
1572 CYInfix_(false, 5, "/", Divide)
1573 CYInfix_(false, 5, "%", Modulus)
1574 CYInfix_(false, 6, "+", Add, CYReplace)
1575 CYInfix_(false, 6, "-", Subtract)
1576 CYInfix_(false, 7, "<<", ShiftLeft)
1577 CYInfix_(false, 7, ">>", ShiftRightSigned)
1578 CYInfix_(false, 7, ">>>", ShiftRightUnsigned)
1579 CYInfix_(false, 8, "<", Less)
1580 CYInfix_(false, 8, ">", Greater)
1581 CYInfix_(false, 8, "<=", LessOrEqual)
1582 CYInfix_(false, 8, ">=", GreaterOrEqual)
1583 CYInfix_(true, 8, "instanceof", InstanceOf)
1584 CYInfix_(true, 8, "in", In)
1585 CYInfix_(false, 9, "==", Equal)
1586 CYInfix_(false, 9, "!=", NotEqual)
1587 CYInfix_(false, 9, "===", Identical)
1588 CYInfix_(false, 9, "!==", NotIdentical)
1589 CYInfix_(false, 10, "&", BitwiseAnd)
1590 CYInfix_(false, 11, "^", BitwiseXOr)
1591 CYInfix_(false, 12, "|", BitwiseOr)
1592 CYInfix_(false, 13, "&&", LogicalAnd)
1593 CYInfix_(false, 14, "||", LogicalOr)
1595 CYAssignment_("=", )
1596 CYAssignment_("*=", Multiply)
1597 CYAssignment_("/=", Divide)
1598 CYAssignment_("%=", Modulus)
1599 CYAssignment_("+=", Add)
1600 CYAssignment_("-=", Subtract)
1601 CYAssignment_("<<=", ShiftLeft)
1602 CYAssignment_(">>=", ShiftRightSigned)
1603 CYAssignment_(">>>=", ShiftRightUnsigned)
1604 CYAssignment_("&=", BitwiseAnd)
1605 CYAssignment_("^=", BitwiseXOr)
1606 CYAssignment_("|=", BitwiseOr)
1608 #endif/*CYPARSER_HPP*/