[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Semantic Predicates (Bison)
From: |
Cleverson Ledur |
Subject: |
Semantic Predicates (Bison) |
Date: |
Mon, 2 May 2016 14:13:14 -0300 |
Hello,
I am using arbitrary predicates to verify semantically the previous
declarations and decide which rule use in Bison (GLR parser).
My question is: Is it possible to access a value ($1,$2...) inside the
arbitrary predicate? Or, is it possible to access the stack to perform
semantic analysis?
For example, I have the following rule:
type_name:
class_name %? { HERE I WANT TO ACCESS $1 } { my action... }
| enum_name { HERE I WANT TO ACCESS $1 } { my action... } ;
In order to perform semantic analysis, I need to access the value received
in $1 (class_name/enum_name) and return true/false to enable or not that
grammar rule.
Thank you.
Cleverson Ledur
"
- Semantic Predicates (Bison),
Cleverson Ledur <=