For Programmers: Free Programming Magazines  


Home > Archive > Compilers > March 2005 > Parsing Java methods contra variables with only 1 look-ahead









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Parsing Java methods contra variables with only 1 look-ahead
LeperMessiah

2005-03-18, 2:14 pm

Like everybody starts out by saying: Im new to the area of compilers, so this is probably a dumb question, but here goes...

Im thinking about wether it is possible, using a recursive descent parser with one symbol of lookehead, to parse either a method-decleration or variable decleration in java. They both can be similar during the first 3 symbols:

public int myName

if this is followed by a "( )" ( or with parameteres ) then we know its a method, but there is no way of knowing this with only 1 lookahead, is there ? Would this be possible with a bottom-up parser instead?

Who-ever can answer this, will be in my prayers!
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com