Questions tagged [irony]

For Irony, the development kit for implementing languages on .NET platform.

Unlike most existing YACC/Lex-style solutions, Irony does not employ any scanner or parser code generation from grammar specifications written in a specialized meta-language. In Irony the target language grammar is coded directly in C# using operator overloading to express grammar constructs.

Irony's scanner and parser modules use the grammar encoded as a C# class to control the parsing process. See the expression grammar sample for an example of grammar definition in C# class, and using it in a working parser.

The Irony Github project: https://github.com/IronyProject/Irony

66 questions
14
votes
2 answers

Parsing SQL Statement With Irony

I am trying to create a method that converts a regular sql statement to c# objects, So i decided to use Irony to parse the sql statement then i return the statement as an Action that contains the type of the statement and the values of it depending…
Daniel Eugen
  • 2,712
  • 8
  • 33
  • 56
13
votes
2 answers

Irony: How to give KeyTerm precedence over variable?

Relevant chunk of Irony grammar: var VARIABLE = new RegexBasedTerminal("variable", @"(?-i)\$?\w+"); variable.Rule = VARIABLE; tag_blk.Rule = html_tag_kw + attr_args_opt + block; term_simple.Rule = NUMBER | STRING | variable | boolean | "null" |…
mpen
  • 272,448
  • 266
  • 850
  • 1,236
10
votes
2 answers

Is there an existing ANTLR or IRONY grammar for R?

Does anyone know if there is an existing existing ANTLR or IRONY grammar for R? Many thanks.
Jonno
  • 789
  • 9
  • 26
8
votes
2 answers

How do I work with the AST in Irony now?

I have a grammar that works and parses in the Irony console just fine, but I don't get anything in the AST treeview. I was following along with the BASIC->Javascript article found here:…
7
votes
5 answers

Irony: How to disallow a space between 2 tokens?

I'm trying to define PHP-style variables in Irony like so: variable.Rule = "$" + identifier; Works great, except that you're allowed to put spaces between the $ and the identifier. I want to prevent that. How? Do I have to create a new customized…
mpen
  • 272,448
  • 266
  • 850
  • 1,236
7
votes
1 answer

Irony: Tutorial on evaluating AST nodes?

I've defined a simple grammar in Irony, and generated a nice compact AST. Now I'm trying to figure out how to evaluate it. Problem is, I can't find any tutorials on how to do this. I've defined just 2 AST nodes: class TagListNode : AstNode { …
mpen
  • 272,448
  • 266
  • 850
  • 1,236
6
votes
4 answers

Issue resolving a shift-reduce conflict in my grammar

I'm trying to write a small parser with Irony. Unfortunately I get a "shift-reduce conflict". Grammars are not my strong point, and I only need to get this one small thingy done. Here's the reduced grammar that produces the error: ExpressionTerm :=…
Vilx-
  • 104,512
  • 87
  • 279
  • 422
4
votes
1 answer

Defining constants and operators in Irony

I'm new to Irony and the whole language implementation shebang, so I've been playing around with the ExpressionEvaluator sample that comes with the Irony source, which seems to (almost) suit my needs for a project I'm working on. However, I would…
bernhof
  • 6,219
  • 2
  • 45
  • 71
4
votes
3 answers

Irony AST generation throws nullreference excepttion

I'm getting started with Irony (version Irony_2012_03_15) but I pretty quickly got stuck when trying to generate an AST. Below is a completely strpped language that throws the exception: [Language("myLang", "0.1", "Bla Bla")] public class…
gjvdkamp
  • 9,929
  • 3
  • 38
  • 46
3
votes
2 answers

I've created my first language in Irony, now how do I get it into Visual Studio 2010?

I tried following this, but I get an error at the end of the wizard. I'm not sure it's compatible with 2010. I'm watching this video on Ook, but I'm not sure how to tie it in with Irony. I think Irony's already done a lot of the grunt work for me, I…
mpen
  • 272,448
  • 266
  • 850
  • 1,236
3
votes
3 answers

Irony-parser-like software for other languages than C#?

Are there any programs that do what Irony .NET language implementation kit does, but for other programming languages?
Abbafei
  • 3,088
  • 3
  • 27
  • 24
3
votes
1 answer

How to recover parsing error in Irony Parser using C#?

I am currently using Irony parser and I don't seem to find that much documentation yet. This time I want to do something like the error recovery in Bison, where you get the line and row where the error was. I'm not really sure how to get the error…
3
votes
1 answer

Expression precedence in Irony parser

Consider this portion of my vbscript grammar EXPR.Rule = BINARY_EXPR | COMPARE_EXPR | AND_EXPR | OR_EXPR; BINARY_EXPR.Rule = EXPR + BINARY_OP + EXPR + ReduceHere(); COMPARE_EXPR.Rule = EXPR + COMPARE_OP + EXPR +…
powlette
  • 1,800
  • 20
  • 41
3
votes
3 answers

Help with learning to use Irony for .net

I am trying to get up to speed with Irony. I keep seeing some terminology that I don't yet understand: terminals, non-terminals, token, state machine, Associativity, Abstract Syntax Tree. Can someone please give some meaning to some of these terms?…
Ronnie Overby
  • 45,287
  • 73
  • 267
  • 346
2
votes
1 answer

Irony won't parse C# using Irony provided C# grammar

So, I'm trying to parse some simple C# code to learn how to use Irony. I'm using the C# grammar included with the Irony samples and using the sample assembly loading code from there as well. There seems to be very little if any documentation on…
user548376
  • 63
  • 5
1
2 3 4 5