[Newcompiler] [SmaCC] error handling

Mathieu Suen mathieusuen at yahoo.fr
Fri Sep 22 21:42:18 UTC 2006


Hi John,

Thanks for your previous answer about this topic. I am bit confuse with error handling:

When you have this grammar:

Expression
    : "(" Expression ")"
    | "(" Expression error {self signalError: 'Missing ")"' beforeToken: '2'}
    | "(" error {self signalError: 'Missing expression' beforeToken: '2'
"-- for an expression like ()"}
    | ...other rules...
    ;

What occur after #signalError:beforeToken: ?

Is there a way to continue parsing? (This could be usefull for syntax highlighting)

I have an others questions:

I have read your suggestion about #handleError:. So if I understand you, you propose to override
#handleError: in our Parser?

I don't see where you put:
(self actionFor: self rightParenthesisId) ~= self errorAction
	ifTrue: [self signalError: 'Missing ")" beforeToken: currentToken]

I have read the default implementation of #handleError: but I don't really understand how things go
on. Can #findErrorHandlerIfNoneUseErrorNumber: be usefull for error handling?

Thanks in advance

	Math

	

	
		
___________________________________________________________________________ 
Découvrez un nouveau moyen de poser toutes vos questions quelque soit le sujet ! 
Yahoo! Questions/Réponses pour partager vos connaissances, vos opinions et vos expériences. 
http://fr.answers.yahoo.com 



More information about the Newcompiler mailing list