home *** CD-ROM | disk | FTP | other *** search
/ Tools / WinSN5.0Ver.iso / NETSCAP.50 / WIN1998.ZIP / ns / js / src / jsscript.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-04-08  |  2.2 KB  |  65 lines

  1. /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
  2.  *
  3.  * The contents of this file are subject to the Netscape Public License
  4.  * Version 1.0 (the "NPL"); you may not use this file except in
  5.  * compliance with the NPL.  You may obtain a copy of the NPL at
  6.  * http://www.mozilla.org/NPL/
  7.  *
  8.  * Software distributed under the NPL is distributed on an "AS IS" basis,
  9.  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
  10.  * for the specific language governing rights and limitations under the
  11.  * NPL.
  12.  *
  13.  * The Initial Developer of this code under the NPL is Netscape
  14.  * Communications Corporation.  Portions created by Netscape are
  15.  * Copyright (C) 1998 Netscape Communications Corporation.  All Rights
  16.  * Reserved.
  17.  */
  18.  
  19. #ifndef jsscript_h___
  20. #define jsscript_h___
  21. /*
  22.  * JS script descriptor.
  23.  */
  24. #include "jsatom.h"
  25. #include "jsprvtd.h"
  26.  
  27. PR_BEGIN_EXTERN_C
  28.  
  29. struct JSScript {
  30.     jsbytecode   *code;         /* bytecodes and their immediate operands */
  31.     uint32       length;        /* length of code vector */
  32.     JSAtomMap    atomMap;       /* maps immediate index to literal struct */
  33.     const char   *filename;     /* source filename or null */
  34.     uintN        lineno;        /* base line number of script */
  35.     uintN        depth;         /* maximum stack depth in slots */
  36.     jssrcnote    *notes;        /* line number and other decompiling data */
  37.     JSSymbol     *args;         /* formal argument list */
  38.     JSSymbol     *vars;         /* local variable list */
  39.     JSPrincipals *principals;    /* principals for this script */
  40.     void         *javaData;     /* extra data used by jsjava.c */
  41. };
  42.  
  43. extern JSScript *
  44. js_NewScript(JSContext *cx, JSCodeGenerator *cg, const char *filename,
  45.          uintN lineno, JSPrincipals *principals, JSFunction *fun);
  46.  
  47. extern void
  48. js_DestroyScript(JSContext *cx, JSScript *script);
  49.  
  50. extern jssrcnote *
  51. js_GetSrcNote(JSScript *script, jsbytecode *pc);
  52.  
  53. extern uintN
  54. js_PCToLineNumber(JSScript *script, jsbytecode *pc);
  55.  
  56. extern jsbytecode *
  57. js_LineNumberToPC(JSScript *script, uintN lineno);
  58.  
  59. extern uintN
  60. js_GetScriptLineExtent(JSScript *script);
  61.  
  62. PR_END_EXTERN_C
  63.  
  64. #endif /* jsscript_h___ */
  65.