/// <summary> /// Initializes a new instance of the <see cref="CodeParser"/> class. /// </summary> /// <param name="language">The language.</param> public CodeParser(ProgramLanguage language) { string fileName = Path.GetTempFileName(); switch (language) { case ProgramLanguage.TSQL: File.WriteAllBytes(fileName, Resource.TSQL); break; case ProgramLanguage.CSharp1: File.WriteAllBytes(fileName, Resource.CS); break; case ProgramLanguage.VBNet1: File.WriteAllBytes(fileName, Resource.VBNET); break; default: throw new ArgumentOutOfRangeException("language"); } _p.SetGrammar(fileName); }
public CodeParser(string grammarFile) { _p = new PgmrClass(); _p.SetGrammar(grammarFile); }