Antonio
Posts: 33
Nickname: arhak
Registered: Jul, 2005
|
|
Re: please help...
|
Posted: Jul 7, 2005 6:52 PM
|
|
It is not a simple question.
1) an EBNF grammar is a formalization of a language specification for example a Java class may be something like this: java_class ::= package_decl imports visibility_modifiers 'KW_CLASS' identifier extends_decl implements_decl class_body where the lowercase words are non-terminals and upercase words are terminals. 'KW_CLASS' is nothing else than the word "class" while visibility_modifiers is something like: visibility_modifiers ::= 'KW_PUBLIC' | 'KW_PROTECTED' | empty | 'KW_PRIVATE'
Another formalism is the BNF grammars (the example is both BNF & EBNF, because the first is subset of the second one) and they are usefull in compilers construction because there are several tool for making lexical analizers and/or syntactical analizers beginning with a BNF or EBNF grammar.
2) It won't be easy to parse any kind of Java program, it is a huge grammar (maybe a Java subset). You will need to do a lexical analizer and a syntactical analizer to recognize the Java sources and will have to think a lot to achieve the convertion to C
3) 4) 5) This is much more complex than point 2), you don't wake up one day and say "I'm going to make a migration tool", you will have to study a lot. Start looking for "Compiler Techniques and Tools" book and keep looking for more books about it.
Good look
|
|