Files
logos-cpp-sdk/cpp-generator/experimental/lidl_lexer.h
Iuri Matias d633575677 add IDL parser & generator (wip) (#33)
* add IDL parser & generator (wip)

* fix fixtures issues affecting tests

* fix fixtures issues affecting tests
2026-03-31 16:29:35 -04:00

38 lines
771 B
C

#ifndef LIDL_LEXER_H
#define LIDL_LEXER_H
#include <QString>
#include <QVector>
struct LidlToken {
enum Type {
// Keywords
Module, TypeKw, Method, Event,
Version, Description, Category, Depends,
// Literals
Ident, StringLit,
// Symbols
LBrace, RBrace, LParen, RParen, LBracket, RBracket,
Colon, Comma, Arrow, Question,
// Special
Eof, Error
};
Type type = Eof;
QString text;
int line = 0;
int column = 0;
};
struct LidlLexResult {
QVector<LidlToken> tokens;
QString error;
int errorLine = 0;
int errorColumn = 0;
bool hasError() const { return !error.isEmpty(); }
};
LidlLexResult lidlTokenize(const QString& source);
#endif // LIDL_LEXER_H