Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » IMP » Problems with LPG parser
Problems with LPG parser [message #5023] Mon, 17 September 2007 17:53 Go to next message
Eclipse UserFriend
Originally posted by: olegm.gmail.com

Hello,

I am trying to follow the tutorial of IMP
http://eclipse-imp.sourceforge.net/documentation/users_guide .html
and get stuck on compiling LPG grammar (see the log below).

FAQ
http://eclipse-imp.sourceforge.net/documentation/faq.html
mentions project "lpg.runtime.java" that can be used for external
compilation of LPG, however, I didn't manage to find it anywhere.
Whas it meant to import plugin "org.eclipse.imp.lpg.runtime" as a project?

Finally, I have tried running LPG binary on the command-line,
but then it complained about the syntax of a template file (see the log
below).

Any suggestions, please? :)

I have archived my whole workspace at:
http://uuslepo.it.da.ut.ee/~olegm/temp/workspace.tar.gz

Thank You for Your help,
Oleg Mürk

----------------- Bash -----------------
[olegm@localhost ~]$ uname -a
Linux localhost.localdomain 2.6.22.5-76.fc7 #1 SMP Thu Aug 30 13:47:21
EDT 2007 i686 i686 i386 GNU/Linux
[olegm@localhost ~]$ tar xzf Desktop/eclipse-SDK-3.2.2-linux-gtk.tar.gz
[olegm@localhost ~]$ cat eclipse/eclipse.ini
-vm
/usr/java/jdk1.5.0_12/bin/java
-vmargs
-Xms40m
-Xmx1024m

----------------- Eclipse -----------------
Eclipse:Help->Software Updates->...
http://www.cs.cornell.edu/Projects/polyglot/eclipseUpdates/
http://lpg.sourceforge.net/updates/
http://eclipse-imp.sourceforge.net/updates/

Eclipse:Files->New->New Plugin Project
OM

Eclipse:Files->New->Programming Language Descriptor
OM

Eclipse:Files->New->New LPG Grammar with Parser Wrapper

java.io.IOException: java.io.IOException:
/home/olegm/eclipse/plugins/lpg.runtime_2.0.6/lpgexe/lpg-lin ux_x86:
cannot execute

----------------- Bash -----------------
[olegm@localhost ~]$ chmod u+x
/home/olegm/eclipse/plugins/lpg.runtime_2.0.6/lpgexe/lpg-lin ux_x86

----------------- Eclipse -----------------
"" -include-directory='/home/olegm/eclipse/plugins/org.eclipse. imp.lpg.metatooling_1.0.62/templates/;/home/olegm/eclipse/pl ugins/lpg.runtime_2.0.6/templates/' ""
is an invalid option OM/src/om/safari/parser OMParser.g line 1
1190048698873 43

----------------- Bash -----------------
[olegm@localhost ~]$ cat workspace/OM/src/om/safari/parser/OMParser.l
/home/olegm/workspace/OM/src/om/safari/parser/OMParser.g:0:0 :0:0:0:0:
Error: Option
"" -include-directory='/home/olegm/eclipse/plugins/org.eclipse. imp.lpg.metatooling_1.0.62/templates/;/home/olegm/eclipse/pl ugins/lpg.runtime_2.0.6/templates/' ""
is missing preceding '-'
/home/olegm/workspace/OM/src/om/safari/parser/OMParser.g:0:0 :0:0:0:0:
Error:
"" -include-directory='/home/olegm/eclipse/plugins/org.eclipse. imp.lpg.metatooling_1.0.62/templates/;/home/olegm/eclipse/pl ugins/lpg.runtime_2.0.6/templates/' ""
is an invalid option

[olegm@localhost ~]$
../eclipse/plugins/lpg.runtime_2.0.6/lpgexe/lpg-linux_x86
-include-directory='/home/olegm/eclipse/plugins/org.eclipse. imp.lpg.metatooling_1.0.62/templates/;/home/olegm/eclipse/pl ugins/lpg.runtime_2.0.6/templates/'
workspace/OM/src/om/safari/parser/OMParser.g

Options in effect for workspace/OM/src/om/safari/parser/OMKWLexer.gi:


ACTION-BLOCK=("workspace/OM/src/om/safari/parser/OMKWLexer.java ","/.","./")

AST-DIRECTORY="./Ast" AST-TYPE="Ast" NOATTRIBUTES NOAUTOMATIC-AST
NOBACKTRACK BYTE CONFLICTS
DAT-DIRECTORY="workspace/OM/src/om/safari/parser/"
DAT-FILE="workspace/OM/src/om/safari/parser/OMKWLexerdcl.data "
DCL-FILE="workspace/OM/src/om/safari/parser/OMKWLexerdcl.java "
NODEBUG
DEF-FILE="workspace/OM/src/om/safari/parser/OMKWLexerdef.java "
NOEDIT
NOERROR-MAPS ESCAPE='$'

EXPORT-TERMINALS=("workspace/OM/src/om/safari/parser/OMParsersym.java ","TK_","")
EXTENDS-PARSETABLE FACTORY="new " FILE-PREFIX="OMKWLexer" NOFIRST
NOFOLLOW NOGLR NOGOTO-DEFAULT
GRM-FILE="workspace/OM/src/om/safari/parser/OMKWLexer.gi"
IMP-FILE="workspace/OM/src/om/safari/parser/OMKWLexerimp.java "

INCLUDE-DIRECTORY=" /home/olegm/eclipse/plugins/org.eclipse.imp.lpg.metatooling_ 1.0.62/templates/;/home/olegm/eclipse/plugins/lpg.runtime_2. 0.6/templates/ "
IMP-FILE="workspace/OM/src/om/safari/parser/OMKWLexerimp.java "
LALR=1
NOLIST MARGIN=4 MAX-CASES=1024 NAMES=OPTIMIZED NONT-CHECK
OR_MARKER='|'
OUT-DIRECTORY="workspace/OM/src/om/safari/parser/"
PACKAGE="om.safari.parser" NOPARENT-SAVE
PARSETABLE-INTERFACES="lpg.runtime.ParseTable" PREFIX="Char_"
PRIORITY
PROGRAMMING_LANGUAGE=JAVA
PRS-FILE="workspace/OM/src/om/safari/parser/OMKWLexerprs.java "
NOQUIET
READ-REDUCE REMAP-TERMINALS NOSCOPES NOSERIALIZE NOSHIFT-DEFAULT
NOSINGLE-PRODUCTIONS NOSOFT-KEYWORDS NOSTATES SUFFIX=""
SYM-FILE="workspace/OM/src/om/safari/parser/OMKWLexersym.java "
TAB-FILE="OMKWLexer.t" TABLE TEMPLATE="KeywordTemplate.gi"
TRACE=CONFLICTS NOVARIABLES NOVERBOSE NOVISITOR
VISITOR-TYPE="Visitor"
WARNINGS NOXREF

/home/olegm/eclipse/plugins/org.eclipse.imp.lpg.metatooling_ 1.0.62/templates/KeywordTemplate.gi:25:1:25:4:775:778:
Error: Syntax error detected on this token
Re: Problems with LPG parser [message #5094 is a reply to message #5023] Mon, 17 September 2007 18:03 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: olegm.gmail.com

One more thing:
When I try "Window->Preferences->LPG Preferences->Select Project", it
shows me my project "OM", however selecting it does not have any effect
and I cannot edit any LPG preferences.


Oleg Murk wrote:
> Hello,
>
> I am trying to follow the tutorial of IMP
> http://eclipse-imp.sourceforge.net/documentation/users_guide .html
> and get stuck on compiling LPG grammar (see the log below).
>
> FAQ
> http://eclipse-imp.sourceforge.net/documentation/faq.html
> mentions project "lpg.runtime.java" that can be used for external
> compilation of LPG, however, I didn't manage to find it anywhere.
> Whas it meant to import plugin "org.eclipse.imp.lpg.runtime" as a project?
>
> Finally, I have tried running LPG binary on the command-line,
> but then it complained about the syntax of a template file (see the log
> below).
>
> Any suggestions, please? :)
>
> I have archived my whole workspace at:
> http://uuslepo.it.da.ut.ee/~olegm/temp/workspace.tar.gz
>
> Thank You for Your help,
> Oleg Mürk
>
> ----------------- Bash -----------------
> [olegm@localhost ~]$ uname -a
> Linux localhost.localdomain 2.6.22.5-76.fc7 #1 SMP Thu Aug 30 13:47:21
> EDT 2007 i686 i686 i386 GNU/Linux
> [olegm@localhost ~]$ tar xzf Desktop/eclipse-SDK-3.2.2-linux-gtk.tar.gz
> [olegm@localhost ~]$ cat eclipse/eclipse.ini
> -vm
> /usr/java/jdk1.5.0_12/bin/java
> -vmargs
> -Xms40m
> -Xmx1024m
>
> ----------------- Eclipse -----------------
> Eclipse:Help->Software Updates->...
> http://www.cs.cornell.edu/Projects/polyglot/eclipseUpdates/
> http://lpg.sourceforge.net/updates/
> http://eclipse-imp.sourceforge.net/updates/
>
> Eclipse:Files->New->New Plugin Project
> OM
>
> Eclipse:Files->New->Programming Language Descriptor
> OM
>
> Eclipse:Files->New->New LPG Grammar with Parser Wrapper
>
> java.io.IOException: java.io.IOException:
> /home/olegm/eclipse/plugins/lpg.runtime_2.0.6/lpgexe/lpg-lin ux_x86:
> cannot execute
>
> ----------------- Bash -----------------
> [olegm@localhost ~]$ chmod u+x
> /home/olegm/eclipse/plugins/lpg.runtime_2.0.6/lpgexe/lpg-lin ux_x86
>
> ----------------- Eclipse -----------------
> "" -include-directory='/home/olegm/eclipse/plugins/org.eclipse. imp.lpg.metatooling_1.0.62/templates/;/home/olegm/eclipse/pl ugins/lpg.runtime_2.0.6/templates/' ""
> is an invalid option OM/src/om/safari/parser OMParser.g line 1
> 1190048698873 43
>
> ----------------- Bash -----------------
> [olegm@localhost ~]$ cat workspace/OM/src/om/safari/parser/OMParser.l
> /home/olegm/workspace/OM/src/om/safari/parser/OMParser.g:0:0 :0:0:0:0:
> Error: Option
> "" -include-directory='/home/olegm/eclipse/plugins/org.eclipse. imp.lpg.metatooling_1.0.62/templates/;/home/olegm/eclipse/pl ugins/lpg.runtime_2.0.6/templates/' ""
> is missing preceding '-'
> /home/olegm/workspace/OM/src/om/safari/parser/OMParser.g:0:0 :0:0:0:0:
> Error:
> "" -include-directory='/home/olegm/eclipse/plugins/org.eclipse. imp.lpg.metatooling_1.0.62/templates/;/home/olegm/eclipse/pl ugins/lpg.runtime_2.0.6/templates/' ""
> is an invalid option
>
> [olegm@localhost ~]$
> ./eclipse/plugins/lpg.runtime_2.0.6/lpgexe/lpg-linux_x86
> -include-directory='/home/olegm/eclipse/plugins/org.eclipse. imp.lpg.metatooling_1.0.62/templates/;/home/olegm/eclipse/pl ugins/lpg.runtime_2.0.6/templates/'
> workspace/OM/src/om/safari/parser/OMParser.g
>
> Options in effect for workspace/OM/src/om/safari/parser/OMKWLexer.gi:
>
>
> ACTION-BLOCK=("workspace/OM/src/om/safari/parser/OMKWLexer.java ","/.","./")
>
> AST-DIRECTORY="./Ast" AST-TYPE="Ast" NOATTRIBUTES NOAUTOMATIC-AST
> NOBACKTRACK BYTE CONFLICTS
> DAT-DIRECTORY="workspace/OM/src/om/safari/parser/"
> DAT-FILE="workspace/OM/src/om/safari/parser/OMKWLexerdcl.data "
> DCL-FILE="workspace/OM/src/om/safari/parser/OMKWLexerdcl.java " NODEBUG
> DEF-FILE="workspace/OM/src/om/safari/parser/OMKWLexerdef.java " NOEDIT
> NOERROR-MAPS ESCAPE='$'
>
> EXPORT-TERMINALS=("workspace/OM/src/om/safari/parser/OMParsersym.java ","TK_","")
>
> EXTENDS-PARSETABLE FACTORY="new " FILE-PREFIX="OMKWLexer" NOFIRST
> NOFOLLOW NOGLR NOGOTO-DEFAULT
> GRM-FILE="workspace/OM/src/om/safari/parser/OMKWLexer.gi"
> IMP-FILE="workspace/OM/src/om/safari/parser/OMKWLexerimp.java "
>
> INCLUDE-DIRECTORY=" /home/olegm/eclipse/plugins/org.eclipse.imp.lpg.metatooling_ 1.0.62/templates/;/home/olegm/eclipse/plugins/lpg.runtime_2. 0.6/templates/ "
>
> IMP-FILE="workspace/OM/src/om/safari/parser/OMKWLexerimp.java " LALR=1
> NOLIST MARGIN=4 MAX-CASES=1024 NAMES=OPTIMIZED NONT-CHECK
> OR_MARKER='|'
> OUT-DIRECTORY="workspace/OM/src/om/safari/parser/"
> PACKAGE="om.safari.parser" NOPARENT-SAVE
> PARSETABLE-INTERFACES="lpg.runtime.ParseTable" PREFIX="Char_" PRIORITY
> PROGRAMMING_LANGUAGE=JAVA
> PRS-FILE="workspace/OM/src/om/safari/parser/OMKWLexerprs.java " NOQUIET
> READ-REDUCE REMAP-TERMINALS NOSCOPES NOSERIALIZE NOSHIFT-DEFAULT
> NOSINGLE-PRODUCTIONS NOSOFT-KEYWORDS NOSTATES SUFFIX=""
> SYM-FILE="workspace/OM/src/om/safari/parser/OMKWLexersym.java "
> TAB-FILE="OMKWLexer.t" TABLE TEMPLATE="KeywordTemplate.gi"
> TRACE=CONFLICTS NOVARIABLES NOVERBOSE NOVISITOR
> VISITOR-TYPE="Visitor"
> WARNINGS NOXREF
>
> /home/olegm/eclipse/plugins/org.eclipse.imp.lpg.metatooling_ 1.0.62/templates/KeywordTemplate.gi:25:1:25:4:775:778:
> Error: Syntax error detected on this token
Re: Problems with LPG parser [message #5161 is a reply to message #5094] Mon, 17 September 2007 23:06 Go to previous messageGo to next message
Philippe Charles is currently offline Philippe CharlesFriend
Messages: 8
Registered: July 2009
Junior Member
Hi Oleg:

It would appear from your output that you are trying to use IMP on
Linux. Unfortunately, at the moment we only support the Windows
version and only the Windows binary is up to date.

Feel free to download the LPG source from Sourceforge and build
a Linux binary for LPG on your system. I believe that that should work fine.

--philippe


Oleg Murk wrote:
> One more thing:
> When I try "Window->Preferences->LPG Preferences->Select Project", it
> shows me my project "OM", however selecting it does not have any effect
> and I cannot edit any LPG preferences.
>
>
> Oleg Murk wrote:
>> Hello,
>>
>> I am trying to follow the tutorial of IMP
>> http://eclipse-imp.sourceforge.net/documentation/users_guide .html
>> and get stuck on compiling LPG grammar (see the log below).
>>
>> FAQ
>> http://eclipse-imp.sourceforge.net/documentation/faq.html
>> mentions project "lpg.runtime.java" that can be used for external
>> compilation of LPG, however, I didn't manage to find it anywhere.
>> Whas it meant to import plugin "org.eclipse.imp.lpg.runtime" as a
>> project?
>>
>> Finally, I have tried running LPG binary on the command-line,
>> but then it complained about the syntax of a template file (see the
>> log below).
>>
>> Any suggestions, please? :)
>>
>> I have archived my whole workspace at:
>> http://uuslepo.it.da.ut.ee/~olegm/temp/workspace.tar.gz
>>
>> Thank You for Your help,
>> Oleg Mürk
>>
>> ----------------- Bash -----------------
>> [olegm@localhost ~]$ uname -a
>> Linux localhost.localdomain 2.6.22.5-76.fc7 #1 SMP Thu Aug 30 13:47:21
>> EDT 2007 i686 i686 i386 GNU/Linux
>> [olegm@localhost ~]$ tar xzf Desktop/eclipse-SDK-3.2.2-linux-gtk.tar.gz
>> [olegm@localhost ~]$ cat eclipse/eclipse.ini
>> -vm
>> /usr/java/jdk1.5.0_12/bin/java
>> -vmargs
>> -Xms40m
>> -Xmx1024m
>>
>> ----------------- Eclipse -----------------
>> Eclipse:Help->Software Updates->...
>> http://www.cs.cornell.edu/Projects/polyglot/eclipseUpdates/
>> http://lpg.sourceforge.net/updates/
>> http://eclipse-imp.sourceforge.net/updates/
>>
>> Eclipse:Files->New->New Plugin Project
>> OM
>>
>> Eclipse:Files->New->Programming Language Descriptor
>> OM
>>
>> Eclipse:Files->New->New LPG Grammar with Parser Wrapper
>> java.io.IOException: java.io.IOException:
>> /home/olegm/eclipse/plugins/lpg.runtime_2.0.6/lpgexe/lpg-lin ux_x86:
>> cannot execute
>>
>> ----------------- Bash -----------------
>> [olegm@localhost ~]$ chmod u+x
>> /home/olegm/eclipse/plugins/lpg.runtime_2.0.6/lpgexe/lpg-lin ux_x86
>>
>> ----------------- Eclipse -----------------
>> "" -include-directory='/home/olegm/eclipse/plugins/org.eclipse. imp.lpg.metatooling_1.0.62/templates/;/home/olegm/eclipse/pl ugins/lpg.runtime_2.0.6/templates/' ""
>> is an invalid option OM/src/om/safari/parser OMParser.g line
>> 1 1190048698873 43
>>
>> ----------------- Bash -----------------
>> [olegm@localhost ~]$ cat workspace/OM/src/om/safari/parser/OMParser.l
>> /home/olegm/workspace/OM/src/om/safari/parser/OMParser.g:0:0 :0:0:0:0:
>> Error: Option
>> "" -include-directory='/home/olegm/eclipse/plugins/org.eclipse. imp.lpg.metatooling_1.0.62/templates/;/home/olegm/eclipse/pl ugins/lpg.runtime_2.0.6/templates/' ""
>> is missing preceding '-'
>> /home/olegm/workspace/OM/src/om/safari/parser/OMParser.g:0:0 :0:0:0:0:
>> Error:
>> "" -include-directory='/home/olegm/eclipse/plugins/org.eclipse. imp.lpg.metatooling_1.0.62/templates/;/home/olegm/eclipse/pl ugins/lpg.runtime_2.0.6/templates/' ""
>> is an invalid option
>>
>> [olegm@localhost ~]$
>> ./eclipse/plugins/lpg.runtime_2.0.6/lpgexe/lpg-linux_x86
>> -include-directory='/home/olegm/eclipse/plugins/org.eclipse. imp.lpg.metatooling_1.0.62/templates/;/home/olegm/eclipse/pl ugins/lpg.runtime_2.0.6/templates/'
>> workspace/OM/src/om/safari/parser/OMParser.g
>>
>> Options in effect for workspace/OM/src/om/safari/parser/OMKWLexer.gi:
>>
>>
>> ACTION-BLOCK=("workspace/OM/src/om/safari/parser/OMKWLexer.java ","/.","./")
>>
>>
>> AST-DIRECTORY="./Ast" AST-TYPE="Ast" NOATTRIBUTES NOAUTOMATIC-AST
>> NOBACKTRACK BYTE CONFLICTS
>> DAT-DIRECTORY="workspace/OM/src/om/safari/parser/"
>> DAT-FILE="workspace/OM/src/om/safari/parser/OMKWLexerdcl.data "
>> DCL-FILE="workspace/OM/src/om/safari/parser/OMKWLexerdcl.java "
>> NODEBUG
>> DEF-FILE="workspace/OM/src/om/safari/parser/OMKWLexerdef.java " NOEDIT
>> NOERROR-MAPS ESCAPE='$'
>>
>> EXPORT-TERMINALS=("workspace/OM/src/om/safari/parser/OMParsersym.java ","TK_","")
>>
>> EXTENDS-PARSETABLE FACTORY="new " FILE-PREFIX="OMKWLexer" NOFIRST
>> NOFOLLOW NOGLR NOGOTO-DEFAULT
>> GRM-FILE="workspace/OM/src/om/safari/parser/OMKWLexer.gi"
>> IMP-FILE="workspace/OM/src/om/safari/parser/OMKWLexerimp.java "
>>
>> INCLUDE-DIRECTORY=" /home/olegm/eclipse/plugins/org.eclipse.imp.lpg.metatooling_ 1.0.62/templates/;/home/olegm/eclipse/plugins/lpg.runtime_2. 0.6/templates/ "
>>
>> IMP-FILE="workspace/OM/src/om/safari/parser/OMKWLexerimp.java " LALR=1
>> NOLIST MARGIN=4 MAX-CASES=1024 NAMES=OPTIMIZED NONT-CHECK
>> OR_MARKER='|'
>> OUT-DIRECTORY="workspace/OM/src/om/safari/parser/"
>> PACKAGE="om.safari.parser" NOPARENT-SAVE
>> PARSETABLE-INTERFACES="lpg.runtime.ParseTable" PREFIX="Char_"
>> PRIORITY
>> PROGRAMMING_LANGUAGE=JAVA
>> PRS-FILE="workspace/OM/src/om/safari/parser/OMKWLexerprs.java "
>> NOQUIET
>> READ-REDUCE REMAP-TERMINALS NOSCOPES NOSERIALIZE NOSHIFT-DEFAULT
>> NOSINGLE-PRODUCTIONS NOSOFT-KEYWORDS NOSTATES SUFFIX=""
>> SYM-FILE="workspace/OM/src/om/safari/parser/OMKWLexersym.java "
>> TAB-FILE="OMKWLexer.t" TABLE TEMPLATE="KeywordTemplate.gi"
>> TRACE=CONFLICTS NOVARIABLES NOVERBOSE NOVISITOR
>> VISITOR-TYPE="Visitor"
>> WARNINGS NOXREF
>>
>> /home/olegm/eclipse/plugins/org.eclipse.imp.lpg.metatooling_ 1.0.62/templates/KeywordTemplate.gi:25:1:25:4:775:778:
>> Error: Syntax error detected on this token
Re: Problems with LPG parser [message #5229 is a reply to message #5161] Tue, 18 September 2007 18:02 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: olegm.gmail.com

Hello,

Philippe Charles wrote:
> It would appear from your output that you are trying to use IMP on
> Linux. Unfortunately, at the moment we only support the Windows
> version and only the Windows binary is up to date.
>
> Feel free to download the LPG source from Sourceforge and build
> a Linux binary for LPG on your system. I believe that that should work
> fine.

Building LPG binary for Linux from sources didn't give results (the same
errors). However I managed to run LPG using Windows emulator Wine.

The trick is to replace the contents of file
$ECLIPSE_HOME/plugins/lpg.runtime_2.0.6/lpgexe/lpg-linux_x86
with a script
----------------------------
#/bin/bash
`echo wine $0 $* | sed "s/lpg-linux_x86/lpg-win32_x86.exe/" | sed
"s/\"-include/-include/" | sed "s/'\"/'/"`
----------------------------
and make it executable
chmod u+x $ECLIPSE_HOME/plugins/lpg.runtime_2.0.6/lpgexe/lpg-linux_x86

Cheers,
OM
Re: Problems with LPG parser [message #5295 is a reply to message #5229] Wed, 19 September 2007 01:09 Go to previous message
Philippe Charles is currently offline Philippe CharlesFriend
Messages: 8
Registered: July 2009
Junior Member
Good idea. Thanks for the info.
--thanks

Oleg Murk wrote:
> Hello,
>
> Philippe Charles wrote:
>> It would appear from your output that you are trying to use IMP on
>> Linux. Unfortunately, at the moment we only support the Windows
>> version and only the Windows binary is up to date.
>>
>> Feel free to download the LPG source from Sourceforge and build
>> a Linux binary for LPG on your system. I believe that that should work
>> fine.
>
> Building LPG binary for Linux from sources didn't give results (the same
> errors). However I managed to run LPG using Windows emulator Wine.
>
> The trick is to replace the contents of file
> $ECLIPSE_HOME/plugins/lpg.runtime_2.0.6/lpgexe/lpg-linux_x86
> with a script
> ----------------------------
> #/bin/bash
> `echo wine $0 $* | sed "s/lpg-linux_x86/lpg-win32_x86.exe/" | sed
> "s/\"-include/-include/" | sed "s/'\"/'/"`
> ----------------------------
> and make it executable
> chmod u+x $ECLIPSE_HOME/plugins/lpg.runtime_2.0.6/lpgexe/lpg-linux_x86
>
> Cheers,
> OM
Re: Problems with LPG parser [message #566414 is a reply to message #5023] Mon, 17 September 2007 18:03 Go to previous message
Eclipse UserFriend
Originally posted by: olegm.gmail.com

One more thing:
When I try "Window->Preferences->LPG Preferences->Select Project", it
shows me my project "OM", however selecting it does not have any effect
and I cannot edit any LPG preferences.


Oleg Murk wrote:
> Hello,
>
> I am trying to follow the tutorial of IMP
> http://eclipse-imp.sourceforge.net/documentation/users_guide .html
> and get stuck on compiling LPG grammar (see the log below).
>
> FAQ
> http://eclipse-imp.sourceforge.net/documentation/faq.html
> mentions project "lpg.runtime.java" that can be used for external
> compilation of LPG, however, I didn't manage to find it anywhere.
> Whas it meant to import plugin "org.eclipse.imp.lpg.runtime" as a project?
>
> Finally, I have tried running LPG binary on the command-line,
> but then it complained about the syntax of a template file (see the log
> below).
>
> Any suggestions, please? :)
>
> I have archived my whole workspace at:
> http://uuslepo.it.da.ut.ee/~olegm/temp/workspace.tar.gz
>
> Thank You for Your help,
> Oleg Mürk
>
> ----------------- Bash -----------------
> [olegm@localhost ~]$ uname -a
> Linux localhost.localdomain 2.6.22.5-76.fc7 #1 SMP Thu Aug 30 13:47:21
> EDT 2007 i686 i686 i386 GNU/Linux
> [olegm@localhost ~]$ tar xzf Desktop/eclipse-SDK-3.2.2-linux-gtk.tar.gz
> [olegm@localhost ~]$ cat eclipse/eclipse.ini
> -vm
> /usr/java/jdk1.5.0_12/bin/java
> -vmargs
> -Xms40m
> -Xmx1024m
>
> ----------------- Eclipse -----------------
> Eclipse:Help->Software Updates->...
> http://www.cs.cornell.edu/Projects/polyglot/eclipseUpdates/
> http://lpg.sourceforge.net/updates/
> http://eclipse-imp.sourceforge.net/updates/
>
> Eclipse:Files->New->New Plugin Project
> OM
>
> Eclipse:Files->New->Programming Language Descriptor
> OM
>
> Eclipse:Files->New->New LPG Grammar with Parser Wrapper
>
> java.io.IOException: java.io.IOException:
> /home/olegm/eclipse/plugins/lpg.runtime_2.0.6/lpgexe/lpg-lin ux_x86:
> cannot execute
>
> ----------------- Bash -----------------
> [olegm@localhost ~]$ chmod u+x
> /home/olegm/eclipse/plugins/lpg.runtime_2.0.6/lpgexe/lpg-lin ux_x86
>
> ----------------- Eclipse -----------------
> "" -include-directory='/home/olegm/eclipse/plugins/org.eclipse. imp.lpg.metatooling_1.0.62/templates/;/home/olegm/eclipse/pl ugins/lpg.runtime_2.0.6/templates/' ""
> is an invalid option OM/src/om/safari/parser OMParser.g line 1
> 1190048698873 43
>
> ----------------- Bash -----------------
> [olegm@localhost ~]$ cat workspace/OM/src/om/safari/parser/OMParser.l
> /home/olegm/workspace/OM/src/om/safari/parser/OMParser.g:0:0 :0:0:0:0:
> Error: Option
> "" -include-directory='/home/olegm/eclipse/plugins/org.eclipse. imp.lpg.metatooling_1.0.62/templates/;/home/olegm/eclipse/pl ugins/lpg.runtime_2.0.6/templates/' ""
> is missing preceding '-'
> /home/olegm/workspace/OM/src/om/safari/parser/OMParser.g:0:0 :0:0:0:0:
> Error:
> "" -include-directory='/home/olegm/eclipse/plugins/org.eclipse. imp.lpg.metatooling_1.0.62/templates/;/home/olegm/eclipse/pl ugins/lpg.runtime_2.0.6/templates/' ""
> is an invalid option
>
> [olegm@localhost ~]$
> ./eclipse/plugins/lpg.runtime_2.0.6/lpgexe/lpg-linux_x86
> -include-directory='/home/olegm/eclipse/plugins/org.eclipse. imp.lpg.metatooling_1.0.62/templates/;/home/olegm/eclipse/pl ugins/lpg.runtime_2.0.6/templates/'
> workspace/OM/src/om/safari/parser/OMParser.g
>
> Options in effect for workspace/OM/src/om/safari/parser/OMKWLexer.gi:
>
>
> ACTION-BLOCK=("workspace/OM/src/om/safari/parser/OMKWLexer.java ","/.","./")
>
> AST-DIRECTORY="./Ast" AST-TYPE="Ast" NOATTRIBUTES NOAUTOMATIC-AST
> NOBACKTRACK BYTE CONFLICTS
> DAT-DIRECTORY="workspace/OM/src/om/safari/parser/"
> DAT-FILE="workspace/OM/src/om/safari/parser/OMKWLexerdcl.data "
> DCL-FILE="workspace/OM/src/om/safari/parser/OMKWLexerdcl.java " NODEBUG
> DEF-FILE="workspace/OM/src/om/safari/parser/OMKWLexerdef.java " NOEDIT
> NOERROR-MAPS ESCAPE='$'
>
> EXPORT-TERMINALS=("workspace/OM/src/om/safari/parser/OMParsersym.java ","TK_","")
>
> EXTENDS-PARSETABLE FACTORY="new " FILE-PREFIX="OMKWLexer" NOFIRST
> NOFOLLOW NOGLR NOGOTO-DEFAULT
> GRM-FILE="workspace/OM/src/om/safari/parser/OMKWLexer.gi"
> IMP-FILE="workspace/OM/src/om/safari/parser/OMKWLexerimp.java "
>
> INCLUDE-DIRECTORY=" /home/olegm/eclipse/plugins/org.eclipse.imp.lpg.metatooling_ 1.0.62/templates/;/home/olegm/eclipse/plugins/lpg.runtime_2. 0.6/templates/ "
>
> IMP-FILE="workspace/OM/src/om/safari/parser/OMKWLexerimp.java " LALR=1
> NOLIST MARGIN=4 MAX-CASES=1024 NAMES=OPTIMIZED NONT-CHECK
> OR_MARKER='|'
> OUT-DIRECTORY="workspace/OM/src/om/safari/parser/"
> PACKAGE="om.safari.parser" NOPARENT-SAVE
> PARSETABLE-INTERFACES="lpg.runtime.ParseTable" PREFIX="Char_" PRIORITY
> PROGRAMMING_LANGUAGE=JAVA
> PRS-FILE="workspace/OM/src/om/safari/parser/OMKWLexerprs.java " NOQUIET
> READ-REDUCE REMAP-TERMINALS NOSCOPES NOSERIALIZE NOSHIFT-DEFAULT
> NOSINGLE-PRODUCTIONS NOSOFT-KEYWORDS NOSTATES SUFFIX=""
> SYM-FILE="workspace/OM/src/om/safari/parser/OMKWLexersym.java "
> TAB-FILE="OMKWLexer.t" TABLE TEMPLATE="KeywordTemplate.gi"
> TRACE=CONFLICTS NOVARIABLES NOVERBOSE NOVISITOR
> VISITOR-TYPE="Visitor"
> WARNINGS NOXREF
>
> /home/olegm/eclipse/plugins/org.eclipse.imp.lpg.metatooling_ 1.0.62/templates/KeywordTemplate.gi:25:1:25:4:775:778:
> Error: Syntax error detected on this token
Re: Problems with LPG parser [message #566429 is a reply to message #5094] Mon, 17 September 2007 23:06 Go to previous message
Philippe Charles is currently offline Philippe CharlesFriend
Messages: 8
Registered: July 2009
Junior Member
Hi Oleg:

It would appear from your output that you are trying to use IMP on
Linux. Unfortunately, at the moment we only support the Windows
version and only the Windows binary is up to date.

Feel free to download the LPG source from Sourceforge and build
a Linux binary for LPG on your system. I believe that that should work fine.

--philippe


Oleg Murk wrote:
> One more thing:
> When I try "Window->Preferences->LPG Preferences->Select Project", it
> shows me my project "OM", however selecting it does not have any effect
> and I cannot edit any LPG preferences.
>
>
> Oleg Murk wrote:
>> Hello,
>>
>> I am trying to follow the tutorial of IMP
>> http://eclipse-imp.sourceforge.net/documentation/users_guide .html
>> and get stuck on compiling LPG grammar (see the log below).
>>
>> FAQ
>> http://eclipse-imp.sourceforge.net/documentation/faq.html
>> mentions project "lpg.runtime.java" that can be used for external
>> compilation of LPG, however, I didn't manage to find it anywhere.
>> Whas it meant to import plugin "org.eclipse.imp.lpg.runtime" as a
>> project?
>>
>> Finally, I have tried running LPG binary on the command-line,
>> but then it complained about the syntax of a template file (see the
>> log below).
>>
>> Any suggestions, please? :)
>>
>> I have archived my whole workspace at:
>> http://uuslepo.it.da.ut.ee/~olegm/temp/workspace.tar.gz
>>
>> Thank You for Your help,
>> Oleg Mürk
>>
>> ----------------- Bash -----------------
>> [olegm@localhost ~]$ uname -a
>> Linux localhost.localdomain 2.6.22.5-76.fc7 #1 SMP Thu Aug 30 13:47:21
>> EDT 2007 i686 i686 i386 GNU/Linux
>> [olegm@localhost ~]$ tar xzf Desktop/eclipse-SDK-3.2.2-linux-gtk.tar.gz
>> [olegm@localhost ~]$ cat eclipse/eclipse.ini
>> -vm
>> /usr/java/jdk1.5.0_12/bin/java
>> -vmargs
>> -Xms40m
>> -Xmx1024m
>>
>> ----------------- Eclipse -----------------
>> Eclipse:Help->Software Updates->...
>> http://www.cs.cornell.edu/Projects/polyglot/eclipseUpdates/
>> http://lpg.sourceforge.net/updates/
>> http://eclipse-imp.sourceforge.net/updates/
>>
>> Eclipse:Files->New->New Plugin Project
>> OM
>>
>> Eclipse:Files->New->Programming Language Descriptor
>> OM
>>
>> Eclipse:Files->New->New LPG Grammar with Parser Wrapper
>> java.io.IOException: java.io.IOException:
>> /home/olegm/eclipse/plugins/lpg.runtime_2.0.6/lpgexe/lpg-lin ux_x86:
>> cannot execute
>>
>> ----------------- Bash -----------------
>> [olegm@localhost ~]$ chmod u+x
>> /home/olegm/eclipse/plugins/lpg.runtime_2.0.6/lpgexe/lpg-lin ux_x86
>>
>> ----------------- Eclipse -----------------
>> "" -include-directory='/home/olegm/eclipse/plugins/org.eclipse. imp.lpg.metatooling_1.0.62/templates/;/home/olegm/eclipse/pl ugins/lpg.runtime_2.0.6/templates/' ""
>> is an invalid option OM/src/om/safari/parser OMParser.g line
>> 1 1190048698873 43
>>
>> ----------------- Bash -----------------
>> [olegm@localhost ~]$ cat workspace/OM/src/om/safari/parser/OMParser.l
>> /home/olegm/workspace/OM/src/om/safari/parser/OMParser.g:0:0 :0:0:0:0:
>> Error: Option
>> "" -include-directory='/home/olegm/eclipse/plugins/org.eclipse. imp.lpg.metatooling_1.0.62/templates/;/home/olegm/eclipse/pl ugins/lpg.runtime_2.0.6/templates/' ""
>> is missing preceding '-'
>> /home/olegm/workspace/OM/src/om/safari/parser/OMParser.g:0:0 :0:0:0:0:
>> Error:
>> "" -include-directory='/home/olegm/eclipse/plugins/org.eclipse. imp.lpg.metatooling_1.0.62/templates/;/home/olegm/eclipse/pl ugins/lpg.runtime_2.0.6/templates/' ""
>> is an invalid option
>>
>> [olegm@localhost ~]$
>> ./eclipse/plugins/lpg.runtime_2.0.6/lpgexe/lpg-linux_x86
>> -include-directory='/home/olegm/eclipse/plugins/org.eclipse. imp.lpg.metatooling_1.0.62/templates/;/home/olegm/eclipse/pl ugins/lpg.runtime_2.0.6/templates/'
>> workspace/OM/src/om/safari/parser/OMParser.g
>>
>> Options in effect for workspace/OM/src/om/safari/parser/OMKWLexer.gi:
>>
>>
>> ACTION-BLOCK=("workspace/OM/src/om/safari/parser/OMKWLexer.java ","/.","./")
>>
>>
>> AST-DIRECTORY="./Ast" AST-TYPE="Ast" NOATTRIBUTES NOAUTOMATIC-AST
>> NOBACKTRACK BYTE CONFLICTS
>> DAT-DIRECTORY="workspace/OM/src/om/safari/parser/"
>> DAT-FILE="workspace/OM/src/om/safari/parser/OMKWLexerdcl.data "
>> DCL-FILE="workspace/OM/src/om/safari/parser/OMKWLexerdcl.java "
>> NODEBUG
>> DEF-FILE="workspace/OM/src/om/safari/parser/OMKWLexerdef.java " NOEDIT
>> NOERROR-MAPS ESCAPE='$'
>>
>> EXPORT-TERMINALS=("workspace/OM/src/om/safari/parser/OMParsersym.java ","TK_","")
>>
>> EXTENDS-PARSETABLE FACTORY="new " FILE-PREFIX="OMKWLexer" NOFIRST
>> NOFOLLOW NOGLR NOGOTO-DEFAULT
>> GRM-FILE="workspace/OM/src/om/safari/parser/OMKWLexer.gi"
>> IMP-FILE="workspace/OM/src/om/safari/parser/OMKWLexerimp.java "
>>
>> INCLUDE-DIRECTORY=" /home/olegm/eclipse/plugins/org.eclipse.imp.lpg.metatooling_ 1.0.62/templates/;/home/olegm/eclipse/plugins/lpg.runtime_2. 0.6/templates/ "
>>
>> IMP-FILE="workspace/OM/src/om/safari/parser/OMKWLexerimp.java " LALR=1
>> NOLIST MARGIN=4 MAX-CASES=1024 NAMES=OPTIMIZED NONT-CHECK
>> OR_MARKER='|'
>> OUT-DIRECTORY="workspace/OM/src/om/safari/parser/"
>> PACKAGE="om.safari.parser" NOPARENT-SAVE
>> PARSETABLE-INTERFACES="lpg.runtime.ParseTable" PREFIX="Char_"
>> PRIORITY
>> PROGRAMMING_LANGUAGE=JAVA
>> PRS-FILE="workspace/OM/src/om/safari/parser/OMKWLexerprs.java "
>> NOQUIET
>> READ-REDUCE REMAP-TERMINALS NOSCOPES NOSERIALIZE NOSHIFT-DEFAULT
>> NOSINGLE-PRODUCTIONS NOSOFT-KEYWORDS NOSTATES SUFFIX=""
>> SYM-FILE="workspace/OM/src/om/safari/parser/OMKWLexersym.java "
>> TAB-FILE="OMKWLexer.t" TABLE TEMPLATE="KeywordTemplate.gi"
>> TRACE=CONFLICTS NOVARIABLES NOVERBOSE NOVISITOR
>> VISITOR-TYPE="Visitor"
>> WARNINGS NOXREF
>>
>> /home/olegm/eclipse/plugins/org.eclipse.imp.lpg.metatooling_ 1.0.62/templates/KeywordTemplate.gi:25:1:25:4:775:778:
>> Error: Syntax error detected on this token
Re: Problems with LPG parser [message #566450 is a reply to message #5161] Tue, 18 September 2007 18:02 Go to previous message
Eclipse UserFriend
Originally posted by: olegm.gmail.com

Hello,

Philippe Charles wrote:
> It would appear from your output that you are trying to use IMP on
> Linux. Unfortunately, at the moment we only support the Windows
> version and only the Windows binary is up to date.
>
> Feel free to download the LPG source from Sourceforge and build
> a Linux binary for LPG on your system. I believe that that should work
> fine.

Building LPG binary for Linux from sources didn't give results (the same
errors). However I managed to run LPG using Windows emulator Wine.

The trick is to replace the contents of file
$ECLIPSE_HOME/plugins/lpg.runtime_2.0.6/lpgexe/lpg-linux_x86
with a script
----------------------------
#/bin/bash
`echo wine $0 $* | sed "s/lpg-linux_x86/lpg-win32_x86.exe/" | sed
"s/\"-include/-include/" | sed "s/'\"/'/"`
----------------------------
and make it executable
chmod u+x $ECLIPSE_HOME/plugins/lpg.runtime_2.0.6/lpgexe/lpg-linux_x86

Cheers,
OM
Re: Problems with LPG parser [message #566474 is a reply to message #5229] Wed, 19 September 2007 01:09 Go to previous message
Philippe Charles is currently offline Philippe CharlesFriend
Messages: 8
Registered: July 2009
Junior Member
Good idea. Thanks for the info.
--thanks

Oleg Murk wrote:
> Hello,
>
> Philippe Charles wrote:
>> It would appear from your output that you are trying to use IMP on
>> Linux. Unfortunately, at the moment we only support the Windows
>> version and only the Windows binary is up to date.
>>
>> Feel free to download the LPG source from Sourceforge and build
>> a Linux binary for LPG on your system. I believe that that should work
>> fine.
>
> Building LPG binary for Linux from sources didn't give results (the same
> errors). However I managed to run LPG using Windows emulator Wine.
>
> The trick is to replace the contents of file
> $ECLIPSE_HOME/plugins/lpg.runtime_2.0.6/lpgexe/lpg-linux_x86
> with a script
> ----------------------------
> #/bin/bash
> `echo wine $0 $* | sed "s/lpg-linux_x86/lpg-win32_x86.exe/" | sed
> "s/\"-include/-include/" | sed "s/'\"/'/"`
> ----------------------------
> and make it executable
> chmod u+x $ECLIPSE_HOME/plugins/lpg.runtime_2.0.6/lpgexe/lpg-linux_x86
>
> Cheers,
> OM
Previous Topic:Problems with LPG parser
Next Topic:LexStream
Goto Forum:
  


Current Time: Wed Apr 24 19:15:18 GMT 2024

Powered by FUDForum. Page generated in 0.03164 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top