mirror of
https://github.com/php-win-ext/phpy.git
synced 2026-03-24 17:02:15 +01:00
283 lines
6.7 KiB
PHP
283 lines
6.7 KiB
PHP
<?php
|
|
namespace python;
|
|
|
|
/**
|
|
|
|
ast
|
|
~~~
|
|
|
|
The `ast` module helps Python applications to process trees of the Python
|
|
abstract syntax grammar. The abstract syntax itself might change with
|
|
each Python release; this module helps to find out programmatically what
|
|
the current grammar looks like and allows modifications of it.
|
|
|
|
An abstract syntax tree can be generated by passing `ast.PyCF_ONLY_AST` as
|
|
a flag to the `compile()` builtin function or by using the `parse()`
|
|
function from this module. The result will be a tree of objects whose
|
|
classes all inherit from `ast.AST`.
|
|
|
|
A modified abstract syntax tree can be compiled into a Python code object
|
|
using the built-in `compile()` function.
|
|
|
|
Additionally various helper functions are provided that make working with
|
|
the trees simpler. The main intention of the helper functions and this
|
|
module in general is to provide an easy to use interface for libraries
|
|
that work tightly with the python syntax (template engines for example).
|
|
|
|
|
|
:copyright: Copyright 2008 by Armin Ronacher.
|
|
:license: Python License.
|
|
*/
|
|
class ast{
|
|
/**
|
|
* @return ast
|
|
*/
|
|
public static function import()
|
|
{
|
|
return \PyCore::import('ast');
|
|
}
|
|
public $PyCF_ALLOW_TOP_LEVEL_AWAIT = 8192;
|
|
public $PyCF_ONLY_AST = 1024;
|
|
public $PyCF_TYPE_COMMENTS = 4096;
|
|
|
|
public $_INFSTR = "1e309";
|
|
public $__name__ = "ast";
|
|
public $__package__ = "";
|
|
|
|
public $AST = null;
|
|
public $Add = null;
|
|
public $And = null;
|
|
public $AnnAssign = null;
|
|
public $Assert = null;
|
|
public $Assign = null;
|
|
public $AsyncFor = null;
|
|
public $AsyncFunctionDef = null;
|
|
public $AsyncWith = null;
|
|
public $Attribute = null;
|
|
public $AugAssign = null;
|
|
public $AugLoad = null;
|
|
public $AugStore = null;
|
|
public $Await = null;
|
|
public $BinOp = null;
|
|
public $BitAnd = null;
|
|
public $BitOr = null;
|
|
public $BitXor = null;
|
|
public $BoolOp = null;
|
|
public $Break = null;
|
|
public $Bytes = null;
|
|
public $Call = null;
|
|
public $ClassDef = null;
|
|
public $Compare = null;
|
|
public $Constant = null;
|
|
public $Continue = null;
|
|
public $Del = null;
|
|
public $Delete = null;
|
|
public $Dict = null;
|
|
public $DictComp = null;
|
|
public $Div = null;
|
|
public $Ellipsis = null;
|
|
public $Eq = null;
|
|
public $ExceptHandler = null;
|
|
public $Expr = null;
|
|
public $Expression = null;
|
|
public $ExtSlice = null;
|
|
public $FloorDiv = null;
|
|
public $For = null;
|
|
public $FormattedValue = null;
|
|
public $FunctionDef = null;
|
|
public $FunctionType = null;
|
|
public $GeneratorExp = null;
|
|
public $Global = null;
|
|
public $Gt = null;
|
|
public $GtE = null;
|
|
public $If = null;
|
|
public $IfExp = null;
|
|
public $Import = null;
|
|
public $ImportFrom = null;
|
|
public $In = null;
|
|
public $Index = null;
|
|
public $IntEnum = null;
|
|
public $Interactive = null;
|
|
public $Invert = null;
|
|
public $Is = null;
|
|
public $IsNot = null;
|
|
public $JoinedStr = null;
|
|
public $LShift = null;
|
|
public $Lambda = null;
|
|
public $List = null;
|
|
public $ListComp = null;
|
|
public $Load = null;
|
|
public $Lt = null;
|
|
public $LtE = null;
|
|
public $MatMult = null;
|
|
public $Match = null;
|
|
public $MatchAs = null;
|
|
public $MatchClass = null;
|
|
public $MatchMapping = null;
|
|
public $MatchOr = null;
|
|
public $MatchSequence = null;
|
|
public $MatchSingleton = null;
|
|
public $MatchStar = null;
|
|
public $MatchValue = null;
|
|
public $Mod = null;
|
|
public $Module = null;
|
|
public $Mult = null;
|
|
public $Name = null;
|
|
public $NameConstant = null;
|
|
public $NamedExpr = null;
|
|
public $NodeTransformer = null;
|
|
public $NodeVisitor = null;
|
|
public $Nonlocal = null;
|
|
public $Not = null;
|
|
public $NotEq = null;
|
|
public $NotIn = null;
|
|
public $Num = null;
|
|
public $Or = null;
|
|
public $Param = null;
|
|
public $Pass = null;
|
|
public $Pow = null;
|
|
public $RShift = null;
|
|
public $Raise = null;
|
|
public $Return = null;
|
|
public $Set = null;
|
|
public $SetComp = null;
|
|
public $Slice = null;
|
|
public $Starred = null;
|
|
public $Store = null;
|
|
public $Str = null;
|
|
public $Sub = null;
|
|
public $Subscript = null;
|
|
public $Suite = null;
|
|
public $Try = null;
|
|
public $TryStar = null;
|
|
public $Tuple = null;
|
|
public $TypeIgnore = null;
|
|
public $UAdd = null;
|
|
public $USub = null;
|
|
public $UnaryOp = null;
|
|
public $While = null;
|
|
public $With = null;
|
|
public $Yield = null;
|
|
public $YieldFrom = null;
|
|
public $_ABC = null;
|
|
public $_ALL_QUOTES = null;
|
|
public $_MULTI_QUOTES = null;
|
|
public $_Precedence = null;
|
|
public $_SINGLE_QUOTES = null;
|
|
public $_Unparser = null;
|
|
public $_const_node_type_names = null;
|
|
public $_const_types = null;
|
|
public $_const_types_not = null;
|
|
public $alias = null;
|
|
public $arg = null;
|
|
public $arguments = null;
|
|
public $auto = null;
|
|
public $boolop = null;
|
|
public $cmpop = null;
|
|
public $comprehension = null;
|
|
public $excepthandler = null;
|
|
public $expr = null;
|
|
public $expr_context = null;
|
|
public $keyword = null;
|
|
public $match_case = null;
|
|
public $mod = null;
|
|
public $nullcontext = null;
|
|
public $operator = null;
|
|
public $pattern = null;
|
|
public $slice = null;
|
|
public $stmt = null;
|
|
public $sys = null;
|
|
public $type_ignore = null;
|
|
public $unaryop = null;
|
|
public $withitem = null;
|
|
|
|
public function _dims_getter($self)
|
|
{
|
|
}
|
|
|
|
public function _dims_setter($self, $value)
|
|
{
|
|
}
|
|
|
|
public function _getter($self)
|
|
{
|
|
}
|
|
|
|
public function _new($cls)
|
|
{
|
|
}
|
|
|
|
public function _pad_whitespace($source)
|
|
{
|
|
}
|
|
|
|
public function _setter($self, $value)
|
|
{
|
|
}
|
|
|
|
public function _simple_enum($etype = [])
|
|
{
|
|
}
|
|
|
|
public function _splitlines_no_ff($source)
|
|
{
|
|
}
|
|
|
|
public function contextmanager($func)
|
|
{
|
|
}
|
|
|
|
public function copy_location($new_node, $old_node)
|
|
{
|
|
}
|
|
|
|
public function dump($node, $annotate_fields = true, $include_attributes = false)
|
|
{
|
|
}
|
|
|
|
public function fix_missing_locations($node)
|
|
{
|
|
}
|
|
|
|
public function get_docstring($node, $clean = true)
|
|
{
|
|
}
|
|
|
|
public function get_source_segment($source, $node)
|
|
{
|
|
}
|
|
|
|
public function increment_lineno($node, $n = 1)
|
|
{
|
|
}
|
|
|
|
public function iter_child_nodes($node)
|
|
{
|
|
}
|
|
|
|
public function iter_fields($node)
|
|
{
|
|
}
|
|
|
|
public function literal_eval($node_or_string)
|
|
{
|
|
}
|
|
|
|
public function main()
|
|
{
|
|
}
|
|
|
|
public function parse($source, $filename = "<unknown>", $mode = "exec")
|
|
{
|
|
}
|
|
|
|
public function unparse($ast_obj)
|
|
{
|
|
}
|
|
|
|
public function walk($node)
|
|
{
|
|
}
|
|
|
|
}
|