PyDev AST Knotentypen
Im Folgenden sind die nicht abstrakten Knotentypen eines PyDev-AST aufgeführt.
Fast alle stammen aus dem Paket org.python.pydev.parser.jython.ast
.
Nicht alle Knotentypen entsprechen Elementen der Python-Grammatik (beispielsweise commentType
).
Außerdem sind hier auch die Typen xyzType
aufgeführt.
Für diese gibt es keine Methoden visitXyzType
in VisitorIF
, aber die Knoten sind im AST vorhanden und können über die jeweiligen Elternknoten erreicht werden (siehe PyDev_AST#Visitor).
Der für einen vorhandenen Python-Quelltext von PyDev erzeugten Syntaxbaum kann mittels des im Rahmen dieser Seminararbeit entwickelten PyDev_AST_Viewer in Eclipse betrachtet werden.
Liste der Knotentypen
Die erste Listenebene in der folgenden Auflistung sind die Typen, die zweite Ebene die Elemente, die zum jeweiligen Typ gespeichert werden.
-
aliasType
-
NameTokType name
-
NameTokType asname
-
-
argumentsType
-
exprType[] args
-
NameTokType vararg
-
NameTokType kwarg
-
exprType[] defaults
-
exprType[] kwonlyargs
-
exprType[] kw_defaults
-
exprType[] annotation
-
exprType varargannotation
-
exprType kwargannotation
-
exprType[] kwonlyargannotation
-
-
commentType
-
String id
-
-
ComprehensionCollection
-
Comprehension
-
Decorators
-
decoratorsType[] exp
-
int id
-
-
decoratorsType
-
exprType func
-
exprType[] args
-
keywordType[] keywords
-
exprType starargs
-
exprType kwargs
-
-
DefaultArg
-
excepthandlerType
-
Attribute
-
exprType value
-
NameTokType attr
-
int ctx
-
-
BinOp
-
BoolOp
-
int op
-
exprType[] values
-
-
Call
-
exprType func
-
exprType[] args
-
keywordType[] keywords
-
exprType starargs
-
exprType kwargs
-
-
Compare
-
Dict
-
DictComp
-
exprType key
-
exprType value
-
comprehensionType[] generators
-
-
GeneratorExp
-
exprType elt
-
comprehensionType[] generators
-
-
IfExp
-
Lambda
-
argumentsType args
-
exprType body
-
-
List
-
exprType[] elts
-
int ctx
-
-
ListComp
-
exprType elt
-
comprehensionType[] generators
-
int ctx
-
-
Name
-
String id
-
int ctx
-
boolean reserved
-
-
Num
-
Object n
-
int type
-
String num
-
-
Repr
-
exprType value
-
-
Set
-
exprType[] elts
-
-
SetComp
-
exprType elt
-
comprehensionType[] generators
-
-
Starred
-
exprType value
-
int ctx
-
-
Str
-
String s
-
int type
-
boolean unicode
-
boolean raw
-
boolean binary
-
-
StrJoin
-
exprType[] strs
-
-
Subscript
-
Tuple
-
exprType[] elts
-
int ctx
-
boolean endsWithComma
-
-
UnaryOp
-
int op
-
exprType operand
-
-
Yield
-
exprType value
-
-
ExtraArg
-
ExtraArgValue
-
exprType value
-
int id
-
-
FuncDefReturnAnn
-
SimpleNode node
-
-
IdentityNode
-
Object image
-
-
JfpDef
-
keywordType
-
NameTokType arg
-
exprType value
-
boolean afterstarargs
-
-
Expression
-
exprType body
-
-
Interactive
-
stmtType[] body
-
-
Module
-
stmtType[] body
-
-
Suite
-
stmtType[] body
-
-
NameTok
-
String id
-
int ctx
-
-
Ellipsis
-
ExtSlice
-
sliceType[] dims
-
-
Index
-
exprType value
-
-
Slice
-
Assert
-
Assign
-
AugAssign
-
Break
-
ClassDef
-
NameTokType name
-
exprType[] bases
-
stmtType[] body
-
decoratorsType[] decs
-
keywordType[] keywords
-
exprType starargs
-
exprType kwargs
-
-
Continue
-
Delete
-
exprType[] targets
-
-
Exec
-
Expr
-
exprType value
-
-
For
-
FunctionDef
-
NameTokType name
-
argumentsType args
-
stmtType[] body
-
decoratorsType[] decs
-
exprType returns
-
-
Global
-
NameTokType[] names
-
exprType value
-
-
If
-
Import
-
aliasType[] names
-
-
ImportFrom
-
NameTokType module
-
aliasType[] names
-
int level
-
-
NonLocal
-
NameTokType[] names
-
exprType value
-
-
Pass
-
Print
-
Raise
-
Return
-
exprType value
-
-
TryExcept
-
stmtType[] body
-
excepthandlerType[] handlers
-
suiteType orelse
-
-
TryFinally
-
While
-
With
-
WithItemType[] with_item
-
suiteType body
-
-
suiteType
-
stmtType[] body
-
-
WithItem