Ejemplo n.º 1
0
        public SourceCompiler()
        {
            var keywords = new ObservableCollection <string>()
            {
                "procedure", "var", "Byte", "Char", "array", "of", "Longint", "String", "Begin", "if", "and", "then", "else", "End", "or"
            };
            var delimiters1 = new ObservableCollection <string>()
            {
                ".", ";", ":", "[", "]", "=", "(", ")", ",", "-", ">", "<"
            };
            var delimiters2 = new ObservableCollection <string>()
            {
                "..", ":="
            };
            var delimiterString = '\'';

            Scanner      = new Scanner(keywords, delimiters1, delimiters2, delimiterString);
            WfpGenerator = new WfpGenerator();
            Parser       = new Parser(Scanner, WfpGenerator);
        }
Ejemplo n.º 2
0
 public Parser(Scanner scanner, WfpGenerator wfpGenerator)
 {
     lexemes = scanner.Lexemes;
     wfp     = wfpGenerator;
 }