Пример #1
0
        private AstExpr ParseRef()
        {
            AstExpr varRef = new AstVarRef {
                StName = Expect(Ktoken.Id).St
            };

            if (Accept(Ktoken.Lbracket))
            {
                var astIndex = new AstIndex {
                    exprLeft = varRef, exprRight = ParseExpr()
                };
                Expect(Ktoken.Rbracket);
                return(astIndex);
            }

            if (Accept(Ktoken.Dot))
            {
                var varRefRight = new AstVarRef {
                    StName = Expect(Ktoken.Id).St
                };
                varRef = new AstDot {
                    varLeft = (AstVarRef)varRef, varRight = varRefRight
                };
            }

            if (FCurrent(Ktoken.Lparen))
            {
                return new AstCall {
                           exprFunc = varRef, rgexprParam = ParseArgumentList().ToArray()
                }
            }
            ;

            return(varRef);
        }
Пример #2
0
 private void CompileDot(AstDot node, Syt syt, StringBuilder sb)
 {
     throw new NotImplementedException();
 }