Jose Falcon, William R. Cook
Department of Computer Science
University of Texas at Austin
Abstract
Both XML and Lisp have demonstrated the utility of generic syntax for expressing tree-structured data. But generic languages do not provide the syntactic richness of custom languages. Generic Extensible Language (Gel) is a rich generic syntax that embodies many of the common syntactic conventions for operators, grouping and lists in widely-used languages. Prefix/infix operators are disambiguated by white-space, so that documents which violate common white-space conventions will not necessarily parse correctly with Gel. With some character replacements and adjusting for mismatch in operator precedence, Gel can extract meaningful structure from typical files in many languages, including Java, CSS, Smalltalk, and ANTLR grammars. This evaluation shows the expressive power of Gel, not that Gel can be used as a parser for existing languages. Gel is intended to serve as a generic language for creating composable domain-specific languages.
Download original paper:
Gel: A Generic Extensible Language
from IFIP Working Conference on Domain Specific Languages (DSL WC)
Getting Started
Running Gel from the command line:
% java -jar gel.jar [-options]
The following options may be used when running Gel from the command line:
| Options | Result |
| -h | This menu. |
| -f <inputfile> | Reads input from given file, STDIN otherwise. |
| -o <outputfile> | Saves ouput into given file, STDOUT otherwise. |
| -p | Ignore parentheses when processing input. |
| -s | Simple printing mode. |
| -l | Print output on a single line. |
| -x | XML printing. |
| -t | Process file in text mode. |
Alternatively, you may play with Gel online!
Examples
The following are example inputs for Gel. Notice that these are nearly identical to programs in their respective languages. Minor changes have been made (as described in the paper (Section 4)) to better fit the syntactic conventions of Gel. Both the input and output files are provided.
- Java: An example of a Java file parsed by Gel. Minor changes were made to denote Java keywords as Gel keywords, along with a few other changes, as explained in the paper.
Input: Example1.java
Output: Example1.output - CSS: An example of a CSS file parsed by Gel. A set of transformations were made to the source as described in the paper.
Input: Example2.css
Output: Example2.output