WONKY



LOG | FILES | OVERVIEW


#ifndef WONKY_SOURCE_FILE_H
#define WONKY_SOURCE_FILE_H WONKY_SOURCE_FILE_H
#include <source_file.hh>

#include <stdio.h>
#include <automata.h>
#include <gcc_string.h>
#include <translation_unit.h>
#include <gcc_error.h>

struct Source_Name
{
	char *name;
	size_t name_size;
};
struct Source_Location
{
	size_t line;
	size_t column;
	size_t starting_byte_index;
	size_t length;
	struct Source_File *src;
};
struct Source_Location_Delta
{
	size_t line_offset;
	size_t column; /*this is a copy from end_location*/
	struct Source_Location *location;
};
struct Source_File
{
	enum Source_Text_Type type;
	struct Source_Name *src_name;
	char *src;
	size_t src_size;
};


extern struct Source_Location start_of_file;




struct Source_File* get_source_file_from_string(char *filename,size_t filename_size,struct Program *program);
struct Source_File* get_temp_source_file();
struct Source_Location* get_source_location(size_t line,size_t column,size_t on_which_byte,size_t length,struct Source_File *src);
struct Source_Location_Delta* get_source_location_delta(struct Source_Location *begining,struct Source_Location *ending);

void source_file_expand(struct Source_File *src,size_t expand_byte_count);

struct Source_Name* get_source_name(char *constructed_name);
void delete_source_file(struct Source_File *src);


#endif