w32tex
About: TeX Live provides a comprehensive TeX system including all the major TeX-related programs, macro packages, and fonts that are free software. Windows sources.
  Fossies Dox: w32tex-src.tar.xz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

parser.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include "main.h"
#include "commands.h"
#include "cfg.h"
#include "stack.h"
#include "util.h"
#include "parser.h"
#include "l2r_fonts.h"
#include "lengths.h"
#include "definitions.h"
#include "funct1.h"
Include dependency graph for parser.c:

Go to the source code of this file.

Classes

struct  InputStackType
 

Macros

#define PARSER_SOURCE_MAX   100
 
#define TRACK_LINE_NUMBER_MAX   10
 
#define CR   (char) 0x0d
 
#define LF   (char) 0x0a
 

Typedefs

typedef struct InputStackType InputStackType
 

Functions

static void parseBracket ()
 
void PushTrackLineNumber (int flag)
 
void PopTrackLineNumber (void)
 
int CurrentLineNumber (void)
 
void UpdateLineNumber (char *s)
 
char * CurrentFileName (void)
 
int PushSource (char *filename, char *string)
 
int StillSource (void)
 
void PopSource (void)
 

Variables

static InputStackType g_parser_stack [100]
 
static int g_parser_depth = -1
 
static char * g_parser_string = "stdin"
 
static FILEg_parser_file = NULL
 
static int g_parser_line = 1
 
static int g_parser_include_level =0
 
static char g_parser_currentChar
 
static char g_parser_lastChar
 
static char g_parser_penultimateChar
 
static int g_parser_backslashes
 
static int g_track_line_number_stack [10]
 
static int g_track_line_number =-1
 

Macro Definition Documentation

◆ CR

#define CR   (char) 0x0d

Definition at line 324 of file parser.c.

◆ LF

#define LF   (char) 0x0a

Definition at line 325 of file parser.c.

◆ PARSER_SOURCE_MAX

#define PARSER_SOURCE_MAX   100

Definition at line 51 of file parser.c.

◆ TRACK_LINE_NUMBER_MAX

#define TRACK_LINE_NUMBER_MAX   10

Definition at line 66 of file parser.c.

Typedef Documentation

◆ InputStackType

Function Documentation

◆ CurrentFileName()

char* CurrentFileName ( void  )

purpose: returns the filename of the text being processed

Definition at line 121 of file parser.c.

References InputStackType::file_name, file_name, g_parser_depth, g_parser_stack, and s.

Referenced by diagnostics(), and PushSource().

◆ CurrentLineNumber()

int CurrentLineNumber ( void  )

purpose: returns the current line number of the text being processed

Definition at line 98 of file parser.c.

References g_parser_line.

Referenced by diagnostics(), and PushSource().

◆ parseBracket()

static void parseBracket ( )
static

◆ PopSource()

◆ PopTrackLineNumber()

void PopTrackLineNumber ( void  )

purpose: restore last state of line numbers tracking in LaTeX source file

Definition at line 86 of file parser.c.

References diagnostics(), ERROR, and g_track_line_number.

Referenced by CmdMakeTitle().

◆ PushSource()

◆ PushTrackLineNumber()

void PushTrackLineNumber ( int  flag)

purpose: set whether or not line numbers should be tracked in LaTeX source file

Definition at line 73 of file parser.c.

References diagnostics(), ERROR, flag, g_track_line_number, g_track_line_number_stack, and TRACK_LINE_NUMBER_MAX.

Referenced by CmdMakeTitle(), and main().

◆ StillSource()

int StillSource ( void  )

purpose: figure out if text remains to be processed

Definition at line 231 of file parser.c.

References feof, g_parser_file, and g_parser_string.

Referenced by ConvertAllttString(), and ConvertString().

◆ UpdateLineNumber()

void UpdateLineNumber ( char *  s)

purpose: advances the line number for each '
' in s

Definition at line 107 of file parser.c.

References g_parser_line, NULL, and s.

Referenced by CmdNewEnvironment(), CmdNewTheorem(), CmdTitle(), and CmdVerbatim().

Variable Documentation

◆ g_parser_backslashes

int g_parser_backslashes
static

Definition at line 64 of file parser.c.

◆ g_parser_currentChar

char g_parser_currentChar
static

Definition at line 61 of file parser.c.

◆ g_parser_depth

int g_parser_depth = -1
static

Definition at line 55 of file parser.c.

Referenced by CurrentFileName(), PopSource(), and PushSource().

◆ g_parser_file

FILE* g_parser_file = NULL
static

Definition at line 57 of file parser.c.

Referenced by PopSource(), PushSource(), and StillSource().

◆ g_parser_include_level

int g_parser_include_level =0
static

Definition at line 59 of file parser.c.

Referenced by PopSource(), and PushSource().

◆ g_parser_lastChar

char g_parser_lastChar
static

Definition at line 62 of file parser.c.

◆ g_parser_line

int g_parser_line = 1
static

Definition at line 58 of file parser.c.

Referenced by CurrentLineNumber(), PopSource(), PushSource(), and UpdateLineNumber().

◆ g_parser_penultimateChar

char g_parser_penultimateChar
static

Definition at line 63 of file parser.c.

◆ g_parser_stack

InputStackType g_parser_stack[100]
static

Definition at line 53 of file parser.c.

Referenced by CurrentFileName(), PopSource(), and PushSource().

◆ g_parser_string

char* g_parser_string = "stdin"
static

Definition at line 56 of file parser.c.

Referenced by PopSource(), PushSource(), and StillSource().

◆ g_track_line_number

int g_track_line_number =-1
static

Definition at line 68 of file parser.c.

Referenced by PopTrackLineNumber(), and PushTrackLineNumber().

◆ g_track_line_number_stack

int g_track_line_number_stack[10]
static

Definition at line 67 of file parser.c.

Referenced by PushTrackLineNumber().