User Guide
tokens.cpp File Reference
#include <string>
#include <catch2/catch_test_macros.hpp>
#include "lexer/modtoken.hpp"
#include "lexer/nmodl_lexer.hpp"
#include "parser/nmodl_driver.hpp"

Go to the source code of this file.

Typedefs

using Token = NmodlParser::token
 
using TokenType = NmodlParser::token_type
 
using SymbolType = NmodlParser::symbol_type
 

Functions

bool check_token_type (const std::string &name, TokenType type)
 retrieve token type from lexer and check if it's of given type More...
 
 TEST_CASE ("NMODL Lexer returning valid token types", "[Lexer]")
 

Typedef Documentation

◆ SymbolType

Definition at line 23 of file tokens.cpp.

◆ Token

using Token = NmodlParser::token

Definition at line 21 of file tokens.cpp.

◆ TokenType

using TokenType = NmodlParser::token_type

Definition at line 22 of file tokens.cpp.

Function Documentation

◆ check_token_type()

bool check_token_type ( const std::string &  name,
TokenType  type 
)

retrieve token type from lexer and check if it's of given type

Lexer returns raw pointers for some AST types and we need to clean-up memory for those. Todo: add tests later for checking values

Definition at line 27 of file tokens.cpp.

◆ TEST_CASE()

TEST_CASE ( "NMODL Lexer returning valid token types"  ,
""  [Lexer] 
)

Definition at line 93 of file tokens.cpp.