import { ASTNodeIdentifier } from '../ast/node/identifier'; import { ASTNodeArguments } from '../ast/node/arguments'; import { ASTNodeArgument } from '../ast/node/argument/class'; import { ASTNodeComment } from '../ast/node/comment'; import { ASTNodeBegin } from '../ast/node/begin'; import { ASTNodeEnd } from '../ast/node/end'; import { ASTNodeFile } from '../ast/node/file'; import { ASTNodeStatements } from '../ast/node/statements'; import { ASTNodeStatement } from '../ast/node/statement/class'; import { ASTNodeStatementInstruction } from '../ast/node/statement/instruction'; import { ASTNodeStatementBlock } from '../ast/node/statement/block'; import { ASTNodeStatementLine } from '../ast/node/statement/line'; import { Parser } from './class'; /** * ParserEncoder constructor. */ export declare class ParserEncoder extends Parser { /** * Indent size. */ optionIndentSize: number; /** * Indent with tab instead of space. */ optionIndentTab: boolean; /** * Align instructions arguments column. */ optionInstructionsArgumentsAlign: boolean; /** * Align instructions comments column. */ optionInstructionsCommentsAlign: boolean; /** * Stack of instruction alignments. */ protected _instructionAlignStack: number[][]; constructor(); /** * Reset any stateful properties. */ reset(): void; /** * Get the indent string. * * @returns Indent string. */ get indentString(): string; /** * Encode AST to ASM. * * @param ast AST node. * @returns ASM code. */ encode(ast: ASTNodeFile): string; /** * Encode AST to ASM. * * @param ast AST node. * @param depth Indent depth. * @returns ASM code. */ encodeStatements(ast: ASTNodeStatements, depth?: number): string; /** * Encode AST to ASM. * * @param ast AST node. * @param depth Indent depth. * @returns ASM code. */ encodeStatement(ast: ASTNodeStatement, depth?: number): string; /** * Encode AST to ASM. * * @param ast AST node. * @param depth Indent depth. * @returns ASM code. */ encodeStatementInstruction(ast: ASTNodeStatementInstruction, depth?: number): string; /** * Encode AST to ASM. * * @param ast AST node. * @param depth Indent depth. * @returns ASM code. */ encodeStatementBlock(ast: ASTNodeStatementBlock, depth?: number): string; /** * Encode AST to ASM. * * @param ast AST node. * @param depth Indent depth. * @returns ASM code. */ encodeStatementLine(ast: ASTNodeStatementLine, depth?: number): string; /** * Encode AST to ASM. * * @param ast AST node. * @param depth Indent depth. * @returns ASM code. */ encodeBegin(ast: ASTNodeBegin, depth?: number): string; /** * Encode AST to ASM. * * @param ast AST node. * @param depth Indent depth. * @returns ASM code. */ encodeEnd(ast: ASTNodeEnd, depth?: number): string; /** * Encode AST to ASM. * * @param ast AST node. * @returns ASM code. */ encodeIdentifier(ast: ASTNodeIdentifier): string; /** * Encode AST to ASM. * * @param ast AST node. * @returns ASM code. */ encodeArguments(ast: ASTNodeArguments): string; /** * Encode AST to ASM. * * @param ast AST node. * @returns ASM code. */ encodeArgument(ast: ASTNodeArgument): string; /** * Encode AST to ASM. * * @param ast AST node. * @returns ASM code. */ encodeComment(ast: ASTNodeComment): string; /** * Column align a string. * * @param str String start. * @param add String added. * @param column Column number. * @param empty Set to true to indent even when empty. * @returns Aligned string. */ protected _align(str: string, add: string, column: number, empty?: boolean): string; /** * Indent string, optionally if non-empty. * * @param str String to be indented. * @param depth Indent depth. * @param empty Set to true to indent even when empty. * @returns Indented string. */ protected _indent(str: string, depth: number, empty?: boolean): string; /** * Create line, optionally indented. * * @param str String to be indented. * @param depth Indent depth. * @returns Indented line. */ protected _line(str: string, depth?: number): string; }