Referring to a Data Type script from a script element

0 votes
asked Sep 18, 2016 in Grammars by dmaclach (160 points)
Is there any good way of referring to a data type script from a script element? For example I have a DataType script to parse varInts and I would like to use it as part of parsing a result in a script element.

1 Answer

0 votes
answered Sep 23, 2016 by andreas (1,480 points)
I'd recommend to create a "prototype" of the custom element in some extra structure and get it from there in the script. A simple example how to do this is in the GZIP grammar. The advantage of this approach is that you can configure the custom element including colors and description once and use it multiple times.
...