Hi, I have the problem that the value of a token appears to be more than what the regexp matches. Here's my (snipped) flex file:
%} %option 8bit %option noyywrap %option nounput QName [a-zA-Z-]+:[a-zA-Z-]+ NCName [a-zA-Z-]+ Digit [0-9] %% {NCName} { XPathlval.sval = XPathtext; return NCNAME; } {QName} { XPathlval.sval = XPathtext; return QNAME; } The relevant parts in my Bison is: %union { int ival; char *sval; KDOM::XPath::ExpressionImpl *expr; KDOM::XPath::ExpressionImpl::List *expressionList; QPSingleType *singleType; KDOM::XPath::SharedQName *qName; bool emptyAllowed; } %token <sval> QNAME %token <sval> NCNAME When parsing the expression "fn:false()", I get a QNAME token with the value "fn:false" -- what I expect & want. However, when parsing the expression "false()", I get the token NCNAME with the value "false(". The token is right, but I don't want the parantese to be included. Why is the parantese included in the value, and how do I fix it? The regexp "[a-zA-Z-]+" really shouldn't match it, right? Cheers, Frans _______________________________________________ Help-bison@gnu.org http://lists.gnu.org/mailman/listinfo/help-bison