1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<!-- This document was generated using DocBuilder 3.3.3 -->
<HTML>
<HEAD>
<TITLE>epp</TITLE>
<SCRIPT type="text/javascript" src="../../../../doc/erlresolvelinks.js">
</SCRIPT>
<STYLE TYPE="text/css">
<!--
.REFBODY { margin-left: 13mm }
.REFTYPES { margin-left: 8mm }
-->
</STYLE>
</HEAD>
<BODY BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#0000FF" VLINK="#FF00FF"
ALINK="#FF0000">
<!-- refpage -->
<CENTER>
<A HREF="http://www.erlang.se">
<IMG BORDER=0 ALT="[Ericsson AB]" SRC="min_head.gif">
</A>
<H1>epp</H1>
</CENTER>
<H3>MODULE</H3>
<DIV CLASS=REFBODY>
epp
</DIV>
<H3>MODULE SUMMARY</H3>
<DIV CLASS=REFBODY>
An Erlang Code Preprocessor
</DIV>
<H3>DESCRIPTION</H3>
<DIV CLASS=REFBODY>
<P>The Erlang code preprocessor includes functions which are used
by <CODE>compile</CODE> to preprocess macros and include files before
the actual parsing takes place.
</DIV>
<H3>EXPORTS</H3>
<P><A NAME="open/2"><STRONG><CODE>open(FileName, IncludePath) -> {ok,Epp} | {error, ErrorDescriptor}</CODE></STRONG></A><BR>
<A NAME="open/3"><STRONG><CODE>open(FileName, IncludePath, PredefMacros) -> {ok,Epp} | {error, ErrorDescriptor}</CODE></STRONG></A><BR>
<DIV CLASS=REFBODY><P>Types:
<DIV CLASS=REFTYPES>
<P>
<STRONG><CODE>FileName = atom() | string()</CODE></STRONG><BR>
<STRONG><CODE>IncludePath = [DirectoryName]</CODE></STRONG><BR>
<STRONG><CODE>DirectoryName = atom() | string()</CODE></STRONG><BR>
<STRONG><CODE>PredefMacros = [{atom(),term()}]</CODE></STRONG><BR>
<STRONG><CODE>Epp = pid() -- handle to the epp server</CODE></STRONG><BR>
<STRONG><CODE>ErrorDescriptor = term()</CODE></STRONG><BR>
</DIV>
</DIV>
<DIV CLASS=REFBODY>
<P>Opens a file for preprocessing.
</DIV>
<P><A NAME="close/1"><STRONG><CODE>close(Epp) -> ok</CODE></STRONG></A><BR>
<DIV CLASS=REFBODY><P>Types:
<DIV CLASS=REFTYPES>
<P>
<STRONG><CODE>Epp = pid() -- handle to the epp server</CODE></STRONG><BR>
</DIV>
</DIV>
<DIV CLASS=REFBODY>
<P>Closes the preprocessing of a file.
</DIV>
<P><A NAME="parse_erl_form/1"><STRONG><CODE>parse_erl_form(Epp) -> {ok, AbsForm} | {eof, Line} | {error, ErrorInfo}</CODE></STRONG></A><BR>
<DIV CLASS=REFBODY><P>Types:
<DIV CLASS=REFTYPES>
<P>
<STRONG><CODE>Epp = pid()</CODE></STRONG><BR>
<STRONG><CODE>AbsForm = term()</CODE></STRONG><BR>
<STRONG><CODE>Line = integer()</CODE></STRONG><BR>
<STRONG><CODE>ErrorInfo = see separate description below.</CODE></STRONG><BR>
</DIV>
</DIV>
<DIV CLASS=REFBODY>
<P>Returns the next Erlang form from the opened Erlang source file.
The tuple <CODE>{eof, Line}</CODE> is returned at end-of-file. The first
form corresponds to an implicit attribute <CODE>-file(File,1).</CODE>, where
<CODE>File</CODE> is the name of the file.
</DIV>
<P><A NAME="parse_file/3"><STRONG><CODE>parse_file(FileName,IncludePath,PredefMacro) -> {ok,[Form]} | {error,OpenError}</CODE></STRONG></A><BR>
<DIV CLASS=REFBODY><P>Types:
<DIV CLASS=REFTYPES>
<P>
<STRONG><CODE>FileName = atom() | string()</CODE></STRONG><BR>
<STRONG><CODE>IncludePath = [DirectoryName]</CODE></STRONG><BR>
<STRONG><CODE>DirectoryName = atom() | string()</CODE></STRONG><BR>
<STRONG><CODE>PredefMacros = [{atom(),term()}]</CODE></STRONG><BR>
<STRONG><CODE>Form = term() -- same as returned by erl_parse:parse_form</CODE></STRONG><BR>
</DIV>
</DIV>
<DIV CLASS=REFBODY>
<P>Preprocesses and parses an Erlang source file.
Note that the tuple <CODE>{eof, Line}</CODE> returned at end-of-file is
included as a "form".
</DIV>
<H3>Error Information</H3>
<DIV CLASS=REFBODY>
<P>The <CODE>ErrorInfo</CODE> mentioned above is the standard
<CODE>ErrorInfo</CODE> structure which is returned from all IO
modules. It has the following format:
<PRE>
{ErrorLine, Module, ErrorDescriptor}
</PRE>
<P>A string which describes the error is obtained with the following call:
<PRE>
apply(Module, format_error, ErrorDescriptor)
</PRE>
</DIV>
<H3>See Also</H3>
<DIV CLASS=REFBODY>
<P><A HREF="erl_parse.html">erl_parse(3)</A>
</DIV>
<H3>AUTHORS</H3>
<DIV CLASS=REFBODY>
Robert Virding - support@erlang.ericsson.se<BR>
</DIV>
<CENTER>
<HR>
<SMALL>stdlib 1.14.2<BR>
Copyright © 1991-2006
<A HREF="http://www.erlang.se">Ericsson AB</A><BR>
</SMALL>
</CENTER>
</BODY>
</HTML>
|