LibreOffice Module hwpfilter (master) 1
Macros | Enumerations | Functions | Variables
hwpeq.cxx File Reference
#include <sal/config.h>
#include <assert.h>
#include <stdio.h>
#include <string.h>
#include <istream>
#include <sstream>
#include "hwpeq.h"
#include <sal/types.h>
#include <sal/macros.h>
#include <rtl/character.hxx>
Include dependency graph for hwpeq.cxx:

Go to the source code of this file.

Macros

#define EQ_CASE   0x01
 
#define EQ_ENV   0x02
 
#define EQ_ATOP   0x04
 

Enumerations

enum  {
  SCRIPT_NONE ,
  SCRIPT_SUB ,
  SCRIPT_SUP ,
  SCRIPT_ALL
}
 

Functions

static bool IS_WS (std::istream::int_type ch)
 
static bool IS_BINARY (std::istream::int_type ch)
 
static int eq_word (OString &outs, std::istream *strm, int script=SCRIPT_NONE)
 
static bool eq_sentence (OString &outs, std::istream *strm, const char *end=nullptr)
 
static const hwpeq * lookup_eqn (char const *str)
 
static void make_keyword (char *keyword, std::string_view token)
 
static void push_token (OString const &white, OString const &token, std::istream *strm)
 
static int next_token (OString &white, OString &token, std::istream *strm)
 
static std::istream::int_type read_white_space (OString &outs, std::istream *strm)
 
static char eq2ltxconv (OString &sstr, std::istream *strm, const char *sentinel)
 
void eq2latex (OString &outs, char const *s)
 

Variables

const hwpeq eq_tbl []
 
static eq_stack * stk = nullptr
 

Macro Definition Documentation

◆ EQ_ATOP

#define EQ_ATOP   0x04

Definition at line 40 of file hwpeq.cxx.

◆ EQ_CASE

#define EQ_CASE   0x01

Definition at line 38 of file hwpeq.cxx.

◆ EQ_ENV

#define EQ_ENV   0x02

Definition at line 39 of file hwpeq.cxx.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
SCRIPT_NONE 
SCRIPT_SUB 
SCRIPT_SUP 
SCRIPT_ALL 

Definition at line 55 of file hwpeq.cxx.

Function Documentation

◆ eq2latex()

void eq2latex ( OString &  outs,
char const *  s 
)

Definition at line 768 of file hwpeq.cxx.

References eq2ltxconv(), eq_sentence(), SAL_NEWLINE_STRING, and stk.

Referenced by Formula::parse().

◆ eq2ltxconv()

static char eq2ltxconv ( OString &  sstr,
std::istream *  strm,
const char *  sentinel 
)
static

◆ eq_sentence()

static bool eq_sentence ( OString &  outs,
std::istream *  strm,
const char *  end = nullptr 
)
static

Definition at line 669 of file hwpeq.cxx.

References end, eq_word(), next_token(), push_token(), and read_white_space().

Referenced by eq2latex(), and eq_word().

◆ eq_word()

static int eq_word ( OString &  outs,
std::istream *  strm,
int  script = SCRIPT_NONE 
)
static

◆ IS_BINARY()

static bool IS_BINARY ( std::istream::int_type  ch)
static

Definition at line 49 of file hwpeq.cxx.

References ch.

Referenced by next_token().

◆ IS_WS()

static bool IS_WS ( std::istream::int_type  ch)
static

Definition at line 42 of file hwpeq.cxx.

References ch.

Referenced by eq2ltxconv(), next_token(), and read_white_space().

◆ lookup_eqn()

static const hwpeq * lookup_eqn ( char const *  str)
static

Definition at line 384 of file hwpeq.cxx.

References eq_tbl, m, result, and SAL_N_ELEMENTS.

Referenced by eq2ltxconv(), and eq_word().

◆ make_keyword()

static void make_keyword ( char *  keyword,
std::string_view  token 
)
static

Definition at line 406 of file hwpeq.cxx.

References result.

Referenced by eq2ltxconv(), eq_word(), and next_token().

◆ next_token()

static int next_token ( OString &  white,
OString &  token,
std::istream *  strm 
)
static

Definition at line 482 of file hwpeq.cxx.

References ch, IS_BINARY(), IS_WS(), make_keyword(), and stk.

Referenced by eq2ltxconv(), eq_sentence(), and eq_word().

◆ push_token()

static void push_token ( OString const &  white,
OString const &  token,
std::istream *  strm 
)
static

Definition at line 467 of file hwpeq.cxx.

References stk.

Referenced by eq_sentence(), and eq_word().

◆ read_white_space()

static std::istream::int_type read_white_space ( OString &  outs,
std::istream *  strm 
)
static

Definition at line 563 of file hwpeq.cxx.

References ch, IS_WS(), result, and stk.

Referenced by eq_sentence(), and eq_word().

Variable Documentation

◆ eq_tbl

const hwpeq eq_tbl[]

Definition at line 71 of file hwpeq.cxx.

Referenced by lookup_eqn().

◆ stk

eq_stack* stk = nullptr
static

Definition at line 465 of file hwpeq.cxx.

Referenced by eq2latex(), next_token(), push_token(), and read_white_space().