protected void Button1_Click(object sender, EventArgs e) { //{ // SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString); // conn.Open(); // string insertQuery = "insert into [Table] ([name],[account],[amount]) values (@name1,@account1,@amount1)"; // SqlCommand com = new SqlCommand(insertQuery, conn); // com.Parameters.AddWithValue("@name1", TextBox3.Text); // com.Parameters.AddWithValue("@account1", TextBox1.Text); // com.Parameters.AddWithValue("@amount1", TextBox2.Text); // com.ExecuteNonQuery(); // Response.Redirect("manage.aspx"); // Response.Write("Transfer Successfull"); // conn.Close(); //} //catch (Exception ex) //{ // Response.Write("Error:"+ex.ToString()); //} if (FileUpload1.HasFile) { try { string filename = Path.GetFileName(FileUpload1.FileName); FileUpload1.SaveAs(Server.MapPath("~/") + filename); STATUS.Text = "Upload status: File uploaded!"; if (Session["AdminFlag"] != null) { VIEW_STATUS.Visible = Visible; VIEW_STATUS.Text = "View All Transactions"; } else { VIEW_STATUS.Visible = Visible; } System.Diagnostics.Debug.WriteLine("Transfer Operation"); System.Diagnostics.Debug.WriteLine("UserName:"******"New"].ToString()); System.Diagnostics.Debug.WriteLine("User GUID:" + Session["SESSIONID"].ToString()); System.Diagnostics.Debug.WriteLine("Session ID:" + HttpContext.Current.Session.SessionID); string file = Server.MapPath("~/ ") + filename; TParser parse = new TParser(file); TransactionBuilder build = new TransactionBuilder(); int BatchId = parse.Parse(build); TransactionQueue queue = build.SetBatch(BatchId); TransactionService service = new TransactionService(); service.Start(queue); } catch (Exception ex) { STATUS.Text = "Upload status: The file could not be uploaded. The following error occured: " + ex.Message; } } }
private void button1_Click(object sender, EventArgs e) { string s = textBox1.Text; tree = new TParser(ClientRectangle.Width, ClientRectangle.Height); tree.Recyrse(s, out tree.top); tree.SetXY(tree.top, 200, 60); label1.Text = "= " + Convert.ToString(tree.top.Value); MyDraw(); }
static void Main(string[] args) { string file = @"C:\Users\Priyank Kapadia\BankInformation\Batch\batch.txt"; TParser parse = new TParser(file); TransactionBuilder build = new TransactionBuilder(); int BatchId = parse.Parse(build); TransactionQueue queue = build.SetBatch(BatchId); TransactionService service = new TransactionService(); service.Start(queue); }
private void Form1_Load(object sender, EventArgs e) { g = CreateGraphics(); string s = textBox1.Text; tree = new TParser(ClientRectangle.Width, ClientRectangle.Height); tree.Recyrse(s, out tree.top); tree.SetXY(tree.top, 200, 60); label1.Text = "= " + Convert.ToString(tree.top.Value); MyDraw(); }
public static void Main(string[] args) { if (args.Length == 1) { ICharStream input = new ANTLRFileStream(args[0]); TLexer lex = new TLexer(input); CommonTokenStream tokens = new CommonTokenStream(lex); //System.out.println("tokens="+tokens); TParser parser = new TParser(tokens); parser.stat(); } else Console.Error.WriteLine("Usage: hoisted <input-file>"); }
private void button9_Click(object sender, EventArgs e) { string s = textBox1.Text; parser = new TParser(); try { parser.SetOperator(ref s, out parser.topOp); MyDraw(II, JJ, g); } catch (Exception ex) { MessageBox.Show(ex.Message); } }
private void Form1_Load(object sender, EventArgs e) { MouseWheel += new MouseEventHandler(Form1_MouseWheel); string s = textBox1.Text; parser = new TParser(); try { parser.SetOperator(ref s, out parser.topOp); } catch (Exception ex) { MessageBox.Show(ex.Message); } }
public static TParser Get <TParser>() where TParser : NamedParser, new() { var type = typeof(TParser); NamedParser singleton; if (_sSingletons.TryGetValue(type, out singleton)) { return((TParser)singleton); } singleton = new TParser(); _sSingletons.Add(type, singleton); return((TParser)singleton); }
public static void Main(string[] args) { if (args.Length == 1) { ICharStream input = new ANTLRFileStream(args[0]); TLexer lex = new TLexer(input); CommonTokenStream tokens = new CommonTokenStream(lex); //System.out.println("tokens="+tokens); TParser parser = new TParser(tokens); parser.stat(); } else { Console.Error.WriteLine("Usage: hoisted <input-file>"); } }
private void buttonRun_Click(object sender, EventArgs e) { string s = textBox1.Text; tree = new TParser(ClientRectangle.Width, ClientRectangle.Height); tree.Expression(ref s, out tree.top); if (tree.error == 0) { tree.SetXY(tree.top, 200, 60); label1.Text = "= " + Convert.ToString(tree.top.Value); MyDraw(); } else { MessageBox.Show("Error = " + tree.error.ToString() + " " + tree.errorToString()); } }
public NodesCollection <Node> Parse(string code) { var input = new AntlrInputStream(code); var lexer = new TLexer(input); var tokens = new CommonTokenStream(lexer); tokens.Fill(); var parser = new TParser(tokens); parser.RemoveErrorListeners(); parser.AddErrorListener(ParseErrorListener.Instance); var res = VisitMain(parser.main()); return(res.As <NodesCollection <Node> >()); }
public static void Main(string[] args) { if (args.Length > 0) { string inputFileName = args[0]; if (!Path.IsPathRooted(inputFileName)) { inputFileName = Path.Combine(Environment.CurrentDirectory, inputFileName); } ICharStream input = new ANTLRFileStream(inputFileName); TLexer lex = new TLexer(input); ITokenStream tokens = new TokenRewriteStream(lex); TParser parser = new TParser(tokens); parser.program(); Console.Out.WriteLine(tokens); } else Console.Error.WriteLine("Usage: tweak <input-file>"); }
public static void Main(string[] args) { if (args.Length == 1) { string inputFileName = args[0]; if (!Path.IsPathRooted(inputFileName)) { inputFileName = Path.Combine(Environment.CurrentDirectory, inputFileName); } ICharStream input = new ANTLRFileStream(inputFileName); TLexer lex = new TLexer(input); CommonTokenStream tokens = new CommonTokenStream(lex); //System.out.println("tokens="+tokens); TParser parser = new TParser(tokens); parser.program(); } else Console.Error.WriteLine("Usage: dynscope <input-file>"); }
public static void Main(string[] args) { if (args.Length > 0) { string inputFileName = args[0]; if (!Path.IsPathRooted(inputFileName)) { inputFileName = Path.Combine(Environment.CurrentDirectory, inputFileName); } ICharStream input = new ANTLRFileStream(inputFileName); TLexer lex = new TLexer(input); ITokenStream tokens = new TokenRewriteStream(lex); TParser parser = new TParser(tokens); parser.program(); Console.Out.WriteLine(tokens); } else { Console.Error.WriteLine("Usage: tweak <input-file>"); } }
public static void Main(string[] args) { if (args.Length == 1) { string inputFileName = args[0]; if (!Path.IsPathRooted(inputFileName)) { inputFileName = Path.Combine(Environment.CurrentDirectory, inputFileName); } ICharStream input = new ANTLRFileStream(inputFileName); TLexer lex = new TLexer(input); CommonTokenStream tokens = new CommonTokenStream(lex); //System.out.println("tokens="+tokens); TParser parser = new TParser(tokens); parser.program(); } else { Console.Error.WriteLine("Usage: dynscope <input-file>"); } }
public SieveConfiguration WithParser <TParser>() where TParser : class, IParser, new() { Parser = new TParser(); return(this); }