summaryrefslogtreecommitdiff
path: root/pkgtools
diff options
context:
space:
mode:
authorrillig <rillig@pkgsrc.org>2006-05-23 08:10:37 +0000
committerrillig <rillig@pkgsrc.org>2006-05-23 08:10:37 +0000
commitf8c029f6c9837d37ca1a668546ea5272bc746fbb (patch)
tree78bc11168d1933c830ce631e2a8af41d418e16f8 /pkgtools
parentb80addd602ab41b120d53e2d1aedd7df07d21279 (diff)
downloadpkgsrc-f8c029f6c9837d37ca1a668546ea5272bc746fbb.tar.gz
The "future directions" chapter gives a vision of what pkglint may do if
I find too much time.
Diffstat (limited to 'pkgtools')
-rw-r--r--pkgtools/pkglint/files/doc/Makefile3
-rw-r--r--pkgtools/pkglint/files/doc/chap.future.xml48
-rw-r--r--pkgtools/pkglint/files/doc/pkglint.xml4
3 files changed, 53 insertions, 2 deletions
diff --git a/pkgtools/pkglint/files/doc/Makefile b/pkgtools/pkglint/files/doc/Makefile
index 3c8a67267a7..d36715f890d 100644
--- a/pkgtools/pkglint/files/doc/Makefile
+++ b/pkgtools/pkglint/files/doc/Makefile
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.2 2006/02/27 02:01:04 rillig Exp $
+# $NetBSD: Makefile,v 1.3 2006/05/23 08:10:37 rillig Exp $
#
XMLDOCS+= pkglint.xml
@@ -7,6 +7,7 @@ XMLDOCS+= chap.defs.xml
XMLDOCS+= chap.types.xml
XMLDOCS+= chap.code.xml
XMLDOCS+= chap.statemachines.xml
+XMLDOCS+= chap.future.xml
IMAGES+= statemachine.patch.png
IMAGES+= statemachine.shellcmd.png
diff --git a/pkgtools/pkglint/files/doc/chap.future.xml b/pkgtools/pkglint/files/doc/chap.future.xml
new file mode 100644
index 00000000000..8700a4395da
--- /dev/null
+++ b/pkgtools/pkglint/files/doc/chap.future.xml
@@ -0,0 +1,48 @@
+<!-- $NetBSD: chap.future.xml,v 1.1 2006/05/23 08:10:37 rillig Exp $ -->
+
+<chapter id="future">
+<title>Future directions</title>
+
+<sect1 id="future.tokenize">
+<title>Tokenizing the input</title>
+
+ <para>For providing more exact diagnostics, it would be nice if
+ &pkglint; could point the user to the exact character position
+ of the smallest problematic text in a file. To do this, the
+ file's contents has to be splitted into tokens.</para>
+
+ <para>Doing this is nontrivial, since the tokenizing scheme
+ depends on the context in which the tokens are used. For
+ example, the <varname>COMMENT</varname> variable may contain
+ arbitrary characters (including <literal>'</literal> and
+ <literal>"</literal>), whereas in many other contexts these are
+ parts of quoted shell words.</para>
+
+</sect1>
+<sect1 id="future.ast">
+<title>Working on abstract syntax trees (AST)</title>
+
+ <para>When the tokenizing above is done, the tokens could be
+ parsed by a grammar to form abstract syntax trees. These would
+ consist mainly of function application so that pkglint can infer
+ types and valid values over these trees. The following functions
+ are likely to appear.</para>
+
+ <table id="future.ast.func">
+ <title>Functions in the abstract syntax trees</title>
+ <tgroup cols="2">
+ <thead><row><entry>Function</entry><entry>Purpose</entry></row></thead>
+ <tbody>
+ <row><entry><function>quote</function>(Val)</entry><entry>The <literal>:Q</literal> modifier</entry></row>
+ <row><entry><function>append</function>(Val, Val)</entry><entry>The <literal>+=</literal> operator</entry></row>
+ <row><entry><function>concat</function>(Val, Val)</entry><entry>The direct concatenation of two values</entry></row>
+ <row><entry><function>subst</function>(Val, Subst)</entry><entry>The <literal>:S</literal> and <literal>:C</literal> modifiers</entry></row>
+ <row><entry><function>shell</function>(Val)</entry><entry>The <literal>!=</literal> operator and the <literal>:sh</literal> modifier</entry></row>
+ <row><entry><function>literal</function>(Val)</entry><entry>Introduces literal values</entry></row>
+ </tbody>
+ </tgroup>
+ </table>
+
+</sect1>
+
+</chapter>
diff --git a/pkgtools/pkglint/files/doc/pkglint.xml b/pkgtools/pkglint/files/doc/pkglint.xml
index f036b5d3503..f0a1a512668 100644
--- a/pkgtools/pkglint/files/doc/pkglint.xml
+++ b/pkgtools/pkglint/files/doc/pkglint.xml
@@ -11,9 +11,10 @@
<!ENTITY chap.types SYSTEM "chap.types.xml">
<!ENTITY chap.code SYSTEM "chap.code.xml">
<!ENTITY chap.statemachines SYSTEM "chap.statemachines.xml">
+ <!ENTITY chap.future SYSTEM "chap.future.xml">
]>
-<!-- $NetBSD: pkglint.xml,v 1.2 2006/02/28 11:40:15 rillig Exp $ -->
+<!-- $NetBSD: pkglint.xml,v 1.3 2006/05/23 08:10:37 rillig Exp $ -->
<book>
<title>Design and implementation of &pkglint;</title>
@@ -32,5 +33,6 @@
&chap.types;
&chap.code;
&chap.statemachines;
+&chap.future;
</book>