2
// <copyright see="prj:///doc/copyright.txt"/>
3
// <license see="prj:///doc/license.txt"/>
4
// <owner name="none" email=""/>
5
// <version>$Revision: 4482 $</version>
8
using ICSharpCode.OldNRefactory.PrettyPrinter;
11
namespace ICSharpCode.OldNRefactory.Ast
13
public class PrimitiveExpression : Expression
17
public Parser.LiteralFormat LiteralFormat { get; set; }
18
public object Value { get; set; }
20
public string StringValue {
22
if (stringValue == null)
23
return CSharpOutputVisitor.ToCSharpString(this);
28
stringValue = value == null ? String.Empty : value;
32
public bool HasStringValue {
34
return stringValue != null;
38
public PrimitiveExpression(object val)
43
public PrimitiveExpression(object val, string stringValue)
46
this.StringValue = stringValue;
49
public override object AcceptVisitor(IAstVisitor visitor, object data)
51
return visitor.VisitPrimitiveExpression(this, data);
54
public override string ToString()
56
return String.Format("[PrimitiveExpression: Value={1}, ValueType={2}, StringValue={0}]",
59
this.Value == null ? "null" : this.Value.GetType().FullName