Пример #1
0
        public static SdlTag ToAst(this SdlReader reader)
        {
            var visitor = new AstSdlTokenVisitor();

            SdlTokenPusher.ParseAndVisit(reader, visitor);
            return(visitor.RootNode);
        }
Пример #2
0
        public static void ParseAndVisit(SdlReader reader, IEnumerable <ISdlTokenVisitorBase> visitors)
        {
            foreach (var v in visitors)
            {
                v.Reset();
            }

            SdlReader copy        = default;
            bool      startOfLine = true;
Пример #3
0
 public void Clone(ref SdlReader reader)
 {
     reader._input           = this._input;
     reader._inputCursor     = this._inputCursor;
     reader.TokenType        = this.TokenType;
     reader.ValueSpan        = this.ValueSpan;
     reader.TagNamespaceSpan = this.TagNamespaceSpan;
     reader.TagNameSpan      = this.TagNameSpan;
     reader.TimeSpanValue    = this.TimeSpanValue;
     reader.DateTimeValue    = this.DateTimeValue;
 }
Пример #4
0
 static SdlValue valueAsSdlValue(ref SdlReader reader) => reader.TokenType switch
 {
Пример #5
0
 public static void ParseAndVisit(SdlReader reader, ISdlTokenVisitorBase visitor)
 {
     ParseAndVisit(reader, new[] { visitor });
 }