Search Results

Search found 41 results on 2 pages for 'behrooz a'.

Page 2/2 | < Previous Page | 1 2 

  • ANTLR Tree Grammar and StringTemplate Code Translation

    - by Behrooz Nobakht
    I am working on a code translation project with a sample ANTLR tree grammar as: start: ^(PROGRAM declaration+) -> program_decl_tmpl(); declaration: class_decl | interface_decl; class_decl: ^(CLASS ^(ID CLASS_IDENTIFIER)) -> class_decl_tmpl(cid={$CLASS_IDENTIFIER.text}); The group template file for it looks like: group My; program_decl_tmpl() ::= << *WHAT?* >> class_decl_tmpl(cid) ::= << public class <cid> {} >> Based on this, I have these questions: Everything works fine apart from that what I should express in WHAT? to say that a program is simply a list of class declarations to get the final generated output? Is this approach averagely suitable for not so a high-level language? I have also studied ANTLR Code Translation with String Templates, but it seems that this approach takes much advantage of interleaving code in tree grammar. Is it also possible to do it as much as possible just in String Templates?

    Read the article

  • How to best fetch a cell value from excel using VSTO?

    - by Behrooz Karjooravary
    I am trying to get cells from excel into csharp but not sure what's the best variable type to read it into. If I make the variable a string and the cell value is a double I get a parse error. If I make the variable double then when the cell is a string it wont work. Here's the code I am running: try { string i = Globals.Sheet1.Cells[7, 7].Value; double num; if (i == null) return; if (double.TryParse(i, out num)) { . . . } } catch (Exception e) { MessageBox.Show(e.ToString()); }

    Read the article

  • get a range of objects with binary search

    - by Behrooz
    I have some data like this: ID Value 1 AAA 1 ABC 2 dasd 2 dsfdsf 2 dsfsd 3 df 3 dwqef they are objects(not plain text). and i want to get all objects with the ID = 2. I can do a binary binary search and get the index 3,but how can i get (2 and 4) is there any efficient algorithm? the real problem has lists with about one Million items. any language except bf and lisp can help.

    Read the article

  • BSoD when creating threads

    - by Behrooz
    I am trying to create +5 threads synchronously so there shouldn't be any concurrency error. Code: System.Threading.Thread t = new System.Threading.Thread(proc); t.Start();//==t.BlueScreen(); t.Join(); Is darkness a feature ? I am doing something wrong? OS:Microsoft windows vista(unfortunately) x64 Language:C# 3.0|4.0 .Net version:3.5|4

    Read the article

  • Is there any sql interpreter for objects?

    - by Behrooz
    Is there any interpreter that takes a string or even a custom object as input and execute it on my datasource? I cannot use linq to object because query always changes and the report i'm working on, has about 6000 queries which i can reduce to 9 if i find some tool doing that for me. Opensource is very applicable. thanks in advance.

    Read the article

  • Operation can only be performed on rows that belong to a DataGridView control?

    - by Behrooz
    it happens when i change the DataSource. i have checked everything(stack traces, all exception information, datasources, grids, all the threads, etc) i have also write lots of diagnostic code(+3000 line) it seems to be a virus, it is going to destroy everything in my app. all grids are going to have the very same error.(while i have not changed any of the code).wtf . it makes my datagridviews to have an red X on them.

    Read the article

  • fast way for finding GUIDs.

    - by Behrooz
    hi. I have lots(+2000) of GUIDs(in some network class) and my program must find one of them when it receives a message and do the job associated with it. the positive point is i have a hard-code generator, but the fastest way is my goal(and i don't know how to implement it). my code should do something like this: switch(received guid) { case guid1: do job 1; break; case guid2: do job 2; break; case guid3: do job 3; break; case guid4: do job 4; break; .... }

    Read the article

< Previous Page | 1 2