private static void CallBeginRule(string lineOfCode, int lineNumber) { var isAssignRule = BnfRules.BeginRule(lineOfCode); if (!isAssignRule) { throw new Exception(String.Format("Failed to compile. Error on line: {0}", lineNumber)); } }
private static void CallProcedureRule(string lineOfCode, int lineNumber) { //var linesOfCode = lineOfCode.Split(' '); //var list = linesOfCode.ToList(); //list.RemoveAll(string.IsNullOrEmpty); var isAssignRule = BnfRules.ProcedureRule(lineOfCode); if (!isAssignRule) { throw new Exception(String.Format("Failed to compile. Error on line: {0}", lineNumber)); } }
private static void CallAsignmentRule(string lineOfCode, int lineNumber) { var splittedLineOfCode = lineOfCode.Split(';'); var list = splittedLineOfCode.ToList(); list.RemoveAll(string.IsNullOrEmpty); var isAssignRule = BnfRules.AsignmentRule(list.ToArray()); if (!isAssignRule) { throw new Exception(String.Format("Failed to compile. Error on line: {0}", lineNumber)); } }