Hi Jonathan, Jonathan Levinson wrote: > Hi Vincent, > > Excellent ideas! > > The diagram you drew is extremely useful! > > If the font shorthand sub-language has a grammar that is regular then it also > has a grammar that is LL(1). So recursive descent parsing will work, if > there is a regular grammar. > > I think the best way of getting font shorthand to work would proceed in > stages: > > 1) First get the current code to properly parse and accept valid font > shorthand expressions. This should be very easy. The one remaining problem > (AFAIK) is the parsing of font-size/line-height where /line-height is > optional. Currently spaces are not allowed around the slash "/" and they > should be. I'm going to try to get to this problem as soon as I have time, > probably in a day or so.
The current code predates the switch to Java 1.4 as a minimum requirement, so couldn’t use the java.util.regex package. Feel free to make use of regular expressions if you think that will make the job easier. > 2) Evaluate which parser or automaton approach is the simplest and produces > better error states than the current approach. > 3) Implement the approach one has chosen in (2). Good luck! <snip/> Vincent