コード例 #1
0
 public JavaScriptBlock(int start, JavaScriptBlockType type, JavaScriptBlock parent, JavaScriptTopLevelBlock topLevel, List<JavaScriptToken> tokens)
 {
     Start = start;
     End = start;
     Type = type;
     m_Parent = parent;
     m_TopLevel = topLevel;
     m_Tokens = tokens;
 }
コード例 #2
0
        private void Parse()
        {
            // Scanner/Tokenizer
            JavaScriptTokenStream ts = new JavaScriptTokenStream(new TextStream(OriginalSpan.Text));
            try
            {
                while (true)
                {
                    JavaScriptToken token = ts.ReadToken();
                    token.Location.Shift(OriginalSpan.Start);
                    m_Tokens.Add(token);
                }
            }
            catch (EndOfStreamException)
            {
            }

            // Parser
            Block = new JavaScriptTopLevelBlock(m_Tokens);
        }