summaryrefslogtreecommitdiffstats
path: root/test/parser/extract-config.awk
blob: e7a5b33e72bbf4d3b0767cff1a5c782661395233 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
BEGIN {
	config=0
}

/^#if\s*0\s*\/\*\s*PARSER_EMBEDDED_CONFIG/ {
	config=1
	print "#include <stdlib.h>"
	print "const char __embedded_config[] = "
	next
}
!config {
	next
}
/^#endif/ {
	print ";"
	print "const size_t __embedded_config_size = sizeof(__embedded_config);"
	exit
}
{
	print "\t\"" $0 "\\n\""
}
OpenPOWER on IntegriCloud