本文整理汇总了C#中Production类的典型用法代码示例。如果您正苦于以下问题:C# Production类的具体用法?C# Production怎么用?C# Production使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Production类属于命名空间,在下文中一共展示了Production类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Add
public void Add()
{
Nonterminal nt = new Nonterminal();
Production p = new Production();
nt.Add(p);
Assert.IsTrue(nt.Contains(p));
}
示例2: UpdateDisplay
public void UpdateDisplay(ProductionShift shift, Production production, IEnumerable<ProductionStop> allStops)
{
productionStart = production.ProductionStart.ToString("g", System.Globalization.CultureInfo.CurrentUICulture);
productionShiftStartDate = shift.ProductionStart.ToShortDateString();
ClearDisplay();
ClearChart(chartShift);
ClearChart(chartProduction);
if (production == null ||
shift == null)
return;
team = shift.Team.Name;
DisplayOrder(production.Order);
DisplayProduct(production.Product);
DisplayProductionStart(shift.ProductionStart, production.ProductionStart);
DisplayProductionTime(shift.Duration, production.Duration);
DisplayProducedItems(shift.ProducedItems, production.ProducedItems, production.ProducedItemsPerHour);
DisplayDiscardedItems(shift.DiscardedItems, production.DiscardedItems);
DisplayFactors(new FactorCalculator(shift), new FactorCalculator(production));
DisplayStopRegistrationsOnChart(chartShift, shift.ProductionStopRegistrations, allStops, production.ValidatedStartTime);
DisplayStopRegistrationsOnChart(chartProduction, production.ProductionStopRegistrations, allStops, production.ValidatedStartTime);
}
示例3: InternalGenerate
/// <summary>
/// </summary>
/// <param name="targetclasses"></param>
/// <returns></returns>
protected override IEnumerable<Production> InternalGenerate(IBSharpClass[] targetclasses){
var genfactory = new Production{
FileName = "Adapters/Model.cs",
GetContent = () => new BaseModelWriter(Model).ToString()
};
yield return genfactory;
}
示例4: PrecedenceBasedParserAction
public PrecedenceBasedParserAction(BnfTerm shiftTerm, ParserState newShiftState, Production reduceProduction)
{
_reduceAction = new ReduceParserAction(reduceProduction);
var reduceEntry = new ConditionalEntry(CheckMustReduce, _reduceAction, "(Precedence comparison)");
ConditionalEntries.Add(reduceEntry);
DefaultAction = _shiftAction = new ShiftParserAction(shiftTerm, newShiftState);
}
示例5: IntermediateNode
internal IntermediateNode(Item item, int startPosition, int endPosition) : base(startPosition, endPosition) {
Item = item;
// these two are used just for figuring out equality
_production = item.Production;
_currentPosition = item.CurrentPosition;
}
示例6: Child
/**
* <summary>Called when adding a child to a parse tree
* node.</summary>
*
* <param name='node'>the parent node</param>
* <param name='child'>the child node, or null</param>
*
* <exception cref='ParseException'>if the node analysis
* discovered errors</exception>
*/
public override void Child(Production node, Node child)
{
switch (node.Id) {
case (int) LogicalConstants.FORMULE:
ChildFormule(node, child);
break;
case (int) LogicalConstants.FORMULE_PRED:
ChildFormulePred(node, child);
break;
case (int) LogicalConstants.FORMULE_BIN:
ChildFormuleBin(node, child);
break;
case (int) LogicalConstants.ATOM:
ChildAtom(node, child);
break;
case (int) LogicalConstants.PREDICAT:
ChildPredicat(node, child);
break;
case (int) LogicalConstants.PRED1:
ChildPred1(node, child);
break;
case (int) LogicalConstants.PRED2:
ChildPred2(node, child);
break;
case (int) LogicalConstants.PRED3:
ChildPred3(node, child);
break;
}
}
示例7: Item
private Item(Production production, int index, State parent, Item prevItem)
{
if (production == null || parent == null)
{
throw new ArgumentNullException();
}
if (index < 0 || index > production.Symbols.Count)
{
throw new ArgumentOutOfRangeException();
}
if (index == 0 && prevItem != null)
{
throw new ArgumentException();
}
if (index > 0 && prevItem == null)
{
throw new ArgumentNullException();
}
this.production = production;
this.index = index;
this.parent = parent;
this.prevItem = prevItem;
this.derivations = index == 0 ? null : new List<object>();
}
示例8: Create
public void Create()
{
Production p1 = new Production();
Production p2 = new Production();
Nonterminal nt = new Nonterminal(p1, p2);
Assert.AreEqual(2, nt.Count);
Assert.IsTrue(nt.Contains(p1) && nt.Contains(p2));
}
示例9: Grammar
public Grammar(
Production startProduction,
Production[] productionList,
Token[] tokenList)
{
_startProduction = startProduction;
_productionList = productionList;
_tokenList = tokenList;
}
示例10: TransitionAction
public TransitionAction(ParserAction action, Production reduceByProduction)
: this(action)
{
if (action != ParserAction.Reduce)
throw new Exception("Can only define the production to reduce by for the reduce action.");
if (reduceByProduction == null)
throw new ArgumentNullException("reduceByProduction");
ReduceByProduction = reduceByProduction;
}
示例11: PostSave
public Production PostSave(Production production)
{
if (production.Id > 0)
DatabaseContext.Database.Update(production);
else
DatabaseContext.Database.Save(production);
return production;
}
示例12: Form1
public Form1()
{
InitializeComponent();
Production m = new Production("AMC", "01");
cbProductions.Items.Add(m);
m = new Production("Showtime", "02");
cbProductions.Items.Add(m);
m = new Production("HBO", "03");
cbProductions.Items.Add(m);
}
示例13: Child
/**
* <summary>Called when adding a child to a parse tree
* node.</summary>
*
* <param name='node'>the parent node</param>
* <param name='child'>the child node, or null</param>
*
* <exception cref='ParseException'>if the node analysis
* discovered errors</exception>
*/
public override void Child(Production node, Node child)
{
switch (node.Id) {
case (int) GrammarConstants.DOCUMENT:
ChildDocument(node, child);
break;
case (int) GrammarConstants.TEXT:
ChildText(node, child);
break;
}
}
示例14: AddTwoProductionsWithSameOrder
public void AddTwoProductionsWithSameOrder()
{
Production production1 = new Production("Machine A", product1, order1, 1000, 100);
Production production2 = new Production("Machine A", product1, order1, 1000, 100);
using (IEntityRepository<Production> repository = factory.CreateEntityRepository<Production>())
{
repository.Save(production1);
repository.Save(production2);
}
}
示例15: Add
public override void Add(Production item)
{
if (Productions.Count == 0)
{
var initialProduction = new Production(new NonTerminal(INITAL_SYMBOL_NAME), item.Symbol, null)
{ID = INITAL_SYMBOL_ID};
Productions.Add(initialProduction);
}
base.Add(item);
}