1
votes

This is my lexer.hpp file:

/**
 * \file
 * \brief Lexical analysis
 * \author Igor Zashchelkin
 *
 * Lexical analysis API for MyLisp.
 */

#ifndef LEXER_H
#define LEXER_H

#include <string>
#include <vector>

/**
 * \brief Used to link token (Token) with it's type.
 * \date June 29, 2018
 *
 * TokenNumber     - 12, 5.4, -200
 * TokenString     - "hello, world"
 * TokenBoolean    - true, false
 * TokenIdentifier - function name, variable name
 * TokenSeparator  - ( ) ,
 */

enum TokenType {
     TokenNumber /// \brief Tokens which store numeric data
    ,TokenString /// \brief Tokens which store symbolic data, that ends and starts at "
    ,TokenBoolean /// \brief Tokens which store only one state 1 or 0
    ,TokenIdentifier /// \brief Tokens which link to something (variable, function)
    ,TokenSeparator /// \brief Tokens which splits logical parts of code
};

/**
 * \brief Token's value type
 * \date June 29, 2018
 *
 * Simply, wrap of std::string
 */

typedef std::string TokenValue;

/**
 * \brief Minimal part of lexical analysis
 * \date June 29, 2018
 *
 * Structured pair of TokenType and TokenValue (aka std::string)
 */

class Token {
private:
    const TokenType type; /// \brief Token's type
    const TokenValue value; /// \brief Token's value
public:
    Token(TokenType type, std::string value); /// \brief Constructor

    const TokenType getType(); /// /brief Getter for type property
    const TokenValue getValue(); /// \brief Getter for value property
};

/**
 * \brief Lexical analysis API instance
 * \date June 29, 2018
 */

class Lexer {
private:
    std::string code; /// \brief Source code
public:
    Lexer(std::string code); /// \brief Constructor

    /**
     * \brief Tokenize source code
     * \date June 29, 2018
     *
     * Generate sequence of tokens (std::vector) from code property (std::string)
     */

    std::vector tokenize();
};

#endif //LEXER_H

Everything is OK (that's my mind), but when I run

doxygen src/lexer/lexer.hpp
Doxygen generates empty documentation. What's wrong?
1
Which version of doxygen?albert
doxygen -v 1.8.13Igor Zashchelkin
For this problem doesn't make a difference with the current (1.8.14) version.albert
Unrelated, but you might want to change std::vector in std::vector<std::string> in the tokenize functionKostas

1 Answers

0
votes

You should have a doxygen configuration file (Doxyfile), a default version can be generated with doxygen -g. In the Doxyfile you can set the required options. You can then start doxygen with just doxygen of doxygen Doxyfile.

Even with the setup used by OP I get the documentation (and a lot of warning messages like: "warning: ignoring unknown tag `file' at line 2, file lexer.hpp", indicating that something is not correct).

See also the doxygen documentation.