Abstract base class for all nodes on the syntax tree
 public VeilCompilerException(string message, Exception innerException, SyntaxTreeNode node)
     : base(message, innerException)
 {
     Node = node;
 }
 public void AddNodeToCurrentBlock(SyntaxTreeNode node)
 {
     this.scopeStack.First().Block.Add(node);
 }
 internal SyntaxTreeNode AddNodeToCurrentBlock(SyntaxTreeNode node)
 {
     BlockStack.Peek().Block.Add(node);
     return node;
 }
Example #4
0
		public static void CheckNotNull(string message, object obj, SyntaxTreeNode node)
		{
			if (obj == null)
				throw new VeilCompilerException(message, node);
		}
Example #5
0
 /// <summary>
 /// Scopes a node to a new model
 /// </summary>
 /// <param name="modelToScopeTo">An expression that evaluates to the model to scope to</param>
 /// <param name="node">The node to execute in the new scope</param>
 public static ScopedNode ScopeNode(ExpressionNode modelToScopeTo, SyntaxTreeNode node)
 {
     return new ScopedNode
     {
         ModelToScope = modelToScopeTo,
         Node = node
     };
 }
Example #6
0
 /// <summary>
 /// Defines an optional point in a template that can be overridden when the template is extended.
 /// If the point is not overridden then the specified content is used by default
 /// </summary>
 /// <param name="overrideName">The name of the override which must match that specified in the overriding template</param>
 /// <param name="defaultContent">The content to use when the point is not overridden</param>
 public static OverridePointNode Override(string overrideName, SyntaxTreeNode defaultContent)
 {
     return new OverridePointNode
     {
         OverrideName = overrideName,
         IsRequired = false,
         DefaultContent = defaultContent
     };
 }
Example #7
0
        /// <summary>
        /// Scopes a node to a new model
        /// </summary>
        /// <param name="modelToScopeTo">An expression that evaluates to the model to scope to</param>
        /// <param name="node">The node to execute in the new scope</param>
        public static ScopedNode ScopeNode(ExpressionNode modelToScopeTo, SyntaxTreeNode node, SourceLocation location)
        {
            return new ScopedNode
            {
				Location = location,
                ModelToScope = modelToScopeTo,
                Node = node
            };
        }
Example #8
0
        /// <summary>
        /// Defines an optional point in a template that can be overridden when the template is extended.
        /// If the point is not overridden then the specified content is used by default
        /// </summary>
        /// <param name="overrideName">The name of the override which must match that specified in the overriding template</param>
        /// <param name="defaultContent">The content to use when the point is not overridden</param>
        public static OverridePointNode Override(string overrideName, SyntaxTreeNode defaultContent, SourceLocation location)
        {
            return new OverridePointNode
            {
				Location = location,
                OverrideName = overrideName,
                IsRequired = false,
                DefaultContent = defaultContent
            };
        }