Skip to content

axmachado/simplepos

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Simple POS Compiler

CloudWalk® company had a very interesting idea about software development to POS terminals:

Let's create a domain specific language to hide the complexity of the terminal hardware and development environment and make the development easier for our customers.

But, when they implemented it, they came out with the not so interesting POSXML language.

The POSXML language have some unpleasant characteristics:

  • It's XML based (arghh)
  • It does not have a offline compiler
  • It does not have any compile time checking in the commands parameters (xml attributes)
  • It does not have the concept of local variables: even if their support says differently, in fact the variables are created in the order they are initialized in the source code and exists from this point on for all the program.
  • It does not support parameters for functions
  • It has a limit of 255 variables at all
  • It does not support arithmetic or logic expressions.

I'm sure anyone that must use POSXML will add a lot of things to this list.

When confronted with the need to develop an POS application to run in the CloudWalk platform, I've decided to try to minimize some of these problems and end up with an application that can be maintained with a little less effort, creating a compiler that takes programs writen in a more or less "organized" language and translates them into POSXML.

You must notice that, since the programs will end up as POSXML programs anyway, all the limitations of POSXML still apply. But I've managed to solve some of the biggest troubles with it:

  • Using the SimplePOS language (it has some "C" language inspired syntax), it's possible to split your program (or module) into a series of source files, and link this files into a single POSXML program. It will allow an easier reuse of functions.
  • The compiler takes care of the variable scopes, allowing the concept of local variables
  • The compiler is able to transform complex arithmetic and logical expressions in something that can be interpreted by the POSXML compiler.

This project is the SimplePOS compiler and linker, and I hope it's usefull to someone besides me.

Documentation of the SimplePOS language can be found in docs/language.md, the api documentation in docs/api.md and examples can be found in the examples directory.

Please, note that the program uses GPLv3 license, and if you use it you must release the source code of the compiler and the applications made using it, since the runtime generated by the compiler is covered by the license. Read the LICENSE file for more information.

About

SimplePOS Language to POSXML compiler

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages