예제 #1
0
 protected internal BlockFormulaRef(
     IBlockFormulaRef parentBlock,
     Collection<IBlockFormulaRef> childBlocks,
     Collection<IFormulaRef> variables,
     Collection<IFormulaRef> formulas,
     IFormulaRef result,
     ITypeDeclaration type,
     IFormulaRef parent)
     : base(parentBlock, 
         childBlocks.ToReadOnlyWithCast<IBlockFormula>(), 
         variables.ToReadOnlyWithCast<IFormula>(), 
         formulas.ToReadOnlyWithCast<IFormula>(), 
         result, 
         type, 
         parent)
 {
     this.parent = parent;
     this.parentBlock = parentBlock;
     this.childBlocks = childBlocks;
     this.variables = variables;
     this.formulas = formulas;
     this.result = result;
 }
예제 #2
0
 public void PushBlock()
 {
     CurrentBlock = FormulaRef.Block(CurrentBlock);
 }
예제 #3
0
 public void PopBlock()
 {
     if (CurrentBlock == null)
     {
         throw new InvalidOperationException();
     }
     else
     {
         CurrentBlock = CurrentBlock.ParentBlock;
     }
 }
예제 #4
0
 public static IBlockFormulaRef Block(IBlockFormulaRef parentBlock)
 {
     return new BlockFormulaRef() { ParentBlock = parentBlock };
 }
예제 #5
0
 public static IBlockFormulaRef Block(IBlockFormulaRef parentBlock)
 {
     throw new NotImplementedException();
 }
예제 #6
0
 public static Collection<INodeRef> ToProperties(
     ITerminalRef<ITypeDeclaration> type,
     IBlockFormulaRef parentBlock,
     IBlockFormulaRef childBlocks,
     INonterminalRef variables,
     INonterminalRef formulas,
     INonterminalRef result)
 {
     var list = (IList<INodeRef>)new List<INodeRef>();
     INonterminalMixin.InsertToProperties(new NodeTypeRef(NonterminalType.Block), type, ref list);
     list.Insert(ParentBlockIndex, parentBlock);
     list.Insert(ChildBlocksIndex, childBlocks);
     list.Insert(VariablesIndex, variables);
     list.Insert(FormulasIndex, formulas);
     list.Insert(ResultIndex, result);
     return new Collection<INodeRef>(list);
 }
예제 #7
0
 public static IBlockFormulaRef SetParentBlock(this IList<INodeRef> source, IBlockFormulaRef value)
 {
     source[ParentBlockIndex] = value;
     return value;
 }
예제 #8
0
 public static IBlockFormulaRef SetChildBlocks(this IList<INodeRef> source, IBlockFormulaRef value)
 {
     source[ChildBlocksIndex] = value;
     return value;
 }
예제 #9
0
 public void PushBlock()
 {
     CurrentBlock = NonterminalRef.Block(CurrentBlock);
 }