Skip to content
Snippets Groups Projects
Commit 8899bdf5 authored by Jan Trávníček's avatar Jan Trávníček
Browse files

make identifiers include digits

parent bae4a1f4
No related branches found
No related tags found
No related merge requests found
Pipeline #
...@@ -45,7 +45,7 @@ L1: ...@@ -45,7 +45,7 @@ L1:
character = in.get(); character = in.get();
if(in.eof()) { if(in.eof()) {
return token; return token;
} else if((character >= 'a' && character <= 'z') || (character >= 'A' && character <= 'Z') ) { } else if ( ( character >= 'a' && character <= 'z' ) || ( character >= 'A' && character <= 'Z' ) || ( character >= '0' && character <= '9' ) ) {
token.value += character; token.value += character;
token.raw += character; token.raw += character;
goto L1; goto L1;
......
...@@ -31,7 +31,7 @@ template < class SymbolType, class RankType > ...@@ -31,7 +31,7 @@ template < class SymbolType, class RankType >
void TreeToStringComposerCommon::compose ( std::ostream & out, const ext::tree < common::ranked_symbol < SymbolType, RankType> > & node ) { void TreeToStringComposerCommon::compose ( std::ostream & out, const ext::tree < common::ranked_symbol < SymbolType, RankType> > & node ) {
alib::stringApi < SymbolType >::compose ( out, node.getData ( ).getSymbol ( ) ); alib::stringApi < SymbolType >::compose ( out, node.getData ( ).getSymbol ( ) );
   
out << ext::to_string ( node.getData ( ).getRank ( ) ); out << " " << ext::to_string ( node.getData ( ).getRank ( ) );
   
for ( const ext::tree < common::ranked_symbol < SymbolType, RankType > > & child : node ) { for ( const ext::tree < common::ranked_symbol < SymbolType, RankType > > & child : node ) {
out << " "; out << " ";
...@@ -46,7 +46,7 @@ void TreeToStringComposerCommon::compose ( std::ostream & out, const common::ran ...@@ -46,7 +46,7 @@ void TreeToStringComposerCommon::compose ( std::ostream & out, const common::ran
} else { } else {
alib::stringApi < SymbolType >::compose ( out, node.getData ( ).getSymbol ( ) ); alib::stringApi < SymbolType >::compose ( out, node.getData ( ).getSymbol ( ) );
   
out << ext::to_string ( node.getData ( ).getRank ( ) ); out << " " << ext::to_string ( node.getData ( ).getRank ( ) );
   
for ( const ext::tree < common::ranked_symbol < SymbolType, RankType > > & child : node ) { for ( const ext::tree < common::ranked_symbol < SymbolType, RankType > > & child : node ) {
out << " "; out << " ";
......
...@@ -23,7 +23,7 @@ void TreeTest::tearDown ( ) { ...@@ -23,7 +23,7 @@ void TreeTest::tearDown ( ) {
   
void TreeTest::testEqual ( ) { void TreeTest::testEqual ( ) {
{ {
std::string input = "RANKED_TREE a0"; std::string input = "RANKED_TREE a 0";
tree::Tree tree = alib::StringDataFactory::fromString ( input ); tree::Tree tree = alib::StringDataFactory::fromString ( input );
   
std::string output = alib::StringDataFactory::toString ( tree ); std::string output = alib::StringDataFactory::toString ( tree );
...@@ -49,7 +49,7 @@ void TreeTest::testEqual ( ) { ...@@ -49,7 +49,7 @@ void TreeTest::testEqual ( ) {
CPPUNIT_ASSERT ( tree == tree2 ); CPPUNIT_ASSERT ( tree == tree2 );
} }
{ {
std::string input = "RANKED_TREE a2 a0 a1 a0"; std::string input = "RANKED_TREE a 2 a 0 a 1 a 0";
tree::Tree tree = alib::StringDataFactory::fromString ( input ); tree::Tree tree = alib::StringDataFactory::fromString ( input );
   
std::string output = alib::StringDataFactory::toString ( tree ); std::string output = alib::StringDataFactory::toString ( tree );
...@@ -73,7 +73,7 @@ void TreeTest::testEqual ( ) { ...@@ -73,7 +73,7 @@ void TreeTest::testEqual ( ) {
CPPUNIT_ASSERT ( tree == tree2 ); CPPUNIT_ASSERT ( tree == tree2 );
} }
{ {
std::string input = "RANKED_PATTERN a2 #S a1 a0"; std::string input = "RANKED_PATTERN a 2 #S a 1 a 0";
tree::Tree tree = alib::StringDataFactory::fromString ( input ); tree::Tree tree = alib::StringDataFactory::fromString ( input );
   
std::string output = alib::StringDataFactory::toString ( tree ); std::string output = alib::StringDataFactory::toString ( tree );
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment