Grammar of Objectmacro in Objectmacro-2.0.zip and in sablecc-4-beta.4.zip

29 views
Skip to first unread message

Phuc Luoi

unread,
Jan 27, 2022, 10:19:30 AM1/27/22
to SableCC
Hi,
should the both version use the same grammar? I have an objectmacro, which is compialbe in sablecc-4.beta.4.zip version but not in objectmacro-2.0.zip version.

$ cat simple.objectmacro  
$comment$
Template fuer die Erzeugung von SQL Abfrage.
Compile-Befehl fuer JAVA:
       objectmacro sqltemplate.objectmacro -t java -d ../../../target/generated-sources/objectmacro -p de.htwsaarland.sql.imp.template  

Autor
       Hong Phuc Bui
$end$

$comment: ========= create_table ===== $

$macro: simple(name)$
hallo $name !!!!!
$end: simple$


$ java -jar .../objectmacro-2.0/lib/objectmacro.jar simple.objectmacro  

ObjectMacro, part of SableCC version repository-snapshot
by Etienne M. Gagnon <ega...@j-meg.com> and other contributors.

Compiling "simple.objectmacro"
*** SYNTAX ERROR ***

Line: 1
Char: 1
Syntax error on unexpected invalidcharacter token "$":
expecting: EOF.


$ java -jar .../sablecc-4-beta.4/lib/objectmacro.jar simple.objectmacro  

ObjectMacro, part of SableCC version 4-beta.4
by Etienne M. Gagnon <ega...@j-meg.com> and other contributors.

Compiling "simple.objectmacro"


Sincerely
Hong-Phuc

PS: I did post an other one, but Google Group does not show it. So if the old post will be shown some time, just remove it.



Etienne Gagnon

unread,
Jan 27, 2022, 10:47:02 AM1/27/22
to sab...@googlegroups.com
Hi Phuc,

They don't share the same syntax. The beta version of SableCC 4 included what I'll call ObjectMacro 1. Experiments in my compiler courses revealed the need for improvements. As a result, I tasked Lâm Tran Van Ba to develop ObjectMacro 2 as his Master's thesis project.

Here's a link to the syntax of ObjecMacro 2: https://github.com/SableCC/sablecc/blob/master/grammars/objectmacro.sablecc3

Lâm's Master thesis (in French) provides a nice overview of ObjecMacro 2 and how to use it in Chapter 1. It's available at: https://archipel.uqam.ca/12655/ .

Please let me know if you have trouble accessing the thesis; there were access problems a few weeks ago and I've been told by UQAM's IT staff that international access has been restablished (it was temporarily cut because of the Log4j vulnerability).

Have fun!

Etienne

Etienne Gagnon, Ph.D.
http://sablecc.org


--
You received this message because you are subscribed to the Google Groups "SableCC" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sablecc+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sablecc/fb82568a-d126-4c78-8d1a-6c5aeede786dn%40googlegroups.com.

Phuc Luoi

unread,
Jan 27, 2022, 2:13:20 PM1/27/22
to SableCC
Hi Etienne,

jep, I can acces the Thesis. Thank you for the fast answer! :) I think the new grammar is nicer than the old one.

Sincerely
Hong-Phuc

Reply all
Reply to author
Forward
0 new messages