コード例 #1
0
ファイル: SpecParser.cs プロジェクト: risc26z/decgen
        /// <summary>
        /// Parse a string containing a flags specification, using the
        /// supplied Specification to look up flag names, and return the
        /// flag specification in binary form.
        /// </summary>
        /// <param name="spec">Associated specification.</param>
        /// <param name="flags">String to be parsed.  The format is the
        /// same as that in specification rules (excluding the square
        /// brackets).</param>
        /// <returns>Binary representation of the specified flags.</returns>
        public static TristateBitArray ParseFlags(Specification spec, string flags)
        {
            var lexer  = new SpecLexer(flags);
            var parser = new SpecParser(spec, lexer);

            return(parser.ParseFlags());
        }
コード例 #2
0
ファイル: SpecParser.cs プロジェクト: risc26z/decgen
        /// <summary>
        /// Parse a specification file/resource and populate the Specification
        /// with its contents.
        /// </summary>
        public static void Parse(Specification spec, StreamReader file)
        {
            var lexer  = new SpecLexer(file);
            var parser = new SpecParser(spec, lexer);

            parser.Parse();
        }
コード例 #3
0
ファイル: Specification.cs プロジェクト: risc26z/decgen
 /// <summary>
 /// Load specification from file or resource.
 /// </summary>
 public void Load(StreamReader textReader)
 {
     SpecParser.Parse(this, textReader);
 }