GNU Octave  9.1.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
lex.cc File Reference
#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.

Macros

#define BEGIN   yyg->yy_start = 1 + 2 *
 
#define BLOCK_COMMENT_START   4
 
#define CMD_OR_OP(PATTERN, TOK, COMPAT)
 
#define CMD_OR_UNARY_OP(PATTERN, TOK, COMPAT)
 
#define COMMAND_START   1
 
#define curr_lexer   yyextra
 
#define DQ_STRING_START   6
 
#define ECHO   do { if (fwrite( yytext, (size_t) yyleng, 1, yyout )) {} } while (0)
 
#define EOB_ACT_CONTINUE_SCAN   0
 
#define EOB_ACT_END_OF_FILE   1
 
#define EOB_ACT_LAST_MATCH   2
 
#define FLEX_BETA
 
#define FLEX_SCANNER
 
#define FLEXINT_H
 
#define FQ_IDENT_START   8
 
#define HANDLE_EOB_OR_EOF(STATUS)
 
#define HANDLE_IDENTIFIER(pattern, get_set)
 
#define HANDLE_NUMBER(PATTERN, BASE)
 
#define HANDLE_STRING_CONTINUATION
 
#define INITIAL   0
 
#define INPUT_FILE_START   3
 
#define INT16_MAX   (32767)
 
#define INT16_MIN   (-32767-1)
 
#define INT32_MAX   (2147483647)
 
#define INT32_MIN   (-2147483647-1)
 
#define INT8_MAX   (127)
 
#define INT8_MIN   (-128)
 
#define isatty   octave_isatty_wrapper
 
#define LINE_COMMENT_START   5
 
#define MATRIX_START   2
 
#define octave_wrap(yyscanner)   (/*CONSTCOND*/1)
 
#define OCTAVE_YYG    struct yyguts_t *yyg = static_cast<struct yyguts_t*> (m_scanner)
 
#define register
 
#define REJECT   reject_used_but_not_detected
 
#define SIZE_MAX   (~(size_t)0)
 
#define SQ_STRING_START   7
 
#define UINT16_MAX   (65535U)
 
#define UINT32_MAX   (4294967295U)
 
#define UINT8_MAX   (255U)
 
#define unput(c)   yyunput( c, yyg->yytext_ptr , yyscanner )
 
#define YY_AT_BOL()   (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
 
#define YY_BREAK   /*LINTED*/break;
 
#define YY_BUF_SIZE   16384
 
#define YY_BUFFER_EOF_PENDING   2
 
#define YY_BUFFER_NEW   0
 
#define YY_BUFFER_NORMAL   1
 
#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_DECL_IS_OURS   1
 
#define yy_delete_buffer   octave__delete_buffer
 
#define YY_DO_BEFORE_ACTION
 
#define YY_END_OF_BUFFER   113
 
#define YY_END_OF_BUFFER_CHAR   0
 
#define YY_EXIT_FAILURE   2
 
#define YY_EXTRA_TYPE   octave::base_lexer *
 
#define YY_FATAL_ERROR(msg)    (yyget_extra (yyscanner))->fatal_error (msg)
 
#define yy_flex_debug   yyg->yy_flex_debug_r
 
#define YY_FLEX_MAJOR_VERSION   2
 
#define YY_FLEX_MINOR_VERSION   6
 
#define YY_FLEX_SUBMINOR_VERSION   4
 
#define yy_flush_buffer   octave__flush_buffer
 
#define YY_FLUSH_BUFFER   yy_flush_buffer( YY_CURRENT_BUFFER , yyscanner)
 
#define yy_init_buffer   octave__init_buffer
 
#define YY_INPUT(buf, result, max_size)    result = curr_lexer->fill_flex_buffer (buf, max_size)
 
#define YY_INT_ALIGNED   short int
 
#define YY_LESS_LINENO(n)
 
#define YY_LINENO_REWIND_TO(ptr)
 
#define yy_load_buffer_state   octave__load_buffer_state
 
#define YY_MORE_ADJ   0
 
#define yy_new_buffer   yy_create_buffer
 
#define YY_NEW_FILE   yyrestart( yyin , yyscanner )
 
#define YY_NO_UNISTD_H   1
 
#define YY_NULL   0
 
#define YY_NUM_RULES   112
 
#define YY_READ_BUF_SIZE   8192
 
#define YY_RESTORE_YY_MORE_OFFSET
 
#define YY_RULE_SETUP
 
#define YY_SC_TO_UI(c)   ((YY_CHAR) (c))
 
#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_SKIP_YYWRAP
 
#define YY_START   ((yyg->yy_start - 1) / 2)
 
#define YY_START_STACK_INCR   25
 
#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_STRUCT_YY_BUFFER_STATE
 
#define yy_switch_to_buffer   octave__switch_to_buffer
 
#define YY_TYPEDEF_YY_BUFFER_STATE
 
#define YY_TYPEDEF_YY_SCANNER_T
 
#define YY_TYPEDEF_YY_SIZE_T
 
#define YY_USER_ACTION
 
#define yyalloc   octave_alloc
 
#define yycolumn   (YY_CURRENT_BUFFER_LVALUE->yy_bs_column)
 
#define yyconst   const
 
#define yyensure_buffer_stack   octave_ensure_buffer_stack
 
#define yyextra   yyg->yyextra_r
 
#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 yyin   yyg->yyin_r
 
#define yyleng   yyg->yyleng_r
 
#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 yylval   yyg->yylval_r
 
#define yymore()   yymore_used_but_not_detected
 
#define yynoreturn
 
#define yyout   yyg->yyout_r
 
#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 YYSTATE   YY_START
 
#define YYSTYPE   OCTAVE_STYPE
 
#define YYTABLES_NAME   "yytables"
 
#define yyterminate()   return YY_NULL
 
#define yytext   yyg->yytext_r
 
#define yytext_ptr   yytext_r
 
#define yywrap   octave_wrap
 

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_STYPEoctave_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)
 

Macro Definition Documentation

◆ BEGIN

#define BEGIN   yyg->yy_start = 1 + 2 *

Definition at line 406 of file lex.cc.

◆ BLOCK_COMMENT_START

#define BLOCK_COMMENT_START   4

Definition at line 1378 of file lex.cc.

◆ CMD_OR_OP

#define CMD_OR_OP (   PATTERN,
  TOK,
  COMPAT 
)
Value:
do \
{ \
curr_lexer->lexer_debug (PATTERN); \
\
if (curr_lexer->looks_like_command_arg ()) \
{ \
yyless (0); \
curr_lexer->push_start_state (COMMAND_START); \
} \
else \
return curr_lexer->handle_op (TOK, false, COMPAT); \
} \
while (0)
#define COMMAND_START
Definition: lex.cc:1375
#define curr_lexer
Definition: lex.cc:1167

Definition at line 1185 of file lex.cc.

◆ CMD_OR_UNARY_OP

#define CMD_OR_UNARY_OP (   PATTERN,
  TOK,
  COMPAT 
)
Value:
do \
{ \
curr_lexer->lexer_debug (PATTERN); \
\
if (curr_lexer->previous_token_may_be_command ()) \
{ \
if (curr_lexer->looks_like_command_arg ()) \
{ \
yyless (0); \
curr_lexer->push_start_state (COMMAND_START); \
} \
else \
return curr_lexer->handle_op (TOK, false, COMPAT); \
} \
else \
{ \
if (curr_lexer->maybe_unput_comma_before_unary_op (TOK)) \
{ \
yyless (0); \
curr_lexer->xunput (','); \
} \
else \
return curr_lexer->handle_op (TOK, false, COMPAT); \
} \
} \
while (0)

Definition at line 1200 of file lex.cc.

◆ COMMAND_START

#define COMMAND_START   1

Definition at line 1375 of file lex.cc.

◆ curr_lexer

#define curr_lexer   yyextra

Definition at line 1167 of file lex.cc.

◆ DQ_STRING_START

#define DQ_STRING_START   6

Definition at line 1380 of file lex.cc.

◆ ECHO

#define ECHO   do { if (fwrite( yytext, (size_t) yyleng, 1, yyout )) {} } while (0)

Definition at line 1529 of file lex.cc.

◆ EOB_ACT_CONTINUE_SCAN

#define EOB_ACT_CONTINUE_SCAN   0

Definition at line 446 of file lex.cc.

◆ EOB_ACT_END_OF_FILE

#define EOB_ACT_END_OF_FILE   1

Definition at line 447 of file lex.cc.

◆ EOB_ACT_LAST_MATCH

#define EOB_ACT_LAST_MATCH   2

Definition at line 448 of file lex.cc.

◆ FLEX_BETA

#define FLEX_BETA

Definition at line 63 of file lex.cc.

◆ FLEX_SCANNER

#define FLEX_SCANNER

Definition at line 58 of file lex.cc.

◆ FLEXINT_H

#define FLEXINT_H

Definition at line 301 of file lex.cc.

◆ FQ_IDENT_START

#define FQ_IDENT_START   8

Definition at line 1382 of file lex.cc.

◆ HANDLE_EOB_OR_EOF

#define HANDLE_EOB_OR_EOF (   STATUS)
Value:
do \
{ \
if (curr_lexer->is_push_lexer ()) \
{ \
if (curr_lexer->at_end_of_buffer ()) \
return STATUS; \
\
if (curr_lexer->at_end_of_file ()) \
return curr_lexer->handle_end_of_input (); \
} \
} \
while (0)

Definition at line 1228 of file lex.cc.

◆ HANDLE_IDENTIFIER

#define HANDLE_IDENTIFIER (   pattern,
  get_set 
)

Definition at line 1283 of file lex.cc.

◆ HANDLE_NUMBER

#define HANDLE_NUMBER (   PATTERN,
  BASE 
)
Value:
do \
{ \
curr_lexer->lexer_debug (PATTERN); \
\
if (curr_lexer->previous_token_may_be_command () \
&& curr_lexer->space_follows_previous_token ()) \
{ \
yyless (0); \
curr_lexer->push_start_state (COMMAND_START); \
} \
else \
{ \
int tok = curr_lexer->previous_token_value (); \
\
if (curr_lexer->whitespace_is_significant () \
&& curr_lexer->space_follows_previous_token () \
&& ! (tok == '[' || tok == '{' \
|| curr_lexer->previous_token_is_binop ())) \
{ \
yyless (0); \
curr_lexer->xunput (','); \
} \
else \
return curr_lexer->handle_number<BASE> (); \
} \
} \
while (0)

Definition at line 1254 of file lex.cc.

◆ HANDLE_STRING_CONTINUATION

#define HANDLE_STRING_CONTINUATION
Value:
do \
{ \
curr_lexer->m_filepos.next_line (); \
} \
while (0)
#define HANDLE_EOB_OR_EOF(STATUS)
Definition: lex.cc:1228

Definition at line 1245 of file lex.cc.

◆ INITIAL

#define INITIAL   0

Definition at line 1374 of file lex.cc.

◆ INPUT_FILE_START

#define INPUT_FILE_START   3

Definition at line 1377 of file lex.cc.

◆ INT16_MAX

#define INT16_MAX   (32767)

Definition at line 343 of file lex.cc.

◆ INT16_MIN

#define INT16_MIN   (-32767-1)

Definition at line 334 of file lex.cc.

◆ INT32_MAX

#define INT32_MAX   (2147483647)

Definition at line 346 of file lex.cc.

◆ INT32_MIN

#define INT32_MIN   (-2147483647-1)

Definition at line 337 of file lex.cc.

◆ INT8_MAX

#define INT8_MAX   (127)

Definition at line 340 of file lex.cc.

◆ INT8_MIN

#define INT8_MIN   (-128)

Definition at line 331 of file lex.cc.

◆ isatty

#define isatty   octave_isatty_wrapper

Definition at line 1158 of file lex.cc.

◆ LINE_COMMENT_START

#define LINE_COMMENT_START   5

Definition at line 1379 of file lex.cc.

◆ MATRIX_START

#define MATRIX_START   2

Definition at line 1376 of file lex.cc.

◆ octave_wrap

#define octave_wrap (   yyscanner)    (/*CONSTCOND*/1)

Definition at line 591 of file lex.cc.

◆ OCTAVE_YYG

#define OCTAVE_YYG    struct yyguts_t *yyg = static_cast<struct yyguts_t*> (m_scanner)

Definition at line 5288 of file lex.cc.

◆ register

#define register

Definition at line 49 of file lex.cc.

◆ REJECT

#define REJECT   reject_used_but_not_detected

Definition at line 1078 of file lex.cc.

◆ SIZE_MAX

#define SIZE_MAX   (~(size_t)0)

Definition at line 359 of file lex.cc.

◆ SQ_STRING_START

#define SQ_STRING_START   7

Definition at line 1381 of file lex.cc.

◆ UINT16_MAX

#define UINT16_MAX   (65535U)

Definition at line 352 of file lex.cc.

◆ UINT32_MAX

#define UINT32_MAX   (4294967295U)

Definition at line 355 of file lex.cc.

◆ UINT8_MAX

#define UINT8_MAX   (255U)

Definition at line 349 of file lex.cc.

◆ unput

#define unput (   c)    yyunput( c, yyg->yytext_ptr , yyscanner )

Definition at line 466 of file lex.cc.

◆ YY_AT_BOL

#define YY_AT_BOL ( )    (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)

Definition at line 587 of file lex.cc.

◆ YY_BREAK

#define YY_BREAK   /*LINTED*/break;

Definition at line 1610 of file lex.cc.

◆ YY_BUF_SIZE

#define YY_BUF_SIZE   16384

Definition at line 428 of file lex.cc.

◆ YY_BUFFER_EOF_PENDING

#define YY_BUFFER_EOF_PENDING   2

Definition at line 528 of file lex.cc.

◆ YY_BUFFER_NEW

#define YY_BUFFER_NEW   0

Definition at line 516 of file lex.cc.

◆ YY_BUFFER_NORMAL

#define YY_BUFFER_NORMAL   1

Definition at line 517 of file lex.cc.

◆ yy_create_buffer

#define yy_create_buffer   octave__create_buffer

Definition at line 69 of file lex.cc.

◆ YY_CURRENT_BUFFER

#define YY_CURRENT_BUFFER
Value:
( yyg->yy_buffer_stack \
? yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] \
: NULL)

Definition at line 539 of file lex.cc.

◆ YY_CURRENT_BUFFER_LVALUE

#define YY_CURRENT_BUFFER_LVALUE   yyg->yy_buffer_stack[yyg->yy_buffer_stack_top]

Definition at line 545 of file lex.cc.

◆ YY_DECL

#define YY_DECL
Value:
int yylex \
(YYSTYPE * yylval_param , yyscan_t yyscanner)
#define YYSTYPE
Definition: lex.cc:1154
#define yylex
Definition: lex.cc:141
void * yyscan_t

Definition at line 1597 of file lex.cc.

◆ YY_DECL_IS_OURS

#define YY_DECL_IS_OURS   1

Definition at line 1592 of file lex.cc.

◆ yy_delete_buffer

#define yy_delete_buffer   octave__delete_buffer

Definition at line 75 of file lex.cc.

◆ YY_DO_BEFORE_ACTION

#define YY_DO_BEFORE_ACTION
Value:
yyg->yytext_ptr = yy_bp; \
yyleng = (int) (yy_cp - yy_bp); \
yyg->yy_hold_char = *yy_cp; \
*yy_cp = '\0'; \
yyg->yy_c_buf_p = yy_cp;

Definition at line 607 of file lex.cc.

◆ YY_END_OF_BUFFER

#define YY_END_OF_BUFFER   113

Definition at line 614 of file lex.cc.

◆ YY_END_OF_BUFFER_CHAR

#define YY_END_OF_BUFFER_CHAR   0

Definition at line 417 of file lex.cc.

◆ YY_EXIT_FAILURE

#define YY_EXIT_FAILURE   2

Definition at line 4411 of file lex.cc.

◆ YY_EXTRA_TYPE

#define YY_EXTRA_TYPE   octave::base_lexer *

Definition at line 1166 of file lex.cc.

◆ YY_FATAL_ERROR

#define YY_FATAL_ERROR (   msg)     (yyget_extra (yyscanner))->fatal_error (msg)

Definition at line 1182 of file lex.cc.

◆ yy_flex_debug

#define yy_flex_debug   yyg->yy_flex_debug_r

Definition at line 400 of file lex.cc.

◆ YY_FLEX_MAJOR_VERSION

#define YY_FLEX_MAJOR_VERSION   2

Definition at line 59 of file lex.cc.

◆ YY_FLEX_MINOR_VERSION

#define YY_FLEX_MINOR_VERSION   6

Definition at line 60 of file lex.cc.

◆ YY_FLEX_SUBMINOR_VERSION

#define YY_FLEX_SUBMINOR_VERSION   4

Definition at line 61 of file lex.cc.

◆ yy_flush_buffer

#define yy_flush_buffer   octave__flush_buffer

Definition at line 105 of file lex.cc.

◆ YY_FLUSH_BUFFER

#define YY_FLUSH_BUFFER   yy_flush_buffer( YY_CURRENT_BUFFER , yyscanner)

Definition at line 558 of file lex.cc.

◆ yy_init_buffer

#define yy_init_buffer   octave__init_buffer

Definition at line 99 of file lex.cc.

◆ YY_INPUT

#define YY_INPUT (   buf,
  result,
  max_size 
)     result = curr_lexer->fill_flex_buffer (buf, max_size)

Definition at line 1174 of file lex.cc.

◆ YY_INT_ALIGNED

#define YY_INT_ALIGNED   short int

Definition at line 54 of file lex.cc.

◆ YY_LESS_LINENO

#define YY_LESS_LINENO (   n)

Definition at line 450 of file lex.cc.

◆ YY_LINENO_REWIND_TO

#define YY_LINENO_REWIND_TO (   ptr)

Definition at line 451 of file lex.cc.

◆ yy_load_buffer_state

#define yy_load_buffer_state   octave__load_buffer_state

Definition at line 111 of file lex.cc.

◆ YY_MORE_ADJ

#define YY_MORE_ADJ   0

Definition at line 1080 of file lex.cc.

◆ yy_new_buffer

#define yy_new_buffer   yy_create_buffer

Definition at line 568 of file lex.cc.

◆ YY_NEW_FILE

#define YY_NEW_FILE   yyrestart( yyin , yyscanner )

Definition at line 416 of file lex.cc.

◆ YY_NO_UNISTD_H

#define YY_NO_UNISTD_H   1

Definition at line 1157 of file lex.cc.

◆ YY_NULL

#define YY_NULL   0

Definition at line 378 of file lex.cc.

◆ YY_NUM_RULES

#define YY_NUM_RULES   112

Definition at line 613 of file lex.cc.

◆ YY_READ_BUF_SIZE

#define YY_READ_BUF_SIZE   8192

Definition at line 1520 of file lex.cc.

◆ YY_RESTORE_YY_MORE_OFFSET

#define YY_RESTORE_YY_MORE_OFFSET

Definition at line 1081 of file lex.cc.

◆ YY_RULE_SETUP

#define YY_RULE_SETUP
Value:
if ( yyleng > 0 ) \
YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \
(yytext[yyleng - 1] == '\n'); \
YY_USER_ACTION
#define yytext
Definition: lex.cc:397
#define yyleng
Definition: lex.cc:396

Definition at line 1613 of file lex.cc.

◆ YY_SC_TO_UI

#define YY_SC_TO_UI (   c)    ((YY_CHAR) (c))

Definition at line 383 of file lex.cc.

◆ yy_scan_buffer

#define yy_scan_buffer   octave__scan_buffer

Definition at line 81 of file lex.cc.

◆ yy_scan_bytes

#define yy_scan_bytes   octave__scan_bytes

Definition at line 93 of file lex.cc.

◆ yy_scan_string

#define yy_scan_string   octave__scan_string

Definition at line 87 of file lex.cc.

◆ yy_set_bol

#define yy_set_bol (   at_bol)
Value:
{ \
if ( ! YY_CURRENT_BUFFER ){\
yyensure_buffer_stack (yyscanner); \
YY_CURRENT_BUFFER_LVALUE = \
yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner); \
} \
YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
}
#define YY_CURRENT_BUFFER
Definition: lex.cc:539
#define yyin
Definition: lex.cc:393
#define YY_BUF_SIZE
Definition: lex.cc:428

Definition at line 578 of file lex.cc.

◆ yy_set_interactive

#define yy_set_interactive (   is_interactive)
Value:
{ \
if ( ! YY_CURRENT_BUFFER ){ \
yyensure_buffer_stack (yyscanner); \
YY_CURRENT_BUFFER_LVALUE = \
yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner); \
} \
YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
}

Definition at line 569 of file lex.cc.

◆ YY_SKIP_YYWRAP

#define YY_SKIP_YYWRAP

Definition at line 592 of file lex.cc.

◆ YY_START

#define YY_START   ((yyg->yy_start - 1) / 2)

Definition at line 411 of file lex.cc.

◆ YY_START_STACK_INCR

#define YY_START_STACK_INCR   25

Definition at line 1578 of file lex.cc.

◆ YY_STATE_BUF_SIZE

#define YY_STATE_BUF_SIZE   ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))

Definition at line 434 of file lex.cc.

◆ YY_STATE_EOF

#define YY_STATE_EOF (   state)    (YY_END_OF_BUFFER + state + 1)

Definition at line 414 of file lex.cc.

◆ YY_STRUCT_YY_BUFFER_STATE

#define YY_STRUCT_YY_BUFFER_STATE

Definition at line 469 of file lex.cc.

◆ yy_switch_to_buffer

#define yy_switch_to_buffer   octave__switch_to_buffer

Definition at line 117 of file lex.cc.

◆ YY_TYPEDEF_YY_BUFFER_STATE

#define YY_TYPEDEF_YY_BUFFER_STATE

Definition at line 437 of file lex.cc.

◆ YY_TYPEDEF_YY_SCANNER_T

#define YY_TYPEDEF_YY_SCANNER_T

Definition at line 387 of file lex.cc.

◆ YY_TYPEDEF_YY_SIZE_T

#define YY_TYPEDEF_YY_SIZE_T

Definition at line 442 of file lex.cc.

◆ YY_USER_ACTION

#define YY_USER_ACTION

Definition at line 1605 of file lex.cc.

◆ yyalloc

#define yyalloc   octave_alloc

Definition at line 273 of file lex.cc.

◆ yycolumn

#define yycolumn   (YY_CURRENT_BUFFER_LVALUE->yy_bs_column)

Definition at line 399 of file lex.cc.

◆ yyconst

#define yyconst   const

Definition at line 369 of file lex.cc.

◆ yyensure_buffer_stack

#define yyensure_buffer_stack   octave_ensure_buffer_stack

Definition at line 135 of file lex.cc.

◆ yyextra

#define yyextra   yyg->yyextra_r

Definition at line 395 of file lex.cc.

◆ yyfree

#define yyfree   octave_free

Definition at line 285 of file lex.cc.

◆ yyget_column

#define yyget_column   octave_get_column

Definition at line 243 of file lex.cc.

◆ yyget_debug

#define yyget_debug   octave_get_debug

Definition at line 171 of file lex.cc.

◆ yyget_extra

#define yyget_extra   octave_get_extra

Definition at line 183 of file lex.cc.

◆ yyget_in

#define yyget_in   octave_get_in

Definition at line 195 of file lex.cc.

◆ yyget_leng

#define yyget_leng   octave_get_leng

Definition at line 219 of file lex.cc.

◆ yyget_lineno

#define yyget_lineno   octave_get_lineno

Definition at line 231 of file lex.cc.

◆ yyget_lval

#define yyget_lval   octave_get_lval

Definition at line 261 of file lex.cc.

◆ yyget_out

#define yyget_out   octave_get_out

Definition at line 207 of file lex.cc.

◆ yyget_text

#define yyget_text   octave_get_text

Definition at line 225 of file lex.cc.

◆ yyin

#define yyin   yyg->yyin_r

Definition at line 393 of file lex.cc.

◆ yyleng

#define yyleng   yyg->yyleng_r

Definition at line 396 of file lex.cc.

◆ yyless [1/2]

#define yyless (   n)
Value:
do \
{ \
/* Undo effects of setting up yytext. */ \
int yyless_macro_arg = (n); \
YY_LESS_LINENO(yyless_macro_arg);\
*yy_cp = yyg->yy_hold_char; \
YY_RESTORE_YY_MORE_OFFSET \
yyg->yy_c_buf_p = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
YY_DO_BEFORE_ACTION; /* set up yytext again */ \
} \
while ( 0 )
#define YY_MORE_ADJ
Definition: lex.cc:1080
octave_idx_type n
Definition: mx-inlines.cc:761

Definition at line 4425 of file lex.cc.

◆ yyless [2/2]

#define yyless (   n)
Value:
do \
{ \
/* Undo effects of setting up yytext. */ \
int yyless_macro_arg = (n); \
YY_LESS_LINENO(yyless_macro_arg);\
yytext[yyleng] = yyg->yy_hold_char; \
yyg->yy_c_buf_p = yytext + yyless_macro_arg; \
yyg->yy_hold_char = *yyg->yy_c_buf_p; \
*yyg->yy_c_buf_p = '\0'; \
yyleng = yyless_macro_arg; \
} \
while ( 0 )

Definition at line 4425 of file lex.cc.

◆ yylex

#define yylex   octave_lex

Definition at line 141 of file lex.cc.

◆ yylex_destroy

#define yylex_destroy   octave_lex_destroy

Definition at line 165 of file lex.cc.

◆ yylex_init

#define yylex_init   octave_lex_init

Definition at line 153 of file lex.cc.

◆ yylex_init_extra

#define yylex_init_extra   octave_lex_init_extra

Definition at line 159 of file lex.cc.

◆ yylineno

#define yylineno   (YY_CURRENT_BUFFER_LVALUE->yy_bs_lineno)

Definition at line 398 of file lex.cc.

◆ yylval

#define yylval   yyg->yylval_r

Definition at line 1436 of file lex.cc.

◆ yymore

#define yymore ( )    yymore_used_but_not_detected

Definition at line 1079 of file lex.cc.

◆ yynoreturn

#define yynoreturn

Definition at line 374 of file lex.cc.

◆ yyout

#define yyout   yyg->yyout_r

Definition at line 394 of file lex.cc.

◆ yypop_buffer_state

#define yypop_buffer_state   octave_pop_buffer_state

Definition at line 129 of file lex.cc.

◆ yypush_buffer_state

#define yypush_buffer_state   octave_push_buffer_state

Definition at line 123 of file lex.cc.

◆ yyrealloc

#define yyrealloc   octave_realloc

Definition at line 279 of file lex.cc.

◆ yyrestart

#define yyrestart   octave_restart

Definition at line 147 of file lex.cc.

◆ yyset_column

#define yyset_column   octave_set_column

Definition at line 249 of file lex.cc.

◆ yyset_debug

#define yyset_debug   octave_set_debug

Definition at line 177 of file lex.cc.

◆ yyset_extra

#define yyset_extra   octave_set_extra

Definition at line 189 of file lex.cc.

◆ yyset_in

#define yyset_in   octave_set_in

Definition at line 201 of file lex.cc.

◆ yyset_lineno

#define yyset_lineno   octave_set_lineno

Definition at line 237 of file lex.cc.

◆ yyset_lval

#define yyset_lval   octave_set_lval

Definition at line 267 of file lex.cc.

◆ yyset_out

#define yyset_out   octave_set_out

Definition at line 213 of file lex.cc.

◆ YYSTATE

#define YYSTATE   YY_START

Definition at line 412 of file lex.cc.

◆ YYSTYPE

#define YYSTYPE   OCTAVE_STYPE

Definition at line 1154 of file lex.cc.

◆ YYTABLES_NAME

#define YYTABLES_NAME   "yytables"

Definition at line 4747 of file lex.cc.

◆ yyterminate

#define yyterminate ( )    return YY_NULL

Definition at line 1573 of file lex.cc.

◆ yytext

#define yytext   yyg->yytext_r

Definition at line 397 of file lex.cc.

◆ yytext_ptr

#define yytext_ptr   yytext_r

Definition at line 597 of file lex.cc.

◆ yywrap

#define yywrap   octave_wrap

Definition at line 255 of file lex.cc.

Typedef Documentation

◆ flex_int16_t

typedef short int flex_int16_t

Definition at line 323 of file lex.cc.

◆ flex_int32_t

typedef int flex_int32_t

Definition at line 324 of file lex.cc.

◆ flex_int8_t

typedef signed char flex_int8_t

Definition at line 322 of file lex.cc.

◆ flex_uint16_t

typedef unsigned short int flex_uint16_t

Definition at line 326 of file lex.cc.

◆ flex_uint32_t

typedef unsigned int flex_uint32_t

Definition at line 327 of file lex.cc.

◆ flex_uint8_t

typedef unsigned char flex_uint8_t

Definition at line 325 of file lex.cc.

◆ YY_BUFFER_STATE

typedef struct yy_buffer_state* YY_BUFFER_STATE

Definition at line 438 of file lex.cc.

◆ YY_CHAR

Definition at line 593 of file lex.cc.

◆ yy_size_t

typedef size_t yy_size_t

Definition at line 443 of file lex.cc.

◆ yy_state_type

typedef int yy_state_type

Definition at line 595 of file lex.cc.

◆ yyscan_t

typedef void* yyscan_t

Definition at line 388 of file lex.cc.

Function Documentation

◆ Fiskeyword()

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.

◆ iskeyword()

◆ octave__create_buffer()

YY_BUFFER_STATE octave__create_buffer ( FILE *  file,
int  size,
yyscan_t  yyscanner 
)

Allocate and initialize an input buffer state.

Parameters
fileA readable stream.
sizeThe character buffer size in bytes. When in doubt, use YY_BUF_SIZE.
yyscannerThe scanner object.
Returns
the allocated buffer state.

Definition at line 4122 of file lex.cc.

References YY_FATAL_ERROR, yy_init_buffer, and yyalloc.

◆ octave__delete_buffer()

void octave__delete_buffer ( YY_BUFFER_STATE  b,
yyscan_t  yyscanner 
)

Destroy the buffer.

Parameters
ba buffer created with yy_create_buffer()
yyscannerThe scanner object.

Definition at line 4150 of file lex.cc.

References YY_CURRENT_BUFFER, YY_CURRENT_BUFFER_LVALUE, yyfree, and yyguts_t.

◆ octave__flush_buffer()

void octave__flush_buffer ( YY_BUFFER_STATE  b,
yyscan_t  yyscanner 
)

Discard all buffered characters.

On the next scan, YY_INPUT will be called.

Parameters
bthe buffer state to be flushed, usually YY_CURRENT_BUFFER.
yyscannerThe 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.

◆ octave__scan_buffer()

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.

Parameters
basethe character buffer
sizethe size in bytes of the character buffer
yyscannerThe scanner object.
Returns
the newly allocated buffer state 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.

◆ octave__scan_bytes()

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.

Parameters
yybytesthe byte buffer to scan
_yybytes_lenthe number of bytes in the buffer pointed to by bytes.
yyscannerThe scanner object.
Returns
the newly allocated buffer state object.

Definition at line 4380 of file lex.cc.

References n, YY_END_OF_BUFFER_CHAR, YY_FATAL_ERROR, yy_scan_buffer, and yyalloc.

◆ octave__scan_string()

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.

Parameters
yystra NUL-terminated string to scan
yyscannerThe scanner object.
Returns
the newly allocated buffer state object.
Note
If you want to scan bytes that may contain NUL values, then use yy_scan_bytes() instead.

Definition at line 4367 of file lex.cc.

References strlen(), and yy_scan_bytes.

◆ octave__switch_to_buffer()

void octave__switch_to_buffer ( YY_BUFFER_STATE  new_buffer,
yyscan_t  yyscanner 
)

Switch to a different input buffer.

Parameters
new_bufferThe new input buffer.
yyscannerThe 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.

◆ octave_alloc()

void * octave_alloc ( yy_size_t  size,
yyscan_t  yyscanner 
)

Definition at line 4758 of file lex.cc.

References malloc().

◆ octave_free()

void octave_free ( void *  ptr,
yyscan_t  yyscanner 
)

Definition at line 4770 of file lex.cc.

References free().

◆ octave_get_column()

int octave_get_column ( yyscan_t  yyscanner)

Get the current column number.

Parameters
yyscannerThe scanner object.

Definition at line 4466 of file lex.cc.

References YY_CURRENT_BUFFER, yycolumn, and yyguts_t.

◆ octave_get_debug()

int octave_get_debug ( yyscan_t  yyscanner)

Definition at line 4571 of file lex.cc.

References yy_flex_debug, and yyguts_t.

◆ octave_get_extra()

octave::base_lexer * octave_get_extra ( yyscan_t  yyscanner)

Get the user-defined data for this scanner.

Parameters
yyscannerThe scanner object.

Definition at line 4444 of file lex.cc.

References yyextra, and yyguts_t.

◆ octave_get_in()

FILE * octave_get_in ( yyscan_t  yyscanner)

Get the input stream.

Parameters
yyscannerThe scanner object.

Definition at line 4479 of file lex.cc.

References yyguts_t, and yyin.

◆ octave_get_leng()

int octave_get_leng ( yyscan_t  yyscanner)

Get the length of the current token.

Parameters
yyscannerThe scanner object.

Definition at line 4497 of file lex.cc.

References yyguts_t, and yyleng.

◆ octave_get_lineno()

int octave_get_lineno ( yyscan_t  yyscanner)

Get the current line number.

Parameters
yyscannerThe scanner object.

Definition at line 4453 of file lex.cc.

References YY_CURRENT_BUFFER, yyguts_t, and yylineno.

◆ octave_get_lval()

OCTAVE_STYPE * octave_get_lval ( yyscan_t  yyscanner)

Definition at line 4585 of file lex.cc.

References yyguts_t, and yylval.

◆ octave_get_out()

FILE * octave_get_out ( yyscan_t  yyscanner)

Get the output stream.

Parameters
yyscannerThe scanner object.

Definition at line 4488 of file lex.cc.

References yyguts_t, and yyout.

◆ octave_get_text()

char * octave_get_text ( yyscan_t  yyscanner)

Get the current token.

Parameters
yyscannerThe scanner object.

Definition at line 4507 of file lex.cc.

References yyguts_t, and yytext.

◆ octave_lex()

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.

◆ octave_lex_destroy()

int octave_lex_destroy ( yyscan_t  yyscanner)

◆ octave_lex_init()

int octave_lex_init ( yyscan_t scanner)

Definition at line 4603 of file lex.cc.

References yyalloc, and yyguts_t.

◆ octave_lex_init_extra()

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.

◆ octave_pop_buffer_state()

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.

Parameters
yyscannerThe 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.

◆ octave_push_buffer_state()

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.

Parameters
new_bufferThe new state.
yyscannerThe 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.

◆ octave_realloc()

void * octave_realloc ( void *  ptr,
yy_size_t  size,
yyscan_t  yyscanner 
)

Definition at line 4764 of file lex.cc.

◆ octave_restart()

void octave_restart ( FILE *  input_file,
yyscan_t  yyscanner 
)

Immediately switch to a different input stream.

Parameters
input_fileA readable stream.
yyscannerThe scanner object.
Note
This function does not reset the start condition to 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.

◆ octave_set_column()

void octave_set_column ( int  _column_no,
yyscan_t  yyscanner 
)

Set the current column.

Parameters
_column_nocolumn number
yyscannerThe scanner object.

Definition at line 4542 of file lex.cc.

References YY_CURRENT_BUFFER, YY_FATAL_ERROR, yycolumn, and yyguts_t.

◆ octave_set_debug()

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.

◆ octave_set_extra()

void octave_set_extra ( octave::base_lexer *  user_defined,
yyscan_t  yyscanner 
)

Set the user-defined data.

This data is never touched by the scanner.

Parameters
user_definedThe data to be associated with this scanner.
yyscannerThe scanner object.

Definition at line 4517 of file lex.cc.

References yyextra, and yyguts_t.

◆ octave_set_in()

void octave_set_in ( FILE *  _in_str,
yyscan_t  yyscanner 
)

Set the input stream.

This does not discard the current input buffer.

Parameters
_in_strA readable stream.
yyscannerThe scanner object.
See also
yy_switch_to_buffer

Definition at line 4559 of file lex.cc.

References yyguts_t, and yyin.

◆ octave_set_lineno()

void octave_set_lineno ( int  _line_number,
yyscan_t  yyscanner 
)

Set the current line number.

Parameters
_line_numberline number
yyscannerThe scanner object.

Definition at line 4527 of file lex.cc.

References YY_CURRENT_BUFFER, YY_FATAL_ERROR, yyguts_t, and yylineno.

◆ octave_set_lval()

void octave_set_lval ( OCTAVE_STYPE yylval_param,
yyscan_t  yyscanner 
)

Definition at line 4591 of file lex.cc.

References yyguts_t, and yylval.

◆ octave_set_out()

void octave_set_out ( FILE *  _out_str,
yyscan_t  yyscanner 
)

Definition at line 4565 of file lex.cc.

References yyguts_t, and yyout.