src/antlr3filestream.c - Online Linux Manual PageSection : 3
Updated : Tue Jan 26 2021
Source : Version 3.3.1
Note : ANTLR3C
NAMEsrc/antlr3filestream.c − The ANTLR3 C filestream is used when the source character stream is a filesystem based input set and all the characters in the filestream can be loaded at once into memory and away the lexer goes.
SYNOPSIS
#include <antlr3.h>
Functionsstatic pANTLR3_INPUT_STREAM antlr3CreateFileStream (pANTLR3_UINT8 fileName)
Use the contents of an operating system file as the input for an input stream. static pANTLR3_INPUT_STREAM antlr3CreateStringStream (pANTLR3_UINT8 data)
Use the supplied 'string' as input to the stream. ANTLR3_API void antlr3Fclose (ANTLR3_FDSC fd)
Close an operating system file and free any handles etc. ANTLR3_API pANTLR3_INPUT_STREAM antlr3FileStreamNew (pANTLR3_UINT8 fileName, ANTLR3_UINT32 encoding)
ANTLR3_API ANTLR3_FDSC antlr3Fopen (pANTLR3_UINT8 filename, const char *mode)
Open an operating system file and return the descriptor We just use the common open() and related functions here. ANTLR3_API ANTLR3_UINT32 antlr3Fread (ANTLR3_FDSC fdsc, ANTLR3_UINT32 count, void *data)
ANTLR3_API ANTLR3_UINT32 antlr3Fsize (pANTLR3_UINT8 fileName)
ANTLR3_API ANTLR3_UINT32 antlr3read8Bit (pANTLR3_INPUT_STREAM input, pANTLR3_UINT8 fileName)
ANTLR3_API pANTLR3_INPUT_STREAM antlr3StringStreamNew (pANTLR3_UINT8 data, ANTLR3_UINT32 encoding, ANTLR3_UINT32 size, pANTLR3_UINT8 name)
static void setupInputStream (pANTLR3_INPUT_STREAM input)
Determine endianess of the input stream and install the API required for the encoding in that format.
Detailed DescriptionThe ANTLR3 C filestream is used when the source character stream is a filesystem based input set and all the characters in the filestream can be loaded at once into memory and away the lexer goes. A number of initializers are provided in order that various character sets can be supported from input files. The ANTLR3 C runtime expects to deal with UTF32 characters only (the reasons for this are to do with the simplification of C code when using this form of Unicode encoding, though this is not a panacea. More information can be found on this by consulting: • http://www.unicode.org/versions/Unicode4.0.0/ch02.pdf#G11178 Where a well grounded discussion of the encoding formats available may be found.
Function Documentation
static pANTLR3_INPUT_STREAM antlr3CreateFileStream (pANTLR3_UINT8 fileName) [static]Use the contents of an operating system file as the input for an input stream. Parameters fileName Name of operating system file to read. Returns • Pointer to new input stream context upon success • One of the ANTLR3_ERR_ defines on error. References ANTLR3_CALLOC, ANTLR3_SUCCESS, antlr3GenericSetupStream(), antlr3read8Bit(), and ANTLR3_INPUT_STREAM_struct::close. Referenced by antlr3FileStreamNew().
static pANTLR3_INPUT_STREAM antlr3CreateStringStream (pANTLR3_UINT8 data) [static]Use the supplied 'string' as input to the stream. Parameters data Pointer to the input data Returns • Pointer to new input stream context upon success • NULL defines on error. References ANTLR3_CALLOC, ANTLR3_FALSE, antlr3GenericSetupStream(), ANTLR3_INPUT_STREAM_struct::data, and ANTLR3_INPUT_STREAM_struct::isAllocated. Referenced by antlr3StringStreamNew().
ANTLR3_API void antlr3Fclose (ANTLR3_FDSC fd)Close an operating system file and free any handles etc. Referenced by antlr3read8Bit().
ANTLR3_API pANTLR3_INPUT_STREAM antlr3FileStreamNew (pANTLR3_UINT8 fileName, ANTLR3_UINT32 encoding)References antlr3CreateFileStream(), ANTLR3_INPUT_STREAM_struct::encoding, ANTLR3_INPUT_STREAM_struct::fileName, ANTLR3_INPUT_STREAM_struct::istream, ANTLR3_STRING_FACTORY_struct::newStr8, setupInputStream(), ANTLR3_INT_STREAM_struct::streamName, and ANTLR3_INPUT_STREAM_struct::strFactory.
ANTLR3_API ANTLR3_FDSC antlr3Fopen (pANTLR3_UINT8 filename, const char * mode)Open an operating system file and return the descriptor We just use the common open() and related functions here. Later we might find better ways on systems such as Windows and OpenVMS for instance. But the idea is to read the while file at once anyway, so it may be irrelevant. Referenced by antlr3read8Bit().
ANTLR3_API ANTLR3_UINT32 antlr3Fread (ANTLR3_FDSC fdsc, ANTLR3_UINT32 count, void * data)Referenced by antlr3read8Bit().
ANTLR3_API ANTLR3_UINT32 antlr3Fsize (pANTLR3_UINT8 fileName)References _stat. Referenced by antlr3read8Bit().
ANTLR3_API ANTLR3_UINT32 antlr3read8Bit (pANTLR3_INPUT_STREAM input, pANTLR3_UINT8 fileName)References ANTLR3_ERR_NOFILE, ANTLR3_ERR_NOMEM, ANTLR3_MALLOC, ANTLR3_SUCCESS, ANTLR3_TRUE, antlr3Fclose(), antlr3Fopen(), antlr3Fread(), antlr3Fsize(), ANTLR3_INPUT_STREAM_struct::data, ANTLR3_INPUT_STREAM_struct::isAllocated, and ANTLR3_INPUT_STREAM_struct::sizeBuf. Referenced by antlr3CreateFileStream().
ANTLR3_API pANTLR3_INPUT_STREAM antlr3StringStreamNew (pANTLR3_UINT8 data, ANTLR3_UINT32 encoding, ANTLR3_UINT32 size, pANTLR3_UINT8 name)References antlr3CreateStringStream(), ANTLR3_INPUT_STREAM_struct::encoding, ANTLR3_INPUT_STREAM_struct::fileName, ANTLR3_INPUT_STREAM_struct::istream, ANTLR3_STRING_FACTORY_struct::newStr8, setupInputStream(), size(), ANTLR3_INPUT_STREAM_struct::sizeBuf, ANTLR3_INT_STREAM_struct::streamName, and ANTLR3_INPUT_STREAM_struct::strFactory.
static void setupInputStream (pANTLR3_INPUT_STREAM input) [static]Determine endianess of the input stream and install the API required for the encoding in that format. References antlr38BitSetupStream(), ANTLR3_ENC_8BIT, ANTLR3_ENC_EBCDIC, ANTLR3_ENC_UTF16, ANTLR3_ENC_UTF16BE, ANTLR3_ENC_UTF16LE, ANTLR3_ENC_UTF32, ANTLR3_ENC_UTF32BE, ANTLR3_ENC_UTF32LE, ANTLR3_ENC_UTF8, ANTLR3_FALSE, ANTLR3_TRUE, antlr3EBCDICSetupStream(), antlr3UTF16SetupStream(), antlr3UTF32SetupStream(), antlr3UTF8SetupStream(), ANTLR3_INPUT_STREAM_struct::encoding, and ANTLR3_INPUT_STREAM_struct::nextChar. Referenced by antlr3FileStreamNew(), and antlr3StringStreamNew().
AuthorGenerated automatically by Doxygen for ANTLR3C from the source code. 0
Johanes Gumabo
Data Size : 27,566 byte
man-antlr3-setupInputStream.3Build : 2024-12-05, 20:55 :
Visitor Screen : x
Visitor Counter ( page / site ) : 5 / 228,415
Visitor ID : :
Visitor IP : 3.22.217.176 :
Visitor Provider : AMAZON-02 :
Provider Position ( lat x lon ) : 39.962500 x -83.006100 : x
Provider Accuracy Radius ( km ) : 1000 :
Provider City : Columbus :
Provider Province : Ohio , : ,
Provider Country : United States :
Provider Continent : North America :
Visitor Recorder : Version :
Visitor Recorder : Library :
Online Linux Manual Page : Version : Online Linux Manual Page - Fedora.40 - march=x86-64 - mtune=generic - 24.12.05
Online Linux Manual Page : Library : lib_c - 24.10.03 - march=x86-64 - mtune=generic - Fedora.40
Online Linux Manual Page : Library : lib_m - 24.10.03 - march=x86-64 - mtune=generic - Fedora.40
Data Base : Version : Online Linux Manual Page Database - 24.04.13 - march=x86-64 - mtune=generic - fedora-38
Data Base : Library : lib_c - 23.02.07 - march=x86-64 - mtune=generic - fedora.36
Very long time ago, I have the best tutor, Wenzel Svojanovsky . If someone knows the email address of Wenzel Svojanovsky , please send an email to johanes_gumabo@yahoo.co.id .
If error, please print screen and send to johanes_gumabo@yahoo.co.id
Under development. Support me via PayPal.