Пример #1
0
 /// <summary>
 /// Проверка наличия библиотеки
 /// </summary>
 /// <param name="tree"></param>
 /// <param name="useClause"></param>
 public bool CheckLibraryClause(ParserRuleContext tree, LibraryClause libraryClause)
 {
     foreach (string lib in libraryClause.getLibraries())
     {
         if (libraryManager.ContainsLibrary(lib) == false)
         {
             throw new VHDL.ParseError.vhdlUnknownLibraryException(tree, FileName, lib);
             return(false);
         }
         else
         {
             LibraryDeclarativeRegion libraryDecl = libraryManager.GetLibrary(lib);
             if (libraryClause.LibraryDeclarativeRegion.Contains(libraryDecl) == false)
             {
                 libraryClause.LibraryDeclarativeRegion.Add(libraryDecl);
             }
         }
     }
     return(true);
 }
 protected override void visitLibraryClause(LibraryClause libraryClause)
 {
     writer.Append(KeywordEnum.LIBRARY.ToString()).Append(' ');
     writer.AppendStrings(libraryClause.getLibraries(), ", ");
     writer.Append(";").NewLine();
 }