Virtual AST Node Properties

SyntaxEditor for WPF Forum

Posted 11 years ago by Ian Davis
Version: 12.2.0571
Avatar

When generating the AST node classes from the language designer, is it possible to generate the node properties as virtual?

For example:

    public partial class Expression : AstNodeBase {
        
        private DataType computedTypeValue;
        
        public override Int32 Id {
            get {
                return FormulaAstNodeId.Expression;
            }
        }

        public DataType ComputedType {
            get {
                return this.computedTypeValue;
            }
            set {
                this.computedTypeValue = value;
            }
        }
    }

 Becomes

    public partial class Expression : AstNodeBase {
        
        private DataType computedTypeValue;
        
        public override Int32 Id {
            get {
                return FormulaAstNodeId.Expression;
            }
        }

        public virtual DataType ComputedType {
            get {
                return this.computedTypeValue;
            }
            set {
                this.computedTypeValue = value;
            }
        }
    }

[Modified 11 years ago]

Comments (1)

Posted 11 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi Ian,

Sorry we don't have any options for that.  But since the generated classes are all partial classes, you could easily extend them with your own virtual properties.


Actipro Software Support

The latest build of this product (v24.1.2) was released 2 days ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.