2020-11-10 15:26:38 +01:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <hex.hpp>
|
|
|
|
|
2021-01-07 21:52:03 +01:00
|
|
|
#include <utility>
|
2020-11-10 15:26:38 +01:00
|
|
|
#include <string>
|
Pattern Language rewrite (#111)
* Initial parser rewrite effort
Lexer and Token cleanup, Parser started over
* Greatly improved parser syntax
* Reimplemented using declarations and variable placement parsing
* Added back unions and structs
* Added enums as well as mathematical expressions (+, -, *, /, <<, >>, &, |, ^)
* Code style improvement
* Implemented arrays and fixed memory issues
* Fixed more memory issues in parser, reimplemented validator, evaluator and patterns
* Fixed builtin types, arrays and reimplemented strings
* Improved error messages
* Made character a distinct type, used for chars and strings
* Implemented padding, fixed arrays
* Added bitfields
* Added rvalue parsing, no evaluating yet
* Added .idea folder to gitignore
* Fixed build on MacOS
* Added custom implementation of integral concept if not available
* Rebased onto master
* Fixed array variable decl crash
* Added rvalues and dot syntax
* Lower case all pattern language error messages
* Fixed typo in variable name
* Fixed bug where preprocessor would not ignore commented out directives
* Reimplemented pointers
* Fixed rebase issues
2021-01-02 20:27:11 +01:00
|
|
|
#include <variant>
|
2020-11-10 15:26:38 +01:00
|
|
|
|
2021-09-21 21:29:18 +02:00
|
|
|
#include <hex/helpers/utils.hpp>
|
2022-01-31 14:37:12 +01:00
|
|
|
#include <hex/pattern_language/log_console.hpp>
|
2021-09-21 21:29:18 +02:00
|
|
|
|
2021-09-08 15:18:24 +02:00
|
|
|
namespace hex::pl {
|
2020-11-10 15:26:38 +01:00
|
|
|
|
2022-02-27 23:25:39 +01:00
|
|
|
class ASTNode;
|
|
|
|
class Pattern;
|
2021-09-21 21:29:18 +02:00
|
|
|
|
Pattern Language rewrite (#111)
* Initial parser rewrite effort
Lexer and Token cleanup, Parser started over
* Greatly improved parser syntax
* Reimplemented using declarations and variable placement parsing
* Added back unions and structs
* Added enums as well as mathematical expressions (+, -, *, /, <<, >>, &, |, ^)
* Code style improvement
* Implemented arrays and fixed memory issues
* Fixed more memory issues in parser, reimplemented validator, evaluator and patterns
* Fixed builtin types, arrays and reimplemented strings
* Improved error messages
* Made character a distinct type, used for chars and strings
* Implemented padding, fixed arrays
* Added bitfields
* Added rvalue parsing, no evaluating yet
* Added .idea folder to gitignore
* Fixed build on MacOS
* Added custom implementation of integral concept if not available
* Rebased onto master
* Fixed array variable decl crash
* Added rvalues and dot syntax
* Lower case all pattern language error messages
* Fixed typo in variable name
* Fixed bug where preprocessor would not ignore commented out directives
* Reimplemented pointers
* Fixed rebase issues
2021-01-02 20:27:11 +01:00
|
|
|
class Token {
|
|
|
|
public:
|
2022-02-27 23:25:39 +01:00
|
|
|
enum class Type : u64
|
|
|
|
{
|
2020-11-10 15:26:38 +01:00
|
|
|
Keyword,
|
Pattern Language rewrite (#111)
* Initial parser rewrite effort
Lexer and Token cleanup, Parser started over
* Greatly improved parser syntax
* Reimplemented using declarations and variable placement parsing
* Added back unions and structs
* Added enums as well as mathematical expressions (+, -, *, /, <<, >>, &, |, ^)
* Code style improvement
* Implemented arrays and fixed memory issues
* Fixed more memory issues in parser, reimplemented validator, evaluator and patterns
* Fixed builtin types, arrays and reimplemented strings
* Improved error messages
* Made character a distinct type, used for chars and strings
* Implemented padding, fixed arrays
* Added bitfields
* Added rvalue parsing, no evaluating yet
* Added .idea folder to gitignore
* Fixed build on MacOS
* Added custom implementation of integral concept if not available
* Rebased onto master
* Fixed array variable decl crash
* Added rvalues and dot syntax
* Lower case all pattern language error messages
* Fixed typo in variable name
* Fixed bug where preprocessor would not ignore commented out directives
* Reimplemented pointers
* Fixed rebase issues
2021-01-02 20:27:11 +01:00
|
|
|
ValueType,
|
2020-11-10 15:26:38 +01:00
|
|
|
Operator,
|
|
|
|
Integer,
|
2021-01-09 21:45:48 +01:00
|
|
|
String,
|
2020-11-10 15:26:38 +01:00
|
|
|
Identifier,
|
Pattern Language rewrite (#111)
* Initial parser rewrite effort
Lexer and Token cleanup, Parser started over
* Greatly improved parser syntax
* Reimplemented using declarations and variable placement parsing
* Added back unions and structs
* Added enums as well as mathematical expressions (+, -, *, /, <<, >>, &, |, ^)
* Code style improvement
* Implemented arrays and fixed memory issues
* Fixed more memory issues in parser, reimplemented validator, evaluator and patterns
* Fixed builtin types, arrays and reimplemented strings
* Improved error messages
* Made character a distinct type, used for chars and strings
* Implemented padding, fixed arrays
* Added bitfields
* Added rvalue parsing, no evaluating yet
* Added .idea folder to gitignore
* Fixed build on MacOS
* Added custom implementation of integral concept if not available
* Rebased onto master
* Fixed array variable decl crash
* Added rvalues and dot syntax
* Lower case all pattern language error messages
* Fixed typo in variable name
* Fixed bug where preprocessor would not ignore commented out directives
* Reimplemented pointers
* Fixed rebase issues
2021-01-02 20:27:11 +01:00
|
|
|
Separator
|
|
|
|
};
|
|
|
|
|
2022-02-27 23:25:39 +01:00
|
|
|
enum class Keyword
|
|
|
|
{
|
Pattern Language rewrite (#111)
* Initial parser rewrite effort
Lexer and Token cleanup, Parser started over
* Greatly improved parser syntax
* Reimplemented using declarations and variable placement parsing
* Added back unions and structs
* Added enums as well as mathematical expressions (+, -, *, /, <<, >>, &, |, ^)
* Code style improvement
* Implemented arrays and fixed memory issues
* Fixed more memory issues in parser, reimplemented validator, evaluator and patterns
* Fixed builtin types, arrays and reimplemented strings
* Improved error messages
* Made character a distinct type, used for chars and strings
* Implemented padding, fixed arrays
* Added bitfields
* Added rvalue parsing, no evaluating yet
* Added .idea folder to gitignore
* Fixed build on MacOS
* Added custom implementation of integral concept if not available
* Rebased onto master
* Fixed array variable decl crash
* Added rvalues and dot syntax
* Lower case all pattern language error messages
* Fixed typo in variable name
* Fixed bug where preprocessor would not ignore commented out directives
* Reimplemented pointers
* Fixed rebase issues
2021-01-02 20:27:11 +01:00
|
|
|
Struct,
|
|
|
|
Union,
|
|
|
|
Using,
|
|
|
|
Enum,
|
|
|
|
Bitfield,
|
|
|
|
LittleEndian,
|
|
|
|
BigEndian,
|
2021-01-07 00:02:51 +01:00
|
|
|
If,
|
2021-04-12 20:49:37 +02:00
|
|
|
Else,
|
2021-06-17 23:13:58 +02:00
|
|
|
Parent,
|
2021-09-21 21:29:18 +02:00
|
|
|
This,
|
2021-06-20 21:22:31 +02:00
|
|
|
While,
|
2021-10-10 13:47:48 +02:00
|
|
|
For,
|
2021-06-20 21:22:31 +02:00
|
|
|
Function,
|
2021-08-25 17:07:01 +02:00
|
|
|
Return,
|
2021-12-18 22:56:36 +01:00
|
|
|
Namespace,
|
|
|
|
In,
|
2021-12-30 14:44:46 +01:00
|
|
|
Out,
|
|
|
|
Break,
|
|
|
|
Continue
|
Pattern Language rewrite (#111)
* Initial parser rewrite effort
Lexer and Token cleanup, Parser started over
* Greatly improved parser syntax
* Reimplemented using declarations and variable placement parsing
* Added back unions and structs
* Added enums as well as mathematical expressions (+, -, *, /, <<, >>, &, |, ^)
* Code style improvement
* Implemented arrays and fixed memory issues
* Fixed more memory issues in parser, reimplemented validator, evaluator and patterns
* Fixed builtin types, arrays and reimplemented strings
* Improved error messages
* Made character a distinct type, used for chars and strings
* Implemented padding, fixed arrays
* Added bitfields
* Added rvalue parsing, no evaluating yet
* Added .idea folder to gitignore
* Fixed build on MacOS
* Added custom implementation of integral concept if not available
* Rebased onto master
* Fixed array variable decl crash
* Added rvalues and dot syntax
* Lower case all pattern language error messages
* Fixed typo in variable name
* Fixed bug where preprocessor would not ignore commented out directives
* Reimplemented pointers
* Fixed rebase issues
2021-01-02 20:27:11 +01:00
|
|
|
};
|
|
|
|
|
2022-02-27 23:25:39 +01:00
|
|
|
enum class Operator
|
|
|
|
{
|
Pattern Language rewrite (#111)
* Initial parser rewrite effort
Lexer and Token cleanup, Parser started over
* Greatly improved parser syntax
* Reimplemented using declarations and variable placement parsing
* Added back unions and structs
* Added enums as well as mathematical expressions (+, -, *, /, <<, >>, &, |, ^)
* Code style improvement
* Implemented arrays and fixed memory issues
* Fixed more memory issues in parser, reimplemented validator, evaluator and patterns
* Fixed builtin types, arrays and reimplemented strings
* Improved error messages
* Made character a distinct type, used for chars and strings
* Implemented padding, fixed arrays
* Added bitfields
* Added rvalue parsing, no evaluating yet
* Added .idea folder to gitignore
* Fixed build on MacOS
* Added custom implementation of integral concept if not available
* Rebased onto master
* Fixed array variable decl crash
* Added rvalues and dot syntax
* Lower case all pattern language error messages
* Fixed typo in variable name
* Fixed bug where preprocessor would not ignore commented out directives
* Reimplemented pointers
* Fixed rebase issues
2021-01-02 20:27:11 +01:00
|
|
|
AtDeclaration,
|
|
|
|
Assignment,
|
|
|
|
Inherit,
|
|
|
|
Plus,
|
|
|
|
Minus,
|
|
|
|
Star,
|
|
|
|
Slash,
|
2021-01-20 22:55:57 +01:00
|
|
|
Percent,
|
Pattern Language rewrite (#111)
* Initial parser rewrite effort
Lexer and Token cleanup, Parser started over
* Greatly improved parser syntax
* Reimplemented using declarations and variable placement parsing
* Added back unions and structs
* Added enums as well as mathematical expressions (+, -, *, /, <<, >>, &, |, ^)
* Code style improvement
* Implemented arrays and fixed memory issues
* Fixed more memory issues in parser, reimplemented validator, evaluator and patterns
* Fixed builtin types, arrays and reimplemented strings
* Improved error messages
* Made character a distinct type, used for chars and strings
* Implemented padding, fixed arrays
* Added bitfields
* Added rvalue parsing, no evaluating yet
* Added .idea folder to gitignore
* Fixed build on MacOS
* Added custom implementation of integral concept if not available
* Rebased onto master
* Fixed array variable decl crash
* Added rvalues and dot syntax
* Lower case all pattern language error messages
* Fixed typo in variable name
* Fixed bug where preprocessor would not ignore commented out directives
* Reimplemented pointers
* Fixed rebase issues
2021-01-02 20:27:11 +01:00
|
|
|
ShiftLeft,
|
|
|
|
ShiftRight,
|
|
|
|
BitOr,
|
|
|
|
BitAnd,
|
2021-01-07 00:02:51 +01:00
|
|
|
BitXor,
|
2021-01-07 00:41:06 +01:00
|
|
|
BitNot,
|
2021-01-07 00:02:51 +01:00
|
|
|
BoolEquals,
|
|
|
|
BoolNotEquals,
|
|
|
|
BoolGreaterThan,
|
|
|
|
BoolLessThan,
|
|
|
|
BoolGreaterThanOrEquals,
|
|
|
|
BoolLessThanOrEquals,
|
|
|
|
BoolAnd,
|
|
|
|
BoolOr,
|
2021-01-07 00:41:06 +01:00
|
|
|
BoolXor,
|
2021-01-07 01:19:54 +01:00
|
|
|
BoolNot,
|
2021-01-20 22:56:31 +01:00
|
|
|
TernaryConditional,
|
2021-04-21 10:17:42 +02:00
|
|
|
Dollar,
|
|
|
|
AddressOf,
|
2021-08-25 17:07:01 +02:00
|
|
|
SizeOf,
|
|
|
|
ScopeResolution
|
Pattern Language rewrite (#111)
* Initial parser rewrite effort
Lexer and Token cleanup, Parser started over
* Greatly improved parser syntax
* Reimplemented using declarations and variable placement parsing
* Added back unions and structs
* Added enums as well as mathematical expressions (+, -, *, /, <<, >>, &, |, ^)
* Code style improvement
* Implemented arrays and fixed memory issues
* Fixed more memory issues in parser, reimplemented validator, evaluator and patterns
* Fixed builtin types, arrays and reimplemented strings
* Improved error messages
* Made character a distinct type, used for chars and strings
* Implemented padding, fixed arrays
* Added bitfields
* Added rvalue parsing, no evaluating yet
* Added .idea folder to gitignore
* Fixed build on MacOS
* Added custom implementation of integral concept if not available
* Rebased onto master
* Fixed array variable decl crash
* Added rvalues and dot syntax
* Lower case all pattern language error messages
* Fixed typo in variable name
* Fixed bug where preprocessor would not ignore commented out directives
* Reimplemented pointers
* Fixed rebase issues
2021-01-02 20:27:11 +01:00
|
|
|
};
|
|
|
|
|
2022-02-27 23:25:39 +01:00
|
|
|
enum class ValueType
|
|
|
|
{
|
2022-02-01 22:09:44 +01:00
|
|
|
Unsigned8Bit = 0x10,
|
|
|
|
Signed8Bit = 0x11,
|
|
|
|
Unsigned16Bit = 0x20,
|
|
|
|
Signed16Bit = 0x21,
|
|
|
|
Unsigned32Bit = 0x40,
|
|
|
|
Signed32Bit = 0x41,
|
|
|
|
Unsigned64Bit = 0x80,
|
|
|
|
Signed64Bit = 0x81,
|
2022-01-24 20:53:17 +01:00
|
|
|
Unsigned128Bit = 0x100,
|
2022-02-01 22:09:44 +01:00
|
|
|
Signed128Bit = 0x101,
|
|
|
|
Character = 0x13,
|
|
|
|
Character16 = 0x23,
|
|
|
|
Boolean = 0x14,
|
|
|
|
Float = 0x42,
|
|
|
|
Double = 0x82,
|
|
|
|
String = 0x15,
|
|
|
|
Auto = 0x16,
|
|
|
|
CustomType = 0x00,
|
|
|
|
Padding = 0x1F,
|
2022-01-24 20:53:17 +01:00
|
|
|
|
2022-02-01 22:09:44 +01:00
|
|
|
Unsigned = 0xFF00,
|
|
|
|
Signed = 0xFF01,
|
2022-01-24 20:53:17 +01:00
|
|
|
FloatingPoint = 0xFF02,
|
2022-02-01 22:09:44 +01:00
|
|
|
Integer = 0xFF03,
|
|
|
|
Any = 0xFFFF
|
Pattern Language rewrite (#111)
* Initial parser rewrite effort
Lexer and Token cleanup, Parser started over
* Greatly improved parser syntax
* Reimplemented using declarations and variable placement parsing
* Added back unions and structs
* Added enums as well as mathematical expressions (+, -, *, /, <<, >>, &, |, ^)
* Code style improvement
* Implemented arrays and fixed memory issues
* Fixed more memory issues in parser, reimplemented validator, evaluator and patterns
* Fixed builtin types, arrays and reimplemented strings
* Improved error messages
* Made character a distinct type, used for chars and strings
* Implemented padding, fixed arrays
* Added bitfields
* Added rvalue parsing, no evaluating yet
* Added .idea folder to gitignore
* Fixed build on MacOS
* Added custom implementation of integral concept if not available
* Rebased onto master
* Fixed array variable decl crash
* Added rvalues and dot syntax
* Lower case all pattern language error messages
* Fixed typo in variable name
* Fixed bug where preprocessor would not ignore commented out directives
* Reimplemented pointers
* Fixed rebase issues
2021-01-02 20:27:11 +01:00
|
|
|
};
|
|
|
|
|
2022-02-27 23:25:39 +01:00
|
|
|
enum class Separator
|
|
|
|
{
|
Pattern Language rewrite (#111)
* Initial parser rewrite effort
Lexer and Token cleanup, Parser started over
* Greatly improved parser syntax
* Reimplemented using declarations and variable placement parsing
* Added back unions and structs
* Added enums as well as mathematical expressions (+, -, *, /, <<, >>, &, |, ^)
* Code style improvement
* Implemented arrays and fixed memory issues
* Fixed more memory issues in parser, reimplemented validator, evaluator and patterns
* Fixed builtin types, arrays and reimplemented strings
* Improved error messages
* Made character a distinct type, used for chars and strings
* Implemented padding, fixed arrays
* Added bitfields
* Added rvalue parsing, no evaluating yet
* Added .idea folder to gitignore
* Fixed build on MacOS
* Added custom implementation of integral concept if not available
* Rebased onto master
* Fixed array variable decl crash
* Added rvalues and dot syntax
* Lower case all pattern language error messages
* Fixed typo in variable name
* Fixed bug where preprocessor would not ignore commented out directives
* Reimplemented pointers
* Fixed rebase issues
2021-01-02 20:27:11 +01:00
|
|
|
RoundBracketOpen,
|
|
|
|
RoundBracketClose,
|
|
|
|
CurlyBracketOpen,
|
|
|
|
CurlyBracketClose,
|
|
|
|
SquareBracketOpen,
|
|
|
|
SquareBracketClose,
|
|
|
|
Comma,
|
|
|
|
Dot,
|
2020-11-10 15:26:38 +01:00
|
|
|
EndOfExpression,
|
|
|
|
EndOfProgram
|
Pattern Language rewrite (#111)
* Initial parser rewrite effort
Lexer and Token cleanup, Parser started over
* Greatly improved parser syntax
* Reimplemented using declarations and variable placement parsing
* Added back unions and structs
* Added enums as well as mathematical expressions (+, -, *, /, <<, >>, &, |, ^)
* Code style improvement
* Implemented arrays and fixed memory issues
* Fixed more memory issues in parser, reimplemented validator, evaluator and patterns
* Fixed builtin types, arrays and reimplemented strings
* Improved error messages
* Made character a distinct type, used for chars and strings
* Implemented padding, fixed arrays
* Added bitfields
* Added rvalue parsing, no evaluating yet
* Added .idea folder to gitignore
* Fixed build on MacOS
* Added custom implementation of integral concept if not available
* Rebased onto master
* Fixed array variable decl crash
* Added rvalues and dot syntax
* Lower case all pattern language error messages
* Fixed typo in variable name
* Fixed bug where preprocessor would not ignore commented out directives
* Reimplemented pointers
* Fixed rebase issues
2021-01-02 20:27:11 +01:00
|
|
|
};
|
2020-11-27 21:20:23 +01:00
|
|
|
|
2021-09-21 21:29:18 +02:00
|
|
|
struct Identifier {
|
|
|
|
explicit Identifier(std::string identifier) : m_identifier(std::move(identifier)) { }
|
|
|
|
|
2022-01-24 20:53:17 +01:00
|
|
|
[[nodiscard]] const std::string &get() const { return this->m_identifier; }
|
2021-09-21 21:29:18 +02:00
|
|
|
|
2022-01-24 20:53:17 +01:00
|
|
|
auto operator<=>(const Identifier &) const = default;
|
2022-02-01 22:09:44 +01:00
|
|
|
bool operator==(const Identifier &) const = default;
|
2021-09-21 21:29:18 +02:00
|
|
|
|
|
|
|
private:
|
|
|
|
std::string m_identifier;
|
|
|
|
};
|
|
|
|
|
2022-03-03 12:11:47 +01:00
|
|
|
using Literal = std::variant<char, bool, u128, i128, double, std::string, Pattern *>;
|
2021-09-21 21:29:18 +02:00
|
|
|
using ValueTypes = std::variant<Keyword, Identifier, Operator, Literal, ValueType, Separator>;
|
Pattern Language rewrite (#111)
* Initial parser rewrite effort
Lexer and Token cleanup, Parser started over
* Greatly improved parser syntax
* Reimplemented using declarations and variable placement parsing
* Added back unions and structs
* Added enums as well as mathematical expressions (+, -, *, /, <<, >>, &, |, ^)
* Code style improvement
* Implemented arrays and fixed memory issues
* Fixed more memory issues in parser, reimplemented validator, evaluator and patterns
* Fixed builtin types, arrays and reimplemented strings
* Improved error messages
* Made character a distinct type, used for chars and strings
* Implemented padding, fixed arrays
* Added bitfields
* Added rvalue parsing, no evaluating yet
* Added .idea folder to gitignore
* Fixed build on MacOS
* Added custom implementation of integral concept if not available
* Rebased onto master
* Fixed array variable decl crash
* Added rvalues and dot syntax
* Lower case all pattern language error messages
* Fixed typo in variable name
* Fixed bug where preprocessor would not ignore commented out directives
* Reimplemented pointers
* Fixed rebase issues
2021-01-02 20:27:11 +01:00
|
|
|
|
|
|
|
Token(Type type, auto value, u32 lineNumber) : type(type), value(value), lineNumber(lineNumber) {
|
|
|
|
}
|
|
|
|
|
|
|
|
[[nodiscard]] constexpr static inline bool isUnsigned(const ValueType type) {
|
2020-12-27 15:54:12 +01:00
|
|
|
return (static_cast<u32>(type) & 0x0F) == 0x00;
|
|
|
|
}
|
|
|
|
|
Pattern Language rewrite (#111)
* Initial parser rewrite effort
Lexer and Token cleanup, Parser started over
* Greatly improved parser syntax
* Reimplemented using declarations and variable placement parsing
* Added back unions and structs
* Added enums as well as mathematical expressions (+, -, *, /, <<, >>, &, |, ^)
* Code style improvement
* Implemented arrays and fixed memory issues
* Fixed more memory issues in parser, reimplemented validator, evaluator and patterns
* Fixed builtin types, arrays and reimplemented strings
* Improved error messages
* Made character a distinct type, used for chars and strings
* Implemented padding, fixed arrays
* Added bitfields
* Added rvalue parsing, no evaluating yet
* Added .idea folder to gitignore
* Fixed build on MacOS
* Added custom implementation of integral concept if not available
* Rebased onto master
* Fixed array variable decl crash
* Added rvalues and dot syntax
* Lower case all pattern language error messages
* Fixed typo in variable name
* Fixed bug where preprocessor would not ignore commented out directives
* Reimplemented pointers
* Fixed rebase issues
2021-01-02 20:27:11 +01:00
|
|
|
[[nodiscard]] constexpr static inline bool isSigned(const ValueType type) {
|
2020-12-27 15:54:12 +01:00
|
|
|
return (static_cast<u32>(type) & 0x0F) == 0x01;
|
|
|
|
}
|
|
|
|
|
Pattern Language rewrite (#111)
* Initial parser rewrite effort
Lexer and Token cleanup, Parser started over
* Greatly improved parser syntax
* Reimplemented using declarations and variable placement parsing
* Added back unions and structs
* Added enums as well as mathematical expressions (+, -, *, /, <<, >>, &, |, ^)
* Code style improvement
* Implemented arrays and fixed memory issues
* Fixed more memory issues in parser, reimplemented validator, evaluator and patterns
* Fixed builtin types, arrays and reimplemented strings
* Improved error messages
* Made character a distinct type, used for chars and strings
* Implemented padding, fixed arrays
* Added bitfields
* Added rvalue parsing, no evaluating yet
* Added .idea folder to gitignore
* Fixed build on MacOS
* Added custom implementation of integral concept if not available
* Rebased onto master
* Fixed array variable decl crash
* Added rvalues and dot syntax
* Lower case all pattern language error messages
* Fixed typo in variable name
* Fixed bug where preprocessor would not ignore commented out directives
* Reimplemented pointers
* Fixed rebase issues
2021-01-02 20:27:11 +01:00
|
|
|
[[nodiscard]] constexpr static inline bool isFloatingPoint(const ValueType type) {
|
2020-12-27 15:54:12 +01:00
|
|
|
return (static_cast<u32>(type) & 0x0F) == 0x02;
|
|
|
|
}
|
|
|
|
|
Pattern Language rewrite (#111)
* Initial parser rewrite effort
Lexer and Token cleanup, Parser started over
* Greatly improved parser syntax
* Reimplemented using declarations and variable placement parsing
* Added back unions and structs
* Added enums as well as mathematical expressions (+, -, *, /, <<, >>, &, |, ^)
* Code style improvement
* Implemented arrays and fixed memory issues
* Fixed more memory issues in parser, reimplemented validator, evaluator and patterns
* Fixed builtin types, arrays and reimplemented strings
* Improved error messages
* Made character a distinct type, used for chars and strings
* Implemented padding, fixed arrays
* Added bitfields
* Added rvalue parsing, no evaluating yet
* Added .idea folder to gitignore
* Fixed build on MacOS
* Added custom implementation of integral concept if not available
* Rebased onto master
* Fixed array variable decl crash
* Added rvalues and dot syntax
* Lower case all pattern language error messages
* Fixed typo in variable name
* Fixed bug where preprocessor would not ignore commented out directives
* Reimplemented pointers
* Fixed rebase issues
2021-01-02 20:27:11 +01:00
|
|
|
[[nodiscard]] constexpr static inline u32 getTypeSize(const ValueType type) {
|
2020-12-27 15:54:12 +01:00
|
|
|
return static_cast<u32>(type) >> 4;
|
|
|
|
}
|
Pattern Language rewrite (#111)
* Initial parser rewrite effort
Lexer and Token cleanup, Parser started over
* Greatly improved parser syntax
* Reimplemented using declarations and variable placement parsing
* Added back unions and structs
* Added enums as well as mathematical expressions (+, -, *, /, <<, >>, &, |, ^)
* Code style improvement
* Implemented arrays and fixed memory issues
* Fixed more memory issues in parser, reimplemented validator, evaluator and patterns
* Fixed builtin types, arrays and reimplemented strings
* Improved error messages
* Made character a distinct type, used for chars and strings
* Implemented padding, fixed arrays
* Added bitfields
* Added rvalue parsing, no evaluating yet
* Added .idea folder to gitignore
* Fixed build on MacOS
* Added custom implementation of integral concept if not available
* Rebased onto master
* Fixed array variable decl crash
* Added rvalues and dot syntax
* Lower case all pattern language error messages
* Fixed typo in variable name
* Fixed bug where preprocessor would not ignore commented out directives
* Reimplemented pointers
* Fixed rebase issues
2021-01-02 20:27:11 +01:00
|
|
|
|
2021-09-21 21:29:18 +02:00
|
|
|
static u128 literalToUnsigned(const pl::Token::Literal &literal) {
|
|
|
|
return std::visit(overloaded {
|
2022-01-31 14:37:12 +01:00
|
|
|
[](const std::string &) -> u128 { LogConsole::abortEvaluation("expected integral type, got string"); },
|
2022-03-03 12:11:47 +01:00
|
|
|
[](Pattern *) -> u128 { LogConsole::abortEvaluation("expected integral type, got custom type"); },
|
2022-01-31 14:37:12 +01:00
|
|
|
[](auto &&result) -> u128 { return result; } },
|
2022-02-01 22:09:44 +01:00
|
|
|
literal);
|
2021-09-21 21:29:18 +02:00
|
|
|
}
|
|
|
|
|
2022-01-22 22:37:52 +01:00
|
|
|
static i128 literalToSigned(const pl::Token::Literal &literal) {
|
2021-09-21 21:29:18 +02:00
|
|
|
return std::visit(overloaded {
|
2022-01-31 14:37:12 +01:00
|
|
|
[](const std::string &) -> i128 { LogConsole::abortEvaluation("expected integral type, got string"); },
|
2022-03-03 12:11:47 +01:00
|
|
|
[](Pattern *) -> i128 { LogConsole::abortEvaluation("expected integral type, got custom type"); },
|
2022-01-31 14:37:12 +01:00
|
|
|
[](auto &&result) -> i128 { return result; } },
|
2022-02-01 22:09:44 +01:00
|
|
|
literal);
|
2021-09-21 21:29:18 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static double literalToFloatingPoint(const pl::Token::Literal &literal) {
|
|
|
|
return std::visit(overloaded {
|
2022-01-31 14:37:12 +01:00
|
|
|
[](const std::string &) -> double { LogConsole::abortEvaluation("expected integral type, got string"); },
|
2022-03-03 12:11:47 +01:00
|
|
|
[](Pattern *) -> double { LogConsole::abortEvaluation("expected integral type, got custom type"); },
|
2022-01-31 14:37:12 +01:00
|
|
|
[](auto &&result) -> double { return result; } },
|
2022-02-01 22:09:44 +01:00
|
|
|
literal);
|
2021-09-21 21:29:18 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static bool literalToBoolean(const pl::Token::Literal &literal) {
|
|
|
|
return std::visit(overloaded {
|
2022-01-31 14:37:12 +01:00
|
|
|
[](const std::string &) -> bool { LogConsole::abortEvaluation("expected integral type, got string"); },
|
2022-03-03 12:11:47 +01:00
|
|
|
[](Pattern *) -> bool { LogConsole::abortEvaluation("expected integral type, got custom type"); },
|
2022-01-31 14:37:12 +01:00
|
|
|
[](auto &&result) -> bool { return result != 0; } },
|
2022-02-01 22:09:44 +01:00
|
|
|
literal);
|
2021-09-21 21:29:18 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static std::string literalToString(const pl::Token::Literal &literal, bool cast) {
|
|
|
|
if (!cast && std::get_if<std::string>(&literal) == nullptr)
|
2022-01-31 14:37:12 +01:00
|
|
|
LogConsole::abortEvaluation("expected string type, got integral");
|
2021-09-21 21:29:18 +02:00
|
|
|
|
|
|
|
return std::visit(overloaded {
|
2022-01-31 14:37:12 +01:00
|
|
|
[](std::string result) -> std::string { return result; },
|
|
|
|
[](u128 result) -> std::string { return hex::to_string(result); },
|
|
|
|
[](i128 result) -> std::string { return hex::to_string(result); },
|
|
|
|
[](bool result) -> std::string { return result ? "true" : "false"; },
|
|
|
|
[](char result) -> std::string { return { 1, result }; },
|
2022-03-03 12:11:47 +01:00
|
|
|
[](Pattern *) -> std::string { LogConsole::abortEvaluation("expected integral type, got custom type"); },
|
2022-01-31 14:37:12 +01:00
|
|
|
[](auto &&result) -> std::string { return std::to_string(result); } },
|
2022-02-01 22:09:44 +01:00
|
|
|
literal);
|
2021-09-21 21:29:18 +02:00
|
|
|
}
|
|
|
|
|
2021-09-08 15:18:24 +02:00
|
|
|
[[nodiscard]] constexpr static auto getTypeName(const pl::Token::ValueType type) {
|
Pattern Language rewrite (#111)
* Initial parser rewrite effort
Lexer and Token cleanup, Parser started over
* Greatly improved parser syntax
* Reimplemented using declarations and variable placement parsing
* Added back unions and structs
* Added enums as well as mathematical expressions (+, -, *, /, <<, >>, &, |, ^)
* Code style improvement
* Implemented arrays and fixed memory issues
* Fixed more memory issues in parser, reimplemented validator, evaluator and patterns
* Fixed builtin types, arrays and reimplemented strings
* Improved error messages
* Made character a distinct type, used for chars and strings
* Implemented padding, fixed arrays
* Added bitfields
* Added rvalue parsing, no evaluating yet
* Added .idea folder to gitignore
* Fixed build on MacOS
* Added custom implementation of integral concept if not available
* Rebased onto master
* Fixed array variable decl crash
* Added rvalues and dot syntax
* Lower case all pattern language error messages
* Fixed typo in variable name
* Fixed bug where preprocessor would not ignore commented out directives
* Reimplemented pointers
* Fixed rebase issues
2021-01-02 20:27:11 +01:00
|
|
|
switch (type) {
|
2022-02-01 22:09:44 +01:00
|
|
|
case ValueType::Signed8Bit:
|
|
|
|
return "s8";
|
|
|
|
case ValueType::Signed16Bit:
|
|
|
|
return "s16";
|
|
|
|
case ValueType::Signed32Bit:
|
|
|
|
return "s32";
|
|
|
|
case ValueType::Signed64Bit:
|
|
|
|
return "s64";
|
|
|
|
case ValueType::Signed128Bit:
|
|
|
|
return "s128";
|
|
|
|
case ValueType::Unsigned8Bit:
|
|
|
|
return "u8";
|
|
|
|
case ValueType::Unsigned16Bit:
|
|
|
|
return "u16";
|
|
|
|
case ValueType::Unsigned32Bit:
|
|
|
|
return "u32";
|
|
|
|
case ValueType::Unsigned64Bit:
|
|
|
|
return "u64";
|
|
|
|
case ValueType::Unsigned128Bit:
|
|
|
|
return "u128";
|
|
|
|
case ValueType::Float:
|
|
|
|
return "float";
|
|
|
|
case ValueType::Double:
|
|
|
|
return "double";
|
|
|
|
case ValueType::Character:
|
|
|
|
return "char";
|
|
|
|
case ValueType::Character16:
|
|
|
|
return "char16";
|
|
|
|
case ValueType::Padding:
|
|
|
|
return "padding";
|
|
|
|
case ValueType::String:
|
|
|
|
return "str";
|
|
|
|
default:
|
|
|
|
return "< ??? >";
|
Pattern Language rewrite (#111)
* Initial parser rewrite effort
Lexer and Token cleanup, Parser started over
* Greatly improved parser syntax
* Reimplemented using declarations and variable placement parsing
* Added back unions and structs
* Added enums as well as mathematical expressions (+, -, *, /, <<, >>, &, |, ^)
* Code style improvement
* Implemented arrays and fixed memory issues
* Fixed more memory issues in parser, reimplemented validator, evaluator and patterns
* Fixed builtin types, arrays and reimplemented strings
* Improved error messages
* Made character a distinct type, used for chars and strings
* Implemented padding, fixed arrays
* Added bitfields
* Added rvalue parsing, no evaluating yet
* Added .idea folder to gitignore
* Fixed build on MacOS
* Added custom implementation of integral concept if not available
* Rebased onto master
* Fixed array variable decl crash
* Added rvalues and dot syntax
* Lower case all pattern language error messages
* Fixed typo in variable name
* Fixed bug where preprocessor would not ignore commented out directives
* Reimplemented pointers
* Fixed rebase issues
2021-01-02 20:27:11 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
bool operator==(const ValueTypes &other) const {
|
2021-01-09 21:45:48 +01:00
|
|
|
if (this->type == Type::Integer || this->type == Type::Identifier || this->type == Type::String)
|
Pattern Language rewrite (#111)
* Initial parser rewrite effort
Lexer and Token cleanup, Parser started over
* Greatly improved parser syntax
* Reimplemented using declarations and variable placement parsing
* Added back unions and structs
* Added enums as well as mathematical expressions (+, -, *, /, <<, >>, &, |, ^)
* Code style improvement
* Implemented arrays and fixed memory issues
* Fixed more memory issues in parser, reimplemented validator, evaluator and patterns
* Fixed builtin types, arrays and reimplemented strings
* Improved error messages
* Made character a distinct type, used for chars and strings
* Implemented padding, fixed arrays
* Added bitfields
* Added rvalue parsing, no evaluating yet
* Added .idea folder to gitignore
* Fixed build on MacOS
* Added custom implementation of integral concept if not available
* Rebased onto master
* Fixed array variable decl crash
* Added rvalues and dot syntax
* Lower case all pattern language error messages
* Fixed typo in variable name
* Fixed bug where preprocessor would not ignore commented out directives
* Reimplemented pointers
* Fixed rebase issues
2021-01-02 20:27:11 +01:00
|
|
|
return true;
|
|
|
|
else if (this->type == Type::ValueType) {
|
2022-01-24 20:53:17 +01:00
|
|
|
auto otherValueType = std::get_if<ValueType>(&other);
|
2022-02-01 22:09:44 +01:00
|
|
|
auto valueType = std::get_if<ValueType>(&this->value);
|
Pattern Language rewrite (#111)
* Initial parser rewrite effort
Lexer and Token cleanup, Parser started over
* Greatly improved parser syntax
* Reimplemented using declarations and variable placement parsing
* Added back unions and structs
* Added enums as well as mathematical expressions (+, -, *, /, <<, >>, &, |, ^)
* Code style improvement
* Implemented arrays and fixed memory issues
* Fixed more memory issues in parser, reimplemented validator, evaluator and patterns
* Fixed builtin types, arrays and reimplemented strings
* Improved error messages
* Made character a distinct type, used for chars and strings
* Implemented padding, fixed arrays
* Added bitfields
* Added rvalue parsing, no evaluating yet
* Added .idea folder to gitignore
* Fixed build on MacOS
* Added custom implementation of integral concept if not available
* Rebased onto master
* Fixed array variable decl crash
* Added rvalues and dot syntax
* Lower case all pattern language error messages
* Fixed typo in variable name
* Fixed bug where preprocessor would not ignore commented out directives
* Reimplemented pointers
* Fixed rebase issues
2021-01-02 20:27:11 +01:00
|
|
|
|
|
|
|
if (otherValueType == nullptr) return false;
|
|
|
|
if (valueType == nullptr) return false;
|
|
|
|
|
|
|
|
if (*otherValueType == *valueType)
|
|
|
|
return true;
|
|
|
|
else if (*otherValueType == ValueType::Any)
|
|
|
|
return *valueType != ValueType::CustomType && *valueType != ValueType::Padding;
|
|
|
|
else if (*otherValueType == ValueType::Unsigned)
|
|
|
|
return isUnsigned(*valueType);
|
|
|
|
else if (*otherValueType == ValueType::Signed)
|
|
|
|
return isSigned(*valueType);
|
|
|
|
else if (*otherValueType == ValueType::FloatingPoint)
|
|
|
|
return isFloatingPoint(*valueType);
|
|
|
|
else if (*otherValueType == ValueType::Integer)
|
|
|
|
return isUnsigned(*valueType) || isSigned(*valueType);
|
2022-01-24 20:53:17 +01:00
|
|
|
} else
|
Pattern Language rewrite (#111)
* Initial parser rewrite effort
Lexer and Token cleanup, Parser started over
* Greatly improved parser syntax
* Reimplemented using declarations and variable placement parsing
* Added back unions and structs
* Added enums as well as mathematical expressions (+, -, *, /, <<, >>, &, |, ^)
* Code style improvement
* Implemented arrays and fixed memory issues
* Fixed more memory issues in parser, reimplemented validator, evaluator and patterns
* Fixed builtin types, arrays and reimplemented strings
* Improved error messages
* Made character a distinct type, used for chars and strings
* Implemented padding, fixed arrays
* Added bitfields
* Added rvalue parsing, no evaluating yet
* Added .idea folder to gitignore
* Fixed build on MacOS
* Added custom implementation of integral concept if not available
* Rebased onto master
* Fixed array variable decl crash
* Added rvalues and dot syntax
* Lower case all pattern language error messages
* Fixed typo in variable name
* Fixed bug where preprocessor would not ignore commented out directives
* Reimplemented pointers
* Fixed rebase issues
2021-01-02 20:27:11 +01:00
|
|
|
return other == this->value;
|
|
|
|
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool operator!=(const ValueTypes &other) const {
|
|
|
|
return !operator==(other);
|
|
|
|
}
|
|
|
|
|
|
|
|
Type type;
|
|
|
|
ValueTypes value;
|
|
|
|
u32 lineNumber;
|
2020-11-10 15:26:38 +01:00
|
|
|
};
|
Pattern Language rewrite (#111)
* Initial parser rewrite effort
Lexer and Token cleanup, Parser started over
* Greatly improved parser syntax
* Reimplemented using declarations and variable placement parsing
* Added back unions and structs
* Added enums as well as mathematical expressions (+, -, *, /, <<, >>, &, |, ^)
* Code style improvement
* Implemented arrays and fixed memory issues
* Fixed more memory issues in parser, reimplemented validator, evaluator and patterns
* Fixed builtin types, arrays and reimplemented strings
* Improved error messages
* Made character a distinct type, used for chars and strings
* Implemented padding, fixed arrays
* Added bitfields
* Added rvalue parsing, no evaluating yet
* Added .idea folder to gitignore
* Fixed build on MacOS
* Added custom implementation of integral concept if not available
* Rebased onto master
* Fixed array variable decl crash
* Added rvalues and dot syntax
* Lower case all pattern language error messages
* Fixed typo in variable name
* Fixed bug where preprocessor would not ignore commented out directives
* Reimplemented pointers
* Fixed rebase issues
2021-01-02 20:27:11 +01:00
|
|
|
|
|
|
|
}
|
|
|
|
|
2021-09-08 15:18:24 +02:00
|
|
|
#define COMPONENT(type, value) hex::pl::Token::Type::type, hex::pl::Token::type::value
|
Pattern Language rewrite (#111)
* Initial parser rewrite effort
Lexer and Token cleanup, Parser started over
* Greatly improved parser syntax
* Reimplemented using declarations and variable placement parsing
* Added back unions and structs
* Added enums as well as mathematical expressions (+, -, *, /, <<, >>, &, |, ^)
* Code style improvement
* Implemented arrays and fixed memory issues
* Fixed more memory issues in parser, reimplemented validator, evaluator and patterns
* Fixed builtin types, arrays and reimplemented strings
* Improved error messages
* Made character a distinct type, used for chars and strings
* Implemented padding, fixed arrays
* Added bitfields
* Added rvalue parsing, no evaluating yet
* Added .idea folder to gitignore
* Fixed build on MacOS
* Added custom implementation of integral concept if not available
* Rebased onto master
* Fixed array variable decl crash
* Added rvalues and dot syntax
* Lower case all pattern language error messages
* Fixed typo in variable name
* Fixed bug where preprocessor would not ignore commented out directives
* Reimplemented pointers
* Fixed rebase issues
2021-01-02 20:27:11 +01:00
|
|
|
|
2022-01-24 20:53:17 +01:00
|
|
|
#define KEYWORD_STRUCT COMPONENT(Keyword, Struct)
|
|
|
|
#define KEYWORD_UNION COMPONENT(Keyword, Union)
|
|
|
|
#define KEYWORD_USING COMPONENT(Keyword, Using)
|
|
|
|
#define KEYWORD_ENUM COMPONENT(Keyword, Enum)
|
|
|
|
#define KEYWORD_BITFIELD COMPONENT(Keyword, Bitfield)
|
|
|
|
#define KEYWORD_LE COMPONENT(Keyword, LittleEndian)
|
|
|
|
#define KEYWORD_BE COMPONENT(Keyword, BigEndian)
|
|
|
|
#define KEYWORD_IF COMPONENT(Keyword, If)
|
|
|
|
#define KEYWORD_ELSE COMPONENT(Keyword, Else)
|
|
|
|
#define KEYWORD_PARENT COMPONENT(Keyword, Parent)
|
|
|
|
#define KEYWORD_THIS COMPONENT(Keyword, This)
|
|
|
|
#define KEYWORD_WHILE COMPONENT(Keyword, While)
|
|
|
|
#define KEYWORD_FOR COMPONENT(Keyword, For)
|
|
|
|
#define KEYWORD_FUNCTION COMPONENT(Keyword, Function)
|
|
|
|
#define KEYWORD_RETURN COMPONENT(Keyword, Return)
|
|
|
|
#define KEYWORD_NAMESPACE COMPONENT(Keyword, Namespace)
|
|
|
|
#define KEYWORD_IN COMPONENT(Keyword, In)
|
|
|
|
#define KEYWORD_OUT COMPONENT(Keyword, Out)
|
|
|
|
#define KEYWORD_BREAK COMPONENT(Keyword, Break)
|
|
|
|
#define KEYWORD_CONTINUE COMPONENT(Keyword, Continue)
|
|
|
|
|
|
|
|
#define INTEGER hex::pl::Token::Type::Integer, hex::pl::Token::Literal(u128(0))
|
|
|
|
#define IDENTIFIER hex::pl::Token::Type::Identifier, ""
|
|
|
|
#define STRING hex::pl::Token::Type::String, hex::pl::Token::Literal("")
|
|
|
|
|
2022-01-29 04:16:32 +01:00
|
|
|
#define OPERATOR_ANY COMPONENT(Operator, Any)
|
2022-01-24 20:53:17 +01:00
|
|
|
#define OPERATOR_AT COMPONENT(Operator, AtDeclaration)
|
|
|
|
#define OPERATOR_ASSIGNMENT COMPONENT(Operator, Assignment)
|
|
|
|
#define OPERATOR_INHERIT COMPONENT(Operator, Inherit)
|
|
|
|
#define OPERATOR_PLUS COMPONENT(Operator, Plus)
|
|
|
|
#define OPERATOR_MINUS COMPONENT(Operator, Minus)
|
|
|
|
#define OPERATOR_STAR COMPONENT(Operator, Star)
|
|
|
|
#define OPERATOR_SLASH COMPONENT(Operator, Slash)
|
|
|
|
#define OPERATOR_PERCENT COMPONENT(Operator, Percent)
|
|
|
|
#define OPERATOR_SHIFTLEFT COMPONENT(Operator, ShiftLeft)
|
|
|
|
#define OPERATOR_SHIFTRIGHT COMPONENT(Operator, ShiftRight)
|
|
|
|
#define OPERATOR_BITOR COMPONENT(Operator, BitOr)
|
|
|
|
#define OPERATOR_BITAND COMPONENT(Operator, BitAnd)
|
|
|
|
#define OPERATOR_BITXOR COMPONENT(Operator, BitXor)
|
|
|
|
#define OPERATOR_BITNOT COMPONENT(Operator, BitNot)
|
|
|
|
#define OPERATOR_BOOLEQUALS COMPONENT(Operator, BoolEquals)
|
|
|
|
#define OPERATOR_BOOLNOTEQUALS COMPONENT(Operator, BoolNotEquals)
|
|
|
|
#define OPERATOR_BOOLGREATERTHAN COMPONENT(Operator, BoolGreaterThan)
|
|
|
|
#define OPERATOR_BOOLLESSTHAN COMPONENT(Operator, BoolLessThan)
|
|
|
|
#define OPERATOR_BOOLGREATERTHANOREQUALS COMPONENT(Operator, BoolGreaterThanOrEquals)
|
|
|
|
#define OPERATOR_BOOLLESSTHANOREQUALS COMPONENT(Operator, BoolLessThanOrEquals)
|
|
|
|
#define OPERATOR_BOOLAND COMPONENT(Operator, BoolAnd)
|
|
|
|
#define OPERATOR_BOOLOR COMPONENT(Operator, BoolOr)
|
|
|
|
#define OPERATOR_BOOLXOR COMPONENT(Operator, BoolXor)
|
|
|
|
#define OPERATOR_BOOLNOT COMPONENT(Operator, BoolNot)
|
|
|
|
#define OPERATOR_TERNARYCONDITIONAL COMPONENT(Operator, TernaryConditional)
|
|
|
|
#define OPERATOR_DOLLAR COMPONENT(Operator, Dollar)
|
|
|
|
#define OPERATOR_ADDRESSOF COMPONENT(Operator, AddressOf)
|
|
|
|
#define OPERATOR_SIZEOF COMPONENT(Operator, SizeOf)
|
|
|
|
#define OPERATOR_SCOPERESOLUTION COMPONENT(Operator, ScopeResolution)
|
|
|
|
|
|
|
|
#define VALUETYPE_CUSTOMTYPE COMPONENT(ValueType, CustomType)
|
|
|
|
#define VALUETYPE_PADDING COMPONENT(ValueType, Padding)
|
|
|
|
#define VALUETYPE_UNSIGNED COMPONENT(ValueType, Unsigned)
|
|
|
|
#define VALUETYPE_SIGNED COMPONENT(ValueType, Signed)
|
|
|
|
#define VALUETYPE_FLOATINGPOINT COMPONENT(ValueType, FloatingPoint)
|
2022-01-30 15:18:45 +01:00
|
|
|
#define VALUETYPE_AUTO COMPONENT(ValueType, Auto)
|
2022-01-24 20:53:17 +01:00
|
|
|
#define VALUETYPE_ANY COMPONENT(ValueType, Any)
|
|
|
|
|
|
|
|
#define SEPARATOR_ROUNDBRACKETOPEN COMPONENT(Separator, RoundBracketOpen)
|
|
|
|
#define SEPARATOR_ROUNDBRACKETCLOSE COMPONENT(Separator, RoundBracketClose)
|
|
|
|
#define SEPARATOR_CURLYBRACKETOPEN COMPONENT(Separator, CurlyBracketOpen)
|
|
|
|
#define SEPARATOR_CURLYBRACKETCLOSE COMPONENT(Separator, CurlyBracketClose)
|
|
|
|
#define SEPARATOR_SQUAREBRACKETOPEN COMPONENT(Separator, SquareBracketOpen)
|
|
|
|
#define SEPARATOR_SQUAREBRACKETCLOSE COMPONENT(Separator, SquareBracketClose)
|
|
|
|
#define SEPARATOR_COMMA COMPONENT(Separator, Comma)
|
|
|
|
#define SEPARATOR_DOT COMPONENT(Separator, Dot)
|
|
|
|
#define SEPARATOR_ENDOFEXPRESSION COMPONENT(Separator, EndOfExpression)
|
|
|
|
#define SEPARATOR_ENDOFPROGRAM COMPONENT(Separator, EndOfProgram)
|