예제 #1
0
 // Constructor
 internal CompileError(string message, Tokenizer t)
 {
     m_strMessage = message;
     m_Bookmark   = t.GetBookmark();
 }
예제 #2
0
 // Constructor
 internal CompileError(string message, Tokenizer t)
 {
     m_strMessage = message;
     m_Bookmark = t.GetBookmark();
 }
예제 #3
0
        ast.ExprNode ParseLtr(fnExprNode Next, ParseContext ctx, Func <Token, bool> TokenCheck)
        {
            // Parse the LHS
            var lhs = Next(ctx);

            ast.ExprNodeLtr ltr = null;

            // Parse all consecutive RHS
            while (true)
            {
                // Check operator at same precedence level
                if (TokenCheck(t.token))
                {
                    if (ltr == null)
                    {
                        ltr = new ast.ExprNodeLtr(lhs.Bookmark, lhs);
                    }

                    // Save the operator token
                    var bmk = t.GetBookmark();
                    t.Next();

                    // Parse the rhs
                    ltr.AddTerm(bmk.token, Next(ctx));
                }
                else
                {
                    return(ltr == null ? lhs : ltr);
                }
            }
        }