示例#1
0
 public void Reformat()
 {
     if (EditPropertiesForm.Run(ReformatProps, true))
     {
         string     sql    = m_editor.Text;
         ISqlParser parser = m_dialect.CreateParser(sql);
         try
         {
             var code = parser.ParseCommand();
             if (!parser.Tokernizer.IsEof)
             {
                 throw new ParseError("DAE-00294 EOF expected");
             }
             string res = m_dialect.GenerateScript(code.GenerateSql, ReformatProps);
             m_editor.SetCodeText(res, true);
         }
         catch (Exception err)
         {
             Errors.Report(err);
         }
     }
 }
示例#2
0
 public static ISqlParser CreateParser(this ISqlDialect dialect, string data)
 {
     return(dialect.CreateParser(dialect.CreateTokenizer(data)));
 }
示例#3
0
 public virtual ISqlParser CreateParser(ISqlTokenizer tokenizer)
 {
     return(m_dialect.CreateParser(tokenizer));
 }