Giter Site home page Giter Site logo

cc_smc's Issues

Consideration: Parameterized events

I've thought of a FSM representing a simple handheld calculator. With the current SMC, the definition would be really cumbersome and difficult to build, because each button (digit) press would require a different event. It would be great to have a way to mitigate this problem, but I wonder if that's a good idea or not.

In this case, events should have some kind of optional payload, so the keypad_pressed event can produce an action consuming the payload of that event like in this:

	AwaitingInput 
	{
		OnDigitKeyPress[x]		AwaitingInput		AppendInput[x]
                ...
	}	

This way, upon the code generation stage, the code could pass the parameter x to the AppendInput action.

Anyways, building a FSM like this with the SMC is still complex, since pressing an operation key in the calculator will lead you to a different operation state depending on the key, and there may be lots of different operations :)

As I said, it's just a consideration. Maybe somebody could come up with a good approach to use case.

Thanks for reading :)

C example build fails on Linux w/case sensitivity issues

Script started on Fri 06 Apr 2018 10:58:57 AM PDT
$ cd CC_SMC-master/
$ ant compile
Buildfile: /home/dbrower/src/CC_SMC-master/build.xml

compile:
[mkdir] Created dir: /home/dbrower/src/CC_SMC-master/build/classes
[javac] /home/dbrower/src/CC_SMC-master/build.xml:8: warning: 'includeantruntime' was not set, defaulting to build.sysclasspath=last; set to false for repeatable builds
[javac] Compiling 33 source files to /home/dbrower/src/CC_SMC-master/build/classes
[javac] Note: /home/dbrower/src/CC_SMC-master/src/smc/SMC.java uses unchecked or unsafe operations.
[javac] Note: Recompile with -Xlint:unchecked for details.

BUILD SUCCESSFUL
Total time: 2 seconds
$ and jar
bash: and: command not found
$ ant jar
Buildfile: /home/dbrower/src/CC_SMC-master/build.xml

compile:
[javac] /home/dbrower/src/CC_SMC-master/build.xml:8: warning: 'includeantruntime' was not set, defaulting to build.sysclasspath=last; set to false for repeatable builds

jar:
[mkdir] Created dir: /home/dbrower/src/CC_SMC-master/build/jar
[jar] Building jar: /home/dbrower/src/CC_SMC-master/build/jar/smc.jar

BUILD SUCCESSFUL
Total time: 0 seconds
$ cd TE��[K��[Ktest_cases/
$ cd c_turnstile/
$ make
rm -f turnstile_test *.o twoCoinTurnstile.h twoCoinTurnstile.c
java -jar ../../build/jar/smc.jar -l C twoCoinTurnstile.sm
Compiled with 0 syntax errors.
cc -c -o turnstile_test.o turnstile_test.c
turnstile_test.c:5:30:fatal error: twoCoinTurnstile.h: No such file or directory
#include "twoCoinTurnstile.h"
^
compilation terminated.
make: *** [turnstile_test.o] Error 1
$ ls
makefile turnstile.h twocointurnstile.c twoCoinTurnstile.sm
turnstileActions.h turnstile_test.c twocointurnstile.h
$ make twoCoinTurnstile.h
java -jar ../../build/jar/smc.jar -l C twoCoinTurnstile.sm
Compiled with 0 syntax errors.
$ ls
makefile turnstile.h twocointurnstile.c twoCoinTurnstile.sm
turnstileActions.h turnstile_test.c twocointurnstile.h
$ make
rm -f turnstile_test *.o twoCoinTurnstile.h twoCoinTurnstile.c
java -jar ../../build/jar/smc.jar -l C twoCoinTurnstile.sm
Compiled with 0 syntax errors.
cc -c -o turnstile_test.o turnstile_test.c
turnstile_test.c:5:30:fatal error: twoCoinTurnstile.h: No such file or directory
#include "twoCoinTurnstile.h"
^
compilation terminated.
make: *** [turnstile_test.o] Error 1

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.