40#ifndef H_GEOGRAM_MESH_MESH_CSG_COMPILER_H
41#define H_GEOGRAM_MESH_MESH_CSG_COMPILER_H
44#include <geogram/mesh/mesh_CSG_builder.h>
65 std::shared_ptr<Mesh> compile_file(
66 const std::filesystem::path& input_filename
68 std::shared_ptr<Mesh> compile_string(
const std::string& source);
76 builder_->set_verbose(x);
85 builder_->set_detailed_verbose(x);
108 void parse_instruction_or_object();
110 void parse_instruction();
111 ArgList parse_arg_list();
114 bool is_object(
const std::string&
id)
const;
115 bool is_instruction(
const std::string&
id)
const;
132 std::string to_string()
const;
193 void compute_lines()
const;
196 std::filesystem::path filename_;
198 Token lookahead_token_;
200 std::shared_ptr<CSGBuilder> builder_;
203 mutable const char* line_ptr_;
A parsed argument list in a .csg file.
Implements CSG objects and instructions.
Creates meshes from OpenSCAD .csg files.
void syntax_error(const char *msg, const Token &tok)
Throws an exception with an error message.
Token next_token_internal()
Function to actually get the next token from the stream.
bool is_modifier(int toktype) const
Checks if a token corresponds to an instruction or object modifier.
const CSGBuilder & builder() const
Gets the CSGbuilder.
void next_token_check(char c)
Checks that the next token is a given character.
int line() const
Gets the currently parsed line source.
void set_detailed_verbose(bool x)
Displays (even more) additional information.
Token lookahead_token()
Gets the next token without any side effect.
void set_verbose(bool x)
Displays (lots of) additional information.
CSGBuilder & builder()
Gets the CSGbuilder.
void syntax_error(const char *msg)
Throws an exception with an error message.
Token next_token()
Gets the next token.
int lines() const
Gets the total number of lines of the currently parsed source.
Tracks the progress of a task.
Common include file, providing basic definitions. Should be included before anything else by all head...
Global Vorpaline namespace.
geo_index_t index_t
The type for storing and manipulating indices.
A parsed value in a .csg file.