Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[wtp-incubator-dev] XQuery tokenizer question about: endExprSingle()

Hi Lionel,

I looked a little into the jflex grammar. I don't get it why there is
a difference between the if expression and the typeswitch. Why doesn't
typeswitch appear with the endExprSingle() because the "case" clause
also contains an ExprSingle on the last position. According to the
endExprSingle() function description this case falls into: "continue
parsing the same outer expression single. Only the sub-expression type
is popped from the state stack". So I was expecting to see a case like
for the IFTHENEXPR state:

switch (context) {
  ...
  case IFTHENEXPR
...

If your answer is "because the case clause of the typeswitch
expression does not have a state on it's own because:
<TS_ENDTSSEQUENCETYPE> "return" { [pushState(????????);]
yybegin(TS_EXPRSINGLE); return KW_RETURN; }
does not push any"  then my question is "why isn't such a state pushed?"

One line above in the jflex file there is this comment: "// No need to
push continuation state because it's done earlier." Maybe this plays a
role in this?


Thanks a lot! Just trying to understand!

Gabriel


-- 
MSc Gabriel Petrovay
Mobile: +41(0)787978034
www.28msec.com


Back to the top