コード例 #1
0
 public static string print(Expression exp, int elemDepth, bool visitRef)
 {
     using (StringWriter str = new StringWriter()) {
         exp.Visit(new ExpPrinter(str, elemDepth, visitRef));
         return(str.ToString());
     }
 }
コード例 #2
0
 public static string print( Expression exp, int elemDepth, bool visitRef )
 {
     using( StringWriter str = new StringWriter() ) {
     exp.Visit( new ExpPrinter(str,elemDepth,visitRef) );
     return str.ToString();
     }
 }
コード例 #3
0
        protected void Visit(Expression e)
        {
            bool isComplex = false;

            if (e is BinaryExp)
            {
                isComplex = true;
            }
            if (e is ReferenceExp)
            {
                isComplex = true;
            }

            if (isComplex)
            {
                writer.Write('(');
            }
            e.Visit(this);
            if (isComplex)
            {
                writer.Write(')');
            }
        }
コード例 #4
0
 public static Expression Calc( Expression exp, Token token, ExpBuilder builder )
 {
     return exp.Visit( new Residual(token,builder) );
 }
コード例 #5
0
	protected Expression OnAttribute( Expression exp, Expression[] atoms ) {
		if(document.Name!="xmlns"
		&& document.Prefix!="xmlns") {
			Trace.WriteLine("@"+document.Name);
			
			AttributeToken token = new AttributeToken(
					document.NamespaceURI,
					document.LocalName,
					document.Value,
					this, builder );
			AttFeeder feeder = new AttFeeder(builder,token);

			exp = exp.Visit(feeder);
			if( exp==Expression.NotAllowed ) {
				// error: bad attribute
				ReportError(ERR_BAD_ATTRIBUTE,document.Name);
			}
			
			if(atoms!=null)
				for( int i=0; i<atoms.Length; i++ )
					atoms[i] = atoms[i].Visit(feeder);
			
			Trace.WriteLine("residual: " + ExpPrinter.printContentModel(exp));
		}
		return exp;
	}
コード例 #6
0
        protected void Visit( Expression e )
        {
            bool isComplex = false;
            if( e is BinaryExp )
            isComplex = true;
            if( e is ReferenceExp )
            isComplex = true;

            if(isComplex)	writer.Write('(');
            e.Visit(this);
            if(isComplex)	writer.Write(')');
        }