How is scala.util.parsing.ast.Binders supposed to be used?

I am currently implementing a small compiler in Scala, and while I was running the context analysis component, I found a sign Bindersin the package scala.util.parsing.ast(I use Scala 2.9 RC), which is documented to enable name binding during parsing. It sounds very interesting, and I walked a lot, but I still don't know how to use it. Although I, of course, can let my abstract syntax survive from BindersI don’t see how to proceed from there. Are there any network usage examples?

+5
source share
2 answers

By mistake, I found this page , which seems to be a version of the documentation for developing more detailed information. Unfortunately, I could not find on the Internet (I mean, outside the original repository) a version of these documents.

I am not sure that you will find what you are looking for in this library. Name resolution is a pretty subtle thing, and it smells like a dubious idea to do this during parsing. The documentation for this very library emphasizes that it is only suitable for languages ​​where name resolution is relatively simple and may not scale otherwise. In addition, none of the parsing examples in the Scala repository use this class.

I would carefully avoid this uncharted territory and analyze the binding binding in a separate session after analysis.

+3
+1

All Articles