UNPKG

@specs-feup/lara

Version:

A js port of the popular framework for building source-to-source compilers

84 lines 2.66 kB
import { LaraJoinPoint } from "../LaraJoinPoint.js"; import JpPredicate from "./predicate/JpPredicate.js"; /** * Object which provides low-level join point-related methods. */ export default class JoinPoints { /** * * @returns the current root node of the AST */ static root(): LaraJoinPoint; /** * Converts an AST node to a JointPoint. * */ static toJoinPoint(node: any): LaraJoinPoint; /** * * @returns all the children of the given node */ private static _all_children; /** * * @returns all the descendants of the given node */ private static _all_descendants; /** * * @returns all the nodes that are inside the scope of a given node */ private static _all_scope_nodes; /** * * @returns all the descendants of the given node, in post order */ private static _all_descendants_postorder; /** * * @returns the nodes inside the scope of the given node. */ static scope($jp: LaraJoinPoint, jpType?: JpPredicate): LaraJoinPoint[]; /** * * @returns the children of the given node, according to the AST */ static children($jp: LaraJoinPoint, jpType?: JpPredicate): LaraJoinPoint[]; /** * * @returns the descendants of the given node, according to the AST, preorder traversal */ static descendants($jp: LaraJoinPoint, jpType?: JpPredicate): LaraJoinPoint[]; /** * * @returns the descendants of the given node, according to the AST, postorder traversal */ static descendantsPostorder($jp: LaraJoinPoint, jpType?: JpPredicate): LaraJoinPoint[]; /** * * @returns the nodes related with the given node, according to the search function */ private static _getNodes; /** * Iterates of attributeNames, returns the first value that is not null or undefined. * If no value is found for the given attributes, returns undefined * * @deprecated Just don't... */ static getAttribute($jp: LaraJoinPoint, attributeNames: string[]): any; /** * Helper method of getAttribute which throws an exception if no value is found * * @deprecated Just don't... */ static getAttributeStrict($jp: LaraJoinPoint, attributeNames: string[]): any; /** * Converts the join point to a string of code. Expects attribute 'code' to exist. * * @param $jp - join point to convert to code. * * @returns a String with the code representation of this join point. */ static getCode($jp: LaraJoinPoint): string; } //# sourceMappingURL=JoinPoints.d.ts.map