NetBeans 6 delivers great updates to the Matisse GUI builder. Spend a few minutes with Roman Strobl and get an expert briefing on what's new and what has changed. (sponsored)
In this, the third and final installation of Andres' Introduction to Groovy series, you learn about how Groovy handles variable numbers of arguments, named parameters, currying, and more about Groovy operators. Including, some new operators.
Swing Fuse (actually just Fuse), is a framework designed to make it easier to create your own custom desktop components. In this article, Daniel Spiewak shows you how to get started and provides sample source code you can download.
Willam Louth shows how he uses JXInsight Probes to investigate probable performance issues with code bases that he is not familiar with. He also highlights possible pitfalls in creating a benchmark, as well as in the analysis of results.
Julien Ponge of IzPack fame has written a new article describing how you can build a simple constraints language using the open source AntLR parser generator. This article walks you through the steps needed to build this language and start using it in your applications.
Back when I had to write a scripting language, I had essentially no experience with Lex, Yacc or Antlr.
This was several years ago, and no doubt Antlr has advanced since then, but it was quite a leap to try and understand it.
Instead, I found SableCC (http://sablecc.org/), and found for my purposes it was simple to use and easy to understand.
The other thing I particularly liked about SableCC is that there is no code in the Grammar. The Grammar is simply the Grammar, all of you code is written in a Visitor class based on the Grammar.
I don't really want to get in to any debate whether one technique is better than the other or who's tool is more powerful.
Rather, I just wanted to point out an alternative. While Antlr has probably evolved past Lex/Yacc, it's still very much inspired by them, and that made it, for me, hard to pick up as a novice in these tools. I found SableCC easier. If you struggled in the past with these tools, check it out.
Well, you probably havent noticed the tool support that is now available for ANTLR.
I know this is not too modest of me to mention this, but my plugin
ANTLR Studio
can make writing and debugging ANTLR grammars far easier and faster than using Lex, Yacc, SableCC all combined.
For example, my
debugger
can walk you live through your grammar while debugging your java code and show you the live parse trees, ASTs, input text, etc.
Also the
Lexer Wizard
can generate within 5 minutes a complex lexer which will take you hours and hours in lex or SableCC to get right.
As far as making sense of ANTLR grammars is concerned, I wrote an
article
showing how simple it really is
Virtual Ant - Revolutionary new GUI for Apache Ant
Example available? [Building a constraints language with AntLR]
Julien: This is really great. Do you have the complete example/package available for download? The links for IConstraintNode & IRootConstraintNode are invalid.
Re: Example available? [Building a constraints language with AntLR]
Hi Mark,
The links are wrong: wherever you see links you should put '[' and ']' around. I can't make anything available for download since that's part of unpublished research work, but nevertheless the idea was to show the essence of building that kind of language with AntLR.
Building a constraints language with AntLR
At 10:59 AM on Jun 23, 2006, Matthew Schmidt wrote:
Fresh Jobs for Developers Post a job opportunity
Read the whole article now.
8 replies so far (
Post your own)
Re: Building a constraints language with AntLR
In the lexer, instead of -WS : (' ' | '\n' | '\r' | '\t') { $setType(Token.SKIP); };you should do -
WS : ( ' ' | '\t' | '\n' { newline(); } | '\r' ('\n')? { newline(); } ) {$setType(Token.SKIP);} ;The call to 'newline()' will ensure the parser records the correct line no and column.
Had you used the 'Lexer Wizard' from my eclipse plugin for ANTLR, this would have been done for you automatically
Re: Building a constraints language with AntLR
Thanks for the tipRe: Building a constraints language with AntLR
Back when I had to write a scripting language, I had essentially no experience with Lex, Yacc or Antlr.This was several years ago, and no doubt Antlr has advanced since then, but it was quite a leap to try and understand it.
Instead, I found SableCC (http://sablecc.org/), and found for my purposes it was simple to use and easy to understand.
The other thing I particularly liked about SableCC is that there is no code in the Grammar. The Grammar is simply the Grammar, all of you code is written in a Visitor class based on the Grammar.
I don't really want to get in to any debate whether one technique is better than the other or who's tool is more powerful.
Rather, I just wanted to point out an alternative. While Antlr has probably evolved past Lex/Yacc, it's still very much inspired by them, and that made it, for me, hard to pick up as a novice in these tools. I found SableCC easier. If you struggled in the past with these tools, check it out.
Re: Building a constraints language with AntLR
Well, you probably havent noticed the tool support that is now available for ANTLR.I know this is not too modest of me to mention this, but my plugin ANTLR Studio can make writing and debugging ANTLR grammars far easier and faster than using Lex, Yacc, SableCC all combined.
For example, my debugger can walk you live through your grammar while debugging your java code and show you the live parse trees, ASTs, input text, etc.
Also the Lexer Wizard can generate within 5 minutes a complex lexer which will take you hours and hours in lex or SableCC to get right.
As far as making sense of ANTLR grammars is concerned, I wrote an article showing how simple it really is
Re: Building a constraints language with AntLR
Yeah but those tools are open source or free, your plugin is notSingle User License 99$
Re: Building a constraints language with AntLR
Yes, but the time you save from using my tool would be far greater than $99Also this is far cheaper and has more features than most parsing tools which cost >500$.
Example available? [Building a constraints language with AntLR]
Julien: This is really great. Do you have the complete example/package available for download? The links for IConstraintNode & IRootConstraintNode are invalid.Thanks.
Re: Example available? [Building a constraints language with AntLR]
Hi Mark,The links are wrong: wherever you see links you should put '[' and ']' around. I can't make anything available for download since that's part of unpublished research work, but nevertheless the idea was to show the essence of building that kind of language with AntLR.
Cheers