Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [platform-dev] using lex/yacc files for syntax highlightning

Would it be possible to call just the generated bison parser from java ?

Since the scanner and parser tracks the exact location of each token, and also 
keeps track of the type of token, it should be possible to call the parser 
one statement at the time (separated by ';'), and use the return information 
for the hl, and outline etc.

Henrik

ps. if you happend to have any PL/I code lying around, don't hesitate to try 
out the pl1gcc compiler.

On Monday 17 January 2005 14.31, Scott Stanchfield wrote:
> Yea! PL/I! My second favorite language!
>
> You may want to consider ANTLR instead of lex/yacc (ANTLR is java-based),
> though I agree that a full blown parser may be a bit expensive during edit.
> Of course since you're probably already using flex/bison for the gcc front
> end, that doesn't help much. (Not just C/C++ vs Java; ANTLR is LL whereas
> bison is LALR)
>
> A quick thought: "EEEK! PL/I doesn't have reserved keywords! What a
> nightmare to parse!". Syntax highlighting and code assist could be really
> tricky and potentially confusing for the user as they type. Maybe you only
> want to trigger the coloring after they complete a line or move the cursor
> off the current line to get less noise as the user types, and the perf hit
> isn't as often?
>
> [I'm thinking that as the user types, some words could potentially change
> highlighting based on context determining if they are keywords or not. "IF
> IF = ELSE THEN ELSE = THEN; ELSE THEN = IF;" (my syntax could be off...
> been a loooong time since I used PL/I...) Of course anyone who writes code
> like that (other than as a silly example) should be shot on sight.]
>
> -- Scott
>
> > -----Original Message-----
> > From: platform-dev-admin@xxxxxxxxxxx
> > [mailto:platform-dev-admin@xxxxxxxxxxx] On Behalf Of Henrik Sorensen
> > Sent: Sunday, January 16, 2005 7:42 PM
> > To: platform-dev@xxxxxxxxxxx
> > Subject: [platform-dev] using lex/yacc files for syntax highlightning
> >
> > please let me know if this is not the right mailinglist for
> > hl related questions.
> >
> > I am working on a new frontend for gcc for the programming
> > language PL/I.
> > (pl1gcc.sourceforge.net)
> >
> > Now that I have the lex scanner and yacc (bison) parser in a
> > good shape, it would be natural to integrate this into the
> > powerfull eclipse editor framework.
> >
> > What is the best approach for this ?
> >
> >
> > Henrik
> >
> >
> > _______________________________________________
> > platform-dev mailing list
> > platform-dev@xxxxxxxxxxx
> > http://dev.eclipse.org/mailman/listinfo/platform-dev
>
> _______________________________________________
> platform-dev mailing list
> platform-dev@xxxxxxxxxxx
> http://dev.eclipse.org/mailman/listinfo/platform-dev


Back to the top