Source

LIME / lib / gcomp.awk

Full commit
#!/usr/bin/awk -f
##################################################################
# This AWK script extracts top-level nodes implemented in .gxf
# This is needed because top-level nodes require a shell, and
# that is handled in Makefiles around LIME in the BE...
#
#Copyright (C) 2008 NXP Semiconductors B.V.
#
#This file is part of LIME.
#
#LIME is free software: you can redistribute it and/or modify
#it under the terms of the GNU General Public License version 2
#as published by the Free Software Foundation; either version 2
#of the License, or (at your option) any later version.
#
#LIME is distributed in the hope that it will be useful,
#but WITHOUT ANY WARRANTY; without even the implied warranty of
#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#GNU General Public License for more details.
#
#You should have received a copy of the GNU General Public License
#along with LIME.  If not, see <http://www.gnu.org/licenses/>.
##################################################################
BEGIN { relax=1 }

func handle(tag,body) { return handle_gxf(tag,body) }

END { for (f in files) for (i=1; i<=nnodes[f]; i++)
      {
	    n=nodes[f,i]

	    if (node_stereotype[f,n])
	    	continue

	    for (j=1; j<=nnodes[n]; j++) {
	        sn=nodes[n,j]
		if (has_code(n,sn)) 
			break 
		j=nnodes[n]+1
	    }
	    if (nnodes[n] && j>nnodes[n]) continue
	    if (nnodes[n] && j==nnodes[n]+1) continue

	    if (is_node_type(f,n,"extern"))
	        continue

	    print n
     }
}

@include gxf-parser.awk
@include pragmas.awk