Machine-translated by Google. Questions are authored in English.
Top

Discussion

The expression ab|c denotes

  • A.the language containing the strings a and bc
  • B.the language containing only the single string abc
  • C.the language of all strings made from a, b and c
  • D.the language containing the strings ab and c

Answer: D

Concatenation binds more tightly than alternation, so the expression groups as (ab)|c. Parentheses would be required to obtain a(b|c) instead. Getting this precedence wrong is one of the commonest mistakes in writing token patterns.

No comment is present. Be the first to comment.
Loading…

Post your comment

Please log in or register to post a comment.