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



Search | Go
Wiki > Main > WpsTokenizerDEPRECATED

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).

r3 - 02 Apr 2021 - 20:46:07 - UnknownUser

Copyright © by the contributing authors.