7 namespace SiliconStudio.Shaders.
Grammar
9 internal class NamedBlockKeyTerm : DynamicKeyTerm
11 public NamedBlockKeyTerm(
string text,
string name)
16 public override void Match(Tokenizer toknizer, out
Token token)
18 var parser = toknizer.GoldParser;
20 var location = toknizer.Location;
21 var nextSymbol = parser.ReadToken();
23 while (nextSymbol.SymbolType == SymbolType.WhiteSpace || nextSymbol.Index == (
int)TokenType.NewLine)
24 nextSymbol = parser.ReadToken();
26 if (nextSymbol.Index != (
int)
TokenType.LeftCurly)
32 var startPosition = parser.CharPosition;
34 bool rightCurlyFound =
false;
36 for (
int i = parser.CharPosition; i < parser.TextBuffer.Length; i++, length++)
38 if (parser.TextBuffer[i] ==
'}')
40 rightCurlyFound =
true;
51 token =
new Token(
this, location, parser.TextBuffer.Substring(startPosition, length), null);
54 parser.MoveBy(length+1);
readonly Terminal SyntaxError
Tokens are produced by scanner and fed to parser, optionally passing through Token filters in between...