From 9230e7da5272d54e1f3f86cdecf841638655a555 Mon Sep 17 00:00:00 2001 From: Pierre Gimalac Date: Tue, 21 Sep 2021 22:35:33 +0200 Subject: [PATCH] Update links in docs getting_started.md #421 --- docs/Getting_Started.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/Getting_Started.md b/docs/Getting_Started.md index 51e346be..aa25ba3a 100644 --- a/docs/Getting_Started.md +++ b/docs/Getting_Started.md @@ -15,7 +15,7 @@ Here’s what the parser looks like: } -The package [scala.util.parsing.combinator](http://www.scala-lang.org/files/archive/api/current/scala-parser-combinators/scala/util/parsing/combinator) contains all of the interesting stuff. Our parser extends [RegexParsers](http://www.scala-lang.org/files/archive/api/current/scala-parser-combinators/scala/util/parsing/combinator/RegexParsers.html) because we do some lexical analysis. `"""[a-z]+""".r` is the regular expression. `^^` is [documented](http://www.scala-lang.org/files/archive/api/current/scala-parser-combinators/scala/util/parsing/combinator/Parsers$Parser.html#^^[U](f:T=>U):Parsers.this.Parser[U]) to be "a parser combinator for function application". Basically, if the parsing on the left of the `^^` succeeds, the function on the right is executed. If you've done yacc parsing, the left hand side of the ^^ corresponds to the grammar rule and the right hand side corresponds to the code generated by the rule. Since the method "word" returns a Parser of type String, the function on the right of `^^` needs to return a String. +The package [scala.util.parsing.combinator](https://javadoc.io/static/org.scala-lang.modules/scala-parser-combinators_2.13/2.0.0/scala/util/parsing/combinator/index.html) contains all of the interesting stuff. Our parser extends [RegexParsers](https://javadoc.io/static/org.scala-lang.modules/scala-parser-combinators_2.13/2.0.0/scala/util/parsing/combinator/RegexParsers.html) because we do some lexical analysis. `"""[a-z]+""".r` is the regular expression. `^^` is [documented](https://javadoc.io/static/org.scala-lang.modules/scala-parser-combinators_2.13/2.0.0/scala/util/parsing/combinator/Parsers$Parser.html#^^[U](f:T=>U):Parsers.this.Parser[U]) to be "a parser combinator for function application". Basically, if the parsing on the left of the `^^` succeeds, the function on the right is executed. If you've done yacc parsing, the left hand side of the ^^ corresponds to the grammar rule and the right hand side corresponds to the code generated by the rule. Since the method "word" returns a Parser of type String, the function on the right of `^^` needs to return a String. So how do we use this parser? Well, if we want to extract a word from string, we can call