release
dev builds
extras
themes manual
wiki
device status forums
mailing lists
IRC bugs
patches
dev guide



Search | Go
Wiki > Main > WpsTokenizerDEPRECATED (r1)

WPS tokenizer

Introduction

%W% This article is Work-in-progress

This page aims to explain the principles of the WPS tokenizer and give all the information needed to maintain and extend it.

Code structure explanation

The parser

The main function for WPS loading and parsing is wps_data_load(). It does the following:
  • reset the WPS data structure
  • copy the WPS source to the plugin buffer
  • parses the source
  • load the bitmaps

call_graph_parser.png

The renderer

call_graph_display.png

How to add a WPS tag

  • Add a new token to enum wps_token_type in gwps.h.
  • Add your token and the corresponding WPS tag to the all_tags array in wps_parser.c. If necessary, add a special parsing function that will be called when the tag is encountered.
  • Add a case for the new token to the switch in get_tag() in gwps-common.c.
  • Add a case for the new token to the switch in dump_wps_tokens() in wps_debug.c (this isn't vital but helpful).
Edit | Attach | Print version | History: r2 < r1 | Backlinks | View wiki text | More topic actions...
r1 - 05 Apr 2007 - 19:34:26 - NicolasPennequin
Copyright by the contributing authors.