Index: toltcl/generic/tolaccess.cpp
===================================================================
--- toltcl/generic/tolaccess.cpp	(revision 2f5c82f10674773e7f3c0b4a39a6b070b3cf041a)
+++ toltcl/generic/tolaccess.cpp	(revision ab6d232f3c6b0b9694d79d115243812236c1b548)
@@ -42,4 +42,5 @@
 #include <tol/tol_btxtgra.h>
 #include <tol/tol_bmethodhook.h>
+#include <tol/tol_bparser.h>
 
 #include <toltclInt.h>
@@ -1879,4 +1880,27 @@
 }
 
+int Tol_CheckSyntax(Tcl_Interp * interp,
+                    Tcl_Obj    * obj_expr,
+                    Tcl_Obj    * obj_result)
+{
+  Tcl_DString dstr;
+  BText tol_expr;
+
+  Tcl_DStringInit(&dstr);
+  tol_expr = Tcl_UtfToExternalDString( NULL, Tcl_GetString( obj_expr ),
+                                       -1, &dstr );
+  Tcl_DStringFree(&dstr);
+  
+  BBool stat = BOut::ErrorHci();
+  BOut::PutErrorHci(BFALSE);
+  BParser* parser = new BParser;
+  Tree* tree = parser->Parsing( tol_expr );
+  Tcl_SetStringObj( obj_result, parser->MessageError(), -1 );
+  delete parser;
+  BOut::PutErrorHci( stat );
+  DESTROY(tree);
+  return TCL_OK;
+}
+
 /*
  * Fill in obj_result the result of evaluating including the file
