⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 qscriptast_p.h

📁 奇趣公司比较新的qt/emd版本
💻 H
📖 第 1 页 / 共 3 页
字号:
/******************************************************************************** Copyright (C) 1992-2007 Trolltech ASA. All rights reserved.**** This file is part of the QtScript module of the Qt Toolkit.**** This file may be used under the terms of the GNU General Public** License version 2.0 as published by the Free Software Foundation** and appearing in the file LICENSE.GPL included in the packaging of** this file.  Please review the following information to ensure GNU** General Public Licensing requirements will be met:** http://trolltech.com/products/qt/licenses/licensing/opensource/**** If you are unsure which license is appropriate for your use, please** review the following information:** http://trolltech.com/products/qt/licenses/licensing/licensingoverview** or contact the sales department at sales@trolltech.com.**** In addition, as a special exception, Trolltech gives you certain** additional rights. These rights are described in the Trolltech GPL** Exception version 1.0, which can be found at** http://www.trolltech.com/products/qt/gplexception/ and in the file** GPL_EXCEPTION.txt in this package.**** In addition, as a special exception, Trolltech, as the sole copyright** holder for Qt Designer, grants users of the Qt/Eclipse Integration** plug-in the right for the Qt/Eclipse Integration to link to** functionality provided by Qt Designer and its related libraries.**** Trolltech reserves all rights not expressly granted herein.**** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.******************************************************************************/#ifndef QSCRIPTAST_P_H#define QSCRIPTAST_P_H////  W A R N I N G//  -------------//// This file is not part of the Qt API.  It exists purely as an// implementation detail.  This header file may change from version to// version without notice, or even be removed.//// We mean it.//#include <QtCore/QString>#ifndef QT_NO_SCRIPT#include "qscriptastfwd_p.h"#include "qscriptastvisitor_p.h"class QScriptNameIdImpl;namespace QSOperator // ### rename{enum Op {    Add,    And,    InplaceAnd,    Assign,    BitAnd,    BitOr,    BitXor,    InplaceSub,    Div,    InplaceDiv,    Equal,    Ge,    Gt,    In,    InplaceAdd,    InstanceOf,    Le,    LShift,    InplaceLeftShift,    Lt,    Mod,    InplaceMod,    Mul,    InplaceMul,    NotEqual,    Or,    InplaceOr,    RShift,    InplaceRightShift,    StrictEqual,    StrictNotEqual,    Sub,    URShift,    InplaceURightShift,    InplaceXor};} // namespace QSOperatornamespace QScript { namespace AST {class Node{public:    enum Kind {        Kind_Node,        Kind_ExpressionNode,        Kind_Statement,        Kind_ThisExpression,        Kind_IdentifierExpression,        Kind_NullExpression,        Kind_TrueLiteral,        Kind_FalseLiteral,        Kind_NumericLiteral,        Kind_StringLiteral,        Kind_RegExpLiteral,        Kind_ArrayLiteral,        Kind_ObjectLiteral,        Kind_ElementList,        Kind_Elision,        Kind_PropertyNameAndValueList,        Kind_PropertyName,        Kind_IdentifierPropertyName,        Kind_StringLiteralPropertyName,        Kind_NumericLiteralPropertyName,        Kind_ArrayMemberExpression,        Kind_FieldMemberExpression,        Kind_NewMemberExpression,        Kind_NewExpression,        Kind_CallExpression,        Kind_ArgumentList,        Kind_PostIncrementExpression,        Kind_PostDecrementExpression,        Kind_DeleteExpression,        Kind_VoidExpression,        Kind_TypeOfExpression,        Kind_PreIncrementExpression,        Kind_PreDecrementExpression,        Kind_UnaryPlusExpression,        Kind_UnaryMinusExpression,        Kind_TildeExpression,        Kind_NotExpression,        Kind_BinaryExpression,        Kind_ConditionalExpression,        Kind_Expression,        Kind_Block,        Kind_StatementList,        Kind_VariableStatement,        Kind_VariableDeclarationList,        Kind_VariableDeclaration,        Kind_EmptyStatement,        Kind_ExpressionStatement,        Kind_IfStatement,        Kind_DoWhileStatement,        Kind_WhileStatement,        Kind_ForStatement,        Kind_LocalForStatement,        Kind_ForEachStatement,        Kind_LocalForEachStatement,        Kind_ContinueStatement,        Kind_BreakStatement,        Kind_ReturnStatement,        Kind_WithStatement,        Kind_SwitchStatement,        Kind_CaseBlock,        Kind_CaseClauses,        Kind_CaseClause,        Kind_DefaultClause,        Kind_LabelledStatement,        Kind_ThrowStatement,        Kind_TryStatement,        Kind_Catch,        Kind_Finally,        Kind_FunctionDeclaration,        Kind_FunctionExpression,        Kind_FormalParameterList,        Kind_FunctionBody,        Kind_Program,        Kind_SourceElements,        Kind_SourceElement,        Kind_FunctionSourceElement,        Kind_StatementSourceElement    };    inline Node():        startLine(0), startColumn(0),        endLine(0), endColumn(0), kind(Kind_Node) {}    virtual ~Node() {}    virtual ExpressionNode *expressionCast();    virtual BinaryExpression *binaryExpressionCast();    virtual Statement *statementCast();    inline void accept(Visitor *visitor)    {        if (visitor->preVisit(this)) {            accept0(visitor);            visitor->postVisit(this);        }    }    static void acceptChild(Node *node, Visitor *visitor)    {        if (node)            node->accept(visitor);    }    virtual void accept0(Visitor *visitor) = 0;    int startLine;    int startColumn;    int endLine;    int endColumn;    Kind kind;};class ExpressionNode: public Node{public:    ExpressionNode() { kind = Kind_ExpressionNode; }    virtual ~ExpressionNode() {}    virtual ExpressionNode *expressionCast();};class Statement: public Node{public:    Statement() { kind = Kind_Statement; }    virtual ~Statement() {}    virtual Statement *statementCast();};class ThisExpression: public ExpressionNode{public:    ThisExpression() { kind = Kind_ThisExpression; }    virtual ~ThisExpression() {}    virtual void accept0(Visitor *visitor);};class IdentifierExpression: public ExpressionNode{public:    IdentifierExpression(QScriptNameIdImpl *n):        name (n) { kind = Kind_IdentifierExpression; }    virtual ~IdentifierExpression() {}    virtual void accept0(Visitor *visitor);// attributes    QScriptNameIdImpl *name;};class NullExpression: public ExpressionNode{public:    NullExpression() { kind = Kind_NullExpression; }    virtual ~NullExpression() {}    virtual void accept0(Visitor *visitor);};class TrueLiteral: public ExpressionNode{public:    TrueLiteral() { kind = Kind_TrueLiteral; }    virtual ~TrueLiteral() {}    virtual void accept0(Visitor *visitor);};class FalseLiteral: public ExpressionNode{public:    FalseLiteral() { kind = Kind_FalseLiteral; }    virtual ~FalseLiteral() {}    virtual void accept0(Visitor *visitor);};class NumericLiteral: public ExpressionNode{public:    NumericLiteral(double v):        value (v) { kind = Kind_NumericLiteral; }    virtual ~NumericLiteral() {}    virtual void accept0(Visitor *visitor);// attributes:    double value;};class StringLiteral: public ExpressionNode{public:    StringLiteral(QScriptNameIdImpl *v):        value (v) { kind = Kind_StringLiteral; }    virtual ~StringLiteral() {}    virtual void accept0(Visitor *visitor);// attributes:    QScriptNameIdImpl *value;};class RegExpLiteral: public ExpressionNode{public:    RegExpLiteral(QScriptNameIdImpl *p, QScriptNameIdImpl *f):        pattern (p), flags (f) { kind = Kind_RegExpLiteral; }    virtual ~RegExpLiteral() {}    virtual void accept0(Visitor *visitor);// attributes:    QScriptNameIdImpl *pattern;    QScriptNameIdImpl *flags;};class ArrayLiteral: public ExpressionNode{public:    ArrayLiteral(Elision *e):        elements (0), elision (e)        { kind = Kind_ArrayLiteral; }    ArrayLiteral(ElementList *elts):        elements (elts), elision (0)        { kind = Kind_ArrayLiteral; }    ArrayLiteral(ElementList *elts, Elision *e):        elements (elts), elision (e)        { kind = Kind_ArrayLiteral; }    virtual ~ArrayLiteral() {}    virtual void accept0(Visitor *visitor);// attributes    ElementList *elements;    Elision *elision;};class ObjectLiteral: public ExpressionNode{public:    ObjectLiteral():        properties (0) { kind = Kind_ObjectLiteral; }    ObjectLiteral(PropertyNameAndValueList *plist):        properties (plist) { kind = Kind_ObjectLiteral; }    virtual ~ObjectLiteral() {}    virtual void accept0(Visitor *visitor);// attributes    PropertyNameAndValueList *properties;};class ElementList: public Node{public:    ElementList(Elision *e, ExpressionNode *expr):        elision (e), expression (expr), next (this)        { kind = Kind_ElementList; }    ElementList(ElementList *previous, Elision *e, ExpressionNode *expr):        elision (e), expression (expr)    {        kind = Kind_ElementList;        next = previous->next;        previous->next = this;    }    virtual ~ElementList() {}    inline ElementList *finish ()    {        ElementList *front = next;        next = 0;        return front;    }    virtual void accept0(Visitor *visitor);// attributes    Elision *elision;    ExpressionNode *expression;    ElementList *next;};class Elision: public Node{public:    Elision():        next (this) { kind = Kind_Elision; }    Elision(Elision *previous)    {        kind = Kind_Elision;        next = previous->next;        previous->next = this;    }    virtual ~Elision() {}    virtual void accept0(Visitor *visitor);    inline Elision *finish ()    {        Elision *front = next;        next = 0;        return front;    }// attributes    Elision *next;};class PropertyNameAndValueList: public Node{public:    PropertyNameAndValueList(PropertyName *n, ExpressionNode *v):        name (n), value (v), next (this)        { kind = Kind_PropertyNameAndValueList; }    PropertyNameAndValueList(PropertyNameAndValueList *previous, PropertyName *n, ExpressionNode *v):        name (n), value (v)    {        kind = Kind_PropertyNameAndValueList;        next = previous->next;        previous->next = this;    }    virtual ~PropertyNameAndValueList() {}    virtual void accept0(Visitor *visitor);    inline PropertyNameAndValueList *finish ()    {        PropertyNameAndValueList *front = next;        next = 0;        return front;    }// attributes    PropertyName *name;    ExpressionNode *value;    PropertyNameAndValueList *next;};class PropertyName: public Node{public:    PropertyName() { kind = Kind_PropertyName; }    virtual ~PropertyName() {}};class IdentifierPropertyName: public PropertyName{public:    IdentifierPropertyName(QScriptNameIdImpl *n):        id (n) { kind = Kind_IdentifierPropertyName; }    virtual ~IdentifierPropertyName() {}    virtual void accept0(Visitor *visitor);// attributes    QScriptNameIdImpl *id;};class StringLiteralPropertyName: public PropertyName{public:    StringLiteralPropertyName(QScriptNameIdImpl *n):        id (n) { kind = Kind_StringLiteralPropertyName; }    virtual ~StringLiteralPropertyName() {}    virtual void accept0(Visitor *visitor);// attributes    QScriptNameIdImpl *id;

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -