Coldfusion Xtext Grammar

33 views
Skip to first unread message

mike...@gmail.com

unread,
Dec 1, 2015, 9:28:26 AM12/1/15
to CFEclipse Users

Alongside the discussion of pushing CFEclipse forward, it sounds like a few folks were interested in getting a Coldfusion Xtext grammar working for CFEclipse, among other potential possibilities. I've started this thread to help those interested keep track of and participate to that end.

Main Issue:

Getting Xtext to treat all text as output until, while recognizing the Coldfusion tokens that could be anywhere within.

Background:

Andrew kindly shared his initial grammar on Github which is no doubt a solid start.

I kept to a reduced grammar that only tried to handle one tag (I didn't even care what it was unless it started with <cf) and output before, after, or inside of it. I wasn't able to convince Xtext to handle this correctly unless the file started with a cf tag, but even that had its problems.

mike...@gmail.com

unread,
Dec 1, 2015, 9:29:50 AM12/1/15
to CFEclipse Users
I'm going to try to find a knowledgeable resource who can give us a little support through this problem. Even if they don't know CF, I think we could explain and give examples that would get us where we need to be.

Andrew Myers

unread,
Dec 2, 2015, 12:45:01 AM12/2/15
to cfeclip...@googlegroups.com
Excellent.  Thanks for taking an interest in this Mike!  Look forward to see if you get any good leads.

Best regards,
Andrew.
--
--
For more information on CFEclipse visit: cfeclipse.org
For support, FAQ and tips and tricks visit: https://github.com/cfeclipse/cfeclipse/wiki
 
You are subscribed to the Google Groups "CFEclipse Users" group.
To post send email to: cfeclip...@googlegroups.com
To unsubscribe send email to: cfeclipse-use...@googlegroups.com
For more options, visit this group online: http://groups.google.com/group/cfeclipse-users?hl=en

---
You received this message because you are subscribed to the Google Groups "CFEclipse Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cfeclipse-use...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

mike...@gmail.com

unread,
Dec 11, 2015, 11:53:50 AM12/11/15
to CFEclipse Users
So I posted on the eclipse forums as one channel for help and got a response...

See the post here:

I have dug into the RichTextString stuff as he pointed out, but haven't yet gotten past this problem. It kind of degenerated to the same fight between and invalid antlr grammar error and unreachable alternatives.

I'm going to try to post more along with my stupid simple grammar experiment to try and solve this.

denstar

unread,
Dec 16, 2015, 5:11:16 PM12/16/15
to cfeclip...@googlegroups.com
I think the main hurdle with xtext is that it uses ANTLR3, and the new
grammar is for ANTLR4.

That said, it might not be too hard to refactor the grammar, and beyond
that, we're not using ANTLR for the tag parsing at all, so we can
continue to use what we've come up with so far.

I think that to address the "ignore output" problem, we just need to add
a bit of logic that either adds what's "inside" to a token that gets
ignored, or flip the token stream on and off at the start/end of the
"non-CFML" block.

Should we use Andrew's go at it as the starting place? We can create a
repo under the cfeclipse group if we'd like. Whatever is clever!

Another option that should be considered is just building the "document
model" in cfml.parsing, and then having tools use that as a basis for
doing stuff. Right now cfml.parsing is just sorta walking a tree and
doing stuff, but if we had a model that we populated, we could pass it
around as an abstract kind of deal that anything could leverage.
> --
> --
> For more information on CFEclipse visit: cfeclipse.org
> For support, FAQ and tips and tricks visit:
> https://github.com/cfeclipse/cfeclipse/wiki
>
> You are subscribed to the Google Groups "CFEclipse Users" group.
> To post send email to: cfeclip...@googlegroups.com
> To unsubscribe send email to: cfeclipse-use...@googlegroups.com
> For more options, visit this group online:
> http://groups.google.com/group/cfeclipse-users?hl=en
>
> ---
> You received this message because you are subscribed to the Google
> Groups "CFEclipse Users" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to cfeclipse-use...@googlegroups.com
> <mailto:cfeclipse-use...@googlegroups.com>.
Reply all
Reply to author
Forward
0 new messages