Added a bit to README.
The directory 'latexdoc' contains a work-in-progress
of DWARF5 in latex source. See latexdoc/README
-and latexdoc/Makefile for more information.
+and tools/README and latexdoc/Makefile for more information.
diff test1.in test1.in.out
python refclassfixup.py test2.in
diff test2.in.out test2.base
- python refclassfixup.py test2.in.out
# checking for idempotence
+ python refclassfixup.py test2.in.out
diff test2.in.out test2.in.out.out
+ python taglink.py test1.in
+ diff test1.in.out taglink.base
+ # checking for idempotence
+ python taglink.py test1.in.out
+ diff test1.in.out.out taglink.base
+ python printstandard.py printstandard.in >printstandard.out
+ diff printstandard.out printstandard.base
+
source of a DWARF document to get its references
complete and correct.
+CAUTION:
+The tools don't really do parsing and
+the lexical processing is barely adequate for the task.
+
+They don't understand the % means 'comment', so avoid
+comments containing latex code or anything like latex.
+
+The tools are not necessarily equivalent in what
+details of input they accept. For example,
+Some will handle \livelink{chap:DWTAGfoo}{ DW\_TAG\_foo }
+(notice the spaces around the DW\_TAG\_foo) and some won't.
+So use \livelink{chap:DWTAGfoo}{DW\_TAG\_foo} instead with
+no pointless spaces (or newlines). Then you won't be disappointed.
+
+The tools assume you use \livelink and other local commands.
+If you use the native latex equivalent the tools won't understand.
+
+
+The requirement of the \ before _ in latex is annoying.
+You can avoid work typing that cruft by just typeing
+DW_TAG_foo and running tohyphen.py on the text, which will
+turn it into DW\-\_TAG\-\_foo which is what you want.
+The hyphens result in nicely formatted lines with line breaks.
+Without the \- there are lots of ugly super-long lines.
+
+Various character (% - and more) have special meaning to latex.
+So just typing them and expecting them to appear in the generated
+document is going to result in disappointment. See the use
+of \dash in the document.
+
+
Our fundamental approach is to tokenize the input line-by-line
and then use trivial pattern matching to determine what
tokens need updating on what lines. Always trying to ensure
other languages) we adopt an inefficient but
simple scanning and lexing approach.
+BORING DETAILS (you can ignore what follows):
Every latex source file is read completely into an dwfile object
which contains a
List of lines
--- /dev/null
+DW_TAG_foo
+DW_AT_foo
+DW_END_line
+DW_ATE_x
+DW_OP_foo
+DW_TAG
+DW_TAG_
+DW_LANG
+DW_LNE
+DW_CC
+DW_CFA
+DW_TAG_access_declaration
+DW_TAG_no_backslash
+DW_TAG_access_declaration
+printstandard.in.out
--- /dev/null
+
+appropriate prefix (DW\_TAG\_foo, DW\_AT\_foo,
+DW\_END_line, DW\_ATE_x, DW\_OP_foo,
+DW\_TAG
+DW\_TAG_
+DW\_LANG, DW\_LNE, DW\_CC or DW\_CFA respectively) followed by
+\_lo\_user or \_hi\_user.
+
+\endlastfoot
+\livelink{chap:DWTAGaccessdeclaration}{ DW\-\_TAG\-\_access\-\_declaration}
+& DECL \\
+
+ DW_TAG_no_backslash
+
+information entry with the tag
+\livetarg{chap:DWTAGaccessdeclaration}{DW\_TAG\_access\_declaration}.
+Each
+such entry is a child of the class or structure type entry.
+
--- /dev/null
+# Copyright 2012 DWARF Debugging Information Format Committee
+#
+# Print the DW_* entries (and only them) one per line,
+# with no \_ or \-.
+# Try
+# python printstandard.py *.tex |sort|uniq
+
+import sys
+import fileio
+
+def transfunc(linetoks):
+ if len(linetoks) < 1:
+ return linetoks
+ tnumin = 0
+ changes = 0
+ lasttoknum = len(linetoks) -1
+ outtoks = []
+ for t in linetoks:
+ stdname= ''.join(t._std)
+ if stdname.startswith("DW_") != 0:
+ print stdname
+ # End of for loop.
+ return outtoks
+
+def read_args():
+ cur = 1
+ filelist = []
+ while len(sys.argv) > cur:
+ v = sys.argv[cur]
+ filelist += [v]
+ cur = int(cur) + 1
+
+ dwf = fileio.readFilelist(filelist)
+ dwf.dwtransformline(transfunc)
+ dwf.dwwrite()
+
+if __name__ == '__main__':
+ read_args()
+
+
+
--- /dev/null
+
+appropriate prefix (\livelink{chap:DWTAGfoo}{DW\_TAG\_foo}, DW\_AT\_foo,
+DW\_END_line, DW\_ATE_x, DW\_OP_foo,
+DW\_TAG
+DW\_TAG_
+DW\_LANG, DW\_LNE, DW\_CC or DW\_CFA respectively) followed by
+\_lo\_user or \_hi\_user.
+
+\endlastfoot
+\livelink{chap:DWTAGaccessdeclaration}{ DW\-\_TAG\-\_access\-\_declaration}
+& DECL \\
+
+
+information entry with the tag
+\livetarg{chap:DWTAGaccessdeclaration}{DW\_TAG\_access\_declaration}.
+Each
+such entry is a child of the class or structure type entry.
+