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;
936 CYPropertyName *name_;
937 CYExpression *value_;
939 CYProperty(CYPropertyName *name, CYExpression *value, CYProperty *next = NULL) :
940 CYNext<CYProperty>(next),
946 void Replace(CYContext &context);
947 virtual void Output(CYOutput &out) const;
950 struct CYDeclaration :
953 CYIdentifier *identifier_;
954 CYExpression *initialiser_;
956 CYDeclaration(CYIdentifier *identifier, CYExpression *initialiser = NULL) :
957 identifier_(identifier),
958 initialiser_(initialiser)
962 virtual void ForIn(CYOutput &out, CYFlags flags) const;
964 virtual const char *ForEachIn() const;
965 virtual CYExpression *ForEachIn(CYContext &out);
967 void Replace(CYContext &context);
969 virtual void Output(CYOutput &out, CYFlags flags) const;
972 struct CYDeclarations :
973 CYNext<CYDeclarations>,
977 CYDeclaration *declaration_;
979 CYDeclarations(CYDeclaration *declaration, CYDeclarations *next = NULL) :
980 CYNext<CYDeclarations>(next),
981 declaration_(declaration)
985 virtual void For(CYOutput &out) const;
987 void Replace(CYContext &context);
988 CYProperty *Property(CYContext &context);
990 virtual void Output(CYOutput &out) const;
991 virtual void Output(CYOutput &out, CYFlags flags) const;
997 CYDeclarations *declarations_;
999 CYVar(CYDeclarations *declarations) :
1000 declarations_(declarations)
1004 virtual CYStatement *Replace(CYContext &context);
1005 virtual void Output(CYOutput &out, CYFlags flags) const;
1011 CYDeclarations *declarations_;
1014 CYLet(CYDeclarations *declarations, CYStatement *statements) :
1015 declarations_(declarations),
1020 virtual CYStatement *Replace(CYContext &context);
1021 virtual void Output(CYOutput &out, CYFlags flags) const;
1027 CYForInitialiser *initialiser_;
1028 CYExpression *test_;
1029 CYExpression *increment_;
1032 CYFor(CYForInitialiser *initialiser, CYExpression *test, CYExpression *increment, CYStatement *code) :
1033 initialiser_(initialiser),
1035 increment_(increment),
1040 virtual CYStatement *Replace(CYContext &context);
1041 virtual void Output(CYOutput &out, CYFlags flags) const;
1047 CYForInInitialiser *initialiser_;
1051 CYForIn(CYForInInitialiser *initialiser, CYExpression *set, CYStatement *code) :
1052 initialiser_(initialiser),
1058 virtual CYStatement *Replace(CYContext &context);
1059 virtual void Output(CYOutput &out, CYFlags flags) const;
1062 struct CYForEachIn :
1065 CYForInInitialiser *initialiser_;
1069 CYForEachIn(CYForInInitialiser *initialiser, CYExpression *set, CYStatement *code) :
1070 initialiser_(initialiser),
1076 virtual CYStatement *Replace(CYContext &context);
1077 virtual void Output(CYOutput &out, CYFlags flags) const;
1083 CYProperty *properties_;
1085 CYObject(CYProperty *properties) :
1086 properties_(properties)
1090 virtual CYExpression *Replace(CYContext &context);
1091 void Output(CYOutput &out, CYFlags flags) const;
1097 CYExpression *object_;
1098 CYExpression *property_;
1100 CYMember(CYExpression *object, CYExpression *property) :
1106 void SetLeft(CYExpression *object) {
1110 void Replace_(CYContext &context);
1113 struct CYDirectMember :
1116 CYDirectMember(CYExpression *object, CYExpression *property) :
1117 CYMember(object, property)
1124 virtual CYExpression *Replace(CYContext &context);
1125 virtual void Output(CYOutput &out, CYFlags flags) const;
1128 struct CYIndirectMember :
1131 CYIndirectMember(CYExpression *object, CYExpression *property) :
1132 CYMember(object, property)
1139 virtual CYExpression *Replace(CYContext &context);
1140 virtual void Output(CYOutput &out, CYFlags flags) const;
1146 CYExpression *constructor_;
1147 CYArgument *arguments_;
1149 CYNew(CYExpression *constructor, CYArgument *arguments) :
1150 constructor_(constructor),
1151 arguments_(arguments)
1155 virtual unsigned Precedence() const {
1156 return arguments_ == NULL ? 2 : 1;
1161 virtual CYExpression *Replace(CYContext &context);
1162 virtual void Output(CYOutput &out, CYFlags flags) const;
1168 CYExpression *function_;
1169 CYArgument *arguments_;
1171 CYCall(CYExpression *function, CYArgument *arguments = NULL) :
1172 function_(function),
1173 arguments_(arguments)
1180 virtual CYExpression *Replace(CYContext &context);
1181 virtual void Output(CYOutput &out, CYFlags flags) const;
1187 CYExpression *test_;
1189 CYStatement *false_;
1191 CYIf(CYExpression *test, CYStatement *_true, CYStatement *_false = NULL) :
1198 virtual CYStatement *Replace(CYContext &context);
1199 virtual void Output(CYOutput &out, CYFlags flags) const;
1205 CYExpression *test_;
1208 CYDoWhile(CYExpression *test, CYStatement *code) :
1214 virtual CYStatement *Replace(CYContext &context);
1215 virtual void Output(CYOutput &out, CYFlags flags) const;
1221 CYExpression *test_;
1224 CYWhile(CYExpression *test, CYStatement *code) :
1230 virtual CYStatement *Replace(CYContext &context);
1231 virtual void Output(CYOutput &out, CYFlags flags) const;
1235 CYIdentifier *name_;
1236 CYFunctionParameter *parameters_;
1239 CYFunction(CYIdentifier *name, CYFunctionParameter *parameters, CYStatement *statements) :
1241 parameters_(parameters),
1246 virtual void Replace_(CYContext &context);
1247 virtual void Output(CYOutput &out, CYFlags flags) const;
1250 struct CYFunctionExpression :
1254 CYFunctionExpression(CYIdentifier *name, CYFunctionParameter *parameters, CYStatement *statements) :
1255 CYFunction(name, parameters, statements)
1262 virtual CYExpression *Replace(CYContext &context);
1263 virtual void Output(CYOutput &out, CYFlags flags) const;
1266 struct CYFunctionStatement :
1270 CYFunctionStatement(CYIdentifier *name, CYFunctionParameter *parameters, CYStatement *statements) :
1271 CYFunction(name, parameters, statements)
1275 virtual CYStatement *Replace(CYContext &context);
1276 virtual void Output(CYOutput &out, CYFlags flags) const;
1282 CYExpression *expression_;
1284 CYExpress(CYExpression *expression) :
1285 expression_(expression)
1289 virtual CYStatement *Replace(CYContext &context);
1290 virtual void Output(CYOutput &out, CYFlags flags) const;
1296 CYIdentifier *label_;
1298 CYContinue(CYIdentifier *label) :
1303 virtual CYStatement *Replace(CYContext &context);
1304 virtual void Output(CYOutput &out, CYFlags flags) const;
1310 CYIdentifier *label_;
1312 CYBreak(CYIdentifier *label) :
1317 virtual CYStatement *Replace(CYContext &context);
1318 virtual void Output(CYOutput &out, CYFlags flags) const;
1324 CYExpression *value_;
1326 CYReturn(CYExpression *value) :
1331 virtual CYStatement *Replace(CYContext &context);
1332 virtual void Output(CYOutput &out, CYFlags flags) const;
1338 virtual CYStatement *Replace(CYContext &context);
1339 virtual void Output(CYOutput &out, CYFlags flags) const;
1347 CYFinally(CYStatement *statements) :
1352 void Replace(CYContext &context);
1353 virtual void Output(CYOutput &out) const;
1362 CYIdentifier *name_;
1365 Catch(CYIdentifier *name, CYStatement *statements) :
1371 void Replace(CYContext &context);
1372 virtual void Output(CYOutput &out) const;
1380 CYFinally *finally_;
1382 Try(CYStatement *statements, Catch *_catch, CYFinally *finally) :
1389 virtual CYStatement *Replace(CYContext &context);
1390 virtual void Output(CYOutput &out, CYFlags flags) const;
1396 CYExpression *value_;
1398 Throw(CYExpression *value) :
1403 virtual CYStatement *Replace(CYContext &context);
1404 virtual void Output(CYOutput &out, CYFlags flags) const;
1412 CYExpression *scope_;
1415 CYWith(CYExpression *scope, CYStatement *code) :
1421 virtual CYStatement *Replace(CYContext &context);
1422 virtual void Output(CYOutput &out, CYFlags flags) const;
1428 CYExpression *value_;
1431 CYSwitch(CYExpression *value, CYClause *clauses) :
1437 virtual CYStatement *Replace(CYContext &context);
1438 virtual void Output(CYOutput &out, CYFlags flags) const;
1441 struct CYCondition :
1444 CYExpression *test_;
1445 CYExpression *true_;
1446 CYExpression *false_;
1448 CYCondition(CYExpression *test, CYExpression *_true, CYExpression *_false) :
1457 virtual CYExpression *Replace(CYContext &context);
1458 virtual void Output(CYOutput &out, CYFlags flags) const;
1461 struct CYAddressOf :
1464 CYAddressOf(CYExpression *rhs) :
1469 virtual const char *Operator() const {
1475 virtual CYExpression *Replace(CYContext &context);
1481 CYIndirect(CYExpression *rhs) :
1486 virtual const char *Operator() const {
1492 virtual CYExpression *Replace(CYContext &context);
1496 virtual CYExpression *Replace(CYContext &context);
1498 #define CYPostfix_(op, name, args...) \
1499 struct CY ## name : \
1502 CY ## name(CYExpression *lhs) : \
1507 virtual const char *Operator() const { \
1512 #define CYPrefix_(alphabetic, op, name, args...) \
1513 struct CY ## name : \
1516 CY ## name(CYExpression *rhs) : \
1521 CYAlphabetic(alphabetic) \
1523 virtual const char *Operator() const { \
1528 #define CYInfix_(alphabetic, precedence, op, name, args...) \
1529 struct CY ## name : \
1532 CY ## name(CYExpression *lhs, CYExpression *rhs) : \
1537 CYAlphabetic(alphabetic) \
1538 CYPrecedence(precedence) \
1540 virtual const char *Operator() const { \
1545 #define CYAssignment_(op, name, args...) \
1546 struct CY ## name ## Assign : \
1549 CY ## name ## Assign(CYExpression *lhs, CYExpression *rhs) : \
1550 CYAssignment(lhs, rhs) \
1554 virtual const char *Operator() const { \
1559 CYPostfix_("++", PostIncrement)
1560 CYPostfix_("--", PostDecrement)
1562 CYPrefix_(true, "delete", Delete)
1563 CYPrefix_(true, "void", Void)
1564 CYPrefix_(true, "typeof", TypeOf)
1565 CYPrefix_(false, "++", PreIncrement)
1566 CYPrefix_(false, "--", PreDecrement)
1567 CYPrefix_(false, "+", Affirm)
1568 CYPrefix_(false, "-", Negate)
1569 CYPrefix_(false, "~", BitwiseNot)
1570 CYPrefix_(false, "!", LogicalNot)
1572 CYInfix_(false, 5, "*", Multiply)
1573 CYInfix_(false, 5, "/", Divide)
1574 CYInfix_(false, 5, "%", Modulus)
1575 CYInfix_(false, 6, "+", Add, CYReplace)
1576 CYInfix_(false, 6, "-", Subtract)
1577 CYInfix_(false, 7, "<<", ShiftLeft)
1578 CYInfix_(false, 7, ">>", ShiftRightSigned)
1579 CYInfix_(false, 7, ">>>", ShiftRightUnsigned)
1580 CYInfix_(false, 8, "<", Less)
1581 CYInfix_(false, 8, ">", Greater)
1582 CYInfix_(false, 8, "<=", LessOrEqual)
1583 CYInfix_(false, 8, ">=", GreaterOrEqual)
1584 CYInfix_(true, 8, "instanceof", InstanceOf)
1585 CYInfix_(true, 8, "in", In)
1586 CYInfix_(false, 9, "==", Equal)
1587 CYInfix_(false, 9, "!=", NotEqual)
1588 CYInfix_(false, 9, "===", Identical)
1589 CYInfix_(false, 9, "!==", NotIdentical)
1590 CYInfix_(false, 10, "&", BitwiseAnd)
1591 CYInfix_(false, 11, "^", BitwiseXOr)
1592 CYInfix_(false, 12, "|", BitwiseOr)
1593 CYInfix_(false, 13, "&&", LogicalAnd)
1594 CYInfix_(false, 14, "||", LogicalOr)
1596 CYAssignment_("=", )
1597 CYAssignment_("*=", Multiply)
1598 CYAssignment_("/=", Divide)
1599 CYAssignment_("%=", Modulus)
1600 CYAssignment_("+=", Add)
1601 CYAssignment_("-=", Subtract)
1602 CYAssignment_("<<=", ShiftLeft)
1603 CYAssignment_(">>=", ShiftRightSigned)
1604 CYAssignment_(">>>=", ShiftRightUnsigned)
1605 CYAssignment_("&=", BitwiseAnd)
1606 CYAssignment_("^=", BitwiseXOr)
1607 CYAssignment_("|=", BitwiseOr)
1609 #endif/*CYPARSER_HPP*/