LangscapeSourcetoolsLangscape is a set of Python tools for processing languages. I also use to call them sourcetools. Among them are: - Tokenizer
- Parser
- Untokenizer
- Unparser
- Parse tree builder
- Parse tree validator
- Grammar based code search
- Grammar based code substitution
- Grammar based expression generation
Once a language has an EBNF encoded grammar as a syntactical description all of those tools are available in Langscape. Extension languagesLangscape is an open source Python framework used to build and extend language components. A language component is called langlet in Langscape. A langlet is syntax definition together with a set of classes that control how source code is parsed, transformed, imported and so on. Both syntax and functionality can be inherited from parent langlets. Classes are extended in ordinary OOP style using subclasses. Syntax is overwritten by redefining and adding grammar rules. Langscape contains some "pythonisms" like providing an interactive console for each langlet. Even though code may not be executable in that style for some languages, console interaction helps in the syntax definition and language transformation phases. Langscape has generally good debugging support. All sorts of objects created during parsing and transformation can be displayed. The display is configured using command line parameters. It doesn't mean that debugging syntax and parsers isn't a total headache anymore but at least one doesn't tap in the dark. AutomataAutomata seem to be merely a fierce implementation detail of Langscape but when you like to think of C as syntactic sugar for "portable assembly" then you may also like the idea of language syntax descriptions being a presentation layer for sets of finite automata. The TriangleThe Langscape triangle is my preferred view on Langscape and it summarizes the different aspects or dimensions briefly described above
More documentation about Langscape can be found at http://www.fiber-space.de/langscape/doc/index.html
|