Menu

BNF for Java / News: Recent posts

A Swing form for each BNF file

BNF's newest Alpha Release for 2007 provides a Swing GUI visual form for each file needed to your BNF and Java code that goes with it, as well as the control files needed to run a compile or a parser project.

This sub-release cleans up some of the user options on the forms. When a compile run is completed, the core's Engine provides debug info to the user. This release makes that info available to your Viewer. ... read more

Posted by Daniel Cohen 2007-01-30

GUI Forms for easy programming

BNF newest Alpha Release for 2007 provides an improved Visual GUI, provides new forms that make it much easier for you to manage your BNF code, as well as the Java code that goes with it.

BNF-for-Java is a compiler/compiler, or parser/generator, that conforms to ISO-14977. In action, the parser reads its source text, parsing it according to the syntax in the BNF code. It builds a Parse Tree, which contains terminals as "content", in a tree whose structure reflects the "syntax" allowed by the BNF. During the parse phase, your Java Extensions are attached to the syntax nodes. Then, during the generator phase, the parse tree is walked to drive your Java Extensions, which produce the actual output.... read more

Posted by Daniel Cohen 2007-01-13

BNF for Java: "Visual" release

BNF for Java is a BNF Compiler-Compiler, or Parser-Generator. It implements ISO Standard Backus-Naur Format, using Java. BNF allows you to create a syntax, or a complete language, to parse your data source. Your custom Java extensions generate output.

This first release for 2007 adds a major improvement in the "Visual" user-interface for the BNF programmer. You can see your BNF and Java files, you can see the results from the compilers, you can track bugs with text reports. You can compile your compiler and run your parser/generator project from the GUI. ... read more

Posted by Daniel Cohen 2007-01-12

BNF's Visual user-interface is improved

"BNF for Java" is a compiler and parser/generator for Extended BNF. It implements the meta-language syntax specified by ISO-14977. That is, you can create your own programming language, and write the parser.

Your parser needs emitters to generate its output, and other extensions for special needs for your language, such as lable-table generation. You write these extensions with Java classes, and the software links them at compile time.... read more

Posted by Daniel Cohen 2006-05-02

BNF's second Alpha release

When BNF-for-Java created our first Alpha release, the milestone we achieved was that BNF's core parser could parse its input text according to the BNF grammar given, build a parse tree, and send the data to the Java extensions, or emitters. The compiler works.

Our second Alpha release focuses on its new GUI, a Java Swing form to visually show you, the BNF programmer, where your files are. This is similar to ordinary compilers that need a "make" file to collect and control all the libraries, inputs, and dependencies. The GUI works.... read more

Posted by Daniel Cohen 2006-04-17

Alpha Release

BNF for Java has reached the "ALPHA" stage.

All of the core modules, and all of the priority features, work correctly.
First, you write a BNF grammar parser, and compile it with BNF for Java. Then, you can add Java extensions for the emitters, and compile with javac.
The result is a working BNF program, a Parser-Generator with input and output.

BNF for Java can compile itself. BNF's own grammar is included, so you can upgrade the grammar, if you need to.... read more

Posted by Daniel Cohen 2005-10-12

BNF goes visual with Swing

BNF for Java is designed to be usable in any operating environment: (1) command-line, using text files, (2) visual GUI, using Swing editor windows, (3) internally, using a String for input. All of these features use a common Project file, defined in XML, to declare the application's source, BNF grammar, and extensions.

The Command-Line Interpretter (CLI) is complete.

The Swing GUI is now in place. Because of the files required by BNF, we use a several Swing components, depending on the nature of each file. Instead of a single application window, we have grouped the files onto JDialogs, similar to Gimp's style.... read more

Posted by Daniel Cohen 2005-03-21

Project home page is revised

Our project home page shows what BNF is, and how to use it.
Some of the page links were broken, and they are now fixed.
What these pages need more than anything is criticism. So if you have any comments, click on "Contact Us" to send us an e-mail.

Bye for now,
Dan Cohen in Calgary

Posted by Daniel Cohen 2005-01-04

BNF parses BNF - a minor milestone

BNF for Java parses Extended BNF. The application, the parser, and the grammar are all in place and functional.

The benchmark:
The BNF-compiler project's front-end is defined in an XML file, which is parsed, BNF Grammar Object is loaded, the Source file is read in. The Source file for this test has 208 lines (5800 chars) of BNF source and comments. At the end of file, the Parse Tree outputs its tokens.
We don't have the Emitters yet.... read more

Posted by Daniel Cohen 2004-12-31

CVS re-structure

The package layout for BNF has changed, and in fact the project is moving forward. We recently erased the entire CVS repository, and re-structured all the source packages.
You can view all the Java source packages under [cvs]/bnf-for-java/CVSROOT/src, including the BNF grammar-object generator. (Only the HelloWorld grammar is complete.)

The program works on the Command Line, as an Ant target, and as a NetBeans application. I will post the Ant script in the "project files" section.

Posted by Daniel Cohen 2004-12-09

BNF for Java reaches "pre-alpha" milestone.

BNF for Java is now at the "pre-alpha" stage.

Creating and using a computer language is a two-step process, and BNF is a "compiler-compiler".
First, to define your new language, you define the syntax using BNF. The BNF "compiler--" converts that to an executable parser object.
Second, to parse your input text, the BNF "--compiler" analyzes it, and produces some output.... read more

Posted by Daniel Cohen 2004-12-09

BNF meets Hello World

A major milestone was reached today. BNF for Java compiles a simple "Hello World" grammar, like the example on the Project Home Page http://bnf-for-java.sourceforge.net/
The scanner tokenizes terminals from the source, and the grammar analyzes that to create a run-time Parse Tree. Finally, the emitter classes generate the correct output.
You can download the source for the entire project from the SourceForge CVS, as well as the examples, and run it yourself.
-- Dan Cohen in Calgary

Posted by Daniel Cohen 2004-11-27

bnf meets tiger

You should never jump into the latest software versions, just to be "cool". But one important feature of Java 5 is generics. Actually I'm not interested in template classes.
Java's collection classes provides containers for generic objects, and the BNF uses ArrayList for a variety of list objects. Tiger uses generics to provide type-safe containers -- I use declarations like: ArrayList<Terminal> which gives a type-safe array of (what else) Terminals.
Now that I've switched to Tiger, I have no desire to go back.... read more

Posted by Daniel Cohen 2004-11-18

bnf meets ant

When I installed JUnit, I needed a platform. I installed ANT, and set up the project tasks for editing, compiling, unit test, and deployment.
This means that the package scheme changed a little. In fact, at home I have two parallel java source folders: one for application classes, and the second for JUnit test classes. It works well.

-- Dan Cohen in Calgary

Posted by Daniel Cohen 2004-11-18

bnf meets JUnit

Now that I have JUnit working with ANT, I have re-worked the "Terminals" package. I subject each class to unit testing. The tests have a major impact on my code!
To make each terminal class pass its black-box test, I had to solidify the interface -- in fact I threw out a couple of java interface files, and replaced them with new, more meaningful contracts.
Each terminal class had to pass its data-flow tests, too. I was surprised at how buggy my intuition was, in the early implementations.... read more

Posted by Daniel Cohen 2004-11-18

Project Testing

I'm adding another module called "ProjectTesting". This tracks the milestone requirements, or testing progress. It contains the test suites I'm using. The suites change every time I update, but it's handy to keep the old tests available.

I'm not using JUnit yet.

Posted by Daniel Cohen 2004-08-08

Take time for CVS

All the projects on SourceForge are stored on their CVS repository. If you are not familiar with CVS, I recommend this book:
"Open Source Development with CVS" by Bar and Fogel.

Then, spend some time managing your own local projects with CVS. Its interface is clunky, but the functionality is good.
Then, when you're confident that CVS can manage your own work, come back here.

You'll find SourceForge files get a lot easier to handle.... read more

Posted by Daniel Cohen 2004-07-27

March/2004 update

The original idea of the BNF package was to create the classes for a basic compiler. But we have added some front-end classes that make the package more of a tool for general use.
New features are:
A "Project" configuration file to define grammar and source text files, and extension Java objects.
An "IDE" to help edit all the files needed to create your various BNF project files.
A formal "CLI" command-line interpretter.
Also the concept of API front-end classes to help you use BNF for ordinary data-handling chores.... read more

Posted by Daniel Cohen 2004-04-09

Initial upload into CVS

All Java source files are in CVS module "BNF"
All HTML documentaiton are in CVS module "HomePages"

Posted by Daniel Cohen 2004-01-29

Announcing new project: BNF for Java

This project will design classes, libraries, and software tools,
to implement a BNF Compiler/Parser,
using Java,
for developers to use in their own software projects.

The Project Home Page is: http://bnf-for-java.sourceforge.net/
The SourceForge Summary Page is:
http://sourceforge.net/projects/bnf-for-java/

BNF for Java is the Extended BNF, as defined by ISO/IEC 14977:1996.
Conformance to this International Standard is a priority goal.... read more

Posted by Daniel Cohen 2004-01-09