public void AddStatement(DynaExpression Statement)
 {
     ccc.Statements.Add(Statement.Expression);
 }
Beispiel #2
0
 /// <summary>
 /// Creates a new class constructor member within this AosDynaClass object.
 /// </summary>
 /// <param name="Arguements">An array of DynaArguement objects containing the incoming arguements for this class constructor.</param>
 /// <param name="Statements">An array of DynaStatement objects containing the expression statements contained within this class constructor.</param>
 /// <param name="Scope">A value of type MemberAttributes indicating the scope of this class constructor.</param>
 public void CreateConstructor(DynaArgument[] Arguments, DynaExpression[] Statements, System.CodeDom.MemberAttributes Scope)
 {
     DynaConstructor cc = new DynaConstructor();
     cc.TypeMember.Attributes = Scope;
     foreach (DynaExpression stmt in Statements)
         cc.TypeMember.Statements.Add(stmt.Expression);
     AddConstructor(cc);
 }
Beispiel #3
0
 /// <summary>
 /// Creates a new field member within this DynaClass object.
 /// </summary>
 /// <param name="Name">A string value containing the name of the new field.</param>
 /// <param name="ValueType">A Type class object indicating the data-type of the new field.</param>
 /// <param name="GetStatements">An array of DynaStatement objects containing the expression statements contained within the 'Set' portion of the field.</param>
 /// <param name="SetStatements">An array of DynaStatement objects containing the expression statements contained within the 'Get' portion of the field.</param>
 /// <param name="Scope">A value of type MemberAttributes indicating the scope of this field.</param>
 public void CreateProperty(string Name, Type ValueType, DynaExpression[] SetStatements, DynaExpression[] GetStatements, System.CodeDom.MemberAttributes Scope)
 {
     DynaProperty prop = new DynaProperty(Name, ValueType, Scope);
     foreach (DynaExpression stmt in SetStatements)
         prop.AddSetStatement(stmt);
     foreach (DynaExpression stmt in GetStatements)
         prop.AddGetStatement(stmt);
     this.AddProperty(prop);
 }
 public DynaOperatorExpression(DynaExpression leftExpression, string rightVariable, CodeBinaryOperatorType Operation)
     : this(leftExpression.Expression, new CodeVariableReferenceExpression(rightVariable), Operation)
 { }
 /// <summary>
 /// Sets the return value of this statement.
 /// </summary>
 /// <param name="ReturnExpression">A DynaStatement object whose result will be the return value.</param>
 public void SetReturnExpression(DynaExpression ReturnExpression)
 {
     this._ce = ReturnExpression.Expression;
 }
 public DynaAssignmentStatement(string VarName, DynaExpression AssignValue)
     : this(VarName, AssignValue.Expression)
 { }
 public DynaOperatorExpression(DynaExpression leftExpression, DynaExpression rightExpression, CodeBinaryOperatorType Operation)
     : this(leftExpression.Expression, rightExpression.Expression, Operation)
 { }
 public DynaArrayIndexerExpression(string VariableName, DynaExpression IndexExpression)
     : this(VariableName, IndexExpression.Expression)
 { }
 public DynaDeclarationStatement(string VariableName, Type DataType, DynaExpression InitExpression)
     : this(VariableName, DataType.FullName, InitExpression)
 { }
 public DynaArrayCreateExpression(string DataType, DynaExpression[] ArrayInitializers)
     : this(DataType)
 {
     foreach (DynaExpression de in ArrayInitializers)
         cec.Add(de.Expression);
 }
 public void SetArraySize(DynaExpression value)
 {
     this._size = value.Expression;
 }
 public DynaArrayCreateExpression(Type DataType, DynaExpression[] ArrayInitializers)
     : this(DataType.FullName, ArrayInitializers)
 { }
 public DynaArrayCreateExpression(string DataType, DynaExpression SizeExpression)
     : this(DataType)
 {
     this._size = SizeExpression.Expression;
 }
 public DynaArrayCreateExpression(Type DataType, DynaExpression SizeExpression)
     : this(DataType.FullName, SizeExpression)
 { }
 public DynaIterationStatement(DynaStatement InitValue, DynaExpression LoopCondition, DynaStatement ValueIncrement, DynaStatement[] LoopStatements)
 {
     switch (InitValue.GetType().Name.ToLower())
     {
         case "dynaiterationstatement":
             this._initValue = (InitValue as DynaIterationStatement).Statement;
             break;
         case "dynaassignmentstatement":
             this._initValue = (InitValue as DynaAssignmentStatement).Statement;
             break;
         case "dynaconditionstatement":
             this._initValue = (InitValue as DynaConditionStatement).Statement;
             break;
         case "dynareturnstatement":
             this._initValue = (InitValue as DynaReturnStatement).Statement;
             break;
         case "dynadeclarationstatement":
             this._initValue = (InitValue as DynaDeclarationStatement).Statement;
             break;
         case "dynacommentstatement":
             this._initValue = (InitValue as DynaCommentStatement).Statement;
             break;
     }
     switch (LoopCondition.GetType().Name.ToLower())
     {
         case "dynamethodexpression":
             this._testCondition = (LoopCondition as DynaMethodExpression).Expression;
             break;
         case "dynaarraycreateexpression":
             this._testCondition = (LoopCondition as DynaArrayCreateExpression).Expression;
             break;
         case "dynaarrayindexerexpression":
             this._testCondition = (LoopCondition as DynaArrayIndexerExpression).Expression;
             break;
         case "dynaoperatorexpression":
             this._testCondition = (LoopCondition as DynaOperatorExpression).Expression;
             break;
     }
     switch (ValueIncrement.GetType().Name.ToLower())
     {
         case "dynaiterationstatement":
             this._valueInc = (ValueIncrement as DynaIterationStatement).Statement;
             break;
         case "dynaassignmentstatement":
             this._valueInc = (ValueIncrement as DynaAssignmentStatement).Statement;
             break;
         case "dynaconditionstatement":
             this._valueInc = (ValueIncrement as DynaConditionStatement).Statement;
             break;
         case "dynareturnstatement":
             this._valueInc = (ValueIncrement as DynaReturnStatement).Statement;
             break;
         case "dynadeclarationstatement":
             this._valueInc = (ValueIncrement as DynaDeclarationStatement).Statement;
             break;
         case "dynacommentstatement":
             this._valueInc = (ValueIncrement as DynaCommentStatement).Statement;
             break;
     }
     if (LoopStatements != null)
     {
         foreach (DynaStatement ds in LoopStatements)
             switch (ds.GetType().Name.ToLower())
             {
                 case "dynaiterationstatement":
                     csc.Add((ds as DynaIterationStatement).Statement);
                     break;
                 case "dynaassignmentstatement":
                     csc.Add((ds as DynaAssignmentStatement).Statement);
                     break;
                 case "dynaconditionstatement":
                     csc.Add((ds as DynaConditionStatement).Statement);
                     break;
                 case "dynareturnstatement":
                     csc.Add((ds as DynaReturnStatement).Statement);
                     break;
                 case "dynadeclarationstatement":
                     csc.Add((ds as DynaDeclarationStatement).Statement);
                     break;
                 case "dynacommentstatement":
                     csc.Add((ds as DynaCommentStatement).Statement);
                     break;
             }
     }
 }
 public void SetInitExpression(DynaExpression InitExpression)
 {
     this._init = InitExpression.Expression;
 }
 public void SetLoopCondition(DynaExpression value)
 {
     switch (value.GetType().Name.ToLower())
     {
         case "dynamethodexpression":
             this._testCondition = (value as DynaMethodExpression).Expression;
             break;
         case "dynaarraycreateexpression":
             this._testCondition = (value as DynaArrayCreateExpression).Expression;
             break;
         case "dynaarrayindexerexpression":
             this._testCondition = (value as DynaArrayIndexerExpression).Expression;
             break;
         case "dynaoperatorexpression":
             this._testCondition = (value as DynaOperatorExpression).Expression;
             break;
     }
 }
 public DynaObjectCreateExpression(string ValueType, DynaExpression[] Parameters)
     : this(ValueType)
 {
     foreach (DynaExpression de in Parameters)
         cec.Add(de.Expression);
 }
 public DynaConditionStatement(DynaExpression TestCondition)
     : this(TestCondition.Expression)
 { }
 public DynaObjectCreateExpression(Type ValueType, DynaExpression[] Parameters)
     : this(ValueType.FullName, Parameters)
 { }
 public DynaOperatorExpression(DynaExpression leftExpression, object rightExpression, CodeBinaryOperatorType Operation)
     : this(leftExpression.Expression, new CodePrimitiveExpression(rightExpression), Operation)
 { }
 //***************************************************************************
 // Public Methods
 // 
 public void AddParameter(DynaExpression value)
 {
     cec.Add(value.Expression);
 }
 public DynaReturnStatement(DynaExpression ReturnExpression)
     : this(ReturnExpression.Expression)
 { }
 public DynaMethodExpression(string ExpressionNamespace, string MethodName, DynaExpression ExpressionArg)
     : this(ExpressionNamespace, MethodName, new DynaExpression[] { ExpressionArg })
 { }
Beispiel #25
0
 /// <summary>
 /// Creates a new method member within this DynaClass object.
 /// </summary>
 /// <param name="Name">A string value containing the name of the new method.</param>
 /// <param name="Arguements">An array of DynaArguement objects specifying the incoming arguements for the new methdod.</param>
 /// <param name="Statements">An array of DynaStatement objects specifying the expression statements contained within this method.</param>
 /// <param name="Scope">A value of type MemberAttributes indicating the scope of the new method.</param>
 public void CreateMethod(string Name, DynaArgument[] Arguements, DynaExpression[] Statements, System.CodeDom.MemberAttributes Scope)
 {
     DynaMethod dm = new DynaMethod(Name);
     dm.TypeMember.Attributes = Scope;
     foreach (DynaExpression stmt in Statements)
         dm.TypeMember.Statements.Add(stmt.Expression);
     AddMethod(dm);
 }
 public DynaMethodExpression(string ExpressionNamespace, string MethodName, DynaExpression[] ExpressionArgs)
 {
     _methodName = MethodName;
     _nameSpace = ExpressionNamespace;
     if (ExpressionArgs != null && ExpressionArgs.Length > 0)
     {
         foreach (DynaExpression de in ExpressionArgs)
             switch (de.GetType().Name.ToLower())
             {
                 case "dynamethodexpression":
                     cec.Add((de as DynaMethodExpression).Expression);
                     break;
                 case "dynaarraycreateexpression":
                     cec.Add((de as DynaArrayCreateExpression).Expression);
                     break;
                 case "dynaarrayindexerexpression":
                     cec.Add((de as DynaArrayIndexerExpression).Expression);
                     break;
                 case "dynaoperatorexpression":
                     cec.Add((de as DynaOperatorExpression).Expression);
                     break;
             }
     }
 }
Beispiel #27
0
 /// <summary>
 /// Creates a new entry point member within this DynaClass object.
 /// When adding this class to an DynaCode object containing other classes, there should be only *one* (1) EntryPoint for the entire DynaCode object.
 /// </summary>
 /// <param name="Arguements">An array of DynaArguement objects containing the incoming arguements for the new entry point.</param></param>
 /// <param name="Statements">An array of DynaStatement objects containing the expression statements contained within the new entry point.</param></param>
 /// <param name="Scope">A value of type MemberAttributes indicating the scope of this class constructor.</param>
 public void CreateEntryPoint(DynaArgument[] Arguements, DynaExpression[] Statements, System.CodeDom.MemberAttributes Scope)
 {
     DynaEntryPoint ep = new DynaEntryPoint();
     ep.TypeMember.Attributes = Scope;
     foreach (DynaExpression stmt in Statements)
         ep.TypeMember.Statements.Add(stmt.Expression);
     AddEntryPoint(ep);
 }
 /// <summary>
 /// Adds an argument value to this method call.  Be cautious, when adding values here, that they are added in the proper order.
 /// </summary>
 /// <param name="value">A DynaExpression object containing an expression whose result value will be passed to the method.</param>
 public void AddArgument(DynaExpression value)
 {
     switch (value.GetType().Name.ToLower())
     {
         case "dynamethodexpression":
             cec.Add((value as DynaMethodExpression).Expression);
             break;
         case "dynaarraycreateexpression":
             cec.Add((value as DynaArrayCreateExpression).Expression);
             break;
         case "dynaarrayindexerexpression":
             cec.Add((value as DynaArrayIndexerExpression).Expression);
             break;
         case "dynaoperatorexpression":
             cec.Add((value as DynaOperatorExpression).Expression);
             break;
     }
 }
Beispiel #29
0
 public void AddSetStatement(DynaExpression value)
 {
     csc2.Add(value.Statement);
 }
 public DynaCatchClause(string ExVarName, string CatchType, DynaExpression[] Statements)
     : this(ExVarName, CatchType)
 {
     foreach (DynaExpression ds in Statements)
         ccc.Statements.Add(ds.Expression);
 }