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;
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 void SetCondition(Condition condition);
341 void Warning(const cy::location &location, const char *message);
344 struct CYForInitialiser {
345 virtual void For(CYOutput &out) const = 0;
348 struct CYForInInitialiser {
349 virtual void ForIn(CYOutput &out, CYFlags flags) const = 0;
350 virtual const char *ForEachIn() const = 0;
351 virtual CYExpression *ForEachIn(CYContext &out) = 0;
357 struct CYExpression :
358 CYNext<CYExpression>,
364 virtual unsigned Precedence() const = 0;
366 virtual bool RightHand() const {
370 virtual void For(CYOutput &out) const;
371 virtual void ForIn(CYOutput &out, CYFlags flags) const;
373 virtual const char *ForEachIn() const;
374 virtual CYExpression *ForEachIn(CYContext &out);
376 virtual void Output(CYOutput &out) const;
377 virtual void Output(CYOutput &out, CYFlags flags) const = 0;
378 void Output(CYOutput &out, unsigned precedence, CYFlags flags) const;
380 virtual CYExpression *ClassName(CYContext &context, bool object);
381 virtual void ClassName(CYOutput &out, bool object) const;
383 CYExpression *ReplaceAll(CYContext &context);
385 virtual CYExpression *Replace(CYContext &context) = 0;
387 virtual CYExpression *Primitive(CYContext &context) {
391 virtual CYNumber *Number(CYContext &context) {
395 virtual CYString *String(CYContext &context) {
399 virtual const char *Word() const {
404 #define CYAlphabetic(value) \
405 virtual bool Alphabetic() const { \
409 #define CYPrecedence(value) \
410 virtual unsigned Precedence() const { \
414 #define CYRightHand(value) \
415 virtual bool RightHand() const { \
422 CYExpression *expressions_;
424 CYCompound(CYExpression *expressions) :
425 expressions_(expressions)
429 void AddPrev(CYExpression *expression) {
430 CYExpression *last(expression);
431 while (last->next_ != NULL)
433 last->SetNext(expressions_);
434 expressions_ = expression;
439 virtual CYExpression *Replace(CYContext &context);
440 void Output(CYOutput &out, CYFlags flags) const;
443 struct CYFunctionParameter :
444 CYNext<CYFunctionParameter>,
449 CYFunctionParameter(CYIdentifier *name, CYFunctionParameter *next = NULL) :
450 CYNext<CYFunctionParameter>(next),
455 virtual void Output(CYOutput &out) const;
458 struct CYComprehension :
459 CYNext<CYComprehension>,
462 virtual const char *Name() const = 0;
464 virtual CYFunctionParameter *Parameter(CYContext &context) const = 0;
465 CYFunctionParameter *Parameters(CYContext &context) const;
466 virtual CYStatement *Replace(CYContext &context, CYStatement *statement) const;
467 virtual void Output(CYOutput &out) const = 0;
470 struct CYForInComprehension :
476 CYForInComprehension(CYIdentifier *name, CYExpression *set) :
482 virtual const char *Name() const {
483 return name_->Value();
486 virtual CYFunctionParameter *Parameter(CYContext &context) const;
487 virtual CYStatement *Replace(CYContext &context, CYStatement *statement) const;
488 virtual void Output(CYOutput &out) const;
491 struct CYForEachInComprehension :
497 CYForEachInComprehension(CYIdentifier *name, CYExpression *set) :
503 virtual const char *Name() const {
504 return name_->Value();
507 virtual CYFunctionParameter *Parameter(CYContext &context) const;
508 virtual CYStatement *Replace(CYContext &context, CYStatement *statement) const;
509 virtual void Output(CYOutput &out) const;
512 struct CYIfComprehension :
517 CYIfComprehension(CYExpression *test) :
522 virtual const char *Name() const {
526 virtual CYFunctionParameter *Parameter(CYContext &context) const;
527 virtual CYStatement *Replace(CYContext &context, CYStatement *statement) const;
528 virtual void Output(CYOutput &out) const;
531 struct CYArrayComprehension :
534 CYExpression *expression_;
535 CYComprehension *comprehensions_;
537 CYArrayComprehension(CYExpression *expression, CYComprehension *comprehensions) :
538 expression_(expression),
539 comprehensions_(comprehensions)
545 virtual CYExpression *Replace(CYContext &context);
546 virtual void Output(CYOutput &out, CYFlags flags) const;
559 virtual CYExpression *Replace(CYContext &context);
573 CYRange(uint64_t lo, uint64_t hi) :
578 bool operator [](uint8_t value) const {
579 return !(value >> 7) && (value >> 6 ? hi_ : lo_) >> (value & 0x3f) & 0x1;
582 void operator()(uint8_t value) {
585 (value >> 6 ? hi_ : lo_) |= uint64_t(0x1) << (value & 0x3f);
589 extern CYRange DigitRange_;
590 extern CYRange WordStartRange_;
591 extern CYRange WordEndRange_;
606 CYString(const char *value) :
612 CYString(const char *value, size_t size) :
618 CYString(const CYWord *word) :
619 value_(word->Value()),
620 size_(strlen(value_))
624 const char *Value() const {
628 virtual const char *Word() const;
630 virtual CYNumber *Number(CYContext &context);
631 virtual CYString *String(CYContext &context);
633 virtual CYString *Concat(CYContext &out, CYString *rhs) const;
634 virtual void Output(CYOutput &out, CYFlags flags) const;
635 virtual void PropertyName(CYOutput &out) const;
644 CYNumber(double value) :
649 double Value() const {
653 virtual CYNumber *Number(CYContext &context);
654 virtual CYString *String(CYContext &context);
656 virtual void Output(CYOutput &out, CYFlags flags) const;
657 virtual void PropertyName(CYOutput &out) const;
665 CYRegEx(const char *value) :
670 const char *Value() const {
674 virtual void Output(CYOutput &out, CYFlags flags) const;
686 virtual CYNumber *Number(CYContext &context);
687 virtual CYString *String(CYContext &context);
689 virtual void Output(CYOutput &out, CYFlags flags) const;
701 virtual CYExpression *Replace(CYContext &context);
702 virtual void Output(CYOutput &out, CYFlags flags) const;
708 virtual bool Value() const = 0;
709 virtual void Output(CYOutput &out, CYFlags flags) const;
721 virtual bool Value() const {
725 virtual CYNumber *Number(CYContext &context);
726 virtual CYString *String(CYContext &context);
738 virtual bool Value() const {
742 virtual CYNumber *Number(CYContext &context);
743 virtual CYString *String(CYContext &context);
751 CYVariable(CYIdentifier *name) :
759 virtual CYExpression *Replace(CYContext &context);
760 virtual void Output(CYOutput &out, CYFlags flags) const;
768 CYPrefix(CYExpression *rhs) :
773 virtual bool Alphabetic() const = 0;
774 virtual const char *Operator() const = 0;
778 virtual CYExpression *Replace(CYContext &context);
779 virtual void Output(CYOutput &out, CYFlags flags) const;
788 CYInfix(CYExpression *lhs, CYExpression *rhs) :
794 void SetLeft(CYExpression *lhs) {
798 virtual bool Alphabetic() const = 0;
799 virtual const char *Operator() const = 0;
801 virtual CYExpression *Replace(CYContext &context);
802 virtual void Output(CYOutput &out, CYFlags flags) const;
810 CYPostfix(CYExpression *lhs) :
815 virtual const char *Operator() const = 0;
819 virtual CYExpression *Replace(CYContext &context);
820 virtual void Output(CYOutput &out, CYFlags flags) const;
823 struct CYAssignment :
829 CYAssignment(CYExpression *lhs, CYExpression *rhs) :
835 void SetLeft(CYExpression *lhs) {
839 virtual const char *Operator() const = 0;
843 virtual CYExpression *Replace(CYContext &context);
844 virtual void Output(CYOutput &out, CYFlags flags) const;
852 CYExpression *value_;
854 CYArgument(CYExpression *value, CYArgument *next = NULL) :
855 CYNext<CYArgument>(next),
861 CYArgument(CYWord *name, CYExpression *value, CYArgument *next = NULL) :
862 CYNext<CYArgument>(next),
868 void Replace(CYContext &context);
869 void Output(CYOutput &out) const;
886 CYStatement *statements_;
888 CYClause(CYExpression *_case, CYStatement *statements) :
890 statements_(statements)
894 void Replace(CYContext &context);
895 virtual void Output(CYOutput &out) const;
902 CYExpression *value_;
904 CYElement(CYExpression *value, CYElement *next) :
905 CYNext<CYElement>(next),
910 void Replace(CYContext &context);
911 void Output(CYOutput &out) const;
917 CYElement *elements_;
919 CYArray(CYElement *elements = NULL) :
924 virtual CYExpression *Replace(CYContext &context);
925 virtual void Output(CYOutput &out, CYFlags flags) const;
928 struct CYDeclaration :
931 CYIdentifier *identifier_;
932 CYExpression *initialiser_;
934 CYDeclaration(CYIdentifier *identifier, CYExpression *initialiser) :
935 identifier_(identifier),
936 initialiser_(initialiser)
940 virtual void ForIn(CYOutput &out, CYFlags flags) const;
942 virtual const char *ForEachIn() const;
943 virtual CYExpression *ForEachIn(CYContext &out);
945 void Replace(CYContext &context);
947 virtual void Output(CYOutput &out, CYFlags flags) const;
950 struct CYDeclarations :
951 CYNext<CYDeclarations>,
955 CYDeclaration *declaration_;
957 CYDeclarations(CYDeclaration *declaration, CYDeclarations *next = NULL) :
958 CYNext<CYDeclarations>(next),
959 declaration_(declaration)
963 virtual void For(CYOutput &out) const;
965 void Replace(CYContext &context);
967 virtual void Output(CYOutput &out) const;
968 virtual void Output(CYOutput &out, CYFlags flags) const;
974 CYDeclarations *declarations_;
976 CYVar(CYDeclarations *declarations) :
977 declarations_(declarations)
981 virtual CYStatement *Replace(CYContext &context);
982 virtual void Output(CYOutput &out, CYFlags flags) const;
988 CYDeclarations *declarations_;
991 CYLet(CYDeclarations *declarations, CYStatement *statements) :
992 declarations_(declarations),
997 virtual CYStatement *Replace(CYContext &context);
998 virtual void Output(CYOutput &out, CYFlags flags) const;
1004 CYForInitialiser *initialiser_;
1005 CYExpression *test_;
1006 CYExpression *increment_;
1009 CYFor(CYForInitialiser *initialiser, CYExpression *test, CYExpression *increment, CYStatement *code) :
1010 initialiser_(initialiser),
1012 increment_(increment),
1017 virtual CYStatement *Replace(CYContext &context);
1018 virtual void Output(CYOutput &out, CYFlags flags) const;
1024 CYForInInitialiser *initialiser_;
1028 CYForIn(CYForInInitialiser *initialiser, CYExpression *set, CYStatement *code) :
1029 initialiser_(initialiser),
1035 virtual CYStatement *Replace(CYContext &context);
1036 virtual void Output(CYOutput &out, CYFlags flags) const;
1039 struct CYForEachIn :
1042 CYForInInitialiser *initialiser_;
1046 CYForEachIn(CYForInInitialiser *initialiser, CYExpression *set, CYStatement *code) :
1047 initialiser_(initialiser),
1053 virtual CYStatement *Replace(CYContext &context);
1054 virtual void Output(CYOutput &out, CYFlags flags) const;
1061 CYPropertyName *name_;
1062 CYExpression *value_;
1064 CYProperty(CYPropertyName *name, CYExpression *value, CYProperty *next = NULL) :
1065 CYNext<CYProperty>(next),
1071 void Replace(CYContext &context);
1072 virtual void Output(CYOutput &out) const;
1078 CYProperty *properties_;
1080 CYObject(CYProperty *properties) :
1081 properties_(properties)
1085 virtual CYExpression *Replace(CYContext &context);
1086 void Output(CYOutput &out, CYFlags flags) const;
1092 CYIdentifier *name_;
1095 CYCatch(CYIdentifier *name, CYStatement *statements) :
1101 void Replace(CYContext &context);
1102 virtual void Output(CYOutput &out) const;
1108 CYExpression *object_;
1109 CYExpression *property_;
1111 CYMember(CYExpression *object, CYExpression *property) :
1117 void SetLeft(CYExpression *object) {
1121 void Replace_(CYContext &context);
1124 struct CYDirectMember :
1127 CYDirectMember(CYExpression *object, CYExpression *property) :
1128 CYMember(object, property)
1135 virtual CYExpression *Replace(CYContext &context);
1136 virtual void Output(CYOutput &out, CYFlags flags) const;
1139 struct CYIndirectMember :
1142 CYIndirectMember(CYExpression *object, CYExpression *property) :
1143 CYMember(object, property)
1150 virtual CYExpression *Replace(CYContext &context);
1151 virtual void Output(CYOutput &out, CYFlags flags) const;
1157 CYExpression *constructor_;
1158 CYArgument *arguments_;
1160 CYNew(CYExpression *constructor, CYArgument *arguments) :
1161 constructor_(constructor),
1162 arguments_(arguments)
1166 virtual unsigned Precedence() const {
1167 return arguments_ == NULL ? 2 : 1;
1172 virtual CYExpression *Replace(CYContext &context);
1173 virtual void Output(CYOutput &out, CYFlags flags) const;
1179 CYExpression *function_;
1180 CYArgument *arguments_;
1182 CYCall(CYExpression *function, CYArgument *arguments = NULL) :
1183 function_(function),
1184 arguments_(arguments)
1191 virtual CYExpression *Replace(CYContext &context);
1192 virtual void Output(CYOutput &out, CYFlags flags) const;
1198 CYExpression *test_;
1200 CYStatement *false_;
1202 CYIf(CYExpression *test, CYStatement *_true, CYStatement *_false = NULL) :
1209 virtual CYStatement *Replace(CYContext &context);
1210 virtual void Output(CYOutput &out, CYFlags flags) const;
1216 CYExpression *test_;
1219 CYDoWhile(CYExpression *test, CYStatement *code) :
1225 virtual CYStatement *Replace(CYContext &context);
1226 virtual void Output(CYOutput &out, CYFlags flags) const;
1232 CYExpression *test_;
1235 CYWhile(CYExpression *test, CYStatement *code) :
1241 virtual CYStatement *Replace(CYContext &context);
1242 virtual void Output(CYOutput &out, CYFlags flags) const;
1246 CYIdentifier *name_;
1247 CYFunctionParameter *parameters_;
1250 CYFunction(CYIdentifier *name, CYFunctionParameter *parameters, CYStatement *statements) :
1252 parameters_(parameters),
1257 virtual void Replace_(CYContext &context);
1258 virtual void Output(CYOutput &out, CYFlags flags) const;
1261 struct CYFunctionExpression :
1265 CYFunctionExpression(CYIdentifier *name, CYFunctionParameter *parameters, CYStatement *statements) :
1266 CYFunction(name, parameters, statements)
1273 virtual CYExpression *Replace(CYContext &context);
1274 virtual void Output(CYOutput &out, CYFlags flags) const;
1277 struct CYFunctionStatement :
1281 CYFunctionStatement(CYIdentifier *name, CYFunctionParameter *parameters, CYStatement *statements) :
1282 CYFunction(name, parameters, statements)
1286 virtual CYStatement *Replace(CYContext &context);
1287 virtual void Output(CYOutput &out, CYFlags flags) const;
1293 CYExpression *expression_;
1295 CYExpress(CYExpression *expression) :
1296 expression_(expression)
1300 virtual CYStatement *Replace(CYContext &context);
1301 virtual void Output(CYOutput &out, CYFlags flags) const;
1307 CYIdentifier *label_;
1309 CYContinue(CYIdentifier *label) :
1314 virtual CYStatement *Replace(CYContext &context);
1315 virtual void Output(CYOutput &out, CYFlags flags) const;
1321 CYIdentifier *label_;
1323 CYBreak(CYIdentifier *label) :
1328 virtual CYStatement *Replace(CYContext &context);
1329 virtual void Output(CYOutput &out, CYFlags flags) const;
1335 CYExpression *value_;
1337 CYReturn(CYExpression *value) :
1342 virtual CYStatement *Replace(CYContext &context);
1343 virtual void Output(CYOutput &out, CYFlags flags) const;
1349 virtual CYStatement *Replace(CYContext &context);
1350 virtual void Output(CYOutput &out, CYFlags flags) const;
1358 CYFinally(CYStatement *statements) :
1363 void Replace(CYContext &context);
1364 virtual void Output(CYOutput &out) const;
1372 CYFinally *finally_;
1374 CYTry(CYStatement *statements, CYCatch *_catch, CYFinally *finally) :
1381 virtual CYStatement *Replace(CYContext &context);
1382 virtual void Output(CYOutput &out, CYFlags flags) const;
1388 CYExpression *value_;
1390 CYThrow(CYExpression *value) :
1395 virtual CYStatement *Replace(CYContext &context);
1396 virtual void Output(CYOutput &out, CYFlags flags) const;
1402 CYExpression *scope_;
1405 CYWith(CYExpression *scope, CYStatement *code) :
1411 virtual CYStatement *Replace(CYContext &context);
1412 virtual void Output(CYOutput &out, CYFlags flags) const;
1418 CYExpression *value_;
1421 CYSwitch(CYExpression *value, CYClause *clauses) :
1427 virtual CYStatement *Replace(CYContext &context);
1428 virtual void Output(CYOutput &out, CYFlags flags) const;
1431 struct CYCondition :
1434 CYExpression *test_;
1435 CYExpression *true_;
1436 CYExpression *false_;
1438 CYCondition(CYExpression *test, CYExpression *_true, CYExpression *_false) :
1447 virtual CYExpression *Replace(CYContext &context);
1448 virtual void Output(CYOutput &out, CYFlags flags) const;
1451 struct CYAddressOf :
1454 CYAddressOf(CYExpression *rhs) :
1459 virtual const char *Operator() const {
1465 virtual CYExpression *Replace(CYContext &context);
1471 CYIndirect(CYExpression *rhs) :
1476 virtual const char *Operator() const {
1482 virtual CYExpression *Replace(CYContext &context);
1486 virtual CYExpression *Replace(CYContext &context);
1488 #define CYPostfix_(op, name, args...) \
1489 struct CY ## name : \
1492 CY ## name(CYExpression *lhs) : \
1497 virtual const char *Operator() const { \
1502 #define CYPrefix_(alphabetic, op, name, args...) \
1503 struct CY ## name : \
1506 CY ## name(CYExpression *rhs) : \
1511 CYAlphabetic(alphabetic) \
1513 virtual const char *Operator() const { \
1518 #define CYInfix_(alphabetic, precedence, op, name, args...) \
1519 struct CY ## name : \
1522 CY ## name(CYExpression *lhs, CYExpression *rhs) : \
1527 CYAlphabetic(alphabetic) \
1528 CYPrecedence(precedence) \
1530 virtual const char *Operator() const { \
1535 #define CYAssignment_(op, name, args...) \
1536 struct CY ## name ## Assign : \
1539 CY ## name ## Assign(CYExpression *lhs, CYExpression *rhs) : \
1540 CYAssignment(lhs, rhs) \
1544 virtual const char *Operator() const { \
1549 CYPostfix_("++", PostIncrement)
1550 CYPostfix_("--", PostDecrement)
1552 CYPrefix_(true, "delete", Delete)
1553 CYPrefix_(true, "void", Void)
1554 CYPrefix_(true, "typeof", TypeOf)
1555 CYPrefix_(false, "++", PreIncrement)
1556 CYPrefix_(false, "--", PreDecrement)
1557 CYPrefix_(false, "+", Affirm)
1558 CYPrefix_(false, "-", Negate)
1559 CYPrefix_(false, "~", BitwiseNot)
1560 CYPrefix_(false, "!", LogicalNot)
1562 CYInfix_(false, 5, "*", Multiply)
1563 CYInfix_(false, 5, "/", Divide)
1564 CYInfix_(false, 5, "%", Modulus)
1565 CYInfix_(false, 6, "+", Add, CYReplace)
1566 CYInfix_(false, 6, "-", Subtract)
1567 CYInfix_(false, 7, "<<", ShiftLeft)
1568 CYInfix_(false, 7, ">>", ShiftRightSigned)
1569 CYInfix_(false, 7, ">>>", ShiftRightUnsigned)
1570 CYInfix_(false, 8, "<", Less)
1571 CYInfix_(false, 8, ">", Greater)
1572 CYInfix_(false, 8, "<=", LessOrEqual)
1573 CYInfix_(false, 8, ">=", GreaterOrEqual)
1574 CYInfix_(true, 8, "instanceof", InstanceOf)
1575 CYInfix_(true, 8, "in", In)
1576 CYInfix_(false, 9, "==", Equal)
1577 CYInfix_(false, 9, "!=", NotEqual)
1578 CYInfix_(false, 9, "===", Identical)
1579 CYInfix_(false, 9, "!==", NotIdentical)
1580 CYInfix_(false, 10, "&", BitwiseAnd)
1581 CYInfix_(false, 11, "^", BitwiseXOr)
1582 CYInfix_(false, 12, "|", BitwiseOr)
1583 CYInfix_(false, 13, "&&", LogicalAnd)
1584 CYInfix_(false, 14, "||", LogicalOr)
1586 CYAssignment_("=", )
1587 CYAssignment_("*=", Multiply)
1588 CYAssignment_("/=", Divide)
1589 CYAssignment_("%=", Modulus)
1590 CYAssignment_("+=", Add)
1591 CYAssignment_("-=", Subtract)
1592 CYAssignment_("<<=", ShiftLeft)
1593 CYAssignment_(">>=", ShiftRightSigned)
1594 CYAssignment_(">>>=", ShiftRightUnsigned)
1595 CYAssignment_("&=", BitwiseAnd)
1596 CYAssignment_("^=", BitwiseXOr)
1597 CYAssignment_("|=", BitwiseOr)
1599 #endif/*CYPARSER_HPP*/