![]() |
Qucs-S S-parameter Viewer & RF Synthesis Tools
|

Public Member Functions | |
| None | __init__ (self, "Environment" environment, str source, t.Optional[str] name=None, t.Optional[str] filename=None, t.Optional[str] state=None) |
| "te.NoReturn" | fail (self, str msg, t.Optional[int] lineno=None, t.Type[TemplateSyntaxError] exc=TemplateSyntaxError) |
| "te.NoReturn" | fail_unknown_tag (self, str name, t.Optional[int] lineno=None) |
| "te.NoReturn" | fail_eof (self, t.Optional[t.Tuple[str,...]] end_tokens=None, t.Optional[int] lineno=None) |
| bool | is_tuple_end (self, t.Optional[t.Tuple[str,...]] extra_end_rules=None) |
| nodes.InternalName | free_identifier (self, t.Optional[int] lineno=None) |
| t.Union[nodes.Node, t.List[nodes.Node]] | parse_statement (self) |
| t.List[nodes.Node] | parse_statements (self, t.Tuple[str,...] end_tokens, bool drop_needle=False) |
| t.Union[nodes.Assign, nodes.AssignBlock] | parse_set (self) |
| nodes.For | parse_for (self) |
| nodes.If | parse_if (self) |
| nodes.With | parse_with (self) |
| nodes.Scope | parse_autoescape (self) |
| nodes.Block | parse_block (self) |
| nodes.Extends | parse_extends (self) |
| _ImportInclude | parse_import_context (self, _ImportInclude node, bool default) |
| nodes.Include | parse_include (self) |
| nodes.Import | parse_import (self) |
| nodes.FromImport | parse_from (self) |
| None | parse_signature (self, _MacroCall node) |
| nodes.CallBlock | parse_call_block (self) |
| nodes.FilterBlock | parse_filter_block (self) |
| nodes.Macro | parse_macro (self) |
| nodes.Output | parse_print (self) |
| nodes.Name | parse_assign_target (self, bool with_tuple=..., "te.Literal[True]" name_only=...) |
| t.Union[nodes.NSRef, nodes.Name, nodes.Tuple] | parse_assign_target (self, bool with_tuple=True, bool name_only=False, t.Optional[t.Tuple[str,...]] extra_end_rules=None, bool with_namespace=False) |
| t.Union[nodes.NSRef, nodes.Name, nodes.Tuple] | parse_assign_target (self, bool with_tuple=True, bool name_only=False, t.Optional[t.Tuple[str,...]] extra_end_rules=None, bool with_namespace=False) |
| nodes.Expr | parse_expression (self, bool with_condexpr=True) |
| nodes.Expr | parse_condexpr (self) |
| nodes.Expr | parse_or (self) |
| nodes.Expr | parse_and (self) |
| nodes.Expr | parse_not (self) |
| nodes.Expr | parse_compare (self) |
| nodes.Expr | parse_math1 (self) |
| nodes.Expr | parse_concat (self) |
| nodes.Expr | parse_math2 (self) |
| nodes.Expr | parse_pow (self) |
| nodes.Expr | parse_unary (self, bool with_filter=True) |
| nodes.Expr | parse_primary (self, bool with_namespace=False) |
| t.Union[nodes.Tuple, nodes.Expr] | parse_tuple (self, bool simplified=False, bool with_condexpr=True, t.Optional[t.Tuple[str,...]] extra_end_rules=None, bool explicit_parentheses=False, bool with_namespace=False) |
| nodes.List | parse_list (self) |
| nodes.Dict | parse_dict (self) |
| nodes.Expr | parse_postfix (self, nodes.Expr node) |
| nodes.Expr | parse_filter_expr (self, nodes.Expr node) |
| t.Union[nodes.Getattr, nodes.Getitem] | parse_subscript (self, nodes.Expr node) |
| nodes.Expr | parse_subscribed (self) |
| t.Tuple[ t.List[nodes.Expr], t.List[nodes.Keyword], t.Optional[nodes.Expr], t.Optional[nodes.Expr],] | parse_call_args (self) |
| nodes.Call | parse_call (self, nodes.Expr node) |
| t.Optional[nodes.Expr] | parse_filter (self, t.Optional[nodes.Expr] node, bool start_inline=False) |
| nodes.Expr | parse_test (self, nodes.Expr node) |
| t.List[nodes.Node] | subparse (self, t.Optional[t.Tuple[str,...]] end_tokens=None) |
| nodes.Template | parse (self) |
Public Attributes | |
| environment | |
| stream | |
| name | |
| filename | |
| closed | |
Protected Member Functions | |
| "te.NoReturn" | _fail_ut_eof (self, t.Optional[str] name, t.List[t.Tuple[str,...]] end_token_stack, t.Optional[int] lineno) |
Protected Attributes | |
| _last_identifier | |
| _end_token_stack | |
This is the central parsing class Jinja uses. It's passed to extensions and can be used to parse expressions or statements.
| "te.NoReturn" jinja2.parser.Parser.fail | ( | self, | |
| str | msg, | ||
| t.Optional[int] | lineno = None, |
||
| t.Type[TemplateSyntaxError] | exc = TemplateSyntaxError |
||
| ) |
Convenience method that raises `exc` with the message, passed line number or last line number as well as the current name and filename.
| "te.NoReturn" jinja2.parser.Parser.fail_eof | ( | self, | |
| t.Optional[t.Tuple[str, ...]] | end_tokens = None, |
||
| t.Optional[int] | lineno = None |
||
| ) |
Like fail_unknown_tag but for end of template situations.
| "te.NoReturn" jinja2.parser.Parser.fail_unknown_tag | ( | self, | |
| str | name, | ||
| t.Optional[int] | lineno = None |
||
| ) |
Called if the parser encounters an unknown tag. Tries to fail with a human readable error message that could help to identify the problem.
| nodes.InternalName jinja2.parser.Parser.free_identifier | ( | self, | |
| t.Optional[int] | lineno = None |
||
| ) |
Return a new free identifier as :class:`~jinja2.nodes.InternalName`.
| bool jinja2.parser.Parser.is_tuple_end | ( | self, | |
| t.Optional[t.Tuple[str, ...]] | extra_end_rules = None |
||
| ) |
Are we at the end of a tuple?
| nodes.Template jinja2.parser.Parser.parse | ( | self | ) |
Parse the whole template into a `Template` node.
| t.Union[nodes.NSRef, nodes.Name, nodes.Tuple] jinja2.parser.Parser.parse_assign_target | ( | self, | |
| bool | with_tuple = True, |
||
| bool | name_only = False, |
||
| t.Optional[t.Tuple[str, ...]] | extra_end_rules = None, |
||
| bool | with_namespace = False |
||
| ) |
Parse an assignment target. As Jinja allows assignments to tuples, this function can parse all allowed assignment targets. Per default assignments to tuples are parsed, that can be disable however by setting `with_tuple` to `False`. If only assignments to names are wanted `name_only` can be set to `True`. The `extra_end_rules` parameter is forwarded to the tuple parsing function. If `with_namespace` is enabled, a namespace assignment may be parsed.
| nodes.Expr jinja2.parser.Parser.parse_expression | ( | self, | |
| bool | with_condexpr = True |
||
| ) |
Parse an expression. Per default all expressions are parsed, if the optional `with_condexpr` parameter is set to `False` conditional expressions are not parsed.
| nodes.For jinja2.parser.Parser.parse_for | ( | self | ) |
Parse a for loop.
| nodes.If jinja2.parser.Parser.parse_if | ( | self | ) |
Parse an if construct.
| nodes.Expr jinja2.parser.Parser.parse_primary | ( | self, | |
| bool | with_namespace = False |
||
| ) |
Parse a name or literal value. If ``with_namespace`` is enabled, also parse namespace attr refs, for use in assignments.
| t.Union[nodes.Assign, nodes.AssignBlock] jinja2.parser.Parser.parse_set | ( | self | ) |
Parse an assign statement.
| t.Union[nodes.Node, t.List[nodes.Node]] jinja2.parser.Parser.parse_statement | ( | self | ) |
Parse a single statement.
| t.List[nodes.Node] jinja2.parser.Parser.parse_statements | ( | self, | |
| t.Tuple[str, ...] | end_tokens, | ||
| bool | drop_needle = False |
||
| ) |
Parse multiple statements into a list until one of the end tokens is reached. This is used to parse the body of statements as it also parses template data if appropriate. The parser checks first if the current token is a colon and skips it if there is one. Then it checks for the block end and parses until if one of the `end_tokens` is reached. Per default the active token in the stream at the end of the call is the matched end token. If this is not wanted `drop_needle` can be set to `True` and the end token is removed.
| t.Union[nodes.Tuple, nodes.Expr] jinja2.parser.Parser.parse_tuple | ( | self, | |
| bool | simplified = False, |
||
| bool | with_condexpr = True, |
||
| t.Optional[t.Tuple[str, ...]] | extra_end_rules = None, |
||
| bool | explicit_parentheses = False, |
||
| bool | with_namespace = False |
||
| ) |
Works like `parse_expression` but if multiple expressions are delimited by a comma a :class:`~jinja2.nodes.Tuple` node is created. This method could also return a regular expression instead of a tuple if no commas where found. The default parsing mode is a full tuple. If `simplified` is `True` only names and literals are parsed; ``with_namespace`` allows namespace attr refs as well. The `no_condexpr` parameter is forwarded to :meth:`parse_expression`. Because tuples do not require delimiters and may end in a bogus comma an extra hint is needed that marks the end of a tuple. For example for loops support tuples between `for` and `in`. In that case the `extra_end_rules` is set to ``['name:in']``. `explicit_parentheses` is true if the parsing was triggered by an expression in parentheses. This is used to figure out if an empty tuple is a valid expression or not.