BadScript 2
Loading...
Searching...
No Matches
BadNullCoalescingExpression.cs
Go to the documentation of this file.
5
7
13{
21 right,
22 position
23 ) { }
24
25 protected override IEnumerable<BadObject> InnerExecute(BadExecutionContext context)
26 {
28
29 foreach (BadObject o in Left.Execute(context))
30 {
31 left = o;
32 }
33
34 left = left.Dereference(Position);
35
36 if (left == BadObject.Null)
37 {
38 foreach (BadObject o in Right.Execute(context))
39 {
40 yield return o;
41 }
42 }
43 else
44 {
45 yield return left;
46 }
47 }
48
49 protected override string GetSymbol()
50 {
51 return "??";
52 }
53}
Describes a specific position inside a source file.
Implements the Null Coalescing Expression LEFT ?? RIGHT.
BadNullCoalescingExpression(BadExpression left, BadExpression right, BadSourcePosition position)
Constructor of the Null Coalescing Expression.
override IEnumerable< BadObject > InnerExecute(BadExecutionContext context)
Base Implementation for all Expressions used inside the Script.
BadSourcePosition Position
The source Position of the Expression.
IEnumerable< BadObject > Execute(BadExecutionContext context)
Evaluates the Expression within the current Execution Context.
Base Implementation of all Binary Expressions.
BadExpression Right
Right side of the Expression.
The Execution Context. Every execution of a script needs a context the script is running in....
The Base Class for all BadScript Objects.
Definition BadObject.cs:14
static readonly BadObject Null
The Null Value for the BadScript Language.
Definition BadObject.cs:28
Contains Shared Data Structures and Functionality.
Contains the Access Expressions for the BadScript2 Language.
Contains the Binary Expressions for the BadScript2 Language.
Contains the Runtime Objects.
Definition BadArray.cs:10
Contains the Runtime Implementation.