Gromacs  2024.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Functions
#include <exception>
#include <string>
#include "parser.h"
+ Include dependency graph for scanner.h:
+ This graph shows which files directly or indirectly include this file:

Description

Parser/scanner interaction functions.

This is an implementation header: there should be no need to use it outside this directory.

Author
Teemu Murtola teemu.nosp@m..mur.nosp@m.tola@.nosp@m.gmai.nosp@m.l.com

Functions

void _gmx_sel_init_lexer (yyscan_t *scannerp, struct gmx_ana_selcollection_t *sc, gmx::TextWriter *statusWriter, int maxnr, bool bGroups, struct gmx_ana_indexgrps_t *grps)
 Initializes the selection scanner. More...
 
void _gmx_sel_free_lexer (yyscan_t scanner)
 Frees memory allocated for the selection scanner. More...
 
void _gmx_sel_lexer_set_exception (yyscan_t scanner, const std::exception_ptr &ex)
 Stores an exception that is caught during parsing. More...
 
void _gmx_sel_lexer_rethrow_exception_if_occurred (yyscan_t scanner)
 Rethrows and clears the stored exception if one is present. More...
 
gmx::TextWriter_gmx_sel_lexer_get_status_writer (yyscan_t scanner)
 Returns writer for status output (if not NULL, the scanner is interactive). More...
 
struct gmx_ana_selcollection_t_gmx_sel_lexer_selcollection (yyscan_t scanner)
 Returns the selection collection for the scanner. More...
 
bool _gmx_sel_lexer_has_groups_set (yyscan_t scanner)
 Returns true if the external index groups for the scanner are set. More...
 
struct gmx_ana_indexgrps_t_gmx_sel_lexer_indexgrps (yyscan_t scanner)
 Returns the external index groups for the scanner. More...
 
int _gmx_sel_lexer_exp_selcount (yyscan_t scanner)
 Returns the number of selections after which the parser should stop. More...
 
const char * _gmx_sel_lexer_pselstr (yyscan_t scanner)
 Returns a pretty string of the current selection. More...
 
void _gmx_sel_lexer_set_current_location (yyscan_t scanner, const gmx::SelectionLocation &location)
 Sets the current parser context location. More...
 
const gmx::SelectionLocation_gmx_sel_lexer_get_current_location (yyscan_t scanner)
 Returns the current parser context location. More...
 
std::string _gmx_sel_lexer_get_current_text (yyscan_t scanner)
 Returns the selection text for the current parser context. More...
 
std::string _gmx_sel_lexer_get_text (yyscan_t scanner, const gmx::SelectionLocation &location)
 Returns the selection text at the given location.
 
void _gmx_sel_lexer_clear_pselstr (yyscan_t scanner)
 Clears the current selection string. More...
 
void _gmx_sel_lexer_clear_method_stack (yyscan_t scanner)
 Clears the method stack in the scanner in error situations. More...
 
void _gmx_sel_finish_method (yyscan_t scanner)
 Notifies the scanner that a complete method expression has been parsed. More...
 
void _gmx_sel_set_lex_input_file (yyscan_t scanner, FILE *fp)
 Initializes the scanner to scan a file. More...
 
void _gmx_sel_set_lex_input_str (yyscan_t scanner, const char *str)
 Initializes the scanner to scan a string. More...
 

Function Documentation

void _gmx_sel_finish_method ( yyscan_t  scanner)

Notifies the scanner that a complete method expression has been parsed.

void _gmx_sel_free_lexer ( yyscan_t  scanner)

Frees memory allocated for the selection scanner.

void _gmx_sel_init_lexer ( yyscan_t *  scannerp,
struct gmx_ana_selcollection_t sc,
gmx::TextWriter statusWriter,
int  maxnr,
bool  bGroups,
struct gmx_ana_indexgrps_t grps 
)

Initializes the selection scanner.

void _gmx_sel_lexer_clear_method_stack ( yyscan_t  scanner)

Clears the method stack in the scanner in error situations.

void _gmx_sel_lexer_clear_pselstr ( yyscan_t  scanner)

Clears the current selection string.

int _gmx_sel_lexer_exp_selcount ( yyscan_t  scanner)

Returns the number of selections after which the parser should stop.

const gmx::SelectionLocation& _gmx_sel_lexer_get_current_location ( yyscan_t  scanner)

Returns the current parser context location.

This returns the location last set with _gmx_sel_lexer_set_current_location().

std::string _gmx_sel_lexer_get_current_text ( yyscan_t  scanner)

Returns the selection text for the current parser context.

This returns the selection text that corresponds to the position set last with _gmx_sel_lexer_set_current_location().

gmx::TextWriter* _gmx_sel_lexer_get_status_writer ( yyscan_t  scanner)

Returns writer for status output (if not NULL, the scanner is interactive).

bool _gmx_sel_lexer_has_groups_set ( yyscan_t  scanner)

Returns true if the external index groups for the scanner are set.

struct gmx_ana_indexgrps_t* _gmx_sel_lexer_indexgrps ( yyscan_t  scanner)

Returns the external index groups for the scanner.

const char* _gmx_sel_lexer_pselstr ( yyscan_t  scanner)

Returns a pretty string of the current selection.

void _gmx_sel_lexer_rethrow_exception_if_occurred ( yyscan_t  scanner)

Rethrows and clears the stored exception if one is present.

struct gmx_ana_selcollection_t* _gmx_sel_lexer_selcollection ( yyscan_t  scanner)

Returns the selection collection for the scanner.

void _gmx_sel_lexer_set_current_location ( yyscan_t  scanner,
const gmx::SelectionLocation location 
)

Sets the current parser context location.

This location is set while Bison reductions are being processed, and identifies the location of the current rule/reduction.

void _gmx_sel_lexer_set_exception ( yyscan_t  scanner,
const std::exception_ptr &  ex 
)

Stores an exception that is caught during parsing.

void _gmx_sel_set_lex_input_file ( yyscan_t  scanner,
FILE *  fp 
)

Initializes the scanner to scan a file.

void _gmx_sel_set_lex_input_str ( yyscan_t  scanner,
const char *  str 
)

Initializes the scanner to scan a string.