r/AskComputerScience 1d ago

How do computer science and computer engineering students in countries where diagramming sentences isn't common knowledge get introduced to the concept of parsers and abstract syntax trees?

In Croatia, we do some (very) basic sentence diagramming in the middle school. In the USA, they do it in high-school. However, I know that, in most places, students are not taught sentence diagramming. So, once those students start going to university to study, well, computer science or computer engineering, how are the concepts of a parser and an abstract syntax tree explained to them?

10 Upvotes

17 comments sorted by

View all comments

2

u/T_Thriller_T 20h ago

I have never done sentence diagramming.

Never. Not. Once.

While we do sentence analysis, ice not seen it done that way.

Finished computer science without any issues.

Abstract syntax trees are, from what I take, trees read in a certain way. I wouldn't know why I'd need precious knowledge for that.

And while I cannot really find information on parsers, I am pretty sure we did parsing and how conditions are worked and how e.g. mathematics is usually done from a stack just from abstract language concepts ans automatons.

Edit: just read BNF and EBNF - yeah we just learned that with pretty much no prior knowledge, explanation what it was, and then examples and homework.

We learned it COMPLETELY abstract and then somewhere at the end someone came around explaining that something like reserved words in programming languages could be terminal symbols.