using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace csmic
{
///
/// Represents the operation types supported by a scripted macro.
///
internal enum OperationType
{
///
/// Represents a conditional block.
///
If,
///
/// Represents a conditional else block.
///
Else,
///
/// Represents a complete conditional block.
///
IfElse,
///
/// A while block.
///
While,
///
/// A for block.
///
For,
///
/// A function declaration.
///
FunctionDeclaration,
///
/// An echo statement.
///
Echo,
///
/// A say statement.
///
Say,
///
/// A display statement.
///
Display,
///
/// A statement to execute.
///
Statement,
///
/// A string to display.
///
String,
///
/// An unknown or malformed block.
///
Unknown
}
///
/// An operation object that executes a specified action.
///
internal class MacroOperation
{
#region Members
///
/// The type of operation represented by the operation.
///
private OperationType operationType;
///
/// The collection of children nodes that belong to the operation.
///
private List children;
///
/// A list of the necesary input to execute the operation.
///
private List input;
#endregion
#region Constructor
///
/// Creates a new macro operation node.
///
/// The type of operation the node represents.
public MacroOperation(OperationType operationType)
{
this.operationType = operationType;
this.children = new List();
this.input = new List();
}
#endregion
#region Properties
///
/// Gets or sets the children nodes of the operation.
///
public List Children
{
get
{
return this.children;
}
set
{
this.children = value;
}
}
///
/// Gets or sets the input for the operation.
///
public List Input
{
get
{
return this.input;
}
set
{
this.input = value;
}
}
///
/// Gets or sets the operation type for this operation.
///
public OperationType OperationType
{
get
{
return this.operationType;
}
set
{
this.operationType = value;
}
}
#endregion
}
}