Example #1
0
        public override PNode evaluate(PNode evaluateMe, PatternMatcher successfulMatch)
        {
            PatternMatcher match = successfulMatch;

            //	Extract the "arguments" from the PatternMatcher.
            List<PNode> M = match.Matching;			//	The pattern -> prose index from the match
            string sourceString = ((StringLiteralObject) M[2].value).literal;
            ProseAction action = new ReadAction(sourceString);

            value = new ProseObject[3];
            value[0] = M[0].value;
            value[1] = action;
            value[2] = M[3].value;

            PNode ret = replaceWithValueAt(evaluateMe, successfulMatch);
            value = null;
            return ret;
        }
Example #2
0
        public override PNode evaluate(PNode evaluateMe, PatternMatcher successfulMatch)
        {
            PatternMatcher match = successfulMatch;

            //	Extract the "arguments" from the PatternMatcher.
            List <PNode> M            = match.Matching;                 //	The pattern -> prose index from the match
            string       sourceString = ((StringLiteralObject)M[2].value).literal;
            ProseAction  action       = new ReadAction(sourceString);

            value    = new ProseObject[3];
            value[0] = M[0].value;
            value[1] = action;
            value[2] = M[3].value;

            PNode ret = replaceWithValueAt(evaluateMe, successfulMatch);

            value = null;
            return(ret);
        }