using System; namespace NTERA.Interpreter { [Flags] public enum LexerType { Real = 1, String = 2, Both = Real | String } [AttributeUsage(AttributeTargets.Field)] public class LexerCharacterAttribute : Attribute { public char Character { get; } public LexerType LexerContext { get; } public LexerCharacterAttribute(char character, LexerType lexerContext = LexerType.Both) { Character = character; LexerContext = lexerContext; } } [AttributeUsage(AttributeTargets.Field)] public class LexerKeywordAttribute : Attribute { public string Keyword { get; } public bool IsLineKeyword { get; } public LexerKeywordAttribute(string keyword, bool isLineKeyword = false) { Keyword = keyword; IsLineKeyword = isLineKeyword; } } [AttributeUsage(AttributeTargets.Method)] public class KeywordMethodAttribute : Attribute { public Token Token { get; } public KeywordMethodAttribute(Token token) { Token = token; } } [AttributeUsage(AttributeTargets.Method)] public class BuiltInFunctionAttribute : Attribute { public string Name { get; } public BuiltInFunctionAttribute(string name) { Name = name; } } }