Utility methods related with the creation of new join points.

Constructors

Methods

  • Creates an array access from the given base that represents an array, and several subscripts.

    Must provide at least one subscript, base expression must be of type array, and have a defined number of dimensions. The number of subscripts must be lower or equal than the number of dimensions of the array type.

    Parameters

    Returns ArrayAccess

  • Creates a new join point 'binaryOp'.

    Parameters

    • op: string

      The binary operator kind.

    • $left: string | Expression

      The left hand of the binary operator. If a string, it is converted to a literal expression.

    • $right: string | Expression

      The right hand of the binary operator. If a string, it is converted to a literal expression.

    • $type: string | Type = "int"

      The return type of the operator. If a string, it is converted to a literal type.

    Returns BinaryOp

  • Internal

    Parameters

    • jp1: any
    • jp2: any

    Returns boolean

    True, if the two AST nodes are equal (internal representation. Not actual Joinpoint types), in the sense that the underlying AST nodes are also equal, according to their .equals() method (might return true for different AST nodes).

    Internal representations of join points should not be exposed to the public API.

  • Creates a new join point 'file'.

    Parameters

    • filename: string | File

      Name of the source file. If filename represents a path to an already existing file, literally adds the contents of the file to the join point.

    • path: string = ""

      The path of the new file, relative to the output folder. Absolute paths are not allowed. This path will be required when including the file (e.g., #include "/")

    Returns FileJp

  • Parameters

    • filename: string

      Name of the source file.

    • source: string

      The contents of the source file.

    • path: string = ""

      The path of the new file, relative to the output folder. Absolute paths are not allowed. This path will be required when including the file (e.g., #include "/")

    Returns FileJp

  • Creates a new 'for' statement join point.

    Parameters

    • Optional$init: string | Statement

      The initialization of the for statement. If a string, it is converted to a literal expression.

    • Optional$condition: string | Statement

      The condition of the for statement. If a string, it is converted to a literal expression.

    • Optional$inc: string | Statement

      The increment of the for statement. If a string, it is converted to a literal expression.

    • Optional$body: string | Statement

      The body of the for statement.

    Returns Loop

  • Tries to convert the given source into a join point, or throws an exception if it is not possible.

    If source is a string:

    • If it can be converted to a builtinType, returns a builtinType;
    • Otherwise, returns a typeLiteral;

    If source is a join point:

    • If is a $type, returns itself;
    • If the property .type is not undefined, returns .type;
    • Otherwise, throws an exception;

    Parameters

    Returns Type | BuiltinType

    A join point representing a type.

  • Creates a new join point 'unaryOp'.

    Parameters

    • op: string

      The unary operator kind.

    • $expr: Expression

      The sub-expression of the unary operator. If a string, it is converted to a literal expression.

    • Optional$type: string | Type

      The return type of the operator. If undefined, tries to infer the correct type based on the type of the $expr (inference might not be implemented for all operators).

    Returns UnaryOp

  • Creates a new join point 'unaryOp'.

    Parameters

    • op: string

      The unary operator kind.

    • $expr: string

      The sub-expression of the unary operator. If a string, it is converted to a literal expression.

    • $type: string | Type

      The return type of the operator that will be converted to a literal type.

    Returns UnaryOp

MMNEPVFCICPMFPCPTTAAATR