[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[8366] parsetexi command_data.awk
From: |
gavinsmith0123 |
Subject: |
[8366] parsetexi command_data.awk |
Date: |
Sun, 21 Oct 2018 12:41:09 -0400 (EDT) |
Revision: 8366
http://svn.sv.gnu.org/viewvc/?view=rev&root=texinfo&revision=8366
Author: gavin
Date: 2018-10-21 12:41:09 -0400 (Sun, 21 Oct 2018)
Log Message:
-----------
parsetexi command_data.awk
Modified Paths:
--------------
trunk/tp/Texinfo/XS/parsetexi/Makefile.am
trunk/tp/Texinfo/XS/parsetexi/command_data.awk
Modified: trunk/tp/Texinfo/XS/parsetexi/Makefile.am
===================================================================
--- trunk/tp/Texinfo/XS/parsetexi/Makefile.am 2018-10-21 16:16:21 UTC (rev
8365)
+++ trunk/tp/Texinfo/XS/parsetexi/Makefile.am 2018-10-21 16:41:09 UTC (rev
8366)
@@ -105,7 +105,6 @@
awk -f element_types.awk element_types.txt >element_types.h
$(srcdir)/command_data.c $(srcdir)/command_ids.h: command_data.txt
command_data.awk
- awk -f $(srcdir)/command_data.awk $(srcdir)/command_data.txt \
- >$(srcdir)/command_ids.h ; \
- cp command_data.c $(srcdir)/command_data.c
+ awk -v srcdir=$(srcdir) -f $(srcdir)/command_data.awk \
+ $(srcdir)/command_data.txt
Modified: trunk/tp/Texinfo/XS/parsetexi/command_data.awk
===================================================================
--- trunk/tp/Texinfo/XS/parsetexi/command_data.awk 2018-10-21 16:16:21 UTC
(rev 8365)
+++ trunk/tp/Texinfo/XS/parsetexi/command_data.awk 2018-10-21 16:41:09 UTC
(rev 8366)
@@ -1,5 +1,4 @@
-# Copyright 2010, 2011, 2012, 2013, 2014, 2015
-# Free Software Foundation, Inc.
+# Copyright 2010-2018 Free Software Foundation, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -68,35 +67,42 @@
inv_bs_escapes[bs_escapes[v]] = v
}
- print "/* This file automatically generated by command_data.awk */"
- print
- print "/* Useful aliases */"
- print "#define CM_hex_09 CM_TAB"
- print "#define CM_hex_0a CM_NEWLINE"
- print "#define CM_hex_20 CM_SPACE"
- print "#define CM_hex_21 CM_EXCLAMATION_MARK"
- print "#define CM_hex_22 CM_POUND_SIGN"
- print "#define CM_hex_27 CM_APOSTROPHE"
- print "#define CM_hex_2a CM_ASTERISK"
- print "#define CM_hex_2c CM_COMMA"
- print "#define CM_hex_2d CM_HYPHEN"
- print "#define CM_hex_2e CM_FULL_STOP"
- print "#define CM_hex_2f CM_SLASH"
- print "#define CM_hex_3a CM_COLON"
- print "#define CM_hex_3d CM_EQUALS"
- print "#define CM_hex_3f CM_QUESTION_MARK"
- print "#define CM_hex_40 CM_AT_SIGN"
- print "#define CM_hex_5c CM_BACKSLASH"
- print "#define CM_hex_5e CM_CIRCUMFLEX"
- print "#define CM_hex_60 CM_BACKQUOTE"
- print "#define CM_hex_7b CM_OPEN_BRACE"
- print "#define CM_hex_7c CM_VERTICAL_BAR"
- print "#define CM_hex_7d CM_CLOSE_BRACE"
- print "#define CM_hex_7e CM_TILDE"
- print
- print "enum command_id {"
- print "CM_NONE,"
- print
+ if (srcdir == "") {
+ srcdir = "."
+ }
+ CD = srcdir "/command_data.c"
+ CI = srcdir "/command_ids.h"
+
+ print "/* This file automatically generated by command_data.awk */" > CI
+ print > CI
+ print "/* Useful aliases */" > CI
+ print "#define CM_hex_09 CM_TAB" > CI
+ print "#define CM_hex_0a CM_NEWLINE" > CI
+ print "#define CM_hex_20 CM_SPACE" > CI
+ print "#define CM_hex_21 CM_EXCLAMATION_MARK" > CI
+ print "#define CM_hex_22 CM_POUND_SIGN" > CI
+ print "#define CM_hex_27 CM_APOSTROPHE" > CI
+ print "#define CM_hex_2a CM_ASTERISK" > CI
+ print "#define CM_hex_2c CM_COMMA" > CI
+ print "#define CM_hex_2d CM_HYPHEN" > CI
+ print "#define CM_hex_2e CM_FULL_STOP" > CI
+ print "#define CM_hex_2f CM_SLASH" > CI
+ print "#define CM_hex_3a CM_COLON" > CI
+ print "#define CM_hex_3d CM_EQUALS" > CI
+ print "#define CM_hex_3f CM_QUESTION_MARK" > CI
+ print "#define CM_hex_40 CM_AT_SIGN" > CI
+ print "#define CM_hex_5c CM_BACKSLASH" > CI
+ print "#define CM_hex_5e CM_CIRCUMFLEX" > CI
+ print "#define CM_hex_60 CM_BACKQUOTE" > CI
+ print "#define CM_hex_7b CM_OPEN_BRACE" > CI
+ print "#define CM_hex_7c CM_VERTICAL_BAR" > CI
+ print "#define CM_hex_7d CM_CLOSE_BRACE" > CI
+ print "#define CM_hex_7e CM_TILDE" > CI
+ print > CI
+ print "enum command_id {" > CI
+ print "CM_NONE," > CI
+ print > CI
+
}
!/^$/ && !/^#/ {
@@ -110,9 +116,9 @@
}
END {
- print "COMMAND builtin_command_data[] = {" >"command_data.c"
+ print "COMMAND builtin_command_data[] = {" > CD
- print "0, 0, 0," >"command_data.c"
+ print "0, 0, 0," > CD
# We want the output sorted so we can use bsearch
PROCINFO["sorted_in"]="@ind_str_asc"
@@ -123,10 +129,10 @@
c2 = inv_bs_escapes[c]
} else
c2 = c
- printf "CM_hex_%02x,\n", ord(c)
+ printf "CM_hex_%02x,\n", ord(c) > CI
} else {
c2 = c
- print "CM_" c ","
+ print "CM_" c "," > CI
}
if (commands[c] != "") {
@@ -141,10 +147,10 @@
} else {
command_data = "0"
}
- print "\"" c2 "\", " flags ", " command_data "," > "command_data.c"
+ print "\"" c2 "\", " flags ", " command_data "," > CD
}
- print "};" >"command_data.c"
- print "};"
+ print "};" > CD
+ print "};" > CI
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [8366] parsetexi command_data.awk,
gavinsmith0123 <=