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 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 CYIdentifier *name_;
1099 CYCatch(CYIdentifier *name, CYStatement *statements) :
1105 void Replace(CYContext &context);
1106 virtual void Output(CYOutput &out) const;
1112 CYExpression *object_;
1113 CYExpression *property_;
1115 CYMember(CYExpression *object, CYExpression *property) :
1121 void SetLeft(CYExpression *object) {
1125 void Replace_(CYContext &context);
1128 struct CYDirectMember :
1131 CYDirectMember(CYExpression *object, CYExpression *property) :
1132 CYMember(object, property)
1139 virtual CYExpression *Replace(CYContext &context);
1140 virtual void Output(CYOutput &out, CYFlags flags) const;
1143 struct CYIndirectMember :
1146 CYIndirectMember(CYExpression *object, CYExpression *property) :
1147 CYMember(object, property)
1154 virtual CYExpression *Replace(CYContext &context);
1155 virtual void Output(CYOutput &out, CYFlags flags) const;
1161 CYExpression *constructor_;
1162 CYArgument *arguments_;
1164 CYNew(CYExpression *constructor, CYArgument *arguments) :
1165 constructor_(constructor),
1166 arguments_(arguments)
1170 virtual unsigned Precedence() const {
1171 return arguments_ == NULL ? 2 : 1;
1176 virtual CYExpression *Replace(CYContext &context);
1177 virtual void Output(CYOutput &out, CYFlags flags) const;
1183 CYExpression *function_;
1184 CYArgument *arguments_;
1186 CYCall(CYExpression *function, CYArgument *arguments = NULL) :
1187 function_(function),
1188 arguments_(arguments)
1195 virtual CYExpression *Replace(CYContext &context);
1196 virtual void Output(CYOutput &out, CYFlags flags) const;
1202 CYExpression *test_;
1204 CYStatement *false_;
1206 CYIf(CYExpression *test, CYStatement *_true, CYStatement *_false = NULL) :
1213 virtual CYStatement *Replace(CYContext &context);
1214 virtual void Output(CYOutput &out, CYFlags flags) const;
1220 CYExpression *test_;
1223 CYDoWhile(CYExpression *test, CYStatement *code) :
1229 virtual CYStatement *Replace(CYContext &context);
1230 virtual void Output(CYOutput &out, CYFlags flags) const;
1236 CYExpression *test_;
1239 CYWhile(CYExpression *test, CYStatement *code) :
1245 virtual CYStatement *Replace(CYContext &context);
1246 virtual void Output(CYOutput &out, CYFlags flags) const;
1250 CYIdentifier *name_;
1251 CYFunctionParameter *parameters_;
1254 CYFunction(CYIdentifier *name, CYFunctionParameter *parameters, CYStatement *statements) :
1256 parameters_(parameters),
1261 virtual void Replace_(CYContext &context);
1262 virtual void Output(CYOutput &out, CYFlags flags) const;
1265 struct CYFunctionExpression :
1269 CYFunctionExpression(CYIdentifier *name, CYFunctionParameter *parameters, CYStatement *statements) :
1270 CYFunction(name, parameters, statements)
1277 virtual CYExpression *Replace(CYContext &context);
1278 virtual void Output(CYOutput &out, CYFlags flags) const;
1281 struct CYFunctionStatement :
1285 CYFunctionStatement(CYIdentifier *name, CYFunctionParameter *parameters, CYStatement *statements) :
1286 CYFunction(name, parameters, statements)
1290 virtual CYStatement *Replace(CYContext &context);
1291 virtual void Output(CYOutput &out, CYFlags flags) const;
1297 CYExpression *expression_;
1299 CYExpress(CYExpression *expression) :
1300 expression_(expression)
1304 virtual CYStatement *Replace(CYContext &context);
1305 virtual void Output(CYOutput &out, CYFlags flags) const;
1311 CYIdentifier *label_;
1313 CYContinue(CYIdentifier *label) :
1318 virtual CYStatement *Replace(CYContext &context);
1319 virtual void Output(CYOutput &out, CYFlags flags) const;
1325 CYIdentifier *label_;
1327 CYBreak(CYIdentifier *label) :
1332 virtual CYStatement *Replace(CYContext &context);
1333 virtual void Output(CYOutput &out, CYFlags flags) const;
1339 CYExpression *value_;
1341 CYReturn(CYExpression *value) :
1346 virtual CYStatement *Replace(CYContext &context);
1347 virtual void Output(CYOutput &out, CYFlags flags) const;
1353 virtual CYStatement *Replace(CYContext &context);
1354 virtual void Output(CYOutput &out, CYFlags flags) const;
1362 CYFinally(CYStatement *statements) :
1367 void Replace(CYContext &context);
1368 virtual void Output(CYOutput &out) const;
1376 CYFinally *finally_;
1378 CYTry(CYStatement *statements, CYCatch *_catch, CYFinally *finally) :
1385 virtual CYStatement *Replace(CYContext &context);
1386 virtual void Output(CYOutput &out, CYFlags flags) const;
1392 CYExpression *value_;
1394 CYThrow(CYExpression *value) :
1399 virtual CYStatement *Replace(CYContext &context);
1400 virtual void Output(CYOutput &out, CYFlags flags) const;
1406 CYExpression *scope_;
1409 CYWith(CYExpression *scope, CYStatement *code) :
1415 virtual CYStatement *Replace(CYContext &context);
1416 virtual void Output(CYOutput &out, CYFlags flags) const;
1422 CYExpression *value_;
1425 CYSwitch(CYExpression *value, CYClause *clauses) :
1431 virtual CYStatement *Replace(CYContext &context);
1432 virtual void Output(CYOutput &out, CYFlags flags) const;
1435 struct CYCondition :
1438 CYExpression *test_;
1439 CYExpression *true_;
1440 CYExpression *false_;
1442 CYCondition(CYExpression *test, CYExpression *_true, CYExpression *_false) :
1451 virtual CYExpression *Replace(CYContext &context);
1452 virtual void Output(CYOutput &out, CYFlags flags) const;
1455 struct CYAddressOf :
1458 CYAddressOf(CYExpression *rhs) :
1463 virtual const char *Operator() const {
1469 virtual CYExpression *Replace(CYContext &context);
1475 CYIndirect(CYExpression *rhs) :
1480 virtual const char *Operator() const {
1486 virtual CYExpression *Replace(CYContext &context);
1490 virtual CYExpression *Replace(CYContext &context);
1492 #define CYPostfix_(op, name, args...) \
1493 struct CY ## name : \
1496 CY ## name(CYExpression *lhs) : \
1501 virtual const char *Operator() const { \
1506 #define CYPrefix_(alphabetic, op, name, args...) \
1507 struct CY ## name : \
1510 CY ## name(CYExpression *rhs) : \
1515 CYAlphabetic(alphabetic) \
1517 virtual const char *Operator() const { \
1522 #define CYInfix_(alphabetic, precedence, op, name, args...) \
1523 struct CY ## name : \
1526 CY ## name(CYExpression *lhs, CYExpression *rhs) : \
1531 CYAlphabetic(alphabetic) \
1532 CYPrecedence(precedence) \
1534 virtual const char *Operator() const { \
1539 #define CYAssignment_(op, name, args...) \
1540 struct CY ## name ## Assign : \
1543 CY ## name ## Assign(CYExpression *lhs, CYExpression *rhs) : \
1544 CYAssignment(lhs, rhs) \
1548 virtual const char *Operator() const { \
1553 CYPostfix_("++", PostIncrement)
1554 CYPostfix_("--", PostDecrement)
1556 CYPrefix_(true, "delete", Delete)
1557 CYPrefix_(true, "void", Void)
1558 CYPrefix_(true, "typeof", TypeOf)
1559 CYPrefix_(false, "++", PreIncrement)
1560 CYPrefix_(false, "--", PreDecrement)
1561 CYPrefix_(false, "+", Affirm)
1562 CYPrefix_(false, "-", Negate)
1563 CYPrefix_(false, "~", BitwiseNot)
1564 CYPrefix_(false, "!", LogicalNot)
1566 CYInfix_(false, 5, "*", Multiply)
1567 CYInfix_(false, 5, "/", Divide)
1568 CYInfix_(false, 5, "%", Modulus)
1569 CYInfix_(false, 6, "+", Add, CYReplace)
1570 CYInfix_(false, 6, "-", Subtract)
1571 CYInfix_(false, 7, "<<", ShiftLeft)
1572 CYInfix_(false, 7, ">>", ShiftRightSigned)
1573 CYInfix_(false, 7, ">>>", ShiftRightUnsigned)
1574 CYInfix_(false, 8, "<", Less)
1575 CYInfix_(false, 8, ">", Greater)
1576 CYInfix_(false, 8, "<=", LessOrEqual)
1577 CYInfix_(false, 8, ">=", GreaterOrEqual)
1578 CYInfix_(true, 8, "instanceof", InstanceOf)
1579 CYInfix_(true, 8, "in", In)
1580 CYInfix_(false, 9, "==", Equal)
1581 CYInfix_(false, 9, "!=", NotEqual)
1582 CYInfix_(false, 9, "===", Identical)
1583 CYInfix_(false, 9, "!==", NotIdentical)
1584 CYInfix_(false, 10, "&", BitwiseAnd)
1585 CYInfix_(false, 11, "^", BitwiseXOr)
1586 CYInfix_(false, 12, "|", BitwiseOr)
1587 CYInfix_(false, 13, "&&", LogicalAnd)
1588 CYInfix_(false, 14, "||", LogicalOr)
1590 CYAssignment_("=", )
1591 CYAssignment_("*=", Multiply)
1592 CYAssignment_("/=", Divide)
1593 CYAssignment_("%=", Modulus)
1594 CYAssignment_("+=", Add)
1595 CYAssignment_("-=", Subtract)
1596 CYAssignment_("<<=", ShiftLeft)
1597 CYAssignment_(">>=", ShiftRightSigned)
1598 CYAssignment_(">>>=", ShiftRightUnsigned)
1599 CYAssignment_("&=", BitwiseAnd)
1600 CYAssignment_("^=", BitwiseXOr)
1601 CYAssignment_("|=", BitwiseOr)
1603 #endif/*CYPARSER_HPP*/