UNPKG

@specs-feup/alpakka

Version:

A Smali/APK source-to-source compiler written in Typescript

565 lines 14.5 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, }; /** * String representation of the ast */ get ast() { return wrapJoinPoint(this._javaObject.getAst()); } /** * Returns an array with the children of the node, ignoring null nodes */ get children() { return wrapJoinPoint(this._javaObject.getChildren()); } /** * String with the code represented by this node */ get code() { return wrapJoinPoint(this._javaObject.getCode()); } /** * Retrieves all descendants of the join point */ get descendants() { return wrapJoinPoint(this._javaObject.getDescendants()); } /** * The id of the node */ get id() { return wrapJoinPoint(this._javaObject.getId()); } /** * Returns the parent node in the AST, or undefined if it is the root node */ get parent() { return wrapJoinPoint(this._javaObject.getParent()); } /** * Returns the 'program' joinpoint */ get root() { return wrapJoinPoint(this._javaObject.getRoot()); } /** * Looks for an ancestor joinpoint name, walking back on the AST */ getAncestor(type) { return wrapJoinPoint(this._javaObject.getAncestor(unwrapJoinPoint(type))); } /** * Returns the child of the node at the given index, ignoring null nodes */ getChild(index) { return wrapJoinPoint(this._javaObject.getChild(unwrapJoinPoint(index))); } /** * Retrieves the descendants of the given type */ getDescendants(type) { return wrapJoinPoint(this._javaObject.getDescendants(unwrapJoinPoint(type))); } /** * Retrieves the descendants of the given type, including the node itself */ getDescendantsAndSelf(type) { return wrapJoinPoint(this._javaObject.getDescendantsAndSelf(unwrapJoinPoint(type))); } /** * Removes the node associated to this joinpoint from the AST */ detach() { return wrapJoinPoint(this._javaObject.detach()); } /** * Inserts the given join point after this join point */ insertAfter(p1) { return wrapJoinPoint(this._javaObject.insertAfter(unwrapJoinPoint(p1))); } /** * Inserts the given join point before this join point */ insertBefore(p1) { return wrapJoinPoint(this._javaObject.insertBefore(unwrapJoinPoint(p1))); } /** * Replaces this node with the given node */ replaceWith(p1) { return wrapJoinPoint(this._javaObject.replaceWith(unwrapJoinPoint(p1))); } /** * Overload which accepts a list of strings */ replaceWithStrings(node) { return wrapJoinPoint(this._javaObject.replaceWithStrings(unwrapJoinPoint(node))); } } /** * Class definition */ export class ClassNode extends Joinpoint { /** * @internal */ static _defaultAttributeInfo = { name: null, }; get classDescriptor() { return wrapJoinPoint(this._javaObject.getClassDescriptor()); } get fields() { return wrapJoinPoint(this._javaObject.getFields()); } get methods() { return wrapJoinPoint(this._javaObject.getMethods()); } get superClassDescriptor() { return wrapJoinPoint(this._javaObject.getSuperClassDescriptor()); } } /** * Expression */ export class Expression extends Joinpoint { /** * @internal */ static _defaultAttributeInfo = { name: null, }; } /** * Field definition */ export class FieldNode extends Joinpoint { /** * @internal */ static _defaultAttributeInfo = { name: null, }; get isStatic() { return wrapJoinPoint(this._javaObject.getIsStatic()); } get name() { return wrapJoinPoint(this._javaObject.getName()); } get referenceName() { return wrapJoinPoint(this._javaObject.getReferenceName()); } } /** * Field reference */ export class FieldReference extends Expression { /** * @internal */ static _defaultAttributeInfo = { name: null, }; } /** * Label reference */ export class LabelReference extends Expression { /** * @internal */ static _defaultAttributeInfo = { name: null, }; get decl() { return wrapJoinPoint(this._javaObject.getDecl()); } } /** * Literal */ export class Literal extends Expression { /** * @internal */ static _defaultAttributeInfo = { name: null, }; } /** * The application's manifest */ export class Manifest extends Joinpoint { /** * @internal */ static _defaultAttributeInfo = { name: null, }; get activities() { return wrapJoinPoint(this._javaObject.getActivities()); } get packageName() { return wrapJoinPoint(this._javaObject.getPackageName()); } get services() { return wrapJoinPoint(this._javaObject.getServices()); } } /** * Method definition */ export class MethodNode extends Joinpoint { /** * @internal */ static _defaultAttributeInfo = { name: null, }; get isStatic() { return wrapJoinPoint(this._javaObject.getIsStatic()); } get name() { return wrapJoinPoint(this._javaObject.getName()); } get prototype() { return wrapJoinPoint(this._javaObject.getPrototype()); } get referenceName() { return wrapJoinPoint(this._javaObject.getReferenceName()); } get registersDirective() { return wrapJoinPoint(this._javaObject.getRegistersDirective()); } } /** * Method prototype */ export class MethodPrototype extends Literal { /** * @internal */ static _defaultAttributeInfo = { name: null, }; get parameters() { return wrapJoinPoint(this._javaObject.getParameters()); } get returnType() { return wrapJoinPoint(this._javaObject.getReturnType()); } } /** * Method reference */ export class MethodReference extends Expression { /** * @internal */ static _defaultAttributeInfo = { name: null, }; get name() { return wrapJoinPoint(this._javaObject.getName()); } get parentClassDescriptor() { return wrapJoinPoint(this._javaObject.getParentClassDescriptor()); } get prototype() { return wrapJoinPoint(this._javaObject.getPrototype()); } } /** * Placeholder node */ export class Placeholder extends Joinpoint { /** * @internal */ static _defaultAttributeInfo = { name: null, }; get kind() { return wrapJoinPoint(this._javaObject.getKind()); } } /** * Primitive literal */ export class PrimitiveLiteral extends Literal { /** * @internal */ static _defaultAttributeInfo = { name: null, }; setValue(value) { return wrapJoinPoint(this._javaObject.setValue(unwrapJoinPoint(value))); } } /** * App node */ export class Program extends Joinpoint { /** * @internal */ static _defaultAttributeInfo = { name: null, }; get classes() { return wrapJoinPoint(this._javaObject.getClasses()); } get manifest() { return wrapJoinPoint(this._javaObject.getManifest()); } buildApk(outputName) { return wrapJoinPoint(this._javaObject.buildApk(unwrapJoinPoint(outputName))); } } /** * Register list */ export class RegisterList extends Expression { /** * @internal */ static _defaultAttributeInfo = { name: null, }; } /** * Register range */ export class RegisterRange extends Expression { /** * @internal */ static _defaultAttributeInfo = { name: null, }; } /** * Register reference */ export class RegisterReference extends Expression { /** * @internal */ static _defaultAttributeInfo = { name: null, }; } /** * Resource nodes, like xml files are not being handled for now */ export class ResourceNode extends Joinpoint { /** * @internal */ static _defaultAttributeInfo = { name: null, }; } /** * Sparse switch element */ export class SparseSwitchElement extends Expression { /** * @internal */ static _defaultAttributeInfo = { name: null, }; get label() { return wrapJoinPoint(this._javaObject.getLabel()); } } /** * Statement */ export class Statement extends Joinpoint { /** * @internal */ static _defaultAttributeInfo = { name: null, }; get line() { return wrapJoinPoint(this._javaObject.getLine()); } get nextStatement() { return wrapJoinPoint(this._javaObject.getNextStatement()); } get prevStatement() { return wrapJoinPoint(this._javaObject.getPrevStatement()); } } /** * Type descriptor */ export class TypeDescriptor extends Literal { /** * @internal */ static _defaultAttributeInfo = { name: null, }; } /** * Array descriptor */ export class ArrayType extends TypeDescriptor { /** * @internal */ static _defaultAttributeInfo = { name: null, }; } /** * Catch directive */ export class Catch extends Statement { /** * @internal */ static _defaultAttributeInfo = { name: null, }; get catch() { return wrapJoinPoint(this._javaObject.getCatch()); } get exception() { return wrapJoinPoint(this._javaObject.getException()); } get tryEnd() { return wrapJoinPoint(this._javaObject.getTryEnd()); } get tryStart() { return wrapJoinPoint(this._javaObject.getTryStart()); } } /** * Class descriptor */ export class ClassType extends TypeDescriptor { /** * @internal */ static _defaultAttributeInfo = { name: null, }; get className() { return wrapJoinPoint(this._javaObject.getClassName()); } get decl() { return wrapJoinPoint(this._javaObject.getDecl()); } get packageName() { return wrapJoinPoint(this._javaObject.getPackageName()); } } /** * Instruction */ export class Instruction extends Statement { /** * @internal */ static _defaultAttributeInfo = { name: null, }; get canThrow() { return wrapJoinPoint(this._javaObject.getCanThrow()); } get opCodeName() { return wrapJoinPoint(this._javaObject.getOpCodeName()); } get setsRegister() { return wrapJoinPoint(this._javaObject.getSetsRegister()); } get setsResult() { return wrapJoinPoint(this._javaObject.getSetsResult()); } } /** * Label declaration */ export class Label extends Statement { /** * @internal */ static _defaultAttributeInfo = { name: null, }; get name() { return wrapJoinPoint(this._javaObject.getName()); } } /** * Line directive */ export class LineDirective extends Statement { /** * @internal */ static _defaultAttributeInfo = { name: null, }; get value() { return wrapJoinPoint(this._javaObject.getValue()); } } /** * Packed switch directive */ export class PackedSwitch extends Statement { /** * @internal */ static _defaultAttributeInfo = { name: null, }; } /** * Primitive descriptor */ export class PrimitiveType extends TypeDescriptor { /** * @internal */ static _defaultAttributeInfo = { name: null, }; } /** * Registers directive */ export class RegistersDirective extends Statement { /** * @internal */ static _defaultAttributeInfo = { name: null, }; get type() { return wrapJoinPoint(this._javaObject.getType()); } get value() { return wrapJoinPoint(this._javaObject.getValue()); } } /** * Smali instruction formats 10x, 11x */ export class ReturnStatement extends Instruction { /** * @internal */ static _defaultAttributeInfo = { name: null, }; } /** * Sparse switch directive */ export class SparseSwitch extends Statement { /** * @internal */ static _defaultAttributeInfo = { name: null, }; } /** * Smali instruction format 31t */ export class Switch extends Instruction { /** * @internal */ static _defaultAttributeInfo = { name: null, }; } /** * Smali instruction format 11x */ export class ThrowStatement extends Instruction { /** * @internal */ static _defaultAttributeInfo = { name: null, }; } /** * Smali instruction formats 10t, 20t, 30t */ export class Goto extends Instruction { /** * @internal */ static _defaultAttributeInfo = { name: null, }; get label() { return wrapJoinPoint(this._javaObject.getLabel()); } } /** * Smali instruction format 22t */ export class IfComparison extends Instruction { /** * @internal */ static _defaultAttributeInfo = { name: null, }; get label() { return wrapJoinPoint(this._javaObject.getLabel()); } } /** * Smali instruction format 21t */ export class IfComparisonWithZero extends Instruction { /** * @internal */ static _defaultAttributeInfo = { name: null, }; get label() { return wrapJoinPoint(this._javaObject.getLabel()); } } const JoinpointMapper = { joinpoint: Joinpoint, classNode: ClassNode, expression: Expression, fieldNode: FieldNode, fieldReference: FieldReference, labelReference: LabelReference, literal: Literal, manifest: Manifest, methodNode: MethodNode, methodPrototype: MethodPrototype, methodReference: MethodReference, placeholder: Placeholder, primitiveLiteral: PrimitiveLiteral, program: Program, registerList: RegisterList, registerRange: RegisterRange, registerReference: RegisterReference, resourceNode: ResourceNode, sparseSwitchElement: SparseSwitchElement, statement: Statement, typeDescriptor: TypeDescriptor, arrayType: ArrayType, catch: Catch, classType: ClassType, instruction: Instruction, label: Label, lineDirective: LineDirective, packedSwitch: PackedSwitch, primitiveType: PrimitiveType, registersDirective: RegistersDirective, returnStatement: ReturnStatement, sparseSwitch: SparseSwitch, switch: Switch, throwStatement: ThrowStatement, goto: Goto, ifComparison: IfComparison, ifComparisonWithZero: IfComparisonWithZero, }; let registered = false; if (!registered) { registerJoinpointMapper(JoinpointMapper); registered = true; } //# sourceMappingURL=Joinpoints.js.map