Qucs-S S-parameter Viewer & RF Synthesis Tools
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | Static Public Attributes | List of all members
jinja2.nodes.Node Class Reference
Inheritance diagram for jinja2.nodes.Node:
Inheritance graph
[legend]
Collaboration diagram for jinja2.nodes.Node:
Collaboration graph
[legend]

Public Member Functions

None __init__ (self, *t.Any fields, **t.Any attributes)
 
t.Iterator[t.Tuple[str, t.Any]] iter_fields (self, t.Optional[t.Container[str]] exclude=None, t.Optional[t.Container[str]] only=None)
 
t.Iterator["Node"] iter_child_nodes (self, t.Optional[t.Container[str]] exclude=None, t.Optional[t.Container[str]] only=None)
 
t.Optional[_NodeBound] find (self, t.Type[_NodeBound] node_type)
 
t.Iterator[_NodeBound] find_all (self, t.Union[t.Type[_NodeBound], t.Tuple[t.Type[_NodeBound],...]] node_type)
 
"Node" set_ctx (self, str ctx)
 
"Node" set_lineno (self, int lineno, bool override=False)
 
"Node" set_environment (self, "Environment" environment)
 
bool __eq__ (self, t.Any other)
 
str __repr__ (self)
 
str dump (self)
 
- Public Member Functions inherited from jinja2.nodes.NodeType
 __new__ (mcs, name, bases, d)
 

Public Attributes

 fields
 

Static Public Attributes

tuple fields = ()
 
tuple attributes = ("lineno", "environment")
 
bool abstract = True
 
int lineno
 
environment .Optional["Environment"]
 

Detailed Description

Baseclass for all Jinja nodes.  There are a number of nodes available
of different types.  There are four major types:

-   :class:`Stmt`: statements
-   :class:`Expr`: expressions
-   :class:`Helper`: helper nodes
-   :class:`Template`: the outermost wrapper node

All nodes have fields and attributes.  Fields may be other nodes, lists,
or arbitrary values.  Fields are passed to the constructor as regular
positional arguments, attributes as keyword arguments.  Each node has
two attributes: `lineno` (the line number of the node) and `environment`.
The `environment` attribute is set at the end of the parsing process for
all nodes automatically.

Member Function Documentation

◆ find()

t.Optional[_NodeBound] jinja2.nodes.Node.find (   self,
t.Type[_NodeBound]  node_type 
)
Find the first node of a given type.  If no such node exists the
return value is `None`.

◆ find_all()

t.Iterator[_NodeBound] jinja2.nodes.Node.find_all (   self,
t.Union[t.Type[_NodeBound], t.Tuple[t.Type[_NodeBound], ...]]   node_type 
)
Find all the nodes of a given type.  If the type is a tuple,
the check is performed for any of the tuple items.

◆ iter_child_nodes()

t.Iterator["Node"] jinja2.nodes.Node.iter_child_nodes (   self,
t.Optional[t.Container[str]]   exclude = None,
t.Optional[t.Container[str]]   only = None 
)
Iterates over all direct child nodes of the node.  This iterates
over all fields and yields the values of they are nodes.  If the value
of a field is a list all the nodes in that list are returned.

◆ iter_fields()

t.Iterator[t.Tuple[str, t.Any]] jinja2.nodes.Node.iter_fields (   self,
t.Optional[t.Container[str]]   exclude = None,
t.Optional[t.Container[str]]   only = None 
)
This method iterates over all fields that are defined and yields
``(key, value)`` tuples.  Per default all fields are returned, but
it's possible to limit that to some fields by providing the `only`
parameter or to exclude some using the `exclude` parameter.  Both
should be sets or tuples of field names.

◆ set_ctx()

"Node" jinja2.nodes.Node.set_ctx (   self,
str  ctx 
)
Reset the context of a node and all child nodes.  Per default the
parser will all generate nodes that have a 'load' context as it's the
most common one.  This method is used in the parser to set assignment
targets and other nodes to a store context.

◆ set_environment()

"Node" jinja2.nodes.Node.set_environment (   self,
"Environment"  environment 
)
Set the environment for all nodes.

◆ set_lineno()

"Node" jinja2.nodes.Node.set_lineno (   self,
int  lineno,
bool   override = False 
)
Set the line numbers of the node and children.

The documentation for this class was generated from the following file: