emacs-devel
[Top][All Lists]
Advanced

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

A question about Wisent-analog to Bison grammar attribute


From: Christian Johansson
Subject: A question about Wisent-analog to Bison grammar attribute
Date: Sat, 4 Apr 2020 08:11:10 +0200
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:68.0) Gecko/20100101 Thunderbird/68.6.0

Hi!

I'm trying to convert the PHP Parser Bison grammar to Wisent and I have stumbled upon a detail that I can't find a solution to.

In https://github.com/php/php-src/blob/master/Zend/zend_language_parser.y#L309
the grammar looks like this:

name:
        namespace_name                                { $$ = $1; $$->attr = ZEND_NAME_NOT_FQ; }     |    T_NAMESPACE T_NS_SEPARATOR namespace_name    { $$ = $3; $$->attr = ZEND_NAME_RELATIVE; }     |    T_NS_SEPARATOR namespace_name                { $$ = $2; $$->attr = ZEND_NAME_FQ; }
;

My interpretation is that the return value of this block is the name excluding the token for the keyword namespace of the separator, but also that the return value has attributes attached to, like whether it's not fully-qualified, fully-qualified or relative. Is it possible to something similar with Wisent grammar?

--

Hälsningar / Best Regards
Christian




reply via email to

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