Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

2
  • 3
    You should use both as and when required. When? I need an example. I mean what you're saying makes sense but I need an explanation as to what exactly you mean. Commented Aug 10, 2012 at 18:02
  • 2
    @Dan, see my answer for a common case. When parsing a CF language often you use a regular expression to split it into tokens, and then handle that stream of tokens using a full parser. For example, you might break "(a + b)*c" into ["(", " ", "a", "+", " ", "b", ")", "*", "c"] and then throw out the spaces and give the result to a parser to handle the parentheses and operator precedence to produce a tree like (Times (Plus (Var "a") (Var "b")) (Var "c")). Commented Aug 10, 2012 at 18:22