Files
gf-core/lib/resource/doc/gfdoc/Predef.html
2007-12-12 20:30:11 +00:00

68 lines
2.9 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<META NAME="generator" CONTENT="http://txt2tags.sf.net">
<TITLE> Predefined functions for concrete syntax</TITLE>
</HEAD><BODY BGCOLOR="white" TEXT="black">
<P ALIGN="center"><CENTER><H1> Predefined functions for concrete syntax</H1>
<FONT SIZE="4">
<I>Last update: 2006-09-01 16:37:08 CEST</I><BR>
</FONT></CENTER>
<P></P>
<HR NOSHADE SIZE=1>
<P></P>
<P></P>
<HR NOSHADE SIZE=1>
<P></P>
<P>
Produced by
gfdoc - a rudimentary GF document generator.
(c) Aarne Ranta (<A HREF="mailto:aarne@cs.chalmers.se">aarne@cs.chalmers.se</A>) 2002 under GNU GPL.
</P>
<P>
The definitions of these constants are hard-coded in GF, and defined
in <A HREF="../src/GF/Grammar/AppPredefined.hs">AppPredefined.hs</A>. Applying
them to run-time variables leads to compiler errors that are often
only detected at the code generation time.
</P>
<PRE>
resource Predef = {
</PRE>
<P></P>
<P>
This type of booleans is for internal use only.
</P>
<PRE>
param PBool = PTrue | PFalse ;
oper Error : Type = variants {} ; -- the empty type
oper Int : Type = variants {} ; -- the type of integers
oper Ints : Int -&gt; Type = variants {} ; -- the type of integers from 0 to n
oper error : Str -&gt; Error = variants {} ; -- forms error message
oper length : Tok -&gt; Int = variants {} ; -- length of string
oper drop : Int -&gt; Tok -&gt; Tok = variants {} ; -- drop prefix of length
oper take : Int -&gt; Tok -&gt; Tok = variants {} ; -- take prefix of length
oper tk : Int -&gt; Tok -&gt; Tok = variants {} ; -- drop suffix of length
oper dp : Int -&gt; Tok -&gt; Tok = variants {} ; -- take suffix of length
oper eqInt : Int -&gt; Int -&gt; PBool = variants {} ; -- test if equal integers
oper lessInt: Int -&gt; Int -&gt; PBool = variants {} ; -- test order of integers
oper plus : Int -&gt; Int -&gt; Int = variants {} ; -- add integers
oper eqStr : Tok -&gt; Tok -&gt; PBool = variants {} ; -- test if equal strings
oper occur : Tok -&gt; Tok -&gt; PBool = variants {} ; -- test if occurs as substring
oper occurs : Tok -&gt; Tok -&gt; PBool = variants {} ; -- test if any char occurs
oper show : (P : Type) -&gt; P -&gt; Tok = variants {} ; -- convert param to string
oper read : (P : Type) -&gt; Tok -&gt; P = variants {} ; -- convert string to param
oper toStr : (L : Type) -&gt; L -&gt; Str = variants {} ; -- find the "first" string
oper mapStr : (L : Type) -&gt; (Str -&gt; Str) -&gt; L -&gt; L = variants {} ;
-- map all strings in a data structure; experimental ---
} ;
</PRE>
<P></P>
<!-- html code generated by txt2tags 2.3 (http://txt2tags.sf.net) -->
<!-- cmdline: txt2tags -thtml -\-toc ../prelude/Predef.txt -->
</BODY></HTML>