[ Index ]
 

Code source de eGroupWare 1.2.106-2

Accédez au Source d'autres logiciels libresSoutenez Angelica Josefina !

title

Body

[fermer]

/phpgwapi/js/jsolait/doc/ -> lang.xhtml (source)

   1  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
   2  <html xmlns="http://www.w3.org/1999/xhtml">
   3    <head>
   4      <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
   5      <title>.: jsolait :. | documentation | lang</title>
   6      <link rel="stylesheet" type="text/css" href="./html.css" />
   7      <meta name="author" content="Jan-Klaas Kollhof" />
   8      <meta name="keywords" content="jsolait.lang" />
   9    </head>
  10    <body>
  11      <a name="top" id="top"></a>
  12      <div class="navigationBar"><a href="./index.xhtml">documentation</a> | 
  13                      lang</div>
  14      <div class="menu">
  15        <ul></ul>
  16        <div class="copyright">copyright © 2004, Jan-Klaas Kollhof</div>
  17      </div>
  18      <div class="content">
  19           <h1>Module lang</h1>
  20  
  21              This module provides language services like tokenizing JavaScript code 
  22              or converting JavaScript objects to and from <a href="http://json.org" target="_blank">JSON</a>.<br />
  23              To customize JSON serialization of Objects just overwrite the toJSON method in your class.
  24           <div class="contentItem"><h2>public members:<a class="bttop" href="#top">â–²</a></h2><div>
  25                
  26                   <h3>JSONParser()</h3><div class="indent">
  27                        A class for parsing JSON.<br />
  28                        <ul>
  29                            <li><b>JSONParser::addLib(obj,name,exports)</b><br />
  30                                Adds a lib object for converting application specific JSON-Objects.<br />
  31                                This is an extension to the default JSON behavior to allow class hinitng.
  32                           </li>
  33                           <li><b>JSONParser::jsonToObj(data)</b><br />
  34                                  Turns JSON code into JavaScript objects.<br />
  35                                <code>data</code> is a String containing the JSON code.
  36                           </li>
  37                           <li><b>JSONParser::objToJson(obj)</b><br />
  38                                Turns an object into JSON.<br />
  39                                This is the same as calling obj.toJSON();<br />
  40                           </li>
  41                      </ul>
  42                   </div>
  43                   <h3>parser</h3><div class="indent">
  44                        A JSONParser object used for jsonToObj and objToJson.
  45                   </div>
  46                   <h3>jsonToObj(src)</h3><div class="indent">
  47                                Turns JSON code into JavaScript objects.<br />
  48                                <code>src</code> is a String containing the JSON code.
  49                   </div>
  50                   <h3>objToJson(obj)</h3><div class="indent">
  51                               Turns an object into JSON.<br />
  52                               This is the same as calling obj.toJSON();<br />
  53                   </div>
  54                   <h3>tokens</h3><div class="indent">
  55                      Token  type constants for the tokenizer.<br />
  56                      <ul>
  57                          <li><b>tokens.WSP</b> WhiteSpace </li>
  58                          <li><b>tokens.OP</b>  Operator </li>
  59                          <li><b>tokens.STR</b> String</li>
  60                          <li><b>tokens.NAME</b> Name</li>
  61                          <li><b>tokens.NUM</b> Number</li>
  62                          <li><b>tokens.ERR</b> Error</li>
  63                          <li><b>tokens.NL</b> NewLine </li>
  64                          <li><b>tokens.COMMENT</b> Comment </li>
  65                          <li><b>tokens.DOCCOMMENT</b> Documentation comment </li>
  66                          <li><b>tokens.REGEXP</b> Regular Expression</li>
  67                      </ul>
  68                   </div>
  69                   
  70                   <h3>Tokenizer(source)</h3><div class="indent">
  71                           Tokenizer Class which incrementally parses JavaScript code(<code>source</code>) and returns the language tokens.<br />
  72                          <ul>
  73                                <li><b>Tokenizer::next()</b><br />                             
  74                                  Returns the next Token object.
  75                               </li>
  76                               <li><b>Tokenizer::nextNonWS(nlIsWS)</b><br />
  77                                  Returns the next non whitespace token.<br />
  78                                  If <code>nlIsWS</code> is <code>true</code> then a NewLine token is interpreted as whitespace.
  79                               </li>
  80                               <li><b>Tokenizer::finished()</b><br />
  81                                  Returns <code>true</code> if the Tokenizer has finished the parsing.
  82                               </li>
  83                           </ul>
  84                   </div>
  85                   
  86                   <h3>Token(type, value, pos, err)</h3><div class="indent">
  87                           Token class for token objects returned by the Tokenizer.<br />
  88                          <ul>
  89                                <li><b>Token::type</b>The type of the token(see the tokens constants).</li>
  90                                <li><b>Token::value</b>A String containing the token value.</li>
  91                                <li><b>Token::pos</b>The starting position of the token in the source .</li>
  92                                <li><b>Token::err</b>The error object for Error tokens.</li>
  93                          </ul>
  94                   </div>
  95           </div></div>
  96       </div>
  97    </body>
  98  </html>


Généré le : Sun Feb 25 17:20:01 2007 par Balluche grâce à PHPXref 0.7