Beispiel #1
0
        protected override void EnterPackageStatement(PackageStatement statement)
        {
            /* There is nothing to Push Back onto the Stack here. But we do need to maintain
             * a reference to the Package for purposes of conversion to CSharp Namespace. */

            PackageStatement = statement;
        }
        protected DescriptorCodeGenerationStrategyBase(PackageStatement packageStatement)
        {
            PackageStatement = packageStatement ?? throw new ArgumentNullException($"{nameof(packageStatement)}");


            if (packageStatement.Parent is ProtoDescriptor protoDescriptor)
            {
                LazyNormalFieldStatementOrdinals = new Lazy <IEnumerable <long> >(
                    () =>
                {
                    var satParametersMessageStatement = protoDescriptor.Items.OfType <MessageStatement>()
                                                        .SingleOrDefault(x => x.Name.Equals("SatParameters"));

                    return(satParametersMessageStatement?.Items.OfType <NormalFieldStatement>()
                           .Select(x => x.Number).OrderBy(x => x).ToArray());
                }
                    );
            }
            else
            {
                LazyNormalFieldStatementOrdinals = new Lazy <IEnumerable <long> >(() => GetRange(0L));

                throw new InvalidOperationException($"Unable to locate the '{typeof(ProtoDescriptor).FullName}' parent.");
            }
        }
        protected override void VisitPackageStatement(PackageStatement statement)
        {
            EnterPackageStatement(statement);

            base.VisitPackageStatement(statement);

            ExitPackageStatement(statement);
        }
 internal static RestartAlgorithmsClassDeclarationCodeGenerationStrategy Create(
     PackageStatement packageStatement, NormalFieldStatement normalFieldStatement)
 => new RestartAlgorithmsClassDeclarationCodeGenerationStrategy(packageStatement, normalFieldStatement);
 private RestartAlgorithmsClassDeclarationCodeGenerationStrategy(
     PackageStatement packageStatement, NormalFieldStatement normalFieldStatement)
     : base(packageStatement, normalFieldStatement)
 {
 }
 protected abstract void ExitPackageStatement(PackageStatement statement);
 protected abstract void EnterPackageStatement(PackageStatement statement);
Beispiel #8
0
 protected override void ExitPackageStatement(PackageStatement statement)
 {
 }
Beispiel #9
0
 protected RestartAlgorithmsClassDeclarationCodeGenerationStrategyBase(
     PackageStatement packageStatement, NormalFieldStatement normalFieldStatement)
     : base(packageStatement, normalFieldStatement, BaseClassSpecification.RepeatedParameter)
 {
 }
Beispiel #10
0
 private ElementParameterClassDeclarationCodeGenerationStrategy(
     PackageStatement packageStatement, NormalFieldStatement normalFieldStatement)
     : base(packageStatement, normalFieldStatement)
 {
 }
Beispiel #11
0
 internal static ElementParameterClassDeclarationCodeGenerationStrategy Create(
     PackageStatement packageStatement, NormalFieldStatement normalFieldStatement)
 => new ElementParameterClassDeclarationCodeGenerationStrategy(packageStatement, normalFieldStatement);