public static IPopulateScope <WeakMemberReference, ISetUpMember> PopulateScope( IKey item, bool v, IPopulateScope <IWeakTypeReference, ISetUpTypeReference> typeToken) { return(new MemberDefinitionPopulateScope(item, v, typeToken)); }
public ITokenMatching <IPopulateScope <WeakImplementationDefinition, ISetUpMethod> > TryMake(IMatchedTokenMatching tokenMatching) { IPopulateScope <IWeakTypeReference, ISetUpTypeReference> context = null, input = null, output = null; var match = tokenMatching .Has(new KeyWordMaker("implementation"), out var _) .HasSquare(x => x .HasLine(y => y .HasElement(z => z.Has(new TypeMaker(), out context)) .Has(new DoneMaker())) .HasLine(y => y .HasElement(z => z.Has(new TypeMaker(), out input)) .Has(new DoneMaker())) .HasLine(y => y .HasElement(z => z.Has(new TypeMaker(), out output)) .Has(new DoneMaker())) .Has(new DoneMaker())) .OptionalHas(new NameMaker(), out var contextName) .OptionalHas(new NameMaker(), out var parameterName) .Has(new BodyMaker(), out var body); if (match is IMatchedTokenMatching matched) { var elements = tokenMatching.Context.ParseBlock(body); var contextNameString = contextName?.Item ?? "context"; var contextDefinition = MemberDefinitionMaker.PopulateScope( new NameKey(contextNameString), false, context ); var parameterNameString = parameterName?.Item ?? "input"; var parameterDefinition = MemberDefinitionMaker.PopulateScope( new NameKey(parameterNameString), false, input ); var resultDefinition = MemberDefinitionMaker.PopulateScope( new ImplicitKey(), false, output ); return(TokenMatching <IPopulateScope <WeakImplementationDefinition, ISetUpMethod> > .MakeMatch( matched.Tokens, matched.Context, new PopulateScopeImplementationDefinition( contextDefinition, parameterDefinition, elements, resultDefinition))); } return(TokenMatching <IPopulateScope <WeakImplementationDefinition, ISetUpMethod> > .MakeNotMatch(match.Context)); }
public BinaryPopulateScope(IPopulateScope <IFrontendType> left, IPopulateScope <IFrontendType> right, BinaryOperation.MakeBinaryType <IWeakTypeReference> make) { this.left = left ?? throw new ArgumentNullException(nameof(left)); this.right = right ?? throw new ArgumentNullException(nameof(right)); this.make = make ?? throw new ArgumentNullException(nameof(make)); }
public static IPopulateScope <IWeakTypeReference> PopulateScope(IPopulateScope <IConvertableFrontendType <IVerifiableType> > left, IPopulateScope <IConvertableFrontendType <IVerifiableType> > right, BinaryOperation.MakeBinaryType <IWeakTypeReference> make) { return(new BinaryPopulateScope(left, right, make)); }
public BinaryPopulateScope(IPopulateScope <IFrontendCodeElement, ISetUpValue> left, IPopulateScope <IFrontendCodeElement, ISetUpValue> right, BinaryOperation.Make <TFrontendCodeElement> make) { this.left = left ?? throw new ArgumentNullException(nameof(left)); this.right = right ?? throw new ArgumentNullException(nameof(right)); this.make = make ?? throw new ArgumentNullException(nameof(make)); }
public PopulateScopeImplementationDefinition( IPopulateScope <WeakMemberReference, ISetUpMember> contextDefinition, IPopulateScope <WeakMemberReference, ISetUpMember> parameterDefinition, IPopulateScope <IFrontendCodeElement, ISetUpSideNode>[] elements, IPopulateScope <WeakMemberReference, ISetUpMember> output) { this.contextDefinition = contextDefinition ?? throw new ArgumentNullException(nameof(contextDefinition)); this.parameterDefinition = parameterDefinition ?? throw new ArgumentNullException(nameof(parameterDefinition)); this.elements = elements ?? throw new ArgumentNullException(nameof(elements)); this.output = output ?? throw new ArgumentNullException(nameof(output)); }
public static IPopulateScope <WeakMethodDefinition, ISetUpMethod> PopulateScope( IPopulateScope <WeakMemberReference, ISetUpMember> parameterDefinition, IPopulateScope <IConvertableFrontendCodeElement <ICodeElement>, ISetUpSideNode>[] elements, IPopulateScope <WeakMemberReference, ISetUpMember> output, bool isEntryPoint) { return(new MethodDefinitionPopulateScope(parameterDefinition, elements, output, isEntryPoint)); }
public static IPopulateScope <WeakImplementationDefinition, ISetUpMethod> PopulateScope( IPopulateScope <WeakMemberReference, ISetUpMember> contextDefinition, IPopulateScope <WeakMemberReference, ISetUpMember> parameterDefinition, IPopulateScope <IConvertableFrontendCodeElement <ICodeElement>, ISetUpSideNode>[] elements, IPopulateScope <WeakMemberReference, ISetUpMember> output) { return(new PopulateScopeImplementationDefinition( contextDefinition, parameterDefinition, elements, output)); }
public MethodDefinitionPopulateScope( IPopulateScope <WeakMemberReference, ISetUpMember> parameterDefinition, IPopulateScope <IFrontendCodeElement, ISetUpSideNode>[] elements, IPopulateScope <WeakMemberReference, ISetUpMember> output, bool isEntryPoint ) { this.parameterDefinition = parameterDefinition ?? throw new ArgumentNullException(nameof(parameterDefinition)); this.elements = elements ?? throw new ArgumentNullException(nameof(elements)); this.output = output ?? throw new ArgumentNullException(nameof(output)); this.isEntryPoint = isEntryPoint; }
public WeakAssignOperationPopulateScope(IPopulateScope <IFrontendCodeElement> left, IPopulateScope <IFrontendCodeElement> right) { this.left = left ?? throw new ArgumentNullException(nameof(left)); this.right = right ?? throw new ArgumentNullException(nameof(right));; }
public MemberDefinitionPopulateScope(IKey item, bool v, IPopulateScope <IWeakTypeReference, ISetUpTypeReference> typeToken) { memberName = item ?? throw new ArgumentNullException(nameof(item)); isReadonly = v; type = typeToken ?? throw new ArgumentNullException(nameof(typeToken)); }
public TrailingPopulateScope(IPopulateScope <IFrontendCodeElement> left, TrailingOperation.Make <TFrontendCodeElement> make) { this.left = left ?? throw new ArgumentNullException(nameof(left)); this.make = make ?? throw new ArgumentNullException(nameof(make)); }
public static IPopulateScope <TFrontendCodeElement> PopulateScope(IPopulateScope <IConvertableFrontendCodeElement <ICodeElement> > left, TrailingOperation.Make <TFrontendCodeElement> make) { return(new TrailingPopulateScope(left, make)); }
public WeakPathOperationPopulateScope(IPopulateScope <IFrontendCodeElement> left, string name) { this.left = left ?? throw new ArgumentNullException(nameof(left)); this.name = name ?? throw new ArgumentNullException(nameof(name)); }
public ITokenMatching <IPopulateScope <WeakMethodDefinition, ISetUpMethod> > TryMake(IMatchedTokenMatching tokenMatching) { { IPopulateScope <IWeakTypeReference, ISetUpTypeReference> inputType = null, outputType = null; var matching = tokenMatching .Has(new KeyWordMaker("method"), out var _) .HasSquare(x => x .HasLine(y => y .HasElement(z => z.Has(new TypeMaker(), out inputType)) .Has(new DoneMaker())) .HasLine(y => y .HasElement(z => z.Has(new TypeMaker(), out outputType)) .Has(new DoneMaker())) .Has(new DoneMaker())) .OptionalHas(new NameMaker(), out var parameterName) .Has(new BodyMaker(), out var body); if (matching is IMatchedTokenMatching matched) { var elements = matching.Context.ParseBlock(body); var parameterDefinition = MemberDefinitionMaker.PopulateScope( new NameKey(parameterName?.Item ?? "input"), false, inputType ); var resultDefinition = MemberDefinitionMaker.PopulateScope( new ImplicitKey(), false, outputType ); return(TokenMatching <IPopulateScope <WeakMethodDefinition, ISetUpMethod> > .MakeMatch( matched.Tokens, matched.Context, new MethodDefinitionPopulateScope( parameterDefinition, elements, resultDefinition, false) )); } } { var matching = tokenMatching .Has(new KeyWordMaker("entry-point"), out var _) .Has(new BodyMaker(), out var body); if (matching is IMatchedTokenMatching matched) { var elements = matching.Context.ParseBlock(body); var parameterDefinition = MemberDefinitionMaker.PopulateScope( new NameKey("input"), false, TypeReferanceMaker.PopulateScope(new NameKey("empty")) ); var resultDefinition = MemberDefinitionMaker.PopulateScope( new ImplicitKey(), false, TypeReferanceMaker.PopulateScope(new NameKey("empty")) ); return(TokenMatching <IPopulateScope <WeakMethodDefinition, ISetUpMethod> > .MakeMatch( matched.Tokens, matched.Context, new MethodDefinitionPopulateScope( parameterDefinition, elements, resultDefinition, true) )); } return(TokenMatching <IPopulateScope <WeakMethodDefinition, ISetUpMethod> > .MakeNotMatch( matching.Context)); } }
public static IPopulateScope <TFrontendCodeElement, ISetUpValue> PopulateScope(IPopulateScope <IFrontendCodeElement> left, IPopulateScope <IFrontendCodeElement> right, BinaryOperation.Make <TFrontendCodeElement> make) { return(new BinaryPopulateScope(left, right, make)); }