Open volgar1x opened 11 years ago
Hi,
Well actually I still am involved with AS3 and compilers but this one is deprecated so to speak.
It looks like its failing on this
for some reason. Try taking that off and see if it works.
while(_i1 < aliases.length)
Mike
I added by myself a IASThisExpression to the dom
package (and its implementation of course) so the this
keyword might not be the problem here. I edited my previous message while you were writing your comment : I think Antlr fails to parse the <
operator.
Hmm, yeah I spent months on that grammar. AS3 is VERY hard language to write a full grammar for.
The problem with <
is that we have XML literals in AS3 so there is an ambiguity in the grammar dealing with this.
Although the while statement is such an obvious usecase, I can't not imagine I didn't run into this. I had a full documentor like asdoc running using this framework.
Mike
Ok, so how to fix this error ? I can't surround of space all operators of the project I'm working on
I can't surround of space all operator
What does that mean?
As far as fixing this, I am sorry but the only thing you can do is try adjusting the grammar where the ambiguity exists and recompiling the parser and lexer.
I can't do this as I am offering the framework as is right now.
Tell me this, are you using this for only parsing? Or are you using the AST writing to create and edit source code?
Mike
I mean that the project I'm currently working on is so big that I can't edit one by one all error of <
parsing.
I'm using your framework for only parsing.
Ok well you have another option. Apache Flex's Falcon compiler. I am using this compiler in a HUGE project that cross compiles actionscript to javascript.
https://github.com/RandoriAS/randori-compiler
I wrote that whole compiler. My point is, that framework I am using is nearly perfect with parsing the whole as3 language and has AST and Definition resolution.
You caould actually extend my visitor framework that visits all AST nodes in a file to do the processing you are doing.
Mike
I don't know where do I start to look, there is not even a Maven artifact ... Furthermore, the visitor pattern can not solve my problem. I'm looking for a similar API than as3-commons-jasblocks
Ok scratch what i said then since I don't know what you're doing.
Anyway, you are on your own fixing this :)
BTW I plan on porting the AST (edit/create) api eventually using this new parser and compiler.
But that is a ways down the road.
Do you know if Falcon has any doc, please ?
I also find this library http://maven.badgers-in-foil.co.uk/sites/metaas/apidocs/index.html, have you forked this project ?
Hello, I really enjoy your library because it provides a high-level API for reading and editing AS3 code but it fails for some reason to parse a simple statement
while
. I have never learnt how to use Antlr so I hope you will found where the bug is.Here is the stacktrace
And here is the code around the line where the parser fail
I think Antlr fails to parse the
<
operator but I don't know how to fix this error by myself. I know you have not committed for a long time but any help will be accepted :D