12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758 |
- namespace MinorShift.Emuera.Sub
- {
- /// <summary>
- /// FormattedStringWTの中身用のトークン
- /// </summary>
- internal abstract class SubWord
- {
- protected SubWord(WordCollection w) { words = w; }
- readonly WordCollection words;
- public WordCollection Words => words;
- public bool IsMacro;
- public virtual void SetIsMacro()
- {
- IsMacro = true;
- if(Words != null)
- Words.SetIsMacro();
-
- }
- }
- internal sealed class TripleSymbolSubWord : SubWord
- {
- public TripleSymbolSubWord(char c) : base(null) { code = c; }
- readonly char code;
- public char Code => code;
- }
- internal sealed class CurlyBraceSubWord : SubWord
- {
- public CurlyBraceSubWord(WordCollection w) : base(w) { }
- }
- internal sealed class PercentSubWord : SubWord
- {
- public PercentSubWord(WordCollection w) : base(w) { }
- }
- internal sealed class YenAtSubWord : SubWord
- {
- public YenAtSubWord(WordCollection w, StrFormWord fsLeft, StrFormWord fsRight)
- : base(w)
- {
- left = fsLeft;
- right = fsRight;
- }
- readonly StrFormWord left;
- readonly StrFormWord right;
- public StrFormWord Left => left;
- public StrFormWord Right => right;
- public override void SetIsMacro()
- {
- IsMacro = true;
- Words.SetIsMacro();
- Left.SetIsMacro();
- Right.SetIsMacro();
- }
- }
- }
|