123456789101112131415161718192021222324252627282930313233343536373839 |
- using System;
- namespace NTERA.Interpreter
- {
- [Flags]
- public enum LexerType
- {
- Real = 1,
- String = 2,
- Both = Real | String
- }
- [AttributeUsage(AttributeTargets.Field, AllowMultiple = true)]
- 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, AllowMultiple = true)]
- public class LexerKeywordAttribute : Attribute
- {
- public string Keyword { get; }
- public bool IsLineKeyword { get; }
- public LexerKeywordAttribute(string keyword, bool isLineKeyword = false)
- {
- Keyword = keyword;
- IsLineKeyword = isLineKeyword;
- }
- }
- }
|