//----< get next token, saving previous token >---------------------- string get() { prevTok = currTok; currTok = toker.getTok(); if (verbose) { Console.Write("{0} ", currTok); } return(currTok); }
// match the toker and Typetable public void match(string[] args) { tt = new TypeTable(); tt = tt.getTypeTable(args); depentable = new Dictionary<String, List<String>>(); foreach (string file in args) { toker = new CToker(); if (!toker.openFile(file as string)) { Console.Write("\n Can't open {0}\n\n", args[0]); return; } String tok = ""; while ( (tok=toker.getTok()) != "") { if (tok != "\n") { if (tt.table.ContainsKey(tok)) { foreach (var ele in tt.table) { if (ele.Key == tok) { foreach (var item in ele.Value) { if (item.file == Path.GetFileName(file) ) { add(item.file,item.file); } else add(Path.GetFileName(file), item.file); } } } } } } toker.close(); } }