<commit_before>//////////////////////////////////////////////////////////////////////
// comp.hpp -- Compile Routines
// Date: Fri Nov 29 20:31:11 2013   (C) datablocks.net
///////////////////////////////////////////////////////////////////////

#ifndef COMP_HPP
#define COMP_HPP

#include <fstream>

unsigned lex_lineno();
int lex_token();
void register_builtin(const std::string& type);
void register_type(int symid);
void lexer_reset();
const std::string& lex_revsym(int symid);

bool gcc_open(std::fstream& fs,int genset,const std::string& suffix=".c");
bool lex_open(int genset,const std::string& suffix);

bool gcc_compile(std::fstream& fs,int genset);
bool gcc_precompile(std::fstream& fs,int genset,const std::string& variation="");
bool gcc_precomplex(int genset,const std::string& variation="");

extern int yyparse();

#endif // COMP_HPP

// End comp.hpp<commit_msg>Imported s_node + reset parser with parser_reset()<commit_after>//////////////////////////////////////////////////////////////////////
// comp.hpp -- Compile Routines
// Date: Fri Nov 29 20:31:11 2013   (C) datablocks.net
///////////////////////////////////////////////////////////////////////

#ifndef COMP_HPP
#define COMP_HPP

#include <fstream>
#include <vector>

enum e_ntype {
	None = 0,
	Ident,		// Identifier
	Typedef,	// Typedef
	Type,		// Type name
	Struct,		// struct
	Union,		// union
	List		// List
};

struct s_node {
	e_ntype		type;		// Node type
	int		symbol;		// Symbol ref
	unsigned	ptr;		// Pointer levels

	std::vector<int> list;		// List 

	int		next;		// Next node in chain

	s_node() { 
		type = None;
		symbol = 0;
		next = 0;
	}
};

unsigned lex_lineno();
int lex_token();
void register_builtin(const std::string& type);
void register_type(int symid);
void lexer_reset();
const std::string& lex_revsym(int symid);

void parser_reset();
s_node& Get(int nno);

bool gcc_open(std::fstream& fs,int genset,const std::string& suffix=".c");
bool lex_open(int genset,const std::string& suffix);

bool gcc_compile(std::fstream& fs,int genset);
bool gcc_precompile(std::fstream& fs,int genset,const std::string& variation="");
bool gcc_precomplex(int genset,const std::string& variation="");

extern int yyparse();

#endif // COMP_HPP

// End comp.hpp
{'fraction_non_alphanumeric': 0.25100312082032994, 'fraction_numerical': 0.012037449843958983, 'mean_word_length': 2.6135265700483092, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '269242', 'n_tokens_mistral': 784, 'n_tokens_neox': 723, 'n_words': 194}