UNPKG

@specs-feup/metafor

Version:

A Fortran source-to-source compiler written in Typescript

501 lines 13.6 kB
/////////////////////////////////////////////////// // This file is generated by build-interfaces.js // /////////////////////////////////////////////////// import { LaraJoinPoint, registerJoinpointMapper, wrapJoinPoint, unwrapJoinPoint, } from "@specs-feup/lara/api/LaraJoinPoint.js"; export class Joinpoint extends LaraJoinPoint { /** * @internal */ static _defaultAttributeInfo = { name: null, }; /** * Returns an array with the children of the node */ get children() { return wrapJoinPoint(this._javaObject.getChildren()); } /** * String with the code represented by this node */ get code() { return wrapJoinPoint(this._javaObject.getCode()); } /** * Returns an array with the descendants of the node */ get descendants() { return wrapJoinPoint(this._javaObject.getDescendants()); } /** * Returns the index of this join point in relation to its parent */ get indexOfSelf() { return wrapJoinPoint(this._javaObject.getIndexOfSelf()); } /** * Returns the node that came before this node, or undefined if there is none */ get leftJp() { return wrapJoinPoint(this._javaObject.getLeftJp()); } /** * Returns the parent node in the AST, or undefined if it is the root node */ get parent() { return wrapJoinPoint(this._javaObject.getParent()); } /** * Returns the node that comes after this node, or undefined if there is none */ get rightJp() { return wrapJoinPoint(this._javaObject.getRightJp()); } /** * Returns the 'program' join point */ get root() { return wrapJoinPoint(this._javaObject.getRoot()); } /** * The nodes of the scope of the current join point. If this node has a body (e.g., loop, function) corresponds to the children of the body. Otherwise, returns an empty array */ get scopeNodes() { return wrapJoinPoint(this._javaObject.getScopeNodes()); } /** * True if the given node is a descendant of this node */ contains(jp) { return wrapJoinPoint(this._javaObject.contains(unwrapJoinPoint(jp))); } /** * Looks for an ancestor joinpoint name, walking back on the AST */ getAncestor(type) { return wrapJoinPoint(this._javaObject.getAncestor(unwrapJoinPoint(type))); } /** * Removes node associated to the joinpoint from the AST */ detach() { return wrapJoinPoint(this._javaObject.detach()); } /** * Replaces this node with the given node */ replaceWith(node) { return wrapJoinPoint(this._javaObject.replaceWith(unwrapJoinPoint(node))); } } /** * Represents an expression */ export class Expr extends Joinpoint { /** * @internal */ static _defaultAttributeInfo = { name: null, }; } /** * Represents a source file (e.g., .f90) */ export class FileJp extends Joinpoint { /** * @internal */ static _defaultAttributeInfo = { name: "name", }; /** * The name of the folder */ get foldername() { return wrapJoinPoint(this._javaObject.getFoldername()); } /** * The name of the file */ get name() { return wrapJoinPoint(this._javaObject.getName()); } } /** * Represents a literal */ export class Literal extends Expr { /** * @internal */ static _defaultAttributeInfo = { name: null, }; get literal() { return wrapJoinPoint(this._javaObject.getLiteral()); } } /** * Represents the loop control structure, with specialized subclasses for different loop kinds */ export class LoopControl extends Joinpoint { /** * @internal */ static _defaultAttributeInfo = { name: null, }; } /** * Represents a name/value pair in a compiler directive */ export class NameValue extends Joinpoint { /** * @internal */ static _defaultAttributeInfo = { name: null, }; get name() { return wrapJoinPoint(this._javaObject.getName()); } } /** * Represents an OpenMP clause */ export class OmpClause extends Joinpoint { /** * @internal */ static _defaultAttributeInfo = { name: null, }; } /** * Represents an OpenMP datasharing clause (public, private, ...) */ export class OmpDataSharingClause extends OmpClause { /** * @internal */ static _defaultAttributeInfo = { name: null, }; } export class OmpOrderedClause extends OmpClause { /** * @internal */ static _defaultAttributeInfo = { name: null, }; } export class OmpReductionClause extends OmpClause { /** * @internal */ static _defaultAttributeInfo = { name: null, }; } /** * Represents the complete program and is the top-most join point in the hierarchy */ export class Program extends Joinpoint { /** * @internal */ static _defaultAttributeInfo = { name: null, }; } export class ProgramUnit extends Joinpoint { /** * @internal */ static _defaultAttributeInfo = { name: null, }; /** * Returns the unit's specification part */ get specification() { return wrapJoinPoint(this._javaObject.getSpecification()); } } export class RangeLoopControl extends LoopControl { /** * @internal */ static _defaultAttributeInfo = { name: null, }; get lower() { return wrapJoinPoint(this._javaObject.getLower()); } get upper() { return wrapJoinPoint(this._javaObject.getUpper()); } get var() { return wrapJoinPoint(this._javaObject.getVar()); } } export class RealLiteral extends Literal { /** * @internal */ static _defaultAttributeInfo = { name: null, }; } /** * Represents a Fortran statement */ export class Statement extends Joinpoint { /** * @internal */ static _defaultAttributeInfo = { name: null, }; get isFirst() { return wrapJoinPoint(this._javaObject.getIsFirst()); } get isLast() { return wrapJoinPoint(this._javaObject.getIsLast()); } } export class StatementBlock extends Joinpoint { /** * @internal */ static _defaultAttributeInfo = { name: null, }; get stmts() { return wrapJoinPoint(this._javaObject.getStmts()); } } export class StringLiteral extends Literal { /** * @internal */ static _defaultAttributeInfo = { name: null, }; } export class Subroutine extends ProgramUnit { /** * @internal */ static _defaultAttributeInfo = { name: null, }; } export class UseStatement extends Statement { /** * @internal */ static _defaultAttributeInfo = { name: null, }; get moduleName() { return wrapJoinPoint(this._javaObject.getModuleName()); } } /** * Represents a binary operation */ export class BinaryOperator extends Expr { /** * @internal */ static _defaultAttributeInfo = { name: null, }; get kind() { return wrapJoinPoint(this._javaObject.getKind()); } get left() { return wrapJoinPoint(this._javaObject.getLeft()); } set left(value) { this._javaObject.setLeft(unwrapJoinPoint(value)); } get right() { return wrapJoinPoint(this._javaObject.getRight()); } set right(value) { this._javaObject.setRight(unwrapJoinPoint(value)); } /** * Sets the left-hand side of the operation */ setLeft(lhs) { return wrapJoinPoint(this._javaObject.setLeft(unwrapJoinPoint(lhs))); } /** * Sets the right-hand side of the operation */ setRight(rhs) { return wrapJoinPoint(this._javaObject.setRight(unwrapJoinPoint(rhs))); } } /** * Represents a designator */ export class Designator extends Expr { /** * @internal */ static _defaultAttributeInfo = { name: null, }; } /** * Represents an executable statement */ export class ExecutableStatement extends Statement { /** * @internal */ static _defaultAttributeInfo = { name: null, }; } export class Execution extends StatementBlock { /** * @internal */ static _defaultAttributeInfo = { name: null, }; get executableStmts() { return wrapJoinPoint(this._javaObject.getExecutableStmts()); } insertBegin(stmt) { return wrapJoinPoint(this._javaObject.insertBegin(unwrapJoinPoint(stmt))); } insertEnd(stmt) { return wrapJoinPoint(this._javaObject.insertEnd(unwrapJoinPoint(stmt))); } } export class IntLiteral extends Literal { /** * @internal */ static _defaultAttributeInfo = { name: null, }; } export class MainProgram extends ProgramUnit { /** * @internal */ static _defaultAttributeInfo = { name: null, }; } /** * Represents a generic OpenMP construct */ export class OmpConstruct extends ExecutableStatement { /** * @internal */ static _defaultAttributeInfo = { name: null, }; get clauses() { return wrapJoinPoint(this._javaObject.getClauses()); } set clauses(value) { this._javaObject.setClauses(unwrapJoinPoint(value)); } /** * Sets the construct's clauses */ setClauses(clauses) { return wrapJoinPoint(this._javaObject.setClauses(unwrapJoinPoint(clauses))); } setDirective(directive) { return wrapJoinPoint(this._javaObject.setDirective(unwrapJoinPoint(directive))); } } /** * Represents an OpenMP loop construct (such as do or do parallel) */ export class OmpLoopConstruct extends OmpConstruct { /** * @internal */ static _defaultAttributeInfo = { name: null, }; setLoop(loop) { return wrapJoinPoint(this._javaObject.setLoop(unwrapJoinPoint(loop))); } } export class Specification extends StatementBlock { /** * @internal */ static _defaultAttributeInfo = { name: null, }; /** * Adds a UseStmt to a specification part. The statement is inserted at the beginning. */ addUseStmt(stmt) { return wrapJoinPoint(this._javaObject.addUseStmt(unwrapJoinPoint(stmt))); } } /** * Represents an action statement */ export class ActionStatement extends ExecutableStatement { /** * @internal */ static _defaultAttributeInfo = { name: null, }; } /** * Represents an assignment statement */ export class AssignmentStatement extends ActionStatement { /** * @internal */ static _defaultAttributeInfo = { name: null, }; get expr() { return wrapJoinPoint(this._javaObject.getExpr()); } get variable() { return wrapJoinPoint(this._javaObject.getVariable()); } } export class CompilerDirective extends ExecutableStatement { /** * @internal */ static _defaultAttributeInfo = { name: null, }; /** * Returns the directive's contents as a string */ get directiveString() { return wrapJoinPoint(this._javaObject.getDirectiveString()); } get pairs() { return wrapJoinPoint(this._javaObject.getPairs()); } } /** * Represents a data reference */ export class DataRef extends Designator { /** * @internal */ static _defaultAttributeInfo = { name: null, }; get name() { return wrapJoinPoint(this._javaObject.getName()); } } /** * Represents a do loop */ export class DoStatement extends ExecutableStatement { /** * @internal */ static _defaultAttributeInfo = { name: null, }; get body() { return wrapJoinPoint(this._javaObject.getBody()); } get control() { return wrapJoinPoint(this._javaObject.getControl()); } } /** * Represents an OpenMP block construct (such as parallel or task) */ export class OmpBlockConstruct extends OmpConstruct { /** * @internal */ static _defaultAttributeInfo = { name: null, }; setBody(body) { return wrapJoinPoint(this._javaObject.setBody(unwrapJoinPoint(body))); } } /** * Represents an access to one (or several) elements of an array */ export class ArraySubscriptExpr extends DataRef { /** * @internal */ static _defaultAttributeInfo = { name: null, }; get subscripts() { return wrapJoinPoint(this._javaObject.getSubscripts()); } get var() { return wrapJoinPoint(this._javaObject.getVar()); } } const JoinpointMapper = { joinpoint: Joinpoint, expr: Expr, file: FileJp, literal: Literal, loopControl: LoopControl, nameValue: NameValue, ompClause: OmpClause, ompDataSharingClause: OmpDataSharingClause, ompOrderedClause: OmpOrderedClause, ompReductionClause: OmpReductionClause, program: Program, programUnit: ProgramUnit, rangeLoopControl: RangeLoopControl, realLiteral: RealLiteral, statement: Statement, statementBlock: StatementBlock, stringLiteral: StringLiteral, subroutine: Subroutine, useStatement: UseStatement, binaryOperator: BinaryOperator, designator: Designator, executableStatement: ExecutableStatement, execution: Execution, intLiteral: IntLiteral, mainProgram: MainProgram, ompConstruct: OmpConstruct, ompLoopConstruct: OmpLoopConstruct, specification: Specification, actionStatement: ActionStatement, assignmentStatement: AssignmentStatement, compilerDirective: CompilerDirective, dataRef: DataRef, doStatement: DoStatement, ompBlockConstruct: OmpBlockConstruct, arraySubscriptExpr: ArraySubscriptExpr, }; let registered = false; if (!registered) { registerJoinpointMapper(JoinpointMapper); registered = true; } //# sourceMappingURL=Joinpoints.js.map