There are two kinds of errors that Basis can find.

  • Syntax errors occur during the parsing of input code, and are caused by grammatically incorrect statements.
    Typical errors might be an illegal character in the input, a missing operator, two operators in a row,
    two statements on the same line with no intervening semicolon, unbalanced parentheses, a misplaced reserved word, etc.

  •  Semantic errors occur during the execution of the code, after it has been parsed as grammatically correct.
    These have to do not with how statements are constructed, but with what they mean.
    Such things as incorrect variable types or sizes, nonexistent variables, subscripts out of range, and the like, are semantic errors.

Basis is a single-pass  parser, that is, it looks at its input only once.

It also is a one-look ahead  parser, meaning that at the most it is never looking more than one symbol ahead of the current context.

By the time a syntax error has been detected, it is likely that a lot of the context information to the left of the error has already been lost.

The diagnostic information that Basis gives attempts to be as useful as possible,

but because of the very limited context information available, it is far from perfect.

Semantic errors are often possible to diagnose more precisely.

We have attempted to make the semantic error information supplied as useful as possible.

Sometimes some of the information is only useful to someone familiar with the internals of Basis;

but we hope that in most cases it will help you find your error.

Syntax Error:

error due to missing colon, semicolon, parenthesis, etc.

Syntax is the way in which we construct sentences by following principles and rules.

Example: In C++, it would be a syntax error to say

int x = "five";

This will not compile because it does not follow the syntax of the language and does not make any sense to the compiler.

Semantic Error:

it is a logical error. it is due to wrong logical statements.

Semantics is the interpretations of and meanings derived from the sentence transmission and understanding of the message.

Semantics errors are Logical, while Syntax errors are code errors.

Example: A semantic error would compile, but be incorrect logically:

const int pi = 12345;

Your program will likely compile and run without error but your results will be incorrect.

(Note that these types of errors are usually much harder to debug)

Syntactic and Semantic Errors的更多相关文章

  1. Type Systems

    This section deals with more theoretical aspects of types. A type system is a set of rules used by a ...

  2. Understanding Tensorflow using Go

    原文: https://pgaleone.eu/tensorflow/go/2017/05/29/understanding-tensorflow-using-go/ Tensorflow is no ...

  3. 2016年最新mac下vscode配置golang开发环境支持debug

    网上目前还找不到完整的mac下golang环境配置支持,本人配置成功,现在整理分享出来. mac最好装下xcode,好像有依赖关系安装Homebrew打开终端窗口, 粘贴脚本执行/usr/bin/ru ...

  4. coffeescript 1.8.0 documents

    CoffeeScript is a little language that compiles into JavaScript. Underneath that awkward Java-esque ...

  5. 6.00.1x Introduction to computation

    6.00 Introduction to Computer Science                  and  Programming • Goal: –Become skillful at ...

  6. Word2vec教程

    Word2vec Tutorial RADIM ŘEHŮŘEK 2014-02-02GENSIM, PROGRAMMING157 COMMENTS I never got round to writi ...

  7. coursera课程Text Retrieval and Search Engines之Week 1 Overview

    Week 1 OverviewHelp Center Week 1 On this page: Instructional Activities Time Goals and Objectives K ...

  8. 【DeepLearning】一些资料

    记录下,有空研究. http://nlp.stanford.edu/projects/DeepLearningInNaturalLanguageProcessing.shtml http://nlp. ...

  9. Chapter 4 Syntax Analysis

    Chapter 4 Syntax Analysis This chapter is devoted to parsing methods that are typically used in comp ...

随机推荐

  1. Anaconda+django写出第一个web app(六)

    今天学习如何写一个注册用户的界面. 上一节的导航栏中我们修改了导航栏右侧的文字为register并将路径设置为/register,内容如下: <li><a href="/r ...

  2. 第二篇:服务消费者(rest + ribbon)

    一. ribbon简介 ribbon是一个负载均衡客户端,可以很好的控制http和tcp的一些行为,Feign也用到了ribbon,当你使用@ FeignClient,ribbon自动被应用. Rib ...

  3. Struts2不扫描jar包中的action

    今天在做一个二开的项目,将struts打成jar包放在WEB-INF的目录下却扫描不到指定的路径,也就是http访问访问不到我们指定的action,其他代码可以正常使用,就是访问不到action.st ...

  4. input文本框禁止修改文本——disabled和readonly属性的作用及区别

    1.input文本框禁止修改文本 disabled属性:<input type="text" name="name" value="xxx&qu ...

  5. 走进异步编程的世界--async/await项目使用实战

    起因:今天要做一个定时器任务:五分钟查询一次数据库发现超时未支付的订单数据将其状态改为已经关闭(数据量大约100条的情况) 开始未使用异步: public void SelfCloseGpPayOrd ...

  6. 如何计算 App 的启动时间

    应用启动场景 事实上 Android 中一个 App 的启动时间可以准确计算的.但是要分场景.也就是说要分开游戏和应用. 大家都知道,在Android中,游戏开发和应用开发是两码事.所以我们需要分开来 ...

  7. APP的CPU,内存,耗电,流量测试工具

    APP的CPU,内存,耗电,流量测试工具下载地址,后续文章会介绍如何使用Emmagee.itest.gt APP应用的CPU,内存,耗电,流量调查 可和同类产品比较,使用GT等工具:CPU靠syste ...

  8. linux服务器安装anaconda,然后远程使用jupyter

    linux服务器安装anaconda: 1.1 下载安装脚本: wget https://repo.anaconda.com/archive/Anaconda3-5.2.0-Linux-x86_64. ...

  9. Vue零散知识点

    1.vue中的<router-view></router-view>的作用,它是和vue的路由相结合的,它的作用是将路由匹配到的组件渲染在里面.比如说你要跳转,如何没有< ...

  10. Java基础91 mysql的用户权限设置问题

    1.概述 1)MySQL数据库中root用户具有最高的权限(超级用户),可以对任何数据库,任何表进行操作. 2)权限账户,只拥有部分权限(CRUD) .例如:只能操作某个数据库的某张表等等. 2.my ...