68kcounter
Version:
68000 ASM source code cycle counter
41 lines (40 loc) • 1.13 kB
TypeScript
import { InstructionTiming } from "../timings";
import { StatementNode } from "./nodes";
export interface Line {
statement: StatementNode;
macroLines?: Line[];
bytes?: number;
bss?: boolean;
timing?: InstructionTiming;
}
export default class Parser {
/** Variable/constants state */
private vars;
/** Macro definitions */
private macros;
/** Running total of parsed statement bytes sizes */
private totalBytes;
/** The name of the macro currently being defined */
private currentMacro;
/** Start of the current repeating group */
private reptStart;
/** Statements in the current repeating group */
private reptStatements;
/** Are we currently in a BSS section */
private bss;
private assignments;
private sections;
/**
* Parse multiple lines of ASM code
*/
parse(input: string): Line[];
/**
* Add size and timing info to statements
*/
private processStatements;
private processStatement;
private processLabel;
private processMacro;
private processDirective;
private processInstruction;
}