1# peg_export_container.tcl -- 2# 3# The PEG to CONTAINER export plugin. Generation of Tcl code, a 4# snit::type. 5# 6# Copyright (c) 2009 Andreas Kupries <andreas_kupries@sourceforge.net> 7# 8# See the file "license.terms" for information on usage and redistribution 9# of this file, and for a DISCLAIMER OF ALL WARRANTIES. 10# 11# RCS: @(#) $Id: pt_peg_export_container.tcl,v 1.1 2010/03/26 05:07:24 andreas_kupries Exp $ 12 13# This package is a plugin for the pt::peg export manager. It 14# takes the canonical serialization of a parsing expression grammar 15# and produces text in CONTAINER format. 16 17# ### ### ### ######### ######### ######### 18## Requisites 19 20# @mdgen NODEP: pt::peg::export::plugin 21 22package require Tcl 8.5 23package require pt::peg::export::plugin ; # The presence of this 24 # pseudo package 25 # indicates execution 26 # inside of a properly 27 # initialized plugin 28 # interpreter. 29package require pt::peg::to::container 30 31# ### ### ### ######### ######### ######### 32## API. 33 34proc export {serial configuration} { 35 36 pt::peg::to::container reset 37 foreach {option value} $configuration { 38 pt::peg::to::container configure $option $value 39 } 40 41 set text [pt::peg::to::container convert $serial] 42 43 pt::peg::to::container reset 44 return $text 45} 46 47# ### ### ### ######### ######### ######### 48## Ready 49 50package provide pt::peg::export::container 1 51return 52