X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=util%2Fyaz-comp;h=31e741b6dba3ed11dcb2093564a87f3e1bf16f5e;hb=006c3df264a95c03bfc557b2004595fc6cc3ee14;hp=5e1199f908b0a61ba5ad23b5e8173e0a8a3f6d69;hpb=d90d31f39aba4c7256d5b83eaf4192630b18ae02;p=yaz-moved-to-github.git diff --git a/util/yaz-comp b/util/yaz-comp index 5e1199f..31e741b 100755 --- a/util/yaz-comp +++ b/util/yaz-comp @@ -3,56 +3,10 @@ exec tclsh "$0" "$@" # # yaz-comp: ASN.1 Compiler for YAZ -# (c) Index Data 1996-2000 +# (c) Index Data 1996-2003 # See the file LICENSE for details. # -# $Log: yaz-comp,v $ -# Revision 1.1 2000-03-02 08:48:20 adam -# Renamed ASN.1 compiler to yaz-comp (used to be yc.tcl). -# -# Revision 1.6 2000/02/10 13:44:02 adam -# Tcl command clock not used if unavailable (Tcl7.4 and earlier). -# -# Revision 1.5 2000/01/15 09:18:42 adam -# Bug fix: some elements where treated as OPTIONAL when they shouldn't. -# -# Revision 1.4 1999/12/16 23:36:19 adam -# Implemented ILL protocol. Minor updates ASN.1 compiler. -# -# Revision 1.3 1999/11/30 13:47:12 adam -# Improved installation. Moved header files to include/yaz. -# -# Revision 1.2 1999/06/09 09:43:11 adam -# Added option -I and variable h-path to specify path for header files. -# -# Revision 1.1 1999/06/08 10:10:16 adam -# New sub directory zutil. Moved YAZ Compiler to be part of YAZ tree. -# -# Revision 1.8 1999/04/20 10:37:04 adam -# Updated for ODR - added name parameter. -# -# Revision 1.7 1998/04/03 14:44:20 adam -# Small fix. -# -# Revision 1.6 1998/04/03 13:21:17 adam -# Yet another fix. -# -# Revision 1.5 1998/04/03 12:48:17 adam -# Fixed bug: missed handling of constructed tags for CHOICE. -# -# Revision 1.4 1998/03/31 15:47:45 adam -# First compiled ASN.1 code for YAZ. -# -# Revision 1.3 1998/03/23 17:13:20 adam -# Implemented SET OF and ENUM. The Compiler now eats ILL (ISO10161) and -# LDAP (RFC1777). -# -# Revision 1.2 1997/10/07 10:31:01 adam -# Added facility to specify tag type (CONTEXT, APPLICATION, ...). -# -# Revision 1.1.1.1 1996/10/31 14:04:40 adam -# First version of the compiler for YAZ. -# +# $Id: yaz-comp,v 1.4 2003-04-14 17:02:12 adam Exp $ # set yc_version 0.3 @@ -256,7 +210,9 @@ proc asnName {name} { if {$inf(verbose)} { puts " mapping member $name,$val to $nval" } - lex + if {![string match {[A-Z]*} $val]} { + lex + } } else { set nval $val if {![string match {[A-Z]*} $val]} { @@ -563,7 +519,7 @@ proc asnSequence {name tag implicit tagtype} { lappend l "\tif (!odr_constructed_begin (o, p, $tagtype, $tag, name))" lappend l "\t\treturn opt && odr_ok(o);" lappend l "\tif (o->direction == ODR_DECODE)" - lappend l "\t\t*p = odr_malloc (o, sizeof(**p));" + lappend l "\t\t*p = ($inf(vprefix)$name *) odr_malloc (o, sizeof(**p));" lappend l "\tif (!odr_sequence_begin (o, p, sizeof(**p), 0))" lappend l "\t\{"