protected BnfiTermCopy(Type domainType, BnfTerm bnfTerm, string name) : base(domainType, name: name ?? GetName(domainType, bnfTerm)) { if (bnfTerm != null) { // "this" BnfiTermCopy is not an independent bnfTerm, just a syntax magic for BnfiTermRecord<TType> (we were called by the Copy method) this.IsContractible = true; this.RuleRaw = bnfTerm.ToBnfExpression() + GrammarHelper.ReduceHere(); } else { // "this" BnfiTermCopy is an independent bnfTerm this.IsContractible = false; } GrammarHelper.MarkTransientForced(this); // default "transient" behavior (the Rule of this BnfiTermCopyable will contain the BnfiTerm... which actually does something) }
protected BnfiTermChoice(Type domainType, string name) : base(domainType, name) { GrammarHelper.MarkTransientForced(this); // the child node already contains the created ast node }
protected BnfiTermConversion(Type domainType, string name) : base(domainType, name) { this.inverseValueConverterForUnparse = IdentityFunction; GrammarHelper.MarkTransientForced(this); // default "transient" behavior (the Rule of this BnfiTermConversion will contain the BnfiTermConversion which actually does something) }