The AutoRepsonder is a domain-specific language (DSL) designed for people who want to create a simple textual, interactive and customised autoresponder or menu based on their needs and use it to offer services to users or customers. With AutoResponder, you can create your very own interactive menus in a second. Our AutoResponder developed based on Xtext has a sophisticated Eclipse-based development environment providing almost the same editing experience as Java IDEs.
- Open Eclipse and use
git
to import 5 following projects called.autoresponder
,.ide
,.ui
,.ui.tests
and.tests
. - You may meet some configuration problems, I already attach all the essential directories into the project. The only thing you should pay attention to is the dependencies of META-INF. You may need to change the version number to suits your installed Xtext version.
- After all setup, you can start at
.autoresponder
project. FindAutoResponder.xtext
in/src
file and run it as "Generate Xtext Artifacts". If there is no error showing in the console and there is a "Done" showing at the end, it means that the setting is all done. However, there may be some.java
files generated by Xtext in.autoresponder
and.ui
projects. You can find them and delete them directly. Then, all the settings are done. - Double clicks on
.autoresponder
to run as Eclipse Application. Set a new and clean workspace for this runtime Eclipse. - When the runtime eclipse is opened, use
git
to import 2 following projects calledTestAutoResponder
and.xpect
. One is sample project and the other one is test project. You can explore it yourself now!
The program consists of 4 basic statements. In order to use them, there is a strict order to follow. The order for basic statements is InstructStatement, HearStatement, TriggerStatement and ActivityStatement. The way to establish the menu are shown below:
- First, you need to define what you want to show in the start of the menu, for example, by using
Instruct -> "This is a test."
. - Second, there is a compulsory input command to put behind all the InstructStatement, which is
WaitForInput 0
. The value here represents the root reponder menu. We start at 0. Every time we go into a sub-menu (an ActivityStatement), the value should add 1. - Then, it is time to set the TriggerStatement and ActivityStatement. If we want to use "start" to trigger the main menu, the rules are as follows:
Input(start) -> Main
Activity Main: on "start" {
// Here is a new sub-menu called Main
}
- The structure within an Activity is the same as shown above.
- There are also other demo statements in the program, such as
transferManual -> "+441800000000"
meaning invoke system to make a call to this phone number. You can use Content Assist to help you. - Attention: In our DSL, you don't need to worry about stucking in the menu you generated. There is a default command inserted. By using
Back
command, you can always back to the last parent menu. In the initial menu, you can useexit
to exit the menu system. Illegal input checking is also default in the generated program.
A little demonstration of what a structure looks like:
Instruct -> "Welcome to the test system!"
WaitForInput 0
Input(Test) -> TestMain
Activity TestMain: on "Test" {
Instruct -> "TestMain menu is opening!"
WaitForInput 1
Input(Tec) -> TechSupport
Activity TechSupport: on "Tec" {
Instruct -> "Change toManual service"
WaitForInput 2
transferManual -> "+441800000000"
}
}