Language
Learn the production rules that generate the language.
We'll cover the following
Node
A node can be considered a DOM tree element. Let’s define a production rule that generates simple DOM elements that do not have any attributes. To do so, we need to analyze element tags. A tag is a sequence of a LESS_THAN_SIGN
character followed by a value (any number of characters), followed by SLASH
and GREATER_THAN_SIGN
characters. Additionally , we need to use the separator
rule before and after the value
rule. Below is the implementation of the node()
method.
Note: We can enter any string value as an input at the bottom of the widget to run the code.
Get hands-on with 1400+ tech skills courses.