Peano
Loading...
Searching...
No Matches
exahype2.api.dslhype2.Parser.Parser Class Reference

Public Member Functions

AST.Expression|AST.FunctionCall parse_call (self, ast.Call call)
AST.ElementUnaryOperation|AST.DataBlockUnaryOperation|AST.Element parse_unary_operation (self, ast.UnaryOp operation)
AST.ElementBinaryOperation|AST.DataBlockBinaryOperation|AST.Element parse_binary_operation (self, ast.BinOp operation)
list[AST.Element|AST.Variable] parse_slice (self, ast.Slice slice, Sequence[AST.Element|AST.Variable] original_iteration_range)
AST.DataBlockSlice parse_subscript (self, ast.Subscript subscript)
list[AST.Statement] parse_data_block_construction (self, AST.Variable lhs, AST.DataBlock rhs)
AST.Function parse (self, function, str|None function_id=None, list[str] function_namespace=[], list[AST.Argument] function_arguments=[], dict[AST.Name, AST.TFunction] function_map={}, list[PDETerm] enabled_pde_terms=[], dict[AST.Argument, int|float] external_variables={}, bool stateless=False)

Data Fields

dict struct_map
 function_map
 enabled_pde_terms
int line_number = self.line_number + 1
 external_variables = external_variables
 stateless = stateless

Protected Member Functions

AST.External _parse_string (self, str string)
AST.Element|AST.External _parse_constant (self, ast.Constant constant)
AST.Variable _parse_variable (self, ast.Name name)
AST.DataBlock _parse_data_block_constructor (self, ast.Call constructor)
AST.FunctionCall _parse_evaluation (self, ast.Call call)
AST.AssignableExpression _parse_assignable_expression (self, ast.expr expression)
AST.Expression _parse_expression (self, ast.expr expression)
list[AST.Statement] _parse_construction (self, ast.Assign assignment)
list[AST.Statement] _parse_assignment_without_construction (self, ast.Assign assignment)
list[AST.Statement] _parse_assignment (self, ast.Assign assignment)
list[AST.Statement] _parse_if (self, ast.If if_statement)
list[AST.Statement] _parse_statement (self, ast.stmt statement)
AST.Function _parse_function (self, ast.FunctionDef function, str|None function_id, list[str] function_namespace, list[AST.Argument] function_arguments, bool stateless)

Detailed Description

Definition at line 6 of file Parser.py.

Member Function Documentation

◆ _parse_assignable_expression()

AST.AssignableExpression exahype2.api.dslhype2.Parser.Parser._parse_assignable_expression ( self,
ast.expr expression )
protected

Definition at line 199 of file Parser.py.

References _parse_variable(), and parse_subscript().

Referenced by _parse_assignment_without_construction(), and _parse_construction().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ _parse_assignment()

list[AST.Statement] exahype2.api.dslhype2.Parser.Parser._parse_assignment ( self,
ast.Assign assignment )
protected

Definition at line 265 of file Parser.py.

References _parse_assignment_without_construction(), _parse_construction(), exahype2.api.dslhype.Parser.Parser._parse_expression(), and _parse_expression().

Referenced by _parse_statement().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ _parse_assignment_without_construction()

list[AST.Statement] exahype2.api.dslhype2.Parser.Parser._parse_assignment_without_construction ( self,
ast.Assign assignment )
protected

Definition at line 251 of file Parser.py.

References _parse_assignable_expression(), exahype2.api.dslhype.Parser.Parser._parse_expression(), and _parse_expression().

Referenced by _parse_assignment().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ _parse_constant()

AST.Element | AST.External exahype2.api.dslhype2.Parser.Parser._parse_constant ( self,
ast.Constant constant )
protected

Definition at line 21 of file Parser.py.

References _parse_string().

Referenced by _parse_expression().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ _parse_construction()

list[AST.Statement] exahype2.api.dslhype2.Parser.Parser._parse_construction ( self,
ast.Assign assignment )
protected

Definition at line 242 of file Parser.py.

References _parse_assignable_expression(), exahype2.api.dslhype.Parser.Parser._parse_expression(), _parse_expression(), assert, and parse_data_block_construction().

Referenced by _parse_assignment().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ _parse_data_block_constructor()

AST.DataBlock exahype2.api.dslhype2.Parser.Parser._parse_data_block_constructor ( self,
ast.Call constructor )
protected

Definition at line 33 of file Parser.py.

References exahype2.api.dslhype.Parser.Parser._parse_expression(), _parse_expression(), and assert.

Referenced by parse_call().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ _parse_evaluation()

AST.FunctionCall exahype2.api.dslhype2.Parser.Parser._parse_evaluation ( self,
ast.Call call )
protected

Definition at line 67 of file Parser.py.

References exahype2.api.dslhype.Parser.Parser._parse_expression(), _parse_expression(), and assert.

Referenced by parse_call().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ _parse_expression()

AST.Expression exahype2.api.dslhype2.Parser.Parser._parse_expression ( self,
ast.expr expression )
protected

◆ _parse_function()

AST.Function exahype2.api.dslhype2.Parser.Parser._parse_function ( self,
ast.FunctionDef function,
str|None function_id,
list[str] function_namespace,
list[AST.Argument] function_arguments,
bool stateless )
protected

◆ _parse_if()

list[AST.Statement] exahype2.api.dslhype2.Parser.Parser._parse_if ( self,
ast.If if_statement )
protected

Definition at line 275 of file Parser.py.

References assert.

Referenced by _parse_statement().

Here is the caller graph for this function:

◆ _parse_statement()

list[AST.Statement] exahype2.api.dslhype2.Parser.Parser._parse_statement ( self,
ast.stmt statement )
protected

Definition at line 290 of file Parser.py.

References exahype2.api.dslhype.Parser.Parser._parse_assignment(), _parse_assignment(), exahype2.api.dslhype.Parser.Parser._parse_if(), and _parse_if().

Referenced by _parse_function().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ _parse_string()

AST.External exahype2.api.dslhype2.Parser.Parser._parse_string ( self,
str string )
protected

Definition at line 7 of file Parser.py.

Referenced by _parse_constant(), and parse_call().

Here is the caller graph for this function:

◆ _parse_variable()

AST.Variable exahype2.api.dslhype2.Parser.Parser._parse_variable ( self,
ast.Name name )
protected

Definition at line 30 of file Parser.py.

Referenced by _parse_assignable_expression(), and _parse_expression().

Here is the caller graph for this function:

◆ parse()

AST.Function exahype2.api.dslhype2.Parser.Parser.parse ( self,
function,
str|None function_id = None,
list[str] function_namespace = [],
list[AST.Argument] function_arguments = [],
dict[AST.Name, AST.TFunction] function_map = {},
list[PDETerm] enabled_pde_terms = [],
dict[AST.Argument,int|float] external_variables = {},
bool stateless = False )

◆ parse_binary_operation()

AST.ElementBinaryOperation | AST.DataBlockBinaryOperation | AST.Element exahype2.api.dslhype2.Parser.Parser.parse_binary_operation ( self,
ast.BinOp operation )

Definition at line 125 of file Parser.py.

References exahype2.api.dslhype.Parser.Parser._parse_expression(), _parse_expression(), and assert.

Referenced by _parse_expression().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ parse_call()

AST.Expression | AST.FunctionCall exahype2.api.dslhype2.Parser.Parser.parse_call ( self,
ast.Call call )

Definition at line 76 of file Parser.py.

References _parse_data_block_constructor(), _parse_evaluation(), exahype2.api.dslhype.Parser.Parser._parse_expression(), _parse_expression(), _parse_string(), and assert.

Referenced by _parse_expression().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ parse_data_block_construction()

list[AST.Statement] exahype2.api.dslhype2.Parser.Parser.parse_data_block_construction ( self,
AST.Variable lhs,
AST.DataBlock rhs )

Definition at line 231 of file Parser.py.

Referenced by _parse_construction().

Here is the caller graph for this function:

◆ parse_slice()

list[AST.Element | AST.Variable] exahype2.api.dslhype2.Parser.Parser.parse_slice ( self,
ast.Slice slice,
Sequence[AST.Element | AST.Variable] original_iteration_range )

Definition at line 161 of file Parser.py.

References exahype2.api.dslhype.Parser.Parser._parse_expression(), _parse_expression(), and assert.

Referenced by parse_subscript().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ parse_subscript()

AST.DataBlockSlice exahype2.api.dslhype2.Parser.Parser.parse_subscript ( self,
ast.Subscript subscript )

Definition at line 178 of file Parser.py.

References exahype2.api.dslhype.Parser.Parser._parse_expression(), _parse_expression(), assert, and parse_slice().

Referenced by _parse_assignable_expression(), and _parse_expression().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ parse_unary_operation()

AST.ElementUnaryOperation | AST.DataBlockUnaryOperation | AST.Element exahype2.api.dslhype2.Parser.Parser.parse_unary_operation ( self,
ast.UnaryOp operation )

Definition at line 113 of file Parser.py.

References exahype2.api.dslhype.Parser.Parser._parse_expression(), _parse_expression(), and assert.

Referenced by _parse_expression().

Here is the call graph for this function:
Here is the caller graph for this function:

Field Documentation

◆ enabled_pde_terms

exahype2.api.dslhype2.Parser.Parser.enabled_pde_terms

Definition at line 280 of file Parser.py.

Referenced by parse().

◆ external_variables

exahype2.api.dslhype2.Parser.Parser.external_variables = external_variables

Definition at line 328 of file Parser.py.

Referenced by _parse_expression().

◆ function_map

exahype2.api.dslhype2.Parser.Parser.function_map

Definition at line 71 of file Parser.py.

Referenced by _parse_function().

◆ line_number

int exahype2.api.dslhype2.Parser.Parser.line_number = self.line_number + 1

Definition at line 317 of file Parser.py.

Referenced by parse().

◆ stateless

exahype2.api.dslhype2.Parser.Parser.stateless = stateless

Definition at line 330 of file Parser.py.

◆ struct_map

dict exahype2.api.dslhype2.Parser.Parser.struct_map

Definition at line 13 of file Parser.py.

Referenced by MLIRPrinter.MLIRPrinter.print_function_definition().


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