help-bison
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: javascript_grammar_ecmascript_transform_unicode_problem


From: Markus W. Weißmann
Subject: Re: javascript_grammar_ecmascript_transform_unicode_problem
Date: Thu, 25 Aug 2011 10:38:51 +0200

Hi Giannis,

On 25 Aug 2011, at 03:13, Giannis St wrote:

> I would like to create a parser for javascript(certainly a subset of 
> it). I tried to transform ecmascriptA3g(for antlr3) in order to use it 
> in bison but i had some issues with some unicode characters. 
> 
> Does Bison support unicode chars? 
> 

It does... if you can say so:
When using bison you split the grammar between a lexer and a parser (bison). 
Only the lexer needs to know about unicode or whatever your input looks like -- 
the lexer needs to provide "tokens" to the parser: how the lexer obtains those 
the parser simply does not care about. Perhaps someone can give a hint on what 
lexer generator can do unicode well?


> Has anyone tried to create a javascript grammar or a subset of it for bison?
> 

I suppose that most browsers use some kind of parser generator for that -- when 
searching for 'javascript lr grammar' some pages of the mozilla project show 
up; I'd expect you to be much better of with an LR grammar -- because thats 
what bison can do. Perhaps you even find a complete parser/lexer in one of the 
many open source JavaScript engines?


Regrads

-Markus

-- 
Markus Weißmann, M.Sc.
Technische Universität München
Institut für Informatik
Boltzmannstr. 3
D-85748 Garching
Germany
Tel. +49 (89) 2 89-1 81 05
Mobil +49 151 58402057 (AUDI)
Fax +49 (89) 2 89-1 81 07
http://wwwknoll.in.tum.de/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]