Click here to Skip to main content
15,879,017 members
Articles / Programming Languages / Java

Create Your Own Programming Language

Rate me:
Please Sign up or sign in to vote.
4.87/5 (53 votes)
21 Jan 2010CPOL12 min read 486K   15.4K   87  
I've created my own programming language called Alef++ for fun, and for better understanding: What is a programing language? How does it work? Can I can create my own?
/* Generated By:JavaCC: Do not edit this line. St4ticConstants.java */
package st4tic;


/** 
 * Token literal values and constants.
 * Generated by org.javacc.parser.OtherFilesGen#start()
 */
public interface St4ticConstants {

  /** End of File. */
  int EOF = 0;
  /** RegularExpression Id. */
  int REQUERE = 6;
  /** RegularExpression Id. */
  int IF = 7;
  /** RegularExpression Id. */
  int WHILE = 8;
  /** RegularExpression Id. */
  int DO = 9;
  /** RegularExpression Id. */
  int STOP = 10;
  /** RegularExpression Id. */
  int DEF = 11;
  /** RegularExpression Id. */
  int DOT = 12;
  /** RegularExpression Id. */
  int COLON = 13;
  /** RegularExpression Id. */
  int EQ = 14;
  /** RegularExpression Id. */
  int GT = 15;
  /** RegularExpression Id. */
  int LT = 16;
  /** RegularExpression Id. */
  int GE = 17;
  /** RegularExpression Id. */
  int LE = 18;
  /** RegularExpression Id. */
  int NE = 19;
  /** RegularExpression Id. */
  int PLUS = 20;
  /** RegularExpression Id. */
  int MINUS = 21;
  /** RegularExpression Id. */
  int MUL = 22;
  /** RegularExpression Id. */
  int DIV = 23;
  /** RegularExpression Id. */
  int MOD = 24;
  /** RegularExpression Id. */
  int ASSIGN = 25;
  /** RegularExpression Id. */
  int INTEGER_LITERAL = 26;
  /** RegularExpression Id. */
  int IDENTIFIER = 27;
  /** RegularExpression Id. */
  int LETTER = 28;
  /** RegularExpression Id. */
  int DIGIT = 29;

  /** Lexical state. */
  int DEFAULT = 0;

  /** Literal token values. */
  String[] tokenImage = {
    "<EOF>",
    "\" \"",
    "\"\\t\"",
    "\"\\n\"",
    "\"\\r\"",
    "<token of kind 5>",
    "\"require\"",
    "\"if\"",
    "\"while\"",
    "\"do\"",
    "\"stop\"",
    "\"def\"",
    "\".\"",
    "\":\"",
    "\"==\"",
    "\">\"",
    "\"<\"",
    "\">=\"",
    "\"<=\"",
    "\"!=\"",
    "\"+\"",
    "\"-\"",
    "\"*\"",
    "\"/\"",
    "\"%\"",
    "\"=\"",
    "<INTEGER_LITERAL>",
    "<IDENTIFIER>",
    "<LETTER>",
    "<DIGIT>",
    "\"(\"",
    "\")\"",
    "\",\"",
  };

}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Technical Lead
Morocco Morocco
Adrabi!, Just another Ghost in the Shell =)

Comments and Discussions