From Douglas Crockford's JavaScript: The Good Parts, Chapter 2 Grammar
This chapter introduces the grammar of the good parts of JavaScript, presenting a quick overview of how the language is structured. We will represent the grammar with railroad diagrams.
The rules for interpreting these diagrams are simple:
- You start on the left edge and follow the tracks to the right edge.
- As you go, you will encounter literals in ovals, and rules or descriptions in rectangles.
- Any sequence that can be made by following the tracks is legal.
- Any sequence that cannot be made by following the tracks is not legal.
- Railroad diagrams with one bar at each end allow whitespace to be inserted between any pair of tokens. Railroad diagrams with two bars at each end do not.
The grammar of the good parts presented in this chapter is significantly simpler than the grammar of the whole language.
I have seen this answer on SO which basically reiterates what is presented in the book. So what is meant by token here?