Example #1
0
        public static Expression MakeOperator(string @operator, FunctionExpression function)
        {
            var token = new Token(function.Token, TokenType.Global, "global", TokenSubType.Keyword);
            var global = new GlobalExpression(token);

            token = new Token(function.Token, TokenType.Identifier, "__ops", TokenSubType.None);
            var opsField = new FieldExpression(token, global);

            token = new Token(function.Token, TokenType.String, @operator, TokenSubType.Operator);
            var opField = new FieldExpression(token, opsField);

            token = new Token(function.Token, TokenType.Assign, "=", TokenSubType.Operator);
            return new BinaryOperatorExpression(token, opField, function);
        }
Example #2
0
 public virtual T Visit(GlobalExpression expression)
 {
     return(default(T));
 }
 public virtual Expression Visit(GlobalExpression expression)
 {
     return(expression);
 }
Example #4
0
 public int Visit(GlobalExpression expression)
 {
     _writer.Write("global");
     return(0);
 }