Attributes.cs 610 B

12345678910111213141516171819202122232425262728
  1. using System;
  2. namespace NTERA.Engine
  3. {
  4. [AttributeUsage(AttributeTargets.Field, AllowMultiple = true)]
  5. public class LexerCharacterAttribute : Attribute
  6. {
  7. public char Character { get; }
  8. public LexerCharacterAttribute(char character)
  9. {
  10. Character = character;
  11. }
  12. }
  13. [AttributeUsage(AttributeTargets.Field, AllowMultiple = true)]
  14. public class LexerKeywordAttribute : Attribute
  15. {
  16. public string Keyword { get; }
  17. public bool IsLineKeyword { get; }
  18. public LexerKeywordAttribute(string keyword, bool isLineKeyword = false)
  19. {
  20. Keyword = keyword;
  21. IsLineKeyword = isLineKeyword;
  22. }
  23. }
  24. }