Skip to content

This repository contains the base project to test language parsers built with JavaCC

License

Notifications You must be signed in to change notification settings

danielvillarg/parser-tester

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Parser-tester

This repository contains the base project to test language parsers built with JavaCC

Usage

To use the parser-tester you should create a new Java project in Eclipse, and copy the contents of the repository into the project

  • Language definitions are/go in the languages package
  • To use the tester, you must add a reference to the parser in the MundoParsers as:
public MyParser getMyParser(){
  return new MyParser(System.in);
} 

You are also required to modify the hook method procesarCadena(String texto) in the same class

if(parsers.get(currentParser).equals("My Parser")){
	MyParser myParser = getMyParser();
	myParser.ReInit(new java.io.StringReader(texto));
  try {
		  myParser.initRule(); 
		  resp = new String("OK \n");
  } catch (Exception e) {
		  resp = new String ("Error de Sintaxis: "+e.getMessage());
  } catch (Error e) {
		  resp = new String ("Error Lexico: "+e.getMessage());
  }
}

About

This repository contains the base project to test language parsers built with JavaCC

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Java 100.0%