From 2b722f1ccfecc75ed93651543c9ba22a849396a1 Mon Sep 17 00:00:00 2001 From: Vincent Sanders Date: Wed, 2 Jan 2013 21:47:13 +0000 Subject: extend binding DSL with prologue and epilogue stanzas --- doc/example.bnd | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) (limited to 'doc') diff --git a/doc/example.bnd b/doc/example.bnd index 6bd051c..690eace 100644 --- a/doc/example.bnd +++ b/doc/example.bnd @@ -11,12 +11,6 @@ * http://www.opensource.org/licenses/mit-license */ -/* additional binding fragments may be included - * Note: this is not preprocessed despite the #include name, the - * parser will simply switch input to the included file and carry on - * cosntructing the bindings Abstract Syntax Tree (AST) - */ -#include "dom.bnd" /* directive to read WebIDL file and add its contents to the webidl AST */ webidlfile "html.idl"; @@ -43,6 +37,22 @@ preamble %{ %} +/* code block emitted immediately before the binding function bodies */ +prologue %{ +%} + +/* code block emmitted at the end of the output */ +epilogue %{ +%} + +/* additional binding fragments may be included + * Note: this is not preprocessed despite the #include name, the + * parser will simply switch input to the included file and carry on + * cosntructing the bindings Abstract Syntax Tree (AST) + */ +#include "dom.bnd" + + /* this block describes the binding to be generated * * Depending on the type of binding being generated multiple blocks -- cgit v1.2.3