forked from GitHub/gf-core
Transfer: Changed transfer program file extension from .tr to .tra to avoid collision with Troff file extension.
This commit is contained in:
@@ -7,7 +7,7 @@
|
|||||||
<P ALIGN="center"><CENTER><H1>Transfer tutorial</H1>
|
<P ALIGN="center"><CENTER><H1>Transfer tutorial</H1>
|
||||||
<FONT SIZE="4">
|
<FONT SIZE="4">
|
||||||
<I>Author: Björn Bringert <bringert@cs.chalmers.se></I><BR>
|
<I>Author: Björn Bringert <bringert@cs.chalmers.se></I><BR>
|
||||||
Last update: Tue Dec 6 17:25:21 2005
|
Last update: Tue Dec 6 17:32:55 2005
|
||||||
</FONT></CENTER>
|
</FONT></CENTER>
|
||||||
|
|
||||||
<P></P>
|
<P></P>
|
||||||
@@ -85,7 +85,7 @@ This is done with the <CODE>transfer</CODE> grammar printer:
|
|||||||
<PRE>
|
<PRE>
|
||||||
$ gf
|
$ gf
|
||||||
> i English.gf
|
> i English.gf
|
||||||
> pg -printer=transfer | wf tree.tr
|
> pg -printer=transfer | wf tree.tra
|
||||||
</PRE>
|
</PRE>
|
||||||
<P></P>
|
<P></P>
|
||||||
<P>
|
<P>
|
||||||
@@ -95,13 +95,13 @@ abstract syntax module is not enough. FIXME: why?
|
|||||||
</P>
|
</P>
|
||||||
<P>
|
<P>
|
||||||
The command sequence above writes a Transfer data type definition to the
|
The command sequence above writes a Transfer data type definition to the
|
||||||
file <A HREF="../transfer/examples/aggregation/tree.tr">tree.tr</A>.
|
file <A HREF="../transfer/examples/aggregation/tree.tra">tree.tra</A>.
|
||||||
</P>
|
</P>
|
||||||
<A NAME="toc5"></A>
|
<A NAME="toc5"></A>
|
||||||
<H1>Write transfer code</H1>
|
<H1>Write transfer code</H1>
|
||||||
<P>
|
<P>
|
||||||
We write the Transfer program
|
We write the Transfer program
|
||||||
<A HREF="../transfer/examples/aggregation/aggregate.tr">aggregate.tr</A>.
|
<A HREF="../transfer/examples/aggregation/aggregate.tra">aggregate.tra</A>.
|
||||||
</P>
|
</P>
|
||||||
<P>
|
<P>
|
||||||
FIXME: explain the code
|
FIXME: explain the code
|
||||||
@@ -123,10 +123,10 @@ Here, <CODE><lib></CODE> is the path to search for any modules which you i
|
|||||||
in your Transfer program. You can give several <CODE>-i</CODE> flags.
|
in your Transfer program. You can give several <CODE>-i</CODE> flags.
|
||||||
</P>
|
</P>
|
||||||
<P>
|
<P>
|
||||||
So, to compile <CODE>aggregate.tr</CODE> which we created above, we use:
|
So, to compile <CODE>aggregate.tra</CODE> which we created above, we use:
|
||||||
</P>
|
</P>
|
||||||
<PRE>
|
<PRE>
|
||||||
$ transferc aggregate.tr
|
$ transferc aggregate.tra
|
||||||
</PRE>
|
</PRE>
|
||||||
<P></P>
|
<P></P>
|
||||||
<P>
|
<P>
|
||||||
|
|||||||
@@ -56,7 +56,7 @@ This is done with the ``transfer`` grammar printer:
|
|||||||
```
|
```
|
||||||
$ gf
|
$ gf
|
||||||
> i English.gf
|
> i English.gf
|
||||||
> pg -printer=transfer | wf tree.tr
|
> pg -printer=transfer | wf tree.tra
|
||||||
```
|
```
|
||||||
|
|
||||||
Note that you need to load a concrete syntax which uses the abstract
|
Note that you need to load a concrete syntax which uses the abstract
|
||||||
@@ -64,13 +64,13 @@ syntax that you want to create a Transfer data type for. Loading just the
|
|||||||
abstract syntax module is not enough. FIXME: why?
|
abstract syntax module is not enough. FIXME: why?
|
||||||
|
|
||||||
The command sequence above writes a Transfer data type definition to the
|
The command sequence above writes a Transfer data type definition to the
|
||||||
file [tree.tr ../transfer/examples/aggregation/tree.tr].
|
file [tree.tra ../transfer/examples/aggregation/tree.tra].
|
||||||
|
|
||||||
|
|
||||||
= Write transfer code =
|
= Write transfer code =
|
||||||
|
|
||||||
We write the Transfer program
|
We write the Transfer program
|
||||||
[aggregate.tr ../transfer/examples/aggregation/aggregate.tr].
|
[aggregate.tra ../transfer/examples/aggregation/aggregate.tra].
|
||||||
|
|
||||||
FIXME: explain the code
|
FIXME: explain the code
|
||||||
|
|
||||||
@@ -88,10 +88,10 @@ $ transferc -i<lib> <transfer program>
|
|||||||
Here, ``<lib>`` is the path to search for any modules which you import
|
Here, ``<lib>`` is the path to search for any modules which you import
|
||||||
in your Transfer program. You can give several ``-i`` flags.
|
in your Transfer program. You can give several ``-i`` flags.
|
||||||
|
|
||||||
So, to compile ``aggregate.tr`` which we created above, we use:
|
So, to compile ``aggregate.tra`` which we created above, we use:
|
||||||
|
|
||||||
```
|
```
|
||||||
$ transferc aggregate.tr
|
$ transferc aggregate.tra
|
||||||
```
|
```
|
||||||
|
|
||||||
The creates the Transfer Core file ``aggregate.trc``.
|
The creates the Transfer Core file ``aggregate.trc``.
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ loadModule = loadModule_ []
|
|||||||
Ok m -> return m
|
Ok m -> return m
|
||||||
let load = [ i | Import (Ident i) <- is ] \\ ms
|
let load = [ i | Import (Ident i) <- is ] \\ ms
|
||||||
let path' = directoryOf f : path
|
let path' = directoryOf f : path
|
||||||
files <- mapM (findFile path' . (++".tr")) load
|
files <- mapM (findFile path' . (++".tra")) load
|
||||||
dss <- mapM (loadModule_ (load++ms) path) files
|
dss <- mapM (loadModule_ (load++ms) path) files
|
||||||
return $ concat (dss++[ds])
|
return $ concat (dss++[ds])
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user