Click here to Skip to main content
15,880,392 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 JTB 1.3.2
//

package st4tic.syntaxtree;

/**
 * Grammar production:
 * f0 -> <IDENTIFIER>
 * f1 -> ( ":" <IDENTIFIER> )+
 * f2 -> "("
 * f3 -> MathExpression()
 * f4 -> ( "," MathExpression() )*
 * f5 -> ")"
 * f6 -> "."
 */
public class JavaStaticMethods implements Node {
   public NodeToken f0;
   public NodeList f1;
   public NodeToken f2;
   public MathExpression f3;
   public NodeListOptional f4;
   public NodeToken f5;
   public NodeToken f6;

   public JavaStaticMethods(NodeToken n0, NodeList n1, NodeToken n2, MathExpression n3, NodeListOptional n4, NodeToken n5, NodeToken n6) {
      f0 = n0;
      f1 = n1;
      f2 = n2;
      f3 = n3;
      f4 = n4;
      f5 = n5;
      f6 = n6;
   }

   public JavaStaticMethods(NodeToken n0, NodeList n1, MathExpression n2, NodeListOptional n3) {
      f0 = n0;
      f1 = n1;
      f2 = new NodeToken("(");
      f3 = n2;
      f4 = n3;
      f5 = new NodeToken(")");
      f6 = new NodeToken(".");
   }

   public void accept(st4tic.visitor.Visitor v) {
      v.visit(this);
   }
   public <R,A> R accept(st4tic.visitor.GJVisitor<R,A> v, A argu) {
      return v.visit(this,argu);
   }
   public <R> R accept(st4tic.visitor.GJNoArguVisitor<R> v) {
      return v.visit(this);
   }
   public <A> void accept(st4tic.visitor.GJVoidVisitor<A> v, A argu) {
      v.visit(this,argu);
   }
}

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