Skip to content
Snippets Groups Projects
Select Git revision
  • 8.0
  • master default protected
  • 9.0
  • 7.8
  • 7.6
  • 7.4
  • 7.2
  • 7.0
  • 0.6
  • rosuav/latex-markdown-renderer
  • rxnpatch/rxnpatch
  • marcus/gobject-introspection
  • rxnpatch/8.0
  • rosuav/pre-listening-ports
  • nt-tools
  • rosuav/async-annotations
  • rosuav/pgsql-ssl
  • rxnpatch/rxnpatch-broken/2023-10-06T094250
  • grubba/fdlib
  • grubba/wip/sakura/8.0
  • v8.0.2000
  • v8.0.1998
  • v8.0.1996
  • v8.0.1994
  • v8.0.1992
  • v8.0.1990
  • v8.0.1988
  • v8.0.1986
  • rxnpatch/clusters/8.0/2025-04-29T124414
  • rxnpatch/2025-04-29T124414
  • v8.0.1984
  • v8.0.1982
  • v8.0.1980
  • v8.0.1978
  • v8.0.1976
  • v8.0.1974
  • v8.0.1972
  • v8.0.1970
  • v8.0.1968
  • v8.0.1966
40 results

lex.h

Blame
    • Fredrik Hübinette (Hubbe)'s avatar
      9b08a2f6
      optimized · 9b08a2f6
      Fredrik Hübinette (Hubbe) authored
      Rev: src/docode.c:1.34
      Rev: src/interpret.c:1.72
      Rev: src/language.yacc:1.67
      Rev: src/lex.c:1.46
      Rev: src/lex.h:1.11
      Rev: src/main.c:1.44
      Rev: src/main.h:1.8
      Rev: src/peep.c:1.20
      Rev: src/peep.in:1.13
      9b08a2f6
      History
      optimized
      Fredrik Hübinette (Hubbe) authored
      Rev: src/docode.c:1.34
      Rev: src/interpret.c:1.72
      Rev: src/language.yacc:1.67
      Rev: src/lex.c:1.46
      Rev: src/lex.h:1.11
      Rev: src/main.c:1.44
      Rev: src/main.h:1.8
      Rev: src/peep.c:1.20
      Rev: src/peep.in:1.13
    lex.h 1.63 KiB
    /*\
    ||| This file a part of Pike, and is copyright by Fredrik Hubinette
    ||| Pike is distributed as GPL (General Public License)
    ||| See the files COPYING and DISCLAIMER for more information.
    \*/
    
    /*
     * $Id: lex.h,v 1.11 1998/03/31 21:52:21 hubbe Exp $
     */
    #ifndef LEX_H
    #define LEX_H
    
    #include <stdio.h>
    
    struct keyword
    {
      char *word;
      int token;
      int flags;
    };
    
    #define I_HASARG 1
    #define I_POINTER 2
    #define I_JUMP 4
    #define I_ISPOINTER 3
    #define I_ISJUMP 7
    #define I_DATA 9
    
    #ifdef DEBUG
    #define INSTR_PROFILING
    #endif
    
    #ifdef INSTR_PROFILING
    extern int last_instruction;
    #endif
    
    struct instr
    {
    #ifdef DEBUG
    #ifdef INSTR_PROFILING
      long reruns[256];
    #endif
      long runs;
      long compiles;
    #endif
      int flags;
      char *name;
    };
    
    #ifdef DEBUG
    #define ADD_COMPILED(X) instrs[(X)-F_OFFSET].compiles++
    #ifdef INSTR_PROFILING
    #define ADD_RUNNED(X) do { int _x=(X)-F_OFFSET; instrs[last_instruction].reruns[_x]++; instrs[last_instruction=_x].runs++; } while(0)
    #else
    #define ADD_RUNNED(X) instrs[(X)-F_OFFSET].runs++
    #endif
    #else
    #define ADD_COMPILED(X)
    #define ADD_RUNNED(X)
    #endif
    
    #ifndef STRUCT_HASH_ENTRY_DECLARED
    #define STRUCT_HASH_ENTRY_DECLARED
    struct hash_entry;
    #endif
    
    #ifndef STRUCT_HASH_TABLE_DECLARED
    #define STRUCT_HASH_TABLE_DECLARED
    struct hash_table;
    #endif
    
    struct lex
    {
      char *pos;
      char *end;
      INT32 current_line;
      INT32 pragmas;
      struct pike_string *current_file;
    };
    
    extern struct lex lex;
    extern struct instr instrs[];
    
    /* Prototypes begin here */
    void exit_lex(void);
    struct reserved;
    void init_lex(void);
    char *low_get_f_name(int n,struct program *p);
    char *get_f_name(int n);
    char *get_token_name(int n);
    /* Prototypes end here */
    
    #endif