1 /* Cycript - Remote Execution 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;
317 std::string filename_;
321 cy::location location_;
322 std::string message_;
325 typedef std::vector<Error> Errors;
332 void ScannerDestroy();
335 CYDriver(const std::string &filename);
338 void SetCondition(Condition condition);
340 void Warning(const cy::location &location, const char *message);
343 struct CYForInitialiser {
344 virtual void For(CYOutput &out) const = 0;
347 struct CYForInInitialiser {
348 virtual void ForIn(CYOutput &out, CYFlags flags) const = 0;
349 virtual const char *ForEachIn() const = 0;
350 virtual CYExpression *ForEachIn(CYContext &out) = 0;
356 struct CYExpression :
357 CYNext<CYExpression>,
363 virtual unsigned Precedence() const = 0;
365 virtual bool RightHand() const {
369 virtual void For(CYOutput &out) const;
370 virtual void ForIn(CYOutput &out, CYFlags flags) const;
372 virtual const char *ForEachIn() const;
373 virtual CYExpression *ForEachIn(CYContext &out);
375 virtual void Output(CYOutput &out) const;
376 virtual void Output(CYOutput &out, CYFlags flags) const = 0;
377 void Output(CYOutput &out, unsigned precedence, CYFlags flags) const;
379 virtual CYExpression *ClassName(CYContext &context, bool object);
380 virtual void ClassName(CYOutput &out, bool object) const;
382 CYExpression *ReplaceAll(CYContext &context);
384 virtual CYExpression *Replace(CYContext &context) = 0;
386 virtual CYExpression *Primitive(CYContext &context) {
390 virtual CYNumber *Number(CYContext &context) {
394 virtual CYString *String(CYContext &context) {
398 virtual const char *Word() const {
403 #define CYAlphabetic(value) \
404 virtual bool Alphabetic() const { \
408 #define CYPrecedence(value) \
409 virtual unsigned Precedence() const { \
413 #define CYRightHand(value) \
414 virtual bool RightHand() const { \
421 CYExpression *expressions_;
423 CYCompound(CYExpression *expressions) :
424 expressions_(expressions)
428 void AddPrev(CYExpression *expression) {
429 CYExpression *last(expression);
430 while (last->next_ != NULL)
432 last->SetNext(expressions_);
433 expressions_ = expression;
438 virtual CYExpression *Replace(CYContext &context);
439 void Output(CYOutput &out, CYFlags flags) const;
442 struct CYFunctionParameter :
443 CYNext<CYFunctionParameter>,
448 CYFunctionParameter(CYIdentifier *name, CYFunctionParameter *next = NULL) :
449 CYNext<CYFunctionParameter>(next),
454 virtual void Output(CYOutput &out) const;
457 struct CYComprehension :
458 CYNext<CYComprehension>,
461 virtual const char *Name() const = 0;
463 virtual CYFunctionParameter *Parameter(CYContext &context) const = 0;
464 CYFunctionParameter *Parameters(CYContext &context) const;
465 virtual CYStatement *Replace(CYContext &context, CYStatement *statement) const;
466 virtual void Output(CYOutput &out) const = 0;
469 struct CYForInComprehension :
475 CYForInComprehension(CYIdentifier *name, CYExpression *set) :
481 virtual const char *Name() const {
482 return name_->Value();
485 virtual CYFunctionParameter *Parameter(CYContext &context) const;
486 virtual CYStatement *Replace(CYContext &context, CYStatement *statement) const;
487 virtual void Output(CYOutput &out) const;
490 struct CYForEachInComprehension :
496 CYForEachInComprehension(CYIdentifier *name, CYExpression *set) :
502 virtual const char *Name() const {
503 return name_->Value();
506 virtual CYFunctionParameter *Parameter(CYContext &context) const;
507 virtual CYStatement *Replace(CYContext &context, CYStatement *statement) const;
508 virtual void Output(CYOutput &out) const;
511 struct CYIfComprehension :
516 CYIfComprehension(CYExpression *test) :
521 virtual const char *Name() const {
525 virtual CYFunctionParameter *Parameter(CYContext &context) const;
526 virtual CYStatement *Replace(CYContext &context, CYStatement *statement) const;
527 virtual void Output(CYOutput &out) const;
530 struct CYArrayComprehension :
533 CYExpression *expression_;
534 CYComprehension *comprehensions_;
536 CYArrayComprehension(CYExpression *expression, CYComprehension *comprehensions) :
537 expression_(expression),
538 comprehensions_(comprehensions)
544 virtual CYExpression *Replace(CYContext &context);
545 virtual void Output(CYOutput &out, CYFlags flags) const;
558 virtual CYExpression *Replace(CYContext &context);
572 CYRange(uint64_t lo, uint64_t hi) :
577 bool operator [](uint8_t value) const {
578 return !(value >> 7) && (value >> 6 ? hi_ : lo_) >> (value & 0x3f) & 0x1;
581 void operator()(uint8_t value) {
584 (value >> 6 ? hi_ : lo_) |= uint64_t(0x1) << (value & 0x3f);
588 extern CYRange DigitRange_;
589 extern CYRange WordStartRange_;
590 extern CYRange WordEndRange_;
605 CYString(const char *value) :
611 CYString(const char *value, size_t size) :
617 CYString(const CYWord *word) :
618 value_(word->Value()),
619 size_(strlen(value_))
623 const char *Value() const {
627 virtual const char *Word() const;
629 virtual CYNumber *Number(CYContext &context);
630 virtual CYString *String(CYContext &context);
632 virtual CYString *Concat(CYContext &out, CYString *rhs) const;
633 virtual void Output(CYOutput &out, CYFlags flags) const;
634 virtual void PropertyName(CYOutput &out) const;
643 CYNumber(double value) :
648 double Value() const {
652 virtual CYNumber *Number(CYContext &context);
653 virtual CYString *String(CYContext &context);
655 virtual void Output(CYOutput &out, CYFlags flags) const;
656 virtual void PropertyName(CYOutput &out) const;
664 CYRegEx(const char *value) :
669 const char *Value() const {
673 virtual void Output(CYOutput &out, CYFlags flags) const;
685 virtual CYNumber *Number(CYContext &context);
686 virtual CYString *String(CYContext &context);
688 virtual void Output(CYOutput &out, CYFlags flags) const;
700 virtual CYExpression *Replace(CYContext &context);
701 virtual void Output(CYOutput &out, CYFlags flags) const;
707 virtual bool Value() const = 0;
708 virtual void Output(CYOutput &out, CYFlags flags) const;
720 virtual bool Value() const {
724 virtual CYNumber *Number(CYContext &context);
725 virtual CYString *String(CYContext &context);
737 virtual bool Value() const {
741 virtual CYNumber *Number(CYContext &context);
742 virtual CYString *String(CYContext &context);
750 CYVariable(CYIdentifier *name) :
758 virtual CYExpression *Replace(CYContext &context);
759 virtual void Output(CYOutput &out, CYFlags flags) const;
767 CYPrefix(CYExpression *rhs) :
772 virtual bool Alphabetic() const = 0;
773 virtual const char *Operator() const = 0;
777 virtual CYExpression *Replace(CYContext &context);
778 virtual void Output(CYOutput &out, CYFlags flags) const;
787 CYInfix(CYExpression *lhs, CYExpression *rhs) :
793 void SetLeft(CYExpression *lhs) {
797 virtual bool Alphabetic() const = 0;
798 virtual const char *Operator() const = 0;
800 virtual CYExpression *Replace(CYContext &context);
801 virtual void Output(CYOutput &out, CYFlags flags) const;
809 CYPostfix(CYExpression *lhs) :
814 virtual const char *Operator() const = 0;
818 virtual CYExpression *Replace(CYContext &context);
819 virtual void Output(CYOutput &out, CYFlags flags) const;
822 struct CYAssignment :
828 CYAssignment(CYExpression *lhs, CYExpression *rhs) :
834 void SetLeft(CYExpression *lhs) {
838 virtual const char *Operator() const = 0;
842 virtual CYExpression *Replace(CYContext &context);
843 virtual void Output(CYOutput &out, CYFlags flags) const;
851 CYExpression *value_;
853 CYArgument(CYExpression *value, CYArgument *next = NULL) :
854 CYNext<CYArgument>(next),
860 CYArgument(CYWord *name, CYExpression *value, CYArgument *next = NULL) :
861 CYNext<CYArgument>(next),
867 void Replace(CYContext &context);
868 void Output(CYOutput &out) const;
885 CYStatement *statements_;
887 CYClause(CYExpression *_case, CYStatement *statements) :
889 statements_(statements)
893 void Replace(CYContext &context);
894 virtual void Output(CYOutput &out) const;
901 CYExpression *value_;
903 CYElement(CYExpression *value, CYElement *next) :
904 CYNext<CYElement>(next),
909 void Replace(CYContext &context);
910 void Output(CYOutput &out) const;
916 CYElement *elements_;
918 CYArray(CYElement *elements = NULL) :
923 virtual CYExpression *Replace(CYContext &context);
924 virtual void Output(CYOutput &out, CYFlags flags) const;
927 struct CYDeclaration :
930 CYIdentifier *identifier_;
931 CYExpression *initialiser_;
933 CYDeclaration(CYIdentifier *identifier, CYExpression *initialiser) :
934 identifier_(identifier),
935 initialiser_(initialiser)
939 virtual void ForIn(CYOutput &out, CYFlags flags) const;
941 virtual const char *ForEachIn() const;
942 virtual CYExpression *ForEachIn(CYContext &out);
944 void Replace(CYContext &context);
946 virtual void Output(CYOutput &out, CYFlags flags) const;
949 struct CYDeclarations :
950 CYNext<CYDeclarations>,
954 CYDeclaration *declaration_;
956 CYDeclarations(CYDeclaration *declaration, CYDeclarations *next) :
957 CYNext<CYDeclarations>(next),
958 declaration_(declaration)
962 virtual void For(CYOutput &out) const;
964 void Replace(CYContext &context);
966 virtual void Output(CYOutput &out) const;
967 virtual void Output(CYOutput &out, CYFlags flags) const;
973 CYDeclarations *declarations_;
975 CYVar(CYDeclarations *declarations) :
976 declarations_(declarations)
980 virtual CYStatement *Replace(CYContext &context);
981 virtual void Output(CYOutput &out, CYFlags flags) const;
987 CYDeclarations *declarations_;
990 CYLet(CYDeclarations *declarations, CYStatement *statements) :
991 declarations_(declarations),
996 virtual CYStatement *Replace(CYContext &context);
997 virtual void Output(CYOutput &out, CYFlags flags) const;
1003 CYForInitialiser *initialiser_;
1004 CYExpression *test_;
1005 CYExpression *increment_;
1008 CYFor(CYForInitialiser *initialiser, CYExpression *test, CYExpression *increment, CYStatement *code) :
1009 initialiser_(initialiser),
1011 increment_(increment),
1016 virtual CYStatement *Replace(CYContext &context);
1017 virtual void Output(CYOutput &out, CYFlags flags) const;
1023 CYForInInitialiser *initialiser_;
1027 CYForIn(CYForInInitialiser *initialiser, CYExpression *set, CYStatement *code) :
1028 initialiser_(initialiser),
1034 virtual CYStatement *Replace(CYContext &context);
1035 virtual void Output(CYOutput &out, CYFlags flags) const;
1038 struct CYForEachIn :
1041 CYForInInitialiser *initialiser_;
1045 CYForEachIn(CYForInInitialiser *initialiser, CYExpression *set, CYStatement *code) :
1046 initialiser_(initialiser),
1052 virtual CYStatement *Replace(CYContext &context);
1053 virtual void Output(CYOutput &out, CYFlags flags) const;
1060 CYPropertyName *name_;
1061 CYExpression *value_;
1063 CYProperty(CYPropertyName *name, CYExpression *value, CYProperty *next = NULL) :
1064 CYNext<CYProperty>(next),
1070 void Replace(CYContext &context);
1071 virtual void Output(CYOutput &out) const;
1077 CYProperty *properties_;
1079 CYObject(CYProperty *properties) :
1080 properties_(properties)
1084 virtual CYExpression *Replace(CYContext &context);
1085 void Output(CYOutput &out, CYFlags flags) const;
1091 CYIdentifier *name_;
1094 CYCatch(CYIdentifier *name, CYStatement *statements) :
1100 void Replace(CYContext &context);
1101 virtual void Output(CYOutput &out) const;
1107 CYExpression *object_;
1108 CYExpression *property_;
1110 CYMember(CYExpression *object, CYExpression *property) :
1116 void SetLeft(CYExpression *object) {
1120 void Replace_(CYContext &context);
1123 struct CYDirectMember :
1126 CYDirectMember(CYExpression *object, CYExpression *property) :
1127 CYMember(object, property)
1134 virtual CYExpression *Replace(CYContext &context);
1135 virtual void Output(CYOutput &out, CYFlags flags) const;
1138 struct CYIndirectMember :
1141 CYIndirectMember(CYExpression *object, CYExpression *property) :
1142 CYMember(object, property)
1149 virtual CYExpression *Replace(CYContext &context);
1150 virtual void Output(CYOutput &out, CYFlags flags) const;
1156 CYExpression *constructor_;
1157 CYArgument *arguments_;
1159 CYNew(CYExpression *constructor, CYArgument *arguments) :
1160 constructor_(constructor),
1161 arguments_(arguments)
1165 virtual unsigned Precedence() const {
1166 return arguments_ == NULL ? 2 : 1;
1171 virtual CYExpression *Replace(CYContext &context);
1172 virtual void Output(CYOutput &out, CYFlags flags) const;
1178 CYExpression *function_;
1179 CYArgument *arguments_;
1181 CYCall(CYExpression *function, CYArgument *arguments = NULL) :
1182 function_(function),
1183 arguments_(arguments)
1190 virtual CYExpression *Replace(CYContext &context);
1191 virtual void Output(CYOutput &out, CYFlags flags) const;
1197 CYExpression *test_;
1199 CYStatement *false_;
1201 CYIf(CYExpression *test, CYStatement *_true, CYStatement *_false = NULL) :
1208 virtual CYStatement *Replace(CYContext &context);
1209 virtual void Output(CYOutput &out, CYFlags flags) const;
1215 CYExpression *test_;
1218 CYDoWhile(CYExpression *test, CYStatement *code) :
1224 virtual CYStatement *Replace(CYContext &context);
1225 virtual void Output(CYOutput &out, CYFlags flags) const;
1231 CYExpression *test_;
1234 CYWhile(CYExpression *test, CYStatement *code) :
1240 virtual CYStatement *Replace(CYContext &context);
1241 virtual void Output(CYOutput &out, CYFlags flags) const;
1245 CYIdentifier *name_;
1246 CYFunctionParameter *parameters_;
1249 CYFunction(CYIdentifier *name, CYFunctionParameter *parameters, CYStatement *statements) :
1251 parameters_(parameters),
1256 virtual void Replace_(CYContext &context);
1257 virtual void Output(CYOutput &out, CYFlags flags) const;
1260 struct CYFunctionExpression :
1264 CYFunctionExpression(CYIdentifier *name, CYFunctionParameter *parameters, CYStatement *statements) :
1265 CYFunction(name, parameters, statements)
1272 virtual CYExpression *Replace(CYContext &context);
1273 virtual void Output(CYOutput &out, CYFlags flags) const;
1276 struct CYFunctionStatement :
1280 CYFunctionStatement(CYIdentifier *name, CYFunctionParameter *parameters, CYStatement *statements) :
1281 CYFunction(name, parameters, statements)
1285 virtual CYStatement *Replace(CYContext &context);
1286 virtual void Output(CYOutput &out, CYFlags flags) const;
1292 CYExpression *expression_;
1294 CYExpress(CYExpression *expression) :
1295 expression_(expression)
1299 virtual CYStatement *Replace(CYContext &context);
1300 virtual void Output(CYOutput &out, CYFlags flags) const;
1306 CYIdentifier *label_;
1308 CYContinue(CYIdentifier *label) :
1313 virtual CYStatement *Replace(CYContext &context);
1314 virtual void Output(CYOutput &out, CYFlags flags) const;
1320 CYIdentifier *label_;
1322 CYBreak(CYIdentifier *label) :
1327 virtual CYStatement *Replace(CYContext &context);
1328 virtual void Output(CYOutput &out, CYFlags flags) const;
1334 CYExpression *value_;
1336 CYReturn(CYExpression *value) :
1341 virtual CYStatement *Replace(CYContext &context);
1342 virtual void Output(CYOutput &out, CYFlags flags) const;
1348 virtual CYStatement *Replace(CYContext &context);
1349 virtual void Output(CYOutput &out, CYFlags flags) const;
1357 CYFinally(CYStatement *statements) :
1362 void Replace(CYContext &context);
1363 virtual void Output(CYOutput &out) const;
1371 CYFinally *finally_;
1373 CYTry(CYStatement *statements, CYCatch *_catch, CYFinally *finally) :
1380 virtual CYStatement *Replace(CYContext &context);
1381 virtual void Output(CYOutput &out, CYFlags flags) const;
1387 CYExpression *value_;
1389 CYThrow(CYExpression *value) :
1394 virtual CYStatement *Replace(CYContext &context);
1395 virtual void Output(CYOutput &out, CYFlags flags) const;
1401 CYExpression *scope_;
1404 CYWith(CYExpression *scope, CYStatement *code) :
1410 virtual CYStatement *Replace(CYContext &context);
1411 virtual void Output(CYOutput &out, CYFlags flags) const;
1417 CYExpression *value_;
1420 CYSwitch(CYExpression *value, CYClause *clauses) :
1426 virtual CYStatement *Replace(CYContext &context);
1427 virtual void Output(CYOutput &out, CYFlags flags) const;
1430 struct CYCondition :
1433 CYExpression *test_;
1434 CYExpression *true_;
1435 CYExpression *false_;
1437 CYCondition(CYExpression *test, CYExpression *_true, CYExpression *_false) :
1446 virtual CYExpression *Replace(CYContext &context);
1447 virtual void Output(CYOutput &out, CYFlags flags) const;
1450 struct CYAddressOf :
1453 CYAddressOf(CYExpression *rhs) :
1458 virtual const char *Operator() const {
1464 virtual CYExpression *Replace(CYContext &context);
1470 CYIndirect(CYExpression *rhs) :
1475 virtual const char *Operator() const {
1481 virtual CYExpression *Replace(CYContext &context);
1485 virtual CYExpression *Replace(CYContext &context);
1487 #define CYPostfix_(op, name, args...) \
1488 struct CY ## name : \
1491 CY ## name(CYExpression *lhs) : \
1496 virtual const char *Operator() const { \
1501 #define CYPrefix_(alphabetic, op, name, args...) \
1502 struct CY ## name : \
1505 CY ## name(CYExpression *rhs) : \
1510 CYAlphabetic(alphabetic) \
1512 virtual const char *Operator() const { \
1517 #define CYInfix_(alphabetic, precedence, op, name, args...) \
1518 struct CY ## name : \
1521 CY ## name(CYExpression *lhs, CYExpression *rhs) : \
1526 CYAlphabetic(alphabetic) \
1527 CYPrecedence(precedence) \
1529 virtual const char *Operator() const { \
1534 #define CYAssignment_(op, name, args...) \
1535 struct CY ## name ## Assign : \
1538 CY ## name ## Assign(CYExpression *lhs, CYExpression *rhs) : \
1539 CYAssignment(lhs, rhs) \
1543 virtual const char *Operator() const { \
1548 CYPostfix_("++", PostIncrement)
1549 CYPostfix_("--", PostDecrement)
1551 CYPrefix_(true, "delete", Delete)
1552 CYPrefix_(true, "void", Void)
1553 CYPrefix_(true, "typeof", TypeOf)
1554 CYPrefix_(false, "++", PreIncrement)
1555 CYPrefix_(false, "--", PreDecrement)
1556 CYPrefix_(false, "+", Affirm)
1557 CYPrefix_(false, "-", Negate)
1558 CYPrefix_(false, "~", BitwiseNot)
1559 CYPrefix_(false, "!", LogicalNot)
1561 CYInfix_(false, 5, "*", Multiply)
1562 CYInfix_(false, 5, "/", Divide)
1563 CYInfix_(false, 5, "%", Modulus)
1564 CYInfix_(false, 6, "+", Add, CYReplace)
1565 CYInfix_(false, 6, "-", Subtract)
1566 CYInfix_(false, 7, "<<", ShiftLeft)
1567 CYInfix_(false, 7, ">>", ShiftRightSigned)
1568 CYInfix_(false, 7, ">>>", ShiftRightUnsigned)
1569 CYInfix_(false, 8, "<", Less)
1570 CYInfix_(false, 8, ">", Greater)
1571 CYInfix_(false, 8, "<=", LessOrEqual)
1572 CYInfix_(false, 8, ">=", GreaterOrEqual)
1573 CYInfix_(true, 8, "instanceof", InstanceOf)
1574 CYInfix_(true, 8, "in", In)
1575 CYInfix_(false, 9, "==", Equal)
1576 CYInfix_(false, 9, "!=", NotEqual)
1577 CYInfix_(false, 9, "===", Identical)
1578 CYInfix_(false, 9, "!==", NotIdentical)
1579 CYInfix_(false, 10, "&", BitwiseAnd)
1580 CYInfix_(false, 11, "^", BitwiseXOr)
1581 CYInfix_(false, 12, "|", BitwiseOr)
1582 CYInfix_(false, 13, "&&", LogicalAnd)
1583 CYInfix_(false, 14, "||", LogicalOr)
1585 CYAssignment_("=", )
1586 CYAssignment_("*=", Multiply)
1587 CYAssignment_("/=", Divide)
1588 CYAssignment_("%=", Modulus)
1589 CYAssignment_("+=", Add)
1590 CYAssignment_("-=", Subtract)
1591 CYAssignment_("<<=", ShiftLeft)
1592 CYAssignment_(">>=", ShiftRightSigned)
1593 CYAssignment_(">>>=", ShiftRightUnsigned)
1594 CYAssignment_("&=", BitwiseAnd)
1595 CYAssignment_("^=", BitwiseXOr)
1596 CYAssignment_("|=", BitwiseOr)
1598 #endif/*CYPARSER_HPP*/