/* * Copyright (C) 2000 Sony Corporation * See license.txt for License Agreement * _______________________________________________________________________ | | | Description: | This file contains the bison rules for the Blendo Parser | | Author(s) : Chris Marrin | _______________________________________________________________________ */ %{ #include #include #define alloca malloc #include "BbAtom.h" #include "BbStack.h" #include "BpRawDefNode.h" #include "BpRawUseNode.h" #include "BpRawField.h" #include "BpRawBlendoProto.h" #include "BpRawExternProto.h" #include "BpRawScript.h" #include "BpParseHandler.h" #ifdef BISON_DEBUG #define YYDEBUG 1 #endif #define YYERROR_VERBOSE #define YYPARSE_PARAM ph #define YYLEX_PARAM ph #define PH ((BpParseHandler *) ph) #define SC (PH->getCurrentScript()) #define yyerror(msg) PH->error(msg) int yylex(void *lvalp, void *ph) { return PH->scan((YYSTYPE *) lvalp); } #if 0 %} %union { char* string; BpRawNode* node; BpRawProto* proto; double num; BbRawAtom atom; BpTreeStmt* stmt; BpTreeExpr* expr; BpTreeArg* arg; BpTreeArrayElt* elt; BpTreeObjectProp* prop; BpTreeLeaf* leaf; BpTreeBinaryOp::Type assignType; BpRawScript* script; int fieldAttr; int keyword; int32_t int32; }; %{ #endif %} %type IDENTIFIER BLENDOS_VERSION %type STRING %type node nodeDeclaration exportNodeDeclaration nodeDefinition %type nodeExposeDeclaration %type anonymousProtoDeclaration anonymousProto %type protoDefinition namedProto domProto %type NUMBER %type unsignedNumber signedNumber %type primaryExpression memberExpression newExpression callExpression arguments %type leftHandSideExpression postfixExpression unaryExpression %type multiplicativeExpression additiveExpression shiftExpression %type relationalExpression equalityExpression bitwiseANDExpression %type relationalExpressionNoIn equalityExpressionNoIn bitwiseANDExpressionNoIn %type bitwiseXORExpression bitwiseORExpression logicalANDExpression logicalORExpression %type bitwiseXORExpressionNoIn bitwiseORExpressionNoIn %type logicalANDExpressionNoIn logicalORExpressionNoIn %type conditionalExpression assignmentExpression expression expressionOpt initializer %type conditionalExpressionNoIn assignmentExpressionNoIn %type expressionNoIn expressionNoInOpt initializerNoIn %type argumentList %type elisionOpt elision elementList arrayLiteral %type objectLiteral propertyNameAndValueList %type propertyName %type assignmentOperator %type sourceElements sourceElement %type expressionStatement triggeredStatement statement statementList %type labelledStatement statementListOpt switchStatement %type block emptyStatement functionDeclaration %type variableStatement ifStatement iterationStatement continueStatement %type breakStatement returnStatement withStatement %type variableDeclarationList variableDeclaration %type variableDeclarationListNoIn variableDeclarationNoIn %type variableDeclarationForIn %type