Exemple #1
0
        public void parsesMemberExpression()
        {
            String      statement = "p.name";
            OTestParser parser    = new OTestParser(statement);
            IExpression e         = parser.parse_instance_expression();

            Assert.IsTrue(e is MemberSelector);
            MemberSelector me = (MemberSelector)e;

            Assert.AreEqual("name", me.getName());
            Assert.IsTrue(me.getParent() is InstanceExpression);
            InstanceExpression uie = (InstanceExpression)me.getParent();

            Assert.AreEqual("p", uie.getName());
        }
Exemple #2
0
        private IExpression resolveMemberSelector(Context context, MemberSelector caller)
        {
            IExpression parent = caller.getParent();
            String      name   = caller.getName();

            return(new MethodCall(new MethodSelector(parent, name), arguments));
        }