please dont rip this site

Keyword Interpreter Code Generator

Keywords List


Whitespaces:
Delimeters:
Case insensitive
Whole words match


Description

This code generator produces the PIC assembler code to look for keywords in a string or a serial ASCII stream.

Parsing routine receives one character at a time and returns the keyword code, or the next state, or error code. The keywords codes are given in the order they were written, starting from 1.

You can specify whether keywords are matched as the whole words or just starting unique part. This let's you use shorthand names for the keywords. Also, case insensitiveness can be specified.

The routine can skip whitespaces before a keyword. Enter the desired characters in the form entry Whitespaces. In some cases it's probably better to delete carriage return (0x0d) or line feed (0x0a) characters if you don't need them, or add some others. To detect the end of a keyword the routine needs to know what characters separate keywords in the text stream (form entry Delimiters). Often, they are the same as whitespaces, but you might want to add '\0' to work with zero terminated strings, or '(' in case the keyword is a function name, e.g. Speed(100). A delimiter character is received as a look-ahead character after a keyword matched to make sure that the keyword ended.



The routine is implemented as a variation of state machine, without explicit tables. The routine is a relatively fast runner, since it compares a character to a minimum number of constant characters, just enough to disambiguate the text meaning.

The size of the generated code is directly related to the number of keywords and their length. It takes about four instructions of program memory per each character in the text area plus jump table and a couple of small routines.

See example on how to call the parsing routine.


See:

See also:


file: /Techref/piclist/codegen/keyword_interpreter.htm, 3KB, , updated: 2013/7/25 11:13, local time: 2017/12/15 15:29,
TOP NEW HELP FIND: 
54.221.76.68:LOG IN

 ©2017 These pages are served without commercial sponsorship. (No popup ads, etc...).Bandwidth abuse increases hosting cost forcing sponsorship or shutdown. This server aggressively defends against automated copying for any reason including offline viewing, duplication, etc... Please respect this requirement and DO NOT RIP THIS SITE. Questions?
Please DO link to this page! Digg it! / MAKE! / 

<A HREF="http://www.piclist.com/techref/piclist/codegen/keyword_interpreter.htm"> Keyword Interpreter Code Generator</A>

After you find an appropriate page, you are invited to your to this massmind site! (posts will be visible only to you before review) Just type in the box and press the Post button. (HTML welcomed, but not the <A tag: Instead, use the link box to link to another page. A tutorial is available Members can login to post directly, become page editors, and be credited for their posts.


Link? Put it here: 
if you want a response, please enter your email address: 
Attn spammers: All posts are reviewed before being made visible to anyone other than the poster.
Did you find what you needed?

  PICList 2017 contributors:
o List host: MIT, Site host massmind.org, Top posters @20171215 RussellMc, Van Horn, David, Sean Breheny, James Cameron, alan.b.pearce, IVP, Neil, Bob Blick, David C Brown, John Gardner,
* Page Editors: James Newton, David Cary, and YOU!
* Roman Black of Black Robotics donates from sales of Linistep stepper controller kits.
* Ashley Roll of Digital Nemesis donates from sales of RCL-1 RS232 to TTL converters.
* Monthly Subscribers: Gregg Rew. on-going support is MOST appreciated!
* Contributors: Richard Seriani, Sr.
 

Welcome to www.piclist.com!

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

  .