/// <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; }
public override void Visit(Import import) { //Check if import exists import.GetModuleId().AcceptVisitor(this); }
/// <summary> /// Add an import to module /// </summary> /// <param name="import">Import to add</param> public void AddImport(Import import) { ImportList.Add(import); }
public virtual void Visit(Import import) { VisitSubNodes(import); }