#!/bin/sh # tag file generation for dj file args= argoutput= while : ; do case "$1" in "") break;; -h|--help) echo "jtags f1 f2 f3 ... [(-o|--ouput) tagfile] fi fj ..." echo echo " Builds tag file for .dj (jakarta) files f1 f2 ... fi fj ..." echo " -o option is not necessary at the end" echo " Default tagfile is default tagfile of etags (should be TAGS)" echo " If several -o options, the last one is taken" echo " -h|--help displays this help" echo " ex: jtags jcvm*.dj extract.dj type_abstraction.dj -o TAGS" echo exit 0;; -o|--output-file) argoutput="-o $2"; shift;; *) args="$args $1";; esac shift done # Francis Montagnac says: # nl seul dans IFS pour tolerer des fichier contenant des blancs. IFS=' ' echo building tags for echo $args exec etags $argoutput --lang=none \ --regex='/^[ \t]*function[ \t]*\([^ \t:]*\)/\1/' \ --regex='/^[ \t]*and[ \t]*function[ \t]*\([^ \t:]*\)/\1/' \ --regex='/^[ \t]*definition[ \t]*\([^ \t:]*\)/\1/' \ --regex='/^[ \t]*and[ \t]*definition[ \t]*\([^ \t:]*\)/\1/' \ --regex='/^[ \t]*data[ \t]*\([^ \t=]*\)/\1/' \ --regex='/^[ \t]*and[ \t]*data[ \t]*\([^ \t=]*\)/\1/' \ --regex='/^[ \t]*record[ \t]*\([^ \t=]*\)/\1/' \ --regex='/^[ \t]*and[ \t]*record[ \t]*\([^ \t=]*\)/\1/' \ --regex='/^[ \t]*type[ \t]*\([^ \t=.]*\)/\1/' \ --regex='/^[ \t]*and[ \t]*type[ \t]*\([^ \t=.]*\)/\1/' \ --regex='/^[ \t]*variable[ \t]*\([^ \t:]*\)/\1/' \ --regex='/^[ \t]*parameter[ \t]*\([^ \t:]*\)/\1/' \ $args #--regex='/^[ \t]*function[ \t]*\([^ \t:]*\)/\1/' \ #--regex='/^[ \t]*definition[ \t]*\([^ \t:]*\)/\1/' \ #--regex='/^[ \t]*data[ \t]*\([^ \t=]*\)/\1/' \ #--regex='/^[ \t]*type[ \t]*\([^ \t=.]*\)/\1/' \ #--regex='/^[ \t]*variable[ \t]*\([^ \t:]*\)/\1/' \ #--regex='/^[ \t]*parameter[ \t]*\([^ \t:]*\)/\1/' \ #$args