[antlr-interest] Dead End
mzukowski at yci.com
mzukowski at yci.com
Wed Oct 30 10:09:09 PST 2002
It sounds like you're not synchronized or something. What is the exact
error? Did you study the multiplexer examples?
Monty
> -----Original Message-----
> From: Anakreon Mejdi [mailto:amejdi at ertonline.gr]
> Sent: Wednesday, October 30, 2002 6:30 AM
> To: antlr-interest at yahoogroups.com
> Subject: [antlr-interest] Dead End
>
>
> I am facing a difficulty with a parser I am writing and need
> some help.
> The program should parse ASP which has html tags and code written in
> JavaScript or VBScript.
> I have written an Html Lexer ,an JavaScript Lexer and a Vbs Lexer.
> The three Lexers a multiplexed via a TokenStreamSelector called
> AspStreamSelector.
> The selector will add few Tokens and consume others in order to make
> parsing simpler.
>
> The Dead end is this:
> An asp page I attempt to parse includes an other file which has
> code written in JavaScript.
> The JavaScript Parser fails to parse the file but when the
> same code is
> fed to the Parser when the JavaScript Parser is working
> alone(not with
> the Vb Parser) it parses the code.
>
> I checked if the JavaScript parser receives the same
> tokens when is
> working alone and when is cooperating with the Vb Parser.
> The only difference was that the tokens (when in asp) had a
> line number
> grater by one.
>
> However the type and text of the Tokens are the same and delivered
> to the Parser in the same sequence.
>
> For two days now I couldn't find a solution to this problem
> and can not understand what causes it.
>
> I hope someone can help.
>
> The mail has as attachment the files of the project.
>
> Among the files there is build.xml which will compile the project
> if you have ant.
>
> In the src directory there are Main.java,Main2.java,Main3.java
> Main.java will parse a plain Vb Script
> Example java Main <aVbsFile > out.txt will print in file
> out.txt the AST
> java Main anything<aVbsFile > out.txt will print in file out.tx the
> token stream.
> Main3 works in the same way only that takes as input JavaScript Code.
>
> Main2 parser an ASP page (Vbs,JS,Html mixed)
> java Main2 pathToAnASP directoryWhereTheFileIs > out.txt will
> print the
> AST
> java Main2 pathToAnASP directoryWhereTheFileIs anything> out.txt will
> print the Stream of Token
>
> In the tests directory I have an asp file which can be used
> as an example.
>
>
> Thanks for any help.
> Anakreon
>
>
>
>
>
>
>
> Your use of Yahoo! Groups is subject to
http://docs.yahoo.com/info/terms/
Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
More information about the antlr-interest
mailing list