KiCad PCB EDA Suite
specctra_lexer.h
Go to the documentation of this file.
1 
2 /* Do not modify this file it was automatically generated by the
3  * TokenList2DsnLexer CMake script.
4  */
5 
6 #ifndef SPECCTRA_LEXER_H_
7 #define SPECCTRA_LEXER_H_
8 
9 #include <dsnlexer.h>
10 
23 namespace DSN
24 {
26  enum T
27  {
28  // these first few are negative special ones for syntax, and are
29  // inherited from DSNLEXER.
37  T_RIGHT = DSN_RIGHT, // right bracket: ')'
38  T_LEFT = DSN_LEFT, // left bracket: '('
39  T_STRING = DSN_STRING, // a quoted string, stripped of the quotes
40  T_EOF = DSN_EOF, // special case for end of file
41 
429  };
430 } // namespace DSN
431 
432 
439 class SPECCTRA_LEXER : public DSNLEXER
440 {
442  static const KEYWORD keywords[];
443  static const unsigned keyword_count;
444 
445 public:
452  SPECCTRA_LEXER( const std::string& aSExpression, const wxString& aSource = wxEmptyString ) :
453  DSNLEXER( keywords, keyword_count, aSExpression, aSource )
454  {
455  }
456 
466  SPECCTRA_LEXER( FILE* aFile, const wxString& aFilename ) :
467  DSNLEXER( keywords, keyword_count, aFile, aFilename )
468  {
469  }
470 
482  SPECCTRA_LEXER( LINE_READER* aLineReader ) :
483  DSNLEXER( keywords, keyword_count, aLineReader )
484  {
485  }
486 
491  static const char* TokenName( DSN::T aTok );
492 
504  {
505  return (DSN::T) DSNLEXER::NextTok();
506  }
507 
517  {
518  return (DSN::T) DSNLEXER::NeedSYMBOL();
519  }
520 
530  {
532  }
533 
539  {
540  return (DSN::T) DSNLEXER::CurTok();
541  }
542 
548  {
549  return (DSN::T) DSNLEXER::PrevTok();
550  }
551 };
552 
553 // example usage
554 
565 #endif // SPECCTRA_LEXER_H_
Class LINE_READER is an abstract class from which implementation specific LINE_READERs may be derived...
Definition: richio.h:81
Class SPECCTRA_LEXER is an automatically generated class using the TokenList2DnsLexer.cmake technology, based on keywords provided by file: /home/kicad/workspace/kicad-doxygen/pcbnew/specctra.keywords.
SPECCTRA_LEXER(const std::string &aSExpression, const wxString &aSource=wxEmptyString)
Constructor ( const std::string&, const wxString& )
This source file implements export and import capabilities to the specctra dsn file format...
Definition: specctra.cpp:62
DSN::T PrevTok()
Function PrevTok returns whatever NextTok() returned the 2nd to last time it was called.
int NeedSYMBOLorNUMBER()
Function NeedSYMBOLorNUMBER calls NextTok() and then verifies that the token read in satisfies bool I...
Definition: dsnlexer.cpp:418
SPECCTRA_LEXER(FILE *aFile, const wxString &aFilename)
Constructor ( FILE* ) takes aFile already opened for reading and aFilename as parameters.
T
enum T contains all this lexer's tokens.
int PrevTok()
Function PrevTok returns whatever NextTok() returned the 2nd to last time it was called.
Definition: dsnlexer.h:329
DSN::T NeedSYMBOLorNUMBER()
Function NeedSYMBOLorNUMBER calls NextTok() and then verifies that the token read in satisfies bool I...
int NeedSYMBOL()
Function NeedSYMBOL calls NextTok() and then verifies that the token read in satisfies bool IsSymbol(...
Definition: dsnlexer.cpp:409
static const KEYWORD keywords[]
Auto generated lexer keywords table and length:
int CurTok()
Function CurTok returns whatever NextTok() returned the last time it was called.
Definition: dsnlexer.h:320
DSN::T CurTok()
Function CurTok returns whatever NextTok() returned the last time it was called.
static const unsigned keyword_count
DSN::T NextTok()
Function NextTok returns the next token found in the input file or T_EOF when reaching the end of fil...
static const char * TokenName(DSN::T aTok)
Function TokenName returns the name of the token in ASCII form.
SPECCTRA_LEXER(LINE_READER *aLineReader)
Constructor ( LINE_READER* ) intializes a lexer and prepares to read from aLineReader which is assume...
DSN::T NeedSYMBOL()
Function NeedSYMBOL calls NextTok() and then verifies that the token read in satisfies bool IsSymbol(...
int NextTok()
Function NextTok returns the next token found in the input file or DSN_EOF when reaching the end of f...
Definition: dsnlexer.cpp:540
Struct KEYWORD holds a keyword string and its unique integer token.
Definition: dsnlexer.h:40
Class DSNLEXER implements a lexical analyzer for the SPECCTRA DSN file format.
Definition: dsnlexer.h:79