示例#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);
 }