FAUST compiler  0.9.9.6b8
Public Member Functions | Private Attributes | List of all members
myparser Class Reference

A minimalistic parser used to recognize '#include <faust/...>' patterns when copying architecture files. More...

Public Member Functions

 myparser (const string &s)
 
bool skip ()
 
bool parse (const string &s)
 
bool filename (string &fname)
 

Private Attributes

string str
 
size_t N
 
size_t p
 

Detailed Description

A minimalistic parser used to recognize '#include <faust/...>' patterns when copying architecture files.

Definition at line 121 of file enrobage.cpp.

Constructor & Destructor Documentation

myparser::myparser ( const string &  s)
inline

Definition at line 127 of file enrobage.cpp.

127 : str(s), N(s.length()), p(0) {}
size_t p
Definition: enrobage.cpp:125
size_t N
Definition: enrobage.cpp:124
string str
Definition: enrobage.cpp:123

Member Function Documentation

bool myparser::filename ( string &  fname)
inline

Definition at line 130 of file enrobage.cpp.

References N, p, and str.

Referenced by isFaustInclude().

130  {
131  size_t saved = p;
132  if (p<N) {
133  char c = str[p++];
134  if (c== '<' | c=='"') {
135  fname = "";
136  while ( p<N && (str[p] != '>') && (str[p] != '"')) fname += str[p++];
137  p++;
138  return true;
139  }
140  }
141  p = saved;
142  return false;
143  }
size_t p
Definition: enrobage.cpp:125
size_t N
Definition: enrobage.cpp:124
string str
Definition: enrobage.cpp:123

Here is the caller graph for this function:

bool myparser::parse ( const string &  s)
inline

Definition at line 129 of file enrobage.cpp.

References p, and str.

Referenced by isFaustInclude().

129 { bool f; if ((f = (p == str.find(s, p)))) p += s.length(); return f; }
size_t p
Definition: enrobage.cpp:125
string str
Definition: enrobage.cpp:123

Here is the caller graph for this function:

bool myparser::skip ( )
inline

Definition at line 128 of file enrobage.cpp.

References N, p, and str.

Referenced by isFaustInclude().

128 { while ( p<N && isspace(str[p]) ) p++; return true; }
size_t p
Definition: enrobage.cpp:125
size_t N
Definition: enrobage.cpp:124
string str
Definition: enrobage.cpp:123

Here is the caller graph for this function:

Member Data Documentation

size_t myparser::N
private

Definition at line 124 of file enrobage.cpp.

Referenced by filename(), and skip().

size_t myparser::p
private

Definition at line 125 of file enrobage.cpp.

Referenced by filename(), parse(), and skip().

string myparser::str
private

Definition at line 123 of file enrobage.cpp.

Referenced by filename(), parse(), and skip().


The documentation for this class was generated from the following file: