JWM Source Documentation
Data Structures | Typedefs | Enumerations | Functions
lex.h File Reference

XML lexer header file. More...

Go to the source code of this file.

Data Structures

struct  AttributeNode
 Structure to represent an XML attribute. More...
 
struct  TokenNode
 Structure to represent an XML tag. More...
 

Typedefs

typedef struct AttributeNode AttributeNode
 Structure to represent an XML attribute.
 
typedef struct TokenNode TokenNode
 Structure to represent an XML tag.
 

Enumerations

enum  TokenType {
  TOK_INVALID, TOK_ACTIVE, TOK_BACKGROUND, TOK_BUTTON,
  TOK_BUTTONCLOSE, TOK_BUTTONMAX, TOK_BUTTONMAXACTIVE, TOK_BUTTONMENU,
  TOK_BUTTONMIN, TOK_CLASS, TOK_CLOCK, TOK_CLOCKSTYLE,
  TOK_CLOSE, TOK_CORNER, TOK_DEFAULTICON, TOK_DESKTOP,
  TOK_DESKTOPS, TOK_DOCK, TOK_DOUBLECLICKDELTA, TOK_DOUBLECLICKSPEED,
  TOK_DYNAMIC, TOK_EXIT, TOK_FOCUSMODEL, TOK_FONT,
  TOK_FOREGROUND, TOK_GROUP, TOK_HEIGHT, TOK_ICONPATH,
  TOK_INCLUDE, TOK_JWM, TOK_KEY, TOK_KILL,
  TOK_LAYER, TOK_MAXIMIZE, TOK_MENU, TOK_MENUSTYLE,
  TOK_MINIMIZE, TOK_MOVE, TOK_MOVEMODE, TOK_NAME,
  TOK_OPACITY, TOK_OPTION, TOK_OUTLINE, TOK_PAGER,
  TOK_PAGERSTYLE, TOK_POPUP, TOK_POPUPSTYLE, TOK_PROGRAM,
  TOK_RESIZE, TOK_RESIZEMODE, TOK_RESTART, TOK_RESTARTCOMMAND,
  TOK_ROOTMENU, TOK_SENDTO, TOK_SEPARATOR, TOK_SHADE,
  TOK_SHUTDOWNCOMMAND, TOK_SNAPMODE, TOK_SPACER, TOK_STARTUPCOMMAND,
  TOK_STICK, TOK_SWALLOW, TOK_TASKLIST, TOK_TASKLISTSTYLE,
  TOK_TEXT, TOK_TRAY, TOK_TRAYBUTTON, TOK_TRAYBUTTONSTYLE,
  TOK_TRAYSTYLE, TOK_WIDTH, TOK_WINDOWSTYLE
}
 Tokens. More...
 

Functions

TokenNodeTokenize (const char *line, const char *fileName)
 Tokenize a buffer.
 
const char * GetTokenName (const TokenNode *tp)
 Get a string represention of a token.
 
const char * GetTokenTypeName (TokenType type)
 Get a string represention of a token.
 
void ReleaseTokens (TokenNode *np)
 Release token nodes.
 

Detailed Description

XML lexer header file.

Author
Joe Wingbermuehle
Date
2004-2006

Definition in file lex.h.

Typedef Documentation

typedef struct AttributeNode AttributeNode

Structure to represent an XML attribute.

typedef struct TokenNode TokenNode

Structure to represent an XML tag.

Enumeration Type Documentation

enum TokenType

Tokens.

Enumerator:
TOK_INVALID 
TOK_ACTIVE 
TOK_BACKGROUND 
TOK_BUTTON 
TOK_BUTTONCLOSE 
TOK_BUTTONMAX 
TOK_BUTTONMAXACTIVE 
TOK_BUTTONMENU 
TOK_BUTTONMIN 
TOK_CLASS 
TOK_CLOCK 
TOK_CLOCKSTYLE 
TOK_CLOSE 
TOK_CORNER 
TOK_DEFAULTICON 
TOK_DESKTOP 
TOK_DESKTOPS 
TOK_DOCK 
TOK_DOUBLECLICKDELTA 
TOK_DOUBLECLICKSPEED 
TOK_DYNAMIC 
TOK_EXIT 
TOK_FOCUSMODEL 
TOK_FONT 
TOK_FOREGROUND 
TOK_GROUP 
TOK_HEIGHT 
TOK_ICONPATH 
TOK_INCLUDE 
TOK_JWM 
TOK_KEY 
TOK_KILL 
TOK_LAYER 
TOK_MAXIMIZE 
TOK_MENU 
TOK_MENUSTYLE 
TOK_MINIMIZE 
TOK_MOVE 
TOK_MOVEMODE 
TOK_NAME 
TOK_OPACITY 
TOK_OPTION 
TOK_OUTLINE 
TOK_PAGER 
TOK_PAGERSTYLE 
TOK_POPUP 
TOK_POPUPSTYLE 
TOK_PROGRAM 
TOK_RESIZE 
TOK_RESIZEMODE 
TOK_RESTART 
TOK_RESTARTCOMMAND 
TOK_ROOTMENU 
TOK_SENDTO 
TOK_SEPARATOR 
TOK_SHADE 
TOK_SHUTDOWNCOMMAND 
TOK_SNAPMODE 
TOK_SPACER 
TOK_STARTUPCOMMAND 
TOK_STICK 
TOK_SWALLOW 
TOK_TASKLIST 
TOK_TASKLISTSTYLE 
TOK_TEXT 
TOK_TRAY 
TOK_TRAYBUTTON 
TOK_TRAYBUTTONSTYLE 
TOK_TRAYSTYLE 
TOK_WIDTH 
TOK_WINDOWSTYLE 

Definition at line 14 of file lex.h.

Function Documentation

const char* GetTokenName ( const TokenNode tp)

Get a string represention of a token.

This is identical to GetTokenTypeName if tp is a valid token.

Parameters
tpThe token node.
Returns
The name (never NULL).

Definition at line 523 of file lex.c.

References GetTokenTypeName(), TokenNode::invalidName, and TokenNode::type.

Referenced by InvalidTag(), Parse(), ParseMenuItem(), ParseTokenValue(), and Tokenize().

const char* GetTokenTypeName ( TokenType  type)

Get a string represention of a token.

Parameters
typeThe token.
Returns
The name (never NULL).

Definition at line 533 of file lex.c.

References FindKey(), and TOKEN_MAP_COUNT.

Referenced by GetTokenName(), and InvalidTag().

void ReleaseTokens ( TokenNode np)
TokenNode* Tokenize ( const char *  line,
const char *  fileName 
)

Tokenize a buffer.

Parameters
lineThe buffer to tokenize.
fileNameThe name of the file for error reporting.
Returns
A linked list of tokens from the buffer.

Definition at line 125 of file lex.c.

References _, CreateAttribute(), CreateNode(), GetTokenName(), head, IsSpace(), JLIKELY, JUNLIKELY, LookupType(), AttributeNode::name, TokenNode::parent, ReadAttributeValue(), ReadElementName(), ReadElementValue(), Reallocate, Release, TokenNode::type, AttributeNode::value, TokenNode::value, and Warning().

Referenced by TokenizeFile(), and TokenizePipe().

joewing.net / Projects / JWM