RodrigoDornelles / 3bc-lang

Low-level language, tiny virtual machine, minimal runtime, intermediate representation, embeddable, easy for beginners. (Friendly Punched cards)
https://3bc-lang.org
GNU General Public License v3.0
239 stars 26 forks source link

add code generated documentation #339

Open RodrigoDornelles opened 2 years ago

RodrigoDornelles commented 2 years ago

it is important to document all state machines, diagrams and dependencies in the source code, for better maintenance. there are tools that transform comments into pages of documentation, It is preferable to use sphinx instead of doxygen because of its license and search engine.

RodrigoDornelles commented 1 year ago
/**
 * @internal
 *  ___________  _____   _
 * |____ | ___ \/  __ \ | |
 *     / / |_/ /| /  \/ | | __ _ _ __   __ _ _   _  __ _  __ _  ___
 *     \ \ ___ \| |     | |/ _` | '_ \ / _` | | | |/ _` |/ _` |/ _ \
 * .___/ / |_/ /| \__/\ | | (_| | | | | (_| | |_| | (_| | (_| |  __/
 * \____/\____/  \____/ |_|\__,_|_| |_|\__, |\__,_|\__,_|\__, |\___|
 *                                     __/ |             __/ |
 *                                    |___/             |___/
 * @endinternal
 * @file driver_interrupt.c
 *
 * @brief
 * Code refers to the managing contexts and interrupt's of the virtual machine.
 *
 * @copyright
 * Low-level language, tiny virtual machine, intermediate representation,     \n
 * embeddable, easy for beginners. (Friendly Punched cards)                   \n
 *                                                                            \n
 * Copyright (C) 2020 Rodrigo Dornelles.                                      \n
 *                                                                            \n
 * This program is free software: you can redistribute it and/or modify       \n
 * it under the terms of the GNU General Public License as published by       \n
 * the Free Software Foundation, either version 3 of the License,             \n
 * or any later version.                                                      \n
 *                                                                            \n
 * This program is distributed in the hope that it will be useful,            \n
 * but WITHOUT ANY WARRANTY; without even the implied warranty of             \n
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the              \n
 * GNU General Public License for more details.                               \n
 *                                                                            \n
 * You should have received a copy of the GNU General Public License          \n
 * along with this program.  If not, see <https://www.gnu.org/licenses/>. 
 *
 * @par Joke
 * @code{.unparsed}
 * _\|/_ weedend alert! _\|/_
 * this code was written in a 4:20 mode.
 * @endcode
 */

DOXYFILE_ENCODING      = UTF-8
PROJECT_NAME           = "3BC Lang"
PROJECT_NUMBER         = 0.1.4
PROJECT_BRIEF          = "3BC Language Virtual Machine is a low-level and easy-to-learn programming language."
PROJECT_LOGO           = 
OUTPUT_DIRECTORY       = .
RECURSIVE              = YES
CREATE_SUBDIRS         = NO
EXTRACT_ALL            = YES
OUTPUT_LANGUAGE        = English
INPUT                  = README.md src
USE_MDFILE_AS_MAINPAGE = README.md
RodrigoDornelles commented 10 months ago
@startuml
rectangle hypervisor as "3BC hypervisor <i>(optional)</i>" {
 component manager
}
rectangle compiler as "3BC Compiler <i>(optional)</i>" {
 component repl
 component cli
}
rectangle runtime as "3BC Runtime" {

 json bus {
  "stack": ["heap", "pc", "sp"],
  "cpu": ["rx", "ry", "rz", "rm", "ra"],
  "layout": ["cpu", "sys", "mem"]
 }

 component sys as "Host System Drivers"
 component driver as "Guest Drivers"
 component cpu as "Virtual CPU"

 cpu <-> bus
 driver <-left-> bus
 sys <-> bus
}

bus <-left-> compiler
bus <-left-> hypervisor
compiler -down[hidden]- hypervisor
driver -up[hidden]- cpu
driver -down[hidden]- sys
@enduml
RodrigoDornelles commented 10 months ago

self->id self->vm.rc self->vm.state self->vm.hyperload self->cpu.rx self->stack.st self->cache.l1

RodrigoDornelles commented 9 months ago
    /** 
    * @htmlonly
    * <h3><b style="color: red">Error code:</b>&nbsp; 1</h3>
    * @endhtmlonly
    * @par Description
    * CPU MODE IS NOT DEFINED
    * @par How to solve
    * Erroneous code example:
    *
    * @code{.sql}
    * STRI NILL 5
    * @endcode
    *
    * You need to set a CPU mode to use any register
    *
    * @code{.sql}
    * MODE NILL 2
    * STRI NILL '5'
    * @endcode
    *
    */