public static LookupItem[] Compile(ParticleConstraint particle) { var instance = new ParticleCompiler(); instance.Visit(particle); var result = new LookupItem[instance._path.Count]; instance._path.CopyTo(result); return(result); }
private void Visit(ParticleConstraint particle) { switch (particle) { case ElementParticle element: { Visit(element); break; } case CompositeParticle any when any.ParticleType == ParticleType.Any: { throw new NotSupportedException(ExceptionMessages.AnyParticleTypeNotSupported); } case CompositeParticle composite: { VisitComposite(composite); break; } } }
public static CompiledParticle Compile(this ParticleConstraint particle) => new CompiledParticle(particle);
public static ParticlePathItem Create(ParticleConstraint particle, byte index) => new ParticlePathItem(particle.ParticleType, index);
public CompiledParticle(ParticleConstraint particle) { Particle = particle; _lookup = new Lazy <LookupItem[]>(() => ParticleCompiler.Compile(Particle), true); }
internal static global::System.Runtime.InteropServices.HandleRef getCPtr(ParticleConstraint obj) { return((obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr); }