Permalink
Browse files

Removed some debugging.

  • Loading branch information...
1 parent 9aa0915 commit 52d385db52c634984431ec2a70613fe07f21790d @navstev0 committed Oct 21, 2011
Showing with 15 additions and 2 deletions.
  1. +1 −1 examples/calculator/calc.calc
  2. +3 −0 lib/compiler.js
  3. +11 −1 lib/parser.js
@@ -1,3 +1,3 @@
1+1
-2+2
+2+a
222+222
View
@@ -24,6 +24,7 @@ exports.Compiler = function( ){
_interpreter.AddTokenEventByName( i, _eventObject[i] );
}
}
+
/////////////////////
//////PRIVATE VARIABLES//
/////////////////////
@@ -99,6 +100,7 @@ exports.Compiler = function( ){
"_literalCharDoubleQuotes":'i.Or( r._anyLiteralChar, \'\\\\"\', "\'" )',
"_anyLiteralChar":'i.Or( i.CharGroup( " ", "!" ), i.CharGroup( "#", "&" ), i.CharGroup( "(", "[" ), i.CharGroup( "]", "~" ) )'
};
+
///////////////////
//////PRIVATE METHODS//
///////////////////
@@ -216,6 +218,7 @@ exports.Compiler = function( ){
return Output[0];
}
};
+
//////////////////
//////PUBLIC METHODS//
//////////////////
View
@@ -22,6 +22,7 @@ exports.LanguageObject = function( ){
_name = name;
this.WriteRule( "script", this.And( this.syntaxObject.syntax, { name:'endOfFile', method:function( token, script ){ return ( token.charPtr + token.length == script.endOfSource ); } } ) );
};
+
/////////////////////
//////PRIVATE VARIABLES//
/////////////////////
@@ -40,6 +41,7 @@ exports.LanguageObject = function( ){
* @type Associative Array
*/
var _tokenIdList = {};
+
///////////////////
//////PRIVATE METHODS//
///////////////////
@@ -63,6 +65,7 @@ exports.LanguageObject = function( ){
}
return argumentArray;
};
+
////////////////////
//////PUBLIC VARIABLES//
////////////////////
@@ -77,6 +80,7 @@ exports.LanguageObject = function( ){
* @type Associative Array
*/
this.syntaxObject = { script:{ id: 0 }, syntax:{ id:1 } };
+
//////////////////
//////PUBLIC METHODS//
//////////////////
@@ -301,6 +305,7 @@ Script = function( ){
this.settings = scriptSettings;
this.rawScript = scriptSettings.rawScript;
};
+
/////////////////////
//////PRIVATE VARIABLES//
/////////////////////
@@ -314,6 +319,7 @@ Script = function( ){
* @type {LanguageObject}
*/
var _interpreter = null;
+
////////////////////
//////PUBLIC VARIABLES//
////////////////////
@@ -337,6 +343,7 @@ Script = function( ){
* @type Object
*/
this.settings = null;
+
//////////////////
//////PUBLIC METHODS//
//////////////////
@@ -409,6 +416,7 @@ Token = function(){
this.id = tokenId;
this.charPtr = tokenCharPtr;
};
+
////////////////////
//////PUBLIC VARIABLES//
////////////////////
@@ -497,6 +505,7 @@ exports.parser = function(){
_interpreter = interpreter;
_rl = _interpreter.ruleList;
};
+
/////////////////////
//////PRIVATE VARIABLES//
/////////////////////
@@ -516,6 +525,7 @@ exports.parser = function(){
* @type Object
*/
var _rl = null;
+
///////////////////
//////PRIVATE METHODS//
///////////////////
@@ -588,7 +598,6 @@ exports.parser = function(){
* @param Token ruleToken - The top of the token tree to report the error on.
*/
this.GetErrorOutput = function( ruleToken, scriptSettings ){
- console.log( "Script didn't evaluate correctly." );
var failedOutput = _ErrorExpactation.call( this, ruleToken.expected );
console.log( "Failed @line:" + failedOutput.line + " @charicter:" + failedOutput.charPtr );
console.log( "Expected tokens [" + failedOutput.tokenArray.join( "," ) + "]" );
@@ -772,6 +781,7 @@ exports.parser = function(){
return script;
};
+
////////////////////
//////PUBLIC VARIABLES//
////////////////////

0 comments on commit 52d385d

Please sign in to comment.