as2fm.as2fm_common.ecmascript_interpretation

Module for interpreting ecmascript.

Functions

ast_expression_to_string(ast_node)

Generate a string starting from an AST node

get_array_expr_as_list(expr[, elem])

Reads a string as an EcmaScript expression and returns it as an ArrayExpression.

get_object_expression_as_dict(expr[, elem])

Reads a string as an EcmaScript expression and returns it as a Dict of ast expressions.

has_array_access(expr, elem)

Evaluate if an ECMAscript expression contains access to an array element.

has_member_access(expr, elem)

Evaluate if an ECMAscript expression contains access to an member element.

has_operators(expr, elem)

Evaluate if an ECMAscript expression contains unary, binary, logical or function operators.

is_literal(expr, elem)

Evaluate if the expression contains only a literal (or an array expression).

make_ast_array_expression(in_array)

Helper function to generate an empty array expression.

parse_ecmascript_expr_to_type(expr, variables)

Interpret a string of ecmacript expression and get the type that is evaluates to.

parse_expression_to_ast(expression, elem)

Parse the string using esprima.

split_by_access(expr, elem)

Expand a Member expression into a list, distinguishing between member and array accesses.

Classes

ArrayAccess()

Placeholder type for ArrayAccess operator call in expanded Member expression.

Exceptions

MemberAccessCheckException

Exception type thrown when there are error expanding a Member expression.