Пример #1
0
 /// <summary>
 /// Parse import
 /// </summary>
 /// <returns></returns>
 public Import ParseImport()
 {
     Import import = new Import();
     if (TokenStream.HasNext() && TokenStream.Peek(1).GetType() == TokenType.IDENTIFIER)
     {
         import.SetModuleId(ParseModuleId());
     }
     else
     {
         //Raise exception
         throw new UnexpectedToken("Unexpected token found:", CurrentToken.GetValue().ToString(), CurrentToken.GetLine());
     }
     return import;
 }
Пример #2
0
 public override void Visit(Import import)
 {
     //Check if import exists
     import.GetModuleId().AcceptVisitor(this);
 }
Пример #3
0
 /// <summary>
 /// Add an import to module
 /// </summary>
 /// <param name="import">Import to add</param>
 public void AddImport(Import import)
 {
     ImportList.Add(import);
 }
Пример #4
0
 public virtual void Visit(Import import)
 {
     VisitSubNodes(import);
 }