4
I Use This!
Activity Not Available

News

Analyzed about 1 year ago. based on code collected about 1 year ago.
Posted about 9 years ago by elias551
Here you go => http://stackoverflow.com/questions/334479/repository-of-bnf-grammars/334539#334539
Posted about 9 years ago by matejgolob
thanks. it works.
Posted about 9 years ago by rivantsov
Just add ... | id_simple; to typeName rule
Posted about 9 years ago by matejgolob
I need simple t-sql parser and I started with demo SqlGrammar. t-sql escaping ([, ]) works fine with identifiers (it looks that there is some "magic" inside call var Id_simple = TerminalFactory.CreateSqlExtIdentifier(this, "id_simple"); but I ... [More] need this also for typenames so for example create table abc ([a] [int]) could work (now it's problem with [int] which is not recognised) How should I change rule typeName.Rule = ToTerm("BIT") | "DATE" | "TIME" | "TIMESTAMP" | "DECIMAL" | "REAL" | "FLOAT" | "SMALLINT" | "INTEGER" that it will also support sql quotes [, ]? Thanks for help Matej [Less]
Posted about 9 years ago by Harri
Rated 2 Stars (out of 5) - tried a number of the example grammars and they all throw exceptions of one kind or another....pity...
Posted about 9 years ago by Nicksys
Hi Roman Thank you very much for replying back to me. You are right, I just changed again and it worked, when I subclass InterpretedLanguageGrammar didn't work before and I thought this is only for scripting languages. I did it now and it is ... [More] working. I have one more question, should I use DoEvaluate to validate the programming syntax , to generate MSIL code, or both? [Less]
Posted about 9 years ago by rivantsov
all these things are built to work together, so if you want to use evaluation machinery already there, you should follow the rules, like using InterpretedLanguageGrammar as a base class. I don't understand, what is the big problem switching to it as a base class? Just change one word in class declaration
Posted about 9 years ago by Nicksys
Hi All, I noticed that if you need to evaluate you need to have ScriptThread var output = rooAST.Evaluate(thread); and in order to create ScriptThread object you need a ScriptApp object, but the constructor of the ScriptApp expects your grammar ... [More] to be child class of InterpretedLanguageGrammar not Grammar. I did build my grammar by subclassing Grammar and I don't know what is the best way to solve this issue (All non-terminals got theri ASTNode class). Thanks [Less]
Posted about 9 years ago by tdolny
Is it possible to switch between multiple separate grammars when parsing one file with Irony? Like for HTML mixed with PHP for example. Achieving independent coloring and validation. How would I start extending Irony to support that if it's not available feature yet?
Posted over 9 years ago by Nicksys
Hi All, I am really unable to understand how to fix this issue, I am been trying a lot and rewrote the grammar based on C# grammar, I studied it very well. Here is my code: this.Root = compilation_unit; compilation_unit.Rule = ... [More] module_declarations_opt; module_declarations_opt.Rule = MakeStarRule(module_declarations_opt, null, module_declaration); module_declaration.Rule = "module" + qualified_identifier + module_body + semi_opt; qualified_identifier.Rule = MakePlusRule(qualified_identifier, dot, identifier); module_body.Rule = "{" + reference_directives_opt + module_member_declarations + "}"; reference_directives_opt.Rule = Empty | reference_directives; reference_directives.Rule = MakePlusRule(reference_directives_opt, null, reference_directive); reference_directive.Rule = "refernece" + qual_name_with_targs + semi; qual_name_with_targs.Rule = identifier_or_builtin; identifier_or_builtin.Rule = identifier | builtin_type; builtin_type.Rule = ToTerm("boolean") | "integer" | "decimal" | "string" | "object"; module_member_declarations.Rule = MakePlusRule(module_member_declarations, null, module_member_declaration); module_member_declaration.Rule = /*module_declaration |*/ type_declaration; type_declaration.Rule = Empty; // class_declaration;// | interface_declaration; // | enum_declaration; [Less]