I have a following simple format:
BLOCK ID {
SUBBLOCK ID {
SUBSUBBLOCK ID {
SOME STATEMENTS;
};
};
};
I configured ply to work with this format. But the issue is that ID could be any string including "BLOCK", "SUBBLOCK", etc.
In the lexer I define ID as:
@TOKEN(r'[a-zA-Z_][a-zA-Z_0-9]*')
def t_ID(self, t):
t.type = self.keyword_map.get(t.value, "ID")
return t
But it means that BLOCK word will not be allowed as a block name.
I have a following simple format: BLOCK ID { SUBBLOCK ID { SUBSUBBLOCK ID { SOME STATEMENTS; }; }; };
I configured ply to work with this format. But the issue is that ID could be any string including "BLOCK", "SUBBLOCK", etc. In the lexer I define ID as:
But it means that BLOCK word will not be allowed as a block name.
How I can overcome this issue?