68kcounter
Version:
68000 ASM source code cycle counter
91 lines (90 loc) • 2.48 kB
TypeScript
import { AddressingMode, Directive, Mnemonic, Qualifier } from "../syntax";
export declare abstract class Node {
type: string;
loc: Location;
text: string;
constructor(start: number, text: string, type?: string);
}
export interface Location {
start: number;
end: number;
}
export declare class LabelNode extends Node {
name: string;
local: boolean;
macro: boolean;
constructor(start: number, text: string);
}
export declare class OpcodeNode extends Node {
op: MnemonicNode | DirectiveNode | MacroNode;
qualifier?: QualifierNode;
constructor(start: number, text: string);
}
export declare class MnemonicNode extends Node {
name: Mnemonic;
constructor(start: number, name: Mnemonic);
}
export declare class DirectiveNode extends Node {
name: Directive;
constructor(start: number, name: Directive);
}
export declare class MacroNode extends Node {
name: string;
constructor(start: number, name: string);
}
export declare class QualifierNode extends Node {
name: Qualifier;
constructor(start: number, name: Qualifier);
}
export declare class EffectiveAddressNode extends Node {
mode: AddressingMode;
constructor(start: number, text: string);
}
export declare class StringNode extends Node {
value: string;
constructor(start: number, text: string);
}
export declare class MacroArgNode extends Node {
index: number;
constructor(start: number, text: string);
}
export declare class MacroInvocationsNode extends Node {
constructor(start: number, text: string);
}
export declare class CommentNode extends Node {
constructor(start: number, text: string);
}
export declare class StatementNode extends Node {
label?: LabelNode;
opcode?: OpcodeNode;
operands: Node[];
comment?: CommentNode;
constructor(text: string);
isLabel(): this is LabelStatement;
isInstruction(): this is InstructionStatement;
isDirective(): this is DirectiveStatement;
isMacro(): this is MacroStatement;
}
export interface InstructionStatement {
opcode: {
op: MnemonicNode;
qualifier?: QualifierNode;
};
operands: EffectiveAddressNode[];
}
export interface DirectiveStatement {
opcode: {
op: DirectiveNode;
qualifier?: QualifierNode;
};
operands: Node[];
}
export interface MacroStatement {
opcode: {
op: MacroNode;
};
operands: Node[];
}
export interface LabelStatement {
label: LabelNode;
}