forums.ps2dev.org Forum Index forums.ps2dev.org
Homebrew PS2, PSP & PS3 Development Discussions
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Semantic Analysis and Parsing on the PS2

 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PS2 Development
View previous topic :: View next topic  
Author Message
whatisdot



Joined: 07 Apr 2008
Posts: 43
Location: Purdue University, USA

PostPosted: Thu Apr 24, 2008 3:03 am    Post subject: Semantic Analysis and Parsing on the PS2 Reply with quote

Hello again,

I have another question for you guys. For those of you who know about semantic analysis and programs that do this for us (yacc, lex, flex, bison, etc). Are there any programs or libraries right now for doing this on the PS2? I haven't seen anything like this in the PS2SDK, but maybe I haven't looked hard enough... I know about the linux port on the PS2, so I figured there had to be SOMETHING like this available out there.
If no one has been working on something like this, then I might just take up the challenge. Programs like these would be a very powerful tool for developers.

In the grand scheme of things, I would like to implement a makeshift shell to work as an interface to the system, as well as being a safety layer. Getting all of those memory errors are a bit frustrating =) I tried messing around with 'radshell' but I couldn't get it to run properly on my PS2.
_________________
--------------------------------------------------------------
"A witty saying proves nothing."
--------------------------------------------------------------
Back to top
View user's profile Send private message
orphean



Joined: 20 Apr 2008
Posts: 8

PostPosted: Thu Apr 24, 2008 7:55 pm    Post subject: Reply with quote

Things like flex and bison simply take in a grammar, process it, and spit out a c source file. So you wouldn't need to create special binaries to do that.

For the library components to the tools you could simply build them using the ps2 toolchain and link it in like any other library.

I don't see why this would require specialized ps2 libs I suppose.
Back to top
View user's profile Send private message
whatisdot



Joined: 07 Apr 2008
Posts: 43
Location: Purdue University, USA

PostPosted: Fri May 02, 2008 3:08 am    Post subject: Reply with quote

I have been playing around with flex and bison and trying to get them to link properly. I have been running into some problems, though. I keep getting this error when it comes to linking:
Code:

/usr/local/ps2dev/ee/lib/gcc-lib/ee/3.2.2/../../../../ee/bin/ld: y.tab.o: Relocations in generic ELF (EM: 62)
y.tab.o: could not read symbols: File in wrong format
collect2: ld returned 1 exit status
make: *** [pclis.elf] Error 1

I could swear that I saw lex and bison being used when I was running the Toolchain, but I just can't get them to link properly with EE-GCC. All the searches I have done on this issue basically say there's nothing to do about it. I guess it just can't be done... =( It's a real shame, because this would make life easier for developers making complex apps for the PS2.

Maybe I'll just have to build my own...
_________________
--------------------------------------------------------------
"A witty saying proves nothing."
--------------------------------------------------------------
Back to top
View user's profile Send private message
Mega Man



Joined: 18 Jun 2005
Posts: 274

PostPosted: Fri May 02, 2008 3:47 am    Post subject: Reply with quote

You are using the wrong compiler. The file "y.tab.o" was created by your native host compiler, but you need to use the ee-gcc cross compiler.
Back to top
View user's profile Send private message Visit poster's website
whatisdot



Joined: 07 Apr 2008
Posts: 43
Location: Purdue University, USA

PostPosted: Fri May 02, 2008 6:37 am    Post subject: Reply with quote

Thanks for the heads up, Mega Man. I fixed that problem and ran into another one. The compiler is spitting back some weird errors. I think it has to do with dependencies, but I don't know that much about what is happening...

Code:

y.tab.o(.text+0x324): In function `yyparse':
y.tab.c: undefined reference to `yylex'
y.tab.o(.data+0x11): In function `yyerror(char const*)':
y.tab.c: undefined reference to `__gxx_personality_v0'
lex.yy.o(.text+0x44): In function `yylex()':
lex.yy.c: undefined reference to `_impure_ptr'
lex.yy.o(.text+0x48):lex.yy.c: undefined reference to `_impure_ptr'
lex.yy.o(.text+0x60):lex.yy.c: undefined reference to `_impure_ptr'
lex.yy.o(.text+0x64):lex.yy.c: undefined reference to `_impure_ptr'
lex.yy.o(.text+0x324):lex.yy.c: undefined reference to `atoi'
lex.yy.o(.text+0x53c):lex.yy.c: undefined reference to `yywrap'
lex.yy.o(.text+0x9b0): In function `yy_get_next_buffer()':
lex.yy.c: undefined reference to `__srget'
lex.yy.o(.text+0x12a4): In function `yyinput()':
lex.yy.c: undefined reference to `yywrap'
lex.yy.o(.text+0x17b0): In function `yy_init_buffer(yy_buffer_state*, __sFILE*)':
lex.yy.c: undefined reference to `isatty'
lex.yy.o(.text+0x1e48): In function `yy_fatal_error(char const*)':
lex.yy.c: undefined reference to `_impure_ptr'
lex.yy.o(.text+0x1e4c):lex.yy.c: undefined reference to `_impure_ptr'
lex.yy.o(.data+0x11): In function `yylex()':
lex.yy.c: undefined reference to `__gxx_personality_v0'
collect2: ld returned 1 exit status

_________________
--------------------------------------------------------------
"A witty saying proves nothing."
--------------------------------------------------------------
Back to top
View user's profile Send private message
Mega Man



Joined: 18 Jun 2005
Posts: 274

PostPosted: Fri May 02, 2008 9:21 am    Post subject: Reply with quote

You used at least for one C file the compiler ee-g++. Then you need to use it also as the linker. When you want to access a C++ symbol from C, you need to place a "extern "C" { ... }" around it.
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PS2 Development All times are GMT + 10 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group