Class SyntaxTreeToAstVisitor

Index

Constructor methods

Properties

Methods

Constructor methods

constructor(fileName: string, lineMap: LineMap, compilationSettings: ImmutableCompilationSettings): SyntaxTreeToAstVisitor

Parameters

Returns

SyntaxTreeToAstVisitor

Properties

private compilationSettings: any

private fileName: any

public lineMap: LineMap

public position: number

public previousTokenTrailingComments: Comment[]

Methods

private convertComment(trivia: any, commentStartPosition: any, hasTrailingNewLine: any): any

Parameters

  • trivia: any
  • commentStartPosition: any
  • hasTrailingNewLine: any

Returns

any

private convertComments(triviaList: any, commentStartPosition: any): any

Parameters

  • triviaList: any
  • commentStartPosition: any

Returns

any

private convertNodeTrailingComments(node: any, lastToken: any, nodeStart: any): any

Parameters

  • node: any
  • lastToken: any
  • nodeStart: any

Returns

any

private convertTokenLeadingComments(token: any, commentStartPosition: any): any

Parameters

  • token: any
  • commentStartPosition: any

Returns

any

private convertTokenTrailingComments(token: any, commentStartPosition: any): any

Parameters

  • token: any
  • commentStartPosition: any

Returns

any

public createTokenSpan(fullStart: number, element: ISyntaxToken): ASTSpan

Parameters

Returns

ASTSpan

private mergeComments(comments1: any, comments2: any): any

Parameters

  • comments1: any
  • comments2: any

Returns

any

public movePast(element: ISyntaxElement)

Parameters

private moveTo(element1: any, element2: any): any

Parameters

  • element1: any
  • element2: any

Returns

any

private setCommentsAndSpan(ast: any, fullStart: any, node: any): any

Parameters

  • ast: any
  • fullStart: any
  • node: any

Returns

any

public setSpan(span: AST, fullStart: number, element: ISyntaxElement, firstToken?: ISyntaxToken, lastToken?: ISyntaxToken)

Parameters

public setSpanExplicit(span: IASTSpan, start: number, end: number)

Parameters

  • span: IASTSpan
  • start: number
  • end: number

public static visit(syntaxTree: SyntaxTree, fileName: string, compilationSettings: ImmutableCompilationSettings, incrementalAST: boolean): SourceUnit

Parameters

Returns

SourceUnit

public visitArgumentList(node: ArgumentListSyntax): ArgumentList

Parameters

Returns

ArgumentList

public visitArrayLiteralExpression(node: ArrayLiteralExpressionSyntax): ArrayLiteralExpression

Parameters

Returns

ArrayLiteralExpression

public visitArrayType(node: ArrayTypeSyntax): ArrayType

Parameters

Returns

ArrayType

public visitBinaryExpression(node: BinaryExpressionSyntax): BinaryExpression

Parameters

Returns

BinaryExpression

public visitBlock(node: BlockSyntax): Block

Parameters

Returns

Block

public visitBreakStatement(node: BreakStatementSyntax): BreakStatement

Parameters

Returns

BreakStatement

public visitCallSignature(node: CallSignatureSyntax): CallSignature

Parameters

Returns

CallSignature

public visitCaseSwitchClause(node: CaseSwitchClauseSyntax): CaseSwitchClause

Parameters

Returns

CaseSwitchClause

public visitCastExpression(node: CastExpressionSyntax): CastExpression

Parameters

Returns

CastExpression

public visitCatchClause(node: CatchClauseSyntax): CatchClause

Parameters

Returns

CatchClause

public visitClassDeclaration(node: ClassDeclarationSyntax): ClassDeclaration

Parameters

Returns

ClassDeclaration

public visitConditionalExpression(node: ConditionalExpressionSyntax): ConditionalExpression

Parameters

Returns

ConditionalExpression

public visitConstraint(node: ConstraintSyntax): Constraint

Parameters

Returns

Constraint

public visitConstructSignature(node: ConstructSignatureSyntax): ConstructSignature

Parameters

Returns

ConstructSignature

public visitConstructorDeclaration(node: ConstructorDeclarationSyntax): ConstructorDeclaration

Parameters

Returns

ConstructorDeclaration

public visitConstructorType(node: ConstructorTypeSyntax): ConstructorType

Parameters

Returns

ConstructorType

public visitContinueStatement(node: ContinueStatementSyntax): ContinueStatement

Parameters

Returns

ContinueStatement

public visitDebuggerStatement(node: DebuggerStatementSyntax): DebuggerStatement

Parameters

Returns

DebuggerStatement

public visitDefaultSwitchClause(node: DefaultSwitchClauseSyntax): DefaultSwitchClause

Parameters

Returns

DefaultSwitchClause

public visitDeleteExpression(node: DeleteExpressionSyntax): DeleteExpression

Parameters

Returns

DeleteExpression

public visitDoStatement(node: DoStatementSyntax): DoStatement

Parameters

Returns

DoStatement

public visitElementAccessExpression(node: ElementAccessExpressionSyntax): ElementAccessExpression

Parameters

Returns

ElementAccessExpression

public visitElseClause(node: ElseClauseSyntax): ElseClause

Parameters

Returns

ElseClause

public visitEmptyStatement(node: EmptyStatementSyntax): EmptyStatement

Parameters

Returns

EmptyStatement

public visitEnumDeclaration(node: EnumDeclarationSyntax): EnumDeclaration

Parameters

Returns

EnumDeclaration

public visitEnumElement(node: EnumElementSyntax): EnumElement

Parameters

Returns

EnumElement

public visitEqualsValueClause(node: EqualsValueClauseSyntax): EqualsValueClause

Parameters

Returns

EqualsValueClause

public visitExportAssignment(node: ExportAssignmentSyntax): ExportAssignment

Parameters

Returns

ExportAssignment

public visitExpressionStatement(node: ExpressionStatementSyntax): ExpressionStatement

Parameters

Returns

ExpressionStatement

public visitExternalModuleReference(node: ExternalModuleReferenceSyntax): ExternalModuleReference

Parameters

Returns

ExternalModuleReference

public visitFinallyClause(node: FinallyClauseSyntax): FinallyClause

Parameters

Returns

FinallyClause

public visitForInStatement(node: ForInStatementSyntax): ForInStatement

Parameters

Returns

ForInStatement

public visitForStatement(node: ForStatementSyntax): ForStatement

Parameters

Returns

ForStatement

public visitFunctionDeclaration(node: FunctionDeclarationSyntax): FunctionDeclaration

Parameters

Returns

FunctionDeclaration

public visitFunctionExpression(node: FunctionExpressionSyntax): FunctionExpression

Parameters

Returns

FunctionExpression

public visitFunctionPropertyAssignment(node: FunctionPropertyAssignmentSyntax): FunctionPropertyAssignment

Parameters

Returns

FunctionPropertyAssignment

public visitFunctionType(node: FunctionTypeSyntax): FunctionType

Parameters

Returns

FunctionType

public visitGenericType(node: GenericTypeSyntax): GenericType

Parameters

Returns

GenericType

public visitGetAccessor(node: GetAccessorSyntax): GetAccessor

Parameters

Returns

GetAccessor

public visitHeritageClause(node: HeritageClauseSyntax): HeritageClause

Parameters

Returns

HeritageClause

private visitIdentifier(token: any): any

Parameters

  • token: any

Returns

any

public visitIfStatement(node: IfStatementSyntax): IfStatement

Parameters

Returns

IfStatement

public visitImportDeclaration(node: ImportDeclarationSyntax): ImportDeclaration

Parameters

Returns

ImportDeclaration

public visitIndexMemberDeclaration(node: IndexMemberDeclarationSyntax): IndexMemberDeclaration

Parameters

Returns

IndexMemberDeclaration

public visitIndexSignature(node: IndexSignatureSyntax): IndexSignature

Parameters

Returns

IndexSignature

public visitInterfaceDeclaration(node: InterfaceDeclarationSyntax): InterfaceDeclaration

Parameters

Returns

InterfaceDeclaration

public visitInvocationExpression(node: InvocationExpressionSyntax): InvocationExpression

Parameters

Returns

InvocationExpression

public visitLabeledStatement(node: LabeledStatementSyntax): LabeledStatement

Parameters

Returns

LabeledStatement

public visitMemberAccessExpression(node: MemberAccessExpressionSyntax): MemberAccessExpression

Parameters

Returns

MemberAccessExpression

public visitMemberFunctionDeclaration(node: MemberFunctionDeclarationSyntax): MemberFunctionDeclaration

Parameters

Returns

MemberFunctionDeclaration

public visitMemberVariableDeclaration(node: MemberVariableDeclarationSyntax): MemberVariableDeclaration

Parameters

Returns

MemberVariableDeclaration

public visitMethodSignature(node: MethodSignatureSyntax): MethodSignature

Parameters

Returns

MethodSignature

private visitModifiers(modifiers: any): any

Parameters

  • modifiers: any

Returns

any

public visitModuleDeclaration(node: ModuleDeclarationSyntax): ModuleDeclaration

Parameters

Returns

ModuleDeclaration

public visitModuleNameModuleReference(node: ModuleNameModuleReferenceSyntax): ModuleNameModuleReference

Parameters

Returns

ModuleNameModuleReference

public visitObjectCreationExpression(node: ObjectCreationExpressionSyntax): ObjectCreationExpression

Parameters

Returns

ObjectCreationExpression

public visitObjectLiteralExpression(node: ObjectLiteralExpressionSyntax): ObjectLiteralExpression

Parameters

Returns

ObjectLiteralExpression

public visitObjectType(node: ObjectTypeSyntax): ObjectType

Parameters

Returns

ObjectType

public visitOmittedExpression(node: OmittedExpressionSyntax): OmittedExpression

Parameters

Returns

OmittedExpression

public visitParameter(node: ParameterSyntax): Parameter

Parameters

Returns

Parameter

public visitParameterList(node: ParameterListSyntax): ParameterList

Parameters

Returns

ParameterList

public visitParenthesizedArrowFunctionExpression(node: ParenthesizedArrowFunctionExpressionSyntax): ParenthesizedArrowFunctionExpression

Parameters

Returns

ParenthesizedArrowFunctionExpression

public visitParenthesizedExpression(node: ParenthesizedExpressionSyntax): ParenthesizedExpression

Parameters

Returns

ParenthesizedExpression

public visitPostfixUnaryExpression(node: PostfixUnaryExpressionSyntax): PostfixUnaryExpression

Parameters

Returns

PostfixUnaryExpression

public visitPrefixUnaryExpression(node: PrefixUnaryExpressionSyntax): PrefixUnaryExpression

Parameters

Returns

PrefixUnaryExpression

public visitPropertySignature(node: PropertySignatureSyntax): PropertySignature

Parameters

Returns

PropertySignature

public visitQualifiedName(node: QualifiedNameSyntax): QualifiedName

Parameters

Returns

QualifiedName

public visitReturnStatement(node: ReturnStatementSyntax): ReturnStatement

Parameters

Returns

ReturnStatement

public visitSeparatedSyntaxList(list: ISeparatedSyntaxList): ISeparatedSyntaxList2

Parameters

Returns

ISeparatedSyntaxList2

public visitSetAccessor(node: SetAccessorSyntax): SetAccessor

Parameters

Returns

SetAccessor

public visitSimpleArrowFunctionExpression(node: SimpleArrowFunctionExpressionSyntax): SimpleArrowFunctionExpression

Parameters

Returns

SimpleArrowFunctionExpression

public visitSimplePropertyAssignment(node: SimplePropertyAssignmentSyntax): SimplePropertyAssignment

Parameters

Returns

SimplePropertyAssignment

public visitSourceUnit(node: SourceUnitSyntax): SourceUnit

Parameters

Returns

SourceUnit

public visitSwitchStatement(node: SwitchStatementSyntax): SwitchStatement

Parameters

Returns

SwitchStatement

public visitSyntaxList(node: ISyntaxList): ISyntaxList2

Parameters

Returns

ISyntaxList2

public visitThrowStatement(node: ThrowStatementSyntax): ThrowStatement

Parameters

Returns

ThrowStatement

public visitToken(token: ISyntaxToken): IASTToken

Parameters

Returns

IASTToken

public visitTokenWorker(token: ISyntaxToken): IASTToken

Parameters

Returns

IASTToken

public visitTryStatement(node: TryStatementSyntax): TryStatement

Parameters

Returns

TryStatement

public visitType(type: ITypeSyntax): AST

Parameters

Returns

AST

public visitTypeAnnotation(node: TypeAnnotationSyntax): TypeAnnotation

Parameters

Returns

TypeAnnotation

public visitTypeArgumentList(node: TypeArgumentListSyntax): TypeArgumentList

Parameters

Returns

TypeArgumentList

public visitTypeOfExpression(node: TypeOfExpressionSyntax): TypeOfExpression

Parameters

Returns

TypeOfExpression

public visitTypeParameter(node: TypeParameterSyntax): TypeParameter

Parameters

Returns

TypeParameter

public visitTypeParameterList(node: TypeParameterListSyntax): TypeParameterList

Parameters

Returns

TypeParameterList

public visitTypeQuery(node: TypeQuerySyntax): TypeQuery

Parameters

Returns

TypeQuery

public visitVariableDeclaration(node: VariableDeclarationSyntax): VariableDeclaration

Parameters

Returns

VariableDeclaration

public visitVariableDeclarator(node: VariableDeclaratorSyntax): VariableDeclarator

Parameters

Returns

VariableDeclarator

public visitVariableStatement(node: VariableStatementSyntax): VariableStatement

Parameters

Returns

VariableStatement

public visitVoidExpression(node: VoidExpressionSyntax): VoidExpression

Parameters

Returns

VoidExpression

public visitWhileStatement(node: WhileStatementSyntax): WhileStatement

Parameters

Returns

WhileStatement

public visitWithStatement(node: WithStatementSyntax): WithStatement

Parameters

Returns

WithStatement