public static NumberLiteral AttachNumberLiteralInfo(this NumberLiteral numberLiteral, NumberLiteralInfo numberLiteralInfo) { numberLiteralInfo.NumberLiteral = numberLiteral; return numberLiteral; }
public static NumberLiteral AttachNumberLiteralInfo(this NumberLiteral numberLiteral, NumberLiteralInfo numberLiteralInfo) { numberLiteralInfo.NumberLiteral = numberLiteral; return(numberLiteral); }
public static BnfiTermConversion <TNumberLiteral> CreateNumberLiteral <TNumberLiteral>(NumberLiteralInfo numberLiteralInfo, string name, NumberOptions options) where TNumberLiteral : INumberLiteral, new() { return(new NumberLiteral(name: name, options: options).AttachNumberLiteralInfo(numberLiteralInfo).IntroNumberLiteral <TNumberLiteral>(numberLiteralInfo)); }
public static BnfiTermConversion <TNumberLiteral> IntroNumberLiteral <TNumberLiteral>(NumberLiteral numberLiteral, NumberLiteralInfo numberLiteralInfo) where TNumberLiteral : INumberLiteral, new() { var _numberLiteral = Intro( numberLiteral, (context, parseNode) => { string tokenText = parseNode.FindTokenAndGetText(); bool hasExplicitTypeModifier = numberLiteralInfo.HasTokenTextExplicitTypeSuffix(tokenText); NumberLiteralBase @base = numberLiteralInfo.GetBaseFromTokenText(tokenText); return(new TNumberLiteral() { Value = parseNode.FindToken().Value, HasExplicitTypeModifier = hasExplicitTypeModifier, Base = @base }); }, NoUnparseByInverse <TNumberLiteral>(), astForChild: false ); _numberLiteral.UtokenizerForUnparse = (formatProvider, reference, astValue) => numberLiteralInfo.NumberLiteralToText(reference, formatProvider); return(_numberLiteral.MarkLiteral()); }
public static BnfiTermConversion <TNumberLiteral> IntroNumberLiteral <TNumberLiteral>(this NumberLiteral numberLiteral, NumberLiteralInfo numberLiteralInfo) where TNumberLiteral : INumberLiteral, new() { return(BnfiTermConversion.IntroNumberLiteral <TNumberLiteral>(numberLiteral, numberLiteralInfo)); }