lexem.h 654 Bytes
Newer Older
victor's avatar
 
victor committed
1 2 3 4
#ifndef LEXEM_H
#define LEXEM_H

#include <QtCore>
victor's avatar
 
victor committed
5
#include "interfaces/lexemtype.h"
victor's avatar
 
victor committed
6

victor's avatar
 
victor committed
7
namespace AST {
victor's avatar
 
victor committed
8 9

    struct Lexem {
victor's avatar
 
victor committed
10
        enum ErrorStage { NoError, Lexer, PDAutomata, Tables, Semantics } errorStage;
11
        enum ErrorRaisePosition { AsIs, Header, Begin, End } errorRaisePosition;
victor's avatar
 
victor committed
12 13
        inline Lexem() {
            type = Shared::LxTypeEmpty;
14 15 16
            lineNo = -1; linePos = 0; length = 0;
            errorStage = NoError;
            errorRaisePosition = AsIs;
victor's avatar
 
victor committed
17
        }
victor's avatar
 
victor committed
18 19
        Shared::LexemType type;
        QString data;
victor's avatar
 
victor committed
20 21 22
        int lineNo;
        int linePos;
        int length;
victor's avatar
 
victor committed
23
        QString error;
victor's avatar
 
victor committed
24 25 26 27 28
    };

}

#endif // LEXEM_H