This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes IDEs, Version Control and other tools and the fly likes Context free grammar by arithmetic expression Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Engineering » IDEs, Version Control and other tools
Bookmark "Context free grammar by arithmetic expression" Watch "Context free grammar by arithmetic expression" New topic
Author

Context free grammar by arithmetic expression

smith Matthew
Greenhorn

Joined: May 02, 2012
Posts: 1
Hey guys, first post on the forum, I have developed an arithmetic expression for a CFG for my computer science class, but i am getting the error "Editor does not contain main type". as helpful as that is, im not comprehending how to solve the problem.

any help would be greatly appreciated
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5823
    
    7

Smith, welcome to Java Ranch!

1) Which IDE are you using?

2) What is the name of the file that contains this source code?

Based on the error message, I assume you create a file name Editor.java (this is merely a guess).

Based on the code you posted, you should have placed this source code in a file name termProject.java. Why? Because you have a class name termProject and that class contains the main() method, and the file name should always correspond to the class name.

You also have two other classes in that file, which is OK for small projects like this, but since the termProjetc havs the main() method, that's the name you should use for the file. You could have also placed those two classes into their own files: Token.java and TokenType.java


JBoss In Action
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Context free grammar by arithmetic expression