1using System.Collections.Generic;
158 private static IEnumerable<BadExpression>
VisitAll(IEnumerable<BadExpression> expressions)
160 return expressions.SelectMany(expression => expression.GetDescendantsAndSelf());
257 return result.Dereference();
284 return result.Dereference();
302 return Execute(expressions, pos);
315 return Execute(expression, pos);
Implements the Html Context for the Transformation Process.
IFileSystem FileSystem
The Filesystem of the Current Template Context.
BadSourcePosition CreateAttributePosition(HtmlAttribute attribute)
Creates the Source Position of the specified Attribute.
readonly BadHtmlTemplateOptions Options
The Html Template Options.
BadSourcePosition CreateOuterPosition()
Creates the Source Position of the current Input Nodes Outer Content.
HtmlDocument OutputDocument
The Output Document.
readonly string Source
The Source Code of the Template.
BadExpression ParseSingle(string code, BadSourcePosition pos)
Parses a single Expression from the specified code and returns it with its position set to the specif...
BadHtmlContext CreateChild(HtmlNode inputNode, HtmlNode outputNode, BadExecutionContext? executionContext=null)
Creates a child context with the specified input, output node and optional execution context.
readonly string FilePath
The File Path of the Template.
BadObject ParseAndExecute(string code, BadSourcePosition pos)
Parses and executes the specified code.
BadObject Execute(BadExpression expression, BadSourcePosition position)
Executes the specified expression.
BadSourcePosition CreateInnerPosition()
Creates the Source Position of the current Input Nodes Inner Content.
BadHtmlContext(HtmlNode inputNode, HtmlNode outputNode, BadExecutionContext executionContext, string filePath, string source, BadHtmlTemplateOptions options, IFileSystem fileSystem)
Constructs a new Html Context.
HtmlDocument InputDocument
The Input Document.
static IEnumerable< BadExpression > VisitAll(IEnumerable< BadExpression > expressions)
Returns an enumeration of all expressions in the specified expressions and their descendants.
readonly HtmlNode InputNode
The Current Input Node.
readonly BadExecutionContext ExecutionContext
The Execution Context that is used to evaluate badscript code.
readonly HtmlNode OutputNode
The Current Output Node.
BadObject ParseAndExecuteSingle(string code, BadSourcePosition pos)
Parses and executes the specified code and returns the result of the last expression.
BadExpression[] Parse(string code, BadSourcePosition pos)
Parses the specified code and returns the expressions with their positions set to the specified posit...
BadObject Execute(IEnumerable< BadExpression > expressions, BadSourcePosition position)
Executes the specified expressions.
Options for the Html Template Engine.
BadSourcePosition? Position
The source position of where the error occurred.
string OriginalMessage
The Original Error Message.
Describes a specific position inside a source file.
static BadSourcePosition Create(string fileName, string source, int index, int length)
Creates a new Source Position.
int Index
The Start Index of the Position.
int Length
The Length of the Position.
The Parser of the Language. It turns Source Code into an Expression Tree.
static BadSourceParser Create(string fileName, string source)
Creates a BadSourceParser Instance based on the source and filename provided.
BadExpression ParseExpression(BadExpression? left=null, int precedence=int.MaxValue)
Parses an Expression with a precedence greater than the given precedence. Moves the reader to the nex...
static IEnumerable< BadExpression > Parse(string fileName, string source)
Parses a BadExpression from the Source Reader.
Base Implementation for all Expressions used inside the Script.
IEnumerable< BadExpression > GetDescendantsAndSelf()
Returns all Descendants of the Expression and the Expression itself.
BadSourcePosition Position
The source Position of the Expression.
void SetPosition(BadSourcePosition pos)
Sets the Source Position of the Expression.
Gets Raised if the Reader encounters an Error.
The Execution Context. Every execution of a script needs a context the script is running in....
BadObject ExecuteScript(IEnumerable< BadExpression > expressions)
Executes an enumeration of expressions and returns the last value.
Gets thrown by the runtime.
The Base Class for all BadScript Objects.
Defines the interface for a file system.
A Html Template Generator based on BadScript2.
Contains Shared Data Structures and Functionality.
Contains IO Implementation for the BadScript2 Runtime.
Contains the Expressions for the BadScript2 Language.
Contains the Parser for the BadScript2 Language.
Contains the Source Reader for the BadScript2 Language.
Contains the Error Objects for the BadScript2 Language.
Contains the Runtime Objects.
Contains the Runtime Implementation.