Esempio n. 1
0
 private void SetupDefaultKeywords()
 {
     _defaultKeywords.ClearKeywords();
     _defaultKeywords.AddKeyword(new DcKeyword("required", 1));
     _defaultKeywords.AddKeyword(new DcKeyword("broadcast", 1 << 1));
     _defaultKeywords.AddKeyword(new DcKeyword("ownrecv", 1 << 2));
     _defaultKeywords.AddKeyword(new DcKeyword("ram", 1 << 3));
     _defaultKeywords.AddKeyword(new DcKeyword("db", 1 << 4));
     _defaultKeywords.AddKeyword(new DcKeyword("clsend", 1 << 5));
     _defaultKeywords.AddKeyword(new DcKeyword("clrecv", 1 << 6));
     _defaultKeywords.AddKeyword(new DcKeyword("ownsend", 1 << 7));
     _defaultKeywords.AddKeyword(new DcKeyword("airecv", 1 << 8));
 }
Esempio n. 2
0
        public bool AddKeyword(string name)
        {
            var keyword = new DcKeyword(name);
            var added   = _keywords.AddKeyword(keyword);

            if (added)
            {
                _declarations.Add(keyword);
            }

            return(added);
        }
Esempio n. 3
0
        private void ReadKeywordsIntoList(DcParser.Keyword_listContext?context, DcKeywordList into)
        {
            while (context != null)
            {
                if (!_dcFile.TryGetKeyword(context.keyword.Text, out var keyword))
                {
                    throw new Exception($"Unknown keyword: {context.keyword.Text}");
                }

                into.AddKeyword(keyword);
                context = context.next;
            }
        }