From f02eee6fd65e352c3fdc16b51aa7f99c2c63482d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ma=C3=ABl=20Gassmann?= Date: Fri, 11 Jun 2021 22:30:14 +0200 Subject: [+] Added basic structure for the javacc-calculator --- calculator-javacc/Calculator.jj | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 calculator-javacc/Calculator.jj (limited to 'calculator-javacc/Calculator.jj') diff --git a/calculator-javacc/Calculator.jj b/calculator-javacc/Calculator.jj new file mode 100644 index 0000000..6cc78f5 --- /dev/null +++ b/calculator-javacc/Calculator.jj @@ -0,0 +1,35 @@ +options{DEBUG_PARSER = true; DEBUG_TOKEN_MANAGER = true;} + +PARSER_BEGIN(Calculator) +public class Calculator { + public static void main(String[] args) { + try{ + Calculator parser = new Calculator(System.in); + parser.Start(); + }catch (ParseException e){ + System.out.println(e.getMessage()); + } + } +} +PARSER_END(Calculator) + +/** +* For now only using the Hello World grammar +*/ + +SKIP : { + " "|"\t"|"\n"|"\r" +} + +TOKEN : { + | + | + | + ( ) + > +} + +void Start() : { +} +{ + ()* +} \ No newline at end of file -- cgit v1.2.3