Example #1
0
		/// <summary>
		/// Initializes a new instance of the <see cref="UngerParser"/> class.
		/// </summary>
		/// <param name="grammar">The grammar definition.</param>
		public UngerParser(IGrammarDefinition grammar)
		{
			#region Contract
			Contract.Requires<ArgumentNullException>(grammar != null);
			#endregion
			this.grammar = grammar;
		}
Example #2
0
		/// <summary>
		/// Initializes a new instance of the <see cref="GrammarImpl"/> class.
		/// </summary>
		/// <param name="name">The name.</param>
		/// <param name="type">The type.</param>
		/// <param name="ambiguityDegree">The ambiguity degree.</param>
		/// <param name="lookAhead">The look-ahead.</param>
		/// <param name="encoding">The encoding.</param>
		/// <param name="definition">The definition.</param>
		public GrammarImpl(string name, GrammarType type, int? ambiguityDegree, int? lookAhead, IEncoding encoding, IGrammarDefinition definition)
			: base(name, type, ambiguityDegree, lookAhead, encoding)
		{
			#region Contract
			Contract.Requires<ArgumentNullException>(name != null);
			Contract.Requires<InvalidEnumArgumentException>(Enum.IsDefined(typeof(GrammarType), type));
			Contract.Requires<ArgumentNullException>(encoding != null);
			#endregion

			this.definition = definition;
		}