#include <stdio.h>
#include <string.h>
#include <errno.h>
#include <stdlib.h>
#include <cctype>
#include <cstring>
#include <algorithm>
#include <iostream>
#include <set>
#include <sstream>
#include <string>
#include <stack>
#include "cmd-edit.h"
#include "lo-mappers.h"
#include "quit.h"
#include "unistd-wrappers.h"
#include "Cell.h"
#include "defun.h"
#include "error.h"
#include "errwarn.h"
#include "input.h"
#include "interpreter.h"
#include "lex.h"
#include "octave.h"
#include "ov-magic-int.h"
#include "ov.h"
#include "parse.h"
#include "pt-all.h"
#include "symtab.h"
#include "token.h"
#include "utils.h"
#include "variables.h"
#include "oct-parse.h"
#include "oct-gperf.h"
Go to the source code of this file.
Typedefs | |
typedef short int | flex_int16_t |
typedef int | flex_int32_t |
typedef signed char | flex_int8_t |
typedef unsigned short int | flex_uint16_t |
typedef unsigned int | flex_uint32_t |
typedef unsigned char | flex_uint8_t |
typedef struct yy_buffer_state * | YY_BUFFER_STATE |
typedef flex_uint8_t | YY_CHAR |
typedef size_t | yy_size_t |
typedef int | yy_state_type |
typedef void * | yyscan_t |
Functions | |
octave_value_list | Fiskeyword (const octave_value_list &args, int) |
bool | iskeyword (const std::string &s) |
YY_BUFFER_STATE | octave__create_buffer (FILE *file, int size, yyscan_t yyscanner) |
Allocate and initialize an input buffer state. More... | |
void | octave__delete_buffer (YY_BUFFER_STATE b, yyscan_t yyscanner) |
Destroy the buffer. More... | |
void | octave__flush_buffer (YY_BUFFER_STATE b, yyscan_t yyscanner) |
Discard all buffered characters. More... | |
YY_BUFFER_STATE | octave__scan_buffer (char *base, yy_size_t size, yyscan_t yyscanner) |
Setup the input buffer state to scan directly from a user-specified character buffer. More... | |
YY_BUFFER_STATE | octave__scan_bytes (const char *yybytes, int _yybytes_len, yyscan_t yyscanner) |
Setup the input buffer state to scan the given bytes. More... | |
YY_BUFFER_STATE | octave__scan_string (const char *yystr, yyscan_t yyscanner) |
Setup the input buffer state to scan a string. More... | |
void | octave__switch_to_buffer (YY_BUFFER_STATE new_buffer, yyscan_t yyscanner) |
Switch to a different input buffer. More... | |
void * | octave_alloc (yy_size_t, yyscan_t yyscanner) |
void | octave_free (void *, yyscan_t yyscanner) |
int | octave_get_column (yyscan_t yyscanner) |
Get the current column number. More... | |
int | octave_get_debug (yyscan_t yyscanner) |
octave::base_lexer * | octave_get_extra (yyscan_t yyscanner) |
Get the user-defined data for this scanner. More... | |
FILE * | octave_get_in (yyscan_t yyscanner) |
Get the input stream. More... | |
int | octave_get_leng (yyscan_t yyscanner) |
Get the length of the current token. More... | |
int | octave_get_lineno (yyscan_t yyscanner) |
Get the current line number. More... | |
OCTAVE_STYPE * | octave_get_lval (yyscan_t yyscanner) |
FILE * | octave_get_out (yyscan_t yyscanner) |
Get the output stream. More... | |
char * | octave_get_text (yyscan_t yyscanner) |
Get the current token. More... | |
int | octave_lex (OCTAVE_STYPE *yylval_param, yyscan_t yyscanner) |
The main scanner function which does all the work. More... | |
int | octave_lex_destroy (yyscan_t yyscanner) |
int | octave_lex_init (yyscan_t *scanner) |
int | octave_lex_init_extra (octave::base_lexer *user_defined, yyscan_t *scanner) |
void | octave_pop_buffer_state (yyscan_t yyscanner) |
Removes and deletes the top of the stack, if present. More... | |
void | octave_push_buffer_state (YY_BUFFER_STATE new_buffer, yyscan_t yyscanner) |
Pushes the new state onto the stack. More... | |
void * | octave_realloc (void *, yy_size_t, yyscan_t yyscanner) |
void | octave_restart (FILE *input_file, yyscan_t yyscanner) |
Immediately switch to a different input stream. More... | |
void | octave_set_column (int _column_no, yyscan_t yyscanner) |
Set the current column. More... | |
void | octave_set_debug (int debug_flag, yyscan_t yyscanner) |
void | octave_set_extra (octave::base_lexer *user_defined, yyscan_t yyscanner) |
Set the user-defined data. More... | |
void | octave_set_in (FILE *_in_str, yyscan_t yyscanner) |
Set the input stream. More... | |
void | octave_set_lineno (int _line_number, yyscan_t yyscanner) |
Set the current line number. More... | |
void | octave_set_lval (OCTAVE_STYPE *yylval_param, yyscan_t yyscanner) |
void | octave_set_out (FILE *_out_str, yyscan_t yyscanner) |
#define CMD_OR_OP | ( | PATTERN, | |
TOK, | |||
COMPAT | |||
) |
#define CMD_OR_UNARY_OP | ( | PATTERN, | |
TOK, | |||
COMPAT | |||
) |
#define HANDLE_EOB_OR_EOF | ( | STATUS | ) |
#define HANDLE_NUMBER | ( | PATTERN, | |
BASE | |||
) |
#define HANDLE_STRING_CONTINUATION |
#define isatty octave_isatty_wrapper |
#define unput | ( | c | ) | yyunput( c, yyg->yytext_ptr , yyscanner ) |
#define YY_AT_BOL | ( | ) | (YY_CURRENT_BUFFER_LVALUE->yy_at_bol) |
#define yy_create_buffer octave__create_buffer |
#define YY_CURRENT_BUFFER |
#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] |
#define YY_DECL |
#define yy_delete_buffer octave__delete_buffer |
#define YY_DO_BEFORE_ACTION |
#define YY_FATAL_ERROR | ( | msg | ) | (yyget_extra (yyscanner))->fatal_error (msg) |
#define yy_flush_buffer octave__flush_buffer |
#define YY_FLUSH_BUFFER yy_flush_buffer( YY_CURRENT_BUFFER , yyscanner) |
#define YY_INPUT | ( | buf, | |
result, | |||
max_size | |||
) | result = curr_lexer->fill_flex_buffer (buf, max_size) |
#define yy_new_buffer yy_create_buffer |
#define YY_RULE_SETUP |
#define yy_scan_buffer octave__scan_buffer |
#define yy_scan_bytes octave__scan_bytes |
#define yy_scan_string octave__scan_string |
#define yy_set_bol | ( | at_bol | ) |
#define yy_set_interactive | ( | is_interactive | ) |
#define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type)) |
#define YY_STATE_EOF | ( | state | ) | (YY_END_OF_BUFFER + state + 1) |
#define yy_switch_to_buffer octave__switch_to_buffer |
#define yyalloc octave_alloc |
#define yycolumn (YY_CURRENT_BUFFER_LVALUE->yy_bs_column) |
#define yyfree octave_free |
#define yyget_column octave_get_column |
#define yyget_debug octave_get_debug |
#define yyget_extra octave_get_extra |
#define yyget_in octave_get_in |
#define yyget_leng octave_get_leng |
#define yyget_lineno octave_get_lineno |
#define yyget_lval octave_get_lval |
#define yyget_out octave_get_out |
#define yyget_text octave_get_text |
#define yyless | ( | n | ) |
#define yyless | ( | n | ) |
#define yylex octave_lex |
#define yylex_destroy octave_lex_destroy |
#define yylex_init octave_lex_init |
#define yylex_init_extra octave_lex_init_extra |
#define yylineno (YY_CURRENT_BUFFER_LVALUE->yy_bs_lineno) |
#define yypop_buffer_state octave_pop_buffer_state |
#define yypush_buffer_state octave_push_buffer_state |
#define yyrealloc octave_realloc |
#define yyrestart octave_restart |
#define yyset_column octave_set_column |
#define yyset_debug octave_set_debug |
#define yyset_extra octave_set_extra |
#define yyset_in octave_set_in |
#define yyset_lineno octave_set_lineno |
#define yyset_lval octave_set_lval |
#define yyset_out octave_set_out |
#define YYSTYPE OCTAVE_STYPE |
#define yywrap octave_wrap |
typedef short int flex_int16_t |
typedef int flex_int32_t |
typedef signed char flex_int8_t |
typedef unsigned short int flex_uint16_t |
typedef unsigned int flex_uint32_t |
typedef unsigned char flex_uint8_t |
typedef struct yy_buffer_state* YY_BUFFER_STATE |
typedef flex_uint8_t YY_CHAR |
typedef int yy_state_type |
octave_value_list Fiskeyword | ( | const octave_value_list & | args, |
int | |||
) |
Definition at line 4931 of file lex.cc.
References octave_value::length(), print_usage(), and TOTAL_KEYWORDS.
bool iskeyword | ( | const std::string & | s | ) |
Definition at line 1335 of file lex.cc.
References octave_kw_hash::in_word_set().
Referenced by make_valid_name_options::make_valid_name_options(), tree_evaluator::assignin(), octave::Fisvarname(), base_lexer::fq_identifier_contains_keyword(), base_parser::make_assign_op(), octave::make_valid_name(), read_mat_ascii_data(), and base_parser::validate_param_list().
YY_BUFFER_STATE octave__create_buffer | ( | FILE * | file, |
int | size, | ||
yyscan_t | yyscanner | ||
) |
Allocate and initialize an input buffer state.
file | A readable stream. |
size | The character buffer size in bytes. When in doubt, use YY_BUF_SIZE . |
yyscanner | The scanner object. |
Definition at line 4122 of file lex.cc.
References YY_FATAL_ERROR, yy_init_buffer, and yyalloc.
void octave__delete_buffer | ( | YY_BUFFER_STATE | b, |
yyscan_t | yyscanner | ||
) |
Destroy the buffer.
b | a buffer created with yy_create_buffer() |
yyscanner | The scanner object. |
Definition at line 4150 of file lex.cc.
References YY_CURRENT_BUFFER, YY_CURRENT_BUFFER_LVALUE, yyfree, and yyguts_t.
void octave__flush_buffer | ( | YY_BUFFER_STATE | b, |
yyscan_t | yyscanner | ||
) |
Discard all buffered characters.
On the next scan, YY_INPUT will be called.
b | the buffer state to be flushed, usually YY_CURRENT_BUFFER . |
yyscanner | The scanner object. |
Definition at line 4199 of file lex.cc.
References YY_BUFFER_NEW, YY_CURRENT_BUFFER, YY_END_OF_BUFFER_CHAR, yy_load_buffer_state, and yyguts_t.
YY_BUFFER_STATE octave__scan_buffer | ( | char * | base, |
yy_size_t | size, | ||
yyscan_t | yyscanner | ||
) |
Setup the input buffer state to scan directly from a user-specified character buffer.
base | the character buffer |
size | the size in bytes of the character buffer |
yyscanner | The scanner object. |
Definition at line 4330 of file lex.cc.
References YY_BUFFER_NEW, YY_END_OF_BUFFER_CHAR, YY_FATAL_ERROR, yy_switch_to_buffer, and yyalloc.
YY_BUFFER_STATE octave__scan_bytes | ( | const char * | yybytes, |
int | _yybytes_len, | ||
yyscan_t | yyscanner | ||
) |
Setup the input buffer state to scan the given bytes.
The next call to yylex() will scan from a copy of bytes.
yybytes | the byte buffer to scan |
_yybytes_len | the number of bytes in the buffer pointed to by bytes. |
yyscanner | The scanner object. |
Definition at line 4380 of file lex.cc.
References n, YY_END_OF_BUFFER_CHAR, YY_FATAL_ERROR, yy_scan_buffer, and yyalloc.
YY_BUFFER_STATE octave__scan_string | ( | const char * | yystr, |
yyscan_t | yyscanner | ||
) |
Setup the input buffer state to scan a string.
The next call to yylex() will scan from a copy of str.
yystr | a NUL-terminated string to scan |
yyscanner | The scanner object. |
Definition at line 4367 of file lex.cc.
References strlen(), and yy_scan_bytes.
void octave__switch_to_buffer | ( | YY_BUFFER_STATE | new_buffer, |
yyscan_t | yyscanner | ||
) |
Switch to a different input buffer.
new_buffer | The new input buffer. |
yyscanner | The scanner object. |
Definition at line 4075 of file lex.cc.
References YY_CURRENT_BUFFER, YY_CURRENT_BUFFER_LVALUE, yy_load_buffer_state, yyensure_buffer_stack, and yyguts_t.
void octave_free | ( | void * | ptr, |
yyscan_t | yyscanner | ||
) |
int octave_get_column | ( | yyscan_t | yyscanner | ) |
Get the current column number.
yyscanner | The scanner object. |
Definition at line 4466 of file lex.cc.
References YY_CURRENT_BUFFER, yycolumn, and yyguts_t.
int octave_get_debug | ( | yyscan_t | yyscanner | ) |
Definition at line 4571 of file lex.cc.
References yy_flex_debug, and yyguts_t.
octave::base_lexer * octave_get_extra | ( | yyscan_t | yyscanner | ) |
FILE * octave_get_in | ( | yyscan_t | yyscanner | ) |
int octave_get_leng | ( | yyscan_t | yyscanner | ) |
int octave_get_lineno | ( | yyscan_t | yyscanner | ) |
Get the current line number.
yyscanner | The scanner object. |
Definition at line 4453 of file lex.cc.
References YY_CURRENT_BUFFER, yyguts_t, and yylineno.
OCTAVE_STYPE * octave_get_lval | ( | yyscan_t | yyscanner | ) |
FILE * octave_get_out | ( | yyscan_t | yyscanner | ) |
char * octave_get_text | ( | yyscan_t | yyscanner | ) |
int octave_lex | ( | OCTAVE_STYPE * | yylval_param, |
yyscan_t | yyscanner | ||
) |
The main scanner function which does all the work.
Definition at line 1621 of file lex.cc.
References YY_AT_BOL, YY_BUF_SIZE, yy_create_buffer, YY_CURRENT_BUFFER, YY_CURRENT_BUFFER_LVALUE, yy_load_buffer_state, yyensure_buffer_stack, yyguts_t, yyin, yylval, and yyout.
int octave_lex_destroy | ( | yyscan_t | yyscanner | ) |
Definition at line 4691 of file lex.cc.
References YY_CURRENT_BUFFER, YY_CURRENT_BUFFER_LVALUE, yy_delete_buffer, yyfree, yyguts_t, and yypop_buffer_state.
int octave_lex_init | ( | yyscan_t * | scanner | ) |
int octave_lex_init_extra | ( | octave::base_lexer * | user_defined, |
yyscan_t * | scanner | ||
) |
Definition at line 4630 of file lex.cc.
References yyalloc, yyguts_t, and yyset_extra.
void octave_pop_buffer_state | ( | yyscan_t | yyscanner | ) |
Removes and deletes the top of the stack, if present.
The next element becomes the new top.
yyscanner | The scanner object. |
Definition at line 4260 of file lex.cc.
References YY_CURRENT_BUFFER, YY_CURRENT_BUFFER_LVALUE, yy_delete_buffer, yy_load_buffer_state, and yyguts_t.
void octave_push_buffer_state | ( | YY_BUFFER_STATE | new_buffer, |
yyscan_t | yyscanner | ||
) |
Pushes the new state onto the stack.
The new state becomes the current state. This function will allocate the stack if necessary.
new_buffer | The new state. |
yyscanner | The scanner object. |
Definition at line 4229 of file lex.cc.
References YY_CURRENT_BUFFER, YY_CURRENT_BUFFER_LVALUE, yy_load_buffer_state, yyensure_buffer_stack, and yyguts_t.
void octave_restart | ( | FILE * | input_file, |
yyscan_t | yyscanner | ||
) |
Immediately switch to a different input stream.
input_file | A readable stream. |
yyscanner | The scanner object. |
INITIAL
. Definition at line 4057 of file lex.cc.
References YY_BUF_SIZE, yy_create_buffer, YY_CURRENT_BUFFER, YY_CURRENT_BUFFER_LVALUE, yy_init_buffer, yy_load_buffer_state, yyensure_buffer_stack, yyguts_t, and yyin.
void octave_set_column | ( | int | _column_no, |
yyscan_t | yyscanner | ||
) |
Set the current column.
_column_no | column number |
yyscanner | The scanner object. |
Definition at line 4542 of file lex.cc.
References YY_CURRENT_BUFFER, YY_FATAL_ERROR, yycolumn, and yyguts_t.
void octave_set_debug | ( | int | debug_flag, |
yyscan_t | yyscanner | ||
) |
Definition at line 4577 of file lex.cc.
References yy_flex_debug, and yyguts_t.
void octave_set_extra | ( | octave::base_lexer * | user_defined, |
yyscan_t | yyscanner | ||
) |
void octave_set_in | ( | FILE * | _in_str, |
yyscan_t | yyscanner | ||
) |
Set the input stream.
This does not discard the current input buffer.
_in_str | A readable stream. |
yyscanner | The scanner object. |
void octave_set_lineno | ( | int | _line_number, |
yyscan_t | yyscanner | ||
) |
Set the current line number.
_line_number | line number |
yyscanner | The scanner object. |
Definition at line 4527 of file lex.cc.
References YY_CURRENT_BUFFER, YY_FATAL_ERROR, yyguts_t, and yylineno.
void octave_set_lval | ( | OCTAVE_STYPE * | yylval_param, |
yyscan_t | yyscanner | ||
) |