• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Context free grammar by arithmetic expression

 
smith Matthew
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 5852
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic