GetAllImportedRules() публичный Метод

public GetAllImportedRules ( ) : HashSet
Результат HashSet
Пример #1
0
        protected virtual void GenerateNFAs( Grammar g )
        {
            IGraphGenerator generator = GenerateDgmlGraphs ? (IGraphGenerator)new DgmlGenerator(g) : new DOTGenerator(g);
            HashSet<Rule> rules = g.GetAllImportedRules();
            rules.UnionWith( g.Rules );

            foreach ( Rule r in rules )
            {
                try
                {
                    string dot = generator.GenerateGraph( r.StartState );
                    if ( dot != null )
                    {
                        WriteGraphFile( g, r, dot, generator.FileExtension );
                    }
                }
                catch ( IOException ioe )
                {
                    ErrorManager.Error( ErrorManager.MSG_CANNOT_WRITE_FILE, ioe );
                }
            }
        }
Пример #2
0
        protected virtual void GenerateNFAs( Grammar g )
        {
            DOTGenerator dotGenerator = new DOTGenerator( g );
            ICollection<Rule> rules = g.GetAllImportedRules();
            rules.addAll( g.Rules );

            foreach ( Rule r in rules )
            {
                try
                {
                    string dot = dotGenerator.GetDOT( r.startState );
                    if ( dot != null )
                    {
                        WriteDOTFile( g, r, dot );
                    }
                }
                catch ( IOException ioe )
                {
                    ErrorManager.Error( ErrorManager.MSG_CANNOT_WRITE_FILE, ioe );
                }
            }
        }