Ejemplo n.º 1
0
 public Parser(Scanner scanner)
 {
     this.hook         = new ErrorHook();
     this.scanner      = scanner;
     this.currentToken = this.scanner.nextToken();
     this.panic        = false;
 }
Ejemplo n.º 2
0
 public Parser(ILexer lexer)
 {
     this.lexer        = lexer;
     this.currentToken = this.lexer.nextToken();
     this.hook         = new ErrorHook();
     this.panic        = false;
 }
    public void sendHook(HookType type, string message)
    {
        Hook temp;

        switch (type)
        {
        case HookType.Action:
            temp = new ActionHook(message);
            break;

        case HookType.Error:
            temp = new ErrorHook(message);
            break;

        case HookType.Input:
            temp = new InputHook(message);
            break;

        default:
            temp = new Hook();
            Debug.LogError("sendHook with string parameter could not determine hook type!");
            break;
        }
        passHook(temp);
    }
Ejemplo n.º 4
0
 protected virtual void errorHook(ErrorHook hook)
 {
     return;
 }
Ejemplo n.º 5
0
 public TypeCheckingVisitor(SymbolTableManager stm)
 {
     this.stm = stm;
     hook     = new ErrorHook();
 }
Ejemplo n.º 6
0
 public TypeCheckingVisitor(SymbolTable table)
 {
     this.table = table;
     this.hook  = new ErrorHook();
 }
Ejemplo n.º 7
0
 public IdentifierUsageCheckingVisitor(SymbolTableManager stm)
 {
     this.stm  = stm;
     this.hook = new ErrorHook();
 }
Ejemplo n.º 8
0
 public SymbolTableBuildingVisitor()
 {
     this.symbolTables = new SymbolTables();
     this.currentTable = null;
     this.hook         = new ErrorHook();
 }
Ejemplo n.º 9
0
 public SymbolTableBuildingVisitor()
 {
     this.table = new SymbolTable();
     this.hook  = new ErrorHook();
 }