• Skip to content
  • Skip to link menu
KDE 4.0 API Reference
  • KDE API Reference
  • kdelibs
  • Sitemap
  • Contact Us
 

KJS

KJS::Node

KJS::Node Class Reference

#include <nodes.h>

Inherited by KJS::ArgumentListNode, KJS::ArgumentsNode, KJS::ArrayNode, KJS::AssignBracketNode, KJS::AssignDotNode, KJS::AssignErrorNode, KJS::AssignExprNode, KJS::AssignNode, KJS::BinaryLogicalNode, KJS::BinaryOperatorNode, KJS::BitwiseNotNode, KJS::BooleanNode, KJS::CaseBlockNode, KJS::CaseClauseNode, KJS::ClauseListNode, KJS::CommaNode, KJS::ConditionalNode, KJS::DeleteReferenceNode, KJS::DeleteValueNode, KJS::ElementNode, KJS::FuncExprNode, KJS::FunctionCallBracketNode, KJS::FunctionCallDotNode, KJS::FunctionCallReferenceNode, KJS::FunctionCallValueNode, KJS::GroupNode, KJS::LocationNode, KJS::LogicalNotNode, KJS::NegateNode, KJS::NewExprNode, KJS::NullNode, KJS::NumberNode, KJS::ObjectLiteralNode, KJS::PackageNameNode, KJS::ParameterNode, KJS::PostfixErrorNode, KJS::PostfixNode, KJS::PrefixErrorNode, KJS::PrefixNode, KJS::PropertyListNode, KJS::PropertyNameNode, KJS::PropertyNode, KJS::RegExpNode, KJS::StatementNode, KJS::StringNode, KJS::ThisNode, KJS::TypeOfReferenceNode, KJS::TypeOfValueNode, KJS::UnaryPlusNode, KJS::VarDeclListNode, KJS::VarDeclNode, and KJS::VoidNode.

List of all members.


Detailed Description

Definition at line 67 of file nodes.h.


Public Types

enum  NodeType {
  UnknownNodeType, NullNodeType, BooleanNodeType, NumberNodeType,
  StringNodeType, RegExpNodeType, TryNodeType, GroupNodeType
}

Public Member Functions

 Node ()
virtual ~Node ()
virtual NodeType type () const
virtual JSValue * evaluate (ExecState *exec)=0
UString toString () const
virtual void streamTo (SourceStream &) const =0
int lineNo () const
void ref ()
void deref ()
unsigned refcount ()
virtual Node * nodeInsideAllParens ()
virtual bool isLocation () const
virtual bool isVarAccessNode () const
virtual bool isBracketAccessorNode () const
virtual bool isDotAccessorNode () const
bool isNumber () const
bool isString () const
bool isGroupNode () const
bool isTryNode () const
virtual bool introducesNewStaticScope () const
virtual bool introducesNewDynamicScope () const
virtual bool isIterationStatement () const
virtual bool isSwitchStatement () const
virtual bool isVarStatement () const
bool introducesNewScope () const
virtual void breakCycle ()
void processDecls (ExecState *)
virtual void recurseVisit (NodeVisitor *)
virtual Node * optimizeLocalAccess (ExecState *exec, FunctionBodyNode *node)
Completion createErrorCompletion (ExecState *, ErrorType, const UString &msg)
Completion createErrorCompletion (ExecState *, ErrorType, const UString &msg, const Identifier &)
JSValue * throwError (ExecState *, ErrorType, const UString &msg)
JSValue * throwError (ExecState *, ErrorType, const UString &msg, const char *string)
JSValue * throwError (ExecState *, ErrorType, const UString &msg, JSValue *, Node *)
JSValue * throwError (ExecState *, ErrorType, const UString &msg, const Identifier &)
JSValue * throwError (ExecState *, ErrorType, const UString &msg, JSValue *, const Identifier &)
JSValue * throwError (ExecState *, ErrorType, const UString &msg, JSValue *, Node *, Node *)
JSValue * throwError (ExecState *, ErrorType, const UString &msg, JSValue *, Node *, const Identifier &)
JSValue * throwUndefinedVariableError (ExecState *, const Identifier &)
void handleException (ExecState *)
void handleException (ExecState *, JSValue *)
void copyDebugInfo (Node *otherNode)

Static Public Member Functions

static void clearNewNodes ()
template<typename T>
static void recurseVisitLink (NodeVisitor *visitor, RefPtr< T > &link)
template<typename T>
static void recurseVisitLink (NodeVisitor *visitor, ListRefPtr< T > &link)

Protected Member Functions

virtual Node * checkSemantics (SemanticChecker *semanticChecker)

Protected Attributes

int m_line

Friends

class SemanticChecker
class VarDeclVisitor
class FuncDeclVisitor

Member Enumeration Documentation

enum KJS::Node::NodeType

Enumerator:
UnknownNodeType 
NullNodeType 
BooleanNodeType 
NumberNodeType 
StringNodeType 
RegExpNodeType 
TryNodeType 
GroupNodeType 

Definition at line 69 of file nodes.h.


Constructor & Destructor Documentation

KJS::Node::Node (  ) 

Definition at line 119 of file nodes.cpp.

KJS::Node::~Node (  )  [virtual]

Definition at line 130 of file nodes.cpp.


Member Function Documentation

virtual NodeType KJS::Node::type (  )  const [inline, virtual]

Reimplemented in KJS::NullNode, KJS::BooleanNode, KJS::NumberNode, KJS::StringNode, KJS::RegExpNode, KJS::GroupNode, and KJS::TryNode.

Definition at line 83 of file nodes.h.

virtual JSValue* KJS::Node::evaluate ( ExecState *  exec  )  [pure virtual]

Implemented in KJS::NullNode, KJS::BooleanNode, KJS::NumberNode, KJS::StringNode, KJS::RegExpNode, KJS::ThisNode, KJS::VarAccessNode, KJS::LocalVarAccessNode, KJS::NonLocalVarAccessNode, KJS::GroupNode, KJS::ElementNode, KJS::ArrayNode, KJS::PropertyNameNode, KJS::PropertyNode, KJS::PropertyListNode, KJS::ObjectLiteralNode, KJS::BracketAccessorNode, KJS::DotAccessorNode, KJS::ArgumentListNode, KJS::ArgumentsNode, KJS::NewExprNode, KJS::FunctionCallValueNode, KJS::FunctionCallReferenceNode, KJS::FunctionCallBracketNode, KJS::FunctionCallDotNode, KJS::PostfixNode, KJS::PostfixErrorNode, KJS::DeleteReferenceNode, KJS::DeleteValueNode, KJS::VoidNode, KJS::TypeOfReferenceNode, KJS::TypeOfValueNode, KJS::PrefixErrorNode, KJS::PrefixNode, KJS::UnaryPlusNode, KJS::NegateNode, KJS::BitwiseNotNode, KJS::LogicalNotNode, KJS::BinaryOperatorNode, KJS::BinaryLogicalNode, KJS::ConditionalNode, KJS::AssignErrorNode, KJS::AssignNode, KJS::AssignBracketNode, KJS::AssignDotNode, KJS::CommaNode, KJS::AssignExprNode, KJS::VarDeclNode, KJS::VarDeclListNode, KJS::ParameterNode, KJS::FuncExprNode, KJS::CaseClauseNode, KJS::ClauseListNode, KJS::CaseBlockNode, and KJS::PackageNameNode.

UString Node::toString (  )  const

Definition at line 251 of file nodes2string.cpp.

virtual void KJS::Node::streamTo ( SourceStream &   )  const [pure virtual]

Implemented in KJS::NullNode, KJS::BooleanNode, KJS::NumberNode, KJS::StringNode, KJS::RegExpNode, KJS::ThisNode, KJS::VarAccessNode, KJS::GroupNode, KJS::ElementNode, KJS::ArrayNode, KJS::PropertyNameNode, KJS::PropertyNode, KJS::PropertyListNode, KJS::ObjectLiteralNode, KJS::BracketAccessorNode, KJS::DotAccessorNode, KJS::ArgumentListNode, KJS::ArgumentsNode, KJS::NewExprNode, KJS::FunctionCallValueNode, KJS::FunctionCallReferenceNode, KJS::FunctionCallBracketNode, KJS::FunctionCallParenBracketNode, KJS::FunctionCallDotNode, KJS::FunctionCallParenDotNode, KJS::PostfixNode, KJS::PostfixErrorNode, KJS::DeleteReferenceNode, KJS::DeleteValueNode, KJS::VoidNode, KJS::TypeOfReferenceNode, KJS::TypeOfValueNode, KJS::PrefixErrorNode, KJS::PrefixNode, KJS::UnaryPlusNode, KJS::NegateNode, KJS::BitwiseNotNode, KJS::LogicalNotNode, KJS::BinaryOperatorNode, KJS::BinaryLogicalNode, KJS::ConditionalNode, KJS::AssignErrorNode, KJS::AssignNode, KJS::AssignBracketNode, KJS::AssignDotNode, KJS::CommaNode, KJS::AssignExprNode, KJS::VarDeclNode, KJS::VarDeclListNode, KJS::VarStatementNode, KJS::BlockNode, KJS::EmptyStatementNode, KJS::ExprStatementNode, KJS::IfNode, KJS::DoWhileNode, KJS::WhileNode, KJS::ForNode, KJS::ForInNode, KJS::ContinueNode, KJS::BreakNode, KJS::ReturnNode, KJS::WithNode, KJS::LabelNode, KJS::ThrowNode, KJS::TryNode, KJS::ParameterNode, KJS::FuncExprNode, KJS::FuncDeclNode, KJS::SourceElementsNode, KJS::CaseClauseNode, KJS::ClauseListNode, KJS::CaseBlockNode, KJS::SwitchNode, KJS::ErrorNode, KJS::PackageNameNode, and KJS::ImportStatement.

int KJS::Node::lineNo (  )  const [inline]

Definition at line 88 of file nodes.h.

void KJS::Node::ref (  ) 

Definition at line 137 of file nodes.cpp.

void KJS::Node::deref (  ) 

Definition at line 156 of file nodes.cpp.

unsigned KJS::Node::refcount (  ) 

Definition at line 172 of file nodes.cpp.

void KJS::Node::clearNewNodes (  )  [static]

Definition at line 187 of file nodes.cpp.

Node * KJS::Node::nodeInsideAllParens (  )  [virtual]

Reimplemented in KJS::GroupNode.

Definition at line 305 of file nodes.cpp.

virtual bool KJS::Node::isLocation (  )  const [inline, virtual]

Reimplemented in KJS::LocationNode.

Definition at line 97 of file nodes.h.

virtual bool KJS::Node::isVarAccessNode (  )  const [inline, virtual]

Reimplemented in KJS::VarAccessNode.

Definition at line 98 of file nodes.h.

virtual bool KJS::Node::isBracketAccessorNode (  )  const [inline, virtual]

Reimplemented in KJS::BracketAccessorNode.

Definition at line 99 of file nodes.h.

virtual bool KJS::Node::isDotAccessorNode (  )  const [inline, virtual]

Reimplemented in KJS::DotAccessorNode.

Definition at line 100 of file nodes.h.

bool KJS::Node::isNumber (  )  const [inline]

Definition at line 101 of file nodes.h.

bool KJS::Node::isString (  )  const [inline]

Definition at line 102 of file nodes.h.

bool KJS::Node::isGroupNode (  )  const [inline]

Definition at line 103 of file nodes.h.

bool KJS::Node::isTryNode (  )  const [inline]

Definition at line 104 of file nodes.h.

virtual bool KJS::Node::introducesNewStaticScope (  )  const [inline, virtual]

Reimplemented in KJS::FuncExprNode, and KJS::FuncDeclNode.

Definition at line 105 of file nodes.h.

virtual bool KJS::Node::introducesNewDynamicScope (  )  const [inline, virtual]

Reimplemented in KJS::WithNode.

Definition at line 106 of file nodes.h.

virtual bool KJS::Node::isIterationStatement (  )  const [inline, virtual]

Reimplemented in KJS::DoWhileNode, KJS::WhileNode, KJS::ForNode, and KJS::ForInNode.

Definition at line 107 of file nodes.h.

virtual bool KJS::Node::isSwitchStatement (  )  const [inline, virtual]

Reimplemented in KJS::SwitchNode.

Definition at line 108 of file nodes.h.

virtual bool KJS::Node::isVarStatement (  )  const [inline, virtual]

Reimplemented in KJS::VarStatementNode.

Definition at line 109 of file nodes.h.

bool KJS::Node::introducesNewScope (  )  const [inline]

Definition at line 111 of file nodes.h.

virtual void KJS::Node::breakCycle (  )  [inline, virtual]

Reimplemented in KJS::ElementNode, KJS::PropertyListNode, KJS::ArgumentListNode, KJS::VarDeclListNode, KJS::ParameterNode, KJS::SourceElementsNode, and KJS::ClauseListNode.

Definition at line 113 of file nodes.h.

void KJS::Node::processDecls ( ExecState *  exec  ) 

Definition at line 350 of file nodes.cpp.

virtual void KJS::Node::recurseVisit ( NodeVisitor *   )  [inline, virtual]

Reimplemented in KJS::GroupNode, KJS::ElementNode, KJS::ArrayNode, KJS::PropertyNode, KJS::PropertyListNode, KJS::ObjectLiteralNode, KJS::BracketAccessorNode, KJS::DotAccessorNode, KJS::ArgumentListNode, KJS::ArgumentsNode, KJS::NewExprNode, KJS::FunctionCallValueNode, KJS::FunctionCallReferenceNode, KJS::FunctionCallBracketNode, KJS::FunctionCallDotNode, KJS::PostfixNode, KJS::DeleteReferenceNode, KJS::DeleteValueNode, KJS::VoidNode, KJS::TypeOfReferenceNode, KJS::TypeOfValueNode, KJS::PrefixNode, KJS::UnaryPlusNode, KJS::NegateNode, KJS::BitwiseNotNode, KJS::LogicalNotNode, KJS::BinaryOperatorNode, KJS::BinaryLogicalNode, KJS::ConditionalNode, KJS::AssignNode, KJS::AssignBracketNode, KJS::AssignDotNode, KJS::CommaNode, KJS::AssignExprNode, KJS::VarDeclNode, KJS::VarDeclListNode, KJS::VarStatementNode, KJS::BlockNode, KJS::ExprStatementNode, KJS::IfNode, KJS::DoWhileNode, KJS::WhileNode, KJS::ForNode, KJS::ForInNode, KJS::ReturnNode, KJS::WithNode, KJS::LabelNode, KJS::ThrowNode, KJS::TryNode, KJS::ParameterNode, KJS::FuncExprNode, KJS::FuncDeclNode, KJS::SourceElementsNode, KJS::CaseClauseNode, KJS::ClauseListNode, KJS::CaseBlockNode, KJS::SwitchNode, KJS::PackageNameNode, and KJS::ImportStatement.

Definition at line 125 of file nodes.h.

Node * KJS::Node::optimizeLocalAccess ( ExecState *  exec,
FunctionBodyNode *  node 
) [virtual]

Reimplemented in KJS::VarAccessNode, KJS::PostfixNode, KJS::PrefixNode, KJS::AssignNode, and KJS::VarStatementNode.

Definition at line 364 of file nodes.cpp.

template<typename T>
static void KJS::Node::recurseVisitLink ( NodeVisitor *  visitor,
RefPtr< T > &  link 
) [inline, static]

Definition at line 134 of file nodes.h.

template<typename T>
static void KJS::Node::recurseVisitLink ( NodeVisitor *  visitor,
ListRefPtr< T > &  link 
) [inline, static]

Definition at line 145 of file nodes.h.

Completion KJS::Node::createErrorCompletion ( ExecState *  exec,
ErrorType  e,
const UString &  msg 
)

Definition at line 219 of file nodes.cpp.

Completion KJS::Node::createErrorCompletion ( ExecState *  exec,
ErrorType  e,
const UString &  msg,
const Identifier &  ident 
)

Definition at line 224 of file nodes.cpp.

JSValue * KJS::Node::throwError ( ExecState *  exec,
ErrorType  e,
const UString &  msg 
)

Definition at line 231 of file nodes.cpp.

JSValue * KJS::Node::throwError ( ExecState *  exec,
ErrorType  e,
const UString &  msg,
const char *  string 
)

Definition at line 236 of file nodes.cpp.

JSValue * KJS::Node::throwError ( ExecState *  exec,
ErrorType  e,
const UString &  msg,
JSValue *  v,
Node *  expr 
)

Definition at line 243 of file nodes.cpp.

JSValue * KJS::Node::throwError ( ExecState *  exec,
ErrorType  e,
const UString &  msg,
const Identifier &  label 
)

Definition at line 252 of file nodes.cpp.

JSValue * KJS::Node::throwError ( ExecState *  exec,
ErrorType  e,
const UString &  msg,
JSValue *  v,
const Identifier &  label 
)

Definition at line 277 of file nodes.cpp.

JSValue * KJS::Node::throwError ( ExecState *  exec,
ErrorType  e,
const UString &  msg,
JSValue *  v,
Node *  e1,
Node *  e2 
)

Definition at line 259 of file nodes.cpp.

JSValue * KJS::Node::throwError ( ExecState *  exec,
ErrorType  e,
const UString &  msg,
JSValue *  v,
Node *  expr,
const Identifier &  label 
)

Definition at line 268 of file nodes.cpp.

JSValue * KJS::Node::throwUndefinedVariableError ( ExecState *  exec,
const Identifier &  ident 
)

Definition at line 285 of file nodes.cpp.

void KJS::Node::handleException ( ExecState *  exec  ) 

Definition at line 290 of file nodes.cpp.

void KJS::Node::handleException ( ExecState *  exec,
JSValue *  exceptionValue 
)

Definition at line 295 of file nodes.cpp.

void KJS::Node::copyDebugInfo ( Node *  otherNode  ) 

Definition at line 310 of file nodes.cpp.

Node * KJS::Node::checkSemantics ( SemanticChecker *  semanticChecker  )  [protected, virtual]

Reimplemented in KJS::StatementNode, KJS::ContinueNode, KJS::BreakNode, KJS::LabelNode, KJS::FuncExprNode, and KJS::FuncDeclNode.

Definition at line 53 of file semantic_checker.cpp.


Friends And Related Function Documentation

friend class SemanticChecker [friend]

Definition at line 178 of file nodes.h.

friend class VarDeclVisitor [friend]

Definition at line 185 of file nodes.h.

friend class FuncDeclVisitor [friend]

Definition at line 186 of file nodes.h.


Member Data Documentation

int KJS::Node::m_line [protected]

Definition at line 181 of file nodes.h.


The documentation for this class was generated from the following files:
  • nodes.h
  • nodes.cpp
  • nodes2string.cpp
  • semantic_checker.cpp

KJS

Skip menu "KJS"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Class Members
  • Related Pages

kdelibs

Skip menu "kdelibs"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • Kate
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • KIO
  • KIOSlave
  • KJS
  •   WTF
  • KJSEmbed
  • KNewStuff
  • KParts
  • Kross
  • KUtils
  • Nepomuk
  •   core
  • Phonon
  •   Backend
  • Solid
  • Sonnet
  • ThreadWeaver
Generated for kdelibs by doxygen 1.5.4
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal