Consider this simple grammar:
S -> a | b
The set of strings that may be generated by the grammar is:
{a, b}
Thus, a grammar generates a set of strings.
A parser for a grammar takes an input string and determines if the string could be generated by the grammar.
Thus, a parser is a recognizer for a grammar.
At least, that is one use of a parser.
But oftentimes a parser is used for other things. For example, a parser for a grammar may take an input string and create a tree structure which contains the input data and conforms to the grammar.
In that case the parser is not a recognizer, it is a data structure builder.
I conclude that there are different types of parsers.
Am I thinking logically? Are there indeed different types of parsers?
Has someone created a list of the different types of things that parsers have been created for?
Please let me know of any looseness or ambiguity in the above statements. I am trying to learn to be precise in statements about these concepts. For example, do you agree that "a grammar generates a set of strings"? Is that precise? correct?